Skip to main content

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::redundant_explicit_links)]
19
20/// Implements a client for the Google Compute Engine API.
21///
22/// # Example
23/// ```
24/// # use google_cloud_compute_v1::client::AcceleratorTypes;
25/// async fn sample(
26/// ) -> anyhow::Result<()> {
27///     let client = AcceleratorTypes::builder().build().await?;
28///     // use `client` to make requests to the Google Compute Engine API.
29///     Ok(())
30/// }
31/// ```
32///
33/// # Service Description
34///
35/// Service for the `acceleratorTypes` resource.
36///
37/// # Configuration
38///
39/// To configure `AcceleratorTypes` use the `with_*` methods in the type returned
40/// by [builder()][AcceleratorTypes::builder]. The default configuration should
41/// work for most applications. Common configuration changes include
42///
43/// * [with_endpoint()]: by default this client uses the global default endpoint
44///   (`https://compute.googleapis.com`). Applications using regional
45///   endpoints or running in restricted networks (e.g. a network configured
46//    with [Private Google Access with VPC Service Controls]) may want to
47///   override this default.
48/// * [with_credentials()]: by default this client uses
49///   [Application Default Credentials]. Applications using custom
50///   authentication may need to override this default.
51///
52/// [with_endpoint()]: super::builder::accelerator_types::ClientBuilder::with_endpoint
53/// [with_credentials()]: super::builder::accelerator_types::ClientBuilder::with_credentials
54/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
55/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
56///
57/// # Pooling and Cloning
58///
59/// `AcceleratorTypes` holds a connection pool internally, it is advised to
60/// create one and reuse it. You do not need to wrap `AcceleratorTypes` in
61/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
62/// already uses an `Arc` internally.
63#[cfg(feature = "accelerator-types")]
64#[cfg_attr(docsrs, doc(cfg(feature = "accelerator-types")))]
65#[derive(Clone, Debug)]
66pub struct AcceleratorTypes {
67    inner: std::sync::Arc<dyn super::stub::dynamic::AcceleratorTypes>,
68}
69
70#[cfg(feature = "accelerator-types")]
71impl AcceleratorTypes {
72    /// Returns a builder for [AcceleratorTypes].
73    ///
74    /// ```
75    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
76    /// # use google_cloud_compute_v1::client::AcceleratorTypes;
77    /// let client = AcceleratorTypes::builder().build().await?;
78    /// # Ok(()) }
79    /// ```
80    pub fn builder() -> super::builder::accelerator_types::ClientBuilder {
81        crate::new_client_builder(super::builder::accelerator_types::client::Factory)
82    }
83
84    /// Creates a new client from the provided stub.
85    ///
86    /// The most common case for calling this function is in tests mocking the
87    /// client's behavior.
88    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
89    where
90        T: super::stub::AcceleratorTypes + 'static,
91    {
92        Self { inner: stub.into() }
93    }
94
95    pub(crate) async fn new(
96        config: gaxi::options::ClientConfig,
97    ) -> crate::ClientBuilderResult<Self> {
98        let inner = Self::build_inner(config).await?;
99        Ok(Self { inner })
100    }
101
102    async fn build_inner(
103        conf: gaxi::options::ClientConfig,
104    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::AcceleratorTypes>>
105    {
106        if gaxi::options::tracing_enabled(&conf) {
107            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
108        }
109        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
110    }
111
112    async fn build_transport(
113        conf: gaxi::options::ClientConfig,
114    ) -> crate::ClientBuilderResult<impl super::stub::AcceleratorTypes> {
115        super::transport::AcceleratorTypes::new(conf).await
116    }
117
118    async fn build_with_tracing(
119        conf: gaxi::options::ClientConfig,
120    ) -> crate::ClientBuilderResult<impl super::stub::AcceleratorTypes> {
121        Self::build_transport(conf)
122            .await
123            .map(super::tracing::AcceleratorTypes::new)
124    }
125
126    /// Retrieves an aggregated list of accelerator types.
127    ///
128    /// To prevent failure, it is recommended that you set the
129    /// `returnPartialSuccess` parameter to `true`.
130    pub fn aggregated_list(&self) -> super::builder::accelerator_types::AggregatedList {
131        super::builder::accelerator_types::AggregatedList::new(self.inner.clone())
132    }
133
134    /// Returns the specified accelerator type.
135    pub fn get(&self) -> super::builder::accelerator_types::Get {
136        super::builder::accelerator_types::Get::new(self.inner.clone())
137    }
138
139    /// Retrieves a list of accelerator types that are available to the specified
140    /// project.
141    pub fn list(&self) -> super::builder::accelerator_types::List {
142        super::builder::accelerator_types::List::new(self.inner.clone())
143    }
144}
145
146/// Implements a client for the Google Compute Engine API.
147///
148/// # Example
149/// ```
150/// # use google_cloud_compute_v1::client::Addresses;
151/// async fn sample(
152/// ) -> anyhow::Result<()> {
153///     let client = Addresses::builder().build().await?;
154///     // use `client` to make requests to the Google Compute Engine API.
155///     Ok(())
156/// }
157/// ```
158///
159/// # Service Description
160///
161/// Service for the `addresses` resource.
162///
163/// # Configuration
164///
165/// To configure `Addresses` use the `with_*` methods in the type returned
166/// by [builder()][Addresses::builder]. The default configuration should
167/// work for most applications. Common configuration changes include
168///
169/// * [with_endpoint()]: by default this client uses the global default endpoint
170///   (`https://compute.googleapis.com`). Applications using regional
171///   endpoints or running in restricted networks (e.g. a network configured
172//    with [Private Google Access with VPC Service Controls]) may want to
173///   override this default.
174/// * [with_credentials()]: by default this client uses
175///   [Application Default Credentials]. Applications using custom
176///   authentication may need to override this default.
177///
178/// [with_endpoint()]: super::builder::addresses::ClientBuilder::with_endpoint
179/// [with_credentials()]: super::builder::addresses::ClientBuilder::with_credentials
180/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
181/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
182///
183/// # Pooling and Cloning
184///
185/// `Addresses` holds a connection pool internally, it is advised to
186/// create one and reuse it. You do not need to wrap `Addresses` in
187/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
188/// already uses an `Arc` internally.
189#[cfg(feature = "addresses")]
190#[cfg_attr(docsrs, doc(cfg(feature = "addresses")))]
191#[derive(Clone, Debug)]
192pub struct Addresses {
193    inner: std::sync::Arc<dyn super::stub::dynamic::Addresses>,
194}
195
196#[cfg(feature = "addresses")]
197impl Addresses {
198    /// Returns a builder for [Addresses].
199    ///
200    /// ```
201    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
202    /// # use google_cloud_compute_v1::client::Addresses;
203    /// let client = Addresses::builder().build().await?;
204    /// # Ok(()) }
205    /// ```
206    pub fn builder() -> super::builder::addresses::ClientBuilder {
207        crate::new_client_builder(super::builder::addresses::client::Factory)
208    }
209
210    /// Creates a new client from the provided stub.
211    ///
212    /// The most common case for calling this function is in tests mocking the
213    /// client's behavior.
214    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
215    where
216        T: super::stub::Addresses + 'static,
217    {
218        Self { inner: stub.into() }
219    }
220
221    pub(crate) async fn new(
222        config: gaxi::options::ClientConfig,
223    ) -> crate::ClientBuilderResult<Self> {
224        let inner = Self::build_inner(config).await?;
225        Ok(Self { inner })
226    }
227
228    async fn build_inner(
229        conf: gaxi::options::ClientConfig,
230    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Addresses>> {
231        if gaxi::options::tracing_enabled(&conf) {
232            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
233        }
234        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
235    }
236
237    async fn build_transport(
238        conf: gaxi::options::ClientConfig,
239    ) -> crate::ClientBuilderResult<impl super::stub::Addresses> {
240        super::transport::Addresses::new(conf).await
241    }
242
243    async fn build_with_tracing(
244        conf: gaxi::options::ClientConfig,
245    ) -> crate::ClientBuilderResult<impl super::stub::Addresses> {
246        Self::build_transport(conf)
247            .await
248            .map(super::tracing::Addresses::new)
249    }
250
251    /// Retrieves an aggregated list of addresses.
252    ///
253    /// To prevent failure, it is recommended that you set the
254    /// `returnPartialSuccess` parameter to `true`.
255    pub fn aggregated_list(&self) -> super::builder::addresses::AggregatedList {
256        super::builder::addresses::AggregatedList::new(self.inner.clone())
257    }
258
259    /// Deletes the specified address resource.
260    pub fn delete(&self) -> super::builder::addresses::Delete {
261        super::builder::addresses::Delete::new(self.inner.clone())
262    }
263
264    /// Returns the specified address resource.
265    pub fn get(&self) -> super::builder::addresses::Get {
266        super::builder::addresses::Get::new(self.inner.clone())
267    }
268
269    /// Creates an address resource in the specified project by using the data
270    /// included in the request.
271    pub fn insert(&self) -> super::builder::addresses::Insert {
272        super::builder::addresses::Insert::new(self.inner.clone())
273    }
274
275    /// Retrieves a list of addresses contained within
276    /// the specified region.
277    pub fn list(&self) -> super::builder::addresses::List {
278        super::builder::addresses::List::new(self.inner.clone())
279    }
280
281    /// Moves the specified address resource.
282    pub fn r#move(&self) -> super::builder::addresses::Move {
283        super::builder::addresses::Move::new(self.inner.clone())
284    }
285
286    /// Sets the labels on an Address. To learn more about labels, read theLabeling
287    /// Resources documentation.
288    pub fn set_labels(&self) -> super::builder::addresses::SetLabels {
289        super::builder::addresses::SetLabels::new(self.inner.clone())
290    }
291
292    /// Returns permissions that a caller has on the specified resource.
293    pub fn test_iam_permissions(&self) -> super::builder::addresses::TestIamPermissions {
294        super::builder::addresses::TestIamPermissions::new(self.inner.clone())
295    }
296
297    /// Retrieves the specified region-specific Operations resource.
298    pub fn get_operation(&self) -> super::builder::addresses::GetOperation {
299        super::builder::addresses::GetOperation::new(self.inner.clone())
300    }
301}
302
303/// Implements a client for the Google Compute Engine API.
304///
305/// # Example
306/// ```
307/// # use google_cloud_compute_v1::client::Advice;
308/// async fn sample(
309/// ) -> anyhow::Result<()> {
310///     let client = Advice::builder().build().await?;
311///     // use `client` to make requests to the Google Compute Engine API.
312///     Ok(())
313/// }
314/// ```
315///
316/// # Service Description
317///
318/// Service for the `advice` resource.
319///
320/// # Configuration
321///
322/// To configure `Advice` use the `with_*` methods in the type returned
323/// by [builder()][Advice::builder]. The default configuration should
324/// work for most applications. Common configuration changes include
325///
326/// * [with_endpoint()]: by default this client uses the global default endpoint
327///   (`https://compute.googleapis.com`). Applications using regional
328///   endpoints or running in restricted networks (e.g. a network configured
329//    with [Private Google Access with VPC Service Controls]) may want to
330///   override this default.
331/// * [with_credentials()]: by default this client uses
332///   [Application Default Credentials]. Applications using custom
333///   authentication may need to override this default.
334///
335/// [with_endpoint()]: super::builder::advice::ClientBuilder::with_endpoint
336/// [with_credentials()]: super::builder::advice::ClientBuilder::with_credentials
337/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
338/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
339///
340/// # Pooling and Cloning
341///
342/// `Advice` holds a connection pool internally, it is advised to
343/// create one and reuse it. You do not need to wrap `Advice` in
344/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
345/// already uses an `Arc` internally.
346#[cfg(feature = "advice")]
347#[cfg_attr(docsrs, doc(cfg(feature = "advice")))]
348#[derive(Clone, Debug)]
349pub struct Advice {
350    inner: std::sync::Arc<dyn super::stub::dynamic::Advice>,
351}
352
353#[cfg(feature = "advice")]
354impl Advice {
355    /// Returns a builder for [Advice].
356    ///
357    /// ```
358    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
359    /// # use google_cloud_compute_v1::client::Advice;
360    /// let client = Advice::builder().build().await?;
361    /// # Ok(()) }
362    /// ```
363    pub fn builder() -> super::builder::advice::ClientBuilder {
364        crate::new_client_builder(super::builder::advice::client::Factory)
365    }
366
367    /// Creates a new client from the provided stub.
368    ///
369    /// The most common case for calling this function is in tests mocking the
370    /// client's behavior.
371    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
372    where
373        T: super::stub::Advice + 'static,
374    {
375        Self { inner: stub.into() }
376    }
377
378    pub(crate) async fn new(
379        config: gaxi::options::ClientConfig,
380    ) -> crate::ClientBuilderResult<Self> {
381        let inner = Self::build_inner(config).await?;
382        Ok(Self { inner })
383    }
384
385    async fn build_inner(
386        conf: gaxi::options::ClientConfig,
387    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Advice>> {
388        if gaxi::options::tracing_enabled(&conf) {
389            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
390        }
391        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
392    }
393
394    async fn build_transport(
395        conf: gaxi::options::ClientConfig,
396    ) -> crate::ClientBuilderResult<impl super::stub::Advice> {
397        super::transport::Advice::new(conf).await
398    }
399
400    async fn build_with_tracing(
401        conf: gaxi::options::ClientConfig,
402    ) -> crate::ClientBuilderResult<impl super::stub::Advice> {
403        Self::build_transport(conf)
404            .await
405            .map(super::tracing::Advice::new)
406    }
407
408    /// Advise how, where and when to create the requested amount of instances
409    /// with specified accelerators, within the specified time and location limits.
410    /// The method recommends creating future reservations for the requested
411    /// resources.
412    pub fn calendar_mode(&self) -> super::builder::advice::CalendarMode {
413        super::builder::advice::CalendarMode::new(self.inner.clone())
414    }
415}
416
417/// Implements a client for the Google Compute Engine API.
418///
419/// # Example
420/// ```
421/// # use google_cloud_compute_v1::client::Autoscalers;
422/// async fn sample(
423/// ) -> anyhow::Result<()> {
424///     let client = Autoscalers::builder().build().await?;
425///     // use `client` to make requests to the Google Compute Engine API.
426///     Ok(())
427/// }
428/// ```
429///
430/// # Service Description
431///
432/// Service for the `autoscalers` resource.
433///
434/// # Configuration
435///
436/// To configure `Autoscalers` use the `with_*` methods in the type returned
437/// by [builder()][Autoscalers::builder]. The default configuration should
438/// work for most applications. Common configuration changes include
439///
440/// * [with_endpoint()]: by default this client uses the global default endpoint
441///   (`https://compute.googleapis.com`). Applications using regional
442///   endpoints or running in restricted networks (e.g. a network configured
443//    with [Private Google Access with VPC Service Controls]) may want to
444///   override this default.
445/// * [with_credentials()]: by default this client uses
446///   [Application Default Credentials]. Applications using custom
447///   authentication may need to override this default.
448///
449/// [with_endpoint()]: super::builder::autoscalers::ClientBuilder::with_endpoint
450/// [with_credentials()]: super::builder::autoscalers::ClientBuilder::with_credentials
451/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
452/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
453///
454/// # Pooling and Cloning
455///
456/// `Autoscalers` holds a connection pool internally, it is advised to
457/// create one and reuse it. You do not need to wrap `Autoscalers` in
458/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
459/// already uses an `Arc` internally.
460#[cfg(feature = "autoscalers")]
461#[cfg_attr(docsrs, doc(cfg(feature = "autoscalers")))]
462#[derive(Clone, Debug)]
463pub struct Autoscalers {
464    inner: std::sync::Arc<dyn super::stub::dynamic::Autoscalers>,
465}
466
467#[cfg(feature = "autoscalers")]
468impl Autoscalers {
469    /// Returns a builder for [Autoscalers].
470    ///
471    /// ```
472    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
473    /// # use google_cloud_compute_v1::client::Autoscalers;
474    /// let client = Autoscalers::builder().build().await?;
475    /// # Ok(()) }
476    /// ```
477    pub fn builder() -> super::builder::autoscalers::ClientBuilder {
478        crate::new_client_builder(super::builder::autoscalers::client::Factory)
479    }
480
481    /// Creates a new client from the provided stub.
482    ///
483    /// The most common case for calling this function is in tests mocking the
484    /// client's behavior.
485    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
486    where
487        T: super::stub::Autoscalers + 'static,
488    {
489        Self { inner: stub.into() }
490    }
491
492    pub(crate) async fn new(
493        config: gaxi::options::ClientConfig,
494    ) -> crate::ClientBuilderResult<Self> {
495        let inner = Self::build_inner(config).await?;
496        Ok(Self { inner })
497    }
498
499    async fn build_inner(
500        conf: gaxi::options::ClientConfig,
501    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Autoscalers>> {
502        if gaxi::options::tracing_enabled(&conf) {
503            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
504        }
505        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
506    }
507
508    async fn build_transport(
509        conf: gaxi::options::ClientConfig,
510    ) -> crate::ClientBuilderResult<impl super::stub::Autoscalers> {
511        super::transport::Autoscalers::new(conf).await
512    }
513
514    async fn build_with_tracing(
515        conf: gaxi::options::ClientConfig,
516    ) -> crate::ClientBuilderResult<impl super::stub::Autoscalers> {
517        Self::build_transport(conf)
518            .await
519            .map(super::tracing::Autoscalers::new)
520    }
521
522    /// Retrieves an aggregated list of autoscalers.
523    ///
524    /// To prevent failure, it is recommended that you set the
525    /// `returnPartialSuccess` parameter to `true`.
526    pub fn aggregated_list(&self) -> super::builder::autoscalers::AggregatedList {
527        super::builder::autoscalers::AggregatedList::new(self.inner.clone())
528    }
529
530    /// Deletes the specified autoscaler.
531    pub fn delete(&self) -> super::builder::autoscalers::Delete {
532        super::builder::autoscalers::Delete::new(self.inner.clone())
533    }
534
535    /// Returns the specified autoscaler resource.
536    pub fn get(&self) -> super::builder::autoscalers::Get {
537        super::builder::autoscalers::Get::new(self.inner.clone())
538    }
539
540    /// Creates an autoscaler in the specified project using the data
541    /// included in the request.
542    pub fn insert(&self) -> super::builder::autoscalers::Insert {
543        super::builder::autoscalers::Insert::new(self.inner.clone())
544    }
545
546    /// Retrieves a list of autoscalers contained within
547    /// the specified zone.
548    pub fn list(&self) -> super::builder::autoscalers::List {
549        super::builder::autoscalers::List::new(self.inner.clone())
550    }
551
552    /// Updates an autoscaler in the specified project using the data
553    /// included in the request. This method supportsPATCH
554    /// semantics and uses theJSON merge
555    /// patch format and processing rules.
556    pub fn patch(&self) -> super::builder::autoscalers::Patch {
557        super::builder::autoscalers::Patch::new(self.inner.clone())
558    }
559
560    /// Returns permissions that a caller has on the specified resource.
561    pub fn test_iam_permissions(&self) -> super::builder::autoscalers::TestIamPermissions {
562        super::builder::autoscalers::TestIamPermissions::new(self.inner.clone())
563    }
564
565    /// Updates an autoscaler in the specified project using the data
566    /// included in the request.
567    pub fn update(&self) -> super::builder::autoscalers::Update {
568        super::builder::autoscalers::Update::new(self.inner.clone())
569    }
570
571    /// Retrieves the specified zone-specific Operations resource.
572    pub fn get_operation(&self) -> super::builder::autoscalers::GetOperation {
573        super::builder::autoscalers::GetOperation::new(self.inner.clone())
574    }
575}
576
577/// Implements a client for the Google Compute Engine API.
578///
579/// # Example
580/// ```
581/// # use google_cloud_compute_v1::client::BackendBuckets;
582/// async fn sample(
583/// ) -> anyhow::Result<()> {
584///     let client = BackendBuckets::builder().build().await?;
585///     // use `client` to make requests to the Google Compute Engine API.
586///     Ok(())
587/// }
588/// ```
589///
590/// # Service Description
591///
592/// Service for the `backendBuckets` resource.
593///
594/// # Configuration
595///
596/// To configure `BackendBuckets` use the `with_*` methods in the type returned
597/// by [builder()][BackendBuckets::builder]. The default configuration should
598/// work for most applications. Common configuration changes include
599///
600/// * [with_endpoint()]: by default this client uses the global default endpoint
601///   (`https://compute.googleapis.com`). Applications using regional
602///   endpoints or running in restricted networks (e.g. a network configured
603//    with [Private Google Access with VPC Service Controls]) may want to
604///   override this default.
605/// * [with_credentials()]: by default this client uses
606///   [Application Default Credentials]. Applications using custom
607///   authentication may need to override this default.
608///
609/// [with_endpoint()]: super::builder::backend_buckets::ClientBuilder::with_endpoint
610/// [with_credentials()]: super::builder::backend_buckets::ClientBuilder::with_credentials
611/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
612/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
613///
614/// # Pooling and Cloning
615///
616/// `BackendBuckets` holds a connection pool internally, it is advised to
617/// create one and reuse it. You do not need to wrap `BackendBuckets` in
618/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
619/// already uses an `Arc` internally.
620#[cfg(feature = "backend-buckets")]
621#[cfg_attr(docsrs, doc(cfg(feature = "backend-buckets")))]
622#[derive(Clone, Debug)]
623pub struct BackendBuckets {
624    inner: std::sync::Arc<dyn super::stub::dynamic::BackendBuckets>,
625}
626
627#[cfg(feature = "backend-buckets")]
628impl BackendBuckets {
629    /// Returns a builder for [BackendBuckets].
630    ///
631    /// ```
632    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
633    /// # use google_cloud_compute_v1::client::BackendBuckets;
634    /// let client = BackendBuckets::builder().build().await?;
635    /// # Ok(()) }
636    /// ```
637    pub fn builder() -> super::builder::backend_buckets::ClientBuilder {
638        crate::new_client_builder(super::builder::backend_buckets::client::Factory)
639    }
640
641    /// Creates a new client from the provided stub.
642    ///
643    /// The most common case for calling this function is in tests mocking the
644    /// client's behavior.
645    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
646    where
647        T: super::stub::BackendBuckets + 'static,
648    {
649        Self { inner: stub.into() }
650    }
651
652    pub(crate) async fn new(
653        config: gaxi::options::ClientConfig,
654    ) -> crate::ClientBuilderResult<Self> {
655        let inner = Self::build_inner(config).await?;
656        Ok(Self { inner })
657    }
658
659    async fn build_inner(
660        conf: gaxi::options::ClientConfig,
661    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::BackendBuckets>> {
662        if gaxi::options::tracing_enabled(&conf) {
663            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
664        }
665        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
666    }
667
668    async fn build_transport(
669        conf: gaxi::options::ClientConfig,
670    ) -> crate::ClientBuilderResult<impl super::stub::BackendBuckets> {
671        super::transport::BackendBuckets::new(conf).await
672    }
673
674    async fn build_with_tracing(
675        conf: gaxi::options::ClientConfig,
676    ) -> crate::ClientBuilderResult<impl super::stub::BackendBuckets> {
677        Self::build_transport(conf)
678            .await
679            .map(super::tracing::BackendBuckets::new)
680    }
681
682    /// Adds a key for validating requests with signed URLs for this backend
683    /// bucket.
684    pub fn add_signed_url_key(&self) -> super::builder::backend_buckets::AddSignedUrlKey {
685        super::builder::backend_buckets::AddSignedUrlKey::new(self.inner.clone())
686    }
687
688    /// Retrieves the list of all BackendBucket resources, regional and global,
689    /// available to the specified project.
690    ///
691    /// To prevent failure, it is recommended that you set the
692    /// `returnPartialSuccess` parameter to `true`.
693    pub fn aggregated_list(&self) -> super::builder::backend_buckets::AggregatedList {
694        super::builder::backend_buckets::AggregatedList::new(self.inner.clone())
695    }
696
697    /// Deletes the specified BackendBucket resource.
698    pub fn delete(&self) -> super::builder::backend_buckets::Delete {
699        super::builder::backend_buckets::Delete::new(self.inner.clone())
700    }
701
702    /// Deletes a key for validating requests with signed URLs for this backend
703    /// bucket.
704    pub fn delete_signed_url_key(&self) -> super::builder::backend_buckets::DeleteSignedUrlKey {
705        super::builder::backend_buckets::DeleteSignedUrlKey::new(self.inner.clone())
706    }
707
708    /// Returns the specified BackendBucket resource.
709    pub fn get(&self) -> super::builder::backend_buckets::Get {
710        super::builder::backend_buckets::Get::new(self.inner.clone())
711    }
712
713    /// Gets the access control policy for a resource. May be empty if no such
714    /// policy or resource exists.
715    pub fn get_iam_policy(&self) -> super::builder::backend_buckets::GetIamPolicy {
716        super::builder::backend_buckets::GetIamPolicy::new(self.inner.clone())
717    }
718
719    /// Creates a BackendBucket resource in the specified project using
720    /// the data included in the request.
721    pub fn insert(&self) -> super::builder::backend_buckets::Insert {
722        super::builder::backend_buckets::Insert::new(self.inner.clone())
723    }
724
725    /// Retrieves the list of BackendBucket resources available to the specified
726    /// project.
727    pub fn list(&self) -> super::builder::backend_buckets::List {
728        super::builder::backend_buckets::List::new(self.inner.clone())
729    }
730
731    /// Retrieves a list of all usable backend buckets in the specified project.
732    pub fn list_usable(&self) -> super::builder::backend_buckets::ListUsable {
733        super::builder::backend_buckets::ListUsable::new(self.inner.clone())
734    }
735
736    /// Updates the specified BackendBucket resource with the data included in the
737    /// request. This method supportsPATCH
738    /// semantics and uses theJSON merge
739    /// patch format and processing rules.
740    pub fn patch(&self) -> super::builder::backend_buckets::Patch {
741        super::builder::backend_buckets::Patch::new(self.inner.clone())
742    }
743
744    /// Sets the edge security policy for the specified backend bucket.
745    pub fn set_edge_security_policy(
746        &self,
747    ) -> super::builder::backend_buckets::SetEdgeSecurityPolicy {
748        super::builder::backend_buckets::SetEdgeSecurityPolicy::new(self.inner.clone())
749    }
750
751    /// Sets the access control policy on the specified resource.
752    /// Replaces any existing policy.
753    pub fn set_iam_policy(&self) -> super::builder::backend_buckets::SetIamPolicy {
754        super::builder::backend_buckets::SetIamPolicy::new(self.inner.clone())
755    }
756
757    /// Returns permissions that a caller has on the specified resource.
758    pub fn test_iam_permissions(&self) -> super::builder::backend_buckets::TestIamPermissions {
759        super::builder::backend_buckets::TestIamPermissions::new(self.inner.clone())
760    }
761
762    /// Updates the specified BackendBucket resource with the data included in the
763    /// request.
764    pub fn update(&self) -> super::builder::backend_buckets::Update {
765        super::builder::backend_buckets::Update::new(self.inner.clone())
766    }
767
768    /// Retrieves the specified Operations resource.
769    pub fn get_operation(&self) -> super::builder::backend_buckets::GetOperation {
770        super::builder::backend_buckets::GetOperation::new(self.inner.clone())
771    }
772}
773
774/// Implements a client for the Google Compute Engine API.
775///
776/// # Example
777/// ```
778/// # use google_cloud_compute_v1::client::BackendServices;
779/// async fn sample(
780/// ) -> anyhow::Result<()> {
781///     let client = BackendServices::builder().build().await?;
782///     // use `client` to make requests to the Google Compute Engine API.
783///     Ok(())
784/// }
785/// ```
786///
787/// # Service Description
788///
789/// Service for the `backendServices` resource.
790///
791/// # Configuration
792///
793/// To configure `BackendServices` use the `with_*` methods in the type returned
794/// by [builder()][BackendServices::builder]. The default configuration should
795/// work for most applications. Common configuration changes include
796///
797/// * [with_endpoint()]: by default this client uses the global default endpoint
798///   (`https://compute.googleapis.com`). Applications using regional
799///   endpoints or running in restricted networks (e.g. a network configured
800//    with [Private Google Access with VPC Service Controls]) may want to
801///   override this default.
802/// * [with_credentials()]: by default this client uses
803///   [Application Default Credentials]. Applications using custom
804///   authentication may need to override this default.
805///
806/// [with_endpoint()]: super::builder::backend_services::ClientBuilder::with_endpoint
807/// [with_credentials()]: super::builder::backend_services::ClientBuilder::with_credentials
808/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
809/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
810///
811/// # Pooling and Cloning
812///
813/// `BackendServices` holds a connection pool internally, it is advised to
814/// create one and reuse it. You do not need to wrap `BackendServices` in
815/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
816/// already uses an `Arc` internally.
817#[cfg(feature = "backend-services")]
818#[cfg_attr(docsrs, doc(cfg(feature = "backend-services")))]
819#[derive(Clone, Debug)]
820pub struct BackendServices {
821    inner: std::sync::Arc<dyn super::stub::dynamic::BackendServices>,
822}
823
824#[cfg(feature = "backend-services")]
825impl BackendServices {
826    /// Returns a builder for [BackendServices].
827    ///
828    /// ```
829    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
830    /// # use google_cloud_compute_v1::client::BackendServices;
831    /// let client = BackendServices::builder().build().await?;
832    /// # Ok(()) }
833    /// ```
834    pub fn builder() -> super::builder::backend_services::ClientBuilder {
835        crate::new_client_builder(super::builder::backend_services::client::Factory)
836    }
837
838    /// Creates a new client from the provided stub.
839    ///
840    /// The most common case for calling this function is in tests mocking the
841    /// client's behavior.
842    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
843    where
844        T: super::stub::BackendServices + 'static,
845    {
846        Self { inner: stub.into() }
847    }
848
849    pub(crate) async fn new(
850        config: gaxi::options::ClientConfig,
851    ) -> crate::ClientBuilderResult<Self> {
852        let inner = Self::build_inner(config).await?;
853        Ok(Self { inner })
854    }
855
856    async fn build_inner(
857        conf: gaxi::options::ClientConfig,
858    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::BackendServices>> {
859        if gaxi::options::tracing_enabled(&conf) {
860            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
861        }
862        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
863    }
864
865    async fn build_transport(
866        conf: gaxi::options::ClientConfig,
867    ) -> crate::ClientBuilderResult<impl super::stub::BackendServices> {
868        super::transport::BackendServices::new(conf).await
869    }
870
871    async fn build_with_tracing(
872        conf: gaxi::options::ClientConfig,
873    ) -> crate::ClientBuilderResult<impl super::stub::BackendServices> {
874        Self::build_transport(conf)
875            .await
876            .map(super::tracing::BackendServices::new)
877    }
878
879    /// Adds a key for validating requests with signed URLs for this backend
880    /// service.
881    pub fn add_signed_url_key(&self) -> super::builder::backend_services::AddSignedUrlKey {
882        super::builder::backend_services::AddSignedUrlKey::new(self.inner.clone())
883    }
884
885    /// Retrieves the list of all BackendService resources, regional and global,
886    /// available to the specified project.
887    ///
888    /// To prevent failure, it is recommended that you set the
889    /// `returnPartialSuccess` parameter to `true`.
890    pub fn aggregated_list(&self) -> super::builder::backend_services::AggregatedList {
891        super::builder::backend_services::AggregatedList::new(self.inner.clone())
892    }
893
894    /// Deletes the specified BackendService resource.
895    pub fn delete(&self) -> super::builder::backend_services::Delete {
896        super::builder::backend_services::Delete::new(self.inner.clone())
897    }
898
899    /// Deletes a key for validating requests with signed URLs for this backend
900    /// service.
901    pub fn delete_signed_url_key(&self) -> super::builder::backend_services::DeleteSignedUrlKey {
902        super::builder::backend_services::DeleteSignedUrlKey::new(self.inner.clone())
903    }
904
905    /// Returns the specified BackendService resource.
906    pub fn get(&self) -> super::builder::backend_services::Get {
907        super::builder::backend_services::Get::new(self.inner.clone())
908    }
909
910    /// Returns effective security policies applied to this backend service.
911    pub fn get_effective_security_policies(
912        &self,
913    ) -> super::builder::backend_services::GetEffectiveSecurityPolicies {
914        super::builder::backend_services::GetEffectiveSecurityPolicies::new(self.inner.clone())
915    }
916
917    /// Gets the most recent health check results for this
918    /// BackendService.
919    ///
920    /// Example request body:
921    ///
922    /// {
923    /// "group": "/zones/us-east1-b/instanceGroups/lb-backend-example"
924    /// }
925    pub fn get_health(&self) -> super::builder::backend_services::GetHealth {
926        super::builder::backend_services::GetHealth::new(self.inner.clone())
927    }
928
929    /// Gets the access control policy for a resource. May be empty if no such
930    /// policy or resource exists.
931    pub fn get_iam_policy(&self) -> super::builder::backend_services::GetIamPolicy {
932        super::builder::backend_services::GetIamPolicy::new(self.inner.clone())
933    }
934
935    /// Creates a BackendService resource in the specified project using
936    /// the data included in the request. For more information, see
937    /// Backend services overview.
938    pub fn insert(&self) -> super::builder::backend_services::Insert {
939        super::builder::backend_services::Insert::new(self.inner.clone())
940    }
941
942    /// Retrieves the list of BackendService resources available to the specified
943    /// project.
944    pub fn list(&self) -> super::builder::backend_services::List {
945        super::builder::backend_services::List::new(self.inner.clone())
946    }
947
948    /// Retrieves a list of all usable backend services in the specified project.
949    pub fn list_usable(&self) -> super::builder::backend_services::ListUsable {
950        super::builder::backend_services::ListUsable::new(self.inner.clone())
951    }
952
953    /// Patches the specified BackendService resource with the data included in the
954    /// request. For more information, see
955    /// Backend services overview. This method
956    /// supports PATCH semantics and uses the JSON merge
957    /// patch format and processing rules.
958    pub fn patch(&self) -> super::builder::backend_services::Patch {
959        super::builder::backend_services::Patch::new(self.inner.clone())
960    }
961
962    /// Sets the edge security policy for the specified backend service.
963    pub fn set_edge_security_policy(
964        &self,
965    ) -> super::builder::backend_services::SetEdgeSecurityPolicy {
966        super::builder::backend_services::SetEdgeSecurityPolicy::new(self.inner.clone())
967    }
968
969    /// Sets the access control policy on the specified resource.
970    /// Replaces any existing policy.
971    pub fn set_iam_policy(&self) -> super::builder::backend_services::SetIamPolicy {
972        super::builder::backend_services::SetIamPolicy::new(self.inner.clone())
973    }
974
975    /// Sets the Google Cloud Armor security policy for the specified backend
976    /// service. For more information, seeGoogle
977    /// Cloud Armor Overview
978    pub fn set_security_policy(&self) -> super::builder::backend_services::SetSecurityPolicy {
979        super::builder::backend_services::SetSecurityPolicy::new(self.inner.clone())
980    }
981
982    /// Returns permissions that a caller has on the specified resource.
983    pub fn test_iam_permissions(&self) -> super::builder::backend_services::TestIamPermissions {
984        super::builder::backend_services::TestIamPermissions::new(self.inner.clone())
985    }
986
987    /// Updates the specified BackendService resource with the data included in the
988    /// request. For more information, seeBackend
989    /// services overview.
990    pub fn update(&self) -> super::builder::backend_services::Update {
991        super::builder::backend_services::Update::new(self.inner.clone())
992    }
993
994    /// Retrieves the specified Operations resource.
995    pub fn get_operation(&self) -> super::builder::backend_services::GetOperation {
996        super::builder::backend_services::GetOperation::new(self.inner.clone())
997    }
998}
999
1000/// Implements a client for the Google Compute Engine API.
1001///
1002/// # Example
1003/// ```
1004/// # use google_cloud_compute_v1::client::CrossSiteNetworks;
1005/// async fn sample(
1006/// ) -> anyhow::Result<()> {
1007///     let client = CrossSiteNetworks::builder().build().await?;
1008///     // use `client` to make requests to the Google Compute Engine API.
1009///     Ok(())
1010/// }
1011/// ```
1012///
1013/// # Service Description
1014///
1015/// Service for the `crossSiteNetworks` resource.
1016///
1017/// # Configuration
1018///
1019/// To configure `CrossSiteNetworks` use the `with_*` methods in the type returned
1020/// by [builder()][CrossSiteNetworks::builder]. The default configuration should
1021/// work for most applications. Common configuration changes include
1022///
1023/// * [with_endpoint()]: by default this client uses the global default endpoint
1024///   (`https://compute.googleapis.com`). Applications using regional
1025///   endpoints or running in restricted networks (e.g. a network configured
1026//    with [Private Google Access with VPC Service Controls]) may want to
1027///   override this default.
1028/// * [with_credentials()]: by default this client uses
1029///   [Application Default Credentials]. Applications using custom
1030///   authentication may need to override this default.
1031///
1032/// [with_endpoint()]: super::builder::cross_site_networks::ClientBuilder::with_endpoint
1033/// [with_credentials()]: super::builder::cross_site_networks::ClientBuilder::with_credentials
1034/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1035/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1036///
1037/// # Pooling and Cloning
1038///
1039/// `CrossSiteNetworks` holds a connection pool internally, it is advised to
1040/// create one and reuse it. You do not need to wrap `CrossSiteNetworks` in
1041/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1042/// already uses an `Arc` internally.
1043#[cfg(feature = "cross-site-networks")]
1044#[cfg_attr(docsrs, doc(cfg(feature = "cross-site-networks")))]
1045#[derive(Clone, Debug)]
1046pub struct CrossSiteNetworks {
1047    inner: std::sync::Arc<dyn super::stub::dynamic::CrossSiteNetworks>,
1048}
1049
1050#[cfg(feature = "cross-site-networks")]
1051impl CrossSiteNetworks {
1052    /// Returns a builder for [CrossSiteNetworks].
1053    ///
1054    /// ```
1055    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1056    /// # use google_cloud_compute_v1::client::CrossSiteNetworks;
1057    /// let client = CrossSiteNetworks::builder().build().await?;
1058    /// # Ok(()) }
1059    /// ```
1060    pub fn builder() -> super::builder::cross_site_networks::ClientBuilder {
1061        crate::new_client_builder(super::builder::cross_site_networks::client::Factory)
1062    }
1063
1064    /// Creates a new client from the provided stub.
1065    ///
1066    /// The most common case for calling this function is in tests mocking the
1067    /// client's behavior.
1068    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
1069    where
1070        T: super::stub::CrossSiteNetworks + 'static,
1071    {
1072        Self { inner: stub.into() }
1073    }
1074
1075    pub(crate) async fn new(
1076        config: gaxi::options::ClientConfig,
1077    ) -> crate::ClientBuilderResult<Self> {
1078        let inner = Self::build_inner(config).await?;
1079        Ok(Self { inner })
1080    }
1081
1082    async fn build_inner(
1083        conf: gaxi::options::ClientConfig,
1084    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::CrossSiteNetworks>>
1085    {
1086        if gaxi::options::tracing_enabled(&conf) {
1087            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1088        }
1089        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1090    }
1091
1092    async fn build_transport(
1093        conf: gaxi::options::ClientConfig,
1094    ) -> crate::ClientBuilderResult<impl super::stub::CrossSiteNetworks> {
1095        super::transport::CrossSiteNetworks::new(conf).await
1096    }
1097
1098    async fn build_with_tracing(
1099        conf: gaxi::options::ClientConfig,
1100    ) -> crate::ClientBuilderResult<impl super::stub::CrossSiteNetworks> {
1101        Self::build_transport(conf)
1102            .await
1103            .map(super::tracing::CrossSiteNetworks::new)
1104    }
1105
1106    /// Deletes the specified cross-site network in the given scope.
1107    pub fn delete(&self) -> super::builder::cross_site_networks::Delete {
1108        super::builder::cross_site_networks::Delete::new(self.inner.clone())
1109    }
1110
1111    /// Returns the specified cross-site network in the given scope.
1112    pub fn get(&self) -> super::builder::cross_site_networks::Get {
1113        super::builder::cross_site_networks::Get::new(self.inner.clone())
1114    }
1115
1116    /// Creates a cross-site network in the specified project in the given scope
1117    /// using the parameters that are included in the request.
1118    pub fn insert(&self) -> super::builder::cross_site_networks::Insert {
1119        super::builder::cross_site_networks::Insert::new(self.inner.clone())
1120    }
1121
1122    /// Lists the cross-site networks for a project in the given scope.
1123    pub fn list(&self) -> super::builder::cross_site_networks::List {
1124        super::builder::cross_site_networks::List::new(self.inner.clone())
1125    }
1126
1127    /// Updates the specified cross-site network with the data included in
1128    /// the request. This method supportsPATCH
1129    /// semantics and uses theJSON merge
1130    /// patch format and processing rules.
1131    pub fn patch(&self) -> super::builder::cross_site_networks::Patch {
1132        super::builder::cross_site_networks::Patch::new(self.inner.clone())
1133    }
1134
1135    /// Retrieves the specified Operations resource.
1136    pub fn get_operation(&self) -> super::builder::cross_site_networks::GetOperation {
1137        super::builder::cross_site_networks::GetOperation::new(self.inner.clone())
1138    }
1139}
1140
1141/// Implements a client for the Google Compute Engine API.
1142///
1143/// # Example
1144/// ```
1145/// # use google_cloud_compute_v1::client::DiskTypes;
1146/// async fn sample(
1147/// ) -> anyhow::Result<()> {
1148///     let client = DiskTypes::builder().build().await?;
1149///     // use `client` to make requests to the Google Compute Engine API.
1150///     Ok(())
1151/// }
1152/// ```
1153///
1154/// # Service Description
1155///
1156/// Service for the `diskTypes` resource.
1157///
1158/// # Configuration
1159///
1160/// To configure `DiskTypes` use the `with_*` methods in the type returned
1161/// by [builder()][DiskTypes::builder]. The default configuration should
1162/// work for most applications. Common configuration changes include
1163///
1164/// * [with_endpoint()]: by default this client uses the global default endpoint
1165///   (`https://compute.googleapis.com`). Applications using regional
1166///   endpoints or running in restricted networks (e.g. a network configured
1167//    with [Private Google Access with VPC Service Controls]) may want to
1168///   override this default.
1169/// * [with_credentials()]: by default this client uses
1170///   [Application Default Credentials]. Applications using custom
1171///   authentication may need to override this default.
1172///
1173/// [with_endpoint()]: super::builder::disk_types::ClientBuilder::with_endpoint
1174/// [with_credentials()]: super::builder::disk_types::ClientBuilder::with_credentials
1175/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1176/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1177///
1178/// # Pooling and Cloning
1179///
1180/// `DiskTypes` holds a connection pool internally, it is advised to
1181/// create one and reuse it. You do not need to wrap `DiskTypes` in
1182/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1183/// already uses an `Arc` internally.
1184#[cfg(feature = "disk-types")]
1185#[cfg_attr(docsrs, doc(cfg(feature = "disk-types")))]
1186#[derive(Clone, Debug)]
1187pub struct DiskTypes {
1188    inner: std::sync::Arc<dyn super::stub::dynamic::DiskTypes>,
1189}
1190
1191#[cfg(feature = "disk-types")]
1192impl DiskTypes {
1193    /// Returns a builder for [DiskTypes].
1194    ///
1195    /// ```
1196    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1197    /// # use google_cloud_compute_v1::client::DiskTypes;
1198    /// let client = DiskTypes::builder().build().await?;
1199    /// # Ok(()) }
1200    /// ```
1201    pub fn builder() -> super::builder::disk_types::ClientBuilder {
1202        crate::new_client_builder(super::builder::disk_types::client::Factory)
1203    }
1204
1205    /// Creates a new client from the provided stub.
1206    ///
1207    /// The most common case for calling this function is in tests mocking the
1208    /// client's behavior.
1209    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
1210    where
1211        T: super::stub::DiskTypes + 'static,
1212    {
1213        Self { inner: stub.into() }
1214    }
1215
1216    pub(crate) async fn new(
1217        config: gaxi::options::ClientConfig,
1218    ) -> crate::ClientBuilderResult<Self> {
1219        let inner = Self::build_inner(config).await?;
1220        Ok(Self { inner })
1221    }
1222
1223    async fn build_inner(
1224        conf: gaxi::options::ClientConfig,
1225    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::DiskTypes>> {
1226        if gaxi::options::tracing_enabled(&conf) {
1227            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1228        }
1229        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1230    }
1231
1232    async fn build_transport(
1233        conf: gaxi::options::ClientConfig,
1234    ) -> crate::ClientBuilderResult<impl super::stub::DiskTypes> {
1235        super::transport::DiskTypes::new(conf).await
1236    }
1237
1238    async fn build_with_tracing(
1239        conf: gaxi::options::ClientConfig,
1240    ) -> crate::ClientBuilderResult<impl super::stub::DiskTypes> {
1241        Self::build_transport(conf)
1242            .await
1243            .map(super::tracing::DiskTypes::new)
1244    }
1245
1246    /// Retrieves an aggregated list of disk types.
1247    ///
1248    /// To prevent failure, it is recommended that you set the
1249    /// `returnPartialSuccess` parameter to `true`.
1250    pub fn aggregated_list(&self) -> super::builder::disk_types::AggregatedList {
1251        super::builder::disk_types::AggregatedList::new(self.inner.clone())
1252    }
1253
1254    /// Returns the specified disk type.
1255    pub fn get(&self) -> super::builder::disk_types::Get {
1256        super::builder::disk_types::Get::new(self.inner.clone())
1257    }
1258
1259    /// Retrieves a list of disk types available to the specified
1260    /// project.
1261    pub fn list(&self) -> super::builder::disk_types::List {
1262        super::builder::disk_types::List::new(self.inner.clone())
1263    }
1264}
1265
1266/// Implements a client for the Google Compute Engine API.
1267///
1268/// # Example
1269/// ```
1270/// # use google_cloud_compute_v1::client::Disks;
1271/// async fn sample(
1272/// ) -> anyhow::Result<()> {
1273///     let client = Disks::builder().build().await?;
1274///     // use `client` to make requests to the Google Compute Engine API.
1275///     Ok(())
1276/// }
1277/// ```
1278///
1279/// # Service Description
1280///
1281/// Service for the `disks` resource.
1282///
1283/// # Configuration
1284///
1285/// To configure `Disks` use the `with_*` methods in the type returned
1286/// by [builder()][Disks::builder]. The default configuration should
1287/// work for most applications. Common configuration changes include
1288///
1289/// * [with_endpoint()]: by default this client uses the global default endpoint
1290///   (`https://compute.googleapis.com`). Applications using regional
1291///   endpoints or running in restricted networks (e.g. a network configured
1292//    with [Private Google Access with VPC Service Controls]) may want to
1293///   override this default.
1294/// * [with_credentials()]: by default this client uses
1295///   [Application Default Credentials]. Applications using custom
1296///   authentication may need to override this default.
1297///
1298/// [with_endpoint()]: super::builder::disks::ClientBuilder::with_endpoint
1299/// [with_credentials()]: super::builder::disks::ClientBuilder::with_credentials
1300/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1301/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1302///
1303/// # Pooling and Cloning
1304///
1305/// `Disks` holds a connection pool internally, it is advised to
1306/// create one and reuse it. You do not need to wrap `Disks` in
1307/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1308/// already uses an `Arc` internally.
1309#[cfg(feature = "disks")]
1310#[cfg_attr(docsrs, doc(cfg(feature = "disks")))]
1311#[derive(Clone, Debug)]
1312pub struct Disks {
1313    inner: std::sync::Arc<dyn super::stub::dynamic::Disks>,
1314}
1315
1316#[cfg(feature = "disks")]
1317impl Disks {
1318    /// Returns a builder for [Disks].
1319    ///
1320    /// ```
1321    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1322    /// # use google_cloud_compute_v1::client::Disks;
1323    /// let client = Disks::builder().build().await?;
1324    /// # Ok(()) }
1325    /// ```
1326    pub fn builder() -> super::builder::disks::ClientBuilder {
1327        crate::new_client_builder(super::builder::disks::client::Factory)
1328    }
1329
1330    /// Creates a new client from the provided stub.
1331    ///
1332    /// The most common case for calling this function is in tests mocking the
1333    /// client's behavior.
1334    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
1335    where
1336        T: super::stub::Disks + 'static,
1337    {
1338        Self { inner: stub.into() }
1339    }
1340
1341    pub(crate) async fn new(
1342        config: gaxi::options::ClientConfig,
1343    ) -> crate::ClientBuilderResult<Self> {
1344        let inner = Self::build_inner(config).await?;
1345        Ok(Self { inner })
1346    }
1347
1348    async fn build_inner(
1349        conf: gaxi::options::ClientConfig,
1350    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Disks>> {
1351        if gaxi::options::tracing_enabled(&conf) {
1352            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1353        }
1354        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1355    }
1356
1357    async fn build_transport(
1358        conf: gaxi::options::ClientConfig,
1359    ) -> crate::ClientBuilderResult<impl super::stub::Disks> {
1360        super::transport::Disks::new(conf).await
1361    }
1362
1363    async fn build_with_tracing(
1364        conf: gaxi::options::ClientConfig,
1365    ) -> crate::ClientBuilderResult<impl super::stub::Disks> {
1366        Self::build_transport(conf)
1367            .await
1368            .map(super::tracing::Disks::new)
1369    }
1370
1371    /// Adds existing resource policies to a disk. You can only add one
1372    /// policy which will be applied to this disk for scheduling snapshot
1373    /// creation.
1374    pub fn add_resource_policies(&self) -> super::builder::disks::AddResourcePolicies {
1375        super::builder::disks::AddResourcePolicies::new(self.inner.clone())
1376    }
1377
1378    /// Retrieves an aggregated list of persistent disks.
1379    ///
1380    /// To prevent failure, it is recommended that you set the
1381    /// `returnPartialSuccess` parameter to `true`.
1382    pub fn aggregated_list(&self) -> super::builder::disks::AggregatedList {
1383        super::builder::disks::AggregatedList::new(self.inner.clone())
1384    }
1385
1386    /// Bulk create a set of disks.
1387    pub fn bulk_insert(&self) -> super::builder::disks::BulkInsert {
1388        super::builder::disks::BulkInsert::new(self.inner.clone())
1389    }
1390
1391    /// Sets the labels on many disks at once. To learn more about labels, read theLabeling
1392    /// Resources documentation.
1393    pub fn bulk_set_labels(&self) -> super::builder::disks::BulkSetLabels {
1394        super::builder::disks::BulkSetLabels::new(self.inner.clone())
1395    }
1396
1397    /// Creates a snapshot of a specified persistent disk. For regular snapshot
1398    /// creation, consider using snapshots.insert
1399    /// instead, as that method supports more features, such as creating snapshots
1400    /// in a project different from the source disk project.
1401    pub fn create_snapshot(&self) -> super::builder::disks::CreateSnapshot {
1402        super::builder::disks::CreateSnapshot::new(self.inner.clone())
1403    }
1404
1405    /// Deletes the specified persistent disk. Deleting a disk removes its data
1406    /// permanently and is irreversible. However, deleting a disk does not
1407    /// delete any snapshots
1408    /// previously made from the disk. You must separatelydelete
1409    /// snapshots.
1410    pub fn delete(&self) -> super::builder::disks::Delete {
1411        super::builder::disks::Delete::new(self.inner.clone())
1412    }
1413
1414    /// Returns the specified persistent disk.
1415    pub fn get(&self) -> super::builder::disks::Get {
1416        super::builder::disks::Get::new(self.inner.clone())
1417    }
1418
1419    /// Gets the access control policy for a resource. May be empty if no such
1420    /// policy or resource exists.
1421    pub fn get_iam_policy(&self) -> super::builder::disks::GetIamPolicy {
1422        super::builder::disks::GetIamPolicy::new(self.inner.clone())
1423    }
1424
1425    /// Creates a persistent disk in the specified project using the data
1426    /// in the request. You can create a disk from a source
1427    /// (sourceImage, sourceSnapshot, orsourceDisk) or create an empty 500 GB data disk by
1428    /// omitting all properties. You can also create a disk that is larger than
1429    /// the default size by specifying the sizeGb property.
1430    pub fn insert(&self) -> super::builder::disks::Insert {
1431        super::builder::disks::Insert::new(self.inner.clone())
1432    }
1433
1434    /// Retrieves a list of persistent disks contained within
1435    /// the specified zone.
1436    pub fn list(&self) -> super::builder::disks::List {
1437        super::builder::disks::List::new(self.inner.clone())
1438    }
1439
1440    /// Removes resource policies from a disk.
1441    pub fn remove_resource_policies(&self) -> super::builder::disks::RemoveResourcePolicies {
1442        super::builder::disks::RemoveResourcePolicies::new(self.inner.clone())
1443    }
1444
1445    /// Resizes the specified persistent disk.
1446    /// You can only increase the size of the disk.
1447    pub fn resize(&self) -> super::builder::disks::Resize {
1448        super::builder::disks::Resize::new(self.inner.clone())
1449    }
1450
1451    /// Sets the access control policy on the specified resource.
1452    /// Replaces any existing policy.
1453    pub fn set_iam_policy(&self) -> super::builder::disks::SetIamPolicy {
1454        super::builder::disks::SetIamPolicy::new(self.inner.clone())
1455    }
1456
1457    /// Sets the labels on a disk. To learn more about labels, read theLabeling
1458    /// Resources documentation.
1459    pub fn set_labels(&self) -> super::builder::disks::SetLabels {
1460        super::builder::disks::SetLabels::new(self.inner.clone())
1461    }
1462
1463    /// Starts asynchronous replication.
1464    /// Must be invoked on the primary disk.
1465    pub fn start_async_replication(&self) -> super::builder::disks::StartAsyncReplication {
1466        super::builder::disks::StartAsyncReplication::new(self.inner.clone())
1467    }
1468
1469    /// Stops asynchronous replication.
1470    /// Can be invoked either on the primary or on the secondary disk.
1471    pub fn stop_async_replication(&self) -> super::builder::disks::StopAsyncReplication {
1472        super::builder::disks::StopAsyncReplication::new(self.inner.clone())
1473    }
1474
1475    /// Stops asynchronous replication for a consistency group of disks.
1476    /// Can be invoked either in the primary or secondary scope.
1477    pub fn stop_group_async_replication(&self) -> super::builder::disks::StopGroupAsyncReplication {
1478        super::builder::disks::StopGroupAsyncReplication::new(self.inner.clone())
1479    }
1480
1481    /// Returns permissions that a caller has on the specified resource.
1482    pub fn test_iam_permissions(&self) -> super::builder::disks::TestIamPermissions {
1483        super::builder::disks::TestIamPermissions::new(self.inner.clone())
1484    }
1485
1486    /// Updates the specified disk with the data included in the request.
1487    /// The update is performed only on selected fields included as part
1488    /// of update-mask.
1489    pub fn update(&self) -> super::builder::disks::Update {
1490        super::builder::disks::Update::new(self.inner.clone())
1491    }
1492
1493    /// Rotates the customer-managed
1494    /// encryption key to the latest version for the specified persistent disk.
1495    pub fn update_kms_key(&self) -> super::builder::disks::UpdateKmsKey {
1496        super::builder::disks::UpdateKmsKey::new(self.inner.clone())
1497    }
1498
1499    /// Retrieves the specified zone-specific Operations resource.
1500    pub fn get_operation(&self) -> super::builder::disks::GetOperation {
1501        super::builder::disks::GetOperation::new(self.inner.clone())
1502    }
1503}
1504
1505/// Implements a client for the Google Compute Engine API.
1506///
1507/// # Example
1508/// ```
1509/// # use google_cloud_compute_v1::client::ExternalVpnGateways;
1510/// async fn sample(
1511/// ) -> anyhow::Result<()> {
1512///     let client = ExternalVpnGateways::builder().build().await?;
1513///     // use `client` to make requests to the Google Compute Engine API.
1514///     Ok(())
1515/// }
1516/// ```
1517///
1518/// # Service Description
1519///
1520/// Service for the `externalVpnGateways` resource.
1521///
1522/// # Configuration
1523///
1524/// To configure `ExternalVpnGateways` use the `with_*` methods in the type returned
1525/// by [builder()][ExternalVpnGateways::builder]. The default configuration should
1526/// work for most applications. Common configuration changes include
1527///
1528/// * [with_endpoint()]: by default this client uses the global default endpoint
1529///   (`https://compute.googleapis.com`). Applications using regional
1530///   endpoints or running in restricted networks (e.g. a network configured
1531//    with [Private Google Access with VPC Service Controls]) may want to
1532///   override this default.
1533/// * [with_credentials()]: by default this client uses
1534///   [Application Default Credentials]. Applications using custom
1535///   authentication may need to override this default.
1536///
1537/// [with_endpoint()]: super::builder::external_vpn_gateways::ClientBuilder::with_endpoint
1538/// [with_credentials()]: super::builder::external_vpn_gateways::ClientBuilder::with_credentials
1539/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1540/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1541///
1542/// # Pooling and Cloning
1543///
1544/// `ExternalVpnGateways` holds a connection pool internally, it is advised to
1545/// create one and reuse it. You do not need to wrap `ExternalVpnGateways` in
1546/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1547/// already uses an `Arc` internally.
1548#[cfg(feature = "external-vpn-gateways")]
1549#[cfg_attr(docsrs, doc(cfg(feature = "external-vpn-gateways")))]
1550#[derive(Clone, Debug)]
1551pub struct ExternalVpnGateways {
1552    inner: std::sync::Arc<dyn super::stub::dynamic::ExternalVpnGateways>,
1553}
1554
1555#[cfg(feature = "external-vpn-gateways")]
1556impl ExternalVpnGateways {
1557    /// Returns a builder for [ExternalVpnGateways].
1558    ///
1559    /// ```
1560    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1561    /// # use google_cloud_compute_v1::client::ExternalVpnGateways;
1562    /// let client = ExternalVpnGateways::builder().build().await?;
1563    /// # Ok(()) }
1564    /// ```
1565    pub fn builder() -> super::builder::external_vpn_gateways::ClientBuilder {
1566        crate::new_client_builder(super::builder::external_vpn_gateways::client::Factory)
1567    }
1568
1569    /// Creates a new client from the provided stub.
1570    ///
1571    /// The most common case for calling this function is in tests mocking the
1572    /// client's behavior.
1573    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
1574    where
1575        T: super::stub::ExternalVpnGateways + 'static,
1576    {
1577        Self { inner: stub.into() }
1578    }
1579
1580    pub(crate) async fn new(
1581        config: gaxi::options::ClientConfig,
1582    ) -> crate::ClientBuilderResult<Self> {
1583        let inner = Self::build_inner(config).await?;
1584        Ok(Self { inner })
1585    }
1586
1587    async fn build_inner(
1588        conf: gaxi::options::ClientConfig,
1589    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ExternalVpnGateways>>
1590    {
1591        if gaxi::options::tracing_enabled(&conf) {
1592            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1593        }
1594        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1595    }
1596
1597    async fn build_transport(
1598        conf: gaxi::options::ClientConfig,
1599    ) -> crate::ClientBuilderResult<impl super::stub::ExternalVpnGateways> {
1600        super::transport::ExternalVpnGateways::new(conf).await
1601    }
1602
1603    async fn build_with_tracing(
1604        conf: gaxi::options::ClientConfig,
1605    ) -> crate::ClientBuilderResult<impl super::stub::ExternalVpnGateways> {
1606        Self::build_transport(conf)
1607            .await
1608            .map(super::tracing::ExternalVpnGateways::new)
1609    }
1610
1611    /// Deletes the specified externalVpnGateway.
1612    pub fn delete(&self) -> super::builder::external_vpn_gateways::Delete {
1613        super::builder::external_vpn_gateways::Delete::new(self.inner.clone())
1614    }
1615
1616    /// Returns the specified externalVpnGateway. Get a list of available
1617    /// externalVpnGateways by making a list() request.
1618    pub fn get(&self) -> super::builder::external_vpn_gateways::Get {
1619        super::builder::external_vpn_gateways::Get::new(self.inner.clone())
1620    }
1621
1622    /// Creates a ExternalVpnGateway in the specified project using
1623    /// the data included in the request.
1624    pub fn insert(&self) -> super::builder::external_vpn_gateways::Insert {
1625        super::builder::external_vpn_gateways::Insert::new(self.inner.clone())
1626    }
1627
1628    /// Retrieves the list of ExternalVpnGateway available to the specified
1629    /// project.
1630    pub fn list(&self) -> super::builder::external_vpn_gateways::List {
1631        super::builder::external_vpn_gateways::List::new(self.inner.clone())
1632    }
1633
1634    /// Sets the labels on an ExternalVpnGateway. To learn more about labels,
1635    /// read the Labeling
1636    /// Resources documentation.
1637    pub fn set_labels(&self) -> super::builder::external_vpn_gateways::SetLabels {
1638        super::builder::external_vpn_gateways::SetLabels::new(self.inner.clone())
1639    }
1640
1641    /// Returns permissions that a caller has on the specified resource.
1642    pub fn test_iam_permissions(
1643        &self,
1644    ) -> super::builder::external_vpn_gateways::TestIamPermissions {
1645        super::builder::external_vpn_gateways::TestIamPermissions::new(self.inner.clone())
1646    }
1647
1648    /// Retrieves the specified Operations resource.
1649    pub fn get_operation(&self) -> super::builder::external_vpn_gateways::GetOperation {
1650        super::builder::external_vpn_gateways::GetOperation::new(self.inner.clone())
1651    }
1652}
1653
1654/// Implements a client for the Google Compute Engine API.
1655///
1656/// # Example
1657/// ```
1658/// # use google_cloud_compute_v1::client::FirewallPolicies;
1659/// async fn sample(
1660/// ) -> anyhow::Result<()> {
1661///     let client = FirewallPolicies::builder().build().await?;
1662///     // use `client` to make requests to the Google Compute Engine API.
1663///     Ok(())
1664/// }
1665/// ```
1666///
1667/// # Service Description
1668///
1669/// Service for the `firewallPolicies` resource.
1670///
1671/// # Configuration
1672///
1673/// To configure `FirewallPolicies` use the `with_*` methods in the type returned
1674/// by [builder()][FirewallPolicies::builder]. The default configuration should
1675/// work for most applications. Common configuration changes include
1676///
1677/// * [with_endpoint()]: by default this client uses the global default endpoint
1678///   (`https://compute.googleapis.com`). Applications using regional
1679///   endpoints or running in restricted networks (e.g. a network configured
1680//    with [Private Google Access with VPC Service Controls]) may want to
1681///   override this default.
1682/// * [with_credentials()]: by default this client uses
1683///   [Application Default Credentials]. Applications using custom
1684///   authentication may need to override this default.
1685///
1686/// [with_endpoint()]: super::builder::firewall_policies::ClientBuilder::with_endpoint
1687/// [with_credentials()]: super::builder::firewall_policies::ClientBuilder::with_credentials
1688/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1689/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1690///
1691/// # Pooling and Cloning
1692///
1693/// `FirewallPolicies` holds a connection pool internally, it is advised to
1694/// create one and reuse it. You do not need to wrap `FirewallPolicies` in
1695/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1696/// already uses an `Arc` internally.
1697#[cfg(feature = "firewall-policies")]
1698#[cfg_attr(docsrs, doc(cfg(feature = "firewall-policies")))]
1699#[derive(Clone, Debug)]
1700pub struct FirewallPolicies {
1701    inner: std::sync::Arc<dyn super::stub::dynamic::FirewallPolicies>,
1702}
1703
1704#[cfg(feature = "firewall-policies")]
1705impl FirewallPolicies {
1706    /// Returns a builder for [FirewallPolicies].
1707    ///
1708    /// ```
1709    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1710    /// # use google_cloud_compute_v1::client::FirewallPolicies;
1711    /// let client = FirewallPolicies::builder().build().await?;
1712    /// # Ok(()) }
1713    /// ```
1714    pub fn builder() -> super::builder::firewall_policies::ClientBuilder {
1715        crate::new_client_builder(super::builder::firewall_policies::client::Factory)
1716    }
1717
1718    /// Creates a new client from the provided stub.
1719    ///
1720    /// The most common case for calling this function is in tests mocking the
1721    /// client's behavior.
1722    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
1723    where
1724        T: super::stub::FirewallPolicies + 'static,
1725    {
1726        Self { inner: stub.into() }
1727    }
1728
1729    pub(crate) async fn new(
1730        config: gaxi::options::ClientConfig,
1731    ) -> crate::ClientBuilderResult<Self> {
1732        let inner = Self::build_inner(config).await?;
1733        Ok(Self { inner })
1734    }
1735
1736    async fn build_inner(
1737        conf: gaxi::options::ClientConfig,
1738    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::FirewallPolicies>>
1739    {
1740        if gaxi::options::tracing_enabled(&conf) {
1741            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1742        }
1743        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1744    }
1745
1746    async fn build_transport(
1747        conf: gaxi::options::ClientConfig,
1748    ) -> crate::ClientBuilderResult<impl super::stub::FirewallPolicies> {
1749        super::transport::FirewallPolicies::new(conf).await
1750    }
1751
1752    async fn build_with_tracing(
1753        conf: gaxi::options::ClientConfig,
1754    ) -> crate::ClientBuilderResult<impl super::stub::FirewallPolicies> {
1755        Self::build_transport(conf)
1756            .await
1757            .map(super::tracing::FirewallPolicies::new)
1758    }
1759
1760    /// Inserts an association for the specified firewall policy.
1761    pub fn add_association(&self) -> super::builder::firewall_policies::AddAssociation {
1762        super::builder::firewall_policies::AddAssociation::new(self.inner.clone())
1763    }
1764
1765    /// Inserts a rule into a firewall policy.
1766    pub fn add_rule(&self) -> super::builder::firewall_policies::AddRule {
1767        super::builder::firewall_policies::AddRule::new(self.inner.clone())
1768    }
1769
1770    /// Copies rules to the specified firewall policy.
1771    pub fn clone_rules(&self) -> super::builder::firewall_policies::CloneRules {
1772        super::builder::firewall_policies::CloneRules::new(self.inner.clone())
1773    }
1774
1775    /// Deletes the specified policy.
1776    pub fn delete(&self) -> super::builder::firewall_policies::Delete {
1777        super::builder::firewall_policies::Delete::new(self.inner.clone())
1778    }
1779
1780    /// Returns the specified firewall policy.
1781    pub fn get(&self) -> super::builder::firewall_policies::Get {
1782        super::builder::firewall_policies::Get::new(self.inner.clone())
1783    }
1784
1785    /// Gets an association with the specified name.
1786    pub fn get_association(&self) -> super::builder::firewall_policies::GetAssociation {
1787        super::builder::firewall_policies::GetAssociation::new(self.inner.clone())
1788    }
1789
1790    /// Gets the access control policy for a resource. May be empty if no such
1791    /// policy or resource exists.
1792    pub fn get_iam_policy(&self) -> super::builder::firewall_policies::GetIamPolicy {
1793        super::builder::firewall_policies::GetIamPolicy::new(self.inner.clone())
1794    }
1795
1796    /// Gets a rule of the specified priority.
1797    pub fn get_rule(&self) -> super::builder::firewall_policies::GetRule {
1798        super::builder::firewall_policies::GetRule::new(self.inner.clone())
1799    }
1800
1801    /// Creates a new policy in the specified project using the data included in
1802    /// the request.
1803    pub fn insert(&self) -> super::builder::firewall_policies::Insert {
1804        super::builder::firewall_policies::Insert::new(self.inner.clone())
1805    }
1806
1807    /// Lists all the policies that have been configured for the specified
1808    /// folder or organization.
1809    pub fn list(&self) -> super::builder::firewall_policies::List {
1810        super::builder::firewall_policies::List::new(self.inner.clone())
1811    }
1812
1813    /// Lists associations of a specified target, i.e., organization or folder.
1814    pub fn list_associations(&self) -> super::builder::firewall_policies::ListAssociations {
1815        super::builder::firewall_policies::ListAssociations::new(self.inner.clone())
1816    }
1817
1818    /// Moves the specified firewall policy.
1819    pub fn r#move(&self) -> super::builder::firewall_policies::Move {
1820        super::builder::firewall_policies::Move::new(self.inner.clone())
1821    }
1822
1823    /// Patches the specified policy with the data included in the request.
1824    pub fn patch(&self) -> super::builder::firewall_policies::Patch {
1825        super::builder::firewall_policies::Patch::new(self.inner.clone())
1826    }
1827
1828    /// Patches a rule of the specified priority.
1829    pub fn patch_rule(&self) -> super::builder::firewall_policies::PatchRule {
1830        super::builder::firewall_policies::PatchRule::new(self.inner.clone())
1831    }
1832
1833    /// Removes an association for the specified firewall policy.
1834    pub fn remove_association(&self) -> super::builder::firewall_policies::RemoveAssociation {
1835        super::builder::firewall_policies::RemoveAssociation::new(self.inner.clone())
1836    }
1837
1838    /// Deletes a rule of the specified priority.
1839    pub fn remove_rule(&self) -> super::builder::firewall_policies::RemoveRule {
1840        super::builder::firewall_policies::RemoveRule::new(self.inner.clone())
1841    }
1842
1843    /// Sets the access control policy on the specified resource.
1844    /// Replaces any existing policy.
1845    pub fn set_iam_policy(&self) -> super::builder::firewall_policies::SetIamPolicy {
1846        super::builder::firewall_policies::SetIamPolicy::new(self.inner.clone())
1847    }
1848
1849    /// Returns permissions that a caller has on the specified resource.
1850    pub fn test_iam_permissions(&self) -> super::builder::firewall_policies::TestIamPermissions {
1851        super::builder::firewall_policies::TestIamPermissions::new(self.inner.clone())
1852    }
1853
1854    /// Retrieves the specified Operations resource. Gets a list of operations
1855    /// by making a `list()` request.
1856    pub fn get_operation(&self) -> super::builder::firewall_policies::GetOperation {
1857        super::builder::firewall_policies::GetOperation::new(self.inner.clone())
1858    }
1859}
1860
1861/// Implements a client for the Google Compute Engine API.
1862///
1863/// # Example
1864/// ```
1865/// # use google_cloud_compute_v1::client::Firewalls;
1866/// async fn sample(
1867/// ) -> anyhow::Result<()> {
1868///     let client = Firewalls::builder().build().await?;
1869///     // use `client` to make requests to the Google Compute Engine API.
1870///     Ok(())
1871/// }
1872/// ```
1873///
1874/// # Service Description
1875///
1876/// Service for the `firewalls` resource.
1877///
1878/// # Configuration
1879///
1880/// To configure `Firewalls` use the `with_*` methods in the type returned
1881/// by [builder()][Firewalls::builder]. The default configuration should
1882/// work for most applications. Common configuration changes include
1883///
1884/// * [with_endpoint()]: by default this client uses the global default endpoint
1885///   (`https://compute.googleapis.com`). Applications using regional
1886///   endpoints or running in restricted networks (e.g. a network configured
1887//    with [Private Google Access with VPC Service Controls]) may want to
1888///   override this default.
1889/// * [with_credentials()]: by default this client uses
1890///   [Application Default Credentials]. Applications using custom
1891///   authentication may need to override this default.
1892///
1893/// [with_endpoint()]: super::builder::firewalls::ClientBuilder::with_endpoint
1894/// [with_credentials()]: super::builder::firewalls::ClientBuilder::with_credentials
1895/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1896/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1897///
1898/// # Pooling and Cloning
1899///
1900/// `Firewalls` holds a connection pool internally, it is advised to
1901/// create one and reuse it. You do not need to wrap `Firewalls` in
1902/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1903/// already uses an `Arc` internally.
1904#[cfg(feature = "firewalls")]
1905#[cfg_attr(docsrs, doc(cfg(feature = "firewalls")))]
1906#[derive(Clone, Debug)]
1907pub struct Firewalls {
1908    inner: std::sync::Arc<dyn super::stub::dynamic::Firewalls>,
1909}
1910
1911#[cfg(feature = "firewalls")]
1912impl Firewalls {
1913    /// Returns a builder for [Firewalls].
1914    ///
1915    /// ```
1916    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1917    /// # use google_cloud_compute_v1::client::Firewalls;
1918    /// let client = Firewalls::builder().build().await?;
1919    /// # Ok(()) }
1920    /// ```
1921    pub fn builder() -> super::builder::firewalls::ClientBuilder {
1922        crate::new_client_builder(super::builder::firewalls::client::Factory)
1923    }
1924
1925    /// Creates a new client from the provided stub.
1926    ///
1927    /// The most common case for calling this function is in tests mocking the
1928    /// client's behavior.
1929    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
1930    where
1931        T: super::stub::Firewalls + 'static,
1932    {
1933        Self { inner: stub.into() }
1934    }
1935
1936    pub(crate) async fn new(
1937        config: gaxi::options::ClientConfig,
1938    ) -> crate::ClientBuilderResult<Self> {
1939        let inner = Self::build_inner(config).await?;
1940        Ok(Self { inner })
1941    }
1942
1943    async fn build_inner(
1944        conf: gaxi::options::ClientConfig,
1945    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Firewalls>> {
1946        if gaxi::options::tracing_enabled(&conf) {
1947            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1948        }
1949        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1950    }
1951
1952    async fn build_transport(
1953        conf: gaxi::options::ClientConfig,
1954    ) -> crate::ClientBuilderResult<impl super::stub::Firewalls> {
1955        super::transport::Firewalls::new(conf).await
1956    }
1957
1958    async fn build_with_tracing(
1959        conf: gaxi::options::ClientConfig,
1960    ) -> crate::ClientBuilderResult<impl super::stub::Firewalls> {
1961        Self::build_transport(conf)
1962            .await
1963            .map(super::tracing::Firewalls::new)
1964    }
1965
1966    /// Deletes the specified firewall.
1967    pub fn delete(&self) -> super::builder::firewalls::Delete {
1968        super::builder::firewalls::Delete::new(self.inner.clone())
1969    }
1970
1971    /// Returns the specified firewall.
1972    pub fn get(&self) -> super::builder::firewalls::Get {
1973        super::builder::firewalls::Get::new(self.inner.clone())
1974    }
1975
1976    /// Creates a firewall rule in the specified project using the data
1977    /// included in the request.
1978    pub fn insert(&self) -> super::builder::firewalls::Insert {
1979        super::builder::firewalls::Insert::new(self.inner.clone())
1980    }
1981
1982    /// Retrieves the list of firewall rules available to the specified
1983    /// project.
1984    pub fn list(&self) -> super::builder::firewalls::List {
1985        super::builder::firewalls::List::new(self.inner.clone())
1986    }
1987
1988    /// Updates the specified firewall rule with the data included in the
1989    /// request. This method supportsPATCH
1990    /// semantics and uses theJSON merge
1991    /// patch format and processing rules.
1992    pub fn patch(&self) -> super::builder::firewalls::Patch {
1993        super::builder::firewalls::Patch::new(self.inner.clone())
1994    }
1995
1996    /// Returns permissions that a caller has on the specified resource.
1997    pub fn test_iam_permissions(&self) -> super::builder::firewalls::TestIamPermissions {
1998        super::builder::firewalls::TestIamPermissions::new(self.inner.clone())
1999    }
2000
2001    /// Updates the specified firewall rule with the data included in the
2002    /// request.
2003    /// Note that all fields will be updated if using PUT, even fields that are not
2004    /// specified. To update individual fields, please use PATCH instead.
2005    pub fn update(&self) -> super::builder::firewalls::Update {
2006        super::builder::firewalls::Update::new(self.inner.clone())
2007    }
2008
2009    /// Retrieves the specified Operations resource.
2010    pub fn get_operation(&self) -> super::builder::firewalls::GetOperation {
2011        super::builder::firewalls::GetOperation::new(self.inner.clone())
2012    }
2013}
2014
2015/// Implements a client for the Google Compute Engine API.
2016///
2017/// # Example
2018/// ```
2019/// # use google_cloud_compute_v1::client::ForwardingRules;
2020/// async fn sample(
2021/// ) -> anyhow::Result<()> {
2022///     let client = ForwardingRules::builder().build().await?;
2023///     // use `client` to make requests to the Google Compute Engine API.
2024///     Ok(())
2025/// }
2026/// ```
2027///
2028/// # Service Description
2029///
2030/// Service for the `forwardingRules` resource.
2031///
2032/// # Configuration
2033///
2034/// To configure `ForwardingRules` use the `with_*` methods in the type returned
2035/// by [builder()][ForwardingRules::builder]. The default configuration should
2036/// work for most applications. Common configuration changes include
2037///
2038/// * [with_endpoint()]: by default this client uses the global default endpoint
2039///   (`https://compute.googleapis.com`). Applications using regional
2040///   endpoints or running in restricted networks (e.g. a network configured
2041//    with [Private Google Access with VPC Service Controls]) may want to
2042///   override this default.
2043/// * [with_credentials()]: by default this client uses
2044///   [Application Default Credentials]. Applications using custom
2045///   authentication may need to override this default.
2046///
2047/// [with_endpoint()]: super::builder::forwarding_rules::ClientBuilder::with_endpoint
2048/// [with_credentials()]: super::builder::forwarding_rules::ClientBuilder::with_credentials
2049/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2050/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2051///
2052/// # Pooling and Cloning
2053///
2054/// `ForwardingRules` holds a connection pool internally, it is advised to
2055/// create one and reuse it. You do not need to wrap `ForwardingRules` in
2056/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2057/// already uses an `Arc` internally.
2058#[cfg(feature = "forwarding-rules")]
2059#[cfg_attr(docsrs, doc(cfg(feature = "forwarding-rules")))]
2060#[derive(Clone, Debug)]
2061pub struct ForwardingRules {
2062    inner: std::sync::Arc<dyn super::stub::dynamic::ForwardingRules>,
2063}
2064
2065#[cfg(feature = "forwarding-rules")]
2066impl ForwardingRules {
2067    /// Returns a builder for [ForwardingRules].
2068    ///
2069    /// ```
2070    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2071    /// # use google_cloud_compute_v1::client::ForwardingRules;
2072    /// let client = ForwardingRules::builder().build().await?;
2073    /// # Ok(()) }
2074    /// ```
2075    pub fn builder() -> super::builder::forwarding_rules::ClientBuilder {
2076        crate::new_client_builder(super::builder::forwarding_rules::client::Factory)
2077    }
2078
2079    /// Creates a new client from the provided stub.
2080    ///
2081    /// The most common case for calling this function is in tests mocking the
2082    /// client's behavior.
2083    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
2084    where
2085        T: super::stub::ForwardingRules + 'static,
2086    {
2087        Self { inner: stub.into() }
2088    }
2089
2090    pub(crate) async fn new(
2091        config: gaxi::options::ClientConfig,
2092    ) -> crate::ClientBuilderResult<Self> {
2093        let inner = Self::build_inner(config).await?;
2094        Ok(Self { inner })
2095    }
2096
2097    async fn build_inner(
2098        conf: gaxi::options::ClientConfig,
2099    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ForwardingRules>> {
2100        if gaxi::options::tracing_enabled(&conf) {
2101            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2102        }
2103        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2104    }
2105
2106    async fn build_transport(
2107        conf: gaxi::options::ClientConfig,
2108    ) -> crate::ClientBuilderResult<impl super::stub::ForwardingRules> {
2109        super::transport::ForwardingRules::new(conf).await
2110    }
2111
2112    async fn build_with_tracing(
2113        conf: gaxi::options::ClientConfig,
2114    ) -> crate::ClientBuilderResult<impl super::stub::ForwardingRules> {
2115        Self::build_transport(conf)
2116            .await
2117            .map(super::tracing::ForwardingRules::new)
2118    }
2119
2120    /// Retrieves an aggregated list of forwarding rules.
2121    ///
2122    /// To prevent failure, it is recommended that you set the
2123    /// `returnPartialSuccess` parameter to `true`.
2124    pub fn aggregated_list(&self) -> super::builder::forwarding_rules::AggregatedList {
2125        super::builder::forwarding_rules::AggregatedList::new(self.inner.clone())
2126    }
2127
2128    /// Deletes the specified ForwardingRule resource.
2129    pub fn delete(&self) -> super::builder::forwarding_rules::Delete {
2130        super::builder::forwarding_rules::Delete::new(self.inner.clone())
2131    }
2132
2133    /// Returns the specified ForwardingRule resource.
2134    pub fn get(&self) -> super::builder::forwarding_rules::Get {
2135        super::builder::forwarding_rules::Get::new(self.inner.clone())
2136    }
2137
2138    /// Creates a ForwardingRule resource in the specified project and region using
2139    /// the data included in the request.
2140    pub fn insert(&self) -> super::builder::forwarding_rules::Insert {
2141        super::builder::forwarding_rules::Insert::new(self.inner.clone())
2142    }
2143
2144    /// Retrieves a list of ForwardingRule resources available to the specified
2145    /// project and region.
2146    pub fn list(&self) -> super::builder::forwarding_rules::List {
2147        super::builder::forwarding_rules::List::new(self.inner.clone())
2148    }
2149
2150    /// Updates the specified forwarding rule with the data included in the
2151    /// request. This method supportsPATCH
2152    /// semantics and uses theJSON merge
2153    /// patch format and processing rules. Currently, you can only
2154    /// patch the network_tier field.
2155    pub fn patch(&self) -> super::builder::forwarding_rules::Patch {
2156        super::builder::forwarding_rules::Patch::new(self.inner.clone())
2157    }
2158
2159    /// Sets the labels on the specified resource. To learn more about labels,
2160    /// read the
2161    /// Labeling Resources documentation.
2162    pub fn set_labels(&self) -> super::builder::forwarding_rules::SetLabels {
2163        super::builder::forwarding_rules::SetLabels::new(self.inner.clone())
2164    }
2165
2166    /// Changes target URL for forwarding rule. The new target should be of the
2167    /// same type as the old target.
2168    pub fn set_target(&self) -> super::builder::forwarding_rules::SetTarget {
2169        super::builder::forwarding_rules::SetTarget::new(self.inner.clone())
2170    }
2171
2172    /// Retrieves the specified region-specific Operations resource.
2173    pub fn get_operation(&self) -> super::builder::forwarding_rules::GetOperation {
2174        super::builder::forwarding_rules::GetOperation::new(self.inner.clone())
2175    }
2176}
2177
2178/// Implements a client for the Google Compute Engine API.
2179///
2180/// # Example
2181/// ```
2182/// # use google_cloud_compute_v1::client::FutureReservations;
2183/// async fn sample(
2184/// ) -> anyhow::Result<()> {
2185///     let client = FutureReservations::builder().build().await?;
2186///     // use `client` to make requests to the Google Compute Engine API.
2187///     Ok(())
2188/// }
2189/// ```
2190///
2191/// # Service Description
2192///
2193/// Service for the `futureReservations` resource.
2194///
2195/// # Configuration
2196///
2197/// To configure `FutureReservations` use the `with_*` methods in the type returned
2198/// by [builder()][FutureReservations::builder]. The default configuration should
2199/// work for most applications. Common configuration changes include
2200///
2201/// * [with_endpoint()]: by default this client uses the global default endpoint
2202///   (`https://compute.googleapis.com`). Applications using regional
2203///   endpoints or running in restricted networks (e.g. a network configured
2204//    with [Private Google Access with VPC Service Controls]) may want to
2205///   override this default.
2206/// * [with_credentials()]: by default this client uses
2207///   [Application Default Credentials]. Applications using custom
2208///   authentication may need to override this default.
2209///
2210/// [with_endpoint()]: super::builder::future_reservations::ClientBuilder::with_endpoint
2211/// [with_credentials()]: super::builder::future_reservations::ClientBuilder::with_credentials
2212/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2213/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2214///
2215/// # Pooling and Cloning
2216///
2217/// `FutureReservations` holds a connection pool internally, it is advised to
2218/// create one and reuse it. You do not need to wrap `FutureReservations` in
2219/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2220/// already uses an `Arc` internally.
2221#[cfg(feature = "future-reservations")]
2222#[cfg_attr(docsrs, doc(cfg(feature = "future-reservations")))]
2223#[derive(Clone, Debug)]
2224pub struct FutureReservations {
2225    inner: std::sync::Arc<dyn super::stub::dynamic::FutureReservations>,
2226}
2227
2228#[cfg(feature = "future-reservations")]
2229impl FutureReservations {
2230    /// Returns a builder for [FutureReservations].
2231    ///
2232    /// ```
2233    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2234    /// # use google_cloud_compute_v1::client::FutureReservations;
2235    /// let client = FutureReservations::builder().build().await?;
2236    /// # Ok(()) }
2237    /// ```
2238    pub fn builder() -> super::builder::future_reservations::ClientBuilder {
2239        crate::new_client_builder(super::builder::future_reservations::client::Factory)
2240    }
2241
2242    /// Creates a new client from the provided stub.
2243    ///
2244    /// The most common case for calling this function is in tests mocking the
2245    /// client's behavior.
2246    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
2247    where
2248        T: super::stub::FutureReservations + 'static,
2249    {
2250        Self { inner: stub.into() }
2251    }
2252
2253    pub(crate) async fn new(
2254        config: gaxi::options::ClientConfig,
2255    ) -> crate::ClientBuilderResult<Self> {
2256        let inner = Self::build_inner(config).await?;
2257        Ok(Self { inner })
2258    }
2259
2260    async fn build_inner(
2261        conf: gaxi::options::ClientConfig,
2262    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::FutureReservations>>
2263    {
2264        if gaxi::options::tracing_enabled(&conf) {
2265            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2266        }
2267        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2268    }
2269
2270    async fn build_transport(
2271        conf: gaxi::options::ClientConfig,
2272    ) -> crate::ClientBuilderResult<impl super::stub::FutureReservations> {
2273        super::transport::FutureReservations::new(conf).await
2274    }
2275
2276    async fn build_with_tracing(
2277        conf: gaxi::options::ClientConfig,
2278    ) -> crate::ClientBuilderResult<impl super::stub::FutureReservations> {
2279        Self::build_transport(conf)
2280            .await
2281            .map(super::tracing::FutureReservations::new)
2282    }
2283
2284    /// Retrieves an aggregated list of future reservations.
2285    ///
2286    /// To prevent failure, it is recommended that you set the
2287    /// `returnPartialSuccess` parameter to `true`.
2288    pub fn aggregated_list(&self) -> super::builder::future_reservations::AggregatedList {
2289        super::builder::future_reservations::AggregatedList::new(self.inner.clone())
2290    }
2291
2292    /// Cancel the specified future reservation.
2293    pub fn cancel(&self) -> super::builder::future_reservations::Cancel {
2294        super::builder::future_reservations::Cancel::new(self.inner.clone())
2295    }
2296
2297    /// Deletes the specified future reservation.
2298    pub fn delete(&self) -> super::builder::future_reservations::Delete {
2299        super::builder::future_reservations::Delete::new(self.inner.clone())
2300    }
2301
2302    /// Retrieves information about the specified future reservation.
2303    pub fn get(&self) -> super::builder::future_reservations::Get {
2304        super::builder::future_reservations::Get::new(self.inner.clone())
2305    }
2306
2307    /// Creates a new Future Reservation.
2308    pub fn insert(&self) -> super::builder::future_reservations::Insert {
2309        super::builder::future_reservations::Insert::new(self.inner.clone())
2310    }
2311
2312    /// A list of all the future reservations that have been configured for the
2313    /// specified project in specified zone.
2314    pub fn list(&self) -> super::builder::future_reservations::List {
2315        super::builder::future_reservations::List::new(self.inner.clone())
2316    }
2317
2318    /// Updates the specified future reservation.
2319    pub fn update(&self) -> super::builder::future_reservations::Update {
2320        super::builder::future_reservations::Update::new(self.inner.clone())
2321    }
2322
2323    /// Retrieves the specified zone-specific Operations resource.
2324    pub fn get_operation(&self) -> super::builder::future_reservations::GetOperation {
2325        super::builder::future_reservations::GetOperation::new(self.inner.clone())
2326    }
2327}
2328
2329/// Implements a client for the Google Compute Engine API.
2330///
2331/// # Example
2332/// ```
2333/// # use google_cloud_compute_v1::client::GlobalAddresses;
2334/// async fn sample(
2335/// ) -> anyhow::Result<()> {
2336///     let client = GlobalAddresses::builder().build().await?;
2337///     // use `client` to make requests to the Google Compute Engine API.
2338///     Ok(())
2339/// }
2340/// ```
2341///
2342/// # Service Description
2343///
2344/// Service for the `globalAddresses` resource.
2345///
2346/// # Configuration
2347///
2348/// To configure `GlobalAddresses` use the `with_*` methods in the type returned
2349/// by [builder()][GlobalAddresses::builder]. The default configuration should
2350/// work for most applications. Common configuration changes include
2351///
2352/// * [with_endpoint()]: by default this client uses the global default endpoint
2353///   (`https://compute.googleapis.com`). Applications using regional
2354///   endpoints or running in restricted networks (e.g. a network configured
2355//    with [Private Google Access with VPC Service Controls]) may want to
2356///   override this default.
2357/// * [with_credentials()]: by default this client uses
2358///   [Application Default Credentials]. Applications using custom
2359///   authentication may need to override this default.
2360///
2361/// [with_endpoint()]: super::builder::global_addresses::ClientBuilder::with_endpoint
2362/// [with_credentials()]: super::builder::global_addresses::ClientBuilder::with_credentials
2363/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2364/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2365///
2366/// # Pooling and Cloning
2367///
2368/// `GlobalAddresses` holds a connection pool internally, it is advised to
2369/// create one and reuse it. You do not need to wrap `GlobalAddresses` in
2370/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2371/// already uses an `Arc` internally.
2372#[cfg(feature = "global-addresses")]
2373#[cfg_attr(docsrs, doc(cfg(feature = "global-addresses")))]
2374#[derive(Clone, Debug)]
2375pub struct GlobalAddresses {
2376    inner: std::sync::Arc<dyn super::stub::dynamic::GlobalAddresses>,
2377}
2378
2379#[cfg(feature = "global-addresses")]
2380impl GlobalAddresses {
2381    /// Returns a builder for [GlobalAddresses].
2382    ///
2383    /// ```
2384    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2385    /// # use google_cloud_compute_v1::client::GlobalAddresses;
2386    /// let client = GlobalAddresses::builder().build().await?;
2387    /// # Ok(()) }
2388    /// ```
2389    pub fn builder() -> super::builder::global_addresses::ClientBuilder {
2390        crate::new_client_builder(super::builder::global_addresses::client::Factory)
2391    }
2392
2393    /// Creates a new client from the provided stub.
2394    ///
2395    /// The most common case for calling this function is in tests mocking the
2396    /// client's behavior.
2397    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
2398    where
2399        T: super::stub::GlobalAddresses + 'static,
2400    {
2401        Self { inner: stub.into() }
2402    }
2403
2404    pub(crate) async fn new(
2405        config: gaxi::options::ClientConfig,
2406    ) -> crate::ClientBuilderResult<Self> {
2407        let inner = Self::build_inner(config).await?;
2408        Ok(Self { inner })
2409    }
2410
2411    async fn build_inner(
2412        conf: gaxi::options::ClientConfig,
2413    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::GlobalAddresses>> {
2414        if gaxi::options::tracing_enabled(&conf) {
2415            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2416        }
2417        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2418    }
2419
2420    async fn build_transport(
2421        conf: gaxi::options::ClientConfig,
2422    ) -> crate::ClientBuilderResult<impl super::stub::GlobalAddresses> {
2423        super::transport::GlobalAddresses::new(conf).await
2424    }
2425
2426    async fn build_with_tracing(
2427        conf: gaxi::options::ClientConfig,
2428    ) -> crate::ClientBuilderResult<impl super::stub::GlobalAddresses> {
2429        Self::build_transport(conf)
2430            .await
2431            .map(super::tracing::GlobalAddresses::new)
2432    }
2433
2434    /// Deletes the specified address resource.
2435    pub fn delete(&self) -> super::builder::global_addresses::Delete {
2436        super::builder::global_addresses::Delete::new(self.inner.clone())
2437    }
2438
2439    /// Returns the specified address resource.
2440    pub fn get(&self) -> super::builder::global_addresses::Get {
2441        super::builder::global_addresses::Get::new(self.inner.clone())
2442    }
2443
2444    /// Creates an address resource in the specified project by using the data
2445    /// included in the request.
2446    pub fn insert(&self) -> super::builder::global_addresses::Insert {
2447        super::builder::global_addresses::Insert::new(self.inner.clone())
2448    }
2449
2450    /// Retrieves a list of global addresses.
2451    pub fn list(&self) -> super::builder::global_addresses::List {
2452        super::builder::global_addresses::List::new(self.inner.clone())
2453    }
2454
2455    /// Moves the specified address resource from one project to another project.
2456    pub fn r#move(&self) -> super::builder::global_addresses::Move {
2457        super::builder::global_addresses::Move::new(self.inner.clone())
2458    }
2459
2460    /// Sets the labels on a GlobalAddress. To learn more about labels, read theLabeling
2461    /// Resources documentation.
2462    pub fn set_labels(&self) -> super::builder::global_addresses::SetLabels {
2463        super::builder::global_addresses::SetLabels::new(self.inner.clone())
2464    }
2465
2466    /// Returns permissions that a caller has on the specified resource.
2467    pub fn test_iam_permissions(&self) -> super::builder::global_addresses::TestIamPermissions {
2468        super::builder::global_addresses::TestIamPermissions::new(self.inner.clone())
2469    }
2470
2471    /// Retrieves the specified Operations resource.
2472    pub fn get_operation(&self) -> super::builder::global_addresses::GetOperation {
2473        super::builder::global_addresses::GetOperation::new(self.inner.clone())
2474    }
2475}
2476
2477/// Implements a client for the Google Compute Engine API.
2478///
2479/// # Example
2480/// ```
2481/// # use google_cloud_compute_v1::client::GlobalForwardingRules;
2482/// async fn sample(
2483/// ) -> anyhow::Result<()> {
2484///     let client = GlobalForwardingRules::builder().build().await?;
2485///     // use `client` to make requests to the Google Compute Engine API.
2486///     Ok(())
2487/// }
2488/// ```
2489///
2490/// # Service Description
2491///
2492/// Service for the `globalForwardingRules` resource.
2493///
2494/// # Configuration
2495///
2496/// To configure `GlobalForwardingRules` use the `with_*` methods in the type returned
2497/// by [builder()][GlobalForwardingRules::builder]. The default configuration should
2498/// work for most applications. Common configuration changes include
2499///
2500/// * [with_endpoint()]: by default this client uses the global default endpoint
2501///   (`https://compute.googleapis.com`). Applications using regional
2502///   endpoints or running in restricted networks (e.g. a network configured
2503//    with [Private Google Access with VPC Service Controls]) may want to
2504///   override this default.
2505/// * [with_credentials()]: by default this client uses
2506///   [Application Default Credentials]. Applications using custom
2507///   authentication may need to override this default.
2508///
2509/// [with_endpoint()]: super::builder::global_forwarding_rules::ClientBuilder::with_endpoint
2510/// [with_credentials()]: super::builder::global_forwarding_rules::ClientBuilder::with_credentials
2511/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2512/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2513///
2514/// # Pooling and Cloning
2515///
2516/// `GlobalForwardingRules` holds a connection pool internally, it is advised to
2517/// create one and reuse it. You do not need to wrap `GlobalForwardingRules` in
2518/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2519/// already uses an `Arc` internally.
2520#[cfg(feature = "global-forwarding-rules")]
2521#[cfg_attr(docsrs, doc(cfg(feature = "global-forwarding-rules")))]
2522#[derive(Clone, Debug)]
2523pub struct GlobalForwardingRules {
2524    inner: std::sync::Arc<dyn super::stub::dynamic::GlobalForwardingRules>,
2525}
2526
2527#[cfg(feature = "global-forwarding-rules")]
2528impl GlobalForwardingRules {
2529    /// Returns a builder for [GlobalForwardingRules].
2530    ///
2531    /// ```
2532    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2533    /// # use google_cloud_compute_v1::client::GlobalForwardingRules;
2534    /// let client = GlobalForwardingRules::builder().build().await?;
2535    /// # Ok(()) }
2536    /// ```
2537    pub fn builder() -> super::builder::global_forwarding_rules::ClientBuilder {
2538        crate::new_client_builder(super::builder::global_forwarding_rules::client::Factory)
2539    }
2540
2541    /// Creates a new client from the provided stub.
2542    ///
2543    /// The most common case for calling this function is in tests mocking the
2544    /// client's behavior.
2545    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
2546    where
2547        T: super::stub::GlobalForwardingRules + 'static,
2548    {
2549        Self { inner: stub.into() }
2550    }
2551
2552    pub(crate) async fn new(
2553        config: gaxi::options::ClientConfig,
2554    ) -> crate::ClientBuilderResult<Self> {
2555        let inner = Self::build_inner(config).await?;
2556        Ok(Self { inner })
2557    }
2558
2559    async fn build_inner(
2560        conf: gaxi::options::ClientConfig,
2561    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::GlobalForwardingRules>>
2562    {
2563        if gaxi::options::tracing_enabled(&conf) {
2564            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2565        }
2566        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2567    }
2568
2569    async fn build_transport(
2570        conf: gaxi::options::ClientConfig,
2571    ) -> crate::ClientBuilderResult<impl super::stub::GlobalForwardingRules> {
2572        super::transport::GlobalForwardingRules::new(conf).await
2573    }
2574
2575    async fn build_with_tracing(
2576        conf: gaxi::options::ClientConfig,
2577    ) -> crate::ClientBuilderResult<impl super::stub::GlobalForwardingRules> {
2578        Self::build_transport(conf)
2579            .await
2580            .map(super::tracing::GlobalForwardingRules::new)
2581    }
2582
2583    /// Deletes the specified GlobalForwardingRule resource.
2584    pub fn delete(&self) -> super::builder::global_forwarding_rules::Delete {
2585        super::builder::global_forwarding_rules::Delete::new(self.inner.clone())
2586    }
2587
2588    /// Returns the specified GlobalForwardingRule resource. Gets a list of
2589    /// available forwarding rules by making a list() request.
2590    pub fn get(&self) -> super::builder::global_forwarding_rules::Get {
2591        super::builder::global_forwarding_rules::Get::new(self.inner.clone())
2592    }
2593
2594    /// Creates a GlobalForwardingRule resource in the specified project using
2595    /// the data included in the request.
2596    pub fn insert(&self) -> super::builder::global_forwarding_rules::Insert {
2597        super::builder::global_forwarding_rules::Insert::new(self.inner.clone())
2598    }
2599
2600    /// Retrieves a list of GlobalForwardingRule resources available to the
2601    /// specified project.
2602    pub fn list(&self) -> super::builder::global_forwarding_rules::List {
2603        super::builder::global_forwarding_rules::List::new(self.inner.clone())
2604    }
2605
2606    /// Updates the specified forwarding rule with the data included in the
2607    /// request. This method supportsPATCH
2608    /// semantics and uses theJSON merge
2609    /// patch format and processing rules. Currently, you can only
2610    /// patch the network_tier field.
2611    pub fn patch(&self) -> super::builder::global_forwarding_rules::Patch {
2612        super::builder::global_forwarding_rules::Patch::new(self.inner.clone())
2613    }
2614
2615    /// Sets the labels on the specified resource. To learn more about labels,
2616    /// read the
2617    /// Labeling resources documentation.
2618    pub fn set_labels(&self) -> super::builder::global_forwarding_rules::SetLabels {
2619        super::builder::global_forwarding_rules::SetLabels::new(self.inner.clone())
2620    }
2621
2622    /// Changes target URL for the GlobalForwardingRule resource. The new target
2623    /// should be of the same type as the old target.
2624    pub fn set_target(&self) -> super::builder::global_forwarding_rules::SetTarget {
2625        super::builder::global_forwarding_rules::SetTarget::new(self.inner.clone())
2626    }
2627
2628    /// Retrieves the specified Operations resource.
2629    pub fn get_operation(&self) -> super::builder::global_forwarding_rules::GetOperation {
2630        super::builder::global_forwarding_rules::GetOperation::new(self.inner.clone())
2631    }
2632}
2633
2634/// Implements a client for the Google Compute Engine API.
2635///
2636/// # Example
2637/// ```
2638/// # use google_cloud_compute_v1::client::GlobalNetworkEndpointGroups;
2639/// async fn sample(
2640/// ) -> anyhow::Result<()> {
2641///     let client = GlobalNetworkEndpointGroups::builder().build().await?;
2642///     // use `client` to make requests to the Google Compute Engine API.
2643///     Ok(())
2644/// }
2645/// ```
2646///
2647/// # Service Description
2648///
2649/// Service for the `globalNetworkEndpointGroups` resource.
2650///
2651/// # Configuration
2652///
2653/// To configure `GlobalNetworkEndpointGroups` use the `with_*` methods in the type returned
2654/// by [builder()][GlobalNetworkEndpointGroups::builder]. The default configuration should
2655/// work for most applications. Common configuration changes include
2656///
2657/// * [with_endpoint()]: by default this client uses the global default endpoint
2658///   (`https://compute.googleapis.com`). Applications using regional
2659///   endpoints or running in restricted networks (e.g. a network configured
2660//    with [Private Google Access with VPC Service Controls]) may want to
2661///   override this default.
2662/// * [with_credentials()]: by default this client uses
2663///   [Application Default Credentials]. Applications using custom
2664///   authentication may need to override this default.
2665///
2666/// [with_endpoint()]: super::builder::global_network_endpoint_groups::ClientBuilder::with_endpoint
2667/// [with_credentials()]: super::builder::global_network_endpoint_groups::ClientBuilder::with_credentials
2668/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2669/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2670///
2671/// # Pooling and Cloning
2672///
2673/// `GlobalNetworkEndpointGroups` holds a connection pool internally, it is advised to
2674/// create one and reuse it. You do not need to wrap `GlobalNetworkEndpointGroups` in
2675/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2676/// already uses an `Arc` internally.
2677#[cfg(feature = "global-network-endpoint-groups")]
2678#[cfg_attr(docsrs, doc(cfg(feature = "global-network-endpoint-groups")))]
2679#[derive(Clone, Debug)]
2680pub struct GlobalNetworkEndpointGroups {
2681    inner: std::sync::Arc<dyn super::stub::dynamic::GlobalNetworkEndpointGroups>,
2682}
2683
2684#[cfg(feature = "global-network-endpoint-groups")]
2685impl GlobalNetworkEndpointGroups {
2686    /// Returns a builder for [GlobalNetworkEndpointGroups].
2687    ///
2688    /// ```
2689    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2690    /// # use google_cloud_compute_v1::client::GlobalNetworkEndpointGroups;
2691    /// let client = GlobalNetworkEndpointGroups::builder().build().await?;
2692    /// # Ok(()) }
2693    /// ```
2694    pub fn builder() -> super::builder::global_network_endpoint_groups::ClientBuilder {
2695        crate::new_client_builder(super::builder::global_network_endpoint_groups::client::Factory)
2696    }
2697
2698    /// Creates a new client from the provided stub.
2699    ///
2700    /// The most common case for calling this function is in tests mocking the
2701    /// client's behavior.
2702    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
2703    where
2704        T: super::stub::GlobalNetworkEndpointGroups + 'static,
2705    {
2706        Self { inner: stub.into() }
2707    }
2708
2709    pub(crate) async fn new(
2710        config: gaxi::options::ClientConfig,
2711    ) -> crate::ClientBuilderResult<Self> {
2712        let inner = Self::build_inner(config).await?;
2713        Ok(Self { inner })
2714    }
2715
2716    async fn build_inner(
2717        conf: gaxi::options::ClientConfig,
2718    ) -> crate::ClientBuilderResult<
2719        std::sync::Arc<dyn super::stub::dynamic::GlobalNetworkEndpointGroups>,
2720    > {
2721        if gaxi::options::tracing_enabled(&conf) {
2722            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2723        }
2724        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2725    }
2726
2727    async fn build_transport(
2728        conf: gaxi::options::ClientConfig,
2729    ) -> crate::ClientBuilderResult<impl super::stub::GlobalNetworkEndpointGroups> {
2730        super::transport::GlobalNetworkEndpointGroups::new(conf).await
2731    }
2732
2733    async fn build_with_tracing(
2734        conf: gaxi::options::ClientConfig,
2735    ) -> crate::ClientBuilderResult<impl super::stub::GlobalNetworkEndpointGroups> {
2736        Self::build_transport(conf)
2737            .await
2738            .map(super::tracing::GlobalNetworkEndpointGroups::new)
2739    }
2740
2741    /// Attach a network endpoint to the specified network endpoint group.
2742    pub fn attach_network_endpoints(
2743        &self,
2744    ) -> super::builder::global_network_endpoint_groups::AttachNetworkEndpoints {
2745        super::builder::global_network_endpoint_groups::AttachNetworkEndpoints::new(
2746            self.inner.clone(),
2747        )
2748    }
2749
2750    /// Deletes the specified network endpoint group.Note that the NEG cannot be
2751    /// deleted if there are backend services referencing it.
2752    pub fn delete(&self) -> super::builder::global_network_endpoint_groups::Delete {
2753        super::builder::global_network_endpoint_groups::Delete::new(self.inner.clone())
2754    }
2755
2756    /// Detach the network endpoint from the specified network endpoint group.
2757    pub fn detach_network_endpoints(
2758        &self,
2759    ) -> super::builder::global_network_endpoint_groups::DetachNetworkEndpoints {
2760        super::builder::global_network_endpoint_groups::DetachNetworkEndpoints::new(
2761            self.inner.clone(),
2762        )
2763    }
2764
2765    /// Returns the specified network endpoint group.
2766    pub fn get(&self) -> super::builder::global_network_endpoint_groups::Get {
2767        super::builder::global_network_endpoint_groups::Get::new(self.inner.clone())
2768    }
2769
2770    /// Creates a network endpoint group in the specified project using the
2771    /// parameters that are included in the request.
2772    ///
2773    /// Note: Use the following APIs to manage network endpoint groups:
2774    ///
2775    /// - To manage NEGs with zonal scope (such as zonal NEGs, hybrid connectivity
2776    ///   NEGs): zonal
2777    ///   API
2778    /// - To manage NEGs with regional scope (such as regional internet NEGs,
2779    ///   serverless NEGs, Private Service Connect NEGs): regional
2780    ///   API
2781    /// - To manage NEGs with global scope (such as global internet NEGs):global
2782    ///   API
2783    pub fn insert(&self) -> super::builder::global_network_endpoint_groups::Insert {
2784        super::builder::global_network_endpoint_groups::Insert::new(self.inner.clone())
2785    }
2786
2787    /// Retrieves the list of network endpoint groups that are located in the
2788    /// specified project.
2789    pub fn list(&self) -> super::builder::global_network_endpoint_groups::List {
2790        super::builder::global_network_endpoint_groups::List::new(self.inner.clone())
2791    }
2792
2793    /// Lists the network endpoints in the specified network endpoint group.
2794    pub fn list_network_endpoints(
2795        &self,
2796    ) -> super::builder::global_network_endpoint_groups::ListNetworkEndpoints {
2797        super::builder::global_network_endpoint_groups::ListNetworkEndpoints::new(
2798            self.inner.clone(),
2799        )
2800    }
2801
2802    /// Retrieves the specified Operations resource.
2803    pub fn get_operation(&self) -> super::builder::global_network_endpoint_groups::GetOperation {
2804        super::builder::global_network_endpoint_groups::GetOperation::new(self.inner.clone())
2805    }
2806}
2807
2808/// Implements a client for the Google Compute Engine API.
2809///
2810/// # Example
2811/// ```
2812/// # use google_cloud_compute_v1::client::GlobalOperations;
2813/// async fn sample(
2814/// ) -> anyhow::Result<()> {
2815///     let client = GlobalOperations::builder().build().await?;
2816///     // use `client` to make requests to the Google Compute Engine API.
2817///     Ok(())
2818/// }
2819/// ```
2820///
2821/// # Service Description
2822///
2823/// Service for the `globalOperations` resource.
2824///
2825/// # Configuration
2826///
2827/// To configure `GlobalOperations` use the `with_*` methods in the type returned
2828/// by [builder()][GlobalOperations::builder]. The default configuration should
2829/// work for most applications. Common configuration changes include
2830///
2831/// * [with_endpoint()]: by default this client uses the global default endpoint
2832///   (`https://compute.googleapis.com`). Applications using regional
2833///   endpoints or running in restricted networks (e.g. a network configured
2834//    with [Private Google Access with VPC Service Controls]) may want to
2835///   override this default.
2836/// * [with_credentials()]: by default this client uses
2837///   [Application Default Credentials]. Applications using custom
2838///   authentication may need to override this default.
2839///
2840/// [with_endpoint()]: super::builder::global_operations::ClientBuilder::with_endpoint
2841/// [with_credentials()]: super::builder::global_operations::ClientBuilder::with_credentials
2842/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2843/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2844///
2845/// # Pooling and Cloning
2846///
2847/// `GlobalOperations` holds a connection pool internally, it is advised to
2848/// create one and reuse it. You do not need to wrap `GlobalOperations` in
2849/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2850/// already uses an `Arc` internally.
2851#[cfg(feature = "global-operations")]
2852#[cfg_attr(docsrs, doc(cfg(feature = "global-operations")))]
2853#[derive(Clone, Debug)]
2854pub struct GlobalOperations {
2855    inner: std::sync::Arc<dyn super::stub::dynamic::GlobalOperations>,
2856}
2857
2858#[cfg(feature = "global-operations")]
2859impl GlobalOperations {
2860    /// Returns a builder for [GlobalOperations].
2861    ///
2862    /// ```
2863    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2864    /// # use google_cloud_compute_v1::client::GlobalOperations;
2865    /// let client = GlobalOperations::builder().build().await?;
2866    /// # Ok(()) }
2867    /// ```
2868    pub fn builder() -> super::builder::global_operations::ClientBuilder {
2869        crate::new_client_builder(super::builder::global_operations::client::Factory)
2870    }
2871
2872    /// Creates a new client from the provided stub.
2873    ///
2874    /// The most common case for calling this function is in tests mocking the
2875    /// client's behavior.
2876    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
2877    where
2878        T: super::stub::GlobalOperations + 'static,
2879    {
2880        Self { inner: stub.into() }
2881    }
2882
2883    pub(crate) async fn new(
2884        config: gaxi::options::ClientConfig,
2885    ) -> crate::ClientBuilderResult<Self> {
2886        let inner = Self::build_inner(config).await?;
2887        Ok(Self { inner })
2888    }
2889
2890    async fn build_inner(
2891        conf: gaxi::options::ClientConfig,
2892    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::GlobalOperations>>
2893    {
2894        if gaxi::options::tracing_enabled(&conf) {
2895            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2896        }
2897        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2898    }
2899
2900    async fn build_transport(
2901        conf: gaxi::options::ClientConfig,
2902    ) -> crate::ClientBuilderResult<impl super::stub::GlobalOperations> {
2903        super::transport::GlobalOperations::new(conf).await
2904    }
2905
2906    async fn build_with_tracing(
2907        conf: gaxi::options::ClientConfig,
2908    ) -> crate::ClientBuilderResult<impl super::stub::GlobalOperations> {
2909        Self::build_transport(conf)
2910            .await
2911            .map(super::tracing::GlobalOperations::new)
2912    }
2913
2914    /// Retrieves an aggregated list of all operations.
2915    ///
2916    /// To prevent failure, Google recommends that you set the
2917    /// `returnPartialSuccess` parameter to `true`.
2918    pub fn aggregated_list(&self) -> super::builder::global_operations::AggregatedList {
2919        super::builder::global_operations::AggregatedList::new(self.inner.clone())
2920    }
2921
2922    /// Deletes the specified Operations resource.
2923    pub fn delete(&self) -> super::builder::global_operations::Delete {
2924        super::builder::global_operations::Delete::new(self.inner.clone())
2925    }
2926
2927    /// Retrieves the specified Operations resource.
2928    pub fn get(&self) -> super::builder::global_operations::Get {
2929        super::builder::global_operations::Get::new(self.inner.clone())
2930    }
2931
2932    /// Retrieves a list of Operation resources contained within the specified
2933    /// project.
2934    pub fn list(&self) -> super::builder::global_operations::List {
2935        super::builder::global_operations::List::new(self.inner.clone())
2936    }
2937
2938    /// Waits for the specified Operation resource to return as `DONE`
2939    /// or for the request to approach the 2 minute deadline, and retrieves the
2940    /// specified Operation resource. This method differs from the
2941    /// `GET` method in that it waits for no more than the default
2942    /// deadline (2 minutes) and then returns the current state of the operation,
2943    /// which might be `DONE` or still in progress.
2944    ///
2945    /// This method is called on a best-effort basis. Specifically:
2946    ///
2947    /// ```norust
2948    /// - In uncommon cases, when the server is overloaded, the request might
2949    /// return before the default deadline is reached, or might return after zero
2950    /// seconds.
2951    /// ```
2952    ///
2953    /// - If the default deadline is reached, there is no guarantee that the
2954    ///   operation is actually done when the method returns. Be prepared to retry
2955    ///   if the operation is not `DONE`.
2956    pub fn wait(&self) -> super::builder::global_operations::Wait {
2957        super::builder::global_operations::Wait::new(self.inner.clone())
2958    }
2959}
2960
2961/// Implements a client for the Google Compute Engine API.
2962///
2963/// # Example
2964/// ```
2965/// # use google_cloud_compute_v1::client::GlobalOrganizationOperations;
2966/// async fn sample(
2967/// ) -> anyhow::Result<()> {
2968///     let client = GlobalOrganizationOperations::builder().build().await?;
2969///     // use `client` to make requests to the Google Compute Engine API.
2970///     Ok(())
2971/// }
2972/// ```
2973///
2974/// # Service Description
2975///
2976/// Service for the `globalOrganizationOperations` resource.
2977///
2978/// # Configuration
2979///
2980/// To configure `GlobalOrganizationOperations` use the `with_*` methods in the type returned
2981/// by [builder()][GlobalOrganizationOperations::builder]. The default configuration should
2982/// work for most applications. Common configuration changes include
2983///
2984/// * [with_endpoint()]: by default this client uses the global default endpoint
2985///   (`https://compute.googleapis.com`). Applications using regional
2986///   endpoints or running in restricted networks (e.g. a network configured
2987//    with [Private Google Access with VPC Service Controls]) may want to
2988///   override this default.
2989/// * [with_credentials()]: by default this client uses
2990///   [Application Default Credentials]. Applications using custom
2991///   authentication may need to override this default.
2992///
2993/// [with_endpoint()]: super::builder::global_organization_operations::ClientBuilder::with_endpoint
2994/// [with_credentials()]: super::builder::global_organization_operations::ClientBuilder::with_credentials
2995/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2996/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2997///
2998/// # Pooling and Cloning
2999///
3000/// `GlobalOrganizationOperations` holds a connection pool internally, it is advised to
3001/// create one and reuse it. You do not need to wrap `GlobalOrganizationOperations` in
3002/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3003/// already uses an `Arc` internally.
3004#[cfg(feature = "global-organization-operations")]
3005#[cfg_attr(docsrs, doc(cfg(feature = "global-organization-operations")))]
3006#[derive(Clone, Debug)]
3007pub struct GlobalOrganizationOperations {
3008    inner: std::sync::Arc<dyn super::stub::dynamic::GlobalOrganizationOperations>,
3009}
3010
3011#[cfg(feature = "global-organization-operations")]
3012impl GlobalOrganizationOperations {
3013    /// Returns a builder for [GlobalOrganizationOperations].
3014    ///
3015    /// ```
3016    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3017    /// # use google_cloud_compute_v1::client::GlobalOrganizationOperations;
3018    /// let client = GlobalOrganizationOperations::builder().build().await?;
3019    /// # Ok(()) }
3020    /// ```
3021    pub fn builder() -> super::builder::global_organization_operations::ClientBuilder {
3022        crate::new_client_builder(super::builder::global_organization_operations::client::Factory)
3023    }
3024
3025    /// Creates a new client from the provided stub.
3026    ///
3027    /// The most common case for calling this function is in tests mocking the
3028    /// client's behavior.
3029    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
3030    where
3031        T: super::stub::GlobalOrganizationOperations + 'static,
3032    {
3033        Self { inner: stub.into() }
3034    }
3035
3036    pub(crate) async fn new(
3037        config: gaxi::options::ClientConfig,
3038    ) -> crate::ClientBuilderResult<Self> {
3039        let inner = Self::build_inner(config).await?;
3040        Ok(Self { inner })
3041    }
3042
3043    async fn build_inner(
3044        conf: gaxi::options::ClientConfig,
3045    ) -> crate::ClientBuilderResult<
3046        std::sync::Arc<dyn super::stub::dynamic::GlobalOrganizationOperations>,
3047    > {
3048        if gaxi::options::tracing_enabled(&conf) {
3049            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3050        }
3051        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3052    }
3053
3054    async fn build_transport(
3055        conf: gaxi::options::ClientConfig,
3056    ) -> crate::ClientBuilderResult<impl super::stub::GlobalOrganizationOperations> {
3057        super::transport::GlobalOrganizationOperations::new(conf).await
3058    }
3059
3060    async fn build_with_tracing(
3061        conf: gaxi::options::ClientConfig,
3062    ) -> crate::ClientBuilderResult<impl super::stub::GlobalOrganizationOperations> {
3063        Self::build_transport(conf)
3064            .await
3065            .map(super::tracing::GlobalOrganizationOperations::new)
3066    }
3067
3068    /// Deletes the specified Operations resource.
3069    pub fn delete(&self) -> super::builder::global_organization_operations::Delete {
3070        super::builder::global_organization_operations::Delete::new(self.inner.clone())
3071    }
3072
3073    /// Retrieves the specified Operations resource. Gets a list of operations
3074    /// by making a `list()` request.
3075    pub fn get(&self) -> super::builder::global_organization_operations::Get {
3076        super::builder::global_organization_operations::Get::new(self.inner.clone())
3077    }
3078
3079    /// Retrieves a list of Operation resources contained within the specified
3080    /// organization.
3081    pub fn list(&self) -> super::builder::global_organization_operations::List {
3082        super::builder::global_organization_operations::List::new(self.inner.clone())
3083    }
3084}
3085
3086/// Implements a client for the Google Compute Engine API.
3087///
3088/// # Example
3089/// ```
3090/// # use google_cloud_compute_v1::client::GlobalPublicDelegatedPrefixes;
3091/// async fn sample(
3092/// ) -> anyhow::Result<()> {
3093///     let client = GlobalPublicDelegatedPrefixes::builder().build().await?;
3094///     // use `client` to make requests to the Google Compute Engine API.
3095///     Ok(())
3096/// }
3097/// ```
3098///
3099/// # Service Description
3100///
3101/// Service for the `globalPublicDelegatedPrefixes` resource.
3102///
3103/// # Configuration
3104///
3105/// To configure `GlobalPublicDelegatedPrefixes` use the `with_*` methods in the type returned
3106/// by [builder()][GlobalPublicDelegatedPrefixes::builder]. The default configuration should
3107/// work for most applications. Common configuration changes include
3108///
3109/// * [with_endpoint()]: by default this client uses the global default endpoint
3110///   (`https://compute.googleapis.com`). Applications using regional
3111///   endpoints or running in restricted networks (e.g. a network configured
3112//    with [Private Google Access with VPC Service Controls]) may want to
3113///   override this default.
3114/// * [with_credentials()]: by default this client uses
3115///   [Application Default Credentials]. Applications using custom
3116///   authentication may need to override this default.
3117///
3118/// [with_endpoint()]: super::builder::global_public_delegated_prefixes::ClientBuilder::with_endpoint
3119/// [with_credentials()]: super::builder::global_public_delegated_prefixes::ClientBuilder::with_credentials
3120/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3121/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3122///
3123/// # Pooling and Cloning
3124///
3125/// `GlobalPublicDelegatedPrefixes` holds a connection pool internally, it is advised to
3126/// create one and reuse it. You do not need to wrap `GlobalPublicDelegatedPrefixes` in
3127/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3128/// already uses an `Arc` internally.
3129#[cfg(feature = "global-public-delegated-prefixes")]
3130#[cfg_attr(docsrs, doc(cfg(feature = "global-public-delegated-prefixes")))]
3131#[derive(Clone, Debug)]
3132pub struct GlobalPublicDelegatedPrefixes {
3133    inner: std::sync::Arc<dyn super::stub::dynamic::GlobalPublicDelegatedPrefixes>,
3134}
3135
3136#[cfg(feature = "global-public-delegated-prefixes")]
3137impl GlobalPublicDelegatedPrefixes {
3138    /// Returns a builder for [GlobalPublicDelegatedPrefixes].
3139    ///
3140    /// ```
3141    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3142    /// # use google_cloud_compute_v1::client::GlobalPublicDelegatedPrefixes;
3143    /// let client = GlobalPublicDelegatedPrefixes::builder().build().await?;
3144    /// # Ok(()) }
3145    /// ```
3146    pub fn builder() -> super::builder::global_public_delegated_prefixes::ClientBuilder {
3147        crate::new_client_builder(super::builder::global_public_delegated_prefixes::client::Factory)
3148    }
3149
3150    /// Creates a new client from the provided stub.
3151    ///
3152    /// The most common case for calling this function is in tests mocking the
3153    /// client's behavior.
3154    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
3155    where
3156        T: super::stub::GlobalPublicDelegatedPrefixes + 'static,
3157    {
3158        Self { inner: stub.into() }
3159    }
3160
3161    pub(crate) async fn new(
3162        config: gaxi::options::ClientConfig,
3163    ) -> crate::ClientBuilderResult<Self> {
3164        let inner = Self::build_inner(config).await?;
3165        Ok(Self { inner })
3166    }
3167
3168    async fn build_inner(
3169        conf: gaxi::options::ClientConfig,
3170    ) -> crate::ClientBuilderResult<
3171        std::sync::Arc<dyn super::stub::dynamic::GlobalPublicDelegatedPrefixes>,
3172    > {
3173        if gaxi::options::tracing_enabled(&conf) {
3174            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3175        }
3176        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3177    }
3178
3179    async fn build_transport(
3180        conf: gaxi::options::ClientConfig,
3181    ) -> crate::ClientBuilderResult<impl super::stub::GlobalPublicDelegatedPrefixes> {
3182        super::transport::GlobalPublicDelegatedPrefixes::new(conf).await
3183    }
3184
3185    async fn build_with_tracing(
3186        conf: gaxi::options::ClientConfig,
3187    ) -> crate::ClientBuilderResult<impl super::stub::GlobalPublicDelegatedPrefixes> {
3188        Self::build_transport(conf)
3189            .await
3190            .map(super::tracing::GlobalPublicDelegatedPrefixes::new)
3191    }
3192
3193    /// Deletes the specified global PublicDelegatedPrefix.
3194    pub fn delete(&self) -> super::builder::global_public_delegated_prefixes::Delete {
3195        super::builder::global_public_delegated_prefixes::Delete::new(self.inner.clone())
3196    }
3197
3198    /// Returns the specified global PublicDelegatedPrefix resource.
3199    pub fn get(&self) -> super::builder::global_public_delegated_prefixes::Get {
3200        super::builder::global_public_delegated_prefixes::Get::new(self.inner.clone())
3201    }
3202
3203    /// Creates a global PublicDelegatedPrefix in the specified project using the
3204    /// parameters that are included in the request.
3205    pub fn insert(&self) -> super::builder::global_public_delegated_prefixes::Insert {
3206        super::builder::global_public_delegated_prefixes::Insert::new(self.inner.clone())
3207    }
3208
3209    /// Lists the global PublicDelegatedPrefixes for a project.
3210    pub fn list(&self) -> super::builder::global_public_delegated_prefixes::List {
3211        super::builder::global_public_delegated_prefixes::List::new(self.inner.clone())
3212    }
3213
3214    /// Patches the specified global PublicDelegatedPrefix resource with the data
3215    /// included in the request. This method supportsPATCH
3216    /// semantics and usesJSON merge
3217    /// patch format and processing rules.
3218    pub fn patch(&self) -> super::builder::global_public_delegated_prefixes::Patch {
3219        super::builder::global_public_delegated_prefixes::Patch::new(self.inner.clone())
3220    }
3221
3222    /// Retrieves the specified Operations resource.
3223    pub fn get_operation(&self) -> super::builder::global_public_delegated_prefixes::GetOperation {
3224        super::builder::global_public_delegated_prefixes::GetOperation::new(self.inner.clone())
3225    }
3226}
3227
3228/// Implements a client for the Google Compute Engine API.
3229///
3230/// # Example
3231/// ```
3232/// # use google_cloud_compute_v1::client::HealthChecks;
3233/// async fn sample(
3234/// ) -> anyhow::Result<()> {
3235///     let client = HealthChecks::builder().build().await?;
3236///     // use `client` to make requests to the Google Compute Engine API.
3237///     Ok(())
3238/// }
3239/// ```
3240///
3241/// # Service Description
3242///
3243/// Service for the `healthChecks` resource.
3244///
3245/// # Configuration
3246///
3247/// To configure `HealthChecks` use the `with_*` methods in the type returned
3248/// by [builder()][HealthChecks::builder]. The default configuration should
3249/// work for most applications. Common configuration changes include
3250///
3251/// * [with_endpoint()]: by default this client uses the global default endpoint
3252///   (`https://compute.googleapis.com`). Applications using regional
3253///   endpoints or running in restricted networks (e.g. a network configured
3254//    with [Private Google Access with VPC Service Controls]) may want to
3255///   override this default.
3256/// * [with_credentials()]: by default this client uses
3257///   [Application Default Credentials]. Applications using custom
3258///   authentication may need to override this default.
3259///
3260/// [with_endpoint()]: super::builder::health_checks::ClientBuilder::with_endpoint
3261/// [with_credentials()]: super::builder::health_checks::ClientBuilder::with_credentials
3262/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3263/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3264///
3265/// # Pooling and Cloning
3266///
3267/// `HealthChecks` holds a connection pool internally, it is advised to
3268/// create one and reuse it. You do not need to wrap `HealthChecks` in
3269/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3270/// already uses an `Arc` internally.
3271#[cfg(feature = "health-checks")]
3272#[cfg_attr(docsrs, doc(cfg(feature = "health-checks")))]
3273#[derive(Clone, Debug)]
3274pub struct HealthChecks {
3275    inner: std::sync::Arc<dyn super::stub::dynamic::HealthChecks>,
3276}
3277
3278#[cfg(feature = "health-checks")]
3279impl HealthChecks {
3280    /// Returns a builder for [HealthChecks].
3281    ///
3282    /// ```
3283    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3284    /// # use google_cloud_compute_v1::client::HealthChecks;
3285    /// let client = HealthChecks::builder().build().await?;
3286    /// # Ok(()) }
3287    /// ```
3288    pub fn builder() -> super::builder::health_checks::ClientBuilder {
3289        crate::new_client_builder(super::builder::health_checks::client::Factory)
3290    }
3291
3292    /// Creates a new client from the provided stub.
3293    ///
3294    /// The most common case for calling this function is in tests mocking the
3295    /// client's behavior.
3296    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
3297    where
3298        T: super::stub::HealthChecks + 'static,
3299    {
3300        Self { inner: stub.into() }
3301    }
3302
3303    pub(crate) async fn new(
3304        config: gaxi::options::ClientConfig,
3305    ) -> crate::ClientBuilderResult<Self> {
3306        let inner = Self::build_inner(config).await?;
3307        Ok(Self { inner })
3308    }
3309
3310    async fn build_inner(
3311        conf: gaxi::options::ClientConfig,
3312    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::HealthChecks>> {
3313        if gaxi::options::tracing_enabled(&conf) {
3314            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3315        }
3316        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3317    }
3318
3319    async fn build_transport(
3320        conf: gaxi::options::ClientConfig,
3321    ) -> crate::ClientBuilderResult<impl super::stub::HealthChecks> {
3322        super::transport::HealthChecks::new(conf).await
3323    }
3324
3325    async fn build_with_tracing(
3326        conf: gaxi::options::ClientConfig,
3327    ) -> crate::ClientBuilderResult<impl super::stub::HealthChecks> {
3328        Self::build_transport(conf)
3329            .await
3330            .map(super::tracing::HealthChecks::new)
3331    }
3332
3333    /// Retrieves the list of all HealthCheck resources, regional and global,
3334    /// available to the specified project.
3335    ///
3336    /// To prevent failure, Google recommends that you set the
3337    /// `returnPartialSuccess` parameter to `true`.
3338    pub fn aggregated_list(&self) -> super::builder::health_checks::AggregatedList {
3339        super::builder::health_checks::AggregatedList::new(self.inner.clone())
3340    }
3341
3342    /// Deletes the specified HealthCheck resource.
3343    pub fn delete(&self) -> super::builder::health_checks::Delete {
3344        super::builder::health_checks::Delete::new(self.inner.clone())
3345    }
3346
3347    /// Returns the specified HealthCheck resource.
3348    pub fn get(&self) -> super::builder::health_checks::Get {
3349        super::builder::health_checks::Get::new(self.inner.clone())
3350    }
3351
3352    /// Creates a HealthCheck resource in the specified project using the data
3353    /// included in the request.
3354    pub fn insert(&self) -> super::builder::health_checks::Insert {
3355        super::builder::health_checks::Insert::new(self.inner.clone())
3356    }
3357
3358    /// Retrieves the list of HealthCheck resources available to the specified
3359    /// project.
3360    pub fn list(&self) -> super::builder::health_checks::List {
3361        super::builder::health_checks::List::new(self.inner.clone())
3362    }
3363
3364    /// Updates a HealthCheck resource in the specified project using the data
3365    /// included in the request. This method supportsPATCH
3366    /// semantics and uses theJSON merge
3367    /// patch format and processing rules.
3368    pub fn patch(&self) -> super::builder::health_checks::Patch {
3369        super::builder::health_checks::Patch::new(self.inner.clone())
3370    }
3371
3372    /// Returns permissions that a caller has on the specified resource.
3373    pub fn test_iam_permissions(&self) -> super::builder::health_checks::TestIamPermissions {
3374        super::builder::health_checks::TestIamPermissions::new(self.inner.clone())
3375    }
3376
3377    /// Updates a HealthCheck resource in the specified project using the data
3378    /// included in the request.
3379    pub fn update(&self) -> super::builder::health_checks::Update {
3380        super::builder::health_checks::Update::new(self.inner.clone())
3381    }
3382
3383    /// Retrieves the specified Operations resource.
3384    pub fn get_operation(&self) -> super::builder::health_checks::GetOperation {
3385        super::builder::health_checks::GetOperation::new(self.inner.clone())
3386    }
3387}
3388
3389/// Implements a client for the Google Compute Engine API.
3390///
3391/// # Example
3392/// ```
3393/// # use google_cloud_compute_v1::client::HttpHealthChecks;
3394/// async fn sample(
3395/// ) -> anyhow::Result<()> {
3396///     let client = HttpHealthChecks::builder().build().await?;
3397///     // use `client` to make requests to the Google Compute Engine API.
3398///     Ok(())
3399/// }
3400/// ```
3401///
3402/// # Service Description
3403///
3404/// Service for the `httpHealthChecks` resource.
3405///
3406/// # Configuration
3407///
3408/// To configure `HttpHealthChecks` use the `with_*` methods in the type returned
3409/// by [builder()][HttpHealthChecks::builder]. The default configuration should
3410/// work for most applications. Common configuration changes include
3411///
3412/// * [with_endpoint()]: by default this client uses the global default endpoint
3413///   (`https://compute.googleapis.com`). Applications using regional
3414///   endpoints or running in restricted networks (e.g. a network configured
3415//    with [Private Google Access with VPC Service Controls]) may want to
3416///   override this default.
3417/// * [with_credentials()]: by default this client uses
3418///   [Application Default Credentials]. Applications using custom
3419///   authentication may need to override this default.
3420///
3421/// [with_endpoint()]: super::builder::http_health_checks::ClientBuilder::with_endpoint
3422/// [with_credentials()]: super::builder::http_health_checks::ClientBuilder::with_credentials
3423/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3424/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3425///
3426/// # Pooling and Cloning
3427///
3428/// `HttpHealthChecks` holds a connection pool internally, it is advised to
3429/// create one and reuse it. You do not need to wrap `HttpHealthChecks` in
3430/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3431/// already uses an `Arc` internally.
3432#[cfg(feature = "http-health-checks")]
3433#[cfg_attr(docsrs, doc(cfg(feature = "http-health-checks")))]
3434#[derive(Clone, Debug)]
3435pub struct HttpHealthChecks {
3436    inner: std::sync::Arc<dyn super::stub::dynamic::HttpHealthChecks>,
3437}
3438
3439#[cfg(feature = "http-health-checks")]
3440impl HttpHealthChecks {
3441    /// Returns a builder for [HttpHealthChecks].
3442    ///
3443    /// ```
3444    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3445    /// # use google_cloud_compute_v1::client::HttpHealthChecks;
3446    /// let client = HttpHealthChecks::builder().build().await?;
3447    /// # Ok(()) }
3448    /// ```
3449    pub fn builder() -> super::builder::http_health_checks::ClientBuilder {
3450        crate::new_client_builder(super::builder::http_health_checks::client::Factory)
3451    }
3452
3453    /// Creates a new client from the provided stub.
3454    ///
3455    /// The most common case for calling this function is in tests mocking the
3456    /// client's behavior.
3457    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
3458    where
3459        T: super::stub::HttpHealthChecks + 'static,
3460    {
3461        Self { inner: stub.into() }
3462    }
3463
3464    pub(crate) async fn new(
3465        config: gaxi::options::ClientConfig,
3466    ) -> crate::ClientBuilderResult<Self> {
3467        let inner = Self::build_inner(config).await?;
3468        Ok(Self { inner })
3469    }
3470
3471    async fn build_inner(
3472        conf: gaxi::options::ClientConfig,
3473    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::HttpHealthChecks>>
3474    {
3475        if gaxi::options::tracing_enabled(&conf) {
3476            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3477        }
3478        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3479    }
3480
3481    async fn build_transport(
3482        conf: gaxi::options::ClientConfig,
3483    ) -> crate::ClientBuilderResult<impl super::stub::HttpHealthChecks> {
3484        super::transport::HttpHealthChecks::new(conf).await
3485    }
3486
3487    async fn build_with_tracing(
3488        conf: gaxi::options::ClientConfig,
3489    ) -> crate::ClientBuilderResult<impl super::stub::HttpHealthChecks> {
3490        Self::build_transport(conf)
3491            .await
3492            .map(super::tracing::HttpHealthChecks::new)
3493    }
3494
3495    /// Deletes the specified HttpHealthCheck resource.
3496    pub fn delete(&self) -> super::builder::http_health_checks::Delete {
3497        super::builder::http_health_checks::Delete::new(self.inner.clone())
3498    }
3499
3500    /// Returns the specified HttpHealthCheck resource.
3501    pub fn get(&self) -> super::builder::http_health_checks::Get {
3502        super::builder::http_health_checks::Get::new(self.inner.clone())
3503    }
3504
3505    /// Creates a HttpHealthCheck resource in the specified project using the data
3506    /// included in the request.
3507    pub fn insert(&self) -> super::builder::http_health_checks::Insert {
3508        super::builder::http_health_checks::Insert::new(self.inner.clone())
3509    }
3510
3511    /// Retrieves the list of HttpHealthCheck resources available to the specified
3512    /// project.
3513    pub fn list(&self) -> super::builder::http_health_checks::List {
3514        super::builder::http_health_checks::List::new(self.inner.clone())
3515    }
3516
3517    /// Updates a HttpHealthCheck resource in the specified project using the data
3518    /// included in the request. This method supportsPATCH
3519    /// semantics and uses theJSON merge
3520    /// patch format and processing rules.
3521    pub fn patch(&self) -> super::builder::http_health_checks::Patch {
3522        super::builder::http_health_checks::Patch::new(self.inner.clone())
3523    }
3524
3525    /// Returns permissions that a caller has on the specified resource.
3526    pub fn test_iam_permissions(&self) -> super::builder::http_health_checks::TestIamPermissions {
3527        super::builder::http_health_checks::TestIamPermissions::new(self.inner.clone())
3528    }
3529
3530    /// Updates a HttpHealthCheck resource in the specified project using the data
3531    /// included in the request.
3532    pub fn update(&self) -> super::builder::http_health_checks::Update {
3533        super::builder::http_health_checks::Update::new(self.inner.clone())
3534    }
3535
3536    /// Retrieves the specified Operations resource.
3537    pub fn get_operation(&self) -> super::builder::http_health_checks::GetOperation {
3538        super::builder::http_health_checks::GetOperation::new(self.inner.clone())
3539    }
3540}
3541
3542/// Implements a client for the Google Compute Engine API.
3543///
3544/// # Example
3545/// ```
3546/// # use google_cloud_compute_v1::client::HttpsHealthChecks;
3547/// async fn sample(
3548/// ) -> anyhow::Result<()> {
3549///     let client = HttpsHealthChecks::builder().build().await?;
3550///     // use `client` to make requests to the Google Compute Engine API.
3551///     Ok(())
3552/// }
3553/// ```
3554///
3555/// # Service Description
3556///
3557/// Service for the `httpsHealthChecks` resource.
3558///
3559/// # Configuration
3560///
3561/// To configure `HttpsHealthChecks` use the `with_*` methods in the type returned
3562/// by [builder()][HttpsHealthChecks::builder]. The default configuration should
3563/// work for most applications. Common configuration changes include
3564///
3565/// * [with_endpoint()]: by default this client uses the global default endpoint
3566///   (`https://compute.googleapis.com`). Applications using regional
3567///   endpoints or running in restricted networks (e.g. a network configured
3568//    with [Private Google Access with VPC Service Controls]) may want to
3569///   override this default.
3570/// * [with_credentials()]: by default this client uses
3571///   [Application Default Credentials]. Applications using custom
3572///   authentication may need to override this default.
3573///
3574/// [with_endpoint()]: super::builder::https_health_checks::ClientBuilder::with_endpoint
3575/// [with_credentials()]: super::builder::https_health_checks::ClientBuilder::with_credentials
3576/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3577/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3578///
3579/// # Pooling and Cloning
3580///
3581/// `HttpsHealthChecks` holds a connection pool internally, it is advised to
3582/// create one and reuse it. You do not need to wrap `HttpsHealthChecks` in
3583/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3584/// already uses an `Arc` internally.
3585#[cfg(feature = "https-health-checks")]
3586#[cfg_attr(docsrs, doc(cfg(feature = "https-health-checks")))]
3587#[derive(Clone, Debug)]
3588pub struct HttpsHealthChecks {
3589    inner: std::sync::Arc<dyn super::stub::dynamic::HttpsHealthChecks>,
3590}
3591
3592#[cfg(feature = "https-health-checks")]
3593impl HttpsHealthChecks {
3594    /// Returns a builder for [HttpsHealthChecks].
3595    ///
3596    /// ```
3597    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3598    /// # use google_cloud_compute_v1::client::HttpsHealthChecks;
3599    /// let client = HttpsHealthChecks::builder().build().await?;
3600    /// # Ok(()) }
3601    /// ```
3602    pub fn builder() -> super::builder::https_health_checks::ClientBuilder {
3603        crate::new_client_builder(super::builder::https_health_checks::client::Factory)
3604    }
3605
3606    /// Creates a new client from the provided stub.
3607    ///
3608    /// The most common case for calling this function is in tests mocking the
3609    /// client's behavior.
3610    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
3611    where
3612        T: super::stub::HttpsHealthChecks + 'static,
3613    {
3614        Self { inner: stub.into() }
3615    }
3616
3617    pub(crate) async fn new(
3618        config: gaxi::options::ClientConfig,
3619    ) -> crate::ClientBuilderResult<Self> {
3620        let inner = Self::build_inner(config).await?;
3621        Ok(Self { inner })
3622    }
3623
3624    async fn build_inner(
3625        conf: gaxi::options::ClientConfig,
3626    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::HttpsHealthChecks>>
3627    {
3628        if gaxi::options::tracing_enabled(&conf) {
3629            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3630        }
3631        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3632    }
3633
3634    async fn build_transport(
3635        conf: gaxi::options::ClientConfig,
3636    ) -> crate::ClientBuilderResult<impl super::stub::HttpsHealthChecks> {
3637        super::transport::HttpsHealthChecks::new(conf).await
3638    }
3639
3640    async fn build_with_tracing(
3641        conf: gaxi::options::ClientConfig,
3642    ) -> crate::ClientBuilderResult<impl super::stub::HttpsHealthChecks> {
3643        Self::build_transport(conf)
3644            .await
3645            .map(super::tracing::HttpsHealthChecks::new)
3646    }
3647
3648    /// Deletes the specified HttpsHealthCheck resource.
3649    pub fn delete(&self) -> super::builder::https_health_checks::Delete {
3650        super::builder::https_health_checks::Delete::new(self.inner.clone())
3651    }
3652
3653    /// Returns the specified HttpsHealthCheck resource.
3654    pub fn get(&self) -> super::builder::https_health_checks::Get {
3655        super::builder::https_health_checks::Get::new(self.inner.clone())
3656    }
3657
3658    /// Creates a HttpsHealthCheck resource in the specified project using the data
3659    /// included in the request.
3660    pub fn insert(&self) -> super::builder::https_health_checks::Insert {
3661        super::builder::https_health_checks::Insert::new(self.inner.clone())
3662    }
3663
3664    /// Retrieves the list of HttpsHealthCheck resources available to the specified
3665    /// project.
3666    pub fn list(&self) -> super::builder::https_health_checks::List {
3667        super::builder::https_health_checks::List::new(self.inner.clone())
3668    }
3669
3670    /// Updates a HttpsHealthCheck resource in the specified project using the data
3671    /// included in the request. This method supportsPATCH
3672    /// semantics and uses theJSON merge
3673    /// patch format and processing rules.
3674    pub fn patch(&self) -> super::builder::https_health_checks::Patch {
3675        super::builder::https_health_checks::Patch::new(self.inner.clone())
3676    }
3677
3678    /// Returns permissions that a caller has on the specified resource.
3679    pub fn test_iam_permissions(&self) -> super::builder::https_health_checks::TestIamPermissions {
3680        super::builder::https_health_checks::TestIamPermissions::new(self.inner.clone())
3681    }
3682
3683    /// Updates a HttpsHealthCheck resource in the specified project using the data
3684    /// included in the request.
3685    pub fn update(&self) -> super::builder::https_health_checks::Update {
3686        super::builder::https_health_checks::Update::new(self.inner.clone())
3687    }
3688
3689    /// Retrieves the specified Operations resource.
3690    pub fn get_operation(&self) -> super::builder::https_health_checks::GetOperation {
3691        super::builder::https_health_checks::GetOperation::new(self.inner.clone())
3692    }
3693}
3694
3695/// Implements a client for the Google Compute Engine API.
3696///
3697/// # Example
3698/// ```
3699/// # use google_cloud_compute_v1::client::ImageFamilyViews;
3700/// async fn sample(
3701/// ) -> anyhow::Result<()> {
3702///     let client = ImageFamilyViews::builder().build().await?;
3703///     // use `client` to make requests to the Google Compute Engine API.
3704///     Ok(())
3705/// }
3706/// ```
3707///
3708/// # Service Description
3709///
3710/// Service for the `imageFamilyViews` resource.
3711///
3712/// # Configuration
3713///
3714/// To configure `ImageFamilyViews` use the `with_*` methods in the type returned
3715/// by [builder()][ImageFamilyViews::builder]. The default configuration should
3716/// work for most applications. Common configuration changes include
3717///
3718/// * [with_endpoint()]: by default this client uses the global default endpoint
3719///   (`https://compute.googleapis.com`). Applications using regional
3720///   endpoints or running in restricted networks (e.g. a network configured
3721//    with [Private Google Access with VPC Service Controls]) may want to
3722///   override this default.
3723/// * [with_credentials()]: by default this client uses
3724///   [Application Default Credentials]. Applications using custom
3725///   authentication may need to override this default.
3726///
3727/// [with_endpoint()]: super::builder::image_family_views::ClientBuilder::with_endpoint
3728/// [with_credentials()]: super::builder::image_family_views::ClientBuilder::with_credentials
3729/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3730/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3731///
3732/// # Pooling and Cloning
3733///
3734/// `ImageFamilyViews` holds a connection pool internally, it is advised to
3735/// create one and reuse it. You do not need to wrap `ImageFamilyViews` in
3736/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3737/// already uses an `Arc` internally.
3738#[cfg(feature = "image-family-views")]
3739#[cfg_attr(docsrs, doc(cfg(feature = "image-family-views")))]
3740#[derive(Clone, Debug)]
3741pub struct ImageFamilyViews {
3742    inner: std::sync::Arc<dyn super::stub::dynamic::ImageFamilyViews>,
3743}
3744
3745#[cfg(feature = "image-family-views")]
3746impl ImageFamilyViews {
3747    /// Returns a builder for [ImageFamilyViews].
3748    ///
3749    /// ```
3750    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3751    /// # use google_cloud_compute_v1::client::ImageFamilyViews;
3752    /// let client = ImageFamilyViews::builder().build().await?;
3753    /// # Ok(()) }
3754    /// ```
3755    pub fn builder() -> super::builder::image_family_views::ClientBuilder {
3756        crate::new_client_builder(super::builder::image_family_views::client::Factory)
3757    }
3758
3759    /// Creates a new client from the provided stub.
3760    ///
3761    /// The most common case for calling this function is in tests mocking the
3762    /// client's behavior.
3763    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
3764    where
3765        T: super::stub::ImageFamilyViews + 'static,
3766    {
3767        Self { inner: stub.into() }
3768    }
3769
3770    pub(crate) async fn new(
3771        config: gaxi::options::ClientConfig,
3772    ) -> crate::ClientBuilderResult<Self> {
3773        let inner = Self::build_inner(config).await?;
3774        Ok(Self { inner })
3775    }
3776
3777    async fn build_inner(
3778        conf: gaxi::options::ClientConfig,
3779    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ImageFamilyViews>>
3780    {
3781        if gaxi::options::tracing_enabled(&conf) {
3782            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3783        }
3784        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3785    }
3786
3787    async fn build_transport(
3788        conf: gaxi::options::ClientConfig,
3789    ) -> crate::ClientBuilderResult<impl super::stub::ImageFamilyViews> {
3790        super::transport::ImageFamilyViews::new(conf).await
3791    }
3792
3793    async fn build_with_tracing(
3794        conf: gaxi::options::ClientConfig,
3795    ) -> crate::ClientBuilderResult<impl super::stub::ImageFamilyViews> {
3796        Self::build_transport(conf)
3797            .await
3798            .map(super::tracing::ImageFamilyViews::new)
3799    }
3800
3801    /// Returns the latest image that is part of an image family, is not
3802    /// deprecated and is rolled out in the specified zone.
3803    pub fn get(&self) -> super::builder::image_family_views::Get {
3804        super::builder::image_family_views::Get::new(self.inner.clone())
3805    }
3806}
3807
3808/// Implements a client for the Google Compute Engine API.
3809///
3810/// # Example
3811/// ```
3812/// # use google_cloud_compute_v1::client::Images;
3813/// async fn sample(
3814/// ) -> anyhow::Result<()> {
3815///     let client = Images::builder().build().await?;
3816///     // use `client` to make requests to the Google Compute Engine API.
3817///     Ok(())
3818/// }
3819/// ```
3820///
3821/// # Service Description
3822///
3823/// Service for the `images` resource.
3824///
3825/// # Configuration
3826///
3827/// To configure `Images` use the `with_*` methods in the type returned
3828/// by [builder()][Images::builder]. The default configuration should
3829/// work for most applications. Common configuration changes include
3830///
3831/// * [with_endpoint()]: by default this client uses the global default endpoint
3832///   (`https://compute.googleapis.com`). Applications using regional
3833///   endpoints or running in restricted networks (e.g. a network configured
3834//    with [Private Google Access with VPC Service Controls]) may want to
3835///   override this default.
3836/// * [with_credentials()]: by default this client uses
3837///   [Application Default Credentials]. Applications using custom
3838///   authentication may need to override this default.
3839///
3840/// [with_endpoint()]: super::builder::images::ClientBuilder::with_endpoint
3841/// [with_credentials()]: super::builder::images::ClientBuilder::with_credentials
3842/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3843/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3844///
3845/// # Pooling and Cloning
3846///
3847/// `Images` holds a connection pool internally, it is advised to
3848/// create one and reuse it. You do not need to wrap `Images` in
3849/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3850/// already uses an `Arc` internally.
3851#[cfg(feature = "images")]
3852#[cfg_attr(docsrs, doc(cfg(feature = "images")))]
3853#[derive(Clone, Debug)]
3854pub struct Images {
3855    inner: std::sync::Arc<dyn super::stub::dynamic::Images>,
3856}
3857
3858#[cfg(feature = "images")]
3859impl Images {
3860    /// Returns a builder for [Images].
3861    ///
3862    /// ```
3863    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3864    /// # use google_cloud_compute_v1::client::Images;
3865    /// let client = Images::builder().build().await?;
3866    /// # Ok(()) }
3867    /// ```
3868    pub fn builder() -> super::builder::images::ClientBuilder {
3869        crate::new_client_builder(super::builder::images::client::Factory)
3870    }
3871
3872    /// Creates a new client from the provided stub.
3873    ///
3874    /// The most common case for calling this function is in tests mocking the
3875    /// client's behavior.
3876    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
3877    where
3878        T: super::stub::Images + 'static,
3879    {
3880        Self { inner: stub.into() }
3881    }
3882
3883    pub(crate) async fn new(
3884        config: gaxi::options::ClientConfig,
3885    ) -> crate::ClientBuilderResult<Self> {
3886        let inner = Self::build_inner(config).await?;
3887        Ok(Self { inner })
3888    }
3889
3890    async fn build_inner(
3891        conf: gaxi::options::ClientConfig,
3892    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Images>> {
3893        if gaxi::options::tracing_enabled(&conf) {
3894            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3895        }
3896        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3897    }
3898
3899    async fn build_transport(
3900        conf: gaxi::options::ClientConfig,
3901    ) -> crate::ClientBuilderResult<impl super::stub::Images> {
3902        super::transport::Images::new(conf).await
3903    }
3904
3905    async fn build_with_tracing(
3906        conf: gaxi::options::ClientConfig,
3907    ) -> crate::ClientBuilderResult<impl super::stub::Images> {
3908        Self::build_transport(conf)
3909            .await
3910            .map(super::tracing::Images::new)
3911    }
3912
3913    /// Deletes the specified image.
3914    pub fn delete(&self) -> super::builder::images::Delete {
3915        super::builder::images::Delete::new(self.inner.clone())
3916    }
3917
3918    /// Sets the deprecation status of an image.
3919    ///
3920    /// If an empty request body is given, clears the deprecation status instead.
3921    pub fn deprecate(&self) -> super::builder::images::Deprecate {
3922        super::builder::images::Deprecate::new(self.inner.clone())
3923    }
3924
3925    /// Returns the specified image.
3926    pub fn get(&self) -> super::builder::images::Get {
3927        super::builder::images::Get::new(self.inner.clone())
3928    }
3929
3930    /// Returns the latest image that is part of an image family and is not
3931    /// deprecated. For more information on image families, seePublic
3932    /// image families documentation.
3933    pub fn get_from_family(&self) -> super::builder::images::GetFromFamily {
3934        super::builder::images::GetFromFamily::new(self.inner.clone())
3935    }
3936
3937    /// Gets the access control policy for a resource. May be empty if no such
3938    /// policy or resource exists.
3939    pub fn get_iam_policy(&self) -> super::builder::images::GetIamPolicy {
3940        super::builder::images::GetIamPolicy::new(self.inner.clone())
3941    }
3942
3943    /// Creates an image in the specified project using the data included
3944    /// in the request.
3945    pub fn insert(&self) -> super::builder::images::Insert {
3946        super::builder::images::Insert::new(self.inner.clone())
3947    }
3948
3949    /// Retrieves the list of custom images
3950    /// available to the specified project. Custom images are images you
3951    /// create that belong to your project. This method does not
3952    /// get any images that belong to other projects, including publicly-available
3953    /// images, like Debian 8. If you want to get a list of publicly-available
3954    /// images, use this method to make a request to the respective image project,
3955    /// such as debian-cloud or windows-cloud.
3956    pub fn list(&self) -> super::builder::images::List {
3957        super::builder::images::List::new(self.inner.clone())
3958    }
3959
3960    /// Patches the specified image with the data included in the request.
3961    /// Only the following fields can be modified: family, description,
3962    /// deprecation status.
3963    pub fn patch(&self) -> super::builder::images::Patch {
3964        super::builder::images::Patch::new(self.inner.clone())
3965    }
3966
3967    /// Sets the access control policy on the specified resource.
3968    /// Replaces any existing policy.
3969    pub fn set_iam_policy(&self) -> super::builder::images::SetIamPolicy {
3970        super::builder::images::SetIamPolicy::new(self.inner.clone())
3971    }
3972
3973    /// Sets the labels on an image. To learn more about labels, read theLabeling
3974    /// Resources documentation.
3975    pub fn set_labels(&self) -> super::builder::images::SetLabels {
3976        super::builder::images::SetLabels::new(self.inner.clone())
3977    }
3978
3979    /// Returns permissions that a caller has on the specified resource.
3980    pub fn test_iam_permissions(&self) -> super::builder::images::TestIamPermissions {
3981        super::builder::images::TestIamPermissions::new(self.inner.clone())
3982    }
3983
3984    /// Retrieves the specified Operations resource.
3985    pub fn get_operation(&self) -> super::builder::images::GetOperation {
3986        super::builder::images::GetOperation::new(self.inner.clone())
3987    }
3988}
3989
3990/// Implements a client for the Google Compute Engine API.
3991///
3992/// # Example
3993/// ```
3994/// # use google_cloud_compute_v1::client::InstanceGroupManagerResizeRequests;
3995/// async fn sample(
3996/// ) -> anyhow::Result<()> {
3997///     let client = InstanceGroupManagerResizeRequests::builder().build().await?;
3998///     // use `client` to make requests to the Google Compute Engine API.
3999///     Ok(())
4000/// }
4001/// ```
4002///
4003/// # Service Description
4004///
4005/// Service for the `instanceGroupManagerResizeRequests` resource.
4006///
4007/// # Configuration
4008///
4009/// To configure `InstanceGroupManagerResizeRequests` use the `with_*` methods in the type returned
4010/// by [builder()][InstanceGroupManagerResizeRequests::builder]. The default configuration should
4011/// work for most applications. Common configuration changes include
4012///
4013/// * [with_endpoint()]: by default this client uses the global default endpoint
4014///   (`https://compute.googleapis.com`). Applications using regional
4015///   endpoints or running in restricted networks (e.g. a network configured
4016//    with [Private Google Access with VPC Service Controls]) may want to
4017///   override this default.
4018/// * [with_credentials()]: by default this client uses
4019///   [Application Default Credentials]. Applications using custom
4020///   authentication may need to override this default.
4021///
4022/// [with_endpoint()]: super::builder::instance_group_manager_resize_requests::ClientBuilder::with_endpoint
4023/// [with_credentials()]: super::builder::instance_group_manager_resize_requests::ClientBuilder::with_credentials
4024/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4025/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4026///
4027/// # Pooling and Cloning
4028///
4029/// `InstanceGroupManagerResizeRequests` holds a connection pool internally, it is advised to
4030/// create one and reuse it. You do not need to wrap `InstanceGroupManagerResizeRequests` in
4031/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4032/// already uses an `Arc` internally.
4033#[cfg(feature = "instance-group-manager-resize-requests")]
4034#[cfg_attr(docsrs, doc(cfg(feature = "instance-group-manager-resize-requests")))]
4035#[derive(Clone, Debug)]
4036pub struct InstanceGroupManagerResizeRequests {
4037    inner: std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagerResizeRequests>,
4038}
4039
4040#[cfg(feature = "instance-group-manager-resize-requests")]
4041impl InstanceGroupManagerResizeRequests {
4042    /// Returns a builder for [InstanceGroupManagerResizeRequests].
4043    ///
4044    /// ```
4045    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4046    /// # use google_cloud_compute_v1::client::InstanceGroupManagerResizeRequests;
4047    /// let client = InstanceGroupManagerResizeRequests::builder().build().await?;
4048    /// # Ok(()) }
4049    /// ```
4050    pub fn builder() -> super::builder::instance_group_manager_resize_requests::ClientBuilder {
4051        crate::new_client_builder(
4052            super::builder::instance_group_manager_resize_requests::client::Factory,
4053        )
4054    }
4055
4056    /// Creates a new client from the provided stub.
4057    ///
4058    /// The most common case for calling this function is in tests mocking the
4059    /// client's behavior.
4060    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
4061    where
4062        T: super::stub::InstanceGroupManagerResizeRequests + 'static,
4063    {
4064        Self { inner: stub.into() }
4065    }
4066
4067    pub(crate) async fn new(
4068        config: gaxi::options::ClientConfig,
4069    ) -> crate::ClientBuilderResult<Self> {
4070        let inner = Self::build_inner(config).await?;
4071        Ok(Self { inner })
4072    }
4073
4074    async fn build_inner(
4075        conf: gaxi::options::ClientConfig,
4076    ) -> crate::ClientBuilderResult<
4077        std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagerResizeRequests>,
4078    > {
4079        if gaxi::options::tracing_enabled(&conf) {
4080            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4081        }
4082        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4083    }
4084
4085    async fn build_transport(
4086        conf: gaxi::options::ClientConfig,
4087    ) -> crate::ClientBuilderResult<impl super::stub::InstanceGroupManagerResizeRequests> {
4088        super::transport::InstanceGroupManagerResizeRequests::new(conf).await
4089    }
4090
4091    async fn build_with_tracing(
4092        conf: gaxi::options::ClientConfig,
4093    ) -> crate::ClientBuilderResult<impl super::stub::InstanceGroupManagerResizeRequests> {
4094        Self::build_transport(conf)
4095            .await
4096            .map(super::tracing::InstanceGroupManagerResizeRequests::new)
4097    }
4098
4099    /// Cancels the specified resize request and removes it from the queue.
4100    /// Cancelled resize request does no longer wait for the resources to be
4101    /// provisioned. Cancel is only possible for requests that are accepted in the
4102    /// queue.
4103    pub fn cancel(&self) -> super::builder::instance_group_manager_resize_requests::Cancel {
4104        super::builder::instance_group_manager_resize_requests::Cancel::new(self.inner.clone())
4105    }
4106
4107    /// Deletes the specified, inactive resize request. Requests that are still
4108    /// active cannot be deleted. Deleting request does not delete instances that
4109    /// were provisioned previously.
4110    pub fn delete(&self) -> super::builder::instance_group_manager_resize_requests::Delete {
4111        super::builder::instance_group_manager_resize_requests::Delete::new(self.inner.clone())
4112    }
4113
4114    /// Returns all of the details about the specified resize request.
4115    pub fn get(&self) -> super::builder::instance_group_manager_resize_requests::Get {
4116        super::builder::instance_group_manager_resize_requests::Get::new(self.inner.clone())
4117    }
4118
4119    /// Creates a new resize request that starts provisioning VMs immediately
4120    /// or queues VM creation.
4121    pub fn insert(&self) -> super::builder::instance_group_manager_resize_requests::Insert {
4122        super::builder::instance_group_manager_resize_requests::Insert::new(self.inner.clone())
4123    }
4124
4125    /// Retrieves a list of resize requests that are contained in the
4126    /// managed instance group.
4127    pub fn list(&self) -> super::builder::instance_group_manager_resize_requests::List {
4128        super::builder::instance_group_manager_resize_requests::List::new(self.inner.clone())
4129    }
4130
4131    /// Retrieves the specified zone-specific Operations resource.
4132    pub fn get_operation(
4133        &self,
4134    ) -> super::builder::instance_group_manager_resize_requests::GetOperation {
4135        super::builder::instance_group_manager_resize_requests::GetOperation::new(
4136            self.inner.clone(),
4137        )
4138    }
4139}
4140
4141/// Implements a client for the Google Compute Engine API.
4142///
4143/// # Example
4144/// ```
4145/// # use google_cloud_compute_v1::client::InstanceGroupManagers;
4146/// async fn sample(
4147/// ) -> anyhow::Result<()> {
4148///     let client = InstanceGroupManagers::builder().build().await?;
4149///     // use `client` to make requests to the Google Compute Engine API.
4150///     Ok(())
4151/// }
4152/// ```
4153///
4154/// # Service Description
4155///
4156/// Service for the `instanceGroupManagers` resource.
4157///
4158/// # Configuration
4159///
4160/// To configure `InstanceGroupManagers` use the `with_*` methods in the type returned
4161/// by [builder()][InstanceGroupManagers::builder]. The default configuration should
4162/// work for most applications. Common configuration changes include
4163///
4164/// * [with_endpoint()]: by default this client uses the global default endpoint
4165///   (`https://compute.googleapis.com`). Applications using regional
4166///   endpoints or running in restricted networks (e.g. a network configured
4167//    with [Private Google Access with VPC Service Controls]) may want to
4168///   override this default.
4169/// * [with_credentials()]: by default this client uses
4170///   [Application Default Credentials]. Applications using custom
4171///   authentication may need to override this default.
4172///
4173/// [with_endpoint()]: super::builder::instance_group_managers::ClientBuilder::with_endpoint
4174/// [with_credentials()]: super::builder::instance_group_managers::ClientBuilder::with_credentials
4175/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4176/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4177///
4178/// # Pooling and Cloning
4179///
4180/// `InstanceGroupManagers` holds a connection pool internally, it is advised to
4181/// create one and reuse it. You do not need to wrap `InstanceGroupManagers` in
4182/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4183/// already uses an `Arc` internally.
4184#[cfg(feature = "instance-group-managers")]
4185#[cfg_attr(docsrs, doc(cfg(feature = "instance-group-managers")))]
4186#[derive(Clone, Debug)]
4187pub struct InstanceGroupManagers {
4188    inner: std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagers>,
4189}
4190
4191#[cfg(feature = "instance-group-managers")]
4192impl InstanceGroupManagers {
4193    /// Returns a builder for [InstanceGroupManagers].
4194    ///
4195    /// ```
4196    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4197    /// # use google_cloud_compute_v1::client::InstanceGroupManagers;
4198    /// let client = InstanceGroupManagers::builder().build().await?;
4199    /// # Ok(()) }
4200    /// ```
4201    pub fn builder() -> super::builder::instance_group_managers::ClientBuilder {
4202        crate::new_client_builder(super::builder::instance_group_managers::client::Factory)
4203    }
4204
4205    /// Creates a new client from the provided stub.
4206    ///
4207    /// The most common case for calling this function is in tests mocking the
4208    /// client's behavior.
4209    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
4210    where
4211        T: super::stub::InstanceGroupManagers + 'static,
4212    {
4213        Self { inner: stub.into() }
4214    }
4215
4216    pub(crate) async fn new(
4217        config: gaxi::options::ClientConfig,
4218    ) -> crate::ClientBuilderResult<Self> {
4219        let inner = Self::build_inner(config).await?;
4220        Ok(Self { inner })
4221    }
4222
4223    async fn build_inner(
4224        conf: gaxi::options::ClientConfig,
4225    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagers>>
4226    {
4227        if gaxi::options::tracing_enabled(&conf) {
4228            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4229        }
4230        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4231    }
4232
4233    async fn build_transport(
4234        conf: gaxi::options::ClientConfig,
4235    ) -> crate::ClientBuilderResult<impl super::stub::InstanceGroupManagers> {
4236        super::transport::InstanceGroupManagers::new(conf).await
4237    }
4238
4239    async fn build_with_tracing(
4240        conf: gaxi::options::ClientConfig,
4241    ) -> crate::ClientBuilderResult<impl super::stub::InstanceGroupManagers> {
4242        Self::build_transport(conf)
4243            .await
4244            .map(super::tracing::InstanceGroupManagers::new)
4245    }
4246
4247    /// Flags the specified instances to be removed from the
4248    /// managed instance group. Abandoning an instance does not delete the
4249    /// instance, but it does remove the instance from any target pools that are
4250    /// applied by the managed instance group. This method reduces thetargetSize of the managed instance group by the
4251    /// number of instances that you abandon. This operation is marked asDONE when the action is scheduled even if the instances have
4252    /// not yet been removed from the group. You must separately verify the
4253    /// status of the abandoning action with thelistmanagedinstances
4254    /// method.
4255    ///
4256    /// If the group is part of a backend
4257    /// service that has enabled
4258    /// connection draining, it can take up to 60 seconds after the connection
4259    /// draining duration has elapsed before the VM instance is removed or deleted.
4260    ///
4261    /// You can specify a maximum of 1000 instances with this method per request.
4262    pub fn abandon_instances(&self) -> super::builder::instance_group_managers::AbandonInstances {
4263        super::builder::instance_group_managers::AbandonInstances::new(self.inner.clone())
4264    }
4265
4266    /// Retrieves the list of managed instance groups and groups them by zone.
4267    ///
4268    /// To prevent failure, Google recommends that you set the
4269    /// `returnPartialSuccess` parameter to `true`.
4270    pub fn aggregated_list(&self) -> super::builder::instance_group_managers::AggregatedList {
4271        super::builder::instance_group_managers::AggregatedList::new(self.inner.clone())
4272    }
4273
4274    /// Applies changes to selected instances on the managed instance group.
4275    /// This method can be used to apply new overrides and/or new versions.
4276    pub fn apply_updates_to_instances(
4277        &self,
4278    ) -> super::builder::instance_group_managers::ApplyUpdatesToInstances {
4279        super::builder::instance_group_managers::ApplyUpdatesToInstances::new(self.inner.clone())
4280    }
4281
4282    /// Creates instances with per-instance configurations in this managed instance
4283    /// group. Instances are created using the current instance template. Thecreate instances operation is marked DONE if thecreateInstances request is successful. The underlying actions
4284    /// take additional time. You must separately verify the status of thecreating or actions with the listmanagedinstances
4285    /// method.
4286    pub fn create_instances(&self) -> super::builder::instance_group_managers::CreateInstances {
4287        super::builder::instance_group_managers::CreateInstances::new(self.inner.clone())
4288    }
4289
4290    /// Deletes the specified managed instance group and all of the instances
4291    /// in that group. Note that the instance group must not belong to a
4292    /// backend service. Read
4293    /// Deleting an instance group for more information.
4294    pub fn delete(&self) -> super::builder::instance_group_managers::Delete {
4295        super::builder::instance_group_managers::Delete::new(self.inner.clone())
4296    }
4297
4298    /// Flags the specified instances in the managed instance group for immediate
4299    /// deletion. The instances are also removed from any target
4300    /// pools of which they were a member. This method reduces thetargetSize of the managed instance group by the number of
4301    /// instances that you delete. This operation is marked as DONE
4302    /// when the action is scheduled even if the instances are still being deleted.
4303    /// You must separately verify the status of the deleting action
4304    /// with thelistmanagedinstances
4305    /// method.
4306    ///
4307    /// If the group is part of a backend
4308    /// service that has enabled
4309    /// connection draining, it can take up to 60 seconds after the connection
4310    /// draining duration has elapsed before the VM instance is removed or deleted.
4311    ///
4312    /// You can specify a maximum of 1000 instances with this method per request.
4313    pub fn delete_instances(&self) -> super::builder::instance_group_managers::DeleteInstances {
4314        super::builder::instance_group_managers::DeleteInstances::new(self.inner.clone())
4315    }
4316
4317    /// Deletes selected per-instance configurations for the managed instance
4318    /// group.
4319    pub fn delete_per_instance_configs(
4320        &self,
4321    ) -> super::builder::instance_group_managers::DeletePerInstanceConfigs {
4322        super::builder::instance_group_managers::DeletePerInstanceConfigs::new(self.inner.clone())
4323    }
4324
4325    /// Returns all of the details about the specified managed instance group.
4326    pub fn get(&self) -> super::builder::instance_group_managers::Get {
4327        super::builder::instance_group_managers::Get::new(self.inner.clone())
4328    }
4329
4330    /// Creates a managed instance group using the information that you specify
4331    /// in the request. After the group is created, instances in the group are
4332    /// created using the specified instance template.
4333    /// This operation is marked as DONE when the group is created
4334    /// even if the instances in the group have not yet been created. You
4335    /// must separately verify the status of the individual instances with thelistmanagedinstances
4336    /// method.
4337    ///
4338    /// A managed instance group can have up to 1000 VM instances per group. Please
4339    /// contact Cloud Support if you need an increase in
4340    /// this limit.
4341    pub fn insert(&self) -> super::builder::instance_group_managers::Insert {
4342        super::builder::instance_group_managers::Insert::new(self.inner.clone())
4343    }
4344
4345    /// Retrieves a list of managed instance groups that are contained within the
4346    /// specified project and zone.
4347    pub fn list(&self) -> super::builder::instance_group_managers::List {
4348        super::builder::instance_group_managers::List::new(self.inner.clone())
4349    }
4350
4351    /// Lists all errors thrown by actions on instances for a given managed
4352    /// instance group. The filter and orderBy query
4353    /// parameters are not supported.
4354    pub fn list_errors(&self) -> super::builder::instance_group_managers::ListErrors {
4355        super::builder::instance_group_managers::ListErrors::new(self.inner.clone())
4356    }
4357
4358    /// Lists all of the instances in the managed instance group. Each instance
4359    /// in the list has a currentAction, which indicates the action
4360    /// that the managed instance group is performing on the instance. For example,
4361    /// if the group is still creating an instance, the currentAction
4362    /// is CREATING. If a previous action failed, the
4363    /// list displays the errors for that failed action. The orderBy
4364    /// query parameter is not supported. The `pageToken` query parameter is
4365    /// supported only if the group's `listManagedInstancesResults` field is set
4366    /// to `PAGINATED`.
4367    pub fn list_managed_instances(
4368        &self,
4369    ) -> super::builder::instance_group_managers::ListManagedInstances {
4370        super::builder::instance_group_managers::ListManagedInstances::new(self.inner.clone())
4371    }
4372
4373    /// Lists all of the per-instance configurations defined for the managed
4374    /// instance group. The orderBy query parameter is not supported.
4375    pub fn list_per_instance_configs(
4376        &self,
4377    ) -> super::builder::instance_group_managers::ListPerInstanceConfigs {
4378        super::builder::instance_group_managers::ListPerInstanceConfigs::new(self.inner.clone())
4379    }
4380
4381    /// Updates a managed instance group using the information that you specify
4382    /// in the request.
4383    /// This operation is marked as DONE when the group is patched
4384    /// even if the instances in the group are still in the process of being
4385    /// patched. You must separately verify the status of the individual instances
4386    /// with thelistManagedInstances
4387    /// method. This method supportsPATCH
4388    /// semantics and uses theJSON merge
4389    /// patch format and processing rules.
4390    ///
4391    /// If you update your group to specify a new template or instance
4392    /// configuration, it's possible that your intended specification for each VM
4393    /// in the group is different from the current state of that VM. To learn how
4394    /// to apply an updated configuration to the VMs in a MIG, seeUpdating instances in
4395    /// a MIG.
4396    pub fn patch(&self) -> super::builder::instance_group_managers::Patch {
4397        super::builder::instance_group_managers::Patch::new(self.inner.clone())
4398    }
4399
4400    /// Inserts or patches per-instance configurations for the managed instance
4401    /// group. perInstanceConfig.name serves as a key used to
4402    /// distinguish whether to perform insert or patch.
4403    pub fn patch_per_instance_configs(
4404        &self,
4405    ) -> super::builder::instance_group_managers::PatchPerInstanceConfigs {
4406        super::builder::instance_group_managers::PatchPerInstanceConfigs::new(self.inner.clone())
4407    }
4408
4409    /// Flags the specified VM instances in the managed instance group to be
4410    /// immediately recreated. Each instance is recreated using the group's current
4411    /// configuration. This operation is marked as DONE when the flag
4412    /// is set even if the instances have not yet been recreated. You must
4413    /// separately verify the status of each instance by checking itscurrentAction field; for more information, see Checking
4414    /// the status of managed instances.
4415    ///
4416    /// If the group is part of a backend
4417    /// service that has enabled
4418    /// connection draining, it can take up to 60 seconds after the connection
4419    /// draining duration has elapsed before the VM instance is removed or deleted.
4420    ///
4421    /// You can specify a maximum of 1000 instances with this method per request.
4422    pub fn recreate_instances(&self) -> super::builder::instance_group_managers::RecreateInstances {
4423        super::builder::instance_group_managers::RecreateInstances::new(self.inner.clone())
4424    }
4425
4426    /// Resizes the managed instance group. If you increase the size, the group
4427    /// creates new instances using the current instance template. If you decrease
4428    /// the size, the group deletes instances. The resize operation is markedDONE when the resize actions are scheduled even if the group
4429    /// has not yet added or deleted any instances. You must separately
4430    /// verify the status of the creating or deleting
4431    /// actions with thelistmanagedinstances
4432    /// method.
4433    ///
4434    /// When resizing down, the instance group arbitrarily chooses the order in
4435    /// which VMs are deleted. The group takes into account some VM attributes when
4436    /// making the selection including:
4437    ///
4438    /// + The status of the VM instance.
4439    /// + The health of the VM instance.
4440    /// + The instance template version the VM is based on.
4441    /// + For regional managed instance groups, the location of the VM instance.
4442    ///
4443    /// This list is subject to change.
4444    ///
4445    /// If the group is part of a backend
4446    /// service that has enabled
4447    /// connection draining, it can take up to 60 seconds after the connection
4448    /// draining duration has elapsed before the VM instance is removed or deleted.
4449    pub fn resize(&self) -> super::builder::instance_group_managers::Resize {
4450        super::builder::instance_group_managers::Resize::new(self.inner.clone())
4451    }
4452
4453    /// Flags the specified instances in the managed instance group to be
4454    /// resumed. This method increases thetargetSize and decreases the targetSuspendedSize
4455    /// of the managed instance group by the number of instances that you resume.
4456    /// The resumeInstances operation is marked DONE if
4457    /// the resumeInstances request is successful. The underlying
4458    /// actions take additional time. You must separately verify the status of theRESUMING action with thelistmanagedinstances
4459    /// method.
4460    ///
4461    /// In this request, you can only specify instances that are suspended. For
4462    /// example, if an instance was previously suspended using the suspendInstances
4463    /// method, it can be resumed using the resumeInstances method.
4464    ///
4465    /// If a health check is attached to the managed instance group, the specified
4466    /// instances will be verified as healthy after they are resumed.
4467    ///
4468    /// You can specify a maximum of 1000 instances with this method per request.
4469    pub fn resume_instances(&self) -> super::builder::instance_group_managers::ResumeInstances {
4470        super::builder::instance_group_managers::ResumeInstances::new(self.inner.clone())
4471    }
4472
4473    /// Specifies the instance template to use when creating new instances in this
4474    /// group. The templates for existing instances in the group do not change
4475    /// unless you run recreateInstances, runapplyUpdatesToInstances, or set the group'supdatePolicy.type to PROACTIVE.
4476    pub fn set_instance_template(
4477        &self,
4478    ) -> super::builder::instance_group_managers::SetInstanceTemplate {
4479        super::builder::instance_group_managers::SetInstanceTemplate::new(self.inner.clone())
4480    }
4481
4482    /// Modifies the target pools to which all instances in this managed instance
4483    /// group are assigned. The target pools automatically apply to all of the
4484    /// instances in the managed instance group. This operation is markedDONE when you make the request even if the instances have not
4485    /// yet been added to their target pools. The change might take some time to
4486    /// apply to all of the instances in the group depending on the size of the
4487    /// group.
4488    pub fn set_target_pools(&self) -> super::builder::instance_group_managers::SetTargetPools {
4489        super::builder::instance_group_managers::SetTargetPools::new(self.inner.clone())
4490    }
4491
4492    /// Flags the specified instances in the managed instance group to be
4493    /// started. This method increases thetargetSize and decreases the targetStoppedSize
4494    /// of the managed instance group by the number of instances that you start.
4495    /// The startInstances operation is marked DONE if
4496    /// the startInstances request is successful. The underlying
4497    /// actions take additional time. You must separately verify the status of theSTARTING action with thelistmanagedinstances
4498    /// method.
4499    ///
4500    /// In this request, you can only specify instances that are stopped. For
4501    /// example, if an instance was previously stopped using the stopInstances
4502    /// method, it can be started using the startInstances method.
4503    ///
4504    /// If a health check is attached to the managed instance group, the specified
4505    /// instances will be verified as healthy after they are started.
4506    ///
4507    /// You can specify a maximum of 1000 instances with this method per request.
4508    pub fn start_instances(&self) -> super::builder::instance_group_managers::StartInstances {
4509        super::builder::instance_group_managers::StartInstances::new(self.inner.clone())
4510    }
4511
4512    /// Flags the specified instances in the managed instance group to be
4513    /// immediately stopped. You can only specify instances that are running in
4514    /// this request. This method reduces thetargetSize and increases the targetStoppedSize
4515    /// of the managed instance group by the number of instances that you stop.
4516    /// The stopInstances operation is marked DONE if
4517    /// the stopInstances request is successful. The underlying
4518    /// actions take additional time. You must separately verify the status of theSTOPPING action with thelistmanagedinstances
4519    /// method.
4520    ///
4521    /// If the standbyPolicy.initialDelaySec field is set, the group
4522    /// delays stopping the instances until initialDelaySec have
4523    /// passed from instance.creationTimestamp (that is, when the
4524    /// instance was created). This delay gives your application time to
4525    /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
4526    /// will be zero delay.
4527    ///
4528    /// If the group is part of a backend
4529    /// service that has enabled
4530    /// connection draining, it can take up to 60 seconds after the connection
4531    /// draining duration has elapsed before the VM instance is stopped.
4532    ///
4533    /// Stopped instances can be started using the startInstances
4534    /// method.
4535    ///
4536    /// You can specify a maximum of 1000 instances with this method per request.
4537    pub fn stop_instances(&self) -> super::builder::instance_group_managers::StopInstances {
4538        super::builder::instance_group_managers::StopInstances::new(self.inner.clone())
4539    }
4540
4541    /// Flags the specified instances in the managed instance group to be
4542    /// immediately suspended. You can only specify instances that are running in
4543    /// this request. This method reduces thetargetSize and increases the targetSuspendedSize
4544    /// of the managed instance group by the number of instances that you suspend.
4545    /// The suspendInstances operation is marked DONE if
4546    /// the suspendInstances request is successful. The underlying
4547    /// actions take additional time. You must separately verify the status of theSUSPENDING action with thelistmanagedinstances
4548    /// method.
4549    ///
4550    /// If the standbyPolicy.initialDelaySec field is set, the group
4551    /// delays suspension of the instances until initialDelaySec have
4552    /// passed from instance.creationTimestamp (that is, when the
4553    /// instance was created). This delay gives your application time to
4554    /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
4555    /// will be zero delay.
4556    ///
4557    /// If the group is part of a backend
4558    /// service that has enabled
4559    /// connection draining, it can take up to 60 seconds after the connection
4560    /// draining duration has elapsed before the VM instance is suspended.
4561    ///
4562    /// Suspended instances can be resumed using the resumeInstances
4563    /// method.
4564    ///
4565    /// You can specify a maximum of 1000 instances with this method per request.
4566    pub fn suspend_instances(&self) -> super::builder::instance_group_managers::SuspendInstances {
4567        super::builder::instance_group_managers::SuspendInstances::new(self.inner.clone())
4568    }
4569
4570    /// Inserts or updates per-instance configurations for the managed instance
4571    /// group. perInstanceConfig.name serves as a key used to
4572    /// distinguish whether to perform insert or patch.
4573    pub fn update_per_instance_configs(
4574        &self,
4575    ) -> super::builder::instance_group_managers::UpdatePerInstanceConfigs {
4576        super::builder::instance_group_managers::UpdatePerInstanceConfigs::new(self.inner.clone())
4577    }
4578
4579    /// Retrieves the specified zone-specific Operations resource.
4580    pub fn get_operation(&self) -> super::builder::instance_group_managers::GetOperation {
4581        super::builder::instance_group_managers::GetOperation::new(self.inner.clone())
4582    }
4583}
4584
4585/// Implements a client for the Google Compute Engine API.
4586///
4587/// # Example
4588/// ```
4589/// # use google_cloud_compute_v1::client::InstanceGroups;
4590/// async fn sample(
4591/// ) -> anyhow::Result<()> {
4592///     let client = InstanceGroups::builder().build().await?;
4593///     // use `client` to make requests to the Google Compute Engine API.
4594///     Ok(())
4595/// }
4596/// ```
4597///
4598/// # Service Description
4599///
4600/// Service for the `instanceGroups` resource.
4601///
4602/// # Configuration
4603///
4604/// To configure `InstanceGroups` use the `with_*` methods in the type returned
4605/// by [builder()][InstanceGroups::builder]. The default configuration should
4606/// work for most applications. Common configuration changes include
4607///
4608/// * [with_endpoint()]: by default this client uses the global default endpoint
4609///   (`https://compute.googleapis.com`). Applications using regional
4610///   endpoints or running in restricted networks (e.g. a network configured
4611//    with [Private Google Access with VPC Service Controls]) may want to
4612///   override this default.
4613/// * [with_credentials()]: by default this client uses
4614///   [Application Default Credentials]. Applications using custom
4615///   authentication may need to override this default.
4616///
4617/// [with_endpoint()]: super::builder::instance_groups::ClientBuilder::with_endpoint
4618/// [with_credentials()]: super::builder::instance_groups::ClientBuilder::with_credentials
4619/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4620/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4621///
4622/// # Pooling and Cloning
4623///
4624/// `InstanceGroups` holds a connection pool internally, it is advised to
4625/// create one and reuse it. You do not need to wrap `InstanceGroups` in
4626/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4627/// already uses an `Arc` internally.
4628#[cfg(feature = "instance-groups")]
4629#[cfg_attr(docsrs, doc(cfg(feature = "instance-groups")))]
4630#[derive(Clone, Debug)]
4631pub struct InstanceGroups {
4632    inner: std::sync::Arc<dyn super::stub::dynamic::InstanceGroups>,
4633}
4634
4635#[cfg(feature = "instance-groups")]
4636impl InstanceGroups {
4637    /// Returns a builder for [InstanceGroups].
4638    ///
4639    /// ```
4640    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4641    /// # use google_cloud_compute_v1::client::InstanceGroups;
4642    /// let client = InstanceGroups::builder().build().await?;
4643    /// # Ok(()) }
4644    /// ```
4645    pub fn builder() -> super::builder::instance_groups::ClientBuilder {
4646        crate::new_client_builder(super::builder::instance_groups::client::Factory)
4647    }
4648
4649    /// Creates a new client from the provided stub.
4650    ///
4651    /// The most common case for calling this function is in tests mocking the
4652    /// client's behavior.
4653    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
4654    where
4655        T: super::stub::InstanceGroups + 'static,
4656    {
4657        Self { inner: stub.into() }
4658    }
4659
4660    pub(crate) async fn new(
4661        config: gaxi::options::ClientConfig,
4662    ) -> crate::ClientBuilderResult<Self> {
4663        let inner = Self::build_inner(config).await?;
4664        Ok(Self { inner })
4665    }
4666
4667    async fn build_inner(
4668        conf: gaxi::options::ClientConfig,
4669    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InstanceGroups>> {
4670        if gaxi::options::tracing_enabled(&conf) {
4671            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4672        }
4673        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4674    }
4675
4676    async fn build_transport(
4677        conf: gaxi::options::ClientConfig,
4678    ) -> crate::ClientBuilderResult<impl super::stub::InstanceGroups> {
4679        super::transport::InstanceGroups::new(conf).await
4680    }
4681
4682    async fn build_with_tracing(
4683        conf: gaxi::options::ClientConfig,
4684    ) -> crate::ClientBuilderResult<impl super::stub::InstanceGroups> {
4685        Self::build_transport(conf)
4686            .await
4687            .map(super::tracing::InstanceGroups::new)
4688    }
4689
4690    /// Adds a list of instances to the specified instance group.  All of the
4691    /// instances in the instance group must be in the same network/subnetwork.
4692    /// Read
4693    /// Adding instances for more information.
4694    pub fn add_instances(&self) -> super::builder::instance_groups::AddInstances {
4695        super::builder::instance_groups::AddInstances::new(self.inner.clone())
4696    }
4697
4698    /// Retrieves the list of instance groups and sorts them by zone.
4699    ///
4700    /// To prevent failure, Google recommends that you set the
4701    /// `returnPartialSuccess` parameter to `true`.
4702    pub fn aggregated_list(&self) -> super::builder::instance_groups::AggregatedList {
4703        super::builder::instance_groups::AggregatedList::new(self.inner.clone())
4704    }
4705
4706    /// Deletes the specified instance group. The instances in the group are not
4707    /// deleted. Note that instance group must not belong to a backend service.
4708    /// Read
4709    /// Deleting an instance group for more information.
4710    pub fn delete(&self) -> super::builder::instance_groups::Delete {
4711        super::builder::instance_groups::Delete::new(self.inner.clone())
4712    }
4713
4714    /// Returns the specified zonal instance group. Get a list of available zonal
4715    /// instance groups by making a list() request.
4716    ///
4717    /// For managed instance groups, use theinstanceGroupManagers
4718    /// or regionInstanceGroupManagers
4719    /// methods instead.
4720    pub fn get(&self) -> super::builder::instance_groups::Get {
4721        super::builder::instance_groups::Get::new(self.inner.clone())
4722    }
4723
4724    /// Creates an instance group in the specified project using the
4725    /// parameters that are included in the request.
4726    pub fn insert(&self) -> super::builder::instance_groups::Insert {
4727        super::builder::instance_groups::Insert::new(self.inner.clone())
4728    }
4729
4730    /// Retrieves the list of zonal instance group resources contained within the
4731    /// specified zone.
4732    ///
4733    /// For managed instance groups, use theinstanceGroupManagers
4734    /// or regionInstanceGroupManagers
4735    /// methods instead.
4736    pub fn list(&self) -> super::builder::instance_groups::List {
4737        super::builder::instance_groups::List::new(self.inner.clone())
4738    }
4739
4740    /// Lists the instances in the specified instance group.
4741    /// The orderBy query parameter is not supported.
4742    /// The filter query parameter is supported, but only for
4743    /// expressions that use `eq` (equal) or `ne` (not equal) operators.
4744    pub fn list_instances(&self) -> super::builder::instance_groups::ListInstances {
4745        super::builder::instance_groups::ListInstances::new(self.inner.clone())
4746    }
4747
4748    /// Removes one or more instances from the specified instance group, but does
4749    /// not delete those instances.
4750    ///
4751    /// If the group is part of a backend
4752    /// service that has enabled
4753    /// connection draining, it can take up to 60 seconds after the connection
4754    /// draining duration before the VM instance is removed or deleted.
4755    pub fn remove_instances(&self) -> super::builder::instance_groups::RemoveInstances {
4756        super::builder::instance_groups::RemoveInstances::new(self.inner.clone())
4757    }
4758
4759    /// Sets the named ports for the specified instance group.
4760    pub fn set_named_ports(&self) -> super::builder::instance_groups::SetNamedPorts {
4761        super::builder::instance_groups::SetNamedPorts::new(self.inner.clone())
4762    }
4763
4764    /// Returns permissions that a caller has on the specified resource.
4765    pub fn test_iam_permissions(&self) -> super::builder::instance_groups::TestIamPermissions {
4766        super::builder::instance_groups::TestIamPermissions::new(self.inner.clone())
4767    }
4768
4769    /// Retrieves the specified zone-specific Operations resource.
4770    pub fn get_operation(&self) -> super::builder::instance_groups::GetOperation {
4771        super::builder::instance_groups::GetOperation::new(self.inner.clone())
4772    }
4773}
4774
4775/// Implements a client for the Google Compute Engine API.
4776///
4777/// # Example
4778/// ```
4779/// # use google_cloud_compute_v1::client::InstanceSettings;
4780/// async fn sample(
4781/// ) -> anyhow::Result<()> {
4782///     let client = InstanceSettings::builder().build().await?;
4783///     // use `client` to make requests to the Google Compute Engine API.
4784///     Ok(())
4785/// }
4786/// ```
4787///
4788/// # Service Description
4789///
4790/// Service for the `instanceSettings` resource.
4791///
4792/// # Configuration
4793///
4794/// To configure `InstanceSettings` use the `with_*` methods in the type returned
4795/// by [builder()][InstanceSettings::builder]. The default configuration should
4796/// work for most applications. Common configuration changes include
4797///
4798/// * [with_endpoint()]: by default this client uses the global default endpoint
4799///   (`https://compute.googleapis.com`). Applications using regional
4800///   endpoints or running in restricted networks (e.g. a network configured
4801//    with [Private Google Access with VPC Service Controls]) may want to
4802///   override this default.
4803/// * [with_credentials()]: by default this client uses
4804///   [Application Default Credentials]. Applications using custom
4805///   authentication may need to override this default.
4806///
4807/// [with_endpoint()]: super::builder::instance_settings::ClientBuilder::with_endpoint
4808/// [with_credentials()]: super::builder::instance_settings::ClientBuilder::with_credentials
4809/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4810/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4811///
4812/// # Pooling and Cloning
4813///
4814/// `InstanceSettings` holds a connection pool internally, it is advised to
4815/// create one and reuse it. You do not need to wrap `InstanceSettings` in
4816/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4817/// already uses an `Arc` internally.
4818#[cfg(feature = "instance-settings")]
4819#[cfg_attr(docsrs, doc(cfg(feature = "instance-settings")))]
4820#[derive(Clone, Debug)]
4821pub struct InstanceSettings {
4822    inner: std::sync::Arc<dyn super::stub::dynamic::InstanceSettings>,
4823}
4824
4825#[cfg(feature = "instance-settings")]
4826impl InstanceSettings {
4827    /// Returns a builder for [InstanceSettings].
4828    ///
4829    /// ```
4830    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4831    /// # use google_cloud_compute_v1::client::InstanceSettings;
4832    /// let client = InstanceSettings::builder().build().await?;
4833    /// # Ok(()) }
4834    /// ```
4835    pub fn builder() -> super::builder::instance_settings::ClientBuilder {
4836        crate::new_client_builder(super::builder::instance_settings::client::Factory)
4837    }
4838
4839    /// Creates a new client from the provided stub.
4840    ///
4841    /// The most common case for calling this function is in tests mocking the
4842    /// client's behavior.
4843    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
4844    where
4845        T: super::stub::InstanceSettings + 'static,
4846    {
4847        Self { inner: stub.into() }
4848    }
4849
4850    pub(crate) async fn new(
4851        config: gaxi::options::ClientConfig,
4852    ) -> crate::ClientBuilderResult<Self> {
4853        let inner = Self::build_inner(config).await?;
4854        Ok(Self { inner })
4855    }
4856
4857    async fn build_inner(
4858        conf: gaxi::options::ClientConfig,
4859    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InstanceSettings>>
4860    {
4861        if gaxi::options::tracing_enabled(&conf) {
4862            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4863        }
4864        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4865    }
4866
4867    async fn build_transport(
4868        conf: gaxi::options::ClientConfig,
4869    ) -> crate::ClientBuilderResult<impl super::stub::InstanceSettings> {
4870        super::transport::InstanceSettings::new(conf).await
4871    }
4872
4873    async fn build_with_tracing(
4874        conf: gaxi::options::ClientConfig,
4875    ) -> crate::ClientBuilderResult<impl super::stub::InstanceSettings> {
4876        Self::build_transport(conf)
4877            .await
4878            .map(super::tracing::InstanceSettings::new)
4879    }
4880
4881    /// Get Instance settings.
4882    pub fn get(&self) -> super::builder::instance_settings::Get {
4883        super::builder::instance_settings::Get::new(self.inner.clone())
4884    }
4885
4886    /// Patch Instance settings
4887    pub fn patch(&self) -> super::builder::instance_settings::Patch {
4888        super::builder::instance_settings::Patch::new(self.inner.clone())
4889    }
4890
4891    /// Retrieves the specified zone-specific Operations resource.
4892    pub fn get_operation(&self) -> super::builder::instance_settings::GetOperation {
4893        super::builder::instance_settings::GetOperation::new(self.inner.clone())
4894    }
4895}
4896
4897/// Implements a client for the Google Compute Engine API.
4898///
4899/// # Example
4900/// ```
4901/// # use google_cloud_compute_v1::client::InstanceTemplates;
4902/// async fn sample(
4903/// ) -> anyhow::Result<()> {
4904///     let client = InstanceTemplates::builder().build().await?;
4905///     // use `client` to make requests to the Google Compute Engine API.
4906///     Ok(())
4907/// }
4908/// ```
4909///
4910/// # Service Description
4911///
4912/// Service for the `instanceTemplates` resource.
4913///
4914/// # Configuration
4915///
4916/// To configure `InstanceTemplates` use the `with_*` methods in the type returned
4917/// by [builder()][InstanceTemplates::builder]. The default configuration should
4918/// work for most applications. Common configuration changes include
4919///
4920/// * [with_endpoint()]: by default this client uses the global default endpoint
4921///   (`https://compute.googleapis.com`). Applications using regional
4922///   endpoints or running in restricted networks (e.g. a network configured
4923//    with [Private Google Access with VPC Service Controls]) may want to
4924///   override this default.
4925/// * [with_credentials()]: by default this client uses
4926///   [Application Default Credentials]. Applications using custom
4927///   authentication may need to override this default.
4928///
4929/// [with_endpoint()]: super::builder::instance_templates::ClientBuilder::with_endpoint
4930/// [with_credentials()]: super::builder::instance_templates::ClientBuilder::with_credentials
4931/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4932/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4933///
4934/// # Pooling and Cloning
4935///
4936/// `InstanceTemplates` holds a connection pool internally, it is advised to
4937/// create one and reuse it. You do not need to wrap `InstanceTemplates` in
4938/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4939/// already uses an `Arc` internally.
4940#[cfg(feature = "instance-templates")]
4941#[cfg_attr(docsrs, doc(cfg(feature = "instance-templates")))]
4942#[derive(Clone, Debug)]
4943pub struct InstanceTemplates {
4944    inner: std::sync::Arc<dyn super::stub::dynamic::InstanceTemplates>,
4945}
4946
4947#[cfg(feature = "instance-templates")]
4948impl InstanceTemplates {
4949    /// Returns a builder for [InstanceTemplates].
4950    ///
4951    /// ```
4952    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4953    /// # use google_cloud_compute_v1::client::InstanceTemplates;
4954    /// let client = InstanceTemplates::builder().build().await?;
4955    /// # Ok(()) }
4956    /// ```
4957    pub fn builder() -> super::builder::instance_templates::ClientBuilder {
4958        crate::new_client_builder(super::builder::instance_templates::client::Factory)
4959    }
4960
4961    /// Creates a new client from the provided stub.
4962    ///
4963    /// The most common case for calling this function is in tests mocking the
4964    /// client's behavior.
4965    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
4966    where
4967        T: super::stub::InstanceTemplates + 'static,
4968    {
4969        Self { inner: stub.into() }
4970    }
4971
4972    pub(crate) async fn new(
4973        config: gaxi::options::ClientConfig,
4974    ) -> crate::ClientBuilderResult<Self> {
4975        let inner = Self::build_inner(config).await?;
4976        Ok(Self { inner })
4977    }
4978
4979    async fn build_inner(
4980        conf: gaxi::options::ClientConfig,
4981    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InstanceTemplates>>
4982    {
4983        if gaxi::options::tracing_enabled(&conf) {
4984            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4985        }
4986        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4987    }
4988
4989    async fn build_transport(
4990        conf: gaxi::options::ClientConfig,
4991    ) -> crate::ClientBuilderResult<impl super::stub::InstanceTemplates> {
4992        super::transport::InstanceTemplates::new(conf).await
4993    }
4994
4995    async fn build_with_tracing(
4996        conf: gaxi::options::ClientConfig,
4997    ) -> crate::ClientBuilderResult<impl super::stub::InstanceTemplates> {
4998        Self::build_transport(conf)
4999            .await
5000            .map(super::tracing::InstanceTemplates::new)
5001    }
5002
5003    /// Retrieves the list of all InstanceTemplates resources, regional and global,
5004    /// available to the specified project.
5005    ///
5006    /// To prevent failure, Google recommends that you set the
5007    /// `returnPartialSuccess` parameter to `true`.
5008    pub fn aggregated_list(&self) -> super::builder::instance_templates::AggregatedList {
5009        super::builder::instance_templates::AggregatedList::new(self.inner.clone())
5010    }
5011
5012    /// Deletes the specified instance template. Deleting an instance template is
5013    /// permanent and cannot be undone. It is not possible to delete templates
5014    /// that are already in use by a managed instance group.
5015    pub fn delete(&self) -> super::builder::instance_templates::Delete {
5016        super::builder::instance_templates::Delete::new(self.inner.clone())
5017    }
5018
5019    /// Returns the specified instance template.
5020    pub fn get(&self) -> super::builder::instance_templates::Get {
5021        super::builder::instance_templates::Get::new(self.inner.clone())
5022    }
5023
5024    /// Gets the access control policy for a resource. May be empty if no such
5025    /// policy or resource exists.
5026    pub fn get_iam_policy(&self) -> super::builder::instance_templates::GetIamPolicy {
5027        super::builder::instance_templates::GetIamPolicy::new(self.inner.clone())
5028    }
5029
5030    /// Creates an instance template in the specified project using the
5031    /// data that is included in the request. If you are creating a new template to
5032    /// update an existing instance group, your new instance template must use the
5033    /// same network or, if applicable, the same subnetwork as the original
5034    /// template.
5035    pub fn insert(&self) -> super::builder::instance_templates::Insert {
5036        super::builder::instance_templates::Insert::new(self.inner.clone())
5037    }
5038
5039    /// Retrieves a list of instance templates that are contained within
5040    /// the specified project.
5041    pub fn list(&self) -> super::builder::instance_templates::List {
5042        super::builder::instance_templates::List::new(self.inner.clone())
5043    }
5044
5045    /// Sets the access control policy on the specified resource.
5046    /// Replaces any existing policy.
5047    pub fn set_iam_policy(&self) -> super::builder::instance_templates::SetIamPolicy {
5048        super::builder::instance_templates::SetIamPolicy::new(self.inner.clone())
5049    }
5050
5051    /// Returns permissions that a caller has on the specified resource.
5052    pub fn test_iam_permissions(&self) -> super::builder::instance_templates::TestIamPermissions {
5053        super::builder::instance_templates::TestIamPermissions::new(self.inner.clone())
5054    }
5055
5056    /// Retrieves the specified Operations resource.
5057    pub fn get_operation(&self) -> super::builder::instance_templates::GetOperation {
5058        super::builder::instance_templates::GetOperation::new(self.inner.clone())
5059    }
5060}
5061
5062/// Implements a client for the Google Compute Engine API.
5063///
5064/// # Example
5065/// ```
5066/// # use google_cloud_compute_v1::client::Instances;
5067/// async fn sample(
5068/// ) -> anyhow::Result<()> {
5069///     let client = Instances::builder().build().await?;
5070///     // use `client` to make requests to the Google Compute Engine API.
5071///     Ok(())
5072/// }
5073/// ```
5074///
5075/// # Service Description
5076///
5077/// Service for the `instances` resource.
5078///
5079/// # Configuration
5080///
5081/// To configure `Instances` use the `with_*` methods in the type returned
5082/// by [builder()][Instances::builder]. The default configuration should
5083/// work for most applications. Common configuration changes include
5084///
5085/// * [with_endpoint()]: by default this client uses the global default endpoint
5086///   (`https://compute.googleapis.com`). Applications using regional
5087///   endpoints or running in restricted networks (e.g. a network configured
5088//    with [Private Google Access with VPC Service Controls]) may want to
5089///   override this default.
5090/// * [with_credentials()]: by default this client uses
5091///   [Application Default Credentials]. Applications using custom
5092///   authentication may need to override this default.
5093///
5094/// [with_endpoint()]: super::builder::instances::ClientBuilder::with_endpoint
5095/// [with_credentials()]: super::builder::instances::ClientBuilder::with_credentials
5096/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5097/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5098///
5099/// # Pooling and Cloning
5100///
5101/// `Instances` holds a connection pool internally, it is advised to
5102/// create one and reuse it. You do not need to wrap `Instances` in
5103/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5104/// already uses an `Arc` internally.
5105#[cfg(feature = "instances")]
5106#[cfg_attr(docsrs, doc(cfg(feature = "instances")))]
5107#[derive(Clone, Debug)]
5108pub struct Instances {
5109    inner: std::sync::Arc<dyn super::stub::dynamic::Instances>,
5110}
5111
5112#[cfg(feature = "instances")]
5113impl Instances {
5114    /// Returns a builder for [Instances].
5115    ///
5116    /// ```
5117    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5118    /// # use google_cloud_compute_v1::client::Instances;
5119    /// let client = Instances::builder().build().await?;
5120    /// # Ok(()) }
5121    /// ```
5122    pub fn builder() -> super::builder::instances::ClientBuilder {
5123        crate::new_client_builder(super::builder::instances::client::Factory)
5124    }
5125
5126    /// Creates a new client from the provided stub.
5127    ///
5128    /// The most common case for calling this function is in tests mocking the
5129    /// client's behavior.
5130    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
5131    where
5132        T: super::stub::Instances + 'static,
5133    {
5134        Self { inner: stub.into() }
5135    }
5136
5137    pub(crate) async fn new(
5138        config: gaxi::options::ClientConfig,
5139    ) -> crate::ClientBuilderResult<Self> {
5140        let inner = Self::build_inner(config).await?;
5141        Ok(Self { inner })
5142    }
5143
5144    async fn build_inner(
5145        conf: gaxi::options::ClientConfig,
5146    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Instances>> {
5147        if gaxi::options::tracing_enabled(&conf) {
5148            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5149        }
5150        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5151    }
5152
5153    async fn build_transport(
5154        conf: gaxi::options::ClientConfig,
5155    ) -> crate::ClientBuilderResult<impl super::stub::Instances> {
5156        super::transport::Instances::new(conf).await
5157    }
5158
5159    async fn build_with_tracing(
5160        conf: gaxi::options::ClientConfig,
5161    ) -> crate::ClientBuilderResult<impl super::stub::Instances> {
5162        Self::build_transport(conf)
5163            .await
5164            .map(super::tracing::Instances::new)
5165    }
5166
5167    /// Adds an access config to an instance's network interface.
5168    pub fn add_access_config(&self) -> super::builder::instances::AddAccessConfig {
5169        super::builder::instances::AddAccessConfig::new(self.inner.clone())
5170    }
5171
5172    /// Adds one dynamic network interface to an active instance.
5173    pub fn add_network_interface(&self) -> super::builder::instances::AddNetworkInterface {
5174        super::builder::instances::AddNetworkInterface::new(self.inner.clone())
5175    }
5176
5177    /// Adds existing resource policies to an instance. You can only add one
5178    /// policy right now which will be applied to this instance for scheduling live
5179    /// migrations.
5180    pub fn add_resource_policies(&self) -> super::builder::instances::AddResourcePolicies {
5181        super::builder::instances::AddResourcePolicies::new(self.inner.clone())
5182    }
5183
5184    /// Retrieves an aggregated list of all of the instances in your project
5185    /// across all regions and zones.
5186    ///
5187    /// The performance of this method degrades when a filter is specified on a
5188    /// project that has a very large number of instances.
5189    ///
5190    /// To prevent failure, Google recommends that you set the
5191    /// `returnPartialSuccess` parameter to `true`.
5192    pub fn aggregated_list(&self) -> super::builder::instances::AggregatedList {
5193        super::builder::instances::AggregatedList::new(self.inner.clone())
5194    }
5195
5196    /// Attaches an existing Disk resource to an instance. You must first
5197    /// create the disk before you can attach it. It is not possible to create
5198    /// and attach a disk at the same time. For more information, readAdding a
5199    /// persistent disk to your instance.
5200    pub fn attach_disk(&self) -> super::builder::instances::AttachDisk {
5201        super::builder::instances::AttachDisk::new(self.inner.clone())
5202    }
5203
5204    /// Creates multiple instances. Count specifies the number of instances to
5205    /// create. For more information, seeAbout bulk
5206    /// creation of VMs.
5207    pub fn bulk_insert(&self) -> super::builder::instances::BulkInsert {
5208        super::builder::instances::BulkInsert::new(self.inner.clone())
5209    }
5210
5211    /// Deletes the specified Instance resource. For more information, seeDeleting
5212    /// an instance.
5213    pub fn delete(&self) -> super::builder::instances::Delete {
5214        super::builder::instances::Delete::new(self.inner.clone())
5215    }
5216
5217    /// Deletes an access config from an instance's network interface.
5218    pub fn delete_access_config(&self) -> super::builder::instances::DeleteAccessConfig {
5219        super::builder::instances::DeleteAccessConfig::new(self.inner.clone())
5220    }
5221
5222    /// Deletes one dynamic network interface from an active instance.
5223    /// InstancesDeleteNetworkInterfaceRequest indicates:
5224    ///
5225    /// - instance from which to delete, using project+zone+resource_id fields;
5226    /// - dynamic network interface to be deleted, using network_interface_name
5227    ///   field;
5228    pub fn delete_network_interface(&self) -> super::builder::instances::DeleteNetworkInterface {
5229        super::builder::instances::DeleteNetworkInterface::new(self.inner.clone())
5230    }
5231
5232    /// Detaches a disk from an instance.
5233    pub fn detach_disk(&self) -> super::builder::instances::DetachDisk {
5234        super::builder::instances::DetachDisk::new(self.inner.clone())
5235    }
5236
5237    /// Returns the specified Instance resource.
5238    pub fn get(&self) -> super::builder::instances::Get {
5239        super::builder::instances::Get::new(self.inner.clone())
5240    }
5241
5242    /// Returns effective firewalls applied to an interface of the instance.
5243    pub fn get_effective_firewalls(&self) -> super::builder::instances::GetEffectiveFirewalls {
5244        super::builder::instances::GetEffectiveFirewalls::new(self.inner.clone())
5245    }
5246
5247    /// Returns the specified guest attributes entry.
5248    pub fn get_guest_attributes(&self) -> super::builder::instances::GetGuestAttributes {
5249        super::builder::instances::GetGuestAttributes::new(self.inner.clone())
5250    }
5251
5252    /// Gets the access control policy for a resource. May be empty if no such
5253    /// policy or resource exists.
5254    pub fn get_iam_policy(&self) -> super::builder::instances::GetIamPolicy {
5255        super::builder::instances::GetIamPolicy::new(self.inner.clone())
5256    }
5257
5258    /// Returns the screenshot from the specified instance.
5259    pub fn get_screenshot(&self) -> super::builder::instances::GetScreenshot {
5260        super::builder::instances::GetScreenshot::new(self.inner.clone())
5261    }
5262
5263    /// Returns the last 1 MB of serial port output from the specified instance.
5264    pub fn get_serial_port_output(&self) -> super::builder::instances::GetSerialPortOutput {
5265        super::builder::instances::GetSerialPortOutput::new(self.inner.clone())
5266    }
5267
5268    /// Returns the Shielded Instance Identity of an instance
5269    pub fn get_shielded_instance_identity(
5270        &self,
5271    ) -> super::builder::instances::GetShieldedInstanceIdentity {
5272        super::builder::instances::GetShieldedInstanceIdentity::new(self.inner.clone())
5273    }
5274
5275    /// Creates an instance resource in the specified project using the data
5276    /// included in the request.
5277    pub fn insert(&self) -> super::builder::instances::Insert {
5278        super::builder::instances::Insert::new(self.inner.clone())
5279    }
5280
5281    /// Retrieves the list of instances contained within
5282    /// the specified zone.
5283    pub fn list(&self) -> super::builder::instances::List {
5284        super::builder::instances::List::new(self.inner.clone())
5285    }
5286
5287    /// Retrieves a list of resources that refer to the VM instance specified in
5288    /// the request. For example, if the VM instance is part of a managed or
5289    /// unmanaged instance group, the referrers list includes the instance group.
5290    /// For more information, readViewing
5291    /// referrers to VM instances.
5292    pub fn list_referrers(&self) -> super::builder::instances::ListReferrers {
5293        super::builder::instances::ListReferrers::new(self.inner.clone())
5294    }
5295
5296    /// Perform a manual maintenance on the instance.
5297    pub fn perform_maintenance(&self) -> super::builder::instances::PerformMaintenance {
5298        super::builder::instances::PerformMaintenance::new(self.inner.clone())
5299    }
5300
5301    /// Removes resource policies from an instance.
5302    pub fn remove_resource_policies(&self) -> super::builder::instances::RemoveResourcePolicies {
5303        super::builder::instances::RemoveResourcePolicies::new(self.inner.clone())
5304    }
5305
5306    /// Mark the host as faulty and try to restart the instance on a new host.
5307    pub fn report_host_as_faulty(&self) -> super::builder::instances::ReportHostAsFaulty {
5308        super::builder::instances::ReportHostAsFaulty::new(self.inner.clone())
5309    }
5310
5311    /// Performs a reset on the instance. This is a hard reset. The VM
5312    /// does not do a graceful shutdown. For more information, seeResetting
5313    /// an instance.
5314    pub fn reset(&self) -> super::builder::instances::Reset {
5315        super::builder::instances::Reset::new(self.inner.clone())
5316    }
5317
5318    /// Resumes an instance that was suspended using theinstances().suspend
5319    /// method.
5320    pub fn resume(&self) -> super::builder::instances::Resume {
5321        super::builder::instances::Resume::new(self.inner.clone())
5322    }
5323
5324    /// Sends diagnostic interrupt to the instance.
5325    pub fn send_diagnostic_interrupt(&self) -> super::builder::instances::SendDiagnosticInterrupt {
5326        super::builder::instances::SendDiagnosticInterrupt::new(self.inner.clone())
5327    }
5328
5329    /// Sets deletion protection on the instance.
5330    pub fn set_deletion_protection(&self) -> super::builder::instances::SetDeletionProtection {
5331        super::builder::instances::SetDeletionProtection::new(self.inner.clone())
5332    }
5333
5334    /// Sets the auto-delete flag for a disk attached to an instance.
5335    pub fn set_disk_auto_delete(&self) -> super::builder::instances::SetDiskAutoDelete {
5336        super::builder::instances::SetDiskAutoDelete::new(self.inner.clone())
5337    }
5338
5339    /// Sets the access control policy on the specified resource.
5340    /// Replaces any existing policy.
5341    pub fn set_iam_policy(&self) -> super::builder::instances::SetIamPolicy {
5342        super::builder::instances::SetIamPolicy::new(self.inner.clone())
5343    }
5344
5345    /// Sets labels on an instance.  To learn more about labels, read theLabeling
5346    /// Resources documentation.
5347    pub fn set_labels(&self) -> super::builder::instances::SetLabels {
5348        super::builder::instances::SetLabels::new(self.inner.clone())
5349    }
5350
5351    /// Changes the number and/or type of accelerator for a stopped instance to the
5352    /// values specified in the request.
5353    pub fn set_machine_resources(&self) -> super::builder::instances::SetMachineResources {
5354        super::builder::instances::SetMachineResources::new(self.inner.clone())
5355    }
5356
5357    /// Changes the machine type for a stopped instance to the machine
5358    /// type specified in the request.
5359    pub fn set_machine_type(&self) -> super::builder::instances::SetMachineType {
5360        super::builder::instances::SetMachineType::new(self.inner.clone())
5361    }
5362
5363    /// Sets metadata for the specified instance to the data included
5364    /// in the request.
5365    pub fn set_metadata(&self) -> super::builder::instances::SetMetadata {
5366        super::builder::instances::SetMetadata::new(self.inner.clone())
5367    }
5368
5369    /// Changes the minimum CPU platform that this instance should use.
5370    /// This method can only
5371    /// be called on a stopped instance. For more information, readSpecifying a
5372    /// Minimum CPU Platform.
5373    pub fn set_min_cpu_platform(&self) -> super::builder::instances::SetMinCpuPlatform {
5374        super::builder::instances::SetMinCpuPlatform::new(self.inner.clone())
5375    }
5376
5377    /// Sets name of an instance.
5378    pub fn set_name(&self) -> super::builder::instances::SetName {
5379        super::builder::instances::SetName::new(self.inner.clone())
5380    }
5381
5382    /// Sets an instance's scheduling options. You can only call this method on astopped instance,
5383    /// that is, a VM instance that is in a `TERMINATED` state. SeeInstance Life
5384    /// Cycle for more information on the possible instance states.
5385    /// For more information about setting scheduling options for a VM, seeSet
5386    /// VM host maintenance policy.
5387    pub fn set_scheduling(&self) -> super::builder::instances::SetScheduling {
5388        super::builder::instances::SetScheduling::new(self.inner.clone())
5389    }
5390
5391    /// Sets the Google Cloud Armor security policy for the specified instance.
5392    /// For more information, seeGoogle
5393    /// Cloud Armor Overview
5394    pub fn set_security_policy(&self) -> super::builder::instances::SetSecurityPolicy {
5395        super::builder::instances::SetSecurityPolicy::new(self.inner.clone())
5396    }
5397
5398    /// Sets the service account on the instance. For more information,
5399    /// readChanging
5400    /// the service account and access scopes for an instance.
5401    pub fn set_service_account(&self) -> super::builder::instances::SetServiceAccount {
5402        super::builder::instances::SetServiceAccount::new(self.inner.clone())
5403    }
5404
5405    /// Sets the Shielded Instance integrity policy for an instance. You can
5406    /// only use this method on a running instance. This method
5407    /// supports PATCH semantics and uses the JSON merge
5408    /// patch format and processing rules.
5409    pub fn set_shielded_instance_integrity_policy(
5410        &self,
5411    ) -> super::builder::instances::SetShieldedInstanceIntegrityPolicy {
5412        super::builder::instances::SetShieldedInstanceIntegrityPolicy::new(self.inner.clone())
5413    }
5414
5415    /// Sets network tags
5416    /// for the specified instance to the data included in the request.
5417    pub fn set_tags(&self) -> super::builder::instances::SetTags {
5418        super::builder::instances::SetTags::new(self.inner.clone())
5419    }
5420
5421    /// Simulates a host maintenance event on a VM. For more information, see
5422    /// Simulate a host maintenance event.
5423    pub fn simulate_maintenance_event(
5424        &self,
5425    ) -> super::builder::instances::SimulateMaintenanceEvent {
5426        super::builder::instances::SimulateMaintenanceEvent::new(self.inner.clone())
5427    }
5428
5429    /// Starts an instance that was stopped using theinstances().stop
5430    /// method. For more information, seeRestart an
5431    /// instance.
5432    pub fn start(&self) -> super::builder::instances::Start {
5433        super::builder::instances::Start::new(self.inner.clone())
5434    }
5435
5436    /// Starts an instance that was stopped using theinstances().stop
5437    /// method. For more information, seeRestart an
5438    /// instance.
5439    pub fn start_with_encryption_key(&self) -> super::builder::instances::StartWithEncryptionKey {
5440        super::builder::instances::StartWithEncryptionKey::new(self.inner.clone())
5441    }
5442
5443    /// Stops a running instance, shutting it down cleanly, and allows
5444    /// you to restart the instance at a later time. Stopped instances do not incur
5445    /// VM usage charges while they are stopped. However, resources that the VM is
5446    /// using, such as persistent disks and static IP addresses, will continue to
5447    /// be charged until they are deleted. For more information, seeStopping
5448    /// an instance.
5449    pub fn stop(&self) -> super::builder::instances::Stop {
5450        super::builder::instances::Stop::new(self.inner.clone())
5451    }
5452
5453    /// This method suspends a running instance, saving its state to persistent
5454    /// storage, and allows you to resume the instance at a later time. Suspended
5455    /// instances have no compute costs (cores or RAM), and incur only storage
5456    /// charges for the saved VM memory and localSSD data. Any charged resources
5457    /// the virtual machine was using, such as persistent disks and static IP
5458    /// addresses, will continue to be charged while the instance is suspended.
5459    /// For more information, see
5460    /// Suspending and resuming an instance.
5461    pub fn suspend(&self) -> super::builder::instances::Suspend {
5462        super::builder::instances::Suspend::new(self.inner.clone())
5463    }
5464
5465    /// Returns permissions that a caller has on the specified resource.
5466    pub fn test_iam_permissions(&self) -> super::builder::instances::TestIamPermissions {
5467        super::builder::instances::TestIamPermissions::new(self.inner.clone())
5468    }
5469
5470    /// Updates an instance only if the necessary resources are available. This
5471    /// method can update only a specific set of instance properties. See
5472    /// Updating a running instance for a list of updatable instance
5473    /// properties.
5474    pub fn update(&self) -> super::builder::instances::Update {
5475        super::builder::instances::Update::new(self.inner.clone())
5476    }
5477
5478    /// Updates the specified access config from an instance's network interface
5479    /// with the data included in the request. This method supportsPATCH
5480    /// semantics and uses theJSON merge
5481    /// patch format and processing rules.
5482    pub fn update_access_config(&self) -> super::builder::instances::UpdateAccessConfig {
5483        super::builder::instances::UpdateAccessConfig::new(self.inner.clone())
5484    }
5485
5486    /// Updates the Display config for a VM instance. You can
5487    /// only use this method on a stopped VM instance. This method supportsPATCH
5488    /// semantics and uses theJSON merge
5489    /// patch format and processing rules.
5490    pub fn update_display_device(&self) -> super::builder::instances::UpdateDisplayDevice {
5491        super::builder::instances::UpdateDisplayDevice::new(self.inner.clone())
5492    }
5493
5494    /// Updates an instance's network interface. This method can only update an
5495    /// interface's alias IP range and attached network. See Modifying
5496    /// alias IP ranges for an existing instance for instructions on
5497    /// changing alias IP ranges. See Migrating
5498    /// a VM between networks for instructions on migrating an interface.
5499    /// This method follows PATCH semantics.
5500    pub fn update_network_interface(&self) -> super::builder::instances::UpdateNetworkInterface {
5501        super::builder::instances::UpdateNetworkInterface::new(self.inner.clone())
5502    }
5503
5504    /// Updates the Shielded Instance config for an instance. You can
5505    /// only use this method on a stopped instance. This method supportsPATCH
5506    /// semantics and uses theJSON merge
5507    /// patch format and processing rules.
5508    pub fn update_shielded_instance_config(
5509        &self,
5510    ) -> super::builder::instances::UpdateShieldedInstanceConfig {
5511        super::builder::instances::UpdateShieldedInstanceConfig::new(self.inner.clone())
5512    }
5513
5514    /// Retrieves the specified zone-specific Operations resource.
5515    pub fn get_operation(&self) -> super::builder::instances::GetOperation {
5516        super::builder::instances::GetOperation::new(self.inner.clone())
5517    }
5518}
5519
5520/// Implements a client for the Google Compute Engine API.
5521///
5522/// # Example
5523/// ```
5524/// # use google_cloud_compute_v1::client::InstantSnapshotGroups;
5525/// async fn sample(
5526/// ) -> anyhow::Result<()> {
5527///     let client = InstantSnapshotGroups::builder().build().await?;
5528///     // use `client` to make requests to the Google Compute Engine API.
5529///     Ok(())
5530/// }
5531/// ```
5532///
5533/// # Service Description
5534///
5535/// Service for the `instantSnapshotGroups` resource.
5536///
5537/// # Configuration
5538///
5539/// To configure `InstantSnapshotGroups` use the `with_*` methods in the type returned
5540/// by [builder()][InstantSnapshotGroups::builder]. The default configuration should
5541/// work for most applications. Common configuration changes include
5542///
5543/// * [with_endpoint()]: by default this client uses the global default endpoint
5544///   (`https://compute.googleapis.com`). Applications using regional
5545///   endpoints or running in restricted networks (e.g. a network configured
5546//    with [Private Google Access with VPC Service Controls]) may want to
5547///   override this default.
5548/// * [with_credentials()]: by default this client uses
5549///   [Application Default Credentials]. Applications using custom
5550///   authentication may need to override this default.
5551///
5552/// [with_endpoint()]: super::builder::instant_snapshot_groups::ClientBuilder::with_endpoint
5553/// [with_credentials()]: super::builder::instant_snapshot_groups::ClientBuilder::with_credentials
5554/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5555/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5556///
5557/// # Pooling and Cloning
5558///
5559/// `InstantSnapshotGroups` holds a connection pool internally, it is advised to
5560/// create one and reuse it. You do not need to wrap `InstantSnapshotGroups` in
5561/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5562/// already uses an `Arc` internally.
5563#[cfg(feature = "instant-snapshot-groups")]
5564#[cfg_attr(docsrs, doc(cfg(feature = "instant-snapshot-groups")))]
5565#[derive(Clone, Debug)]
5566pub struct InstantSnapshotGroups {
5567    inner: std::sync::Arc<dyn super::stub::dynamic::InstantSnapshotGroups>,
5568}
5569
5570#[cfg(feature = "instant-snapshot-groups")]
5571impl InstantSnapshotGroups {
5572    /// Returns a builder for [InstantSnapshotGroups].
5573    ///
5574    /// ```
5575    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5576    /// # use google_cloud_compute_v1::client::InstantSnapshotGroups;
5577    /// let client = InstantSnapshotGroups::builder().build().await?;
5578    /// # Ok(()) }
5579    /// ```
5580    pub fn builder() -> super::builder::instant_snapshot_groups::ClientBuilder {
5581        crate::new_client_builder(super::builder::instant_snapshot_groups::client::Factory)
5582    }
5583
5584    /// Creates a new client from the provided stub.
5585    ///
5586    /// The most common case for calling this function is in tests mocking the
5587    /// client's behavior.
5588    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
5589    where
5590        T: super::stub::InstantSnapshotGroups + 'static,
5591    {
5592        Self { inner: stub.into() }
5593    }
5594
5595    pub(crate) async fn new(
5596        config: gaxi::options::ClientConfig,
5597    ) -> crate::ClientBuilderResult<Self> {
5598        let inner = Self::build_inner(config).await?;
5599        Ok(Self { inner })
5600    }
5601
5602    async fn build_inner(
5603        conf: gaxi::options::ClientConfig,
5604    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InstantSnapshotGroups>>
5605    {
5606        if gaxi::options::tracing_enabled(&conf) {
5607            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5608        }
5609        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5610    }
5611
5612    async fn build_transport(
5613        conf: gaxi::options::ClientConfig,
5614    ) -> crate::ClientBuilderResult<impl super::stub::InstantSnapshotGroups> {
5615        super::transport::InstantSnapshotGroups::new(conf).await
5616    }
5617
5618    async fn build_with_tracing(
5619        conf: gaxi::options::ClientConfig,
5620    ) -> crate::ClientBuilderResult<impl super::stub::InstantSnapshotGroups> {
5621        Self::build_transport(conf)
5622            .await
5623            .map(super::tracing::InstantSnapshotGroups::new)
5624    }
5625
5626    /// deletes a Zonal InstantSnapshotGroup resource
5627    pub fn delete(&self) -> super::builder::instant_snapshot_groups::Delete {
5628        super::builder::instant_snapshot_groups::Delete::new(self.inner.clone())
5629    }
5630
5631    /// returns the specified InstantSnapshotGroup resource in the specified zone.
5632    pub fn get(&self) -> super::builder::instant_snapshot_groups::Get {
5633        super::builder::instant_snapshot_groups::Get::new(self.inner.clone())
5634    }
5635
5636    /// Gets the access control policy for a resource. May be empty if no such
5637    /// policy or resource exists.
5638    pub fn get_iam_policy(&self) -> super::builder::instant_snapshot_groups::GetIamPolicy {
5639        super::builder::instant_snapshot_groups::GetIamPolicy::new(self.inner.clone())
5640    }
5641
5642    /// inserts a Zonal InstantSnapshotGroup resource
5643    pub fn insert(&self) -> super::builder::instant_snapshot_groups::Insert {
5644        super::builder::instant_snapshot_groups::Insert::new(self.inner.clone())
5645    }
5646
5647    /// retrieves the list of InstantSnapshotGroup resources contained within
5648    /// the specified zone.
5649    pub fn list(&self) -> super::builder::instant_snapshot_groups::List {
5650        super::builder::instant_snapshot_groups::List::new(self.inner.clone())
5651    }
5652
5653    /// Sets the access control policy on the specified resource.
5654    /// Replaces any existing policy.
5655    pub fn set_iam_policy(&self) -> super::builder::instant_snapshot_groups::SetIamPolicy {
5656        super::builder::instant_snapshot_groups::SetIamPolicy::new(self.inner.clone())
5657    }
5658
5659    /// Returns permissions that a caller has on the specified resource.
5660    pub fn test_iam_permissions(
5661        &self,
5662    ) -> super::builder::instant_snapshot_groups::TestIamPermissions {
5663        super::builder::instant_snapshot_groups::TestIamPermissions::new(self.inner.clone())
5664    }
5665
5666    /// Retrieves the specified zone-specific Operations resource.
5667    pub fn get_operation(&self) -> super::builder::instant_snapshot_groups::GetOperation {
5668        super::builder::instant_snapshot_groups::GetOperation::new(self.inner.clone())
5669    }
5670}
5671
5672/// Implements a client for the Google Compute Engine API.
5673///
5674/// # Example
5675/// ```
5676/// # use google_cloud_compute_v1::client::InstantSnapshots;
5677/// async fn sample(
5678/// ) -> anyhow::Result<()> {
5679///     let client = InstantSnapshots::builder().build().await?;
5680///     // use `client` to make requests to the Google Compute Engine API.
5681///     Ok(())
5682/// }
5683/// ```
5684///
5685/// # Service Description
5686///
5687/// Service for the `instantSnapshots` resource.
5688///
5689/// # Configuration
5690///
5691/// To configure `InstantSnapshots` use the `with_*` methods in the type returned
5692/// by [builder()][InstantSnapshots::builder]. The default configuration should
5693/// work for most applications. Common configuration changes include
5694///
5695/// * [with_endpoint()]: by default this client uses the global default endpoint
5696///   (`https://compute.googleapis.com`). Applications using regional
5697///   endpoints or running in restricted networks (e.g. a network configured
5698//    with [Private Google Access with VPC Service Controls]) may want to
5699///   override this default.
5700/// * [with_credentials()]: by default this client uses
5701///   [Application Default Credentials]. Applications using custom
5702///   authentication may need to override this default.
5703///
5704/// [with_endpoint()]: super::builder::instant_snapshots::ClientBuilder::with_endpoint
5705/// [with_credentials()]: super::builder::instant_snapshots::ClientBuilder::with_credentials
5706/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5707/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5708///
5709/// # Pooling and Cloning
5710///
5711/// `InstantSnapshots` holds a connection pool internally, it is advised to
5712/// create one and reuse it. You do not need to wrap `InstantSnapshots` in
5713/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5714/// already uses an `Arc` internally.
5715#[cfg(feature = "instant-snapshots")]
5716#[cfg_attr(docsrs, doc(cfg(feature = "instant-snapshots")))]
5717#[derive(Clone, Debug)]
5718pub struct InstantSnapshots {
5719    inner: std::sync::Arc<dyn super::stub::dynamic::InstantSnapshots>,
5720}
5721
5722#[cfg(feature = "instant-snapshots")]
5723impl InstantSnapshots {
5724    /// Returns a builder for [InstantSnapshots].
5725    ///
5726    /// ```
5727    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5728    /// # use google_cloud_compute_v1::client::InstantSnapshots;
5729    /// let client = InstantSnapshots::builder().build().await?;
5730    /// # Ok(()) }
5731    /// ```
5732    pub fn builder() -> super::builder::instant_snapshots::ClientBuilder {
5733        crate::new_client_builder(super::builder::instant_snapshots::client::Factory)
5734    }
5735
5736    /// Creates a new client from the provided stub.
5737    ///
5738    /// The most common case for calling this function is in tests mocking the
5739    /// client's behavior.
5740    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
5741    where
5742        T: super::stub::InstantSnapshots + 'static,
5743    {
5744        Self { inner: stub.into() }
5745    }
5746
5747    pub(crate) async fn new(
5748        config: gaxi::options::ClientConfig,
5749    ) -> crate::ClientBuilderResult<Self> {
5750        let inner = Self::build_inner(config).await?;
5751        Ok(Self { inner })
5752    }
5753
5754    async fn build_inner(
5755        conf: gaxi::options::ClientConfig,
5756    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InstantSnapshots>>
5757    {
5758        if gaxi::options::tracing_enabled(&conf) {
5759            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5760        }
5761        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5762    }
5763
5764    async fn build_transport(
5765        conf: gaxi::options::ClientConfig,
5766    ) -> crate::ClientBuilderResult<impl super::stub::InstantSnapshots> {
5767        super::transport::InstantSnapshots::new(conf).await
5768    }
5769
5770    async fn build_with_tracing(
5771        conf: gaxi::options::ClientConfig,
5772    ) -> crate::ClientBuilderResult<impl super::stub::InstantSnapshots> {
5773        Self::build_transport(conf)
5774            .await
5775            .map(super::tracing::InstantSnapshots::new)
5776    }
5777
5778    /// Retrieves an aggregated list of instantSnapshots.
5779    ///
5780    /// To prevent failure, Google recommends that you set the
5781    /// `returnPartialSuccess` parameter to `true`.
5782    pub fn aggregated_list(&self) -> super::builder::instant_snapshots::AggregatedList {
5783        super::builder::instant_snapshots::AggregatedList::new(self.inner.clone())
5784    }
5785
5786    /// Deletes the specified InstantSnapshot resource. Keep in mind that deleting
5787    /// a single instantSnapshot might not necessarily delete all the data on that
5788    /// instantSnapshot. If any data on the instantSnapshot that is marked for
5789    /// deletion is needed for subsequent instantSnapshots, the data will be moved
5790    /// to the next corresponding instantSnapshot.
5791    ///
5792    /// For more information, seeDeleting
5793    /// instantSnapshots.
5794    pub fn delete(&self) -> super::builder::instant_snapshots::Delete {
5795        super::builder::instant_snapshots::Delete::new(self.inner.clone())
5796    }
5797
5798    /// Returns the specified InstantSnapshot resource in the specified zone.
5799    pub fn get(&self) -> super::builder::instant_snapshots::Get {
5800        super::builder::instant_snapshots::Get::new(self.inner.clone())
5801    }
5802
5803    /// Gets the access control policy for a resource. May be empty if no such
5804    /// policy or resource exists.
5805    pub fn get_iam_policy(&self) -> super::builder::instant_snapshots::GetIamPolicy {
5806        super::builder::instant_snapshots::GetIamPolicy::new(self.inner.clone())
5807    }
5808
5809    /// Creates an instant snapshot in the specified zone.
5810    pub fn insert(&self) -> super::builder::instant_snapshots::Insert {
5811        super::builder::instant_snapshots::Insert::new(self.inner.clone())
5812    }
5813
5814    /// Retrieves the list of InstantSnapshot resources contained within
5815    /// the specified zone.
5816    pub fn list(&self) -> super::builder::instant_snapshots::List {
5817        super::builder::instant_snapshots::List::new(self.inner.clone())
5818    }
5819
5820    /// Sets the access control policy on the specified resource.
5821    /// Replaces any existing policy.
5822    pub fn set_iam_policy(&self) -> super::builder::instant_snapshots::SetIamPolicy {
5823        super::builder::instant_snapshots::SetIamPolicy::new(self.inner.clone())
5824    }
5825
5826    /// Sets the labels on a instantSnapshot in the given zone. To learn more about
5827    /// labels, read the Labeling
5828    /// Resources documentation.
5829    pub fn set_labels(&self) -> super::builder::instant_snapshots::SetLabels {
5830        super::builder::instant_snapshots::SetLabels::new(self.inner.clone())
5831    }
5832
5833    /// Returns permissions that a caller has on the specified resource.
5834    pub fn test_iam_permissions(&self) -> super::builder::instant_snapshots::TestIamPermissions {
5835        super::builder::instant_snapshots::TestIamPermissions::new(self.inner.clone())
5836    }
5837
5838    /// Retrieves the specified zone-specific Operations resource.
5839    pub fn get_operation(&self) -> super::builder::instant_snapshots::GetOperation {
5840        super::builder::instant_snapshots::GetOperation::new(self.inner.clone())
5841    }
5842}
5843
5844/// Implements a client for the Google Compute Engine API.
5845///
5846/// # Example
5847/// ```
5848/// # use google_cloud_compute_v1::client::InterconnectAttachmentGroups;
5849/// async fn sample(
5850/// ) -> anyhow::Result<()> {
5851///     let client = InterconnectAttachmentGroups::builder().build().await?;
5852///     // use `client` to make requests to the Google Compute Engine API.
5853///     Ok(())
5854/// }
5855/// ```
5856///
5857/// # Service Description
5858///
5859/// Service for the `interconnectAttachmentGroups` resource.
5860///
5861/// # Configuration
5862///
5863/// To configure `InterconnectAttachmentGroups` use the `with_*` methods in the type returned
5864/// by [builder()][InterconnectAttachmentGroups::builder]. The default configuration should
5865/// work for most applications. Common configuration changes include
5866///
5867/// * [with_endpoint()]: by default this client uses the global default endpoint
5868///   (`https://compute.googleapis.com`). Applications using regional
5869///   endpoints or running in restricted networks (e.g. a network configured
5870//    with [Private Google Access with VPC Service Controls]) may want to
5871///   override this default.
5872/// * [with_credentials()]: by default this client uses
5873///   [Application Default Credentials]. Applications using custom
5874///   authentication may need to override this default.
5875///
5876/// [with_endpoint()]: super::builder::interconnect_attachment_groups::ClientBuilder::with_endpoint
5877/// [with_credentials()]: super::builder::interconnect_attachment_groups::ClientBuilder::with_credentials
5878/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5879/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5880///
5881/// # Pooling and Cloning
5882///
5883/// `InterconnectAttachmentGroups` holds a connection pool internally, it is advised to
5884/// create one and reuse it. You do not need to wrap `InterconnectAttachmentGroups` in
5885/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5886/// already uses an `Arc` internally.
5887#[cfg(feature = "interconnect-attachment-groups")]
5888#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-attachment-groups")))]
5889#[derive(Clone, Debug)]
5890pub struct InterconnectAttachmentGroups {
5891    inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachmentGroups>,
5892}
5893
5894#[cfg(feature = "interconnect-attachment-groups")]
5895impl InterconnectAttachmentGroups {
5896    /// Returns a builder for [InterconnectAttachmentGroups].
5897    ///
5898    /// ```
5899    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5900    /// # use google_cloud_compute_v1::client::InterconnectAttachmentGroups;
5901    /// let client = InterconnectAttachmentGroups::builder().build().await?;
5902    /// # Ok(()) }
5903    /// ```
5904    pub fn builder() -> super::builder::interconnect_attachment_groups::ClientBuilder {
5905        crate::new_client_builder(super::builder::interconnect_attachment_groups::client::Factory)
5906    }
5907
5908    /// Creates a new client from the provided stub.
5909    ///
5910    /// The most common case for calling this function is in tests mocking the
5911    /// client's behavior.
5912    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
5913    where
5914        T: super::stub::InterconnectAttachmentGroups + 'static,
5915    {
5916        Self { inner: stub.into() }
5917    }
5918
5919    pub(crate) async fn new(
5920        config: gaxi::options::ClientConfig,
5921    ) -> crate::ClientBuilderResult<Self> {
5922        let inner = Self::build_inner(config).await?;
5923        Ok(Self { inner })
5924    }
5925
5926    async fn build_inner(
5927        conf: gaxi::options::ClientConfig,
5928    ) -> crate::ClientBuilderResult<
5929        std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachmentGroups>,
5930    > {
5931        if gaxi::options::tracing_enabled(&conf) {
5932            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5933        }
5934        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5935    }
5936
5937    async fn build_transport(
5938        conf: gaxi::options::ClientConfig,
5939    ) -> crate::ClientBuilderResult<impl super::stub::InterconnectAttachmentGroups> {
5940        super::transport::InterconnectAttachmentGroups::new(conf).await
5941    }
5942
5943    async fn build_with_tracing(
5944        conf: gaxi::options::ClientConfig,
5945    ) -> crate::ClientBuilderResult<impl super::stub::InterconnectAttachmentGroups> {
5946        Self::build_transport(conf)
5947            .await
5948            .map(super::tracing::InterconnectAttachmentGroups::new)
5949    }
5950
5951    /// Deletes the specified InterconnectAttachmentGroup in the given scope
5952    pub fn delete(&self) -> super::builder::interconnect_attachment_groups::Delete {
5953        super::builder::interconnect_attachment_groups::Delete::new(self.inner.clone())
5954    }
5955
5956    /// Returns the specified InterconnectAttachmentGroup resource in the given
5957    /// scope.
5958    pub fn get(&self) -> super::builder::interconnect_attachment_groups::Get {
5959        super::builder::interconnect_attachment_groups::Get::new(self.inner.clone())
5960    }
5961
5962    /// Gets the access control policy for a resource. May be empty if no such
5963    /// policy or resource exists.
5964    pub fn get_iam_policy(&self) -> super::builder::interconnect_attachment_groups::GetIamPolicy {
5965        super::builder::interconnect_attachment_groups::GetIamPolicy::new(self.inner.clone())
5966    }
5967
5968    /// Returns the InterconnectAttachmentStatuses for the specified
5969    /// InterconnectAttachmentGroup resource.
5970    pub fn get_operational_status(
5971        &self,
5972    ) -> super::builder::interconnect_attachment_groups::GetOperationalStatus {
5973        super::builder::interconnect_attachment_groups::GetOperationalStatus::new(
5974            self.inner.clone(),
5975        )
5976    }
5977
5978    /// Creates a InterconnectAttachmentGroup in the specified project in the given
5979    /// scope using the parameters that are included in the request.
5980    pub fn insert(&self) -> super::builder::interconnect_attachment_groups::Insert {
5981        super::builder::interconnect_attachment_groups::Insert::new(self.inner.clone())
5982    }
5983
5984    /// Lists the InterconnectAttachmentGroups for a project in the given scope.
5985    pub fn list(&self) -> super::builder::interconnect_attachment_groups::List {
5986        super::builder::interconnect_attachment_groups::List::new(self.inner.clone())
5987    }
5988
5989    /// Patches the specified InterconnectAttachmentGroup resource with the data
5990    /// included in the request. This method supports PATCH
5991    /// semantics and usesJSON merge
5992    /// patch format and processing rules.
5993    pub fn patch(&self) -> super::builder::interconnect_attachment_groups::Patch {
5994        super::builder::interconnect_attachment_groups::Patch::new(self.inner.clone())
5995    }
5996
5997    /// Sets the access control policy on the specified resource.
5998    /// Replaces any existing policy.
5999    pub fn set_iam_policy(&self) -> super::builder::interconnect_attachment_groups::SetIamPolicy {
6000        super::builder::interconnect_attachment_groups::SetIamPolicy::new(self.inner.clone())
6001    }
6002
6003    /// Returns permissions that a caller has on the specified resource.
6004    pub fn test_iam_permissions(
6005        &self,
6006    ) -> super::builder::interconnect_attachment_groups::TestIamPermissions {
6007        super::builder::interconnect_attachment_groups::TestIamPermissions::new(self.inner.clone())
6008    }
6009
6010    /// Retrieves the specified Operations resource.
6011    pub fn get_operation(&self) -> super::builder::interconnect_attachment_groups::GetOperation {
6012        super::builder::interconnect_attachment_groups::GetOperation::new(self.inner.clone())
6013    }
6014}
6015
6016/// Implements a client for the Google Compute Engine API.
6017///
6018/// # Example
6019/// ```
6020/// # use google_cloud_compute_v1::client::InterconnectAttachments;
6021/// async fn sample(
6022/// ) -> anyhow::Result<()> {
6023///     let client = InterconnectAttachments::builder().build().await?;
6024///     // use `client` to make requests to the Google Compute Engine API.
6025///     Ok(())
6026/// }
6027/// ```
6028///
6029/// # Service Description
6030///
6031/// Service for the `interconnectAttachments` resource.
6032///
6033/// # Configuration
6034///
6035/// To configure `InterconnectAttachments` use the `with_*` methods in the type returned
6036/// by [builder()][InterconnectAttachments::builder]. The default configuration should
6037/// work for most applications. Common configuration changes include
6038///
6039/// * [with_endpoint()]: by default this client uses the global default endpoint
6040///   (`https://compute.googleapis.com`). Applications using regional
6041///   endpoints or running in restricted networks (e.g. a network configured
6042//    with [Private Google Access with VPC Service Controls]) may want to
6043///   override this default.
6044/// * [with_credentials()]: by default this client uses
6045///   [Application Default Credentials]. Applications using custom
6046///   authentication may need to override this default.
6047///
6048/// [with_endpoint()]: super::builder::interconnect_attachments::ClientBuilder::with_endpoint
6049/// [with_credentials()]: super::builder::interconnect_attachments::ClientBuilder::with_credentials
6050/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6051/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6052///
6053/// # Pooling and Cloning
6054///
6055/// `InterconnectAttachments` holds a connection pool internally, it is advised to
6056/// create one and reuse it. You do not need to wrap `InterconnectAttachments` in
6057/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6058/// already uses an `Arc` internally.
6059#[cfg(feature = "interconnect-attachments")]
6060#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-attachments")))]
6061#[derive(Clone, Debug)]
6062pub struct InterconnectAttachments {
6063    inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachments>,
6064}
6065
6066#[cfg(feature = "interconnect-attachments")]
6067impl InterconnectAttachments {
6068    /// Returns a builder for [InterconnectAttachments].
6069    ///
6070    /// ```
6071    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6072    /// # use google_cloud_compute_v1::client::InterconnectAttachments;
6073    /// let client = InterconnectAttachments::builder().build().await?;
6074    /// # Ok(()) }
6075    /// ```
6076    pub fn builder() -> super::builder::interconnect_attachments::ClientBuilder {
6077        crate::new_client_builder(super::builder::interconnect_attachments::client::Factory)
6078    }
6079
6080    /// Creates a new client from the provided stub.
6081    ///
6082    /// The most common case for calling this function is in tests mocking the
6083    /// client's behavior.
6084    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
6085    where
6086        T: super::stub::InterconnectAttachments + 'static,
6087    {
6088        Self { inner: stub.into() }
6089    }
6090
6091    pub(crate) async fn new(
6092        config: gaxi::options::ClientConfig,
6093    ) -> crate::ClientBuilderResult<Self> {
6094        let inner = Self::build_inner(config).await?;
6095        Ok(Self { inner })
6096    }
6097
6098    async fn build_inner(
6099        conf: gaxi::options::ClientConfig,
6100    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachments>>
6101    {
6102        if gaxi::options::tracing_enabled(&conf) {
6103            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6104        }
6105        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6106    }
6107
6108    async fn build_transport(
6109        conf: gaxi::options::ClientConfig,
6110    ) -> crate::ClientBuilderResult<impl super::stub::InterconnectAttachments> {
6111        super::transport::InterconnectAttachments::new(conf).await
6112    }
6113
6114    async fn build_with_tracing(
6115        conf: gaxi::options::ClientConfig,
6116    ) -> crate::ClientBuilderResult<impl super::stub::InterconnectAttachments> {
6117        Self::build_transport(conf)
6118            .await
6119            .map(super::tracing::InterconnectAttachments::new)
6120    }
6121
6122    /// Retrieves an aggregated list of interconnect attachments.
6123    ///
6124    /// To prevent failure, Google recommends that you set the
6125    /// `returnPartialSuccess` parameter to `true`.
6126    pub fn aggregated_list(&self) -> super::builder::interconnect_attachments::AggregatedList {
6127        super::builder::interconnect_attachments::AggregatedList::new(self.inner.clone())
6128    }
6129
6130    /// Deletes the specified interconnect attachment.
6131    pub fn delete(&self) -> super::builder::interconnect_attachments::Delete {
6132        super::builder::interconnect_attachments::Delete::new(self.inner.clone())
6133    }
6134
6135    /// Returns the specified interconnect attachment.
6136    pub fn get(&self) -> super::builder::interconnect_attachments::Get {
6137        super::builder::interconnect_attachments::Get::new(self.inner.clone())
6138    }
6139
6140    /// Creates an InterconnectAttachment in the specified project using the data
6141    /// included in the request.
6142    pub fn insert(&self) -> super::builder::interconnect_attachments::Insert {
6143        super::builder::interconnect_attachments::Insert::new(self.inner.clone())
6144    }
6145
6146    /// Retrieves the list of interconnect attachments contained within
6147    /// the specified region.
6148    pub fn list(&self) -> super::builder::interconnect_attachments::List {
6149        super::builder::interconnect_attachments::List::new(self.inner.clone())
6150    }
6151
6152    /// Updates the specified interconnect attachment with the data included in the
6153    /// request. This method supportsPATCH
6154    /// semantics and uses theJSON merge
6155    /// patch format and processing rules.
6156    pub fn patch(&self) -> super::builder::interconnect_attachments::Patch {
6157        super::builder::interconnect_attachments::Patch::new(self.inner.clone())
6158    }
6159
6160    /// Sets the labels on an InterconnectAttachment. To learn more about labels,
6161    /// read the Labeling
6162    /// Resources documentation.
6163    pub fn set_labels(&self) -> super::builder::interconnect_attachments::SetLabels {
6164        super::builder::interconnect_attachments::SetLabels::new(self.inner.clone())
6165    }
6166
6167    /// Retrieves the specified region-specific Operations resource.
6168    pub fn get_operation(&self) -> super::builder::interconnect_attachments::GetOperation {
6169        super::builder::interconnect_attachments::GetOperation::new(self.inner.clone())
6170    }
6171}
6172
6173/// Implements a client for the Google Compute Engine API.
6174///
6175/// # Example
6176/// ```
6177/// # use google_cloud_compute_v1::client::InterconnectGroups;
6178/// async fn sample(
6179/// ) -> anyhow::Result<()> {
6180///     let client = InterconnectGroups::builder().build().await?;
6181///     // use `client` to make requests to the Google Compute Engine API.
6182///     Ok(())
6183/// }
6184/// ```
6185///
6186/// # Service Description
6187///
6188/// Service for the `interconnectGroups` resource.
6189///
6190/// # Configuration
6191///
6192/// To configure `InterconnectGroups` use the `with_*` methods in the type returned
6193/// by [builder()][InterconnectGroups::builder]. The default configuration should
6194/// work for most applications. Common configuration changes include
6195///
6196/// * [with_endpoint()]: by default this client uses the global default endpoint
6197///   (`https://compute.googleapis.com`). Applications using regional
6198///   endpoints or running in restricted networks (e.g. a network configured
6199//    with [Private Google Access with VPC Service Controls]) may want to
6200///   override this default.
6201/// * [with_credentials()]: by default this client uses
6202///   [Application Default Credentials]. Applications using custom
6203///   authentication may need to override this default.
6204///
6205/// [with_endpoint()]: super::builder::interconnect_groups::ClientBuilder::with_endpoint
6206/// [with_credentials()]: super::builder::interconnect_groups::ClientBuilder::with_credentials
6207/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6208/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6209///
6210/// # Pooling and Cloning
6211///
6212/// `InterconnectGroups` holds a connection pool internally, it is advised to
6213/// create one and reuse it. You do not need to wrap `InterconnectGroups` in
6214/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6215/// already uses an `Arc` internally.
6216#[cfg(feature = "interconnect-groups")]
6217#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-groups")))]
6218#[derive(Clone, Debug)]
6219pub struct InterconnectGroups {
6220    inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectGroups>,
6221}
6222
6223#[cfg(feature = "interconnect-groups")]
6224impl InterconnectGroups {
6225    /// Returns a builder for [InterconnectGroups].
6226    ///
6227    /// ```
6228    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6229    /// # use google_cloud_compute_v1::client::InterconnectGroups;
6230    /// let client = InterconnectGroups::builder().build().await?;
6231    /// # Ok(()) }
6232    /// ```
6233    pub fn builder() -> super::builder::interconnect_groups::ClientBuilder {
6234        crate::new_client_builder(super::builder::interconnect_groups::client::Factory)
6235    }
6236
6237    /// Creates a new client from the provided stub.
6238    ///
6239    /// The most common case for calling this function is in tests mocking the
6240    /// client's behavior.
6241    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
6242    where
6243        T: super::stub::InterconnectGroups + 'static,
6244    {
6245        Self { inner: stub.into() }
6246    }
6247
6248    pub(crate) async fn new(
6249        config: gaxi::options::ClientConfig,
6250    ) -> crate::ClientBuilderResult<Self> {
6251        let inner = Self::build_inner(config).await?;
6252        Ok(Self { inner })
6253    }
6254
6255    async fn build_inner(
6256        conf: gaxi::options::ClientConfig,
6257    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InterconnectGroups>>
6258    {
6259        if gaxi::options::tracing_enabled(&conf) {
6260            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6261        }
6262        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6263    }
6264
6265    async fn build_transport(
6266        conf: gaxi::options::ClientConfig,
6267    ) -> crate::ClientBuilderResult<impl super::stub::InterconnectGroups> {
6268        super::transport::InterconnectGroups::new(conf).await
6269    }
6270
6271    async fn build_with_tracing(
6272        conf: gaxi::options::ClientConfig,
6273    ) -> crate::ClientBuilderResult<impl super::stub::InterconnectGroups> {
6274        Self::build_transport(conf)
6275            .await
6276            .map(super::tracing::InterconnectGroups::new)
6277    }
6278
6279    /// Create Interconnects with redundancy by creating them in a specified
6280    /// interconnect group.
6281    pub fn create_members(&self) -> super::builder::interconnect_groups::CreateMembers {
6282        super::builder::interconnect_groups::CreateMembers::new(self.inner.clone())
6283    }
6284
6285    /// Deletes the specified InterconnectGroup in the given scope
6286    pub fn delete(&self) -> super::builder::interconnect_groups::Delete {
6287        super::builder::interconnect_groups::Delete::new(self.inner.clone())
6288    }
6289
6290    /// Returns the specified InterconnectGroup resource in the given scope.
6291    pub fn get(&self) -> super::builder::interconnect_groups::Get {
6292        super::builder::interconnect_groups::Get::new(self.inner.clone())
6293    }
6294
6295    /// Gets the access control policy for a resource. May be empty if no such
6296    /// policy or resource exists.
6297    pub fn get_iam_policy(&self) -> super::builder::interconnect_groups::GetIamPolicy {
6298        super::builder::interconnect_groups::GetIamPolicy::new(self.inner.clone())
6299    }
6300
6301    /// Returns the interconnectStatuses for the specified
6302    /// InterconnectGroup.
6303    pub fn get_operational_status(
6304        &self,
6305    ) -> super::builder::interconnect_groups::GetOperationalStatus {
6306        super::builder::interconnect_groups::GetOperationalStatus::new(self.inner.clone())
6307    }
6308
6309    /// Creates a InterconnectGroup in the specified project in the given scope
6310    /// using the parameters that are included in the request.
6311    pub fn insert(&self) -> super::builder::interconnect_groups::Insert {
6312        super::builder::interconnect_groups::Insert::new(self.inner.clone())
6313    }
6314
6315    /// Lists the InterconnectGroups for a project in the given scope.
6316    pub fn list(&self) -> super::builder::interconnect_groups::List {
6317        super::builder::interconnect_groups::List::new(self.inner.clone())
6318    }
6319
6320    /// Patches the specified InterconnectGroup resource with the data included in
6321    /// the request. This method supports PATCH
6322    /// semantics and usesJSON merge
6323    /// patch format and processing rules.
6324    pub fn patch(&self) -> super::builder::interconnect_groups::Patch {
6325        super::builder::interconnect_groups::Patch::new(self.inner.clone())
6326    }
6327
6328    /// Sets the access control policy on the specified resource.
6329    /// Replaces any existing policy.
6330    pub fn set_iam_policy(&self) -> super::builder::interconnect_groups::SetIamPolicy {
6331        super::builder::interconnect_groups::SetIamPolicy::new(self.inner.clone())
6332    }
6333
6334    /// Returns permissions that a caller has on the specified resource.
6335    pub fn test_iam_permissions(&self) -> super::builder::interconnect_groups::TestIamPermissions {
6336        super::builder::interconnect_groups::TestIamPermissions::new(self.inner.clone())
6337    }
6338
6339    /// Retrieves the specified Operations resource.
6340    pub fn get_operation(&self) -> super::builder::interconnect_groups::GetOperation {
6341        super::builder::interconnect_groups::GetOperation::new(self.inner.clone())
6342    }
6343}
6344
6345/// Implements a client for the Google Compute Engine API.
6346///
6347/// # Example
6348/// ```
6349/// # use google_cloud_compute_v1::client::InterconnectLocations;
6350/// async fn sample(
6351/// ) -> anyhow::Result<()> {
6352///     let client = InterconnectLocations::builder().build().await?;
6353///     // use `client` to make requests to the Google Compute Engine API.
6354///     Ok(())
6355/// }
6356/// ```
6357///
6358/// # Service Description
6359///
6360/// Service for the `interconnectLocations` resource.
6361///
6362/// # Configuration
6363///
6364/// To configure `InterconnectLocations` use the `with_*` methods in the type returned
6365/// by [builder()][InterconnectLocations::builder]. The default configuration should
6366/// work for most applications. Common configuration changes include
6367///
6368/// * [with_endpoint()]: by default this client uses the global default endpoint
6369///   (`https://compute.googleapis.com`). Applications using regional
6370///   endpoints or running in restricted networks (e.g. a network configured
6371//    with [Private Google Access with VPC Service Controls]) may want to
6372///   override this default.
6373/// * [with_credentials()]: by default this client uses
6374///   [Application Default Credentials]. Applications using custom
6375///   authentication may need to override this default.
6376///
6377/// [with_endpoint()]: super::builder::interconnect_locations::ClientBuilder::with_endpoint
6378/// [with_credentials()]: super::builder::interconnect_locations::ClientBuilder::with_credentials
6379/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6380/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6381///
6382/// # Pooling and Cloning
6383///
6384/// `InterconnectLocations` holds a connection pool internally, it is advised to
6385/// create one and reuse it. You do not need to wrap `InterconnectLocations` in
6386/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6387/// already uses an `Arc` internally.
6388#[cfg(feature = "interconnect-locations")]
6389#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-locations")))]
6390#[derive(Clone, Debug)]
6391pub struct InterconnectLocations {
6392    inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectLocations>,
6393}
6394
6395#[cfg(feature = "interconnect-locations")]
6396impl InterconnectLocations {
6397    /// Returns a builder for [InterconnectLocations].
6398    ///
6399    /// ```
6400    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6401    /// # use google_cloud_compute_v1::client::InterconnectLocations;
6402    /// let client = InterconnectLocations::builder().build().await?;
6403    /// # Ok(()) }
6404    /// ```
6405    pub fn builder() -> super::builder::interconnect_locations::ClientBuilder {
6406        crate::new_client_builder(super::builder::interconnect_locations::client::Factory)
6407    }
6408
6409    /// Creates a new client from the provided stub.
6410    ///
6411    /// The most common case for calling this function is in tests mocking the
6412    /// client's behavior.
6413    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
6414    where
6415        T: super::stub::InterconnectLocations + 'static,
6416    {
6417        Self { inner: stub.into() }
6418    }
6419
6420    pub(crate) async fn new(
6421        config: gaxi::options::ClientConfig,
6422    ) -> crate::ClientBuilderResult<Self> {
6423        let inner = Self::build_inner(config).await?;
6424        Ok(Self { inner })
6425    }
6426
6427    async fn build_inner(
6428        conf: gaxi::options::ClientConfig,
6429    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InterconnectLocations>>
6430    {
6431        if gaxi::options::tracing_enabled(&conf) {
6432            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6433        }
6434        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6435    }
6436
6437    async fn build_transport(
6438        conf: gaxi::options::ClientConfig,
6439    ) -> crate::ClientBuilderResult<impl super::stub::InterconnectLocations> {
6440        super::transport::InterconnectLocations::new(conf).await
6441    }
6442
6443    async fn build_with_tracing(
6444        conf: gaxi::options::ClientConfig,
6445    ) -> crate::ClientBuilderResult<impl super::stub::InterconnectLocations> {
6446        Self::build_transport(conf)
6447            .await
6448            .map(super::tracing::InterconnectLocations::new)
6449    }
6450
6451    /// Returns the details for the specified interconnect location. Gets a list of
6452    /// available interconnect locations by making a list() request.
6453    pub fn get(&self) -> super::builder::interconnect_locations::Get {
6454        super::builder::interconnect_locations::Get::new(self.inner.clone())
6455    }
6456
6457    /// Retrieves the list of interconnect locations available to the specified
6458    /// project.
6459    pub fn list(&self) -> super::builder::interconnect_locations::List {
6460        super::builder::interconnect_locations::List::new(self.inner.clone())
6461    }
6462}
6463
6464/// Implements a client for the Google Compute Engine API.
6465///
6466/// # Example
6467/// ```
6468/// # use google_cloud_compute_v1::client::InterconnectRemoteLocations;
6469/// async fn sample(
6470/// ) -> anyhow::Result<()> {
6471///     let client = InterconnectRemoteLocations::builder().build().await?;
6472///     // use `client` to make requests to the Google Compute Engine API.
6473///     Ok(())
6474/// }
6475/// ```
6476///
6477/// # Service Description
6478///
6479/// Service for the `interconnectRemoteLocations` resource.
6480///
6481/// # Configuration
6482///
6483/// To configure `InterconnectRemoteLocations` use the `with_*` methods in the type returned
6484/// by [builder()][InterconnectRemoteLocations::builder]. The default configuration should
6485/// work for most applications. Common configuration changes include
6486///
6487/// * [with_endpoint()]: by default this client uses the global default endpoint
6488///   (`https://compute.googleapis.com`). Applications using regional
6489///   endpoints or running in restricted networks (e.g. a network configured
6490//    with [Private Google Access with VPC Service Controls]) may want to
6491///   override this default.
6492/// * [with_credentials()]: by default this client uses
6493///   [Application Default Credentials]. Applications using custom
6494///   authentication may need to override this default.
6495///
6496/// [with_endpoint()]: super::builder::interconnect_remote_locations::ClientBuilder::with_endpoint
6497/// [with_credentials()]: super::builder::interconnect_remote_locations::ClientBuilder::with_credentials
6498/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6499/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6500///
6501/// # Pooling and Cloning
6502///
6503/// `InterconnectRemoteLocations` holds a connection pool internally, it is advised to
6504/// create one and reuse it. You do not need to wrap `InterconnectRemoteLocations` in
6505/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6506/// already uses an `Arc` internally.
6507#[cfg(feature = "interconnect-remote-locations")]
6508#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-remote-locations")))]
6509#[derive(Clone, Debug)]
6510pub struct InterconnectRemoteLocations {
6511    inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectRemoteLocations>,
6512}
6513
6514#[cfg(feature = "interconnect-remote-locations")]
6515impl InterconnectRemoteLocations {
6516    /// Returns a builder for [InterconnectRemoteLocations].
6517    ///
6518    /// ```
6519    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6520    /// # use google_cloud_compute_v1::client::InterconnectRemoteLocations;
6521    /// let client = InterconnectRemoteLocations::builder().build().await?;
6522    /// # Ok(()) }
6523    /// ```
6524    pub fn builder() -> super::builder::interconnect_remote_locations::ClientBuilder {
6525        crate::new_client_builder(super::builder::interconnect_remote_locations::client::Factory)
6526    }
6527
6528    /// Creates a new client from the provided stub.
6529    ///
6530    /// The most common case for calling this function is in tests mocking the
6531    /// client's behavior.
6532    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
6533    where
6534        T: super::stub::InterconnectRemoteLocations + 'static,
6535    {
6536        Self { inner: stub.into() }
6537    }
6538
6539    pub(crate) async fn new(
6540        config: gaxi::options::ClientConfig,
6541    ) -> crate::ClientBuilderResult<Self> {
6542        let inner = Self::build_inner(config).await?;
6543        Ok(Self { inner })
6544    }
6545
6546    async fn build_inner(
6547        conf: gaxi::options::ClientConfig,
6548    ) -> crate::ClientBuilderResult<
6549        std::sync::Arc<dyn super::stub::dynamic::InterconnectRemoteLocations>,
6550    > {
6551        if gaxi::options::tracing_enabled(&conf) {
6552            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6553        }
6554        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6555    }
6556
6557    async fn build_transport(
6558        conf: gaxi::options::ClientConfig,
6559    ) -> crate::ClientBuilderResult<impl super::stub::InterconnectRemoteLocations> {
6560        super::transport::InterconnectRemoteLocations::new(conf).await
6561    }
6562
6563    async fn build_with_tracing(
6564        conf: gaxi::options::ClientConfig,
6565    ) -> crate::ClientBuilderResult<impl super::stub::InterconnectRemoteLocations> {
6566        Self::build_transport(conf)
6567            .await
6568            .map(super::tracing::InterconnectRemoteLocations::new)
6569    }
6570
6571    /// Returns the details for the specified interconnect remote location. Gets a
6572    /// list of available interconnect remote locations by making alist() request.
6573    pub fn get(&self) -> super::builder::interconnect_remote_locations::Get {
6574        super::builder::interconnect_remote_locations::Get::new(self.inner.clone())
6575    }
6576
6577    /// Retrieves the list of interconnect remote locations available to the
6578    /// specified project.
6579    pub fn list(&self) -> super::builder::interconnect_remote_locations::List {
6580        super::builder::interconnect_remote_locations::List::new(self.inner.clone())
6581    }
6582}
6583
6584/// Implements a client for the Google Compute Engine API.
6585///
6586/// # Example
6587/// ```
6588/// # use google_cloud_compute_v1::client::Interconnects;
6589/// async fn sample(
6590/// ) -> anyhow::Result<()> {
6591///     let client = Interconnects::builder().build().await?;
6592///     // use `client` to make requests to the Google Compute Engine API.
6593///     Ok(())
6594/// }
6595/// ```
6596///
6597/// # Service Description
6598///
6599/// Service for the `interconnects` resource.
6600///
6601/// # Configuration
6602///
6603/// To configure `Interconnects` use the `with_*` methods in the type returned
6604/// by [builder()][Interconnects::builder]. The default configuration should
6605/// work for most applications. Common configuration changes include
6606///
6607/// * [with_endpoint()]: by default this client uses the global default endpoint
6608///   (`https://compute.googleapis.com`). Applications using regional
6609///   endpoints or running in restricted networks (e.g. a network configured
6610//    with [Private Google Access with VPC Service Controls]) may want to
6611///   override this default.
6612/// * [with_credentials()]: by default this client uses
6613///   [Application Default Credentials]. Applications using custom
6614///   authentication may need to override this default.
6615///
6616/// [with_endpoint()]: super::builder::interconnects::ClientBuilder::with_endpoint
6617/// [with_credentials()]: super::builder::interconnects::ClientBuilder::with_credentials
6618/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6619/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6620///
6621/// # Pooling and Cloning
6622///
6623/// `Interconnects` holds a connection pool internally, it is advised to
6624/// create one and reuse it. You do not need to wrap `Interconnects` in
6625/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6626/// already uses an `Arc` internally.
6627#[cfg(feature = "interconnects")]
6628#[cfg_attr(docsrs, doc(cfg(feature = "interconnects")))]
6629#[derive(Clone, Debug)]
6630pub struct Interconnects {
6631    inner: std::sync::Arc<dyn super::stub::dynamic::Interconnects>,
6632}
6633
6634#[cfg(feature = "interconnects")]
6635impl Interconnects {
6636    /// Returns a builder for [Interconnects].
6637    ///
6638    /// ```
6639    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6640    /// # use google_cloud_compute_v1::client::Interconnects;
6641    /// let client = Interconnects::builder().build().await?;
6642    /// # Ok(()) }
6643    /// ```
6644    pub fn builder() -> super::builder::interconnects::ClientBuilder {
6645        crate::new_client_builder(super::builder::interconnects::client::Factory)
6646    }
6647
6648    /// Creates a new client from the provided stub.
6649    ///
6650    /// The most common case for calling this function is in tests mocking the
6651    /// client's behavior.
6652    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
6653    where
6654        T: super::stub::Interconnects + 'static,
6655    {
6656        Self { inner: stub.into() }
6657    }
6658
6659    pub(crate) async fn new(
6660        config: gaxi::options::ClientConfig,
6661    ) -> crate::ClientBuilderResult<Self> {
6662        let inner = Self::build_inner(config).await?;
6663        Ok(Self { inner })
6664    }
6665
6666    async fn build_inner(
6667        conf: gaxi::options::ClientConfig,
6668    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Interconnects>> {
6669        if gaxi::options::tracing_enabled(&conf) {
6670            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6671        }
6672        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6673    }
6674
6675    async fn build_transport(
6676        conf: gaxi::options::ClientConfig,
6677    ) -> crate::ClientBuilderResult<impl super::stub::Interconnects> {
6678        super::transport::Interconnects::new(conf).await
6679    }
6680
6681    async fn build_with_tracing(
6682        conf: gaxi::options::ClientConfig,
6683    ) -> crate::ClientBuilderResult<impl super::stub::Interconnects> {
6684        Self::build_transport(conf)
6685            .await
6686            .map(super::tracing::Interconnects::new)
6687    }
6688
6689    /// Deletes the specified Interconnect.
6690    pub fn delete(&self) -> super::builder::interconnects::Delete {
6691        super::builder::interconnects::Delete::new(self.inner.clone())
6692    }
6693
6694    /// Returns the specified Interconnect. Get a list of available Interconnects
6695    /// by making a list() request.
6696    pub fn get(&self) -> super::builder::interconnects::Get {
6697        super::builder::interconnects::Get::new(self.inner.clone())
6698    }
6699
6700    /// Returns the interconnectDiagnostics for the specified
6701    /// Interconnect.
6702    ///
6703    /// In the event of a
6704    /// global outage, do not use this API to make decisions about where to
6705    /// redirect your network traffic.
6706    ///
6707    /// Unlike a VLAN attachment, which is regional, a Cloud Interconnect
6708    /// connection is a global resource. A global outage can prevent this
6709    /// API from functioning properly.
6710    pub fn get_diagnostics(&self) -> super::builder::interconnects::GetDiagnostics {
6711        super::builder::interconnects::GetDiagnostics::new(self.inner.clone())
6712    }
6713
6714    /// Returns the interconnectMacsecConfig for the specified
6715    /// Interconnect.
6716    pub fn get_macsec_config(&self) -> super::builder::interconnects::GetMacsecConfig {
6717        super::builder::interconnects::GetMacsecConfig::new(self.inner.clone())
6718    }
6719
6720    /// Creates an Interconnect in the specified project using
6721    /// the data included in the request.
6722    pub fn insert(&self) -> super::builder::interconnects::Insert {
6723        super::builder::interconnects::Insert::new(self.inner.clone())
6724    }
6725
6726    /// Retrieves the list of Interconnects available to the specified project.
6727    pub fn list(&self) -> super::builder::interconnects::List {
6728        super::builder::interconnects::List::new(self.inner.clone())
6729    }
6730
6731    /// Updates the specified Interconnect with the data included in the request.
6732    /// This method supportsPATCH
6733    /// semantics and uses theJSON merge
6734    /// patch format and processing rules.
6735    pub fn patch(&self) -> super::builder::interconnects::Patch {
6736        super::builder::interconnects::Patch::new(self.inner.clone())
6737    }
6738
6739    /// Sets the labels on an Interconnect. To learn more about labels,
6740    /// read the Labeling
6741    /// Resources documentation.
6742    pub fn set_labels(&self) -> super::builder::interconnects::SetLabels {
6743        super::builder::interconnects::SetLabels::new(self.inner.clone())
6744    }
6745
6746    /// Retrieves the specified Operations resource.
6747    pub fn get_operation(&self) -> super::builder::interconnects::GetOperation {
6748        super::builder::interconnects::GetOperation::new(self.inner.clone())
6749    }
6750}
6751
6752/// Implements a client for the Google Compute Engine API.
6753///
6754/// # Example
6755/// ```
6756/// # use google_cloud_compute_v1::client::LicenseCodes;
6757/// async fn sample(
6758/// ) -> anyhow::Result<()> {
6759///     let client = LicenseCodes::builder().build().await?;
6760///     // use `client` to make requests to the Google Compute Engine API.
6761///     Ok(())
6762/// }
6763/// ```
6764///
6765/// # Service Description
6766///
6767/// Service for the `licenseCodes` resource.
6768///
6769/// # Configuration
6770///
6771/// To configure `LicenseCodes` use the `with_*` methods in the type returned
6772/// by [builder()][LicenseCodes::builder]. The default configuration should
6773/// work for most applications. Common configuration changes include
6774///
6775/// * [with_endpoint()]: by default this client uses the global default endpoint
6776///   (`https://compute.googleapis.com`). Applications using regional
6777///   endpoints or running in restricted networks (e.g. a network configured
6778//    with [Private Google Access with VPC Service Controls]) may want to
6779///   override this default.
6780/// * [with_credentials()]: by default this client uses
6781///   [Application Default Credentials]. Applications using custom
6782///   authentication may need to override this default.
6783///
6784/// [with_endpoint()]: super::builder::license_codes::ClientBuilder::with_endpoint
6785/// [with_credentials()]: super::builder::license_codes::ClientBuilder::with_credentials
6786/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6787/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6788///
6789/// # Pooling and Cloning
6790///
6791/// `LicenseCodes` holds a connection pool internally, it is advised to
6792/// create one and reuse it. You do not need to wrap `LicenseCodes` in
6793/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6794/// already uses an `Arc` internally.
6795#[cfg(feature = "license-codes")]
6796#[cfg_attr(docsrs, doc(cfg(feature = "license-codes")))]
6797#[derive(Clone, Debug)]
6798pub struct LicenseCodes {
6799    inner: std::sync::Arc<dyn super::stub::dynamic::LicenseCodes>,
6800}
6801
6802#[cfg(feature = "license-codes")]
6803impl LicenseCodes {
6804    /// Returns a builder for [LicenseCodes].
6805    ///
6806    /// ```
6807    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6808    /// # use google_cloud_compute_v1::client::LicenseCodes;
6809    /// let client = LicenseCodes::builder().build().await?;
6810    /// # Ok(()) }
6811    /// ```
6812    pub fn builder() -> super::builder::license_codes::ClientBuilder {
6813        crate::new_client_builder(super::builder::license_codes::client::Factory)
6814    }
6815
6816    /// Creates a new client from the provided stub.
6817    ///
6818    /// The most common case for calling this function is in tests mocking the
6819    /// client's behavior.
6820    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
6821    where
6822        T: super::stub::LicenseCodes + 'static,
6823    {
6824        Self { inner: stub.into() }
6825    }
6826
6827    pub(crate) async fn new(
6828        config: gaxi::options::ClientConfig,
6829    ) -> crate::ClientBuilderResult<Self> {
6830        let inner = Self::build_inner(config).await?;
6831        Ok(Self { inner })
6832    }
6833
6834    async fn build_inner(
6835        conf: gaxi::options::ClientConfig,
6836    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::LicenseCodes>> {
6837        if gaxi::options::tracing_enabled(&conf) {
6838            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6839        }
6840        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6841    }
6842
6843    async fn build_transport(
6844        conf: gaxi::options::ClientConfig,
6845    ) -> crate::ClientBuilderResult<impl super::stub::LicenseCodes> {
6846        super::transport::LicenseCodes::new(conf).await
6847    }
6848
6849    async fn build_with_tracing(
6850        conf: gaxi::options::ClientConfig,
6851    ) -> crate::ClientBuilderResult<impl super::stub::LicenseCodes> {
6852        Self::build_transport(conf)
6853            .await
6854            .map(super::tracing::LicenseCodes::new)
6855    }
6856
6857    /// Return a specified license code. License codes are mirrored across
6858    /// all projects that have permissions to read the License Code.
6859    /// *Caution* This resource is intended
6860    /// for use only by third-party partners who are creatingCloud Marketplace
6861    /// images.
6862    pub fn get(&self) -> super::builder::license_codes::Get {
6863        super::builder::license_codes::Get::new(self.inner.clone())
6864    }
6865
6866    /// Returns permissions that a caller has on the specified resource.
6867    /// *Caution* This resource is intended
6868    /// for use only by third-party partners who are creatingCloud Marketplace
6869    /// images.
6870    pub fn test_iam_permissions(&self) -> super::builder::license_codes::TestIamPermissions {
6871        super::builder::license_codes::TestIamPermissions::new(self.inner.clone())
6872    }
6873}
6874
6875/// Implements a client for the Google Compute Engine API.
6876///
6877/// # Example
6878/// ```
6879/// # use google_cloud_compute_v1::client::Licenses;
6880/// async fn sample(
6881/// ) -> anyhow::Result<()> {
6882///     let client = Licenses::builder().build().await?;
6883///     // use `client` to make requests to the Google Compute Engine API.
6884///     Ok(())
6885/// }
6886/// ```
6887///
6888/// # Service Description
6889///
6890/// Service for the `licenses` resource.
6891///
6892/// # Configuration
6893///
6894/// To configure `Licenses` use the `with_*` methods in the type returned
6895/// by [builder()][Licenses::builder]. The default configuration should
6896/// work for most applications. Common configuration changes include
6897///
6898/// * [with_endpoint()]: by default this client uses the global default endpoint
6899///   (`https://compute.googleapis.com`). Applications using regional
6900///   endpoints or running in restricted networks (e.g. a network configured
6901//    with [Private Google Access with VPC Service Controls]) may want to
6902///   override this default.
6903/// * [with_credentials()]: by default this client uses
6904///   [Application Default Credentials]. Applications using custom
6905///   authentication may need to override this default.
6906///
6907/// [with_endpoint()]: super::builder::licenses::ClientBuilder::with_endpoint
6908/// [with_credentials()]: super::builder::licenses::ClientBuilder::with_credentials
6909/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6910/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6911///
6912/// # Pooling and Cloning
6913///
6914/// `Licenses` holds a connection pool internally, it is advised to
6915/// create one and reuse it. You do not need to wrap `Licenses` in
6916/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6917/// already uses an `Arc` internally.
6918#[cfg(feature = "licenses")]
6919#[cfg_attr(docsrs, doc(cfg(feature = "licenses")))]
6920#[derive(Clone, Debug)]
6921pub struct Licenses {
6922    inner: std::sync::Arc<dyn super::stub::dynamic::Licenses>,
6923}
6924
6925#[cfg(feature = "licenses")]
6926impl Licenses {
6927    /// Returns a builder for [Licenses].
6928    ///
6929    /// ```
6930    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6931    /// # use google_cloud_compute_v1::client::Licenses;
6932    /// let client = Licenses::builder().build().await?;
6933    /// # Ok(()) }
6934    /// ```
6935    pub fn builder() -> super::builder::licenses::ClientBuilder {
6936        crate::new_client_builder(super::builder::licenses::client::Factory)
6937    }
6938
6939    /// Creates a new client from the provided stub.
6940    ///
6941    /// The most common case for calling this function is in tests mocking the
6942    /// client's behavior.
6943    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
6944    where
6945        T: super::stub::Licenses + 'static,
6946    {
6947        Self { inner: stub.into() }
6948    }
6949
6950    pub(crate) async fn new(
6951        config: gaxi::options::ClientConfig,
6952    ) -> crate::ClientBuilderResult<Self> {
6953        let inner = Self::build_inner(config).await?;
6954        Ok(Self { inner })
6955    }
6956
6957    async fn build_inner(
6958        conf: gaxi::options::ClientConfig,
6959    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Licenses>> {
6960        if gaxi::options::tracing_enabled(&conf) {
6961            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6962        }
6963        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6964    }
6965
6966    async fn build_transport(
6967        conf: gaxi::options::ClientConfig,
6968    ) -> crate::ClientBuilderResult<impl super::stub::Licenses> {
6969        super::transport::Licenses::new(conf).await
6970    }
6971
6972    async fn build_with_tracing(
6973        conf: gaxi::options::ClientConfig,
6974    ) -> crate::ClientBuilderResult<impl super::stub::Licenses> {
6975        Self::build_transport(conf)
6976            .await
6977            .map(super::tracing::Licenses::new)
6978    }
6979
6980    /// Deletes the specified license.
6981    /// *Caution* This resource is intended
6982    /// for use only by third-party partners who are creatingCloud Marketplace
6983    /// images.
6984    pub fn delete(&self) -> super::builder::licenses::Delete {
6985        super::builder::licenses::Delete::new(self.inner.clone())
6986    }
6987
6988    /// Returns the specified License resource.
6989    /// *Caution* This resource is intended
6990    /// for use only by third-party partners who are creatingCloud Marketplace
6991    /// images.
6992    pub fn get(&self) -> super::builder::licenses::Get {
6993        super::builder::licenses::Get::new(self.inner.clone())
6994    }
6995
6996    /// Gets the access control policy for a resource. May be empty if no such
6997    /// policy or resource exists.
6998    /// *Caution* This resource is intended
6999    /// for use only by third-party partners who are creatingCloud Marketplace
7000    /// images.
7001    pub fn get_iam_policy(&self) -> super::builder::licenses::GetIamPolicy {
7002        super::builder::licenses::GetIamPolicy::new(self.inner.clone())
7003    }
7004
7005    /// Create a License resource in the specified project.
7006    /// *Caution* This resource is intended
7007    /// for use only by third-party partners who are creatingCloud Marketplace
7008    /// images.
7009    pub fn insert(&self) -> super::builder::licenses::Insert {
7010        super::builder::licenses::Insert::new(self.inner.clone())
7011    }
7012
7013    /// Retrieves the list of licenses
7014    /// available in the specified project. This method does not
7015    /// get any licenses that belong to other projects, including licenses attached
7016    /// to publicly-available images, like Debian 9. If you want to get a list of
7017    /// publicly-available licenses, use this method to make a request to the
7018    /// respective image project, such as debian-cloud orwindows-cloud.
7019    /// *Caution* This resource is intended
7020    /// for use only by third-party partners who are creatingCloud Marketplace
7021    /// images.
7022    pub fn list(&self) -> super::builder::licenses::List {
7023        super::builder::licenses::List::new(self.inner.clone())
7024    }
7025
7026    /// Sets the access control policy on the specified resource.
7027    /// Replaces any existing policy.
7028    /// *Caution* This resource is intended
7029    /// for use only by third-party partners who are creatingCloud Marketplace
7030    /// images.
7031    pub fn set_iam_policy(&self) -> super::builder::licenses::SetIamPolicy {
7032        super::builder::licenses::SetIamPolicy::new(self.inner.clone())
7033    }
7034
7035    /// Returns permissions that a caller has on the specified resource.
7036    /// *Caution* This resource is intended
7037    /// for use only by third-party partners who are creatingCloud Marketplace
7038    /// images.
7039    pub fn test_iam_permissions(&self) -> super::builder::licenses::TestIamPermissions {
7040        super::builder::licenses::TestIamPermissions::new(self.inner.clone())
7041    }
7042
7043    /// Updates a License resource in the specified project.
7044    /// *Caution* This resource is intended
7045    /// for use only by third-party partners who are creatingCloud Marketplace
7046    /// images.
7047    pub fn update(&self) -> super::builder::licenses::Update {
7048        super::builder::licenses::Update::new(self.inner.clone())
7049    }
7050
7051    /// Retrieves the specified Operations resource.
7052    pub fn get_operation(&self) -> super::builder::licenses::GetOperation {
7053        super::builder::licenses::GetOperation::new(self.inner.clone())
7054    }
7055}
7056
7057/// Implements a client for the Google Compute Engine API.
7058///
7059/// # Example
7060/// ```
7061/// # use google_cloud_compute_v1::client::MachineImages;
7062/// async fn sample(
7063/// ) -> anyhow::Result<()> {
7064///     let client = MachineImages::builder().build().await?;
7065///     // use `client` to make requests to the Google Compute Engine API.
7066///     Ok(())
7067/// }
7068/// ```
7069///
7070/// # Service Description
7071///
7072/// Service for the `machineImages` resource.
7073///
7074/// # Configuration
7075///
7076/// To configure `MachineImages` use the `with_*` methods in the type returned
7077/// by [builder()][MachineImages::builder]. The default configuration should
7078/// work for most applications. Common configuration changes include
7079///
7080/// * [with_endpoint()]: by default this client uses the global default endpoint
7081///   (`https://compute.googleapis.com`). Applications using regional
7082///   endpoints or running in restricted networks (e.g. a network configured
7083//    with [Private Google Access with VPC Service Controls]) may want to
7084///   override this default.
7085/// * [with_credentials()]: by default this client uses
7086///   [Application Default Credentials]. Applications using custom
7087///   authentication may need to override this default.
7088///
7089/// [with_endpoint()]: super::builder::machine_images::ClientBuilder::with_endpoint
7090/// [with_credentials()]: super::builder::machine_images::ClientBuilder::with_credentials
7091/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7092/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7093///
7094/// # Pooling and Cloning
7095///
7096/// `MachineImages` holds a connection pool internally, it is advised to
7097/// create one and reuse it. You do not need to wrap `MachineImages` in
7098/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7099/// already uses an `Arc` internally.
7100#[cfg(feature = "machine-images")]
7101#[cfg_attr(docsrs, doc(cfg(feature = "machine-images")))]
7102#[derive(Clone, Debug)]
7103pub struct MachineImages {
7104    inner: std::sync::Arc<dyn super::stub::dynamic::MachineImages>,
7105}
7106
7107#[cfg(feature = "machine-images")]
7108impl MachineImages {
7109    /// Returns a builder for [MachineImages].
7110    ///
7111    /// ```
7112    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7113    /// # use google_cloud_compute_v1::client::MachineImages;
7114    /// let client = MachineImages::builder().build().await?;
7115    /// # Ok(()) }
7116    /// ```
7117    pub fn builder() -> super::builder::machine_images::ClientBuilder {
7118        crate::new_client_builder(super::builder::machine_images::client::Factory)
7119    }
7120
7121    /// Creates a new client from the provided stub.
7122    ///
7123    /// The most common case for calling this function is in tests mocking the
7124    /// client's behavior.
7125    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
7126    where
7127        T: super::stub::MachineImages + 'static,
7128    {
7129        Self { inner: stub.into() }
7130    }
7131
7132    pub(crate) async fn new(
7133        config: gaxi::options::ClientConfig,
7134    ) -> crate::ClientBuilderResult<Self> {
7135        let inner = Self::build_inner(config).await?;
7136        Ok(Self { inner })
7137    }
7138
7139    async fn build_inner(
7140        conf: gaxi::options::ClientConfig,
7141    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::MachineImages>> {
7142        if gaxi::options::tracing_enabled(&conf) {
7143            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7144        }
7145        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7146    }
7147
7148    async fn build_transport(
7149        conf: gaxi::options::ClientConfig,
7150    ) -> crate::ClientBuilderResult<impl super::stub::MachineImages> {
7151        super::transport::MachineImages::new(conf).await
7152    }
7153
7154    async fn build_with_tracing(
7155        conf: gaxi::options::ClientConfig,
7156    ) -> crate::ClientBuilderResult<impl super::stub::MachineImages> {
7157        Self::build_transport(conf)
7158            .await
7159            .map(super::tracing::MachineImages::new)
7160    }
7161
7162    /// Deletes the specified machine image. Deleting a machine image is permanent
7163    /// and cannot be undone.
7164    pub fn delete(&self) -> super::builder::machine_images::Delete {
7165        super::builder::machine_images::Delete::new(self.inner.clone())
7166    }
7167
7168    /// Returns the specified machine image.
7169    pub fn get(&self) -> super::builder::machine_images::Get {
7170        super::builder::machine_images::Get::new(self.inner.clone())
7171    }
7172
7173    /// Gets the access control policy for a resource. May be empty if no such
7174    /// policy or resource exists.
7175    pub fn get_iam_policy(&self) -> super::builder::machine_images::GetIamPolicy {
7176        super::builder::machine_images::GetIamPolicy::new(self.inner.clone())
7177    }
7178
7179    /// Creates a machine image in the specified project using the
7180    /// data that is included in the request. If you are creating a new machine
7181    /// image to update an existing instance, your new machine image should use the
7182    /// same network or, if applicable, the same subnetwork as the original
7183    /// instance.
7184    pub fn insert(&self) -> super::builder::machine_images::Insert {
7185        super::builder::machine_images::Insert::new(self.inner.clone())
7186    }
7187
7188    /// Retrieves a list of machine images that are contained within
7189    /// the specified project.
7190    pub fn list(&self) -> super::builder::machine_images::List {
7191        super::builder::machine_images::List::new(self.inner.clone())
7192    }
7193
7194    /// Sets the access control policy on the specified resource.
7195    /// Replaces any existing policy.
7196    pub fn set_iam_policy(&self) -> super::builder::machine_images::SetIamPolicy {
7197        super::builder::machine_images::SetIamPolicy::new(self.inner.clone())
7198    }
7199
7200    /// Sets the labels on a machine image. To learn more about labels, read theLabeling
7201    /// Resources documentation.
7202    pub fn set_labels(&self) -> super::builder::machine_images::SetLabels {
7203        super::builder::machine_images::SetLabels::new(self.inner.clone())
7204    }
7205
7206    /// Returns permissions that a caller has on the specified resource.
7207    pub fn test_iam_permissions(&self) -> super::builder::machine_images::TestIamPermissions {
7208        super::builder::machine_images::TestIamPermissions::new(self.inner.clone())
7209    }
7210
7211    /// Retrieves the specified Operations resource.
7212    pub fn get_operation(&self) -> super::builder::machine_images::GetOperation {
7213        super::builder::machine_images::GetOperation::new(self.inner.clone())
7214    }
7215}
7216
7217/// Implements a client for the Google Compute Engine API.
7218///
7219/// # Example
7220/// ```
7221/// # use google_cloud_compute_v1::client::MachineTypes;
7222/// async fn sample(
7223/// ) -> anyhow::Result<()> {
7224///     let client = MachineTypes::builder().build().await?;
7225///     // use `client` to make requests to the Google Compute Engine API.
7226///     Ok(())
7227/// }
7228/// ```
7229///
7230/// # Service Description
7231///
7232/// Service for the `machineTypes` resource.
7233///
7234/// # Configuration
7235///
7236/// To configure `MachineTypes` use the `with_*` methods in the type returned
7237/// by [builder()][MachineTypes::builder]. The default configuration should
7238/// work for most applications. Common configuration changes include
7239///
7240/// * [with_endpoint()]: by default this client uses the global default endpoint
7241///   (`https://compute.googleapis.com`). Applications using regional
7242///   endpoints or running in restricted networks (e.g. a network configured
7243//    with [Private Google Access with VPC Service Controls]) may want to
7244///   override this default.
7245/// * [with_credentials()]: by default this client uses
7246///   [Application Default Credentials]. Applications using custom
7247///   authentication may need to override this default.
7248///
7249/// [with_endpoint()]: super::builder::machine_types::ClientBuilder::with_endpoint
7250/// [with_credentials()]: super::builder::machine_types::ClientBuilder::with_credentials
7251/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7252/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7253///
7254/// # Pooling and Cloning
7255///
7256/// `MachineTypes` holds a connection pool internally, it is advised to
7257/// create one and reuse it. You do not need to wrap `MachineTypes` in
7258/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7259/// already uses an `Arc` internally.
7260#[cfg(feature = "machine-types")]
7261#[cfg_attr(docsrs, doc(cfg(feature = "machine-types")))]
7262#[derive(Clone, Debug)]
7263pub struct MachineTypes {
7264    inner: std::sync::Arc<dyn super::stub::dynamic::MachineTypes>,
7265}
7266
7267#[cfg(feature = "machine-types")]
7268impl MachineTypes {
7269    /// Returns a builder for [MachineTypes].
7270    ///
7271    /// ```
7272    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7273    /// # use google_cloud_compute_v1::client::MachineTypes;
7274    /// let client = MachineTypes::builder().build().await?;
7275    /// # Ok(()) }
7276    /// ```
7277    pub fn builder() -> super::builder::machine_types::ClientBuilder {
7278        crate::new_client_builder(super::builder::machine_types::client::Factory)
7279    }
7280
7281    /// Creates a new client from the provided stub.
7282    ///
7283    /// The most common case for calling this function is in tests mocking the
7284    /// client's behavior.
7285    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
7286    where
7287        T: super::stub::MachineTypes + 'static,
7288    {
7289        Self { inner: stub.into() }
7290    }
7291
7292    pub(crate) async fn new(
7293        config: gaxi::options::ClientConfig,
7294    ) -> crate::ClientBuilderResult<Self> {
7295        let inner = Self::build_inner(config).await?;
7296        Ok(Self { inner })
7297    }
7298
7299    async fn build_inner(
7300        conf: gaxi::options::ClientConfig,
7301    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::MachineTypes>> {
7302        if gaxi::options::tracing_enabled(&conf) {
7303            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7304        }
7305        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7306    }
7307
7308    async fn build_transport(
7309        conf: gaxi::options::ClientConfig,
7310    ) -> crate::ClientBuilderResult<impl super::stub::MachineTypes> {
7311        super::transport::MachineTypes::new(conf).await
7312    }
7313
7314    async fn build_with_tracing(
7315        conf: gaxi::options::ClientConfig,
7316    ) -> crate::ClientBuilderResult<impl super::stub::MachineTypes> {
7317        Self::build_transport(conf)
7318            .await
7319            .map(super::tracing::MachineTypes::new)
7320    }
7321
7322    /// Retrieves an aggregated list of machine types.
7323    ///
7324    /// To prevent failure, Google recommends that you set the
7325    /// `returnPartialSuccess` parameter to `true`.
7326    pub fn aggregated_list(&self) -> super::builder::machine_types::AggregatedList {
7327        super::builder::machine_types::AggregatedList::new(self.inner.clone())
7328    }
7329
7330    /// Returns the specified machine type.
7331    pub fn get(&self) -> super::builder::machine_types::Get {
7332        super::builder::machine_types::Get::new(self.inner.clone())
7333    }
7334
7335    /// Retrieves a list of machine types available to the specified
7336    /// project.
7337    pub fn list(&self) -> super::builder::machine_types::List {
7338        super::builder::machine_types::List::new(self.inner.clone())
7339    }
7340}
7341
7342/// Implements a client for the Google Compute Engine API.
7343///
7344/// # Example
7345/// ```
7346/// # use google_cloud_compute_v1::client::NetworkAttachments;
7347/// async fn sample(
7348/// ) -> anyhow::Result<()> {
7349///     let client = NetworkAttachments::builder().build().await?;
7350///     // use `client` to make requests to the Google Compute Engine API.
7351///     Ok(())
7352/// }
7353/// ```
7354///
7355/// # Service Description
7356///
7357/// Service for the `networkAttachments` resource.
7358///
7359/// # Configuration
7360///
7361/// To configure `NetworkAttachments` use the `with_*` methods in the type returned
7362/// by [builder()][NetworkAttachments::builder]. The default configuration should
7363/// work for most applications. Common configuration changes include
7364///
7365/// * [with_endpoint()]: by default this client uses the global default endpoint
7366///   (`https://compute.googleapis.com`). Applications using regional
7367///   endpoints or running in restricted networks (e.g. a network configured
7368//    with [Private Google Access with VPC Service Controls]) may want to
7369///   override this default.
7370/// * [with_credentials()]: by default this client uses
7371///   [Application Default Credentials]. Applications using custom
7372///   authentication may need to override this default.
7373///
7374/// [with_endpoint()]: super::builder::network_attachments::ClientBuilder::with_endpoint
7375/// [with_credentials()]: super::builder::network_attachments::ClientBuilder::with_credentials
7376/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7377/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7378///
7379/// # Pooling and Cloning
7380///
7381/// `NetworkAttachments` holds a connection pool internally, it is advised to
7382/// create one and reuse it. You do not need to wrap `NetworkAttachments` in
7383/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7384/// already uses an `Arc` internally.
7385#[cfg(feature = "network-attachments")]
7386#[cfg_attr(docsrs, doc(cfg(feature = "network-attachments")))]
7387#[derive(Clone, Debug)]
7388pub struct NetworkAttachments {
7389    inner: std::sync::Arc<dyn super::stub::dynamic::NetworkAttachments>,
7390}
7391
7392#[cfg(feature = "network-attachments")]
7393impl NetworkAttachments {
7394    /// Returns a builder for [NetworkAttachments].
7395    ///
7396    /// ```
7397    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7398    /// # use google_cloud_compute_v1::client::NetworkAttachments;
7399    /// let client = NetworkAttachments::builder().build().await?;
7400    /// # Ok(()) }
7401    /// ```
7402    pub fn builder() -> super::builder::network_attachments::ClientBuilder {
7403        crate::new_client_builder(super::builder::network_attachments::client::Factory)
7404    }
7405
7406    /// Creates a new client from the provided stub.
7407    ///
7408    /// The most common case for calling this function is in tests mocking the
7409    /// client's behavior.
7410    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
7411    where
7412        T: super::stub::NetworkAttachments + 'static,
7413    {
7414        Self { inner: stub.into() }
7415    }
7416
7417    pub(crate) async fn new(
7418        config: gaxi::options::ClientConfig,
7419    ) -> crate::ClientBuilderResult<Self> {
7420        let inner = Self::build_inner(config).await?;
7421        Ok(Self { inner })
7422    }
7423
7424    async fn build_inner(
7425        conf: gaxi::options::ClientConfig,
7426    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NetworkAttachments>>
7427    {
7428        if gaxi::options::tracing_enabled(&conf) {
7429            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7430        }
7431        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7432    }
7433
7434    async fn build_transport(
7435        conf: gaxi::options::ClientConfig,
7436    ) -> crate::ClientBuilderResult<impl super::stub::NetworkAttachments> {
7437        super::transport::NetworkAttachments::new(conf).await
7438    }
7439
7440    async fn build_with_tracing(
7441        conf: gaxi::options::ClientConfig,
7442    ) -> crate::ClientBuilderResult<impl super::stub::NetworkAttachments> {
7443        Self::build_transport(conf)
7444            .await
7445            .map(super::tracing::NetworkAttachments::new)
7446    }
7447
7448    /// Retrieves the list of all NetworkAttachment resources,
7449    /// regional and global, available to the specified project.
7450    ///
7451    /// To prevent failure, Google recommends that you set the
7452    /// `returnPartialSuccess` parameter to `true`.
7453    pub fn aggregated_list(&self) -> super::builder::network_attachments::AggregatedList {
7454        super::builder::network_attachments::AggregatedList::new(self.inner.clone())
7455    }
7456
7457    /// Deletes the specified NetworkAttachment in the given scope
7458    pub fn delete(&self) -> super::builder::network_attachments::Delete {
7459        super::builder::network_attachments::Delete::new(self.inner.clone())
7460    }
7461
7462    /// Returns the specified NetworkAttachment resource in the given scope.
7463    pub fn get(&self) -> super::builder::network_attachments::Get {
7464        super::builder::network_attachments::Get::new(self.inner.clone())
7465    }
7466
7467    /// Gets the access control policy for a resource. May be empty if no such
7468    /// policy or resource exists.
7469    pub fn get_iam_policy(&self) -> super::builder::network_attachments::GetIamPolicy {
7470        super::builder::network_attachments::GetIamPolicy::new(self.inner.clone())
7471    }
7472
7473    /// Creates a NetworkAttachment in the specified project in the given scope
7474    /// using the parameters that are included in the request.
7475    pub fn insert(&self) -> super::builder::network_attachments::Insert {
7476        super::builder::network_attachments::Insert::new(self.inner.clone())
7477    }
7478
7479    /// Lists the NetworkAttachments for a project in the given scope.
7480    pub fn list(&self) -> super::builder::network_attachments::List {
7481        super::builder::network_attachments::List::new(self.inner.clone())
7482    }
7483
7484    /// Patches the specified NetworkAttachment resource with the data included in
7485    /// the request. This method supports PATCH
7486    /// semantics and usesJSON merge
7487    /// patch format and processing rules.
7488    pub fn patch(&self) -> super::builder::network_attachments::Patch {
7489        super::builder::network_attachments::Patch::new(self.inner.clone())
7490    }
7491
7492    /// Sets the access control policy on the specified resource.
7493    /// Replaces any existing policy.
7494    pub fn set_iam_policy(&self) -> super::builder::network_attachments::SetIamPolicy {
7495        super::builder::network_attachments::SetIamPolicy::new(self.inner.clone())
7496    }
7497
7498    /// Returns permissions that a caller has on the specified resource.
7499    pub fn test_iam_permissions(&self) -> super::builder::network_attachments::TestIamPermissions {
7500        super::builder::network_attachments::TestIamPermissions::new(self.inner.clone())
7501    }
7502
7503    /// Retrieves the specified region-specific Operations resource.
7504    pub fn get_operation(&self) -> super::builder::network_attachments::GetOperation {
7505        super::builder::network_attachments::GetOperation::new(self.inner.clone())
7506    }
7507}
7508
7509/// Implements a client for the Google Compute Engine API.
7510///
7511/// # Example
7512/// ```
7513/// # use google_cloud_compute_v1::client::NetworkEdgeSecurityServices;
7514/// async fn sample(
7515/// ) -> anyhow::Result<()> {
7516///     let client = NetworkEdgeSecurityServices::builder().build().await?;
7517///     // use `client` to make requests to the Google Compute Engine API.
7518///     Ok(())
7519/// }
7520/// ```
7521///
7522/// # Service Description
7523///
7524/// Service for the `networkEdgeSecurityServices` resource.
7525///
7526/// # Configuration
7527///
7528/// To configure `NetworkEdgeSecurityServices` use the `with_*` methods in the type returned
7529/// by [builder()][NetworkEdgeSecurityServices::builder]. The default configuration should
7530/// work for most applications. Common configuration changes include
7531///
7532/// * [with_endpoint()]: by default this client uses the global default endpoint
7533///   (`https://compute.googleapis.com`). Applications using regional
7534///   endpoints or running in restricted networks (e.g. a network configured
7535//    with [Private Google Access with VPC Service Controls]) may want to
7536///   override this default.
7537/// * [with_credentials()]: by default this client uses
7538///   [Application Default Credentials]. Applications using custom
7539///   authentication may need to override this default.
7540///
7541/// [with_endpoint()]: super::builder::network_edge_security_services::ClientBuilder::with_endpoint
7542/// [with_credentials()]: super::builder::network_edge_security_services::ClientBuilder::with_credentials
7543/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7544/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7545///
7546/// # Pooling and Cloning
7547///
7548/// `NetworkEdgeSecurityServices` holds a connection pool internally, it is advised to
7549/// create one and reuse it. You do not need to wrap `NetworkEdgeSecurityServices` in
7550/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7551/// already uses an `Arc` internally.
7552#[cfg(feature = "network-edge-security-services")]
7553#[cfg_attr(docsrs, doc(cfg(feature = "network-edge-security-services")))]
7554#[derive(Clone, Debug)]
7555pub struct NetworkEdgeSecurityServices {
7556    inner: std::sync::Arc<dyn super::stub::dynamic::NetworkEdgeSecurityServices>,
7557}
7558
7559#[cfg(feature = "network-edge-security-services")]
7560impl NetworkEdgeSecurityServices {
7561    /// Returns a builder for [NetworkEdgeSecurityServices].
7562    ///
7563    /// ```
7564    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7565    /// # use google_cloud_compute_v1::client::NetworkEdgeSecurityServices;
7566    /// let client = NetworkEdgeSecurityServices::builder().build().await?;
7567    /// # Ok(()) }
7568    /// ```
7569    pub fn builder() -> super::builder::network_edge_security_services::ClientBuilder {
7570        crate::new_client_builder(super::builder::network_edge_security_services::client::Factory)
7571    }
7572
7573    /// Creates a new client from the provided stub.
7574    ///
7575    /// The most common case for calling this function is in tests mocking the
7576    /// client's behavior.
7577    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
7578    where
7579        T: super::stub::NetworkEdgeSecurityServices + 'static,
7580    {
7581        Self { inner: stub.into() }
7582    }
7583
7584    pub(crate) async fn new(
7585        config: gaxi::options::ClientConfig,
7586    ) -> crate::ClientBuilderResult<Self> {
7587        let inner = Self::build_inner(config).await?;
7588        Ok(Self { inner })
7589    }
7590
7591    async fn build_inner(
7592        conf: gaxi::options::ClientConfig,
7593    ) -> crate::ClientBuilderResult<
7594        std::sync::Arc<dyn super::stub::dynamic::NetworkEdgeSecurityServices>,
7595    > {
7596        if gaxi::options::tracing_enabled(&conf) {
7597            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7598        }
7599        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7600    }
7601
7602    async fn build_transport(
7603        conf: gaxi::options::ClientConfig,
7604    ) -> crate::ClientBuilderResult<impl super::stub::NetworkEdgeSecurityServices> {
7605        super::transport::NetworkEdgeSecurityServices::new(conf).await
7606    }
7607
7608    async fn build_with_tracing(
7609        conf: gaxi::options::ClientConfig,
7610    ) -> crate::ClientBuilderResult<impl super::stub::NetworkEdgeSecurityServices> {
7611        Self::build_transport(conf)
7612            .await
7613            .map(super::tracing::NetworkEdgeSecurityServices::new)
7614    }
7615
7616    /// Retrieves the list of all NetworkEdgeSecurityService resources available to
7617    /// the specified project.
7618    ///
7619    /// To prevent failure, Google recommends that you set the
7620    /// `returnPartialSuccess` parameter to `true`.
7621    pub fn aggregated_list(
7622        &self,
7623    ) -> super::builder::network_edge_security_services::AggregatedList {
7624        super::builder::network_edge_security_services::AggregatedList::new(self.inner.clone())
7625    }
7626
7627    /// Deletes the specified service.
7628    pub fn delete(&self) -> super::builder::network_edge_security_services::Delete {
7629        super::builder::network_edge_security_services::Delete::new(self.inner.clone())
7630    }
7631
7632    /// Gets a specified NetworkEdgeSecurityService.
7633    pub fn get(&self) -> super::builder::network_edge_security_services::Get {
7634        super::builder::network_edge_security_services::Get::new(self.inner.clone())
7635    }
7636
7637    /// Creates a new service in the specified project using the data included in
7638    /// the request.
7639    pub fn insert(&self) -> super::builder::network_edge_security_services::Insert {
7640        super::builder::network_edge_security_services::Insert::new(self.inner.clone())
7641    }
7642
7643    /// Patches the specified policy with the data included in the request.
7644    pub fn patch(&self) -> super::builder::network_edge_security_services::Patch {
7645        super::builder::network_edge_security_services::Patch::new(self.inner.clone())
7646    }
7647
7648    /// Retrieves the specified region-specific Operations resource.
7649    pub fn get_operation(&self) -> super::builder::network_edge_security_services::GetOperation {
7650        super::builder::network_edge_security_services::GetOperation::new(self.inner.clone())
7651    }
7652}
7653
7654/// Implements a client for the Google Compute Engine API.
7655///
7656/// # Example
7657/// ```
7658/// # use google_cloud_compute_v1::client::NetworkEndpointGroups;
7659/// async fn sample(
7660/// ) -> anyhow::Result<()> {
7661///     let client = NetworkEndpointGroups::builder().build().await?;
7662///     // use `client` to make requests to the Google Compute Engine API.
7663///     Ok(())
7664/// }
7665/// ```
7666///
7667/// # Service Description
7668///
7669/// Service for the `networkEndpointGroups` resource.
7670///
7671/// # Configuration
7672///
7673/// To configure `NetworkEndpointGroups` use the `with_*` methods in the type returned
7674/// by [builder()][NetworkEndpointGroups::builder]. The default configuration should
7675/// work for most applications. Common configuration changes include
7676///
7677/// * [with_endpoint()]: by default this client uses the global default endpoint
7678///   (`https://compute.googleapis.com`). Applications using regional
7679///   endpoints or running in restricted networks (e.g. a network configured
7680//    with [Private Google Access with VPC Service Controls]) may want to
7681///   override this default.
7682/// * [with_credentials()]: by default this client uses
7683///   [Application Default Credentials]. Applications using custom
7684///   authentication may need to override this default.
7685///
7686/// [with_endpoint()]: super::builder::network_endpoint_groups::ClientBuilder::with_endpoint
7687/// [with_credentials()]: super::builder::network_endpoint_groups::ClientBuilder::with_credentials
7688/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7689/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7690///
7691/// # Pooling and Cloning
7692///
7693/// `NetworkEndpointGroups` holds a connection pool internally, it is advised to
7694/// create one and reuse it. You do not need to wrap `NetworkEndpointGroups` in
7695/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7696/// already uses an `Arc` internally.
7697#[cfg(feature = "network-endpoint-groups")]
7698#[cfg_attr(docsrs, doc(cfg(feature = "network-endpoint-groups")))]
7699#[derive(Clone, Debug)]
7700pub struct NetworkEndpointGroups {
7701    inner: std::sync::Arc<dyn super::stub::dynamic::NetworkEndpointGroups>,
7702}
7703
7704#[cfg(feature = "network-endpoint-groups")]
7705impl NetworkEndpointGroups {
7706    /// Returns a builder for [NetworkEndpointGroups].
7707    ///
7708    /// ```
7709    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7710    /// # use google_cloud_compute_v1::client::NetworkEndpointGroups;
7711    /// let client = NetworkEndpointGroups::builder().build().await?;
7712    /// # Ok(()) }
7713    /// ```
7714    pub fn builder() -> super::builder::network_endpoint_groups::ClientBuilder {
7715        crate::new_client_builder(super::builder::network_endpoint_groups::client::Factory)
7716    }
7717
7718    /// Creates a new client from the provided stub.
7719    ///
7720    /// The most common case for calling this function is in tests mocking the
7721    /// client's behavior.
7722    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
7723    where
7724        T: super::stub::NetworkEndpointGroups + 'static,
7725    {
7726        Self { inner: stub.into() }
7727    }
7728
7729    pub(crate) async fn new(
7730        config: gaxi::options::ClientConfig,
7731    ) -> crate::ClientBuilderResult<Self> {
7732        let inner = Self::build_inner(config).await?;
7733        Ok(Self { inner })
7734    }
7735
7736    async fn build_inner(
7737        conf: gaxi::options::ClientConfig,
7738    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NetworkEndpointGroups>>
7739    {
7740        if gaxi::options::tracing_enabled(&conf) {
7741            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7742        }
7743        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7744    }
7745
7746    async fn build_transport(
7747        conf: gaxi::options::ClientConfig,
7748    ) -> crate::ClientBuilderResult<impl super::stub::NetworkEndpointGroups> {
7749        super::transport::NetworkEndpointGroups::new(conf).await
7750    }
7751
7752    async fn build_with_tracing(
7753        conf: gaxi::options::ClientConfig,
7754    ) -> crate::ClientBuilderResult<impl super::stub::NetworkEndpointGroups> {
7755        Self::build_transport(conf)
7756            .await
7757            .map(super::tracing::NetworkEndpointGroups::new)
7758    }
7759
7760    /// Retrieves the list of network endpoint groups and sorts them by zone.
7761    ///
7762    /// To prevent failure, Google recommends that you set the
7763    /// `returnPartialSuccess` parameter to `true`.
7764    pub fn aggregated_list(&self) -> super::builder::network_endpoint_groups::AggregatedList {
7765        super::builder::network_endpoint_groups::AggregatedList::new(self.inner.clone())
7766    }
7767
7768    /// Attach a list of network endpoints to the specified network endpoint group.
7769    pub fn attach_network_endpoints(
7770        &self,
7771    ) -> super::builder::network_endpoint_groups::AttachNetworkEndpoints {
7772        super::builder::network_endpoint_groups::AttachNetworkEndpoints::new(self.inner.clone())
7773    }
7774
7775    /// Deletes the specified network endpoint group. The network endpoints in the
7776    /// NEG and the VM instances they belong to are not terminated when the NEG is
7777    /// deleted. Note that the NEG cannot be deleted if there are backend services
7778    /// referencing it.
7779    pub fn delete(&self) -> super::builder::network_endpoint_groups::Delete {
7780        super::builder::network_endpoint_groups::Delete::new(self.inner.clone())
7781    }
7782
7783    /// Detach a list of network endpoints from the specified network endpoint
7784    /// group.
7785    pub fn detach_network_endpoints(
7786        &self,
7787    ) -> super::builder::network_endpoint_groups::DetachNetworkEndpoints {
7788        super::builder::network_endpoint_groups::DetachNetworkEndpoints::new(self.inner.clone())
7789    }
7790
7791    /// Returns the specified network endpoint group.
7792    pub fn get(&self) -> super::builder::network_endpoint_groups::Get {
7793        super::builder::network_endpoint_groups::Get::new(self.inner.clone())
7794    }
7795
7796    /// Creates a network endpoint group in the specified project using the
7797    /// parameters that are included in the request.
7798    ///
7799    /// Note: Use the following APIs to manage network endpoint groups:
7800    ///
7801    /// - To manage NEGs with zonal scope (such as zonal NEGs, hybrid connectivity
7802    ///   NEGs): zonal
7803    ///   API
7804    /// - To manage NEGs with regional scope (such as regional internet NEGs,
7805    ///   serverless NEGs, Private Service Connect NEGs): regional
7806    ///   API
7807    /// - To manage NEGs with global scope (such as global internet NEGs):global
7808    ///   API
7809    pub fn insert(&self) -> super::builder::network_endpoint_groups::Insert {
7810        super::builder::network_endpoint_groups::Insert::new(self.inner.clone())
7811    }
7812
7813    /// Retrieves the list of network endpoint groups that are located in the
7814    /// specified project and zone.
7815    pub fn list(&self) -> super::builder::network_endpoint_groups::List {
7816        super::builder::network_endpoint_groups::List::new(self.inner.clone())
7817    }
7818
7819    /// Lists the network endpoints in the specified network endpoint group.
7820    pub fn list_network_endpoints(
7821        &self,
7822    ) -> super::builder::network_endpoint_groups::ListNetworkEndpoints {
7823        super::builder::network_endpoint_groups::ListNetworkEndpoints::new(self.inner.clone())
7824    }
7825
7826    /// Returns permissions that a caller has on the specified resource.
7827    pub fn test_iam_permissions(
7828        &self,
7829    ) -> super::builder::network_endpoint_groups::TestIamPermissions {
7830        super::builder::network_endpoint_groups::TestIamPermissions::new(self.inner.clone())
7831    }
7832
7833    /// Retrieves the specified zone-specific Operations resource.
7834    pub fn get_operation(&self) -> super::builder::network_endpoint_groups::GetOperation {
7835        super::builder::network_endpoint_groups::GetOperation::new(self.inner.clone())
7836    }
7837}
7838
7839/// Implements a client for the Google Compute Engine API.
7840///
7841/// # Example
7842/// ```
7843/// # use google_cloud_compute_v1::client::NetworkFirewallPolicies;
7844/// async fn sample(
7845/// ) -> anyhow::Result<()> {
7846///     let client = NetworkFirewallPolicies::builder().build().await?;
7847///     // use `client` to make requests to the Google Compute Engine API.
7848///     Ok(())
7849/// }
7850/// ```
7851///
7852/// # Service Description
7853///
7854/// Service for the `networkFirewallPolicies` resource.
7855///
7856/// # Configuration
7857///
7858/// To configure `NetworkFirewallPolicies` use the `with_*` methods in the type returned
7859/// by [builder()][NetworkFirewallPolicies::builder]. The default configuration should
7860/// work for most applications. Common configuration changes include
7861///
7862/// * [with_endpoint()]: by default this client uses the global default endpoint
7863///   (`https://compute.googleapis.com`). Applications using regional
7864///   endpoints or running in restricted networks (e.g. a network configured
7865//    with [Private Google Access with VPC Service Controls]) may want to
7866///   override this default.
7867/// * [with_credentials()]: by default this client uses
7868///   [Application Default Credentials]. Applications using custom
7869///   authentication may need to override this default.
7870///
7871/// [with_endpoint()]: super::builder::network_firewall_policies::ClientBuilder::with_endpoint
7872/// [with_credentials()]: super::builder::network_firewall_policies::ClientBuilder::with_credentials
7873/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7874/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7875///
7876/// # Pooling and Cloning
7877///
7878/// `NetworkFirewallPolicies` holds a connection pool internally, it is advised to
7879/// create one and reuse it. You do not need to wrap `NetworkFirewallPolicies` in
7880/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7881/// already uses an `Arc` internally.
7882#[cfg(feature = "network-firewall-policies")]
7883#[cfg_attr(docsrs, doc(cfg(feature = "network-firewall-policies")))]
7884#[derive(Clone, Debug)]
7885pub struct NetworkFirewallPolicies {
7886    inner: std::sync::Arc<dyn super::stub::dynamic::NetworkFirewallPolicies>,
7887}
7888
7889#[cfg(feature = "network-firewall-policies")]
7890impl NetworkFirewallPolicies {
7891    /// Returns a builder for [NetworkFirewallPolicies].
7892    ///
7893    /// ```
7894    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7895    /// # use google_cloud_compute_v1::client::NetworkFirewallPolicies;
7896    /// let client = NetworkFirewallPolicies::builder().build().await?;
7897    /// # Ok(()) }
7898    /// ```
7899    pub fn builder() -> super::builder::network_firewall_policies::ClientBuilder {
7900        crate::new_client_builder(super::builder::network_firewall_policies::client::Factory)
7901    }
7902
7903    /// Creates a new client from the provided stub.
7904    ///
7905    /// The most common case for calling this function is in tests mocking the
7906    /// client's behavior.
7907    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
7908    where
7909        T: super::stub::NetworkFirewallPolicies + 'static,
7910    {
7911        Self { inner: stub.into() }
7912    }
7913
7914    pub(crate) async fn new(
7915        config: gaxi::options::ClientConfig,
7916    ) -> crate::ClientBuilderResult<Self> {
7917        let inner = Self::build_inner(config).await?;
7918        Ok(Self { inner })
7919    }
7920
7921    async fn build_inner(
7922        conf: gaxi::options::ClientConfig,
7923    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NetworkFirewallPolicies>>
7924    {
7925        if gaxi::options::tracing_enabled(&conf) {
7926            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7927        }
7928        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7929    }
7930
7931    async fn build_transport(
7932        conf: gaxi::options::ClientConfig,
7933    ) -> crate::ClientBuilderResult<impl super::stub::NetworkFirewallPolicies> {
7934        super::transport::NetworkFirewallPolicies::new(conf).await
7935    }
7936
7937    async fn build_with_tracing(
7938        conf: gaxi::options::ClientConfig,
7939    ) -> crate::ClientBuilderResult<impl super::stub::NetworkFirewallPolicies> {
7940        Self::build_transport(conf)
7941            .await
7942            .map(super::tracing::NetworkFirewallPolicies::new)
7943    }
7944
7945    /// Inserts an association for the specified firewall policy.
7946    pub fn add_association(&self) -> super::builder::network_firewall_policies::AddAssociation {
7947        super::builder::network_firewall_policies::AddAssociation::new(self.inner.clone())
7948    }
7949
7950    /// Inserts a packet mirroring rule into a firewall policy.
7951    pub fn add_packet_mirroring_rule(
7952        &self,
7953    ) -> super::builder::network_firewall_policies::AddPacketMirroringRule {
7954        super::builder::network_firewall_policies::AddPacketMirroringRule::new(self.inner.clone())
7955    }
7956
7957    /// Inserts a rule into a firewall policy.
7958    pub fn add_rule(&self) -> super::builder::network_firewall_policies::AddRule {
7959        super::builder::network_firewall_policies::AddRule::new(self.inner.clone())
7960    }
7961
7962    /// Retrieves an aggregated list of network firewall policies, listing network
7963    /// firewall policies from all applicable scopes (global and regional) and
7964    /// grouping the results per scope.
7965    ///
7966    /// To prevent failure, it is recommended that you set the
7967    /// `returnPartialSuccess` parameter to `true`.
7968    pub fn aggregated_list(&self) -> super::builder::network_firewall_policies::AggregatedList {
7969        super::builder::network_firewall_policies::AggregatedList::new(self.inner.clone())
7970    }
7971
7972    /// Copies rules to the specified firewall policy.
7973    pub fn clone_rules(&self) -> super::builder::network_firewall_policies::CloneRules {
7974        super::builder::network_firewall_policies::CloneRules::new(self.inner.clone())
7975    }
7976
7977    /// Deletes the specified policy.
7978    pub fn delete(&self) -> super::builder::network_firewall_policies::Delete {
7979        super::builder::network_firewall_policies::Delete::new(self.inner.clone())
7980    }
7981
7982    /// Returns the specified network firewall policy.
7983    pub fn get(&self) -> super::builder::network_firewall_policies::Get {
7984        super::builder::network_firewall_policies::Get::new(self.inner.clone())
7985    }
7986
7987    /// Gets an association with the specified name.
7988    pub fn get_association(&self) -> super::builder::network_firewall_policies::GetAssociation {
7989        super::builder::network_firewall_policies::GetAssociation::new(self.inner.clone())
7990    }
7991
7992    /// Gets the access control policy for a resource. May be empty if no such
7993    /// policy or resource exists.
7994    pub fn get_iam_policy(&self) -> super::builder::network_firewall_policies::GetIamPolicy {
7995        super::builder::network_firewall_policies::GetIamPolicy::new(self.inner.clone())
7996    }
7997
7998    /// Gets a packet mirroring rule of the specified priority.
7999    pub fn get_packet_mirroring_rule(
8000        &self,
8001    ) -> super::builder::network_firewall_policies::GetPacketMirroringRule {
8002        super::builder::network_firewall_policies::GetPacketMirroringRule::new(self.inner.clone())
8003    }
8004
8005    /// Gets a rule of the specified priority.
8006    pub fn get_rule(&self) -> super::builder::network_firewall_policies::GetRule {
8007        super::builder::network_firewall_policies::GetRule::new(self.inner.clone())
8008    }
8009
8010    /// Creates a new policy in the specified project using the data included in
8011    /// the request.
8012    pub fn insert(&self) -> super::builder::network_firewall_policies::Insert {
8013        super::builder::network_firewall_policies::Insert::new(self.inner.clone())
8014    }
8015
8016    /// Lists all the policies that have been configured for the specified project.
8017    pub fn list(&self) -> super::builder::network_firewall_policies::List {
8018        super::builder::network_firewall_policies::List::new(self.inner.clone())
8019    }
8020
8021    /// Patches the specified policy with the data included in the request.
8022    pub fn patch(&self) -> super::builder::network_firewall_policies::Patch {
8023        super::builder::network_firewall_policies::Patch::new(self.inner.clone())
8024    }
8025
8026    /// Patches a packet mirroring rule of the specified priority.
8027    pub fn patch_packet_mirroring_rule(
8028        &self,
8029    ) -> super::builder::network_firewall_policies::PatchPacketMirroringRule {
8030        super::builder::network_firewall_policies::PatchPacketMirroringRule::new(self.inner.clone())
8031    }
8032
8033    /// Patches a rule of the specified priority.
8034    pub fn patch_rule(&self) -> super::builder::network_firewall_policies::PatchRule {
8035        super::builder::network_firewall_policies::PatchRule::new(self.inner.clone())
8036    }
8037
8038    /// Removes an association for the specified firewall policy.
8039    pub fn remove_association(
8040        &self,
8041    ) -> super::builder::network_firewall_policies::RemoveAssociation {
8042        super::builder::network_firewall_policies::RemoveAssociation::new(self.inner.clone())
8043    }
8044
8045    /// Deletes a packet mirroring rule of the specified priority.
8046    pub fn remove_packet_mirroring_rule(
8047        &self,
8048    ) -> super::builder::network_firewall_policies::RemovePacketMirroringRule {
8049        super::builder::network_firewall_policies::RemovePacketMirroringRule::new(
8050            self.inner.clone(),
8051        )
8052    }
8053
8054    /// Deletes a rule of the specified priority.
8055    pub fn remove_rule(&self) -> super::builder::network_firewall_policies::RemoveRule {
8056        super::builder::network_firewall_policies::RemoveRule::new(self.inner.clone())
8057    }
8058
8059    /// Sets the access control policy on the specified resource.
8060    /// Replaces any existing policy.
8061    pub fn set_iam_policy(&self) -> super::builder::network_firewall_policies::SetIamPolicy {
8062        super::builder::network_firewall_policies::SetIamPolicy::new(self.inner.clone())
8063    }
8064
8065    /// Returns permissions that a caller has on the specified resource.
8066    pub fn test_iam_permissions(
8067        &self,
8068    ) -> super::builder::network_firewall_policies::TestIamPermissions {
8069        super::builder::network_firewall_policies::TestIamPermissions::new(self.inner.clone())
8070    }
8071
8072    /// Retrieves the specified Operations resource.
8073    pub fn get_operation(&self) -> super::builder::network_firewall_policies::GetOperation {
8074        super::builder::network_firewall_policies::GetOperation::new(self.inner.clone())
8075    }
8076}
8077
8078/// Implements a client for the Google Compute Engine API.
8079///
8080/// # Example
8081/// ```
8082/// # use google_cloud_compute_v1::client::NetworkProfiles;
8083/// async fn sample(
8084/// ) -> anyhow::Result<()> {
8085///     let client = NetworkProfiles::builder().build().await?;
8086///     // use `client` to make requests to the Google Compute Engine API.
8087///     Ok(())
8088/// }
8089/// ```
8090///
8091/// # Service Description
8092///
8093/// Service for the `networkProfiles` resource.
8094///
8095/// # Configuration
8096///
8097/// To configure `NetworkProfiles` use the `with_*` methods in the type returned
8098/// by [builder()][NetworkProfiles::builder]. The default configuration should
8099/// work for most applications. Common configuration changes include
8100///
8101/// * [with_endpoint()]: by default this client uses the global default endpoint
8102///   (`https://compute.googleapis.com`). Applications using regional
8103///   endpoints or running in restricted networks (e.g. a network configured
8104//    with [Private Google Access with VPC Service Controls]) may want to
8105///   override this default.
8106/// * [with_credentials()]: by default this client uses
8107///   [Application Default Credentials]. Applications using custom
8108///   authentication may need to override this default.
8109///
8110/// [with_endpoint()]: super::builder::network_profiles::ClientBuilder::with_endpoint
8111/// [with_credentials()]: super::builder::network_profiles::ClientBuilder::with_credentials
8112/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8113/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8114///
8115/// # Pooling and Cloning
8116///
8117/// `NetworkProfiles` holds a connection pool internally, it is advised to
8118/// create one and reuse it. You do not need to wrap `NetworkProfiles` in
8119/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8120/// already uses an `Arc` internally.
8121#[cfg(feature = "network-profiles")]
8122#[cfg_attr(docsrs, doc(cfg(feature = "network-profiles")))]
8123#[derive(Clone, Debug)]
8124pub struct NetworkProfiles {
8125    inner: std::sync::Arc<dyn super::stub::dynamic::NetworkProfiles>,
8126}
8127
8128#[cfg(feature = "network-profiles")]
8129impl NetworkProfiles {
8130    /// Returns a builder for [NetworkProfiles].
8131    ///
8132    /// ```
8133    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8134    /// # use google_cloud_compute_v1::client::NetworkProfiles;
8135    /// let client = NetworkProfiles::builder().build().await?;
8136    /// # Ok(()) }
8137    /// ```
8138    pub fn builder() -> super::builder::network_profiles::ClientBuilder {
8139        crate::new_client_builder(super::builder::network_profiles::client::Factory)
8140    }
8141
8142    /// Creates a new client from the provided stub.
8143    ///
8144    /// The most common case for calling this function is in tests mocking the
8145    /// client's behavior.
8146    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
8147    where
8148        T: super::stub::NetworkProfiles + 'static,
8149    {
8150        Self { inner: stub.into() }
8151    }
8152
8153    pub(crate) async fn new(
8154        config: gaxi::options::ClientConfig,
8155    ) -> crate::ClientBuilderResult<Self> {
8156        let inner = Self::build_inner(config).await?;
8157        Ok(Self { inner })
8158    }
8159
8160    async fn build_inner(
8161        conf: gaxi::options::ClientConfig,
8162    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NetworkProfiles>> {
8163        if gaxi::options::tracing_enabled(&conf) {
8164            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8165        }
8166        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8167    }
8168
8169    async fn build_transport(
8170        conf: gaxi::options::ClientConfig,
8171    ) -> crate::ClientBuilderResult<impl super::stub::NetworkProfiles> {
8172        super::transport::NetworkProfiles::new(conf).await
8173    }
8174
8175    async fn build_with_tracing(
8176        conf: gaxi::options::ClientConfig,
8177    ) -> crate::ClientBuilderResult<impl super::stub::NetworkProfiles> {
8178        Self::build_transport(conf)
8179            .await
8180            .map(super::tracing::NetworkProfiles::new)
8181    }
8182
8183    /// Returns the specified network profile.
8184    pub fn get(&self) -> super::builder::network_profiles::Get {
8185        super::builder::network_profiles::Get::new(self.inner.clone())
8186    }
8187
8188    /// Retrieves a list of network profiles available to the specified
8189    /// project.
8190    pub fn list(&self) -> super::builder::network_profiles::List {
8191        super::builder::network_profiles::List::new(self.inner.clone())
8192    }
8193}
8194
8195/// Implements a client for the Google Compute Engine API.
8196///
8197/// # Example
8198/// ```
8199/// # use google_cloud_compute_v1::client::Networks;
8200/// async fn sample(
8201/// ) -> anyhow::Result<()> {
8202///     let client = Networks::builder().build().await?;
8203///     // use `client` to make requests to the Google Compute Engine API.
8204///     Ok(())
8205/// }
8206/// ```
8207///
8208/// # Service Description
8209///
8210/// Service for the `networks` resource.
8211///
8212/// # Configuration
8213///
8214/// To configure `Networks` use the `with_*` methods in the type returned
8215/// by [builder()][Networks::builder]. The default configuration should
8216/// work for most applications. Common configuration changes include
8217///
8218/// * [with_endpoint()]: by default this client uses the global default endpoint
8219///   (`https://compute.googleapis.com`). Applications using regional
8220///   endpoints or running in restricted networks (e.g. a network configured
8221//    with [Private Google Access with VPC Service Controls]) may want to
8222///   override this default.
8223/// * [with_credentials()]: by default this client uses
8224///   [Application Default Credentials]. Applications using custom
8225///   authentication may need to override this default.
8226///
8227/// [with_endpoint()]: super::builder::networks::ClientBuilder::with_endpoint
8228/// [with_credentials()]: super::builder::networks::ClientBuilder::with_credentials
8229/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8230/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8231///
8232/// # Pooling and Cloning
8233///
8234/// `Networks` holds a connection pool internally, it is advised to
8235/// create one and reuse it. You do not need to wrap `Networks` in
8236/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8237/// already uses an `Arc` internally.
8238#[cfg(feature = "networks")]
8239#[cfg_attr(docsrs, doc(cfg(feature = "networks")))]
8240#[derive(Clone, Debug)]
8241pub struct Networks {
8242    inner: std::sync::Arc<dyn super::stub::dynamic::Networks>,
8243}
8244
8245#[cfg(feature = "networks")]
8246impl Networks {
8247    /// Returns a builder for [Networks].
8248    ///
8249    /// ```
8250    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8251    /// # use google_cloud_compute_v1::client::Networks;
8252    /// let client = Networks::builder().build().await?;
8253    /// # Ok(()) }
8254    /// ```
8255    pub fn builder() -> super::builder::networks::ClientBuilder {
8256        crate::new_client_builder(super::builder::networks::client::Factory)
8257    }
8258
8259    /// Creates a new client from the provided stub.
8260    ///
8261    /// The most common case for calling this function is in tests mocking the
8262    /// client's behavior.
8263    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
8264    where
8265        T: super::stub::Networks + 'static,
8266    {
8267        Self { inner: stub.into() }
8268    }
8269
8270    pub(crate) async fn new(
8271        config: gaxi::options::ClientConfig,
8272    ) -> crate::ClientBuilderResult<Self> {
8273        let inner = Self::build_inner(config).await?;
8274        Ok(Self { inner })
8275    }
8276
8277    async fn build_inner(
8278        conf: gaxi::options::ClientConfig,
8279    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Networks>> {
8280        if gaxi::options::tracing_enabled(&conf) {
8281            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8282        }
8283        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8284    }
8285
8286    async fn build_transport(
8287        conf: gaxi::options::ClientConfig,
8288    ) -> crate::ClientBuilderResult<impl super::stub::Networks> {
8289        super::transport::Networks::new(conf).await
8290    }
8291
8292    async fn build_with_tracing(
8293        conf: gaxi::options::ClientConfig,
8294    ) -> crate::ClientBuilderResult<impl super::stub::Networks> {
8295        Self::build_transport(conf)
8296            .await
8297            .map(super::tracing::Networks::new)
8298    }
8299
8300    /// Adds a peering to the specified network.
8301    pub fn add_peering(&self) -> super::builder::networks::AddPeering {
8302        super::builder::networks::AddPeering::new(self.inner.clone())
8303    }
8304
8305    /// Deletes the specified network.
8306    pub fn delete(&self) -> super::builder::networks::Delete {
8307        super::builder::networks::Delete::new(self.inner.clone())
8308    }
8309
8310    /// Returns the specified network.
8311    pub fn get(&self) -> super::builder::networks::Get {
8312        super::builder::networks::Get::new(self.inner.clone())
8313    }
8314
8315    /// Returns the effective firewalls on a given network.
8316    pub fn get_effective_firewalls(&self) -> super::builder::networks::GetEffectiveFirewalls {
8317        super::builder::networks::GetEffectiveFirewalls::new(self.inner.clone())
8318    }
8319
8320    /// Creates a network in the specified project using the data included
8321    /// in the request.
8322    pub fn insert(&self) -> super::builder::networks::Insert {
8323        super::builder::networks::Insert::new(self.inner.clone())
8324    }
8325
8326    /// Retrieves the list of networks available to the specified project.
8327    pub fn list(&self) -> super::builder::networks::List {
8328        super::builder::networks::List::new(self.inner.clone())
8329    }
8330
8331    /// Lists the peering routes exchanged over peering connection.
8332    pub fn list_peering_routes(&self) -> super::builder::networks::ListPeeringRoutes {
8333        super::builder::networks::ListPeeringRoutes::new(self.inner.clone())
8334    }
8335
8336    /// Patches the specified network with the data included in the request.
8337    /// Only routingConfig can be modified.
8338    pub fn patch(&self) -> super::builder::networks::Patch {
8339        super::builder::networks::Patch::new(self.inner.clone())
8340    }
8341
8342    /// Removes a peering from the specified network.
8343    pub fn remove_peering(&self) -> super::builder::networks::RemovePeering {
8344        super::builder::networks::RemovePeering::new(self.inner.clone())
8345    }
8346
8347    /// Requests to remove a peering from the specified network. Applicable only
8348    /// for PeeringConnection with update_strategy=CONSENSUS.
8349    pub fn request_remove_peering(&self) -> super::builder::networks::RequestRemovePeering {
8350        super::builder::networks::RequestRemovePeering::new(self.inner.clone())
8351    }
8352
8353    /// Switches the network mode from auto subnet mode to custom subnet mode.
8354    pub fn switch_to_custom_mode(&self) -> super::builder::networks::SwitchToCustomMode {
8355        super::builder::networks::SwitchToCustomMode::new(self.inner.clone())
8356    }
8357
8358    /// Updates the specified network peering with the data included in the
8359    /// request. You can only modify the NetworkPeering.export_custom_routes field
8360    /// and the NetworkPeering.import_custom_routes field.
8361    pub fn update_peering(&self) -> super::builder::networks::UpdatePeering {
8362        super::builder::networks::UpdatePeering::new(self.inner.clone())
8363    }
8364
8365    /// Retrieves the specified Operations resource.
8366    pub fn get_operation(&self) -> super::builder::networks::GetOperation {
8367        super::builder::networks::GetOperation::new(self.inner.clone())
8368    }
8369}
8370
8371/// Implements a client for the Google Compute Engine API.
8372///
8373/// # Example
8374/// ```
8375/// # use google_cloud_compute_v1::client::NodeGroups;
8376/// async fn sample(
8377/// ) -> anyhow::Result<()> {
8378///     let client = NodeGroups::builder().build().await?;
8379///     // use `client` to make requests to the Google Compute Engine API.
8380///     Ok(())
8381/// }
8382/// ```
8383///
8384/// # Service Description
8385///
8386/// Service for the `nodeGroups` resource.
8387///
8388/// # Configuration
8389///
8390/// To configure `NodeGroups` use the `with_*` methods in the type returned
8391/// by [builder()][NodeGroups::builder]. The default configuration should
8392/// work for most applications. Common configuration changes include
8393///
8394/// * [with_endpoint()]: by default this client uses the global default endpoint
8395///   (`https://compute.googleapis.com`). Applications using regional
8396///   endpoints or running in restricted networks (e.g. a network configured
8397//    with [Private Google Access with VPC Service Controls]) may want to
8398///   override this default.
8399/// * [with_credentials()]: by default this client uses
8400///   [Application Default Credentials]. Applications using custom
8401///   authentication may need to override this default.
8402///
8403/// [with_endpoint()]: super::builder::node_groups::ClientBuilder::with_endpoint
8404/// [with_credentials()]: super::builder::node_groups::ClientBuilder::with_credentials
8405/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8406/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8407///
8408/// # Pooling and Cloning
8409///
8410/// `NodeGroups` holds a connection pool internally, it is advised to
8411/// create one and reuse it. You do not need to wrap `NodeGroups` in
8412/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8413/// already uses an `Arc` internally.
8414#[cfg(feature = "node-groups")]
8415#[cfg_attr(docsrs, doc(cfg(feature = "node-groups")))]
8416#[derive(Clone, Debug)]
8417pub struct NodeGroups {
8418    inner: std::sync::Arc<dyn super::stub::dynamic::NodeGroups>,
8419}
8420
8421#[cfg(feature = "node-groups")]
8422impl NodeGroups {
8423    /// Returns a builder for [NodeGroups].
8424    ///
8425    /// ```
8426    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8427    /// # use google_cloud_compute_v1::client::NodeGroups;
8428    /// let client = NodeGroups::builder().build().await?;
8429    /// # Ok(()) }
8430    /// ```
8431    pub fn builder() -> super::builder::node_groups::ClientBuilder {
8432        crate::new_client_builder(super::builder::node_groups::client::Factory)
8433    }
8434
8435    /// Creates a new client from the provided stub.
8436    ///
8437    /// The most common case for calling this function is in tests mocking the
8438    /// client's behavior.
8439    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
8440    where
8441        T: super::stub::NodeGroups + 'static,
8442    {
8443        Self { inner: stub.into() }
8444    }
8445
8446    pub(crate) async fn new(
8447        config: gaxi::options::ClientConfig,
8448    ) -> crate::ClientBuilderResult<Self> {
8449        let inner = Self::build_inner(config).await?;
8450        Ok(Self { inner })
8451    }
8452
8453    async fn build_inner(
8454        conf: gaxi::options::ClientConfig,
8455    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NodeGroups>> {
8456        if gaxi::options::tracing_enabled(&conf) {
8457            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8458        }
8459        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8460    }
8461
8462    async fn build_transport(
8463        conf: gaxi::options::ClientConfig,
8464    ) -> crate::ClientBuilderResult<impl super::stub::NodeGroups> {
8465        super::transport::NodeGroups::new(conf).await
8466    }
8467
8468    async fn build_with_tracing(
8469        conf: gaxi::options::ClientConfig,
8470    ) -> crate::ClientBuilderResult<impl super::stub::NodeGroups> {
8471        Self::build_transport(conf)
8472            .await
8473            .map(super::tracing::NodeGroups::new)
8474    }
8475
8476    /// Adds specified number of nodes to the node group.
8477    pub fn add_nodes(&self) -> super::builder::node_groups::AddNodes {
8478        super::builder::node_groups::AddNodes::new(self.inner.clone())
8479    }
8480
8481    /// Retrieves an aggregated list of node groups.
8482    /// Note: use nodeGroups.listNodes for more details about each group.
8483    ///
8484    /// To prevent failure, Google recommends that you set the
8485    /// `returnPartialSuccess` parameter to `true`.
8486    pub fn aggregated_list(&self) -> super::builder::node_groups::AggregatedList {
8487        super::builder::node_groups::AggregatedList::new(self.inner.clone())
8488    }
8489
8490    /// Deletes the specified NodeGroup resource.
8491    pub fn delete(&self) -> super::builder::node_groups::Delete {
8492        super::builder::node_groups::Delete::new(self.inner.clone())
8493    }
8494
8495    /// Deletes specified nodes from the node group.
8496    pub fn delete_nodes(&self) -> super::builder::node_groups::DeleteNodes {
8497        super::builder::node_groups::DeleteNodes::new(self.inner.clone())
8498    }
8499
8500    /// Returns the specified NodeGroup. Get a list of available NodeGroups
8501    /// by making a list() request.
8502    /// Note: the "nodes" field should not be used. Use nodeGroups.listNodes
8503    /// instead.
8504    pub fn get(&self) -> super::builder::node_groups::Get {
8505        super::builder::node_groups::Get::new(self.inner.clone())
8506    }
8507
8508    /// Gets the access control policy for a resource. May be empty if no such
8509    /// policy or resource exists.
8510    pub fn get_iam_policy(&self) -> super::builder::node_groups::GetIamPolicy {
8511        super::builder::node_groups::GetIamPolicy::new(self.inner.clone())
8512    }
8513
8514    /// Creates a NodeGroup resource in the specified project using the data
8515    /// included in the request.
8516    pub fn insert(&self) -> super::builder::node_groups::Insert {
8517        super::builder::node_groups::Insert::new(self.inner.clone())
8518    }
8519
8520    /// Retrieves a list of node groups available to the specified project.
8521    /// Note: use nodeGroups.listNodes for more details about each group.
8522    pub fn list(&self) -> super::builder::node_groups::List {
8523        super::builder::node_groups::List::new(self.inner.clone())
8524    }
8525
8526    /// Lists nodes in the node group.
8527    pub fn list_nodes(&self) -> super::builder::node_groups::ListNodes {
8528        super::builder::node_groups::ListNodes::new(self.inner.clone())
8529    }
8530
8531    /// Updates the specified node group.
8532    pub fn patch(&self) -> super::builder::node_groups::Patch {
8533        super::builder::node_groups::Patch::new(self.inner.clone())
8534    }
8535
8536    /// Perform maintenance on a subset of nodes in the node group.
8537    pub fn perform_maintenance(&self) -> super::builder::node_groups::PerformMaintenance {
8538        super::builder::node_groups::PerformMaintenance::new(self.inner.clone())
8539    }
8540
8541    /// Sets the access control policy on the specified resource.
8542    /// Replaces any existing policy.
8543    pub fn set_iam_policy(&self) -> super::builder::node_groups::SetIamPolicy {
8544        super::builder::node_groups::SetIamPolicy::new(self.inner.clone())
8545    }
8546
8547    /// Updates the node template of the node group.
8548    pub fn set_node_template(&self) -> super::builder::node_groups::SetNodeTemplate {
8549        super::builder::node_groups::SetNodeTemplate::new(self.inner.clone())
8550    }
8551
8552    /// Simulates maintenance event on specified nodes from the node group.
8553    pub fn simulate_maintenance_event(
8554        &self,
8555    ) -> super::builder::node_groups::SimulateMaintenanceEvent {
8556        super::builder::node_groups::SimulateMaintenanceEvent::new(self.inner.clone())
8557    }
8558
8559    /// Returns permissions that a caller has on the specified resource.
8560    pub fn test_iam_permissions(&self) -> super::builder::node_groups::TestIamPermissions {
8561        super::builder::node_groups::TestIamPermissions::new(self.inner.clone())
8562    }
8563
8564    /// Retrieves the specified zone-specific Operations resource.
8565    pub fn get_operation(&self) -> super::builder::node_groups::GetOperation {
8566        super::builder::node_groups::GetOperation::new(self.inner.clone())
8567    }
8568}
8569
8570/// Implements a client for the Google Compute Engine API.
8571///
8572/// # Example
8573/// ```
8574/// # use google_cloud_compute_v1::client::NodeTemplates;
8575/// async fn sample(
8576/// ) -> anyhow::Result<()> {
8577///     let client = NodeTemplates::builder().build().await?;
8578///     // use `client` to make requests to the Google Compute Engine API.
8579///     Ok(())
8580/// }
8581/// ```
8582///
8583/// # Service Description
8584///
8585/// Service for the `nodeTemplates` resource.
8586///
8587/// # Configuration
8588///
8589/// To configure `NodeTemplates` use the `with_*` methods in the type returned
8590/// by [builder()][NodeTemplates::builder]. The default configuration should
8591/// work for most applications. Common configuration changes include
8592///
8593/// * [with_endpoint()]: by default this client uses the global default endpoint
8594///   (`https://compute.googleapis.com`). Applications using regional
8595///   endpoints or running in restricted networks (e.g. a network configured
8596//    with [Private Google Access with VPC Service Controls]) may want to
8597///   override this default.
8598/// * [with_credentials()]: by default this client uses
8599///   [Application Default Credentials]. Applications using custom
8600///   authentication may need to override this default.
8601///
8602/// [with_endpoint()]: super::builder::node_templates::ClientBuilder::with_endpoint
8603/// [with_credentials()]: super::builder::node_templates::ClientBuilder::with_credentials
8604/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8605/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8606///
8607/// # Pooling and Cloning
8608///
8609/// `NodeTemplates` holds a connection pool internally, it is advised to
8610/// create one and reuse it. You do not need to wrap `NodeTemplates` in
8611/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8612/// already uses an `Arc` internally.
8613#[cfg(feature = "node-templates")]
8614#[cfg_attr(docsrs, doc(cfg(feature = "node-templates")))]
8615#[derive(Clone, Debug)]
8616pub struct NodeTemplates {
8617    inner: std::sync::Arc<dyn super::stub::dynamic::NodeTemplates>,
8618}
8619
8620#[cfg(feature = "node-templates")]
8621impl NodeTemplates {
8622    /// Returns a builder for [NodeTemplates].
8623    ///
8624    /// ```
8625    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8626    /// # use google_cloud_compute_v1::client::NodeTemplates;
8627    /// let client = NodeTemplates::builder().build().await?;
8628    /// # Ok(()) }
8629    /// ```
8630    pub fn builder() -> super::builder::node_templates::ClientBuilder {
8631        crate::new_client_builder(super::builder::node_templates::client::Factory)
8632    }
8633
8634    /// Creates a new client from the provided stub.
8635    ///
8636    /// The most common case for calling this function is in tests mocking the
8637    /// client's behavior.
8638    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
8639    where
8640        T: super::stub::NodeTemplates + 'static,
8641    {
8642        Self { inner: stub.into() }
8643    }
8644
8645    pub(crate) async fn new(
8646        config: gaxi::options::ClientConfig,
8647    ) -> crate::ClientBuilderResult<Self> {
8648        let inner = Self::build_inner(config).await?;
8649        Ok(Self { inner })
8650    }
8651
8652    async fn build_inner(
8653        conf: gaxi::options::ClientConfig,
8654    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NodeTemplates>> {
8655        if gaxi::options::tracing_enabled(&conf) {
8656            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8657        }
8658        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8659    }
8660
8661    async fn build_transport(
8662        conf: gaxi::options::ClientConfig,
8663    ) -> crate::ClientBuilderResult<impl super::stub::NodeTemplates> {
8664        super::transport::NodeTemplates::new(conf).await
8665    }
8666
8667    async fn build_with_tracing(
8668        conf: gaxi::options::ClientConfig,
8669    ) -> crate::ClientBuilderResult<impl super::stub::NodeTemplates> {
8670        Self::build_transport(conf)
8671            .await
8672            .map(super::tracing::NodeTemplates::new)
8673    }
8674
8675    /// Retrieves an aggregated list of node templates.
8676    ///
8677    /// To prevent failure, Google recommends that you set the
8678    /// `returnPartialSuccess` parameter to `true`.
8679    pub fn aggregated_list(&self) -> super::builder::node_templates::AggregatedList {
8680        super::builder::node_templates::AggregatedList::new(self.inner.clone())
8681    }
8682
8683    /// Deletes the specified NodeTemplate resource.
8684    pub fn delete(&self) -> super::builder::node_templates::Delete {
8685        super::builder::node_templates::Delete::new(self.inner.clone())
8686    }
8687
8688    /// Returns the specified node template.
8689    pub fn get(&self) -> super::builder::node_templates::Get {
8690        super::builder::node_templates::Get::new(self.inner.clone())
8691    }
8692
8693    /// Gets the access control policy for a resource. May be empty if no such
8694    /// policy or resource exists.
8695    pub fn get_iam_policy(&self) -> super::builder::node_templates::GetIamPolicy {
8696        super::builder::node_templates::GetIamPolicy::new(self.inner.clone())
8697    }
8698
8699    /// Creates a NodeTemplate resource in the specified project using the data
8700    /// included in the request.
8701    pub fn insert(&self) -> super::builder::node_templates::Insert {
8702        super::builder::node_templates::Insert::new(self.inner.clone())
8703    }
8704
8705    /// Retrieves a list of node templates available to the specified
8706    /// project.
8707    pub fn list(&self) -> super::builder::node_templates::List {
8708        super::builder::node_templates::List::new(self.inner.clone())
8709    }
8710
8711    /// Sets the access control policy on the specified resource.
8712    /// Replaces any existing policy.
8713    pub fn set_iam_policy(&self) -> super::builder::node_templates::SetIamPolicy {
8714        super::builder::node_templates::SetIamPolicy::new(self.inner.clone())
8715    }
8716
8717    /// Returns permissions that a caller has on the specified resource.
8718    pub fn test_iam_permissions(&self) -> super::builder::node_templates::TestIamPermissions {
8719        super::builder::node_templates::TestIamPermissions::new(self.inner.clone())
8720    }
8721
8722    /// Retrieves the specified region-specific Operations resource.
8723    pub fn get_operation(&self) -> super::builder::node_templates::GetOperation {
8724        super::builder::node_templates::GetOperation::new(self.inner.clone())
8725    }
8726}
8727
8728/// Implements a client for the Google Compute Engine API.
8729///
8730/// # Example
8731/// ```
8732/// # use google_cloud_compute_v1::client::NodeTypes;
8733/// async fn sample(
8734/// ) -> anyhow::Result<()> {
8735///     let client = NodeTypes::builder().build().await?;
8736///     // use `client` to make requests to the Google Compute Engine API.
8737///     Ok(())
8738/// }
8739/// ```
8740///
8741/// # Service Description
8742///
8743/// Service for the `nodeTypes` resource.
8744///
8745/// # Configuration
8746///
8747/// To configure `NodeTypes` use the `with_*` methods in the type returned
8748/// by [builder()][NodeTypes::builder]. The default configuration should
8749/// work for most applications. Common configuration changes include
8750///
8751/// * [with_endpoint()]: by default this client uses the global default endpoint
8752///   (`https://compute.googleapis.com`). Applications using regional
8753///   endpoints or running in restricted networks (e.g. a network configured
8754//    with [Private Google Access with VPC Service Controls]) may want to
8755///   override this default.
8756/// * [with_credentials()]: by default this client uses
8757///   [Application Default Credentials]. Applications using custom
8758///   authentication may need to override this default.
8759///
8760/// [with_endpoint()]: super::builder::node_types::ClientBuilder::with_endpoint
8761/// [with_credentials()]: super::builder::node_types::ClientBuilder::with_credentials
8762/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8763/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8764///
8765/// # Pooling and Cloning
8766///
8767/// `NodeTypes` holds a connection pool internally, it is advised to
8768/// create one and reuse it. You do not need to wrap `NodeTypes` in
8769/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8770/// already uses an `Arc` internally.
8771#[cfg(feature = "node-types")]
8772#[cfg_attr(docsrs, doc(cfg(feature = "node-types")))]
8773#[derive(Clone, Debug)]
8774pub struct NodeTypes {
8775    inner: std::sync::Arc<dyn super::stub::dynamic::NodeTypes>,
8776}
8777
8778#[cfg(feature = "node-types")]
8779impl NodeTypes {
8780    /// Returns a builder for [NodeTypes].
8781    ///
8782    /// ```
8783    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8784    /// # use google_cloud_compute_v1::client::NodeTypes;
8785    /// let client = NodeTypes::builder().build().await?;
8786    /// # Ok(()) }
8787    /// ```
8788    pub fn builder() -> super::builder::node_types::ClientBuilder {
8789        crate::new_client_builder(super::builder::node_types::client::Factory)
8790    }
8791
8792    /// Creates a new client from the provided stub.
8793    ///
8794    /// The most common case for calling this function is in tests mocking the
8795    /// client's behavior.
8796    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
8797    where
8798        T: super::stub::NodeTypes + 'static,
8799    {
8800        Self { inner: stub.into() }
8801    }
8802
8803    pub(crate) async fn new(
8804        config: gaxi::options::ClientConfig,
8805    ) -> crate::ClientBuilderResult<Self> {
8806        let inner = Self::build_inner(config).await?;
8807        Ok(Self { inner })
8808    }
8809
8810    async fn build_inner(
8811        conf: gaxi::options::ClientConfig,
8812    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NodeTypes>> {
8813        if gaxi::options::tracing_enabled(&conf) {
8814            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8815        }
8816        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8817    }
8818
8819    async fn build_transport(
8820        conf: gaxi::options::ClientConfig,
8821    ) -> crate::ClientBuilderResult<impl super::stub::NodeTypes> {
8822        super::transport::NodeTypes::new(conf).await
8823    }
8824
8825    async fn build_with_tracing(
8826        conf: gaxi::options::ClientConfig,
8827    ) -> crate::ClientBuilderResult<impl super::stub::NodeTypes> {
8828        Self::build_transport(conf)
8829            .await
8830            .map(super::tracing::NodeTypes::new)
8831    }
8832
8833    /// Retrieves an aggregated list of node types.
8834    ///
8835    /// To prevent failure, Google recommends that you set the
8836    /// `returnPartialSuccess` parameter to `true`.
8837    pub fn aggregated_list(&self) -> super::builder::node_types::AggregatedList {
8838        super::builder::node_types::AggregatedList::new(self.inner.clone())
8839    }
8840
8841    /// Returns the specified node type.
8842    pub fn get(&self) -> super::builder::node_types::Get {
8843        super::builder::node_types::Get::new(self.inner.clone())
8844    }
8845
8846    /// Retrieves a list of node types available to the specified
8847    /// project.
8848    pub fn list(&self) -> super::builder::node_types::List {
8849        super::builder::node_types::List::new(self.inner.clone())
8850    }
8851}
8852
8853/// Implements a client for the Google Compute Engine API.
8854///
8855/// # Example
8856/// ```
8857/// # use google_cloud_compute_v1::client::OrganizationSecurityPolicies;
8858/// async fn sample(
8859/// ) -> anyhow::Result<()> {
8860///     let client = OrganizationSecurityPolicies::builder().build().await?;
8861///     // use `client` to make requests to the Google Compute Engine API.
8862///     Ok(())
8863/// }
8864/// ```
8865///
8866/// # Service Description
8867///
8868/// Service for the `organizationSecurityPolicies` resource.
8869///
8870/// # Configuration
8871///
8872/// To configure `OrganizationSecurityPolicies` use the `with_*` methods in the type returned
8873/// by [builder()][OrganizationSecurityPolicies::builder]. The default configuration should
8874/// work for most applications. Common configuration changes include
8875///
8876/// * [with_endpoint()]: by default this client uses the global default endpoint
8877///   (`https://compute.googleapis.com`). Applications using regional
8878///   endpoints or running in restricted networks (e.g. a network configured
8879//    with [Private Google Access with VPC Service Controls]) may want to
8880///   override this default.
8881/// * [with_credentials()]: by default this client uses
8882///   [Application Default Credentials]. Applications using custom
8883///   authentication may need to override this default.
8884///
8885/// [with_endpoint()]: super::builder::organization_security_policies::ClientBuilder::with_endpoint
8886/// [with_credentials()]: super::builder::organization_security_policies::ClientBuilder::with_credentials
8887/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8888/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8889///
8890/// # Pooling and Cloning
8891///
8892/// `OrganizationSecurityPolicies` holds a connection pool internally, it is advised to
8893/// create one and reuse it. You do not need to wrap `OrganizationSecurityPolicies` in
8894/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8895/// already uses an `Arc` internally.
8896#[cfg(feature = "organization-security-policies")]
8897#[cfg_attr(docsrs, doc(cfg(feature = "organization-security-policies")))]
8898#[derive(Clone, Debug)]
8899pub struct OrganizationSecurityPolicies {
8900    inner: std::sync::Arc<dyn super::stub::dynamic::OrganizationSecurityPolicies>,
8901}
8902
8903#[cfg(feature = "organization-security-policies")]
8904impl OrganizationSecurityPolicies {
8905    /// Returns a builder for [OrganizationSecurityPolicies].
8906    ///
8907    /// ```
8908    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8909    /// # use google_cloud_compute_v1::client::OrganizationSecurityPolicies;
8910    /// let client = OrganizationSecurityPolicies::builder().build().await?;
8911    /// # Ok(()) }
8912    /// ```
8913    pub fn builder() -> super::builder::organization_security_policies::ClientBuilder {
8914        crate::new_client_builder(super::builder::organization_security_policies::client::Factory)
8915    }
8916
8917    /// Creates a new client from the provided stub.
8918    ///
8919    /// The most common case for calling this function is in tests mocking the
8920    /// client's behavior.
8921    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
8922    where
8923        T: super::stub::OrganizationSecurityPolicies + 'static,
8924    {
8925        Self { inner: stub.into() }
8926    }
8927
8928    pub(crate) async fn new(
8929        config: gaxi::options::ClientConfig,
8930    ) -> crate::ClientBuilderResult<Self> {
8931        let inner = Self::build_inner(config).await?;
8932        Ok(Self { inner })
8933    }
8934
8935    async fn build_inner(
8936        conf: gaxi::options::ClientConfig,
8937    ) -> crate::ClientBuilderResult<
8938        std::sync::Arc<dyn super::stub::dynamic::OrganizationSecurityPolicies>,
8939    > {
8940        if gaxi::options::tracing_enabled(&conf) {
8941            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8942        }
8943        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8944    }
8945
8946    async fn build_transport(
8947        conf: gaxi::options::ClientConfig,
8948    ) -> crate::ClientBuilderResult<impl super::stub::OrganizationSecurityPolicies> {
8949        super::transport::OrganizationSecurityPolicies::new(conf).await
8950    }
8951
8952    async fn build_with_tracing(
8953        conf: gaxi::options::ClientConfig,
8954    ) -> crate::ClientBuilderResult<impl super::stub::OrganizationSecurityPolicies> {
8955        Self::build_transport(conf)
8956            .await
8957            .map(super::tracing::OrganizationSecurityPolicies::new)
8958    }
8959
8960    /// Inserts an association for the specified security policy.
8961    ///
8962    /// This has billing implications.  Projects in the hierarchy with effective
8963    /// hierarchical security policies will be automatically enrolled into Cloud
8964    /// Armor Enterprise if not already enrolled.
8965    ///
8966    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8967    /// versions of this API were used to modify firewall policies. This usage is
8968    /// now disabled for most organizations. Use firewallPolicies.addAssociation
8969    /// instead.
8970    pub fn add_association(
8971        &self,
8972    ) -> super::builder::organization_security_policies::AddAssociation {
8973        super::builder::organization_security_policies::AddAssociation::new(self.inner.clone())
8974    }
8975
8976    /// Inserts a rule into a security policy.
8977    ///
8978    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8979    /// versions of this API were used to modify firewall policies. This usage is
8980    /// now disabled for most organizations. Use firewallPolicies.addRule instead.
8981    pub fn add_rule(&self) -> super::builder::organization_security_policies::AddRule {
8982        super::builder::organization_security_policies::AddRule::new(self.inner.clone())
8983    }
8984
8985    /// Copies rules to the specified security policy.
8986    ///
8987    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8988    /// versions of this API were used to modify firewall policies. This usage is
8989    /// now disabled for most organizations. Use firewallPolicies.cloneRules
8990    /// instead.
8991    pub fn copy_rules(&self) -> super::builder::organization_security_policies::CopyRules {
8992        super::builder::organization_security_policies::CopyRules::new(self.inner.clone())
8993    }
8994
8995    /// Deletes the specified policy.
8996    ///
8997    /// Use this API to remove Cloud Armor policies. Previously, alpha and beta
8998    /// versions of this API were used to remove firewall policies. This usage is
8999    /// now disabled for most organizations. Use firewallPolicies.delete instead.
9000    pub fn delete(&self) -> super::builder::organization_security_policies::Delete {
9001        super::builder::organization_security_policies::Delete::new(self.inner.clone())
9002    }
9003
9004    /// List all of the ordered rules present in a single specified policy.
9005    ///
9006    /// Use this API to read Cloud Armor policies. Previously, alpha and beta
9007    /// versions of this API were used to read firewall policies. This usage is now
9008    /// disabled for most organizations. Use firewallPolicies.get instead.
9009    pub fn get(&self) -> super::builder::organization_security_policies::Get {
9010        super::builder::organization_security_policies::Get::new(self.inner.clone())
9011    }
9012
9013    /// Gets an association with the specified name.
9014    ///
9015    /// Use this API to read Cloud Armor policies. Previously, alpha and beta
9016    /// versions of this API were used to read firewall policies. This usage is
9017    /// now disabled for most organizations. Use firewallPolicies.getAssociation
9018    /// instead.
9019    pub fn get_association(
9020        &self,
9021    ) -> super::builder::organization_security_policies::GetAssociation {
9022        super::builder::organization_security_policies::GetAssociation::new(self.inner.clone())
9023    }
9024
9025    /// Gets a rule at the specified priority.
9026    ///
9027    /// Use this API to read Cloud Armor policies. Previously, alpha and beta
9028    /// versions of this API were used to read firewall policies. This usage is now
9029    /// disabled for most organizations. Use firewallPolicies.getRule instead.
9030    pub fn get_rule(&self) -> super::builder::organization_security_policies::GetRule {
9031        super::builder::organization_security_policies::GetRule::new(self.inner.clone())
9032    }
9033
9034    /// Creates a new policy in the specified organization using the data included
9035    /// in the request.
9036    ///
9037    /// Use this API to add Cloud Armor policies. Previously, alpha and beta
9038    /// versions of this API were used to add firewall policies. This usage is now
9039    /// disabled for most organizations. Use firewallPolicies.insert instead.
9040    pub fn insert(&self) -> super::builder::organization_security_policies::Insert {
9041        super::builder::organization_security_policies::Insert::new(self.inner.clone())
9042    }
9043
9044    /// List all the policies that have been configured for the specified
9045    /// organization.
9046    ///
9047    /// Use this API to read Cloud Armor policies. Previously, alpha and beta
9048    /// versions of this API were used to read firewall policies. This usage is now
9049    /// disabled for most organizations. Use firewallPolicies.list instead.
9050    pub fn list(&self) -> super::builder::organization_security_policies::List {
9051        super::builder::organization_security_policies::List::new(self.inner.clone())
9052    }
9053
9054    /// Lists associations of a specified target, i.e., organization or folder.
9055    ///
9056    /// Use this API to read Cloud Armor policies. Previously, alpha and beta
9057    /// versions of this API were used to read firewall policies. This usage is
9058    /// now disabled for most organizations. Use firewallPolicies.listAssociations
9059    /// instead.
9060    pub fn list_associations(
9061        &self,
9062    ) -> super::builder::organization_security_policies::ListAssociations {
9063        super::builder::organization_security_policies::ListAssociations::new(self.inner.clone())
9064    }
9065
9066    /// Gets the current list of preconfigured Web Application Firewall (WAF)
9067    /// expressions.
9068    pub fn list_preconfigured_expression_sets(
9069        &self,
9070    ) -> super::builder::organization_security_policies::ListPreconfiguredExpressionSets {
9071        super::builder::organization_security_policies::ListPreconfiguredExpressionSets::new(
9072            self.inner.clone(),
9073        )
9074    }
9075
9076    /// Moves the specified security policy.
9077    ///
9078    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
9079    /// versions of this API were used to modify firewall policies. This usage is
9080    /// now disabled for most organizations. Use firewallPolicies.move instead.
9081    pub fn r#move(&self) -> super::builder::organization_security_policies::Move {
9082        super::builder::organization_security_policies::Move::new(self.inner.clone())
9083    }
9084
9085    /// Patches the specified policy with the data included in the request.
9086    ///
9087    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
9088    /// versions of this API were used to modify firewall policies. This usage is
9089    /// now disabled for most organizations. Use firewallPolicies.patch instead.
9090    pub fn patch(&self) -> super::builder::organization_security_policies::Patch {
9091        super::builder::organization_security_policies::Patch::new(self.inner.clone())
9092    }
9093
9094    /// Patches a rule at the specified priority.
9095    ///
9096    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
9097    /// versions of this API were used to modify firewall policies. This usage is
9098    /// now disabled for most organizations. Use firewallPolicies.patchRule
9099    /// instead.
9100    pub fn patch_rule(&self) -> super::builder::organization_security_policies::PatchRule {
9101        super::builder::organization_security_policies::PatchRule::new(self.inner.clone())
9102    }
9103
9104    /// Removes an association for the specified security policy.
9105    ///
9106    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
9107    /// versions of this API were used to modify firewall policies. This usage is
9108    /// now disabled for most organizations. Use firewallPolicies.removeAssociation
9109    /// instead.
9110    pub fn remove_association(
9111        &self,
9112    ) -> super::builder::organization_security_policies::RemoveAssociation {
9113        super::builder::organization_security_policies::RemoveAssociation::new(self.inner.clone())
9114    }
9115
9116    /// Deletes a rule at the specified priority.
9117    ///
9118    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
9119    /// versions of this API were used to modify firewall policies. This usage is
9120    /// now disabled for most organizations. Use firewallPolicies.removeRule
9121    /// instead.
9122    pub fn remove_rule(&self) -> super::builder::organization_security_policies::RemoveRule {
9123        super::builder::organization_security_policies::RemoveRule::new(self.inner.clone())
9124    }
9125
9126    /// Retrieves the specified Operations resource. Gets a list of operations
9127    /// by making a `list()` request.
9128    pub fn get_operation(&self) -> super::builder::organization_security_policies::GetOperation {
9129        super::builder::organization_security_policies::GetOperation::new(self.inner.clone())
9130    }
9131}
9132
9133/// Implements a client for the Google Compute Engine API.
9134///
9135/// # Example
9136/// ```
9137/// # use google_cloud_compute_v1::client::PacketMirrorings;
9138/// async fn sample(
9139/// ) -> anyhow::Result<()> {
9140///     let client = PacketMirrorings::builder().build().await?;
9141///     // use `client` to make requests to the Google Compute Engine API.
9142///     Ok(())
9143/// }
9144/// ```
9145///
9146/// # Service Description
9147///
9148/// Service for the `packetMirrorings` resource.
9149///
9150/// # Configuration
9151///
9152/// To configure `PacketMirrorings` use the `with_*` methods in the type returned
9153/// by [builder()][PacketMirrorings::builder]. The default configuration should
9154/// work for most applications. Common configuration changes include
9155///
9156/// * [with_endpoint()]: by default this client uses the global default endpoint
9157///   (`https://compute.googleapis.com`). Applications using regional
9158///   endpoints or running in restricted networks (e.g. a network configured
9159//    with [Private Google Access with VPC Service Controls]) may want to
9160///   override this default.
9161/// * [with_credentials()]: by default this client uses
9162///   [Application Default Credentials]. Applications using custom
9163///   authentication may need to override this default.
9164///
9165/// [with_endpoint()]: super::builder::packet_mirrorings::ClientBuilder::with_endpoint
9166/// [with_credentials()]: super::builder::packet_mirrorings::ClientBuilder::with_credentials
9167/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9168/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9169///
9170/// # Pooling and Cloning
9171///
9172/// `PacketMirrorings` holds a connection pool internally, it is advised to
9173/// create one and reuse it. You do not need to wrap `PacketMirrorings` in
9174/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9175/// already uses an `Arc` internally.
9176#[cfg(feature = "packet-mirrorings")]
9177#[cfg_attr(docsrs, doc(cfg(feature = "packet-mirrorings")))]
9178#[derive(Clone, Debug)]
9179pub struct PacketMirrorings {
9180    inner: std::sync::Arc<dyn super::stub::dynamic::PacketMirrorings>,
9181}
9182
9183#[cfg(feature = "packet-mirrorings")]
9184impl PacketMirrorings {
9185    /// Returns a builder for [PacketMirrorings].
9186    ///
9187    /// ```
9188    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9189    /// # use google_cloud_compute_v1::client::PacketMirrorings;
9190    /// let client = PacketMirrorings::builder().build().await?;
9191    /// # Ok(()) }
9192    /// ```
9193    pub fn builder() -> super::builder::packet_mirrorings::ClientBuilder {
9194        crate::new_client_builder(super::builder::packet_mirrorings::client::Factory)
9195    }
9196
9197    /// Creates a new client from the provided stub.
9198    ///
9199    /// The most common case for calling this function is in tests mocking the
9200    /// client's behavior.
9201    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
9202    where
9203        T: super::stub::PacketMirrorings + 'static,
9204    {
9205        Self { inner: stub.into() }
9206    }
9207
9208    pub(crate) async fn new(
9209        config: gaxi::options::ClientConfig,
9210    ) -> crate::ClientBuilderResult<Self> {
9211        let inner = Self::build_inner(config).await?;
9212        Ok(Self { inner })
9213    }
9214
9215    async fn build_inner(
9216        conf: gaxi::options::ClientConfig,
9217    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::PacketMirrorings>>
9218    {
9219        if gaxi::options::tracing_enabled(&conf) {
9220            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9221        }
9222        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9223    }
9224
9225    async fn build_transport(
9226        conf: gaxi::options::ClientConfig,
9227    ) -> crate::ClientBuilderResult<impl super::stub::PacketMirrorings> {
9228        super::transport::PacketMirrorings::new(conf).await
9229    }
9230
9231    async fn build_with_tracing(
9232        conf: gaxi::options::ClientConfig,
9233    ) -> crate::ClientBuilderResult<impl super::stub::PacketMirrorings> {
9234        Self::build_transport(conf)
9235            .await
9236            .map(super::tracing::PacketMirrorings::new)
9237    }
9238
9239    /// Retrieves an aggregated list of packetMirrorings.
9240    ///
9241    /// To prevent failure, Google recommends that you set the
9242    /// `returnPartialSuccess` parameter to `true`.
9243    pub fn aggregated_list(&self) -> super::builder::packet_mirrorings::AggregatedList {
9244        super::builder::packet_mirrorings::AggregatedList::new(self.inner.clone())
9245    }
9246
9247    /// Deletes the specified PacketMirroring resource.
9248    pub fn delete(&self) -> super::builder::packet_mirrorings::Delete {
9249        super::builder::packet_mirrorings::Delete::new(self.inner.clone())
9250    }
9251
9252    /// Returns the specified PacketMirroring resource.
9253    pub fn get(&self) -> super::builder::packet_mirrorings::Get {
9254        super::builder::packet_mirrorings::Get::new(self.inner.clone())
9255    }
9256
9257    /// Creates a PacketMirroring resource in the specified project and region
9258    /// using the data included in the request.
9259    pub fn insert(&self) -> super::builder::packet_mirrorings::Insert {
9260        super::builder::packet_mirrorings::Insert::new(self.inner.clone())
9261    }
9262
9263    /// Retrieves a list of PacketMirroring resources available to the specified
9264    /// project and region.
9265    pub fn list(&self) -> super::builder::packet_mirrorings::List {
9266        super::builder::packet_mirrorings::List::new(self.inner.clone())
9267    }
9268
9269    /// Patches the specified PacketMirroring resource with the data included in
9270    /// the request. This method supportsPATCH
9271    /// semantics and usesJSON merge
9272    /// patch format and processing rules.
9273    pub fn patch(&self) -> super::builder::packet_mirrorings::Patch {
9274        super::builder::packet_mirrorings::Patch::new(self.inner.clone())
9275    }
9276
9277    /// Returns permissions that a caller has on the specified resource.
9278    pub fn test_iam_permissions(&self) -> super::builder::packet_mirrorings::TestIamPermissions {
9279        super::builder::packet_mirrorings::TestIamPermissions::new(self.inner.clone())
9280    }
9281
9282    /// Retrieves the specified region-specific Operations resource.
9283    pub fn get_operation(&self) -> super::builder::packet_mirrorings::GetOperation {
9284        super::builder::packet_mirrorings::GetOperation::new(self.inner.clone())
9285    }
9286}
9287
9288/// Implements a client for the Google Compute Engine API.
9289///
9290/// # Example
9291/// ```
9292/// # use google_cloud_compute_v1::client::PreviewFeatures;
9293/// async fn sample(
9294/// ) -> anyhow::Result<()> {
9295///     let client = PreviewFeatures::builder().build().await?;
9296///     // use `client` to make requests to the Google Compute Engine API.
9297///     Ok(())
9298/// }
9299/// ```
9300///
9301/// # Service Description
9302///
9303/// Service for the `previewFeatures` resource.
9304///
9305/// # Configuration
9306///
9307/// To configure `PreviewFeatures` use the `with_*` methods in the type returned
9308/// by [builder()][PreviewFeatures::builder]. The default configuration should
9309/// work for most applications. Common configuration changes include
9310///
9311/// * [with_endpoint()]: by default this client uses the global default endpoint
9312///   (`https://compute.googleapis.com`). Applications using regional
9313///   endpoints or running in restricted networks (e.g. a network configured
9314//    with [Private Google Access with VPC Service Controls]) may want to
9315///   override this default.
9316/// * [with_credentials()]: by default this client uses
9317///   [Application Default Credentials]. Applications using custom
9318///   authentication may need to override this default.
9319///
9320/// [with_endpoint()]: super::builder::preview_features::ClientBuilder::with_endpoint
9321/// [with_credentials()]: super::builder::preview_features::ClientBuilder::with_credentials
9322/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9323/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9324///
9325/// # Pooling and Cloning
9326///
9327/// `PreviewFeatures` holds a connection pool internally, it is advised to
9328/// create one and reuse it. You do not need to wrap `PreviewFeatures` in
9329/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9330/// already uses an `Arc` internally.
9331#[cfg(feature = "preview-features")]
9332#[cfg_attr(docsrs, doc(cfg(feature = "preview-features")))]
9333#[derive(Clone, Debug)]
9334pub struct PreviewFeatures {
9335    inner: std::sync::Arc<dyn super::stub::dynamic::PreviewFeatures>,
9336}
9337
9338#[cfg(feature = "preview-features")]
9339impl PreviewFeatures {
9340    /// Returns a builder for [PreviewFeatures].
9341    ///
9342    /// ```
9343    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9344    /// # use google_cloud_compute_v1::client::PreviewFeatures;
9345    /// let client = PreviewFeatures::builder().build().await?;
9346    /// # Ok(()) }
9347    /// ```
9348    pub fn builder() -> super::builder::preview_features::ClientBuilder {
9349        crate::new_client_builder(super::builder::preview_features::client::Factory)
9350    }
9351
9352    /// Creates a new client from the provided stub.
9353    ///
9354    /// The most common case for calling this function is in tests mocking the
9355    /// client's behavior.
9356    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
9357    where
9358        T: super::stub::PreviewFeatures + 'static,
9359    {
9360        Self { inner: stub.into() }
9361    }
9362
9363    pub(crate) async fn new(
9364        config: gaxi::options::ClientConfig,
9365    ) -> crate::ClientBuilderResult<Self> {
9366        let inner = Self::build_inner(config).await?;
9367        Ok(Self { inner })
9368    }
9369
9370    async fn build_inner(
9371        conf: gaxi::options::ClientConfig,
9372    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::PreviewFeatures>> {
9373        if gaxi::options::tracing_enabled(&conf) {
9374            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9375        }
9376        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9377    }
9378
9379    async fn build_transport(
9380        conf: gaxi::options::ClientConfig,
9381    ) -> crate::ClientBuilderResult<impl super::stub::PreviewFeatures> {
9382        super::transport::PreviewFeatures::new(conf).await
9383    }
9384
9385    async fn build_with_tracing(
9386        conf: gaxi::options::ClientConfig,
9387    ) -> crate::ClientBuilderResult<impl super::stub::PreviewFeatures> {
9388        Self::build_transport(conf)
9389            .await
9390            .map(super::tracing::PreviewFeatures::new)
9391    }
9392
9393    /// Returns the details of the given PreviewFeature.
9394    pub fn get(&self) -> super::builder::preview_features::Get {
9395        super::builder::preview_features::Get::new(self.inner.clone())
9396    }
9397
9398    /// Returns the details of the given PreviewFeature.
9399    pub fn list(&self) -> super::builder::preview_features::List {
9400        super::builder::preview_features::List::new(self.inner.clone())
9401    }
9402
9403    /// Patches the given PreviewFeature. This method is used to enable or disable
9404    /// a PreviewFeature.
9405    pub fn update(&self) -> super::builder::preview_features::Update {
9406        super::builder::preview_features::Update::new(self.inner.clone())
9407    }
9408
9409    /// Retrieves the specified Operations resource.
9410    pub fn get_operation(&self) -> super::builder::preview_features::GetOperation {
9411        super::builder::preview_features::GetOperation::new(self.inner.clone())
9412    }
9413}
9414
9415/// Implements a client for the Google Compute Engine API.
9416///
9417/// # Example
9418/// ```
9419/// # use google_cloud_compute_v1::client::Projects;
9420/// async fn sample(
9421/// ) -> anyhow::Result<()> {
9422///     let client = Projects::builder().build().await?;
9423///     // use `client` to make requests to the Google Compute Engine API.
9424///     Ok(())
9425/// }
9426/// ```
9427///
9428/// # Service Description
9429///
9430/// Service for the `projects` resource.
9431///
9432/// # Configuration
9433///
9434/// To configure `Projects` use the `with_*` methods in the type returned
9435/// by [builder()][Projects::builder]. The default configuration should
9436/// work for most applications. Common configuration changes include
9437///
9438/// * [with_endpoint()]: by default this client uses the global default endpoint
9439///   (`https://compute.googleapis.com`). Applications using regional
9440///   endpoints or running in restricted networks (e.g. a network configured
9441//    with [Private Google Access with VPC Service Controls]) may want to
9442///   override this default.
9443/// * [with_credentials()]: by default this client uses
9444///   [Application Default Credentials]. Applications using custom
9445///   authentication may need to override this default.
9446///
9447/// [with_endpoint()]: super::builder::projects::ClientBuilder::with_endpoint
9448/// [with_credentials()]: super::builder::projects::ClientBuilder::with_credentials
9449/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9450/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9451///
9452/// # Pooling and Cloning
9453///
9454/// `Projects` holds a connection pool internally, it is advised to
9455/// create one and reuse it. You do not need to wrap `Projects` in
9456/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9457/// already uses an `Arc` internally.
9458#[cfg(feature = "projects")]
9459#[cfg_attr(docsrs, doc(cfg(feature = "projects")))]
9460#[derive(Clone, Debug)]
9461pub struct Projects {
9462    inner: std::sync::Arc<dyn super::stub::dynamic::Projects>,
9463}
9464
9465#[cfg(feature = "projects")]
9466impl Projects {
9467    /// Returns a builder for [Projects].
9468    ///
9469    /// ```
9470    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9471    /// # use google_cloud_compute_v1::client::Projects;
9472    /// let client = Projects::builder().build().await?;
9473    /// # Ok(()) }
9474    /// ```
9475    pub fn builder() -> super::builder::projects::ClientBuilder {
9476        crate::new_client_builder(super::builder::projects::client::Factory)
9477    }
9478
9479    /// Creates a new client from the provided stub.
9480    ///
9481    /// The most common case for calling this function is in tests mocking the
9482    /// client's behavior.
9483    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
9484    where
9485        T: super::stub::Projects + 'static,
9486    {
9487        Self { inner: stub.into() }
9488    }
9489
9490    pub(crate) async fn new(
9491        config: gaxi::options::ClientConfig,
9492    ) -> crate::ClientBuilderResult<Self> {
9493        let inner = Self::build_inner(config).await?;
9494        Ok(Self { inner })
9495    }
9496
9497    async fn build_inner(
9498        conf: gaxi::options::ClientConfig,
9499    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Projects>> {
9500        if gaxi::options::tracing_enabled(&conf) {
9501            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9502        }
9503        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9504    }
9505
9506    async fn build_transport(
9507        conf: gaxi::options::ClientConfig,
9508    ) -> crate::ClientBuilderResult<impl super::stub::Projects> {
9509        super::transport::Projects::new(conf).await
9510    }
9511
9512    async fn build_with_tracing(
9513        conf: gaxi::options::ClientConfig,
9514    ) -> crate::ClientBuilderResult<impl super::stub::Projects> {
9515        Self::build_transport(conf)
9516            .await
9517            .map(super::tracing::Projects::new)
9518    }
9519
9520    /// Disable this project as a shared VPC host project.
9521    pub fn disable_xpn_host(&self) -> super::builder::projects::DisableXpnHost {
9522        super::builder::projects::DisableXpnHost::new(self.inner.clone())
9523    }
9524
9525    /// Disable a service resource (also known as service project) associated with
9526    /// this host project.
9527    pub fn disable_xpn_resource(&self) -> super::builder::projects::DisableXpnResource {
9528        super::builder::projects::DisableXpnResource::new(self.inner.clone())
9529    }
9530
9531    /// Enable this project as a shared VPC host project.
9532    pub fn enable_xpn_host(&self) -> super::builder::projects::EnableXpnHost {
9533        super::builder::projects::EnableXpnHost::new(self.inner.clone())
9534    }
9535
9536    /// Enable service resource (a.k.a service project) for a host project, so that
9537    /// subnets in the host project can be used by instances in the service
9538    /// project.
9539    pub fn enable_xpn_resource(&self) -> super::builder::projects::EnableXpnResource {
9540        super::builder::projects::EnableXpnResource::new(self.inner.clone())
9541    }
9542
9543    /// Returns the specified Project resource.
9544    ///
9545    /// To decrease latency for this method, you can optionally omit any unneeded
9546    /// information from the response by using a field mask. This practice is
9547    /// especially recommended for unused quota information (the `quotas` field).
9548    /// To exclude one or more fields, set your request's `fields` query parameter
9549    /// to only include the fields you need. For example, to only include the `id`
9550    /// and `selfLink` fields, add the query parameter `?fields=id,selfLink` to
9551    /// your request.
9552    pub fn get(&self) -> super::builder::projects::Get {
9553        super::builder::projects::Get::new(self.inner.clone())
9554    }
9555
9556    /// Gets the shared VPC host project that this project links to. May be empty
9557    /// if no link exists.
9558    pub fn get_xpn_host(&self) -> super::builder::projects::GetXpnHost {
9559        super::builder::projects::GetXpnHost::new(self.inner.clone())
9560    }
9561
9562    /// Gets service resources (a.k.a service project) associated with this host
9563    /// project.
9564    pub fn get_xpn_resources(&self) -> super::builder::projects::GetXpnResources {
9565        super::builder::projects::GetXpnResources::new(self.inner.clone())
9566    }
9567
9568    /// Lists all shared VPC host projects visible to the user in an organization.
9569    pub fn list_xpn_hosts(&self) -> super::builder::projects::ListXpnHosts {
9570        super::builder::projects::ListXpnHosts::new(self.inner.clone())
9571    }
9572
9573    /// Moves a persistent disk from one zone to another.
9574    /// *Note*: The moveDisk API will be deprecated on September 29, 2026.
9575    ///
9576    /// Starting September 29, 2025, you can't use the moveDisk API on new
9577    /// projects. To move a disk to a different region or zone, follow the steps in
9578    /// [Change the location of a
9579    /// disk](https://cloud.google.com/compute/docs/disks/migrate-to-hyperdisk#migrate-to-hd).
9580    ///
9581    /// Projects that already use the moveDisk API can continue usage until
9582    /// September 29, 2026.
9583    ///
9584    /// Starting November 1, 2025, API responses will include a warning message in
9585    /// the response body about the upcoming deprecation. You can skip the message
9586    /// to continue using the service without interruption.
9587    #[deprecated]
9588    pub fn move_disk(&self) -> super::builder::projects::MoveDisk {
9589        super::builder::projects::MoveDisk::new(self.inner.clone())
9590    }
9591
9592    /// Moves an instance and its attached persistent disks from one zone to
9593    /// another.
9594    /// *Note*: Moving VMs or disks by using this method might
9595    /// cause unexpected behavior. For more information, see the [known
9596    /// issue](/compute/docs/troubleshooting/known-issues#moving_vms_or_disks_using_the_moveinstance_api_or_the_causes_unexpected_behavior).
9597    /// [Deprecated] This method is deprecated. See [moving instance across
9598    /// zones](/compute/docs/instances/moving-instance-across-zones) instead.
9599    #[deprecated]
9600    pub fn move_instance(&self) -> super::builder::projects::MoveInstance {
9601        super::builder::projects::MoveInstance::new(self.inner.clone())
9602    }
9603
9604    /// Sets the Cloud Armor tier of the project. To set ENTERPRISE or above the
9605    /// billing account of the project must be subscribed to Cloud Armor
9606    /// Enterprise. See Subscribing
9607    /// to Cloud Armor Enterprise for more information.
9608    pub fn set_cloud_armor_tier(&self) -> super::builder::projects::SetCloudArmorTier {
9609        super::builder::projects::SetCloudArmorTier::new(self.inner.clone())
9610    }
9611
9612    /// Sets metadata common to all instances within the specified project using
9613    /// the data included in the request.
9614    pub fn set_common_instance_metadata(
9615        &self,
9616    ) -> super::builder::projects::SetCommonInstanceMetadata {
9617        super::builder::projects::SetCommonInstanceMetadata::new(self.inner.clone())
9618    }
9619
9620    /// Sets the default network tier of the project. The default network tier is
9621    /// used when an address/forwardingRule/instance is created without specifying
9622    /// the network tier field.
9623    pub fn set_default_network_tier(&self) -> super::builder::projects::SetDefaultNetworkTier {
9624        super::builder::projects::SetDefaultNetworkTier::new(self.inner.clone())
9625    }
9626
9627    /// Enables the usage export feature and sets theusage export bucket
9628    /// where reports are stored. If you provide an empty request body using this
9629    /// method, the usage export feature will be disabled.
9630    pub fn set_usage_export_bucket(&self) -> super::builder::projects::SetUsageExportBucket {
9631        super::builder::projects::SetUsageExportBucket::new(self.inner.clone())
9632    }
9633
9634    /// Retrieves the specified Operations resource.
9635    pub fn get_operation(&self) -> super::builder::projects::GetOperation {
9636        super::builder::projects::GetOperation::new(self.inner.clone())
9637    }
9638}
9639
9640/// Implements a client for the Google Compute Engine API.
9641///
9642/// # Example
9643/// ```
9644/// # use google_cloud_compute_v1::client::PublicAdvertisedPrefixes;
9645/// async fn sample(
9646/// ) -> anyhow::Result<()> {
9647///     let client = PublicAdvertisedPrefixes::builder().build().await?;
9648///     // use `client` to make requests to the Google Compute Engine API.
9649///     Ok(())
9650/// }
9651/// ```
9652///
9653/// # Service Description
9654///
9655/// Service for the `publicAdvertisedPrefixes` resource.
9656///
9657/// # Configuration
9658///
9659/// To configure `PublicAdvertisedPrefixes` use the `with_*` methods in the type returned
9660/// by [builder()][PublicAdvertisedPrefixes::builder]. The default configuration should
9661/// work for most applications. Common configuration changes include
9662///
9663/// * [with_endpoint()]: by default this client uses the global default endpoint
9664///   (`https://compute.googleapis.com`). Applications using regional
9665///   endpoints or running in restricted networks (e.g. a network configured
9666//    with [Private Google Access with VPC Service Controls]) may want to
9667///   override this default.
9668/// * [with_credentials()]: by default this client uses
9669///   [Application Default Credentials]. Applications using custom
9670///   authentication may need to override this default.
9671///
9672/// [with_endpoint()]: super::builder::public_advertised_prefixes::ClientBuilder::with_endpoint
9673/// [with_credentials()]: super::builder::public_advertised_prefixes::ClientBuilder::with_credentials
9674/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9675/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9676///
9677/// # Pooling and Cloning
9678///
9679/// `PublicAdvertisedPrefixes` holds a connection pool internally, it is advised to
9680/// create one and reuse it. You do not need to wrap `PublicAdvertisedPrefixes` in
9681/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9682/// already uses an `Arc` internally.
9683#[cfg(feature = "public-advertised-prefixes")]
9684#[cfg_attr(docsrs, doc(cfg(feature = "public-advertised-prefixes")))]
9685#[derive(Clone, Debug)]
9686pub struct PublicAdvertisedPrefixes {
9687    inner: std::sync::Arc<dyn super::stub::dynamic::PublicAdvertisedPrefixes>,
9688}
9689
9690#[cfg(feature = "public-advertised-prefixes")]
9691impl PublicAdvertisedPrefixes {
9692    /// Returns a builder for [PublicAdvertisedPrefixes].
9693    ///
9694    /// ```
9695    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9696    /// # use google_cloud_compute_v1::client::PublicAdvertisedPrefixes;
9697    /// let client = PublicAdvertisedPrefixes::builder().build().await?;
9698    /// # Ok(()) }
9699    /// ```
9700    pub fn builder() -> super::builder::public_advertised_prefixes::ClientBuilder {
9701        crate::new_client_builder(super::builder::public_advertised_prefixes::client::Factory)
9702    }
9703
9704    /// Creates a new client from the provided stub.
9705    ///
9706    /// The most common case for calling this function is in tests mocking the
9707    /// client's behavior.
9708    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
9709    where
9710        T: super::stub::PublicAdvertisedPrefixes + 'static,
9711    {
9712        Self { inner: stub.into() }
9713    }
9714
9715    pub(crate) async fn new(
9716        config: gaxi::options::ClientConfig,
9717    ) -> crate::ClientBuilderResult<Self> {
9718        let inner = Self::build_inner(config).await?;
9719        Ok(Self { inner })
9720    }
9721
9722    async fn build_inner(
9723        conf: gaxi::options::ClientConfig,
9724    ) -> crate::ClientBuilderResult<
9725        std::sync::Arc<dyn super::stub::dynamic::PublicAdvertisedPrefixes>,
9726    > {
9727        if gaxi::options::tracing_enabled(&conf) {
9728            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9729        }
9730        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9731    }
9732
9733    async fn build_transport(
9734        conf: gaxi::options::ClientConfig,
9735    ) -> crate::ClientBuilderResult<impl super::stub::PublicAdvertisedPrefixes> {
9736        super::transport::PublicAdvertisedPrefixes::new(conf).await
9737    }
9738
9739    async fn build_with_tracing(
9740        conf: gaxi::options::ClientConfig,
9741    ) -> crate::ClientBuilderResult<impl super::stub::PublicAdvertisedPrefixes> {
9742        Self::build_transport(conf)
9743            .await
9744            .map(super::tracing::PublicAdvertisedPrefixes::new)
9745    }
9746
9747    /// Announces the specified PublicAdvertisedPrefix
9748    pub fn announce(&self) -> super::builder::public_advertised_prefixes::Announce {
9749        super::builder::public_advertised_prefixes::Announce::new(self.inner.clone())
9750    }
9751
9752    /// Deletes the specified PublicAdvertisedPrefix
9753    pub fn delete(&self) -> super::builder::public_advertised_prefixes::Delete {
9754        super::builder::public_advertised_prefixes::Delete::new(self.inner.clone())
9755    }
9756
9757    /// Returns the specified PublicAdvertisedPrefix resource.
9758    pub fn get(&self) -> super::builder::public_advertised_prefixes::Get {
9759        super::builder::public_advertised_prefixes::Get::new(self.inner.clone())
9760    }
9761
9762    /// Creates a PublicAdvertisedPrefix in the specified project
9763    /// using the parameters that are included in the request.
9764    pub fn insert(&self) -> super::builder::public_advertised_prefixes::Insert {
9765        super::builder::public_advertised_prefixes::Insert::new(self.inner.clone())
9766    }
9767
9768    /// Lists the PublicAdvertisedPrefixes for a project.
9769    pub fn list(&self) -> super::builder::public_advertised_prefixes::List {
9770        super::builder::public_advertised_prefixes::List::new(self.inner.clone())
9771    }
9772
9773    /// Patches the specified Router resource with the data included in the
9774    /// request. This method supportsPATCH
9775    /// semantics and usesJSON merge
9776    /// patch format and processing rules.
9777    pub fn patch(&self) -> super::builder::public_advertised_prefixes::Patch {
9778        super::builder::public_advertised_prefixes::Patch::new(self.inner.clone())
9779    }
9780
9781    /// Withdraws the specified PublicAdvertisedPrefix
9782    pub fn withdraw(&self) -> super::builder::public_advertised_prefixes::Withdraw {
9783        super::builder::public_advertised_prefixes::Withdraw::new(self.inner.clone())
9784    }
9785
9786    /// Retrieves the specified Operations resource.
9787    pub fn get_operation(&self) -> super::builder::public_advertised_prefixes::GetOperation {
9788        super::builder::public_advertised_prefixes::GetOperation::new(self.inner.clone())
9789    }
9790}
9791
9792/// Implements a client for the Google Compute Engine API.
9793///
9794/// # Example
9795/// ```
9796/// # use google_cloud_compute_v1::client::PublicDelegatedPrefixes;
9797/// async fn sample(
9798/// ) -> anyhow::Result<()> {
9799///     let client = PublicDelegatedPrefixes::builder().build().await?;
9800///     // use `client` to make requests to the Google Compute Engine API.
9801///     Ok(())
9802/// }
9803/// ```
9804///
9805/// # Service Description
9806///
9807/// Service for the `publicDelegatedPrefixes` resource.
9808///
9809/// # Configuration
9810///
9811/// To configure `PublicDelegatedPrefixes` use the `with_*` methods in the type returned
9812/// by [builder()][PublicDelegatedPrefixes::builder]. The default configuration should
9813/// work for most applications. Common configuration changes include
9814///
9815/// * [with_endpoint()]: by default this client uses the global default endpoint
9816///   (`https://compute.googleapis.com`). Applications using regional
9817///   endpoints or running in restricted networks (e.g. a network configured
9818//    with [Private Google Access with VPC Service Controls]) may want to
9819///   override this default.
9820/// * [with_credentials()]: by default this client uses
9821///   [Application Default Credentials]. Applications using custom
9822///   authentication may need to override this default.
9823///
9824/// [with_endpoint()]: super::builder::public_delegated_prefixes::ClientBuilder::with_endpoint
9825/// [with_credentials()]: super::builder::public_delegated_prefixes::ClientBuilder::with_credentials
9826/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9827/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9828///
9829/// # Pooling and Cloning
9830///
9831/// `PublicDelegatedPrefixes` holds a connection pool internally, it is advised to
9832/// create one and reuse it. You do not need to wrap `PublicDelegatedPrefixes` in
9833/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9834/// already uses an `Arc` internally.
9835#[cfg(feature = "public-delegated-prefixes")]
9836#[cfg_attr(docsrs, doc(cfg(feature = "public-delegated-prefixes")))]
9837#[derive(Clone, Debug)]
9838pub struct PublicDelegatedPrefixes {
9839    inner: std::sync::Arc<dyn super::stub::dynamic::PublicDelegatedPrefixes>,
9840}
9841
9842#[cfg(feature = "public-delegated-prefixes")]
9843impl PublicDelegatedPrefixes {
9844    /// Returns a builder for [PublicDelegatedPrefixes].
9845    ///
9846    /// ```
9847    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9848    /// # use google_cloud_compute_v1::client::PublicDelegatedPrefixes;
9849    /// let client = PublicDelegatedPrefixes::builder().build().await?;
9850    /// # Ok(()) }
9851    /// ```
9852    pub fn builder() -> super::builder::public_delegated_prefixes::ClientBuilder {
9853        crate::new_client_builder(super::builder::public_delegated_prefixes::client::Factory)
9854    }
9855
9856    /// Creates a new client from the provided stub.
9857    ///
9858    /// The most common case for calling this function is in tests mocking the
9859    /// client's behavior.
9860    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
9861    where
9862        T: super::stub::PublicDelegatedPrefixes + 'static,
9863    {
9864        Self { inner: stub.into() }
9865    }
9866
9867    pub(crate) async fn new(
9868        config: gaxi::options::ClientConfig,
9869    ) -> crate::ClientBuilderResult<Self> {
9870        let inner = Self::build_inner(config).await?;
9871        Ok(Self { inner })
9872    }
9873
9874    async fn build_inner(
9875        conf: gaxi::options::ClientConfig,
9876    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::PublicDelegatedPrefixes>>
9877    {
9878        if gaxi::options::tracing_enabled(&conf) {
9879            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9880        }
9881        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9882    }
9883
9884    async fn build_transport(
9885        conf: gaxi::options::ClientConfig,
9886    ) -> crate::ClientBuilderResult<impl super::stub::PublicDelegatedPrefixes> {
9887        super::transport::PublicDelegatedPrefixes::new(conf).await
9888    }
9889
9890    async fn build_with_tracing(
9891        conf: gaxi::options::ClientConfig,
9892    ) -> crate::ClientBuilderResult<impl super::stub::PublicDelegatedPrefixes> {
9893        Self::build_transport(conf)
9894            .await
9895            .map(super::tracing::PublicDelegatedPrefixes::new)
9896    }
9897
9898    /// Lists all PublicDelegatedPrefix resources owned by the specific project
9899    /// across all scopes.
9900    ///
9901    /// To prevent failure, Google recommends that you set the
9902    /// `returnPartialSuccess` parameter to `true`.
9903    pub fn aggregated_list(&self) -> super::builder::public_delegated_prefixes::AggregatedList {
9904        super::builder::public_delegated_prefixes::AggregatedList::new(self.inner.clone())
9905    }
9906
9907    /// Announces the specified PublicDelegatedPrefix in the given region.
9908    pub fn announce(&self) -> super::builder::public_delegated_prefixes::Announce {
9909        super::builder::public_delegated_prefixes::Announce::new(self.inner.clone())
9910    }
9911
9912    /// Deletes the specified PublicDelegatedPrefix in the given region.
9913    pub fn delete(&self) -> super::builder::public_delegated_prefixes::Delete {
9914        super::builder::public_delegated_prefixes::Delete::new(self.inner.clone())
9915    }
9916
9917    /// Returns the specified PublicDelegatedPrefix resource in the given region.
9918    pub fn get(&self) -> super::builder::public_delegated_prefixes::Get {
9919        super::builder::public_delegated_prefixes::Get::new(self.inner.clone())
9920    }
9921
9922    /// Creates a PublicDelegatedPrefix in the specified project in the given
9923    /// region using the parameters that are included in the request.
9924    pub fn insert(&self) -> super::builder::public_delegated_prefixes::Insert {
9925        super::builder::public_delegated_prefixes::Insert::new(self.inner.clone())
9926    }
9927
9928    /// Lists the PublicDelegatedPrefixes for a project in the given region.
9929    pub fn list(&self) -> super::builder::public_delegated_prefixes::List {
9930        super::builder::public_delegated_prefixes::List::new(self.inner.clone())
9931    }
9932
9933    /// Patches the specified PublicDelegatedPrefix resource with the data included
9934    /// in the request. This method supportsPATCH
9935    /// semantics and usesJSON merge
9936    /// patch format and processing rules.
9937    pub fn patch(&self) -> super::builder::public_delegated_prefixes::Patch {
9938        super::builder::public_delegated_prefixes::Patch::new(self.inner.clone())
9939    }
9940
9941    /// Withdraws the specified PublicDelegatedPrefix in the given region.
9942    pub fn withdraw(&self) -> super::builder::public_delegated_prefixes::Withdraw {
9943        super::builder::public_delegated_prefixes::Withdraw::new(self.inner.clone())
9944    }
9945
9946    /// Retrieves the specified region-specific Operations resource.
9947    pub fn get_operation(&self) -> super::builder::public_delegated_prefixes::GetOperation {
9948        super::builder::public_delegated_prefixes::GetOperation::new(self.inner.clone())
9949    }
9950}
9951
9952/// Implements a client for the Google Compute Engine API.
9953///
9954/// # Example
9955/// ```
9956/// # use google_cloud_compute_v1::client::RegionAutoscalers;
9957/// async fn sample(
9958/// ) -> anyhow::Result<()> {
9959///     let client = RegionAutoscalers::builder().build().await?;
9960///     // use `client` to make requests to the Google Compute Engine API.
9961///     Ok(())
9962/// }
9963/// ```
9964///
9965/// # Service Description
9966///
9967/// Service for the `regionAutoscalers` resource.
9968///
9969/// # Configuration
9970///
9971/// To configure `RegionAutoscalers` use the `with_*` methods in the type returned
9972/// by [builder()][RegionAutoscalers::builder]. The default configuration should
9973/// work for most applications. Common configuration changes include
9974///
9975/// * [with_endpoint()]: by default this client uses the global default endpoint
9976///   (`https://compute.googleapis.com`). Applications using regional
9977///   endpoints or running in restricted networks (e.g. a network configured
9978//    with [Private Google Access with VPC Service Controls]) may want to
9979///   override this default.
9980/// * [with_credentials()]: by default this client uses
9981///   [Application Default Credentials]. Applications using custom
9982///   authentication may need to override this default.
9983///
9984/// [with_endpoint()]: super::builder::region_autoscalers::ClientBuilder::with_endpoint
9985/// [with_credentials()]: super::builder::region_autoscalers::ClientBuilder::with_credentials
9986/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9987/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9988///
9989/// # Pooling and Cloning
9990///
9991/// `RegionAutoscalers` holds a connection pool internally, it is advised to
9992/// create one and reuse it. You do not need to wrap `RegionAutoscalers` in
9993/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9994/// already uses an `Arc` internally.
9995#[cfg(feature = "region-autoscalers")]
9996#[cfg_attr(docsrs, doc(cfg(feature = "region-autoscalers")))]
9997#[derive(Clone, Debug)]
9998pub struct RegionAutoscalers {
9999    inner: std::sync::Arc<dyn super::stub::dynamic::RegionAutoscalers>,
10000}
10001
10002#[cfg(feature = "region-autoscalers")]
10003impl RegionAutoscalers {
10004    /// Returns a builder for [RegionAutoscalers].
10005    ///
10006    /// ```
10007    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10008    /// # use google_cloud_compute_v1::client::RegionAutoscalers;
10009    /// let client = RegionAutoscalers::builder().build().await?;
10010    /// # Ok(()) }
10011    /// ```
10012    pub fn builder() -> super::builder::region_autoscalers::ClientBuilder {
10013        crate::new_client_builder(super::builder::region_autoscalers::client::Factory)
10014    }
10015
10016    /// Creates a new client from the provided stub.
10017    ///
10018    /// The most common case for calling this function is in tests mocking the
10019    /// client's behavior.
10020    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
10021    where
10022        T: super::stub::RegionAutoscalers + 'static,
10023    {
10024        Self { inner: stub.into() }
10025    }
10026
10027    pub(crate) async fn new(
10028        config: gaxi::options::ClientConfig,
10029    ) -> crate::ClientBuilderResult<Self> {
10030        let inner = Self::build_inner(config).await?;
10031        Ok(Self { inner })
10032    }
10033
10034    async fn build_inner(
10035        conf: gaxi::options::ClientConfig,
10036    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionAutoscalers>>
10037    {
10038        if gaxi::options::tracing_enabled(&conf) {
10039            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10040        }
10041        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10042    }
10043
10044    async fn build_transport(
10045        conf: gaxi::options::ClientConfig,
10046    ) -> crate::ClientBuilderResult<impl super::stub::RegionAutoscalers> {
10047        super::transport::RegionAutoscalers::new(conf).await
10048    }
10049
10050    async fn build_with_tracing(
10051        conf: gaxi::options::ClientConfig,
10052    ) -> crate::ClientBuilderResult<impl super::stub::RegionAutoscalers> {
10053        Self::build_transport(conf)
10054            .await
10055            .map(super::tracing::RegionAutoscalers::new)
10056    }
10057
10058    /// Deletes the specified autoscaler.
10059    pub fn delete(&self) -> super::builder::region_autoscalers::Delete {
10060        super::builder::region_autoscalers::Delete::new(self.inner.clone())
10061    }
10062
10063    /// Returns the specified autoscaler.
10064    pub fn get(&self) -> super::builder::region_autoscalers::Get {
10065        super::builder::region_autoscalers::Get::new(self.inner.clone())
10066    }
10067
10068    /// Creates an autoscaler in the specified project using
10069    /// the data included in the request.
10070    pub fn insert(&self) -> super::builder::region_autoscalers::Insert {
10071        super::builder::region_autoscalers::Insert::new(self.inner.clone())
10072    }
10073
10074    /// Retrieves a list of autoscalers contained within
10075    /// the specified region.
10076    pub fn list(&self) -> super::builder::region_autoscalers::List {
10077        super::builder::region_autoscalers::List::new(self.inner.clone())
10078    }
10079
10080    /// Updates an autoscaler in the specified project using
10081    /// the data included in the request. This method supportsPATCH
10082    /// semantics and uses theJSON merge
10083    /// patch format and processing rules.
10084    pub fn patch(&self) -> super::builder::region_autoscalers::Patch {
10085        super::builder::region_autoscalers::Patch::new(self.inner.clone())
10086    }
10087
10088    /// Returns permissions that a caller has on the specified resource.
10089    pub fn test_iam_permissions(&self) -> super::builder::region_autoscalers::TestIamPermissions {
10090        super::builder::region_autoscalers::TestIamPermissions::new(self.inner.clone())
10091    }
10092
10093    /// Updates an autoscaler in the specified project using
10094    /// the data included in the request.
10095    pub fn update(&self) -> super::builder::region_autoscalers::Update {
10096        super::builder::region_autoscalers::Update::new(self.inner.clone())
10097    }
10098
10099    /// Retrieves the specified region-specific Operations resource.
10100    pub fn get_operation(&self) -> super::builder::region_autoscalers::GetOperation {
10101        super::builder::region_autoscalers::GetOperation::new(self.inner.clone())
10102    }
10103}
10104
10105/// Implements a client for the Google Compute Engine API.
10106///
10107/// # Example
10108/// ```
10109/// # use google_cloud_compute_v1::client::RegionBackendBuckets;
10110/// async fn sample(
10111/// ) -> anyhow::Result<()> {
10112///     let client = RegionBackendBuckets::builder().build().await?;
10113///     // use `client` to make requests to the Google Compute Engine API.
10114///     Ok(())
10115/// }
10116/// ```
10117///
10118/// # Service Description
10119///
10120/// Service for the `regionBackendBuckets` resource.
10121///
10122/// # Configuration
10123///
10124/// To configure `RegionBackendBuckets` use the `with_*` methods in the type returned
10125/// by [builder()][RegionBackendBuckets::builder]. The default configuration should
10126/// work for most applications. Common configuration changes include
10127///
10128/// * [with_endpoint()]: by default this client uses the global default endpoint
10129///   (`https://compute.googleapis.com`). Applications using regional
10130///   endpoints or running in restricted networks (e.g. a network configured
10131//    with [Private Google Access with VPC Service Controls]) may want to
10132///   override this default.
10133/// * [with_credentials()]: by default this client uses
10134///   [Application Default Credentials]. Applications using custom
10135///   authentication may need to override this default.
10136///
10137/// [with_endpoint()]: super::builder::region_backend_buckets::ClientBuilder::with_endpoint
10138/// [with_credentials()]: super::builder::region_backend_buckets::ClientBuilder::with_credentials
10139/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10140/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10141///
10142/// # Pooling and Cloning
10143///
10144/// `RegionBackendBuckets` holds a connection pool internally, it is advised to
10145/// create one and reuse it. You do not need to wrap `RegionBackendBuckets` in
10146/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10147/// already uses an `Arc` internally.
10148#[cfg(feature = "region-backend-buckets")]
10149#[cfg_attr(docsrs, doc(cfg(feature = "region-backend-buckets")))]
10150#[derive(Clone, Debug)]
10151pub struct RegionBackendBuckets {
10152    inner: std::sync::Arc<dyn super::stub::dynamic::RegionBackendBuckets>,
10153}
10154
10155#[cfg(feature = "region-backend-buckets")]
10156impl RegionBackendBuckets {
10157    /// Returns a builder for [RegionBackendBuckets].
10158    ///
10159    /// ```
10160    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10161    /// # use google_cloud_compute_v1::client::RegionBackendBuckets;
10162    /// let client = RegionBackendBuckets::builder().build().await?;
10163    /// # Ok(()) }
10164    /// ```
10165    pub fn builder() -> super::builder::region_backend_buckets::ClientBuilder {
10166        crate::new_client_builder(super::builder::region_backend_buckets::client::Factory)
10167    }
10168
10169    /// Creates a new client from the provided stub.
10170    ///
10171    /// The most common case for calling this function is in tests mocking the
10172    /// client's behavior.
10173    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
10174    where
10175        T: super::stub::RegionBackendBuckets + 'static,
10176    {
10177        Self { inner: stub.into() }
10178    }
10179
10180    pub(crate) async fn new(
10181        config: gaxi::options::ClientConfig,
10182    ) -> crate::ClientBuilderResult<Self> {
10183        let inner = Self::build_inner(config).await?;
10184        Ok(Self { inner })
10185    }
10186
10187    async fn build_inner(
10188        conf: gaxi::options::ClientConfig,
10189    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionBackendBuckets>>
10190    {
10191        if gaxi::options::tracing_enabled(&conf) {
10192            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10193        }
10194        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10195    }
10196
10197    async fn build_transport(
10198        conf: gaxi::options::ClientConfig,
10199    ) -> crate::ClientBuilderResult<impl super::stub::RegionBackendBuckets> {
10200        super::transport::RegionBackendBuckets::new(conf).await
10201    }
10202
10203    async fn build_with_tracing(
10204        conf: gaxi::options::ClientConfig,
10205    ) -> crate::ClientBuilderResult<impl super::stub::RegionBackendBuckets> {
10206        Self::build_transport(conf)
10207            .await
10208            .map(super::tracing::RegionBackendBuckets::new)
10209    }
10210
10211    /// Deletes the specified regional BackendBucket resource.
10212    pub fn delete(&self) -> super::builder::region_backend_buckets::Delete {
10213        super::builder::region_backend_buckets::Delete::new(self.inner.clone())
10214    }
10215
10216    /// Returns the specified regional BackendBucket resource.
10217    pub fn get(&self) -> super::builder::region_backend_buckets::Get {
10218        super::builder::region_backend_buckets::Get::new(self.inner.clone())
10219    }
10220
10221    /// Gets the access control policy for a resource. May be empty if no such
10222    /// policy or resource exists.
10223    pub fn get_iam_policy(&self) -> super::builder::region_backend_buckets::GetIamPolicy {
10224        super::builder::region_backend_buckets::GetIamPolicy::new(self.inner.clone())
10225    }
10226
10227    /// Creates a RegionBackendBucket in the specified project in the given scope
10228    /// using the parameters that are included in the request.
10229    pub fn insert(&self) -> super::builder::region_backend_buckets::Insert {
10230        super::builder::region_backend_buckets::Insert::new(self.inner.clone())
10231    }
10232
10233    /// Retrieves the list of BackendBucket resources available to the specified
10234    /// project in the given region.
10235    pub fn list(&self) -> super::builder::region_backend_buckets::List {
10236        super::builder::region_backend_buckets::List::new(self.inner.clone())
10237    }
10238
10239    /// Retrieves a list of all usable backend buckets in the specified project in
10240    /// the given region.
10241    pub fn list_usable(&self) -> super::builder::region_backend_buckets::ListUsable {
10242        super::builder::region_backend_buckets::ListUsable::new(self.inner.clone())
10243    }
10244
10245    /// Updates the specified  BackendBucket resource with the data included in the
10246    /// request. This method supportsPATCH
10247    /// semantics and uses theJSON merge
10248    /// patch format and processing rules.
10249    pub fn patch(&self) -> super::builder::region_backend_buckets::Patch {
10250        super::builder::region_backend_buckets::Patch::new(self.inner.clone())
10251    }
10252
10253    /// Sets the access control policy on the specified resource.
10254    /// Replaces any existing policy.
10255    pub fn set_iam_policy(&self) -> super::builder::region_backend_buckets::SetIamPolicy {
10256        super::builder::region_backend_buckets::SetIamPolicy::new(self.inner.clone())
10257    }
10258
10259    /// Returns permissions that a caller has on the specified resource.
10260    pub fn test_iam_permissions(
10261        &self,
10262    ) -> super::builder::region_backend_buckets::TestIamPermissions {
10263        super::builder::region_backend_buckets::TestIamPermissions::new(self.inner.clone())
10264    }
10265
10266    /// Retrieves the specified region-specific Operations resource.
10267    pub fn get_operation(&self) -> super::builder::region_backend_buckets::GetOperation {
10268        super::builder::region_backend_buckets::GetOperation::new(self.inner.clone())
10269    }
10270}
10271
10272/// Implements a client for the Google Compute Engine API.
10273///
10274/// # Example
10275/// ```
10276/// # use google_cloud_compute_v1::client::RegionBackendServices;
10277/// async fn sample(
10278/// ) -> anyhow::Result<()> {
10279///     let client = RegionBackendServices::builder().build().await?;
10280///     // use `client` to make requests to the Google Compute Engine API.
10281///     Ok(())
10282/// }
10283/// ```
10284///
10285/// # Service Description
10286///
10287/// Service for the `regionBackendServices` resource.
10288///
10289/// # Configuration
10290///
10291/// To configure `RegionBackendServices` use the `with_*` methods in the type returned
10292/// by [builder()][RegionBackendServices::builder]. The default configuration should
10293/// work for most applications. Common configuration changes include
10294///
10295/// * [with_endpoint()]: by default this client uses the global default endpoint
10296///   (`https://compute.googleapis.com`). Applications using regional
10297///   endpoints or running in restricted networks (e.g. a network configured
10298//    with [Private Google Access with VPC Service Controls]) may want to
10299///   override this default.
10300/// * [with_credentials()]: by default this client uses
10301///   [Application Default Credentials]. Applications using custom
10302///   authentication may need to override this default.
10303///
10304/// [with_endpoint()]: super::builder::region_backend_services::ClientBuilder::with_endpoint
10305/// [with_credentials()]: super::builder::region_backend_services::ClientBuilder::with_credentials
10306/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10307/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10308///
10309/// # Pooling and Cloning
10310///
10311/// `RegionBackendServices` holds a connection pool internally, it is advised to
10312/// create one and reuse it. You do not need to wrap `RegionBackendServices` in
10313/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10314/// already uses an `Arc` internally.
10315#[cfg(feature = "region-backend-services")]
10316#[cfg_attr(docsrs, doc(cfg(feature = "region-backend-services")))]
10317#[derive(Clone, Debug)]
10318pub struct RegionBackendServices {
10319    inner: std::sync::Arc<dyn super::stub::dynamic::RegionBackendServices>,
10320}
10321
10322#[cfg(feature = "region-backend-services")]
10323impl RegionBackendServices {
10324    /// Returns a builder for [RegionBackendServices].
10325    ///
10326    /// ```
10327    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10328    /// # use google_cloud_compute_v1::client::RegionBackendServices;
10329    /// let client = RegionBackendServices::builder().build().await?;
10330    /// # Ok(()) }
10331    /// ```
10332    pub fn builder() -> super::builder::region_backend_services::ClientBuilder {
10333        crate::new_client_builder(super::builder::region_backend_services::client::Factory)
10334    }
10335
10336    /// Creates a new client from the provided stub.
10337    ///
10338    /// The most common case for calling this function is in tests mocking the
10339    /// client's behavior.
10340    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
10341    where
10342        T: super::stub::RegionBackendServices + 'static,
10343    {
10344        Self { inner: stub.into() }
10345    }
10346
10347    pub(crate) async fn new(
10348        config: gaxi::options::ClientConfig,
10349    ) -> crate::ClientBuilderResult<Self> {
10350        let inner = Self::build_inner(config).await?;
10351        Ok(Self { inner })
10352    }
10353
10354    async fn build_inner(
10355        conf: gaxi::options::ClientConfig,
10356    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionBackendServices>>
10357    {
10358        if gaxi::options::tracing_enabled(&conf) {
10359            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10360        }
10361        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10362    }
10363
10364    async fn build_transport(
10365        conf: gaxi::options::ClientConfig,
10366    ) -> crate::ClientBuilderResult<impl super::stub::RegionBackendServices> {
10367        super::transport::RegionBackendServices::new(conf).await
10368    }
10369
10370    async fn build_with_tracing(
10371        conf: gaxi::options::ClientConfig,
10372    ) -> crate::ClientBuilderResult<impl super::stub::RegionBackendServices> {
10373        Self::build_transport(conf)
10374            .await
10375            .map(super::tracing::RegionBackendServices::new)
10376    }
10377
10378    /// Deletes the specified regional BackendService resource.
10379    pub fn delete(&self) -> super::builder::region_backend_services::Delete {
10380        super::builder::region_backend_services::Delete::new(self.inner.clone())
10381    }
10382
10383    /// Returns the specified regional BackendService resource.
10384    pub fn get(&self) -> super::builder::region_backend_services::Get {
10385        super::builder::region_backend_services::Get::new(self.inner.clone())
10386    }
10387
10388    /// Gets the most recent health check results for this
10389    /// regional BackendService.
10390    pub fn get_health(&self) -> super::builder::region_backend_services::GetHealth {
10391        super::builder::region_backend_services::GetHealth::new(self.inner.clone())
10392    }
10393
10394    /// Gets the access control policy for a resource. May be empty if no such
10395    /// policy or resource exists.
10396    pub fn get_iam_policy(&self) -> super::builder::region_backend_services::GetIamPolicy {
10397        super::builder::region_backend_services::GetIamPolicy::new(self.inner.clone())
10398    }
10399
10400    /// Creates a regional BackendService resource in the specified project using
10401    /// the data included in the request. For more information, see
10402    /// Backend services overview.
10403    pub fn insert(&self) -> super::builder::region_backend_services::Insert {
10404        super::builder::region_backend_services::Insert::new(self.inner.clone())
10405    }
10406
10407    /// Retrieves the list of regional BackendService resources available to the
10408    /// specified project in the given region.
10409    pub fn list(&self) -> super::builder::region_backend_services::List {
10410        super::builder::region_backend_services::List::new(self.inner.clone())
10411    }
10412
10413    /// Retrieves a list of all usable backend services in the specified project in
10414    /// the given region.
10415    pub fn list_usable(&self) -> super::builder::region_backend_services::ListUsable {
10416        super::builder::region_backend_services::ListUsable::new(self.inner.clone())
10417    }
10418
10419    /// Updates the specified regional BackendService resource with the data
10420    /// included in the request. For more information, see
10421    /// Understanding backend services This method
10422    /// supports PATCH semantics and uses the JSON merge
10423    /// patch format and processing rules.
10424    pub fn patch(&self) -> super::builder::region_backend_services::Patch {
10425        super::builder::region_backend_services::Patch::new(self.inner.clone())
10426    }
10427
10428    /// Sets the access control policy on the specified resource.
10429    /// Replaces any existing policy.
10430    pub fn set_iam_policy(&self) -> super::builder::region_backend_services::SetIamPolicy {
10431        super::builder::region_backend_services::SetIamPolicy::new(self.inner.clone())
10432    }
10433
10434    /// Sets the Google Cloud Armor security policy for the specified backend
10435    /// service. For more information, seeGoogle
10436    /// Cloud Armor Overview
10437    pub fn set_security_policy(
10438        &self,
10439    ) -> super::builder::region_backend_services::SetSecurityPolicy {
10440        super::builder::region_backend_services::SetSecurityPolicy::new(self.inner.clone())
10441    }
10442
10443    /// Returns permissions that a caller has on the specified resource.
10444    pub fn test_iam_permissions(
10445        &self,
10446    ) -> super::builder::region_backend_services::TestIamPermissions {
10447        super::builder::region_backend_services::TestIamPermissions::new(self.inner.clone())
10448    }
10449
10450    /// Updates the specified regional BackendService resource with the data
10451    /// included in the request. For more information,
10452    /// see
10453    /// Backend services overview.
10454    pub fn update(&self) -> super::builder::region_backend_services::Update {
10455        super::builder::region_backend_services::Update::new(self.inner.clone())
10456    }
10457
10458    /// Retrieves the specified region-specific Operations resource.
10459    pub fn get_operation(&self) -> super::builder::region_backend_services::GetOperation {
10460        super::builder::region_backend_services::GetOperation::new(self.inner.clone())
10461    }
10462}
10463
10464/// Implements a client for the Google Compute Engine API.
10465///
10466/// # Example
10467/// ```
10468/// # use google_cloud_compute_v1::client::RegionCommitments;
10469/// async fn sample(
10470/// ) -> anyhow::Result<()> {
10471///     let client = RegionCommitments::builder().build().await?;
10472///     // use `client` to make requests to the Google Compute Engine API.
10473///     Ok(())
10474/// }
10475/// ```
10476///
10477/// # Service Description
10478///
10479/// Service for the `regionCommitments` resource.
10480///
10481/// # Configuration
10482///
10483/// To configure `RegionCommitments` use the `with_*` methods in the type returned
10484/// by [builder()][RegionCommitments::builder]. The default configuration should
10485/// work for most applications. Common configuration changes include
10486///
10487/// * [with_endpoint()]: by default this client uses the global default endpoint
10488///   (`https://compute.googleapis.com`). Applications using regional
10489///   endpoints or running in restricted networks (e.g. a network configured
10490//    with [Private Google Access with VPC Service Controls]) may want to
10491///   override this default.
10492/// * [with_credentials()]: by default this client uses
10493///   [Application Default Credentials]. Applications using custom
10494///   authentication may need to override this default.
10495///
10496/// [with_endpoint()]: super::builder::region_commitments::ClientBuilder::with_endpoint
10497/// [with_credentials()]: super::builder::region_commitments::ClientBuilder::with_credentials
10498/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10499/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10500///
10501/// # Pooling and Cloning
10502///
10503/// `RegionCommitments` holds a connection pool internally, it is advised to
10504/// create one and reuse it. You do not need to wrap `RegionCommitments` in
10505/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10506/// already uses an `Arc` internally.
10507#[cfg(feature = "region-commitments")]
10508#[cfg_attr(docsrs, doc(cfg(feature = "region-commitments")))]
10509#[derive(Clone, Debug)]
10510pub struct RegionCommitments {
10511    inner: std::sync::Arc<dyn super::stub::dynamic::RegionCommitments>,
10512}
10513
10514#[cfg(feature = "region-commitments")]
10515impl RegionCommitments {
10516    /// Returns a builder for [RegionCommitments].
10517    ///
10518    /// ```
10519    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10520    /// # use google_cloud_compute_v1::client::RegionCommitments;
10521    /// let client = RegionCommitments::builder().build().await?;
10522    /// # Ok(()) }
10523    /// ```
10524    pub fn builder() -> super::builder::region_commitments::ClientBuilder {
10525        crate::new_client_builder(super::builder::region_commitments::client::Factory)
10526    }
10527
10528    /// Creates a new client from the provided stub.
10529    ///
10530    /// The most common case for calling this function is in tests mocking the
10531    /// client's behavior.
10532    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
10533    where
10534        T: super::stub::RegionCommitments + 'static,
10535    {
10536        Self { inner: stub.into() }
10537    }
10538
10539    pub(crate) async fn new(
10540        config: gaxi::options::ClientConfig,
10541    ) -> crate::ClientBuilderResult<Self> {
10542        let inner = Self::build_inner(config).await?;
10543        Ok(Self { inner })
10544    }
10545
10546    async fn build_inner(
10547        conf: gaxi::options::ClientConfig,
10548    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionCommitments>>
10549    {
10550        if gaxi::options::tracing_enabled(&conf) {
10551            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10552        }
10553        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10554    }
10555
10556    async fn build_transport(
10557        conf: gaxi::options::ClientConfig,
10558    ) -> crate::ClientBuilderResult<impl super::stub::RegionCommitments> {
10559        super::transport::RegionCommitments::new(conf).await
10560    }
10561
10562    async fn build_with_tracing(
10563        conf: gaxi::options::ClientConfig,
10564    ) -> crate::ClientBuilderResult<impl super::stub::RegionCommitments> {
10565        Self::build_transport(conf)
10566            .await
10567            .map(super::tracing::RegionCommitments::new)
10568    }
10569
10570    /// Retrieves an aggregated list of commitments by region.
10571    ///
10572    /// To prevent failure, it is recommended that you set the
10573    /// `returnPartialSuccess` parameter to `true`.
10574    pub fn aggregated_list(&self) -> super::builder::region_commitments::AggregatedList {
10575        super::builder::region_commitments::AggregatedList::new(self.inner.clone())
10576    }
10577
10578    /// Returns the specified commitment resource.
10579    pub fn get(&self) -> super::builder::region_commitments::Get {
10580        super::builder::region_commitments::Get::new(self.inner.clone())
10581    }
10582
10583    /// Creates a commitment in the specified project using the data
10584    /// included in the request.
10585    pub fn insert(&self) -> super::builder::region_commitments::Insert {
10586        super::builder::region_commitments::Insert::new(self.inner.clone())
10587    }
10588
10589    /// Retrieves a list of commitments contained within
10590    /// the specified region.
10591    pub fn list(&self) -> super::builder::region_commitments::List {
10592        super::builder::region_commitments::List::new(self.inner.clone())
10593    }
10594
10595    /// Updates the specified commitment with the data included in the request.
10596    /// Update is performed only on selected fields included as part of
10597    /// update-mask. Only the following fields can be updated: auto_renew and plan.
10598    pub fn update(&self) -> super::builder::region_commitments::Update {
10599        super::builder::region_commitments::Update::new(self.inner.clone())
10600    }
10601
10602    /// Retrieves the specified region-specific Operations resource.
10603    pub fn get_operation(&self) -> super::builder::region_commitments::GetOperation {
10604        super::builder::region_commitments::GetOperation::new(self.inner.clone())
10605    }
10606}
10607
10608/// Implements a client for the Google Compute Engine API.
10609///
10610/// # Example
10611/// ```
10612/// # use google_cloud_compute_v1::client::RegionCompositeHealthChecks;
10613/// async fn sample(
10614/// ) -> anyhow::Result<()> {
10615///     let client = RegionCompositeHealthChecks::builder().build().await?;
10616///     // use `client` to make requests to the Google Compute Engine API.
10617///     Ok(())
10618/// }
10619/// ```
10620///
10621/// # Service Description
10622///
10623/// Service for the `regionCompositeHealthChecks` resource.
10624///
10625/// # Configuration
10626///
10627/// To configure `RegionCompositeHealthChecks` use the `with_*` methods in the type returned
10628/// by [builder()][RegionCompositeHealthChecks::builder]. The default configuration should
10629/// work for most applications. Common configuration changes include
10630///
10631/// * [with_endpoint()]: by default this client uses the global default endpoint
10632///   (`https://compute.googleapis.com`). Applications using regional
10633///   endpoints or running in restricted networks (e.g. a network configured
10634//    with [Private Google Access with VPC Service Controls]) may want to
10635///   override this default.
10636/// * [with_credentials()]: by default this client uses
10637///   [Application Default Credentials]. Applications using custom
10638///   authentication may need to override this default.
10639///
10640/// [with_endpoint()]: super::builder::region_composite_health_checks::ClientBuilder::with_endpoint
10641/// [with_credentials()]: super::builder::region_composite_health_checks::ClientBuilder::with_credentials
10642/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10643/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10644///
10645/// # Pooling and Cloning
10646///
10647/// `RegionCompositeHealthChecks` holds a connection pool internally, it is advised to
10648/// create one and reuse it. You do not need to wrap `RegionCompositeHealthChecks` in
10649/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10650/// already uses an `Arc` internally.
10651#[cfg(feature = "region-composite-health-checks")]
10652#[cfg_attr(docsrs, doc(cfg(feature = "region-composite-health-checks")))]
10653#[derive(Clone, Debug)]
10654pub struct RegionCompositeHealthChecks {
10655    inner: std::sync::Arc<dyn super::stub::dynamic::RegionCompositeHealthChecks>,
10656}
10657
10658#[cfg(feature = "region-composite-health-checks")]
10659impl RegionCompositeHealthChecks {
10660    /// Returns a builder for [RegionCompositeHealthChecks].
10661    ///
10662    /// ```
10663    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10664    /// # use google_cloud_compute_v1::client::RegionCompositeHealthChecks;
10665    /// let client = RegionCompositeHealthChecks::builder().build().await?;
10666    /// # Ok(()) }
10667    /// ```
10668    pub fn builder() -> super::builder::region_composite_health_checks::ClientBuilder {
10669        crate::new_client_builder(super::builder::region_composite_health_checks::client::Factory)
10670    }
10671
10672    /// Creates a new client from the provided stub.
10673    ///
10674    /// The most common case for calling this function is in tests mocking the
10675    /// client's behavior.
10676    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
10677    where
10678        T: super::stub::RegionCompositeHealthChecks + 'static,
10679    {
10680        Self { inner: stub.into() }
10681    }
10682
10683    pub(crate) async fn new(
10684        config: gaxi::options::ClientConfig,
10685    ) -> crate::ClientBuilderResult<Self> {
10686        let inner = Self::build_inner(config).await?;
10687        Ok(Self { inner })
10688    }
10689
10690    async fn build_inner(
10691        conf: gaxi::options::ClientConfig,
10692    ) -> crate::ClientBuilderResult<
10693        std::sync::Arc<dyn super::stub::dynamic::RegionCompositeHealthChecks>,
10694    > {
10695        if gaxi::options::tracing_enabled(&conf) {
10696            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10697        }
10698        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10699    }
10700
10701    async fn build_transport(
10702        conf: gaxi::options::ClientConfig,
10703    ) -> crate::ClientBuilderResult<impl super::stub::RegionCompositeHealthChecks> {
10704        super::transport::RegionCompositeHealthChecks::new(conf).await
10705    }
10706
10707    async fn build_with_tracing(
10708        conf: gaxi::options::ClientConfig,
10709    ) -> crate::ClientBuilderResult<impl super::stub::RegionCompositeHealthChecks> {
10710        Self::build_transport(conf)
10711            .await
10712            .map(super::tracing::RegionCompositeHealthChecks::new)
10713    }
10714
10715    /// Retrieves the list of all CompositeHealthCheck resources (all
10716    /// regional) available to the specified project.
10717    ///
10718    /// To prevent failure, it is recommended that you set the
10719    /// `returnPartialSuccess` parameter to `true`.
10720    pub fn aggregated_list(
10721        &self,
10722    ) -> super::builder::region_composite_health_checks::AggregatedList {
10723        super::builder::region_composite_health_checks::AggregatedList::new(self.inner.clone())
10724    }
10725
10726    /// Deletes the specified CompositeHealthCheck in the given region
10727    pub fn delete(&self) -> super::builder::region_composite_health_checks::Delete {
10728        super::builder::region_composite_health_checks::Delete::new(self.inner.clone())
10729    }
10730
10731    /// Returns the specified CompositeHealthCheck resource in the given region.
10732    pub fn get(&self) -> super::builder::region_composite_health_checks::Get {
10733        super::builder::region_composite_health_checks::Get::new(self.inner.clone())
10734    }
10735
10736    /// Gets the most recent health check results for this
10737    /// regional CompositeHealthCheck.
10738    pub fn get_health(&self) -> super::builder::region_composite_health_checks::GetHealth {
10739        super::builder::region_composite_health_checks::GetHealth::new(self.inner.clone())
10740    }
10741
10742    /// Create a CompositeHealthCheck in the specified project in the given region
10743    /// using the parameters that are included in the request.
10744    pub fn insert(&self) -> super::builder::region_composite_health_checks::Insert {
10745        super::builder::region_composite_health_checks::Insert::new(self.inner.clone())
10746    }
10747
10748    /// Lists the CompositeHealthChecks for a project in the given region.
10749    pub fn list(&self) -> super::builder::region_composite_health_checks::List {
10750        super::builder::region_composite_health_checks::List::new(self.inner.clone())
10751    }
10752
10753    /// Updates the specified regional CompositeHealthCheck resource
10754    /// with the data included in the request.  This method supportsPATCH
10755    /// semantics and uses theJSON merge
10756    /// patch format and processing rules.
10757    pub fn patch(&self) -> super::builder::region_composite_health_checks::Patch {
10758        super::builder::region_composite_health_checks::Patch::new(self.inner.clone())
10759    }
10760
10761    /// Returns permissions that a caller has on the specified resource.
10762    pub fn test_iam_permissions(
10763        &self,
10764    ) -> super::builder::region_composite_health_checks::TestIamPermissions {
10765        super::builder::region_composite_health_checks::TestIamPermissions::new(self.inner.clone())
10766    }
10767
10768    /// Retrieves the specified region-specific Operations resource.
10769    pub fn get_operation(&self) -> super::builder::region_composite_health_checks::GetOperation {
10770        super::builder::region_composite_health_checks::GetOperation::new(self.inner.clone())
10771    }
10772}
10773
10774/// Implements a client for the Google Compute Engine API.
10775///
10776/// # Example
10777/// ```
10778/// # use google_cloud_compute_v1::client::RegionDiskTypes;
10779/// async fn sample(
10780/// ) -> anyhow::Result<()> {
10781///     let client = RegionDiskTypes::builder().build().await?;
10782///     // use `client` to make requests to the Google Compute Engine API.
10783///     Ok(())
10784/// }
10785/// ```
10786///
10787/// # Service Description
10788///
10789/// Service for the `regionDiskTypes` resource.
10790///
10791/// # Configuration
10792///
10793/// To configure `RegionDiskTypes` use the `with_*` methods in the type returned
10794/// by [builder()][RegionDiskTypes::builder]. The default configuration should
10795/// work for most applications. Common configuration changes include
10796///
10797/// * [with_endpoint()]: by default this client uses the global default endpoint
10798///   (`https://compute.googleapis.com`). Applications using regional
10799///   endpoints or running in restricted networks (e.g. a network configured
10800//    with [Private Google Access with VPC Service Controls]) may want to
10801///   override this default.
10802/// * [with_credentials()]: by default this client uses
10803///   [Application Default Credentials]. Applications using custom
10804///   authentication may need to override this default.
10805///
10806/// [with_endpoint()]: super::builder::region_disk_types::ClientBuilder::with_endpoint
10807/// [with_credentials()]: super::builder::region_disk_types::ClientBuilder::with_credentials
10808/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10809/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10810///
10811/// # Pooling and Cloning
10812///
10813/// `RegionDiskTypes` holds a connection pool internally, it is advised to
10814/// create one and reuse it. You do not need to wrap `RegionDiskTypes` in
10815/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10816/// already uses an `Arc` internally.
10817#[cfg(feature = "region-disk-types")]
10818#[cfg_attr(docsrs, doc(cfg(feature = "region-disk-types")))]
10819#[derive(Clone, Debug)]
10820pub struct RegionDiskTypes {
10821    inner: std::sync::Arc<dyn super::stub::dynamic::RegionDiskTypes>,
10822}
10823
10824#[cfg(feature = "region-disk-types")]
10825impl RegionDiskTypes {
10826    /// Returns a builder for [RegionDiskTypes].
10827    ///
10828    /// ```
10829    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10830    /// # use google_cloud_compute_v1::client::RegionDiskTypes;
10831    /// let client = RegionDiskTypes::builder().build().await?;
10832    /// # Ok(()) }
10833    /// ```
10834    pub fn builder() -> super::builder::region_disk_types::ClientBuilder {
10835        crate::new_client_builder(super::builder::region_disk_types::client::Factory)
10836    }
10837
10838    /// Creates a new client from the provided stub.
10839    ///
10840    /// The most common case for calling this function is in tests mocking the
10841    /// client's behavior.
10842    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
10843    where
10844        T: super::stub::RegionDiskTypes + 'static,
10845    {
10846        Self { inner: stub.into() }
10847    }
10848
10849    pub(crate) async fn new(
10850        config: gaxi::options::ClientConfig,
10851    ) -> crate::ClientBuilderResult<Self> {
10852        let inner = Self::build_inner(config).await?;
10853        Ok(Self { inner })
10854    }
10855
10856    async fn build_inner(
10857        conf: gaxi::options::ClientConfig,
10858    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionDiskTypes>> {
10859        if gaxi::options::tracing_enabled(&conf) {
10860            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10861        }
10862        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10863    }
10864
10865    async fn build_transport(
10866        conf: gaxi::options::ClientConfig,
10867    ) -> crate::ClientBuilderResult<impl super::stub::RegionDiskTypes> {
10868        super::transport::RegionDiskTypes::new(conf).await
10869    }
10870
10871    async fn build_with_tracing(
10872        conf: gaxi::options::ClientConfig,
10873    ) -> crate::ClientBuilderResult<impl super::stub::RegionDiskTypes> {
10874        Self::build_transport(conf)
10875            .await
10876            .map(super::tracing::RegionDiskTypes::new)
10877    }
10878
10879    /// Returns the specified regional disk type.
10880    pub fn get(&self) -> super::builder::region_disk_types::Get {
10881        super::builder::region_disk_types::Get::new(self.inner.clone())
10882    }
10883
10884    /// Retrieves a list of regional disk types available to the specified project.
10885    pub fn list(&self) -> super::builder::region_disk_types::List {
10886        super::builder::region_disk_types::List::new(self.inner.clone())
10887    }
10888}
10889
10890/// Implements a client for the Google Compute Engine API.
10891///
10892/// # Example
10893/// ```
10894/// # use google_cloud_compute_v1::client::RegionDisks;
10895/// async fn sample(
10896/// ) -> anyhow::Result<()> {
10897///     let client = RegionDisks::builder().build().await?;
10898///     // use `client` to make requests to the Google Compute Engine API.
10899///     Ok(())
10900/// }
10901/// ```
10902///
10903/// # Service Description
10904///
10905/// Service for the `regionDisks` resource.
10906///
10907/// # Configuration
10908///
10909/// To configure `RegionDisks` use the `with_*` methods in the type returned
10910/// by [builder()][RegionDisks::builder]. The default configuration should
10911/// work for most applications. Common configuration changes include
10912///
10913/// * [with_endpoint()]: by default this client uses the global default endpoint
10914///   (`https://compute.googleapis.com`). Applications using regional
10915///   endpoints or running in restricted networks (e.g. a network configured
10916//    with [Private Google Access with VPC Service Controls]) may want to
10917///   override this default.
10918/// * [with_credentials()]: by default this client uses
10919///   [Application Default Credentials]. Applications using custom
10920///   authentication may need to override this default.
10921///
10922/// [with_endpoint()]: super::builder::region_disks::ClientBuilder::with_endpoint
10923/// [with_credentials()]: super::builder::region_disks::ClientBuilder::with_credentials
10924/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10925/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10926///
10927/// # Pooling and Cloning
10928///
10929/// `RegionDisks` holds a connection pool internally, it is advised to
10930/// create one and reuse it. You do not need to wrap `RegionDisks` in
10931/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10932/// already uses an `Arc` internally.
10933#[cfg(feature = "region-disks")]
10934#[cfg_attr(docsrs, doc(cfg(feature = "region-disks")))]
10935#[derive(Clone, Debug)]
10936pub struct RegionDisks {
10937    inner: std::sync::Arc<dyn super::stub::dynamic::RegionDisks>,
10938}
10939
10940#[cfg(feature = "region-disks")]
10941impl RegionDisks {
10942    /// Returns a builder for [RegionDisks].
10943    ///
10944    /// ```
10945    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10946    /// # use google_cloud_compute_v1::client::RegionDisks;
10947    /// let client = RegionDisks::builder().build().await?;
10948    /// # Ok(()) }
10949    /// ```
10950    pub fn builder() -> super::builder::region_disks::ClientBuilder {
10951        crate::new_client_builder(super::builder::region_disks::client::Factory)
10952    }
10953
10954    /// Creates a new client from the provided stub.
10955    ///
10956    /// The most common case for calling this function is in tests mocking the
10957    /// client's behavior.
10958    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
10959    where
10960        T: super::stub::RegionDisks + 'static,
10961    {
10962        Self { inner: stub.into() }
10963    }
10964
10965    pub(crate) async fn new(
10966        config: gaxi::options::ClientConfig,
10967    ) -> crate::ClientBuilderResult<Self> {
10968        let inner = Self::build_inner(config).await?;
10969        Ok(Self { inner })
10970    }
10971
10972    async fn build_inner(
10973        conf: gaxi::options::ClientConfig,
10974    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionDisks>> {
10975        if gaxi::options::tracing_enabled(&conf) {
10976            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10977        }
10978        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10979    }
10980
10981    async fn build_transport(
10982        conf: gaxi::options::ClientConfig,
10983    ) -> crate::ClientBuilderResult<impl super::stub::RegionDisks> {
10984        super::transport::RegionDisks::new(conf).await
10985    }
10986
10987    async fn build_with_tracing(
10988        conf: gaxi::options::ClientConfig,
10989    ) -> crate::ClientBuilderResult<impl super::stub::RegionDisks> {
10990        Self::build_transport(conf)
10991            .await
10992            .map(super::tracing::RegionDisks::new)
10993    }
10994
10995    /// Adds existing resource policies to a regional disk. You can only add one
10996    /// policy which will be applied to this disk for scheduling snapshot
10997    /// creation.
10998    pub fn add_resource_policies(&self) -> super::builder::region_disks::AddResourcePolicies {
10999        super::builder::region_disks::AddResourcePolicies::new(self.inner.clone())
11000    }
11001
11002    /// Bulk create a set of disks.
11003    pub fn bulk_insert(&self) -> super::builder::region_disks::BulkInsert {
11004        super::builder::region_disks::BulkInsert::new(self.inner.clone())
11005    }
11006
11007    /// Creates a snapshot of a specified persistent disk. For regular snapshot
11008    /// creation, consider using snapshots.insert
11009    /// instead, as that method supports more features, such as creating snapshots
11010    /// in a project different from the source disk project.
11011    pub fn create_snapshot(&self) -> super::builder::region_disks::CreateSnapshot {
11012        super::builder::region_disks::CreateSnapshot::new(self.inner.clone())
11013    }
11014
11015    /// Deletes the specified regional persistent disk. Deleting a regional disk
11016    /// removes all the replicas of its data permanently and is irreversible.
11017    /// However, deleting a disk does not delete anysnapshots
11018    /// previously made from the disk. You must separatelydelete
11019    /// snapshots.
11020    pub fn delete(&self) -> super::builder::region_disks::Delete {
11021        super::builder::region_disks::Delete::new(self.inner.clone())
11022    }
11023
11024    /// Returns a specified regional persistent disk.
11025    pub fn get(&self) -> super::builder::region_disks::Get {
11026        super::builder::region_disks::Get::new(self.inner.clone())
11027    }
11028
11029    /// Gets the access control policy for a resource. May be empty if no such
11030    /// policy or resource exists.
11031    pub fn get_iam_policy(&self) -> super::builder::region_disks::GetIamPolicy {
11032        super::builder::region_disks::GetIamPolicy::new(self.inner.clone())
11033    }
11034
11035    /// Creates a persistent regional disk in the specified project using the data
11036    /// included in the request.
11037    pub fn insert(&self) -> super::builder::region_disks::Insert {
11038        super::builder::region_disks::Insert::new(self.inner.clone())
11039    }
11040
11041    /// Retrieves the list of persistent disks contained within
11042    /// the specified region.
11043    pub fn list(&self) -> super::builder::region_disks::List {
11044        super::builder::region_disks::List::new(self.inner.clone())
11045    }
11046
11047    /// Removes resource policies from a regional disk.
11048    pub fn remove_resource_policies(&self) -> super::builder::region_disks::RemoveResourcePolicies {
11049        super::builder::region_disks::RemoveResourcePolicies::new(self.inner.clone())
11050    }
11051
11052    /// Resizes the specified regional persistent disk.
11053    pub fn resize(&self) -> super::builder::region_disks::Resize {
11054        super::builder::region_disks::Resize::new(self.inner.clone())
11055    }
11056
11057    /// Sets the access control policy on the specified resource.
11058    /// Replaces any existing policy.
11059    pub fn set_iam_policy(&self) -> super::builder::region_disks::SetIamPolicy {
11060        super::builder::region_disks::SetIamPolicy::new(self.inner.clone())
11061    }
11062
11063    /// Sets the labels on the target regional disk.
11064    pub fn set_labels(&self) -> super::builder::region_disks::SetLabels {
11065        super::builder::region_disks::SetLabels::new(self.inner.clone())
11066    }
11067
11068    /// Starts asynchronous replication.
11069    /// Must be invoked on the primary disk.
11070    pub fn start_async_replication(&self) -> super::builder::region_disks::StartAsyncReplication {
11071        super::builder::region_disks::StartAsyncReplication::new(self.inner.clone())
11072    }
11073
11074    /// Stops asynchronous replication.
11075    /// Can be invoked either on the primary or on the secondary disk.
11076    pub fn stop_async_replication(&self) -> super::builder::region_disks::StopAsyncReplication {
11077        super::builder::region_disks::StopAsyncReplication::new(self.inner.clone())
11078    }
11079
11080    /// Stops asynchronous replication for a consistency group of disks.
11081    /// Can be invoked either in the primary or secondary scope.
11082    pub fn stop_group_async_replication(
11083        &self,
11084    ) -> super::builder::region_disks::StopGroupAsyncReplication {
11085        super::builder::region_disks::StopGroupAsyncReplication::new(self.inner.clone())
11086    }
11087
11088    /// Returns permissions that a caller has on the specified resource.
11089    pub fn test_iam_permissions(&self) -> super::builder::region_disks::TestIamPermissions {
11090        super::builder::region_disks::TestIamPermissions::new(self.inner.clone())
11091    }
11092
11093    /// Update the specified disk with the data included in the request. Update is
11094    /// performed only on selected fields included as part of update-mask.
11095    pub fn update(&self) -> super::builder::region_disks::Update {
11096        super::builder::region_disks::Update::new(self.inner.clone())
11097    }
11098
11099    /// Rotates the customer-managed
11100    /// encryption key to the latest version for the specified persistent disk.
11101    pub fn update_kms_key(&self) -> super::builder::region_disks::UpdateKmsKey {
11102        super::builder::region_disks::UpdateKmsKey::new(self.inner.clone())
11103    }
11104
11105    /// Retrieves the specified region-specific Operations resource.
11106    pub fn get_operation(&self) -> super::builder::region_disks::GetOperation {
11107        super::builder::region_disks::GetOperation::new(self.inner.clone())
11108    }
11109}
11110
11111/// Implements a client for the Google Compute Engine API.
11112///
11113/// # Example
11114/// ```
11115/// # use google_cloud_compute_v1::client::RegionHealthAggregationPolicies;
11116/// async fn sample(
11117/// ) -> anyhow::Result<()> {
11118///     let client = RegionHealthAggregationPolicies::builder().build().await?;
11119///     // use `client` to make requests to the Google Compute Engine API.
11120///     Ok(())
11121/// }
11122/// ```
11123///
11124/// # Service Description
11125///
11126/// Service for the `regionHealthAggregationPolicies` resource.
11127///
11128/// # Configuration
11129///
11130/// To configure `RegionHealthAggregationPolicies` use the `with_*` methods in the type returned
11131/// by [builder()][RegionHealthAggregationPolicies::builder]. The default configuration should
11132/// work for most applications. Common configuration changes include
11133///
11134/// * [with_endpoint()]: by default this client uses the global default endpoint
11135///   (`https://compute.googleapis.com`). Applications using regional
11136///   endpoints or running in restricted networks (e.g. a network configured
11137//    with [Private Google Access with VPC Service Controls]) may want to
11138///   override this default.
11139/// * [with_credentials()]: by default this client uses
11140///   [Application Default Credentials]. Applications using custom
11141///   authentication may need to override this default.
11142///
11143/// [with_endpoint()]: super::builder::region_health_aggregation_policies::ClientBuilder::with_endpoint
11144/// [with_credentials()]: super::builder::region_health_aggregation_policies::ClientBuilder::with_credentials
11145/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11146/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11147///
11148/// # Pooling and Cloning
11149///
11150/// `RegionHealthAggregationPolicies` holds a connection pool internally, it is advised to
11151/// create one and reuse it. You do not need to wrap `RegionHealthAggregationPolicies` in
11152/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11153/// already uses an `Arc` internally.
11154#[cfg(feature = "region-health-aggregation-policies")]
11155#[cfg_attr(docsrs, doc(cfg(feature = "region-health-aggregation-policies")))]
11156#[derive(Clone, Debug)]
11157pub struct RegionHealthAggregationPolicies {
11158    inner: std::sync::Arc<dyn super::stub::dynamic::RegionHealthAggregationPolicies>,
11159}
11160
11161#[cfg(feature = "region-health-aggregation-policies")]
11162impl RegionHealthAggregationPolicies {
11163    /// Returns a builder for [RegionHealthAggregationPolicies].
11164    ///
11165    /// ```
11166    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11167    /// # use google_cloud_compute_v1::client::RegionHealthAggregationPolicies;
11168    /// let client = RegionHealthAggregationPolicies::builder().build().await?;
11169    /// # Ok(()) }
11170    /// ```
11171    pub fn builder() -> super::builder::region_health_aggregation_policies::ClientBuilder {
11172        crate::new_client_builder(
11173            super::builder::region_health_aggregation_policies::client::Factory,
11174        )
11175    }
11176
11177    /// Creates a new client from the provided stub.
11178    ///
11179    /// The most common case for calling this function is in tests mocking the
11180    /// client's behavior.
11181    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
11182    where
11183        T: super::stub::RegionHealthAggregationPolicies + 'static,
11184    {
11185        Self { inner: stub.into() }
11186    }
11187
11188    pub(crate) async fn new(
11189        config: gaxi::options::ClientConfig,
11190    ) -> crate::ClientBuilderResult<Self> {
11191        let inner = Self::build_inner(config).await?;
11192        Ok(Self { inner })
11193    }
11194
11195    async fn build_inner(
11196        conf: gaxi::options::ClientConfig,
11197    ) -> crate::ClientBuilderResult<
11198        std::sync::Arc<dyn super::stub::dynamic::RegionHealthAggregationPolicies>,
11199    > {
11200        if gaxi::options::tracing_enabled(&conf) {
11201            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11202        }
11203        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11204    }
11205
11206    async fn build_transport(
11207        conf: gaxi::options::ClientConfig,
11208    ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthAggregationPolicies> {
11209        super::transport::RegionHealthAggregationPolicies::new(conf).await
11210    }
11211
11212    async fn build_with_tracing(
11213        conf: gaxi::options::ClientConfig,
11214    ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthAggregationPolicies> {
11215        Self::build_transport(conf)
11216            .await
11217            .map(super::tracing::RegionHealthAggregationPolicies::new)
11218    }
11219
11220    /// Retrieves the list of all HealthAggregationPolicy resources,
11221    /// regional and global, available to the specified project.
11222    ///
11223    /// To prevent failure, it is recommended that you set the
11224    /// `returnPartialSuccess` parameter to `true`.
11225    pub fn aggregated_list(
11226        &self,
11227    ) -> super::builder::region_health_aggregation_policies::AggregatedList {
11228        super::builder::region_health_aggregation_policies::AggregatedList::new(self.inner.clone())
11229    }
11230
11231    /// Deletes the specified HealthAggregationPolicy in the given region.
11232    pub fn delete(&self) -> super::builder::region_health_aggregation_policies::Delete {
11233        super::builder::region_health_aggregation_policies::Delete::new(self.inner.clone())
11234    }
11235
11236    /// Returns the specified HealthAggregationPolicy resource in the given region.
11237    pub fn get(&self) -> super::builder::region_health_aggregation_policies::Get {
11238        super::builder::region_health_aggregation_policies::Get::new(self.inner.clone())
11239    }
11240
11241    /// Create a HealthAggregationPolicy in the specified project in the given
11242    /// region using the parameters that are included in the request.
11243    pub fn insert(&self) -> super::builder::region_health_aggregation_policies::Insert {
11244        super::builder::region_health_aggregation_policies::Insert::new(self.inner.clone())
11245    }
11246
11247    /// Lists the HealthAggregationPolicies for a project in the given region.
11248    pub fn list(&self) -> super::builder::region_health_aggregation_policies::List {
11249        super::builder::region_health_aggregation_policies::List::new(self.inner.clone())
11250    }
11251
11252    /// Updates the specified regional HealthAggregationPolicy
11253    /// resource with the data included in the request. This method supportsPATCH
11254    /// semantics and uses theJSON merge
11255    /// patch format and processing rules.
11256    pub fn patch(&self) -> super::builder::region_health_aggregation_policies::Patch {
11257        super::builder::region_health_aggregation_policies::Patch::new(self.inner.clone())
11258    }
11259
11260    /// Returns permissions that a caller has on the specified resource.
11261    pub fn test_iam_permissions(
11262        &self,
11263    ) -> super::builder::region_health_aggregation_policies::TestIamPermissions {
11264        super::builder::region_health_aggregation_policies::TestIamPermissions::new(
11265            self.inner.clone(),
11266        )
11267    }
11268
11269    /// Retrieves the specified region-specific Operations resource.
11270    pub fn get_operation(
11271        &self,
11272    ) -> super::builder::region_health_aggregation_policies::GetOperation {
11273        super::builder::region_health_aggregation_policies::GetOperation::new(self.inner.clone())
11274    }
11275}
11276
11277/// Implements a client for the Google Compute Engine API.
11278///
11279/// # Example
11280/// ```
11281/// # use google_cloud_compute_v1::client::RegionHealthCheckServices;
11282/// async fn sample(
11283/// ) -> anyhow::Result<()> {
11284///     let client = RegionHealthCheckServices::builder().build().await?;
11285///     // use `client` to make requests to the Google Compute Engine API.
11286///     Ok(())
11287/// }
11288/// ```
11289///
11290/// # Service Description
11291///
11292/// Service for the `regionHealthCheckServices` resource.
11293///
11294/// # Configuration
11295///
11296/// To configure `RegionHealthCheckServices` use the `with_*` methods in the type returned
11297/// by [builder()][RegionHealthCheckServices::builder]. The default configuration should
11298/// work for most applications. Common configuration changes include
11299///
11300/// * [with_endpoint()]: by default this client uses the global default endpoint
11301///   (`https://compute.googleapis.com`). Applications using regional
11302///   endpoints or running in restricted networks (e.g. a network configured
11303//    with [Private Google Access with VPC Service Controls]) may want to
11304///   override this default.
11305/// * [with_credentials()]: by default this client uses
11306///   [Application Default Credentials]. Applications using custom
11307///   authentication may need to override this default.
11308///
11309/// [with_endpoint()]: super::builder::region_health_check_services::ClientBuilder::with_endpoint
11310/// [with_credentials()]: super::builder::region_health_check_services::ClientBuilder::with_credentials
11311/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11312/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11313///
11314/// # Pooling and Cloning
11315///
11316/// `RegionHealthCheckServices` holds a connection pool internally, it is advised to
11317/// create one and reuse it. You do not need to wrap `RegionHealthCheckServices` in
11318/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11319/// already uses an `Arc` internally.
11320#[cfg(feature = "region-health-check-services")]
11321#[cfg_attr(docsrs, doc(cfg(feature = "region-health-check-services")))]
11322#[derive(Clone, Debug)]
11323pub struct RegionHealthCheckServices {
11324    inner: std::sync::Arc<dyn super::stub::dynamic::RegionHealthCheckServices>,
11325}
11326
11327#[cfg(feature = "region-health-check-services")]
11328impl RegionHealthCheckServices {
11329    /// Returns a builder for [RegionHealthCheckServices].
11330    ///
11331    /// ```
11332    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11333    /// # use google_cloud_compute_v1::client::RegionHealthCheckServices;
11334    /// let client = RegionHealthCheckServices::builder().build().await?;
11335    /// # Ok(()) }
11336    /// ```
11337    pub fn builder() -> super::builder::region_health_check_services::ClientBuilder {
11338        crate::new_client_builder(super::builder::region_health_check_services::client::Factory)
11339    }
11340
11341    /// Creates a new client from the provided stub.
11342    ///
11343    /// The most common case for calling this function is in tests mocking the
11344    /// client's behavior.
11345    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
11346    where
11347        T: super::stub::RegionHealthCheckServices + 'static,
11348    {
11349        Self { inner: stub.into() }
11350    }
11351
11352    pub(crate) async fn new(
11353        config: gaxi::options::ClientConfig,
11354    ) -> crate::ClientBuilderResult<Self> {
11355        let inner = Self::build_inner(config).await?;
11356        Ok(Self { inner })
11357    }
11358
11359    async fn build_inner(
11360        conf: gaxi::options::ClientConfig,
11361    ) -> crate::ClientBuilderResult<
11362        std::sync::Arc<dyn super::stub::dynamic::RegionHealthCheckServices>,
11363    > {
11364        if gaxi::options::tracing_enabled(&conf) {
11365            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11366        }
11367        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11368    }
11369
11370    async fn build_transport(
11371        conf: gaxi::options::ClientConfig,
11372    ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthCheckServices> {
11373        super::transport::RegionHealthCheckServices::new(conf).await
11374    }
11375
11376    async fn build_with_tracing(
11377        conf: gaxi::options::ClientConfig,
11378    ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthCheckServices> {
11379        Self::build_transport(conf)
11380            .await
11381            .map(super::tracing::RegionHealthCheckServices::new)
11382    }
11383
11384    /// Retrieves the list of all HealthCheckService resources,
11385    /// regional and global, available to the specified project.
11386    ///
11387    /// To prevent failure, it is recommended that you set the
11388    /// `returnPartialSuccess` parameter to `true`.
11389    pub fn aggregated_list(&self) -> super::builder::region_health_check_services::AggregatedList {
11390        super::builder::region_health_check_services::AggregatedList::new(self.inner.clone())
11391    }
11392
11393    /// Deletes the specified regional HealthCheckService.
11394    pub fn delete(&self) -> super::builder::region_health_check_services::Delete {
11395        super::builder::region_health_check_services::Delete::new(self.inner.clone())
11396    }
11397
11398    /// Returns the specified regional HealthCheckService resource.
11399    pub fn get(&self) -> super::builder::region_health_check_services::Get {
11400        super::builder::region_health_check_services::Get::new(self.inner.clone())
11401    }
11402
11403    /// Creates a regional HealthCheckService resource in the
11404    /// specified project and region using the data included in the request.
11405    pub fn insert(&self) -> super::builder::region_health_check_services::Insert {
11406        super::builder::region_health_check_services::Insert::new(self.inner.clone())
11407    }
11408
11409    /// Lists all the HealthCheckService resources that have been
11410    /// configured for the specified project in the given region.
11411    pub fn list(&self) -> super::builder::region_health_check_services::List {
11412        super::builder::region_health_check_services::List::new(self.inner.clone())
11413    }
11414
11415    /// Updates the specified regional HealthCheckService resource
11416    /// with the data included in the request.  This method supportsPATCH
11417    /// semantics and uses theJSON merge
11418    /// patch format and processing rules.
11419    pub fn patch(&self) -> super::builder::region_health_check_services::Patch {
11420        super::builder::region_health_check_services::Patch::new(self.inner.clone())
11421    }
11422
11423    /// Returns permissions that a caller has on the specified resource.
11424    pub fn test_iam_permissions(
11425        &self,
11426    ) -> super::builder::region_health_check_services::TestIamPermissions {
11427        super::builder::region_health_check_services::TestIamPermissions::new(self.inner.clone())
11428    }
11429
11430    /// Retrieves the specified region-specific Operations resource.
11431    pub fn get_operation(&self) -> super::builder::region_health_check_services::GetOperation {
11432        super::builder::region_health_check_services::GetOperation::new(self.inner.clone())
11433    }
11434}
11435
11436/// Implements a client for the Google Compute Engine API.
11437///
11438/// # Example
11439/// ```
11440/// # use google_cloud_compute_v1::client::RegionHealthChecks;
11441/// async fn sample(
11442/// ) -> anyhow::Result<()> {
11443///     let client = RegionHealthChecks::builder().build().await?;
11444///     // use `client` to make requests to the Google Compute Engine API.
11445///     Ok(())
11446/// }
11447/// ```
11448///
11449/// # Service Description
11450///
11451/// Service for the `regionHealthChecks` resource.
11452///
11453/// # Configuration
11454///
11455/// To configure `RegionHealthChecks` use the `with_*` methods in the type returned
11456/// by [builder()][RegionHealthChecks::builder]. The default configuration should
11457/// work for most applications. Common configuration changes include
11458///
11459/// * [with_endpoint()]: by default this client uses the global default endpoint
11460///   (`https://compute.googleapis.com`). Applications using regional
11461///   endpoints or running in restricted networks (e.g. a network configured
11462//    with [Private Google Access with VPC Service Controls]) may want to
11463///   override this default.
11464/// * [with_credentials()]: by default this client uses
11465///   [Application Default Credentials]. Applications using custom
11466///   authentication may need to override this default.
11467///
11468/// [with_endpoint()]: super::builder::region_health_checks::ClientBuilder::with_endpoint
11469/// [with_credentials()]: super::builder::region_health_checks::ClientBuilder::with_credentials
11470/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11471/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11472///
11473/// # Pooling and Cloning
11474///
11475/// `RegionHealthChecks` holds a connection pool internally, it is advised to
11476/// create one and reuse it. You do not need to wrap `RegionHealthChecks` in
11477/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11478/// already uses an `Arc` internally.
11479#[cfg(feature = "region-health-checks")]
11480#[cfg_attr(docsrs, doc(cfg(feature = "region-health-checks")))]
11481#[derive(Clone, Debug)]
11482pub struct RegionHealthChecks {
11483    inner: std::sync::Arc<dyn super::stub::dynamic::RegionHealthChecks>,
11484}
11485
11486#[cfg(feature = "region-health-checks")]
11487impl RegionHealthChecks {
11488    /// Returns a builder for [RegionHealthChecks].
11489    ///
11490    /// ```
11491    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11492    /// # use google_cloud_compute_v1::client::RegionHealthChecks;
11493    /// let client = RegionHealthChecks::builder().build().await?;
11494    /// # Ok(()) }
11495    /// ```
11496    pub fn builder() -> super::builder::region_health_checks::ClientBuilder {
11497        crate::new_client_builder(super::builder::region_health_checks::client::Factory)
11498    }
11499
11500    /// Creates a new client from the provided stub.
11501    ///
11502    /// The most common case for calling this function is in tests mocking the
11503    /// client's behavior.
11504    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
11505    where
11506        T: super::stub::RegionHealthChecks + 'static,
11507    {
11508        Self { inner: stub.into() }
11509    }
11510
11511    pub(crate) async fn new(
11512        config: gaxi::options::ClientConfig,
11513    ) -> crate::ClientBuilderResult<Self> {
11514        let inner = Self::build_inner(config).await?;
11515        Ok(Self { inner })
11516    }
11517
11518    async fn build_inner(
11519        conf: gaxi::options::ClientConfig,
11520    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionHealthChecks>>
11521    {
11522        if gaxi::options::tracing_enabled(&conf) {
11523            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11524        }
11525        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11526    }
11527
11528    async fn build_transport(
11529        conf: gaxi::options::ClientConfig,
11530    ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthChecks> {
11531        super::transport::RegionHealthChecks::new(conf).await
11532    }
11533
11534    async fn build_with_tracing(
11535        conf: gaxi::options::ClientConfig,
11536    ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthChecks> {
11537        Self::build_transport(conf)
11538            .await
11539            .map(super::tracing::RegionHealthChecks::new)
11540    }
11541
11542    /// Deletes the specified HealthCheck resource.
11543    pub fn delete(&self) -> super::builder::region_health_checks::Delete {
11544        super::builder::region_health_checks::Delete::new(self.inner.clone())
11545    }
11546
11547    /// Returns the specified HealthCheck resource.
11548    pub fn get(&self) -> super::builder::region_health_checks::Get {
11549        super::builder::region_health_checks::Get::new(self.inner.clone())
11550    }
11551
11552    /// Creates a HealthCheck resource in the specified project using the data
11553    /// included in the request.
11554    pub fn insert(&self) -> super::builder::region_health_checks::Insert {
11555        super::builder::region_health_checks::Insert::new(self.inner.clone())
11556    }
11557
11558    /// Retrieves the list of HealthCheck resources available to the specified
11559    /// project.
11560    pub fn list(&self) -> super::builder::region_health_checks::List {
11561        super::builder::region_health_checks::List::new(self.inner.clone())
11562    }
11563
11564    /// Updates a HealthCheck resource in the specified project using the data
11565    /// included in the request. This method supportsPATCH
11566    /// semantics and uses theJSON merge
11567    /// patch format and processing rules.
11568    pub fn patch(&self) -> super::builder::region_health_checks::Patch {
11569        super::builder::region_health_checks::Patch::new(self.inner.clone())
11570    }
11571
11572    /// Returns permissions that a caller has on the specified resource.
11573    pub fn test_iam_permissions(&self) -> super::builder::region_health_checks::TestIamPermissions {
11574        super::builder::region_health_checks::TestIamPermissions::new(self.inner.clone())
11575    }
11576
11577    /// Updates a HealthCheck resource in the specified project using the data
11578    /// included in the request.
11579    pub fn update(&self) -> super::builder::region_health_checks::Update {
11580        super::builder::region_health_checks::Update::new(self.inner.clone())
11581    }
11582
11583    /// Retrieves the specified region-specific Operations resource.
11584    pub fn get_operation(&self) -> super::builder::region_health_checks::GetOperation {
11585        super::builder::region_health_checks::GetOperation::new(self.inner.clone())
11586    }
11587}
11588
11589/// Implements a client for the Google Compute Engine API.
11590///
11591/// # Example
11592/// ```
11593/// # use google_cloud_compute_v1::client::RegionHealthSources;
11594/// async fn sample(
11595/// ) -> anyhow::Result<()> {
11596///     let client = RegionHealthSources::builder().build().await?;
11597///     // use `client` to make requests to the Google Compute Engine API.
11598///     Ok(())
11599/// }
11600/// ```
11601///
11602/// # Service Description
11603///
11604/// Service for the `regionHealthSources` resource.
11605///
11606/// # Configuration
11607///
11608/// To configure `RegionHealthSources` use the `with_*` methods in the type returned
11609/// by [builder()][RegionHealthSources::builder]. The default configuration should
11610/// work for most applications. Common configuration changes include
11611///
11612/// * [with_endpoint()]: by default this client uses the global default endpoint
11613///   (`https://compute.googleapis.com`). Applications using regional
11614///   endpoints or running in restricted networks (e.g. a network configured
11615//    with [Private Google Access with VPC Service Controls]) may want to
11616///   override this default.
11617/// * [with_credentials()]: by default this client uses
11618///   [Application Default Credentials]. Applications using custom
11619///   authentication may need to override this default.
11620///
11621/// [with_endpoint()]: super::builder::region_health_sources::ClientBuilder::with_endpoint
11622/// [with_credentials()]: super::builder::region_health_sources::ClientBuilder::with_credentials
11623/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11624/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11625///
11626/// # Pooling and Cloning
11627///
11628/// `RegionHealthSources` holds a connection pool internally, it is advised to
11629/// create one and reuse it. You do not need to wrap `RegionHealthSources` in
11630/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11631/// already uses an `Arc` internally.
11632#[cfg(feature = "region-health-sources")]
11633#[cfg_attr(docsrs, doc(cfg(feature = "region-health-sources")))]
11634#[derive(Clone, Debug)]
11635pub struct RegionHealthSources {
11636    inner: std::sync::Arc<dyn super::stub::dynamic::RegionHealthSources>,
11637}
11638
11639#[cfg(feature = "region-health-sources")]
11640impl RegionHealthSources {
11641    /// Returns a builder for [RegionHealthSources].
11642    ///
11643    /// ```
11644    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11645    /// # use google_cloud_compute_v1::client::RegionHealthSources;
11646    /// let client = RegionHealthSources::builder().build().await?;
11647    /// # Ok(()) }
11648    /// ```
11649    pub fn builder() -> super::builder::region_health_sources::ClientBuilder {
11650        crate::new_client_builder(super::builder::region_health_sources::client::Factory)
11651    }
11652
11653    /// Creates a new client from the provided stub.
11654    ///
11655    /// The most common case for calling this function is in tests mocking the
11656    /// client's behavior.
11657    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
11658    where
11659        T: super::stub::RegionHealthSources + 'static,
11660    {
11661        Self { inner: stub.into() }
11662    }
11663
11664    pub(crate) async fn new(
11665        config: gaxi::options::ClientConfig,
11666    ) -> crate::ClientBuilderResult<Self> {
11667        let inner = Self::build_inner(config).await?;
11668        Ok(Self { inner })
11669    }
11670
11671    async fn build_inner(
11672        conf: gaxi::options::ClientConfig,
11673    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionHealthSources>>
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::RegionHealthSources> {
11684        super::transport::RegionHealthSources::new(conf).await
11685    }
11686
11687    async fn build_with_tracing(
11688        conf: gaxi::options::ClientConfig,
11689    ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthSources> {
11690        Self::build_transport(conf)
11691            .await
11692            .map(super::tracing::RegionHealthSources::new)
11693    }
11694
11695    /// Retrieves the list of all HealthSource resources (all
11696    /// regional) available to the specified project.
11697    ///
11698    /// To prevent failure, Google recommends that you set the
11699    /// `returnPartialSuccess` parameter to `true`.
11700    pub fn aggregated_list(&self) -> super::builder::region_health_sources::AggregatedList {
11701        super::builder::region_health_sources::AggregatedList::new(self.inner.clone())
11702    }
11703
11704    /// Deletes the specified HealthSource in the given region
11705    pub fn delete(&self) -> super::builder::region_health_sources::Delete {
11706        super::builder::region_health_sources::Delete::new(self.inner.clone())
11707    }
11708
11709    /// Returns the specified HealthSource resource in the given region.
11710    pub fn get(&self) -> super::builder::region_health_sources::Get {
11711        super::builder::region_health_sources::Get::new(self.inner.clone())
11712    }
11713
11714    /// Gets the most recent health check results for this
11715    /// regional HealthSource.
11716    pub fn get_health(&self) -> super::builder::region_health_sources::GetHealth {
11717        super::builder::region_health_sources::GetHealth::new(self.inner.clone())
11718    }
11719
11720    /// Create a HealthSource in the specified project in the given region
11721    /// using the parameters that are included in the request.
11722    pub fn insert(&self) -> super::builder::region_health_sources::Insert {
11723        super::builder::region_health_sources::Insert::new(self.inner.clone())
11724    }
11725
11726    /// Lists the HealthSources for a project in the given region.
11727    pub fn list(&self) -> super::builder::region_health_sources::List {
11728        super::builder::region_health_sources::List::new(self.inner.clone())
11729    }
11730
11731    /// Updates the specified regional HealthSource resource
11732    /// with the data included in the request.  This method supportsPATCH
11733    /// semantics and uses theJSON merge
11734    /// patch format and processing rules.
11735    pub fn patch(&self) -> super::builder::region_health_sources::Patch {
11736        super::builder::region_health_sources::Patch::new(self.inner.clone())
11737    }
11738
11739    /// Returns permissions that a caller has on the specified resource.
11740    pub fn test_iam_permissions(
11741        &self,
11742    ) -> super::builder::region_health_sources::TestIamPermissions {
11743        super::builder::region_health_sources::TestIamPermissions::new(self.inner.clone())
11744    }
11745
11746    /// Retrieves the specified region-specific Operations resource.
11747    pub fn get_operation(&self) -> super::builder::region_health_sources::GetOperation {
11748        super::builder::region_health_sources::GetOperation::new(self.inner.clone())
11749    }
11750}
11751
11752/// Implements a client for the Google Compute Engine API.
11753///
11754/// # Example
11755/// ```
11756/// # use google_cloud_compute_v1::client::RegionInstanceGroupManagerResizeRequests;
11757/// async fn sample(
11758/// ) -> anyhow::Result<()> {
11759///     let client = RegionInstanceGroupManagerResizeRequests::builder().build().await?;
11760///     // use `client` to make requests to the Google Compute Engine API.
11761///     Ok(())
11762/// }
11763/// ```
11764///
11765/// # Service Description
11766///
11767/// Service for the `regionInstanceGroupManagerResizeRequests` resource.
11768///
11769/// # Configuration
11770///
11771/// To configure `RegionInstanceGroupManagerResizeRequests` use the `with_*` methods in the type returned
11772/// by [builder()][RegionInstanceGroupManagerResizeRequests::builder]. The default configuration should
11773/// work for most applications. Common configuration changes include
11774///
11775/// * [with_endpoint()]: by default this client uses the global default endpoint
11776///   (`https://compute.googleapis.com`). Applications using regional
11777///   endpoints or running in restricted networks (e.g. a network configured
11778//    with [Private Google Access with VPC Service Controls]) may want to
11779///   override this default.
11780/// * [with_credentials()]: by default this client uses
11781///   [Application Default Credentials]. Applications using custom
11782///   authentication may need to override this default.
11783///
11784/// [with_endpoint()]: super::builder::region_instance_group_manager_resize_requests::ClientBuilder::with_endpoint
11785/// [with_credentials()]: super::builder::region_instance_group_manager_resize_requests::ClientBuilder::with_credentials
11786/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11787/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11788///
11789/// # Pooling and Cloning
11790///
11791/// `RegionInstanceGroupManagerResizeRequests` holds a connection pool internally, it is advised to
11792/// create one and reuse it. You do not need to wrap `RegionInstanceGroupManagerResizeRequests` in
11793/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11794/// already uses an `Arc` internally.
11795#[cfg(feature = "region-instance-group-manager-resize-requests")]
11796#[cfg_attr(
11797    docsrs,
11798    doc(cfg(feature = "region-instance-group-manager-resize-requests"))
11799)]
11800#[derive(Clone, Debug)]
11801pub struct RegionInstanceGroupManagerResizeRequests {
11802    inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroupManagerResizeRequests>,
11803}
11804
11805#[cfg(feature = "region-instance-group-manager-resize-requests")]
11806impl RegionInstanceGroupManagerResizeRequests {
11807    /// Returns a builder for [RegionInstanceGroupManagerResizeRequests].
11808    ///
11809    /// ```
11810    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11811    /// # use google_cloud_compute_v1::client::RegionInstanceGroupManagerResizeRequests;
11812    /// let client = RegionInstanceGroupManagerResizeRequests::builder().build().await?;
11813    /// # Ok(()) }
11814    /// ```
11815    pub fn builder() -> super::builder::region_instance_group_manager_resize_requests::ClientBuilder
11816    {
11817        crate::new_client_builder(
11818            super::builder::region_instance_group_manager_resize_requests::client::Factory,
11819        )
11820    }
11821
11822    /// Creates a new client from the provided stub.
11823    ///
11824    /// The most common case for calling this function is in tests mocking the
11825    /// client's behavior.
11826    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
11827    where
11828        T: super::stub::RegionInstanceGroupManagerResizeRequests + 'static,
11829    {
11830        Self { inner: stub.into() }
11831    }
11832
11833    pub(crate) async fn new(
11834        config: gaxi::options::ClientConfig,
11835    ) -> crate::ClientBuilderResult<Self> {
11836        let inner = Self::build_inner(config).await?;
11837        Ok(Self { inner })
11838    }
11839
11840    async fn build_inner(
11841        conf: gaxi::options::ClientConfig,
11842    ) -> crate::ClientBuilderResult<
11843        std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroupManagerResizeRequests>,
11844    > {
11845        if gaxi::options::tracing_enabled(&conf) {
11846            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11847        }
11848        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11849    }
11850
11851    async fn build_transport(
11852        conf: gaxi::options::ClientConfig,
11853    ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroupManagerResizeRequests>
11854    {
11855        super::transport::RegionInstanceGroupManagerResizeRequests::new(conf).await
11856    }
11857
11858    async fn build_with_tracing(
11859        conf: gaxi::options::ClientConfig,
11860    ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroupManagerResizeRequests>
11861    {
11862        Self::build_transport(conf)
11863            .await
11864            .map(super::tracing::RegionInstanceGroupManagerResizeRequests::new)
11865    }
11866
11867    /// Cancels the specified resize request.
11868    /// Cancelled resize request no longer waits for the resources to be
11869    /// provisioned. Cancel is only possible for requests that are in accepted
11870    /// state.
11871    pub fn cancel(&self) -> super::builder::region_instance_group_manager_resize_requests::Cancel {
11872        super::builder::region_instance_group_manager_resize_requests::Cancel::new(
11873            self.inner.clone(),
11874        )
11875    }
11876
11877    /// Deletes the specified, inactive resize request. Requests that are still
11878    /// active cannot be deleted. Deleting request does not delete instances that
11879    /// were provisioned previously.
11880    pub fn delete(&self) -> super::builder::region_instance_group_manager_resize_requests::Delete {
11881        super::builder::region_instance_group_manager_resize_requests::Delete::new(
11882            self.inner.clone(),
11883        )
11884    }
11885
11886    /// Returns all of the details about the specified resize request.
11887    pub fn get(&self) -> super::builder::region_instance_group_manager_resize_requests::Get {
11888        super::builder::region_instance_group_manager_resize_requests::Get::new(self.inner.clone())
11889    }
11890
11891    /// Creates a new Resize Request that starts provisioning VMs immediately
11892    /// or queues VM creation.
11893    pub fn insert(&self) -> super::builder::region_instance_group_manager_resize_requests::Insert {
11894        super::builder::region_instance_group_manager_resize_requests::Insert::new(
11895            self.inner.clone(),
11896        )
11897    }
11898
11899    /// Retrieves a list of Resize Requests that are contained in the
11900    /// managed instance group.
11901    pub fn list(&self) -> super::builder::region_instance_group_manager_resize_requests::List {
11902        super::builder::region_instance_group_manager_resize_requests::List::new(self.inner.clone())
11903    }
11904
11905    /// Retrieves the specified region-specific Operations resource.
11906    pub fn get_operation(
11907        &self,
11908    ) -> super::builder::region_instance_group_manager_resize_requests::GetOperation {
11909        super::builder::region_instance_group_manager_resize_requests::GetOperation::new(
11910            self.inner.clone(),
11911        )
11912    }
11913}
11914
11915/// Implements a client for the Google Compute Engine API.
11916///
11917/// # Example
11918/// ```
11919/// # use google_cloud_compute_v1::client::RegionInstanceGroupManagers;
11920/// async fn sample(
11921/// ) -> anyhow::Result<()> {
11922///     let client = RegionInstanceGroupManagers::builder().build().await?;
11923///     // use `client` to make requests to the Google Compute Engine API.
11924///     Ok(())
11925/// }
11926/// ```
11927///
11928/// # Service Description
11929///
11930/// Service for the `regionInstanceGroupManagers` resource.
11931///
11932/// # Configuration
11933///
11934/// To configure `RegionInstanceGroupManagers` use the `with_*` methods in the type returned
11935/// by [builder()][RegionInstanceGroupManagers::builder]. The default configuration should
11936/// work for most applications. Common configuration changes include
11937///
11938/// * [with_endpoint()]: by default this client uses the global default endpoint
11939///   (`https://compute.googleapis.com`). Applications using regional
11940///   endpoints or running in restricted networks (e.g. a network configured
11941//    with [Private Google Access with VPC Service Controls]) may want to
11942///   override this default.
11943/// * [with_credentials()]: by default this client uses
11944///   [Application Default Credentials]. Applications using custom
11945///   authentication may need to override this default.
11946///
11947/// [with_endpoint()]: super::builder::region_instance_group_managers::ClientBuilder::with_endpoint
11948/// [with_credentials()]: super::builder::region_instance_group_managers::ClientBuilder::with_credentials
11949/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11950/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11951///
11952/// # Pooling and Cloning
11953///
11954/// `RegionInstanceGroupManagers` holds a connection pool internally, it is advised to
11955/// create one and reuse it. You do not need to wrap `RegionInstanceGroupManagers` in
11956/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11957/// already uses an `Arc` internally.
11958#[cfg(feature = "region-instance-group-managers")]
11959#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-group-managers")))]
11960#[derive(Clone, Debug)]
11961pub struct RegionInstanceGroupManagers {
11962    inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroupManagers>,
11963}
11964
11965#[cfg(feature = "region-instance-group-managers")]
11966impl RegionInstanceGroupManagers {
11967    /// Returns a builder for [RegionInstanceGroupManagers].
11968    ///
11969    /// ```
11970    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11971    /// # use google_cloud_compute_v1::client::RegionInstanceGroupManagers;
11972    /// let client = RegionInstanceGroupManagers::builder().build().await?;
11973    /// # Ok(()) }
11974    /// ```
11975    pub fn builder() -> super::builder::region_instance_group_managers::ClientBuilder {
11976        crate::new_client_builder(super::builder::region_instance_group_managers::client::Factory)
11977    }
11978
11979    /// Creates a new client from the provided stub.
11980    ///
11981    /// The most common case for calling this function is in tests mocking the
11982    /// client's behavior.
11983    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
11984    where
11985        T: super::stub::RegionInstanceGroupManagers + 'static,
11986    {
11987        Self { inner: stub.into() }
11988    }
11989
11990    pub(crate) async fn new(
11991        config: gaxi::options::ClientConfig,
11992    ) -> crate::ClientBuilderResult<Self> {
11993        let inner = Self::build_inner(config).await?;
11994        Ok(Self { inner })
11995    }
11996
11997    async fn build_inner(
11998        conf: gaxi::options::ClientConfig,
11999    ) -> crate::ClientBuilderResult<
12000        std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroupManagers>,
12001    > {
12002        if gaxi::options::tracing_enabled(&conf) {
12003            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12004        }
12005        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12006    }
12007
12008    async fn build_transport(
12009        conf: gaxi::options::ClientConfig,
12010    ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroupManagers> {
12011        super::transport::RegionInstanceGroupManagers::new(conf).await
12012    }
12013
12014    async fn build_with_tracing(
12015        conf: gaxi::options::ClientConfig,
12016    ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroupManagers> {
12017        Self::build_transport(conf)
12018            .await
12019            .map(super::tracing::RegionInstanceGroupManagers::new)
12020    }
12021
12022    /// Flags the specified instances to be immediately removed from the managed
12023    /// instance group. Abandoning an instance does not delete the
12024    /// instance, but it does remove the instance from any target pools that are
12025    /// applied by the managed instance group. This method reduces thetargetSize of the managed instance group by the
12026    /// number of instances that you abandon. This operation is marked asDONE when the action is scheduled even if the instances have
12027    /// not yet been removed from the group. You must separately verify the
12028    /// status of the abandoning action with thelistmanagedinstances
12029    /// method.
12030    ///
12031    /// If the group is part of a backend
12032    /// service that has enabled
12033    /// connection draining, it can take up to 60 seconds after the connection
12034    /// draining duration has elapsed before the VM instance is removed or deleted.
12035    ///
12036    /// You can specify a maximum of 1000 instances with this method per request.
12037    pub fn abandon_instances(
12038        &self,
12039    ) -> super::builder::region_instance_group_managers::AbandonInstances {
12040        super::builder::region_instance_group_managers::AbandonInstances::new(self.inner.clone())
12041    }
12042
12043    /// Apply updates to selected instances the managed instance group.
12044    pub fn apply_updates_to_instances(
12045        &self,
12046    ) -> super::builder::region_instance_group_managers::ApplyUpdatesToInstances {
12047        super::builder::region_instance_group_managers::ApplyUpdatesToInstances::new(
12048            self.inner.clone(),
12049        )
12050    }
12051
12052    /// Creates instances with per-instance configurations in this regional managed
12053    /// instance group. Instances are created using the current instance template.
12054    /// The create instances operation is marked DONE if
12055    /// the createInstances request is successful. The underlying
12056    /// actions take additional time. You must separately verify the status of thecreating or actions with the listmanagedinstances
12057    /// method.
12058    pub fn create_instances(
12059        &self,
12060    ) -> super::builder::region_instance_group_managers::CreateInstances {
12061        super::builder::region_instance_group_managers::CreateInstances::new(self.inner.clone())
12062    }
12063
12064    /// Deletes the specified managed instance group and all of the instances
12065    /// in that group.
12066    pub fn delete(&self) -> super::builder::region_instance_group_managers::Delete {
12067        super::builder::region_instance_group_managers::Delete::new(self.inner.clone())
12068    }
12069
12070    /// Flags the specified instances in the managed instance group to be
12071    /// immediately deleted. The instances are also removed from any target
12072    /// pools of which they were a member. This method reduces thetargetSize of the managed instance group by the number of
12073    /// instances that you delete.
12074    /// The deleteInstances operation is marked DONE if
12075    /// the deleteInstances request is successful. The underlying
12076    /// actions take additional time. You must separately verify the status of thedeleting action with thelistmanagedinstances
12077    /// method.
12078    ///
12079    /// If the group is part of a backend
12080    /// service that has enabled
12081    /// connection draining, it can take up to 60 seconds after the connection
12082    /// draining duration has elapsed before the VM instance is removed or deleted.
12083    ///
12084    /// You can specify a maximum of 1000 instances with this method per request.
12085    pub fn delete_instances(
12086        &self,
12087    ) -> super::builder::region_instance_group_managers::DeleteInstances {
12088        super::builder::region_instance_group_managers::DeleteInstances::new(self.inner.clone())
12089    }
12090
12091    /// Deletes selected per-instance configurations for the managed instance
12092    /// group.
12093    pub fn delete_per_instance_configs(
12094        &self,
12095    ) -> super::builder::region_instance_group_managers::DeletePerInstanceConfigs {
12096        super::builder::region_instance_group_managers::DeletePerInstanceConfigs::new(
12097            self.inner.clone(),
12098        )
12099    }
12100
12101    /// Returns all of the details about the specified managed instance group.
12102    pub fn get(&self) -> super::builder::region_instance_group_managers::Get {
12103        super::builder::region_instance_group_managers::Get::new(self.inner.clone())
12104    }
12105
12106    /// Creates a managed instance group using the information that you specify
12107    /// in the request. After the group is created, instances in the group are
12108    /// created using the specified instance template.
12109    /// This operation is marked as DONE when the group is created
12110    /// even if the instances in the group have not yet been created. You must
12111    /// separately verify the status of the individual instances with thelistmanagedinstances
12112    /// method.
12113    ///
12114    /// A regional managed instance group can contain up to 2000 instances.
12115    pub fn insert(&self) -> super::builder::region_instance_group_managers::Insert {
12116        super::builder::region_instance_group_managers::Insert::new(self.inner.clone())
12117    }
12118
12119    /// Retrieves the list of managed instance groups that are contained
12120    /// within the specified region.
12121    pub fn list(&self) -> super::builder::region_instance_group_managers::List {
12122        super::builder::region_instance_group_managers::List::new(self.inner.clone())
12123    }
12124
12125    /// Lists all errors thrown by actions on instances for a given regional
12126    /// managed instance group. The filter andorderBy query parameters are not supported.
12127    pub fn list_errors(&self) -> super::builder::region_instance_group_managers::ListErrors {
12128        super::builder::region_instance_group_managers::ListErrors::new(self.inner.clone())
12129    }
12130
12131    /// Lists the instances in the managed instance group and instances that are
12132    /// scheduled to be created. The list includes any current actions
12133    /// that the group has scheduled for its instances. The orderBy
12134    /// query parameter is not supported.   The `pageToken` query parameter is
12135    /// supported only if the group's `listManagedInstancesResults` field is set
12136    /// to `PAGINATED`.
12137    pub fn list_managed_instances(
12138        &self,
12139    ) -> super::builder::region_instance_group_managers::ListManagedInstances {
12140        super::builder::region_instance_group_managers::ListManagedInstances::new(
12141            self.inner.clone(),
12142        )
12143    }
12144
12145    /// Lists all of the per-instance configurations defined for the managed
12146    /// instance group. The orderBy query parameter is not supported.
12147    pub fn list_per_instance_configs(
12148        &self,
12149    ) -> super::builder::region_instance_group_managers::ListPerInstanceConfigs {
12150        super::builder::region_instance_group_managers::ListPerInstanceConfigs::new(
12151            self.inner.clone(),
12152        )
12153    }
12154
12155    /// Updates a managed instance group using the information that you specify
12156    /// in the request.
12157    /// This operation is marked as DONE when the group is patched
12158    /// even if the instances in the group are still in the process of being
12159    /// patched. You must separately verify the status of the individual instances
12160    /// with the listmanagedinstances
12161    /// method. This method supportsPATCH
12162    /// semantics and uses theJSON merge
12163    /// patch format and processing rules.
12164    ///
12165    /// If you update your group to specify a new template or instance
12166    /// configuration, it's possible that your intended specification for each VM
12167    /// in the group is different from the current state of that VM. To learn how
12168    /// to apply an updated configuration to the VMs in a MIG, seeUpdating instances in
12169    /// a MIG.
12170    pub fn patch(&self) -> super::builder::region_instance_group_managers::Patch {
12171        super::builder::region_instance_group_managers::Patch::new(self.inner.clone())
12172    }
12173
12174    /// Inserts or patches per-instance configurations for the managed instance
12175    /// group. perInstanceConfig.name serves as a key used to
12176    /// distinguish whether to perform insert or patch.
12177    pub fn patch_per_instance_configs(
12178        &self,
12179    ) -> super::builder::region_instance_group_managers::PatchPerInstanceConfigs {
12180        super::builder::region_instance_group_managers::PatchPerInstanceConfigs::new(
12181            self.inner.clone(),
12182        )
12183    }
12184
12185    /// Flags the specified VM instances in the managed instance group to be
12186    /// immediately recreated. Each instance is recreated using the group's current
12187    /// configuration. This operation is marked as DONE when the flag
12188    /// is set even if the instances have not yet been recreated. You must
12189    /// separately verify the status of each instance by checking itscurrentAction field; for more information, see Checking
12190    /// the status of managed instances.
12191    ///
12192    /// If the group is part of a backend
12193    /// service that has enabled
12194    /// connection draining, it can take up to 60 seconds after the connection
12195    /// draining duration has elapsed before the VM instance is removed or deleted.
12196    ///
12197    /// You can specify a maximum of 1000 instances with this method per request.
12198    pub fn recreate_instances(
12199        &self,
12200    ) -> super::builder::region_instance_group_managers::RecreateInstances {
12201        super::builder::region_instance_group_managers::RecreateInstances::new(self.inner.clone())
12202    }
12203
12204    /// Changes the intended size of the managed instance group. If you increase
12205    /// the size, the group creates new instances using the current instance
12206    /// template. If you decrease the size, the group deletes one or more
12207    /// instances.
12208    ///
12209    /// The resize operation is marked DONE if theresize request is successful. The underlying actions take
12210    /// additional time. You must separately verify the status of thecreating or deleting actions with thelistmanagedinstances
12211    /// method.
12212    ///
12213    /// If the group is part of a backend
12214    /// service that has enabled
12215    /// connection draining, it can take up to 60 seconds after the connection
12216    /// draining duration has elapsed before the VM instance is removed or deleted.
12217    pub fn resize(&self) -> super::builder::region_instance_group_managers::Resize {
12218        super::builder::region_instance_group_managers::Resize::new(self.inner.clone())
12219    }
12220
12221    /// Flags the specified instances in the managed instance group to be
12222    /// resumed. This method increases thetargetSize and decreases the targetSuspendedSize
12223    /// of the managed instance group by the number of instances that you resume.
12224    /// The resumeInstances operation is marked DONE if
12225    /// the resumeInstances request is successful. The underlying
12226    /// actions take additional time. You must separately verify the status of theRESUMING action with thelistmanagedinstances
12227    /// method.
12228    ///
12229    /// In this request, you can only specify instances that are suspended. For
12230    /// example, if an instance was previously suspended using the suspendInstances
12231    /// method, it can be resumed using the resumeInstances method.
12232    ///
12233    /// If a health check is attached to the managed instance group, the specified
12234    /// instances will be verified as healthy after they are resumed.
12235    ///
12236    /// You can specify a maximum of 1000 instances with this method per request.
12237    pub fn resume_instances(
12238        &self,
12239    ) -> super::builder::region_instance_group_managers::ResumeInstances {
12240        super::builder::region_instance_group_managers::ResumeInstances::new(self.inner.clone())
12241    }
12242
12243    /// Sets the instance template to use when creating new instances or recreating
12244    /// instances in this group. Existing instances are not affected.
12245    pub fn set_instance_template(
12246        &self,
12247    ) -> super::builder::region_instance_group_managers::SetInstanceTemplate {
12248        super::builder::region_instance_group_managers::SetInstanceTemplate::new(self.inner.clone())
12249    }
12250
12251    /// Modifies the target pools to which all new instances in this group are
12252    /// assigned. Existing instances in the group are not affected.
12253    pub fn set_target_pools(
12254        &self,
12255    ) -> super::builder::region_instance_group_managers::SetTargetPools {
12256        super::builder::region_instance_group_managers::SetTargetPools::new(self.inner.clone())
12257    }
12258
12259    /// Flags the specified instances in the managed instance group to be
12260    /// started. This method increases thetargetSize and decreases the targetStoppedSize
12261    /// of the managed instance group by the number of instances that you start.
12262    /// The startInstances operation is marked DONE if
12263    /// the startInstances request is successful. The underlying
12264    /// actions take additional time. You must separately verify the status of theSTARTING action with thelistmanagedinstances
12265    /// method.
12266    ///
12267    /// In this request, you can only specify instances that are stopped. For
12268    /// example, if an instance was previously stopped using the stopInstances
12269    /// method, it can be started using the startInstances method.
12270    ///
12271    /// If a health check is attached to the managed instance group, the specified
12272    /// instances will be verified as healthy after they are started.
12273    ///
12274    /// You can specify a maximum of 1000 instances with this method per request.
12275    pub fn start_instances(
12276        &self,
12277    ) -> super::builder::region_instance_group_managers::StartInstances {
12278        super::builder::region_instance_group_managers::StartInstances::new(self.inner.clone())
12279    }
12280
12281    /// Flags the specified instances in the managed instance group to be
12282    /// immediately stopped. You can only specify instances that are running in
12283    /// this request. This method reduces thetargetSize and increases the targetStoppedSize
12284    /// of the managed instance group by the number of instances that you stop.
12285    /// The stopInstances operation is marked DONE if
12286    /// the stopInstances request is successful. The underlying
12287    /// actions take additional time. You must separately verify the status of theSTOPPING action with thelistmanagedinstances
12288    /// method.
12289    ///
12290    /// If the standbyPolicy.initialDelaySec field is set, the group
12291    /// delays stopping the instances until initialDelaySec have
12292    /// passed from instance.creationTimestamp (that is, when the
12293    /// instance was created). This delay gives your application time to
12294    /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
12295    /// will be zero delay.
12296    ///
12297    /// If the group is part of a backend
12298    /// service that has enabled
12299    /// connection draining, it can take up to 60 seconds after the connection
12300    /// draining duration has elapsed before the VM instance is stopped.
12301    ///
12302    /// Stopped instances can be started using the startInstances
12303    /// method.
12304    ///
12305    /// You can specify a maximum of 1000 instances with this method per request.
12306    pub fn stop_instances(&self) -> super::builder::region_instance_group_managers::StopInstances {
12307        super::builder::region_instance_group_managers::StopInstances::new(self.inner.clone())
12308    }
12309
12310    /// Flags the specified instances in the managed instance group to be
12311    /// immediately suspended. You can only specify instances that are running in
12312    /// this request. This method reduces thetargetSize and increases the targetSuspendedSize
12313    /// of the managed instance group by the number of instances that you suspend.
12314    /// The suspendInstances operation is marked DONE if
12315    /// the suspendInstances request is successful. The underlying
12316    /// actions take additional time. You must separately verify the status of theSUSPENDING action with thelistmanagedinstances
12317    /// method.
12318    ///
12319    /// If the standbyPolicy.initialDelaySec field is set, the group
12320    /// delays suspension of the instances until initialDelaySec have
12321    /// passed from instance.creationTimestamp (that is, when the
12322    /// instance was created). This delay gives your application time to
12323    /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
12324    /// will be zero delay.
12325    ///
12326    /// If the group is part of a backend
12327    /// service that has enabled
12328    /// connection draining, it can take up to 60 seconds after the connection
12329    /// draining duration has elapsed before the VM instance is suspended.
12330    ///
12331    /// Suspended instances can be resumed using the resumeInstances
12332    /// method.
12333    ///
12334    /// You can specify a maximum of 1000 instances with this method per request.
12335    pub fn suspend_instances(
12336        &self,
12337    ) -> super::builder::region_instance_group_managers::SuspendInstances {
12338        super::builder::region_instance_group_managers::SuspendInstances::new(self.inner.clone())
12339    }
12340
12341    /// Inserts or updates per-instance configurations for the managed instance
12342    /// group. perInstanceConfig.name serves as a key used to
12343    /// distinguish whether to perform insert or patch.
12344    pub fn update_per_instance_configs(
12345        &self,
12346    ) -> super::builder::region_instance_group_managers::UpdatePerInstanceConfigs {
12347        super::builder::region_instance_group_managers::UpdatePerInstanceConfigs::new(
12348            self.inner.clone(),
12349        )
12350    }
12351
12352    /// Retrieves the specified region-specific Operations resource.
12353    pub fn get_operation(&self) -> super::builder::region_instance_group_managers::GetOperation {
12354        super::builder::region_instance_group_managers::GetOperation::new(self.inner.clone())
12355    }
12356}
12357
12358/// Implements a client for the Google Compute Engine API.
12359///
12360/// # Example
12361/// ```
12362/// # use google_cloud_compute_v1::client::RegionInstanceGroups;
12363/// async fn sample(
12364/// ) -> anyhow::Result<()> {
12365///     let client = RegionInstanceGroups::builder().build().await?;
12366///     // use `client` to make requests to the Google Compute Engine API.
12367///     Ok(())
12368/// }
12369/// ```
12370///
12371/// # Service Description
12372///
12373/// Service for the `regionInstanceGroups` resource.
12374///
12375/// # Configuration
12376///
12377/// To configure `RegionInstanceGroups` use the `with_*` methods in the type returned
12378/// by [builder()][RegionInstanceGroups::builder]. The default configuration should
12379/// work for most applications. Common configuration changes include
12380///
12381/// * [with_endpoint()]: by default this client uses the global default endpoint
12382///   (`https://compute.googleapis.com`). Applications using regional
12383///   endpoints or running in restricted networks (e.g. a network configured
12384//    with [Private Google Access with VPC Service Controls]) may want to
12385///   override this default.
12386/// * [with_credentials()]: by default this client uses
12387///   [Application Default Credentials]. Applications using custom
12388///   authentication may need to override this default.
12389///
12390/// [with_endpoint()]: super::builder::region_instance_groups::ClientBuilder::with_endpoint
12391/// [with_credentials()]: super::builder::region_instance_groups::ClientBuilder::with_credentials
12392/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12393/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12394///
12395/// # Pooling and Cloning
12396///
12397/// `RegionInstanceGroups` holds a connection pool internally, it is advised to
12398/// create one and reuse it. You do not need to wrap `RegionInstanceGroups` in
12399/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12400/// already uses an `Arc` internally.
12401#[cfg(feature = "region-instance-groups")]
12402#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-groups")))]
12403#[derive(Clone, Debug)]
12404pub struct RegionInstanceGroups {
12405    inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroups>,
12406}
12407
12408#[cfg(feature = "region-instance-groups")]
12409impl RegionInstanceGroups {
12410    /// Returns a builder for [RegionInstanceGroups].
12411    ///
12412    /// ```
12413    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12414    /// # use google_cloud_compute_v1::client::RegionInstanceGroups;
12415    /// let client = RegionInstanceGroups::builder().build().await?;
12416    /// # Ok(()) }
12417    /// ```
12418    pub fn builder() -> super::builder::region_instance_groups::ClientBuilder {
12419        crate::new_client_builder(super::builder::region_instance_groups::client::Factory)
12420    }
12421
12422    /// Creates a new client from the provided stub.
12423    ///
12424    /// The most common case for calling this function is in tests mocking the
12425    /// client's behavior.
12426    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
12427    where
12428        T: super::stub::RegionInstanceGroups + 'static,
12429    {
12430        Self { inner: stub.into() }
12431    }
12432
12433    pub(crate) async fn new(
12434        config: gaxi::options::ClientConfig,
12435    ) -> crate::ClientBuilderResult<Self> {
12436        let inner = Self::build_inner(config).await?;
12437        Ok(Self { inner })
12438    }
12439
12440    async fn build_inner(
12441        conf: gaxi::options::ClientConfig,
12442    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroups>>
12443    {
12444        if gaxi::options::tracing_enabled(&conf) {
12445            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12446        }
12447        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12448    }
12449
12450    async fn build_transport(
12451        conf: gaxi::options::ClientConfig,
12452    ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroups> {
12453        super::transport::RegionInstanceGroups::new(conf).await
12454    }
12455
12456    async fn build_with_tracing(
12457        conf: gaxi::options::ClientConfig,
12458    ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroups> {
12459        Self::build_transport(conf)
12460            .await
12461            .map(super::tracing::RegionInstanceGroups::new)
12462    }
12463
12464    /// Returns the specified instance group resource.
12465    pub fn get(&self) -> super::builder::region_instance_groups::Get {
12466        super::builder::region_instance_groups::Get::new(self.inner.clone())
12467    }
12468
12469    /// Retrieves the list of instance group resources contained within
12470    /// the specified region.
12471    pub fn list(&self) -> super::builder::region_instance_groups::List {
12472        super::builder::region_instance_groups::List::new(self.inner.clone())
12473    }
12474
12475    /// Lists the instances in the specified instance group and displays
12476    /// information about the named ports. Depending on the specified options, this
12477    /// method can list all instances or only the instances that are running.
12478    /// The orderBy query parameter is not supported.
12479    pub fn list_instances(&self) -> super::builder::region_instance_groups::ListInstances {
12480        super::builder::region_instance_groups::ListInstances::new(self.inner.clone())
12481    }
12482
12483    /// Sets the named ports for the specified regional instance group.
12484    pub fn set_named_ports(&self) -> super::builder::region_instance_groups::SetNamedPorts {
12485        super::builder::region_instance_groups::SetNamedPorts::new(self.inner.clone())
12486    }
12487
12488    /// Returns permissions that a caller has on the specified resource.
12489    pub fn test_iam_permissions(
12490        &self,
12491    ) -> super::builder::region_instance_groups::TestIamPermissions {
12492        super::builder::region_instance_groups::TestIamPermissions::new(self.inner.clone())
12493    }
12494
12495    /// Retrieves the specified region-specific Operations resource.
12496    pub fn get_operation(&self) -> super::builder::region_instance_groups::GetOperation {
12497        super::builder::region_instance_groups::GetOperation::new(self.inner.clone())
12498    }
12499}
12500
12501/// Implements a client for the Google Compute Engine API.
12502///
12503/// # Example
12504/// ```
12505/// # use google_cloud_compute_v1::client::RegionInstanceTemplates;
12506/// async fn sample(
12507/// ) -> anyhow::Result<()> {
12508///     let client = RegionInstanceTemplates::builder().build().await?;
12509///     // use `client` to make requests to the Google Compute Engine API.
12510///     Ok(())
12511/// }
12512/// ```
12513///
12514/// # Service Description
12515///
12516/// Service for the `regionInstanceTemplates` resource.
12517///
12518/// # Configuration
12519///
12520/// To configure `RegionInstanceTemplates` use the `with_*` methods in the type returned
12521/// by [builder()][RegionInstanceTemplates::builder]. The default configuration should
12522/// work for most applications. Common configuration changes include
12523///
12524/// * [with_endpoint()]: by default this client uses the global default endpoint
12525///   (`https://compute.googleapis.com`). Applications using regional
12526///   endpoints or running in restricted networks (e.g. a network configured
12527//    with [Private Google Access with VPC Service Controls]) may want to
12528///   override this default.
12529/// * [with_credentials()]: by default this client uses
12530///   [Application Default Credentials]. Applications using custom
12531///   authentication may need to override this default.
12532///
12533/// [with_endpoint()]: super::builder::region_instance_templates::ClientBuilder::with_endpoint
12534/// [with_credentials()]: super::builder::region_instance_templates::ClientBuilder::with_credentials
12535/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12536/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12537///
12538/// # Pooling and Cloning
12539///
12540/// `RegionInstanceTemplates` holds a connection pool internally, it is advised to
12541/// create one and reuse it. You do not need to wrap `RegionInstanceTemplates` in
12542/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12543/// already uses an `Arc` internally.
12544#[cfg(feature = "region-instance-templates")]
12545#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-templates")))]
12546#[derive(Clone, Debug)]
12547pub struct RegionInstanceTemplates {
12548    inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceTemplates>,
12549}
12550
12551#[cfg(feature = "region-instance-templates")]
12552impl RegionInstanceTemplates {
12553    /// Returns a builder for [RegionInstanceTemplates].
12554    ///
12555    /// ```
12556    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12557    /// # use google_cloud_compute_v1::client::RegionInstanceTemplates;
12558    /// let client = RegionInstanceTemplates::builder().build().await?;
12559    /// # Ok(()) }
12560    /// ```
12561    pub fn builder() -> super::builder::region_instance_templates::ClientBuilder {
12562        crate::new_client_builder(super::builder::region_instance_templates::client::Factory)
12563    }
12564
12565    /// Creates a new client from the provided stub.
12566    ///
12567    /// The most common case for calling this function is in tests mocking the
12568    /// client's behavior.
12569    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
12570    where
12571        T: super::stub::RegionInstanceTemplates + 'static,
12572    {
12573        Self { inner: stub.into() }
12574    }
12575
12576    pub(crate) async fn new(
12577        config: gaxi::options::ClientConfig,
12578    ) -> crate::ClientBuilderResult<Self> {
12579        let inner = Self::build_inner(config).await?;
12580        Ok(Self { inner })
12581    }
12582
12583    async fn build_inner(
12584        conf: gaxi::options::ClientConfig,
12585    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionInstanceTemplates>>
12586    {
12587        if gaxi::options::tracing_enabled(&conf) {
12588            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12589        }
12590        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12591    }
12592
12593    async fn build_transport(
12594        conf: gaxi::options::ClientConfig,
12595    ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceTemplates> {
12596        super::transport::RegionInstanceTemplates::new(conf).await
12597    }
12598
12599    async fn build_with_tracing(
12600        conf: gaxi::options::ClientConfig,
12601    ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceTemplates> {
12602        Self::build_transport(conf)
12603            .await
12604            .map(super::tracing::RegionInstanceTemplates::new)
12605    }
12606
12607    /// Deletes the specified instance template. Deleting an instance template is
12608    /// permanent and cannot be undone.
12609    pub fn delete(&self) -> super::builder::region_instance_templates::Delete {
12610        super::builder::region_instance_templates::Delete::new(self.inner.clone())
12611    }
12612
12613    /// Returns the specified instance template.
12614    pub fn get(&self) -> super::builder::region_instance_templates::Get {
12615        super::builder::region_instance_templates::Get::new(self.inner.clone())
12616    }
12617
12618    /// Creates an instance template in the specified project and region using the
12619    /// global instance template whose URL is included in the request.
12620    pub fn insert(&self) -> super::builder::region_instance_templates::Insert {
12621        super::builder::region_instance_templates::Insert::new(self.inner.clone())
12622    }
12623
12624    /// Retrieves a list of instance templates that are contained within the
12625    /// specified project and region.
12626    pub fn list(&self) -> super::builder::region_instance_templates::List {
12627        super::builder::region_instance_templates::List::new(self.inner.clone())
12628    }
12629
12630    /// Retrieves the specified region-specific Operations resource.
12631    pub fn get_operation(&self) -> super::builder::region_instance_templates::GetOperation {
12632        super::builder::region_instance_templates::GetOperation::new(self.inner.clone())
12633    }
12634}
12635
12636/// Implements a client for the Google Compute Engine API.
12637///
12638/// # Example
12639/// ```
12640/// # use google_cloud_compute_v1::client::RegionInstances;
12641/// async fn sample(
12642/// ) -> anyhow::Result<()> {
12643///     let client = RegionInstances::builder().build().await?;
12644///     // use `client` to make requests to the Google Compute Engine API.
12645///     Ok(())
12646/// }
12647/// ```
12648///
12649/// # Service Description
12650///
12651/// Service for the `regionInstances` resource.
12652///
12653/// # Configuration
12654///
12655/// To configure `RegionInstances` use the `with_*` methods in the type returned
12656/// by [builder()][RegionInstances::builder]. The default configuration should
12657/// work for most applications. Common configuration changes include
12658///
12659/// * [with_endpoint()]: by default this client uses the global default endpoint
12660///   (`https://compute.googleapis.com`). Applications using regional
12661///   endpoints or running in restricted networks (e.g. a network configured
12662//    with [Private Google Access with VPC Service Controls]) may want to
12663///   override this default.
12664/// * [with_credentials()]: by default this client uses
12665///   [Application Default Credentials]. Applications using custom
12666///   authentication may need to override this default.
12667///
12668/// [with_endpoint()]: super::builder::region_instances::ClientBuilder::with_endpoint
12669/// [with_credentials()]: super::builder::region_instances::ClientBuilder::with_credentials
12670/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12671/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12672///
12673/// # Pooling and Cloning
12674///
12675/// `RegionInstances` holds a connection pool internally, it is advised to
12676/// create one and reuse it. You do not need to wrap `RegionInstances` in
12677/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12678/// already uses an `Arc` internally.
12679#[cfg(feature = "region-instances")]
12680#[cfg_attr(docsrs, doc(cfg(feature = "region-instances")))]
12681#[derive(Clone, Debug)]
12682pub struct RegionInstances {
12683    inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstances>,
12684}
12685
12686#[cfg(feature = "region-instances")]
12687impl RegionInstances {
12688    /// Returns a builder for [RegionInstances].
12689    ///
12690    /// ```
12691    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12692    /// # use google_cloud_compute_v1::client::RegionInstances;
12693    /// let client = RegionInstances::builder().build().await?;
12694    /// # Ok(()) }
12695    /// ```
12696    pub fn builder() -> super::builder::region_instances::ClientBuilder {
12697        crate::new_client_builder(super::builder::region_instances::client::Factory)
12698    }
12699
12700    /// Creates a new client from the provided stub.
12701    ///
12702    /// The most common case for calling this function is in tests mocking the
12703    /// client's behavior.
12704    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
12705    where
12706        T: super::stub::RegionInstances + 'static,
12707    {
12708        Self { inner: stub.into() }
12709    }
12710
12711    pub(crate) async fn new(
12712        config: gaxi::options::ClientConfig,
12713    ) -> crate::ClientBuilderResult<Self> {
12714        let inner = Self::build_inner(config).await?;
12715        Ok(Self { inner })
12716    }
12717
12718    async fn build_inner(
12719        conf: gaxi::options::ClientConfig,
12720    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionInstances>> {
12721        if gaxi::options::tracing_enabled(&conf) {
12722            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12723        }
12724        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12725    }
12726
12727    async fn build_transport(
12728        conf: gaxi::options::ClientConfig,
12729    ) -> crate::ClientBuilderResult<impl super::stub::RegionInstances> {
12730        super::transport::RegionInstances::new(conf).await
12731    }
12732
12733    async fn build_with_tracing(
12734        conf: gaxi::options::ClientConfig,
12735    ) -> crate::ClientBuilderResult<impl super::stub::RegionInstances> {
12736        Self::build_transport(conf)
12737            .await
12738            .map(super::tracing::RegionInstances::new)
12739    }
12740
12741    /// Creates multiple instances in a given region. Count specifies the number of
12742    /// instances to create.
12743    pub fn bulk_insert(&self) -> super::builder::region_instances::BulkInsert {
12744        super::builder::region_instances::BulkInsert::new(self.inner.clone())
12745    }
12746
12747    /// Retrieves the specified region-specific Operations resource.
12748    pub fn get_operation(&self) -> super::builder::region_instances::GetOperation {
12749        super::builder::region_instances::GetOperation::new(self.inner.clone())
12750    }
12751}
12752
12753/// Implements a client for the Google Compute Engine API.
12754///
12755/// # Example
12756/// ```
12757/// # use google_cloud_compute_v1::client::RegionInstantSnapshotGroups;
12758/// async fn sample(
12759/// ) -> anyhow::Result<()> {
12760///     let client = RegionInstantSnapshotGroups::builder().build().await?;
12761///     // use `client` to make requests to the Google Compute Engine API.
12762///     Ok(())
12763/// }
12764/// ```
12765///
12766/// # Service Description
12767///
12768/// Service for the `regionInstantSnapshotGroups` resource.
12769///
12770/// # Configuration
12771///
12772/// To configure `RegionInstantSnapshotGroups` use the `with_*` methods in the type returned
12773/// by [builder()][RegionInstantSnapshotGroups::builder]. The default configuration should
12774/// work for most applications. Common configuration changes include
12775///
12776/// * [with_endpoint()]: by default this client uses the global default endpoint
12777///   (`https://compute.googleapis.com`). Applications using regional
12778///   endpoints or running in restricted networks (e.g. a network configured
12779//    with [Private Google Access with VPC Service Controls]) may want to
12780///   override this default.
12781/// * [with_credentials()]: by default this client uses
12782///   [Application Default Credentials]. Applications using custom
12783///   authentication may need to override this default.
12784///
12785/// [with_endpoint()]: super::builder::region_instant_snapshot_groups::ClientBuilder::with_endpoint
12786/// [with_credentials()]: super::builder::region_instant_snapshot_groups::ClientBuilder::with_credentials
12787/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12788/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12789///
12790/// # Pooling and Cloning
12791///
12792/// `RegionInstantSnapshotGroups` holds a connection pool internally, it is advised to
12793/// create one and reuse it. You do not need to wrap `RegionInstantSnapshotGroups` in
12794/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12795/// already uses an `Arc` internally.
12796#[cfg(feature = "region-instant-snapshot-groups")]
12797#[cfg_attr(docsrs, doc(cfg(feature = "region-instant-snapshot-groups")))]
12798#[derive(Clone, Debug)]
12799pub struct RegionInstantSnapshotGroups {
12800    inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstantSnapshotGroups>,
12801}
12802
12803#[cfg(feature = "region-instant-snapshot-groups")]
12804impl RegionInstantSnapshotGroups {
12805    /// Returns a builder for [RegionInstantSnapshotGroups].
12806    ///
12807    /// ```
12808    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12809    /// # use google_cloud_compute_v1::client::RegionInstantSnapshotGroups;
12810    /// let client = RegionInstantSnapshotGroups::builder().build().await?;
12811    /// # Ok(()) }
12812    /// ```
12813    pub fn builder() -> super::builder::region_instant_snapshot_groups::ClientBuilder {
12814        crate::new_client_builder(super::builder::region_instant_snapshot_groups::client::Factory)
12815    }
12816
12817    /// Creates a new client from the provided stub.
12818    ///
12819    /// The most common case for calling this function is in tests mocking the
12820    /// client's behavior.
12821    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
12822    where
12823        T: super::stub::RegionInstantSnapshotGroups + 'static,
12824    {
12825        Self { inner: stub.into() }
12826    }
12827
12828    pub(crate) async fn new(
12829        config: gaxi::options::ClientConfig,
12830    ) -> crate::ClientBuilderResult<Self> {
12831        let inner = Self::build_inner(config).await?;
12832        Ok(Self { inner })
12833    }
12834
12835    async fn build_inner(
12836        conf: gaxi::options::ClientConfig,
12837    ) -> crate::ClientBuilderResult<
12838        std::sync::Arc<dyn super::stub::dynamic::RegionInstantSnapshotGroups>,
12839    > {
12840        if gaxi::options::tracing_enabled(&conf) {
12841            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12842        }
12843        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12844    }
12845
12846    async fn build_transport(
12847        conf: gaxi::options::ClientConfig,
12848    ) -> crate::ClientBuilderResult<impl super::stub::RegionInstantSnapshotGroups> {
12849        super::transport::RegionInstantSnapshotGroups::new(conf).await
12850    }
12851
12852    async fn build_with_tracing(
12853        conf: gaxi::options::ClientConfig,
12854    ) -> crate::ClientBuilderResult<impl super::stub::RegionInstantSnapshotGroups> {
12855        Self::build_transport(conf)
12856            .await
12857            .map(super::tracing::RegionInstantSnapshotGroups::new)
12858    }
12859
12860    /// deletes a Regional InstantSnapshotGroup resource
12861    pub fn delete(&self) -> super::builder::region_instant_snapshot_groups::Delete {
12862        super::builder::region_instant_snapshot_groups::Delete::new(self.inner.clone())
12863    }
12864
12865    /// returns the specified InstantSnapshotGroup resource in the specified
12866    /// region.
12867    pub fn get(&self) -> super::builder::region_instant_snapshot_groups::Get {
12868        super::builder::region_instant_snapshot_groups::Get::new(self.inner.clone())
12869    }
12870
12871    /// Gets the access control policy for a resource. May be empty if no such
12872    /// policy or resource exists.
12873    pub fn get_iam_policy(&self) -> super::builder::region_instant_snapshot_groups::GetIamPolicy {
12874        super::builder::region_instant_snapshot_groups::GetIamPolicy::new(self.inner.clone())
12875    }
12876
12877    /// creates a Regional InstantSnapshotGroup resource
12878    pub fn insert(&self) -> super::builder::region_instant_snapshot_groups::Insert {
12879        super::builder::region_instant_snapshot_groups::Insert::new(self.inner.clone())
12880    }
12881
12882    /// retrieves the list of InstantSnapshotGroup resources contained within
12883    /// the specified region.
12884    pub fn list(&self) -> super::builder::region_instant_snapshot_groups::List {
12885        super::builder::region_instant_snapshot_groups::List::new(self.inner.clone())
12886    }
12887
12888    /// Sets the access control policy on the specified resource.
12889    /// Replaces any existing policy.
12890    pub fn set_iam_policy(&self) -> super::builder::region_instant_snapshot_groups::SetIamPolicy {
12891        super::builder::region_instant_snapshot_groups::SetIamPolicy::new(self.inner.clone())
12892    }
12893
12894    /// Returns permissions that a caller has on the specified resource.
12895    pub fn test_iam_permissions(
12896        &self,
12897    ) -> super::builder::region_instant_snapshot_groups::TestIamPermissions {
12898        super::builder::region_instant_snapshot_groups::TestIamPermissions::new(self.inner.clone())
12899    }
12900
12901    /// Retrieves the specified region-specific Operations resource.
12902    pub fn get_operation(&self) -> super::builder::region_instant_snapshot_groups::GetOperation {
12903        super::builder::region_instant_snapshot_groups::GetOperation::new(self.inner.clone())
12904    }
12905}
12906
12907/// Implements a client for the Google Compute Engine API.
12908///
12909/// # Example
12910/// ```
12911/// # use google_cloud_compute_v1::client::RegionInstantSnapshots;
12912/// async fn sample(
12913/// ) -> anyhow::Result<()> {
12914///     let client = RegionInstantSnapshots::builder().build().await?;
12915///     // use `client` to make requests to the Google Compute Engine API.
12916///     Ok(())
12917/// }
12918/// ```
12919///
12920/// # Service Description
12921///
12922/// Service for the `regionInstantSnapshots` resource.
12923///
12924/// # Configuration
12925///
12926/// To configure `RegionInstantSnapshots` use the `with_*` methods in the type returned
12927/// by [builder()][RegionInstantSnapshots::builder]. The default configuration should
12928/// work for most applications. Common configuration changes include
12929///
12930/// * [with_endpoint()]: by default this client uses the global default endpoint
12931///   (`https://compute.googleapis.com`). Applications using regional
12932///   endpoints or running in restricted networks (e.g. a network configured
12933//    with [Private Google Access with VPC Service Controls]) may want to
12934///   override this default.
12935/// * [with_credentials()]: by default this client uses
12936///   [Application Default Credentials]. Applications using custom
12937///   authentication may need to override this default.
12938///
12939/// [with_endpoint()]: super::builder::region_instant_snapshots::ClientBuilder::with_endpoint
12940/// [with_credentials()]: super::builder::region_instant_snapshots::ClientBuilder::with_credentials
12941/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12942/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12943///
12944/// # Pooling and Cloning
12945///
12946/// `RegionInstantSnapshots` holds a connection pool internally, it is advised to
12947/// create one and reuse it. You do not need to wrap `RegionInstantSnapshots` in
12948/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12949/// already uses an `Arc` internally.
12950#[cfg(feature = "region-instant-snapshots")]
12951#[cfg_attr(docsrs, doc(cfg(feature = "region-instant-snapshots")))]
12952#[derive(Clone, Debug)]
12953pub struct RegionInstantSnapshots {
12954    inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstantSnapshots>,
12955}
12956
12957#[cfg(feature = "region-instant-snapshots")]
12958impl RegionInstantSnapshots {
12959    /// Returns a builder for [RegionInstantSnapshots].
12960    ///
12961    /// ```
12962    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12963    /// # use google_cloud_compute_v1::client::RegionInstantSnapshots;
12964    /// let client = RegionInstantSnapshots::builder().build().await?;
12965    /// # Ok(()) }
12966    /// ```
12967    pub fn builder() -> super::builder::region_instant_snapshots::ClientBuilder {
12968        crate::new_client_builder(super::builder::region_instant_snapshots::client::Factory)
12969    }
12970
12971    /// Creates a new client from the provided stub.
12972    ///
12973    /// The most common case for calling this function is in tests mocking the
12974    /// client's behavior.
12975    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
12976    where
12977        T: super::stub::RegionInstantSnapshots + 'static,
12978    {
12979        Self { inner: stub.into() }
12980    }
12981
12982    pub(crate) async fn new(
12983        config: gaxi::options::ClientConfig,
12984    ) -> crate::ClientBuilderResult<Self> {
12985        let inner = Self::build_inner(config).await?;
12986        Ok(Self { inner })
12987    }
12988
12989    async fn build_inner(
12990        conf: gaxi::options::ClientConfig,
12991    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionInstantSnapshots>>
12992    {
12993        if gaxi::options::tracing_enabled(&conf) {
12994            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12995        }
12996        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12997    }
12998
12999    async fn build_transport(
13000        conf: gaxi::options::ClientConfig,
13001    ) -> crate::ClientBuilderResult<impl super::stub::RegionInstantSnapshots> {
13002        super::transport::RegionInstantSnapshots::new(conf).await
13003    }
13004
13005    async fn build_with_tracing(
13006        conf: gaxi::options::ClientConfig,
13007    ) -> crate::ClientBuilderResult<impl super::stub::RegionInstantSnapshots> {
13008        Self::build_transport(conf)
13009            .await
13010            .map(super::tracing::RegionInstantSnapshots::new)
13011    }
13012
13013    /// Deletes the specified InstantSnapshot resource. Keep in mind that deleting
13014    /// a single instantSnapshot might not necessarily delete all the data on that
13015    /// instantSnapshot. If any data on the instantSnapshot that is marked for
13016    /// deletion is needed for subsequent instantSnapshots, the data will be moved
13017    /// to the next corresponding instantSnapshot.
13018    ///
13019    /// For more information, seeDeleting
13020    /// instantSnapshots.
13021    pub fn delete(&self) -> super::builder::region_instant_snapshots::Delete {
13022        super::builder::region_instant_snapshots::Delete::new(self.inner.clone())
13023    }
13024
13025    /// Returns the specified InstantSnapshot resource in the specified region.
13026    pub fn get(&self) -> super::builder::region_instant_snapshots::Get {
13027        super::builder::region_instant_snapshots::Get::new(self.inner.clone())
13028    }
13029
13030    /// Gets the access control policy for a resource. May be empty if no such
13031    /// policy or resource exists.
13032    pub fn get_iam_policy(&self) -> super::builder::region_instant_snapshots::GetIamPolicy {
13033        super::builder::region_instant_snapshots::GetIamPolicy::new(self.inner.clone())
13034    }
13035
13036    /// Creates an instant snapshot in the specified region.
13037    pub fn insert(&self) -> super::builder::region_instant_snapshots::Insert {
13038        super::builder::region_instant_snapshots::Insert::new(self.inner.clone())
13039    }
13040
13041    /// Retrieves the list of InstantSnapshot resources contained within
13042    /// the specified region.
13043    pub fn list(&self) -> super::builder::region_instant_snapshots::List {
13044        super::builder::region_instant_snapshots::List::new(self.inner.clone())
13045    }
13046
13047    /// Sets the access control policy on the specified resource.
13048    /// Replaces any existing policy.
13049    pub fn set_iam_policy(&self) -> super::builder::region_instant_snapshots::SetIamPolicy {
13050        super::builder::region_instant_snapshots::SetIamPolicy::new(self.inner.clone())
13051    }
13052
13053    /// Sets the labels on a instantSnapshot in the given region. To learn more
13054    /// about labels, read the Labeling
13055    /// Resources documentation.
13056    pub fn set_labels(&self) -> super::builder::region_instant_snapshots::SetLabels {
13057        super::builder::region_instant_snapshots::SetLabels::new(self.inner.clone())
13058    }
13059
13060    /// Returns permissions that a caller has on the specified resource.
13061    pub fn test_iam_permissions(
13062        &self,
13063    ) -> super::builder::region_instant_snapshots::TestIamPermissions {
13064        super::builder::region_instant_snapshots::TestIamPermissions::new(self.inner.clone())
13065    }
13066
13067    /// Retrieves the specified region-specific Operations resource.
13068    pub fn get_operation(&self) -> super::builder::region_instant_snapshots::GetOperation {
13069        super::builder::region_instant_snapshots::GetOperation::new(self.inner.clone())
13070    }
13071}
13072
13073/// Implements a client for the Google Compute Engine API.
13074///
13075/// # Example
13076/// ```
13077/// # use google_cloud_compute_v1::client::RegionNetworkEndpointGroups;
13078/// async fn sample(
13079/// ) -> anyhow::Result<()> {
13080///     let client = RegionNetworkEndpointGroups::builder().build().await?;
13081///     // use `client` to make requests to the Google Compute Engine API.
13082///     Ok(())
13083/// }
13084/// ```
13085///
13086/// # Service Description
13087///
13088/// Service for the `regionNetworkEndpointGroups` resource.
13089///
13090/// # Configuration
13091///
13092/// To configure `RegionNetworkEndpointGroups` use the `with_*` methods in the type returned
13093/// by [builder()][RegionNetworkEndpointGroups::builder]. The default configuration should
13094/// work for most applications. Common configuration changes include
13095///
13096/// * [with_endpoint()]: by default this client uses the global default endpoint
13097///   (`https://compute.googleapis.com`). Applications using regional
13098///   endpoints or running in restricted networks (e.g. a network configured
13099//    with [Private Google Access with VPC Service Controls]) may want to
13100///   override this default.
13101/// * [with_credentials()]: by default this client uses
13102///   [Application Default Credentials]. Applications using custom
13103///   authentication may need to override this default.
13104///
13105/// [with_endpoint()]: super::builder::region_network_endpoint_groups::ClientBuilder::with_endpoint
13106/// [with_credentials()]: super::builder::region_network_endpoint_groups::ClientBuilder::with_credentials
13107/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13108/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13109///
13110/// # Pooling and Cloning
13111///
13112/// `RegionNetworkEndpointGroups` holds a connection pool internally, it is advised to
13113/// create one and reuse it. You do not need to wrap `RegionNetworkEndpointGroups` in
13114/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13115/// already uses an `Arc` internally.
13116#[cfg(feature = "region-network-endpoint-groups")]
13117#[cfg_attr(docsrs, doc(cfg(feature = "region-network-endpoint-groups")))]
13118#[derive(Clone, Debug)]
13119pub struct RegionNetworkEndpointGroups {
13120    inner: std::sync::Arc<dyn super::stub::dynamic::RegionNetworkEndpointGroups>,
13121}
13122
13123#[cfg(feature = "region-network-endpoint-groups")]
13124impl RegionNetworkEndpointGroups {
13125    /// Returns a builder for [RegionNetworkEndpointGroups].
13126    ///
13127    /// ```
13128    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13129    /// # use google_cloud_compute_v1::client::RegionNetworkEndpointGroups;
13130    /// let client = RegionNetworkEndpointGroups::builder().build().await?;
13131    /// # Ok(()) }
13132    /// ```
13133    pub fn builder() -> super::builder::region_network_endpoint_groups::ClientBuilder {
13134        crate::new_client_builder(super::builder::region_network_endpoint_groups::client::Factory)
13135    }
13136
13137    /// Creates a new client from the provided stub.
13138    ///
13139    /// The most common case for calling this function is in tests mocking the
13140    /// client's behavior.
13141    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
13142    where
13143        T: super::stub::RegionNetworkEndpointGroups + 'static,
13144    {
13145        Self { inner: stub.into() }
13146    }
13147
13148    pub(crate) async fn new(
13149        config: gaxi::options::ClientConfig,
13150    ) -> crate::ClientBuilderResult<Self> {
13151        let inner = Self::build_inner(config).await?;
13152        Ok(Self { inner })
13153    }
13154
13155    async fn build_inner(
13156        conf: gaxi::options::ClientConfig,
13157    ) -> crate::ClientBuilderResult<
13158        std::sync::Arc<dyn super::stub::dynamic::RegionNetworkEndpointGroups>,
13159    > {
13160        if gaxi::options::tracing_enabled(&conf) {
13161            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13162        }
13163        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13164    }
13165
13166    async fn build_transport(
13167        conf: gaxi::options::ClientConfig,
13168    ) -> crate::ClientBuilderResult<impl super::stub::RegionNetworkEndpointGroups> {
13169        super::transport::RegionNetworkEndpointGroups::new(conf).await
13170    }
13171
13172    async fn build_with_tracing(
13173        conf: gaxi::options::ClientConfig,
13174    ) -> crate::ClientBuilderResult<impl super::stub::RegionNetworkEndpointGroups> {
13175        Self::build_transport(conf)
13176            .await
13177            .map(super::tracing::RegionNetworkEndpointGroups::new)
13178    }
13179
13180    /// Attach a list of network endpoints to the specified network endpoint group.
13181    pub fn attach_network_endpoints(
13182        &self,
13183    ) -> super::builder::region_network_endpoint_groups::AttachNetworkEndpoints {
13184        super::builder::region_network_endpoint_groups::AttachNetworkEndpoints::new(
13185            self.inner.clone(),
13186        )
13187    }
13188
13189    /// Deletes the specified network endpoint group. Note that the NEG cannot be
13190    /// deleted if it is configured as a backend of a backend service.
13191    pub fn delete(&self) -> super::builder::region_network_endpoint_groups::Delete {
13192        super::builder::region_network_endpoint_groups::Delete::new(self.inner.clone())
13193    }
13194
13195    /// Detach the network endpoint from the specified network endpoint group.
13196    pub fn detach_network_endpoints(
13197        &self,
13198    ) -> super::builder::region_network_endpoint_groups::DetachNetworkEndpoints {
13199        super::builder::region_network_endpoint_groups::DetachNetworkEndpoints::new(
13200            self.inner.clone(),
13201        )
13202    }
13203
13204    /// Returns the specified network endpoint group.
13205    pub fn get(&self) -> super::builder::region_network_endpoint_groups::Get {
13206        super::builder::region_network_endpoint_groups::Get::new(self.inner.clone())
13207    }
13208
13209    /// Creates a network endpoint group in the specified project using the
13210    /// parameters that are included in the request.
13211    ///
13212    /// Note: Use the following APIs to manage network endpoint groups:
13213    ///
13214    /// - To manage NEGs with zonal scope (such as zonal NEGs, hybrid connectivity
13215    ///   NEGs): zonal
13216    ///   API
13217    /// - To manage NEGs with regional scope (such as regional internet NEGs,
13218    ///   serverless NEGs, Private Service Connect NEGs): regional
13219    ///   API
13220    /// - To manage NEGs with global scope (such as global internet NEGs):global
13221    ///   API
13222    pub fn insert(&self) -> super::builder::region_network_endpoint_groups::Insert {
13223        super::builder::region_network_endpoint_groups::Insert::new(self.inner.clone())
13224    }
13225
13226    /// Retrieves the list of regional network endpoint groups available to the
13227    /// specified project in the given region.
13228    pub fn list(&self) -> super::builder::region_network_endpoint_groups::List {
13229        super::builder::region_network_endpoint_groups::List::new(self.inner.clone())
13230    }
13231
13232    /// Lists the network endpoints in the specified network endpoint group.
13233    pub fn list_network_endpoints(
13234        &self,
13235    ) -> super::builder::region_network_endpoint_groups::ListNetworkEndpoints {
13236        super::builder::region_network_endpoint_groups::ListNetworkEndpoints::new(
13237            self.inner.clone(),
13238        )
13239    }
13240
13241    /// Retrieves the specified region-specific Operations resource.
13242    pub fn get_operation(&self) -> super::builder::region_network_endpoint_groups::GetOperation {
13243        super::builder::region_network_endpoint_groups::GetOperation::new(self.inner.clone())
13244    }
13245}
13246
13247/// Implements a client for the Google Compute Engine API.
13248///
13249/// # Example
13250/// ```
13251/// # use google_cloud_compute_v1::client::RegionNetworkFirewallPolicies;
13252/// async fn sample(
13253/// ) -> anyhow::Result<()> {
13254///     let client = RegionNetworkFirewallPolicies::builder().build().await?;
13255///     // use `client` to make requests to the Google Compute Engine API.
13256///     Ok(())
13257/// }
13258/// ```
13259///
13260/// # Service Description
13261///
13262/// Service for the `regionNetworkFirewallPolicies` resource.
13263///
13264/// # Configuration
13265///
13266/// To configure `RegionNetworkFirewallPolicies` use the `with_*` methods in the type returned
13267/// by [builder()][RegionNetworkFirewallPolicies::builder]. The default configuration should
13268/// work for most applications. Common configuration changes include
13269///
13270/// * [with_endpoint()]: by default this client uses the global default endpoint
13271///   (`https://compute.googleapis.com`). Applications using regional
13272///   endpoints or running in restricted networks (e.g. a network configured
13273//    with [Private Google Access with VPC Service Controls]) may want to
13274///   override this default.
13275/// * [with_credentials()]: by default this client uses
13276///   [Application Default Credentials]. Applications using custom
13277///   authentication may need to override this default.
13278///
13279/// [with_endpoint()]: super::builder::region_network_firewall_policies::ClientBuilder::with_endpoint
13280/// [with_credentials()]: super::builder::region_network_firewall_policies::ClientBuilder::with_credentials
13281/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13282/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13283///
13284/// # Pooling and Cloning
13285///
13286/// `RegionNetworkFirewallPolicies` holds a connection pool internally, it is advised to
13287/// create one and reuse it. You do not need to wrap `RegionNetworkFirewallPolicies` in
13288/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13289/// already uses an `Arc` internally.
13290#[cfg(feature = "region-network-firewall-policies")]
13291#[cfg_attr(docsrs, doc(cfg(feature = "region-network-firewall-policies")))]
13292#[derive(Clone, Debug)]
13293pub struct RegionNetworkFirewallPolicies {
13294    inner: std::sync::Arc<dyn super::stub::dynamic::RegionNetworkFirewallPolicies>,
13295}
13296
13297#[cfg(feature = "region-network-firewall-policies")]
13298impl RegionNetworkFirewallPolicies {
13299    /// Returns a builder for [RegionNetworkFirewallPolicies].
13300    ///
13301    /// ```
13302    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13303    /// # use google_cloud_compute_v1::client::RegionNetworkFirewallPolicies;
13304    /// let client = RegionNetworkFirewallPolicies::builder().build().await?;
13305    /// # Ok(()) }
13306    /// ```
13307    pub fn builder() -> super::builder::region_network_firewall_policies::ClientBuilder {
13308        crate::new_client_builder(super::builder::region_network_firewall_policies::client::Factory)
13309    }
13310
13311    /// Creates a new client from the provided stub.
13312    ///
13313    /// The most common case for calling this function is in tests mocking the
13314    /// client's behavior.
13315    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
13316    where
13317        T: super::stub::RegionNetworkFirewallPolicies + 'static,
13318    {
13319        Self { inner: stub.into() }
13320    }
13321
13322    pub(crate) async fn new(
13323        config: gaxi::options::ClientConfig,
13324    ) -> crate::ClientBuilderResult<Self> {
13325        let inner = Self::build_inner(config).await?;
13326        Ok(Self { inner })
13327    }
13328
13329    async fn build_inner(
13330        conf: gaxi::options::ClientConfig,
13331    ) -> crate::ClientBuilderResult<
13332        std::sync::Arc<dyn super::stub::dynamic::RegionNetworkFirewallPolicies>,
13333    > {
13334        if gaxi::options::tracing_enabled(&conf) {
13335            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13336        }
13337        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13338    }
13339
13340    async fn build_transport(
13341        conf: gaxi::options::ClientConfig,
13342    ) -> crate::ClientBuilderResult<impl super::stub::RegionNetworkFirewallPolicies> {
13343        super::transport::RegionNetworkFirewallPolicies::new(conf).await
13344    }
13345
13346    async fn build_with_tracing(
13347        conf: gaxi::options::ClientConfig,
13348    ) -> crate::ClientBuilderResult<impl super::stub::RegionNetworkFirewallPolicies> {
13349        Self::build_transport(conf)
13350            .await
13351            .map(super::tracing::RegionNetworkFirewallPolicies::new)
13352    }
13353
13354    /// Inserts an association for the specified network firewall policy.
13355    pub fn add_association(
13356        &self,
13357    ) -> super::builder::region_network_firewall_policies::AddAssociation {
13358        super::builder::region_network_firewall_policies::AddAssociation::new(self.inner.clone())
13359    }
13360
13361    /// Inserts a rule into a network firewall policy.
13362    pub fn add_rule(&self) -> super::builder::region_network_firewall_policies::AddRule {
13363        super::builder::region_network_firewall_policies::AddRule::new(self.inner.clone())
13364    }
13365
13366    /// Copies rules to the specified network firewall policy.
13367    pub fn clone_rules(&self) -> super::builder::region_network_firewall_policies::CloneRules {
13368        super::builder::region_network_firewall_policies::CloneRules::new(self.inner.clone())
13369    }
13370
13371    /// Deletes the specified network firewall policy.
13372    pub fn delete(&self) -> super::builder::region_network_firewall_policies::Delete {
13373        super::builder::region_network_firewall_policies::Delete::new(self.inner.clone())
13374    }
13375
13376    /// Returns the specified network firewall policy.
13377    pub fn get(&self) -> super::builder::region_network_firewall_policies::Get {
13378        super::builder::region_network_firewall_policies::Get::new(self.inner.clone())
13379    }
13380
13381    /// Gets an association with the specified name.
13382    pub fn get_association(
13383        &self,
13384    ) -> super::builder::region_network_firewall_policies::GetAssociation {
13385        super::builder::region_network_firewall_policies::GetAssociation::new(self.inner.clone())
13386    }
13387
13388    /// Returns the effective firewalls on a given network.
13389    pub fn get_effective_firewalls(
13390        &self,
13391    ) -> super::builder::region_network_firewall_policies::GetEffectiveFirewalls {
13392        super::builder::region_network_firewall_policies::GetEffectiveFirewalls::new(
13393            self.inner.clone(),
13394        )
13395    }
13396
13397    /// Gets the access control policy for a resource. May be empty if no such
13398    /// policy or resource exists.
13399    pub fn get_iam_policy(&self) -> super::builder::region_network_firewall_policies::GetIamPolicy {
13400        super::builder::region_network_firewall_policies::GetIamPolicy::new(self.inner.clone())
13401    }
13402
13403    /// Gets a rule of the specified priority.
13404    pub fn get_rule(&self) -> super::builder::region_network_firewall_policies::GetRule {
13405        super::builder::region_network_firewall_policies::GetRule::new(self.inner.clone())
13406    }
13407
13408    /// Creates a new network firewall policy in the specified project and region.
13409    pub fn insert(&self) -> super::builder::region_network_firewall_policies::Insert {
13410        super::builder::region_network_firewall_policies::Insert::new(self.inner.clone())
13411    }
13412
13413    /// Lists all the network firewall policies that have been configured
13414    /// for the specified project in the given region.
13415    pub fn list(&self) -> super::builder::region_network_firewall_policies::List {
13416        super::builder::region_network_firewall_policies::List::new(self.inner.clone())
13417    }
13418
13419    /// Patches the specified network firewall policy.
13420    pub fn patch(&self) -> super::builder::region_network_firewall_policies::Patch {
13421        super::builder::region_network_firewall_policies::Patch::new(self.inner.clone())
13422    }
13423
13424    /// Patches a rule of the specified priority.
13425    pub fn patch_rule(&self) -> super::builder::region_network_firewall_policies::PatchRule {
13426        super::builder::region_network_firewall_policies::PatchRule::new(self.inner.clone())
13427    }
13428
13429    /// Removes an association for the specified network firewall policy.
13430    pub fn remove_association(
13431        &self,
13432    ) -> super::builder::region_network_firewall_policies::RemoveAssociation {
13433        super::builder::region_network_firewall_policies::RemoveAssociation::new(self.inner.clone())
13434    }
13435
13436    /// Deletes a rule of the specified priority.
13437    pub fn remove_rule(&self) -> super::builder::region_network_firewall_policies::RemoveRule {
13438        super::builder::region_network_firewall_policies::RemoveRule::new(self.inner.clone())
13439    }
13440
13441    /// Sets the access control policy on the specified resource.
13442    /// Replaces any existing policy.
13443    pub fn set_iam_policy(&self) -> super::builder::region_network_firewall_policies::SetIamPolicy {
13444        super::builder::region_network_firewall_policies::SetIamPolicy::new(self.inner.clone())
13445    }
13446
13447    /// Returns permissions that a caller has on the specified resource.
13448    pub fn test_iam_permissions(
13449        &self,
13450    ) -> super::builder::region_network_firewall_policies::TestIamPermissions {
13451        super::builder::region_network_firewall_policies::TestIamPermissions::new(
13452            self.inner.clone(),
13453        )
13454    }
13455
13456    /// Retrieves the specified region-specific Operations resource.
13457    pub fn get_operation(&self) -> super::builder::region_network_firewall_policies::GetOperation {
13458        super::builder::region_network_firewall_policies::GetOperation::new(self.inner.clone())
13459    }
13460}
13461
13462/// Implements a client for the Google Compute Engine API.
13463///
13464/// # Example
13465/// ```
13466/// # use google_cloud_compute_v1::client::RegionNotificationEndpoints;
13467/// async fn sample(
13468/// ) -> anyhow::Result<()> {
13469///     let client = RegionNotificationEndpoints::builder().build().await?;
13470///     // use `client` to make requests to the Google Compute Engine API.
13471///     Ok(())
13472/// }
13473/// ```
13474///
13475/// # Service Description
13476///
13477/// Service for the `regionNotificationEndpoints` resource.
13478///
13479/// # Configuration
13480///
13481/// To configure `RegionNotificationEndpoints` use the `with_*` methods in the type returned
13482/// by [builder()][RegionNotificationEndpoints::builder]. The default configuration should
13483/// work for most applications. Common configuration changes include
13484///
13485/// * [with_endpoint()]: by default this client uses the global default endpoint
13486///   (`https://compute.googleapis.com`). Applications using regional
13487///   endpoints or running in restricted networks (e.g. a network configured
13488//    with [Private Google Access with VPC Service Controls]) may want to
13489///   override this default.
13490/// * [with_credentials()]: by default this client uses
13491///   [Application Default Credentials]. Applications using custom
13492///   authentication may need to override this default.
13493///
13494/// [with_endpoint()]: super::builder::region_notification_endpoints::ClientBuilder::with_endpoint
13495/// [with_credentials()]: super::builder::region_notification_endpoints::ClientBuilder::with_credentials
13496/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13497/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13498///
13499/// # Pooling and Cloning
13500///
13501/// `RegionNotificationEndpoints` holds a connection pool internally, it is advised to
13502/// create one and reuse it. You do not need to wrap `RegionNotificationEndpoints` in
13503/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13504/// already uses an `Arc` internally.
13505#[cfg(feature = "region-notification-endpoints")]
13506#[cfg_attr(docsrs, doc(cfg(feature = "region-notification-endpoints")))]
13507#[derive(Clone, Debug)]
13508pub struct RegionNotificationEndpoints {
13509    inner: std::sync::Arc<dyn super::stub::dynamic::RegionNotificationEndpoints>,
13510}
13511
13512#[cfg(feature = "region-notification-endpoints")]
13513impl RegionNotificationEndpoints {
13514    /// Returns a builder for [RegionNotificationEndpoints].
13515    ///
13516    /// ```
13517    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13518    /// # use google_cloud_compute_v1::client::RegionNotificationEndpoints;
13519    /// let client = RegionNotificationEndpoints::builder().build().await?;
13520    /// # Ok(()) }
13521    /// ```
13522    pub fn builder() -> super::builder::region_notification_endpoints::ClientBuilder {
13523        crate::new_client_builder(super::builder::region_notification_endpoints::client::Factory)
13524    }
13525
13526    /// Creates a new client from the provided stub.
13527    ///
13528    /// The most common case for calling this function is in tests mocking the
13529    /// client's behavior.
13530    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
13531    where
13532        T: super::stub::RegionNotificationEndpoints + 'static,
13533    {
13534        Self { inner: stub.into() }
13535    }
13536
13537    pub(crate) async fn new(
13538        config: gaxi::options::ClientConfig,
13539    ) -> crate::ClientBuilderResult<Self> {
13540        let inner = Self::build_inner(config).await?;
13541        Ok(Self { inner })
13542    }
13543
13544    async fn build_inner(
13545        conf: gaxi::options::ClientConfig,
13546    ) -> crate::ClientBuilderResult<
13547        std::sync::Arc<dyn super::stub::dynamic::RegionNotificationEndpoints>,
13548    > {
13549        if gaxi::options::tracing_enabled(&conf) {
13550            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13551        }
13552        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13553    }
13554
13555    async fn build_transport(
13556        conf: gaxi::options::ClientConfig,
13557    ) -> crate::ClientBuilderResult<impl super::stub::RegionNotificationEndpoints> {
13558        super::transport::RegionNotificationEndpoints::new(conf).await
13559    }
13560
13561    async fn build_with_tracing(
13562        conf: gaxi::options::ClientConfig,
13563    ) -> crate::ClientBuilderResult<impl super::stub::RegionNotificationEndpoints> {
13564        Self::build_transport(conf)
13565            .await
13566            .map(super::tracing::RegionNotificationEndpoints::new)
13567    }
13568
13569    /// Retrieves the list of all NotificationEndpoint resources,
13570    /// regional and global, available to the specified project.
13571    pub fn aggregated_list(&self) -> super::builder::region_notification_endpoints::AggregatedList {
13572        super::builder::region_notification_endpoints::AggregatedList::new(self.inner.clone())
13573    }
13574
13575    /// Deletes the specified NotificationEndpoint in the given region
13576    pub fn delete(&self) -> super::builder::region_notification_endpoints::Delete {
13577        super::builder::region_notification_endpoints::Delete::new(self.inner.clone())
13578    }
13579
13580    /// Returns the specified NotificationEndpoint resource in the given region.
13581    pub fn get(&self) -> super::builder::region_notification_endpoints::Get {
13582        super::builder::region_notification_endpoints::Get::new(self.inner.clone())
13583    }
13584
13585    /// Create a NotificationEndpoint in the specified project in the given region
13586    /// using the parameters that are included in the request.
13587    pub fn insert(&self) -> super::builder::region_notification_endpoints::Insert {
13588        super::builder::region_notification_endpoints::Insert::new(self.inner.clone())
13589    }
13590
13591    /// Lists the NotificationEndpoints for a project in the given region.
13592    pub fn list(&self) -> super::builder::region_notification_endpoints::List {
13593        super::builder::region_notification_endpoints::List::new(self.inner.clone())
13594    }
13595
13596    /// Returns permissions that a caller has on the specified resource.
13597    pub fn test_iam_permissions(
13598        &self,
13599    ) -> super::builder::region_notification_endpoints::TestIamPermissions {
13600        super::builder::region_notification_endpoints::TestIamPermissions::new(self.inner.clone())
13601    }
13602
13603    /// Retrieves the specified region-specific Operations resource.
13604    pub fn get_operation(&self) -> super::builder::region_notification_endpoints::GetOperation {
13605        super::builder::region_notification_endpoints::GetOperation::new(self.inner.clone())
13606    }
13607}
13608
13609/// Implements a client for the Google Compute Engine API.
13610///
13611/// # Example
13612/// ```
13613/// # use google_cloud_compute_v1::client::RegionOperations;
13614/// async fn sample(
13615/// ) -> anyhow::Result<()> {
13616///     let client = RegionOperations::builder().build().await?;
13617///     // use `client` to make requests to the Google Compute Engine API.
13618///     Ok(())
13619/// }
13620/// ```
13621///
13622/// # Service Description
13623///
13624/// Service for the `regionOperations` resource.
13625///
13626/// # Configuration
13627///
13628/// To configure `RegionOperations` use the `with_*` methods in the type returned
13629/// by [builder()][RegionOperations::builder]. The default configuration should
13630/// work for most applications. Common configuration changes include
13631///
13632/// * [with_endpoint()]: by default this client uses the global default endpoint
13633///   (`https://compute.googleapis.com`). Applications using regional
13634///   endpoints or running in restricted networks (e.g. a network configured
13635//    with [Private Google Access with VPC Service Controls]) may want to
13636///   override this default.
13637/// * [with_credentials()]: by default this client uses
13638///   [Application Default Credentials]. Applications using custom
13639///   authentication may need to override this default.
13640///
13641/// [with_endpoint()]: super::builder::region_operations::ClientBuilder::with_endpoint
13642/// [with_credentials()]: super::builder::region_operations::ClientBuilder::with_credentials
13643/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13644/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13645///
13646/// # Pooling and Cloning
13647///
13648/// `RegionOperations` holds a connection pool internally, it is advised to
13649/// create one and reuse it. You do not need to wrap `RegionOperations` in
13650/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13651/// already uses an `Arc` internally.
13652#[cfg(feature = "region-operations")]
13653#[cfg_attr(docsrs, doc(cfg(feature = "region-operations")))]
13654#[derive(Clone, Debug)]
13655pub struct RegionOperations {
13656    inner: std::sync::Arc<dyn super::stub::dynamic::RegionOperations>,
13657}
13658
13659#[cfg(feature = "region-operations")]
13660impl RegionOperations {
13661    /// Returns a builder for [RegionOperations].
13662    ///
13663    /// ```
13664    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13665    /// # use google_cloud_compute_v1::client::RegionOperations;
13666    /// let client = RegionOperations::builder().build().await?;
13667    /// # Ok(()) }
13668    /// ```
13669    pub fn builder() -> super::builder::region_operations::ClientBuilder {
13670        crate::new_client_builder(super::builder::region_operations::client::Factory)
13671    }
13672
13673    /// Creates a new client from the provided stub.
13674    ///
13675    /// The most common case for calling this function is in tests mocking the
13676    /// client's behavior.
13677    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
13678    where
13679        T: super::stub::RegionOperations + 'static,
13680    {
13681        Self { inner: stub.into() }
13682    }
13683
13684    pub(crate) async fn new(
13685        config: gaxi::options::ClientConfig,
13686    ) -> crate::ClientBuilderResult<Self> {
13687        let inner = Self::build_inner(config).await?;
13688        Ok(Self { inner })
13689    }
13690
13691    async fn build_inner(
13692        conf: gaxi::options::ClientConfig,
13693    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionOperations>>
13694    {
13695        if gaxi::options::tracing_enabled(&conf) {
13696            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13697        }
13698        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13699    }
13700
13701    async fn build_transport(
13702        conf: gaxi::options::ClientConfig,
13703    ) -> crate::ClientBuilderResult<impl super::stub::RegionOperations> {
13704        super::transport::RegionOperations::new(conf).await
13705    }
13706
13707    async fn build_with_tracing(
13708        conf: gaxi::options::ClientConfig,
13709    ) -> crate::ClientBuilderResult<impl super::stub::RegionOperations> {
13710        Self::build_transport(conf)
13711            .await
13712            .map(super::tracing::RegionOperations::new)
13713    }
13714
13715    /// Deletes the specified region-specific Operations resource.
13716    pub fn delete(&self) -> super::builder::region_operations::Delete {
13717        super::builder::region_operations::Delete::new(self.inner.clone())
13718    }
13719
13720    /// Retrieves the specified region-specific Operations resource.
13721    pub fn get(&self) -> super::builder::region_operations::Get {
13722        super::builder::region_operations::Get::new(self.inner.clone())
13723    }
13724
13725    /// Retrieves a list of Operation resources contained within
13726    /// the specified region.
13727    pub fn list(&self) -> super::builder::region_operations::List {
13728        super::builder::region_operations::List::new(self.inner.clone())
13729    }
13730
13731    /// Waits for the specified Operation resource to return as `DONE`
13732    /// or for the request to approach the 2 minute deadline, and retrieves the
13733    /// specified Operation resource. This method differs from the
13734    /// `GET` method in that it waits for no more than the default
13735    /// deadline (2 minutes) and then returns the current state of the operation,
13736    /// which might be `DONE` or still in progress.
13737    ///
13738    /// This method is called on a best-effort basis. Specifically:
13739    ///
13740    /// ```norust
13741    /// - In uncommon cases, when the server is overloaded, the request might
13742    /// return before the default deadline is reached, or might return after zero
13743    /// seconds.
13744    /// ```
13745    ///
13746    /// - If the default deadline is reached, there is no guarantee that the
13747    ///   operation is actually done when the method returns. Be prepared to retry
13748    ///   if the operation is not `DONE`.
13749    pub fn wait(&self) -> super::builder::region_operations::Wait {
13750        super::builder::region_operations::Wait::new(self.inner.clone())
13751    }
13752}
13753
13754/// Implements a client for the Google Compute Engine API.
13755///
13756/// # Example
13757/// ```
13758/// # use google_cloud_compute_v1::client::RegionSecurityPolicies;
13759/// async fn sample(
13760/// ) -> anyhow::Result<()> {
13761///     let client = RegionSecurityPolicies::builder().build().await?;
13762///     // use `client` to make requests to the Google Compute Engine API.
13763///     Ok(())
13764/// }
13765/// ```
13766///
13767/// # Service Description
13768///
13769/// Service for the `regionSecurityPolicies` resource.
13770///
13771/// # Configuration
13772///
13773/// To configure `RegionSecurityPolicies` use the `with_*` methods in the type returned
13774/// by [builder()][RegionSecurityPolicies::builder]. The default configuration should
13775/// work for most applications. Common configuration changes include
13776///
13777/// * [with_endpoint()]: by default this client uses the global default endpoint
13778///   (`https://compute.googleapis.com`). Applications using regional
13779///   endpoints or running in restricted networks (e.g. a network configured
13780//    with [Private Google Access with VPC Service Controls]) may want to
13781///   override this default.
13782/// * [with_credentials()]: by default this client uses
13783///   [Application Default Credentials]. Applications using custom
13784///   authentication may need to override this default.
13785///
13786/// [with_endpoint()]: super::builder::region_security_policies::ClientBuilder::with_endpoint
13787/// [with_credentials()]: super::builder::region_security_policies::ClientBuilder::with_credentials
13788/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13789/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13790///
13791/// # Pooling and Cloning
13792///
13793/// `RegionSecurityPolicies` holds a connection pool internally, it is advised to
13794/// create one and reuse it. You do not need to wrap `RegionSecurityPolicies` in
13795/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13796/// already uses an `Arc` internally.
13797#[cfg(feature = "region-security-policies")]
13798#[cfg_attr(docsrs, doc(cfg(feature = "region-security-policies")))]
13799#[derive(Clone, Debug)]
13800pub struct RegionSecurityPolicies {
13801    inner: std::sync::Arc<dyn super::stub::dynamic::RegionSecurityPolicies>,
13802}
13803
13804#[cfg(feature = "region-security-policies")]
13805impl RegionSecurityPolicies {
13806    /// Returns a builder for [RegionSecurityPolicies].
13807    ///
13808    /// ```
13809    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13810    /// # use google_cloud_compute_v1::client::RegionSecurityPolicies;
13811    /// let client = RegionSecurityPolicies::builder().build().await?;
13812    /// # Ok(()) }
13813    /// ```
13814    pub fn builder() -> super::builder::region_security_policies::ClientBuilder {
13815        crate::new_client_builder(super::builder::region_security_policies::client::Factory)
13816    }
13817
13818    /// Creates a new client from the provided stub.
13819    ///
13820    /// The most common case for calling this function is in tests mocking the
13821    /// client's behavior.
13822    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
13823    where
13824        T: super::stub::RegionSecurityPolicies + 'static,
13825    {
13826        Self { inner: stub.into() }
13827    }
13828
13829    pub(crate) async fn new(
13830        config: gaxi::options::ClientConfig,
13831    ) -> crate::ClientBuilderResult<Self> {
13832        let inner = Self::build_inner(config).await?;
13833        Ok(Self { inner })
13834    }
13835
13836    async fn build_inner(
13837        conf: gaxi::options::ClientConfig,
13838    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionSecurityPolicies>>
13839    {
13840        if gaxi::options::tracing_enabled(&conf) {
13841            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13842        }
13843        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13844    }
13845
13846    async fn build_transport(
13847        conf: gaxi::options::ClientConfig,
13848    ) -> crate::ClientBuilderResult<impl super::stub::RegionSecurityPolicies> {
13849        super::transport::RegionSecurityPolicies::new(conf).await
13850    }
13851
13852    async fn build_with_tracing(
13853        conf: gaxi::options::ClientConfig,
13854    ) -> crate::ClientBuilderResult<impl super::stub::RegionSecurityPolicies> {
13855        Self::build_transport(conf)
13856            .await
13857            .map(super::tracing::RegionSecurityPolicies::new)
13858    }
13859
13860    /// Inserts a rule into a security policy.
13861    pub fn add_rule(&self) -> super::builder::region_security_policies::AddRule {
13862        super::builder::region_security_policies::AddRule::new(self.inner.clone())
13863    }
13864
13865    /// Deletes the specified policy.
13866    pub fn delete(&self) -> super::builder::region_security_policies::Delete {
13867        super::builder::region_security_policies::Delete::new(self.inner.clone())
13868    }
13869
13870    /// List all of the ordered rules present in a single specified policy.
13871    pub fn get(&self) -> super::builder::region_security_policies::Get {
13872        super::builder::region_security_policies::Get::new(self.inner.clone())
13873    }
13874
13875    /// Gets a rule at the specified priority.
13876    pub fn get_rule(&self) -> super::builder::region_security_policies::GetRule {
13877        super::builder::region_security_policies::GetRule::new(self.inner.clone())
13878    }
13879
13880    /// Creates a new policy in the specified project using the data included in
13881    /// the request.
13882    pub fn insert(&self) -> super::builder::region_security_policies::Insert {
13883        super::builder::region_security_policies::Insert::new(self.inner.clone())
13884    }
13885
13886    /// List all the policies that have been configured for the specified project
13887    /// and region.
13888    pub fn list(&self) -> super::builder::region_security_policies::List {
13889        super::builder::region_security_policies::List::new(self.inner.clone())
13890    }
13891
13892    /// Patches the specified policy with the data included in the request. To
13893    /// clear fields in the policy, leave the fields empty and specify them in the
13894    /// updateMask. This cannot be used to be update the rules in the policy.
13895    /// Please use the per rule methods like addRule, patchRule, and removeRule
13896    /// instead.
13897    pub fn patch(&self) -> super::builder::region_security_policies::Patch {
13898        super::builder::region_security_policies::Patch::new(self.inner.clone())
13899    }
13900
13901    /// Patches a rule at the specified priority. To clear fields in the rule,
13902    /// leave the fields empty and specify them in the updateMask.
13903    pub fn patch_rule(&self) -> super::builder::region_security_policies::PatchRule {
13904        super::builder::region_security_policies::PatchRule::new(self.inner.clone())
13905    }
13906
13907    /// Deletes a rule at the specified priority.
13908    pub fn remove_rule(&self) -> super::builder::region_security_policies::RemoveRule {
13909        super::builder::region_security_policies::RemoveRule::new(self.inner.clone())
13910    }
13911
13912    /// Sets the labels on a security policy. To learn more about labels,
13913    /// read the Labeling Resources
13914    /// documentation.
13915    pub fn set_labels(&self) -> super::builder::region_security_policies::SetLabels {
13916        super::builder::region_security_policies::SetLabels::new(self.inner.clone())
13917    }
13918
13919    /// Retrieves the specified region-specific Operations resource.
13920    pub fn get_operation(&self) -> super::builder::region_security_policies::GetOperation {
13921        super::builder::region_security_policies::GetOperation::new(self.inner.clone())
13922    }
13923}
13924
13925/// Implements a client for the Google Compute Engine API.
13926///
13927/// # Example
13928/// ```
13929/// # use google_cloud_compute_v1::client::RegionSnapshotSettings;
13930/// async fn sample(
13931/// ) -> anyhow::Result<()> {
13932///     let client = RegionSnapshotSettings::builder().build().await?;
13933///     // use `client` to make requests to the Google Compute Engine API.
13934///     Ok(())
13935/// }
13936/// ```
13937///
13938/// # Service Description
13939///
13940/// Service for the `regionSnapshotSettings` resource.
13941///
13942/// # Configuration
13943///
13944/// To configure `RegionSnapshotSettings` use the `with_*` methods in the type returned
13945/// by [builder()][RegionSnapshotSettings::builder]. The default configuration should
13946/// work for most applications. Common configuration changes include
13947///
13948/// * [with_endpoint()]: by default this client uses the global default endpoint
13949///   (`https://compute.googleapis.com`). Applications using regional
13950///   endpoints or running in restricted networks (e.g. a network configured
13951//    with [Private Google Access with VPC Service Controls]) may want to
13952///   override this default.
13953/// * [with_credentials()]: by default this client uses
13954///   [Application Default Credentials]. Applications using custom
13955///   authentication may need to override this default.
13956///
13957/// [with_endpoint()]: super::builder::region_snapshot_settings::ClientBuilder::with_endpoint
13958/// [with_credentials()]: super::builder::region_snapshot_settings::ClientBuilder::with_credentials
13959/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13960/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13961///
13962/// # Pooling and Cloning
13963///
13964/// `RegionSnapshotSettings` holds a connection pool internally, it is advised to
13965/// create one and reuse it. You do not need to wrap `RegionSnapshotSettings` in
13966/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13967/// already uses an `Arc` internally.
13968#[cfg(feature = "region-snapshot-settings")]
13969#[cfg_attr(docsrs, doc(cfg(feature = "region-snapshot-settings")))]
13970#[derive(Clone, Debug)]
13971pub struct RegionSnapshotSettings {
13972    inner: std::sync::Arc<dyn super::stub::dynamic::RegionSnapshotSettings>,
13973}
13974
13975#[cfg(feature = "region-snapshot-settings")]
13976impl RegionSnapshotSettings {
13977    /// Returns a builder for [RegionSnapshotSettings].
13978    ///
13979    /// ```
13980    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13981    /// # use google_cloud_compute_v1::client::RegionSnapshotSettings;
13982    /// let client = RegionSnapshotSettings::builder().build().await?;
13983    /// # Ok(()) }
13984    /// ```
13985    pub fn builder() -> super::builder::region_snapshot_settings::ClientBuilder {
13986        crate::new_client_builder(super::builder::region_snapshot_settings::client::Factory)
13987    }
13988
13989    /// Creates a new client from the provided stub.
13990    ///
13991    /// The most common case for calling this function is in tests mocking the
13992    /// client's behavior.
13993    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
13994    where
13995        T: super::stub::RegionSnapshotSettings + 'static,
13996    {
13997        Self { inner: stub.into() }
13998    }
13999
14000    pub(crate) async fn new(
14001        config: gaxi::options::ClientConfig,
14002    ) -> crate::ClientBuilderResult<Self> {
14003        let inner = Self::build_inner(config).await?;
14004        Ok(Self { inner })
14005    }
14006
14007    async fn build_inner(
14008        conf: gaxi::options::ClientConfig,
14009    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionSnapshotSettings>>
14010    {
14011        if gaxi::options::tracing_enabled(&conf) {
14012            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14013        }
14014        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14015    }
14016
14017    async fn build_transport(
14018        conf: gaxi::options::ClientConfig,
14019    ) -> crate::ClientBuilderResult<impl super::stub::RegionSnapshotSettings> {
14020        super::transport::RegionSnapshotSettings::new(conf).await
14021    }
14022
14023    async fn build_with_tracing(
14024        conf: gaxi::options::ClientConfig,
14025    ) -> crate::ClientBuilderResult<impl super::stub::RegionSnapshotSettings> {
14026        Self::build_transport(conf)
14027            .await
14028            .map(super::tracing::RegionSnapshotSettings::new)
14029    }
14030
14031    /// Get region snapshot settings.
14032    pub fn get(&self) -> super::builder::region_snapshot_settings::Get {
14033        super::builder::region_snapshot_settings::Get::new(self.inner.clone())
14034    }
14035
14036    /// Patch region snapshot settings.
14037    pub fn patch(&self) -> super::builder::region_snapshot_settings::Patch {
14038        super::builder::region_snapshot_settings::Patch::new(self.inner.clone())
14039    }
14040
14041    /// Retrieves the specified region-specific Operations resource.
14042    pub fn get_operation(&self) -> super::builder::region_snapshot_settings::GetOperation {
14043        super::builder::region_snapshot_settings::GetOperation::new(self.inner.clone())
14044    }
14045}
14046
14047/// Implements a client for the Google Compute Engine API.
14048///
14049/// # Example
14050/// ```
14051/// # use google_cloud_compute_v1::client::RegionSnapshots;
14052/// async fn sample(
14053/// ) -> anyhow::Result<()> {
14054///     let client = RegionSnapshots::builder().build().await?;
14055///     // use `client` to make requests to the Google Compute Engine API.
14056///     Ok(())
14057/// }
14058/// ```
14059///
14060/// # Service Description
14061///
14062/// Service for the `regionSnapshots` resource.
14063///
14064/// # Configuration
14065///
14066/// To configure `RegionSnapshots` use the `with_*` methods in the type returned
14067/// by [builder()][RegionSnapshots::builder]. The default configuration should
14068/// work for most applications. Common configuration changes include
14069///
14070/// * [with_endpoint()]: by default this client uses the global default endpoint
14071///   (`https://compute.googleapis.com`). Applications using regional
14072///   endpoints or running in restricted networks (e.g. a network configured
14073//    with [Private Google Access with VPC Service Controls]) may want to
14074///   override this default.
14075/// * [with_credentials()]: by default this client uses
14076///   [Application Default Credentials]. Applications using custom
14077///   authentication may need to override this default.
14078///
14079/// [with_endpoint()]: super::builder::region_snapshots::ClientBuilder::with_endpoint
14080/// [with_credentials()]: super::builder::region_snapshots::ClientBuilder::with_credentials
14081/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14082/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14083///
14084/// # Pooling and Cloning
14085///
14086/// `RegionSnapshots` holds a connection pool internally, it is advised to
14087/// create one and reuse it. You do not need to wrap `RegionSnapshots` in
14088/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14089/// already uses an `Arc` internally.
14090#[cfg(feature = "region-snapshots")]
14091#[cfg_attr(docsrs, doc(cfg(feature = "region-snapshots")))]
14092#[derive(Clone, Debug)]
14093pub struct RegionSnapshots {
14094    inner: std::sync::Arc<dyn super::stub::dynamic::RegionSnapshots>,
14095}
14096
14097#[cfg(feature = "region-snapshots")]
14098impl RegionSnapshots {
14099    /// Returns a builder for [RegionSnapshots].
14100    ///
14101    /// ```
14102    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14103    /// # use google_cloud_compute_v1::client::RegionSnapshots;
14104    /// let client = RegionSnapshots::builder().build().await?;
14105    /// # Ok(()) }
14106    /// ```
14107    pub fn builder() -> super::builder::region_snapshots::ClientBuilder {
14108        crate::new_client_builder(super::builder::region_snapshots::client::Factory)
14109    }
14110
14111    /// Creates a new client from the provided stub.
14112    ///
14113    /// The most common case for calling this function is in tests mocking the
14114    /// client's behavior.
14115    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
14116    where
14117        T: super::stub::RegionSnapshots + 'static,
14118    {
14119        Self { inner: stub.into() }
14120    }
14121
14122    pub(crate) async fn new(
14123        config: gaxi::options::ClientConfig,
14124    ) -> crate::ClientBuilderResult<Self> {
14125        let inner = Self::build_inner(config).await?;
14126        Ok(Self { inner })
14127    }
14128
14129    async fn build_inner(
14130        conf: gaxi::options::ClientConfig,
14131    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionSnapshots>> {
14132        if gaxi::options::tracing_enabled(&conf) {
14133            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14134        }
14135        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14136    }
14137
14138    async fn build_transport(
14139        conf: gaxi::options::ClientConfig,
14140    ) -> crate::ClientBuilderResult<impl super::stub::RegionSnapshots> {
14141        super::transport::RegionSnapshots::new(conf).await
14142    }
14143
14144    async fn build_with_tracing(
14145        conf: gaxi::options::ClientConfig,
14146    ) -> crate::ClientBuilderResult<impl super::stub::RegionSnapshots> {
14147        Self::build_transport(conf)
14148            .await
14149            .map(super::tracing::RegionSnapshots::new)
14150    }
14151
14152    /// Deletes the specified Snapshot resource. Keep in mind that deleting
14153    /// a single snapshot might not necessarily delete all the data on that
14154    /// snapshot. If any data on the snapshot that is marked for deletion is
14155    /// needed for subsequent snapshots, the data will be moved to the next
14156    /// corresponding snapshot.
14157    ///
14158    /// For more information, seeDeleting
14159    /// snapshots.
14160    pub fn delete(&self) -> super::builder::region_snapshots::Delete {
14161        super::builder::region_snapshots::Delete::new(self.inner.clone())
14162    }
14163
14164    /// Returns the specified Snapshot resource.
14165    pub fn get(&self) -> super::builder::region_snapshots::Get {
14166        super::builder::region_snapshots::Get::new(self.inner.clone())
14167    }
14168
14169    /// Gets the access control policy for a resource. May be empty if no such
14170    /// policy or resource exists.
14171    pub fn get_iam_policy(&self) -> super::builder::region_snapshots::GetIamPolicy {
14172        super::builder::region_snapshots::GetIamPolicy::new(self.inner.clone())
14173    }
14174
14175    /// Creates a snapshot in the specified region using the data included
14176    /// in the request.
14177    pub fn insert(&self) -> super::builder::region_snapshots::Insert {
14178        super::builder::region_snapshots::Insert::new(self.inner.clone())
14179    }
14180
14181    /// Retrieves the list of Snapshot resources contained within
14182    /// the specified region.
14183    pub fn list(&self) -> super::builder::region_snapshots::List {
14184        super::builder::region_snapshots::List::new(self.inner.clone())
14185    }
14186
14187    /// Sets the access control policy on the specified resource.
14188    /// Replaces any existing policy.
14189    pub fn set_iam_policy(&self) -> super::builder::region_snapshots::SetIamPolicy {
14190        super::builder::region_snapshots::SetIamPolicy::new(self.inner.clone())
14191    }
14192
14193    /// Sets the labels on a regional snapshot. To learn more about labels, read
14194    /// the Labeling Resources
14195    /// documentation.
14196    pub fn set_labels(&self) -> super::builder::region_snapshots::SetLabels {
14197        super::builder::region_snapshots::SetLabels::new(self.inner.clone())
14198    }
14199
14200    /// Returns permissions that a caller has on the specified resource.
14201    pub fn test_iam_permissions(&self) -> super::builder::region_snapshots::TestIamPermissions {
14202        super::builder::region_snapshots::TestIamPermissions::new(self.inner.clone())
14203    }
14204
14205    /// Rotates the customer-managed
14206    /// encryption key to the latest version for the specified snapshot.
14207    pub fn update_kms_key(&self) -> super::builder::region_snapshots::UpdateKmsKey {
14208        super::builder::region_snapshots::UpdateKmsKey::new(self.inner.clone())
14209    }
14210
14211    /// Retrieves the specified region-specific Operations resource.
14212    pub fn get_operation(&self) -> super::builder::region_snapshots::GetOperation {
14213        super::builder::region_snapshots::GetOperation::new(self.inner.clone())
14214    }
14215}
14216
14217/// Implements a client for the Google Compute Engine API.
14218///
14219/// # Example
14220/// ```
14221/// # use google_cloud_compute_v1::client::RegionSslCertificates;
14222/// async fn sample(
14223/// ) -> anyhow::Result<()> {
14224///     let client = RegionSslCertificates::builder().build().await?;
14225///     // use `client` to make requests to the Google Compute Engine API.
14226///     Ok(())
14227/// }
14228/// ```
14229///
14230/// # Service Description
14231///
14232/// Service for the `regionSslCertificates` resource.
14233///
14234/// # Configuration
14235///
14236/// To configure `RegionSslCertificates` use the `with_*` methods in the type returned
14237/// by [builder()][RegionSslCertificates::builder]. The default configuration should
14238/// work for most applications. Common configuration changes include
14239///
14240/// * [with_endpoint()]: by default this client uses the global default endpoint
14241///   (`https://compute.googleapis.com`). Applications using regional
14242///   endpoints or running in restricted networks (e.g. a network configured
14243//    with [Private Google Access with VPC Service Controls]) may want to
14244///   override this default.
14245/// * [with_credentials()]: by default this client uses
14246///   [Application Default Credentials]. Applications using custom
14247///   authentication may need to override this default.
14248///
14249/// [with_endpoint()]: super::builder::region_ssl_certificates::ClientBuilder::with_endpoint
14250/// [with_credentials()]: super::builder::region_ssl_certificates::ClientBuilder::with_credentials
14251/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14252/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14253///
14254/// # Pooling and Cloning
14255///
14256/// `RegionSslCertificates` holds a connection pool internally, it is advised to
14257/// create one and reuse it. You do not need to wrap `RegionSslCertificates` in
14258/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14259/// already uses an `Arc` internally.
14260#[cfg(feature = "region-ssl-certificates")]
14261#[cfg_attr(docsrs, doc(cfg(feature = "region-ssl-certificates")))]
14262#[derive(Clone, Debug)]
14263pub struct RegionSslCertificates {
14264    inner: std::sync::Arc<dyn super::stub::dynamic::RegionSslCertificates>,
14265}
14266
14267#[cfg(feature = "region-ssl-certificates")]
14268impl RegionSslCertificates {
14269    /// Returns a builder for [RegionSslCertificates].
14270    ///
14271    /// ```
14272    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14273    /// # use google_cloud_compute_v1::client::RegionSslCertificates;
14274    /// let client = RegionSslCertificates::builder().build().await?;
14275    /// # Ok(()) }
14276    /// ```
14277    pub fn builder() -> super::builder::region_ssl_certificates::ClientBuilder {
14278        crate::new_client_builder(super::builder::region_ssl_certificates::client::Factory)
14279    }
14280
14281    /// Creates a new client from the provided stub.
14282    ///
14283    /// The most common case for calling this function is in tests mocking the
14284    /// client's behavior.
14285    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
14286    where
14287        T: super::stub::RegionSslCertificates + 'static,
14288    {
14289        Self { inner: stub.into() }
14290    }
14291
14292    pub(crate) async fn new(
14293        config: gaxi::options::ClientConfig,
14294    ) -> crate::ClientBuilderResult<Self> {
14295        let inner = Self::build_inner(config).await?;
14296        Ok(Self { inner })
14297    }
14298
14299    async fn build_inner(
14300        conf: gaxi::options::ClientConfig,
14301    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionSslCertificates>>
14302    {
14303        if gaxi::options::tracing_enabled(&conf) {
14304            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14305        }
14306        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14307    }
14308
14309    async fn build_transport(
14310        conf: gaxi::options::ClientConfig,
14311    ) -> crate::ClientBuilderResult<impl super::stub::RegionSslCertificates> {
14312        super::transport::RegionSslCertificates::new(conf).await
14313    }
14314
14315    async fn build_with_tracing(
14316        conf: gaxi::options::ClientConfig,
14317    ) -> crate::ClientBuilderResult<impl super::stub::RegionSslCertificates> {
14318        Self::build_transport(conf)
14319            .await
14320            .map(super::tracing::RegionSslCertificates::new)
14321    }
14322
14323    /// Deletes the specified SslCertificate resource in the region.
14324    pub fn delete(&self) -> super::builder::region_ssl_certificates::Delete {
14325        super::builder::region_ssl_certificates::Delete::new(self.inner.clone())
14326    }
14327
14328    /// Returns the specified SslCertificate resource in the specified region. Get
14329    /// a list of available SSL certificates by making a list()
14330    /// request.
14331    pub fn get(&self) -> super::builder::region_ssl_certificates::Get {
14332        super::builder::region_ssl_certificates::Get::new(self.inner.clone())
14333    }
14334
14335    /// Creates a SslCertificate resource in the specified project and region using
14336    /// the data included in the request
14337    pub fn insert(&self) -> super::builder::region_ssl_certificates::Insert {
14338        super::builder::region_ssl_certificates::Insert::new(self.inner.clone())
14339    }
14340
14341    /// Retrieves the list of SslCertificate resources available to the specified
14342    /// project in the specified region.
14343    pub fn list(&self) -> super::builder::region_ssl_certificates::List {
14344        super::builder::region_ssl_certificates::List::new(self.inner.clone())
14345    }
14346
14347    /// Retrieves the specified region-specific Operations resource.
14348    pub fn get_operation(&self) -> super::builder::region_ssl_certificates::GetOperation {
14349        super::builder::region_ssl_certificates::GetOperation::new(self.inner.clone())
14350    }
14351}
14352
14353/// Implements a client for the Google Compute Engine API.
14354///
14355/// # Example
14356/// ```
14357/// # use google_cloud_compute_v1::client::RegionSslPolicies;
14358/// async fn sample(
14359/// ) -> anyhow::Result<()> {
14360///     let client = RegionSslPolicies::builder().build().await?;
14361///     // use `client` to make requests to the Google Compute Engine API.
14362///     Ok(())
14363/// }
14364/// ```
14365///
14366/// # Service Description
14367///
14368/// Service for the `regionSslPolicies` resource.
14369///
14370/// # Configuration
14371///
14372/// To configure `RegionSslPolicies` use the `with_*` methods in the type returned
14373/// by [builder()][RegionSslPolicies::builder]. The default configuration should
14374/// work for most applications. Common configuration changes include
14375///
14376/// * [with_endpoint()]: by default this client uses the global default endpoint
14377///   (`https://compute.googleapis.com`). Applications using regional
14378///   endpoints or running in restricted networks (e.g. a network configured
14379//    with [Private Google Access with VPC Service Controls]) may want to
14380///   override this default.
14381/// * [with_credentials()]: by default this client uses
14382///   [Application Default Credentials]. Applications using custom
14383///   authentication may need to override this default.
14384///
14385/// [with_endpoint()]: super::builder::region_ssl_policies::ClientBuilder::with_endpoint
14386/// [with_credentials()]: super::builder::region_ssl_policies::ClientBuilder::with_credentials
14387/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14388/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14389///
14390/// # Pooling and Cloning
14391///
14392/// `RegionSslPolicies` holds a connection pool internally, it is advised to
14393/// create one and reuse it. You do not need to wrap `RegionSslPolicies` in
14394/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14395/// already uses an `Arc` internally.
14396#[cfg(feature = "region-ssl-policies")]
14397#[cfg_attr(docsrs, doc(cfg(feature = "region-ssl-policies")))]
14398#[derive(Clone, Debug)]
14399pub struct RegionSslPolicies {
14400    inner: std::sync::Arc<dyn super::stub::dynamic::RegionSslPolicies>,
14401}
14402
14403#[cfg(feature = "region-ssl-policies")]
14404impl RegionSslPolicies {
14405    /// Returns a builder for [RegionSslPolicies].
14406    ///
14407    /// ```
14408    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14409    /// # use google_cloud_compute_v1::client::RegionSslPolicies;
14410    /// let client = RegionSslPolicies::builder().build().await?;
14411    /// # Ok(()) }
14412    /// ```
14413    pub fn builder() -> super::builder::region_ssl_policies::ClientBuilder {
14414        crate::new_client_builder(super::builder::region_ssl_policies::client::Factory)
14415    }
14416
14417    /// Creates a new client from the provided stub.
14418    ///
14419    /// The most common case for calling this function is in tests mocking the
14420    /// client's behavior.
14421    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
14422    where
14423        T: super::stub::RegionSslPolicies + 'static,
14424    {
14425        Self { inner: stub.into() }
14426    }
14427
14428    pub(crate) async fn new(
14429        config: gaxi::options::ClientConfig,
14430    ) -> crate::ClientBuilderResult<Self> {
14431        let inner = Self::build_inner(config).await?;
14432        Ok(Self { inner })
14433    }
14434
14435    async fn build_inner(
14436        conf: gaxi::options::ClientConfig,
14437    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionSslPolicies>>
14438    {
14439        if gaxi::options::tracing_enabled(&conf) {
14440            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14441        }
14442        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14443    }
14444
14445    async fn build_transport(
14446        conf: gaxi::options::ClientConfig,
14447    ) -> crate::ClientBuilderResult<impl super::stub::RegionSslPolicies> {
14448        super::transport::RegionSslPolicies::new(conf).await
14449    }
14450
14451    async fn build_with_tracing(
14452        conf: gaxi::options::ClientConfig,
14453    ) -> crate::ClientBuilderResult<impl super::stub::RegionSslPolicies> {
14454        Self::build_transport(conf)
14455            .await
14456            .map(super::tracing::RegionSslPolicies::new)
14457    }
14458
14459    /// Deletes the specified SSL policy. The SSL policy resource can be deleted
14460    /// only if it is not in use by any TargetHttpsProxy or TargetSslProxy
14461    /// resources.
14462    pub fn delete(&self) -> super::builder::region_ssl_policies::Delete {
14463        super::builder::region_ssl_policies::Delete::new(self.inner.clone())
14464    }
14465
14466    /// Lists all of the ordered rules present in a single specified policy.
14467    pub fn get(&self) -> super::builder::region_ssl_policies::Get {
14468        super::builder::region_ssl_policies::Get::new(self.inner.clone())
14469    }
14470
14471    /// Creates a new policy in the specified project and region using the data
14472    /// included in the request.
14473    pub fn insert(&self) -> super::builder::region_ssl_policies::Insert {
14474        super::builder::region_ssl_policies::Insert::new(self.inner.clone())
14475    }
14476
14477    /// Lists all the SSL policies that have been configured for the specified
14478    /// project and region.
14479    pub fn list(&self) -> super::builder::region_ssl_policies::List {
14480        super::builder::region_ssl_policies::List::new(self.inner.clone())
14481    }
14482
14483    /// Lists all features that can be specified in the SSL policy when using
14484    /// custom profile.
14485    pub fn list_available_features(
14486        &self,
14487    ) -> super::builder::region_ssl_policies::ListAvailableFeatures {
14488        super::builder::region_ssl_policies::ListAvailableFeatures::new(self.inner.clone())
14489    }
14490
14491    /// Patches the specified SSL policy with the data included in the request.
14492    pub fn patch(&self) -> super::builder::region_ssl_policies::Patch {
14493        super::builder::region_ssl_policies::Patch::new(self.inner.clone())
14494    }
14495
14496    /// Retrieves the specified region-specific Operations resource.
14497    pub fn get_operation(&self) -> super::builder::region_ssl_policies::GetOperation {
14498        super::builder::region_ssl_policies::GetOperation::new(self.inner.clone())
14499    }
14500}
14501
14502/// Implements a client for the Google Compute Engine API.
14503///
14504/// # Example
14505/// ```
14506/// # use google_cloud_compute_v1::client::RegionTargetHttpProxies;
14507/// async fn sample(
14508/// ) -> anyhow::Result<()> {
14509///     let client = RegionTargetHttpProxies::builder().build().await?;
14510///     // use `client` to make requests to the Google Compute Engine API.
14511///     Ok(())
14512/// }
14513/// ```
14514///
14515/// # Service Description
14516///
14517/// Service for the `regionTargetHttpProxies` resource.
14518///
14519/// # Configuration
14520///
14521/// To configure `RegionTargetHttpProxies` use the `with_*` methods in the type returned
14522/// by [builder()][RegionTargetHttpProxies::builder]. The default configuration should
14523/// work for most applications. Common configuration changes include
14524///
14525/// * [with_endpoint()]: by default this client uses the global default endpoint
14526///   (`https://compute.googleapis.com`). Applications using regional
14527///   endpoints or running in restricted networks (e.g. a network configured
14528//    with [Private Google Access with VPC Service Controls]) may want to
14529///   override this default.
14530/// * [with_credentials()]: by default this client uses
14531///   [Application Default Credentials]. Applications using custom
14532///   authentication may need to override this default.
14533///
14534/// [with_endpoint()]: super::builder::region_target_http_proxies::ClientBuilder::with_endpoint
14535/// [with_credentials()]: super::builder::region_target_http_proxies::ClientBuilder::with_credentials
14536/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14537/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14538///
14539/// # Pooling and Cloning
14540///
14541/// `RegionTargetHttpProxies` holds a connection pool internally, it is advised to
14542/// create one and reuse it. You do not need to wrap `RegionTargetHttpProxies` in
14543/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14544/// already uses an `Arc` internally.
14545#[cfg(feature = "region-target-http-proxies")]
14546#[cfg_attr(docsrs, doc(cfg(feature = "region-target-http-proxies")))]
14547#[derive(Clone, Debug)]
14548pub struct RegionTargetHttpProxies {
14549    inner: std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpProxies>,
14550}
14551
14552#[cfg(feature = "region-target-http-proxies")]
14553impl RegionTargetHttpProxies {
14554    /// Returns a builder for [RegionTargetHttpProxies].
14555    ///
14556    /// ```
14557    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14558    /// # use google_cloud_compute_v1::client::RegionTargetHttpProxies;
14559    /// let client = RegionTargetHttpProxies::builder().build().await?;
14560    /// # Ok(()) }
14561    /// ```
14562    pub fn builder() -> super::builder::region_target_http_proxies::ClientBuilder {
14563        crate::new_client_builder(super::builder::region_target_http_proxies::client::Factory)
14564    }
14565
14566    /// Creates a new client from the provided stub.
14567    ///
14568    /// The most common case for calling this function is in tests mocking the
14569    /// client's behavior.
14570    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
14571    where
14572        T: super::stub::RegionTargetHttpProxies + 'static,
14573    {
14574        Self { inner: stub.into() }
14575    }
14576
14577    pub(crate) async fn new(
14578        config: gaxi::options::ClientConfig,
14579    ) -> crate::ClientBuilderResult<Self> {
14580        let inner = Self::build_inner(config).await?;
14581        Ok(Self { inner })
14582    }
14583
14584    async fn build_inner(
14585        conf: gaxi::options::ClientConfig,
14586    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpProxies>>
14587    {
14588        if gaxi::options::tracing_enabled(&conf) {
14589            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14590        }
14591        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14592    }
14593
14594    async fn build_transport(
14595        conf: gaxi::options::ClientConfig,
14596    ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetHttpProxies> {
14597        super::transport::RegionTargetHttpProxies::new(conf).await
14598    }
14599
14600    async fn build_with_tracing(
14601        conf: gaxi::options::ClientConfig,
14602    ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetHttpProxies> {
14603        Self::build_transport(conf)
14604            .await
14605            .map(super::tracing::RegionTargetHttpProxies::new)
14606    }
14607
14608    /// Deletes the specified TargetHttpProxy resource.
14609    pub fn delete(&self) -> super::builder::region_target_http_proxies::Delete {
14610        super::builder::region_target_http_proxies::Delete::new(self.inner.clone())
14611    }
14612
14613    /// Returns the specified TargetHttpProxy resource in the specified region.
14614    pub fn get(&self) -> super::builder::region_target_http_proxies::Get {
14615        super::builder::region_target_http_proxies::Get::new(self.inner.clone())
14616    }
14617
14618    /// Creates a TargetHttpProxy resource in the specified project and region
14619    /// using the data included in the request.
14620    pub fn insert(&self) -> super::builder::region_target_http_proxies::Insert {
14621        super::builder::region_target_http_proxies::Insert::new(self.inner.clone())
14622    }
14623
14624    /// Retrieves the list of TargetHttpProxy resources available
14625    /// to the specified project in the specified region.
14626    pub fn list(&self) -> super::builder::region_target_http_proxies::List {
14627        super::builder::region_target_http_proxies::List::new(self.inner.clone())
14628    }
14629
14630    /// Changes the URL map for TargetHttpProxy.
14631    pub fn set_url_map(&self) -> super::builder::region_target_http_proxies::SetUrlMap {
14632        super::builder::region_target_http_proxies::SetUrlMap::new(self.inner.clone())
14633    }
14634
14635    /// Retrieves the specified region-specific Operations resource.
14636    pub fn get_operation(&self) -> super::builder::region_target_http_proxies::GetOperation {
14637        super::builder::region_target_http_proxies::GetOperation::new(self.inner.clone())
14638    }
14639}
14640
14641/// Implements a client for the Google Compute Engine API.
14642///
14643/// # Example
14644/// ```
14645/// # use google_cloud_compute_v1::client::RegionTargetHttpsProxies;
14646/// async fn sample(
14647/// ) -> anyhow::Result<()> {
14648///     let client = RegionTargetHttpsProxies::builder().build().await?;
14649///     // use `client` to make requests to the Google Compute Engine API.
14650///     Ok(())
14651/// }
14652/// ```
14653///
14654/// # Service Description
14655///
14656/// Service for the `regionTargetHttpsProxies` resource.
14657///
14658/// # Configuration
14659///
14660/// To configure `RegionTargetHttpsProxies` use the `with_*` methods in the type returned
14661/// by [builder()][RegionTargetHttpsProxies::builder]. The default configuration should
14662/// work for most applications. Common configuration changes include
14663///
14664/// * [with_endpoint()]: by default this client uses the global default endpoint
14665///   (`https://compute.googleapis.com`). Applications using regional
14666///   endpoints or running in restricted networks (e.g. a network configured
14667//    with [Private Google Access with VPC Service Controls]) may want to
14668///   override this default.
14669/// * [with_credentials()]: by default this client uses
14670///   [Application Default Credentials]. Applications using custom
14671///   authentication may need to override this default.
14672///
14673/// [with_endpoint()]: super::builder::region_target_https_proxies::ClientBuilder::with_endpoint
14674/// [with_credentials()]: super::builder::region_target_https_proxies::ClientBuilder::with_credentials
14675/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14676/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14677///
14678/// # Pooling and Cloning
14679///
14680/// `RegionTargetHttpsProxies` holds a connection pool internally, it is advised to
14681/// create one and reuse it. You do not need to wrap `RegionTargetHttpsProxies` in
14682/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14683/// already uses an `Arc` internally.
14684#[cfg(feature = "region-target-https-proxies")]
14685#[cfg_attr(docsrs, doc(cfg(feature = "region-target-https-proxies")))]
14686#[derive(Clone, Debug)]
14687pub struct RegionTargetHttpsProxies {
14688    inner: std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpsProxies>,
14689}
14690
14691#[cfg(feature = "region-target-https-proxies")]
14692impl RegionTargetHttpsProxies {
14693    /// Returns a builder for [RegionTargetHttpsProxies].
14694    ///
14695    /// ```
14696    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14697    /// # use google_cloud_compute_v1::client::RegionTargetHttpsProxies;
14698    /// let client = RegionTargetHttpsProxies::builder().build().await?;
14699    /// # Ok(()) }
14700    /// ```
14701    pub fn builder() -> super::builder::region_target_https_proxies::ClientBuilder {
14702        crate::new_client_builder(super::builder::region_target_https_proxies::client::Factory)
14703    }
14704
14705    /// Creates a new client from the provided stub.
14706    ///
14707    /// The most common case for calling this function is in tests mocking the
14708    /// client's behavior.
14709    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
14710    where
14711        T: super::stub::RegionTargetHttpsProxies + 'static,
14712    {
14713        Self { inner: stub.into() }
14714    }
14715
14716    pub(crate) async fn new(
14717        config: gaxi::options::ClientConfig,
14718    ) -> crate::ClientBuilderResult<Self> {
14719        let inner = Self::build_inner(config).await?;
14720        Ok(Self { inner })
14721    }
14722
14723    async fn build_inner(
14724        conf: gaxi::options::ClientConfig,
14725    ) -> crate::ClientBuilderResult<
14726        std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpsProxies>,
14727    > {
14728        if gaxi::options::tracing_enabled(&conf) {
14729            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14730        }
14731        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14732    }
14733
14734    async fn build_transport(
14735        conf: gaxi::options::ClientConfig,
14736    ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetHttpsProxies> {
14737        super::transport::RegionTargetHttpsProxies::new(conf).await
14738    }
14739
14740    async fn build_with_tracing(
14741        conf: gaxi::options::ClientConfig,
14742    ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetHttpsProxies> {
14743        Self::build_transport(conf)
14744            .await
14745            .map(super::tracing::RegionTargetHttpsProxies::new)
14746    }
14747
14748    /// Deletes the specified TargetHttpsProxy resource.
14749    pub fn delete(&self) -> super::builder::region_target_https_proxies::Delete {
14750        super::builder::region_target_https_proxies::Delete::new(self.inner.clone())
14751    }
14752
14753    /// Returns the specified TargetHttpsProxy resource in the specified region.
14754    pub fn get(&self) -> super::builder::region_target_https_proxies::Get {
14755        super::builder::region_target_https_proxies::Get::new(self.inner.clone())
14756    }
14757
14758    /// Creates a TargetHttpsProxy resource in the specified project and region
14759    /// using the data included in the request.
14760    pub fn insert(&self) -> super::builder::region_target_https_proxies::Insert {
14761        super::builder::region_target_https_proxies::Insert::new(self.inner.clone())
14762    }
14763
14764    /// Retrieves the list of TargetHttpsProxy resources available
14765    /// to the specified project in the specified region.
14766    pub fn list(&self) -> super::builder::region_target_https_proxies::List {
14767        super::builder::region_target_https_proxies::List::new(self.inner.clone())
14768    }
14769
14770    /// Patches the specified regional TargetHttpsProxy resource with the data
14771    /// included in the request. This method supports PATCH
14772    /// semantics and usesJSON merge
14773    /// patch format and processing rules.
14774    pub fn patch(&self) -> super::builder::region_target_https_proxies::Patch {
14775        super::builder::region_target_https_proxies::Patch::new(self.inner.clone())
14776    }
14777
14778    /// Replaces SslCertificates for TargetHttpsProxy.
14779    pub fn set_ssl_certificates(
14780        &self,
14781    ) -> super::builder::region_target_https_proxies::SetSslCertificates {
14782        super::builder::region_target_https_proxies::SetSslCertificates::new(self.inner.clone())
14783    }
14784
14785    /// Changes the URL map for TargetHttpsProxy.
14786    pub fn set_url_map(&self) -> super::builder::region_target_https_proxies::SetUrlMap {
14787        super::builder::region_target_https_proxies::SetUrlMap::new(self.inner.clone())
14788    }
14789
14790    /// Retrieves the specified region-specific Operations resource.
14791    pub fn get_operation(&self) -> super::builder::region_target_https_proxies::GetOperation {
14792        super::builder::region_target_https_proxies::GetOperation::new(self.inner.clone())
14793    }
14794}
14795
14796/// Implements a client for the Google Compute Engine API.
14797///
14798/// # Example
14799/// ```
14800/// # use google_cloud_compute_v1::client::RegionTargetTcpProxies;
14801/// async fn sample(
14802/// ) -> anyhow::Result<()> {
14803///     let client = RegionTargetTcpProxies::builder().build().await?;
14804///     // use `client` to make requests to the Google Compute Engine API.
14805///     Ok(())
14806/// }
14807/// ```
14808///
14809/// # Service Description
14810///
14811/// Service for the `regionTargetTcpProxies` resource.
14812///
14813/// # Configuration
14814///
14815/// To configure `RegionTargetTcpProxies` use the `with_*` methods in the type returned
14816/// by [builder()][RegionTargetTcpProxies::builder]. The default configuration should
14817/// work for most applications. Common configuration changes include
14818///
14819/// * [with_endpoint()]: by default this client uses the global default endpoint
14820///   (`https://compute.googleapis.com`). Applications using regional
14821///   endpoints or running in restricted networks (e.g. a network configured
14822//    with [Private Google Access with VPC Service Controls]) may want to
14823///   override this default.
14824/// * [with_credentials()]: by default this client uses
14825///   [Application Default Credentials]. Applications using custom
14826///   authentication may need to override this default.
14827///
14828/// [with_endpoint()]: super::builder::region_target_tcp_proxies::ClientBuilder::with_endpoint
14829/// [with_credentials()]: super::builder::region_target_tcp_proxies::ClientBuilder::with_credentials
14830/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14831/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14832///
14833/// # Pooling and Cloning
14834///
14835/// `RegionTargetTcpProxies` holds a connection pool internally, it is advised to
14836/// create one and reuse it. You do not need to wrap `RegionTargetTcpProxies` in
14837/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14838/// already uses an `Arc` internally.
14839#[cfg(feature = "region-target-tcp-proxies")]
14840#[cfg_attr(docsrs, doc(cfg(feature = "region-target-tcp-proxies")))]
14841#[derive(Clone, Debug)]
14842pub struct RegionTargetTcpProxies {
14843    inner: std::sync::Arc<dyn super::stub::dynamic::RegionTargetTcpProxies>,
14844}
14845
14846#[cfg(feature = "region-target-tcp-proxies")]
14847impl RegionTargetTcpProxies {
14848    /// Returns a builder for [RegionTargetTcpProxies].
14849    ///
14850    /// ```
14851    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14852    /// # use google_cloud_compute_v1::client::RegionTargetTcpProxies;
14853    /// let client = RegionTargetTcpProxies::builder().build().await?;
14854    /// # Ok(()) }
14855    /// ```
14856    pub fn builder() -> super::builder::region_target_tcp_proxies::ClientBuilder {
14857        crate::new_client_builder(super::builder::region_target_tcp_proxies::client::Factory)
14858    }
14859
14860    /// Creates a new client from the provided stub.
14861    ///
14862    /// The most common case for calling this function is in tests mocking the
14863    /// client's behavior.
14864    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
14865    where
14866        T: super::stub::RegionTargetTcpProxies + 'static,
14867    {
14868        Self { inner: stub.into() }
14869    }
14870
14871    pub(crate) async fn new(
14872        config: gaxi::options::ClientConfig,
14873    ) -> crate::ClientBuilderResult<Self> {
14874        let inner = Self::build_inner(config).await?;
14875        Ok(Self { inner })
14876    }
14877
14878    async fn build_inner(
14879        conf: gaxi::options::ClientConfig,
14880    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionTargetTcpProxies>>
14881    {
14882        if gaxi::options::tracing_enabled(&conf) {
14883            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14884        }
14885        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14886    }
14887
14888    async fn build_transport(
14889        conf: gaxi::options::ClientConfig,
14890    ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetTcpProxies> {
14891        super::transport::RegionTargetTcpProxies::new(conf).await
14892    }
14893
14894    async fn build_with_tracing(
14895        conf: gaxi::options::ClientConfig,
14896    ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetTcpProxies> {
14897        Self::build_transport(conf)
14898            .await
14899            .map(super::tracing::RegionTargetTcpProxies::new)
14900    }
14901
14902    /// Deletes the specified TargetTcpProxy resource.
14903    pub fn delete(&self) -> super::builder::region_target_tcp_proxies::Delete {
14904        super::builder::region_target_tcp_proxies::Delete::new(self.inner.clone())
14905    }
14906
14907    /// Returns the specified TargetTcpProxy resource.
14908    pub fn get(&self) -> super::builder::region_target_tcp_proxies::Get {
14909        super::builder::region_target_tcp_proxies::Get::new(self.inner.clone())
14910    }
14911
14912    /// Creates a TargetTcpProxy resource in the specified project and region using
14913    /// the data included in the request.
14914    pub fn insert(&self) -> super::builder::region_target_tcp_proxies::Insert {
14915        super::builder::region_target_tcp_proxies::Insert::new(self.inner.clone())
14916    }
14917
14918    /// Retrieves a list of TargetTcpProxy resources
14919    /// available to the specified project in a given region.
14920    pub fn list(&self) -> super::builder::region_target_tcp_proxies::List {
14921        super::builder::region_target_tcp_proxies::List::new(self.inner.clone())
14922    }
14923
14924    /// Retrieves the specified region-specific Operations resource.
14925    pub fn get_operation(&self) -> super::builder::region_target_tcp_proxies::GetOperation {
14926        super::builder::region_target_tcp_proxies::GetOperation::new(self.inner.clone())
14927    }
14928}
14929
14930/// Implements a client for the Google Compute Engine API.
14931///
14932/// # Example
14933/// ```
14934/// # use google_cloud_compute_v1::client::RegionUrlMaps;
14935/// async fn sample(
14936/// ) -> anyhow::Result<()> {
14937///     let client = RegionUrlMaps::builder().build().await?;
14938///     // use `client` to make requests to the Google Compute Engine API.
14939///     Ok(())
14940/// }
14941/// ```
14942///
14943/// # Service Description
14944///
14945/// Service for the `regionUrlMaps` resource.
14946///
14947/// # Configuration
14948///
14949/// To configure `RegionUrlMaps` use the `with_*` methods in the type returned
14950/// by [builder()][RegionUrlMaps::builder]. The default configuration should
14951/// work for most applications. Common configuration changes include
14952///
14953/// * [with_endpoint()]: by default this client uses the global default endpoint
14954///   (`https://compute.googleapis.com`). Applications using regional
14955///   endpoints or running in restricted networks (e.g. a network configured
14956//    with [Private Google Access with VPC Service Controls]) may want to
14957///   override this default.
14958/// * [with_credentials()]: by default this client uses
14959///   [Application Default Credentials]. Applications using custom
14960///   authentication may need to override this default.
14961///
14962/// [with_endpoint()]: super::builder::region_url_maps::ClientBuilder::with_endpoint
14963/// [with_credentials()]: super::builder::region_url_maps::ClientBuilder::with_credentials
14964/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14965/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14966///
14967/// # Pooling and Cloning
14968///
14969/// `RegionUrlMaps` holds a connection pool internally, it is advised to
14970/// create one and reuse it. You do not need to wrap `RegionUrlMaps` in
14971/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14972/// already uses an `Arc` internally.
14973#[cfg(feature = "region-url-maps")]
14974#[cfg_attr(docsrs, doc(cfg(feature = "region-url-maps")))]
14975#[derive(Clone, Debug)]
14976pub struct RegionUrlMaps {
14977    inner: std::sync::Arc<dyn super::stub::dynamic::RegionUrlMaps>,
14978}
14979
14980#[cfg(feature = "region-url-maps")]
14981impl RegionUrlMaps {
14982    /// Returns a builder for [RegionUrlMaps].
14983    ///
14984    /// ```
14985    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14986    /// # use google_cloud_compute_v1::client::RegionUrlMaps;
14987    /// let client = RegionUrlMaps::builder().build().await?;
14988    /// # Ok(()) }
14989    /// ```
14990    pub fn builder() -> super::builder::region_url_maps::ClientBuilder {
14991        crate::new_client_builder(super::builder::region_url_maps::client::Factory)
14992    }
14993
14994    /// Creates a new client from the provided stub.
14995    ///
14996    /// The most common case for calling this function is in tests mocking the
14997    /// client's behavior.
14998    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
14999    where
15000        T: super::stub::RegionUrlMaps + 'static,
15001    {
15002        Self { inner: stub.into() }
15003    }
15004
15005    pub(crate) async fn new(
15006        config: gaxi::options::ClientConfig,
15007    ) -> crate::ClientBuilderResult<Self> {
15008        let inner = Self::build_inner(config).await?;
15009        Ok(Self { inner })
15010    }
15011
15012    async fn build_inner(
15013        conf: gaxi::options::ClientConfig,
15014    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionUrlMaps>> {
15015        if gaxi::options::tracing_enabled(&conf) {
15016            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15017        }
15018        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15019    }
15020
15021    async fn build_transport(
15022        conf: gaxi::options::ClientConfig,
15023    ) -> crate::ClientBuilderResult<impl super::stub::RegionUrlMaps> {
15024        super::transport::RegionUrlMaps::new(conf).await
15025    }
15026
15027    async fn build_with_tracing(
15028        conf: gaxi::options::ClientConfig,
15029    ) -> crate::ClientBuilderResult<impl super::stub::RegionUrlMaps> {
15030        Self::build_transport(conf)
15031            .await
15032            .map(super::tracing::RegionUrlMaps::new)
15033    }
15034
15035    /// Deletes the specified UrlMap resource.
15036    pub fn delete(&self) -> super::builder::region_url_maps::Delete {
15037        super::builder::region_url_maps::Delete::new(self.inner.clone())
15038    }
15039
15040    /// Returns the specified UrlMap resource.
15041    pub fn get(&self) -> super::builder::region_url_maps::Get {
15042        super::builder::region_url_maps::Get::new(self.inner.clone())
15043    }
15044
15045    /// Creates a UrlMap resource in the specified project using
15046    /// the data included in the request.
15047    pub fn insert(&self) -> super::builder::region_url_maps::Insert {
15048        super::builder::region_url_maps::Insert::new(self.inner.clone())
15049    }
15050
15051    /// Retrieves the list of UrlMap resources available to the specified
15052    /// project in the specified region.
15053    pub fn list(&self) -> super::builder::region_url_maps::List {
15054        super::builder::region_url_maps::List::new(self.inner.clone())
15055    }
15056
15057    /// Patches the specified UrlMap resource with the data included in the
15058    /// request. This method supportsPATCH
15059    /// semantics and usesJSON merge
15060    /// patch format and processing rules.
15061    pub fn patch(&self) -> super::builder::region_url_maps::Patch {
15062        super::builder::region_url_maps::Patch::new(self.inner.clone())
15063    }
15064
15065    /// Updates the specified UrlMap resource with the data included in the
15066    /// request.
15067    pub fn update(&self) -> super::builder::region_url_maps::Update {
15068        super::builder::region_url_maps::Update::new(self.inner.clone())
15069    }
15070
15071    /// Runs static validation for the UrlMap. In particular, the tests of the
15072    /// provided UrlMap will be run. Calling this method does NOT create the
15073    /// UrlMap.
15074    pub fn validate(&self) -> super::builder::region_url_maps::Validate {
15075        super::builder::region_url_maps::Validate::new(self.inner.clone())
15076    }
15077
15078    /// Retrieves the specified region-specific Operations resource.
15079    pub fn get_operation(&self) -> super::builder::region_url_maps::GetOperation {
15080        super::builder::region_url_maps::GetOperation::new(self.inner.clone())
15081    }
15082}
15083
15084/// Implements a client for the Google Compute Engine API.
15085///
15086/// # Example
15087/// ```
15088/// # use google_cloud_compute_v1::client::RegionZones;
15089/// async fn sample(
15090/// ) -> anyhow::Result<()> {
15091///     let client = RegionZones::builder().build().await?;
15092///     // use `client` to make requests to the Google Compute Engine API.
15093///     Ok(())
15094/// }
15095/// ```
15096///
15097/// # Service Description
15098///
15099/// Service for the `regionZones` resource.
15100///
15101/// # Configuration
15102///
15103/// To configure `RegionZones` use the `with_*` methods in the type returned
15104/// by [builder()][RegionZones::builder]. The default configuration should
15105/// work for most applications. Common configuration changes include
15106///
15107/// * [with_endpoint()]: by default this client uses the global default endpoint
15108///   (`https://compute.googleapis.com`). Applications using regional
15109///   endpoints or running in restricted networks (e.g. a network configured
15110//    with [Private Google Access with VPC Service Controls]) may want to
15111///   override this default.
15112/// * [with_credentials()]: by default this client uses
15113///   [Application Default Credentials]. Applications using custom
15114///   authentication may need to override this default.
15115///
15116/// [with_endpoint()]: super::builder::region_zones::ClientBuilder::with_endpoint
15117/// [with_credentials()]: super::builder::region_zones::ClientBuilder::with_credentials
15118/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15119/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15120///
15121/// # Pooling and Cloning
15122///
15123/// `RegionZones` holds a connection pool internally, it is advised to
15124/// create one and reuse it. You do not need to wrap `RegionZones` in
15125/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15126/// already uses an `Arc` internally.
15127#[cfg(feature = "region-zones")]
15128#[cfg_attr(docsrs, doc(cfg(feature = "region-zones")))]
15129#[derive(Clone, Debug)]
15130pub struct RegionZones {
15131    inner: std::sync::Arc<dyn super::stub::dynamic::RegionZones>,
15132}
15133
15134#[cfg(feature = "region-zones")]
15135impl RegionZones {
15136    /// Returns a builder for [RegionZones].
15137    ///
15138    /// ```
15139    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15140    /// # use google_cloud_compute_v1::client::RegionZones;
15141    /// let client = RegionZones::builder().build().await?;
15142    /// # Ok(()) }
15143    /// ```
15144    pub fn builder() -> super::builder::region_zones::ClientBuilder {
15145        crate::new_client_builder(super::builder::region_zones::client::Factory)
15146    }
15147
15148    /// Creates a new client from the provided stub.
15149    ///
15150    /// The most common case for calling this function is in tests mocking the
15151    /// client's behavior.
15152    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
15153    where
15154        T: super::stub::RegionZones + 'static,
15155    {
15156        Self { inner: stub.into() }
15157    }
15158
15159    pub(crate) async fn new(
15160        config: gaxi::options::ClientConfig,
15161    ) -> crate::ClientBuilderResult<Self> {
15162        let inner = Self::build_inner(config).await?;
15163        Ok(Self { inner })
15164    }
15165
15166    async fn build_inner(
15167        conf: gaxi::options::ClientConfig,
15168    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionZones>> {
15169        if gaxi::options::tracing_enabled(&conf) {
15170            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15171        }
15172        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15173    }
15174
15175    async fn build_transport(
15176        conf: gaxi::options::ClientConfig,
15177    ) -> crate::ClientBuilderResult<impl super::stub::RegionZones> {
15178        super::transport::RegionZones::new(conf).await
15179    }
15180
15181    async fn build_with_tracing(
15182        conf: gaxi::options::ClientConfig,
15183    ) -> crate::ClientBuilderResult<impl super::stub::RegionZones> {
15184        Self::build_transport(conf)
15185            .await
15186            .map(super::tracing::RegionZones::new)
15187    }
15188
15189    /// Retrieves the list of Zone resources under the specific region available to
15190    /// the specified project.
15191    pub fn list(&self) -> super::builder::region_zones::List {
15192        super::builder::region_zones::List::new(self.inner.clone())
15193    }
15194}
15195
15196/// Implements a client for the Google Compute Engine API.
15197///
15198/// # Example
15199/// ```
15200/// # use google_cloud_compute_v1::client::Regions;
15201/// async fn sample(
15202/// ) -> anyhow::Result<()> {
15203///     let client = Regions::builder().build().await?;
15204///     // use `client` to make requests to the Google Compute Engine API.
15205///     Ok(())
15206/// }
15207/// ```
15208///
15209/// # Service Description
15210///
15211/// Service for the `regions` resource.
15212///
15213/// # Configuration
15214///
15215/// To configure `Regions` use the `with_*` methods in the type returned
15216/// by [builder()][Regions::builder]. The default configuration should
15217/// work for most applications. Common configuration changes include
15218///
15219/// * [with_endpoint()]: by default this client uses the global default endpoint
15220///   (`https://compute.googleapis.com`). Applications using regional
15221///   endpoints or running in restricted networks (e.g. a network configured
15222//    with [Private Google Access with VPC Service Controls]) may want to
15223///   override this default.
15224/// * [with_credentials()]: by default this client uses
15225///   [Application Default Credentials]. Applications using custom
15226///   authentication may need to override this default.
15227///
15228/// [with_endpoint()]: super::builder::regions::ClientBuilder::with_endpoint
15229/// [with_credentials()]: super::builder::regions::ClientBuilder::with_credentials
15230/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15231/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15232///
15233/// # Pooling and Cloning
15234///
15235/// `Regions` holds a connection pool internally, it is advised to
15236/// create one and reuse it. You do not need to wrap `Regions` in
15237/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15238/// already uses an `Arc` internally.
15239#[cfg(feature = "regions")]
15240#[cfg_attr(docsrs, doc(cfg(feature = "regions")))]
15241#[derive(Clone, Debug)]
15242pub struct Regions {
15243    inner: std::sync::Arc<dyn super::stub::dynamic::Regions>,
15244}
15245
15246#[cfg(feature = "regions")]
15247impl Regions {
15248    /// Returns a builder for [Regions].
15249    ///
15250    /// ```
15251    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15252    /// # use google_cloud_compute_v1::client::Regions;
15253    /// let client = Regions::builder().build().await?;
15254    /// # Ok(()) }
15255    /// ```
15256    pub fn builder() -> super::builder::regions::ClientBuilder {
15257        crate::new_client_builder(super::builder::regions::client::Factory)
15258    }
15259
15260    /// Creates a new client from the provided stub.
15261    ///
15262    /// The most common case for calling this function is in tests mocking the
15263    /// client's behavior.
15264    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
15265    where
15266        T: super::stub::Regions + 'static,
15267    {
15268        Self { inner: stub.into() }
15269    }
15270
15271    pub(crate) async fn new(
15272        config: gaxi::options::ClientConfig,
15273    ) -> crate::ClientBuilderResult<Self> {
15274        let inner = Self::build_inner(config).await?;
15275        Ok(Self { inner })
15276    }
15277
15278    async fn build_inner(
15279        conf: gaxi::options::ClientConfig,
15280    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Regions>> {
15281        if gaxi::options::tracing_enabled(&conf) {
15282            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15283        }
15284        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15285    }
15286
15287    async fn build_transport(
15288        conf: gaxi::options::ClientConfig,
15289    ) -> crate::ClientBuilderResult<impl super::stub::Regions> {
15290        super::transport::Regions::new(conf).await
15291    }
15292
15293    async fn build_with_tracing(
15294        conf: gaxi::options::ClientConfig,
15295    ) -> crate::ClientBuilderResult<impl super::stub::Regions> {
15296        Self::build_transport(conf)
15297            .await
15298            .map(super::tracing::Regions::new)
15299    }
15300
15301    /// Returns the specified Region resource.
15302    ///
15303    /// To decrease latency for this method, you can optionally omit any unneeded
15304    /// information from the response by using a field mask. This practice is
15305    /// especially recommended for unused quota information (the `quotas` field).
15306    /// To exclude one or more fields, set your request's `fields` query parameter
15307    /// to only include the fields you need. For example, to only include the `id`
15308    /// and `selfLink` fields, add the query parameter `?fields=id,selfLink` to
15309    /// your request.
15310    ///
15311    /// This method fails if the quota information is unavailable for the region
15312    /// and if the organization policy constraint
15313    /// compute.requireBasicQuotaInResponse is enforced. This
15314    /// constraint, when enforced, disables the fail-open behaviour when quota
15315    /// information (the `items.quotas` field) is unavailable for the region.
15316    /// It is recommended to use the default setting
15317    /// for the constraint unless your application requires the fail-closed
15318    /// behaviour for this method.
15319    pub fn get(&self) -> super::builder::regions::Get {
15320        super::builder::regions::Get::new(self.inner.clone())
15321    }
15322
15323    /// Retrieves the list of region resources available to the specified project.
15324    ///
15325    /// To decrease latency for this method, you can optionally omit any unneeded
15326    /// information from the response by using a field mask. This practice is
15327    /// especially recommended for unused quota information
15328    /// (the `items.quotas` field).
15329    /// To exclude one or more fields, set your request's `fields` query parameter
15330    /// to only include the fields you need. For example, to only include the `id`
15331    /// and `selfLink` fields, add the query parameter `?fields=id,selfLink` to
15332    /// your request.
15333    ///
15334    /// This method fails if the quota information is unavailable for the region
15335    /// and if the organization policy constraint
15336    /// compute.requireBasicQuotaInResponse is enforced. This
15337    /// constraint, when enforced, disables the fail-open behaviour when quota
15338    /// information (the `items.quotas` field) is unavailable for the region.
15339    /// It is recommended to use the default setting
15340    /// for the constraint unless your application requires the fail-closed
15341    /// behaviour for this method.
15342    pub fn list(&self) -> super::builder::regions::List {
15343        super::builder::regions::List::new(self.inner.clone())
15344    }
15345}
15346
15347/// Implements a client for the Google Compute Engine API.
15348///
15349/// # Example
15350/// ```
15351/// # use google_cloud_compute_v1::client::ReservationBlocks;
15352/// async fn sample(
15353/// ) -> anyhow::Result<()> {
15354///     let client = ReservationBlocks::builder().build().await?;
15355///     // use `client` to make requests to the Google Compute Engine API.
15356///     Ok(())
15357/// }
15358/// ```
15359///
15360/// # Service Description
15361///
15362/// Service for the `reservationBlocks` resource.
15363///
15364/// # Configuration
15365///
15366/// To configure `ReservationBlocks` use the `with_*` methods in the type returned
15367/// by [builder()][ReservationBlocks::builder]. The default configuration should
15368/// work for most applications. Common configuration changes include
15369///
15370/// * [with_endpoint()]: by default this client uses the global default endpoint
15371///   (`https://compute.googleapis.com`). Applications using regional
15372///   endpoints or running in restricted networks (e.g. a network configured
15373//    with [Private Google Access with VPC Service Controls]) may want to
15374///   override this default.
15375/// * [with_credentials()]: by default this client uses
15376///   [Application Default Credentials]. Applications using custom
15377///   authentication may need to override this default.
15378///
15379/// [with_endpoint()]: super::builder::reservation_blocks::ClientBuilder::with_endpoint
15380/// [with_credentials()]: super::builder::reservation_blocks::ClientBuilder::with_credentials
15381/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15382/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15383///
15384/// # Pooling and Cloning
15385///
15386/// `ReservationBlocks` holds a connection pool internally, it is advised to
15387/// create one and reuse it. You do not need to wrap `ReservationBlocks` in
15388/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15389/// already uses an `Arc` internally.
15390#[cfg(feature = "reservation-blocks")]
15391#[cfg_attr(docsrs, doc(cfg(feature = "reservation-blocks")))]
15392#[derive(Clone, Debug)]
15393pub struct ReservationBlocks {
15394    inner: std::sync::Arc<dyn super::stub::dynamic::ReservationBlocks>,
15395}
15396
15397#[cfg(feature = "reservation-blocks")]
15398impl ReservationBlocks {
15399    /// Returns a builder for [ReservationBlocks].
15400    ///
15401    /// ```
15402    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15403    /// # use google_cloud_compute_v1::client::ReservationBlocks;
15404    /// let client = ReservationBlocks::builder().build().await?;
15405    /// # Ok(()) }
15406    /// ```
15407    pub fn builder() -> super::builder::reservation_blocks::ClientBuilder {
15408        crate::new_client_builder(super::builder::reservation_blocks::client::Factory)
15409    }
15410
15411    /// Creates a new client from the provided stub.
15412    ///
15413    /// The most common case for calling this function is in tests mocking the
15414    /// client's behavior.
15415    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
15416    where
15417        T: super::stub::ReservationBlocks + 'static,
15418    {
15419        Self { inner: stub.into() }
15420    }
15421
15422    pub(crate) async fn new(
15423        config: gaxi::options::ClientConfig,
15424    ) -> crate::ClientBuilderResult<Self> {
15425        let inner = Self::build_inner(config).await?;
15426        Ok(Self { inner })
15427    }
15428
15429    async fn build_inner(
15430        conf: gaxi::options::ClientConfig,
15431    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ReservationBlocks>>
15432    {
15433        if gaxi::options::tracing_enabled(&conf) {
15434            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15435        }
15436        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15437    }
15438
15439    async fn build_transport(
15440        conf: gaxi::options::ClientConfig,
15441    ) -> crate::ClientBuilderResult<impl super::stub::ReservationBlocks> {
15442        super::transport::ReservationBlocks::new(conf).await
15443    }
15444
15445    async fn build_with_tracing(
15446        conf: gaxi::options::ClientConfig,
15447    ) -> crate::ClientBuilderResult<impl super::stub::ReservationBlocks> {
15448        Self::build_transport(conf)
15449            .await
15450            .map(super::tracing::ReservationBlocks::new)
15451    }
15452
15453    /// Retrieves information about the specified reservation block.
15454    pub fn get(&self) -> super::builder::reservation_blocks::Get {
15455        super::builder::reservation_blocks::Get::new(self.inner.clone())
15456    }
15457
15458    /// Gets the access control policy for a resource. May be empty if no such
15459    /// policy or resource exists.
15460    pub fn get_iam_policy(&self) -> super::builder::reservation_blocks::GetIamPolicy {
15461        super::builder::reservation_blocks::GetIamPolicy::new(self.inner.clone())
15462    }
15463
15464    /// Retrieves a list of reservation blocks under a single reservation.
15465    pub fn list(&self) -> super::builder::reservation_blocks::List {
15466        super::builder::reservation_blocks::List::new(self.inner.clone())
15467    }
15468
15469    /// Allows customers to perform maintenance on a reservation block
15470    pub fn perform_maintenance(&self) -> super::builder::reservation_blocks::PerformMaintenance {
15471        super::builder::reservation_blocks::PerformMaintenance::new(self.inner.clone())
15472    }
15473
15474    /// Sets the access control policy on the specified resource.
15475    /// Replaces any existing policy.
15476    pub fn set_iam_policy(&self) -> super::builder::reservation_blocks::SetIamPolicy {
15477        super::builder::reservation_blocks::SetIamPolicy::new(self.inner.clone())
15478    }
15479
15480    /// Returns permissions that a caller has on the specified resource.
15481    pub fn test_iam_permissions(&self) -> super::builder::reservation_blocks::TestIamPermissions {
15482        super::builder::reservation_blocks::TestIamPermissions::new(self.inner.clone())
15483    }
15484
15485    /// Retrieves the specified zone-specific Operations resource.
15486    pub fn get_operation(&self) -> super::builder::reservation_blocks::GetOperation {
15487        super::builder::reservation_blocks::GetOperation::new(self.inner.clone())
15488    }
15489}
15490
15491/// Implements a client for the Google Compute Engine API.
15492///
15493/// # Example
15494/// ```
15495/// # use google_cloud_compute_v1::client::ReservationSlots;
15496/// async fn sample(
15497/// ) -> anyhow::Result<()> {
15498///     let client = ReservationSlots::builder().build().await?;
15499///     // use `client` to make requests to the Google Compute Engine API.
15500///     Ok(())
15501/// }
15502/// ```
15503///
15504/// # Service Description
15505///
15506/// Service for the `reservationSlots` resource.
15507///
15508/// # Configuration
15509///
15510/// To configure `ReservationSlots` use the `with_*` methods in the type returned
15511/// by [builder()][ReservationSlots::builder]. The default configuration should
15512/// work for most applications. Common configuration changes include
15513///
15514/// * [with_endpoint()]: by default this client uses the global default endpoint
15515///   (`https://compute.googleapis.com`). Applications using regional
15516///   endpoints or running in restricted networks (e.g. a network configured
15517//    with [Private Google Access with VPC Service Controls]) may want to
15518///   override this default.
15519/// * [with_credentials()]: by default this client uses
15520///   [Application Default Credentials]. Applications using custom
15521///   authentication may need to override this default.
15522///
15523/// [with_endpoint()]: super::builder::reservation_slots::ClientBuilder::with_endpoint
15524/// [with_credentials()]: super::builder::reservation_slots::ClientBuilder::with_credentials
15525/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15526/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15527///
15528/// # Pooling and Cloning
15529///
15530/// `ReservationSlots` holds a connection pool internally, it is advised to
15531/// create one and reuse it. You do not need to wrap `ReservationSlots` in
15532/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15533/// already uses an `Arc` internally.
15534#[cfg(feature = "reservation-slots")]
15535#[cfg_attr(docsrs, doc(cfg(feature = "reservation-slots")))]
15536#[derive(Clone, Debug)]
15537pub struct ReservationSlots {
15538    inner: std::sync::Arc<dyn super::stub::dynamic::ReservationSlots>,
15539}
15540
15541#[cfg(feature = "reservation-slots")]
15542impl ReservationSlots {
15543    /// Returns a builder for [ReservationSlots].
15544    ///
15545    /// ```
15546    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15547    /// # use google_cloud_compute_v1::client::ReservationSlots;
15548    /// let client = ReservationSlots::builder().build().await?;
15549    /// # Ok(()) }
15550    /// ```
15551    pub fn builder() -> super::builder::reservation_slots::ClientBuilder {
15552        crate::new_client_builder(super::builder::reservation_slots::client::Factory)
15553    }
15554
15555    /// Creates a new client from the provided stub.
15556    ///
15557    /// The most common case for calling this function is in tests mocking the
15558    /// client's behavior.
15559    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
15560    where
15561        T: super::stub::ReservationSlots + 'static,
15562    {
15563        Self { inner: stub.into() }
15564    }
15565
15566    pub(crate) async fn new(
15567        config: gaxi::options::ClientConfig,
15568    ) -> crate::ClientBuilderResult<Self> {
15569        let inner = Self::build_inner(config).await?;
15570        Ok(Self { inner })
15571    }
15572
15573    async fn build_inner(
15574        conf: gaxi::options::ClientConfig,
15575    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ReservationSlots>>
15576    {
15577        if gaxi::options::tracing_enabled(&conf) {
15578            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15579        }
15580        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15581    }
15582
15583    async fn build_transport(
15584        conf: gaxi::options::ClientConfig,
15585    ) -> crate::ClientBuilderResult<impl super::stub::ReservationSlots> {
15586        super::transport::ReservationSlots::new(conf).await
15587    }
15588
15589    async fn build_with_tracing(
15590        conf: gaxi::options::ClientConfig,
15591    ) -> crate::ClientBuilderResult<impl super::stub::ReservationSlots> {
15592        Self::build_transport(conf)
15593            .await
15594            .map(super::tracing::ReservationSlots::new)
15595    }
15596
15597    /// Retrieves information about the specified reservation slot.
15598    pub fn get(&self) -> super::builder::reservation_slots::Get {
15599        super::builder::reservation_slots::Get::new(self.inner.clone())
15600    }
15601
15602    /// Allows customers to get SBOM versions of a reservation slot.
15603    pub fn get_version(&self) -> super::builder::reservation_slots::GetVersion {
15604        super::builder::reservation_slots::GetVersion::new(self.inner.clone())
15605    }
15606
15607    /// Retrieves a list of reservation slots under a single reservation.
15608    pub fn list(&self) -> super::builder::reservation_slots::List {
15609        super::builder::reservation_slots::List::new(self.inner.clone())
15610    }
15611
15612    /// Update a reservation slot in the specified sub-block.
15613    pub fn update(&self) -> super::builder::reservation_slots::Update {
15614        super::builder::reservation_slots::Update::new(self.inner.clone())
15615    }
15616
15617    /// Retrieves the specified zone-specific Operations resource.
15618    pub fn get_operation(&self) -> super::builder::reservation_slots::GetOperation {
15619        super::builder::reservation_slots::GetOperation::new(self.inner.clone())
15620    }
15621}
15622
15623/// Implements a client for the Google Compute Engine API.
15624///
15625/// # Example
15626/// ```
15627/// # use google_cloud_compute_v1::client::ReservationSubBlocks;
15628/// async fn sample(
15629/// ) -> anyhow::Result<()> {
15630///     let client = ReservationSubBlocks::builder().build().await?;
15631///     // use `client` to make requests to the Google Compute Engine API.
15632///     Ok(())
15633/// }
15634/// ```
15635///
15636/// # Service Description
15637///
15638/// Service for the `reservationSubBlocks` resource.
15639///
15640/// # Configuration
15641///
15642/// To configure `ReservationSubBlocks` use the `with_*` methods in the type returned
15643/// by [builder()][ReservationSubBlocks::builder]. The default configuration should
15644/// work for most applications. Common configuration changes include
15645///
15646/// * [with_endpoint()]: by default this client uses the global default endpoint
15647///   (`https://compute.googleapis.com`). Applications using regional
15648///   endpoints or running in restricted networks (e.g. a network configured
15649//    with [Private Google Access with VPC Service Controls]) may want to
15650///   override this default.
15651/// * [with_credentials()]: by default this client uses
15652///   [Application Default Credentials]. Applications using custom
15653///   authentication may need to override this default.
15654///
15655/// [with_endpoint()]: super::builder::reservation_sub_blocks::ClientBuilder::with_endpoint
15656/// [with_credentials()]: super::builder::reservation_sub_blocks::ClientBuilder::with_credentials
15657/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15658/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15659///
15660/// # Pooling and Cloning
15661///
15662/// `ReservationSubBlocks` holds a connection pool internally, it is advised to
15663/// create one and reuse it. You do not need to wrap `ReservationSubBlocks` in
15664/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15665/// already uses an `Arc` internally.
15666#[cfg(feature = "reservation-sub-blocks")]
15667#[cfg_attr(docsrs, doc(cfg(feature = "reservation-sub-blocks")))]
15668#[derive(Clone, Debug)]
15669pub struct ReservationSubBlocks {
15670    inner: std::sync::Arc<dyn super::stub::dynamic::ReservationSubBlocks>,
15671}
15672
15673#[cfg(feature = "reservation-sub-blocks")]
15674impl ReservationSubBlocks {
15675    /// Returns a builder for [ReservationSubBlocks].
15676    ///
15677    /// ```
15678    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15679    /// # use google_cloud_compute_v1::client::ReservationSubBlocks;
15680    /// let client = ReservationSubBlocks::builder().build().await?;
15681    /// # Ok(()) }
15682    /// ```
15683    pub fn builder() -> super::builder::reservation_sub_blocks::ClientBuilder {
15684        crate::new_client_builder(super::builder::reservation_sub_blocks::client::Factory)
15685    }
15686
15687    /// Creates a new client from the provided stub.
15688    ///
15689    /// The most common case for calling this function is in tests mocking the
15690    /// client's behavior.
15691    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
15692    where
15693        T: super::stub::ReservationSubBlocks + 'static,
15694    {
15695        Self { inner: stub.into() }
15696    }
15697
15698    pub(crate) async fn new(
15699        config: gaxi::options::ClientConfig,
15700    ) -> crate::ClientBuilderResult<Self> {
15701        let inner = Self::build_inner(config).await?;
15702        Ok(Self { inner })
15703    }
15704
15705    async fn build_inner(
15706        conf: gaxi::options::ClientConfig,
15707    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ReservationSubBlocks>>
15708    {
15709        if gaxi::options::tracing_enabled(&conf) {
15710            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15711        }
15712        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15713    }
15714
15715    async fn build_transport(
15716        conf: gaxi::options::ClientConfig,
15717    ) -> crate::ClientBuilderResult<impl super::stub::ReservationSubBlocks> {
15718        super::transport::ReservationSubBlocks::new(conf).await
15719    }
15720
15721    async fn build_with_tracing(
15722        conf: gaxi::options::ClientConfig,
15723    ) -> crate::ClientBuilderResult<impl super::stub::ReservationSubBlocks> {
15724        Self::build_transport(conf)
15725            .await
15726            .map(super::tracing::ReservationSubBlocks::new)
15727    }
15728
15729    /// Retrieves information about the specified reservation subBlock.
15730    pub fn get(&self) -> super::builder::reservation_sub_blocks::Get {
15731        super::builder::reservation_sub_blocks::Get::new(self.inner.clone())
15732    }
15733
15734    /// Gets the access control policy for a resource. May be empty if no such
15735    /// policy or resource exists.
15736    pub fn get_iam_policy(&self) -> super::builder::reservation_sub_blocks::GetIamPolicy {
15737        super::builder::reservation_sub_blocks::GetIamPolicy::new(self.inner.clone())
15738    }
15739
15740    /// Allows customers to get SBOM versions of a reservation subBlock.
15741    pub fn get_version(&self) -> super::builder::reservation_sub_blocks::GetVersion {
15742        super::builder::reservation_sub_blocks::GetVersion::new(self.inner.clone())
15743    }
15744
15745    /// Retrieves a list of reservation subBlocks under a single reservation.
15746    pub fn list(&self) -> super::builder::reservation_sub_blocks::List {
15747        super::builder::reservation_sub_blocks::List::new(self.inner.clone())
15748    }
15749
15750    /// Allows customers to perform maintenance on a reservation subBlock
15751    pub fn perform_maintenance(
15752        &self,
15753    ) -> super::builder::reservation_sub_blocks::PerformMaintenance {
15754        super::builder::reservation_sub_blocks::PerformMaintenance::new(self.inner.clone())
15755    }
15756
15757    /// Allows customers to report a faulty subBlock.
15758    pub fn report_faulty(&self) -> super::builder::reservation_sub_blocks::ReportFaulty {
15759        super::builder::reservation_sub_blocks::ReportFaulty::new(self.inner.clone())
15760    }
15761
15762    /// Sets the access control policy on the specified resource.
15763    /// Replaces any existing policy.
15764    pub fn set_iam_policy(&self) -> super::builder::reservation_sub_blocks::SetIamPolicy {
15765        super::builder::reservation_sub_blocks::SetIamPolicy::new(self.inner.clone())
15766    }
15767
15768    /// Returns permissions that a caller has on the specified resource.
15769    pub fn test_iam_permissions(
15770        &self,
15771    ) -> super::builder::reservation_sub_blocks::TestIamPermissions {
15772        super::builder::reservation_sub_blocks::TestIamPermissions::new(self.inner.clone())
15773    }
15774
15775    /// Retrieves the specified zone-specific Operations resource.
15776    pub fn get_operation(&self) -> super::builder::reservation_sub_blocks::GetOperation {
15777        super::builder::reservation_sub_blocks::GetOperation::new(self.inner.clone())
15778    }
15779}
15780
15781/// Implements a client for the Google Compute Engine API.
15782///
15783/// # Example
15784/// ```
15785/// # use google_cloud_compute_v1::client::Reservations;
15786/// async fn sample(
15787/// ) -> anyhow::Result<()> {
15788///     let client = Reservations::builder().build().await?;
15789///     // use `client` to make requests to the Google Compute Engine API.
15790///     Ok(())
15791/// }
15792/// ```
15793///
15794/// # Service Description
15795///
15796/// Service for the `reservations` resource.
15797///
15798/// # Configuration
15799///
15800/// To configure `Reservations` use the `with_*` methods in the type returned
15801/// by [builder()][Reservations::builder]. The default configuration should
15802/// work for most applications. Common configuration changes include
15803///
15804/// * [with_endpoint()]: by default this client uses the global default endpoint
15805///   (`https://compute.googleapis.com`). Applications using regional
15806///   endpoints or running in restricted networks (e.g. a network configured
15807//    with [Private Google Access with VPC Service Controls]) may want to
15808///   override this default.
15809/// * [with_credentials()]: by default this client uses
15810///   [Application Default Credentials]. Applications using custom
15811///   authentication may need to override this default.
15812///
15813/// [with_endpoint()]: super::builder::reservations::ClientBuilder::with_endpoint
15814/// [with_credentials()]: super::builder::reservations::ClientBuilder::with_credentials
15815/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15816/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15817///
15818/// # Pooling and Cloning
15819///
15820/// `Reservations` holds a connection pool internally, it is advised to
15821/// create one and reuse it. You do not need to wrap `Reservations` in
15822/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15823/// already uses an `Arc` internally.
15824#[cfg(feature = "reservations")]
15825#[cfg_attr(docsrs, doc(cfg(feature = "reservations")))]
15826#[derive(Clone, Debug)]
15827pub struct Reservations {
15828    inner: std::sync::Arc<dyn super::stub::dynamic::Reservations>,
15829}
15830
15831#[cfg(feature = "reservations")]
15832impl Reservations {
15833    /// Returns a builder for [Reservations].
15834    ///
15835    /// ```
15836    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15837    /// # use google_cloud_compute_v1::client::Reservations;
15838    /// let client = Reservations::builder().build().await?;
15839    /// # Ok(()) }
15840    /// ```
15841    pub fn builder() -> super::builder::reservations::ClientBuilder {
15842        crate::new_client_builder(super::builder::reservations::client::Factory)
15843    }
15844
15845    /// Creates a new client from the provided stub.
15846    ///
15847    /// The most common case for calling this function is in tests mocking the
15848    /// client's behavior.
15849    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
15850    where
15851        T: super::stub::Reservations + 'static,
15852    {
15853        Self { inner: stub.into() }
15854    }
15855
15856    pub(crate) async fn new(
15857        config: gaxi::options::ClientConfig,
15858    ) -> crate::ClientBuilderResult<Self> {
15859        let inner = Self::build_inner(config).await?;
15860        Ok(Self { inner })
15861    }
15862
15863    async fn build_inner(
15864        conf: gaxi::options::ClientConfig,
15865    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Reservations>> {
15866        if gaxi::options::tracing_enabled(&conf) {
15867            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15868        }
15869        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15870    }
15871
15872    async fn build_transport(
15873        conf: gaxi::options::ClientConfig,
15874    ) -> crate::ClientBuilderResult<impl super::stub::Reservations> {
15875        super::transport::Reservations::new(conf).await
15876    }
15877
15878    async fn build_with_tracing(
15879        conf: gaxi::options::ClientConfig,
15880    ) -> crate::ClientBuilderResult<impl super::stub::Reservations> {
15881        Self::build_transport(conf)
15882            .await
15883            .map(super::tracing::Reservations::new)
15884    }
15885
15886    /// Retrieves an aggregated list of reservations.
15887    ///
15888    /// To prevent failure, it is recommended that you set the
15889    /// `returnPartialSuccess` parameter to `true`.
15890    pub fn aggregated_list(&self) -> super::builder::reservations::AggregatedList {
15891        super::builder::reservations::AggregatedList::new(self.inner.clone())
15892    }
15893
15894    /// Deletes the specified reservation.
15895    pub fn delete(&self) -> super::builder::reservations::Delete {
15896        super::builder::reservations::Delete::new(self.inner.clone())
15897    }
15898
15899    /// Retrieves information about the specified reservation.
15900    pub fn get(&self) -> super::builder::reservations::Get {
15901        super::builder::reservations::Get::new(self.inner.clone())
15902    }
15903
15904    /// Gets the access control policy for a resource. May be empty if no such
15905    /// policy or resource exists.
15906    pub fn get_iam_policy(&self) -> super::builder::reservations::GetIamPolicy {
15907        super::builder::reservations::GetIamPolicy::new(self.inner.clone())
15908    }
15909
15910    /// Creates a new reservation. For more information, readReserving zonal
15911    /// resources.
15912    pub fn insert(&self) -> super::builder::reservations::Insert {
15913        super::builder::reservations::Insert::new(self.inner.clone())
15914    }
15915
15916    /// A list of all the reservations that have been configured for the
15917    /// specified project in specified zone.
15918    pub fn list(&self) -> super::builder::reservations::List {
15919        super::builder::reservations::List::new(self.inner.clone())
15920    }
15921
15922    /// Perform maintenance on an extended reservation
15923    pub fn perform_maintenance(&self) -> super::builder::reservations::PerformMaintenance {
15924        super::builder::reservations::PerformMaintenance::new(self.inner.clone())
15925    }
15926
15927    /// Resizes the reservation (applicable to standalone reservations only). For
15928    /// more information, readModifying
15929    /// reservations.
15930    pub fn resize(&self) -> super::builder::reservations::Resize {
15931        super::builder::reservations::Resize::new(self.inner.clone())
15932    }
15933
15934    /// Sets the access control policy on the specified resource.
15935    /// Replaces any existing policy.
15936    pub fn set_iam_policy(&self) -> super::builder::reservations::SetIamPolicy {
15937        super::builder::reservations::SetIamPolicy::new(self.inner.clone())
15938    }
15939
15940    /// Returns permissions that a caller has on the specified resource.
15941    pub fn test_iam_permissions(&self) -> super::builder::reservations::TestIamPermissions {
15942        super::builder::reservations::TestIamPermissions::new(self.inner.clone())
15943    }
15944
15945    /// Update share settings of the reservation.
15946    pub fn update(&self) -> super::builder::reservations::Update {
15947        super::builder::reservations::Update::new(self.inner.clone())
15948    }
15949
15950    /// Retrieves the specified zone-specific Operations resource.
15951    pub fn get_operation(&self) -> super::builder::reservations::GetOperation {
15952        super::builder::reservations::GetOperation::new(self.inner.clone())
15953    }
15954}
15955
15956/// Implements a client for the Google Compute Engine API.
15957///
15958/// # Example
15959/// ```
15960/// # use google_cloud_compute_v1::client::ResourcePolicies;
15961/// async fn sample(
15962/// ) -> anyhow::Result<()> {
15963///     let client = ResourcePolicies::builder().build().await?;
15964///     // use `client` to make requests to the Google Compute Engine API.
15965///     Ok(())
15966/// }
15967/// ```
15968///
15969/// # Service Description
15970///
15971/// Service for the `resourcePolicies` resource.
15972///
15973/// # Configuration
15974///
15975/// To configure `ResourcePolicies` use the `with_*` methods in the type returned
15976/// by [builder()][ResourcePolicies::builder]. The default configuration should
15977/// work for most applications. Common configuration changes include
15978///
15979/// * [with_endpoint()]: by default this client uses the global default endpoint
15980///   (`https://compute.googleapis.com`). Applications using regional
15981///   endpoints or running in restricted networks (e.g. a network configured
15982//    with [Private Google Access with VPC Service Controls]) may want to
15983///   override this default.
15984/// * [with_credentials()]: by default this client uses
15985///   [Application Default Credentials]. Applications using custom
15986///   authentication may need to override this default.
15987///
15988/// [with_endpoint()]: super::builder::resource_policies::ClientBuilder::with_endpoint
15989/// [with_credentials()]: super::builder::resource_policies::ClientBuilder::with_credentials
15990/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15991/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15992///
15993/// # Pooling and Cloning
15994///
15995/// `ResourcePolicies` holds a connection pool internally, it is advised to
15996/// create one and reuse it. You do not need to wrap `ResourcePolicies` in
15997/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15998/// already uses an `Arc` internally.
15999#[cfg(feature = "resource-policies")]
16000#[cfg_attr(docsrs, doc(cfg(feature = "resource-policies")))]
16001#[derive(Clone, Debug)]
16002pub struct ResourcePolicies {
16003    inner: std::sync::Arc<dyn super::stub::dynamic::ResourcePolicies>,
16004}
16005
16006#[cfg(feature = "resource-policies")]
16007impl ResourcePolicies {
16008    /// Returns a builder for [ResourcePolicies].
16009    ///
16010    /// ```
16011    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16012    /// # use google_cloud_compute_v1::client::ResourcePolicies;
16013    /// let client = ResourcePolicies::builder().build().await?;
16014    /// # Ok(()) }
16015    /// ```
16016    pub fn builder() -> super::builder::resource_policies::ClientBuilder {
16017        crate::new_client_builder(super::builder::resource_policies::client::Factory)
16018    }
16019
16020    /// Creates a new client from the provided stub.
16021    ///
16022    /// The most common case for calling this function is in tests mocking the
16023    /// client's behavior.
16024    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
16025    where
16026        T: super::stub::ResourcePolicies + 'static,
16027    {
16028        Self { inner: stub.into() }
16029    }
16030
16031    pub(crate) async fn new(
16032        config: gaxi::options::ClientConfig,
16033    ) -> crate::ClientBuilderResult<Self> {
16034        let inner = Self::build_inner(config).await?;
16035        Ok(Self { inner })
16036    }
16037
16038    async fn build_inner(
16039        conf: gaxi::options::ClientConfig,
16040    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ResourcePolicies>>
16041    {
16042        if gaxi::options::tracing_enabled(&conf) {
16043            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16044        }
16045        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16046    }
16047
16048    async fn build_transport(
16049        conf: gaxi::options::ClientConfig,
16050    ) -> crate::ClientBuilderResult<impl super::stub::ResourcePolicies> {
16051        super::transport::ResourcePolicies::new(conf).await
16052    }
16053
16054    async fn build_with_tracing(
16055        conf: gaxi::options::ClientConfig,
16056    ) -> crate::ClientBuilderResult<impl super::stub::ResourcePolicies> {
16057        Self::build_transport(conf)
16058            .await
16059            .map(super::tracing::ResourcePolicies::new)
16060    }
16061
16062    /// Retrieves an aggregated list of resource policies.
16063    ///
16064    /// To prevent failure, Google recommends that you set the
16065    /// `returnPartialSuccess` parameter to `true`.
16066    pub fn aggregated_list(&self) -> super::builder::resource_policies::AggregatedList {
16067        super::builder::resource_policies::AggregatedList::new(self.inner.clone())
16068    }
16069
16070    /// Deletes the specified resource policy.
16071    pub fn delete(&self) -> super::builder::resource_policies::Delete {
16072        super::builder::resource_policies::Delete::new(self.inner.clone())
16073    }
16074
16075    /// Retrieves all information of the specified resource policy.
16076    pub fn get(&self) -> super::builder::resource_policies::Get {
16077        super::builder::resource_policies::Get::new(self.inner.clone())
16078    }
16079
16080    /// Gets the access control policy for a resource. May be empty if no such
16081    /// policy or resource exists.
16082    pub fn get_iam_policy(&self) -> super::builder::resource_policies::GetIamPolicy {
16083        super::builder::resource_policies::GetIamPolicy::new(self.inner.clone())
16084    }
16085
16086    /// Creates a new resource policy.
16087    pub fn insert(&self) -> super::builder::resource_policies::Insert {
16088        super::builder::resource_policies::Insert::new(self.inner.clone())
16089    }
16090
16091    /// A list all the resource policies that have been configured for the
16092    /// specified project in specified region.
16093    pub fn list(&self) -> super::builder::resource_policies::List {
16094        super::builder::resource_policies::List::new(self.inner.clone())
16095    }
16096
16097    /// Modify the specified resource policy.
16098    pub fn patch(&self) -> super::builder::resource_policies::Patch {
16099        super::builder::resource_policies::Patch::new(self.inner.clone())
16100    }
16101
16102    /// Sets the access control policy on the specified resource.
16103    /// Replaces any existing policy.
16104    pub fn set_iam_policy(&self) -> super::builder::resource_policies::SetIamPolicy {
16105        super::builder::resource_policies::SetIamPolicy::new(self.inner.clone())
16106    }
16107
16108    /// Returns permissions that a caller has on the specified resource.
16109    pub fn test_iam_permissions(&self) -> super::builder::resource_policies::TestIamPermissions {
16110        super::builder::resource_policies::TestIamPermissions::new(self.inner.clone())
16111    }
16112
16113    /// Retrieves the specified region-specific Operations resource.
16114    pub fn get_operation(&self) -> super::builder::resource_policies::GetOperation {
16115        super::builder::resource_policies::GetOperation::new(self.inner.clone())
16116    }
16117}
16118
16119/// Implements a client for the Google Compute Engine API.
16120///
16121/// # Example
16122/// ```
16123/// # use google_cloud_compute_v1::client::Routers;
16124/// async fn sample(
16125/// ) -> anyhow::Result<()> {
16126///     let client = Routers::builder().build().await?;
16127///     // use `client` to make requests to the Google Compute Engine API.
16128///     Ok(())
16129/// }
16130/// ```
16131///
16132/// # Service Description
16133///
16134/// Service for the `routers` resource.
16135///
16136/// # Configuration
16137///
16138/// To configure `Routers` use the `with_*` methods in the type returned
16139/// by [builder()][Routers::builder]. The default configuration should
16140/// work for most applications. Common configuration changes include
16141///
16142/// * [with_endpoint()]: by default this client uses the global default endpoint
16143///   (`https://compute.googleapis.com`). Applications using regional
16144///   endpoints or running in restricted networks (e.g. a network configured
16145//    with [Private Google Access with VPC Service Controls]) may want to
16146///   override this default.
16147/// * [with_credentials()]: by default this client uses
16148///   [Application Default Credentials]. Applications using custom
16149///   authentication may need to override this default.
16150///
16151/// [with_endpoint()]: super::builder::routers::ClientBuilder::with_endpoint
16152/// [with_credentials()]: super::builder::routers::ClientBuilder::with_credentials
16153/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16154/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16155///
16156/// # Pooling and Cloning
16157///
16158/// `Routers` holds a connection pool internally, it is advised to
16159/// create one and reuse it. You do not need to wrap `Routers` in
16160/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16161/// already uses an `Arc` internally.
16162#[cfg(feature = "routers")]
16163#[cfg_attr(docsrs, doc(cfg(feature = "routers")))]
16164#[derive(Clone, Debug)]
16165pub struct Routers {
16166    inner: std::sync::Arc<dyn super::stub::dynamic::Routers>,
16167}
16168
16169#[cfg(feature = "routers")]
16170impl Routers {
16171    /// Returns a builder for [Routers].
16172    ///
16173    /// ```
16174    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16175    /// # use google_cloud_compute_v1::client::Routers;
16176    /// let client = Routers::builder().build().await?;
16177    /// # Ok(()) }
16178    /// ```
16179    pub fn builder() -> super::builder::routers::ClientBuilder {
16180        crate::new_client_builder(super::builder::routers::client::Factory)
16181    }
16182
16183    /// Creates a new client from the provided stub.
16184    ///
16185    /// The most common case for calling this function is in tests mocking the
16186    /// client's behavior.
16187    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
16188    where
16189        T: super::stub::Routers + 'static,
16190    {
16191        Self { inner: stub.into() }
16192    }
16193
16194    pub(crate) async fn new(
16195        config: gaxi::options::ClientConfig,
16196    ) -> crate::ClientBuilderResult<Self> {
16197        let inner = Self::build_inner(config).await?;
16198        Ok(Self { inner })
16199    }
16200
16201    async fn build_inner(
16202        conf: gaxi::options::ClientConfig,
16203    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Routers>> {
16204        if gaxi::options::tracing_enabled(&conf) {
16205            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16206        }
16207        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16208    }
16209
16210    async fn build_transport(
16211        conf: gaxi::options::ClientConfig,
16212    ) -> crate::ClientBuilderResult<impl super::stub::Routers> {
16213        super::transport::Routers::new(conf).await
16214    }
16215
16216    async fn build_with_tracing(
16217        conf: gaxi::options::ClientConfig,
16218    ) -> crate::ClientBuilderResult<impl super::stub::Routers> {
16219        Self::build_transport(conf)
16220            .await
16221            .map(super::tracing::Routers::new)
16222    }
16223
16224    /// Retrieves an aggregated list of routers.
16225    ///
16226    /// To prevent failure, Google recommends that you set the
16227    /// `returnPartialSuccess` parameter to `true`.
16228    pub fn aggregated_list(&self) -> super::builder::routers::AggregatedList {
16229        super::builder::routers::AggregatedList::new(self.inner.clone())
16230    }
16231
16232    /// Deletes the specified Router resource.
16233    pub fn delete(&self) -> super::builder::routers::Delete {
16234        super::builder::routers::Delete::new(self.inner.clone())
16235    }
16236
16237    /// Deletes Route Policy
16238    pub fn delete_route_policy(&self) -> super::builder::routers::DeleteRoutePolicy {
16239        super::builder::routers::DeleteRoutePolicy::new(self.inner.clone())
16240    }
16241
16242    /// Returns the specified Router resource.
16243    pub fn get(&self) -> super::builder::routers::Get {
16244        super::builder::routers::Get::new(self.inner.clone())
16245    }
16246
16247    /// Retrieves runtime NAT IP information.
16248    pub fn get_nat_ip_info(&self) -> super::builder::routers::GetNatIpInfo {
16249        super::builder::routers::GetNatIpInfo::new(self.inner.clone())
16250    }
16251
16252    /// Retrieves runtime Nat mapping information of VM endpoints.
16253    pub fn get_nat_mapping_info(&self) -> super::builder::routers::GetNatMappingInfo {
16254        super::builder::routers::GetNatMappingInfo::new(self.inner.clone())
16255    }
16256
16257    /// Returns specified Route Policy
16258    pub fn get_route_policy(&self) -> super::builder::routers::GetRoutePolicy {
16259        super::builder::routers::GetRoutePolicy::new(self.inner.clone())
16260    }
16261
16262    /// Retrieves runtime information of the specified router.
16263    pub fn get_router_status(&self) -> super::builder::routers::GetRouterStatus {
16264        super::builder::routers::GetRouterStatus::new(self.inner.clone())
16265    }
16266
16267    /// Creates a Router resource in the specified project and region using
16268    /// the data included in the request.
16269    pub fn insert(&self) -> super::builder::routers::Insert {
16270        super::builder::routers::Insert::new(self.inner.clone())
16271    }
16272
16273    /// Retrieves a list of Router resources available to the specified project.
16274    pub fn list(&self) -> super::builder::routers::List {
16275        super::builder::routers::List::new(self.inner.clone())
16276    }
16277
16278    /// Retrieves a list of router bgp routes available to the specified project.
16279    pub fn list_bgp_routes(&self) -> super::builder::routers::ListBgpRoutes {
16280        super::builder::routers::ListBgpRoutes::new(self.inner.clone())
16281    }
16282
16283    /// Retrieves a list of router route policy subresources available to the
16284    /// specified project.
16285    pub fn list_route_policies(&self) -> super::builder::routers::ListRoutePolicies {
16286        super::builder::routers::ListRoutePolicies::new(self.inner.clone())
16287    }
16288
16289    /// Patches the specified Router resource with the data included in the
16290    /// request. This method supportsPATCH
16291    /// semantics and usesJSON merge
16292    /// patch format and processing rules.
16293    pub fn patch(&self) -> super::builder::routers::Patch {
16294        super::builder::routers::Patch::new(self.inner.clone())
16295    }
16296
16297    /// Patches Route Policy
16298    pub fn patch_route_policy(&self) -> super::builder::routers::PatchRoutePolicy {
16299        super::builder::routers::PatchRoutePolicy::new(self.inner.clone())
16300    }
16301
16302    /// Preview fields auto-generated during router create andupdate operations.
16303    /// Calling this method does NOT create or update the router.
16304    pub fn preview(&self) -> super::builder::routers::Preview {
16305        super::builder::routers::Preview::new(self.inner.clone())
16306    }
16307
16308    /// Updates the specified Router resource with the data included in the
16309    /// request.  This method conforms toPUT semantics, which requests that the state of the
16310    /// target resource be created or replaced with the state defined by the
16311    /// representation enclosed in the request message payload.
16312    pub fn update(&self) -> super::builder::routers::Update {
16313        super::builder::routers::Update::new(self.inner.clone())
16314    }
16315
16316    /// Updates or creates new Route Policy
16317    pub fn update_route_policy(&self) -> super::builder::routers::UpdateRoutePolicy {
16318        super::builder::routers::UpdateRoutePolicy::new(self.inner.clone())
16319    }
16320
16321    /// Retrieves the specified region-specific Operations resource.
16322    pub fn get_operation(&self) -> super::builder::routers::GetOperation {
16323        super::builder::routers::GetOperation::new(self.inner.clone())
16324    }
16325}
16326
16327/// Implements a client for the Google Compute Engine API.
16328///
16329/// # Example
16330/// ```
16331/// # use google_cloud_compute_v1::client::Routes;
16332/// async fn sample(
16333/// ) -> anyhow::Result<()> {
16334///     let client = Routes::builder().build().await?;
16335///     // use `client` to make requests to the Google Compute Engine API.
16336///     Ok(())
16337/// }
16338/// ```
16339///
16340/// # Service Description
16341///
16342/// Service for the `routes` resource.
16343///
16344/// # Configuration
16345///
16346/// To configure `Routes` use the `with_*` methods in the type returned
16347/// by [builder()][Routes::builder]. The default configuration should
16348/// work for most applications. Common configuration changes include
16349///
16350/// * [with_endpoint()]: by default this client uses the global default endpoint
16351///   (`https://compute.googleapis.com`). Applications using regional
16352///   endpoints or running in restricted networks (e.g. a network configured
16353//    with [Private Google Access with VPC Service Controls]) may want to
16354///   override this default.
16355/// * [with_credentials()]: by default this client uses
16356///   [Application Default Credentials]. Applications using custom
16357///   authentication may need to override this default.
16358///
16359/// [with_endpoint()]: super::builder::routes::ClientBuilder::with_endpoint
16360/// [with_credentials()]: super::builder::routes::ClientBuilder::with_credentials
16361/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16362/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16363///
16364/// # Pooling and Cloning
16365///
16366/// `Routes` holds a connection pool internally, it is advised to
16367/// create one and reuse it. You do not need to wrap `Routes` in
16368/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16369/// already uses an `Arc` internally.
16370#[cfg(feature = "routes")]
16371#[cfg_attr(docsrs, doc(cfg(feature = "routes")))]
16372#[derive(Clone, Debug)]
16373pub struct Routes {
16374    inner: std::sync::Arc<dyn super::stub::dynamic::Routes>,
16375}
16376
16377#[cfg(feature = "routes")]
16378impl Routes {
16379    /// Returns a builder for [Routes].
16380    ///
16381    /// ```
16382    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16383    /// # use google_cloud_compute_v1::client::Routes;
16384    /// let client = Routes::builder().build().await?;
16385    /// # Ok(()) }
16386    /// ```
16387    pub fn builder() -> super::builder::routes::ClientBuilder {
16388        crate::new_client_builder(super::builder::routes::client::Factory)
16389    }
16390
16391    /// Creates a new client from the provided stub.
16392    ///
16393    /// The most common case for calling this function is in tests mocking the
16394    /// client's behavior.
16395    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
16396    where
16397        T: super::stub::Routes + 'static,
16398    {
16399        Self { inner: stub.into() }
16400    }
16401
16402    pub(crate) async fn new(
16403        config: gaxi::options::ClientConfig,
16404    ) -> crate::ClientBuilderResult<Self> {
16405        let inner = Self::build_inner(config).await?;
16406        Ok(Self { inner })
16407    }
16408
16409    async fn build_inner(
16410        conf: gaxi::options::ClientConfig,
16411    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Routes>> {
16412        if gaxi::options::tracing_enabled(&conf) {
16413            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16414        }
16415        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16416    }
16417
16418    async fn build_transport(
16419        conf: gaxi::options::ClientConfig,
16420    ) -> crate::ClientBuilderResult<impl super::stub::Routes> {
16421        super::transport::Routes::new(conf).await
16422    }
16423
16424    async fn build_with_tracing(
16425        conf: gaxi::options::ClientConfig,
16426    ) -> crate::ClientBuilderResult<impl super::stub::Routes> {
16427        Self::build_transport(conf)
16428            .await
16429            .map(super::tracing::Routes::new)
16430    }
16431
16432    /// Deletes the specified Route resource.
16433    pub fn delete(&self) -> super::builder::routes::Delete {
16434        super::builder::routes::Delete::new(self.inner.clone())
16435    }
16436
16437    /// Returns the specified Route resource.
16438    pub fn get(&self) -> super::builder::routes::Get {
16439        super::builder::routes::Get::new(self.inner.clone())
16440    }
16441
16442    /// Creates a Route resource in the specified project using the data included
16443    /// in the request.
16444    pub fn insert(&self) -> super::builder::routes::Insert {
16445        super::builder::routes::Insert::new(self.inner.clone())
16446    }
16447
16448    /// Retrieves the list of Route resources available to the specified project.
16449    pub fn list(&self) -> super::builder::routes::List {
16450        super::builder::routes::List::new(self.inner.clone())
16451    }
16452
16453    /// Returns permissions that a caller has on the specified resource.
16454    pub fn test_iam_permissions(&self) -> super::builder::routes::TestIamPermissions {
16455        super::builder::routes::TestIamPermissions::new(self.inner.clone())
16456    }
16457
16458    /// Retrieves the specified Operations resource.
16459    pub fn get_operation(&self) -> super::builder::routes::GetOperation {
16460        super::builder::routes::GetOperation::new(self.inner.clone())
16461    }
16462}
16463
16464/// Implements a client for the Google Compute Engine API.
16465///
16466/// # Example
16467/// ```
16468/// # use google_cloud_compute_v1::client::SecurityPolicies;
16469/// async fn sample(
16470/// ) -> anyhow::Result<()> {
16471///     let client = SecurityPolicies::builder().build().await?;
16472///     // use `client` to make requests to the Google Compute Engine API.
16473///     Ok(())
16474/// }
16475/// ```
16476///
16477/// # Service Description
16478///
16479/// Service for the `securityPolicies` resource.
16480///
16481/// # Configuration
16482///
16483/// To configure `SecurityPolicies` use the `with_*` methods in the type returned
16484/// by [builder()][SecurityPolicies::builder]. The default configuration should
16485/// work for most applications. Common configuration changes include
16486///
16487/// * [with_endpoint()]: by default this client uses the global default endpoint
16488///   (`https://compute.googleapis.com`). Applications using regional
16489///   endpoints or running in restricted networks (e.g. a network configured
16490//    with [Private Google Access with VPC Service Controls]) may want to
16491///   override this default.
16492/// * [with_credentials()]: by default this client uses
16493///   [Application Default Credentials]. Applications using custom
16494///   authentication may need to override this default.
16495///
16496/// [with_endpoint()]: super::builder::security_policies::ClientBuilder::with_endpoint
16497/// [with_credentials()]: super::builder::security_policies::ClientBuilder::with_credentials
16498/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16499/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16500///
16501/// # Pooling and Cloning
16502///
16503/// `SecurityPolicies` holds a connection pool internally, it is advised to
16504/// create one and reuse it. You do not need to wrap `SecurityPolicies` in
16505/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16506/// already uses an `Arc` internally.
16507#[cfg(feature = "security-policies")]
16508#[cfg_attr(docsrs, doc(cfg(feature = "security-policies")))]
16509#[derive(Clone, Debug)]
16510pub struct SecurityPolicies {
16511    inner: std::sync::Arc<dyn super::stub::dynamic::SecurityPolicies>,
16512}
16513
16514#[cfg(feature = "security-policies")]
16515impl SecurityPolicies {
16516    /// Returns a builder for [SecurityPolicies].
16517    ///
16518    /// ```
16519    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16520    /// # use google_cloud_compute_v1::client::SecurityPolicies;
16521    /// let client = SecurityPolicies::builder().build().await?;
16522    /// # Ok(()) }
16523    /// ```
16524    pub fn builder() -> super::builder::security_policies::ClientBuilder {
16525        crate::new_client_builder(super::builder::security_policies::client::Factory)
16526    }
16527
16528    /// Creates a new client from the provided stub.
16529    ///
16530    /// The most common case for calling this function is in tests mocking the
16531    /// client's behavior.
16532    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
16533    where
16534        T: super::stub::SecurityPolicies + 'static,
16535    {
16536        Self { inner: stub.into() }
16537    }
16538
16539    pub(crate) async fn new(
16540        config: gaxi::options::ClientConfig,
16541    ) -> crate::ClientBuilderResult<Self> {
16542        let inner = Self::build_inner(config).await?;
16543        Ok(Self { inner })
16544    }
16545
16546    async fn build_inner(
16547        conf: gaxi::options::ClientConfig,
16548    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SecurityPolicies>>
16549    {
16550        if gaxi::options::tracing_enabled(&conf) {
16551            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16552        }
16553        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16554    }
16555
16556    async fn build_transport(
16557        conf: gaxi::options::ClientConfig,
16558    ) -> crate::ClientBuilderResult<impl super::stub::SecurityPolicies> {
16559        super::transport::SecurityPolicies::new(conf).await
16560    }
16561
16562    async fn build_with_tracing(
16563        conf: gaxi::options::ClientConfig,
16564    ) -> crate::ClientBuilderResult<impl super::stub::SecurityPolicies> {
16565        Self::build_transport(conf)
16566            .await
16567            .map(super::tracing::SecurityPolicies::new)
16568    }
16569
16570    /// Inserts a rule into a security policy.
16571    pub fn add_rule(&self) -> super::builder::security_policies::AddRule {
16572        super::builder::security_policies::AddRule::new(self.inner.clone())
16573    }
16574
16575    /// Retrieves the list of all SecurityPolicy resources, regional and global,
16576    /// available to the specified project.
16577    ///
16578    /// To prevent failure, Google recommends that you set the
16579    /// `returnPartialSuccess` parameter to `true`.
16580    pub fn aggregated_list(&self) -> super::builder::security_policies::AggregatedList {
16581        super::builder::security_policies::AggregatedList::new(self.inner.clone())
16582    }
16583
16584    /// Deletes the specified policy.
16585    pub fn delete(&self) -> super::builder::security_policies::Delete {
16586        super::builder::security_policies::Delete::new(self.inner.clone())
16587    }
16588
16589    /// List all of the ordered rules present in a single specified policy.
16590    pub fn get(&self) -> super::builder::security_policies::Get {
16591        super::builder::security_policies::Get::new(self.inner.clone())
16592    }
16593
16594    /// Gets a rule at the specified priority.
16595    pub fn get_rule(&self) -> super::builder::security_policies::GetRule {
16596        super::builder::security_policies::GetRule::new(self.inner.clone())
16597    }
16598
16599    /// Creates a new policy in the specified project using the data included in
16600    /// the request.
16601    pub fn insert(&self) -> super::builder::security_policies::Insert {
16602        super::builder::security_policies::Insert::new(self.inner.clone())
16603    }
16604
16605    /// List all the policies that have been configured for the specified project.
16606    pub fn list(&self) -> super::builder::security_policies::List {
16607        super::builder::security_policies::List::new(self.inner.clone())
16608    }
16609
16610    /// Gets the current list of preconfigured Web Application Firewall (WAF)
16611    /// expressions.
16612    pub fn list_preconfigured_expression_sets(
16613        &self,
16614    ) -> super::builder::security_policies::ListPreconfiguredExpressionSets {
16615        super::builder::security_policies::ListPreconfiguredExpressionSets::new(self.inner.clone())
16616    }
16617
16618    /// Patches the specified policy with the data included in the request. To
16619    /// clear fields in the policy, leave the fields empty and specify them in the
16620    /// updateMask. This cannot be used to be update the rules in the policy.
16621    /// Please use the per rule methods like addRule, patchRule, and removeRule
16622    /// instead.
16623    pub fn patch(&self) -> super::builder::security_policies::Patch {
16624        super::builder::security_policies::Patch::new(self.inner.clone())
16625    }
16626
16627    /// Patches a rule at the specified priority. To clear fields in the rule,
16628    /// leave the fields empty and specify them in the updateMask.
16629    pub fn patch_rule(&self) -> super::builder::security_policies::PatchRule {
16630        super::builder::security_policies::PatchRule::new(self.inner.clone())
16631    }
16632
16633    /// Deletes a rule at the specified priority.
16634    pub fn remove_rule(&self) -> super::builder::security_policies::RemoveRule {
16635        super::builder::security_policies::RemoveRule::new(self.inner.clone())
16636    }
16637
16638    /// Sets the labels on a security policy. To learn more about labels,
16639    /// read the Labeling Resources
16640    /// documentation.
16641    pub fn set_labels(&self) -> super::builder::security_policies::SetLabels {
16642        super::builder::security_policies::SetLabels::new(self.inner.clone())
16643    }
16644
16645    /// Retrieves the specified Operations resource.
16646    pub fn get_operation(&self) -> super::builder::security_policies::GetOperation {
16647        super::builder::security_policies::GetOperation::new(self.inner.clone())
16648    }
16649}
16650
16651/// Implements a client for the Google Compute Engine API.
16652///
16653/// # Example
16654/// ```
16655/// # use google_cloud_compute_v1::client::ServiceAttachments;
16656/// async fn sample(
16657/// ) -> anyhow::Result<()> {
16658///     let client = ServiceAttachments::builder().build().await?;
16659///     // use `client` to make requests to the Google Compute Engine API.
16660///     Ok(())
16661/// }
16662/// ```
16663///
16664/// # Service Description
16665///
16666/// Service for the `serviceAttachments` resource.
16667///
16668/// # Configuration
16669///
16670/// To configure `ServiceAttachments` use the `with_*` methods in the type returned
16671/// by [builder()][ServiceAttachments::builder]. The default configuration should
16672/// work for most applications. Common configuration changes include
16673///
16674/// * [with_endpoint()]: by default this client uses the global default endpoint
16675///   (`https://compute.googleapis.com`). Applications using regional
16676///   endpoints or running in restricted networks (e.g. a network configured
16677//    with [Private Google Access with VPC Service Controls]) may want to
16678///   override this default.
16679/// * [with_credentials()]: by default this client uses
16680///   [Application Default Credentials]. Applications using custom
16681///   authentication may need to override this default.
16682///
16683/// [with_endpoint()]: super::builder::service_attachments::ClientBuilder::with_endpoint
16684/// [with_credentials()]: super::builder::service_attachments::ClientBuilder::with_credentials
16685/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16686/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16687///
16688/// # Pooling and Cloning
16689///
16690/// `ServiceAttachments` holds a connection pool internally, it is advised to
16691/// create one and reuse it. You do not need to wrap `ServiceAttachments` in
16692/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16693/// already uses an `Arc` internally.
16694#[cfg(feature = "service-attachments")]
16695#[cfg_attr(docsrs, doc(cfg(feature = "service-attachments")))]
16696#[derive(Clone, Debug)]
16697pub struct ServiceAttachments {
16698    inner: std::sync::Arc<dyn super::stub::dynamic::ServiceAttachments>,
16699}
16700
16701#[cfg(feature = "service-attachments")]
16702impl ServiceAttachments {
16703    /// Returns a builder for [ServiceAttachments].
16704    ///
16705    /// ```
16706    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16707    /// # use google_cloud_compute_v1::client::ServiceAttachments;
16708    /// let client = ServiceAttachments::builder().build().await?;
16709    /// # Ok(()) }
16710    /// ```
16711    pub fn builder() -> super::builder::service_attachments::ClientBuilder {
16712        crate::new_client_builder(super::builder::service_attachments::client::Factory)
16713    }
16714
16715    /// Creates a new client from the provided stub.
16716    ///
16717    /// The most common case for calling this function is in tests mocking the
16718    /// client's behavior.
16719    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
16720    where
16721        T: super::stub::ServiceAttachments + 'static,
16722    {
16723        Self { inner: stub.into() }
16724    }
16725
16726    pub(crate) async fn new(
16727        config: gaxi::options::ClientConfig,
16728    ) -> crate::ClientBuilderResult<Self> {
16729        let inner = Self::build_inner(config).await?;
16730        Ok(Self { inner })
16731    }
16732
16733    async fn build_inner(
16734        conf: gaxi::options::ClientConfig,
16735    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ServiceAttachments>>
16736    {
16737        if gaxi::options::tracing_enabled(&conf) {
16738            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16739        }
16740        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16741    }
16742
16743    async fn build_transport(
16744        conf: gaxi::options::ClientConfig,
16745    ) -> crate::ClientBuilderResult<impl super::stub::ServiceAttachments> {
16746        super::transport::ServiceAttachments::new(conf).await
16747    }
16748
16749    async fn build_with_tracing(
16750        conf: gaxi::options::ClientConfig,
16751    ) -> crate::ClientBuilderResult<impl super::stub::ServiceAttachments> {
16752        Self::build_transport(conf)
16753            .await
16754            .map(super::tracing::ServiceAttachments::new)
16755    }
16756
16757    /// Retrieves the list of all ServiceAttachment resources,
16758    /// regional and global, available to the specified project.
16759    ///
16760    /// To prevent failure, Google recommends that you set the
16761    /// `returnPartialSuccess` parameter to `true`.
16762    pub fn aggregated_list(&self) -> super::builder::service_attachments::AggregatedList {
16763        super::builder::service_attachments::AggregatedList::new(self.inner.clone())
16764    }
16765
16766    /// Deletes the specified ServiceAttachment in the given scope
16767    pub fn delete(&self) -> super::builder::service_attachments::Delete {
16768        super::builder::service_attachments::Delete::new(self.inner.clone())
16769    }
16770
16771    /// Returns the specified ServiceAttachment resource in the given scope.
16772    pub fn get(&self) -> super::builder::service_attachments::Get {
16773        super::builder::service_attachments::Get::new(self.inner.clone())
16774    }
16775
16776    /// Gets the access control policy for a resource. May be empty if no such
16777    /// policy or resource exists.
16778    pub fn get_iam_policy(&self) -> super::builder::service_attachments::GetIamPolicy {
16779        super::builder::service_attachments::GetIamPolicy::new(self.inner.clone())
16780    }
16781
16782    /// Creates a ServiceAttachment in the specified project in the given scope
16783    /// using the parameters that are included in the request.
16784    pub fn insert(&self) -> super::builder::service_attachments::Insert {
16785        super::builder::service_attachments::Insert::new(self.inner.clone())
16786    }
16787
16788    /// Lists the ServiceAttachments for a project in the given scope.
16789    pub fn list(&self) -> super::builder::service_attachments::List {
16790        super::builder::service_attachments::List::new(self.inner.clone())
16791    }
16792
16793    /// Patches the specified ServiceAttachment resource with the data included in
16794    /// the request. This method supports PATCH
16795    /// semantics and usesJSON merge
16796    /// patch format and processing rules.
16797    pub fn patch(&self) -> super::builder::service_attachments::Patch {
16798        super::builder::service_attachments::Patch::new(self.inner.clone())
16799    }
16800
16801    /// Sets the access control policy on the specified resource.
16802    /// Replaces any existing policy.
16803    pub fn set_iam_policy(&self) -> super::builder::service_attachments::SetIamPolicy {
16804        super::builder::service_attachments::SetIamPolicy::new(self.inner.clone())
16805    }
16806
16807    /// Returns permissions that a caller has on the specified resource.
16808    pub fn test_iam_permissions(&self) -> super::builder::service_attachments::TestIamPermissions {
16809        super::builder::service_attachments::TestIamPermissions::new(self.inner.clone())
16810    }
16811
16812    /// Retrieves the specified region-specific Operations resource.
16813    pub fn get_operation(&self) -> super::builder::service_attachments::GetOperation {
16814        super::builder::service_attachments::GetOperation::new(self.inner.clone())
16815    }
16816}
16817
16818/// Implements a client for the Google Compute Engine API.
16819///
16820/// # Example
16821/// ```
16822/// # use google_cloud_compute_v1::client::SnapshotSettings;
16823/// async fn sample(
16824/// ) -> anyhow::Result<()> {
16825///     let client = SnapshotSettings::builder().build().await?;
16826///     // use `client` to make requests to the Google Compute Engine API.
16827///     Ok(())
16828/// }
16829/// ```
16830///
16831/// # Service Description
16832///
16833/// Service for the `snapshotSettings` resource.
16834///
16835/// # Configuration
16836///
16837/// To configure `SnapshotSettings` use the `with_*` methods in the type returned
16838/// by [builder()][SnapshotSettings::builder]. The default configuration should
16839/// work for most applications. Common configuration changes include
16840///
16841/// * [with_endpoint()]: by default this client uses the global default endpoint
16842///   (`https://compute.googleapis.com`). Applications using regional
16843///   endpoints or running in restricted networks (e.g. a network configured
16844//    with [Private Google Access with VPC Service Controls]) may want to
16845///   override this default.
16846/// * [with_credentials()]: by default this client uses
16847///   [Application Default Credentials]. Applications using custom
16848///   authentication may need to override this default.
16849///
16850/// [with_endpoint()]: super::builder::snapshot_settings::ClientBuilder::with_endpoint
16851/// [with_credentials()]: super::builder::snapshot_settings::ClientBuilder::with_credentials
16852/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16853/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16854///
16855/// # Pooling and Cloning
16856///
16857/// `SnapshotSettings` holds a connection pool internally, it is advised to
16858/// create one and reuse it. You do not need to wrap `SnapshotSettings` in
16859/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16860/// already uses an `Arc` internally.
16861#[cfg(feature = "snapshot-settings")]
16862#[cfg_attr(docsrs, doc(cfg(feature = "snapshot-settings")))]
16863#[derive(Clone, Debug)]
16864pub struct SnapshotSettings {
16865    inner: std::sync::Arc<dyn super::stub::dynamic::SnapshotSettings>,
16866}
16867
16868#[cfg(feature = "snapshot-settings")]
16869impl SnapshotSettings {
16870    /// Returns a builder for [SnapshotSettings].
16871    ///
16872    /// ```
16873    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16874    /// # use google_cloud_compute_v1::client::SnapshotSettings;
16875    /// let client = SnapshotSettings::builder().build().await?;
16876    /// # Ok(()) }
16877    /// ```
16878    pub fn builder() -> super::builder::snapshot_settings::ClientBuilder {
16879        crate::new_client_builder(super::builder::snapshot_settings::client::Factory)
16880    }
16881
16882    /// Creates a new client from the provided stub.
16883    ///
16884    /// The most common case for calling this function is in tests mocking the
16885    /// client's behavior.
16886    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
16887    where
16888        T: super::stub::SnapshotSettings + 'static,
16889    {
16890        Self { inner: stub.into() }
16891    }
16892
16893    pub(crate) async fn new(
16894        config: gaxi::options::ClientConfig,
16895    ) -> crate::ClientBuilderResult<Self> {
16896        let inner = Self::build_inner(config).await?;
16897        Ok(Self { inner })
16898    }
16899
16900    async fn build_inner(
16901        conf: gaxi::options::ClientConfig,
16902    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SnapshotSettings>>
16903    {
16904        if gaxi::options::tracing_enabled(&conf) {
16905            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16906        }
16907        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16908    }
16909
16910    async fn build_transport(
16911        conf: gaxi::options::ClientConfig,
16912    ) -> crate::ClientBuilderResult<impl super::stub::SnapshotSettings> {
16913        super::transport::SnapshotSettings::new(conf).await
16914    }
16915
16916    async fn build_with_tracing(
16917        conf: gaxi::options::ClientConfig,
16918    ) -> crate::ClientBuilderResult<impl super::stub::SnapshotSettings> {
16919        Self::build_transport(conf)
16920            .await
16921            .map(super::tracing::SnapshotSettings::new)
16922    }
16923
16924    /// Get snapshot settings.
16925    pub fn get(&self) -> super::builder::snapshot_settings::Get {
16926        super::builder::snapshot_settings::Get::new(self.inner.clone())
16927    }
16928
16929    /// Patch snapshot settings.
16930    pub fn patch(&self) -> super::builder::snapshot_settings::Patch {
16931        super::builder::snapshot_settings::Patch::new(self.inner.clone())
16932    }
16933
16934    /// Retrieves the specified Operations resource.
16935    pub fn get_operation(&self) -> super::builder::snapshot_settings::GetOperation {
16936        super::builder::snapshot_settings::GetOperation::new(self.inner.clone())
16937    }
16938}
16939
16940/// Implements a client for the Google Compute Engine API.
16941///
16942/// # Example
16943/// ```
16944/// # use google_cloud_compute_v1::client::Snapshots;
16945/// async fn sample(
16946/// ) -> anyhow::Result<()> {
16947///     let client = Snapshots::builder().build().await?;
16948///     // use `client` to make requests to the Google Compute Engine API.
16949///     Ok(())
16950/// }
16951/// ```
16952///
16953/// # Service Description
16954///
16955/// Service for the `snapshots` resource.
16956///
16957/// # Configuration
16958///
16959/// To configure `Snapshots` use the `with_*` methods in the type returned
16960/// by [builder()][Snapshots::builder]. The default configuration should
16961/// work for most applications. Common configuration changes include
16962///
16963/// * [with_endpoint()]: by default this client uses the global default endpoint
16964///   (`https://compute.googleapis.com`). Applications using regional
16965///   endpoints or running in restricted networks (e.g. a network configured
16966//    with [Private Google Access with VPC Service Controls]) may want to
16967///   override this default.
16968/// * [with_credentials()]: by default this client uses
16969///   [Application Default Credentials]. Applications using custom
16970///   authentication may need to override this default.
16971///
16972/// [with_endpoint()]: super::builder::snapshots::ClientBuilder::with_endpoint
16973/// [with_credentials()]: super::builder::snapshots::ClientBuilder::with_credentials
16974/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16975/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16976///
16977/// # Pooling and Cloning
16978///
16979/// `Snapshots` holds a connection pool internally, it is advised to
16980/// create one and reuse it. You do not need to wrap `Snapshots` in
16981/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16982/// already uses an `Arc` internally.
16983#[cfg(feature = "snapshots")]
16984#[cfg_attr(docsrs, doc(cfg(feature = "snapshots")))]
16985#[derive(Clone, Debug)]
16986pub struct Snapshots {
16987    inner: std::sync::Arc<dyn super::stub::dynamic::Snapshots>,
16988}
16989
16990#[cfg(feature = "snapshots")]
16991impl Snapshots {
16992    /// Returns a builder for [Snapshots].
16993    ///
16994    /// ```
16995    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16996    /// # use google_cloud_compute_v1::client::Snapshots;
16997    /// let client = Snapshots::builder().build().await?;
16998    /// # Ok(()) }
16999    /// ```
17000    pub fn builder() -> super::builder::snapshots::ClientBuilder {
17001        crate::new_client_builder(super::builder::snapshots::client::Factory)
17002    }
17003
17004    /// Creates a new client from the provided stub.
17005    ///
17006    /// The most common case for calling this function is in tests mocking the
17007    /// client's behavior.
17008    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
17009    where
17010        T: super::stub::Snapshots + 'static,
17011    {
17012        Self { inner: stub.into() }
17013    }
17014
17015    pub(crate) async fn new(
17016        config: gaxi::options::ClientConfig,
17017    ) -> crate::ClientBuilderResult<Self> {
17018        let inner = Self::build_inner(config).await?;
17019        Ok(Self { inner })
17020    }
17021
17022    async fn build_inner(
17023        conf: gaxi::options::ClientConfig,
17024    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Snapshots>> {
17025        if gaxi::options::tracing_enabled(&conf) {
17026            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17027        }
17028        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17029    }
17030
17031    async fn build_transport(
17032        conf: gaxi::options::ClientConfig,
17033    ) -> crate::ClientBuilderResult<impl super::stub::Snapshots> {
17034        super::transport::Snapshots::new(conf).await
17035    }
17036
17037    async fn build_with_tracing(
17038        conf: gaxi::options::ClientConfig,
17039    ) -> crate::ClientBuilderResult<impl super::stub::Snapshots> {
17040        Self::build_transport(conf)
17041            .await
17042            .map(super::tracing::Snapshots::new)
17043    }
17044
17045    /// Deletes the specified Snapshot resource. Keep in mind that deleting
17046    /// a single snapshot might not necessarily delete all the data on that
17047    /// snapshot. If any data on the snapshot that is marked for deletion is
17048    /// needed for subsequent snapshots, the data will be moved to the next
17049    /// corresponding snapshot.
17050    ///
17051    /// For more information, seeDeleting
17052    /// snapshots.
17053    pub fn delete(&self) -> super::builder::snapshots::Delete {
17054        super::builder::snapshots::Delete::new(self.inner.clone())
17055    }
17056
17057    /// Returns the specified Snapshot resource.
17058    pub fn get(&self) -> super::builder::snapshots::Get {
17059        super::builder::snapshots::Get::new(self.inner.clone())
17060    }
17061
17062    /// Gets the access control policy for a resource. May be empty if no such
17063    /// policy or resource exists.
17064    pub fn get_iam_policy(&self) -> super::builder::snapshots::GetIamPolicy {
17065        super::builder::snapshots::GetIamPolicy::new(self.inner.clone())
17066    }
17067
17068    /// Creates a snapshot in the specified project using the data included
17069    /// in the request. For regular snapshot creation, consider using this method
17070    /// instead of disks.createSnapshot,
17071    /// as this method supports more features, such as creating snapshots in a
17072    /// project different from the source disk project.
17073    pub fn insert(&self) -> super::builder::snapshots::Insert {
17074        super::builder::snapshots::Insert::new(self.inner.clone())
17075    }
17076
17077    /// Retrieves the list of Snapshot resources contained within
17078    /// the specified project.
17079    pub fn list(&self) -> super::builder::snapshots::List {
17080        super::builder::snapshots::List::new(self.inner.clone())
17081    }
17082
17083    /// Sets the access control policy on the specified resource.
17084    /// Replaces any existing policy.
17085    pub fn set_iam_policy(&self) -> super::builder::snapshots::SetIamPolicy {
17086        super::builder::snapshots::SetIamPolicy::new(self.inner.clone())
17087    }
17088
17089    /// Sets the labels on a snapshot. To learn more about labels, read theLabeling
17090    /// Resources documentation.
17091    pub fn set_labels(&self) -> super::builder::snapshots::SetLabels {
17092        super::builder::snapshots::SetLabels::new(self.inner.clone())
17093    }
17094
17095    /// Returns permissions that a caller has on the specified resource.
17096    pub fn test_iam_permissions(&self) -> super::builder::snapshots::TestIamPermissions {
17097        super::builder::snapshots::TestIamPermissions::new(self.inner.clone())
17098    }
17099
17100    /// Rotates the customer-managed
17101    /// encryption key to the latest version for the specified snapshot.
17102    pub fn update_kms_key(&self) -> super::builder::snapshots::UpdateKmsKey {
17103        super::builder::snapshots::UpdateKmsKey::new(self.inner.clone())
17104    }
17105
17106    /// Retrieves the specified Operations resource.
17107    pub fn get_operation(&self) -> super::builder::snapshots::GetOperation {
17108        super::builder::snapshots::GetOperation::new(self.inner.clone())
17109    }
17110}
17111
17112/// Implements a client for the Google Compute Engine API.
17113///
17114/// # Example
17115/// ```
17116/// # use google_cloud_compute_v1::client::SslCertificates;
17117/// async fn sample(
17118/// ) -> anyhow::Result<()> {
17119///     let client = SslCertificates::builder().build().await?;
17120///     // use `client` to make requests to the Google Compute Engine API.
17121///     Ok(())
17122/// }
17123/// ```
17124///
17125/// # Service Description
17126///
17127/// Service for the `sslCertificates` resource.
17128///
17129/// # Configuration
17130///
17131/// To configure `SslCertificates` use the `with_*` methods in the type returned
17132/// by [builder()][SslCertificates::builder]. The default configuration should
17133/// work for most applications. Common configuration changes include
17134///
17135/// * [with_endpoint()]: by default this client uses the global default endpoint
17136///   (`https://compute.googleapis.com`). Applications using regional
17137///   endpoints or running in restricted networks (e.g. a network configured
17138//    with [Private Google Access with VPC Service Controls]) may want to
17139///   override this default.
17140/// * [with_credentials()]: by default this client uses
17141///   [Application Default Credentials]. Applications using custom
17142///   authentication may need to override this default.
17143///
17144/// [with_endpoint()]: super::builder::ssl_certificates::ClientBuilder::with_endpoint
17145/// [with_credentials()]: super::builder::ssl_certificates::ClientBuilder::with_credentials
17146/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17147/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17148///
17149/// # Pooling and Cloning
17150///
17151/// `SslCertificates` holds a connection pool internally, it is advised to
17152/// create one and reuse it. You do not need to wrap `SslCertificates` in
17153/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17154/// already uses an `Arc` internally.
17155#[cfg(feature = "ssl-certificates")]
17156#[cfg_attr(docsrs, doc(cfg(feature = "ssl-certificates")))]
17157#[derive(Clone, Debug)]
17158pub struct SslCertificates {
17159    inner: std::sync::Arc<dyn super::stub::dynamic::SslCertificates>,
17160}
17161
17162#[cfg(feature = "ssl-certificates")]
17163impl SslCertificates {
17164    /// Returns a builder for [SslCertificates].
17165    ///
17166    /// ```
17167    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17168    /// # use google_cloud_compute_v1::client::SslCertificates;
17169    /// let client = SslCertificates::builder().build().await?;
17170    /// # Ok(()) }
17171    /// ```
17172    pub fn builder() -> super::builder::ssl_certificates::ClientBuilder {
17173        crate::new_client_builder(super::builder::ssl_certificates::client::Factory)
17174    }
17175
17176    /// Creates a new client from the provided stub.
17177    ///
17178    /// The most common case for calling this function is in tests mocking the
17179    /// client's behavior.
17180    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
17181    where
17182        T: super::stub::SslCertificates + 'static,
17183    {
17184        Self { inner: stub.into() }
17185    }
17186
17187    pub(crate) async fn new(
17188        config: gaxi::options::ClientConfig,
17189    ) -> crate::ClientBuilderResult<Self> {
17190        let inner = Self::build_inner(config).await?;
17191        Ok(Self { inner })
17192    }
17193
17194    async fn build_inner(
17195        conf: gaxi::options::ClientConfig,
17196    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SslCertificates>> {
17197        if gaxi::options::tracing_enabled(&conf) {
17198            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17199        }
17200        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17201    }
17202
17203    async fn build_transport(
17204        conf: gaxi::options::ClientConfig,
17205    ) -> crate::ClientBuilderResult<impl super::stub::SslCertificates> {
17206        super::transport::SslCertificates::new(conf).await
17207    }
17208
17209    async fn build_with_tracing(
17210        conf: gaxi::options::ClientConfig,
17211    ) -> crate::ClientBuilderResult<impl super::stub::SslCertificates> {
17212        Self::build_transport(conf)
17213            .await
17214            .map(super::tracing::SslCertificates::new)
17215    }
17216
17217    /// Retrieves the list of all SslCertificate resources, regional and global,
17218    /// available to the specified project.
17219    ///
17220    /// To prevent failure, Google recommends that you set the
17221    /// `returnPartialSuccess` parameter to `true`.
17222    pub fn aggregated_list(&self) -> super::builder::ssl_certificates::AggregatedList {
17223        super::builder::ssl_certificates::AggregatedList::new(self.inner.clone())
17224    }
17225
17226    /// Deletes the specified SslCertificate resource.
17227    pub fn delete(&self) -> super::builder::ssl_certificates::Delete {
17228        super::builder::ssl_certificates::Delete::new(self.inner.clone())
17229    }
17230
17231    /// Returns the specified SslCertificate resource.
17232    pub fn get(&self) -> super::builder::ssl_certificates::Get {
17233        super::builder::ssl_certificates::Get::new(self.inner.clone())
17234    }
17235
17236    /// Creates a SslCertificate resource in the specified project using the data
17237    /// included in the request.
17238    pub fn insert(&self) -> super::builder::ssl_certificates::Insert {
17239        super::builder::ssl_certificates::Insert::new(self.inner.clone())
17240    }
17241
17242    /// Retrieves the list of SslCertificate resources available to the specified
17243    /// project.
17244    pub fn list(&self) -> super::builder::ssl_certificates::List {
17245        super::builder::ssl_certificates::List::new(self.inner.clone())
17246    }
17247
17248    /// Retrieves the specified Operations resource.
17249    pub fn get_operation(&self) -> super::builder::ssl_certificates::GetOperation {
17250        super::builder::ssl_certificates::GetOperation::new(self.inner.clone())
17251    }
17252}
17253
17254/// Implements a client for the Google Compute Engine API.
17255///
17256/// # Example
17257/// ```
17258/// # use google_cloud_compute_v1::client::SslPolicies;
17259/// async fn sample(
17260/// ) -> anyhow::Result<()> {
17261///     let client = SslPolicies::builder().build().await?;
17262///     // use `client` to make requests to the Google Compute Engine API.
17263///     Ok(())
17264/// }
17265/// ```
17266///
17267/// # Service Description
17268///
17269/// Service for the `sslPolicies` resource.
17270///
17271/// # Configuration
17272///
17273/// To configure `SslPolicies` use the `with_*` methods in the type returned
17274/// by [builder()][SslPolicies::builder]. The default configuration should
17275/// work for most applications. Common configuration changes include
17276///
17277/// * [with_endpoint()]: by default this client uses the global default endpoint
17278///   (`https://compute.googleapis.com`). Applications using regional
17279///   endpoints or running in restricted networks (e.g. a network configured
17280//    with [Private Google Access with VPC Service Controls]) may want to
17281///   override this default.
17282/// * [with_credentials()]: by default this client uses
17283///   [Application Default Credentials]. Applications using custom
17284///   authentication may need to override this default.
17285///
17286/// [with_endpoint()]: super::builder::ssl_policies::ClientBuilder::with_endpoint
17287/// [with_credentials()]: super::builder::ssl_policies::ClientBuilder::with_credentials
17288/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17289/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17290///
17291/// # Pooling and Cloning
17292///
17293/// `SslPolicies` holds a connection pool internally, it is advised to
17294/// create one and reuse it. You do not need to wrap `SslPolicies` in
17295/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17296/// already uses an `Arc` internally.
17297#[cfg(feature = "ssl-policies")]
17298#[cfg_attr(docsrs, doc(cfg(feature = "ssl-policies")))]
17299#[derive(Clone, Debug)]
17300pub struct SslPolicies {
17301    inner: std::sync::Arc<dyn super::stub::dynamic::SslPolicies>,
17302}
17303
17304#[cfg(feature = "ssl-policies")]
17305impl SslPolicies {
17306    /// Returns a builder for [SslPolicies].
17307    ///
17308    /// ```
17309    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17310    /// # use google_cloud_compute_v1::client::SslPolicies;
17311    /// let client = SslPolicies::builder().build().await?;
17312    /// # Ok(()) }
17313    /// ```
17314    pub fn builder() -> super::builder::ssl_policies::ClientBuilder {
17315        crate::new_client_builder(super::builder::ssl_policies::client::Factory)
17316    }
17317
17318    /// Creates a new client from the provided stub.
17319    ///
17320    /// The most common case for calling this function is in tests mocking the
17321    /// client's behavior.
17322    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
17323    where
17324        T: super::stub::SslPolicies + 'static,
17325    {
17326        Self { inner: stub.into() }
17327    }
17328
17329    pub(crate) async fn new(
17330        config: gaxi::options::ClientConfig,
17331    ) -> crate::ClientBuilderResult<Self> {
17332        let inner = Self::build_inner(config).await?;
17333        Ok(Self { inner })
17334    }
17335
17336    async fn build_inner(
17337        conf: gaxi::options::ClientConfig,
17338    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SslPolicies>> {
17339        if gaxi::options::tracing_enabled(&conf) {
17340            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17341        }
17342        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17343    }
17344
17345    async fn build_transport(
17346        conf: gaxi::options::ClientConfig,
17347    ) -> crate::ClientBuilderResult<impl super::stub::SslPolicies> {
17348        super::transport::SslPolicies::new(conf).await
17349    }
17350
17351    async fn build_with_tracing(
17352        conf: gaxi::options::ClientConfig,
17353    ) -> crate::ClientBuilderResult<impl super::stub::SslPolicies> {
17354        Self::build_transport(conf)
17355            .await
17356            .map(super::tracing::SslPolicies::new)
17357    }
17358
17359    /// Retrieves the list of all SslPolicy resources, regional and global,
17360    /// available to the specified project.
17361    ///
17362    /// To prevent failure, Google recommends that you set the
17363    /// `returnPartialSuccess` parameter to `true`.
17364    pub fn aggregated_list(&self) -> super::builder::ssl_policies::AggregatedList {
17365        super::builder::ssl_policies::AggregatedList::new(self.inner.clone())
17366    }
17367
17368    /// Deletes the specified SSL policy. The SSL policy resource can be deleted
17369    /// only if it is not in use by any TargetHttpsProxy or TargetSslProxy
17370    /// resources.
17371    pub fn delete(&self) -> super::builder::ssl_policies::Delete {
17372        super::builder::ssl_policies::Delete::new(self.inner.clone())
17373    }
17374
17375    /// Lists all of the ordered rules present in a single specified policy.
17376    pub fn get(&self) -> super::builder::ssl_policies::Get {
17377        super::builder::ssl_policies::Get::new(self.inner.clone())
17378    }
17379
17380    /// Returns the specified SSL policy resource.
17381    pub fn insert(&self) -> super::builder::ssl_policies::Insert {
17382        super::builder::ssl_policies::Insert::new(self.inner.clone())
17383    }
17384
17385    /// Lists all the SSL policies that have been configured for the specified
17386    /// project.
17387    pub fn list(&self) -> super::builder::ssl_policies::List {
17388        super::builder::ssl_policies::List::new(self.inner.clone())
17389    }
17390
17391    /// Lists all features that can be specified in the SSL policy when using
17392    /// custom profile.
17393    pub fn list_available_features(&self) -> super::builder::ssl_policies::ListAvailableFeatures {
17394        super::builder::ssl_policies::ListAvailableFeatures::new(self.inner.clone())
17395    }
17396
17397    /// Patches the specified SSL policy with the data included in the request.
17398    pub fn patch(&self) -> super::builder::ssl_policies::Patch {
17399        super::builder::ssl_policies::Patch::new(self.inner.clone())
17400    }
17401
17402    /// Retrieves the specified Operations resource.
17403    pub fn get_operation(&self) -> super::builder::ssl_policies::GetOperation {
17404        super::builder::ssl_policies::GetOperation::new(self.inner.clone())
17405    }
17406}
17407
17408/// Implements a client for the Google Compute Engine API.
17409///
17410/// # Example
17411/// ```
17412/// # use google_cloud_compute_v1::client::StoragePoolTypes;
17413/// async fn sample(
17414/// ) -> anyhow::Result<()> {
17415///     let client = StoragePoolTypes::builder().build().await?;
17416///     // use `client` to make requests to the Google Compute Engine API.
17417///     Ok(())
17418/// }
17419/// ```
17420///
17421/// # Service Description
17422///
17423/// Service for the `storagePoolTypes` resource.
17424///
17425/// # Configuration
17426///
17427/// To configure `StoragePoolTypes` use the `with_*` methods in the type returned
17428/// by [builder()][StoragePoolTypes::builder]. The default configuration should
17429/// work for most applications. Common configuration changes include
17430///
17431/// * [with_endpoint()]: by default this client uses the global default endpoint
17432///   (`https://compute.googleapis.com`). Applications using regional
17433///   endpoints or running in restricted networks (e.g. a network configured
17434//    with [Private Google Access with VPC Service Controls]) may want to
17435///   override this default.
17436/// * [with_credentials()]: by default this client uses
17437///   [Application Default Credentials]. Applications using custom
17438///   authentication may need to override this default.
17439///
17440/// [with_endpoint()]: super::builder::storage_pool_types::ClientBuilder::with_endpoint
17441/// [with_credentials()]: super::builder::storage_pool_types::ClientBuilder::with_credentials
17442/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17443/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17444///
17445/// # Pooling and Cloning
17446///
17447/// `StoragePoolTypes` holds a connection pool internally, it is advised to
17448/// create one and reuse it. You do not need to wrap `StoragePoolTypes` in
17449/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17450/// already uses an `Arc` internally.
17451#[cfg(feature = "storage-pool-types")]
17452#[cfg_attr(docsrs, doc(cfg(feature = "storage-pool-types")))]
17453#[derive(Clone, Debug)]
17454pub struct StoragePoolTypes {
17455    inner: std::sync::Arc<dyn super::stub::dynamic::StoragePoolTypes>,
17456}
17457
17458#[cfg(feature = "storage-pool-types")]
17459impl StoragePoolTypes {
17460    /// Returns a builder for [StoragePoolTypes].
17461    ///
17462    /// ```
17463    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17464    /// # use google_cloud_compute_v1::client::StoragePoolTypes;
17465    /// let client = StoragePoolTypes::builder().build().await?;
17466    /// # Ok(()) }
17467    /// ```
17468    pub fn builder() -> super::builder::storage_pool_types::ClientBuilder {
17469        crate::new_client_builder(super::builder::storage_pool_types::client::Factory)
17470    }
17471
17472    /// Creates a new client from the provided stub.
17473    ///
17474    /// The most common case for calling this function is in tests mocking the
17475    /// client's behavior.
17476    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
17477    where
17478        T: super::stub::StoragePoolTypes + 'static,
17479    {
17480        Self { inner: stub.into() }
17481    }
17482
17483    pub(crate) async fn new(
17484        config: gaxi::options::ClientConfig,
17485    ) -> crate::ClientBuilderResult<Self> {
17486        let inner = Self::build_inner(config).await?;
17487        Ok(Self { inner })
17488    }
17489
17490    async fn build_inner(
17491        conf: gaxi::options::ClientConfig,
17492    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::StoragePoolTypes>>
17493    {
17494        if gaxi::options::tracing_enabled(&conf) {
17495            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17496        }
17497        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17498    }
17499
17500    async fn build_transport(
17501        conf: gaxi::options::ClientConfig,
17502    ) -> crate::ClientBuilderResult<impl super::stub::StoragePoolTypes> {
17503        super::transport::StoragePoolTypes::new(conf).await
17504    }
17505
17506    async fn build_with_tracing(
17507        conf: gaxi::options::ClientConfig,
17508    ) -> crate::ClientBuilderResult<impl super::stub::StoragePoolTypes> {
17509        Self::build_transport(conf)
17510            .await
17511            .map(super::tracing::StoragePoolTypes::new)
17512    }
17513
17514    /// Retrieves an aggregated list of storage pool types.
17515    ///
17516    /// To prevent failure, Google recommends that you set the
17517    /// `returnPartialSuccess` parameter to `true`.
17518    pub fn aggregated_list(&self) -> super::builder::storage_pool_types::AggregatedList {
17519        super::builder::storage_pool_types::AggregatedList::new(self.inner.clone())
17520    }
17521
17522    /// Returns the specified storage pool type.
17523    pub fn get(&self) -> super::builder::storage_pool_types::Get {
17524        super::builder::storage_pool_types::Get::new(self.inner.clone())
17525    }
17526
17527    /// Retrieves a list of storage pool types available to the specified
17528    /// project.
17529    pub fn list(&self) -> super::builder::storage_pool_types::List {
17530        super::builder::storage_pool_types::List::new(self.inner.clone())
17531    }
17532}
17533
17534/// Implements a client for the Google Compute Engine API.
17535///
17536/// # Example
17537/// ```
17538/// # use google_cloud_compute_v1::client::StoragePools;
17539/// async fn sample(
17540/// ) -> anyhow::Result<()> {
17541///     let client = StoragePools::builder().build().await?;
17542///     // use `client` to make requests to the Google Compute Engine API.
17543///     Ok(())
17544/// }
17545/// ```
17546///
17547/// # Service Description
17548///
17549/// Service for the `storagePools` resource.
17550///
17551/// # Configuration
17552///
17553/// To configure `StoragePools` use the `with_*` methods in the type returned
17554/// by [builder()][StoragePools::builder]. The default configuration should
17555/// work for most applications. Common configuration changes include
17556///
17557/// * [with_endpoint()]: by default this client uses the global default endpoint
17558///   (`https://compute.googleapis.com`). Applications using regional
17559///   endpoints or running in restricted networks (e.g. a network configured
17560//    with [Private Google Access with VPC Service Controls]) may want to
17561///   override this default.
17562/// * [with_credentials()]: by default this client uses
17563///   [Application Default Credentials]. Applications using custom
17564///   authentication may need to override this default.
17565///
17566/// [with_endpoint()]: super::builder::storage_pools::ClientBuilder::with_endpoint
17567/// [with_credentials()]: super::builder::storage_pools::ClientBuilder::with_credentials
17568/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17569/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17570///
17571/// # Pooling and Cloning
17572///
17573/// `StoragePools` holds a connection pool internally, it is advised to
17574/// create one and reuse it. You do not need to wrap `StoragePools` in
17575/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17576/// already uses an `Arc` internally.
17577#[cfg(feature = "storage-pools")]
17578#[cfg_attr(docsrs, doc(cfg(feature = "storage-pools")))]
17579#[derive(Clone, Debug)]
17580pub struct StoragePools {
17581    inner: std::sync::Arc<dyn super::stub::dynamic::StoragePools>,
17582}
17583
17584#[cfg(feature = "storage-pools")]
17585impl StoragePools {
17586    /// Returns a builder for [StoragePools].
17587    ///
17588    /// ```
17589    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17590    /// # use google_cloud_compute_v1::client::StoragePools;
17591    /// let client = StoragePools::builder().build().await?;
17592    /// # Ok(()) }
17593    /// ```
17594    pub fn builder() -> super::builder::storage_pools::ClientBuilder {
17595        crate::new_client_builder(super::builder::storage_pools::client::Factory)
17596    }
17597
17598    /// Creates a new client from the provided stub.
17599    ///
17600    /// The most common case for calling this function is in tests mocking the
17601    /// client's behavior.
17602    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
17603    where
17604        T: super::stub::StoragePools + 'static,
17605    {
17606        Self { inner: stub.into() }
17607    }
17608
17609    pub(crate) async fn new(
17610        config: gaxi::options::ClientConfig,
17611    ) -> crate::ClientBuilderResult<Self> {
17612        let inner = Self::build_inner(config).await?;
17613        Ok(Self { inner })
17614    }
17615
17616    async fn build_inner(
17617        conf: gaxi::options::ClientConfig,
17618    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::StoragePools>> {
17619        if gaxi::options::tracing_enabled(&conf) {
17620            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17621        }
17622        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17623    }
17624
17625    async fn build_transport(
17626        conf: gaxi::options::ClientConfig,
17627    ) -> crate::ClientBuilderResult<impl super::stub::StoragePools> {
17628        super::transport::StoragePools::new(conf).await
17629    }
17630
17631    async fn build_with_tracing(
17632        conf: gaxi::options::ClientConfig,
17633    ) -> crate::ClientBuilderResult<impl super::stub::StoragePools> {
17634        Self::build_transport(conf)
17635            .await
17636            .map(super::tracing::StoragePools::new)
17637    }
17638
17639    /// Retrieves an aggregated list of storage pools.
17640    ///
17641    /// To prevent failure, Google recommends that you set the
17642    /// `returnPartialSuccess` parameter to `true`.
17643    pub fn aggregated_list(&self) -> super::builder::storage_pools::AggregatedList {
17644        super::builder::storage_pools::AggregatedList::new(self.inner.clone())
17645    }
17646
17647    /// Deletes the specified storage pool. Deleting a storagePool
17648    /// removes its data permanently and is irreversible. However, deleting a
17649    /// storagePool does not delete any snapshots previously
17650    /// made from the storagePool. You must separately delete
17651    /// snapshots.
17652    pub fn delete(&self) -> super::builder::storage_pools::Delete {
17653        super::builder::storage_pools::Delete::new(self.inner.clone())
17654    }
17655
17656    /// Returns a specified storage pool. Gets a list of available
17657    /// storage pools by making a list() request.
17658    pub fn get(&self) -> super::builder::storage_pools::Get {
17659        super::builder::storage_pools::Get::new(self.inner.clone())
17660    }
17661
17662    /// Gets the access control policy for a resource. May be empty if no such
17663    /// policy or resource exists.
17664    pub fn get_iam_policy(&self) -> super::builder::storage_pools::GetIamPolicy {
17665        super::builder::storage_pools::GetIamPolicy::new(self.inner.clone())
17666    }
17667
17668    /// Creates a storage pool in the specified project using the data
17669    /// in the request.
17670    pub fn insert(&self) -> super::builder::storage_pools::Insert {
17671        super::builder::storage_pools::Insert::new(self.inner.clone())
17672    }
17673
17674    /// Retrieves a list of storage pools contained within
17675    /// the specified zone.
17676    pub fn list(&self) -> super::builder::storage_pools::List {
17677        super::builder::storage_pools::List::new(self.inner.clone())
17678    }
17679
17680    /// Lists the disks in a specified storage pool.
17681    pub fn list_disks(&self) -> super::builder::storage_pools::ListDisks {
17682        super::builder::storage_pools::ListDisks::new(self.inner.clone())
17683    }
17684
17685    /// Sets the access control policy on the specified resource.
17686    /// Replaces any existing policy.
17687    pub fn set_iam_policy(&self) -> super::builder::storage_pools::SetIamPolicy {
17688        super::builder::storage_pools::SetIamPolicy::new(self.inner.clone())
17689    }
17690
17691    /// Returns permissions that a caller has on the specified resource.
17692    pub fn test_iam_permissions(&self) -> super::builder::storage_pools::TestIamPermissions {
17693        super::builder::storage_pools::TestIamPermissions::new(self.inner.clone())
17694    }
17695
17696    /// Updates the specified storagePool with the data included in the request.
17697    /// The update is performed only on selected fields included as part
17698    /// of update-mask. Only the following fields can be modified:
17699    /// pool_provisioned_capacity_gb, pool_provisioned_iops and
17700    /// pool_provisioned_throughput.
17701    pub fn update(&self) -> super::builder::storage_pools::Update {
17702        super::builder::storage_pools::Update::new(self.inner.clone())
17703    }
17704
17705    /// Retrieves the specified zone-specific Operations resource.
17706    pub fn get_operation(&self) -> super::builder::storage_pools::GetOperation {
17707        super::builder::storage_pools::GetOperation::new(self.inner.clone())
17708    }
17709}
17710
17711/// Implements a client for the Google Compute Engine API.
17712///
17713/// # Example
17714/// ```
17715/// # use google_cloud_compute_v1::client::Subnetworks;
17716/// async fn sample(
17717/// ) -> anyhow::Result<()> {
17718///     let client = Subnetworks::builder().build().await?;
17719///     // use `client` to make requests to the Google Compute Engine API.
17720///     Ok(())
17721/// }
17722/// ```
17723///
17724/// # Service Description
17725///
17726/// Service for the `subnetworks` resource.
17727///
17728/// # Configuration
17729///
17730/// To configure `Subnetworks` use the `with_*` methods in the type returned
17731/// by [builder()][Subnetworks::builder]. The default configuration should
17732/// work for most applications. Common configuration changes include
17733///
17734/// * [with_endpoint()]: by default this client uses the global default endpoint
17735///   (`https://compute.googleapis.com`). Applications using regional
17736///   endpoints or running in restricted networks (e.g. a network configured
17737//    with [Private Google Access with VPC Service Controls]) may want to
17738///   override this default.
17739/// * [with_credentials()]: by default this client uses
17740///   [Application Default Credentials]. Applications using custom
17741///   authentication may need to override this default.
17742///
17743/// [with_endpoint()]: super::builder::subnetworks::ClientBuilder::with_endpoint
17744/// [with_credentials()]: super::builder::subnetworks::ClientBuilder::with_credentials
17745/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17746/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17747///
17748/// # Pooling and Cloning
17749///
17750/// `Subnetworks` holds a connection pool internally, it is advised to
17751/// create one and reuse it. You do not need to wrap `Subnetworks` in
17752/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17753/// already uses an `Arc` internally.
17754#[cfg(feature = "subnetworks")]
17755#[cfg_attr(docsrs, doc(cfg(feature = "subnetworks")))]
17756#[derive(Clone, Debug)]
17757pub struct Subnetworks {
17758    inner: std::sync::Arc<dyn super::stub::dynamic::Subnetworks>,
17759}
17760
17761#[cfg(feature = "subnetworks")]
17762impl Subnetworks {
17763    /// Returns a builder for [Subnetworks].
17764    ///
17765    /// ```
17766    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17767    /// # use google_cloud_compute_v1::client::Subnetworks;
17768    /// let client = Subnetworks::builder().build().await?;
17769    /// # Ok(()) }
17770    /// ```
17771    pub fn builder() -> super::builder::subnetworks::ClientBuilder {
17772        crate::new_client_builder(super::builder::subnetworks::client::Factory)
17773    }
17774
17775    /// Creates a new client from the provided stub.
17776    ///
17777    /// The most common case for calling this function is in tests mocking the
17778    /// client's behavior.
17779    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
17780    where
17781        T: super::stub::Subnetworks + 'static,
17782    {
17783        Self { inner: stub.into() }
17784    }
17785
17786    pub(crate) async fn new(
17787        config: gaxi::options::ClientConfig,
17788    ) -> crate::ClientBuilderResult<Self> {
17789        let inner = Self::build_inner(config).await?;
17790        Ok(Self { inner })
17791    }
17792
17793    async fn build_inner(
17794        conf: gaxi::options::ClientConfig,
17795    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Subnetworks>> {
17796        if gaxi::options::tracing_enabled(&conf) {
17797            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17798        }
17799        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17800    }
17801
17802    async fn build_transport(
17803        conf: gaxi::options::ClientConfig,
17804    ) -> crate::ClientBuilderResult<impl super::stub::Subnetworks> {
17805        super::transport::Subnetworks::new(conf).await
17806    }
17807
17808    async fn build_with_tracing(
17809        conf: gaxi::options::ClientConfig,
17810    ) -> crate::ClientBuilderResult<impl super::stub::Subnetworks> {
17811        Self::build_transport(conf)
17812            .await
17813            .map(super::tracing::Subnetworks::new)
17814    }
17815
17816    /// Retrieves an aggregated list of subnetworks.
17817    ///
17818    /// To prevent failure, Google recommends that you set the
17819    /// `returnPartialSuccess` parameter to `true`.
17820    pub fn aggregated_list(&self) -> super::builder::subnetworks::AggregatedList {
17821        super::builder::subnetworks::AggregatedList::new(self.inner.clone())
17822    }
17823
17824    /// Deletes the specified subnetwork.
17825    pub fn delete(&self) -> super::builder::subnetworks::Delete {
17826        super::builder::subnetworks::Delete::new(self.inner.clone())
17827    }
17828
17829    /// Expands the IP CIDR range of the subnetwork to a specified value.
17830    pub fn expand_ip_cidr_range(&self) -> super::builder::subnetworks::ExpandIpCidrRange {
17831        super::builder::subnetworks::ExpandIpCidrRange::new(self.inner.clone())
17832    }
17833
17834    /// Returns the specified subnetwork.
17835    pub fn get(&self) -> super::builder::subnetworks::Get {
17836        super::builder::subnetworks::Get::new(self.inner.clone())
17837    }
17838
17839    /// Gets the access control policy for a resource. May be empty if no such
17840    /// policy or resource exists.
17841    pub fn get_iam_policy(&self) -> super::builder::subnetworks::GetIamPolicy {
17842        super::builder::subnetworks::GetIamPolicy::new(self.inner.clone())
17843    }
17844
17845    /// Creates a subnetwork in the specified project using the data
17846    /// included in the request.
17847    pub fn insert(&self) -> super::builder::subnetworks::Insert {
17848        super::builder::subnetworks::Insert::new(self.inner.clone())
17849    }
17850
17851    /// Retrieves a list of subnetworks available to the specified
17852    /// project.
17853    pub fn list(&self) -> super::builder::subnetworks::List {
17854        super::builder::subnetworks::List::new(self.inner.clone())
17855    }
17856
17857    /// Retrieves an aggregated list of all usable subnetworks in the project.
17858    pub fn list_usable(&self) -> super::builder::subnetworks::ListUsable {
17859        super::builder::subnetworks::ListUsable::new(self.inner.clone())
17860    }
17861
17862    /// Patches the specified subnetwork with the data included in the request.
17863    /// Only certain fields can be updated with a patch request
17864    /// as indicated in the field descriptions.
17865    /// You must specify the current fingerprint of the
17866    /// subnetwork resource being patched.
17867    pub fn patch(&self) -> super::builder::subnetworks::Patch {
17868        super::builder::subnetworks::Patch::new(self.inner.clone())
17869    }
17870
17871    /// Sets the access control policy on the specified resource.
17872    /// Replaces any existing policy.
17873    pub fn set_iam_policy(&self) -> super::builder::subnetworks::SetIamPolicy {
17874        super::builder::subnetworks::SetIamPolicy::new(self.inner.clone())
17875    }
17876
17877    /// Set whether VMs in this subnet can access Google services without assigning
17878    /// external IP addresses through Private Google Access.
17879    pub fn set_private_ip_google_access(
17880        &self,
17881    ) -> super::builder::subnetworks::SetPrivateIpGoogleAccess {
17882        super::builder::subnetworks::SetPrivateIpGoogleAccess::new(self.inner.clone())
17883    }
17884
17885    /// Returns permissions that a caller has on the specified resource.
17886    pub fn test_iam_permissions(&self) -> super::builder::subnetworks::TestIamPermissions {
17887        super::builder::subnetworks::TestIamPermissions::new(self.inner.clone())
17888    }
17889
17890    /// Retrieves the specified region-specific Operations resource.
17891    pub fn get_operation(&self) -> super::builder::subnetworks::GetOperation {
17892        super::builder::subnetworks::GetOperation::new(self.inner.clone())
17893    }
17894}
17895
17896/// Implements a client for the Google Compute Engine API.
17897///
17898/// # Example
17899/// ```
17900/// # use google_cloud_compute_v1::client::TargetGrpcProxies;
17901/// async fn sample(
17902/// ) -> anyhow::Result<()> {
17903///     let client = TargetGrpcProxies::builder().build().await?;
17904///     // use `client` to make requests to the Google Compute Engine API.
17905///     Ok(())
17906/// }
17907/// ```
17908///
17909/// # Service Description
17910///
17911/// Service for the `targetGrpcProxies` resource.
17912///
17913/// # Configuration
17914///
17915/// To configure `TargetGrpcProxies` use the `with_*` methods in the type returned
17916/// by [builder()][TargetGrpcProxies::builder]. The default configuration should
17917/// work for most applications. Common configuration changes include
17918///
17919/// * [with_endpoint()]: by default this client uses the global default endpoint
17920///   (`https://compute.googleapis.com`). Applications using regional
17921///   endpoints or running in restricted networks (e.g. a network configured
17922//    with [Private Google Access with VPC Service Controls]) may want to
17923///   override this default.
17924/// * [with_credentials()]: by default this client uses
17925///   [Application Default Credentials]. Applications using custom
17926///   authentication may need to override this default.
17927///
17928/// [with_endpoint()]: super::builder::target_grpc_proxies::ClientBuilder::with_endpoint
17929/// [with_credentials()]: super::builder::target_grpc_proxies::ClientBuilder::with_credentials
17930/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17931/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17932///
17933/// # Pooling and Cloning
17934///
17935/// `TargetGrpcProxies` holds a connection pool internally, it is advised to
17936/// create one and reuse it. You do not need to wrap `TargetGrpcProxies` in
17937/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17938/// already uses an `Arc` internally.
17939#[cfg(feature = "target-grpc-proxies")]
17940#[cfg_attr(docsrs, doc(cfg(feature = "target-grpc-proxies")))]
17941#[derive(Clone, Debug)]
17942pub struct TargetGrpcProxies {
17943    inner: std::sync::Arc<dyn super::stub::dynamic::TargetGrpcProxies>,
17944}
17945
17946#[cfg(feature = "target-grpc-proxies")]
17947impl TargetGrpcProxies {
17948    /// Returns a builder for [TargetGrpcProxies].
17949    ///
17950    /// ```
17951    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17952    /// # use google_cloud_compute_v1::client::TargetGrpcProxies;
17953    /// let client = TargetGrpcProxies::builder().build().await?;
17954    /// # Ok(()) }
17955    /// ```
17956    pub fn builder() -> super::builder::target_grpc_proxies::ClientBuilder {
17957        crate::new_client_builder(super::builder::target_grpc_proxies::client::Factory)
17958    }
17959
17960    /// Creates a new client from the provided stub.
17961    ///
17962    /// The most common case for calling this function is in tests mocking the
17963    /// client's behavior.
17964    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
17965    where
17966        T: super::stub::TargetGrpcProxies + 'static,
17967    {
17968        Self { inner: stub.into() }
17969    }
17970
17971    pub(crate) async fn new(
17972        config: gaxi::options::ClientConfig,
17973    ) -> crate::ClientBuilderResult<Self> {
17974        let inner = Self::build_inner(config).await?;
17975        Ok(Self { inner })
17976    }
17977
17978    async fn build_inner(
17979        conf: gaxi::options::ClientConfig,
17980    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetGrpcProxies>>
17981    {
17982        if gaxi::options::tracing_enabled(&conf) {
17983            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17984        }
17985        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17986    }
17987
17988    async fn build_transport(
17989        conf: gaxi::options::ClientConfig,
17990    ) -> crate::ClientBuilderResult<impl super::stub::TargetGrpcProxies> {
17991        super::transport::TargetGrpcProxies::new(conf).await
17992    }
17993
17994    async fn build_with_tracing(
17995        conf: gaxi::options::ClientConfig,
17996    ) -> crate::ClientBuilderResult<impl super::stub::TargetGrpcProxies> {
17997        Self::build_transport(conf)
17998            .await
17999            .map(super::tracing::TargetGrpcProxies::new)
18000    }
18001
18002    /// Deletes the specified TargetGrpcProxy in the given scope
18003    pub fn delete(&self) -> super::builder::target_grpc_proxies::Delete {
18004        super::builder::target_grpc_proxies::Delete::new(self.inner.clone())
18005    }
18006
18007    /// Returns the specified TargetGrpcProxy resource in the given scope.
18008    pub fn get(&self) -> super::builder::target_grpc_proxies::Get {
18009        super::builder::target_grpc_proxies::Get::new(self.inner.clone())
18010    }
18011
18012    /// Creates a TargetGrpcProxy in the specified project in the given scope
18013    /// using the parameters that are included in the request.
18014    pub fn insert(&self) -> super::builder::target_grpc_proxies::Insert {
18015        super::builder::target_grpc_proxies::Insert::new(self.inner.clone())
18016    }
18017
18018    /// Lists the TargetGrpcProxies for a project in the given scope.
18019    pub fn list(&self) -> super::builder::target_grpc_proxies::List {
18020        super::builder::target_grpc_proxies::List::new(self.inner.clone())
18021    }
18022
18023    /// Patches the specified TargetGrpcProxy resource with the data included in
18024    /// the request. This method supports PATCH
18025    /// semantics and usesJSON merge
18026    /// patch format and processing rules.
18027    pub fn patch(&self) -> super::builder::target_grpc_proxies::Patch {
18028        super::builder::target_grpc_proxies::Patch::new(self.inner.clone())
18029    }
18030
18031    /// Retrieves the specified Operations resource.
18032    pub fn get_operation(&self) -> super::builder::target_grpc_proxies::GetOperation {
18033        super::builder::target_grpc_proxies::GetOperation::new(self.inner.clone())
18034    }
18035}
18036
18037/// Implements a client for the Google Compute Engine API.
18038///
18039/// # Example
18040/// ```
18041/// # use google_cloud_compute_v1::client::TargetHttpProxies;
18042/// async fn sample(
18043/// ) -> anyhow::Result<()> {
18044///     let client = TargetHttpProxies::builder().build().await?;
18045///     // use `client` to make requests to the Google Compute Engine API.
18046///     Ok(())
18047/// }
18048/// ```
18049///
18050/// # Service Description
18051///
18052/// Service for the `targetHttpProxies` resource.
18053///
18054/// # Configuration
18055///
18056/// To configure `TargetHttpProxies` use the `with_*` methods in the type returned
18057/// by [builder()][TargetHttpProxies::builder]. The default configuration should
18058/// work for most applications. Common configuration changes include
18059///
18060/// * [with_endpoint()]: by default this client uses the global default endpoint
18061///   (`https://compute.googleapis.com`). Applications using regional
18062///   endpoints or running in restricted networks (e.g. a network configured
18063//    with [Private Google Access with VPC Service Controls]) may want to
18064///   override this default.
18065/// * [with_credentials()]: by default this client uses
18066///   [Application Default Credentials]. Applications using custom
18067///   authentication may need to override this default.
18068///
18069/// [with_endpoint()]: super::builder::target_http_proxies::ClientBuilder::with_endpoint
18070/// [with_credentials()]: super::builder::target_http_proxies::ClientBuilder::with_credentials
18071/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18072/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18073///
18074/// # Pooling and Cloning
18075///
18076/// `TargetHttpProxies` holds a connection pool internally, it is advised to
18077/// create one and reuse it. You do not need to wrap `TargetHttpProxies` in
18078/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18079/// already uses an `Arc` internally.
18080#[cfg(feature = "target-http-proxies")]
18081#[cfg_attr(docsrs, doc(cfg(feature = "target-http-proxies")))]
18082#[derive(Clone, Debug)]
18083pub struct TargetHttpProxies {
18084    inner: std::sync::Arc<dyn super::stub::dynamic::TargetHttpProxies>,
18085}
18086
18087#[cfg(feature = "target-http-proxies")]
18088impl TargetHttpProxies {
18089    /// Returns a builder for [TargetHttpProxies].
18090    ///
18091    /// ```
18092    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18093    /// # use google_cloud_compute_v1::client::TargetHttpProxies;
18094    /// let client = TargetHttpProxies::builder().build().await?;
18095    /// # Ok(()) }
18096    /// ```
18097    pub fn builder() -> super::builder::target_http_proxies::ClientBuilder {
18098        crate::new_client_builder(super::builder::target_http_proxies::client::Factory)
18099    }
18100
18101    /// Creates a new client from the provided stub.
18102    ///
18103    /// The most common case for calling this function is in tests mocking the
18104    /// client's behavior.
18105    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
18106    where
18107        T: super::stub::TargetHttpProxies + 'static,
18108    {
18109        Self { inner: stub.into() }
18110    }
18111
18112    pub(crate) async fn new(
18113        config: gaxi::options::ClientConfig,
18114    ) -> crate::ClientBuilderResult<Self> {
18115        let inner = Self::build_inner(config).await?;
18116        Ok(Self { inner })
18117    }
18118
18119    async fn build_inner(
18120        conf: gaxi::options::ClientConfig,
18121    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetHttpProxies>>
18122    {
18123        if gaxi::options::tracing_enabled(&conf) {
18124            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18125        }
18126        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18127    }
18128
18129    async fn build_transport(
18130        conf: gaxi::options::ClientConfig,
18131    ) -> crate::ClientBuilderResult<impl super::stub::TargetHttpProxies> {
18132        super::transport::TargetHttpProxies::new(conf).await
18133    }
18134
18135    async fn build_with_tracing(
18136        conf: gaxi::options::ClientConfig,
18137    ) -> crate::ClientBuilderResult<impl super::stub::TargetHttpProxies> {
18138        Self::build_transport(conf)
18139            .await
18140            .map(super::tracing::TargetHttpProxies::new)
18141    }
18142
18143    /// Retrieves the list of all TargetHttpProxy resources, regional and global,
18144    /// available to the specified project.
18145    ///
18146    /// To prevent failure, Google recommends that you set the
18147    /// `returnPartialSuccess` parameter to `true`.
18148    pub fn aggregated_list(&self) -> super::builder::target_http_proxies::AggregatedList {
18149        super::builder::target_http_proxies::AggregatedList::new(self.inner.clone())
18150    }
18151
18152    /// Deletes the specified TargetHttpProxy resource.
18153    pub fn delete(&self) -> super::builder::target_http_proxies::Delete {
18154        super::builder::target_http_proxies::Delete::new(self.inner.clone())
18155    }
18156
18157    /// Returns the specified TargetHttpProxy resource.
18158    pub fn get(&self) -> super::builder::target_http_proxies::Get {
18159        super::builder::target_http_proxies::Get::new(self.inner.clone())
18160    }
18161
18162    /// Creates a TargetHttpProxy resource in the specified
18163    /// project using the data included in the request.
18164    pub fn insert(&self) -> super::builder::target_http_proxies::Insert {
18165        super::builder::target_http_proxies::Insert::new(self.inner.clone())
18166    }
18167
18168    /// Retrieves the list of TargetHttpProxy resources available
18169    /// to the specified project.
18170    pub fn list(&self) -> super::builder::target_http_proxies::List {
18171        super::builder::target_http_proxies::List::new(self.inner.clone())
18172    }
18173
18174    /// Patches the specified TargetHttpProxy resource with the data included in
18175    /// the request. This method supports PATCH
18176    /// semantics and usesJSON merge
18177    /// patch format and processing rules.
18178    pub fn patch(&self) -> super::builder::target_http_proxies::Patch {
18179        super::builder::target_http_proxies::Patch::new(self.inner.clone())
18180    }
18181
18182    /// Changes the URL map for TargetHttpProxy.
18183    pub fn set_url_map(&self) -> super::builder::target_http_proxies::SetUrlMap {
18184        super::builder::target_http_proxies::SetUrlMap::new(self.inner.clone())
18185    }
18186
18187    /// Retrieves the specified Operations resource.
18188    pub fn get_operation(&self) -> super::builder::target_http_proxies::GetOperation {
18189        super::builder::target_http_proxies::GetOperation::new(self.inner.clone())
18190    }
18191}
18192
18193/// Implements a client for the Google Compute Engine API.
18194///
18195/// # Example
18196/// ```
18197/// # use google_cloud_compute_v1::client::TargetHttpsProxies;
18198/// async fn sample(
18199/// ) -> anyhow::Result<()> {
18200///     let client = TargetHttpsProxies::builder().build().await?;
18201///     // use `client` to make requests to the Google Compute Engine API.
18202///     Ok(())
18203/// }
18204/// ```
18205///
18206/// # Service Description
18207///
18208/// Service for the `targetHttpsProxies` resource.
18209///
18210/// # Configuration
18211///
18212/// To configure `TargetHttpsProxies` use the `with_*` methods in the type returned
18213/// by [builder()][TargetHttpsProxies::builder]. The default configuration should
18214/// work for most applications. Common configuration changes include
18215///
18216/// * [with_endpoint()]: by default this client uses the global default endpoint
18217///   (`https://compute.googleapis.com`). Applications using regional
18218///   endpoints or running in restricted networks (e.g. a network configured
18219//    with [Private Google Access with VPC Service Controls]) may want to
18220///   override this default.
18221/// * [with_credentials()]: by default this client uses
18222///   [Application Default Credentials]. Applications using custom
18223///   authentication may need to override this default.
18224///
18225/// [with_endpoint()]: super::builder::target_https_proxies::ClientBuilder::with_endpoint
18226/// [with_credentials()]: super::builder::target_https_proxies::ClientBuilder::with_credentials
18227/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18228/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18229///
18230/// # Pooling and Cloning
18231///
18232/// `TargetHttpsProxies` holds a connection pool internally, it is advised to
18233/// create one and reuse it. You do not need to wrap `TargetHttpsProxies` in
18234/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18235/// already uses an `Arc` internally.
18236#[cfg(feature = "target-https-proxies")]
18237#[cfg_attr(docsrs, doc(cfg(feature = "target-https-proxies")))]
18238#[derive(Clone, Debug)]
18239pub struct TargetHttpsProxies {
18240    inner: std::sync::Arc<dyn super::stub::dynamic::TargetHttpsProxies>,
18241}
18242
18243#[cfg(feature = "target-https-proxies")]
18244impl TargetHttpsProxies {
18245    /// Returns a builder for [TargetHttpsProxies].
18246    ///
18247    /// ```
18248    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18249    /// # use google_cloud_compute_v1::client::TargetHttpsProxies;
18250    /// let client = TargetHttpsProxies::builder().build().await?;
18251    /// # Ok(()) }
18252    /// ```
18253    pub fn builder() -> super::builder::target_https_proxies::ClientBuilder {
18254        crate::new_client_builder(super::builder::target_https_proxies::client::Factory)
18255    }
18256
18257    /// Creates a new client from the provided stub.
18258    ///
18259    /// The most common case for calling this function is in tests mocking the
18260    /// client's behavior.
18261    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
18262    where
18263        T: super::stub::TargetHttpsProxies + 'static,
18264    {
18265        Self { inner: stub.into() }
18266    }
18267
18268    pub(crate) async fn new(
18269        config: gaxi::options::ClientConfig,
18270    ) -> crate::ClientBuilderResult<Self> {
18271        let inner = Self::build_inner(config).await?;
18272        Ok(Self { inner })
18273    }
18274
18275    async fn build_inner(
18276        conf: gaxi::options::ClientConfig,
18277    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetHttpsProxies>>
18278    {
18279        if gaxi::options::tracing_enabled(&conf) {
18280            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18281        }
18282        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18283    }
18284
18285    async fn build_transport(
18286        conf: gaxi::options::ClientConfig,
18287    ) -> crate::ClientBuilderResult<impl super::stub::TargetHttpsProxies> {
18288        super::transport::TargetHttpsProxies::new(conf).await
18289    }
18290
18291    async fn build_with_tracing(
18292        conf: gaxi::options::ClientConfig,
18293    ) -> crate::ClientBuilderResult<impl super::stub::TargetHttpsProxies> {
18294        Self::build_transport(conf)
18295            .await
18296            .map(super::tracing::TargetHttpsProxies::new)
18297    }
18298
18299    /// Retrieves the list of all TargetHttpsProxy resources, regional and global,
18300    /// available to the specified project.
18301    ///
18302    /// To prevent failure, Google recommends that you set the
18303    /// `returnPartialSuccess` parameter to `true`.
18304    pub fn aggregated_list(&self) -> super::builder::target_https_proxies::AggregatedList {
18305        super::builder::target_https_proxies::AggregatedList::new(self.inner.clone())
18306    }
18307
18308    /// Deletes the specified TargetHttpsProxy resource.
18309    pub fn delete(&self) -> super::builder::target_https_proxies::Delete {
18310        super::builder::target_https_proxies::Delete::new(self.inner.clone())
18311    }
18312
18313    /// Returns the specified TargetHttpsProxy resource.
18314    pub fn get(&self) -> super::builder::target_https_proxies::Get {
18315        super::builder::target_https_proxies::Get::new(self.inner.clone())
18316    }
18317
18318    /// Creates a TargetHttpsProxy resource in the specified
18319    /// project using the data included in the request.
18320    pub fn insert(&self) -> super::builder::target_https_proxies::Insert {
18321        super::builder::target_https_proxies::Insert::new(self.inner.clone())
18322    }
18323
18324    /// Retrieves the list of TargetHttpsProxy resources
18325    /// available to the specified project.
18326    pub fn list(&self) -> super::builder::target_https_proxies::List {
18327        super::builder::target_https_proxies::List::new(self.inner.clone())
18328    }
18329
18330    /// Patches the specified TargetHttpsProxy resource with the data included in
18331    /// the request. This method supports PATCH
18332    /// semantics and usesJSON merge
18333    /// patch format and processing rules.
18334    pub fn patch(&self) -> super::builder::target_https_proxies::Patch {
18335        super::builder::target_https_proxies::Patch::new(self.inner.clone())
18336    }
18337
18338    /// Changes the Certificate Map for TargetHttpsProxy.
18339    pub fn set_certificate_map(&self) -> super::builder::target_https_proxies::SetCertificateMap {
18340        super::builder::target_https_proxies::SetCertificateMap::new(self.inner.clone())
18341    }
18342
18343    /// Sets the QUIC override policy for TargetHttpsProxy.
18344    pub fn set_quic_override(&self) -> super::builder::target_https_proxies::SetQuicOverride {
18345        super::builder::target_https_proxies::SetQuicOverride::new(self.inner.clone())
18346    }
18347
18348    /// Replaces SslCertificates for TargetHttpsProxy.
18349    pub fn set_ssl_certificates(&self) -> super::builder::target_https_proxies::SetSslCertificates {
18350        super::builder::target_https_proxies::SetSslCertificates::new(self.inner.clone())
18351    }
18352
18353    /// Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies the
18354    /// server-side support for SSL features. This affects connections between
18355    /// clients and the HTTPS proxy load balancer. They do not affect the
18356    /// connection between the load balancer and the backends.
18357    pub fn set_ssl_policy(&self) -> super::builder::target_https_proxies::SetSslPolicy {
18358        super::builder::target_https_proxies::SetSslPolicy::new(self.inner.clone())
18359    }
18360
18361    /// Changes the URL map for TargetHttpsProxy.
18362    pub fn set_url_map(&self) -> super::builder::target_https_proxies::SetUrlMap {
18363        super::builder::target_https_proxies::SetUrlMap::new(self.inner.clone())
18364    }
18365
18366    /// Retrieves the specified Operations resource.
18367    pub fn get_operation(&self) -> super::builder::target_https_proxies::GetOperation {
18368        super::builder::target_https_proxies::GetOperation::new(self.inner.clone())
18369    }
18370}
18371
18372/// Implements a client for the Google Compute Engine API.
18373///
18374/// # Example
18375/// ```
18376/// # use google_cloud_compute_v1::client::TargetInstances;
18377/// async fn sample(
18378/// ) -> anyhow::Result<()> {
18379///     let client = TargetInstances::builder().build().await?;
18380///     // use `client` to make requests to the Google Compute Engine API.
18381///     Ok(())
18382/// }
18383/// ```
18384///
18385/// # Service Description
18386///
18387/// Service for the `targetInstances` resource.
18388///
18389/// # Configuration
18390///
18391/// To configure `TargetInstances` use the `with_*` methods in the type returned
18392/// by [builder()][TargetInstances::builder]. The default configuration should
18393/// work for most applications. Common configuration changes include
18394///
18395/// * [with_endpoint()]: by default this client uses the global default endpoint
18396///   (`https://compute.googleapis.com`). Applications using regional
18397///   endpoints or running in restricted networks (e.g. a network configured
18398//    with [Private Google Access with VPC Service Controls]) may want to
18399///   override this default.
18400/// * [with_credentials()]: by default this client uses
18401///   [Application Default Credentials]. Applications using custom
18402///   authentication may need to override this default.
18403///
18404/// [with_endpoint()]: super::builder::target_instances::ClientBuilder::with_endpoint
18405/// [with_credentials()]: super::builder::target_instances::ClientBuilder::with_credentials
18406/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18407/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18408///
18409/// # Pooling and Cloning
18410///
18411/// `TargetInstances` holds a connection pool internally, it is advised to
18412/// create one and reuse it. You do not need to wrap `TargetInstances` in
18413/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18414/// already uses an `Arc` internally.
18415#[cfg(feature = "target-instances")]
18416#[cfg_attr(docsrs, doc(cfg(feature = "target-instances")))]
18417#[derive(Clone, Debug)]
18418pub struct TargetInstances {
18419    inner: std::sync::Arc<dyn super::stub::dynamic::TargetInstances>,
18420}
18421
18422#[cfg(feature = "target-instances")]
18423impl TargetInstances {
18424    /// Returns a builder for [TargetInstances].
18425    ///
18426    /// ```
18427    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18428    /// # use google_cloud_compute_v1::client::TargetInstances;
18429    /// let client = TargetInstances::builder().build().await?;
18430    /// # Ok(()) }
18431    /// ```
18432    pub fn builder() -> super::builder::target_instances::ClientBuilder {
18433        crate::new_client_builder(super::builder::target_instances::client::Factory)
18434    }
18435
18436    /// Creates a new client from the provided stub.
18437    ///
18438    /// The most common case for calling this function is in tests mocking the
18439    /// client's behavior.
18440    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
18441    where
18442        T: super::stub::TargetInstances + 'static,
18443    {
18444        Self { inner: stub.into() }
18445    }
18446
18447    pub(crate) async fn new(
18448        config: gaxi::options::ClientConfig,
18449    ) -> crate::ClientBuilderResult<Self> {
18450        let inner = Self::build_inner(config).await?;
18451        Ok(Self { inner })
18452    }
18453
18454    async fn build_inner(
18455        conf: gaxi::options::ClientConfig,
18456    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetInstances>> {
18457        if gaxi::options::tracing_enabled(&conf) {
18458            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18459        }
18460        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18461    }
18462
18463    async fn build_transport(
18464        conf: gaxi::options::ClientConfig,
18465    ) -> crate::ClientBuilderResult<impl super::stub::TargetInstances> {
18466        super::transport::TargetInstances::new(conf).await
18467    }
18468
18469    async fn build_with_tracing(
18470        conf: gaxi::options::ClientConfig,
18471    ) -> crate::ClientBuilderResult<impl super::stub::TargetInstances> {
18472        Self::build_transport(conf)
18473            .await
18474            .map(super::tracing::TargetInstances::new)
18475    }
18476
18477    /// Retrieves an aggregated list of target instances.
18478    ///
18479    /// To prevent failure, Google recommends that you set the
18480    /// `returnPartialSuccess` parameter to `true`.
18481    pub fn aggregated_list(&self) -> super::builder::target_instances::AggregatedList {
18482        super::builder::target_instances::AggregatedList::new(self.inner.clone())
18483    }
18484
18485    /// Deletes the specified TargetInstance resource.
18486    pub fn delete(&self) -> super::builder::target_instances::Delete {
18487        super::builder::target_instances::Delete::new(self.inner.clone())
18488    }
18489
18490    /// Returns the specified TargetInstance resource.
18491    pub fn get(&self) -> super::builder::target_instances::Get {
18492        super::builder::target_instances::Get::new(self.inner.clone())
18493    }
18494
18495    /// Creates a TargetInstance resource in the specified project and zone using
18496    /// the data included in the request.
18497    pub fn insert(&self) -> super::builder::target_instances::Insert {
18498        super::builder::target_instances::Insert::new(self.inner.clone())
18499    }
18500
18501    /// Retrieves a list of TargetInstance resources available to the specified
18502    /// project and zone.
18503    pub fn list(&self) -> super::builder::target_instances::List {
18504        super::builder::target_instances::List::new(self.inner.clone())
18505    }
18506
18507    /// Sets the Google Cloud Armor security policy for the specified target
18508    /// instance. For more information, seeGoogle
18509    /// Cloud Armor Overview
18510    pub fn set_security_policy(&self) -> super::builder::target_instances::SetSecurityPolicy {
18511        super::builder::target_instances::SetSecurityPolicy::new(self.inner.clone())
18512    }
18513
18514    /// Returns permissions that a caller has on the specified resource.
18515    pub fn test_iam_permissions(&self) -> super::builder::target_instances::TestIamPermissions {
18516        super::builder::target_instances::TestIamPermissions::new(self.inner.clone())
18517    }
18518
18519    /// Retrieves the specified zone-specific Operations resource.
18520    pub fn get_operation(&self) -> super::builder::target_instances::GetOperation {
18521        super::builder::target_instances::GetOperation::new(self.inner.clone())
18522    }
18523}
18524
18525/// Implements a client for the Google Compute Engine API.
18526///
18527/// # Example
18528/// ```
18529/// # use google_cloud_compute_v1::client::TargetPools;
18530/// async fn sample(
18531/// ) -> anyhow::Result<()> {
18532///     let client = TargetPools::builder().build().await?;
18533///     // use `client` to make requests to the Google Compute Engine API.
18534///     Ok(())
18535/// }
18536/// ```
18537///
18538/// # Service Description
18539///
18540/// Service for the `targetPools` resource.
18541///
18542/// # Configuration
18543///
18544/// To configure `TargetPools` use the `with_*` methods in the type returned
18545/// by [builder()][TargetPools::builder]. The default configuration should
18546/// work for most applications. Common configuration changes include
18547///
18548/// * [with_endpoint()]: by default this client uses the global default endpoint
18549///   (`https://compute.googleapis.com`). Applications using regional
18550///   endpoints or running in restricted networks (e.g. a network configured
18551//    with [Private Google Access with VPC Service Controls]) may want to
18552///   override this default.
18553/// * [with_credentials()]: by default this client uses
18554///   [Application Default Credentials]. Applications using custom
18555///   authentication may need to override this default.
18556///
18557/// [with_endpoint()]: super::builder::target_pools::ClientBuilder::with_endpoint
18558/// [with_credentials()]: super::builder::target_pools::ClientBuilder::with_credentials
18559/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18560/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18561///
18562/// # Pooling and Cloning
18563///
18564/// `TargetPools` holds a connection pool internally, it is advised to
18565/// create one and reuse it. You do not need to wrap `TargetPools` in
18566/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18567/// already uses an `Arc` internally.
18568#[cfg(feature = "target-pools")]
18569#[cfg_attr(docsrs, doc(cfg(feature = "target-pools")))]
18570#[derive(Clone, Debug)]
18571pub struct TargetPools {
18572    inner: std::sync::Arc<dyn super::stub::dynamic::TargetPools>,
18573}
18574
18575#[cfg(feature = "target-pools")]
18576impl TargetPools {
18577    /// Returns a builder for [TargetPools].
18578    ///
18579    /// ```
18580    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18581    /// # use google_cloud_compute_v1::client::TargetPools;
18582    /// let client = TargetPools::builder().build().await?;
18583    /// # Ok(()) }
18584    /// ```
18585    pub fn builder() -> super::builder::target_pools::ClientBuilder {
18586        crate::new_client_builder(super::builder::target_pools::client::Factory)
18587    }
18588
18589    /// Creates a new client from the provided stub.
18590    ///
18591    /// The most common case for calling this function is in tests mocking the
18592    /// client's behavior.
18593    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
18594    where
18595        T: super::stub::TargetPools + 'static,
18596    {
18597        Self { inner: stub.into() }
18598    }
18599
18600    pub(crate) async fn new(
18601        config: gaxi::options::ClientConfig,
18602    ) -> crate::ClientBuilderResult<Self> {
18603        let inner = Self::build_inner(config).await?;
18604        Ok(Self { inner })
18605    }
18606
18607    async fn build_inner(
18608        conf: gaxi::options::ClientConfig,
18609    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetPools>> {
18610        if gaxi::options::tracing_enabled(&conf) {
18611            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18612        }
18613        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18614    }
18615
18616    async fn build_transport(
18617        conf: gaxi::options::ClientConfig,
18618    ) -> crate::ClientBuilderResult<impl super::stub::TargetPools> {
18619        super::transport::TargetPools::new(conf).await
18620    }
18621
18622    async fn build_with_tracing(
18623        conf: gaxi::options::ClientConfig,
18624    ) -> crate::ClientBuilderResult<impl super::stub::TargetPools> {
18625        Self::build_transport(conf)
18626            .await
18627            .map(super::tracing::TargetPools::new)
18628    }
18629
18630    /// Adds health check URLs to a target pool.
18631    pub fn add_health_check(&self) -> super::builder::target_pools::AddHealthCheck {
18632        super::builder::target_pools::AddHealthCheck::new(self.inner.clone())
18633    }
18634
18635    /// Adds an instance to a target pool.
18636    pub fn add_instance(&self) -> super::builder::target_pools::AddInstance {
18637        super::builder::target_pools::AddInstance::new(self.inner.clone())
18638    }
18639
18640    /// Retrieves an aggregated list of target pools.
18641    ///
18642    /// To prevent failure, Google recommends that you set the
18643    /// `returnPartialSuccess` parameter to `true`.
18644    pub fn aggregated_list(&self) -> super::builder::target_pools::AggregatedList {
18645        super::builder::target_pools::AggregatedList::new(self.inner.clone())
18646    }
18647
18648    /// Deletes the specified target pool.
18649    pub fn delete(&self) -> super::builder::target_pools::Delete {
18650        super::builder::target_pools::Delete::new(self.inner.clone())
18651    }
18652
18653    /// Returns the specified target pool.
18654    pub fn get(&self) -> super::builder::target_pools::Get {
18655        super::builder::target_pools::Get::new(self.inner.clone())
18656    }
18657
18658    /// Gets the most recent health check results for each IP for the
18659    /// instance that is referenced by the given target pool.
18660    pub fn get_health(&self) -> super::builder::target_pools::GetHealth {
18661        super::builder::target_pools::GetHealth::new(self.inner.clone())
18662    }
18663
18664    /// Creates a target pool in the specified project and region using
18665    /// the data included in the request.
18666    pub fn insert(&self) -> super::builder::target_pools::Insert {
18667        super::builder::target_pools::Insert::new(self.inner.clone())
18668    }
18669
18670    /// Retrieves a list of target pools available to the specified
18671    /// project and region.
18672    pub fn list(&self) -> super::builder::target_pools::List {
18673        super::builder::target_pools::List::new(self.inner.clone())
18674    }
18675
18676    /// Removes health check URL from a target pool.
18677    pub fn remove_health_check(&self) -> super::builder::target_pools::RemoveHealthCheck {
18678        super::builder::target_pools::RemoveHealthCheck::new(self.inner.clone())
18679    }
18680
18681    /// Removes instance URL from a target pool.
18682    pub fn remove_instance(&self) -> super::builder::target_pools::RemoveInstance {
18683        super::builder::target_pools::RemoveInstance::new(self.inner.clone())
18684    }
18685
18686    /// Changes a backup target pool's configurations.
18687    pub fn set_backup(&self) -> super::builder::target_pools::SetBackup {
18688        super::builder::target_pools::SetBackup::new(self.inner.clone())
18689    }
18690
18691    /// Sets the Google Cloud Armor security policy for the specified target pool.
18692    /// For more information, seeGoogle
18693    /// Cloud Armor Overview
18694    pub fn set_security_policy(&self) -> super::builder::target_pools::SetSecurityPolicy {
18695        super::builder::target_pools::SetSecurityPolicy::new(self.inner.clone())
18696    }
18697
18698    /// Returns permissions that a caller has on the specified resource.
18699    pub fn test_iam_permissions(&self) -> super::builder::target_pools::TestIamPermissions {
18700        super::builder::target_pools::TestIamPermissions::new(self.inner.clone())
18701    }
18702
18703    /// Retrieves the specified region-specific Operations resource.
18704    pub fn get_operation(&self) -> super::builder::target_pools::GetOperation {
18705        super::builder::target_pools::GetOperation::new(self.inner.clone())
18706    }
18707}
18708
18709/// Implements a client for the Google Compute Engine API.
18710///
18711/// # Example
18712/// ```
18713/// # use google_cloud_compute_v1::client::TargetSslProxies;
18714/// async fn sample(
18715/// ) -> anyhow::Result<()> {
18716///     let client = TargetSslProxies::builder().build().await?;
18717///     // use `client` to make requests to the Google Compute Engine API.
18718///     Ok(())
18719/// }
18720/// ```
18721///
18722/// # Service Description
18723///
18724/// Service for the `targetSslProxies` resource.
18725///
18726/// # Configuration
18727///
18728/// To configure `TargetSslProxies` use the `with_*` methods in the type returned
18729/// by [builder()][TargetSslProxies::builder]. The default configuration should
18730/// work for most applications. Common configuration changes include
18731///
18732/// * [with_endpoint()]: by default this client uses the global default endpoint
18733///   (`https://compute.googleapis.com`). Applications using regional
18734///   endpoints or running in restricted networks (e.g. a network configured
18735//    with [Private Google Access with VPC Service Controls]) may want to
18736///   override this default.
18737/// * [with_credentials()]: by default this client uses
18738///   [Application Default Credentials]. Applications using custom
18739///   authentication may need to override this default.
18740///
18741/// [with_endpoint()]: super::builder::target_ssl_proxies::ClientBuilder::with_endpoint
18742/// [with_credentials()]: super::builder::target_ssl_proxies::ClientBuilder::with_credentials
18743/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18744/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18745///
18746/// # Pooling and Cloning
18747///
18748/// `TargetSslProxies` holds a connection pool internally, it is advised to
18749/// create one and reuse it. You do not need to wrap `TargetSslProxies` in
18750/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18751/// already uses an `Arc` internally.
18752#[cfg(feature = "target-ssl-proxies")]
18753#[cfg_attr(docsrs, doc(cfg(feature = "target-ssl-proxies")))]
18754#[derive(Clone, Debug)]
18755pub struct TargetSslProxies {
18756    inner: std::sync::Arc<dyn super::stub::dynamic::TargetSslProxies>,
18757}
18758
18759#[cfg(feature = "target-ssl-proxies")]
18760impl TargetSslProxies {
18761    /// Returns a builder for [TargetSslProxies].
18762    ///
18763    /// ```
18764    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18765    /// # use google_cloud_compute_v1::client::TargetSslProxies;
18766    /// let client = TargetSslProxies::builder().build().await?;
18767    /// # Ok(()) }
18768    /// ```
18769    pub fn builder() -> super::builder::target_ssl_proxies::ClientBuilder {
18770        crate::new_client_builder(super::builder::target_ssl_proxies::client::Factory)
18771    }
18772
18773    /// Creates a new client from the provided stub.
18774    ///
18775    /// The most common case for calling this function is in tests mocking the
18776    /// client's behavior.
18777    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
18778    where
18779        T: super::stub::TargetSslProxies + 'static,
18780    {
18781        Self { inner: stub.into() }
18782    }
18783
18784    pub(crate) async fn new(
18785        config: gaxi::options::ClientConfig,
18786    ) -> crate::ClientBuilderResult<Self> {
18787        let inner = Self::build_inner(config).await?;
18788        Ok(Self { inner })
18789    }
18790
18791    async fn build_inner(
18792        conf: gaxi::options::ClientConfig,
18793    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetSslProxies>>
18794    {
18795        if gaxi::options::tracing_enabled(&conf) {
18796            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18797        }
18798        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18799    }
18800
18801    async fn build_transport(
18802        conf: gaxi::options::ClientConfig,
18803    ) -> crate::ClientBuilderResult<impl super::stub::TargetSslProxies> {
18804        super::transport::TargetSslProxies::new(conf).await
18805    }
18806
18807    async fn build_with_tracing(
18808        conf: gaxi::options::ClientConfig,
18809    ) -> crate::ClientBuilderResult<impl super::stub::TargetSslProxies> {
18810        Self::build_transport(conf)
18811            .await
18812            .map(super::tracing::TargetSslProxies::new)
18813    }
18814
18815    /// Deletes the specified TargetSslProxy resource.
18816    pub fn delete(&self) -> super::builder::target_ssl_proxies::Delete {
18817        super::builder::target_ssl_proxies::Delete::new(self.inner.clone())
18818    }
18819
18820    /// Returns the specified TargetSslProxy resource.
18821    pub fn get(&self) -> super::builder::target_ssl_proxies::Get {
18822        super::builder::target_ssl_proxies::Get::new(self.inner.clone())
18823    }
18824
18825    /// Creates a TargetSslProxy resource in the specified project using
18826    /// the data included in the request.
18827    pub fn insert(&self) -> super::builder::target_ssl_proxies::Insert {
18828        super::builder::target_ssl_proxies::Insert::new(self.inner.clone())
18829    }
18830
18831    /// Retrieves the list of TargetSslProxy resources
18832    /// available to the specified project.
18833    pub fn list(&self) -> super::builder::target_ssl_proxies::List {
18834        super::builder::target_ssl_proxies::List::new(self.inner.clone())
18835    }
18836
18837    /// Changes the BackendService for TargetSslProxy.
18838    pub fn set_backend_service(&self) -> super::builder::target_ssl_proxies::SetBackendService {
18839        super::builder::target_ssl_proxies::SetBackendService::new(self.inner.clone())
18840    }
18841
18842    /// Changes the Certificate Map for TargetSslProxy.
18843    pub fn set_certificate_map(&self) -> super::builder::target_ssl_proxies::SetCertificateMap {
18844        super::builder::target_ssl_proxies::SetCertificateMap::new(self.inner.clone())
18845    }
18846
18847    /// Changes the ProxyHeaderType for TargetSslProxy.
18848    pub fn set_proxy_header(&self) -> super::builder::target_ssl_proxies::SetProxyHeader {
18849        super::builder::target_ssl_proxies::SetProxyHeader::new(self.inner.clone())
18850    }
18851
18852    /// Changes SslCertificates for TargetSslProxy.
18853    pub fn set_ssl_certificates(&self) -> super::builder::target_ssl_proxies::SetSslCertificates {
18854        super::builder::target_ssl_proxies::SetSslCertificates::new(self.inner.clone())
18855    }
18856
18857    /// Sets the SSL policy for TargetSslProxy. The SSL policy specifies the
18858    /// server-side support for SSL features. This affects connections between
18859    /// clients and the load balancer. They do not affect the
18860    /// connection between the load balancer and the backends.
18861    pub fn set_ssl_policy(&self) -> super::builder::target_ssl_proxies::SetSslPolicy {
18862        super::builder::target_ssl_proxies::SetSslPolicy::new(self.inner.clone())
18863    }
18864
18865    /// Returns permissions that a caller has on the specified resource.
18866    pub fn test_iam_permissions(&self) -> super::builder::target_ssl_proxies::TestIamPermissions {
18867        super::builder::target_ssl_proxies::TestIamPermissions::new(self.inner.clone())
18868    }
18869
18870    /// Retrieves the specified Operations resource.
18871    pub fn get_operation(&self) -> super::builder::target_ssl_proxies::GetOperation {
18872        super::builder::target_ssl_proxies::GetOperation::new(self.inner.clone())
18873    }
18874}
18875
18876/// Implements a client for the Google Compute Engine API.
18877///
18878/// # Example
18879/// ```
18880/// # use google_cloud_compute_v1::client::TargetTcpProxies;
18881/// async fn sample(
18882/// ) -> anyhow::Result<()> {
18883///     let client = TargetTcpProxies::builder().build().await?;
18884///     // use `client` to make requests to the Google Compute Engine API.
18885///     Ok(())
18886/// }
18887/// ```
18888///
18889/// # Service Description
18890///
18891/// Service for the `targetTcpProxies` resource.
18892///
18893/// # Configuration
18894///
18895/// To configure `TargetTcpProxies` use the `with_*` methods in the type returned
18896/// by [builder()][TargetTcpProxies::builder]. The default configuration should
18897/// work for most applications. Common configuration changes include
18898///
18899/// * [with_endpoint()]: by default this client uses the global default endpoint
18900///   (`https://compute.googleapis.com`). Applications using regional
18901///   endpoints or running in restricted networks (e.g. a network configured
18902//    with [Private Google Access with VPC Service Controls]) may want to
18903///   override this default.
18904/// * [with_credentials()]: by default this client uses
18905///   [Application Default Credentials]. Applications using custom
18906///   authentication may need to override this default.
18907///
18908/// [with_endpoint()]: super::builder::target_tcp_proxies::ClientBuilder::with_endpoint
18909/// [with_credentials()]: super::builder::target_tcp_proxies::ClientBuilder::with_credentials
18910/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18911/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18912///
18913/// # Pooling and Cloning
18914///
18915/// `TargetTcpProxies` holds a connection pool internally, it is advised to
18916/// create one and reuse it. You do not need to wrap `TargetTcpProxies` in
18917/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18918/// already uses an `Arc` internally.
18919#[cfg(feature = "target-tcp-proxies")]
18920#[cfg_attr(docsrs, doc(cfg(feature = "target-tcp-proxies")))]
18921#[derive(Clone, Debug)]
18922pub struct TargetTcpProxies {
18923    inner: std::sync::Arc<dyn super::stub::dynamic::TargetTcpProxies>,
18924}
18925
18926#[cfg(feature = "target-tcp-proxies")]
18927impl TargetTcpProxies {
18928    /// Returns a builder for [TargetTcpProxies].
18929    ///
18930    /// ```
18931    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18932    /// # use google_cloud_compute_v1::client::TargetTcpProxies;
18933    /// let client = TargetTcpProxies::builder().build().await?;
18934    /// # Ok(()) }
18935    /// ```
18936    pub fn builder() -> super::builder::target_tcp_proxies::ClientBuilder {
18937        crate::new_client_builder(super::builder::target_tcp_proxies::client::Factory)
18938    }
18939
18940    /// Creates a new client from the provided stub.
18941    ///
18942    /// The most common case for calling this function is in tests mocking the
18943    /// client's behavior.
18944    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
18945    where
18946        T: super::stub::TargetTcpProxies + 'static,
18947    {
18948        Self { inner: stub.into() }
18949    }
18950
18951    pub(crate) async fn new(
18952        config: gaxi::options::ClientConfig,
18953    ) -> crate::ClientBuilderResult<Self> {
18954        let inner = Self::build_inner(config).await?;
18955        Ok(Self { inner })
18956    }
18957
18958    async fn build_inner(
18959        conf: gaxi::options::ClientConfig,
18960    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetTcpProxies>>
18961    {
18962        if gaxi::options::tracing_enabled(&conf) {
18963            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18964        }
18965        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18966    }
18967
18968    async fn build_transport(
18969        conf: gaxi::options::ClientConfig,
18970    ) -> crate::ClientBuilderResult<impl super::stub::TargetTcpProxies> {
18971        super::transport::TargetTcpProxies::new(conf).await
18972    }
18973
18974    async fn build_with_tracing(
18975        conf: gaxi::options::ClientConfig,
18976    ) -> crate::ClientBuilderResult<impl super::stub::TargetTcpProxies> {
18977        Self::build_transport(conf)
18978            .await
18979            .map(super::tracing::TargetTcpProxies::new)
18980    }
18981
18982    /// Retrieves the list of all TargetTcpProxy resources, regional and global,
18983    /// available to the specified project.
18984    ///
18985    /// To prevent failure, Google recommends that you set the
18986    /// `returnPartialSuccess` parameter to `true`.
18987    pub fn aggregated_list(&self) -> super::builder::target_tcp_proxies::AggregatedList {
18988        super::builder::target_tcp_proxies::AggregatedList::new(self.inner.clone())
18989    }
18990
18991    /// Deletes the specified TargetTcpProxy resource.
18992    pub fn delete(&self) -> super::builder::target_tcp_proxies::Delete {
18993        super::builder::target_tcp_proxies::Delete::new(self.inner.clone())
18994    }
18995
18996    /// Returns the specified TargetTcpProxy resource.
18997    pub fn get(&self) -> super::builder::target_tcp_proxies::Get {
18998        super::builder::target_tcp_proxies::Get::new(self.inner.clone())
18999    }
19000
19001    /// Creates a TargetTcpProxy resource in the specified project using
19002    /// the data included in the request.
19003    pub fn insert(&self) -> super::builder::target_tcp_proxies::Insert {
19004        super::builder::target_tcp_proxies::Insert::new(self.inner.clone())
19005    }
19006
19007    /// Retrieves the list of TargetTcpProxy resources
19008    /// available to the specified project.
19009    pub fn list(&self) -> super::builder::target_tcp_proxies::List {
19010        super::builder::target_tcp_proxies::List::new(self.inner.clone())
19011    }
19012
19013    /// Changes the BackendService for TargetTcpProxy.
19014    pub fn set_backend_service(&self) -> super::builder::target_tcp_proxies::SetBackendService {
19015        super::builder::target_tcp_proxies::SetBackendService::new(self.inner.clone())
19016    }
19017
19018    /// Changes the ProxyHeaderType for TargetTcpProxy.
19019    pub fn set_proxy_header(&self) -> super::builder::target_tcp_proxies::SetProxyHeader {
19020        super::builder::target_tcp_proxies::SetProxyHeader::new(self.inner.clone())
19021    }
19022
19023    /// Returns permissions that a caller has on the specified resource.
19024    pub fn test_iam_permissions(&self) -> super::builder::target_tcp_proxies::TestIamPermissions {
19025        super::builder::target_tcp_proxies::TestIamPermissions::new(self.inner.clone())
19026    }
19027
19028    /// Retrieves the specified Operations resource.
19029    pub fn get_operation(&self) -> super::builder::target_tcp_proxies::GetOperation {
19030        super::builder::target_tcp_proxies::GetOperation::new(self.inner.clone())
19031    }
19032}
19033
19034/// Implements a client for the Google Compute Engine API.
19035///
19036/// # Example
19037/// ```
19038/// # use google_cloud_compute_v1::client::TargetVpnGateways;
19039/// async fn sample(
19040/// ) -> anyhow::Result<()> {
19041///     let client = TargetVpnGateways::builder().build().await?;
19042///     // use `client` to make requests to the Google Compute Engine API.
19043///     Ok(())
19044/// }
19045/// ```
19046///
19047/// # Service Description
19048///
19049/// Service for the `targetVpnGateways` resource.
19050///
19051/// # Configuration
19052///
19053/// To configure `TargetVpnGateways` use the `with_*` methods in the type returned
19054/// by [builder()][TargetVpnGateways::builder]. The default configuration should
19055/// work for most applications. Common configuration changes include
19056///
19057/// * [with_endpoint()]: by default this client uses the global default endpoint
19058///   (`https://compute.googleapis.com`). Applications using regional
19059///   endpoints or running in restricted networks (e.g. a network configured
19060//    with [Private Google Access with VPC Service Controls]) may want to
19061///   override this default.
19062/// * [with_credentials()]: by default this client uses
19063///   [Application Default Credentials]. Applications using custom
19064///   authentication may need to override this default.
19065///
19066/// [with_endpoint()]: super::builder::target_vpn_gateways::ClientBuilder::with_endpoint
19067/// [with_credentials()]: super::builder::target_vpn_gateways::ClientBuilder::with_credentials
19068/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
19069/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
19070///
19071/// # Pooling and Cloning
19072///
19073/// `TargetVpnGateways` holds a connection pool internally, it is advised to
19074/// create one and reuse it. You do not need to wrap `TargetVpnGateways` in
19075/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
19076/// already uses an `Arc` internally.
19077#[cfg(feature = "target-vpn-gateways")]
19078#[cfg_attr(docsrs, doc(cfg(feature = "target-vpn-gateways")))]
19079#[derive(Clone, Debug)]
19080pub struct TargetVpnGateways {
19081    inner: std::sync::Arc<dyn super::stub::dynamic::TargetVpnGateways>,
19082}
19083
19084#[cfg(feature = "target-vpn-gateways")]
19085impl TargetVpnGateways {
19086    /// Returns a builder for [TargetVpnGateways].
19087    ///
19088    /// ```
19089    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19090    /// # use google_cloud_compute_v1::client::TargetVpnGateways;
19091    /// let client = TargetVpnGateways::builder().build().await?;
19092    /// # Ok(()) }
19093    /// ```
19094    pub fn builder() -> super::builder::target_vpn_gateways::ClientBuilder {
19095        crate::new_client_builder(super::builder::target_vpn_gateways::client::Factory)
19096    }
19097
19098    /// Creates a new client from the provided stub.
19099    ///
19100    /// The most common case for calling this function is in tests mocking the
19101    /// client's behavior.
19102    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
19103    where
19104        T: super::stub::TargetVpnGateways + 'static,
19105    {
19106        Self { inner: stub.into() }
19107    }
19108
19109    pub(crate) async fn new(
19110        config: gaxi::options::ClientConfig,
19111    ) -> crate::ClientBuilderResult<Self> {
19112        let inner = Self::build_inner(config).await?;
19113        Ok(Self { inner })
19114    }
19115
19116    async fn build_inner(
19117        conf: gaxi::options::ClientConfig,
19118    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetVpnGateways>>
19119    {
19120        if gaxi::options::tracing_enabled(&conf) {
19121            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
19122        }
19123        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
19124    }
19125
19126    async fn build_transport(
19127        conf: gaxi::options::ClientConfig,
19128    ) -> crate::ClientBuilderResult<impl super::stub::TargetVpnGateways> {
19129        super::transport::TargetVpnGateways::new(conf).await
19130    }
19131
19132    async fn build_with_tracing(
19133        conf: gaxi::options::ClientConfig,
19134    ) -> crate::ClientBuilderResult<impl super::stub::TargetVpnGateways> {
19135        Self::build_transport(conf)
19136            .await
19137            .map(super::tracing::TargetVpnGateways::new)
19138    }
19139
19140    /// Retrieves an aggregated list of target VPN gateways.
19141    ///
19142    /// To prevent failure, Google recommends that you set the
19143    /// `returnPartialSuccess` parameter to `true`.
19144    pub fn aggregated_list(&self) -> super::builder::target_vpn_gateways::AggregatedList {
19145        super::builder::target_vpn_gateways::AggregatedList::new(self.inner.clone())
19146    }
19147
19148    /// Deletes the specified target VPN gateway.
19149    pub fn delete(&self) -> super::builder::target_vpn_gateways::Delete {
19150        super::builder::target_vpn_gateways::Delete::new(self.inner.clone())
19151    }
19152
19153    /// Returns the specified target VPN gateway.
19154    pub fn get(&self) -> super::builder::target_vpn_gateways::Get {
19155        super::builder::target_vpn_gateways::Get::new(self.inner.clone())
19156    }
19157
19158    /// Creates a target VPN gateway in the specified project and region using
19159    /// the data included in the request.
19160    pub fn insert(&self) -> super::builder::target_vpn_gateways::Insert {
19161        super::builder::target_vpn_gateways::Insert::new(self.inner.clone())
19162    }
19163
19164    /// Retrieves a list of target VPN gateways available to the specified
19165    /// project and region.
19166    pub fn list(&self) -> super::builder::target_vpn_gateways::List {
19167        super::builder::target_vpn_gateways::List::new(self.inner.clone())
19168    }
19169
19170    /// Sets the labels on a TargetVpnGateway. To learn more about labels, read theLabeling
19171    /// Resources documentation.
19172    pub fn set_labels(&self) -> super::builder::target_vpn_gateways::SetLabels {
19173        super::builder::target_vpn_gateways::SetLabels::new(self.inner.clone())
19174    }
19175
19176    /// Retrieves the specified region-specific Operations resource.
19177    pub fn get_operation(&self) -> super::builder::target_vpn_gateways::GetOperation {
19178        super::builder::target_vpn_gateways::GetOperation::new(self.inner.clone())
19179    }
19180}
19181
19182/// Implements a client for the Google Compute Engine API.
19183///
19184/// # Example
19185/// ```
19186/// # use google_cloud_compute_v1::client::UrlMaps;
19187/// async fn sample(
19188/// ) -> anyhow::Result<()> {
19189///     let client = UrlMaps::builder().build().await?;
19190///     // use `client` to make requests to the Google Compute Engine API.
19191///     Ok(())
19192/// }
19193/// ```
19194///
19195/// # Service Description
19196///
19197/// Service for the `urlMaps` resource.
19198///
19199/// # Configuration
19200///
19201/// To configure `UrlMaps` use the `with_*` methods in the type returned
19202/// by [builder()][UrlMaps::builder]. The default configuration should
19203/// work for most applications. Common configuration changes include
19204///
19205/// * [with_endpoint()]: by default this client uses the global default endpoint
19206///   (`https://compute.googleapis.com`). Applications using regional
19207///   endpoints or running in restricted networks (e.g. a network configured
19208//    with [Private Google Access with VPC Service Controls]) may want to
19209///   override this default.
19210/// * [with_credentials()]: by default this client uses
19211///   [Application Default Credentials]. Applications using custom
19212///   authentication may need to override this default.
19213///
19214/// [with_endpoint()]: super::builder::url_maps::ClientBuilder::with_endpoint
19215/// [with_credentials()]: super::builder::url_maps::ClientBuilder::with_credentials
19216/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
19217/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
19218///
19219/// # Pooling and Cloning
19220///
19221/// `UrlMaps` holds a connection pool internally, it is advised to
19222/// create one and reuse it. You do not need to wrap `UrlMaps` in
19223/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
19224/// already uses an `Arc` internally.
19225#[cfg(feature = "url-maps")]
19226#[cfg_attr(docsrs, doc(cfg(feature = "url-maps")))]
19227#[derive(Clone, Debug)]
19228pub struct UrlMaps {
19229    inner: std::sync::Arc<dyn super::stub::dynamic::UrlMaps>,
19230}
19231
19232#[cfg(feature = "url-maps")]
19233impl UrlMaps {
19234    /// Returns a builder for [UrlMaps].
19235    ///
19236    /// ```
19237    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19238    /// # use google_cloud_compute_v1::client::UrlMaps;
19239    /// let client = UrlMaps::builder().build().await?;
19240    /// # Ok(()) }
19241    /// ```
19242    pub fn builder() -> super::builder::url_maps::ClientBuilder {
19243        crate::new_client_builder(super::builder::url_maps::client::Factory)
19244    }
19245
19246    /// Creates a new client from the provided stub.
19247    ///
19248    /// The most common case for calling this function is in tests mocking the
19249    /// client's behavior.
19250    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
19251    where
19252        T: super::stub::UrlMaps + 'static,
19253    {
19254        Self { inner: stub.into() }
19255    }
19256
19257    pub(crate) async fn new(
19258        config: gaxi::options::ClientConfig,
19259    ) -> crate::ClientBuilderResult<Self> {
19260        let inner = Self::build_inner(config).await?;
19261        Ok(Self { inner })
19262    }
19263
19264    async fn build_inner(
19265        conf: gaxi::options::ClientConfig,
19266    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::UrlMaps>> {
19267        if gaxi::options::tracing_enabled(&conf) {
19268            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
19269        }
19270        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
19271    }
19272
19273    async fn build_transport(
19274        conf: gaxi::options::ClientConfig,
19275    ) -> crate::ClientBuilderResult<impl super::stub::UrlMaps> {
19276        super::transport::UrlMaps::new(conf).await
19277    }
19278
19279    async fn build_with_tracing(
19280        conf: gaxi::options::ClientConfig,
19281    ) -> crate::ClientBuilderResult<impl super::stub::UrlMaps> {
19282        Self::build_transport(conf)
19283            .await
19284            .map(super::tracing::UrlMaps::new)
19285    }
19286
19287    /// Retrieves the list of all UrlMap resources, regional and global,
19288    /// available to the specified project.
19289    ///
19290    /// To prevent failure, Google recommends that you set the
19291    /// `returnPartialSuccess` parameter to `true`.
19292    pub fn aggregated_list(&self) -> super::builder::url_maps::AggregatedList {
19293        super::builder::url_maps::AggregatedList::new(self.inner.clone())
19294    }
19295
19296    /// Deletes the specified UrlMap resource.
19297    pub fn delete(&self) -> super::builder::url_maps::Delete {
19298        super::builder::url_maps::Delete::new(self.inner.clone())
19299    }
19300
19301    /// Returns the specified UrlMap resource.
19302    pub fn get(&self) -> super::builder::url_maps::Get {
19303        super::builder::url_maps::Get::new(self.inner.clone())
19304    }
19305
19306    /// Creates a UrlMap resource in the specified project using
19307    /// the data included in the request.
19308    pub fn insert(&self) -> super::builder::url_maps::Insert {
19309        super::builder::url_maps::Insert::new(self.inner.clone())
19310    }
19311
19312    /// Initiates a cache invalidation operation, invalidating the specified path,
19313    /// scoped to the specified UrlMap.
19314    ///
19315    /// For more information, see [Invalidating cached
19316    /// content](/cdn/docs/invalidating-cached-content).
19317    pub fn invalidate_cache(&self) -> super::builder::url_maps::InvalidateCache {
19318        super::builder::url_maps::InvalidateCache::new(self.inner.clone())
19319    }
19320
19321    /// Retrieves the list of UrlMap resources available to the specified
19322    /// project.
19323    pub fn list(&self) -> super::builder::url_maps::List {
19324        super::builder::url_maps::List::new(self.inner.clone())
19325    }
19326
19327    /// Patches the specified UrlMap resource with the data included in the
19328    /// request. This method supportsPATCH
19329    /// semantics and uses theJSON merge
19330    /// patch format and processing rules.
19331    pub fn patch(&self) -> super::builder::url_maps::Patch {
19332        super::builder::url_maps::Patch::new(self.inner.clone())
19333    }
19334
19335    /// Returns permissions that a caller has on the specified resource.
19336    pub fn test_iam_permissions(&self) -> super::builder::url_maps::TestIamPermissions {
19337        super::builder::url_maps::TestIamPermissions::new(self.inner.clone())
19338    }
19339
19340    /// Updates the specified UrlMap resource with the data included in the
19341    /// request.
19342    pub fn update(&self) -> super::builder::url_maps::Update {
19343        super::builder::url_maps::Update::new(self.inner.clone())
19344    }
19345
19346    /// Runs static validation for the UrlMap. In particular, the tests of the
19347    /// provided UrlMap will be run. Calling this method does NOT create the
19348    /// UrlMap.
19349    pub fn validate(&self) -> super::builder::url_maps::Validate {
19350        super::builder::url_maps::Validate::new(self.inner.clone())
19351    }
19352
19353    /// Retrieves the specified Operations resource.
19354    pub fn get_operation(&self) -> super::builder::url_maps::GetOperation {
19355        super::builder::url_maps::GetOperation::new(self.inner.clone())
19356    }
19357}
19358
19359/// Implements a client for the Google Compute Engine API.
19360///
19361/// # Example
19362/// ```
19363/// # use google_cloud_compute_v1::client::VpnGateways;
19364/// async fn sample(
19365/// ) -> anyhow::Result<()> {
19366///     let client = VpnGateways::builder().build().await?;
19367///     // use `client` to make requests to the Google Compute Engine API.
19368///     Ok(())
19369/// }
19370/// ```
19371///
19372/// # Service Description
19373///
19374/// Service for the `vpnGateways` resource.
19375///
19376/// # Configuration
19377///
19378/// To configure `VpnGateways` use the `with_*` methods in the type returned
19379/// by [builder()][VpnGateways::builder]. The default configuration should
19380/// work for most applications. Common configuration changes include
19381///
19382/// * [with_endpoint()]: by default this client uses the global default endpoint
19383///   (`https://compute.googleapis.com`). Applications using regional
19384///   endpoints or running in restricted networks (e.g. a network configured
19385//    with [Private Google Access with VPC Service Controls]) may want to
19386///   override this default.
19387/// * [with_credentials()]: by default this client uses
19388///   [Application Default Credentials]. Applications using custom
19389///   authentication may need to override this default.
19390///
19391/// [with_endpoint()]: super::builder::vpn_gateways::ClientBuilder::with_endpoint
19392/// [with_credentials()]: super::builder::vpn_gateways::ClientBuilder::with_credentials
19393/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
19394/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
19395///
19396/// # Pooling and Cloning
19397///
19398/// `VpnGateways` holds a connection pool internally, it is advised to
19399/// create one and reuse it. You do not need to wrap `VpnGateways` in
19400/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
19401/// already uses an `Arc` internally.
19402#[cfg(feature = "vpn-gateways")]
19403#[cfg_attr(docsrs, doc(cfg(feature = "vpn-gateways")))]
19404#[derive(Clone, Debug)]
19405pub struct VpnGateways {
19406    inner: std::sync::Arc<dyn super::stub::dynamic::VpnGateways>,
19407}
19408
19409#[cfg(feature = "vpn-gateways")]
19410impl VpnGateways {
19411    /// Returns a builder for [VpnGateways].
19412    ///
19413    /// ```
19414    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19415    /// # use google_cloud_compute_v1::client::VpnGateways;
19416    /// let client = VpnGateways::builder().build().await?;
19417    /// # Ok(()) }
19418    /// ```
19419    pub fn builder() -> super::builder::vpn_gateways::ClientBuilder {
19420        crate::new_client_builder(super::builder::vpn_gateways::client::Factory)
19421    }
19422
19423    /// Creates a new client from the provided stub.
19424    ///
19425    /// The most common case for calling this function is in tests mocking the
19426    /// client's behavior.
19427    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
19428    where
19429        T: super::stub::VpnGateways + 'static,
19430    {
19431        Self { inner: stub.into() }
19432    }
19433
19434    pub(crate) async fn new(
19435        config: gaxi::options::ClientConfig,
19436    ) -> crate::ClientBuilderResult<Self> {
19437        let inner = Self::build_inner(config).await?;
19438        Ok(Self { inner })
19439    }
19440
19441    async fn build_inner(
19442        conf: gaxi::options::ClientConfig,
19443    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::VpnGateways>> {
19444        if gaxi::options::tracing_enabled(&conf) {
19445            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
19446        }
19447        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
19448    }
19449
19450    async fn build_transport(
19451        conf: gaxi::options::ClientConfig,
19452    ) -> crate::ClientBuilderResult<impl super::stub::VpnGateways> {
19453        super::transport::VpnGateways::new(conf).await
19454    }
19455
19456    async fn build_with_tracing(
19457        conf: gaxi::options::ClientConfig,
19458    ) -> crate::ClientBuilderResult<impl super::stub::VpnGateways> {
19459        Self::build_transport(conf)
19460            .await
19461            .map(super::tracing::VpnGateways::new)
19462    }
19463
19464    /// Retrieves an aggregated list of VPN gateways.
19465    ///
19466    /// To prevent failure, Google recommends that you set the
19467    /// `returnPartialSuccess` parameter to `true`.
19468    pub fn aggregated_list(&self) -> super::builder::vpn_gateways::AggregatedList {
19469        super::builder::vpn_gateways::AggregatedList::new(self.inner.clone())
19470    }
19471
19472    /// Deletes the specified VPN gateway.
19473    pub fn delete(&self) -> super::builder::vpn_gateways::Delete {
19474        super::builder::vpn_gateways::Delete::new(self.inner.clone())
19475    }
19476
19477    /// Returns the specified VPN gateway.
19478    pub fn get(&self) -> super::builder::vpn_gateways::Get {
19479        super::builder::vpn_gateways::Get::new(self.inner.clone())
19480    }
19481
19482    /// Returns the status for the specified VPN gateway.
19483    pub fn get_status(&self) -> super::builder::vpn_gateways::GetStatus {
19484        super::builder::vpn_gateways::GetStatus::new(self.inner.clone())
19485    }
19486
19487    /// Creates a VPN gateway in the specified project and region using
19488    /// the data included in the request.
19489    pub fn insert(&self) -> super::builder::vpn_gateways::Insert {
19490        super::builder::vpn_gateways::Insert::new(self.inner.clone())
19491    }
19492
19493    /// Retrieves a list of VPN gateways available to the specified
19494    /// project and region.
19495    pub fn list(&self) -> super::builder::vpn_gateways::List {
19496        super::builder::vpn_gateways::List::new(self.inner.clone())
19497    }
19498
19499    /// Sets the labels on a VpnGateway. To learn more about labels, read theLabeling
19500    /// Resources documentation.
19501    pub fn set_labels(&self) -> super::builder::vpn_gateways::SetLabels {
19502        super::builder::vpn_gateways::SetLabels::new(self.inner.clone())
19503    }
19504
19505    /// Returns permissions that a caller has on the specified resource.
19506    pub fn test_iam_permissions(&self) -> super::builder::vpn_gateways::TestIamPermissions {
19507        super::builder::vpn_gateways::TestIamPermissions::new(self.inner.clone())
19508    }
19509
19510    /// Retrieves the specified region-specific Operations resource.
19511    pub fn get_operation(&self) -> super::builder::vpn_gateways::GetOperation {
19512        super::builder::vpn_gateways::GetOperation::new(self.inner.clone())
19513    }
19514}
19515
19516/// Implements a client for the Google Compute Engine API.
19517///
19518/// # Example
19519/// ```
19520/// # use google_cloud_compute_v1::client::VpnTunnels;
19521/// async fn sample(
19522/// ) -> anyhow::Result<()> {
19523///     let client = VpnTunnels::builder().build().await?;
19524///     // use `client` to make requests to the Google Compute Engine API.
19525///     Ok(())
19526/// }
19527/// ```
19528///
19529/// # Service Description
19530///
19531/// Service for the `vpnTunnels` resource.
19532///
19533/// # Configuration
19534///
19535/// To configure `VpnTunnels` use the `with_*` methods in the type returned
19536/// by [builder()][VpnTunnels::builder]. The default configuration should
19537/// work for most applications. Common configuration changes include
19538///
19539/// * [with_endpoint()]: by default this client uses the global default endpoint
19540///   (`https://compute.googleapis.com`). Applications using regional
19541///   endpoints or running in restricted networks (e.g. a network configured
19542//    with [Private Google Access with VPC Service Controls]) may want to
19543///   override this default.
19544/// * [with_credentials()]: by default this client uses
19545///   [Application Default Credentials]. Applications using custom
19546///   authentication may need to override this default.
19547///
19548/// [with_endpoint()]: super::builder::vpn_tunnels::ClientBuilder::with_endpoint
19549/// [with_credentials()]: super::builder::vpn_tunnels::ClientBuilder::with_credentials
19550/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
19551/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
19552///
19553/// # Pooling and Cloning
19554///
19555/// `VpnTunnels` holds a connection pool internally, it is advised to
19556/// create one and reuse it. You do not need to wrap `VpnTunnels` in
19557/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
19558/// already uses an `Arc` internally.
19559#[cfg(feature = "vpn-tunnels")]
19560#[cfg_attr(docsrs, doc(cfg(feature = "vpn-tunnels")))]
19561#[derive(Clone, Debug)]
19562pub struct VpnTunnels {
19563    inner: std::sync::Arc<dyn super::stub::dynamic::VpnTunnels>,
19564}
19565
19566#[cfg(feature = "vpn-tunnels")]
19567impl VpnTunnels {
19568    /// Returns a builder for [VpnTunnels].
19569    ///
19570    /// ```
19571    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19572    /// # use google_cloud_compute_v1::client::VpnTunnels;
19573    /// let client = VpnTunnels::builder().build().await?;
19574    /// # Ok(()) }
19575    /// ```
19576    pub fn builder() -> super::builder::vpn_tunnels::ClientBuilder {
19577        crate::new_client_builder(super::builder::vpn_tunnels::client::Factory)
19578    }
19579
19580    /// Creates a new client from the provided stub.
19581    ///
19582    /// The most common case for calling this function is in tests mocking the
19583    /// client's behavior.
19584    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
19585    where
19586        T: super::stub::VpnTunnels + 'static,
19587    {
19588        Self { inner: stub.into() }
19589    }
19590
19591    pub(crate) async fn new(
19592        config: gaxi::options::ClientConfig,
19593    ) -> crate::ClientBuilderResult<Self> {
19594        let inner = Self::build_inner(config).await?;
19595        Ok(Self { inner })
19596    }
19597
19598    async fn build_inner(
19599        conf: gaxi::options::ClientConfig,
19600    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::VpnTunnels>> {
19601        if gaxi::options::tracing_enabled(&conf) {
19602            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
19603        }
19604        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
19605    }
19606
19607    async fn build_transport(
19608        conf: gaxi::options::ClientConfig,
19609    ) -> crate::ClientBuilderResult<impl super::stub::VpnTunnels> {
19610        super::transport::VpnTunnels::new(conf).await
19611    }
19612
19613    async fn build_with_tracing(
19614        conf: gaxi::options::ClientConfig,
19615    ) -> crate::ClientBuilderResult<impl super::stub::VpnTunnels> {
19616        Self::build_transport(conf)
19617            .await
19618            .map(super::tracing::VpnTunnels::new)
19619    }
19620
19621    /// Retrieves an aggregated list of VPN tunnels.
19622    ///
19623    /// To prevent failure, Google recommends that you set the
19624    /// `returnPartialSuccess` parameter to `true`.
19625    pub fn aggregated_list(&self) -> super::builder::vpn_tunnels::AggregatedList {
19626        super::builder::vpn_tunnels::AggregatedList::new(self.inner.clone())
19627    }
19628
19629    /// Deletes the specified VpnTunnel resource.
19630    pub fn delete(&self) -> super::builder::vpn_tunnels::Delete {
19631        super::builder::vpn_tunnels::Delete::new(self.inner.clone())
19632    }
19633
19634    /// Returns the specified VpnTunnel resource.
19635    pub fn get(&self) -> super::builder::vpn_tunnels::Get {
19636        super::builder::vpn_tunnels::Get::new(self.inner.clone())
19637    }
19638
19639    /// Creates a VpnTunnel resource in the specified project and region using
19640    /// the data included in the request.
19641    pub fn insert(&self) -> super::builder::vpn_tunnels::Insert {
19642        super::builder::vpn_tunnels::Insert::new(self.inner.clone())
19643    }
19644
19645    /// Retrieves a list of VpnTunnel resources contained in the specified
19646    /// project and region.
19647    pub fn list(&self) -> super::builder::vpn_tunnels::List {
19648        super::builder::vpn_tunnels::List::new(self.inner.clone())
19649    }
19650
19651    /// Sets the labels on a VpnTunnel. To learn more about labels, read theLabeling
19652    /// Resources documentation.
19653    pub fn set_labels(&self) -> super::builder::vpn_tunnels::SetLabels {
19654        super::builder::vpn_tunnels::SetLabels::new(self.inner.clone())
19655    }
19656
19657    /// Retrieves the specified region-specific Operations resource.
19658    pub fn get_operation(&self) -> super::builder::vpn_tunnels::GetOperation {
19659        super::builder::vpn_tunnels::GetOperation::new(self.inner.clone())
19660    }
19661}
19662
19663/// Implements a client for the Google Compute Engine API.
19664///
19665/// # Example
19666/// ```
19667/// # use google_cloud_compute_v1::client::WireGroups;
19668/// async fn sample(
19669/// ) -> anyhow::Result<()> {
19670///     let client = WireGroups::builder().build().await?;
19671///     // use `client` to make requests to the Google Compute Engine API.
19672///     Ok(())
19673/// }
19674/// ```
19675///
19676/// # Service Description
19677///
19678/// Service for the `wireGroups` resource.
19679///
19680/// # Configuration
19681///
19682/// To configure `WireGroups` use the `with_*` methods in the type returned
19683/// by [builder()][WireGroups::builder]. The default configuration should
19684/// work for most applications. Common configuration changes include
19685///
19686/// * [with_endpoint()]: by default this client uses the global default endpoint
19687///   (`https://compute.googleapis.com`). Applications using regional
19688///   endpoints or running in restricted networks (e.g. a network configured
19689//    with [Private Google Access with VPC Service Controls]) may want to
19690///   override this default.
19691/// * [with_credentials()]: by default this client uses
19692///   [Application Default Credentials]. Applications using custom
19693///   authentication may need to override this default.
19694///
19695/// [with_endpoint()]: super::builder::wire_groups::ClientBuilder::with_endpoint
19696/// [with_credentials()]: super::builder::wire_groups::ClientBuilder::with_credentials
19697/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
19698/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
19699///
19700/// # Pooling and Cloning
19701///
19702/// `WireGroups` holds a connection pool internally, it is advised to
19703/// create one and reuse it. You do not need to wrap `WireGroups` in
19704/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
19705/// already uses an `Arc` internally.
19706#[cfg(feature = "wire-groups")]
19707#[cfg_attr(docsrs, doc(cfg(feature = "wire-groups")))]
19708#[derive(Clone, Debug)]
19709pub struct WireGroups {
19710    inner: std::sync::Arc<dyn super::stub::dynamic::WireGroups>,
19711}
19712
19713#[cfg(feature = "wire-groups")]
19714impl WireGroups {
19715    /// Returns a builder for [WireGroups].
19716    ///
19717    /// ```
19718    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19719    /// # use google_cloud_compute_v1::client::WireGroups;
19720    /// let client = WireGroups::builder().build().await?;
19721    /// # Ok(()) }
19722    /// ```
19723    pub fn builder() -> super::builder::wire_groups::ClientBuilder {
19724        crate::new_client_builder(super::builder::wire_groups::client::Factory)
19725    }
19726
19727    /// Creates a new client from the provided stub.
19728    ///
19729    /// The most common case for calling this function is in tests mocking the
19730    /// client's behavior.
19731    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
19732    where
19733        T: super::stub::WireGroups + 'static,
19734    {
19735        Self { inner: stub.into() }
19736    }
19737
19738    pub(crate) async fn new(
19739        config: gaxi::options::ClientConfig,
19740    ) -> crate::ClientBuilderResult<Self> {
19741        let inner = Self::build_inner(config).await?;
19742        Ok(Self { inner })
19743    }
19744
19745    async fn build_inner(
19746        conf: gaxi::options::ClientConfig,
19747    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::WireGroups>> {
19748        if gaxi::options::tracing_enabled(&conf) {
19749            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
19750        }
19751        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
19752    }
19753
19754    async fn build_transport(
19755        conf: gaxi::options::ClientConfig,
19756    ) -> crate::ClientBuilderResult<impl super::stub::WireGroups> {
19757        super::transport::WireGroups::new(conf).await
19758    }
19759
19760    async fn build_with_tracing(
19761        conf: gaxi::options::ClientConfig,
19762    ) -> crate::ClientBuilderResult<impl super::stub::WireGroups> {
19763        Self::build_transport(conf)
19764            .await
19765            .map(super::tracing::WireGroups::new)
19766    }
19767
19768    /// Deletes the specified wire group in the given scope.
19769    pub fn delete(&self) -> super::builder::wire_groups::Delete {
19770        super::builder::wire_groups::Delete::new(self.inner.clone())
19771    }
19772
19773    /// Gets the specified wire group resource in the given scope.
19774    pub fn get(&self) -> super::builder::wire_groups::Get {
19775        super::builder::wire_groups::Get::new(self.inner.clone())
19776    }
19777
19778    /// Creates a wire group in the specified project in the given scope
19779    /// using the parameters that are included in the request.
19780    pub fn insert(&self) -> super::builder::wire_groups::Insert {
19781        super::builder::wire_groups::Insert::new(self.inner.clone())
19782    }
19783
19784    /// Lists the wire groups for a project in the given scope.
19785    pub fn list(&self) -> super::builder::wire_groups::List {
19786        super::builder::wire_groups::List::new(self.inner.clone())
19787    }
19788
19789    /// Updates the specified wire group resource with the data included in the
19790    /// request. This method supportsPATCH
19791    /// semantics and usesJSON merge
19792    /// patch format and processing rules.
19793    pub fn patch(&self) -> super::builder::wire_groups::Patch {
19794        super::builder::wire_groups::Patch::new(self.inner.clone())
19795    }
19796
19797    /// Retrieves the specified Operations resource.
19798    pub fn get_operation(&self) -> super::builder::wire_groups::GetOperation {
19799        super::builder::wire_groups::GetOperation::new(self.inner.clone())
19800    }
19801}
19802
19803/// Implements a client for the Google Compute Engine API.
19804///
19805/// # Example
19806/// ```
19807/// # use google_cloud_compute_v1::client::ZoneOperations;
19808/// async fn sample(
19809/// ) -> anyhow::Result<()> {
19810///     let client = ZoneOperations::builder().build().await?;
19811///     // use `client` to make requests to the Google Compute Engine API.
19812///     Ok(())
19813/// }
19814/// ```
19815///
19816/// # Service Description
19817///
19818/// Service for the `zoneOperations` resource.
19819///
19820/// # Configuration
19821///
19822/// To configure `ZoneOperations` use the `with_*` methods in the type returned
19823/// by [builder()][ZoneOperations::builder]. The default configuration should
19824/// work for most applications. Common configuration changes include
19825///
19826/// * [with_endpoint()]: by default this client uses the global default endpoint
19827///   (`https://compute.googleapis.com`). Applications using regional
19828///   endpoints or running in restricted networks (e.g. a network configured
19829//    with [Private Google Access with VPC Service Controls]) may want to
19830///   override this default.
19831/// * [with_credentials()]: by default this client uses
19832///   [Application Default Credentials]. Applications using custom
19833///   authentication may need to override this default.
19834///
19835/// [with_endpoint()]: super::builder::zone_operations::ClientBuilder::with_endpoint
19836/// [with_credentials()]: super::builder::zone_operations::ClientBuilder::with_credentials
19837/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
19838/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
19839///
19840/// # Pooling and Cloning
19841///
19842/// `ZoneOperations` holds a connection pool internally, it is advised to
19843/// create one and reuse it. You do not need to wrap `ZoneOperations` in
19844/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
19845/// already uses an `Arc` internally.
19846#[cfg(feature = "zone-operations")]
19847#[cfg_attr(docsrs, doc(cfg(feature = "zone-operations")))]
19848#[derive(Clone, Debug)]
19849pub struct ZoneOperations {
19850    inner: std::sync::Arc<dyn super::stub::dynamic::ZoneOperations>,
19851}
19852
19853#[cfg(feature = "zone-operations")]
19854impl ZoneOperations {
19855    /// Returns a builder for [ZoneOperations].
19856    ///
19857    /// ```
19858    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19859    /// # use google_cloud_compute_v1::client::ZoneOperations;
19860    /// let client = ZoneOperations::builder().build().await?;
19861    /// # Ok(()) }
19862    /// ```
19863    pub fn builder() -> super::builder::zone_operations::ClientBuilder {
19864        crate::new_client_builder(super::builder::zone_operations::client::Factory)
19865    }
19866
19867    /// Creates a new client from the provided stub.
19868    ///
19869    /// The most common case for calling this function is in tests mocking the
19870    /// client's behavior.
19871    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
19872    where
19873        T: super::stub::ZoneOperations + 'static,
19874    {
19875        Self { inner: stub.into() }
19876    }
19877
19878    pub(crate) async fn new(
19879        config: gaxi::options::ClientConfig,
19880    ) -> crate::ClientBuilderResult<Self> {
19881        let inner = Self::build_inner(config).await?;
19882        Ok(Self { inner })
19883    }
19884
19885    async fn build_inner(
19886        conf: gaxi::options::ClientConfig,
19887    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ZoneOperations>> {
19888        if gaxi::options::tracing_enabled(&conf) {
19889            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
19890        }
19891        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
19892    }
19893
19894    async fn build_transport(
19895        conf: gaxi::options::ClientConfig,
19896    ) -> crate::ClientBuilderResult<impl super::stub::ZoneOperations> {
19897        super::transport::ZoneOperations::new(conf).await
19898    }
19899
19900    async fn build_with_tracing(
19901        conf: gaxi::options::ClientConfig,
19902    ) -> crate::ClientBuilderResult<impl super::stub::ZoneOperations> {
19903        Self::build_transport(conf)
19904            .await
19905            .map(super::tracing::ZoneOperations::new)
19906    }
19907
19908    /// Deletes the specified zone-specific Operations resource.
19909    pub fn delete(&self) -> super::builder::zone_operations::Delete {
19910        super::builder::zone_operations::Delete::new(self.inner.clone())
19911    }
19912
19913    /// Retrieves the specified zone-specific Operations resource.
19914    pub fn get(&self) -> super::builder::zone_operations::Get {
19915        super::builder::zone_operations::Get::new(self.inner.clone())
19916    }
19917
19918    /// Retrieves a list of Operation resources contained within
19919    /// the specified zone.
19920    pub fn list(&self) -> super::builder::zone_operations::List {
19921        super::builder::zone_operations::List::new(self.inner.clone())
19922    }
19923
19924    /// Waits for the specified Operation resource to return as `DONE`
19925    /// or for the request to approach the 2 minute deadline, and retrieves the
19926    /// specified Operation resource. This method waits for no more than the
19927    /// 2 minutes and then returns the current state of the
19928    /// operation, which might be `DONE` or still in progress.
19929    ///
19930    /// This method is called on a best-effort basis. Specifically:
19931    ///
19932    /// ```norust
19933    /// - In uncommon cases, when the server is overloaded, the request might
19934    /// return before the default deadline is reached, or might return after zero
19935    /// seconds.
19936    /// ```
19937    ///
19938    /// - If the default deadline is reached, there is no guarantee that the
19939    ///   operation is actually done when the method returns. Be prepared to retry
19940    ///   if the operation is not `DONE`.
19941    pub fn wait(&self) -> super::builder::zone_operations::Wait {
19942        super::builder::zone_operations::Wait::new(self.inner.clone())
19943    }
19944}
19945
19946/// Implements a client for the Google Compute Engine API.
19947///
19948/// # Example
19949/// ```
19950/// # use google_cloud_compute_v1::client::ZoneVmExtensionPolicies;
19951/// async fn sample(
19952/// ) -> anyhow::Result<()> {
19953///     let client = ZoneVmExtensionPolicies::builder().build().await?;
19954///     // use `client` to make requests to the Google Compute Engine API.
19955///     Ok(())
19956/// }
19957/// ```
19958///
19959/// # Service Description
19960///
19961/// Service for the `zoneVmExtensionPolicies` resource.
19962///
19963/// # Configuration
19964///
19965/// To configure `ZoneVmExtensionPolicies` use the `with_*` methods in the type returned
19966/// by [builder()][ZoneVmExtensionPolicies::builder]. The default configuration should
19967/// work for most applications. Common configuration changes include
19968///
19969/// * [with_endpoint()]: by default this client uses the global default endpoint
19970///   (`https://compute.googleapis.com`). Applications using regional
19971///   endpoints or running in restricted networks (e.g. a network configured
19972//    with [Private Google Access with VPC Service Controls]) may want to
19973///   override this default.
19974/// * [with_credentials()]: by default this client uses
19975///   [Application Default Credentials]. Applications using custom
19976///   authentication may need to override this default.
19977///
19978/// [with_endpoint()]: super::builder::zone_vm_extension_policies::ClientBuilder::with_endpoint
19979/// [with_credentials()]: super::builder::zone_vm_extension_policies::ClientBuilder::with_credentials
19980/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
19981/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
19982///
19983/// # Pooling and Cloning
19984///
19985/// `ZoneVmExtensionPolicies` holds a connection pool internally, it is advised to
19986/// create one and reuse it. You do not need to wrap `ZoneVmExtensionPolicies` in
19987/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
19988/// already uses an `Arc` internally.
19989#[cfg(feature = "zone-vm-extension-policies")]
19990#[cfg_attr(docsrs, doc(cfg(feature = "zone-vm-extension-policies")))]
19991#[derive(Clone, Debug)]
19992pub struct ZoneVmExtensionPolicies {
19993    inner: std::sync::Arc<dyn super::stub::dynamic::ZoneVmExtensionPolicies>,
19994}
19995
19996#[cfg(feature = "zone-vm-extension-policies")]
19997impl ZoneVmExtensionPolicies {
19998    /// Returns a builder for [ZoneVmExtensionPolicies].
19999    ///
20000    /// ```
20001    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
20002    /// # use google_cloud_compute_v1::client::ZoneVmExtensionPolicies;
20003    /// let client = ZoneVmExtensionPolicies::builder().build().await?;
20004    /// # Ok(()) }
20005    /// ```
20006    pub fn builder() -> super::builder::zone_vm_extension_policies::ClientBuilder {
20007        crate::new_client_builder(super::builder::zone_vm_extension_policies::client::Factory)
20008    }
20009
20010    /// Creates a new client from the provided stub.
20011    ///
20012    /// The most common case for calling this function is in tests mocking the
20013    /// client's behavior.
20014    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
20015    where
20016        T: super::stub::ZoneVmExtensionPolicies + 'static,
20017    {
20018        Self { inner: stub.into() }
20019    }
20020
20021    pub(crate) async fn new(
20022        config: gaxi::options::ClientConfig,
20023    ) -> crate::ClientBuilderResult<Self> {
20024        let inner = Self::build_inner(config).await?;
20025        Ok(Self { inner })
20026    }
20027
20028    async fn build_inner(
20029        conf: gaxi::options::ClientConfig,
20030    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ZoneVmExtensionPolicies>>
20031    {
20032        if gaxi::options::tracing_enabled(&conf) {
20033            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
20034        }
20035        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
20036    }
20037
20038    async fn build_transport(
20039        conf: gaxi::options::ClientConfig,
20040    ) -> crate::ClientBuilderResult<impl super::stub::ZoneVmExtensionPolicies> {
20041        super::transport::ZoneVmExtensionPolicies::new(conf).await
20042    }
20043
20044    async fn build_with_tracing(
20045        conf: gaxi::options::ClientConfig,
20046    ) -> crate::ClientBuilderResult<impl super::stub::ZoneVmExtensionPolicies> {
20047        Self::build_transport(conf)
20048            .await
20049            .map(super::tracing::ZoneVmExtensionPolicies::new)
20050    }
20051
20052    /// Deletes a specified zone VM extension policy.
20053    pub fn delete(&self) -> super::builder::zone_vm_extension_policies::Delete {
20054        super::builder::zone_vm_extension_policies::Delete::new(self.inner.clone())
20055    }
20056
20057    /// Retrieves details of a specific zone VM extension policy.
20058    pub fn get(&self) -> super::builder::zone_vm_extension_policies::Get {
20059        super::builder::zone_vm_extension_policies::Get::new(self.inner.clone())
20060    }
20061
20062    /// Creates a new zone-level VM extension policy within a project.
20063    pub fn insert(&self) -> super::builder::zone_vm_extension_policies::Insert {
20064        super::builder::zone_vm_extension_policies::Insert::new(self.inner.clone())
20065    }
20066
20067    /// Lists all VM extension policies within a specific zone for a project.
20068    pub fn list(&self) -> super::builder::zone_vm_extension_policies::List {
20069        super::builder::zone_vm_extension_policies::List::new(self.inner.clone())
20070    }
20071
20072    /// Modifies an existing zone VM extension policy.
20073    pub fn update(&self) -> super::builder::zone_vm_extension_policies::Update {
20074        super::builder::zone_vm_extension_policies::Update::new(self.inner.clone())
20075    }
20076
20077    /// Retrieves the specified zone-specific Operations resource.
20078    pub fn get_operation(&self) -> super::builder::zone_vm_extension_policies::GetOperation {
20079        super::builder::zone_vm_extension_policies::GetOperation::new(self.inner.clone())
20080    }
20081}
20082
20083/// Implements a client for the Google Compute Engine API.
20084///
20085/// # Example
20086/// ```
20087/// # use google_cloud_compute_v1::client::Zones;
20088/// async fn sample(
20089/// ) -> anyhow::Result<()> {
20090///     let client = Zones::builder().build().await?;
20091///     // use `client` to make requests to the Google Compute Engine API.
20092///     Ok(())
20093/// }
20094/// ```
20095///
20096/// # Service Description
20097///
20098/// Service for the `zones` resource.
20099///
20100/// # Configuration
20101///
20102/// To configure `Zones` use the `with_*` methods in the type returned
20103/// by [builder()][Zones::builder]. The default configuration should
20104/// work for most applications. Common configuration changes include
20105///
20106/// * [with_endpoint()]: by default this client uses the global default endpoint
20107///   (`https://compute.googleapis.com`). Applications using regional
20108///   endpoints or running in restricted networks (e.g. a network configured
20109//    with [Private Google Access with VPC Service Controls]) may want to
20110///   override this default.
20111/// * [with_credentials()]: by default this client uses
20112///   [Application Default Credentials]. Applications using custom
20113///   authentication may need to override this default.
20114///
20115/// [with_endpoint()]: super::builder::zones::ClientBuilder::with_endpoint
20116/// [with_credentials()]: super::builder::zones::ClientBuilder::with_credentials
20117/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
20118/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
20119///
20120/// # Pooling and Cloning
20121///
20122/// `Zones` holds a connection pool internally, it is advised to
20123/// create one and reuse it. You do not need to wrap `Zones` in
20124/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
20125/// already uses an `Arc` internally.
20126#[cfg(feature = "zones")]
20127#[cfg_attr(docsrs, doc(cfg(feature = "zones")))]
20128#[derive(Clone, Debug)]
20129pub struct Zones {
20130    inner: std::sync::Arc<dyn super::stub::dynamic::Zones>,
20131}
20132
20133#[cfg(feature = "zones")]
20134impl Zones {
20135    /// Returns a builder for [Zones].
20136    ///
20137    /// ```
20138    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
20139    /// # use google_cloud_compute_v1::client::Zones;
20140    /// let client = Zones::builder().build().await?;
20141    /// # Ok(()) }
20142    /// ```
20143    pub fn builder() -> super::builder::zones::ClientBuilder {
20144        crate::new_client_builder(super::builder::zones::client::Factory)
20145    }
20146
20147    /// Creates a new client from the provided stub.
20148    ///
20149    /// The most common case for calling this function is in tests mocking the
20150    /// client's behavior.
20151    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
20152    where
20153        T: super::stub::Zones + 'static,
20154    {
20155        Self { inner: stub.into() }
20156    }
20157
20158    pub(crate) async fn new(
20159        config: gaxi::options::ClientConfig,
20160    ) -> crate::ClientBuilderResult<Self> {
20161        let inner = Self::build_inner(config).await?;
20162        Ok(Self { inner })
20163    }
20164
20165    async fn build_inner(
20166        conf: gaxi::options::ClientConfig,
20167    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Zones>> {
20168        if gaxi::options::tracing_enabled(&conf) {
20169            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
20170        }
20171        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
20172    }
20173
20174    async fn build_transport(
20175        conf: gaxi::options::ClientConfig,
20176    ) -> crate::ClientBuilderResult<impl super::stub::Zones> {
20177        super::transport::Zones::new(conf).await
20178    }
20179
20180    async fn build_with_tracing(
20181        conf: gaxi::options::ClientConfig,
20182    ) -> crate::ClientBuilderResult<impl super::stub::Zones> {
20183        Self::build_transport(conf)
20184            .await
20185            .map(super::tracing::Zones::new)
20186    }
20187
20188    /// Returns the specified Zone resource.
20189    pub fn get(&self) -> super::builder::zones::Get {
20190        super::builder::zones::Get::new(self.inner.clone())
20191    }
20192
20193    /// Retrieves the list of Zone resources available to the specified project.
20194    pub fn list(&self) -> super::builder::zones::List {
20195        super::builder::zones::List::new(self.inner.clone())
20196    }
20197}