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/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
25/// # use google_cloud_compute_v1::client::AcceleratorTypes;
26/// let client = AcceleratorTypes::builder().build().await?;
27/// // use `client` to make requests to the Google Compute Engine API.
28/// # Ok(()) }
29/// ```
30///
31/// # Service Description
32///
33/// Service for the `acceleratorTypes` resource.
34///
35/// # Configuration
36///
37/// To configure `AcceleratorTypes` use the `with_*` methods in the type returned
38/// by [builder()][AcceleratorTypes::builder]. The default configuration should
39/// work for most applications. Common configuration changes include
40///
41/// * [with_endpoint()]: by default this client uses the global default endpoint
42///   (`https://compute.googleapis.com`). Applications using regional
43///   endpoints or running in restricted networks (e.g. a network configured
44//    with [Private Google Access with VPC Service Controls]) may want to
45///   override this default.
46/// * [with_credentials()]: by default this client uses
47///   [Application Default Credentials]. Applications using custom
48///   authentication may need to override this default.
49///
50/// [with_endpoint()]: super::builder::accelerator_types::ClientBuilder::with_endpoint
51/// [with_credentials()]: super::builder::accelerator_types::ClientBuilder::credentials
52/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
53/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
54///
55/// # Pooling and Cloning
56///
57/// `AcceleratorTypes` holds a connection pool internally, it is advised to
58/// create one and the reuse it.  You do not need to wrap `AcceleratorTypes` in
59/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
60/// already uses an `Arc` internally.
61#[cfg(feature = "accelerator-types")]
62#[cfg_attr(docsrs, doc(cfg(feature = "accelerator-types")))]
63#[derive(Clone, Debug)]
64pub struct AcceleratorTypes {
65    inner: std::sync::Arc<dyn super::stub::dynamic::AcceleratorTypes>,
66}
67
68#[cfg(feature = "accelerator-types")]
69impl AcceleratorTypes {
70    /// Returns a builder for [AcceleratorTypes].
71    ///
72    /// ```
73    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
74    /// # use google_cloud_compute_v1::client::AcceleratorTypes;
75    /// let client = AcceleratorTypes::builder().build().await?;
76    /// # Ok(()) }
77    /// ```
78    pub fn builder() -> super::builder::accelerator_types::ClientBuilder {
79        crate::new_client_builder(super::builder::accelerator_types::client::Factory)
80    }
81
82    /// Creates a new client from the provided stub.
83    ///
84    /// The most common case for calling this function is in tests mocking the
85    /// client's behavior.
86    pub fn from_stub<T>(stub: T) -> Self
87    where
88        T: super::stub::AcceleratorTypes + 'static,
89    {
90        Self {
91            inner: std::sync::Arc::new(stub),
92        }
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/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
151/// # use google_cloud_compute_v1::client::Addresses;
152/// let client = Addresses::builder().build().await?;
153/// // use `client` to make requests to the Google Compute Engine API.
154/// # Ok(()) }
155/// ```
156///
157/// # Service Description
158///
159/// Service for the `addresses` resource.
160///
161/// # Configuration
162///
163/// To configure `Addresses` use the `with_*` methods in the type returned
164/// by [builder()][Addresses::builder]. The default configuration should
165/// work for most applications. Common configuration changes include
166///
167/// * [with_endpoint()]: by default this client uses the global default endpoint
168///   (`https://compute.googleapis.com`). Applications using regional
169///   endpoints or running in restricted networks (e.g. a network configured
170//    with [Private Google Access with VPC Service Controls]) may want to
171///   override this default.
172/// * [with_credentials()]: by default this client uses
173///   [Application Default Credentials]. Applications using custom
174///   authentication may need to override this default.
175///
176/// [with_endpoint()]: super::builder::addresses::ClientBuilder::with_endpoint
177/// [with_credentials()]: super::builder::addresses::ClientBuilder::credentials
178/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
179/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
180///
181/// # Pooling and Cloning
182///
183/// `Addresses` holds a connection pool internally, it is advised to
184/// create one and the reuse it.  You do not need to wrap `Addresses` in
185/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
186/// already uses an `Arc` internally.
187#[cfg(feature = "addresses")]
188#[cfg_attr(docsrs, doc(cfg(feature = "addresses")))]
189#[derive(Clone, Debug)]
190pub struct Addresses {
191    inner: std::sync::Arc<dyn super::stub::dynamic::Addresses>,
192}
193
194#[cfg(feature = "addresses")]
195impl Addresses {
196    /// Returns a builder for [Addresses].
197    ///
198    /// ```
199    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
200    /// # use google_cloud_compute_v1::client::Addresses;
201    /// let client = Addresses::builder().build().await?;
202    /// # Ok(()) }
203    /// ```
204    pub fn builder() -> super::builder::addresses::ClientBuilder {
205        crate::new_client_builder(super::builder::addresses::client::Factory)
206    }
207
208    /// Creates a new client from the provided stub.
209    ///
210    /// The most common case for calling this function is in tests mocking the
211    /// client's behavior.
212    pub fn from_stub<T>(stub: T) -> Self
213    where
214        T: super::stub::Addresses + 'static,
215    {
216        Self {
217            inner: std::sync::Arc::new(stub),
218        }
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/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
308/// # use google_cloud_compute_v1::client::Advice;
309/// let client = Advice::builder().build().await?;
310/// // use `client` to make requests to the Google Compute Engine API.
311/// # Ok(()) }
312/// ```
313///
314/// # Service Description
315///
316/// Service for the `advice` resource.
317///
318/// # Configuration
319///
320/// To configure `Advice` use the `with_*` methods in the type returned
321/// by [builder()][Advice::builder]. The default configuration should
322/// work for most applications. Common configuration changes include
323///
324/// * [with_endpoint()]: by default this client uses the global default endpoint
325///   (`https://compute.googleapis.com`). Applications using regional
326///   endpoints or running in restricted networks (e.g. a network configured
327//    with [Private Google Access with VPC Service Controls]) may want to
328///   override this default.
329/// * [with_credentials()]: by default this client uses
330///   [Application Default Credentials]. Applications using custom
331///   authentication may need to override this default.
332///
333/// [with_endpoint()]: super::builder::advice::ClientBuilder::with_endpoint
334/// [with_credentials()]: super::builder::advice::ClientBuilder::credentials
335/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
336/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
337///
338/// # Pooling and Cloning
339///
340/// `Advice` holds a connection pool internally, it is advised to
341/// create one and the reuse it.  You do not need to wrap `Advice` in
342/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
343/// already uses an `Arc` internally.
344#[cfg(feature = "advice")]
345#[cfg_attr(docsrs, doc(cfg(feature = "advice")))]
346#[derive(Clone, Debug)]
347pub struct Advice {
348    inner: std::sync::Arc<dyn super::stub::dynamic::Advice>,
349}
350
351#[cfg(feature = "advice")]
352impl Advice {
353    /// Returns a builder for [Advice].
354    ///
355    /// ```
356    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
357    /// # use google_cloud_compute_v1::client::Advice;
358    /// let client = Advice::builder().build().await?;
359    /// # Ok(()) }
360    /// ```
361    pub fn builder() -> super::builder::advice::ClientBuilder {
362        crate::new_client_builder(super::builder::advice::client::Factory)
363    }
364
365    /// Creates a new client from the provided stub.
366    ///
367    /// The most common case for calling this function is in tests mocking the
368    /// client's behavior.
369    pub fn from_stub<T>(stub: T) -> Self
370    where
371        T: super::stub::Advice + 'static,
372    {
373        Self {
374            inner: std::sync::Arc::new(stub),
375        }
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/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
422/// # use google_cloud_compute_v1::client::Autoscalers;
423/// let client = Autoscalers::builder().build().await?;
424/// // use `client` to make requests to the Google Compute Engine API.
425/// # Ok(()) }
426/// ```
427///
428/// # Service Description
429///
430/// Service for the `autoscalers` resource.
431///
432/// # Configuration
433///
434/// To configure `Autoscalers` use the `with_*` methods in the type returned
435/// by [builder()][Autoscalers::builder]. The default configuration should
436/// work for most applications. Common configuration changes include
437///
438/// * [with_endpoint()]: by default this client uses the global default endpoint
439///   (`https://compute.googleapis.com`). Applications using regional
440///   endpoints or running in restricted networks (e.g. a network configured
441//    with [Private Google Access with VPC Service Controls]) may want to
442///   override this default.
443/// * [with_credentials()]: by default this client uses
444///   [Application Default Credentials]. Applications using custom
445///   authentication may need to override this default.
446///
447/// [with_endpoint()]: super::builder::autoscalers::ClientBuilder::with_endpoint
448/// [with_credentials()]: super::builder::autoscalers::ClientBuilder::credentials
449/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
450/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
451///
452/// # Pooling and Cloning
453///
454/// `Autoscalers` holds a connection pool internally, it is advised to
455/// create one and the reuse it.  You do not need to wrap `Autoscalers` in
456/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
457/// already uses an `Arc` internally.
458#[cfg(feature = "autoscalers")]
459#[cfg_attr(docsrs, doc(cfg(feature = "autoscalers")))]
460#[derive(Clone, Debug)]
461pub struct Autoscalers {
462    inner: std::sync::Arc<dyn super::stub::dynamic::Autoscalers>,
463}
464
465#[cfg(feature = "autoscalers")]
466impl Autoscalers {
467    /// Returns a builder for [Autoscalers].
468    ///
469    /// ```
470    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
471    /// # use google_cloud_compute_v1::client::Autoscalers;
472    /// let client = Autoscalers::builder().build().await?;
473    /// # Ok(()) }
474    /// ```
475    pub fn builder() -> super::builder::autoscalers::ClientBuilder {
476        crate::new_client_builder(super::builder::autoscalers::client::Factory)
477    }
478
479    /// Creates a new client from the provided stub.
480    ///
481    /// The most common case for calling this function is in tests mocking the
482    /// client's behavior.
483    pub fn from_stub<T>(stub: T) -> Self
484    where
485        T: super::stub::Autoscalers + 'static,
486    {
487        Self {
488            inner: std::sync::Arc::new(stub),
489        }
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/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
582/// # use google_cloud_compute_v1::client::BackendBuckets;
583/// let client = BackendBuckets::builder().build().await?;
584/// // use `client` to make requests to the Google Compute Engine API.
585/// # Ok(()) }
586/// ```
587///
588/// # Service Description
589///
590/// Service for the `backendBuckets` resource.
591///
592/// # Configuration
593///
594/// To configure `BackendBuckets` use the `with_*` methods in the type returned
595/// by [builder()][BackendBuckets::builder]. The default configuration should
596/// work for most applications. Common configuration changes include
597///
598/// * [with_endpoint()]: by default this client uses the global default endpoint
599///   (`https://compute.googleapis.com`). Applications using regional
600///   endpoints or running in restricted networks (e.g. a network configured
601//    with [Private Google Access with VPC Service Controls]) may want to
602///   override this default.
603/// * [with_credentials()]: by default this client uses
604///   [Application Default Credentials]. Applications using custom
605///   authentication may need to override this default.
606///
607/// [with_endpoint()]: super::builder::backend_buckets::ClientBuilder::with_endpoint
608/// [with_credentials()]: super::builder::backend_buckets::ClientBuilder::credentials
609/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
610/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
611///
612/// # Pooling and Cloning
613///
614/// `BackendBuckets` holds a connection pool internally, it is advised to
615/// create one and the reuse it.  You do not need to wrap `BackendBuckets` in
616/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
617/// already uses an `Arc` internally.
618#[cfg(feature = "backend-buckets")]
619#[cfg_attr(docsrs, doc(cfg(feature = "backend-buckets")))]
620#[derive(Clone, Debug)]
621pub struct BackendBuckets {
622    inner: std::sync::Arc<dyn super::stub::dynamic::BackendBuckets>,
623}
624
625#[cfg(feature = "backend-buckets")]
626impl BackendBuckets {
627    /// Returns a builder for [BackendBuckets].
628    ///
629    /// ```
630    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
631    /// # use google_cloud_compute_v1::client::BackendBuckets;
632    /// let client = BackendBuckets::builder().build().await?;
633    /// # Ok(()) }
634    /// ```
635    pub fn builder() -> super::builder::backend_buckets::ClientBuilder {
636        crate::new_client_builder(super::builder::backend_buckets::client::Factory)
637    }
638
639    /// Creates a new client from the provided stub.
640    ///
641    /// The most common case for calling this function is in tests mocking the
642    /// client's behavior.
643    pub fn from_stub<T>(stub: T) -> Self
644    where
645        T: super::stub::BackendBuckets + 'static,
646    {
647        Self {
648            inner: std::sync::Arc::new(stub),
649        }
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    /// Deletes the specified BackendBucket resource.
689    pub fn delete(&self) -> super::builder::backend_buckets::Delete {
690        super::builder::backend_buckets::Delete::new(self.inner.clone())
691    }
692
693    /// Deletes a key for validating requests with signed URLs for this backend
694    /// bucket.
695    pub fn delete_signed_url_key(&self) -> super::builder::backend_buckets::DeleteSignedUrlKey {
696        super::builder::backend_buckets::DeleteSignedUrlKey::new(self.inner.clone())
697    }
698
699    /// Returns the specified BackendBucket resource.
700    pub fn get(&self) -> super::builder::backend_buckets::Get {
701        super::builder::backend_buckets::Get::new(self.inner.clone())
702    }
703
704    /// Gets the access control policy for a resource. May be empty if no such
705    /// policy or resource exists.
706    pub fn get_iam_policy(&self) -> super::builder::backend_buckets::GetIamPolicy {
707        super::builder::backend_buckets::GetIamPolicy::new(self.inner.clone())
708    }
709
710    /// Creates a BackendBucket resource in the specified project using
711    /// the data included in the request.
712    pub fn insert(&self) -> super::builder::backend_buckets::Insert {
713        super::builder::backend_buckets::Insert::new(self.inner.clone())
714    }
715
716    /// Retrieves the list of BackendBucket resources available to the specified
717    /// project.
718    pub fn list(&self) -> super::builder::backend_buckets::List {
719        super::builder::backend_buckets::List::new(self.inner.clone())
720    }
721
722    /// Updates the specified BackendBucket resource with the data included in the
723    /// request. This method supportsPATCH
724    /// semantics and uses theJSON merge
725    /// patch format and processing rules.
726    pub fn patch(&self) -> super::builder::backend_buckets::Patch {
727        super::builder::backend_buckets::Patch::new(self.inner.clone())
728    }
729
730    /// Sets the edge security policy for the specified backend bucket.
731    pub fn set_edge_security_policy(
732        &self,
733    ) -> super::builder::backend_buckets::SetEdgeSecurityPolicy {
734        super::builder::backend_buckets::SetEdgeSecurityPolicy::new(self.inner.clone())
735    }
736
737    /// Sets the access control policy on the specified resource.
738    /// Replaces any existing policy.
739    pub fn set_iam_policy(&self) -> super::builder::backend_buckets::SetIamPolicy {
740        super::builder::backend_buckets::SetIamPolicy::new(self.inner.clone())
741    }
742
743    /// Returns permissions that a caller has on the specified resource.
744    pub fn test_iam_permissions(&self) -> super::builder::backend_buckets::TestIamPermissions {
745        super::builder::backend_buckets::TestIamPermissions::new(self.inner.clone())
746    }
747
748    /// Updates the specified BackendBucket resource with the data included in the
749    /// request.
750    pub fn update(&self) -> super::builder::backend_buckets::Update {
751        super::builder::backend_buckets::Update::new(self.inner.clone())
752    }
753
754    /// Retrieves the specified Operations resource.
755    pub fn get_operation(&self) -> super::builder::backend_buckets::GetOperation {
756        super::builder::backend_buckets::GetOperation::new(self.inner.clone())
757    }
758}
759
760/// Implements a client for the Google Compute Engine API.
761///
762/// # Example
763/// ```
764/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
765/// # use google_cloud_compute_v1::client::BackendServices;
766/// let client = BackendServices::builder().build().await?;
767/// // use `client` to make requests to the Google Compute Engine API.
768/// # Ok(()) }
769/// ```
770///
771/// # Service Description
772///
773/// Service for the `backendServices` resource.
774///
775/// # Configuration
776///
777/// To configure `BackendServices` use the `with_*` methods in the type returned
778/// by [builder()][BackendServices::builder]. The default configuration should
779/// work for most applications. Common configuration changes include
780///
781/// * [with_endpoint()]: by default this client uses the global default endpoint
782///   (`https://compute.googleapis.com`). Applications using regional
783///   endpoints or running in restricted networks (e.g. a network configured
784//    with [Private Google Access with VPC Service Controls]) may want to
785///   override this default.
786/// * [with_credentials()]: by default this client uses
787///   [Application Default Credentials]. Applications using custom
788///   authentication may need to override this default.
789///
790/// [with_endpoint()]: super::builder::backend_services::ClientBuilder::with_endpoint
791/// [with_credentials()]: super::builder::backend_services::ClientBuilder::credentials
792/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
793/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
794///
795/// # Pooling and Cloning
796///
797/// `BackendServices` holds a connection pool internally, it is advised to
798/// create one and the reuse it.  You do not need to wrap `BackendServices` in
799/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
800/// already uses an `Arc` internally.
801#[cfg(feature = "backend-services")]
802#[cfg_attr(docsrs, doc(cfg(feature = "backend-services")))]
803#[derive(Clone, Debug)]
804pub struct BackendServices {
805    inner: std::sync::Arc<dyn super::stub::dynamic::BackendServices>,
806}
807
808#[cfg(feature = "backend-services")]
809impl BackendServices {
810    /// Returns a builder for [BackendServices].
811    ///
812    /// ```
813    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
814    /// # use google_cloud_compute_v1::client::BackendServices;
815    /// let client = BackendServices::builder().build().await?;
816    /// # Ok(()) }
817    /// ```
818    pub fn builder() -> super::builder::backend_services::ClientBuilder {
819        crate::new_client_builder(super::builder::backend_services::client::Factory)
820    }
821
822    /// Creates a new client from the provided stub.
823    ///
824    /// The most common case for calling this function is in tests mocking the
825    /// client's behavior.
826    pub fn from_stub<T>(stub: T) -> Self
827    where
828        T: super::stub::BackendServices + 'static,
829    {
830        Self {
831            inner: std::sync::Arc::new(stub),
832        }
833    }
834
835    pub(crate) async fn new(
836        config: gaxi::options::ClientConfig,
837    ) -> crate::ClientBuilderResult<Self> {
838        let inner = Self::build_inner(config).await?;
839        Ok(Self { inner })
840    }
841
842    async fn build_inner(
843        conf: gaxi::options::ClientConfig,
844    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::BackendServices>> {
845        if gaxi::options::tracing_enabled(&conf) {
846            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
847        }
848        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
849    }
850
851    async fn build_transport(
852        conf: gaxi::options::ClientConfig,
853    ) -> crate::ClientBuilderResult<impl super::stub::BackendServices> {
854        super::transport::BackendServices::new(conf).await
855    }
856
857    async fn build_with_tracing(
858        conf: gaxi::options::ClientConfig,
859    ) -> crate::ClientBuilderResult<impl super::stub::BackendServices> {
860        Self::build_transport(conf)
861            .await
862            .map(super::tracing::BackendServices::new)
863    }
864
865    /// Adds a key for validating requests with signed URLs for this backend
866    /// service.
867    pub fn add_signed_url_key(&self) -> super::builder::backend_services::AddSignedUrlKey {
868        super::builder::backend_services::AddSignedUrlKey::new(self.inner.clone())
869    }
870
871    /// Retrieves the list of all BackendService resources, regional and global,
872    /// available to the specified project.
873    ///
874    /// To prevent failure, it is recommended that you set the
875    /// `returnPartialSuccess` parameter to `true`.
876    pub fn aggregated_list(&self) -> super::builder::backend_services::AggregatedList {
877        super::builder::backend_services::AggregatedList::new(self.inner.clone())
878    }
879
880    /// Deletes the specified BackendService resource.
881    pub fn delete(&self) -> super::builder::backend_services::Delete {
882        super::builder::backend_services::Delete::new(self.inner.clone())
883    }
884
885    /// Deletes a key for validating requests with signed URLs for this backend
886    /// service.
887    pub fn delete_signed_url_key(&self) -> super::builder::backend_services::DeleteSignedUrlKey {
888        super::builder::backend_services::DeleteSignedUrlKey::new(self.inner.clone())
889    }
890
891    /// Returns the specified BackendService resource.
892    pub fn get(&self) -> super::builder::backend_services::Get {
893        super::builder::backend_services::Get::new(self.inner.clone())
894    }
895
896    /// Returns effective security policies applied to this backend service.
897    pub fn get_effective_security_policies(
898        &self,
899    ) -> super::builder::backend_services::GetEffectiveSecurityPolicies {
900        super::builder::backend_services::GetEffectiveSecurityPolicies::new(self.inner.clone())
901    }
902
903    /// Gets the most recent health check results for this
904    /// BackendService.
905    ///
906    /// Example request body:
907    ///
908    /// {
909    /// "group": "/zones/us-east1-b/instanceGroups/lb-backend-example"
910    /// }
911    pub fn get_health(&self) -> super::builder::backend_services::GetHealth {
912        super::builder::backend_services::GetHealth::new(self.inner.clone())
913    }
914
915    /// Gets the access control policy for a resource. May be empty if no such
916    /// policy or resource exists.
917    pub fn get_iam_policy(&self) -> super::builder::backend_services::GetIamPolicy {
918        super::builder::backend_services::GetIamPolicy::new(self.inner.clone())
919    }
920
921    /// Creates a BackendService resource in the specified project using
922    /// the data included in the request. For more information, see
923    /// Backend services overview.
924    pub fn insert(&self) -> super::builder::backend_services::Insert {
925        super::builder::backend_services::Insert::new(self.inner.clone())
926    }
927
928    /// Retrieves the list of BackendService resources available to the specified
929    /// project.
930    pub fn list(&self) -> super::builder::backend_services::List {
931        super::builder::backend_services::List::new(self.inner.clone())
932    }
933
934    /// Retrieves a list of all usable backend services in the specified project.
935    pub fn list_usable(&self) -> super::builder::backend_services::ListUsable {
936        super::builder::backend_services::ListUsable::new(self.inner.clone())
937    }
938
939    /// Patches the specified BackendService resource with the data included in the
940    /// request. For more information, see
941    /// Backend services overview. This method
942    /// supports PATCH semantics and uses the JSON merge
943    /// patch format and processing rules.
944    pub fn patch(&self) -> super::builder::backend_services::Patch {
945        super::builder::backend_services::Patch::new(self.inner.clone())
946    }
947
948    /// Sets the edge security policy for the specified backend service.
949    pub fn set_edge_security_policy(
950        &self,
951    ) -> super::builder::backend_services::SetEdgeSecurityPolicy {
952        super::builder::backend_services::SetEdgeSecurityPolicy::new(self.inner.clone())
953    }
954
955    /// Sets the access control policy on the specified resource.
956    /// Replaces any existing policy.
957    pub fn set_iam_policy(&self) -> super::builder::backend_services::SetIamPolicy {
958        super::builder::backend_services::SetIamPolicy::new(self.inner.clone())
959    }
960
961    /// Sets the Google Cloud Armor security policy for the specified backend
962    /// service. For more information, seeGoogle
963    /// Cloud Armor Overview
964    pub fn set_security_policy(&self) -> super::builder::backend_services::SetSecurityPolicy {
965        super::builder::backend_services::SetSecurityPolicy::new(self.inner.clone())
966    }
967
968    /// Returns permissions that a caller has on the specified resource.
969    pub fn test_iam_permissions(&self) -> super::builder::backend_services::TestIamPermissions {
970        super::builder::backend_services::TestIamPermissions::new(self.inner.clone())
971    }
972
973    /// Updates the specified BackendService resource with the data included in the
974    /// request. For more information, seeBackend
975    /// services overview.
976    pub fn update(&self) -> super::builder::backend_services::Update {
977        super::builder::backend_services::Update::new(self.inner.clone())
978    }
979
980    /// Retrieves the specified Operations resource.
981    pub fn get_operation(&self) -> super::builder::backend_services::GetOperation {
982        super::builder::backend_services::GetOperation::new(self.inner.clone())
983    }
984}
985
986/// Implements a client for the Google Compute Engine API.
987///
988/// # Example
989/// ```
990/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
991/// # use google_cloud_compute_v1::client::CrossSiteNetworks;
992/// let client = CrossSiteNetworks::builder().build().await?;
993/// // use `client` to make requests to the Google Compute Engine API.
994/// # Ok(()) }
995/// ```
996///
997/// # Service Description
998///
999/// Service for the `crossSiteNetworks` resource.
1000///
1001/// # Configuration
1002///
1003/// To configure `CrossSiteNetworks` use the `with_*` methods in the type returned
1004/// by [builder()][CrossSiteNetworks::builder]. The default configuration should
1005/// work for most applications. Common configuration changes include
1006///
1007/// * [with_endpoint()]: by default this client uses the global default endpoint
1008///   (`https://compute.googleapis.com`). Applications using regional
1009///   endpoints or running in restricted networks (e.g. a network configured
1010//    with [Private Google Access with VPC Service Controls]) may want to
1011///   override this default.
1012/// * [with_credentials()]: by default this client uses
1013///   [Application Default Credentials]. Applications using custom
1014///   authentication may need to override this default.
1015///
1016/// [with_endpoint()]: super::builder::cross_site_networks::ClientBuilder::with_endpoint
1017/// [with_credentials()]: super::builder::cross_site_networks::ClientBuilder::credentials
1018/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1019/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1020///
1021/// # Pooling and Cloning
1022///
1023/// `CrossSiteNetworks` holds a connection pool internally, it is advised to
1024/// create one and the reuse it.  You do not need to wrap `CrossSiteNetworks` in
1025/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1026/// already uses an `Arc` internally.
1027#[cfg(feature = "cross-site-networks")]
1028#[cfg_attr(docsrs, doc(cfg(feature = "cross-site-networks")))]
1029#[derive(Clone, Debug)]
1030pub struct CrossSiteNetworks {
1031    inner: std::sync::Arc<dyn super::stub::dynamic::CrossSiteNetworks>,
1032}
1033
1034#[cfg(feature = "cross-site-networks")]
1035impl CrossSiteNetworks {
1036    /// Returns a builder for [CrossSiteNetworks].
1037    ///
1038    /// ```
1039    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1040    /// # use google_cloud_compute_v1::client::CrossSiteNetworks;
1041    /// let client = CrossSiteNetworks::builder().build().await?;
1042    /// # Ok(()) }
1043    /// ```
1044    pub fn builder() -> super::builder::cross_site_networks::ClientBuilder {
1045        crate::new_client_builder(super::builder::cross_site_networks::client::Factory)
1046    }
1047
1048    /// Creates a new client from the provided stub.
1049    ///
1050    /// The most common case for calling this function is in tests mocking the
1051    /// client's behavior.
1052    pub fn from_stub<T>(stub: T) -> Self
1053    where
1054        T: super::stub::CrossSiteNetworks + 'static,
1055    {
1056        Self {
1057            inner: std::sync::Arc::new(stub),
1058        }
1059    }
1060
1061    pub(crate) async fn new(
1062        config: gaxi::options::ClientConfig,
1063    ) -> crate::ClientBuilderResult<Self> {
1064        let inner = Self::build_inner(config).await?;
1065        Ok(Self { inner })
1066    }
1067
1068    async fn build_inner(
1069        conf: gaxi::options::ClientConfig,
1070    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::CrossSiteNetworks>>
1071    {
1072        if gaxi::options::tracing_enabled(&conf) {
1073            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1074        }
1075        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1076    }
1077
1078    async fn build_transport(
1079        conf: gaxi::options::ClientConfig,
1080    ) -> crate::ClientBuilderResult<impl super::stub::CrossSiteNetworks> {
1081        super::transport::CrossSiteNetworks::new(conf).await
1082    }
1083
1084    async fn build_with_tracing(
1085        conf: gaxi::options::ClientConfig,
1086    ) -> crate::ClientBuilderResult<impl super::stub::CrossSiteNetworks> {
1087        Self::build_transport(conf)
1088            .await
1089            .map(super::tracing::CrossSiteNetworks::new)
1090    }
1091
1092    /// Deletes the specified cross-site network in the given scope.
1093    pub fn delete(&self) -> super::builder::cross_site_networks::Delete {
1094        super::builder::cross_site_networks::Delete::new(self.inner.clone())
1095    }
1096
1097    /// Returns the specified cross-site network in the given scope.
1098    pub fn get(&self) -> super::builder::cross_site_networks::Get {
1099        super::builder::cross_site_networks::Get::new(self.inner.clone())
1100    }
1101
1102    /// Creates a cross-site network in the specified project in the given scope
1103    /// using the parameters that are included in the request.
1104    pub fn insert(&self) -> super::builder::cross_site_networks::Insert {
1105        super::builder::cross_site_networks::Insert::new(self.inner.clone())
1106    }
1107
1108    /// Lists the cross-site networks for a project in the given scope.
1109    pub fn list(&self) -> super::builder::cross_site_networks::List {
1110        super::builder::cross_site_networks::List::new(self.inner.clone())
1111    }
1112
1113    /// Updates the specified cross-site network with the data included in
1114    /// the request. This method supportsPATCH
1115    /// semantics and uses theJSON merge
1116    /// patch format and processing rules.
1117    pub fn patch(&self) -> super::builder::cross_site_networks::Patch {
1118        super::builder::cross_site_networks::Patch::new(self.inner.clone())
1119    }
1120
1121    /// Retrieves the specified Operations resource.
1122    pub fn get_operation(&self) -> super::builder::cross_site_networks::GetOperation {
1123        super::builder::cross_site_networks::GetOperation::new(self.inner.clone())
1124    }
1125}
1126
1127/// Implements a client for the Google Compute Engine API.
1128///
1129/// # Example
1130/// ```
1131/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1132/// # use google_cloud_compute_v1::client::DiskTypes;
1133/// let client = DiskTypes::builder().build().await?;
1134/// // use `client` to make requests to the Google Compute Engine API.
1135/// # Ok(()) }
1136/// ```
1137///
1138/// # Service Description
1139///
1140/// Service for the `diskTypes` resource.
1141///
1142/// # Configuration
1143///
1144/// To configure `DiskTypes` use the `with_*` methods in the type returned
1145/// by [builder()][DiskTypes::builder]. The default configuration should
1146/// work for most applications. Common configuration changes include
1147///
1148/// * [with_endpoint()]: by default this client uses the global default endpoint
1149///   (`https://compute.googleapis.com`). Applications using regional
1150///   endpoints or running in restricted networks (e.g. a network configured
1151//    with [Private Google Access with VPC Service Controls]) may want to
1152///   override this default.
1153/// * [with_credentials()]: by default this client uses
1154///   [Application Default Credentials]. Applications using custom
1155///   authentication may need to override this default.
1156///
1157/// [with_endpoint()]: super::builder::disk_types::ClientBuilder::with_endpoint
1158/// [with_credentials()]: super::builder::disk_types::ClientBuilder::credentials
1159/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1160/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1161///
1162/// # Pooling and Cloning
1163///
1164/// `DiskTypes` holds a connection pool internally, it is advised to
1165/// create one and the reuse it.  You do not need to wrap `DiskTypes` in
1166/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1167/// already uses an `Arc` internally.
1168#[cfg(feature = "disk-types")]
1169#[cfg_attr(docsrs, doc(cfg(feature = "disk-types")))]
1170#[derive(Clone, Debug)]
1171pub struct DiskTypes {
1172    inner: std::sync::Arc<dyn super::stub::dynamic::DiskTypes>,
1173}
1174
1175#[cfg(feature = "disk-types")]
1176impl DiskTypes {
1177    /// Returns a builder for [DiskTypes].
1178    ///
1179    /// ```
1180    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1181    /// # use google_cloud_compute_v1::client::DiskTypes;
1182    /// let client = DiskTypes::builder().build().await?;
1183    /// # Ok(()) }
1184    /// ```
1185    pub fn builder() -> super::builder::disk_types::ClientBuilder {
1186        crate::new_client_builder(super::builder::disk_types::client::Factory)
1187    }
1188
1189    /// Creates a new client from the provided stub.
1190    ///
1191    /// The most common case for calling this function is in tests mocking the
1192    /// client's behavior.
1193    pub fn from_stub<T>(stub: T) -> Self
1194    where
1195        T: super::stub::DiskTypes + 'static,
1196    {
1197        Self {
1198            inner: std::sync::Arc::new(stub),
1199        }
1200    }
1201
1202    pub(crate) async fn new(
1203        config: gaxi::options::ClientConfig,
1204    ) -> crate::ClientBuilderResult<Self> {
1205        let inner = Self::build_inner(config).await?;
1206        Ok(Self { inner })
1207    }
1208
1209    async fn build_inner(
1210        conf: gaxi::options::ClientConfig,
1211    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::DiskTypes>> {
1212        if gaxi::options::tracing_enabled(&conf) {
1213            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1214        }
1215        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1216    }
1217
1218    async fn build_transport(
1219        conf: gaxi::options::ClientConfig,
1220    ) -> crate::ClientBuilderResult<impl super::stub::DiskTypes> {
1221        super::transport::DiskTypes::new(conf).await
1222    }
1223
1224    async fn build_with_tracing(
1225        conf: gaxi::options::ClientConfig,
1226    ) -> crate::ClientBuilderResult<impl super::stub::DiskTypes> {
1227        Self::build_transport(conf)
1228            .await
1229            .map(super::tracing::DiskTypes::new)
1230    }
1231
1232    /// Retrieves an aggregated list of disk types.
1233    ///
1234    /// To prevent failure, it is recommended that you set the
1235    /// `returnPartialSuccess` parameter to `true`.
1236    pub fn aggregated_list(&self) -> super::builder::disk_types::AggregatedList {
1237        super::builder::disk_types::AggregatedList::new(self.inner.clone())
1238    }
1239
1240    /// Returns the specified disk type.
1241    pub fn get(&self) -> super::builder::disk_types::Get {
1242        super::builder::disk_types::Get::new(self.inner.clone())
1243    }
1244
1245    /// Retrieves a list of disk types available to the specified
1246    /// project.
1247    pub fn list(&self) -> super::builder::disk_types::List {
1248        super::builder::disk_types::List::new(self.inner.clone())
1249    }
1250}
1251
1252/// Implements a client for the Google Compute Engine API.
1253///
1254/// # Example
1255/// ```
1256/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1257/// # use google_cloud_compute_v1::client::Disks;
1258/// let client = Disks::builder().build().await?;
1259/// // use `client` to make requests to the Google Compute Engine API.
1260/// # Ok(()) }
1261/// ```
1262///
1263/// # Service Description
1264///
1265/// Service for the `disks` resource.
1266///
1267/// # Configuration
1268///
1269/// To configure `Disks` use the `with_*` methods in the type returned
1270/// by [builder()][Disks::builder]. The default configuration should
1271/// work for most applications. Common configuration changes include
1272///
1273/// * [with_endpoint()]: by default this client uses the global default endpoint
1274///   (`https://compute.googleapis.com`). Applications using regional
1275///   endpoints or running in restricted networks (e.g. a network configured
1276//    with [Private Google Access with VPC Service Controls]) may want to
1277///   override this default.
1278/// * [with_credentials()]: by default this client uses
1279///   [Application Default Credentials]. Applications using custom
1280///   authentication may need to override this default.
1281///
1282/// [with_endpoint()]: super::builder::disks::ClientBuilder::with_endpoint
1283/// [with_credentials()]: super::builder::disks::ClientBuilder::credentials
1284/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1285/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1286///
1287/// # Pooling and Cloning
1288///
1289/// `Disks` holds a connection pool internally, it is advised to
1290/// create one and the reuse it.  You do not need to wrap `Disks` in
1291/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1292/// already uses an `Arc` internally.
1293#[cfg(feature = "disks")]
1294#[cfg_attr(docsrs, doc(cfg(feature = "disks")))]
1295#[derive(Clone, Debug)]
1296pub struct Disks {
1297    inner: std::sync::Arc<dyn super::stub::dynamic::Disks>,
1298}
1299
1300#[cfg(feature = "disks")]
1301impl Disks {
1302    /// Returns a builder for [Disks].
1303    ///
1304    /// ```
1305    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1306    /// # use google_cloud_compute_v1::client::Disks;
1307    /// let client = Disks::builder().build().await?;
1308    /// # Ok(()) }
1309    /// ```
1310    pub fn builder() -> super::builder::disks::ClientBuilder {
1311        crate::new_client_builder(super::builder::disks::client::Factory)
1312    }
1313
1314    /// Creates a new client from the provided stub.
1315    ///
1316    /// The most common case for calling this function is in tests mocking the
1317    /// client's behavior.
1318    pub fn from_stub<T>(stub: T) -> Self
1319    where
1320        T: super::stub::Disks + 'static,
1321    {
1322        Self {
1323            inner: std::sync::Arc::new(stub),
1324        }
1325    }
1326
1327    pub(crate) async fn new(
1328        config: gaxi::options::ClientConfig,
1329    ) -> crate::ClientBuilderResult<Self> {
1330        let inner = Self::build_inner(config).await?;
1331        Ok(Self { inner })
1332    }
1333
1334    async fn build_inner(
1335        conf: gaxi::options::ClientConfig,
1336    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Disks>> {
1337        if gaxi::options::tracing_enabled(&conf) {
1338            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1339        }
1340        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1341    }
1342
1343    async fn build_transport(
1344        conf: gaxi::options::ClientConfig,
1345    ) -> crate::ClientBuilderResult<impl super::stub::Disks> {
1346        super::transport::Disks::new(conf).await
1347    }
1348
1349    async fn build_with_tracing(
1350        conf: gaxi::options::ClientConfig,
1351    ) -> crate::ClientBuilderResult<impl super::stub::Disks> {
1352        Self::build_transport(conf)
1353            .await
1354            .map(super::tracing::Disks::new)
1355    }
1356
1357    /// Adds existing resource policies to a disk. You can only add one
1358    /// policy which will be applied to this disk for scheduling snapshot
1359    /// creation.
1360    pub fn add_resource_policies(&self) -> super::builder::disks::AddResourcePolicies {
1361        super::builder::disks::AddResourcePolicies::new(self.inner.clone())
1362    }
1363
1364    /// Retrieves an aggregated list of persistent disks.
1365    ///
1366    /// To prevent failure, it is recommended that you set the
1367    /// `returnPartialSuccess` parameter to `true`.
1368    pub fn aggregated_list(&self) -> super::builder::disks::AggregatedList {
1369        super::builder::disks::AggregatedList::new(self.inner.clone())
1370    }
1371
1372    /// Bulk create a set of disks.
1373    pub fn bulk_insert(&self) -> super::builder::disks::BulkInsert {
1374        super::builder::disks::BulkInsert::new(self.inner.clone())
1375    }
1376
1377    /// Sets the labels on many disks at once. To learn more about labels, read theLabeling
1378    /// Resources documentation.
1379    pub fn bulk_set_labels(&self) -> super::builder::disks::BulkSetLabels {
1380        super::builder::disks::BulkSetLabels::new(self.inner.clone())
1381    }
1382
1383    /// Creates a snapshot of a specified persistent disk. For regular snapshot
1384    /// creation, consider using snapshots.insert
1385    /// instead, as that method supports more features, such as creating snapshots
1386    /// in a project different from the source disk project.
1387    pub fn create_snapshot(&self) -> super::builder::disks::CreateSnapshot {
1388        super::builder::disks::CreateSnapshot::new(self.inner.clone())
1389    }
1390
1391    /// Deletes the specified persistent disk. Deleting a disk removes its data
1392    /// permanently and is irreversible. However, deleting a disk does not
1393    /// delete any snapshots
1394    /// previously made from the disk. You must separatelydelete
1395    /// snapshots.
1396    pub fn delete(&self) -> super::builder::disks::Delete {
1397        super::builder::disks::Delete::new(self.inner.clone())
1398    }
1399
1400    /// Returns the specified persistent disk.
1401    pub fn get(&self) -> super::builder::disks::Get {
1402        super::builder::disks::Get::new(self.inner.clone())
1403    }
1404
1405    /// Gets the access control policy for a resource. May be empty if no such
1406    /// policy or resource exists.
1407    pub fn get_iam_policy(&self) -> super::builder::disks::GetIamPolicy {
1408        super::builder::disks::GetIamPolicy::new(self.inner.clone())
1409    }
1410
1411    /// Creates a persistent disk in the specified project using the data
1412    /// in the request. You can create a disk from a source
1413    /// (sourceImage, sourceSnapshot, orsourceDisk) or create an empty 500 GB data disk by
1414    /// omitting all properties. You can also create a disk that is larger than
1415    /// the default size by specifying the sizeGb property.
1416    pub fn insert(&self) -> super::builder::disks::Insert {
1417        super::builder::disks::Insert::new(self.inner.clone())
1418    }
1419
1420    /// Retrieves a list of persistent disks contained within
1421    /// the specified zone.
1422    pub fn list(&self) -> super::builder::disks::List {
1423        super::builder::disks::List::new(self.inner.clone())
1424    }
1425
1426    /// Removes resource policies from a disk.
1427    pub fn remove_resource_policies(&self) -> super::builder::disks::RemoveResourcePolicies {
1428        super::builder::disks::RemoveResourcePolicies::new(self.inner.clone())
1429    }
1430
1431    /// Resizes the specified persistent disk.
1432    /// You can only increase the size of the disk.
1433    pub fn resize(&self) -> super::builder::disks::Resize {
1434        super::builder::disks::Resize::new(self.inner.clone())
1435    }
1436
1437    /// Sets the access control policy on the specified resource.
1438    /// Replaces any existing policy.
1439    pub fn set_iam_policy(&self) -> super::builder::disks::SetIamPolicy {
1440        super::builder::disks::SetIamPolicy::new(self.inner.clone())
1441    }
1442
1443    /// Sets the labels on a disk. To learn more about labels, read theLabeling
1444    /// Resources documentation.
1445    pub fn set_labels(&self) -> super::builder::disks::SetLabels {
1446        super::builder::disks::SetLabels::new(self.inner.clone())
1447    }
1448
1449    /// Starts asynchronous replication.
1450    /// Must be invoked on the primary disk.
1451    pub fn start_async_replication(&self) -> super::builder::disks::StartAsyncReplication {
1452        super::builder::disks::StartAsyncReplication::new(self.inner.clone())
1453    }
1454
1455    /// Stops asynchronous replication.
1456    /// Can be invoked either on the primary or on the secondary disk.
1457    pub fn stop_async_replication(&self) -> super::builder::disks::StopAsyncReplication {
1458        super::builder::disks::StopAsyncReplication::new(self.inner.clone())
1459    }
1460
1461    /// Stops asynchronous replication for a consistency group of disks.
1462    /// Can be invoked either in the primary or secondary scope.
1463    pub fn stop_group_async_replication(&self) -> super::builder::disks::StopGroupAsyncReplication {
1464        super::builder::disks::StopGroupAsyncReplication::new(self.inner.clone())
1465    }
1466
1467    /// Returns permissions that a caller has on the specified resource.
1468    pub fn test_iam_permissions(&self) -> super::builder::disks::TestIamPermissions {
1469        super::builder::disks::TestIamPermissions::new(self.inner.clone())
1470    }
1471
1472    /// Updates the specified disk with the data included in the request.
1473    /// The update is performed only on selected fields included as part
1474    /// of update-mask. Only the following fields can be modified: user_license.
1475    pub fn update(&self) -> super::builder::disks::Update {
1476        super::builder::disks::Update::new(self.inner.clone())
1477    }
1478
1479    /// Retrieves the specified zone-specific Operations resource.
1480    pub fn get_operation(&self) -> super::builder::disks::GetOperation {
1481        super::builder::disks::GetOperation::new(self.inner.clone())
1482    }
1483}
1484
1485/// Implements a client for the Google Compute Engine API.
1486///
1487/// # Example
1488/// ```
1489/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1490/// # use google_cloud_compute_v1::client::ExternalVpnGateways;
1491/// let client = ExternalVpnGateways::builder().build().await?;
1492/// // use `client` to make requests to the Google Compute Engine API.
1493/// # Ok(()) }
1494/// ```
1495///
1496/// # Service Description
1497///
1498/// Service for the `externalVpnGateways` resource.
1499///
1500/// # Configuration
1501///
1502/// To configure `ExternalVpnGateways` use the `with_*` methods in the type returned
1503/// by [builder()][ExternalVpnGateways::builder]. The default configuration should
1504/// work for most applications. Common configuration changes include
1505///
1506/// * [with_endpoint()]: by default this client uses the global default endpoint
1507///   (`https://compute.googleapis.com`). Applications using regional
1508///   endpoints or running in restricted networks (e.g. a network configured
1509//    with [Private Google Access with VPC Service Controls]) may want to
1510///   override this default.
1511/// * [with_credentials()]: by default this client uses
1512///   [Application Default Credentials]. Applications using custom
1513///   authentication may need to override this default.
1514///
1515/// [with_endpoint()]: super::builder::external_vpn_gateways::ClientBuilder::with_endpoint
1516/// [with_credentials()]: super::builder::external_vpn_gateways::ClientBuilder::credentials
1517/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1518/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1519///
1520/// # Pooling and Cloning
1521///
1522/// `ExternalVpnGateways` holds a connection pool internally, it is advised to
1523/// create one and the reuse it.  You do not need to wrap `ExternalVpnGateways` in
1524/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1525/// already uses an `Arc` internally.
1526#[cfg(feature = "external-vpn-gateways")]
1527#[cfg_attr(docsrs, doc(cfg(feature = "external-vpn-gateways")))]
1528#[derive(Clone, Debug)]
1529pub struct ExternalVpnGateways {
1530    inner: std::sync::Arc<dyn super::stub::dynamic::ExternalVpnGateways>,
1531}
1532
1533#[cfg(feature = "external-vpn-gateways")]
1534impl ExternalVpnGateways {
1535    /// Returns a builder for [ExternalVpnGateways].
1536    ///
1537    /// ```
1538    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1539    /// # use google_cloud_compute_v1::client::ExternalVpnGateways;
1540    /// let client = ExternalVpnGateways::builder().build().await?;
1541    /// # Ok(()) }
1542    /// ```
1543    pub fn builder() -> super::builder::external_vpn_gateways::ClientBuilder {
1544        crate::new_client_builder(super::builder::external_vpn_gateways::client::Factory)
1545    }
1546
1547    /// Creates a new client from the provided stub.
1548    ///
1549    /// The most common case for calling this function is in tests mocking the
1550    /// client's behavior.
1551    pub fn from_stub<T>(stub: T) -> Self
1552    where
1553        T: super::stub::ExternalVpnGateways + 'static,
1554    {
1555        Self {
1556            inner: std::sync::Arc::new(stub),
1557        }
1558    }
1559
1560    pub(crate) async fn new(
1561        config: gaxi::options::ClientConfig,
1562    ) -> crate::ClientBuilderResult<Self> {
1563        let inner = Self::build_inner(config).await?;
1564        Ok(Self { inner })
1565    }
1566
1567    async fn build_inner(
1568        conf: gaxi::options::ClientConfig,
1569    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ExternalVpnGateways>>
1570    {
1571        if gaxi::options::tracing_enabled(&conf) {
1572            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1573        }
1574        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1575    }
1576
1577    async fn build_transport(
1578        conf: gaxi::options::ClientConfig,
1579    ) -> crate::ClientBuilderResult<impl super::stub::ExternalVpnGateways> {
1580        super::transport::ExternalVpnGateways::new(conf).await
1581    }
1582
1583    async fn build_with_tracing(
1584        conf: gaxi::options::ClientConfig,
1585    ) -> crate::ClientBuilderResult<impl super::stub::ExternalVpnGateways> {
1586        Self::build_transport(conf)
1587            .await
1588            .map(super::tracing::ExternalVpnGateways::new)
1589    }
1590
1591    /// Deletes the specified externalVpnGateway.
1592    pub fn delete(&self) -> super::builder::external_vpn_gateways::Delete {
1593        super::builder::external_vpn_gateways::Delete::new(self.inner.clone())
1594    }
1595
1596    /// Returns the specified externalVpnGateway. Get a list of available
1597    /// externalVpnGateways by making a list() request.
1598    pub fn get(&self) -> super::builder::external_vpn_gateways::Get {
1599        super::builder::external_vpn_gateways::Get::new(self.inner.clone())
1600    }
1601
1602    /// Creates a ExternalVpnGateway in the specified project using
1603    /// the data included in the request.
1604    pub fn insert(&self) -> super::builder::external_vpn_gateways::Insert {
1605        super::builder::external_vpn_gateways::Insert::new(self.inner.clone())
1606    }
1607
1608    /// Retrieves the list of ExternalVpnGateway available to the specified
1609    /// project.
1610    pub fn list(&self) -> super::builder::external_vpn_gateways::List {
1611        super::builder::external_vpn_gateways::List::new(self.inner.clone())
1612    }
1613
1614    /// Sets the labels on an ExternalVpnGateway. To learn more about labels,
1615    /// read the Labeling
1616    /// Resources documentation.
1617    pub fn set_labels(&self) -> super::builder::external_vpn_gateways::SetLabels {
1618        super::builder::external_vpn_gateways::SetLabels::new(self.inner.clone())
1619    }
1620
1621    /// Returns permissions that a caller has on the specified resource.
1622    pub fn test_iam_permissions(
1623        &self,
1624    ) -> super::builder::external_vpn_gateways::TestIamPermissions {
1625        super::builder::external_vpn_gateways::TestIamPermissions::new(self.inner.clone())
1626    }
1627
1628    /// Retrieves the specified Operations resource.
1629    pub fn get_operation(&self) -> super::builder::external_vpn_gateways::GetOperation {
1630        super::builder::external_vpn_gateways::GetOperation::new(self.inner.clone())
1631    }
1632}
1633
1634/// Implements a client for the Google Compute Engine API.
1635///
1636/// # Example
1637/// ```
1638/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1639/// # use google_cloud_compute_v1::client::FirewallPolicies;
1640/// let client = FirewallPolicies::builder().build().await?;
1641/// // use `client` to make requests to the Google Compute Engine API.
1642/// # Ok(()) }
1643/// ```
1644///
1645/// # Service Description
1646///
1647/// Service for the `firewallPolicies` resource.
1648///
1649/// # Configuration
1650///
1651/// To configure `FirewallPolicies` use the `with_*` methods in the type returned
1652/// by [builder()][FirewallPolicies::builder]. The default configuration should
1653/// work for most applications. Common configuration changes include
1654///
1655/// * [with_endpoint()]: by default this client uses the global default endpoint
1656///   (`https://compute.googleapis.com`). Applications using regional
1657///   endpoints or running in restricted networks (e.g. a network configured
1658//    with [Private Google Access with VPC Service Controls]) may want to
1659///   override this default.
1660/// * [with_credentials()]: by default this client uses
1661///   [Application Default Credentials]. Applications using custom
1662///   authentication may need to override this default.
1663///
1664/// [with_endpoint()]: super::builder::firewall_policies::ClientBuilder::with_endpoint
1665/// [with_credentials()]: super::builder::firewall_policies::ClientBuilder::credentials
1666/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1667/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1668///
1669/// # Pooling and Cloning
1670///
1671/// `FirewallPolicies` holds a connection pool internally, it is advised to
1672/// create one and the reuse it.  You do not need to wrap `FirewallPolicies` in
1673/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1674/// already uses an `Arc` internally.
1675#[cfg(feature = "firewall-policies")]
1676#[cfg_attr(docsrs, doc(cfg(feature = "firewall-policies")))]
1677#[derive(Clone, Debug)]
1678pub struct FirewallPolicies {
1679    inner: std::sync::Arc<dyn super::stub::dynamic::FirewallPolicies>,
1680}
1681
1682#[cfg(feature = "firewall-policies")]
1683impl FirewallPolicies {
1684    /// Returns a builder for [FirewallPolicies].
1685    ///
1686    /// ```
1687    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1688    /// # use google_cloud_compute_v1::client::FirewallPolicies;
1689    /// let client = FirewallPolicies::builder().build().await?;
1690    /// # Ok(()) }
1691    /// ```
1692    pub fn builder() -> super::builder::firewall_policies::ClientBuilder {
1693        crate::new_client_builder(super::builder::firewall_policies::client::Factory)
1694    }
1695
1696    /// Creates a new client from the provided stub.
1697    ///
1698    /// The most common case for calling this function is in tests mocking the
1699    /// client's behavior.
1700    pub fn from_stub<T>(stub: T) -> Self
1701    where
1702        T: super::stub::FirewallPolicies + 'static,
1703    {
1704        Self {
1705            inner: std::sync::Arc::new(stub),
1706        }
1707    }
1708
1709    pub(crate) async fn new(
1710        config: gaxi::options::ClientConfig,
1711    ) -> crate::ClientBuilderResult<Self> {
1712        let inner = Self::build_inner(config).await?;
1713        Ok(Self { inner })
1714    }
1715
1716    async fn build_inner(
1717        conf: gaxi::options::ClientConfig,
1718    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::FirewallPolicies>>
1719    {
1720        if gaxi::options::tracing_enabled(&conf) {
1721            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1722        }
1723        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1724    }
1725
1726    async fn build_transport(
1727        conf: gaxi::options::ClientConfig,
1728    ) -> crate::ClientBuilderResult<impl super::stub::FirewallPolicies> {
1729        super::transport::FirewallPolicies::new(conf).await
1730    }
1731
1732    async fn build_with_tracing(
1733        conf: gaxi::options::ClientConfig,
1734    ) -> crate::ClientBuilderResult<impl super::stub::FirewallPolicies> {
1735        Self::build_transport(conf)
1736            .await
1737            .map(super::tracing::FirewallPolicies::new)
1738    }
1739
1740    /// Inserts an association for the specified firewall policy.
1741    pub fn add_association(&self) -> super::builder::firewall_policies::AddAssociation {
1742        super::builder::firewall_policies::AddAssociation::new(self.inner.clone())
1743    }
1744
1745    /// Inserts a rule into a firewall policy.
1746    pub fn add_rule(&self) -> super::builder::firewall_policies::AddRule {
1747        super::builder::firewall_policies::AddRule::new(self.inner.clone())
1748    }
1749
1750    /// Copies rules to the specified firewall policy.
1751    pub fn clone_rules(&self) -> super::builder::firewall_policies::CloneRules {
1752        super::builder::firewall_policies::CloneRules::new(self.inner.clone())
1753    }
1754
1755    /// Deletes the specified policy.
1756    pub fn delete(&self) -> super::builder::firewall_policies::Delete {
1757        super::builder::firewall_policies::Delete::new(self.inner.clone())
1758    }
1759
1760    /// Returns the specified firewall policy.
1761    pub fn get(&self) -> super::builder::firewall_policies::Get {
1762        super::builder::firewall_policies::Get::new(self.inner.clone())
1763    }
1764
1765    /// Gets an association with the specified name.
1766    pub fn get_association(&self) -> super::builder::firewall_policies::GetAssociation {
1767        super::builder::firewall_policies::GetAssociation::new(self.inner.clone())
1768    }
1769
1770    /// Gets the access control policy for a resource. May be empty if no such
1771    /// policy or resource exists.
1772    pub fn get_iam_policy(&self) -> super::builder::firewall_policies::GetIamPolicy {
1773        super::builder::firewall_policies::GetIamPolicy::new(self.inner.clone())
1774    }
1775
1776    /// Gets a rule of the specified priority.
1777    pub fn get_rule(&self) -> super::builder::firewall_policies::GetRule {
1778        super::builder::firewall_policies::GetRule::new(self.inner.clone())
1779    }
1780
1781    /// Creates a new policy in the specified project using the data included in
1782    /// the request.
1783    pub fn insert(&self) -> super::builder::firewall_policies::Insert {
1784        super::builder::firewall_policies::Insert::new(self.inner.clone())
1785    }
1786
1787    /// Lists all the policies that have been configured for the specified
1788    /// folder or organization.
1789    pub fn list(&self) -> super::builder::firewall_policies::List {
1790        super::builder::firewall_policies::List::new(self.inner.clone())
1791    }
1792
1793    /// Lists associations of a specified target, i.e., organization or folder.
1794    pub fn list_associations(&self) -> super::builder::firewall_policies::ListAssociations {
1795        super::builder::firewall_policies::ListAssociations::new(self.inner.clone())
1796    }
1797
1798    /// Moves the specified firewall policy.
1799    pub fn r#move(&self) -> super::builder::firewall_policies::Move {
1800        super::builder::firewall_policies::Move::new(self.inner.clone())
1801    }
1802
1803    /// Patches the specified policy with the data included in the request.
1804    pub fn patch(&self) -> super::builder::firewall_policies::Patch {
1805        super::builder::firewall_policies::Patch::new(self.inner.clone())
1806    }
1807
1808    /// Patches a rule of the specified priority.
1809    pub fn patch_rule(&self) -> super::builder::firewall_policies::PatchRule {
1810        super::builder::firewall_policies::PatchRule::new(self.inner.clone())
1811    }
1812
1813    /// Removes an association for the specified firewall policy.
1814    pub fn remove_association(&self) -> super::builder::firewall_policies::RemoveAssociation {
1815        super::builder::firewall_policies::RemoveAssociation::new(self.inner.clone())
1816    }
1817
1818    /// Deletes a rule of the specified priority.
1819    pub fn remove_rule(&self) -> super::builder::firewall_policies::RemoveRule {
1820        super::builder::firewall_policies::RemoveRule::new(self.inner.clone())
1821    }
1822
1823    /// Sets the access control policy on the specified resource.
1824    /// Replaces any existing policy.
1825    pub fn set_iam_policy(&self) -> super::builder::firewall_policies::SetIamPolicy {
1826        super::builder::firewall_policies::SetIamPolicy::new(self.inner.clone())
1827    }
1828
1829    /// Returns permissions that a caller has on the specified resource.
1830    pub fn test_iam_permissions(&self) -> super::builder::firewall_policies::TestIamPermissions {
1831        super::builder::firewall_policies::TestIamPermissions::new(self.inner.clone())
1832    }
1833
1834    /// Retrieves the specified Operations resource. Gets a list of operations
1835    /// by making a `list()` request.
1836    pub fn get_operation(&self) -> super::builder::firewall_policies::GetOperation {
1837        super::builder::firewall_policies::GetOperation::new(self.inner.clone())
1838    }
1839}
1840
1841/// Implements a client for the Google Compute Engine API.
1842///
1843/// # Example
1844/// ```
1845/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1846/// # use google_cloud_compute_v1::client::Firewalls;
1847/// let client = Firewalls::builder().build().await?;
1848/// // use `client` to make requests to the Google Compute Engine API.
1849/// # Ok(()) }
1850/// ```
1851///
1852/// # Service Description
1853///
1854/// Service for the `firewalls` resource.
1855///
1856/// # Configuration
1857///
1858/// To configure `Firewalls` use the `with_*` methods in the type returned
1859/// by [builder()][Firewalls::builder]. The default configuration should
1860/// work for most applications. Common configuration changes include
1861///
1862/// * [with_endpoint()]: by default this client uses the global default endpoint
1863///   (`https://compute.googleapis.com`). Applications using regional
1864///   endpoints or running in restricted networks (e.g. a network configured
1865//    with [Private Google Access with VPC Service Controls]) may want to
1866///   override this default.
1867/// * [with_credentials()]: by default this client uses
1868///   [Application Default Credentials]. Applications using custom
1869///   authentication may need to override this default.
1870///
1871/// [with_endpoint()]: super::builder::firewalls::ClientBuilder::with_endpoint
1872/// [with_credentials()]: super::builder::firewalls::ClientBuilder::credentials
1873/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1874/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1875///
1876/// # Pooling and Cloning
1877///
1878/// `Firewalls` holds a connection pool internally, it is advised to
1879/// create one and the reuse it.  You do not need to wrap `Firewalls` in
1880/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1881/// already uses an `Arc` internally.
1882#[cfg(feature = "firewalls")]
1883#[cfg_attr(docsrs, doc(cfg(feature = "firewalls")))]
1884#[derive(Clone, Debug)]
1885pub struct Firewalls {
1886    inner: std::sync::Arc<dyn super::stub::dynamic::Firewalls>,
1887}
1888
1889#[cfg(feature = "firewalls")]
1890impl Firewalls {
1891    /// Returns a builder for [Firewalls].
1892    ///
1893    /// ```
1894    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1895    /// # use google_cloud_compute_v1::client::Firewalls;
1896    /// let client = Firewalls::builder().build().await?;
1897    /// # Ok(()) }
1898    /// ```
1899    pub fn builder() -> super::builder::firewalls::ClientBuilder {
1900        crate::new_client_builder(super::builder::firewalls::client::Factory)
1901    }
1902
1903    /// Creates a new client from the provided stub.
1904    ///
1905    /// The most common case for calling this function is in tests mocking the
1906    /// client's behavior.
1907    pub fn from_stub<T>(stub: T) -> Self
1908    where
1909        T: super::stub::Firewalls + 'static,
1910    {
1911        Self {
1912            inner: std::sync::Arc::new(stub),
1913        }
1914    }
1915
1916    pub(crate) async fn new(
1917        config: gaxi::options::ClientConfig,
1918    ) -> crate::ClientBuilderResult<Self> {
1919        let inner = Self::build_inner(config).await?;
1920        Ok(Self { inner })
1921    }
1922
1923    async fn build_inner(
1924        conf: gaxi::options::ClientConfig,
1925    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Firewalls>> {
1926        if gaxi::options::tracing_enabled(&conf) {
1927            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1928        }
1929        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1930    }
1931
1932    async fn build_transport(
1933        conf: gaxi::options::ClientConfig,
1934    ) -> crate::ClientBuilderResult<impl super::stub::Firewalls> {
1935        super::transport::Firewalls::new(conf).await
1936    }
1937
1938    async fn build_with_tracing(
1939        conf: gaxi::options::ClientConfig,
1940    ) -> crate::ClientBuilderResult<impl super::stub::Firewalls> {
1941        Self::build_transport(conf)
1942            .await
1943            .map(super::tracing::Firewalls::new)
1944    }
1945
1946    /// Deletes the specified firewall.
1947    pub fn delete(&self) -> super::builder::firewalls::Delete {
1948        super::builder::firewalls::Delete::new(self.inner.clone())
1949    }
1950
1951    /// Returns the specified firewall.
1952    pub fn get(&self) -> super::builder::firewalls::Get {
1953        super::builder::firewalls::Get::new(self.inner.clone())
1954    }
1955
1956    /// Creates a firewall rule in the specified project using the data
1957    /// included in the request.
1958    pub fn insert(&self) -> super::builder::firewalls::Insert {
1959        super::builder::firewalls::Insert::new(self.inner.clone())
1960    }
1961
1962    /// Retrieves the list of firewall rules available to the specified
1963    /// project.
1964    pub fn list(&self) -> super::builder::firewalls::List {
1965        super::builder::firewalls::List::new(self.inner.clone())
1966    }
1967
1968    /// Updates the specified firewall rule with the data included in the
1969    /// request. This method supportsPATCH
1970    /// semantics and uses theJSON merge
1971    /// patch format and processing rules.
1972    pub fn patch(&self) -> super::builder::firewalls::Patch {
1973        super::builder::firewalls::Patch::new(self.inner.clone())
1974    }
1975
1976    /// Returns permissions that a caller has on the specified resource.
1977    pub fn test_iam_permissions(&self) -> super::builder::firewalls::TestIamPermissions {
1978        super::builder::firewalls::TestIamPermissions::new(self.inner.clone())
1979    }
1980
1981    /// Updates the specified firewall rule with the data included in the
1982    /// request.
1983    /// Note that all fields will be updated if using PUT, even fields that are not
1984    /// specified. To update individual fields, please use PATCH instead.
1985    pub fn update(&self) -> super::builder::firewalls::Update {
1986        super::builder::firewalls::Update::new(self.inner.clone())
1987    }
1988
1989    /// Retrieves the specified Operations resource.
1990    pub fn get_operation(&self) -> super::builder::firewalls::GetOperation {
1991        super::builder::firewalls::GetOperation::new(self.inner.clone())
1992    }
1993}
1994
1995/// Implements a client for the Google Compute Engine API.
1996///
1997/// # Example
1998/// ```
1999/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2000/// # use google_cloud_compute_v1::client::ForwardingRules;
2001/// let client = ForwardingRules::builder().build().await?;
2002/// // use `client` to make requests to the Google Compute Engine API.
2003/// # Ok(()) }
2004/// ```
2005///
2006/// # Service Description
2007///
2008/// Service for the `forwardingRules` resource.
2009///
2010/// # Configuration
2011///
2012/// To configure `ForwardingRules` use the `with_*` methods in the type returned
2013/// by [builder()][ForwardingRules::builder]. The default configuration should
2014/// work for most applications. Common configuration changes include
2015///
2016/// * [with_endpoint()]: by default this client uses the global default endpoint
2017///   (`https://compute.googleapis.com`). Applications using regional
2018///   endpoints or running in restricted networks (e.g. a network configured
2019//    with [Private Google Access with VPC Service Controls]) may want to
2020///   override this default.
2021/// * [with_credentials()]: by default this client uses
2022///   [Application Default Credentials]. Applications using custom
2023///   authentication may need to override this default.
2024///
2025/// [with_endpoint()]: super::builder::forwarding_rules::ClientBuilder::with_endpoint
2026/// [with_credentials()]: super::builder::forwarding_rules::ClientBuilder::credentials
2027/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2028/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2029///
2030/// # Pooling and Cloning
2031///
2032/// `ForwardingRules` holds a connection pool internally, it is advised to
2033/// create one and the reuse it.  You do not need to wrap `ForwardingRules` in
2034/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2035/// already uses an `Arc` internally.
2036#[cfg(feature = "forwarding-rules")]
2037#[cfg_attr(docsrs, doc(cfg(feature = "forwarding-rules")))]
2038#[derive(Clone, Debug)]
2039pub struct ForwardingRules {
2040    inner: std::sync::Arc<dyn super::stub::dynamic::ForwardingRules>,
2041}
2042
2043#[cfg(feature = "forwarding-rules")]
2044impl ForwardingRules {
2045    /// Returns a builder for [ForwardingRules].
2046    ///
2047    /// ```
2048    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2049    /// # use google_cloud_compute_v1::client::ForwardingRules;
2050    /// let client = ForwardingRules::builder().build().await?;
2051    /// # Ok(()) }
2052    /// ```
2053    pub fn builder() -> super::builder::forwarding_rules::ClientBuilder {
2054        crate::new_client_builder(super::builder::forwarding_rules::client::Factory)
2055    }
2056
2057    /// Creates a new client from the provided stub.
2058    ///
2059    /// The most common case for calling this function is in tests mocking the
2060    /// client's behavior.
2061    pub fn from_stub<T>(stub: T) -> Self
2062    where
2063        T: super::stub::ForwardingRules + 'static,
2064    {
2065        Self {
2066            inner: std::sync::Arc::new(stub),
2067        }
2068    }
2069
2070    pub(crate) async fn new(
2071        config: gaxi::options::ClientConfig,
2072    ) -> crate::ClientBuilderResult<Self> {
2073        let inner = Self::build_inner(config).await?;
2074        Ok(Self { inner })
2075    }
2076
2077    async fn build_inner(
2078        conf: gaxi::options::ClientConfig,
2079    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ForwardingRules>> {
2080        if gaxi::options::tracing_enabled(&conf) {
2081            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2082        }
2083        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2084    }
2085
2086    async fn build_transport(
2087        conf: gaxi::options::ClientConfig,
2088    ) -> crate::ClientBuilderResult<impl super::stub::ForwardingRules> {
2089        super::transport::ForwardingRules::new(conf).await
2090    }
2091
2092    async fn build_with_tracing(
2093        conf: gaxi::options::ClientConfig,
2094    ) -> crate::ClientBuilderResult<impl super::stub::ForwardingRules> {
2095        Self::build_transport(conf)
2096            .await
2097            .map(super::tracing::ForwardingRules::new)
2098    }
2099
2100    /// Retrieves an aggregated list of forwarding rules.
2101    ///
2102    /// To prevent failure, it is recommended that you set the
2103    /// `returnPartialSuccess` parameter to `true`.
2104    pub fn aggregated_list(&self) -> super::builder::forwarding_rules::AggregatedList {
2105        super::builder::forwarding_rules::AggregatedList::new(self.inner.clone())
2106    }
2107
2108    /// Deletes the specified ForwardingRule resource.
2109    pub fn delete(&self) -> super::builder::forwarding_rules::Delete {
2110        super::builder::forwarding_rules::Delete::new(self.inner.clone())
2111    }
2112
2113    /// Returns the specified ForwardingRule resource.
2114    pub fn get(&self) -> super::builder::forwarding_rules::Get {
2115        super::builder::forwarding_rules::Get::new(self.inner.clone())
2116    }
2117
2118    /// Creates a ForwardingRule resource in the specified project and region using
2119    /// the data included in the request.
2120    pub fn insert(&self) -> super::builder::forwarding_rules::Insert {
2121        super::builder::forwarding_rules::Insert::new(self.inner.clone())
2122    }
2123
2124    /// Retrieves a list of ForwardingRule resources available to the specified
2125    /// project and region.
2126    pub fn list(&self) -> super::builder::forwarding_rules::List {
2127        super::builder::forwarding_rules::List::new(self.inner.clone())
2128    }
2129
2130    /// Updates the specified forwarding rule with the data included in the
2131    /// request. This method supportsPATCH
2132    /// semantics and uses theJSON merge
2133    /// patch format and processing rules. Currently, you can only
2134    /// patch the network_tier field.
2135    pub fn patch(&self) -> super::builder::forwarding_rules::Patch {
2136        super::builder::forwarding_rules::Patch::new(self.inner.clone())
2137    }
2138
2139    /// Sets the labels on the specified resource. To learn more about labels,
2140    /// read the
2141    /// Labeling Resources documentation.
2142    pub fn set_labels(&self) -> super::builder::forwarding_rules::SetLabels {
2143        super::builder::forwarding_rules::SetLabels::new(self.inner.clone())
2144    }
2145
2146    /// Changes target URL for forwarding rule. The new target should be of the
2147    /// same type as the old target.
2148    pub fn set_target(&self) -> super::builder::forwarding_rules::SetTarget {
2149        super::builder::forwarding_rules::SetTarget::new(self.inner.clone())
2150    }
2151
2152    /// Retrieves the specified region-specific Operations resource.
2153    pub fn get_operation(&self) -> super::builder::forwarding_rules::GetOperation {
2154        super::builder::forwarding_rules::GetOperation::new(self.inner.clone())
2155    }
2156}
2157
2158/// Implements a client for the Google Compute Engine API.
2159///
2160/// # Example
2161/// ```
2162/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2163/// # use google_cloud_compute_v1::client::FutureReservations;
2164/// let client = FutureReservations::builder().build().await?;
2165/// // use `client` to make requests to the Google Compute Engine API.
2166/// # Ok(()) }
2167/// ```
2168///
2169/// # Service Description
2170///
2171/// Service for the `futureReservations` resource.
2172///
2173/// # Configuration
2174///
2175/// To configure `FutureReservations` use the `with_*` methods in the type returned
2176/// by [builder()][FutureReservations::builder]. The default configuration should
2177/// work for most applications. Common configuration changes include
2178///
2179/// * [with_endpoint()]: by default this client uses the global default endpoint
2180///   (`https://compute.googleapis.com`). Applications using regional
2181///   endpoints or running in restricted networks (e.g. a network configured
2182//    with [Private Google Access with VPC Service Controls]) may want to
2183///   override this default.
2184/// * [with_credentials()]: by default this client uses
2185///   [Application Default Credentials]. Applications using custom
2186///   authentication may need to override this default.
2187///
2188/// [with_endpoint()]: super::builder::future_reservations::ClientBuilder::with_endpoint
2189/// [with_credentials()]: super::builder::future_reservations::ClientBuilder::credentials
2190/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2191/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2192///
2193/// # Pooling and Cloning
2194///
2195/// `FutureReservations` holds a connection pool internally, it is advised to
2196/// create one and the reuse it.  You do not need to wrap `FutureReservations` in
2197/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2198/// already uses an `Arc` internally.
2199#[cfg(feature = "future-reservations")]
2200#[cfg_attr(docsrs, doc(cfg(feature = "future-reservations")))]
2201#[derive(Clone, Debug)]
2202pub struct FutureReservations {
2203    inner: std::sync::Arc<dyn super::stub::dynamic::FutureReservations>,
2204}
2205
2206#[cfg(feature = "future-reservations")]
2207impl FutureReservations {
2208    /// Returns a builder for [FutureReservations].
2209    ///
2210    /// ```
2211    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2212    /// # use google_cloud_compute_v1::client::FutureReservations;
2213    /// let client = FutureReservations::builder().build().await?;
2214    /// # Ok(()) }
2215    /// ```
2216    pub fn builder() -> super::builder::future_reservations::ClientBuilder {
2217        crate::new_client_builder(super::builder::future_reservations::client::Factory)
2218    }
2219
2220    /// Creates a new client from the provided stub.
2221    ///
2222    /// The most common case for calling this function is in tests mocking the
2223    /// client's behavior.
2224    pub fn from_stub<T>(stub: T) -> Self
2225    where
2226        T: super::stub::FutureReservations + 'static,
2227    {
2228        Self {
2229            inner: std::sync::Arc::new(stub),
2230        }
2231    }
2232
2233    pub(crate) async fn new(
2234        config: gaxi::options::ClientConfig,
2235    ) -> crate::ClientBuilderResult<Self> {
2236        let inner = Self::build_inner(config).await?;
2237        Ok(Self { inner })
2238    }
2239
2240    async fn build_inner(
2241        conf: gaxi::options::ClientConfig,
2242    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::FutureReservations>>
2243    {
2244        if gaxi::options::tracing_enabled(&conf) {
2245            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2246        }
2247        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2248    }
2249
2250    async fn build_transport(
2251        conf: gaxi::options::ClientConfig,
2252    ) -> crate::ClientBuilderResult<impl super::stub::FutureReservations> {
2253        super::transport::FutureReservations::new(conf).await
2254    }
2255
2256    async fn build_with_tracing(
2257        conf: gaxi::options::ClientConfig,
2258    ) -> crate::ClientBuilderResult<impl super::stub::FutureReservations> {
2259        Self::build_transport(conf)
2260            .await
2261            .map(super::tracing::FutureReservations::new)
2262    }
2263
2264    /// Retrieves an aggregated list of future reservations.
2265    ///
2266    /// To prevent failure, it is recommended that you set the
2267    /// `returnPartialSuccess` parameter to `true`.
2268    pub fn aggregated_list(&self) -> super::builder::future_reservations::AggregatedList {
2269        super::builder::future_reservations::AggregatedList::new(self.inner.clone())
2270    }
2271
2272    /// Cancel the specified future reservation.
2273    pub fn cancel(&self) -> super::builder::future_reservations::Cancel {
2274        super::builder::future_reservations::Cancel::new(self.inner.clone())
2275    }
2276
2277    /// Deletes the specified future reservation.
2278    pub fn delete(&self) -> super::builder::future_reservations::Delete {
2279        super::builder::future_reservations::Delete::new(self.inner.clone())
2280    }
2281
2282    /// Retrieves information about the specified future reservation.
2283    pub fn get(&self) -> super::builder::future_reservations::Get {
2284        super::builder::future_reservations::Get::new(self.inner.clone())
2285    }
2286
2287    /// Creates a new Future Reservation.
2288    pub fn insert(&self) -> super::builder::future_reservations::Insert {
2289        super::builder::future_reservations::Insert::new(self.inner.clone())
2290    }
2291
2292    /// A list of all the future reservations that have been configured for the
2293    /// specified project in specified zone.
2294    pub fn list(&self) -> super::builder::future_reservations::List {
2295        super::builder::future_reservations::List::new(self.inner.clone())
2296    }
2297
2298    /// Updates the specified future reservation.
2299    pub fn update(&self) -> super::builder::future_reservations::Update {
2300        super::builder::future_reservations::Update::new(self.inner.clone())
2301    }
2302
2303    /// Retrieves the specified zone-specific Operations resource.
2304    pub fn get_operation(&self) -> super::builder::future_reservations::GetOperation {
2305        super::builder::future_reservations::GetOperation::new(self.inner.clone())
2306    }
2307}
2308
2309/// Implements a client for the Google Compute Engine API.
2310///
2311/// # Example
2312/// ```
2313/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2314/// # use google_cloud_compute_v1::client::GlobalAddresses;
2315/// let client = GlobalAddresses::builder().build().await?;
2316/// // use `client` to make requests to the Google Compute Engine API.
2317/// # Ok(()) }
2318/// ```
2319///
2320/// # Service Description
2321///
2322/// Service for the `globalAddresses` resource.
2323///
2324/// # Configuration
2325///
2326/// To configure `GlobalAddresses` use the `with_*` methods in the type returned
2327/// by [builder()][GlobalAddresses::builder]. The default configuration should
2328/// work for most applications. Common configuration changes include
2329///
2330/// * [with_endpoint()]: by default this client uses the global default endpoint
2331///   (`https://compute.googleapis.com`). Applications using regional
2332///   endpoints or running in restricted networks (e.g. a network configured
2333//    with [Private Google Access with VPC Service Controls]) may want to
2334///   override this default.
2335/// * [with_credentials()]: by default this client uses
2336///   [Application Default Credentials]. Applications using custom
2337///   authentication may need to override this default.
2338///
2339/// [with_endpoint()]: super::builder::global_addresses::ClientBuilder::with_endpoint
2340/// [with_credentials()]: super::builder::global_addresses::ClientBuilder::credentials
2341/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2342/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2343///
2344/// # Pooling and Cloning
2345///
2346/// `GlobalAddresses` holds a connection pool internally, it is advised to
2347/// create one and the reuse it.  You do not need to wrap `GlobalAddresses` in
2348/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2349/// already uses an `Arc` internally.
2350#[cfg(feature = "global-addresses")]
2351#[cfg_attr(docsrs, doc(cfg(feature = "global-addresses")))]
2352#[derive(Clone, Debug)]
2353pub struct GlobalAddresses {
2354    inner: std::sync::Arc<dyn super::stub::dynamic::GlobalAddresses>,
2355}
2356
2357#[cfg(feature = "global-addresses")]
2358impl GlobalAddresses {
2359    /// Returns a builder for [GlobalAddresses].
2360    ///
2361    /// ```
2362    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2363    /// # use google_cloud_compute_v1::client::GlobalAddresses;
2364    /// let client = GlobalAddresses::builder().build().await?;
2365    /// # Ok(()) }
2366    /// ```
2367    pub fn builder() -> super::builder::global_addresses::ClientBuilder {
2368        crate::new_client_builder(super::builder::global_addresses::client::Factory)
2369    }
2370
2371    /// Creates a new client from the provided stub.
2372    ///
2373    /// The most common case for calling this function is in tests mocking the
2374    /// client's behavior.
2375    pub fn from_stub<T>(stub: T) -> Self
2376    where
2377        T: super::stub::GlobalAddresses + 'static,
2378    {
2379        Self {
2380            inner: std::sync::Arc::new(stub),
2381        }
2382    }
2383
2384    pub(crate) async fn new(
2385        config: gaxi::options::ClientConfig,
2386    ) -> crate::ClientBuilderResult<Self> {
2387        let inner = Self::build_inner(config).await?;
2388        Ok(Self { inner })
2389    }
2390
2391    async fn build_inner(
2392        conf: gaxi::options::ClientConfig,
2393    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::GlobalAddresses>> {
2394        if gaxi::options::tracing_enabled(&conf) {
2395            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2396        }
2397        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2398    }
2399
2400    async fn build_transport(
2401        conf: gaxi::options::ClientConfig,
2402    ) -> crate::ClientBuilderResult<impl super::stub::GlobalAddresses> {
2403        super::transport::GlobalAddresses::new(conf).await
2404    }
2405
2406    async fn build_with_tracing(
2407        conf: gaxi::options::ClientConfig,
2408    ) -> crate::ClientBuilderResult<impl super::stub::GlobalAddresses> {
2409        Self::build_transport(conf)
2410            .await
2411            .map(super::tracing::GlobalAddresses::new)
2412    }
2413
2414    /// Deletes the specified address resource.
2415    pub fn delete(&self) -> super::builder::global_addresses::Delete {
2416        super::builder::global_addresses::Delete::new(self.inner.clone())
2417    }
2418
2419    /// Returns the specified address resource.
2420    pub fn get(&self) -> super::builder::global_addresses::Get {
2421        super::builder::global_addresses::Get::new(self.inner.clone())
2422    }
2423
2424    /// Creates an address resource in the specified project by using the data
2425    /// included in the request.
2426    pub fn insert(&self) -> super::builder::global_addresses::Insert {
2427        super::builder::global_addresses::Insert::new(self.inner.clone())
2428    }
2429
2430    /// Retrieves a list of global addresses.
2431    pub fn list(&self) -> super::builder::global_addresses::List {
2432        super::builder::global_addresses::List::new(self.inner.clone())
2433    }
2434
2435    /// Moves the specified address resource from one project to another project.
2436    pub fn r#move(&self) -> super::builder::global_addresses::Move {
2437        super::builder::global_addresses::Move::new(self.inner.clone())
2438    }
2439
2440    /// Sets the labels on a GlobalAddress. To learn more about labels, read theLabeling
2441    /// Resources documentation.
2442    pub fn set_labels(&self) -> super::builder::global_addresses::SetLabels {
2443        super::builder::global_addresses::SetLabels::new(self.inner.clone())
2444    }
2445
2446    /// Returns permissions that a caller has on the specified resource.
2447    pub fn test_iam_permissions(&self) -> super::builder::global_addresses::TestIamPermissions {
2448        super::builder::global_addresses::TestIamPermissions::new(self.inner.clone())
2449    }
2450
2451    /// Retrieves the specified Operations resource.
2452    pub fn get_operation(&self) -> super::builder::global_addresses::GetOperation {
2453        super::builder::global_addresses::GetOperation::new(self.inner.clone())
2454    }
2455}
2456
2457/// Implements a client for the Google Compute Engine API.
2458///
2459/// # Example
2460/// ```
2461/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2462/// # use google_cloud_compute_v1::client::GlobalForwardingRules;
2463/// let client = GlobalForwardingRules::builder().build().await?;
2464/// // use `client` to make requests to the Google Compute Engine API.
2465/// # Ok(()) }
2466/// ```
2467///
2468/// # Service Description
2469///
2470/// Service for the `globalForwardingRules` resource.
2471///
2472/// # Configuration
2473///
2474/// To configure `GlobalForwardingRules` use the `with_*` methods in the type returned
2475/// by [builder()][GlobalForwardingRules::builder]. The default configuration should
2476/// work for most applications. Common configuration changes include
2477///
2478/// * [with_endpoint()]: by default this client uses the global default endpoint
2479///   (`https://compute.googleapis.com`). Applications using regional
2480///   endpoints or running in restricted networks (e.g. a network configured
2481//    with [Private Google Access with VPC Service Controls]) may want to
2482///   override this default.
2483/// * [with_credentials()]: by default this client uses
2484///   [Application Default Credentials]. Applications using custom
2485///   authentication may need to override this default.
2486///
2487/// [with_endpoint()]: super::builder::global_forwarding_rules::ClientBuilder::with_endpoint
2488/// [with_credentials()]: super::builder::global_forwarding_rules::ClientBuilder::credentials
2489/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2490/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2491///
2492/// # Pooling and Cloning
2493///
2494/// `GlobalForwardingRules` holds a connection pool internally, it is advised to
2495/// create one and the reuse it.  You do not need to wrap `GlobalForwardingRules` in
2496/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2497/// already uses an `Arc` internally.
2498#[cfg(feature = "global-forwarding-rules")]
2499#[cfg_attr(docsrs, doc(cfg(feature = "global-forwarding-rules")))]
2500#[derive(Clone, Debug)]
2501pub struct GlobalForwardingRules {
2502    inner: std::sync::Arc<dyn super::stub::dynamic::GlobalForwardingRules>,
2503}
2504
2505#[cfg(feature = "global-forwarding-rules")]
2506impl GlobalForwardingRules {
2507    /// Returns a builder for [GlobalForwardingRules].
2508    ///
2509    /// ```
2510    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2511    /// # use google_cloud_compute_v1::client::GlobalForwardingRules;
2512    /// let client = GlobalForwardingRules::builder().build().await?;
2513    /// # Ok(()) }
2514    /// ```
2515    pub fn builder() -> super::builder::global_forwarding_rules::ClientBuilder {
2516        crate::new_client_builder(super::builder::global_forwarding_rules::client::Factory)
2517    }
2518
2519    /// Creates a new client from the provided stub.
2520    ///
2521    /// The most common case for calling this function is in tests mocking the
2522    /// client's behavior.
2523    pub fn from_stub<T>(stub: T) -> Self
2524    where
2525        T: super::stub::GlobalForwardingRules + 'static,
2526    {
2527        Self {
2528            inner: std::sync::Arc::new(stub),
2529        }
2530    }
2531
2532    pub(crate) async fn new(
2533        config: gaxi::options::ClientConfig,
2534    ) -> crate::ClientBuilderResult<Self> {
2535        let inner = Self::build_inner(config).await?;
2536        Ok(Self { inner })
2537    }
2538
2539    async fn build_inner(
2540        conf: gaxi::options::ClientConfig,
2541    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::GlobalForwardingRules>>
2542    {
2543        if gaxi::options::tracing_enabled(&conf) {
2544            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2545        }
2546        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2547    }
2548
2549    async fn build_transport(
2550        conf: gaxi::options::ClientConfig,
2551    ) -> crate::ClientBuilderResult<impl super::stub::GlobalForwardingRules> {
2552        super::transport::GlobalForwardingRules::new(conf).await
2553    }
2554
2555    async fn build_with_tracing(
2556        conf: gaxi::options::ClientConfig,
2557    ) -> crate::ClientBuilderResult<impl super::stub::GlobalForwardingRules> {
2558        Self::build_transport(conf)
2559            .await
2560            .map(super::tracing::GlobalForwardingRules::new)
2561    }
2562
2563    /// Deletes the specified GlobalForwardingRule resource.
2564    pub fn delete(&self) -> super::builder::global_forwarding_rules::Delete {
2565        super::builder::global_forwarding_rules::Delete::new(self.inner.clone())
2566    }
2567
2568    /// Returns the specified GlobalForwardingRule resource. Gets a list of
2569    /// available forwarding rules by making a list() request.
2570    pub fn get(&self) -> super::builder::global_forwarding_rules::Get {
2571        super::builder::global_forwarding_rules::Get::new(self.inner.clone())
2572    }
2573
2574    /// Creates a GlobalForwardingRule resource in the specified project using
2575    /// the data included in the request.
2576    pub fn insert(&self) -> super::builder::global_forwarding_rules::Insert {
2577        super::builder::global_forwarding_rules::Insert::new(self.inner.clone())
2578    }
2579
2580    /// Retrieves a list of GlobalForwardingRule resources available to the
2581    /// specified project.
2582    pub fn list(&self) -> super::builder::global_forwarding_rules::List {
2583        super::builder::global_forwarding_rules::List::new(self.inner.clone())
2584    }
2585
2586    /// Updates the specified forwarding rule with the data included in the
2587    /// request. This method supportsPATCH
2588    /// semantics and uses theJSON merge
2589    /// patch format and processing rules. Currently, you can only
2590    /// patch the network_tier field.
2591    pub fn patch(&self) -> super::builder::global_forwarding_rules::Patch {
2592        super::builder::global_forwarding_rules::Patch::new(self.inner.clone())
2593    }
2594
2595    /// Sets the labels on the specified resource. To learn more about labels,
2596    /// read the
2597    /// Labeling resources documentation.
2598    pub fn set_labels(&self) -> super::builder::global_forwarding_rules::SetLabels {
2599        super::builder::global_forwarding_rules::SetLabels::new(self.inner.clone())
2600    }
2601
2602    /// Changes target URL for the GlobalForwardingRule resource. The new target
2603    /// should be of the same type as the old target.
2604    pub fn set_target(&self) -> super::builder::global_forwarding_rules::SetTarget {
2605        super::builder::global_forwarding_rules::SetTarget::new(self.inner.clone())
2606    }
2607
2608    /// Retrieves the specified Operations resource.
2609    pub fn get_operation(&self) -> super::builder::global_forwarding_rules::GetOperation {
2610        super::builder::global_forwarding_rules::GetOperation::new(self.inner.clone())
2611    }
2612}
2613
2614/// Implements a client for the Google Compute Engine API.
2615///
2616/// # Example
2617/// ```
2618/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2619/// # use google_cloud_compute_v1::client::GlobalNetworkEndpointGroups;
2620/// let client = GlobalNetworkEndpointGroups::builder().build().await?;
2621/// // use `client` to make requests to the Google Compute Engine API.
2622/// # Ok(()) }
2623/// ```
2624///
2625/// # Service Description
2626///
2627/// Service for the `globalNetworkEndpointGroups` resource.
2628///
2629/// # Configuration
2630///
2631/// To configure `GlobalNetworkEndpointGroups` use the `with_*` methods in the type returned
2632/// by [builder()][GlobalNetworkEndpointGroups::builder]. The default configuration should
2633/// work for most applications. Common configuration changes include
2634///
2635/// * [with_endpoint()]: by default this client uses the global default endpoint
2636///   (`https://compute.googleapis.com`). Applications using regional
2637///   endpoints or running in restricted networks (e.g. a network configured
2638//    with [Private Google Access with VPC Service Controls]) may want to
2639///   override this default.
2640/// * [with_credentials()]: by default this client uses
2641///   [Application Default Credentials]. Applications using custom
2642///   authentication may need to override this default.
2643///
2644/// [with_endpoint()]: super::builder::global_network_endpoint_groups::ClientBuilder::with_endpoint
2645/// [with_credentials()]: super::builder::global_network_endpoint_groups::ClientBuilder::credentials
2646/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2647/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2648///
2649/// # Pooling and Cloning
2650///
2651/// `GlobalNetworkEndpointGroups` holds a connection pool internally, it is advised to
2652/// create one and the reuse it.  You do not need to wrap `GlobalNetworkEndpointGroups` in
2653/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2654/// already uses an `Arc` internally.
2655#[cfg(feature = "global-network-endpoint-groups")]
2656#[cfg_attr(docsrs, doc(cfg(feature = "global-network-endpoint-groups")))]
2657#[derive(Clone, Debug)]
2658pub struct GlobalNetworkEndpointGroups {
2659    inner: std::sync::Arc<dyn super::stub::dynamic::GlobalNetworkEndpointGroups>,
2660}
2661
2662#[cfg(feature = "global-network-endpoint-groups")]
2663impl GlobalNetworkEndpointGroups {
2664    /// Returns a builder for [GlobalNetworkEndpointGroups].
2665    ///
2666    /// ```
2667    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2668    /// # use google_cloud_compute_v1::client::GlobalNetworkEndpointGroups;
2669    /// let client = GlobalNetworkEndpointGroups::builder().build().await?;
2670    /// # Ok(()) }
2671    /// ```
2672    pub fn builder() -> super::builder::global_network_endpoint_groups::ClientBuilder {
2673        crate::new_client_builder(super::builder::global_network_endpoint_groups::client::Factory)
2674    }
2675
2676    /// Creates a new client from the provided stub.
2677    ///
2678    /// The most common case for calling this function is in tests mocking the
2679    /// client's behavior.
2680    pub fn from_stub<T>(stub: T) -> Self
2681    where
2682        T: super::stub::GlobalNetworkEndpointGroups + 'static,
2683    {
2684        Self {
2685            inner: std::sync::Arc::new(stub),
2686        }
2687    }
2688
2689    pub(crate) async fn new(
2690        config: gaxi::options::ClientConfig,
2691    ) -> crate::ClientBuilderResult<Self> {
2692        let inner = Self::build_inner(config).await?;
2693        Ok(Self { inner })
2694    }
2695
2696    async fn build_inner(
2697        conf: gaxi::options::ClientConfig,
2698    ) -> crate::ClientBuilderResult<
2699        std::sync::Arc<dyn super::stub::dynamic::GlobalNetworkEndpointGroups>,
2700    > {
2701        if gaxi::options::tracing_enabled(&conf) {
2702            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2703        }
2704        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2705    }
2706
2707    async fn build_transport(
2708        conf: gaxi::options::ClientConfig,
2709    ) -> crate::ClientBuilderResult<impl super::stub::GlobalNetworkEndpointGroups> {
2710        super::transport::GlobalNetworkEndpointGroups::new(conf).await
2711    }
2712
2713    async fn build_with_tracing(
2714        conf: gaxi::options::ClientConfig,
2715    ) -> crate::ClientBuilderResult<impl super::stub::GlobalNetworkEndpointGroups> {
2716        Self::build_transport(conf)
2717            .await
2718            .map(super::tracing::GlobalNetworkEndpointGroups::new)
2719    }
2720
2721    /// Attach a network endpoint to the specified network endpoint group.
2722    pub fn attach_network_endpoints(
2723        &self,
2724    ) -> super::builder::global_network_endpoint_groups::AttachNetworkEndpoints {
2725        super::builder::global_network_endpoint_groups::AttachNetworkEndpoints::new(
2726            self.inner.clone(),
2727        )
2728    }
2729
2730    /// Deletes the specified network endpoint group.Note that the NEG cannot be
2731    /// deleted if there are backend services referencing it.
2732    pub fn delete(&self) -> super::builder::global_network_endpoint_groups::Delete {
2733        super::builder::global_network_endpoint_groups::Delete::new(self.inner.clone())
2734    }
2735
2736    /// Detach the network endpoint from the specified network endpoint group.
2737    pub fn detach_network_endpoints(
2738        &self,
2739    ) -> super::builder::global_network_endpoint_groups::DetachNetworkEndpoints {
2740        super::builder::global_network_endpoint_groups::DetachNetworkEndpoints::new(
2741            self.inner.clone(),
2742        )
2743    }
2744
2745    /// Returns the specified network endpoint group.
2746    pub fn get(&self) -> super::builder::global_network_endpoint_groups::Get {
2747        super::builder::global_network_endpoint_groups::Get::new(self.inner.clone())
2748    }
2749
2750    /// Creates a network endpoint group in the specified project using the
2751    /// parameters that are included in the request.
2752    ///
2753    /// Note: Use the following APIs to manage network endpoint groups:
2754    ///
2755    /// - To manage NEGs with zonal scope (such as zonal NEGs, hybrid connectivity
2756    ///   NEGs): zonal
2757    ///   API
2758    /// - To manage NEGs with regional scope (such as regional internet NEGs,
2759    ///   serverless NEGs, Private Service Connect NEGs): regional
2760    ///   API
2761    /// - To manage NEGs with global scope (such as global internet NEGs):global
2762    ///   API
2763    pub fn insert(&self) -> super::builder::global_network_endpoint_groups::Insert {
2764        super::builder::global_network_endpoint_groups::Insert::new(self.inner.clone())
2765    }
2766
2767    /// Retrieves the list of network endpoint groups that are located in the
2768    /// specified project.
2769    pub fn list(&self) -> super::builder::global_network_endpoint_groups::List {
2770        super::builder::global_network_endpoint_groups::List::new(self.inner.clone())
2771    }
2772
2773    /// Lists the network endpoints in the specified network endpoint group.
2774    pub fn list_network_endpoints(
2775        &self,
2776    ) -> super::builder::global_network_endpoint_groups::ListNetworkEndpoints {
2777        super::builder::global_network_endpoint_groups::ListNetworkEndpoints::new(
2778            self.inner.clone(),
2779        )
2780    }
2781
2782    /// Retrieves the specified Operations resource.
2783    pub fn get_operation(&self) -> super::builder::global_network_endpoint_groups::GetOperation {
2784        super::builder::global_network_endpoint_groups::GetOperation::new(self.inner.clone())
2785    }
2786}
2787
2788/// Implements a client for the Google Compute Engine API.
2789///
2790/// # Example
2791/// ```
2792/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2793/// # use google_cloud_compute_v1::client::GlobalOperations;
2794/// let client = GlobalOperations::builder().build().await?;
2795/// // use `client` to make requests to the Google Compute Engine API.
2796/// # Ok(()) }
2797/// ```
2798///
2799/// # Service Description
2800///
2801/// Service for the `globalOperations` resource.
2802///
2803/// # Configuration
2804///
2805/// To configure `GlobalOperations` use the `with_*` methods in the type returned
2806/// by [builder()][GlobalOperations::builder]. The default configuration should
2807/// work for most applications. Common configuration changes include
2808///
2809/// * [with_endpoint()]: by default this client uses the global default endpoint
2810///   (`https://compute.googleapis.com`). Applications using regional
2811///   endpoints or running in restricted networks (e.g. a network configured
2812//    with [Private Google Access with VPC Service Controls]) may want to
2813///   override this default.
2814/// * [with_credentials()]: by default this client uses
2815///   [Application Default Credentials]. Applications using custom
2816///   authentication may need to override this default.
2817///
2818/// [with_endpoint()]: super::builder::global_operations::ClientBuilder::with_endpoint
2819/// [with_credentials()]: super::builder::global_operations::ClientBuilder::credentials
2820/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2821/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2822///
2823/// # Pooling and Cloning
2824///
2825/// `GlobalOperations` holds a connection pool internally, it is advised to
2826/// create one and the reuse it.  You do not need to wrap `GlobalOperations` in
2827/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2828/// already uses an `Arc` internally.
2829#[cfg(feature = "global-operations")]
2830#[cfg_attr(docsrs, doc(cfg(feature = "global-operations")))]
2831#[derive(Clone, Debug)]
2832pub struct GlobalOperations {
2833    inner: std::sync::Arc<dyn super::stub::dynamic::GlobalOperations>,
2834}
2835
2836#[cfg(feature = "global-operations")]
2837impl GlobalOperations {
2838    /// Returns a builder for [GlobalOperations].
2839    ///
2840    /// ```
2841    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2842    /// # use google_cloud_compute_v1::client::GlobalOperations;
2843    /// let client = GlobalOperations::builder().build().await?;
2844    /// # Ok(()) }
2845    /// ```
2846    pub fn builder() -> super::builder::global_operations::ClientBuilder {
2847        crate::new_client_builder(super::builder::global_operations::client::Factory)
2848    }
2849
2850    /// Creates a new client from the provided stub.
2851    ///
2852    /// The most common case for calling this function is in tests mocking the
2853    /// client's behavior.
2854    pub fn from_stub<T>(stub: T) -> Self
2855    where
2856        T: super::stub::GlobalOperations + 'static,
2857    {
2858        Self {
2859            inner: std::sync::Arc::new(stub),
2860        }
2861    }
2862
2863    pub(crate) async fn new(
2864        config: gaxi::options::ClientConfig,
2865    ) -> crate::ClientBuilderResult<Self> {
2866        let inner = Self::build_inner(config).await?;
2867        Ok(Self { inner })
2868    }
2869
2870    async fn build_inner(
2871        conf: gaxi::options::ClientConfig,
2872    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::GlobalOperations>>
2873    {
2874        if gaxi::options::tracing_enabled(&conf) {
2875            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2876        }
2877        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2878    }
2879
2880    async fn build_transport(
2881        conf: gaxi::options::ClientConfig,
2882    ) -> crate::ClientBuilderResult<impl super::stub::GlobalOperations> {
2883        super::transport::GlobalOperations::new(conf).await
2884    }
2885
2886    async fn build_with_tracing(
2887        conf: gaxi::options::ClientConfig,
2888    ) -> crate::ClientBuilderResult<impl super::stub::GlobalOperations> {
2889        Self::build_transport(conf)
2890            .await
2891            .map(super::tracing::GlobalOperations::new)
2892    }
2893
2894    /// Retrieves an aggregated list of all operations.
2895    ///
2896    /// To prevent failure, Google recommends that you set the
2897    /// `returnPartialSuccess` parameter to `true`.
2898    pub fn aggregated_list(&self) -> super::builder::global_operations::AggregatedList {
2899        super::builder::global_operations::AggregatedList::new(self.inner.clone())
2900    }
2901
2902    /// Deletes the specified Operations resource.
2903    pub fn delete(&self) -> super::builder::global_operations::Delete {
2904        super::builder::global_operations::Delete::new(self.inner.clone())
2905    }
2906
2907    /// Retrieves the specified Operations resource.
2908    pub fn get(&self) -> super::builder::global_operations::Get {
2909        super::builder::global_operations::Get::new(self.inner.clone())
2910    }
2911
2912    /// Retrieves a list of Operation resources contained within the specified
2913    /// project.
2914    pub fn list(&self) -> super::builder::global_operations::List {
2915        super::builder::global_operations::List::new(self.inner.clone())
2916    }
2917
2918    /// Waits for the specified Operation resource to return as `DONE`
2919    /// or for the request to approach the 2 minute deadline, and retrieves the
2920    /// specified Operation resource. This method differs from the
2921    /// `GET` method in that it waits for no more than the default
2922    /// deadline (2 minutes) and then returns the current state of the operation,
2923    /// which might be `DONE` or still in progress.
2924    ///
2925    /// This method is called on a best-effort basis. Specifically:
2926    ///
2927    /// ```norust
2928    /// - In uncommon cases, when the server is overloaded, the request might
2929    /// return before the default deadline is reached, or might return after zero
2930    /// seconds.
2931    /// ```
2932    ///
2933    /// - If the default deadline is reached, there is no guarantee that the
2934    ///   operation is actually done when the method returns. Be prepared to retry
2935    ///   if the operation is not `DONE`.
2936    pub fn wait(&self) -> super::builder::global_operations::Wait {
2937        super::builder::global_operations::Wait::new(self.inner.clone())
2938    }
2939}
2940
2941/// Implements a client for the Google Compute Engine API.
2942///
2943/// # Example
2944/// ```
2945/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2946/// # use google_cloud_compute_v1::client::GlobalOrganizationOperations;
2947/// let client = GlobalOrganizationOperations::builder().build().await?;
2948/// // use `client` to make requests to the Google Compute Engine API.
2949/// # Ok(()) }
2950/// ```
2951///
2952/// # Service Description
2953///
2954/// Service for the `globalOrganizationOperations` resource.
2955///
2956/// # Configuration
2957///
2958/// To configure `GlobalOrganizationOperations` use the `with_*` methods in the type returned
2959/// by [builder()][GlobalOrganizationOperations::builder]. The default configuration should
2960/// work for most applications. Common configuration changes include
2961///
2962/// * [with_endpoint()]: by default this client uses the global default endpoint
2963///   (`https://compute.googleapis.com`). Applications using regional
2964///   endpoints or running in restricted networks (e.g. a network configured
2965//    with [Private Google Access with VPC Service Controls]) may want to
2966///   override this default.
2967/// * [with_credentials()]: by default this client uses
2968///   [Application Default Credentials]. Applications using custom
2969///   authentication may need to override this default.
2970///
2971/// [with_endpoint()]: super::builder::global_organization_operations::ClientBuilder::with_endpoint
2972/// [with_credentials()]: super::builder::global_organization_operations::ClientBuilder::credentials
2973/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2974/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2975///
2976/// # Pooling and Cloning
2977///
2978/// `GlobalOrganizationOperations` holds a connection pool internally, it is advised to
2979/// create one and the reuse it.  You do not need to wrap `GlobalOrganizationOperations` in
2980/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2981/// already uses an `Arc` internally.
2982#[cfg(feature = "global-organization-operations")]
2983#[cfg_attr(docsrs, doc(cfg(feature = "global-organization-operations")))]
2984#[derive(Clone, Debug)]
2985pub struct GlobalOrganizationOperations {
2986    inner: std::sync::Arc<dyn super::stub::dynamic::GlobalOrganizationOperations>,
2987}
2988
2989#[cfg(feature = "global-organization-operations")]
2990impl GlobalOrganizationOperations {
2991    /// Returns a builder for [GlobalOrganizationOperations].
2992    ///
2993    /// ```
2994    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2995    /// # use google_cloud_compute_v1::client::GlobalOrganizationOperations;
2996    /// let client = GlobalOrganizationOperations::builder().build().await?;
2997    /// # Ok(()) }
2998    /// ```
2999    pub fn builder() -> super::builder::global_organization_operations::ClientBuilder {
3000        crate::new_client_builder(super::builder::global_organization_operations::client::Factory)
3001    }
3002
3003    /// Creates a new client from the provided stub.
3004    ///
3005    /// The most common case for calling this function is in tests mocking the
3006    /// client's behavior.
3007    pub fn from_stub<T>(stub: T) -> Self
3008    where
3009        T: super::stub::GlobalOrganizationOperations + 'static,
3010    {
3011        Self {
3012            inner: std::sync::Arc::new(stub),
3013        }
3014    }
3015
3016    pub(crate) async fn new(
3017        config: gaxi::options::ClientConfig,
3018    ) -> crate::ClientBuilderResult<Self> {
3019        let inner = Self::build_inner(config).await?;
3020        Ok(Self { inner })
3021    }
3022
3023    async fn build_inner(
3024        conf: gaxi::options::ClientConfig,
3025    ) -> crate::ClientBuilderResult<
3026        std::sync::Arc<dyn super::stub::dynamic::GlobalOrganizationOperations>,
3027    > {
3028        if gaxi::options::tracing_enabled(&conf) {
3029            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3030        }
3031        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3032    }
3033
3034    async fn build_transport(
3035        conf: gaxi::options::ClientConfig,
3036    ) -> crate::ClientBuilderResult<impl super::stub::GlobalOrganizationOperations> {
3037        super::transport::GlobalOrganizationOperations::new(conf).await
3038    }
3039
3040    async fn build_with_tracing(
3041        conf: gaxi::options::ClientConfig,
3042    ) -> crate::ClientBuilderResult<impl super::stub::GlobalOrganizationOperations> {
3043        Self::build_transport(conf)
3044            .await
3045            .map(super::tracing::GlobalOrganizationOperations::new)
3046    }
3047
3048    /// Deletes the specified Operations resource.
3049    pub fn delete(&self) -> super::builder::global_organization_operations::Delete {
3050        super::builder::global_organization_operations::Delete::new(self.inner.clone())
3051    }
3052
3053    /// Retrieves the specified Operations resource. Gets a list of operations
3054    /// by making a `list()` request.
3055    pub fn get(&self) -> super::builder::global_organization_operations::Get {
3056        super::builder::global_organization_operations::Get::new(self.inner.clone())
3057    }
3058
3059    /// Retrieves a list of Operation resources contained within the specified
3060    /// organization.
3061    pub fn list(&self) -> super::builder::global_organization_operations::List {
3062        super::builder::global_organization_operations::List::new(self.inner.clone())
3063    }
3064}
3065
3066/// Implements a client for the Google Compute Engine API.
3067///
3068/// # Example
3069/// ```
3070/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3071/// # use google_cloud_compute_v1::client::GlobalPublicDelegatedPrefixes;
3072/// let client = GlobalPublicDelegatedPrefixes::builder().build().await?;
3073/// // use `client` to make requests to the Google Compute Engine API.
3074/// # Ok(()) }
3075/// ```
3076///
3077/// # Service Description
3078///
3079/// Service for the `globalPublicDelegatedPrefixes` resource.
3080///
3081/// # Configuration
3082///
3083/// To configure `GlobalPublicDelegatedPrefixes` use the `with_*` methods in the type returned
3084/// by [builder()][GlobalPublicDelegatedPrefixes::builder]. The default configuration should
3085/// work for most applications. Common configuration changes include
3086///
3087/// * [with_endpoint()]: by default this client uses the global default endpoint
3088///   (`https://compute.googleapis.com`). Applications using regional
3089///   endpoints or running in restricted networks (e.g. a network configured
3090//    with [Private Google Access with VPC Service Controls]) may want to
3091///   override this default.
3092/// * [with_credentials()]: by default this client uses
3093///   [Application Default Credentials]. Applications using custom
3094///   authentication may need to override this default.
3095///
3096/// [with_endpoint()]: super::builder::global_public_delegated_prefixes::ClientBuilder::with_endpoint
3097/// [with_credentials()]: super::builder::global_public_delegated_prefixes::ClientBuilder::credentials
3098/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3099/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3100///
3101/// # Pooling and Cloning
3102///
3103/// `GlobalPublicDelegatedPrefixes` holds a connection pool internally, it is advised to
3104/// create one and the reuse it.  You do not need to wrap `GlobalPublicDelegatedPrefixes` in
3105/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3106/// already uses an `Arc` internally.
3107#[cfg(feature = "global-public-delegated-prefixes")]
3108#[cfg_attr(docsrs, doc(cfg(feature = "global-public-delegated-prefixes")))]
3109#[derive(Clone, Debug)]
3110pub struct GlobalPublicDelegatedPrefixes {
3111    inner: std::sync::Arc<dyn super::stub::dynamic::GlobalPublicDelegatedPrefixes>,
3112}
3113
3114#[cfg(feature = "global-public-delegated-prefixes")]
3115impl GlobalPublicDelegatedPrefixes {
3116    /// Returns a builder for [GlobalPublicDelegatedPrefixes].
3117    ///
3118    /// ```
3119    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3120    /// # use google_cloud_compute_v1::client::GlobalPublicDelegatedPrefixes;
3121    /// let client = GlobalPublicDelegatedPrefixes::builder().build().await?;
3122    /// # Ok(()) }
3123    /// ```
3124    pub fn builder() -> super::builder::global_public_delegated_prefixes::ClientBuilder {
3125        crate::new_client_builder(super::builder::global_public_delegated_prefixes::client::Factory)
3126    }
3127
3128    /// Creates a new client from the provided stub.
3129    ///
3130    /// The most common case for calling this function is in tests mocking the
3131    /// client's behavior.
3132    pub fn from_stub<T>(stub: T) -> Self
3133    where
3134        T: super::stub::GlobalPublicDelegatedPrefixes + 'static,
3135    {
3136        Self {
3137            inner: std::sync::Arc::new(stub),
3138        }
3139    }
3140
3141    pub(crate) async fn new(
3142        config: gaxi::options::ClientConfig,
3143    ) -> crate::ClientBuilderResult<Self> {
3144        let inner = Self::build_inner(config).await?;
3145        Ok(Self { inner })
3146    }
3147
3148    async fn build_inner(
3149        conf: gaxi::options::ClientConfig,
3150    ) -> crate::ClientBuilderResult<
3151        std::sync::Arc<dyn super::stub::dynamic::GlobalPublicDelegatedPrefixes>,
3152    > {
3153        if gaxi::options::tracing_enabled(&conf) {
3154            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3155        }
3156        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3157    }
3158
3159    async fn build_transport(
3160        conf: gaxi::options::ClientConfig,
3161    ) -> crate::ClientBuilderResult<impl super::stub::GlobalPublicDelegatedPrefixes> {
3162        super::transport::GlobalPublicDelegatedPrefixes::new(conf).await
3163    }
3164
3165    async fn build_with_tracing(
3166        conf: gaxi::options::ClientConfig,
3167    ) -> crate::ClientBuilderResult<impl super::stub::GlobalPublicDelegatedPrefixes> {
3168        Self::build_transport(conf)
3169            .await
3170            .map(super::tracing::GlobalPublicDelegatedPrefixes::new)
3171    }
3172
3173    /// Deletes the specified global PublicDelegatedPrefix.
3174    pub fn delete(&self) -> super::builder::global_public_delegated_prefixes::Delete {
3175        super::builder::global_public_delegated_prefixes::Delete::new(self.inner.clone())
3176    }
3177
3178    /// Returns the specified global PublicDelegatedPrefix resource.
3179    pub fn get(&self) -> super::builder::global_public_delegated_prefixes::Get {
3180        super::builder::global_public_delegated_prefixes::Get::new(self.inner.clone())
3181    }
3182
3183    /// Creates a global PublicDelegatedPrefix in the specified project using the
3184    /// parameters that are included in the request.
3185    pub fn insert(&self) -> super::builder::global_public_delegated_prefixes::Insert {
3186        super::builder::global_public_delegated_prefixes::Insert::new(self.inner.clone())
3187    }
3188
3189    /// Lists the global PublicDelegatedPrefixes for a project.
3190    pub fn list(&self) -> super::builder::global_public_delegated_prefixes::List {
3191        super::builder::global_public_delegated_prefixes::List::new(self.inner.clone())
3192    }
3193
3194    /// Patches the specified global PublicDelegatedPrefix resource with the data
3195    /// included in the request. This method supportsPATCH
3196    /// semantics and usesJSON merge
3197    /// patch format and processing rules.
3198    pub fn patch(&self) -> super::builder::global_public_delegated_prefixes::Patch {
3199        super::builder::global_public_delegated_prefixes::Patch::new(self.inner.clone())
3200    }
3201
3202    /// Retrieves the specified Operations resource.
3203    pub fn get_operation(&self) -> super::builder::global_public_delegated_prefixes::GetOperation {
3204        super::builder::global_public_delegated_prefixes::GetOperation::new(self.inner.clone())
3205    }
3206}
3207
3208/// Implements a client for the Google Compute Engine API.
3209///
3210/// # Example
3211/// ```
3212/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3213/// # use google_cloud_compute_v1::client::HealthChecks;
3214/// let client = HealthChecks::builder().build().await?;
3215/// // use `client` to make requests to the Google Compute Engine API.
3216/// # Ok(()) }
3217/// ```
3218///
3219/// # Service Description
3220///
3221/// Service for the `healthChecks` resource.
3222///
3223/// # Configuration
3224///
3225/// To configure `HealthChecks` use the `with_*` methods in the type returned
3226/// by [builder()][HealthChecks::builder]. The default configuration should
3227/// work for most applications. Common configuration changes include
3228///
3229/// * [with_endpoint()]: by default this client uses the global default endpoint
3230///   (`https://compute.googleapis.com`). Applications using regional
3231///   endpoints or running in restricted networks (e.g. a network configured
3232//    with [Private Google Access with VPC Service Controls]) may want to
3233///   override this default.
3234/// * [with_credentials()]: by default this client uses
3235///   [Application Default Credentials]. Applications using custom
3236///   authentication may need to override this default.
3237///
3238/// [with_endpoint()]: super::builder::health_checks::ClientBuilder::with_endpoint
3239/// [with_credentials()]: super::builder::health_checks::ClientBuilder::credentials
3240/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3241/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3242///
3243/// # Pooling and Cloning
3244///
3245/// `HealthChecks` holds a connection pool internally, it is advised to
3246/// create one and the reuse it.  You do not need to wrap `HealthChecks` in
3247/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3248/// already uses an `Arc` internally.
3249#[cfg(feature = "health-checks")]
3250#[cfg_attr(docsrs, doc(cfg(feature = "health-checks")))]
3251#[derive(Clone, Debug)]
3252pub struct HealthChecks {
3253    inner: std::sync::Arc<dyn super::stub::dynamic::HealthChecks>,
3254}
3255
3256#[cfg(feature = "health-checks")]
3257impl HealthChecks {
3258    /// Returns a builder for [HealthChecks].
3259    ///
3260    /// ```
3261    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3262    /// # use google_cloud_compute_v1::client::HealthChecks;
3263    /// let client = HealthChecks::builder().build().await?;
3264    /// # Ok(()) }
3265    /// ```
3266    pub fn builder() -> super::builder::health_checks::ClientBuilder {
3267        crate::new_client_builder(super::builder::health_checks::client::Factory)
3268    }
3269
3270    /// Creates a new client from the provided stub.
3271    ///
3272    /// The most common case for calling this function is in tests mocking the
3273    /// client's behavior.
3274    pub fn from_stub<T>(stub: T) -> Self
3275    where
3276        T: super::stub::HealthChecks + 'static,
3277    {
3278        Self {
3279            inner: std::sync::Arc::new(stub),
3280        }
3281    }
3282
3283    pub(crate) async fn new(
3284        config: gaxi::options::ClientConfig,
3285    ) -> crate::ClientBuilderResult<Self> {
3286        let inner = Self::build_inner(config).await?;
3287        Ok(Self { inner })
3288    }
3289
3290    async fn build_inner(
3291        conf: gaxi::options::ClientConfig,
3292    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::HealthChecks>> {
3293        if gaxi::options::tracing_enabled(&conf) {
3294            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3295        }
3296        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3297    }
3298
3299    async fn build_transport(
3300        conf: gaxi::options::ClientConfig,
3301    ) -> crate::ClientBuilderResult<impl super::stub::HealthChecks> {
3302        super::transport::HealthChecks::new(conf).await
3303    }
3304
3305    async fn build_with_tracing(
3306        conf: gaxi::options::ClientConfig,
3307    ) -> crate::ClientBuilderResult<impl super::stub::HealthChecks> {
3308        Self::build_transport(conf)
3309            .await
3310            .map(super::tracing::HealthChecks::new)
3311    }
3312
3313    /// Retrieves the list of all HealthCheck resources, regional and global,
3314    /// available to the specified project.
3315    ///
3316    /// To prevent failure, Google recommends that you set the
3317    /// `returnPartialSuccess` parameter to `true`.
3318    pub fn aggregated_list(&self) -> super::builder::health_checks::AggregatedList {
3319        super::builder::health_checks::AggregatedList::new(self.inner.clone())
3320    }
3321
3322    /// Deletes the specified HealthCheck resource.
3323    pub fn delete(&self) -> super::builder::health_checks::Delete {
3324        super::builder::health_checks::Delete::new(self.inner.clone())
3325    }
3326
3327    /// Returns the specified HealthCheck resource.
3328    pub fn get(&self) -> super::builder::health_checks::Get {
3329        super::builder::health_checks::Get::new(self.inner.clone())
3330    }
3331
3332    /// Creates a HealthCheck resource in the specified project using the data
3333    /// included in the request.
3334    pub fn insert(&self) -> super::builder::health_checks::Insert {
3335        super::builder::health_checks::Insert::new(self.inner.clone())
3336    }
3337
3338    /// Retrieves the list of HealthCheck resources available to the specified
3339    /// project.
3340    pub fn list(&self) -> super::builder::health_checks::List {
3341        super::builder::health_checks::List::new(self.inner.clone())
3342    }
3343
3344    /// Updates a HealthCheck resource in the specified project using the data
3345    /// included in the request. This method supportsPATCH
3346    /// semantics and uses theJSON merge
3347    /// patch format and processing rules.
3348    pub fn patch(&self) -> super::builder::health_checks::Patch {
3349        super::builder::health_checks::Patch::new(self.inner.clone())
3350    }
3351
3352    /// Returns permissions that a caller has on the specified resource.
3353    pub fn test_iam_permissions(&self) -> super::builder::health_checks::TestIamPermissions {
3354        super::builder::health_checks::TestIamPermissions::new(self.inner.clone())
3355    }
3356
3357    /// Updates a HealthCheck resource in the specified project using the data
3358    /// included in the request.
3359    pub fn update(&self) -> super::builder::health_checks::Update {
3360        super::builder::health_checks::Update::new(self.inner.clone())
3361    }
3362
3363    /// Retrieves the specified Operations resource.
3364    pub fn get_operation(&self) -> super::builder::health_checks::GetOperation {
3365        super::builder::health_checks::GetOperation::new(self.inner.clone())
3366    }
3367}
3368
3369/// Implements a client for the Google Compute Engine API.
3370///
3371/// # Example
3372/// ```
3373/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3374/// # use google_cloud_compute_v1::client::HttpHealthChecks;
3375/// let client = HttpHealthChecks::builder().build().await?;
3376/// // use `client` to make requests to the Google Compute Engine API.
3377/// # Ok(()) }
3378/// ```
3379///
3380/// # Service Description
3381///
3382/// Service for the `httpHealthChecks` resource.
3383///
3384/// # Configuration
3385///
3386/// To configure `HttpHealthChecks` use the `with_*` methods in the type returned
3387/// by [builder()][HttpHealthChecks::builder]. The default configuration should
3388/// work for most applications. Common configuration changes include
3389///
3390/// * [with_endpoint()]: by default this client uses the global default endpoint
3391///   (`https://compute.googleapis.com`). Applications using regional
3392///   endpoints or running in restricted networks (e.g. a network configured
3393//    with [Private Google Access with VPC Service Controls]) may want to
3394///   override this default.
3395/// * [with_credentials()]: by default this client uses
3396///   [Application Default Credentials]. Applications using custom
3397///   authentication may need to override this default.
3398///
3399/// [with_endpoint()]: super::builder::http_health_checks::ClientBuilder::with_endpoint
3400/// [with_credentials()]: super::builder::http_health_checks::ClientBuilder::credentials
3401/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3402/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3403///
3404/// # Pooling and Cloning
3405///
3406/// `HttpHealthChecks` holds a connection pool internally, it is advised to
3407/// create one and the reuse it.  You do not need to wrap `HttpHealthChecks` in
3408/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3409/// already uses an `Arc` internally.
3410#[cfg(feature = "http-health-checks")]
3411#[cfg_attr(docsrs, doc(cfg(feature = "http-health-checks")))]
3412#[derive(Clone, Debug)]
3413pub struct HttpHealthChecks {
3414    inner: std::sync::Arc<dyn super::stub::dynamic::HttpHealthChecks>,
3415}
3416
3417#[cfg(feature = "http-health-checks")]
3418impl HttpHealthChecks {
3419    /// Returns a builder for [HttpHealthChecks].
3420    ///
3421    /// ```
3422    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3423    /// # use google_cloud_compute_v1::client::HttpHealthChecks;
3424    /// let client = HttpHealthChecks::builder().build().await?;
3425    /// # Ok(()) }
3426    /// ```
3427    pub fn builder() -> super::builder::http_health_checks::ClientBuilder {
3428        crate::new_client_builder(super::builder::http_health_checks::client::Factory)
3429    }
3430
3431    /// Creates a new client from the provided stub.
3432    ///
3433    /// The most common case for calling this function is in tests mocking the
3434    /// client's behavior.
3435    pub fn from_stub<T>(stub: T) -> Self
3436    where
3437        T: super::stub::HttpHealthChecks + 'static,
3438    {
3439        Self {
3440            inner: std::sync::Arc::new(stub),
3441        }
3442    }
3443
3444    pub(crate) async fn new(
3445        config: gaxi::options::ClientConfig,
3446    ) -> crate::ClientBuilderResult<Self> {
3447        let inner = Self::build_inner(config).await?;
3448        Ok(Self { inner })
3449    }
3450
3451    async fn build_inner(
3452        conf: gaxi::options::ClientConfig,
3453    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::HttpHealthChecks>>
3454    {
3455        if gaxi::options::tracing_enabled(&conf) {
3456            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3457        }
3458        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3459    }
3460
3461    async fn build_transport(
3462        conf: gaxi::options::ClientConfig,
3463    ) -> crate::ClientBuilderResult<impl super::stub::HttpHealthChecks> {
3464        super::transport::HttpHealthChecks::new(conf).await
3465    }
3466
3467    async fn build_with_tracing(
3468        conf: gaxi::options::ClientConfig,
3469    ) -> crate::ClientBuilderResult<impl super::stub::HttpHealthChecks> {
3470        Self::build_transport(conf)
3471            .await
3472            .map(super::tracing::HttpHealthChecks::new)
3473    }
3474
3475    /// Deletes the specified HttpHealthCheck resource.
3476    pub fn delete(&self) -> super::builder::http_health_checks::Delete {
3477        super::builder::http_health_checks::Delete::new(self.inner.clone())
3478    }
3479
3480    /// Returns the specified HttpHealthCheck resource.
3481    pub fn get(&self) -> super::builder::http_health_checks::Get {
3482        super::builder::http_health_checks::Get::new(self.inner.clone())
3483    }
3484
3485    /// Creates a HttpHealthCheck resource in the specified project using the data
3486    /// included in the request.
3487    pub fn insert(&self) -> super::builder::http_health_checks::Insert {
3488        super::builder::http_health_checks::Insert::new(self.inner.clone())
3489    }
3490
3491    /// Retrieves the list of HttpHealthCheck resources available to the specified
3492    /// project.
3493    pub fn list(&self) -> super::builder::http_health_checks::List {
3494        super::builder::http_health_checks::List::new(self.inner.clone())
3495    }
3496
3497    /// Updates a HttpHealthCheck resource in the specified project using the data
3498    /// included in the request. This method supportsPATCH
3499    /// semantics and uses theJSON merge
3500    /// patch format and processing rules.
3501    pub fn patch(&self) -> super::builder::http_health_checks::Patch {
3502        super::builder::http_health_checks::Patch::new(self.inner.clone())
3503    }
3504
3505    /// Returns permissions that a caller has on the specified resource.
3506    pub fn test_iam_permissions(&self) -> super::builder::http_health_checks::TestIamPermissions {
3507        super::builder::http_health_checks::TestIamPermissions::new(self.inner.clone())
3508    }
3509
3510    /// Updates a HttpHealthCheck resource in the specified project using the data
3511    /// included in the request.
3512    pub fn update(&self) -> super::builder::http_health_checks::Update {
3513        super::builder::http_health_checks::Update::new(self.inner.clone())
3514    }
3515
3516    /// Retrieves the specified Operations resource.
3517    pub fn get_operation(&self) -> super::builder::http_health_checks::GetOperation {
3518        super::builder::http_health_checks::GetOperation::new(self.inner.clone())
3519    }
3520}
3521
3522/// Implements a client for the Google Compute Engine API.
3523///
3524/// # Example
3525/// ```
3526/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3527/// # use google_cloud_compute_v1::client::HttpsHealthChecks;
3528/// let client = HttpsHealthChecks::builder().build().await?;
3529/// // use `client` to make requests to the Google Compute Engine API.
3530/// # Ok(()) }
3531/// ```
3532///
3533/// # Service Description
3534///
3535/// Service for the `httpsHealthChecks` resource.
3536///
3537/// # Configuration
3538///
3539/// To configure `HttpsHealthChecks` use the `with_*` methods in the type returned
3540/// by [builder()][HttpsHealthChecks::builder]. The default configuration should
3541/// work for most applications. Common configuration changes include
3542///
3543/// * [with_endpoint()]: by default this client uses the global default endpoint
3544///   (`https://compute.googleapis.com`). Applications using regional
3545///   endpoints or running in restricted networks (e.g. a network configured
3546//    with [Private Google Access with VPC Service Controls]) may want to
3547///   override this default.
3548/// * [with_credentials()]: by default this client uses
3549///   [Application Default Credentials]. Applications using custom
3550///   authentication may need to override this default.
3551///
3552/// [with_endpoint()]: super::builder::https_health_checks::ClientBuilder::with_endpoint
3553/// [with_credentials()]: super::builder::https_health_checks::ClientBuilder::credentials
3554/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3555/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3556///
3557/// # Pooling and Cloning
3558///
3559/// `HttpsHealthChecks` holds a connection pool internally, it is advised to
3560/// create one and the reuse it.  You do not need to wrap `HttpsHealthChecks` in
3561/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3562/// already uses an `Arc` internally.
3563#[cfg(feature = "https-health-checks")]
3564#[cfg_attr(docsrs, doc(cfg(feature = "https-health-checks")))]
3565#[derive(Clone, Debug)]
3566pub struct HttpsHealthChecks {
3567    inner: std::sync::Arc<dyn super::stub::dynamic::HttpsHealthChecks>,
3568}
3569
3570#[cfg(feature = "https-health-checks")]
3571impl HttpsHealthChecks {
3572    /// Returns a builder for [HttpsHealthChecks].
3573    ///
3574    /// ```
3575    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3576    /// # use google_cloud_compute_v1::client::HttpsHealthChecks;
3577    /// let client = HttpsHealthChecks::builder().build().await?;
3578    /// # Ok(()) }
3579    /// ```
3580    pub fn builder() -> super::builder::https_health_checks::ClientBuilder {
3581        crate::new_client_builder(super::builder::https_health_checks::client::Factory)
3582    }
3583
3584    /// Creates a new client from the provided stub.
3585    ///
3586    /// The most common case for calling this function is in tests mocking the
3587    /// client's behavior.
3588    pub fn from_stub<T>(stub: T) -> Self
3589    where
3590        T: super::stub::HttpsHealthChecks + 'static,
3591    {
3592        Self {
3593            inner: std::sync::Arc::new(stub),
3594        }
3595    }
3596
3597    pub(crate) async fn new(
3598        config: gaxi::options::ClientConfig,
3599    ) -> crate::ClientBuilderResult<Self> {
3600        let inner = Self::build_inner(config).await?;
3601        Ok(Self { inner })
3602    }
3603
3604    async fn build_inner(
3605        conf: gaxi::options::ClientConfig,
3606    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::HttpsHealthChecks>>
3607    {
3608        if gaxi::options::tracing_enabled(&conf) {
3609            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3610        }
3611        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3612    }
3613
3614    async fn build_transport(
3615        conf: gaxi::options::ClientConfig,
3616    ) -> crate::ClientBuilderResult<impl super::stub::HttpsHealthChecks> {
3617        super::transport::HttpsHealthChecks::new(conf).await
3618    }
3619
3620    async fn build_with_tracing(
3621        conf: gaxi::options::ClientConfig,
3622    ) -> crate::ClientBuilderResult<impl super::stub::HttpsHealthChecks> {
3623        Self::build_transport(conf)
3624            .await
3625            .map(super::tracing::HttpsHealthChecks::new)
3626    }
3627
3628    /// Deletes the specified HttpsHealthCheck resource.
3629    pub fn delete(&self) -> super::builder::https_health_checks::Delete {
3630        super::builder::https_health_checks::Delete::new(self.inner.clone())
3631    }
3632
3633    /// Returns the specified HttpsHealthCheck resource.
3634    pub fn get(&self) -> super::builder::https_health_checks::Get {
3635        super::builder::https_health_checks::Get::new(self.inner.clone())
3636    }
3637
3638    /// Creates a HttpsHealthCheck resource in the specified project using the data
3639    /// included in the request.
3640    pub fn insert(&self) -> super::builder::https_health_checks::Insert {
3641        super::builder::https_health_checks::Insert::new(self.inner.clone())
3642    }
3643
3644    /// Retrieves the list of HttpsHealthCheck resources available to the specified
3645    /// project.
3646    pub fn list(&self) -> super::builder::https_health_checks::List {
3647        super::builder::https_health_checks::List::new(self.inner.clone())
3648    }
3649
3650    /// Updates a HttpsHealthCheck resource in the specified project using the data
3651    /// included in the request. This method supportsPATCH
3652    /// semantics and uses theJSON merge
3653    /// patch format and processing rules.
3654    pub fn patch(&self) -> super::builder::https_health_checks::Patch {
3655        super::builder::https_health_checks::Patch::new(self.inner.clone())
3656    }
3657
3658    /// Returns permissions that a caller has on the specified resource.
3659    pub fn test_iam_permissions(&self) -> super::builder::https_health_checks::TestIamPermissions {
3660        super::builder::https_health_checks::TestIamPermissions::new(self.inner.clone())
3661    }
3662
3663    /// Updates a HttpsHealthCheck resource in the specified project using the data
3664    /// included in the request.
3665    pub fn update(&self) -> super::builder::https_health_checks::Update {
3666        super::builder::https_health_checks::Update::new(self.inner.clone())
3667    }
3668
3669    /// Retrieves the specified Operations resource.
3670    pub fn get_operation(&self) -> super::builder::https_health_checks::GetOperation {
3671        super::builder::https_health_checks::GetOperation::new(self.inner.clone())
3672    }
3673}
3674
3675/// Implements a client for the Google Compute Engine API.
3676///
3677/// # Example
3678/// ```
3679/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3680/// # use google_cloud_compute_v1::client::ImageFamilyViews;
3681/// let client = ImageFamilyViews::builder().build().await?;
3682/// // use `client` to make requests to the Google Compute Engine API.
3683/// # Ok(()) }
3684/// ```
3685///
3686/// # Service Description
3687///
3688/// Service for the `imageFamilyViews` resource.
3689///
3690/// # Configuration
3691///
3692/// To configure `ImageFamilyViews` use the `with_*` methods in the type returned
3693/// by [builder()][ImageFamilyViews::builder]. The default configuration should
3694/// work for most applications. Common configuration changes include
3695///
3696/// * [with_endpoint()]: by default this client uses the global default endpoint
3697///   (`https://compute.googleapis.com`). Applications using regional
3698///   endpoints or running in restricted networks (e.g. a network configured
3699//    with [Private Google Access with VPC Service Controls]) may want to
3700///   override this default.
3701/// * [with_credentials()]: by default this client uses
3702///   [Application Default Credentials]. Applications using custom
3703///   authentication may need to override this default.
3704///
3705/// [with_endpoint()]: super::builder::image_family_views::ClientBuilder::with_endpoint
3706/// [with_credentials()]: super::builder::image_family_views::ClientBuilder::credentials
3707/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3708/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3709///
3710/// # Pooling and Cloning
3711///
3712/// `ImageFamilyViews` holds a connection pool internally, it is advised to
3713/// create one and the reuse it.  You do not need to wrap `ImageFamilyViews` in
3714/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3715/// already uses an `Arc` internally.
3716#[cfg(feature = "image-family-views")]
3717#[cfg_attr(docsrs, doc(cfg(feature = "image-family-views")))]
3718#[derive(Clone, Debug)]
3719pub struct ImageFamilyViews {
3720    inner: std::sync::Arc<dyn super::stub::dynamic::ImageFamilyViews>,
3721}
3722
3723#[cfg(feature = "image-family-views")]
3724impl ImageFamilyViews {
3725    /// Returns a builder for [ImageFamilyViews].
3726    ///
3727    /// ```
3728    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3729    /// # use google_cloud_compute_v1::client::ImageFamilyViews;
3730    /// let client = ImageFamilyViews::builder().build().await?;
3731    /// # Ok(()) }
3732    /// ```
3733    pub fn builder() -> super::builder::image_family_views::ClientBuilder {
3734        crate::new_client_builder(super::builder::image_family_views::client::Factory)
3735    }
3736
3737    /// Creates a new client from the provided stub.
3738    ///
3739    /// The most common case for calling this function is in tests mocking the
3740    /// client's behavior.
3741    pub fn from_stub<T>(stub: T) -> Self
3742    where
3743        T: super::stub::ImageFamilyViews + 'static,
3744    {
3745        Self {
3746            inner: std::sync::Arc::new(stub),
3747        }
3748    }
3749
3750    pub(crate) async fn new(
3751        config: gaxi::options::ClientConfig,
3752    ) -> crate::ClientBuilderResult<Self> {
3753        let inner = Self::build_inner(config).await?;
3754        Ok(Self { inner })
3755    }
3756
3757    async fn build_inner(
3758        conf: gaxi::options::ClientConfig,
3759    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ImageFamilyViews>>
3760    {
3761        if gaxi::options::tracing_enabled(&conf) {
3762            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3763        }
3764        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3765    }
3766
3767    async fn build_transport(
3768        conf: gaxi::options::ClientConfig,
3769    ) -> crate::ClientBuilderResult<impl super::stub::ImageFamilyViews> {
3770        super::transport::ImageFamilyViews::new(conf).await
3771    }
3772
3773    async fn build_with_tracing(
3774        conf: gaxi::options::ClientConfig,
3775    ) -> crate::ClientBuilderResult<impl super::stub::ImageFamilyViews> {
3776        Self::build_transport(conf)
3777            .await
3778            .map(super::tracing::ImageFamilyViews::new)
3779    }
3780
3781    /// Returns the latest image that is part of an image family, is not
3782    /// deprecated and is rolled out in the specified zone.
3783    pub fn get(&self) -> super::builder::image_family_views::Get {
3784        super::builder::image_family_views::Get::new(self.inner.clone())
3785    }
3786}
3787
3788/// Implements a client for the Google Compute Engine API.
3789///
3790/// # Example
3791/// ```
3792/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3793/// # use google_cloud_compute_v1::client::Images;
3794/// let client = Images::builder().build().await?;
3795/// // use `client` to make requests to the Google Compute Engine API.
3796/// # Ok(()) }
3797/// ```
3798///
3799/// # Service Description
3800///
3801/// Service for the `images` resource.
3802///
3803/// # Configuration
3804///
3805/// To configure `Images` use the `with_*` methods in the type returned
3806/// by [builder()][Images::builder]. The default configuration should
3807/// work for most applications. Common configuration changes include
3808///
3809/// * [with_endpoint()]: by default this client uses the global default endpoint
3810///   (`https://compute.googleapis.com`). Applications using regional
3811///   endpoints or running in restricted networks (e.g. a network configured
3812//    with [Private Google Access with VPC Service Controls]) may want to
3813///   override this default.
3814/// * [with_credentials()]: by default this client uses
3815///   [Application Default Credentials]. Applications using custom
3816///   authentication may need to override this default.
3817///
3818/// [with_endpoint()]: super::builder::images::ClientBuilder::with_endpoint
3819/// [with_credentials()]: super::builder::images::ClientBuilder::credentials
3820/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3821/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3822///
3823/// # Pooling and Cloning
3824///
3825/// `Images` holds a connection pool internally, it is advised to
3826/// create one and the reuse it.  You do not need to wrap `Images` in
3827/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3828/// already uses an `Arc` internally.
3829#[cfg(feature = "images")]
3830#[cfg_attr(docsrs, doc(cfg(feature = "images")))]
3831#[derive(Clone, Debug)]
3832pub struct Images {
3833    inner: std::sync::Arc<dyn super::stub::dynamic::Images>,
3834}
3835
3836#[cfg(feature = "images")]
3837impl Images {
3838    /// Returns a builder for [Images].
3839    ///
3840    /// ```
3841    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3842    /// # use google_cloud_compute_v1::client::Images;
3843    /// let client = Images::builder().build().await?;
3844    /// # Ok(()) }
3845    /// ```
3846    pub fn builder() -> super::builder::images::ClientBuilder {
3847        crate::new_client_builder(super::builder::images::client::Factory)
3848    }
3849
3850    /// Creates a new client from the provided stub.
3851    ///
3852    /// The most common case for calling this function is in tests mocking the
3853    /// client's behavior.
3854    pub fn from_stub<T>(stub: T) -> Self
3855    where
3856        T: super::stub::Images + 'static,
3857    {
3858        Self {
3859            inner: std::sync::Arc::new(stub),
3860        }
3861    }
3862
3863    pub(crate) async fn new(
3864        config: gaxi::options::ClientConfig,
3865    ) -> crate::ClientBuilderResult<Self> {
3866        let inner = Self::build_inner(config).await?;
3867        Ok(Self { inner })
3868    }
3869
3870    async fn build_inner(
3871        conf: gaxi::options::ClientConfig,
3872    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Images>> {
3873        if gaxi::options::tracing_enabled(&conf) {
3874            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3875        }
3876        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3877    }
3878
3879    async fn build_transport(
3880        conf: gaxi::options::ClientConfig,
3881    ) -> crate::ClientBuilderResult<impl super::stub::Images> {
3882        super::transport::Images::new(conf).await
3883    }
3884
3885    async fn build_with_tracing(
3886        conf: gaxi::options::ClientConfig,
3887    ) -> crate::ClientBuilderResult<impl super::stub::Images> {
3888        Self::build_transport(conf)
3889            .await
3890            .map(super::tracing::Images::new)
3891    }
3892
3893    /// Deletes the specified image.
3894    pub fn delete(&self) -> super::builder::images::Delete {
3895        super::builder::images::Delete::new(self.inner.clone())
3896    }
3897
3898    /// Sets the deprecation status of an image.
3899    ///
3900    /// If an empty request body is given, clears the deprecation status instead.
3901    pub fn deprecate(&self) -> super::builder::images::Deprecate {
3902        super::builder::images::Deprecate::new(self.inner.clone())
3903    }
3904
3905    /// Returns the specified image.
3906    pub fn get(&self) -> super::builder::images::Get {
3907        super::builder::images::Get::new(self.inner.clone())
3908    }
3909
3910    /// Returns the latest image that is part of an image family and is not
3911    /// deprecated. For more information on image families, seePublic
3912    /// image families documentation.
3913    pub fn get_from_family(&self) -> super::builder::images::GetFromFamily {
3914        super::builder::images::GetFromFamily::new(self.inner.clone())
3915    }
3916
3917    /// Gets the access control policy for a resource. May be empty if no such
3918    /// policy or resource exists.
3919    pub fn get_iam_policy(&self) -> super::builder::images::GetIamPolicy {
3920        super::builder::images::GetIamPolicy::new(self.inner.clone())
3921    }
3922
3923    /// Creates an image in the specified project using the data included
3924    /// in the request.
3925    pub fn insert(&self) -> super::builder::images::Insert {
3926        super::builder::images::Insert::new(self.inner.clone())
3927    }
3928
3929    /// Retrieves the list of custom images
3930    /// available to the specified project. Custom images are images you
3931    /// create that belong to your project. This method does not
3932    /// get any images that belong to other projects, including publicly-available
3933    /// images, like Debian 8. If you want to get a list of publicly-available
3934    /// images, use this method to make a request to the respective image project,
3935    /// such as debian-cloud or windows-cloud.
3936    pub fn list(&self) -> super::builder::images::List {
3937        super::builder::images::List::new(self.inner.clone())
3938    }
3939
3940    /// Patches the specified image with the data included in the request.
3941    /// Only the following fields can be modified: family, description,
3942    /// deprecation status.
3943    pub fn patch(&self) -> super::builder::images::Patch {
3944        super::builder::images::Patch::new(self.inner.clone())
3945    }
3946
3947    /// Sets the access control policy on the specified resource.
3948    /// Replaces any existing policy.
3949    pub fn set_iam_policy(&self) -> super::builder::images::SetIamPolicy {
3950        super::builder::images::SetIamPolicy::new(self.inner.clone())
3951    }
3952
3953    /// Sets the labels on an image. To learn more about labels, read theLabeling
3954    /// Resources documentation.
3955    pub fn set_labels(&self) -> super::builder::images::SetLabels {
3956        super::builder::images::SetLabels::new(self.inner.clone())
3957    }
3958
3959    /// Returns permissions that a caller has on the specified resource.
3960    pub fn test_iam_permissions(&self) -> super::builder::images::TestIamPermissions {
3961        super::builder::images::TestIamPermissions::new(self.inner.clone())
3962    }
3963
3964    /// Retrieves the specified Operations resource.
3965    pub fn get_operation(&self) -> super::builder::images::GetOperation {
3966        super::builder::images::GetOperation::new(self.inner.clone())
3967    }
3968}
3969
3970/// Implements a client for the Google Compute Engine API.
3971///
3972/// # Example
3973/// ```
3974/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3975/// # use google_cloud_compute_v1::client::InstanceGroupManagerResizeRequests;
3976/// let client = InstanceGroupManagerResizeRequests::builder().build().await?;
3977/// // use `client` to make requests to the Google Compute Engine API.
3978/// # Ok(()) }
3979/// ```
3980///
3981/// # Service Description
3982///
3983/// Service for the `instanceGroupManagerResizeRequests` resource.
3984///
3985/// # Configuration
3986///
3987/// To configure `InstanceGroupManagerResizeRequests` use the `with_*` methods in the type returned
3988/// by [builder()][InstanceGroupManagerResizeRequests::builder]. The default configuration should
3989/// work for most applications. Common configuration changes include
3990///
3991/// * [with_endpoint()]: by default this client uses the global default endpoint
3992///   (`https://compute.googleapis.com`). Applications using regional
3993///   endpoints or running in restricted networks (e.g. a network configured
3994//    with [Private Google Access with VPC Service Controls]) may want to
3995///   override this default.
3996/// * [with_credentials()]: by default this client uses
3997///   [Application Default Credentials]. Applications using custom
3998///   authentication may need to override this default.
3999///
4000/// [with_endpoint()]: super::builder::instance_group_manager_resize_requests::ClientBuilder::with_endpoint
4001/// [with_credentials()]: super::builder::instance_group_manager_resize_requests::ClientBuilder::credentials
4002/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4003/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4004///
4005/// # Pooling and Cloning
4006///
4007/// `InstanceGroupManagerResizeRequests` holds a connection pool internally, it is advised to
4008/// create one and the reuse it.  You do not need to wrap `InstanceGroupManagerResizeRequests` in
4009/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4010/// already uses an `Arc` internally.
4011#[cfg(feature = "instance-group-manager-resize-requests")]
4012#[cfg_attr(docsrs, doc(cfg(feature = "instance-group-manager-resize-requests")))]
4013#[derive(Clone, Debug)]
4014pub struct InstanceGroupManagerResizeRequests {
4015    inner: std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagerResizeRequests>,
4016}
4017
4018#[cfg(feature = "instance-group-manager-resize-requests")]
4019impl InstanceGroupManagerResizeRequests {
4020    /// Returns a builder for [InstanceGroupManagerResizeRequests].
4021    ///
4022    /// ```
4023    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4024    /// # use google_cloud_compute_v1::client::InstanceGroupManagerResizeRequests;
4025    /// let client = InstanceGroupManagerResizeRequests::builder().build().await?;
4026    /// # Ok(()) }
4027    /// ```
4028    pub fn builder() -> super::builder::instance_group_manager_resize_requests::ClientBuilder {
4029        crate::new_client_builder(
4030            super::builder::instance_group_manager_resize_requests::client::Factory,
4031        )
4032    }
4033
4034    /// Creates a new client from the provided stub.
4035    ///
4036    /// The most common case for calling this function is in tests mocking the
4037    /// client's behavior.
4038    pub fn from_stub<T>(stub: T) -> Self
4039    where
4040        T: super::stub::InstanceGroupManagerResizeRequests + 'static,
4041    {
4042        Self {
4043            inner: std::sync::Arc::new(stub),
4044        }
4045    }
4046
4047    pub(crate) async fn new(
4048        config: gaxi::options::ClientConfig,
4049    ) -> crate::ClientBuilderResult<Self> {
4050        let inner = Self::build_inner(config).await?;
4051        Ok(Self { inner })
4052    }
4053
4054    async fn build_inner(
4055        conf: gaxi::options::ClientConfig,
4056    ) -> crate::ClientBuilderResult<
4057        std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagerResizeRequests>,
4058    > {
4059        if gaxi::options::tracing_enabled(&conf) {
4060            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4061        }
4062        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4063    }
4064
4065    async fn build_transport(
4066        conf: gaxi::options::ClientConfig,
4067    ) -> crate::ClientBuilderResult<impl super::stub::InstanceGroupManagerResizeRequests> {
4068        super::transport::InstanceGroupManagerResizeRequests::new(conf).await
4069    }
4070
4071    async fn build_with_tracing(
4072        conf: gaxi::options::ClientConfig,
4073    ) -> crate::ClientBuilderResult<impl super::stub::InstanceGroupManagerResizeRequests> {
4074        Self::build_transport(conf)
4075            .await
4076            .map(super::tracing::InstanceGroupManagerResizeRequests::new)
4077    }
4078
4079    /// Cancels the specified resize request and removes it from the queue.
4080    /// Cancelled resize request does no longer wait for the resources to be
4081    /// provisioned. Cancel is only possible for requests that are accepted in the
4082    /// queue.
4083    pub fn cancel(&self) -> super::builder::instance_group_manager_resize_requests::Cancel {
4084        super::builder::instance_group_manager_resize_requests::Cancel::new(self.inner.clone())
4085    }
4086
4087    /// Deletes the specified, inactive resize request. Requests that are still
4088    /// active cannot be deleted. Deleting request does not delete instances that
4089    /// were provisioned previously.
4090    pub fn delete(&self) -> super::builder::instance_group_manager_resize_requests::Delete {
4091        super::builder::instance_group_manager_resize_requests::Delete::new(self.inner.clone())
4092    }
4093
4094    /// Returns all of the details about the specified resize request.
4095    pub fn get(&self) -> super::builder::instance_group_manager_resize_requests::Get {
4096        super::builder::instance_group_manager_resize_requests::Get::new(self.inner.clone())
4097    }
4098
4099    /// Creates a new resize request that starts provisioning VMs immediately
4100    /// or queues VM creation.
4101    pub fn insert(&self) -> super::builder::instance_group_manager_resize_requests::Insert {
4102        super::builder::instance_group_manager_resize_requests::Insert::new(self.inner.clone())
4103    }
4104
4105    /// Retrieves a list of resize requests that are contained in the
4106    /// managed instance group.
4107    pub fn list(&self) -> super::builder::instance_group_manager_resize_requests::List {
4108        super::builder::instance_group_manager_resize_requests::List::new(self.inner.clone())
4109    }
4110
4111    /// Retrieves the specified zone-specific Operations resource.
4112    pub fn get_operation(
4113        &self,
4114    ) -> super::builder::instance_group_manager_resize_requests::GetOperation {
4115        super::builder::instance_group_manager_resize_requests::GetOperation::new(
4116            self.inner.clone(),
4117        )
4118    }
4119}
4120
4121/// Implements a client for the Google Compute Engine API.
4122///
4123/// # Example
4124/// ```
4125/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4126/// # use google_cloud_compute_v1::client::InstanceGroupManagers;
4127/// let client = InstanceGroupManagers::builder().build().await?;
4128/// // use `client` to make requests to the Google Compute Engine API.
4129/// # Ok(()) }
4130/// ```
4131///
4132/// # Service Description
4133///
4134/// Service for the `instanceGroupManagers` resource.
4135///
4136/// # Configuration
4137///
4138/// To configure `InstanceGroupManagers` use the `with_*` methods in the type returned
4139/// by [builder()][InstanceGroupManagers::builder]. The default configuration should
4140/// work for most applications. Common configuration changes include
4141///
4142/// * [with_endpoint()]: by default this client uses the global default endpoint
4143///   (`https://compute.googleapis.com`). Applications using regional
4144///   endpoints or running in restricted networks (e.g. a network configured
4145//    with [Private Google Access with VPC Service Controls]) may want to
4146///   override this default.
4147/// * [with_credentials()]: by default this client uses
4148///   [Application Default Credentials]. Applications using custom
4149///   authentication may need to override this default.
4150///
4151/// [with_endpoint()]: super::builder::instance_group_managers::ClientBuilder::with_endpoint
4152/// [with_credentials()]: super::builder::instance_group_managers::ClientBuilder::credentials
4153/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4154/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4155///
4156/// # Pooling and Cloning
4157///
4158/// `InstanceGroupManagers` holds a connection pool internally, it is advised to
4159/// create one and the reuse it.  You do not need to wrap `InstanceGroupManagers` in
4160/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4161/// already uses an `Arc` internally.
4162#[cfg(feature = "instance-group-managers")]
4163#[cfg_attr(docsrs, doc(cfg(feature = "instance-group-managers")))]
4164#[derive(Clone, Debug)]
4165pub struct InstanceGroupManagers {
4166    inner: std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagers>,
4167}
4168
4169#[cfg(feature = "instance-group-managers")]
4170impl InstanceGroupManagers {
4171    /// Returns a builder for [InstanceGroupManagers].
4172    ///
4173    /// ```
4174    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4175    /// # use google_cloud_compute_v1::client::InstanceGroupManagers;
4176    /// let client = InstanceGroupManagers::builder().build().await?;
4177    /// # Ok(()) }
4178    /// ```
4179    pub fn builder() -> super::builder::instance_group_managers::ClientBuilder {
4180        crate::new_client_builder(super::builder::instance_group_managers::client::Factory)
4181    }
4182
4183    /// Creates a new client from the provided stub.
4184    ///
4185    /// The most common case for calling this function is in tests mocking the
4186    /// client's behavior.
4187    pub fn from_stub<T>(stub: T) -> Self
4188    where
4189        T: super::stub::InstanceGroupManagers + 'static,
4190    {
4191        Self {
4192            inner: std::sync::Arc::new(stub),
4193        }
4194    }
4195
4196    pub(crate) async fn new(
4197        config: gaxi::options::ClientConfig,
4198    ) -> crate::ClientBuilderResult<Self> {
4199        let inner = Self::build_inner(config).await?;
4200        Ok(Self { inner })
4201    }
4202
4203    async fn build_inner(
4204        conf: gaxi::options::ClientConfig,
4205    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagers>>
4206    {
4207        if gaxi::options::tracing_enabled(&conf) {
4208            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4209        }
4210        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4211    }
4212
4213    async fn build_transport(
4214        conf: gaxi::options::ClientConfig,
4215    ) -> crate::ClientBuilderResult<impl super::stub::InstanceGroupManagers> {
4216        super::transport::InstanceGroupManagers::new(conf).await
4217    }
4218
4219    async fn build_with_tracing(
4220        conf: gaxi::options::ClientConfig,
4221    ) -> crate::ClientBuilderResult<impl super::stub::InstanceGroupManagers> {
4222        Self::build_transport(conf)
4223            .await
4224            .map(super::tracing::InstanceGroupManagers::new)
4225    }
4226
4227    /// Flags the specified instances to be removed from the
4228    /// managed instance group. Abandoning an instance does not delete the
4229    /// instance, but it does remove the instance from any target pools that are
4230    /// applied by the managed instance group. This method reduces thetargetSize of the managed instance group by the
4231    /// number of instances that you abandon. This operation is marked asDONE when the action is scheduled even if the instances have
4232    /// not yet been removed from the group. You must separately verify the
4233    /// status of the abandoning action with thelistmanagedinstances
4234    /// method.
4235    ///
4236    /// If the group is part of a backend
4237    /// service that has enabled
4238    /// connection draining, it can take up to 60 seconds after the connection
4239    /// draining duration has elapsed before the VM instance is removed or deleted.
4240    ///
4241    /// You can specify a maximum of 1000 instances with this method per request.
4242    pub fn abandon_instances(&self) -> super::builder::instance_group_managers::AbandonInstances {
4243        super::builder::instance_group_managers::AbandonInstances::new(self.inner.clone())
4244    }
4245
4246    /// Retrieves the list of managed instance groups and groups them by zone.
4247    ///
4248    /// To prevent failure, Google recommends that you set the
4249    /// `returnPartialSuccess` parameter to `true`.
4250    pub fn aggregated_list(&self) -> super::builder::instance_group_managers::AggregatedList {
4251        super::builder::instance_group_managers::AggregatedList::new(self.inner.clone())
4252    }
4253
4254    /// Applies changes to selected instances on the managed instance group.
4255    /// This method can be used to apply new overrides and/or new versions.
4256    pub fn apply_updates_to_instances(
4257        &self,
4258    ) -> super::builder::instance_group_managers::ApplyUpdatesToInstances {
4259        super::builder::instance_group_managers::ApplyUpdatesToInstances::new(self.inner.clone())
4260    }
4261
4262    /// Creates instances with per-instance configurations in this managed instance
4263    /// group. Instances are created using the current instance template. Thecreate instances operation is marked DONE if thecreateInstances request is successful. The underlying actions
4264    /// take additional time. You must separately verify the status of thecreating or actions with the listmanagedinstances
4265    /// method.
4266    pub fn create_instances(&self) -> super::builder::instance_group_managers::CreateInstances {
4267        super::builder::instance_group_managers::CreateInstances::new(self.inner.clone())
4268    }
4269
4270    /// Deletes the specified managed instance group and all of the instances
4271    /// in that group. Note that the instance group must not belong to a
4272    /// backend service. Read
4273    /// Deleting an instance group for more information.
4274    pub fn delete(&self) -> super::builder::instance_group_managers::Delete {
4275        super::builder::instance_group_managers::Delete::new(self.inner.clone())
4276    }
4277
4278    /// Flags the specified instances in the managed instance group for immediate
4279    /// deletion. The instances are also removed from any target
4280    /// pools of which they were a member. This method reduces thetargetSize of the managed instance group by the number of
4281    /// instances that you delete. This operation is marked as DONE
4282    /// when the action is scheduled even if the instances are still being deleted.
4283    /// You must separately verify the status of the deleting action
4284    /// with thelistmanagedinstances
4285    /// method.
4286    ///
4287    /// If the group is part of a backend
4288    /// service that has enabled
4289    /// connection draining, it can take up to 60 seconds after the connection
4290    /// draining duration has elapsed before the VM instance is removed or deleted.
4291    ///
4292    /// You can specify a maximum of 1000 instances with this method per request.
4293    pub fn delete_instances(&self) -> super::builder::instance_group_managers::DeleteInstances {
4294        super::builder::instance_group_managers::DeleteInstances::new(self.inner.clone())
4295    }
4296
4297    /// Deletes selected per-instance configurations for the managed instance
4298    /// group.
4299    pub fn delete_per_instance_configs(
4300        &self,
4301    ) -> super::builder::instance_group_managers::DeletePerInstanceConfigs {
4302        super::builder::instance_group_managers::DeletePerInstanceConfigs::new(self.inner.clone())
4303    }
4304
4305    /// Returns all of the details about the specified managed instance group.
4306    pub fn get(&self) -> super::builder::instance_group_managers::Get {
4307        super::builder::instance_group_managers::Get::new(self.inner.clone())
4308    }
4309
4310    /// Creates a managed instance group using the information that you specify
4311    /// in the request. After the group is created, instances in the group are
4312    /// created using the specified instance template.
4313    /// This operation is marked as DONE when the group is created
4314    /// even if the instances in the group have not yet been created. You
4315    /// must separately verify the status of the individual instances with thelistmanagedinstances
4316    /// method.
4317    ///
4318    /// A managed instance group can have up to 1000 VM instances per group. Please
4319    /// contact Cloud Support if you need an increase in
4320    /// this limit.
4321    pub fn insert(&self) -> super::builder::instance_group_managers::Insert {
4322        super::builder::instance_group_managers::Insert::new(self.inner.clone())
4323    }
4324
4325    /// Retrieves a list of managed instance groups that are contained within the
4326    /// specified project and zone.
4327    pub fn list(&self) -> super::builder::instance_group_managers::List {
4328        super::builder::instance_group_managers::List::new(self.inner.clone())
4329    }
4330
4331    /// Lists all errors thrown by actions on instances for a given managed
4332    /// instance group. The filter and orderBy query
4333    /// parameters are not supported.
4334    pub fn list_errors(&self) -> super::builder::instance_group_managers::ListErrors {
4335        super::builder::instance_group_managers::ListErrors::new(self.inner.clone())
4336    }
4337
4338    /// Lists all of the instances in the managed instance group. Each instance
4339    /// in the list has a currentAction, which indicates the action
4340    /// that the managed instance group is performing on the instance. For example,
4341    /// if the group is still creating an instance, the currentAction
4342    /// is CREATING. If a previous action failed, the
4343    /// list displays the errors for that failed action. The orderBy
4344    /// query parameter is not supported. The `pageToken` query parameter is
4345    /// supported only if the group's `listManagedInstancesResults` field is set
4346    /// to `PAGINATED`.
4347    pub fn list_managed_instances(
4348        &self,
4349    ) -> super::builder::instance_group_managers::ListManagedInstances {
4350        super::builder::instance_group_managers::ListManagedInstances::new(self.inner.clone())
4351    }
4352
4353    /// Lists all of the per-instance configurations defined for the managed
4354    /// instance group. The orderBy query parameter is not supported.
4355    pub fn list_per_instance_configs(
4356        &self,
4357    ) -> super::builder::instance_group_managers::ListPerInstanceConfigs {
4358        super::builder::instance_group_managers::ListPerInstanceConfigs::new(self.inner.clone())
4359    }
4360
4361    /// Updates a managed instance group using the information that you specify
4362    /// in the request.
4363    /// This operation is marked as DONE when the group is patched
4364    /// even if the instances in the group are still in the process of being
4365    /// patched. You must separately verify the status of the individual instances
4366    /// with thelistManagedInstances
4367    /// method. This method supportsPATCH
4368    /// semantics and uses theJSON merge
4369    /// patch format and processing rules.
4370    ///
4371    /// If you update your group to specify a new template or instance
4372    /// configuration, it's possible that your intended specification for each VM
4373    /// in the group is different from the current state of that VM. To learn how
4374    /// to apply an updated configuration to the VMs in a MIG, seeUpdating instances in
4375    /// a MIG.
4376    pub fn patch(&self) -> super::builder::instance_group_managers::Patch {
4377        super::builder::instance_group_managers::Patch::new(self.inner.clone())
4378    }
4379
4380    /// Inserts or patches per-instance configurations for the managed instance
4381    /// group. perInstanceConfig.name serves as a key used to
4382    /// distinguish whether to perform insert or patch.
4383    pub fn patch_per_instance_configs(
4384        &self,
4385    ) -> super::builder::instance_group_managers::PatchPerInstanceConfigs {
4386        super::builder::instance_group_managers::PatchPerInstanceConfigs::new(self.inner.clone())
4387    }
4388
4389    /// Flags the specified VM instances in the managed instance group to be
4390    /// immediately recreated. Each instance is recreated using the group's current
4391    /// configuration. This operation is marked as DONE when the flag
4392    /// is set even if the instances have not yet been recreated. You must
4393    /// separately verify the status of each instance by checking itscurrentAction field; for more information, see Checking
4394    /// the status of managed instances.
4395    ///
4396    /// If the group is part of a backend
4397    /// service that has enabled
4398    /// connection draining, it can take up to 60 seconds after the connection
4399    /// draining duration has elapsed before the VM instance is removed or deleted.
4400    ///
4401    /// You can specify a maximum of 1000 instances with this method per request.
4402    pub fn recreate_instances(&self) -> super::builder::instance_group_managers::RecreateInstances {
4403        super::builder::instance_group_managers::RecreateInstances::new(self.inner.clone())
4404    }
4405
4406    /// Resizes the managed instance group. If you increase the size, the group
4407    /// creates new instances using the current instance template. If you decrease
4408    /// the size, the group deletes instances. The resize operation is markedDONE when the resize actions are scheduled even if the group
4409    /// has not yet added or deleted any instances. You must separately
4410    /// verify the status of the creating or deleting
4411    /// actions with thelistmanagedinstances
4412    /// method.
4413    ///
4414    /// When resizing down, the instance group arbitrarily chooses the order in
4415    /// which VMs are deleted. The group takes into account some VM attributes when
4416    /// making the selection including:
4417    ///
4418    /// + The status of the VM instance.
4419    /// + The health of the VM instance.
4420    /// + The instance template version the VM is based on.
4421    /// + For regional managed instance groups, the location of the VM instance.
4422    ///
4423    /// This list is subject to change.
4424    ///
4425    /// If the group is part of a backend
4426    /// service that has enabled
4427    /// connection draining, it can take up to 60 seconds after the connection
4428    /// draining duration has elapsed before the VM instance is removed or deleted.
4429    pub fn resize(&self) -> super::builder::instance_group_managers::Resize {
4430        super::builder::instance_group_managers::Resize::new(self.inner.clone())
4431    }
4432
4433    /// Flags the specified instances in the managed instance group to be
4434    /// resumed. This method increases thetargetSize and decreases the targetSuspendedSize
4435    /// of the managed instance group by the number of instances that you resume.
4436    /// The resumeInstances operation is marked DONE if
4437    /// the resumeInstances request is successful. The underlying
4438    /// actions take additional time. You must separately verify the status of theRESUMING action with thelistmanagedinstances
4439    /// method.
4440    ///
4441    /// In this request, you can only specify instances that are suspended. For
4442    /// example, if an instance was previously suspended using the suspendInstances
4443    /// method, it can be resumed using the resumeInstances method.
4444    ///
4445    /// If a health check is attached to the managed instance group, the specified
4446    /// instances will be verified as healthy after they are resumed.
4447    ///
4448    /// You can specify a maximum of 1000 instances with this method per request.
4449    pub fn resume_instances(&self) -> super::builder::instance_group_managers::ResumeInstances {
4450        super::builder::instance_group_managers::ResumeInstances::new(self.inner.clone())
4451    }
4452
4453    /// Specifies the instance template to use when creating new instances in this
4454    /// group. The templates for existing instances in the group do not change
4455    /// unless you run recreateInstances, runapplyUpdatesToInstances, or set the group'supdatePolicy.type to PROACTIVE.
4456    pub fn set_instance_template(
4457        &self,
4458    ) -> super::builder::instance_group_managers::SetInstanceTemplate {
4459        super::builder::instance_group_managers::SetInstanceTemplate::new(self.inner.clone())
4460    }
4461
4462    /// Modifies the target pools to which all instances in this managed instance
4463    /// group are assigned. The target pools automatically apply to all of the
4464    /// instances in the managed instance group. This operation is markedDONE when you make the request even if the instances have not
4465    /// yet been added to their target pools. The change might take some time to
4466    /// apply to all of the instances in the group depending on the size of the
4467    /// group.
4468    pub fn set_target_pools(&self) -> super::builder::instance_group_managers::SetTargetPools {
4469        super::builder::instance_group_managers::SetTargetPools::new(self.inner.clone())
4470    }
4471
4472    /// Flags the specified instances in the managed instance group to be
4473    /// started. This method increases thetargetSize and decreases the targetStoppedSize
4474    /// of the managed instance group by the number of instances that you start.
4475    /// The startInstances operation is marked DONE if
4476    /// the startInstances request is successful. The underlying
4477    /// actions take additional time. You must separately verify the status of theSTARTING action with thelistmanagedinstances
4478    /// method.
4479    ///
4480    /// In this request, you can only specify instances that are stopped. For
4481    /// example, if an instance was previously stopped using the stopInstances
4482    /// method, it can be started using the startInstances method.
4483    ///
4484    /// If a health check is attached to the managed instance group, the specified
4485    /// instances will be verified as healthy after they are started.
4486    ///
4487    /// You can specify a maximum of 1000 instances with this method per request.
4488    pub fn start_instances(&self) -> super::builder::instance_group_managers::StartInstances {
4489        super::builder::instance_group_managers::StartInstances::new(self.inner.clone())
4490    }
4491
4492    /// Flags the specified instances in the managed instance group to be
4493    /// immediately stopped. You can only specify instances that are running in
4494    /// this request. This method reduces thetargetSize and increases the targetStoppedSize
4495    /// of the managed instance group by the number of instances that you stop.
4496    /// The stopInstances operation is marked DONE if
4497    /// the stopInstances request is successful. The underlying
4498    /// actions take additional time. You must separately verify the status of theSTOPPING action with thelistmanagedinstances
4499    /// method.
4500    ///
4501    /// If the standbyPolicy.initialDelaySec field is set, the group
4502    /// delays stopping the instances until initialDelaySec have
4503    /// passed from instance.creationTimestamp (that is, when the
4504    /// instance was created). This delay gives your application time to
4505    /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
4506    /// will be zero delay.
4507    ///
4508    /// If the group is part of a backend
4509    /// service that has enabled
4510    /// connection draining, it can take up to 60 seconds after the connection
4511    /// draining duration has elapsed before the VM instance is stopped.
4512    ///
4513    /// Stopped instances can be started using the startInstances
4514    /// method.
4515    ///
4516    /// You can specify a maximum of 1000 instances with this method per request.
4517    pub fn stop_instances(&self) -> super::builder::instance_group_managers::StopInstances {
4518        super::builder::instance_group_managers::StopInstances::new(self.inner.clone())
4519    }
4520
4521    /// Flags the specified instances in the managed instance group to be
4522    /// immediately suspended. You can only specify instances that are running in
4523    /// this request. This method reduces thetargetSize and increases the targetSuspendedSize
4524    /// of the managed instance group by the number of instances that you suspend.
4525    /// The suspendInstances operation is marked DONE if
4526    /// the suspendInstances request is successful. The underlying
4527    /// actions take additional time. You must separately verify the status of theSUSPENDING action with thelistmanagedinstances
4528    /// method.
4529    ///
4530    /// If the standbyPolicy.initialDelaySec field is set, the group
4531    /// delays suspension of the instances until initialDelaySec have
4532    /// passed from instance.creationTimestamp (that is, when the
4533    /// instance was created). This delay gives your application time to
4534    /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
4535    /// will be zero delay.
4536    ///
4537    /// If the group is part of a backend
4538    /// service that has enabled
4539    /// connection draining, it can take up to 60 seconds after the connection
4540    /// draining duration has elapsed before the VM instance is suspended.
4541    ///
4542    /// Suspended instances can be resumed using the resumeInstances
4543    /// method.
4544    ///
4545    /// You can specify a maximum of 1000 instances with this method per request.
4546    pub fn suspend_instances(&self) -> super::builder::instance_group_managers::SuspendInstances {
4547        super::builder::instance_group_managers::SuspendInstances::new(self.inner.clone())
4548    }
4549
4550    /// Inserts or updates per-instance configurations for the managed instance
4551    /// group. perInstanceConfig.name serves as a key used to
4552    /// distinguish whether to perform insert or patch.
4553    pub fn update_per_instance_configs(
4554        &self,
4555    ) -> super::builder::instance_group_managers::UpdatePerInstanceConfigs {
4556        super::builder::instance_group_managers::UpdatePerInstanceConfigs::new(self.inner.clone())
4557    }
4558
4559    /// Retrieves the specified zone-specific Operations resource.
4560    pub fn get_operation(&self) -> super::builder::instance_group_managers::GetOperation {
4561        super::builder::instance_group_managers::GetOperation::new(self.inner.clone())
4562    }
4563}
4564
4565/// Implements a client for the Google Compute Engine API.
4566///
4567/// # Example
4568/// ```
4569/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4570/// # use google_cloud_compute_v1::client::InstanceGroups;
4571/// let client = InstanceGroups::builder().build().await?;
4572/// // use `client` to make requests to the Google Compute Engine API.
4573/// # Ok(()) }
4574/// ```
4575///
4576/// # Service Description
4577///
4578/// Service for the `instanceGroups` resource.
4579///
4580/// # Configuration
4581///
4582/// To configure `InstanceGroups` use the `with_*` methods in the type returned
4583/// by [builder()][InstanceGroups::builder]. The default configuration should
4584/// work for most applications. Common configuration changes include
4585///
4586/// * [with_endpoint()]: by default this client uses the global default endpoint
4587///   (`https://compute.googleapis.com`). Applications using regional
4588///   endpoints or running in restricted networks (e.g. a network configured
4589//    with [Private Google Access with VPC Service Controls]) may want to
4590///   override this default.
4591/// * [with_credentials()]: by default this client uses
4592///   [Application Default Credentials]. Applications using custom
4593///   authentication may need to override this default.
4594///
4595/// [with_endpoint()]: super::builder::instance_groups::ClientBuilder::with_endpoint
4596/// [with_credentials()]: super::builder::instance_groups::ClientBuilder::credentials
4597/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4598/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4599///
4600/// # Pooling and Cloning
4601///
4602/// `InstanceGroups` holds a connection pool internally, it is advised to
4603/// create one and the reuse it.  You do not need to wrap `InstanceGroups` in
4604/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4605/// already uses an `Arc` internally.
4606#[cfg(feature = "instance-groups")]
4607#[cfg_attr(docsrs, doc(cfg(feature = "instance-groups")))]
4608#[derive(Clone, Debug)]
4609pub struct InstanceGroups {
4610    inner: std::sync::Arc<dyn super::stub::dynamic::InstanceGroups>,
4611}
4612
4613#[cfg(feature = "instance-groups")]
4614impl InstanceGroups {
4615    /// Returns a builder for [InstanceGroups].
4616    ///
4617    /// ```
4618    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4619    /// # use google_cloud_compute_v1::client::InstanceGroups;
4620    /// let client = InstanceGroups::builder().build().await?;
4621    /// # Ok(()) }
4622    /// ```
4623    pub fn builder() -> super::builder::instance_groups::ClientBuilder {
4624        crate::new_client_builder(super::builder::instance_groups::client::Factory)
4625    }
4626
4627    /// Creates a new client from the provided stub.
4628    ///
4629    /// The most common case for calling this function is in tests mocking the
4630    /// client's behavior.
4631    pub fn from_stub<T>(stub: T) -> Self
4632    where
4633        T: super::stub::InstanceGroups + 'static,
4634    {
4635        Self {
4636            inner: std::sync::Arc::new(stub),
4637        }
4638    }
4639
4640    pub(crate) async fn new(
4641        config: gaxi::options::ClientConfig,
4642    ) -> crate::ClientBuilderResult<Self> {
4643        let inner = Self::build_inner(config).await?;
4644        Ok(Self { inner })
4645    }
4646
4647    async fn build_inner(
4648        conf: gaxi::options::ClientConfig,
4649    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InstanceGroups>> {
4650        if gaxi::options::tracing_enabled(&conf) {
4651            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4652        }
4653        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4654    }
4655
4656    async fn build_transport(
4657        conf: gaxi::options::ClientConfig,
4658    ) -> crate::ClientBuilderResult<impl super::stub::InstanceGroups> {
4659        super::transport::InstanceGroups::new(conf).await
4660    }
4661
4662    async fn build_with_tracing(
4663        conf: gaxi::options::ClientConfig,
4664    ) -> crate::ClientBuilderResult<impl super::stub::InstanceGroups> {
4665        Self::build_transport(conf)
4666            .await
4667            .map(super::tracing::InstanceGroups::new)
4668    }
4669
4670    /// Adds a list of instances to the specified instance group.  All of the
4671    /// instances in the instance group must be in the same network/subnetwork.
4672    /// Read
4673    /// Adding instances for more information.
4674    pub fn add_instances(&self) -> super::builder::instance_groups::AddInstances {
4675        super::builder::instance_groups::AddInstances::new(self.inner.clone())
4676    }
4677
4678    /// Retrieves the list of instance groups and sorts them by zone.
4679    ///
4680    /// To prevent failure, Google recommends that you set the
4681    /// `returnPartialSuccess` parameter to `true`.
4682    pub fn aggregated_list(&self) -> super::builder::instance_groups::AggregatedList {
4683        super::builder::instance_groups::AggregatedList::new(self.inner.clone())
4684    }
4685
4686    /// Deletes the specified instance group. The instances in the group are not
4687    /// deleted. Note that instance group must not belong to a backend service.
4688    /// Read
4689    /// Deleting an instance group for more information.
4690    pub fn delete(&self) -> super::builder::instance_groups::Delete {
4691        super::builder::instance_groups::Delete::new(self.inner.clone())
4692    }
4693
4694    /// Returns the specified zonal instance group. Get a list of available zonal
4695    /// instance groups by making a list() request.
4696    ///
4697    /// For managed instance groups, use theinstanceGroupManagers
4698    /// or regionInstanceGroupManagers
4699    /// methods instead.
4700    pub fn get(&self) -> super::builder::instance_groups::Get {
4701        super::builder::instance_groups::Get::new(self.inner.clone())
4702    }
4703
4704    /// Creates an instance group in the specified project using the
4705    /// parameters that are included in the request.
4706    pub fn insert(&self) -> super::builder::instance_groups::Insert {
4707        super::builder::instance_groups::Insert::new(self.inner.clone())
4708    }
4709
4710    /// Retrieves the list of zonal instance group resources contained within the
4711    /// specified zone.
4712    ///
4713    /// For managed instance groups, use theinstanceGroupManagers
4714    /// or regionInstanceGroupManagers
4715    /// methods instead.
4716    pub fn list(&self) -> super::builder::instance_groups::List {
4717        super::builder::instance_groups::List::new(self.inner.clone())
4718    }
4719
4720    /// Lists the instances in the specified instance group.
4721    /// The orderBy query parameter is not supported.
4722    /// The filter query parameter is supported, but only for
4723    /// expressions that use `eq` (equal) or `ne` (not equal) operators.
4724    pub fn list_instances(&self) -> super::builder::instance_groups::ListInstances {
4725        super::builder::instance_groups::ListInstances::new(self.inner.clone())
4726    }
4727
4728    /// Removes one or more instances from the specified instance group, but does
4729    /// not delete those instances.
4730    ///
4731    /// If the group is part of a backend
4732    /// service that has enabled
4733    /// connection draining, it can take up to 60 seconds after the connection
4734    /// draining duration before the VM instance is removed or deleted.
4735    pub fn remove_instances(&self) -> super::builder::instance_groups::RemoveInstances {
4736        super::builder::instance_groups::RemoveInstances::new(self.inner.clone())
4737    }
4738
4739    /// Sets the named ports for the specified instance group.
4740    pub fn set_named_ports(&self) -> super::builder::instance_groups::SetNamedPorts {
4741        super::builder::instance_groups::SetNamedPorts::new(self.inner.clone())
4742    }
4743
4744    /// Returns permissions that a caller has on the specified resource.
4745    pub fn test_iam_permissions(&self) -> super::builder::instance_groups::TestIamPermissions {
4746        super::builder::instance_groups::TestIamPermissions::new(self.inner.clone())
4747    }
4748
4749    /// Retrieves the specified zone-specific Operations resource.
4750    pub fn get_operation(&self) -> super::builder::instance_groups::GetOperation {
4751        super::builder::instance_groups::GetOperation::new(self.inner.clone())
4752    }
4753}
4754
4755/// Implements a client for the Google Compute Engine API.
4756///
4757/// # Example
4758/// ```
4759/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4760/// # use google_cloud_compute_v1::client::InstanceSettings;
4761/// let client = InstanceSettings::builder().build().await?;
4762/// // use `client` to make requests to the Google Compute Engine API.
4763/// # Ok(()) }
4764/// ```
4765///
4766/// # Service Description
4767///
4768/// Service for the `instanceSettings` resource.
4769///
4770/// # Configuration
4771///
4772/// To configure `InstanceSettings` use the `with_*` methods in the type returned
4773/// by [builder()][InstanceSettings::builder]. The default configuration should
4774/// work for most applications. Common configuration changes include
4775///
4776/// * [with_endpoint()]: by default this client uses the global default endpoint
4777///   (`https://compute.googleapis.com`). Applications using regional
4778///   endpoints or running in restricted networks (e.g. a network configured
4779//    with [Private Google Access with VPC Service Controls]) may want to
4780///   override this default.
4781/// * [with_credentials()]: by default this client uses
4782///   [Application Default Credentials]. Applications using custom
4783///   authentication may need to override this default.
4784///
4785/// [with_endpoint()]: super::builder::instance_settings::ClientBuilder::with_endpoint
4786/// [with_credentials()]: super::builder::instance_settings::ClientBuilder::credentials
4787/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4788/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4789///
4790/// # Pooling and Cloning
4791///
4792/// `InstanceSettings` holds a connection pool internally, it is advised to
4793/// create one and the reuse it.  You do not need to wrap `InstanceSettings` in
4794/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4795/// already uses an `Arc` internally.
4796#[cfg(feature = "instance-settings")]
4797#[cfg_attr(docsrs, doc(cfg(feature = "instance-settings")))]
4798#[derive(Clone, Debug)]
4799pub struct InstanceSettings {
4800    inner: std::sync::Arc<dyn super::stub::dynamic::InstanceSettings>,
4801}
4802
4803#[cfg(feature = "instance-settings")]
4804impl InstanceSettings {
4805    /// Returns a builder for [InstanceSettings].
4806    ///
4807    /// ```
4808    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4809    /// # use google_cloud_compute_v1::client::InstanceSettings;
4810    /// let client = InstanceSettings::builder().build().await?;
4811    /// # Ok(()) }
4812    /// ```
4813    pub fn builder() -> super::builder::instance_settings::ClientBuilder {
4814        crate::new_client_builder(super::builder::instance_settings::client::Factory)
4815    }
4816
4817    /// Creates a new client from the provided stub.
4818    ///
4819    /// The most common case for calling this function is in tests mocking the
4820    /// client's behavior.
4821    pub fn from_stub<T>(stub: T) -> Self
4822    where
4823        T: super::stub::InstanceSettings + 'static,
4824    {
4825        Self {
4826            inner: std::sync::Arc::new(stub),
4827        }
4828    }
4829
4830    pub(crate) async fn new(
4831        config: gaxi::options::ClientConfig,
4832    ) -> crate::ClientBuilderResult<Self> {
4833        let inner = Self::build_inner(config).await?;
4834        Ok(Self { inner })
4835    }
4836
4837    async fn build_inner(
4838        conf: gaxi::options::ClientConfig,
4839    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InstanceSettings>>
4840    {
4841        if gaxi::options::tracing_enabled(&conf) {
4842            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4843        }
4844        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4845    }
4846
4847    async fn build_transport(
4848        conf: gaxi::options::ClientConfig,
4849    ) -> crate::ClientBuilderResult<impl super::stub::InstanceSettings> {
4850        super::transport::InstanceSettings::new(conf).await
4851    }
4852
4853    async fn build_with_tracing(
4854        conf: gaxi::options::ClientConfig,
4855    ) -> crate::ClientBuilderResult<impl super::stub::InstanceSettings> {
4856        Self::build_transport(conf)
4857            .await
4858            .map(super::tracing::InstanceSettings::new)
4859    }
4860
4861    /// Get Instance settings.
4862    pub fn get(&self) -> super::builder::instance_settings::Get {
4863        super::builder::instance_settings::Get::new(self.inner.clone())
4864    }
4865
4866    /// Patch Instance settings
4867    pub fn patch(&self) -> super::builder::instance_settings::Patch {
4868        super::builder::instance_settings::Patch::new(self.inner.clone())
4869    }
4870
4871    /// Retrieves the specified zone-specific Operations resource.
4872    pub fn get_operation(&self) -> super::builder::instance_settings::GetOperation {
4873        super::builder::instance_settings::GetOperation::new(self.inner.clone())
4874    }
4875}
4876
4877/// Implements a client for the Google Compute Engine API.
4878///
4879/// # Example
4880/// ```
4881/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4882/// # use google_cloud_compute_v1::client::InstanceTemplates;
4883/// let client = InstanceTemplates::builder().build().await?;
4884/// // use `client` to make requests to the Google Compute Engine API.
4885/// # Ok(()) }
4886/// ```
4887///
4888/// # Service Description
4889///
4890/// Service for the `instanceTemplates` resource.
4891///
4892/// # Configuration
4893///
4894/// To configure `InstanceTemplates` use the `with_*` methods in the type returned
4895/// by [builder()][InstanceTemplates::builder]. The default configuration should
4896/// work for most applications. Common configuration changes include
4897///
4898/// * [with_endpoint()]: by default this client uses the global default endpoint
4899///   (`https://compute.googleapis.com`). Applications using regional
4900///   endpoints or running in restricted networks (e.g. a network configured
4901//    with [Private Google Access with VPC Service Controls]) may want to
4902///   override this default.
4903/// * [with_credentials()]: by default this client uses
4904///   [Application Default Credentials]. Applications using custom
4905///   authentication may need to override this default.
4906///
4907/// [with_endpoint()]: super::builder::instance_templates::ClientBuilder::with_endpoint
4908/// [with_credentials()]: super::builder::instance_templates::ClientBuilder::credentials
4909/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4910/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4911///
4912/// # Pooling and Cloning
4913///
4914/// `InstanceTemplates` holds a connection pool internally, it is advised to
4915/// create one and the reuse it.  You do not need to wrap `InstanceTemplates` in
4916/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4917/// already uses an `Arc` internally.
4918#[cfg(feature = "instance-templates")]
4919#[cfg_attr(docsrs, doc(cfg(feature = "instance-templates")))]
4920#[derive(Clone, Debug)]
4921pub struct InstanceTemplates {
4922    inner: std::sync::Arc<dyn super::stub::dynamic::InstanceTemplates>,
4923}
4924
4925#[cfg(feature = "instance-templates")]
4926impl InstanceTemplates {
4927    /// Returns a builder for [InstanceTemplates].
4928    ///
4929    /// ```
4930    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4931    /// # use google_cloud_compute_v1::client::InstanceTemplates;
4932    /// let client = InstanceTemplates::builder().build().await?;
4933    /// # Ok(()) }
4934    /// ```
4935    pub fn builder() -> super::builder::instance_templates::ClientBuilder {
4936        crate::new_client_builder(super::builder::instance_templates::client::Factory)
4937    }
4938
4939    /// Creates a new client from the provided stub.
4940    ///
4941    /// The most common case for calling this function is in tests mocking the
4942    /// client's behavior.
4943    pub fn from_stub<T>(stub: T) -> Self
4944    where
4945        T: super::stub::InstanceTemplates + 'static,
4946    {
4947        Self {
4948            inner: std::sync::Arc::new(stub),
4949        }
4950    }
4951
4952    pub(crate) async fn new(
4953        config: gaxi::options::ClientConfig,
4954    ) -> crate::ClientBuilderResult<Self> {
4955        let inner = Self::build_inner(config).await?;
4956        Ok(Self { inner })
4957    }
4958
4959    async fn build_inner(
4960        conf: gaxi::options::ClientConfig,
4961    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InstanceTemplates>>
4962    {
4963        if gaxi::options::tracing_enabled(&conf) {
4964            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4965        }
4966        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4967    }
4968
4969    async fn build_transport(
4970        conf: gaxi::options::ClientConfig,
4971    ) -> crate::ClientBuilderResult<impl super::stub::InstanceTemplates> {
4972        super::transport::InstanceTemplates::new(conf).await
4973    }
4974
4975    async fn build_with_tracing(
4976        conf: gaxi::options::ClientConfig,
4977    ) -> crate::ClientBuilderResult<impl super::stub::InstanceTemplates> {
4978        Self::build_transport(conf)
4979            .await
4980            .map(super::tracing::InstanceTemplates::new)
4981    }
4982
4983    /// Retrieves the list of all InstanceTemplates resources, regional and global,
4984    /// available to the specified project.
4985    ///
4986    /// To prevent failure, Google recommends that you set the
4987    /// `returnPartialSuccess` parameter to `true`.
4988    pub fn aggregated_list(&self) -> super::builder::instance_templates::AggregatedList {
4989        super::builder::instance_templates::AggregatedList::new(self.inner.clone())
4990    }
4991
4992    /// Deletes the specified instance template. Deleting an instance template is
4993    /// permanent and cannot be undone. It is not possible to delete templates
4994    /// that are already in use by a managed instance group.
4995    pub fn delete(&self) -> super::builder::instance_templates::Delete {
4996        super::builder::instance_templates::Delete::new(self.inner.clone())
4997    }
4998
4999    /// Returns the specified instance template.
5000    pub fn get(&self) -> super::builder::instance_templates::Get {
5001        super::builder::instance_templates::Get::new(self.inner.clone())
5002    }
5003
5004    /// Gets the access control policy for a resource. May be empty if no such
5005    /// policy or resource exists.
5006    pub fn get_iam_policy(&self) -> super::builder::instance_templates::GetIamPolicy {
5007        super::builder::instance_templates::GetIamPolicy::new(self.inner.clone())
5008    }
5009
5010    /// Creates an instance template in the specified project using the
5011    /// data that is included in the request. If you are creating a new template to
5012    /// update an existing instance group, your new instance template must use the
5013    /// same network or, if applicable, the same subnetwork as the original
5014    /// template.
5015    pub fn insert(&self) -> super::builder::instance_templates::Insert {
5016        super::builder::instance_templates::Insert::new(self.inner.clone())
5017    }
5018
5019    /// Retrieves a list of instance templates that are contained within
5020    /// the specified project.
5021    pub fn list(&self) -> super::builder::instance_templates::List {
5022        super::builder::instance_templates::List::new(self.inner.clone())
5023    }
5024
5025    /// Sets the access control policy on the specified resource.
5026    /// Replaces any existing policy.
5027    pub fn set_iam_policy(&self) -> super::builder::instance_templates::SetIamPolicy {
5028        super::builder::instance_templates::SetIamPolicy::new(self.inner.clone())
5029    }
5030
5031    /// Returns permissions that a caller has on the specified resource.
5032    pub fn test_iam_permissions(&self) -> super::builder::instance_templates::TestIamPermissions {
5033        super::builder::instance_templates::TestIamPermissions::new(self.inner.clone())
5034    }
5035
5036    /// Retrieves the specified Operations resource.
5037    pub fn get_operation(&self) -> super::builder::instance_templates::GetOperation {
5038        super::builder::instance_templates::GetOperation::new(self.inner.clone())
5039    }
5040}
5041
5042/// Implements a client for the Google Compute Engine API.
5043///
5044/// # Example
5045/// ```
5046/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5047/// # use google_cloud_compute_v1::client::Instances;
5048/// let client = Instances::builder().build().await?;
5049/// // use `client` to make requests to the Google Compute Engine API.
5050/// # Ok(()) }
5051/// ```
5052///
5053/// # Service Description
5054///
5055/// Service for the `instances` resource.
5056///
5057/// # Configuration
5058///
5059/// To configure `Instances` use the `with_*` methods in the type returned
5060/// by [builder()][Instances::builder]. The default configuration should
5061/// work for most applications. Common configuration changes include
5062///
5063/// * [with_endpoint()]: by default this client uses the global default endpoint
5064///   (`https://compute.googleapis.com`). Applications using regional
5065///   endpoints or running in restricted networks (e.g. a network configured
5066//    with [Private Google Access with VPC Service Controls]) may want to
5067///   override this default.
5068/// * [with_credentials()]: by default this client uses
5069///   [Application Default Credentials]. Applications using custom
5070///   authentication may need to override this default.
5071///
5072/// [with_endpoint()]: super::builder::instances::ClientBuilder::with_endpoint
5073/// [with_credentials()]: super::builder::instances::ClientBuilder::credentials
5074/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5075/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5076///
5077/// # Pooling and Cloning
5078///
5079/// `Instances` holds a connection pool internally, it is advised to
5080/// create one and the reuse it.  You do not need to wrap `Instances` in
5081/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5082/// already uses an `Arc` internally.
5083#[cfg(feature = "instances")]
5084#[cfg_attr(docsrs, doc(cfg(feature = "instances")))]
5085#[derive(Clone, Debug)]
5086pub struct Instances {
5087    inner: std::sync::Arc<dyn super::stub::dynamic::Instances>,
5088}
5089
5090#[cfg(feature = "instances")]
5091impl Instances {
5092    /// Returns a builder for [Instances].
5093    ///
5094    /// ```
5095    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5096    /// # use google_cloud_compute_v1::client::Instances;
5097    /// let client = Instances::builder().build().await?;
5098    /// # Ok(()) }
5099    /// ```
5100    pub fn builder() -> super::builder::instances::ClientBuilder {
5101        crate::new_client_builder(super::builder::instances::client::Factory)
5102    }
5103
5104    /// Creates a new client from the provided stub.
5105    ///
5106    /// The most common case for calling this function is in tests mocking the
5107    /// client's behavior.
5108    pub fn from_stub<T>(stub: T) -> Self
5109    where
5110        T: super::stub::Instances + 'static,
5111    {
5112        Self {
5113            inner: std::sync::Arc::new(stub),
5114        }
5115    }
5116
5117    pub(crate) async fn new(
5118        config: gaxi::options::ClientConfig,
5119    ) -> crate::ClientBuilderResult<Self> {
5120        let inner = Self::build_inner(config).await?;
5121        Ok(Self { inner })
5122    }
5123
5124    async fn build_inner(
5125        conf: gaxi::options::ClientConfig,
5126    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Instances>> {
5127        if gaxi::options::tracing_enabled(&conf) {
5128            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5129        }
5130        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5131    }
5132
5133    async fn build_transport(
5134        conf: gaxi::options::ClientConfig,
5135    ) -> crate::ClientBuilderResult<impl super::stub::Instances> {
5136        super::transport::Instances::new(conf).await
5137    }
5138
5139    async fn build_with_tracing(
5140        conf: gaxi::options::ClientConfig,
5141    ) -> crate::ClientBuilderResult<impl super::stub::Instances> {
5142        Self::build_transport(conf)
5143            .await
5144            .map(super::tracing::Instances::new)
5145    }
5146
5147    /// Adds an access config to an instance's network interface.
5148    pub fn add_access_config(&self) -> super::builder::instances::AddAccessConfig {
5149        super::builder::instances::AddAccessConfig::new(self.inner.clone())
5150    }
5151
5152    /// Adds one dynamic network interface to an active instance.
5153    pub fn add_network_interface(&self) -> super::builder::instances::AddNetworkInterface {
5154        super::builder::instances::AddNetworkInterface::new(self.inner.clone())
5155    }
5156
5157    /// Adds existing resource policies to an instance. You can only add one
5158    /// policy right now which will be applied to this instance for scheduling live
5159    /// migrations.
5160    pub fn add_resource_policies(&self) -> super::builder::instances::AddResourcePolicies {
5161        super::builder::instances::AddResourcePolicies::new(self.inner.clone())
5162    }
5163
5164    /// Retrieves an aggregated list of all of the instances in your project
5165    /// across all regions and zones.
5166    ///
5167    /// The performance of this method degrades when a filter is specified on a
5168    /// project that has a very large number of instances.
5169    ///
5170    /// To prevent failure, Google recommends that you set the
5171    /// `returnPartialSuccess` parameter to `true`.
5172    pub fn aggregated_list(&self) -> super::builder::instances::AggregatedList {
5173        super::builder::instances::AggregatedList::new(self.inner.clone())
5174    }
5175
5176    /// Attaches an existing Disk resource to an instance. You must first
5177    /// create the disk before you can attach it. It is not possible to create
5178    /// and attach a disk at the same time. For more information, readAdding a
5179    /// persistent disk to your instance.
5180    pub fn attach_disk(&self) -> super::builder::instances::AttachDisk {
5181        super::builder::instances::AttachDisk::new(self.inner.clone())
5182    }
5183
5184    /// Creates multiple instances. Count specifies the number of instances to
5185    /// create. For more information, seeAbout bulk
5186    /// creation of VMs.
5187    pub fn bulk_insert(&self) -> super::builder::instances::BulkInsert {
5188        super::builder::instances::BulkInsert::new(self.inner.clone())
5189    }
5190
5191    /// Deletes the specified Instance resource. For more information, seeDeleting
5192    /// an instance.
5193    pub fn delete(&self) -> super::builder::instances::Delete {
5194        super::builder::instances::Delete::new(self.inner.clone())
5195    }
5196
5197    /// Deletes an access config from an instance's network interface.
5198    pub fn delete_access_config(&self) -> super::builder::instances::DeleteAccessConfig {
5199        super::builder::instances::DeleteAccessConfig::new(self.inner.clone())
5200    }
5201
5202    /// Deletes one dynamic network interface from an active instance.
5203    /// InstancesDeleteNetworkInterfaceRequest indicates:
5204    ///
5205    /// - instance from which to delete, using project+zone+resource_id fields;
5206    /// - dynamic network interface to be deleted, using network_interface_name
5207    ///   field;
5208    pub fn delete_network_interface(&self) -> super::builder::instances::DeleteNetworkInterface {
5209        super::builder::instances::DeleteNetworkInterface::new(self.inner.clone())
5210    }
5211
5212    /// Detaches a disk from an instance.
5213    pub fn detach_disk(&self) -> super::builder::instances::DetachDisk {
5214        super::builder::instances::DetachDisk::new(self.inner.clone())
5215    }
5216
5217    /// Returns the specified Instance resource.
5218    pub fn get(&self) -> super::builder::instances::Get {
5219        super::builder::instances::Get::new(self.inner.clone())
5220    }
5221
5222    /// Returns effective firewalls applied to an interface of the instance.
5223    pub fn get_effective_firewalls(&self) -> super::builder::instances::GetEffectiveFirewalls {
5224        super::builder::instances::GetEffectiveFirewalls::new(self.inner.clone())
5225    }
5226
5227    /// Returns the specified guest attributes entry.
5228    pub fn get_guest_attributes(&self) -> super::builder::instances::GetGuestAttributes {
5229        super::builder::instances::GetGuestAttributes::new(self.inner.clone())
5230    }
5231
5232    /// Gets the access control policy for a resource. May be empty if no such
5233    /// policy or resource exists.
5234    pub fn get_iam_policy(&self) -> super::builder::instances::GetIamPolicy {
5235        super::builder::instances::GetIamPolicy::new(self.inner.clone())
5236    }
5237
5238    /// Returns the screenshot from the specified instance.
5239    pub fn get_screenshot(&self) -> super::builder::instances::GetScreenshot {
5240        super::builder::instances::GetScreenshot::new(self.inner.clone())
5241    }
5242
5243    /// Returns the last 1 MB of serial port output from the specified instance.
5244    pub fn get_serial_port_output(&self) -> super::builder::instances::GetSerialPortOutput {
5245        super::builder::instances::GetSerialPortOutput::new(self.inner.clone())
5246    }
5247
5248    /// Returns the Shielded Instance Identity of an instance
5249    pub fn get_shielded_instance_identity(
5250        &self,
5251    ) -> super::builder::instances::GetShieldedInstanceIdentity {
5252        super::builder::instances::GetShieldedInstanceIdentity::new(self.inner.clone())
5253    }
5254
5255    /// Creates an instance resource in the specified project using the data
5256    /// included in the request.
5257    pub fn insert(&self) -> super::builder::instances::Insert {
5258        super::builder::instances::Insert::new(self.inner.clone())
5259    }
5260
5261    /// Retrieves the list of instances contained within
5262    /// the specified zone.
5263    pub fn list(&self) -> super::builder::instances::List {
5264        super::builder::instances::List::new(self.inner.clone())
5265    }
5266
5267    /// Retrieves a list of resources that refer to the VM instance specified in
5268    /// the request. For example, if the VM instance is part of a managed or
5269    /// unmanaged instance group, the referrers list includes the instance group.
5270    /// For more information, readViewing
5271    /// referrers to VM instances.
5272    pub fn list_referrers(&self) -> super::builder::instances::ListReferrers {
5273        super::builder::instances::ListReferrers::new(self.inner.clone())
5274    }
5275
5276    /// Perform a manual maintenance on the instance.
5277    pub fn perform_maintenance(&self) -> super::builder::instances::PerformMaintenance {
5278        super::builder::instances::PerformMaintenance::new(self.inner.clone())
5279    }
5280
5281    /// Removes resource policies from an instance.
5282    pub fn remove_resource_policies(&self) -> super::builder::instances::RemoveResourcePolicies {
5283        super::builder::instances::RemoveResourcePolicies::new(self.inner.clone())
5284    }
5285
5286    /// Mark the host as faulty and try to restart the instance on a new host.
5287    pub fn report_host_as_faulty(&self) -> super::builder::instances::ReportHostAsFaulty {
5288        super::builder::instances::ReportHostAsFaulty::new(self.inner.clone())
5289    }
5290
5291    /// Performs a reset on the instance. This is a hard reset. The VM
5292    /// does not do a graceful shutdown. For more information, seeResetting
5293    /// an instance.
5294    pub fn reset(&self) -> super::builder::instances::Reset {
5295        super::builder::instances::Reset::new(self.inner.clone())
5296    }
5297
5298    /// Resumes an instance that was suspended using theinstances().suspend
5299    /// method.
5300    pub fn resume(&self) -> super::builder::instances::Resume {
5301        super::builder::instances::Resume::new(self.inner.clone())
5302    }
5303
5304    /// Sends diagnostic interrupt to the instance.
5305    pub fn send_diagnostic_interrupt(&self) -> super::builder::instances::SendDiagnosticInterrupt {
5306        super::builder::instances::SendDiagnosticInterrupt::new(self.inner.clone())
5307    }
5308
5309    /// Sets deletion protection on the instance.
5310    pub fn set_deletion_protection(&self) -> super::builder::instances::SetDeletionProtection {
5311        super::builder::instances::SetDeletionProtection::new(self.inner.clone())
5312    }
5313
5314    /// Sets the auto-delete flag for a disk attached to an instance.
5315    pub fn set_disk_auto_delete(&self) -> super::builder::instances::SetDiskAutoDelete {
5316        super::builder::instances::SetDiskAutoDelete::new(self.inner.clone())
5317    }
5318
5319    /// Sets the access control policy on the specified resource.
5320    /// Replaces any existing policy.
5321    pub fn set_iam_policy(&self) -> super::builder::instances::SetIamPolicy {
5322        super::builder::instances::SetIamPolicy::new(self.inner.clone())
5323    }
5324
5325    /// Sets labels on an instance.  To learn more about labels, read theLabeling
5326    /// Resources documentation.
5327    pub fn set_labels(&self) -> super::builder::instances::SetLabels {
5328        super::builder::instances::SetLabels::new(self.inner.clone())
5329    }
5330
5331    /// Changes the number and/or type of accelerator for a stopped instance to the
5332    /// values specified in the request.
5333    pub fn set_machine_resources(&self) -> super::builder::instances::SetMachineResources {
5334        super::builder::instances::SetMachineResources::new(self.inner.clone())
5335    }
5336
5337    /// Changes the machine type for a stopped instance to the machine
5338    /// type specified in the request.
5339    pub fn set_machine_type(&self) -> super::builder::instances::SetMachineType {
5340        super::builder::instances::SetMachineType::new(self.inner.clone())
5341    }
5342
5343    /// Sets metadata for the specified instance to the data included
5344    /// in the request.
5345    pub fn set_metadata(&self) -> super::builder::instances::SetMetadata {
5346        super::builder::instances::SetMetadata::new(self.inner.clone())
5347    }
5348
5349    /// Changes the minimum CPU platform that this instance should use.
5350    /// This method can only
5351    /// be called on a stopped instance. For more information, readSpecifying a
5352    /// Minimum CPU Platform.
5353    pub fn set_min_cpu_platform(&self) -> super::builder::instances::SetMinCpuPlatform {
5354        super::builder::instances::SetMinCpuPlatform::new(self.inner.clone())
5355    }
5356
5357    /// Sets name of an instance.
5358    pub fn set_name(&self) -> super::builder::instances::SetName {
5359        super::builder::instances::SetName::new(self.inner.clone())
5360    }
5361
5362    /// Sets an instance's scheduling options. You can only call this method on astopped instance,
5363    /// that is, a VM instance that is in a `TERMINATED` state. SeeInstance Life
5364    /// Cycle for more information on the possible instance states.
5365    /// For more information about setting scheduling options for a VM, seeSet
5366    /// VM host maintenance policy.
5367    pub fn set_scheduling(&self) -> super::builder::instances::SetScheduling {
5368        super::builder::instances::SetScheduling::new(self.inner.clone())
5369    }
5370
5371    /// Sets the Google Cloud Armor security policy for the specified instance.
5372    /// For more information, seeGoogle
5373    /// Cloud Armor Overview
5374    pub fn set_security_policy(&self) -> super::builder::instances::SetSecurityPolicy {
5375        super::builder::instances::SetSecurityPolicy::new(self.inner.clone())
5376    }
5377
5378    /// Sets the service account on the instance. For more information,
5379    /// readChanging
5380    /// the service account and access scopes for an instance.
5381    pub fn set_service_account(&self) -> super::builder::instances::SetServiceAccount {
5382        super::builder::instances::SetServiceAccount::new(self.inner.clone())
5383    }
5384
5385    /// Sets the Shielded Instance integrity policy for an instance. You can
5386    /// only use this method on a running instance. This method
5387    /// supports PATCH semantics and uses the JSON merge
5388    /// patch format and processing rules.
5389    pub fn set_shielded_instance_integrity_policy(
5390        &self,
5391    ) -> super::builder::instances::SetShieldedInstanceIntegrityPolicy {
5392        super::builder::instances::SetShieldedInstanceIntegrityPolicy::new(self.inner.clone())
5393    }
5394
5395    /// Sets network tags
5396    /// for the specified instance to the data included in the request.
5397    pub fn set_tags(&self) -> super::builder::instances::SetTags {
5398        super::builder::instances::SetTags::new(self.inner.clone())
5399    }
5400
5401    /// Simulates a host maintenance event on a VM. For more information, see
5402    /// Simulate a host maintenance event.
5403    pub fn simulate_maintenance_event(
5404        &self,
5405    ) -> super::builder::instances::SimulateMaintenanceEvent {
5406        super::builder::instances::SimulateMaintenanceEvent::new(self.inner.clone())
5407    }
5408
5409    /// Starts an instance that was stopped using theinstances().stop
5410    /// method. For more information, seeRestart an
5411    /// instance.
5412    pub fn start(&self) -> super::builder::instances::Start {
5413        super::builder::instances::Start::new(self.inner.clone())
5414    }
5415
5416    /// Starts an instance that was stopped using theinstances().stop
5417    /// method. For more information, seeRestart an
5418    /// instance.
5419    pub fn start_with_encryption_key(&self) -> super::builder::instances::StartWithEncryptionKey {
5420        super::builder::instances::StartWithEncryptionKey::new(self.inner.clone())
5421    }
5422
5423    /// Stops a running instance, shutting it down cleanly, and allows
5424    /// you to restart the instance at a later time. Stopped instances do not incur
5425    /// VM usage charges while they are stopped. However, resources that the VM is
5426    /// using, such as persistent disks and static IP addresses, will continue to
5427    /// be charged until they are deleted. For more information, seeStopping
5428    /// an instance.
5429    pub fn stop(&self) -> super::builder::instances::Stop {
5430        super::builder::instances::Stop::new(self.inner.clone())
5431    }
5432
5433    /// This method suspends a running instance, saving its state to persistent
5434    /// storage, and allows you to resume the instance at a later time. Suspended
5435    /// instances have no compute costs (cores or RAM), and incur only storage
5436    /// charges for the saved VM memory and localSSD data. Any charged resources
5437    /// the virtual machine was using, such as persistent disks and static IP
5438    /// addresses, will continue to be charged while the instance is suspended.
5439    /// For more information, see
5440    /// Suspending and resuming an instance.
5441    pub fn suspend(&self) -> super::builder::instances::Suspend {
5442        super::builder::instances::Suspend::new(self.inner.clone())
5443    }
5444
5445    /// Returns permissions that a caller has on the specified resource.
5446    pub fn test_iam_permissions(&self) -> super::builder::instances::TestIamPermissions {
5447        super::builder::instances::TestIamPermissions::new(self.inner.clone())
5448    }
5449
5450    /// Updates an instance only if the necessary resources are available. This
5451    /// method can update only a specific set of instance properties. See
5452    /// Updating a running instance for a list of updatable instance
5453    /// properties.
5454    pub fn update(&self) -> super::builder::instances::Update {
5455        super::builder::instances::Update::new(self.inner.clone())
5456    }
5457
5458    /// Updates the specified access config from an instance's network interface
5459    /// with the data included in the request. This method supportsPATCH
5460    /// semantics and uses theJSON merge
5461    /// patch format and processing rules.
5462    pub fn update_access_config(&self) -> super::builder::instances::UpdateAccessConfig {
5463        super::builder::instances::UpdateAccessConfig::new(self.inner.clone())
5464    }
5465
5466    /// Updates the Display config for a VM instance. You can
5467    /// only use this method on a stopped VM instance. This method supportsPATCH
5468    /// semantics and uses theJSON merge
5469    /// patch format and processing rules.
5470    pub fn update_display_device(&self) -> super::builder::instances::UpdateDisplayDevice {
5471        super::builder::instances::UpdateDisplayDevice::new(self.inner.clone())
5472    }
5473
5474    /// Updates an instance's network interface. This method can only update an
5475    /// interface's alias IP range and attached network. See Modifying
5476    /// alias IP ranges for an existing instance for instructions on
5477    /// changing alias IP ranges. See Migrating
5478    /// a VM between networks for instructions on migrating an interface.
5479    /// This method follows PATCH semantics.
5480    pub fn update_network_interface(&self) -> super::builder::instances::UpdateNetworkInterface {
5481        super::builder::instances::UpdateNetworkInterface::new(self.inner.clone())
5482    }
5483
5484    /// Updates the Shielded Instance config for an instance. You can
5485    /// only use this method on a stopped instance. This method supportsPATCH
5486    /// semantics and uses theJSON merge
5487    /// patch format and processing rules.
5488    pub fn update_shielded_instance_config(
5489        &self,
5490    ) -> super::builder::instances::UpdateShieldedInstanceConfig {
5491        super::builder::instances::UpdateShieldedInstanceConfig::new(self.inner.clone())
5492    }
5493
5494    /// Retrieves the specified zone-specific Operations resource.
5495    pub fn get_operation(&self) -> super::builder::instances::GetOperation {
5496        super::builder::instances::GetOperation::new(self.inner.clone())
5497    }
5498}
5499
5500/// Implements a client for the Google Compute Engine API.
5501///
5502/// # Example
5503/// ```
5504/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5505/// # use google_cloud_compute_v1::client::InstantSnapshots;
5506/// let client = InstantSnapshots::builder().build().await?;
5507/// // use `client` to make requests to the Google Compute Engine API.
5508/// # Ok(()) }
5509/// ```
5510///
5511/// # Service Description
5512///
5513/// Service for the `instantSnapshots` resource.
5514///
5515/// # Configuration
5516///
5517/// To configure `InstantSnapshots` use the `with_*` methods in the type returned
5518/// by [builder()][InstantSnapshots::builder]. The default configuration should
5519/// work for most applications. Common configuration changes include
5520///
5521/// * [with_endpoint()]: by default this client uses the global default endpoint
5522///   (`https://compute.googleapis.com`). Applications using regional
5523///   endpoints or running in restricted networks (e.g. a network configured
5524//    with [Private Google Access with VPC Service Controls]) may want to
5525///   override this default.
5526/// * [with_credentials()]: by default this client uses
5527///   [Application Default Credentials]. Applications using custom
5528///   authentication may need to override this default.
5529///
5530/// [with_endpoint()]: super::builder::instant_snapshots::ClientBuilder::with_endpoint
5531/// [with_credentials()]: super::builder::instant_snapshots::ClientBuilder::credentials
5532/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5533/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5534///
5535/// # Pooling and Cloning
5536///
5537/// `InstantSnapshots` holds a connection pool internally, it is advised to
5538/// create one and the reuse it.  You do not need to wrap `InstantSnapshots` in
5539/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5540/// already uses an `Arc` internally.
5541#[cfg(feature = "instant-snapshots")]
5542#[cfg_attr(docsrs, doc(cfg(feature = "instant-snapshots")))]
5543#[derive(Clone, Debug)]
5544pub struct InstantSnapshots {
5545    inner: std::sync::Arc<dyn super::stub::dynamic::InstantSnapshots>,
5546}
5547
5548#[cfg(feature = "instant-snapshots")]
5549impl InstantSnapshots {
5550    /// Returns a builder for [InstantSnapshots].
5551    ///
5552    /// ```
5553    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5554    /// # use google_cloud_compute_v1::client::InstantSnapshots;
5555    /// let client = InstantSnapshots::builder().build().await?;
5556    /// # Ok(()) }
5557    /// ```
5558    pub fn builder() -> super::builder::instant_snapshots::ClientBuilder {
5559        crate::new_client_builder(super::builder::instant_snapshots::client::Factory)
5560    }
5561
5562    /// Creates a new client from the provided stub.
5563    ///
5564    /// The most common case for calling this function is in tests mocking the
5565    /// client's behavior.
5566    pub fn from_stub<T>(stub: T) -> Self
5567    where
5568        T: super::stub::InstantSnapshots + 'static,
5569    {
5570        Self {
5571            inner: std::sync::Arc::new(stub),
5572        }
5573    }
5574
5575    pub(crate) async fn new(
5576        config: gaxi::options::ClientConfig,
5577    ) -> crate::ClientBuilderResult<Self> {
5578        let inner = Self::build_inner(config).await?;
5579        Ok(Self { inner })
5580    }
5581
5582    async fn build_inner(
5583        conf: gaxi::options::ClientConfig,
5584    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InstantSnapshots>>
5585    {
5586        if gaxi::options::tracing_enabled(&conf) {
5587            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5588        }
5589        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5590    }
5591
5592    async fn build_transport(
5593        conf: gaxi::options::ClientConfig,
5594    ) -> crate::ClientBuilderResult<impl super::stub::InstantSnapshots> {
5595        super::transport::InstantSnapshots::new(conf).await
5596    }
5597
5598    async fn build_with_tracing(
5599        conf: gaxi::options::ClientConfig,
5600    ) -> crate::ClientBuilderResult<impl super::stub::InstantSnapshots> {
5601        Self::build_transport(conf)
5602            .await
5603            .map(super::tracing::InstantSnapshots::new)
5604    }
5605
5606    /// Retrieves an aggregated list of instantSnapshots.
5607    ///
5608    /// To prevent failure, Google recommends that you set the
5609    /// `returnPartialSuccess` parameter to `true`.
5610    pub fn aggregated_list(&self) -> super::builder::instant_snapshots::AggregatedList {
5611        super::builder::instant_snapshots::AggregatedList::new(self.inner.clone())
5612    }
5613
5614    /// Deletes the specified InstantSnapshot resource. Keep in mind that deleting
5615    /// a single instantSnapshot might not necessarily delete all the data on that
5616    /// instantSnapshot. If any data on the instantSnapshot that is marked for
5617    /// deletion is needed for subsequent instantSnapshots, the data will be moved
5618    /// to the next corresponding instantSnapshot.
5619    ///
5620    /// For more information, seeDeleting
5621    /// instantSnapshots.
5622    pub fn delete(&self) -> super::builder::instant_snapshots::Delete {
5623        super::builder::instant_snapshots::Delete::new(self.inner.clone())
5624    }
5625
5626    /// Returns the specified InstantSnapshot resource in the specified zone.
5627    pub fn get(&self) -> super::builder::instant_snapshots::Get {
5628        super::builder::instant_snapshots::Get::new(self.inner.clone())
5629    }
5630
5631    /// Gets the access control policy for a resource. May be empty if no such
5632    /// policy or resource exists.
5633    pub fn get_iam_policy(&self) -> super::builder::instant_snapshots::GetIamPolicy {
5634        super::builder::instant_snapshots::GetIamPolicy::new(self.inner.clone())
5635    }
5636
5637    /// Creates an instant snapshot in the specified zone.
5638    pub fn insert(&self) -> super::builder::instant_snapshots::Insert {
5639        super::builder::instant_snapshots::Insert::new(self.inner.clone())
5640    }
5641
5642    /// Retrieves the list of InstantSnapshot resources contained within
5643    /// the specified zone.
5644    pub fn list(&self) -> super::builder::instant_snapshots::List {
5645        super::builder::instant_snapshots::List::new(self.inner.clone())
5646    }
5647
5648    /// Sets the access control policy on the specified resource.
5649    /// Replaces any existing policy.
5650    pub fn set_iam_policy(&self) -> super::builder::instant_snapshots::SetIamPolicy {
5651        super::builder::instant_snapshots::SetIamPolicy::new(self.inner.clone())
5652    }
5653
5654    /// Sets the labels on a instantSnapshot in the given zone. To learn more about
5655    /// labels, read the Labeling
5656    /// Resources documentation.
5657    pub fn set_labels(&self) -> super::builder::instant_snapshots::SetLabels {
5658        super::builder::instant_snapshots::SetLabels::new(self.inner.clone())
5659    }
5660
5661    /// Returns permissions that a caller has on the specified resource.
5662    pub fn test_iam_permissions(&self) -> super::builder::instant_snapshots::TestIamPermissions {
5663        super::builder::instant_snapshots::TestIamPermissions::new(self.inner.clone())
5664    }
5665
5666    /// Retrieves the specified zone-specific Operations resource.
5667    pub fn get_operation(&self) -> super::builder::instant_snapshots::GetOperation {
5668        super::builder::instant_snapshots::GetOperation::new(self.inner.clone())
5669    }
5670}
5671
5672/// Implements a client for the Google Compute Engine API.
5673///
5674/// # Example
5675/// ```
5676/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5677/// # use google_cloud_compute_v1::client::InterconnectAttachmentGroups;
5678/// let client = InterconnectAttachmentGroups::builder().build().await?;
5679/// // use `client` to make requests to the Google Compute Engine API.
5680/// # Ok(()) }
5681/// ```
5682///
5683/// # Service Description
5684///
5685/// Service for the `interconnectAttachmentGroups` resource.
5686///
5687/// # Configuration
5688///
5689/// To configure `InterconnectAttachmentGroups` use the `with_*` methods in the type returned
5690/// by [builder()][InterconnectAttachmentGroups::builder]. The default configuration should
5691/// work for most applications. Common configuration changes include
5692///
5693/// * [with_endpoint()]: by default this client uses the global default endpoint
5694///   (`https://compute.googleapis.com`). Applications using regional
5695///   endpoints or running in restricted networks (e.g. a network configured
5696//    with [Private Google Access with VPC Service Controls]) may want to
5697///   override this default.
5698/// * [with_credentials()]: by default this client uses
5699///   [Application Default Credentials]. Applications using custom
5700///   authentication may need to override this default.
5701///
5702/// [with_endpoint()]: super::builder::interconnect_attachment_groups::ClientBuilder::with_endpoint
5703/// [with_credentials()]: super::builder::interconnect_attachment_groups::ClientBuilder::credentials
5704/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5705/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5706///
5707/// # Pooling and Cloning
5708///
5709/// `InterconnectAttachmentGroups` holds a connection pool internally, it is advised to
5710/// create one and the reuse it.  You do not need to wrap `InterconnectAttachmentGroups` in
5711/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5712/// already uses an `Arc` internally.
5713#[cfg(feature = "interconnect-attachment-groups")]
5714#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-attachment-groups")))]
5715#[derive(Clone, Debug)]
5716pub struct InterconnectAttachmentGroups {
5717    inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachmentGroups>,
5718}
5719
5720#[cfg(feature = "interconnect-attachment-groups")]
5721impl InterconnectAttachmentGroups {
5722    /// Returns a builder for [InterconnectAttachmentGroups].
5723    ///
5724    /// ```
5725    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5726    /// # use google_cloud_compute_v1::client::InterconnectAttachmentGroups;
5727    /// let client = InterconnectAttachmentGroups::builder().build().await?;
5728    /// # Ok(()) }
5729    /// ```
5730    pub fn builder() -> super::builder::interconnect_attachment_groups::ClientBuilder {
5731        crate::new_client_builder(super::builder::interconnect_attachment_groups::client::Factory)
5732    }
5733
5734    /// Creates a new client from the provided stub.
5735    ///
5736    /// The most common case for calling this function is in tests mocking the
5737    /// client's behavior.
5738    pub fn from_stub<T>(stub: T) -> Self
5739    where
5740        T: super::stub::InterconnectAttachmentGroups + 'static,
5741    {
5742        Self {
5743            inner: std::sync::Arc::new(stub),
5744        }
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<
5757        std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachmentGroups>,
5758    > {
5759        if gaxi::options::tracing_enabled(&conf) {
5760            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5761        }
5762        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5763    }
5764
5765    async fn build_transport(
5766        conf: gaxi::options::ClientConfig,
5767    ) -> crate::ClientBuilderResult<impl super::stub::InterconnectAttachmentGroups> {
5768        super::transport::InterconnectAttachmentGroups::new(conf).await
5769    }
5770
5771    async fn build_with_tracing(
5772        conf: gaxi::options::ClientConfig,
5773    ) -> crate::ClientBuilderResult<impl super::stub::InterconnectAttachmentGroups> {
5774        Self::build_transport(conf)
5775            .await
5776            .map(super::tracing::InterconnectAttachmentGroups::new)
5777    }
5778
5779    /// Deletes the specified InterconnectAttachmentGroup in the given scope
5780    pub fn delete(&self) -> super::builder::interconnect_attachment_groups::Delete {
5781        super::builder::interconnect_attachment_groups::Delete::new(self.inner.clone())
5782    }
5783
5784    /// Returns the specified InterconnectAttachmentGroup resource in the given
5785    /// scope.
5786    pub fn get(&self) -> super::builder::interconnect_attachment_groups::Get {
5787        super::builder::interconnect_attachment_groups::Get::new(self.inner.clone())
5788    }
5789
5790    /// Gets the access control policy for a resource. May be empty if no such
5791    /// policy or resource exists.
5792    pub fn get_iam_policy(&self) -> super::builder::interconnect_attachment_groups::GetIamPolicy {
5793        super::builder::interconnect_attachment_groups::GetIamPolicy::new(self.inner.clone())
5794    }
5795
5796    /// Returns the InterconnectAttachmentStatuses for the specified
5797    /// InterconnectAttachmentGroup resource.
5798    pub fn get_operational_status(
5799        &self,
5800    ) -> super::builder::interconnect_attachment_groups::GetOperationalStatus {
5801        super::builder::interconnect_attachment_groups::GetOperationalStatus::new(
5802            self.inner.clone(),
5803        )
5804    }
5805
5806    /// Creates a InterconnectAttachmentGroup in the specified project in the given
5807    /// scope using the parameters that are included in the request.
5808    pub fn insert(&self) -> super::builder::interconnect_attachment_groups::Insert {
5809        super::builder::interconnect_attachment_groups::Insert::new(self.inner.clone())
5810    }
5811
5812    /// Lists the InterconnectAttachmentGroups for a project in the given scope.
5813    pub fn list(&self) -> super::builder::interconnect_attachment_groups::List {
5814        super::builder::interconnect_attachment_groups::List::new(self.inner.clone())
5815    }
5816
5817    /// Patches the specified InterconnectAttachmentGroup resource with the data
5818    /// included in the request. This method supports PATCH
5819    /// semantics and usesJSON merge
5820    /// patch format and processing rules.
5821    pub fn patch(&self) -> super::builder::interconnect_attachment_groups::Patch {
5822        super::builder::interconnect_attachment_groups::Patch::new(self.inner.clone())
5823    }
5824
5825    /// Sets the access control policy on the specified resource.
5826    /// Replaces any existing policy.
5827    pub fn set_iam_policy(&self) -> super::builder::interconnect_attachment_groups::SetIamPolicy {
5828        super::builder::interconnect_attachment_groups::SetIamPolicy::new(self.inner.clone())
5829    }
5830
5831    /// Returns permissions that a caller has on the specified resource.
5832    pub fn test_iam_permissions(
5833        &self,
5834    ) -> super::builder::interconnect_attachment_groups::TestIamPermissions {
5835        super::builder::interconnect_attachment_groups::TestIamPermissions::new(self.inner.clone())
5836    }
5837
5838    /// Retrieves the specified Operations resource.
5839    pub fn get_operation(&self) -> super::builder::interconnect_attachment_groups::GetOperation {
5840        super::builder::interconnect_attachment_groups::GetOperation::new(self.inner.clone())
5841    }
5842}
5843
5844/// Implements a client for the Google Compute Engine API.
5845///
5846/// # Example
5847/// ```
5848/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5849/// # use google_cloud_compute_v1::client::InterconnectAttachments;
5850/// let client = InterconnectAttachments::builder().build().await?;
5851/// // use `client` to make requests to the Google Compute Engine API.
5852/// # Ok(()) }
5853/// ```
5854///
5855/// # Service Description
5856///
5857/// Service for the `interconnectAttachments` resource.
5858///
5859/// # Configuration
5860///
5861/// To configure `InterconnectAttachments` use the `with_*` methods in the type returned
5862/// by [builder()][InterconnectAttachments::builder]. The default configuration should
5863/// work for most applications. Common configuration changes include
5864///
5865/// * [with_endpoint()]: by default this client uses the global default endpoint
5866///   (`https://compute.googleapis.com`). Applications using regional
5867///   endpoints or running in restricted networks (e.g. a network configured
5868//    with [Private Google Access with VPC Service Controls]) may want to
5869///   override this default.
5870/// * [with_credentials()]: by default this client uses
5871///   [Application Default Credentials]. Applications using custom
5872///   authentication may need to override this default.
5873///
5874/// [with_endpoint()]: super::builder::interconnect_attachments::ClientBuilder::with_endpoint
5875/// [with_credentials()]: super::builder::interconnect_attachments::ClientBuilder::credentials
5876/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5877/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5878///
5879/// # Pooling and Cloning
5880///
5881/// `InterconnectAttachments` holds a connection pool internally, it is advised to
5882/// create one and the reuse it.  You do not need to wrap `InterconnectAttachments` in
5883/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5884/// already uses an `Arc` internally.
5885#[cfg(feature = "interconnect-attachments")]
5886#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-attachments")))]
5887#[derive(Clone, Debug)]
5888pub struct InterconnectAttachments {
5889    inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachments>,
5890}
5891
5892#[cfg(feature = "interconnect-attachments")]
5893impl InterconnectAttachments {
5894    /// Returns a builder for [InterconnectAttachments].
5895    ///
5896    /// ```
5897    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5898    /// # use google_cloud_compute_v1::client::InterconnectAttachments;
5899    /// let client = InterconnectAttachments::builder().build().await?;
5900    /// # Ok(()) }
5901    /// ```
5902    pub fn builder() -> super::builder::interconnect_attachments::ClientBuilder {
5903        crate::new_client_builder(super::builder::interconnect_attachments::client::Factory)
5904    }
5905
5906    /// Creates a new client from the provided stub.
5907    ///
5908    /// The most common case for calling this function is in tests mocking the
5909    /// client's behavior.
5910    pub fn from_stub<T>(stub: T) -> Self
5911    where
5912        T: super::stub::InterconnectAttachments + 'static,
5913    {
5914        Self {
5915            inner: std::sync::Arc::new(stub),
5916        }
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<std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachments>>
5929    {
5930        if gaxi::options::tracing_enabled(&conf) {
5931            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5932        }
5933        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5934    }
5935
5936    async fn build_transport(
5937        conf: gaxi::options::ClientConfig,
5938    ) -> crate::ClientBuilderResult<impl super::stub::InterconnectAttachments> {
5939        super::transport::InterconnectAttachments::new(conf).await
5940    }
5941
5942    async fn build_with_tracing(
5943        conf: gaxi::options::ClientConfig,
5944    ) -> crate::ClientBuilderResult<impl super::stub::InterconnectAttachments> {
5945        Self::build_transport(conf)
5946            .await
5947            .map(super::tracing::InterconnectAttachments::new)
5948    }
5949
5950    /// Retrieves an aggregated list of interconnect attachments.
5951    ///
5952    /// To prevent failure, Google recommends that you set the
5953    /// `returnPartialSuccess` parameter to `true`.
5954    pub fn aggregated_list(&self) -> super::builder::interconnect_attachments::AggregatedList {
5955        super::builder::interconnect_attachments::AggregatedList::new(self.inner.clone())
5956    }
5957
5958    /// Deletes the specified interconnect attachment.
5959    pub fn delete(&self) -> super::builder::interconnect_attachments::Delete {
5960        super::builder::interconnect_attachments::Delete::new(self.inner.clone())
5961    }
5962
5963    /// Returns the specified interconnect attachment.
5964    pub fn get(&self) -> super::builder::interconnect_attachments::Get {
5965        super::builder::interconnect_attachments::Get::new(self.inner.clone())
5966    }
5967
5968    /// Creates an InterconnectAttachment in the specified project using the data
5969    /// included in the request.
5970    pub fn insert(&self) -> super::builder::interconnect_attachments::Insert {
5971        super::builder::interconnect_attachments::Insert::new(self.inner.clone())
5972    }
5973
5974    /// Retrieves the list of interconnect attachments contained within
5975    /// the specified region.
5976    pub fn list(&self) -> super::builder::interconnect_attachments::List {
5977        super::builder::interconnect_attachments::List::new(self.inner.clone())
5978    }
5979
5980    /// Updates the specified interconnect attachment with the data included in the
5981    /// request. This method supportsPATCH
5982    /// semantics and uses theJSON merge
5983    /// patch format and processing rules.
5984    pub fn patch(&self) -> super::builder::interconnect_attachments::Patch {
5985        super::builder::interconnect_attachments::Patch::new(self.inner.clone())
5986    }
5987
5988    /// Sets the labels on an InterconnectAttachment. To learn more about labels,
5989    /// read the Labeling
5990    /// Resources documentation.
5991    pub fn set_labels(&self) -> super::builder::interconnect_attachments::SetLabels {
5992        super::builder::interconnect_attachments::SetLabels::new(self.inner.clone())
5993    }
5994
5995    /// Retrieves the specified region-specific Operations resource.
5996    pub fn get_operation(&self) -> super::builder::interconnect_attachments::GetOperation {
5997        super::builder::interconnect_attachments::GetOperation::new(self.inner.clone())
5998    }
5999}
6000
6001/// Implements a client for the Google Compute Engine API.
6002///
6003/// # Example
6004/// ```
6005/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6006/// # use google_cloud_compute_v1::client::InterconnectGroups;
6007/// let client = InterconnectGroups::builder().build().await?;
6008/// // use `client` to make requests to the Google Compute Engine API.
6009/// # Ok(()) }
6010/// ```
6011///
6012/// # Service Description
6013///
6014/// Service for the `interconnectGroups` resource.
6015///
6016/// # Configuration
6017///
6018/// To configure `InterconnectGroups` use the `with_*` methods in the type returned
6019/// by [builder()][InterconnectGroups::builder]. The default configuration should
6020/// work for most applications. Common configuration changes include
6021///
6022/// * [with_endpoint()]: by default this client uses the global default endpoint
6023///   (`https://compute.googleapis.com`). Applications using regional
6024///   endpoints or running in restricted networks (e.g. a network configured
6025//    with [Private Google Access with VPC Service Controls]) may want to
6026///   override this default.
6027/// * [with_credentials()]: by default this client uses
6028///   [Application Default Credentials]. Applications using custom
6029///   authentication may need to override this default.
6030///
6031/// [with_endpoint()]: super::builder::interconnect_groups::ClientBuilder::with_endpoint
6032/// [with_credentials()]: super::builder::interconnect_groups::ClientBuilder::credentials
6033/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6034/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6035///
6036/// # Pooling and Cloning
6037///
6038/// `InterconnectGroups` holds a connection pool internally, it is advised to
6039/// create one and the reuse it.  You do not need to wrap `InterconnectGroups` in
6040/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6041/// already uses an `Arc` internally.
6042#[cfg(feature = "interconnect-groups")]
6043#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-groups")))]
6044#[derive(Clone, Debug)]
6045pub struct InterconnectGroups {
6046    inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectGroups>,
6047}
6048
6049#[cfg(feature = "interconnect-groups")]
6050impl InterconnectGroups {
6051    /// Returns a builder for [InterconnectGroups].
6052    ///
6053    /// ```
6054    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6055    /// # use google_cloud_compute_v1::client::InterconnectGroups;
6056    /// let client = InterconnectGroups::builder().build().await?;
6057    /// # Ok(()) }
6058    /// ```
6059    pub fn builder() -> super::builder::interconnect_groups::ClientBuilder {
6060        crate::new_client_builder(super::builder::interconnect_groups::client::Factory)
6061    }
6062
6063    /// Creates a new client from the provided stub.
6064    ///
6065    /// The most common case for calling this function is in tests mocking the
6066    /// client's behavior.
6067    pub fn from_stub<T>(stub: T) -> Self
6068    where
6069        T: super::stub::InterconnectGroups + 'static,
6070    {
6071        Self {
6072            inner: std::sync::Arc::new(stub),
6073        }
6074    }
6075
6076    pub(crate) async fn new(
6077        config: gaxi::options::ClientConfig,
6078    ) -> crate::ClientBuilderResult<Self> {
6079        let inner = Self::build_inner(config).await?;
6080        Ok(Self { inner })
6081    }
6082
6083    async fn build_inner(
6084        conf: gaxi::options::ClientConfig,
6085    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InterconnectGroups>>
6086    {
6087        if gaxi::options::tracing_enabled(&conf) {
6088            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6089        }
6090        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6091    }
6092
6093    async fn build_transport(
6094        conf: gaxi::options::ClientConfig,
6095    ) -> crate::ClientBuilderResult<impl super::stub::InterconnectGroups> {
6096        super::transport::InterconnectGroups::new(conf).await
6097    }
6098
6099    async fn build_with_tracing(
6100        conf: gaxi::options::ClientConfig,
6101    ) -> crate::ClientBuilderResult<impl super::stub::InterconnectGroups> {
6102        Self::build_transport(conf)
6103            .await
6104            .map(super::tracing::InterconnectGroups::new)
6105    }
6106
6107    /// Create Interconnects with redundancy by creating them in a specified
6108    /// interconnect group.
6109    pub fn create_members(&self) -> super::builder::interconnect_groups::CreateMembers {
6110        super::builder::interconnect_groups::CreateMembers::new(self.inner.clone())
6111    }
6112
6113    /// Deletes the specified InterconnectGroup in the given scope
6114    pub fn delete(&self) -> super::builder::interconnect_groups::Delete {
6115        super::builder::interconnect_groups::Delete::new(self.inner.clone())
6116    }
6117
6118    /// Returns the specified InterconnectGroup resource in the given scope.
6119    pub fn get(&self) -> super::builder::interconnect_groups::Get {
6120        super::builder::interconnect_groups::Get::new(self.inner.clone())
6121    }
6122
6123    /// Gets the access control policy for a resource. May be empty if no such
6124    /// policy or resource exists.
6125    pub fn get_iam_policy(&self) -> super::builder::interconnect_groups::GetIamPolicy {
6126        super::builder::interconnect_groups::GetIamPolicy::new(self.inner.clone())
6127    }
6128
6129    /// Returns the interconnectStatuses for the specified
6130    /// InterconnectGroup.
6131    pub fn get_operational_status(
6132        &self,
6133    ) -> super::builder::interconnect_groups::GetOperationalStatus {
6134        super::builder::interconnect_groups::GetOperationalStatus::new(self.inner.clone())
6135    }
6136
6137    /// Creates a InterconnectGroup in the specified project in the given scope
6138    /// using the parameters that are included in the request.
6139    pub fn insert(&self) -> super::builder::interconnect_groups::Insert {
6140        super::builder::interconnect_groups::Insert::new(self.inner.clone())
6141    }
6142
6143    /// Lists the InterconnectGroups for a project in the given scope.
6144    pub fn list(&self) -> super::builder::interconnect_groups::List {
6145        super::builder::interconnect_groups::List::new(self.inner.clone())
6146    }
6147
6148    /// Patches the specified InterconnectGroup resource with the data included in
6149    /// the request. This method supports PATCH
6150    /// semantics and usesJSON merge
6151    /// patch format and processing rules.
6152    pub fn patch(&self) -> super::builder::interconnect_groups::Patch {
6153        super::builder::interconnect_groups::Patch::new(self.inner.clone())
6154    }
6155
6156    /// Sets the access control policy on the specified resource.
6157    /// Replaces any existing policy.
6158    pub fn set_iam_policy(&self) -> super::builder::interconnect_groups::SetIamPolicy {
6159        super::builder::interconnect_groups::SetIamPolicy::new(self.inner.clone())
6160    }
6161
6162    /// Returns permissions that a caller has on the specified resource.
6163    pub fn test_iam_permissions(&self) -> super::builder::interconnect_groups::TestIamPermissions {
6164        super::builder::interconnect_groups::TestIamPermissions::new(self.inner.clone())
6165    }
6166
6167    /// Retrieves the specified Operations resource.
6168    pub fn get_operation(&self) -> super::builder::interconnect_groups::GetOperation {
6169        super::builder::interconnect_groups::GetOperation::new(self.inner.clone())
6170    }
6171}
6172
6173/// Implements a client for the Google Compute Engine API.
6174///
6175/// # Example
6176/// ```
6177/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6178/// # use google_cloud_compute_v1::client::InterconnectLocations;
6179/// let client = InterconnectLocations::builder().build().await?;
6180/// // use `client` to make requests to the Google Compute Engine API.
6181/// # Ok(()) }
6182/// ```
6183///
6184/// # Service Description
6185///
6186/// Service for the `interconnectLocations` resource.
6187///
6188/// # Configuration
6189///
6190/// To configure `InterconnectLocations` use the `with_*` methods in the type returned
6191/// by [builder()][InterconnectLocations::builder]. The default configuration should
6192/// work for most applications. Common configuration changes include
6193///
6194/// * [with_endpoint()]: by default this client uses the global default endpoint
6195///   (`https://compute.googleapis.com`). Applications using regional
6196///   endpoints or running in restricted networks (e.g. a network configured
6197//    with [Private Google Access with VPC Service Controls]) may want to
6198///   override this default.
6199/// * [with_credentials()]: by default this client uses
6200///   [Application Default Credentials]. Applications using custom
6201///   authentication may need to override this default.
6202///
6203/// [with_endpoint()]: super::builder::interconnect_locations::ClientBuilder::with_endpoint
6204/// [with_credentials()]: super::builder::interconnect_locations::ClientBuilder::credentials
6205/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6206/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6207///
6208/// # Pooling and Cloning
6209///
6210/// `InterconnectLocations` holds a connection pool internally, it is advised to
6211/// create one and the reuse it.  You do not need to wrap `InterconnectLocations` in
6212/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6213/// already uses an `Arc` internally.
6214#[cfg(feature = "interconnect-locations")]
6215#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-locations")))]
6216#[derive(Clone, Debug)]
6217pub struct InterconnectLocations {
6218    inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectLocations>,
6219}
6220
6221#[cfg(feature = "interconnect-locations")]
6222impl InterconnectLocations {
6223    /// Returns a builder for [InterconnectLocations].
6224    ///
6225    /// ```
6226    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6227    /// # use google_cloud_compute_v1::client::InterconnectLocations;
6228    /// let client = InterconnectLocations::builder().build().await?;
6229    /// # Ok(()) }
6230    /// ```
6231    pub fn builder() -> super::builder::interconnect_locations::ClientBuilder {
6232        crate::new_client_builder(super::builder::interconnect_locations::client::Factory)
6233    }
6234
6235    /// Creates a new client from the provided stub.
6236    ///
6237    /// The most common case for calling this function is in tests mocking the
6238    /// client's behavior.
6239    pub fn from_stub<T>(stub: T) -> Self
6240    where
6241        T: super::stub::InterconnectLocations + 'static,
6242    {
6243        Self {
6244            inner: std::sync::Arc::new(stub),
6245        }
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::InterconnectLocations>>
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::InterconnectLocations> {
6268        super::transport::InterconnectLocations::new(conf).await
6269    }
6270
6271    async fn build_with_tracing(
6272        conf: gaxi::options::ClientConfig,
6273    ) -> crate::ClientBuilderResult<impl super::stub::InterconnectLocations> {
6274        Self::build_transport(conf)
6275            .await
6276            .map(super::tracing::InterconnectLocations::new)
6277    }
6278
6279    /// Returns the details for the specified interconnect location. Gets a list of
6280    /// available interconnect locations by making a list() request.
6281    pub fn get(&self) -> super::builder::interconnect_locations::Get {
6282        super::builder::interconnect_locations::Get::new(self.inner.clone())
6283    }
6284
6285    /// Retrieves the list of interconnect locations available to the specified
6286    /// project.
6287    pub fn list(&self) -> super::builder::interconnect_locations::List {
6288        super::builder::interconnect_locations::List::new(self.inner.clone())
6289    }
6290}
6291
6292/// Implements a client for the Google Compute Engine API.
6293///
6294/// # Example
6295/// ```
6296/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6297/// # use google_cloud_compute_v1::client::InterconnectRemoteLocations;
6298/// let client = InterconnectRemoteLocations::builder().build().await?;
6299/// // use `client` to make requests to the Google Compute Engine API.
6300/// # Ok(()) }
6301/// ```
6302///
6303/// # Service Description
6304///
6305/// Service for the `interconnectRemoteLocations` resource.
6306///
6307/// # Configuration
6308///
6309/// To configure `InterconnectRemoteLocations` use the `with_*` methods in the type returned
6310/// by [builder()][InterconnectRemoteLocations::builder]. The default configuration should
6311/// work for most applications. Common configuration changes include
6312///
6313/// * [with_endpoint()]: by default this client uses the global default endpoint
6314///   (`https://compute.googleapis.com`). Applications using regional
6315///   endpoints or running in restricted networks (e.g. a network configured
6316//    with [Private Google Access with VPC Service Controls]) may want to
6317///   override this default.
6318/// * [with_credentials()]: by default this client uses
6319///   [Application Default Credentials]. Applications using custom
6320///   authentication may need to override this default.
6321///
6322/// [with_endpoint()]: super::builder::interconnect_remote_locations::ClientBuilder::with_endpoint
6323/// [with_credentials()]: super::builder::interconnect_remote_locations::ClientBuilder::credentials
6324/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6325/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6326///
6327/// # Pooling and Cloning
6328///
6329/// `InterconnectRemoteLocations` holds a connection pool internally, it is advised to
6330/// create one and the reuse it.  You do not need to wrap `InterconnectRemoteLocations` in
6331/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6332/// already uses an `Arc` internally.
6333#[cfg(feature = "interconnect-remote-locations")]
6334#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-remote-locations")))]
6335#[derive(Clone, Debug)]
6336pub struct InterconnectRemoteLocations {
6337    inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectRemoteLocations>,
6338}
6339
6340#[cfg(feature = "interconnect-remote-locations")]
6341impl InterconnectRemoteLocations {
6342    /// Returns a builder for [InterconnectRemoteLocations].
6343    ///
6344    /// ```
6345    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6346    /// # use google_cloud_compute_v1::client::InterconnectRemoteLocations;
6347    /// let client = InterconnectRemoteLocations::builder().build().await?;
6348    /// # Ok(()) }
6349    /// ```
6350    pub fn builder() -> super::builder::interconnect_remote_locations::ClientBuilder {
6351        crate::new_client_builder(super::builder::interconnect_remote_locations::client::Factory)
6352    }
6353
6354    /// Creates a new client from the provided stub.
6355    ///
6356    /// The most common case for calling this function is in tests mocking the
6357    /// client's behavior.
6358    pub fn from_stub<T>(stub: T) -> Self
6359    where
6360        T: super::stub::InterconnectRemoteLocations + 'static,
6361    {
6362        Self {
6363            inner: std::sync::Arc::new(stub),
6364        }
6365    }
6366
6367    pub(crate) async fn new(
6368        config: gaxi::options::ClientConfig,
6369    ) -> crate::ClientBuilderResult<Self> {
6370        let inner = Self::build_inner(config).await?;
6371        Ok(Self { inner })
6372    }
6373
6374    async fn build_inner(
6375        conf: gaxi::options::ClientConfig,
6376    ) -> crate::ClientBuilderResult<
6377        std::sync::Arc<dyn super::stub::dynamic::InterconnectRemoteLocations>,
6378    > {
6379        if gaxi::options::tracing_enabled(&conf) {
6380            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6381        }
6382        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6383    }
6384
6385    async fn build_transport(
6386        conf: gaxi::options::ClientConfig,
6387    ) -> crate::ClientBuilderResult<impl super::stub::InterconnectRemoteLocations> {
6388        super::transport::InterconnectRemoteLocations::new(conf).await
6389    }
6390
6391    async fn build_with_tracing(
6392        conf: gaxi::options::ClientConfig,
6393    ) -> crate::ClientBuilderResult<impl super::stub::InterconnectRemoteLocations> {
6394        Self::build_transport(conf)
6395            .await
6396            .map(super::tracing::InterconnectRemoteLocations::new)
6397    }
6398
6399    /// Returns the details for the specified interconnect remote location. Gets a
6400    /// list of available interconnect remote locations by making alist() request.
6401    pub fn get(&self) -> super::builder::interconnect_remote_locations::Get {
6402        super::builder::interconnect_remote_locations::Get::new(self.inner.clone())
6403    }
6404
6405    /// Retrieves the list of interconnect remote locations available to the
6406    /// specified project.
6407    pub fn list(&self) -> super::builder::interconnect_remote_locations::List {
6408        super::builder::interconnect_remote_locations::List::new(self.inner.clone())
6409    }
6410}
6411
6412/// Implements a client for the Google Compute Engine API.
6413///
6414/// # Example
6415/// ```
6416/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6417/// # use google_cloud_compute_v1::client::Interconnects;
6418/// let client = Interconnects::builder().build().await?;
6419/// // use `client` to make requests to the Google Compute Engine API.
6420/// # Ok(()) }
6421/// ```
6422///
6423/// # Service Description
6424///
6425/// Service for the `interconnects` resource.
6426///
6427/// # Configuration
6428///
6429/// To configure `Interconnects` use the `with_*` methods in the type returned
6430/// by [builder()][Interconnects::builder]. The default configuration should
6431/// work for most applications. Common configuration changes include
6432///
6433/// * [with_endpoint()]: by default this client uses the global default endpoint
6434///   (`https://compute.googleapis.com`). Applications using regional
6435///   endpoints or running in restricted networks (e.g. a network configured
6436//    with [Private Google Access with VPC Service Controls]) may want to
6437///   override this default.
6438/// * [with_credentials()]: by default this client uses
6439///   [Application Default Credentials]. Applications using custom
6440///   authentication may need to override this default.
6441///
6442/// [with_endpoint()]: super::builder::interconnects::ClientBuilder::with_endpoint
6443/// [with_credentials()]: super::builder::interconnects::ClientBuilder::credentials
6444/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6445/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6446///
6447/// # Pooling and Cloning
6448///
6449/// `Interconnects` holds a connection pool internally, it is advised to
6450/// create one and the reuse it.  You do not need to wrap `Interconnects` in
6451/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6452/// already uses an `Arc` internally.
6453#[cfg(feature = "interconnects")]
6454#[cfg_attr(docsrs, doc(cfg(feature = "interconnects")))]
6455#[derive(Clone, Debug)]
6456pub struct Interconnects {
6457    inner: std::sync::Arc<dyn super::stub::dynamic::Interconnects>,
6458}
6459
6460#[cfg(feature = "interconnects")]
6461impl Interconnects {
6462    /// Returns a builder for [Interconnects].
6463    ///
6464    /// ```
6465    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6466    /// # use google_cloud_compute_v1::client::Interconnects;
6467    /// let client = Interconnects::builder().build().await?;
6468    /// # Ok(()) }
6469    /// ```
6470    pub fn builder() -> super::builder::interconnects::ClientBuilder {
6471        crate::new_client_builder(super::builder::interconnects::client::Factory)
6472    }
6473
6474    /// Creates a new client from the provided stub.
6475    ///
6476    /// The most common case for calling this function is in tests mocking the
6477    /// client's behavior.
6478    pub fn from_stub<T>(stub: T) -> Self
6479    where
6480        T: super::stub::Interconnects + 'static,
6481    {
6482        Self {
6483            inner: std::sync::Arc::new(stub),
6484        }
6485    }
6486
6487    pub(crate) async fn new(
6488        config: gaxi::options::ClientConfig,
6489    ) -> crate::ClientBuilderResult<Self> {
6490        let inner = Self::build_inner(config).await?;
6491        Ok(Self { inner })
6492    }
6493
6494    async fn build_inner(
6495        conf: gaxi::options::ClientConfig,
6496    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Interconnects>> {
6497        if gaxi::options::tracing_enabled(&conf) {
6498            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6499        }
6500        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6501    }
6502
6503    async fn build_transport(
6504        conf: gaxi::options::ClientConfig,
6505    ) -> crate::ClientBuilderResult<impl super::stub::Interconnects> {
6506        super::transport::Interconnects::new(conf).await
6507    }
6508
6509    async fn build_with_tracing(
6510        conf: gaxi::options::ClientConfig,
6511    ) -> crate::ClientBuilderResult<impl super::stub::Interconnects> {
6512        Self::build_transport(conf)
6513            .await
6514            .map(super::tracing::Interconnects::new)
6515    }
6516
6517    /// Deletes the specified Interconnect.
6518    pub fn delete(&self) -> super::builder::interconnects::Delete {
6519        super::builder::interconnects::Delete::new(self.inner.clone())
6520    }
6521
6522    /// Returns the specified Interconnect. Get a list of available Interconnects
6523    /// by making a list() request.
6524    pub fn get(&self) -> super::builder::interconnects::Get {
6525        super::builder::interconnects::Get::new(self.inner.clone())
6526    }
6527
6528    /// Returns the interconnectDiagnostics for the specified
6529    /// Interconnect.
6530    ///
6531    /// In the event of a
6532    /// global outage, do not use this API to make decisions about where to
6533    /// redirect your network traffic.
6534    ///
6535    /// Unlike a VLAN attachment, which is regional, a Cloud Interconnect
6536    /// connection is a global resource. A global outage can prevent this
6537    /// API from functioning properly.
6538    pub fn get_diagnostics(&self) -> super::builder::interconnects::GetDiagnostics {
6539        super::builder::interconnects::GetDiagnostics::new(self.inner.clone())
6540    }
6541
6542    /// Returns the interconnectMacsecConfig for the specified
6543    /// Interconnect.
6544    pub fn get_macsec_config(&self) -> super::builder::interconnects::GetMacsecConfig {
6545        super::builder::interconnects::GetMacsecConfig::new(self.inner.clone())
6546    }
6547
6548    /// Creates an Interconnect in the specified project using
6549    /// the data included in the request.
6550    pub fn insert(&self) -> super::builder::interconnects::Insert {
6551        super::builder::interconnects::Insert::new(self.inner.clone())
6552    }
6553
6554    /// Retrieves the list of Interconnects available to the specified project.
6555    pub fn list(&self) -> super::builder::interconnects::List {
6556        super::builder::interconnects::List::new(self.inner.clone())
6557    }
6558
6559    /// Updates the specified Interconnect with the data included in the request.
6560    /// This method supportsPATCH
6561    /// semantics and uses theJSON merge
6562    /// patch format and processing rules.
6563    pub fn patch(&self) -> super::builder::interconnects::Patch {
6564        super::builder::interconnects::Patch::new(self.inner.clone())
6565    }
6566
6567    /// Sets the labels on an Interconnect. To learn more about labels,
6568    /// read the Labeling
6569    /// Resources documentation.
6570    pub fn set_labels(&self) -> super::builder::interconnects::SetLabels {
6571        super::builder::interconnects::SetLabels::new(self.inner.clone())
6572    }
6573
6574    /// Retrieves the specified Operations resource.
6575    pub fn get_operation(&self) -> super::builder::interconnects::GetOperation {
6576        super::builder::interconnects::GetOperation::new(self.inner.clone())
6577    }
6578}
6579
6580/// Implements a client for the Google Compute Engine API.
6581///
6582/// # Example
6583/// ```
6584/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6585/// # use google_cloud_compute_v1::client::LicenseCodes;
6586/// let client = LicenseCodes::builder().build().await?;
6587/// // use `client` to make requests to the Google Compute Engine API.
6588/// # Ok(()) }
6589/// ```
6590///
6591/// # Service Description
6592///
6593/// Service for the `licenseCodes` resource.
6594///
6595/// # Configuration
6596///
6597/// To configure `LicenseCodes` use the `with_*` methods in the type returned
6598/// by [builder()][LicenseCodes::builder]. The default configuration should
6599/// work for most applications. Common configuration changes include
6600///
6601/// * [with_endpoint()]: by default this client uses the global default endpoint
6602///   (`https://compute.googleapis.com`). Applications using regional
6603///   endpoints or running in restricted networks (e.g. a network configured
6604//    with [Private Google Access with VPC Service Controls]) may want to
6605///   override this default.
6606/// * [with_credentials()]: by default this client uses
6607///   [Application Default Credentials]. Applications using custom
6608///   authentication may need to override this default.
6609///
6610/// [with_endpoint()]: super::builder::license_codes::ClientBuilder::with_endpoint
6611/// [with_credentials()]: super::builder::license_codes::ClientBuilder::credentials
6612/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6613/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6614///
6615/// # Pooling and Cloning
6616///
6617/// `LicenseCodes` holds a connection pool internally, it is advised to
6618/// create one and the reuse it.  You do not need to wrap `LicenseCodes` in
6619/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6620/// already uses an `Arc` internally.
6621#[cfg(feature = "license-codes")]
6622#[cfg_attr(docsrs, doc(cfg(feature = "license-codes")))]
6623#[derive(Clone, Debug)]
6624pub struct LicenseCodes {
6625    inner: std::sync::Arc<dyn super::stub::dynamic::LicenseCodes>,
6626}
6627
6628#[cfg(feature = "license-codes")]
6629impl LicenseCodes {
6630    /// Returns a builder for [LicenseCodes].
6631    ///
6632    /// ```
6633    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6634    /// # use google_cloud_compute_v1::client::LicenseCodes;
6635    /// let client = LicenseCodes::builder().build().await?;
6636    /// # Ok(()) }
6637    /// ```
6638    pub fn builder() -> super::builder::license_codes::ClientBuilder {
6639        crate::new_client_builder(super::builder::license_codes::client::Factory)
6640    }
6641
6642    /// Creates a new client from the provided stub.
6643    ///
6644    /// The most common case for calling this function is in tests mocking the
6645    /// client's behavior.
6646    pub fn from_stub<T>(stub: T) -> Self
6647    where
6648        T: super::stub::LicenseCodes + 'static,
6649    {
6650        Self {
6651            inner: std::sync::Arc::new(stub),
6652        }
6653    }
6654
6655    pub(crate) async fn new(
6656        config: gaxi::options::ClientConfig,
6657    ) -> crate::ClientBuilderResult<Self> {
6658        let inner = Self::build_inner(config).await?;
6659        Ok(Self { inner })
6660    }
6661
6662    async fn build_inner(
6663        conf: gaxi::options::ClientConfig,
6664    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::LicenseCodes>> {
6665        if gaxi::options::tracing_enabled(&conf) {
6666            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6667        }
6668        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6669    }
6670
6671    async fn build_transport(
6672        conf: gaxi::options::ClientConfig,
6673    ) -> crate::ClientBuilderResult<impl super::stub::LicenseCodes> {
6674        super::transport::LicenseCodes::new(conf).await
6675    }
6676
6677    async fn build_with_tracing(
6678        conf: gaxi::options::ClientConfig,
6679    ) -> crate::ClientBuilderResult<impl super::stub::LicenseCodes> {
6680        Self::build_transport(conf)
6681            .await
6682            .map(super::tracing::LicenseCodes::new)
6683    }
6684
6685    /// Return a specified license code. License codes are mirrored across
6686    /// all projects that have permissions to read the License Code.
6687    /// *Caution* This resource is intended
6688    /// for use only by third-party partners who are creatingCloud Marketplace
6689    /// images.
6690    pub fn get(&self) -> super::builder::license_codes::Get {
6691        super::builder::license_codes::Get::new(self.inner.clone())
6692    }
6693
6694    /// Returns permissions that a caller has on the specified resource.
6695    /// *Caution* This resource is intended
6696    /// for use only by third-party partners who are creatingCloud Marketplace
6697    /// images.
6698    pub fn test_iam_permissions(&self) -> super::builder::license_codes::TestIamPermissions {
6699        super::builder::license_codes::TestIamPermissions::new(self.inner.clone())
6700    }
6701}
6702
6703/// Implements a client for the Google Compute Engine API.
6704///
6705/// # Example
6706/// ```
6707/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6708/// # use google_cloud_compute_v1::client::Licenses;
6709/// let client = Licenses::builder().build().await?;
6710/// // use `client` to make requests to the Google Compute Engine API.
6711/// # Ok(()) }
6712/// ```
6713///
6714/// # Service Description
6715///
6716/// Service for the `licenses` resource.
6717///
6718/// # Configuration
6719///
6720/// To configure `Licenses` use the `with_*` methods in the type returned
6721/// by [builder()][Licenses::builder]. The default configuration should
6722/// work for most applications. Common configuration changes include
6723///
6724/// * [with_endpoint()]: by default this client uses the global default endpoint
6725///   (`https://compute.googleapis.com`). Applications using regional
6726///   endpoints or running in restricted networks (e.g. a network configured
6727//    with [Private Google Access with VPC Service Controls]) may want to
6728///   override this default.
6729/// * [with_credentials()]: by default this client uses
6730///   [Application Default Credentials]. Applications using custom
6731///   authentication may need to override this default.
6732///
6733/// [with_endpoint()]: super::builder::licenses::ClientBuilder::with_endpoint
6734/// [with_credentials()]: super::builder::licenses::ClientBuilder::credentials
6735/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6736/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6737///
6738/// # Pooling and Cloning
6739///
6740/// `Licenses` holds a connection pool internally, it is advised to
6741/// create one and the reuse it.  You do not need to wrap `Licenses` in
6742/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6743/// already uses an `Arc` internally.
6744#[cfg(feature = "licenses")]
6745#[cfg_attr(docsrs, doc(cfg(feature = "licenses")))]
6746#[derive(Clone, Debug)]
6747pub struct Licenses {
6748    inner: std::sync::Arc<dyn super::stub::dynamic::Licenses>,
6749}
6750
6751#[cfg(feature = "licenses")]
6752impl Licenses {
6753    /// Returns a builder for [Licenses].
6754    ///
6755    /// ```
6756    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6757    /// # use google_cloud_compute_v1::client::Licenses;
6758    /// let client = Licenses::builder().build().await?;
6759    /// # Ok(()) }
6760    /// ```
6761    pub fn builder() -> super::builder::licenses::ClientBuilder {
6762        crate::new_client_builder(super::builder::licenses::client::Factory)
6763    }
6764
6765    /// Creates a new client from the provided stub.
6766    ///
6767    /// The most common case for calling this function is in tests mocking the
6768    /// client's behavior.
6769    pub fn from_stub<T>(stub: T) -> Self
6770    where
6771        T: super::stub::Licenses + 'static,
6772    {
6773        Self {
6774            inner: std::sync::Arc::new(stub),
6775        }
6776    }
6777
6778    pub(crate) async fn new(
6779        config: gaxi::options::ClientConfig,
6780    ) -> crate::ClientBuilderResult<Self> {
6781        let inner = Self::build_inner(config).await?;
6782        Ok(Self { inner })
6783    }
6784
6785    async fn build_inner(
6786        conf: gaxi::options::ClientConfig,
6787    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Licenses>> {
6788        if gaxi::options::tracing_enabled(&conf) {
6789            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6790        }
6791        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6792    }
6793
6794    async fn build_transport(
6795        conf: gaxi::options::ClientConfig,
6796    ) -> crate::ClientBuilderResult<impl super::stub::Licenses> {
6797        super::transport::Licenses::new(conf).await
6798    }
6799
6800    async fn build_with_tracing(
6801        conf: gaxi::options::ClientConfig,
6802    ) -> crate::ClientBuilderResult<impl super::stub::Licenses> {
6803        Self::build_transport(conf)
6804            .await
6805            .map(super::tracing::Licenses::new)
6806    }
6807
6808    /// Deletes the specified license.
6809    /// *Caution* This resource is intended
6810    /// for use only by third-party partners who are creatingCloud Marketplace
6811    /// images.
6812    pub fn delete(&self) -> super::builder::licenses::Delete {
6813        super::builder::licenses::Delete::new(self.inner.clone())
6814    }
6815
6816    /// Returns the specified License resource.
6817    /// *Caution* This resource is intended
6818    /// for use only by third-party partners who are creatingCloud Marketplace
6819    /// images.
6820    pub fn get(&self) -> super::builder::licenses::Get {
6821        super::builder::licenses::Get::new(self.inner.clone())
6822    }
6823
6824    /// Gets the access control policy for a resource. May be empty if no such
6825    /// policy or resource exists.
6826    /// *Caution* This resource is intended
6827    /// for use only by third-party partners who are creatingCloud Marketplace
6828    /// images.
6829    pub fn get_iam_policy(&self) -> super::builder::licenses::GetIamPolicy {
6830        super::builder::licenses::GetIamPolicy::new(self.inner.clone())
6831    }
6832
6833    /// Create a License resource in the specified project.
6834    /// *Caution* This resource is intended
6835    /// for use only by third-party partners who are creatingCloud Marketplace
6836    /// images.
6837    pub fn insert(&self) -> super::builder::licenses::Insert {
6838        super::builder::licenses::Insert::new(self.inner.clone())
6839    }
6840
6841    /// Retrieves the list of licenses
6842    /// available in the specified project. This method does not
6843    /// get any licenses that belong to other projects, including licenses attached
6844    /// to publicly-available images, like Debian 9. If you want to get a list of
6845    /// publicly-available licenses, use this method to make a request to the
6846    /// respective image project, such as debian-cloud orwindows-cloud.
6847    /// *Caution* This resource is intended
6848    /// for use only by third-party partners who are creatingCloud Marketplace
6849    /// images.
6850    pub fn list(&self) -> super::builder::licenses::List {
6851        super::builder::licenses::List::new(self.inner.clone())
6852    }
6853
6854    /// Sets the access control policy on the specified resource.
6855    /// Replaces any existing policy.
6856    /// *Caution* This resource is intended
6857    /// for use only by third-party partners who are creatingCloud Marketplace
6858    /// images.
6859    pub fn set_iam_policy(&self) -> super::builder::licenses::SetIamPolicy {
6860        super::builder::licenses::SetIamPolicy::new(self.inner.clone())
6861    }
6862
6863    /// Returns permissions that a caller has on the specified resource.
6864    /// *Caution* This resource is intended
6865    /// for use only by third-party partners who are creatingCloud Marketplace
6866    /// images.
6867    pub fn test_iam_permissions(&self) -> super::builder::licenses::TestIamPermissions {
6868        super::builder::licenses::TestIamPermissions::new(self.inner.clone())
6869    }
6870
6871    /// Updates a License resource in the specified project.
6872    /// *Caution* This resource is intended
6873    /// for use only by third-party partners who are creatingCloud Marketplace
6874    /// images.
6875    pub fn update(&self) -> super::builder::licenses::Update {
6876        super::builder::licenses::Update::new(self.inner.clone())
6877    }
6878
6879    /// Retrieves the specified Operations resource.
6880    pub fn get_operation(&self) -> super::builder::licenses::GetOperation {
6881        super::builder::licenses::GetOperation::new(self.inner.clone())
6882    }
6883}
6884
6885/// Implements a client for the Google Compute Engine API.
6886///
6887/// # Example
6888/// ```
6889/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6890/// # use google_cloud_compute_v1::client::MachineImages;
6891/// let client = MachineImages::builder().build().await?;
6892/// // use `client` to make requests to the Google Compute Engine API.
6893/// # Ok(()) }
6894/// ```
6895///
6896/// # Service Description
6897///
6898/// Service for the `machineImages` resource.
6899///
6900/// # Configuration
6901///
6902/// To configure `MachineImages` use the `with_*` methods in the type returned
6903/// by [builder()][MachineImages::builder]. The default configuration should
6904/// work for most applications. Common configuration changes include
6905///
6906/// * [with_endpoint()]: by default this client uses the global default endpoint
6907///   (`https://compute.googleapis.com`). Applications using regional
6908///   endpoints or running in restricted networks (e.g. a network configured
6909//    with [Private Google Access with VPC Service Controls]) may want to
6910///   override this default.
6911/// * [with_credentials()]: by default this client uses
6912///   [Application Default Credentials]. Applications using custom
6913///   authentication may need to override this default.
6914///
6915/// [with_endpoint()]: super::builder::machine_images::ClientBuilder::with_endpoint
6916/// [with_credentials()]: super::builder::machine_images::ClientBuilder::credentials
6917/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6918/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6919///
6920/// # Pooling and Cloning
6921///
6922/// `MachineImages` holds a connection pool internally, it is advised to
6923/// create one and the reuse it.  You do not need to wrap `MachineImages` in
6924/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6925/// already uses an `Arc` internally.
6926#[cfg(feature = "machine-images")]
6927#[cfg_attr(docsrs, doc(cfg(feature = "machine-images")))]
6928#[derive(Clone, Debug)]
6929pub struct MachineImages {
6930    inner: std::sync::Arc<dyn super::stub::dynamic::MachineImages>,
6931}
6932
6933#[cfg(feature = "machine-images")]
6934impl MachineImages {
6935    /// Returns a builder for [MachineImages].
6936    ///
6937    /// ```
6938    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6939    /// # use google_cloud_compute_v1::client::MachineImages;
6940    /// let client = MachineImages::builder().build().await?;
6941    /// # Ok(()) }
6942    /// ```
6943    pub fn builder() -> super::builder::machine_images::ClientBuilder {
6944        crate::new_client_builder(super::builder::machine_images::client::Factory)
6945    }
6946
6947    /// Creates a new client from the provided stub.
6948    ///
6949    /// The most common case for calling this function is in tests mocking the
6950    /// client's behavior.
6951    pub fn from_stub<T>(stub: T) -> Self
6952    where
6953        T: super::stub::MachineImages + 'static,
6954    {
6955        Self {
6956            inner: std::sync::Arc::new(stub),
6957        }
6958    }
6959
6960    pub(crate) async fn new(
6961        config: gaxi::options::ClientConfig,
6962    ) -> crate::ClientBuilderResult<Self> {
6963        let inner = Self::build_inner(config).await?;
6964        Ok(Self { inner })
6965    }
6966
6967    async fn build_inner(
6968        conf: gaxi::options::ClientConfig,
6969    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::MachineImages>> {
6970        if gaxi::options::tracing_enabled(&conf) {
6971            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6972        }
6973        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6974    }
6975
6976    async fn build_transport(
6977        conf: gaxi::options::ClientConfig,
6978    ) -> crate::ClientBuilderResult<impl super::stub::MachineImages> {
6979        super::transport::MachineImages::new(conf).await
6980    }
6981
6982    async fn build_with_tracing(
6983        conf: gaxi::options::ClientConfig,
6984    ) -> crate::ClientBuilderResult<impl super::stub::MachineImages> {
6985        Self::build_transport(conf)
6986            .await
6987            .map(super::tracing::MachineImages::new)
6988    }
6989
6990    /// Deletes the specified machine image. Deleting a machine image is permanent
6991    /// and cannot be undone.
6992    pub fn delete(&self) -> super::builder::machine_images::Delete {
6993        super::builder::machine_images::Delete::new(self.inner.clone())
6994    }
6995
6996    /// Returns the specified machine image.
6997    pub fn get(&self) -> super::builder::machine_images::Get {
6998        super::builder::machine_images::Get::new(self.inner.clone())
6999    }
7000
7001    /// Gets the access control policy for a resource. May be empty if no such
7002    /// policy or resource exists.
7003    pub fn get_iam_policy(&self) -> super::builder::machine_images::GetIamPolicy {
7004        super::builder::machine_images::GetIamPolicy::new(self.inner.clone())
7005    }
7006
7007    /// Creates a machine image in the specified project using the
7008    /// data that is included in the request. If you are creating a new machine
7009    /// image to update an existing instance, your new machine image should use the
7010    /// same network or, if applicable, the same subnetwork as the original
7011    /// instance.
7012    pub fn insert(&self) -> super::builder::machine_images::Insert {
7013        super::builder::machine_images::Insert::new(self.inner.clone())
7014    }
7015
7016    /// Retrieves a list of machine images that are contained within
7017    /// the specified project.
7018    pub fn list(&self) -> super::builder::machine_images::List {
7019        super::builder::machine_images::List::new(self.inner.clone())
7020    }
7021
7022    /// Sets the access control policy on the specified resource.
7023    /// Replaces any existing policy.
7024    pub fn set_iam_policy(&self) -> super::builder::machine_images::SetIamPolicy {
7025        super::builder::machine_images::SetIamPolicy::new(self.inner.clone())
7026    }
7027
7028    /// Sets the labels on a machine image. To learn more about labels, read theLabeling
7029    /// Resources documentation.
7030    pub fn set_labels(&self) -> super::builder::machine_images::SetLabels {
7031        super::builder::machine_images::SetLabels::new(self.inner.clone())
7032    }
7033
7034    /// Returns permissions that a caller has on the specified resource.
7035    pub fn test_iam_permissions(&self) -> super::builder::machine_images::TestIamPermissions {
7036        super::builder::machine_images::TestIamPermissions::new(self.inner.clone())
7037    }
7038
7039    /// Retrieves the specified Operations resource.
7040    pub fn get_operation(&self) -> super::builder::machine_images::GetOperation {
7041        super::builder::machine_images::GetOperation::new(self.inner.clone())
7042    }
7043}
7044
7045/// Implements a client for the Google Compute Engine API.
7046///
7047/// # Example
7048/// ```
7049/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7050/// # use google_cloud_compute_v1::client::MachineTypes;
7051/// let client = MachineTypes::builder().build().await?;
7052/// // use `client` to make requests to the Google Compute Engine API.
7053/// # Ok(()) }
7054/// ```
7055///
7056/// # Service Description
7057///
7058/// Service for the `machineTypes` resource.
7059///
7060/// # Configuration
7061///
7062/// To configure `MachineTypes` use the `with_*` methods in the type returned
7063/// by [builder()][MachineTypes::builder]. The default configuration should
7064/// work for most applications. Common configuration changes include
7065///
7066/// * [with_endpoint()]: by default this client uses the global default endpoint
7067///   (`https://compute.googleapis.com`). Applications using regional
7068///   endpoints or running in restricted networks (e.g. a network configured
7069//    with [Private Google Access with VPC Service Controls]) may want to
7070///   override this default.
7071/// * [with_credentials()]: by default this client uses
7072///   [Application Default Credentials]. Applications using custom
7073///   authentication may need to override this default.
7074///
7075/// [with_endpoint()]: super::builder::machine_types::ClientBuilder::with_endpoint
7076/// [with_credentials()]: super::builder::machine_types::ClientBuilder::credentials
7077/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7078/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7079///
7080/// # Pooling and Cloning
7081///
7082/// `MachineTypes` holds a connection pool internally, it is advised to
7083/// create one and the reuse it.  You do not need to wrap `MachineTypes` in
7084/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7085/// already uses an `Arc` internally.
7086#[cfg(feature = "machine-types")]
7087#[cfg_attr(docsrs, doc(cfg(feature = "machine-types")))]
7088#[derive(Clone, Debug)]
7089pub struct MachineTypes {
7090    inner: std::sync::Arc<dyn super::stub::dynamic::MachineTypes>,
7091}
7092
7093#[cfg(feature = "machine-types")]
7094impl MachineTypes {
7095    /// Returns a builder for [MachineTypes].
7096    ///
7097    /// ```
7098    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7099    /// # use google_cloud_compute_v1::client::MachineTypes;
7100    /// let client = MachineTypes::builder().build().await?;
7101    /// # Ok(()) }
7102    /// ```
7103    pub fn builder() -> super::builder::machine_types::ClientBuilder {
7104        crate::new_client_builder(super::builder::machine_types::client::Factory)
7105    }
7106
7107    /// Creates a new client from the provided stub.
7108    ///
7109    /// The most common case for calling this function is in tests mocking the
7110    /// client's behavior.
7111    pub fn from_stub<T>(stub: T) -> Self
7112    where
7113        T: super::stub::MachineTypes + 'static,
7114    {
7115        Self {
7116            inner: std::sync::Arc::new(stub),
7117        }
7118    }
7119
7120    pub(crate) async fn new(
7121        config: gaxi::options::ClientConfig,
7122    ) -> crate::ClientBuilderResult<Self> {
7123        let inner = Self::build_inner(config).await?;
7124        Ok(Self { inner })
7125    }
7126
7127    async fn build_inner(
7128        conf: gaxi::options::ClientConfig,
7129    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::MachineTypes>> {
7130        if gaxi::options::tracing_enabled(&conf) {
7131            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7132        }
7133        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7134    }
7135
7136    async fn build_transport(
7137        conf: gaxi::options::ClientConfig,
7138    ) -> crate::ClientBuilderResult<impl super::stub::MachineTypes> {
7139        super::transport::MachineTypes::new(conf).await
7140    }
7141
7142    async fn build_with_tracing(
7143        conf: gaxi::options::ClientConfig,
7144    ) -> crate::ClientBuilderResult<impl super::stub::MachineTypes> {
7145        Self::build_transport(conf)
7146            .await
7147            .map(super::tracing::MachineTypes::new)
7148    }
7149
7150    /// Retrieves an aggregated list of machine types.
7151    ///
7152    /// To prevent failure, Google recommends that you set the
7153    /// `returnPartialSuccess` parameter to `true`.
7154    pub fn aggregated_list(&self) -> super::builder::machine_types::AggregatedList {
7155        super::builder::machine_types::AggregatedList::new(self.inner.clone())
7156    }
7157
7158    /// Returns the specified machine type.
7159    pub fn get(&self) -> super::builder::machine_types::Get {
7160        super::builder::machine_types::Get::new(self.inner.clone())
7161    }
7162
7163    /// Retrieves a list of machine types available to the specified
7164    /// project.
7165    pub fn list(&self) -> super::builder::machine_types::List {
7166        super::builder::machine_types::List::new(self.inner.clone())
7167    }
7168}
7169
7170/// Implements a client for the Google Compute Engine API.
7171///
7172/// # Example
7173/// ```
7174/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7175/// # use google_cloud_compute_v1::client::NetworkAttachments;
7176/// let client = NetworkAttachments::builder().build().await?;
7177/// // use `client` to make requests to the Google Compute Engine API.
7178/// # Ok(()) }
7179/// ```
7180///
7181/// # Service Description
7182///
7183/// Service for the `networkAttachments` resource.
7184///
7185/// # Configuration
7186///
7187/// To configure `NetworkAttachments` use the `with_*` methods in the type returned
7188/// by [builder()][NetworkAttachments::builder]. The default configuration should
7189/// work for most applications. Common configuration changes include
7190///
7191/// * [with_endpoint()]: by default this client uses the global default endpoint
7192///   (`https://compute.googleapis.com`). Applications using regional
7193///   endpoints or running in restricted networks (e.g. a network configured
7194//    with [Private Google Access with VPC Service Controls]) may want to
7195///   override this default.
7196/// * [with_credentials()]: by default this client uses
7197///   [Application Default Credentials]. Applications using custom
7198///   authentication may need to override this default.
7199///
7200/// [with_endpoint()]: super::builder::network_attachments::ClientBuilder::with_endpoint
7201/// [with_credentials()]: super::builder::network_attachments::ClientBuilder::credentials
7202/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7203/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7204///
7205/// # Pooling and Cloning
7206///
7207/// `NetworkAttachments` holds a connection pool internally, it is advised to
7208/// create one and the reuse it.  You do not need to wrap `NetworkAttachments` in
7209/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7210/// already uses an `Arc` internally.
7211#[cfg(feature = "network-attachments")]
7212#[cfg_attr(docsrs, doc(cfg(feature = "network-attachments")))]
7213#[derive(Clone, Debug)]
7214pub struct NetworkAttachments {
7215    inner: std::sync::Arc<dyn super::stub::dynamic::NetworkAttachments>,
7216}
7217
7218#[cfg(feature = "network-attachments")]
7219impl NetworkAttachments {
7220    /// Returns a builder for [NetworkAttachments].
7221    ///
7222    /// ```
7223    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7224    /// # use google_cloud_compute_v1::client::NetworkAttachments;
7225    /// let client = NetworkAttachments::builder().build().await?;
7226    /// # Ok(()) }
7227    /// ```
7228    pub fn builder() -> super::builder::network_attachments::ClientBuilder {
7229        crate::new_client_builder(super::builder::network_attachments::client::Factory)
7230    }
7231
7232    /// Creates a new client from the provided stub.
7233    ///
7234    /// The most common case for calling this function is in tests mocking the
7235    /// client's behavior.
7236    pub fn from_stub<T>(stub: T) -> Self
7237    where
7238        T: super::stub::NetworkAttachments + 'static,
7239    {
7240        Self {
7241            inner: std::sync::Arc::new(stub),
7242        }
7243    }
7244
7245    pub(crate) async fn new(
7246        config: gaxi::options::ClientConfig,
7247    ) -> crate::ClientBuilderResult<Self> {
7248        let inner = Self::build_inner(config).await?;
7249        Ok(Self { inner })
7250    }
7251
7252    async fn build_inner(
7253        conf: gaxi::options::ClientConfig,
7254    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NetworkAttachments>>
7255    {
7256        if gaxi::options::tracing_enabled(&conf) {
7257            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7258        }
7259        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7260    }
7261
7262    async fn build_transport(
7263        conf: gaxi::options::ClientConfig,
7264    ) -> crate::ClientBuilderResult<impl super::stub::NetworkAttachments> {
7265        super::transport::NetworkAttachments::new(conf).await
7266    }
7267
7268    async fn build_with_tracing(
7269        conf: gaxi::options::ClientConfig,
7270    ) -> crate::ClientBuilderResult<impl super::stub::NetworkAttachments> {
7271        Self::build_transport(conf)
7272            .await
7273            .map(super::tracing::NetworkAttachments::new)
7274    }
7275
7276    /// Retrieves the list of all NetworkAttachment resources,
7277    /// regional and global, available to the specified project.
7278    ///
7279    /// To prevent failure, Google recommends that you set the
7280    /// `returnPartialSuccess` parameter to `true`.
7281    pub fn aggregated_list(&self) -> super::builder::network_attachments::AggregatedList {
7282        super::builder::network_attachments::AggregatedList::new(self.inner.clone())
7283    }
7284
7285    /// Deletes the specified NetworkAttachment in the given scope
7286    pub fn delete(&self) -> super::builder::network_attachments::Delete {
7287        super::builder::network_attachments::Delete::new(self.inner.clone())
7288    }
7289
7290    /// Returns the specified NetworkAttachment resource in the given scope.
7291    pub fn get(&self) -> super::builder::network_attachments::Get {
7292        super::builder::network_attachments::Get::new(self.inner.clone())
7293    }
7294
7295    /// Gets the access control policy for a resource. May be empty if no such
7296    /// policy or resource exists.
7297    pub fn get_iam_policy(&self) -> super::builder::network_attachments::GetIamPolicy {
7298        super::builder::network_attachments::GetIamPolicy::new(self.inner.clone())
7299    }
7300
7301    /// Creates a NetworkAttachment in the specified project in the given scope
7302    /// using the parameters that are included in the request.
7303    pub fn insert(&self) -> super::builder::network_attachments::Insert {
7304        super::builder::network_attachments::Insert::new(self.inner.clone())
7305    }
7306
7307    /// Lists the NetworkAttachments for a project in the given scope.
7308    pub fn list(&self) -> super::builder::network_attachments::List {
7309        super::builder::network_attachments::List::new(self.inner.clone())
7310    }
7311
7312    /// Patches the specified NetworkAttachment resource with the data included in
7313    /// the request. This method supports PATCH
7314    /// semantics and usesJSON merge
7315    /// patch format and processing rules.
7316    pub fn patch(&self) -> super::builder::network_attachments::Patch {
7317        super::builder::network_attachments::Patch::new(self.inner.clone())
7318    }
7319
7320    /// Sets the access control policy on the specified resource.
7321    /// Replaces any existing policy.
7322    pub fn set_iam_policy(&self) -> super::builder::network_attachments::SetIamPolicy {
7323        super::builder::network_attachments::SetIamPolicy::new(self.inner.clone())
7324    }
7325
7326    /// Returns permissions that a caller has on the specified resource.
7327    pub fn test_iam_permissions(&self) -> super::builder::network_attachments::TestIamPermissions {
7328        super::builder::network_attachments::TestIamPermissions::new(self.inner.clone())
7329    }
7330
7331    /// Retrieves the specified region-specific Operations resource.
7332    pub fn get_operation(&self) -> super::builder::network_attachments::GetOperation {
7333        super::builder::network_attachments::GetOperation::new(self.inner.clone())
7334    }
7335}
7336
7337/// Implements a client for the Google Compute Engine API.
7338///
7339/// # Example
7340/// ```
7341/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7342/// # use google_cloud_compute_v1::client::NetworkEdgeSecurityServices;
7343/// let client = NetworkEdgeSecurityServices::builder().build().await?;
7344/// // use `client` to make requests to the Google Compute Engine API.
7345/// # Ok(()) }
7346/// ```
7347///
7348/// # Service Description
7349///
7350/// Service for the `networkEdgeSecurityServices` resource.
7351///
7352/// # Configuration
7353///
7354/// To configure `NetworkEdgeSecurityServices` use the `with_*` methods in the type returned
7355/// by [builder()][NetworkEdgeSecurityServices::builder]. The default configuration should
7356/// work for most applications. Common configuration changes include
7357///
7358/// * [with_endpoint()]: by default this client uses the global default endpoint
7359///   (`https://compute.googleapis.com`). Applications using regional
7360///   endpoints or running in restricted networks (e.g. a network configured
7361//    with [Private Google Access with VPC Service Controls]) may want to
7362///   override this default.
7363/// * [with_credentials()]: by default this client uses
7364///   [Application Default Credentials]. Applications using custom
7365///   authentication may need to override this default.
7366///
7367/// [with_endpoint()]: super::builder::network_edge_security_services::ClientBuilder::with_endpoint
7368/// [with_credentials()]: super::builder::network_edge_security_services::ClientBuilder::credentials
7369/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7370/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7371///
7372/// # Pooling and Cloning
7373///
7374/// `NetworkEdgeSecurityServices` holds a connection pool internally, it is advised to
7375/// create one and the reuse it.  You do not need to wrap `NetworkEdgeSecurityServices` in
7376/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7377/// already uses an `Arc` internally.
7378#[cfg(feature = "network-edge-security-services")]
7379#[cfg_attr(docsrs, doc(cfg(feature = "network-edge-security-services")))]
7380#[derive(Clone, Debug)]
7381pub struct NetworkEdgeSecurityServices {
7382    inner: std::sync::Arc<dyn super::stub::dynamic::NetworkEdgeSecurityServices>,
7383}
7384
7385#[cfg(feature = "network-edge-security-services")]
7386impl NetworkEdgeSecurityServices {
7387    /// Returns a builder for [NetworkEdgeSecurityServices].
7388    ///
7389    /// ```
7390    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7391    /// # use google_cloud_compute_v1::client::NetworkEdgeSecurityServices;
7392    /// let client = NetworkEdgeSecurityServices::builder().build().await?;
7393    /// # Ok(()) }
7394    /// ```
7395    pub fn builder() -> super::builder::network_edge_security_services::ClientBuilder {
7396        crate::new_client_builder(super::builder::network_edge_security_services::client::Factory)
7397    }
7398
7399    /// Creates a new client from the provided stub.
7400    ///
7401    /// The most common case for calling this function is in tests mocking the
7402    /// client's behavior.
7403    pub fn from_stub<T>(stub: T) -> Self
7404    where
7405        T: super::stub::NetworkEdgeSecurityServices + 'static,
7406    {
7407        Self {
7408            inner: std::sync::Arc::new(stub),
7409        }
7410    }
7411
7412    pub(crate) async fn new(
7413        config: gaxi::options::ClientConfig,
7414    ) -> crate::ClientBuilderResult<Self> {
7415        let inner = Self::build_inner(config).await?;
7416        Ok(Self { inner })
7417    }
7418
7419    async fn build_inner(
7420        conf: gaxi::options::ClientConfig,
7421    ) -> crate::ClientBuilderResult<
7422        std::sync::Arc<dyn super::stub::dynamic::NetworkEdgeSecurityServices>,
7423    > {
7424        if gaxi::options::tracing_enabled(&conf) {
7425            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7426        }
7427        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7428    }
7429
7430    async fn build_transport(
7431        conf: gaxi::options::ClientConfig,
7432    ) -> crate::ClientBuilderResult<impl super::stub::NetworkEdgeSecurityServices> {
7433        super::transport::NetworkEdgeSecurityServices::new(conf).await
7434    }
7435
7436    async fn build_with_tracing(
7437        conf: gaxi::options::ClientConfig,
7438    ) -> crate::ClientBuilderResult<impl super::stub::NetworkEdgeSecurityServices> {
7439        Self::build_transport(conf)
7440            .await
7441            .map(super::tracing::NetworkEdgeSecurityServices::new)
7442    }
7443
7444    /// Retrieves the list of all NetworkEdgeSecurityService resources available to
7445    /// the specified project.
7446    ///
7447    /// To prevent failure, Google recommends that you set the
7448    /// `returnPartialSuccess` parameter to `true`.
7449    pub fn aggregated_list(
7450        &self,
7451    ) -> super::builder::network_edge_security_services::AggregatedList {
7452        super::builder::network_edge_security_services::AggregatedList::new(self.inner.clone())
7453    }
7454
7455    /// Deletes the specified service.
7456    pub fn delete(&self) -> super::builder::network_edge_security_services::Delete {
7457        super::builder::network_edge_security_services::Delete::new(self.inner.clone())
7458    }
7459
7460    /// Gets a specified NetworkEdgeSecurityService.
7461    pub fn get(&self) -> super::builder::network_edge_security_services::Get {
7462        super::builder::network_edge_security_services::Get::new(self.inner.clone())
7463    }
7464
7465    /// Creates a new service in the specified project using the data included in
7466    /// the request.
7467    pub fn insert(&self) -> super::builder::network_edge_security_services::Insert {
7468        super::builder::network_edge_security_services::Insert::new(self.inner.clone())
7469    }
7470
7471    /// Patches the specified policy with the data included in the request.
7472    pub fn patch(&self) -> super::builder::network_edge_security_services::Patch {
7473        super::builder::network_edge_security_services::Patch::new(self.inner.clone())
7474    }
7475
7476    /// Retrieves the specified region-specific Operations resource.
7477    pub fn get_operation(&self) -> super::builder::network_edge_security_services::GetOperation {
7478        super::builder::network_edge_security_services::GetOperation::new(self.inner.clone())
7479    }
7480}
7481
7482/// Implements a client for the Google Compute Engine API.
7483///
7484/// # Example
7485/// ```
7486/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7487/// # use google_cloud_compute_v1::client::NetworkEndpointGroups;
7488/// let client = NetworkEndpointGroups::builder().build().await?;
7489/// // use `client` to make requests to the Google Compute Engine API.
7490/// # Ok(()) }
7491/// ```
7492///
7493/// # Service Description
7494///
7495/// Service for the `networkEndpointGroups` resource.
7496///
7497/// # Configuration
7498///
7499/// To configure `NetworkEndpointGroups` use the `with_*` methods in the type returned
7500/// by [builder()][NetworkEndpointGroups::builder]. The default configuration should
7501/// work for most applications. Common configuration changes include
7502///
7503/// * [with_endpoint()]: by default this client uses the global default endpoint
7504///   (`https://compute.googleapis.com`). Applications using regional
7505///   endpoints or running in restricted networks (e.g. a network configured
7506//    with [Private Google Access with VPC Service Controls]) may want to
7507///   override this default.
7508/// * [with_credentials()]: by default this client uses
7509///   [Application Default Credentials]. Applications using custom
7510///   authentication may need to override this default.
7511///
7512/// [with_endpoint()]: super::builder::network_endpoint_groups::ClientBuilder::with_endpoint
7513/// [with_credentials()]: super::builder::network_endpoint_groups::ClientBuilder::credentials
7514/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7515/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7516///
7517/// # Pooling and Cloning
7518///
7519/// `NetworkEndpointGroups` holds a connection pool internally, it is advised to
7520/// create one and the reuse it.  You do not need to wrap `NetworkEndpointGroups` in
7521/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7522/// already uses an `Arc` internally.
7523#[cfg(feature = "network-endpoint-groups")]
7524#[cfg_attr(docsrs, doc(cfg(feature = "network-endpoint-groups")))]
7525#[derive(Clone, Debug)]
7526pub struct NetworkEndpointGroups {
7527    inner: std::sync::Arc<dyn super::stub::dynamic::NetworkEndpointGroups>,
7528}
7529
7530#[cfg(feature = "network-endpoint-groups")]
7531impl NetworkEndpointGroups {
7532    /// Returns a builder for [NetworkEndpointGroups].
7533    ///
7534    /// ```
7535    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7536    /// # use google_cloud_compute_v1::client::NetworkEndpointGroups;
7537    /// let client = NetworkEndpointGroups::builder().build().await?;
7538    /// # Ok(()) }
7539    /// ```
7540    pub fn builder() -> super::builder::network_endpoint_groups::ClientBuilder {
7541        crate::new_client_builder(super::builder::network_endpoint_groups::client::Factory)
7542    }
7543
7544    /// Creates a new client from the provided stub.
7545    ///
7546    /// The most common case for calling this function is in tests mocking the
7547    /// client's behavior.
7548    pub fn from_stub<T>(stub: T) -> Self
7549    where
7550        T: super::stub::NetworkEndpointGroups + 'static,
7551    {
7552        Self {
7553            inner: std::sync::Arc::new(stub),
7554        }
7555    }
7556
7557    pub(crate) async fn new(
7558        config: gaxi::options::ClientConfig,
7559    ) -> crate::ClientBuilderResult<Self> {
7560        let inner = Self::build_inner(config).await?;
7561        Ok(Self { inner })
7562    }
7563
7564    async fn build_inner(
7565        conf: gaxi::options::ClientConfig,
7566    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NetworkEndpointGroups>>
7567    {
7568        if gaxi::options::tracing_enabled(&conf) {
7569            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7570        }
7571        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7572    }
7573
7574    async fn build_transport(
7575        conf: gaxi::options::ClientConfig,
7576    ) -> crate::ClientBuilderResult<impl super::stub::NetworkEndpointGroups> {
7577        super::transport::NetworkEndpointGroups::new(conf).await
7578    }
7579
7580    async fn build_with_tracing(
7581        conf: gaxi::options::ClientConfig,
7582    ) -> crate::ClientBuilderResult<impl super::stub::NetworkEndpointGroups> {
7583        Self::build_transport(conf)
7584            .await
7585            .map(super::tracing::NetworkEndpointGroups::new)
7586    }
7587
7588    /// Retrieves the list of network endpoint groups and sorts them by zone.
7589    ///
7590    /// To prevent failure, Google recommends that you set the
7591    /// `returnPartialSuccess` parameter to `true`.
7592    pub fn aggregated_list(&self) -> super::builder::network_endpoint_groups::AggregatedList {
7593        super::builder::network_endpoint_groups::AggregatedList::new(self.inner.clone())
7594    }
7595
7596    /// Attach a list of network endpoints to the specified network endpoint group.
7597    pub fn attach_network_endpoints(
7598        &self,
7599    ) -> super::builder::network_endpoint_groups::AttachNetworkEndpoints {
7600        super::builder::network_endpoint_groups::AttachNetworkEndpoints::new(self.inner.clone())
7601    }
7602
7603    /// Deletes the specified network endpoint group. The network endpoints in the
7604    /// NEG and the VM instances they belong to are not terminated when the NEG is
7605    /// deleted. Note that the NEG cannot be deleted if there are backend services
7606    /// referencing it.
7607    pub fn delete(&self) -> super::builder::network_endpoint_groups::Delete {
7608        super::builder::network_endpoint_groups::Delete::new(self.inner.clone())
7609    }
7610
7611    /// Detach a list of network endpoints from the specified network endpoint
7612    /// group.
7613    pub fn detach_network_endpoints(
7614        &self,
7615    ) -> super::builder::network_endpoint_groups::DetachNetworkEndpoints {
7616        super::builder::network_endpoint_groups::DetachNetworkEndpoints::new(self.inner.clone())
7617    }
7618
7619    /// Returns the specified network endpoint group.
7620    pub fn get(&self) -> super::builder::network_endpoint_groups::Get {
7621        super::builder::network_endpoint_groups::Get::new(self.inner.clone())
7622    }
7623
7624    /// Creates a network endpoint group in the specified project using the
7625    /// parameters that are included in the request.
7626    ///
7627    /// Note: Use the following APIs to manage network endpoint groups:
7628    ///
7629    /// - To manage NEGs with zonal scope (such as zonal NEGs, hybrid connectivity
7630    ///   NEGs): zonal
7631    ///   API
7632    /// - To manage NEGs with regional scope (such as regional internet NEGs,
7633    ///   serverless NEGs, Private Service Connect NEGs): regional
7634    ///   API
7635    /// - To manage NEGs with global scope (such as global internet NEGs):global
7636    ///   API
7637    pub fn insert(&self) -> super::builder::network_endpoint_groups::Insert {
7638        super::builder::network_endpoint_groups::Insert::new(self.inner.clone())
7639    }
7640
7641    /// Retrieves the list of network endpoint groups that are located in the
7642    /// specified project and zone.
7643    pub fn list(&self) -> super::builder::network_endpoint_groups::List {
7644        super::builder::network_endpoint_groups::List::new(self.inner.clone())
7645    }
7646
7647    /// Lists the network endpoints in the specified network endpoint group.
7648    pub fn list_network_endpoints(
7649        &self,
7650    ) -> super::builder::network_endpoint_groups::ListNetworkEndpoints {
7651        super::builder::network_endpoint_groups::ListNetworkEndpoints::new(self.inner.clone())
7652    }
7653
7654    /// Returns permissions that a caller has on the specified resource.
7655    pub fn test_iam_permissions(
7656        &self,
7657    ) -> super::builder::network_endpoint_groups::TestIamPermissions {
7658        super::builder::network_endpoint_groups::TestIamPermissions::new(self.inner.clone())
7659    }
7660
7661    /// Retrieves the specified zone-specific Operations resource.
7662    pub fn get_operation(&self) -> super::builder::network_endpoint_groups::GetOperation {
7663        super::builder::network_endpoint_groups::GetOperation::new(self.inner.clone())
7664    }
7665}
7666
7667/// Implements a client for the Google Compute Engine API.
7668///
7669/// # Example
7670/// ```
7671/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7672/// # use google_cloud_compute_v1::client::NetworkFirewallPolicies;
7673/// let client = NetworkFirewallPolicies::builder().build().await?;
7674/// // use `client` to make requests to the Google Compute Engine API.
7675/// # Ok(()) }
7676/// ```
7677///
7678/// # Service Description
7679///
7680/// Service for the `networkFirewallPolicies` resource.
7681///
7682/// # Configuration
7683///
7684/// To configure `NetworkFirewallPolicies` use the `with_*` methods in the type returned
7685/// by [builder()][NetworkFirewallPolicies::builder]. The default configuration should
7686/// work for most applications. Common configuration changes include
7687///
7688/// * [with_endpoint()]: by default this client uses the global default endpoint
7689///   (`https://compute.googleapis.com`). Applications using regional
7690///   endpoints or running in restricted networks (e.g. a network configured
7691//    with [Private Google Access with VPC Service Controls]) may want to
7692///   override this default.
7693/// * [with_credentials()]: by default this client uses
7694///   [Application Default Credentials]. Applications using custom
7695///   authentication may need to override this default.
7696///
7697/// [with_endpoint()]: super::builder::network_firewall_policies::ClientBuilder::with_endpoint
7698/// [with_credentials()]: super::builder::network_firewall_policies::ClientBuilder::credentials
7699/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7700/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7701///
7702/// # Pooling and Cloning
7703///
7704/// `NetworkFirewallPolicies` holds a connection pool internally, it is advised to
7705/// create one and the reuse it.  You do not need to wrap `NetworkFirewallPolicies` in
7706/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7707/// already uses an `Arc` internally.
7708#[cfg(feature = "network-firewall-policies")]
7709#[cfg_attr(docsrs, doc(cfg(feature = "network-firewall-policies")))]
7710#[derive(Clone, Debug)]
7711pub struct NetworkFirewallPolicies {
7712    inner: std::sync::Arc<dyn super::stub::dynamic::NetworkFirewallPolicies>,
7713}
7714
7715#[cfg(feature = "network-firewall-policies")]
7716impl NetworkFirewallPolicies {
7717    /// Returns a builder for [NetworkFirewallPolicies].
7718    ///
7719    /// ```
7720    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7721    /// # use google_cloud_compute_v1::client::NetworkFirewallPolicies;
7722    /// let client = NetworkFirewallPolicies::builder().build().await?;
7723    /// # Ok(()) }
7724    /// ```
7725    pub fn builder() -> super::builder::network_firewall_policies::ClientBuilder {
7726        crate::new_client_builder(super::builder::network_firewall_policies::client::Factory)
7727    }
7728
7729    /// Creates a new client from the provided stub.
7730    ///
7731    /// The most common case for calling this function is in tests mocking the
7732    /// client's behavior.
7733    pub fn from_stub<T>(stub: T) -> Self
7734    where
7735        T: super::stub::NetworkFirewallPolicies + 'static,
7736    {
7737        Self {
7738            inner: std::sync::Arc::new(stub),
7739        }
7740    }
7741
7742    pub(crate) async fn new(
7743        config: gaxi::options::ClientConfig,
7744    ) -> crate::ClientBuilderResult<Self> {
7745        let inner = Self::build_inner(config).await?;
7746        Ok(Self { inner })
7747    }
7748
7749    async fn build_inner(
7750        conf: gaxi::options::ClientConfig,
7751    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NetworkFirewallPolicies>>
7752    {
7753        if gaxi::options::tracing_enabled(&conf) {
7754            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7755        }
7756        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7757    }
7758
7759    async fn build_transport(
7760        conf: gaxi::options::ClientConfig,
7761    ) -> crate::ClientBuilderResult<impl super::stub::NetworkFirewallPolicies> {
7762        super::transport::NetworkFirewallPolicies::new(conf).await
7763    }
7764
7765    async fn build_with_tracing(
7766        conf: gaxi::options::ClientConfig,
7767    ) -> crate::ClientBuilderResult<impl super::stub::NetworkFirewallPolicies> {
7768        Self::build_transport(conf)
7769            .await
7770            .map(super::tracing::NetworkFirewallPolicies::new)
7771    }
7772
7773    /// Inserts an association for the specified firewall policy.
7774    pub fn add_association(&self) -> super::builder::network_firewall_policies::AddAssociation {
7775        super::builder::network_firewall_policies::AddAssociation::new(self.inner.clone())
7776    }
7777
7778    /// Inserts a packet mirroring rule into a firewall policy.
7779    pub fn add_packet_mirroring_rule(
7780        &self,
7781    ) -> super::builder::network_firewall_policies::AddPacketMirroringRule {
7782        super::builder::network_firewall_policies::AddPacketMirroringRule::new(self.inner.clone())
7783    }
7784
7785    /// Inserts a rule into a firewall policy.
7786    pub fn add_rule(&self) -> super::builder::network_firewall_policies::AddRule {
7787        super::builder::network_firewall_policies::AddRule::new(self.inner.clone())
7788    }
7789
7790    /// Retrieves an aggregated list of network firewall policies, listing network
7791    /// firewall policies from all applicable scopes (global and regional) and
7792    /// grouping the results per scope.
7793    ///
7794    /// To prevent failure, it is recommended that you set the
7795    /// `returnPartialSuccess` parameter to `true`.
7796    pub fn aggregated_list(&self) -> super::builder::network_firewall_policies::AggregatedList {
7797        super::builder::network_firewall_policies::AggregatedList::new(self.inner.clone())
7798    }
7799
7800    /// Copies rules to the specified firewall policy.
7801    pub fn clone_rules(&self) -> super::builder::network_firewall_policies::CloneRules {
7802        super::builder::network_firewall_policies::CloneRules::new(self.inner.clone())
7803    }
7804
7805    /// Deletes the specified policy.
7806    pub fn delete(&self) -> super::builder::network_firewall_policies::Delete {
7807        super::builder::network_firewall_policies::Delete::new(self.inner.clone())
7808    }
7809
7810    /// Returns the specified network firewall policy.
7811    pub fn get(&self) -> super::builder::network_firewall_policies::Get {
7812        super::builder::network_firewall_policies::Get::new(self.inner.clone())
7813    }
7814
7815    /// Gets an association with the specified name.
7816    pub fn get_association(&self) -> super::builder::network_firewall_policies::GetAssociation {
7817        super::builder::network_firewall_policies::GetAssociation::new(self.inner.clone())
7818    }
7819
7820    /// Gets the access control policy for a resource. May be empty if no such
7821    /// policy or resource exists.
7822    pub fn get_iam_policy(&self) -> super::builder::network_firewall_policies::GetIamPolicy {
7823        super::builder::network_firewall_policies::GetIamPolicy::new(self.inner.clone())
7824    }
7825
7826    /// Gets a packet mirroring rule of the specified priority.
7827    pub fn get_packet_mirroring_rule(
7828        &self,
7829    ) -> super::builder::network_firewall_policies::GetPacketMirroringRule {
7830        super::builder::network_firewall_policies::GetPacketMirroringRule::new(self.inner.clone())
7831    }
7832
7833    /// Gets a rule of the specified priority.
7834    pub fn get_rule(&self) -> super::builder::network_firewall_policies::GetRule {
7835        super::builder::network_firewall_policies::GetRule::new(self.inner.clone())
7836    }
7837
7838    /// Creates a new policy in the specified project using the data included in
7839    /// the request.
7840    pub fn insert(&self) -> super::builder::network_firewall_policies::Insert {
7841        super::builder::network_firewall_policies::Insert::new(self.inner.clone())
7842    }
7843
7844    /// Lists all the policies that have been configured for the specified project.
7845    pub fn list(&self) -> super::builder::network_firewall_policies::List {
7846        super::builder::network_firewall_policies::List::new(self.inner.clone())
7847    }
7848
7849    /// Patches the specified policy with the data included in the request.
7850    pub fn patch(&self) -> super::builder::network_firewall_policies::Patch {
7851        super::builder::network_firewall_policies::Patch::new(self.inner.clone())
7852    }
7853
7854    /// Patches a packet mirroring rule of the specified priority.
7855    pub fn patch_packet_mirroring_rule(
7856        &self,
7857    ) -> super::builder::network_firewall_policies::PatchPacketMirroringRule {
7858        super::builder::network_firewall_policies::PatchPacketMirroringRule::new(self.inner.clone())
7859    }
7860
7861    /// Patches a rule of the specified priority.
7862    pub fn patch_rule(&self) -> super::builder::network_firewall_policies::PatchRule {
7863        super::builder::network_firewall_policies::PatchRule::new(self.inner.clone())
7864    }
7865
7866    /// Removes an association for the specified firewall policy.
7867    pub fn remove_association(
7868        &self,
7869    ) -> super::builder::network_firewall_policies::RemoveAssociation {
7870        super::builder::network_firewall_policies::RemoveAssociation::new(self.inner.clone())
7871    }
7872
7873    /// Deletes a packet mirroring rule of the specified priority.
7874    pub fn remove_packet_mirroring_rule(
7875        &self,
7876    ) -> super::builder::network_firewall_policies::RemovePacketMirroringRule {
7877        super::builder::network_firewall_policies::RemovePacketMirroringRule::new(
7878            self.inner.clone(),
7879        )
7880    }
7881
7882    /// Deletes a rule of the specified priority.
7883    pub fn remove_rule(&self) -> super::builder::network_firewall_policies::RemoveRule {
7884        super::builder::network_firewall_policies::RemoveRule::new(self.inner.clone())
7885    }
7886
7887    /// Sets the access control policy on the specified resource.
7888    /// Replaces any existing policy.
7889    pub fn set_iam_policy(&self) -> super::builder::network_firewall_policies::SetIamPolicy {
7890        super::builder::network_firewall_policies::SetIamPolicy::new(self.inner.clone())
7891    }
7892
7893    /// Returns permissions that a caller has on the specified resource.
7894    pub fn test_iam_permissions(
7895        &self,
7896    ) -> super::builder::network_firewall_policies::TestIamPermissions {
7897        super::builder::network_firewall_policies::TestIamPermissions::new(self.inner.clone())
7898    }
7899
7900    /// Retrieves the specified Operations resource.
7901    pub fn get_operation(&self) -> super::builder::network_firewall_policies::GetOperation {
7902        super::builder::network_firewall_policies::GetOperation::new(self.inner.clone())
7903    }
7904}
7905
7906/// Implements a client for the Google Compute Engine API.
7907///
7908/// # Example
7909/// ```
7910/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7911/// # use google_cloud_compute_v1::client::NetworkProfiles;
7912/// let client = NetworkProfiles::builder().build().await?;
7913/// // use `client` to make requests to the Google Compute Engine API.
7914/// # Ok(()) }
7915/// ```
7916///
7917/// # Service Description
7918///
7919/// Service for the `networkProfiles` resource.
7920///
7921/// # Configuration
7922///
7923/// To configure `NetworkProfiles` use the `with_*` methods in the type returned
7924/// by [builder()][NetworkProfiles::builder]. The default configuration should
7925/// work for most applications. Common configuration changes include
7926///
7927/// * [with_endpoint()]: by default this client uses the global default endpoint
7928///   (`https://compute.googleapis.com`). Applications using regional
7929///   endpoints or running in restricted networks (e.g. a network configured
7930//    with [Private Google Access with VPC Service Controls]) may want to
7931///   override this default.
7932/// * [with_credentials()]: by default this client uses
7933///   [Application Default Credentials]. Applications using custom
7934///   authentication may need to override this default.
7935///
7936/// [with_endpoint()]: super::builder::network_profiles::ClientBuilder::with_endpoint
7937/// [with_credentials()]: super::builder::network_profiles::ClientBuilder::credentials
7938/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7939/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7940///
7941/// # Pooling and Cloning
7942///
7943/// `NetworkProfiles` holds a connection pool internally, it is advised to
7944/// create one and the reuse it.  You do not need to wrap `NetworkProfiles` in
7945/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7946/// already uses an `Arc` internally.
7947#[cfg(feature = "network-profiles")]
7948#[cfg_attr(docsrs, doc(cfg(feature = "network-profiles")))]
7949#[derive(Clone, Debug)]
7950pub struct NetworkProfiles {
7951    inner: std::sync::Arc<dyn super::stub::dynamic::NetworkProfiles>,
7952}
7953
7954#[cfg(feature = "network-profiles")]
7955impl NetworkProfiles {
7956    /// Returns a builder for [NetworkProfiles].
7957    ///
7958    /// ```
7959    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7960    /// # use google_cloud_compute_v1::client::NetworkProfiles;
7961    /// let client = NetworkProfiles::builder().build().await?;
7962    /// # Ok(()) }
7963    /// ```
7964    pub fn builder() -> super::builder::network_profiles::ClientBuilder {
7965        crate::new_client_builder(super::builder::network_profiles::client::Factory)
7966    }
7967
7968    /// Creates a new client from the provided stub.
7969    ///
7970    /// The most common case for calling this function is in tests mocking the
7971    /// client's behavior.
7972    pub fn from_stub<T>(stub: T) -> Self
7973    where
7974        T: super::stub::NetworkProfiles + 'static,
7975    {
7976        Self {
7977            inner: std::sync::Arc::new(stub),
7978        }
7979    }
7980
7981    pub(crate) async fn new(
7982        config: gaxi::options::ClientConfig,
7983    ) -> crate::ClientBuilderResult<Self> {
7984        let inner = Self::build_inner(config).await?;
7985        Ok(Self { inner })
7986    }
7987
7988    async fn build_inner(
7989        conf: gaxi::options::ClientConfig,
7990    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NetworkProfiles>> {
7991        if gaxi::options::tracing_enabled(&conf) {
7992            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7993        }
7994        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7995    }
7996
7997    async fn build_transport(
7998        conf: gaxi::options::ClientConfig,
7999    ) -> crate::ClientBuilderResult<impl super::stub::NetworkProfiles> {
8000        super::transport::NetworkProfiles::new(conf).await
8001    }
8002
8003    async fn build_with_tracing(
8004        conf: gaxi::options::ClientConfig,
8005    ) -> crate::ClientBuilderResult<impl super::stub::NetworkProfiles> {
8006        Self::build_transport(conf)
8007            .await
8008            .map(super::tracing::NetworkProfiles::new)
8009    }
8010
8011    /// Returns the specified network profile.
8012    pub fn get(&self) -> super::builder::network_profiles::Get {
8013        super::builder::network_profiles::Get::new(self.inner.clone())
8014    }
8015
8016    /// Retrieves a list of network profiles available to the specified
8017    /// project.
8018    pub fn list(&self) -> super::builder::network_profiles::List {
8019        super::builder::network_profiles::List::new(self.inner.clone())
8020    }
8021}
8022
8023/// Implements a client for the Google Compute Engine API.
8024///
8025/// # Example
8026/// ```
8027/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8028/// # use google_cloud_compute_v1::client::Networks;
8029/// let client = Networks::builder().build().await?;
8030/// // use `client` to make requests to the Google Compute Engine API.
8031/// # Ok(()) }
8032/// ```
8033///
8034/// # Service Description
8035///
8036/// Service for the `networks` resource.
8037///
8038/// # Configuration
8039///
8040/// To configure `Networks` use the `with_*` methods in the type returned
8041/// by [builder()][Networks::builder]. The default configuration should
8042/// work for most applications. Common configuration changes include
8043///
8044/// * [with_endpoint()]: by default this client uses the global default endpoint
8045///   (`https://compute.googleapis.com`). Applications using regional
8046///   endpoints or running in restricted networks (e.g. a network configured
8047//    with [Private Google Access with VPC Service Controls]) may want to
8048///   override this default.
8049/// * [with_credentials()]: by default this client uses
8050///   [Application Default Credentials]. Applications using custom
8051///   authentication may need to override this default.
8052///
8053/// [with_endpoint()]: super::builder::networks::ClientBuilder::with_endpoint
8054/// [with_credentials()]: super::builder::networks::ClientBuilder::credentials
8055/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8056/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8057///
8058/// # Pooling and Cloning
8059///
8060/// `Networks` holds a connection pool internally, it is advised to
8061/// create one and the reuse it.  You do not need to wrap `Networks` in
8062/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8063/// already uses an `Arc` internally.
8064#[cfg(feature = "networks")]
8065#[cfg_attr(docsrs, doc(cfg(feature = "networks")))]
8066#[derive(Clone, Debug)]
8067pub struct Networks {
8068    inner: std::sync::Arc<dyn super::stub::dynamic::Networks>,
8069}
8070
8071#[cfg(feature = "networks")]
8072impl Networks {
8073    /// Returns a builder for [Networks].
8074    ///
8075    /// ```
8076    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8077    /// # use google_cloud_compute_v1::client::Networks;
8078    /// let client = Networks::builder().build().await?;
8079    /// # Ok(()) }
8080    /// ```
8081    pub fn builder() -> super::builder::networks::ClientBuilder {
8082        crate::new_client_builder(super::builder::networks::client::Factory)
8083    }
8084
8085    /// Creates a new client from the provided stub.
8086    ///
8087    /// The most common case for calling this function is in tests mocking the
8088    /// client's behavior.
8089    pub fn from_stub<T>(stub: T) -> Self
8090    where
8091        T: super::stub::Networks + 'static,
8092    {
8093        Self {
8094            inner: std::sync::Arc::new(stub),
8095        }
8096    }
8097
8098    pub(crate) async fn new(
8099        config: gaxi::options::ClientConfig,
8100    ) -> crate::ClientBuilderResult<Self> {
8101        let inner = Self::build_inner(config).await?;
8102        Ok(Self { inner })
8103    }
8104
8105    async fn build_inner(
8106        conf: gaxi::options::ClientConfig,
8107    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Networks>> {
8108        if gaxi::options::tracing_enabled(&conf) {
8109            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8110        }
8111        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8112    }
8113
8114    async fn build_transport(
8115        conf: gaxi::options::ClientConfig,
8116    ) -> crate::ClientBuilderResult<impl super::stub::Networks> {
8117        super::transport::Networks::new(conf).await
8118    }
8119
8120    async fn build_with_tracing(
8121        conf: gaxi::options::ClientConfig,
8122    ) -> crate::ClientBuilderResult<impl super::stub::Networks> {
8123        Self::build_transport(conf)
8124            .await
8125            .map(super::tracing::Networks::new)
8126    }
8127
8128    /// Adds a peering to the specified network.
8129    pub fn add_peering(&self) -> super::builder::networks::AddPeering {
8130        super::builder::networks::AddPeering::new(self.inner.clone())
8131    }
8132
8133    /// Deletes the specified network.
8134    pub fn delete(&self) -> super::builder::networks::Delete {
8135        super::builder::networks::Delete::new(self.inner.clone())
8136    }
8137
8138    /// Returns the specified network.
8139    pub fn get(&self) -> super::builder::networks::Get {
8140        super::builder::networks::Get::new(self.inner.clone())
8141    }
8142
8143    /// Returns the effective firewalls on a given network.
8144    pub fn get_effective_firewalls(&self) -> super::builder::networks::GetEffectiveFirewalls {
8145        super::builder::networks::GetEffectiveFirewalls::new(self.inner.clone())
8146    }
8147
8148    /// Creates a network in the specified project using the data included
8149    /// in the request.
8150    pub fn insert(&self) -> super::builder::networks::Insert {
8151        super::builder::networks::Insert::new(self.inner.clone())
8152    }
8153
8154    /// Retrieves the list of networks available to the specified project.
8155    pub fn list(&self) -> super::builder::networks::List {
8156        super::builder::networks::List::new(self.inner.clone())
8157    }
8158
8159    /// Lists the peering routes exchanged over peering connection.
8160    pub fn list_peering_routes(&self) -> super::builder::networks::ListPeeringRoutes {
8161        super::builder::networks::ListPeeringRoutes::new(self.inner.clone())
8162    }
8163
8164    /// Patches the specified network with the data included in the request.
8165    /// Only routingConfig can be modified.
8166    pub fn patch(&self) -> super::builder::networks::Patch {
8167        super::builder::networks::Patch::new(self.inner.clone())
8168    }
8169
8170    /// Removes a peering from the specified network.
8171    pub fn remove_peering(&self) -> super::builder::networks::RemovePeering {
8172        super::builder::networks::RemovePeering::new(self.inner.clone())
8173    }
8174
8175    /// Requests to remove a peering from the specified network. Applicable only
8176    /// for PeeringConnection with update_strategy=CONSENSUS.
8177    pub fn request_remove_peering(&self) -> super::builder::networks::RequestRemovePeering {
8178        super::builder::networks::RequestRemovePeering::new(self.inner.clone())
8179    }
8180
8181    /// Switches the network mode from auto subnet mode to custom subnet mode.
8182    pub fn switch_to_custom_mode(&self) -> super::builder::networks::SwitchToCustomMode {
8183        super::builder::networks::SwitchToCustomMode::new(self.inner.clone())
8184    }
8185
8186    /// Updates the specified network peering with the data included in the
8187    /// request. You can only modify the NetworkPeering.export_custom_routes field
8188    /// and the NetworkPeering.import_custom_routes field.
8189    pub fn update_peering(&self) -> super::builder::networks::UpdatePeering {
8190        super::builder::networks::UpdatePeering::new(self.inner.clone())
8191    }
8192
8193    /// Retrieves the specified Operations resource.
8194    pub fn get_operation(&self) -> super::builder::networks::GetOperation {
8195        super::builder::networks::GetOperation::new(self.inner.clone())
8196    }
8197}
8198
8199/// Implements a client for the Google Compute Engine API.
8200///
8201/// # Example
8202/// ```
8203/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8204/// # use google_cloud_compute_v1::client::NodeGroups;
8205/// let client = NodeGroups::builder().build().await?;
8206/// // use `client` to make requests to the Google Compute Engine API.
8207/// # Ok(()) }
8208/// ```
8209///
8210/// # Service Description
8211///
8212/// Service for the `nodeGroups` resource.
8213///
8214/// # Configuration
8215///
8216/// To configure `NodeGroups` use the `with_*` methods in the type returned
8217/// by [builder()][NodeGroups::builder]. The default configuration should
8218/// work for most applications. Common configuration changes include
8219///
8220/// * [with_endpoint()]: by default this client uses the global default endpoint
8221///   (`https://compute.googleapis.com`). Applications using regional
8222///   endpoints or running in restricted networks (e.g. a network configured
8223//    with [Private Google Access with VPC Service Controls]) may want to
8224///   override this default.
8225/// * [with_credentials()]: by default this client uses
8226///   [Application Default Credentials]. Applications using custom
8227///   authentication may need to override this default.
8228///
8229/// [with_endpoint()]: super::builder::node_groups::ClientBuilder::with_endpoint
8230/// [with_credentials()]: super::builder::node_groups::ClientBuilder::credentials
8231/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8232/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8233///
8234/// # Pooling and Cloning
8235///
8236/// `NodeGroups` holds a connection pool internally, it is advised to
8237/// create one and the reuse it.  You do not need to wrap `NodeGroups` in
8238/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8239/// already uses an `Arc` internally.
8240#[cfg(feature = "node-groups")]
8241#[cfg_attr(docsrs, doc(cfg(feature = "node-groups")))]
8242#[derive(Clone, Debug)]
8243pub struct NodeGroups {
8244    inner: std::sync::Arc<dyn super::stub::dynamic::NodeGroups>,
8245}
8246
8247#[cfg(feature = "node-groups")]
8248impl NodeGroups {
8249    /// Returns a builder for [NodeGroups].
8250    ///
8251    /// ```
8252    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8253    /// # use google_cloud_compute_v1::client::NodeGroups;
8254    /// let client = NodeGroups::builder().build().await?;
8255    /// # Ok(()) }
8256    /// ```
8257    pub fn builder() -> super::builder::node_groups::ClientBuilder {
8258        crate::new_client_builder(super::builder::node_groups::client::Factory)
8259    }
8260
8261    /// Creates a new client from the provided stub.
8262    ///
8263    /// The most common case for calling this function is in tests mocking the
8264    /// client's behavior.
8265    pub fn from_stub<T>(stub: T) -> Self
8266    where
8267        T: super::stub::NodeGroups + 'static,
8268    {
8269        Self {
8270            inner: std::sync::Arc::new(stub),
8271        }
8272    }
8273
8274    pub(crate) async fn new(
8275        config: gaxi::options::ClientConfig,
8276    ) -> crate::ClientBuilderResult<Self> {
8277        let inner = Self::build_inner(config).await?;
8278        Ok(Self { inner })
8279    }
8280
8281    async fn build_inner(
8282        conf: gaxi::options::ClientConfig,
8283    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NodeGroups>> {
8284        if gaxi::options::tracing_enabled(&conf) {
8285            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8286        }
8287        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8288    }
8289
8290    async fn build_transport(
8291        conf: gaxi::options::ClientConfig,
8292    ) -> crate::ClientBuilderResult<impl super::stub::NodeGroups> {
8293        super::transport::NodeGroups::new(conf).await
8294    }
8295
8296    async fn build_with_tracing(
8297        conf: gaxi::options::ClientConfig,
8298    ) -> crate::ClientBuilderResult<impl super::stub::NodeGroups> {
8299        Self::build_transport(conf)
8300            .await
8301            .map(super::tracing::NodeGroups::new)
8302    }
8303
8304    /// Adds specified number of nodes to the node group.
8305    pub fn add_nodes(&self) -> super::builder::node_groups::AddNodes {
8306        super::builder::node_groups::AddNodes::new(self.inner.clone())
8307    }
8308
8309    /// Retrieves an aggregated list of node groups.
8310    /// Note: use nodeGroups.listNodes for more details about each group.
8311    ///
8312    /// To prevent failure, Google recommends that you set the
8313    /// `returnPartialSuccess` parameter to `true`.
8314    pub fn aggregated_list(&self) -> super::builder::node_groups::AggregatedList {
8315        super::builder::node_groups::AggregatedList::new(self.inner.clone())
8316    }
8317
8318    /// Deletes the specified NodeGroup resource.
8319    pub fn delete(&self) -> super::builder::node_groups::Delete {
8320        super::builder::node_groups::Delete::new(self.inner.clone())
8321    }
8322
8323    /// Deletes specified nodes from the node group.
8324    pub fn delete_nodes(&self) -> super::builder::node_groups::DeleteNodes {
8325        super::builder::node_groups::DeleteNodes::new(self.inner.clone())
8326    }
8327
8328    /// Returns the specified NodeGroup. Get a list of available NodeGroups
8329    /// by making a list() request.
8330    /// Note: the "nodes" field should not be used. Use nodeGroups.listNodes
8331    /// instead.
8332    pub fn get(&self) -> super::builder::node_groups::Get {
8333        super::builder::node_groups::Get::new(self.inner.clone())
8334    }
8335
8336    /// Gets the access control policy for a resource. May be empty if no such
8337    /// policy or resource exists.
8338    pub fn get_iam_policy(&self) -> super::builder::node_groups::GetIamPolicy {
8339        super::builder::node_groups::GetIamPolicy::new(self.inner.clone())
8340    }
8341
8342    /// Creates a NodeGroup resource in the specified project using the data
8343    /// included in the request.
8344    pub fn insert(&self) -> super::builder::node_groups::Insert {
8345        super::builder::node_groups::Insert::new(self.inner.clone())
8346    }
8347
8348    /// Retrieves a list of node groups available to the specified project.
8349    /// Note: use nodeGroups.listNodes for more details about each group.
8350    pub fn list(&self) -> super::builder::node_groups::List {
8351        super::builder::node_groups::List::new(self.inner.clone())
8352    }
8353
8354    /// Lists nodes in the node group.
8355    pub fn list_nodes(&self) -> super::builder::node_groups::ListNodes {
8356        super::builder::node_groups::ListNodes::new(self.inner.clone())
8357    }
8358
8359    /// Updates the specified node group.
8360    pub fn patch(&self) -> super::builder::node_groups::Patch {
8361        super::builder::node_groups::Patch::new(self.inner.clone())
8362    }
8363
8364    /// Perform maintenance on a subset of nodes in the node group.
8365    pub fn perform_maintenance(&self) -> super::builder::node_groups::PerformMaintenance {
8366        super::builder::node_groups::PerformMaintenance::new(self.inner.clone())
8367    }
8368
8369    /// Sets the access control policy on the specified resource.
8370    /// Replaces any existing policy.
8371    pub fn set_iam_policy(&self) -> super::builder::node_groups::SetIamPolicy {
8372        super::builder::node_groups::SetIamPolicy::new(self.inner.clone())
8373    }
8374
8375    /// Updates the node template of the node group.
8376    pub fn set_node_template(&self) -> super::builder::node_groups::SetNodeTemplate {
8377        super::builder::node_groups::SetNodeTemplate::new(self.inner.clone())
8378    }
8379
8380    /// Simulates maintenance event on specified nodes from the node group.
8381    pub fn simulate_maintenance_event(
8382        &self,
8383    ) -> super::builder::node_groups::SimulateMaintenanceEvent {
8384        super::builder::node_groups::SimulateMaintenanceEvent::new(self.inner.clone())
8385    }
8386
8387    /// Returns permissions that a caller has on the specified resource.
8388    pub fn test_iam_permissions(&self) -> super::builder::node_groups::TestIamPermissions {
8389        super::builder::node_groups::TestIamPermissions::new(self.inner.clone())
8390    }
8391
8392    /// Retrieves the specified zone-specific Operations resource.
8393    pub fn get_operation(&self) -> super::builder::node_groups::GetOperation {
8394        super::builder::node_groups::GetOperation::new(self.inner.clone())
8395    }
8396}
8397
8398/// Implements a client for the Google Compute Engine API.
8399///
8400/// # Example
8401/// ```
8402/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8403/// # use google_cloud_compute_v1::client::NodeTemplates;
8404/// let client = NodeTemplates::builder().build().await?;
8405/// // use `client` to make requests to the Google Compute Engine API.
8406/// # Ok(()) }
8407/// ```
8408///
8409/// # Service Description
8410///
8411/// Service for the `nodeTemplates` resource.
8412///
8413/// # Configuration
8414///
8415/// To configure `NodeTemplates` use the `with_*` methods in the type returned
8416/// by [builder()][NodeTemplates::builder]. The default configuration should
8417/// work for most applications. Common configuration changes include
8418///
8419/// * [with_endpoint()]: by default this client uses the global default endpoint
8420///   (`https://compute.googleapis.com`). Applications using regional
8421///   endpoints or running in restricted networks (e.g. a network configured
8422//    with [Private Google Access with VPC Service Controls]) may want to
8423///   override this default.
8424/// * [with_credentials()]: by default this client uses
8425///   [Application Default Credentials]. Applications using custom
8426///   authentication may need to override this default.
8427///
8428/// [with_endpoint()]: super::builder::node_templates::ClientBuilder::with_endpoint
8429/// [with_credentials()]: super::builder::node_templates::ClientBuilder::credentials
8430/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8431/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8432///
8433/// # Pooling and Cloning
8434///
8435/// `NodeTemplates` holds a connection pool internally, it is advised to
8436/// create one and the reuse it.  You do not need to wrap `NodeTemplates` in
8437/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8438/// already uses an `Arc` internally.
8439#[cfg(feature = "node-templates")]
8440#[cfg_attr(docsrs, doc(cfg(feature = "node-templates")))]
8441#[derive(Clone, Debug)]
8442pub struct NodeTemplates {
8443    inner: std::sync::Arc<dyn super::stub::dynamic::NodeTemplates>,
8444}
8445
8446#[cfg(feature = "node-templates")]
8447impl NodeTemplates {
8448    /// Returns a builder for [NodeTemplates].
8449    ///
8450    /// ```
8451    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8452    /// # use google_cloud_compute_v1::client::NodeTemplates;
8453    /// let client = NodeTemplates::builder().build().await?;
8454    /// # Ok(()) }
8455    /// ```
8456    pub fn builder() -> super::builder::node_templates::ClientBuilder {
8457        crate::new_client_builder(super::builder::node_templates::client::Factory)
8458    }
8459
8460    /// Creates a new client from the provided stub.
8461    ///
8462    /// The most common case for calling this function is in tests mocking the
8463    /// client's behavior.
8464    pub fn from_stub<T>(stub: T) -> Self
8465    where
8466        T: super::stub::NodeTemplates + 'static,
8467    {
8468        Self {
8469            inner: std::sync::Arc::new(stub),
8470        }
8471    }
8472
8473    pub(crate) async fn new(
8474        config: gaxi::options::ClientConfig,
8475    ) -> crate::ClientBuilderResult<Self> {
8476        let inner = Self::build_inner(config).await?;
8477        Ok(Self { inner })
8478    }
8479
8480    async fn build_inner(
8481        conf: gaxi::options::ClientConfig,
8482    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NodeTemplates>> {
8483        if gaxi::options::tracing_enabled(&conf) {
8484            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8485        }
8486        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8487    }
8488
8489    async fn build_transport(
8490        conf: gaxi::options::ClientConfig,
8491    ) -> crate::ClientBuilderResult<impl super::stub::NodeTemplates> {
8492        super::transport::NodeTemplates::new(conf).await
8493    }
8494
8495    async fn build_with_tracing(
8496        conf: gaxi::options::ClientConfig,
8497    ) -> crate::ClientBuilderResult<impl super::stub::NodeTemplates> {
8498        Self::build_transport(conf)
8499            .await
8500            .map(super::tracing::NodeTemplates::new)
8501    }
8502
8503    /// Retrieves an aggregated list of node templates.
8504    ///
8505    /// To prevent failure, Google recommends that you set the
8506    /// `returnPartialSuccess` parameter to `true`.
8507    pub fn aggregated_list(&self) -> super::builder::node_templates::AggregatedList {
8508        super::builder::node_templates::AggregatedList::new(self.inner.clone())
8509    }
8510
8511    /// Deletes the specified NodeTemplate resource.
8512    pub fn delete(&self) -> super::builder::node_templates::Delete {
8513        super::builder::node_templates::Delete::new(self.inner.clone())
8514    }
8515
8516    /// Returns the specified node template.
8517    pub fn get(&self) -> super::builder::node_templates::Get {
8518        super::builder::node_templates::Get::new(self.inner.clone())
8519    }
8520
8521    /// Gets the access control policy for a resource. May be empty if no such
8522    /// policy or resource exists.
8523    pub fn get_iam_policy(&self) -> super::builder::node_templates::GetIamPolicy {
8524        super::builder::node_templates::GetIamPolicy::new(self.inner.clone())
8525    }
8526
8527    /// Creates a NodeTemplate resource in the specified project using the data
8528    /// included in the request.
8529    pub fn insert(&self) -> super::builder::node_templates::Insert {
8530        super::builder::node_templates::Insert::new(self.inner.clone())
8531    }
8532
8533    /// Retrieves a list of node templates available to the specified
8534    /// project.
8535    pub fn list(&self) -> super::builder::node_templates::List {
8536        super::builder::node_templates::List::new(self.inner.clone())
8537    }
8538
8539    /// Sets the access control policy on the specified resource.
8540    /// Replaces any existing policy.
8541    pub fn set_iam_policy(&self) -> super::builder::node_templates::SetIamPolicy {
8542        super::builder::node_templates::SetIamPolicy::new(self.inner.clone())
8543    }
8544
8545    /// Returns permissions that a caller has on the specified resource.
8546    pub fn test_iam_permissions(&self) -> super::builder::node_templates::TestIamPermissions {
8547        super::builder::node_templates::TestIamPermissions::new(self.inner.clone())
8548    }
8549
8550    /// Retrieves the specified region-specific Operations resource.
8551    pub fn get_operation(&self) -> super::builder::node_templates::GetOperation {
8552        super::builder::node_templates::GetOperation::new(self.inner.clone())
8553    }
8554}
8555
8556/// Implements a client for the Google Compute Engine API.
8557///
8558/// # Example
8559/// ```
8560/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8561/// # use google_cloud_compute_v1::client::NodeTypes;
8562/// let client = NodeTypes::builder().build().await?;
8563/// // use `client` to make requests to the Google Compute Engine API.
8564/// # Ok(()) }
8565/// ```
8566///
8567/// # Service Description
8568///
8569/// Service for the `nodeTypes` resource.
8570///
8571/// # Configuration
8572///
8573/// To configure `NodeTypes` use the `with_*` methods in the type returned
8574/// by [builder()][NodeTypes::builder]. The default configuration should
8575/// work for most applications. Common configuration changes include
8576///
8577/// * [with_endpoint()]: by default this client uses the global default endpoint
8578///   (`https://compute.googleapis.com`). Applications using regional
8579///   endpoints or running in restricted networks (e.g. a network configured
8580//    with [Private Google Access with VPC Service Controls]) may want to
8581///   override this default.
8582/// * [with_credentials()]: by default this client uses
8583///   [Application Default Credentials]. Applications using custom
8584///   authentication may need to override this default.
8585///
8586/// [with_endpoint()]: super::builder::node_types::ClientBuilder::with_endpoint
8587/// [with_credentials()]: super::builder::node_types::ClientBuilder::credentials
8588/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8589/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8590///
8591/// # Pooling and Cloning
8592///
8593/// `NodeTypes` holds a connection pool internally, it is advised to
8594/// create one and the reuse it.  You do not need to wrap `NodeTypes` in
8595/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8596/// already uses an `Arc` internally.
8597#[cfg(feature = "node-types")]
8598#[cfg_attr(docsrs, doc(cfg(feature = "node-types")))]
8599#[derive(Clone, Debug)]
8600pub struct NodeTypes {
8601    inner: std::sync::Arc<dyn super::stub::dynamic::NodeTypes>,
8602}
8603
8604#[cfg(feature = "node-types")]
8605impl NodeTypes {
8606    /// Returns a builder for [NodeTypes].
8607    ///
8608    /// ```
8609    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8610    /// # use google_cloud_compute_v1::client::NodeTypes;
8611    /// let client = NodeTypes::builder().build().await?;
8612    /// # Ok(()) }
8613    /// ```
8614    pub fn builder() -> super::builder::node_types::ClientBuilder {
8615        crate::new_client_builder(super::builder::node_types::client::Factory)
8616    }
8617
8618    /// Creates a new client from the provided stub.
8619    ///
8620    /// The most common case for calling this function is in tests mocking the
8621    /// client's behavior.
8622    pub fn from_stub<T>(stub: T) -> Self
8623    where
8624        T: super::stub::NodeTypes + 'static,
8625    {
8626        Self {
8627            inner: std::sync::Arc::new(stub),
8628        }
8629    }
8630
8631    pub(crate) async fn new(
8632        config: gaxi::options::ClientConfig,
8633    ) -> crate::ClientBuilderResult<Self> {
8634        let inner = Self::build_inner(config).await?;
8635        Ok(Self { inner })
8636    }
8637
8638    async fn build_inner(
8639        conf: gaxi::options::ClientConfig,
8640    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NodeTypes>> {
8641        if gaxi::options::tracing_enabled(&conf) {
8642            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8643        }
8644        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8645    }
8646
8647    async fn build_transport(
8648        conf: gaxi::options::ClientConfig,
8649    ) -> crate::ClientBuilderResult<impl super::stub::NodeTypes> {
8650        super::transport::NodeTypes::new(conf).await
8651    }
8652
8653    async fn build_with_tracing(
8654        conf: gaxi::options::ClientConfig,
8655    ) -> crate::ClientBuilderResult<impl super::stub::NodeTypes> {
8656        Self::build_transport(conf)
8657            .await
8658            .map(super::tracing::NodeTypes::new)
8659    }
8660
8661    /// Retrieves an aggregated list of node types.
8662    ///
8663    /// To prevent failure, Google recommends that you set the
8664    /// `returnPartialSuccess` parameter to `true`.
8665    pub fn aggregated_list(&self) -> super::builder::node_types::AggregatedList {
8666        super::builder::node_types::AggregatedList::new(self.inner.clone())
8667    }
8668
8669    /// Returns the specified node type.
8670    pub fn get(&self) -> super::builder::node_types::Get {
8671        super::builder::node_types::Get::new(self.inner.clone())
8672    }
8673
8674    /// Retrieves a list of node types available to the specified
8675    /// project.
8676    pub fn list(&self) -> super::builder::node_types::List {
8677        super::builder::node_types::List::new(self.inner.clone())
8678    }
8679}
8680
8681/// Implements a client for the Google Compute Engine API.
8682///
8683/// # Example
8684/// ```
8685/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8686/// # use google_cloud_compute_v1::client::OrganizationSecurityPolicies;
8687/// let client = OrganizationSecurityPolicies::builder().build().await?;
8688/// // use `client` to make requests to the Google Compute Engine API.
8689/// # Ok(()) }
8690/// ```
8691///
8692/// # Service Description
8693///
8694/// Service for the `organizationSecurityPolicies` resource.
8695///
8696/// # Configuration
8697///
8698/// To configure `OrganizationSecurityPolicies` use the `with_*` methods in the type returned
8699/// by [builder()][OrganizationSecurityPolicies::builder]. The default configuration should
8700/// work for most applications. Common configuration changes include
8701///
8702/// * [with_endpoint()]: by default this client uses the global default endpoint
8703///   (`https://compute.googleapis.com`). Applications using regional
8704///   endpoints or running in restricted networks (e.g. a network configured
8705//    with [Private Google Access with VPC Service Controls]) may want to
8706///   override this default.
8707/// * [with_credentials()]: by default this client uses
8708///   [Application Default Credentials]. Applications using custom
8709///   authentication may need to override this default.
8710///
8711/// [with_endpoint()]: super::builder::organization_security_policies::ClientBuilder::with_endpoint
8712/// [with_credentials()]: super::builder::organization_security_policies::ClientBuilder::credentials
8713/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8714/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8715///
8716/// # Pooling and Cloning
8717///
8718/// `OrganizationSecurityPolicies` holds a connection pool internally, it is advised to
8719/// create one and the reuse it.  You do not need to wrap `OrganizationSecurityPolicies` in
8720/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8721/// already uses an `Arc` internally.
8722#[cfg(feature = "organization-security-policies")]
8723#[cfg_attr(docsrs, doc(cfg(feature = "organization-security-policies")))]
8724#[derive(Clone, Debug)]
8725pub struct OrganizationSecurityPolicies {
8726    inner: std::sync::Arc<dyn super::stub::dynamic::OrganizationSecurityPolicies>,
8727}
8728
8729#[cfg(feature = "organization-security-policies")]
8730impl OrganizationSecurityPolicies {
8731    /// Returns a builder for [OrganizationSecurityPolicies].
8732    ///
8733    /// ```
8734    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8735    /// # use google_cloud_compute_v1::client::OrganizationSecurityPolicies;
8736    /// let client = OrganizationSecurityPolicies::builder().build().await?;
8737    /// # Ok(()) }
8738    /// ```
8739    pub fn builder() -> super::builder::organization_security_policies::ClientBuilder {
8740        crate::new_client_builder(super::builder::organization_security_policies::client::Factory)
8741    }
8742
8743    /// Creates a new client from the provided stub.
8744    ///
8745    /// The most common case for calling this function is in tests mocking the
8746    /// client's behavior.
8747    pub fn from_stub<T>(stub: T) -> Self
8748    where
8749        T: super::stub::OrganizationSecurityPolicies + 'static,
8750    {
8751        Self {
8752            inner: std::sync::Arc::new(stub),
8753        }
8754    }
8755
8756    pub(crate) async fn new(
8757        config: gaxi::options::ClientConfig,
8758    ) -> crate::ClientBuilderResult<Self> {
8759        let inner = Self::build_inner(config).await?;
8760        Ok(Self { inner })
8761    }
8762
8763    async fn build_inner(
8764        conf: gaxi::options::ClientConfig,
8765    ) -> crate::ClientBuilderResult<
8766        std::sync::Arc<dyn super::stub::dynamic::OrganizationSecurityPolicies>,
8767    > {
8768        if gaxi::options::tracing_enabled(&conf) {
8769            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8770        }
8771        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8772    }
8773
8774    async fn build_transport(
8775        conf: gaxi::options::ClientConfig,
8776    ) -> crate::ClientBuilderResult<impl super::stub::OrganizationSecurityPolicies> {
8777        super::transport::OrganizationSecurityPolicies::new(conf).await
8778    }
8779
8780    async fn build_with_tracing(
8781        conf: gaxi::options::ClientConfig,
8782    ) -> crate::ClientBuilderResult<impl super::stub::OrganizationSecurityPolicies> {
8783        Self::build_transport(conf)
8784            .await
8785            .map(super::tracing::OrganizationSecurityPolicies::new)
8786    }
8787
8788    /// Inserts an association for the specified security policy.
8789    ///
8790    /// This has billing implications.  Projects in the hierarchy with effective
8791    /// hierarchical security policies will be automatically enrolled into Cloud
8792    /// Armor Enterprise if not already enrolled.
8793    ///
8794    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8795    /// versions of this API were used to modify firewall policies. This usage is
8796    /// now disabled for most organizations. Use firewallPolicies.addAssociation
8797    /// instead.
8798    pub fn add_association(
8799        &self,
8800    ) -> super::builder::organization_security_policies::AddAssociation {
8801        super::builder::organization_security_policies::AddAssociation::new(self.inner.clone())
8802    }
8803
8804    /// Inserts a rule into a security policy.
8805    ///
8806    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8807    /// versions of this API were used to modify firewall policies. This usage is
8808    /// now disabled for most organizations. Use firewallPolicies.addRule instead.
8809    pub fn add_rule(&self) -> super::builder::organization_security_policies::AddRule {
8810        super::builder::organization_security_policies::AddRule::new(self.inner.clone())
8811    }
8812
8813    /// Copies rules to the specified security policy.
8814    ///
8815    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8816    /// versions of this API were used to modify firewall policies. This usage is
8817    /// now disabled for most organizations. Use firewallPolicies.cloneRules
8818    /// instead.
8819    pub fn copy_rules(&self) -> super::builder::organization_security_policies::CopyRules {
8820        super::builder::organization_security_policies::CopyRules::new(self.inner.clone())
8821    }
8822
8823    /// Deletes the specified policy.
8824    ///
8825    /// Use this API to remove Cloud Armor policies. Previously, alpha and beta
8826    /// versions of this API were used to remove firewall policies. This usage is
8827    /// now disabled for most organizations. Use firewallPolicies.delete instead.
8828    pub fn delete(&self) -> super::builder::organization_security_policies::Delete {
8829        super::builder::organization_security_policies::Delete::new(self.inner.clone())
8830    }
8831
8832    /// List all of the ordered rules present in a single specified policy.
8833    ///
8834    /// Use this API to read Cloud Armor policies. Previously, alpha and beta
8835    /// versions of this API were used to read firewall policies. This usage is now
8836    /// disabled for most organizations. Use firewallPolicies.get instead.
8837    pub fn get(&self) -> super::builder::organization_security_policies::Get {
8838        super::builder::organization_security_policies::Get::new(self.inner.clone())
8839    }
8840
8841    /// Gets an association with the specified name.
8842    ///
8843    /// Use this API to read Cloud Armor policies. Previously, alpha and beta
8844    /// versions of this API were used to read firewall policies. This usage is
8845    /// now disabled for most organizations. Use firewallPolicies.getAssociation
8846    /// instead.
8847    pub fn get_association(
8848        &self,
8849    ) -> super::builder::organization_security_policies::GetAssociation {
8850        super::builder::organization_security_policies::GetAssociation::new(self.inner.clone())
8851    }
8852
8853    /// Gets a rule at the specified priority.
8854    ///
8855    /// Use this API to read Cloud Armor policies. Previously, alpha and beta
8856    /// versions of this API were used to read firewall policies. This usage is now
8857    /// disabled for most organizations. Use firewallPolicies.getRule instead.
8858    pub fn get_rule(&self) -> super::builder::organization_security_policies::GetRule {
8859        super::builder::organization_security_policies::GetRule::new(self.inner.clone())
8860    }
8861
8862    /// Creates a new policy in the specified organization using the data included
8863    /// in the request.
8864    ///
8865    /// Use this API to add Cloud Armor policies. Previously, alpha and beta
8866    /// versions of this API were used to add firewall policies. This usage is now
8867    /// disabled for most organizations. Use firewallPolicies.insert instead.
8868    pub fn insert(&self) -> super::builder::organization_security_policies::Insert {
8869        super::builder::organization_security_policies::Insert::new(self.inner.clone())
8870    }
8871
8872    /// List all the policies that have been configured for the specified
8873    /// organization.
8874    ///
8875    /// Use this API to read Cloud Armor policies. Previously, alpha and beta
8876    /// versions of this API were used to read firewall policies. This usage is now
8877    /// disabled for most organizations. Use firewallPolicies.list instead.
8878    pub fn list(&self) -> super::builder::organization_security_policies::List {
8879        super::builder::organization_security_policies::List::new(self.inner.clone())
8880    }
8881
8882    /// Lists associations of a specified target, i.e., organization or folder.
8883    ///
8884    /// Use this API to read Cloud Armor policies. Previously, alpha and beta
8885    /// versions of this API were used to read firewall policies. This usage is
8886    /// now disabled for most organizations. Use firewallPolicies.listAssociations
8887    /// instead.
8888    pub fn list_associations(
8889        &self,
8890    ) -> super::builder::organization_security_policies::ListAssociations {
8891        super::builder::organization_security_policies::ListAssociations::new(self.inner.clone())
8892    }
8893
8894    /// Gets the current list of preconfigured Web Application Firewall (WAF)
8895    /// expressions.
8896    pub fn list_preconfigured_expression_sets(
8897        &self,
8898    ) -> super::builder::organization_security_policies::ListPreconfiguredExpressionSets {
8899        super::builder::organization_security_policies::ListPreconfiguredExpressionSets::new(
8900            self.inner.clone(),
8901        )
8902    }
8903
8904    /// Moves the specified security policy.
8905    ///
8906    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8907    /// versions of this API were used to modify firewall policies. This usage is
8908    /// now disabled for most organizations. Use firewallPolicies.move instead.
8909    pub fn r#move(&self) -> super::builder::organization_security_policies::Move {
8910        super::builder::organization_security_policies::Move::new(self.inner.clone())
8911    }
8912
8913    /// Patches the specified policy with the data included in the request.
8914    ///
8915    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8916    /// versions of this API were used to modify firewall policies. This usage is
8917    /// now disabled for most organizations. Use firewallPolicies.patch instead.
8918    pub fn patch(&self) -> super::builder::organization_security_policies::Patch {
8919        super::builder::organization_security_policies::Patch::new(self.inner.clone())
8920    }
8921
8922    /// Patches a rule at the specified priority.
8923    ///
8924    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8925    /// versions of this API were used to modify firewall policies. This usage is
8926    /// now disabled for most organizations. Use firewallPolicies.patchRule
8927    /// instead.
8928    pub fn patch_rule(&self) -> super::builder::organization_security_policies::PatchRule {
8929        super::builder::organization_security_policies::PatchRule::new(self.inner.clone())
8930    }
8931
8932    /// Removes an association for the specified security policy.
8933    ///
8934    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8935    /// versions of this API were used to modify firewall policies. This usage is
8936    /// now disabled for most organizations. Use firewallPolicies.removeAssociation
8937    /// instead.
8938    pub fn remove_association(
8939        &self,
8940    ) -> super::builder::organization_security_policies::RemoveAssociation {
8941        super::builder::organization_security_policies::RemoveAssociation::new(self.inner.clone())
8942    }
8943
8944    /// Deletes a rule at the specified priority.
8945    ///
8946    /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8947    /// versions of this API were used to modify firewall policies. This usage is
8948    /// now disabled for most organizations. Use firewallPolicies.removeRule
8949    /// instead.
8950    pub fn remove_rule(&self) -> super::builder::organization_security_policies::RemoveRule {
8951        super::builder::organization_security_policies::RemoveRule::new(self.inner.clone())
8952    }
8953
8954    /// Retrieves the specified Operations resource. Gets a list of operations
8955    /// by making a `list()` request.
8956    pub fn get_operation(&self) -> super::builder::organization_security_policies::GetOperation {
8957        super::builder::organization_security_policies::GetOperation::new(self.inner.clone())
8958    }
8959}
8960
8961/// Implements a client for the Google Compute Engine API.
8962///
8963/// # Example
8964/// ```
8965/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8966/// # use google_cloud_compute_v1::client::PacketMirrorings;
8967/// let client = PacketMirrorings::builder().build().await?;
8968/// // use `client` to make requests to the Google Compute Engine API.
8969/// # Ok(()) }
8970/// ```
8971///
8972/// # Service Description
8973///
8974/// Service for the `packetMirrorings` resource.
8975///
8976/// # Configuration
8977///
8978/// To configure `PacketMirrorings` use the `with_*` methods in the type returned
8979/// by [builder()][PacketMirrorings::builder]. The default configuration should
8980/// work for most applications. Common configuration changes include
8981///
8982/// * [with_endpoint()]: by default this client uses the global default endpoint
8983///   (`https://compute.googleapis.com`). Applications using regional
8984///   endpoints or running in restricted networks (e.g. a network configured
8985//    with [Private Google Access with VPC Service Controls]) may want to
8986///   override this default.
8987/// * [with_credentials()]: by default this client uses
8988///   [Application Default Credentials]. Applications using custom
8989///   authentication may need to override this default.
8990///
8991/// [with_endpoint()]: super::builder::packet_mirrorings::ClientBuilder::with_endpoint
8992/// [with_credentials()]: super::builder::packet_mirrorings::ClientBuilder::credentials
8993/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8994/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8995///
8996/// # Pooling and Cloning
8997///
8998/// `PacketMirrorings` holds a connection pool internally, it is advised to
8999/// create one and the reuse it.  You do not need to wrap `PacketMirrorings` in
9000/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9001/// already uses an `Arc` internally.
9002#[cfg(feature = "packet-mirrorings")]
9003#[cfg_attr(docsrs, doc(cfg(feature = "packet-mirrorings")))]
9004#[derive(Clone, Debug)]
9005pub struct PacketMirrorings {
9006    inner: std::sync::Arc<dyn super::stub::dynamic::PacketMirrorings>,
9007}
9008
9009#[cfg(feature = "packet-mirrorings")]
9010impl PacketMirrorings {
9011    /// Returns a builder for [PacketMirrorings].
9012    ///
9013    /// ```
9014    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9015    /// # use google_cloud_compute_v1::client::PacketMirrorings;
9016    /// let client = PacketMirrorings::builder().build().await?;
9017    /// # Ok(()) }
9018    /// ```
9019    pub fn builder() -> super::builder::packet_mirrorings::ClientBuilder {
9020        crate::new_client_builder(super::builder::packet_mirrorings::client::Factory)
9021    }
9022
9023    /// Creates a new client from the provided stub.
9024    ///
9025    /// The most common case for calling this function is in tests mocking the
9026    /// client's behavior.
9027    pub fn from_stub<T>(stub: T) -> Self
9028    where
9029        T: super::stub::PacketMirrorings + 'static,
9030    {
9031        Self {
9032            inner: std::sync::Arc::new(stub),
9033        }
9034    }
9035
9036    pub(crate) async fn new(
9037        config: gaxi::options::ClientConfig,
9038    ) -> crate::ClientBuilderResult<Self> {
9039        let inner = Self::build_inner(config).await?;
9040        Ok(Self { inner })
9041    }
9042
9043    async fn build_inner(
9044        conf: gaxi::options::ClientConfig,
9045    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::PacketMirrorings>>
9046    {
9047        if gaxi::options::tracing_enabled(&conf) {
9048            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9049        }
9050        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9051    }
9052
9053    async fn build_transport(
9054        conf: gaxi::options::ClientConfig,
9055    ) -> crate::ClientBuilderResult<impl super::stub::PacketMirrorings> {
9056        super::transport::PacketMirrorings::new(conf).await
9057    }
9058
9059    async fn build_with_tracing(
9060        conf: gaxi::options::ClientConfig,
9061    ) -> crate::ClientBuilderResult<impl super::stub::PacketMirrorings> {
9062        Self::build_transport(conf)
9063            .await
9064            .map(super::tracing::PacketMirrorings::new)
9065    }
9066
9067    /// Retrieves an aggregated list of packetMirrorings.
9068    ///
9069    /// To prevent failure, Google recommends that you set the
9070    /// `returnPartialSuccess` parameter to `true`.
9071    pub fn aggregated_list(&self) -> super::builder::packet_mirrorings::AggregatedList {
9072        super::builder::packet_mirrorings::AggregatedList::new(self.inner.clone())
9073    }
9074
9075    /// Deletes the specified PacketMirroring resource.
9076    pub fn delete(&self) -> super::builder::packet_mirrorings::Delete {
9077        super::builder::packet_mirrorings::Delete::new(self.inner.clone())
9078    }
9079
9080    /// Returns the specified PacketMirroring resource.
9081    pub fn get(&self) -> super::builder::packet_mirrorings::Get {
9082        super::builder::packet_mirrorings::Get::new(self.inner.clone())
9083    }
9084
9085    /// Creates a PacketMirroring resource in the specified project and region
9086    /// using the data included in the request.
9087    pub fn insert(&self) -> super::builder::packet_mirrorings::Insert {
9088        super::builder::packet_mirrorings::Insert::new(self.inner.clone())
9089    }
9090
9091    /// Retrieves a list of PacketMirroring resources available to the specified
9092    /// project and region.
9093    pub fn list(&self) -> super::builder::packet_mirrorings::List {
9094        super::builder::packet_mirrorings::List::new(self.inner.clone())
9095    }
9096
9097    /// Patches the specified PacketMirroring resource with the data included in
9098    /// the request. This method supportsPATCH
9099    /// semantics and usesJSON merge
9100    /// patch format and processing rules.
9101    pub fn patch(&self) -> super::builder::packet_mirrorings::Patch {
9102        super::builder::packet_mirrorings::Patch::new(self.inner.clone())
9103    }
9104
9105    /// Returns permissions that a caller has on the specified resource.
9106    pub fn test_iam_permissions(&self) -> super::builder::packet_mirrorings::TestIamPermissions {
9107        super::builder::packet_mirrorings::TestIamPermissions::new(self.inner.clone())
9108    }
9109
9110    /// Retrieves the specified region-specific Operations resource.
9111    pub fn get_operation(&self) -> super::builder::packet_mirrorings::GetOperation {
9112        super::builder::packet_mirrorings::GetOperation::new(self.inner.clone())
9113    }
9114}
9115
9116/// Implements a client for the Google Compute Engine API.
9117///
9118/// # Example
9119/// ```
9120/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9121/// # use google_cloud_compute_v1::client::PreviewFeatures;
9122/// let client = PreviewFeatures::builder().build().await?;
9123/// // use `client` to make requests to the Google Compute Engine API.
9124/// # Ok(()) }
9125/// ```
9126///
9127/// # Service Description
9128///
9129/// Service for the `previewFeatures` resource.
9130///
9131/// # Configuration
9132///
9133/// To configure `PreviewFeatures` use the `with_*` methods in the type returned
9134/// by [builder()][PreviewFeatures::builder]. The default configuration should
9135/// work for most applications. Common configuration changes include
9136///
9137/// * [with_endpoint()]: by default this client uses the global default endpoint
9138///   (`https://compute.googleapis.com`). Applications using regional
9139///   endpoints or running in restricted networks (e.g. a network configured
9140//    with [Private Google Access with VPC Service Controls]) may want to
9141///   override this default.
9142/// * [with_credentials()]: by default this client uses
9143///   [Application Default Credentials]. Applications using custom
9144///   authentication may need to override this default.
9145///
9146/// [with_endpoint()]: super::builder::preview_features::ClientBuilder::with_endpoint
9147/// [with_credentials()]: super::builder::preview_features::ClientBuilder::credentials
9148/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9149/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9150///
9151/// # Pooling and Cloning
9152///
9153/// `PreviewFeatures` holds a connection pool internally, it is advised to
9154/// create one and the reuse it.  You do not need to wrap `PreviewFeatures` in
9155/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9156/// already uses an `Arc` internally.
9157#[cfg(feature = "preview-features")]
9158#[cfg_attr(docsrs, doc(cfg(feature = "preview-features")))]
9159#[derive(Clone, Debug)]
9160pub struct PreviewFeatures {
9161    inner: std::sync::Arc<dyn super::stub::dynamic::PreviewFeatures>,
9162}
9163
9164#[cfg(feature = "preview-features")]
9165impl PreviewFeatures {
9166    /// Returns a builder for [PreviewFeatures].
9167    ///
9168    /// ```
9169    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9170    /// # use google_cloud_compute_v1::client::PreviewFeatures;
9171    /// let client = PreviewFeatures::builder().build().await?;
9172    /// # Ok(()) }
9173    /// ```
9174    pub fn builder() -> super::builder::preview_features::ClientBuilder {
9175        crate::new_client_builder(super::builder::preview_features::client::Factory)
9176    }
9177
9178    /// Creates a new client from the provided stub.
9179    ///
9180    /// The most common case for calling this function is in tests mocking the
9181    /// client's behavior.
9182    pub fn from_stub<T>(stub: T) -> Self
9183    where
9184        T: super::stub::PreviewFeatures + 'static,
9185    {
9186        Self {
9187            inner: std::sync::Arc::new(stub),
9188        }
9189    }
9190
9191    pub(crate) async fn new(
9192        config: gaxi::options::ClientConfig,
9193    ) -> crate::ClientBuilderResult<Self> {
9194        let inner = Self::build_inner(config).await?;
9195        Ok(Self { inner })
9196    }
9197
9198    async fn build_inner(
9199        conf: gaxi::options::ClientConfig,
9200    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::PreviewFeatures>> {
9201        if gaxi::options::tracing_enabled(&conf) {
9202            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9203        }
9204        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9205    }
9206
9207    async fn build_transport(
9208        conf: gaxi::options::ClientConfig,
9209    ) -> crate::ClientBuilderResult<impl super::stub::PreviewFeatures> {
9210        super::transport::PreviewFeatures::new(conf).await
9211    }
9212
9213    async fn build_with_tracing(
9214        conf: gaxi::options::ClientConfig,
9215    ) -> crate::ClientBuilderResult<impl super::stub::PreviewFeatures> {
9216        Self::build_transport(conf)
9217            .await
9218            .map(super::tracing::PreviewFeatures::new)
9219    }
9220
9221    /// Returns the details of the given PreviewFeature.
9222    pub fn get(&self) -> super::builder::preview_features::Get {
9223        super::builder::preview_features::Get::new(self.inner.clone())
9224    }
9225
9226    /// Returns the details of the given PreviewFeature.
9227    pub fn list(&self) -> super::builder::preview_features::List {
9228        super::builder::preview_features::List::new(self.inner.clone())
9229    }
9230
9231    /// Patches the given PreviewFeature. This method is used to enable or disable
9232    /// a PreviewFeature.
9233    pub fn update(&self) -> super::builder::preview_features::Update {
9234        super::builder::preview_features::Update::new(self.inner.clone())
9235    }
9236
9237    /// Retrieves the specified Operations resource.
9238    pub fn get_operation(&self) -> super::builder::preview_features::GetOperation {
9239        super::builder::preview_features::GetOperation::new(self.inner.clone())
9240    }
9241}
9242
9243/// Implements a client for the Google Compute Engine API.
9244///
9245/// # Example
9246/// ```
9247/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9248/// # use google_cloud_compute_v1::client::Projects;
9249/// let client = Projects::builder().build().await?;
9250/// // use `client` to make requests to the Google Compute Engine API.
9251/// # Ok(()) }
9252/// ```
9253///
9254/// # Service Description
9255///
9256/// Service for the `projects` resource.
9257///
9258/// # Configuration
9259///
9260/// To configure `Projects` use the `with_*` methods in the type returned
9261/// by [builder()][Projects::builder]. The default configuration should
9262/// work for most applications. Common configuration changes include
9263///
9264/// * [with_endpoint()]: by default this client uses the global default endpoint
9265///   (`https://compute.googleapis.com`). Applications using regional
9266///   endpoints or running in restricted networks (e.g. a network configured
9267//    with [Private Google Access with VPC Service Controls]) may want to
9268///   override this default.
9269/// * [with_credentials()]: by default this client uses
9270///   [Application Default Credentials]. Applications using custom
9271///   authentication may need to override this default.
9272///
9273/// [with_endpoint()]: super::builder::projects::ClientBuilder::with_endpoint
9274/// [with_credentials()]: super::builder::projects::ClientBuilder::credentials
9275/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9276/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9277///
9278/// # Pooling and Cloning
9279///
9280/// `Projects` holds a connection pool internally, it is advised to
9281/// create one and the reuse it.  You do not need to wrap `Projects` in
9282/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9283/// already uses an `Arc` internally.
9284#[cfg(feature = "projects")]
9285#[cfg_attr(docsrs, doc(cfg(feature = "projects")))]
9286#[derive(Clone, Debug)]
9287pub struct Projects {
9288    inner: std::sync::Arc<dyn super::stub::dynamic::Projects>,
9289}
9290
9291#[cfg(feature = "projects")]
9292impl Projects {
9293    /// Returns a builder for [Projects].
9294    ///
9295    /// ```
9296    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9297    /// # use google_cloud_compute_v1::client::Projects;
9298    /// let client = Projects::builder().build().await?;
9299    /// # Ok(()) }
9300    /// ```
9301    pub fn builder() -> super::builder::projects::ClientBuilder {
9302        crate::new_client_builder(super::builder::projects::client::Factory)
9303    }
9304
9305    /// Creates a new client from the provided stub.
9306    ///
9307    /// The most common case for calling this function is in tests mocking the
9308    /// client's behavior.
9309    pub fn from_stub<T>(stub: T) -> Self
9310    where
9311        T: super::stub::Projects + 'static,
9312    {
9313        Self {
9314            inner: std::sync::Arc::new(stub),
9315        }
9316    }
9317
9318    pub(crate) async fn new(
9319        config: gaxi::options::ClientConfig,
9320    ) -> crate::ClientBuilderResult<Self> {
9321        let inner = Self::build_inner(config).await?;
9322        Ok(Self { inner })
9323    }
9324
9325    async fn build_inner(
9326        conf: gaxi::options::ClientConfig,
9327    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Projects>> {
9328        if gaxi::options::tracing_enabled(&conf) {
9329            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9330        }
9331        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9332    }
9333
9334    async fn build_transport(
9335        conf: gaxi::options::ClientConfig,
9336    ) -> crate::ClientBuilderResult<impl super::stub::Projects> {
9337        super::transport::Projects::new(conf).await
9338    }
9339
9340    async fn build_with_tracing(
9341        conf: gaxi::options::ClientConfig,
9342    ) -> crate::ClientBuilderResult<impl super::stub::Projects> {
9343        Self::build_transport(conf)
9344            .await
9345            .map(super::tracing::Projects::new)
9346    }
9347
9348    /// Disable this project as a shared VPC host project.
9349    pub fn disable_xpn_host(&self) -> super::builder::projects::DisableXpnHost {
9350        super::builder::projects::DisableXpnHost::new(self.inner.clone())
9351    }
9352
9353    /// Disable a service resource (also known as service project) associated with
9354    /// this host project.
9355    pub fn disable_xpn_resource(&self) -> super::builder::projects::DisableXpnResource {
9356        super::builder::projects::DisableXpnResource::new(self.inner.clone())
9357    }
9358
9359    /// Enable this project as a shared VPC host project.
9360    pub fn enable_xpn_host(&self) -> super::builder::projects::EnableXpnHost {
9361        super::builder::projects::EnableXpnHost::new(self.inner.clone())
9362    }
9363
9364    /// Enable service resource (a.k.a service project) for a host project, so that
9365    /// subnets in the host project can be used by instances in the service
9366    /// project.
9367    pub fn enable_xpn_resource(&self) -> super::builder::projects::EnableXpnResource {
9368        super::builder::projects::EnableXpnResource::new(self.inner.clone())
9369    }
9370
9371    /// Returns the specified Project resource.
9372    ///
9373    /// To decrease latency for this method, you can optionally omit any unneeded
9374    /// information from the response by using a field mask. This practice is
9375    /// especially recommended for unused quota information (the `quotas` field).
9376    /// To exclude one or more fields, set your request's `fields` query parameter
9377    /// to only include the fields you need. For example, to only include the `id`
9378    /// and `selfLink` fields, add the query parameter `?fields=id,selfLink` to
9379    /// your request.
9380    pub fn get(&self) -> super::builder::projects::Get {
9381        super::builder::projects::Get::new(self.inner.clone())
9382    }
9383
9384    /// Gets the shared VPC host project that this project links to. May be empty
9385    /// if no link exists.
9386    pub fn get_xpn_host(&self) -> super::builder::projects::GetXpnHost {
9387        super::builder::projects::GetXpnHost::new(self.inner.clone())
9388    }
9389
9390    /// Gets service resources (a.k.a service project) associated with this host
9391    /// project.
9392    pub fn get_xpn_resources(&self) -> super::builder::projects::GetXpnResources {
9393        super::builder::projects::GetXpnResources::new(self.inner.clone())
9394    }
9395
9396    /// Lists all shared VPC host projects visible to the user in an organization.
9397    pub fn list_xpn_hosts(&self) -> super::builder::projects::ListXpnHosts {
9398        super::builder::projects::ListXpnHosts::new(self.inner.clone())
9399    }
9400
9401    /// Moves a persistent disk from one zone to another.
9402    /// *Note*: The moveDisk API will be deprecated on September 29, 2026.
9403    ///
9404    /// Starting September 29, 2025, you can't use the moveDisk API on new
9405    /// projects. To move a disk to a different region or zone, follow the steps in
9406    /// [Change the location of a
9407    /// disk](https://cloud.google.com/compute/docs/disks/migrate-to-hyperdisk#migrate-to-hd).
9408    ///
9409    /// Projects that already use the moveDisk API can continue usage until
9410    /// September 29, 2026.
9411    ///
9412    /// Starting November 1, 2025, API responses will include a warning message in
9413    /// the response body about the upcoming deprecation. You can skip the message
9414    /// to continue using the service without interruption.
9415    #[deprecated]
9416    pub fn move_disk(&self) -> super::builder::projects::MoveDisk {
9417        super::builder::projects::MoveDisk::new(self.inner.clone())
9418    }
9419
9420    /// Moves an instance and its attached persistent disks from one zone to
9421    /// another.
9422    /// *Note*: Moving VMs or disks by using this method might
9423    /// cause unexpected behavior. For more information, see the [known
9424    /// issue](/compute/docs/troubleshooting/known-issues#moving_vms_or_disks_using_the_moveinstance_api_or_the_causes_unexpected_behavior).
9425    /// [Deprecated] This method is deprecated. See [moving instance across
9426    /// zones](/compute/docs/instances/moving-instance-across-zones) instead.
9427    #[deprecated]
9428    pub fn move_instance(&self) -> super::builder::projects::MoveInstance {
9429        super::builder::projects::MoveInstance::new(self.inner.clone())
9430    }
9431
9432    /// Sets the Cloud Armor tier of the project. To set ENTERPRISE or above the
9433    /// billing account of the project must be subscribed to Cloud Armor
9434    /// Enterprise. See Subscribing
9435    /// to Cloud Armor Enterprise for more information.
9436    pub fn set_cloud_armor_tier(&self) -> super::builder::projects::SetCloudArmorTier {
9437        super::builder::projects::SetCloudArmorTier::new(self.inner.clone())
9438    }
9439
9440    /// Sets metadata common to all instances within the specified project using
9441    /// the data included in the request.
9442    pub fn set_common_instance_metadata(
9443        &self,
9444    ) -> super::builder::projects::SetCommonInstanceMetadata {
9445        super::builder::projects::SetCommonInstanceMetadata::new(self.inner.clone())
9446    }
9447
9448    /// Sets the default network tier of the project. The default network tier is
9449    /// used when an address/forwardingRule/instance is created without specifying
9450    /// the network tier field.
9451    pub fn set_default_network_tier(&self) -> super::builder::projects::SetDefaultNetworkTier {
9452        super::builder::projects::SetDefaultNetworkTier::new(self.inner.clone())
9453    }
9454
9455    /// Enables the usage export feature and sets theusage export bucket
9456    /// where reports are stored. If you provide an empty request body using this
9457    /// method, the usage export feature will be disabled.
9458    pub fn set_usage_export_bucket(&self) -> super::builder::projects::SetUsageExportBucket {
9459        super::builder::projects::SetUsageExportBucket::new(self.inner.clone())
9460    }
9461
9462    /// Retrieves the specified Operations resource.
9463    pub fn get_operation(&self) -> super::builder::projects::GetOperation {
9464        super::builder::projects::GetOperation::new(self.inner.clone())
9465    }
9466}
9467
9468/// Implements a client for the Google Compute Engine API.
9469///
9470/// # Example
9471/// ```
9472/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9473/// # use google_cloud_compute_v1::client::PublicAdvertisedPrefixes;
9474/// let client = PublicAdvertisedPrefixes::builder().build().await?;
9475/// // use `client` to make requests to the Google Compute Engine API.
9476/// # Ok(()) }
9477/// ```
9478///
9479/// # Service Description
9480///
9481/// Service for the `publicAdvertisedPrefixes` resource.
9482///
9483/// # Configuration
9484///
9485/// To configure `PublicAdvertisedPrefixes` use the `with_*` methods in the type returned
9486/// by [builder()][PublicAdvertisedPrefixes::builder]. The default configuration should
9487/// work for most applications. Common configuration changes include
9488///
9489/// * [with_endpoint()]: by default this client uses the global default endpoint
9490///   (`https://compute.googleapis.com`). Applications using regional
9491///   endpoints or running in restricted networks (e.g. a network configured
9492//    with [Private Google Access with VPC Service Controls]) may want to
9493///   override this default.
9494/// * [with_credentials()]: by default this client uses
9495///   [Application Default Credentials]. Applications using custom
9496///   authentication may need to override this default.
9497///
9498/// [with_endpoint()]: super::builder::public_advertised_prefixes::ClientBuilder::with_endpoint
9499/// [with_credentials()]: super::builder::public_advertised_prefixes::ClientBuilder::credentials
9500/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9501/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9502///
9503/// # Pooling and Cloning
9504///
9505/// `PublicAdvertisedPrefixes` holds a connection pool internally, it is advised to
9506/// create one and the reuse it.  You do not need to wrap `PublicAdvertisedPrefixes` in
9507/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9508/// already uses an `Arc` internally.
9509#[cfg(feature = "public-advertised-prefixes")]
9510#[cfg_attr(docsrs, doc(cfg(feature = "public-advertised-prefixes")))]
9511#[derive(Clone, Debug)]
9512pub struct PublicAdvertisedPrefixes {
9513    inner: std::sync::Arc<dyn super::stub::dynamic::PublicAdvertisedPrefixes>,
9514}
9515
9516#[cfg(feature = "public-advertised-prefixes")]
9517impl PublicAdvertisedPrefixes {
9518    /// Returns a builder for [PublicAdvertisedPrefixes].
9519    ///
9520    /// ```
9521    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9522    /// # use google_cloud_compute_v1::client::PublicAdvertisedPrefixes;
9523    /// let client = PublicAdvertisedPrefixes::builder().build().await?;
9524    /// # Ok(()) }
9525    /// ```
9526    pub fn builder() -> super::builder::public_advertised_prefixes::ClientBuilder {
9527        crate::new_client_builder(super::builder::public_advertised_prefixes::client::Factory)
9528    }
9529
9530    /// Creates a new client from the provided stub.
9531    ///
9532    /// The most common case for calling this function is in tests mocking the
9533    /// client's behavior.
9534    pub fn from_stub<T>(stub: T) -> Self
9535    where
9536        T: super::stub::PublicAdvertisedPrefixes + 'static,
9537    {
9538        Self {
9539            inner: std::sync::Arc::new(stub),
9540        }
9541    }
9542
9543    pub(crate) async fn new(
9544        config: gaxi::options::ClientConfig,
9545    ) -> crate::ClientBuilderResult<Self> {
9546        let inner = Self::build_inner(config).await?;
9547        Ok(Self { inner })
9548    }
9549
9550    async fn build_inner(
9551        conf: gaxi::options::ClientConfig,
9552    ) -> crate::ClientBuilderResult<
9553        std::sync::Arc<dyn super::stub::dynamic::PublicAdvertisedPrefixes>,
9554    > {
9555        if gaxi::options::tracing_enabled(&conf) {
9556            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9557        }
9558        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9559    }
9560
9561    async fn build_transport(
9562        conf: gaxi::options::ClientConfig,
9563    ) -> crate::ClientBuilderResult<impl super::stub::PublicAdvertisedPrefixes> {
9564        super::transport::PublicAdvertisedPrefixes::new(conf).await
9565    }
9566
9567    async fn build_with_tracing(
9568        conf: gaxi::options::ClientConfig,
9569    ) -> crate::ClientBuilderResult<impl super::stub::PublicAdvertisedPrefixes> {
9570        Self::build_transport(conf)
9571            .await
9572            .map(super::tracing::PublicAdvertisedPrefixes::new)
9573    }
9574
9575    /// Announces the specified PublicAdvertisedPrefix
9576    pub fn announce(&self) -> super::builder::public_advertised_prefixes::Announce {
9577        super::builder::public_advertised_prefixes::Announce::new(self.inner.clone())
9578    }
9579
9580    /// Deletes the specified PublicAdvertisedPrefix
9581    pub fn delete(&self) -> super::builder::public_advertised_prefixes::Delete {
9582        super::builder::public_advertised_prefixes::Delete::new(self.inner.clone())
9583    }
9584
9585    /// Returns the specified PublicAdvertisedPrefix resource.
9586    pub fn get(&self) -> super::builder::public_advertised_prefixes::Get {
9587        super::builder::public_advertised_prefixes::Get::new(self.inner.clone())
9588    }
9589
9590    /// Creates a PublicAdvertisedPrefix in the specified project
9591    /// using the parameters that are included in the request.
9592    pub fn insert(&self) -> super::builder::public_advertised_prefixes::Insert {
9593        super::builder::public_advertised_prefixes::Insert::new(self.inner.clone())
9594    }
9595
9596    /// Lists the PublicAdvertisedPrefixes for a project.
9597    pub fn list(&self) -> super::builder::public_advertised_prefixes::List {
9598        super::builder::public_advertised_prefixes::List::new(self.inner.clone())
9599    }
9600
9601    /// Patches the specified Router resource with the data included in the
9602    /// request. This method supportsPATCH
9603    /// semantics and usesJSON merge
9604    /// patch format and processing rules.
9605    pub fn patch(&self) -> super::builder::public_advertised_prefixes::Patch {
9606        super::builder::public_advertised_prefixes::Patch::new(self.inner.clone())
9607    }
9608
9609    /// Withdraws the specified PublicAdvertisedPrefix
9610    pub fn withdraw(&self) -> super::builder::public_advertised_prefixes::Withdraw {
9611        super::builder::public_advertised_prefixes::Withdraw::new(self.inner.clone())
9612    }
9613
9614    /// Retrieves the specified Operations resource.
9615    pub fn get_operation(&self) -> super::builder::public_advertised_prefixes::GetOperation {
9616        super::builder::public_advertised_prefixes::GetOperation::new(self.inner.clone())
9617    }
9618}
9619
9620/// Implements a client for the Google Compute Engine API.
9621///
9622/// # Example
9623/// ```
9624/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9625/// # use google_cloud_compute_v1::client::PublicDelegatedPrefixes;
9626/// let client = PublicDelegatedPrefixes::builder().build().await?;
9627/// // use `client` to make requests to the Google Compute Engine API.
9628/// # Ok(()) }
9629/// ```
9630///
9631/// # Service Description
9632///
9633/// Service for the `publicDelegatedPrefixes` resource.
9634///
9635/// # Configuration
9636///
9637/// To configure `PublicDelegatedPrefixes` use the `with_*` methods in the type returned
9638/// by [builder()][PublicDelegatedPrefixes::builder]. The default configuration should
9639/// work for most applications. Common configuration changes include
9640///
9641/// * [with_endpoint()]: by default this client uses the global default endpoint
9642///   (`https://compute.googleapis.com`). Applications using regional
9643///   endpoints or running in restricted networks (e.g. a network configured
9644//    with [Private Google Access with VPC Service Controls]) may want to
9645///   override this default.
9646/// * [with_credentials()]: by default this client uses
9647///   [Application Default Credentials]. Applications using custom
9648///   authentication may need to override this default.
9649///
9650/// [with_endpoint()]: super::builder::public_delegated_prefixes::ClientBuilder::with_endpoint
9651/// [with_credentials()]: super::builder::public_delegated_prefixes::ClientBuilder::credentials
9652/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9653/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9654///
9655/// # Pooling and Cloning
9656///
9657/// `PublicDelegatedPrefixes` holds a connection pool internally, it is advised to
9658/// create one and the reuse it.  You do not need to wrap `PublicDelegatedPrefixes` in
9659/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9660/// already uses an `Arc` internally.
9661#[cfg(feature = "public-delegated-prefixes")]
9662#[cfg_attr(docsrs, doc(cfg(feature = "public-delegated-prefixes")))]
9663#[derive(Clone, Debug)]
9664pub struct PublicDelegatedPrefixes {
9665    inner: std::sync::Arc<dyn super::stub::dynamic::PublicDelegatedPrefixes>,
9666}
9667
9668#[cfg(feature = "public-delegated-prefixes")]
9669impl PublicDelegatedPrefixes {
9670    /// Returns a builder for [PublicDelegatedPrefixes].
9671    ///
9672    /// ```
9673    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9674    /// # use google_cloud_compute_v1::client::PublicDelegatedPrefixes;
9675    /// let client = PublicDelegatedPrefixes::builder().build().await?;
9676    /// # Ok(()) }
9677    /// ```
9678    pub fn builder() -> super::builder::public_delegated_prefixes::ClientBuilder {
9679        crate::new_client_builder(super::builder::public_delegated_prefixes::client::Factory)
9680    }
9681
9682    /// Creates a new client from the provided stub.
9683    ///
9684    /// The most common case for calling this function is in tests mocking the
9685    /// client's behavior.
9686    pub fn from_stub<T>(stub: T) -> Self
9687    where
9688        T: super::stub::PublicDelegatedPrefixes + 'static,
9689    {
9690        Self {
9691            inner: std::sync::Arc::new(stub),
9692        }
9693    }
9694
9695    pub(crate) async fn new(
9696        config: gaxi::options::ClientConfig,
9697    ) -> crate::ClientBuilderResult<Self> {
9698        let inner = Self::build_inner(config).await?;
9699        Ok(Self { inner })
9700    }
9701
9702    async fn build_inner(
9703        conf: gaxi::options::ClientConfig,
9704    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::PublicDelegatedPrefixes>>
9705    {
9706        if gaxi::options::tracing_enabled(&conf) {
9707            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9708        }
9709        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9710    }
9711
9712    async fn build_transport(
9713        conf: gaxi::options::ClientConfig,
9714    ) -> crate::ClientBuilderResult<impl super::stub::PublicDelegatedPrefixes> {
9715        super::transport::PublicDelegatedPrefixes::new(conf).await
9716    }
9717
9718    async fn build_with_tracing(
9719        conf: gaxi::options::ClientConfig,
9720    ) -> crate::ClientBuilderResult<impl super::stub::PublicDelegatedPrefixes> {
9721        Self::build_transport(conf)
9722            .await
9723            .map(super::tracing::PublicDelegatedPrefixes::new)
9724    }
9725
9726    /// Lists all PublicDelegatedPrefix resources owned by the specific project
9727    /// across all scopes.
9728    ///
9729    /// To prevent failure, Google recommends that you set the
9730    /// `returnPartialSuccess` parameter to `true`.
9731    pub fn aggregated_list(&self) -> super::builder::public_delegated_prefixes::AggregatedList {
9732        super::builder::public_delegated_prefixes::AggregatedList::new(self.inner.clone())
9733    }
9734
9735    /// Announces the specified PublicDelegatedPrefix in the given region.
9736    pub fn announce(&self) -> super::builder::public_delegated_prefixes::Announce {
9737        super::builder::public_delegated_prefixes::Announce::new(self.inner.clone())
9738    }
9739
9740    /// Deletes the specified PublicDelegatedPrefix in the given region.
9741    pub fn delete(&self) -> super::builder::public_delegated_prefixes::Delete {
9742        super::builder::public_delegated_prefixes::Delete::new(self.inner.clone())
9743    }
9744
9745    /// Returns the specified PublicDelegatedPrefix resource in the given region.
9746    pub fn get(&self) -> super::builder::public_delegated_prefixes::Get {
9747        super::builder::public_delegated_prefixes::Get::new(self.inner.clone())
9748    }
9749
9750    /// Creates a PublicDelegatedPrefix in the specified project in the given
9751    /// region using the parameters that are included in the request.
9752    pub fn insert(&self) -> super::builder::public_delegated_prefixes::Insert {
9753        super::builder::public_delegated_prefixes::Insert::new(self.inner.clone())
9754    }
9755
9756    /// Lists the PublicDelegatedPrefixes for a project in the given region.
9757    pub fn list(&self) -> super::builder::public_delegated_prefixes::List {
9758        super::builder::public_delegated_prefixes::List::new(self.inner.clone())
9759    }
9760
9761    /// Patches the specified PublicDelegatedPrefix resource with the data included
9762    /// in the request. This method supportsPATCH
9763    /// semantics and usesJSON merge
9764    /// patch format and processing rules.
9765    pub fn patch(&self) -> super::builder::public_delegated_prefixes::Patch {
9766        super::builder::public_delegated_prefixes::Patch::new(self.inner.clone())
9767    }
9768
9769    /// Withdraws the specified PublicDelegatedPrefix in the given region.
9770    pub fn withdraw(&self) -> super::builder::public_delegated_prefixes::Withdraw {
9771        super::builder::public_delegated_prefixes::Withdraw::new(self.inner.clone())
9772    }
9773
9774    /// Retrieves the specified region-specific Operations resource.
9775    pub fn get_operation(&self) -> super::builder::public_delegated_prefixes::GetOperation {
9776        super::builder::public_delegated_prefixes::GetOperation::new(self.inner.clone())
9777    }
9778}
9779
9780/// Implements a client for the Google Compute Engine API.
9781///
9782/// # Example
9783/// ```
9784/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9785/// # use google_cloud_compute_v1::client::RegionAutoscalers;
9786/// let client = RegionAutoscalers::builder().build().await?;
9787/// // use `client` to make requests to the Google Compute Engine API.
9788/// # Ok(()) }
9789/// ```
9790///
9791/// # Service Description
9792///
9793/// Service for the `regionAutoscalers` resource.
9794///
9795/// # Configuration
9796///
9797/// To configure `RegionAutoscalers` use the `with_*` methods in the type returned
9798/// by [builder()][RegionAutoscalers::builder]. The default configuration should
9799/// work for most applications. Common configuration changes include
9800///
9801/// * [with_endpoint()]: by default this client uses the global default endpoint
9802///   (`https://compute.googleapis.com`). Applications using regional
9803///   endpoints or running in restricted networks (e.g. a network configured
9804//    with [Private Google Access with VPC Service Controls]) may want to
9805///   override this default.
9806/// * [with_credentials()]: by default this client uses
9807///   [Application Default Credentials]. Applications using custom
9808///   authentication may need to override this default.
9809///
9810/// [with_endpoint()]: super::builder::region_autoscalers::ClientBuilder::with_endpoint
9811/// [with_credentials()]: super::builder::region_autoscalers::ClientBuilder::credentials
9812/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9813/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9814///
9815/// # Pooling and Cloning
9816///
9817/// `RegionAutoscalers` holds a connection pool internally, it is advised to
9818/// create one and the reuse it.  You do not need to wrap `RegionAutoscalers` in
9819/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9820/// already uses an `Arc` internally.
9821#[cfg(feature = "region-autoscalers")]
9822#[cfg_attr(docsrs, doc(cfg(feature = "region-autoscalers")))]
9823#[derive(Clone, Debug)]
9824pub struct RegionAutoscalers {
9825    inner: std::sync::Arc<dyn super::stub::dynamic::RegionAutoscalers>,
9826}
9827
9828#[cfg(feature = "region-autoscalers")]
9829impl RegionAutoscalers {
9830    /// Returns a builder for [RegionAutoscalers].
9831    ///
9832    /// ```
9833    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9834    /// # use google_cloud_compute_v1::client::RegionAutoscalers;
9835    /// let client = RegionAutoscalers::builder().build().await?;
9836    /// # Ok(()) }
9837    /// ```
9838    pub fn builder() -> super::builder::region_autoscalers::ClientBuilder {
9839        crate::new_client_builder(super::builder::region_autoscalers::client::Factory)
9840    }
9841
9842    /// Creates a new client from the provided stub.
9843    ///
9844    /// The most common case for calling this function is in tests mocking the
9845    /// client's behavior.
9846    pub fn from_stub<T>(stub: T) -> Self
9847    where
9848        T: super::stub::RegionAutoscalers + 'static,
9849    {
9850        Self {
9851            inner: std::sync::Arc::new(stub),
9852        }
9853    }
9854
9855    pub(crate) async fn new(
9856        config: gaxi::options::ClientConfig,
9857    ) -> crate::ClientBuilderResult<Self> {
9858        let inner = Self::build_inner(config).await?;
9859        Ok(Self { inner })
9860    }
9861
9862    async fn build_inner(
9863        conf: gaxi::options::ClientConfig,
9864    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionAutoscalers>>
9865    {
9866        if gaxi::options::tracing_enabled(&conf) {
9867            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9868        }
9869        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9870    }
9871
9872    async fn build_transport(
9873        conf: gaxi::options::ClientConfig,
9874    ) -> crate::ClientBuilderResult<impl super::stub::RegionAutoscalers> {
9875        super::transport::RegionAutoscalers::new(conf).await
9876    }
9877
9878    async fn build_with_tracing(
9879        conf: gaxi::options::ClientConfig,
9880    ) -> crate::ClientBuilderResult<impl super::stub::RegionAutoscalers> {
9881        Self::build_transport(conf)
9882            .await
9883            .map(super::tracing::RegionAutoscalers::new)
9884    }
9885
9886    /// Deletes the specified autoscaler.
9887    pub fn delete(&self) -> super::builder::region_autoscalers::Delete {
9888        super::builder::region_autoscalers::Delete::new(self.inner.clone())
9889    }
9890
9891    /// Returns the specified autoscaler.
9892    pub fn get(&self) -> super::builder::region_autoscalers::Get {
9893        super::builder::region_autoscalers::Get::new(self.inner.clone())
9894    }
9895
9896    /// Creates an autoscaler in the specified project using
9897    /// the data included in the request.
9898    pub fn insert(&self) -> super::builder::region_autoscalers::Insert {
9899        super::builder::region_autoscalers::Insert::new(self.inner.clone())
9900    }
9901
9902    /// Retrieves a list of autoscalers contained within
9903    /// the specified region.
9904    pub fn list(&self) -> super::builder::region_autoscalers::List {
9905        super::builder::region_autoscalers::List::new(self.inner.clone())
9906    }
9907
9908    /// Updates an autoscaler in the specified project using
9909    /// the data included in the request. This method supportsPATCH
9910    /// semantics and uses theJSON merge
9911    /// patch format and processing rules.
9912    pub fn patch(&self) -> super::builder::region_autoscalers::Patch {
9913        super::builder::region_autoscalers::Patch::new(self.inner.clone())
9914    }
9915
9916    /// Returns permissions that a caller has on the specified resource.
9917    pub fn test_iam_permissions(&self) -> super::builder::region_autoscalers::TestIamPermissions {
9918        super::builder::region_autoscalers::TestIamPermissions::new(self.inner.clone())
9919    }
9920
9921    /// Updates an autoscaler in the specified project using
9922    /// the data included in the request.
9923    pub fn update(&self) -> super::builder::region_autoscalers::Update {
9924        super::builder::region_autoscalers::Update::new(self.inner.clone())
9925    }
9926
9927    /// Retrieves the specified region-specific Operations resource.
9928    pub fn get_operation(&self) -> super::builder::region_autoscalers::GetOperation {
9929        super::builder::region_autoscalers::GetOperation::new(self.inner.clone())
9930    }
9931}
9932
9933/// Implements a client for the Google Compute Engine API.
9934///
9935/// # Example
9936/// ```
9937/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9938/// # use google_cloud_compute_v1::client::RegionBackendServices;
9939/// let client = RegionBackendServices::builder().build().await?;
9940/// // use `client` to make requests to the Google Compute Engine API.
9941/// # Ok(()) }
9942/// ```
9943///
9944/// # Service Description
9945///
9946/// Service for the `regionBackendServices` resource.
9947///
9948/// # Configuration
9949///
9950/// To configure `RegionBackendServices` use the `with_*` methods in the type returned
9951/// by [builder()][RegionBackendServices::builder]. The default configuration should
9952/// work for most applications. Common configuration changes include
9953///
9954/// * [with_endpoint()]: by default this client uses the global default endpoint
9955///   (`https://compute.googleapis.com`). Applications using regional
9956///   endpoints or running in restricted networks (e.g. a network configured
9957//    with [Private Google Access with VPC Service Controls]) may want to
9958///   override this default.
9959/// * [with_credentials()]: by default this client uses
9960///   [Application Default Credentials]. Applications using custom
9961///   authentication may need to override this default.
9962///
9963/// [with_endpoint()]: super::builder::region_backend_services::ClientBuilder::with_endpoint
9964/// [with_credentials()]: super::builder::region_backend_services::ClientBuilder::credentials
9965/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9966/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9967///
9968/// # Pooling and Cloning
9969///
9970/// `RegionBackendServices` holds a connection pool internally, it is advised to
9971/// create one and the reuse it.  You do not need to wrap `RegionBackendServices` in
9972/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9973/// already uses an `Arc` internally.
9974#[cfg(feature = "region-backend-services")]
9975#[cfg_attr(docsrs, doc(cfg(feature = "region-backend-services")))]
9976#[derive(Clone, Debug)]
9977pub struct RegionBackendServices {
9978    inner: std::sync::Arc<dyn super::stub::dynamic::RegionBackendServices>,
9979}
9980
9981#[cfg(feature = "region-backend-services")]
9982impl RegionBackendServices {
9983    /// Returns a builder for [RegionBackendServices].
9984    ///
9985    /// ```
9986    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9987    /// # use google_cloud_compute_v1::client::RegionBackendServices;
9988    /// let client = RegionBackendServices::builder().build().await?;
9989    /// # Ok(()) }
9990    /// ```
9991    pub fn builder() -> super::builder::region_backend_services::ClientBuilder {
9992        crate::new_client_builder(super::builder::region_backend_services::client::Factory)
9993    }
9994
9995    /// Creates a new client from the provided stub.
9996    ///
9997    /// The most common case for calling this function is in tests mocking the
9998    /// client's behavior.
9999    pub fn from_stub<T>(stub: T) -> Self
10000    where
10001        T: super::stub::RegionBackendServices + 'static,
10002    {
10003        Self {
10004            inner: std::sync::Arc::new(stub),
10005        }
10006    }
10007
10008    pub(crate) async fn new(
10009        config: gaxi::options::ClientConfig,
10010    ) -> crate::ClientBuilderResult<Self> {
10011        let inner = Self::build_inner(config).await?;
10012        Ok(Self { inner })
10013    }
10014
10015    async fn build_inner(
10016        conf: gaxi::options::ClientConfig,
10017    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionBackendServices>>
10018    {
10019        if gaxi::options::tracing_enabled(&conf) {
10020            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10021        }
10022        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10023    }
10024
10025    async fn build_transport(
10026        conf: gaxi::options::ClientConfig,
10027    ) -> crate::ClientBuilderResult<impl super::stub::RegionBackendServices> {
10028        super::transport::RegionBackendServices::new(conf).await
10029    }
10030
10031    async fn build_with_tracing(
10032        conf: gaxi::options::ClientConfig,
10033    ) -> crate::ClientBuilderResult<impl super::stub::RegionBackendServices> {
10034        Self::build_transport(conf)
10035            .await
10036            .map(super::tracing::RegionBackendServices::new)
10037    }
10038
10039    /// Deletes the specified regional BackendService resource.
10040    pub fn delete(&self) -> super::builder::region_backend_services::Delete {
10041        super::builder::region_backend_services::Delete::new(self.inner.clone())
10042    }
10043
10044    /// Returns the specified regional BackendService resource.
10045    pub fn get(&self) -> super::builder::region_backend_services::Get {
10046        super::builder::region_backend_services::Get::new(self.inner.clone())
10047    }
10048
10049    /// Gets the most recent health check results for this
10050    /// regional BackendService.
10051    pub fn get_health(&self) -> super::builder::region_backend_services::GetHealth {
10052        super::builder::region_backend_services::GetHealth::new(self.inner.clone())
10053    }
10054
10055    /// Gets the access control policy for a resource. May be empty if no such
10056    /// policy or resource exists.
10057    pub fn get_iam_policy(&self) -> super::builder::region_backend_services::GetIamPolicy {
10058        super::builder::region_backend_services::GetIamPolicy::new(self.inner.clone())
10059    }
10060
10061    /// Creates a regional BackendService resource in the specified project using
10062    /// the data included in the request. For more information, see
10063    /// Backend services overview.
10064    pub fn insert(&self) -> super::builder::region_backend_services::Insert {
10065        super::builder::region_backend_services::Insert::new(self.inner.clone())
10066    }
10067
10068    /// Retrieves the list of regional BackendService resources available to the
10069    /// specified project in the given region.
10070    pub fn list(&self) -> super::builder::region_backend_services::List {
10071        super::builder::region_backend_services::List::new(self.inner.clone())
10072    }
10073
10074    /// Retrieves a list of all usable backend services in the specified project in
10075    /// the given region.
10076    pub fn list_usable(&self) -> super::builder::region_backend_services::ListUsable {
10077        super::builder::region_backend_services::ListUsable::new(self.inner.clone())
10078    }
10079
10080    /// Updates the specified regional BackendService resource with the data
10081    /// included in the request. For more information, see
10082    /// Understanding backend services This method
10083    /// supports PATCH semantics and uses the JSON merge
10084    /// patch format and processing rules.
10085    pub fn patch(&self) -> super::builder::region_backend_services::Patch {
10086        super::builder::region_backend_services::Patch::new(self.inner.clone())
10087    }
10088
10089    /// Sets the access control policy on the specified resource.
10090    /// Replaces any existing policy.
10091    pub fn set_iam_policy(&self) -> super::builder::region_backend_services::SetIamPolicy {
10092        super::builder::region_backend_services::SetIamPolicy::new(self.inner.clone())
10093    }
10094
10095    /// Sets the Google Cloud Armor security policy for the specified backend
10096    /// service. For more information, seeGoogle
10097    /// Cloud Armor Overview
10098    pub fn set_security_policy(
10099        &self,
10100    ) -> super::builder::region_backend_services::SetSecurityPolicy {
10101        super::builder::region_backend_services::SetSecurityPolicy::new(self.inner.clone())
10102    }
10103
10104    /// Returns permissions that a caller has on the specified resource.
10105    pub fn test_iam_permissions(
10106        &self,
10107    ) -> super::builder::region_backend_services::TestIamPermissions {
10108        super::builder::region_backend_services::TestIamPermissions::new(self.inner.clone())
10109    }
10110
10111    /// Updates the specified regional BackendService resource with the data
10112    /// included in the request. For more information,
10113    /// see
10114    /// Backend services overview.
10115    pub fn update(&self) -> super::builder::region_backend_services::Update {
10116        super::builder::region_backend_services::Update::new(self.inner.clone())
10117    }
10118
10119    /// Retrieves the specified region-specific Operations resource.
10120    pub fn get_operation(&self) -> super::builder::region_backend_services::GetOperation {
10121        super::builder::region_backend_services::GetOperation::new(self.inner.clone())
10122    }
10123}
10124
10125/// Implements a client for the Google Compute Engine API.
10126///
10127/// # Example
10128/// ```
10129/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10130/// # use google_cloud_compute_v1::client::RegionCommitments;
10131/// let client = RegionCommitments::builder().build().await?;
10132/// // use `client` to make requests to the Google Compute Engine API.
10133/// # Ok(()) }
10134/// ```
10135///
10136/// # Service Description
10137///
10138/// Service for the `regionCommitments` resource.
10139///
10140/// # Configuration
10141///
10142/// To configure `RegionCommitments` use the `with_*` methods in the type returned
10143/// by [builder()][RegionCommitments::builder]. The default configuration should
10144/// work for most applications. Common configuration changes include
10145///
10146/// * [with_endpoint()]: by default this client uses the global default endpoint
10147///   (`https://compute.googleapis.com`). Applications using regional
10148///   endpoints or running in restricted networks (e.g. a network configured
10149//    with [Private Google Access with VPC Service Controls]) may want to
10150///   override this default.
10151/// * [with_credentials()]: by default this client uses
10152///   [Application Default Credentials]. Applications using custom
10153///   authentication may need to override this default.
10154///
10155/// [with_endpoint()]: super::builder::region_commitments::ClientBuilder::with_endpoint
10156/// [with_credentials()]: super::builder::region_commitments::ClientBuilder::credentials
10157/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10158/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10159///
10160/// # Pooling and Cloning
10161///
10162/// `RegionCommitments` holds a connection pool internally, it is advised to
10163/// create one and the reuse it.  You do not need to wrap `RegionCommitments` in
10164/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10165/// already uses an `Arc` internally.
10166#[cfg(feature = "region-commitments")]
10167#[cfg_attr(docsrs, doc(cfg(feature = "region-commitments")))]
10168#[derive(Clone, Debug)]
10169pub struct RegionCommitments {
10170    inner: std::sync::Arc<dyn super::stub::dynamic::RegionCommitments>,
10171}
10172
10173#[cfg(feature = "region-commitments")]
10174impl RegionCommitments {
10175    /// Returns a builder for [RegionCommitments].
10176    ///
10177    /// ```
10178    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10179    /// # use google_cloud_compute_v1::client::RegionCommitments;
10180    /// let client = RegionCommitments::builder().build().await?;
10181    /// # Ok(()) }
10182    /// ```
10183    pub fn builder() -> super::builder::region_commitments::ClientBuilder {
10184        crate::new_client_builder(super::builder::region_commitments::client::Factory)
10185    }
10186
10187    /// Creates a new client from the provided stub.
10188    ///
10189    /// The most common case for calling this function is in tests mocking the
10190    /// client's behavior.
10191    pub fn from_stub<T>(stub: T) -> Self
10192    where
10193        T: super::stub::RegionCommitments + 'static,
10194    {
10195        Self {
10196            inner: std::sync::Arc::new(stub),
10197        }
10198    }
10199
10200    pub(crate) async fn new(
10201        config: gaxi::options::ClientConfig,
10202    ) -> crate::ClientBuilderResult<Self> {
10203        let inner = Self::build_inner(config).await?;
10204        Ok(Self { inner })
10205    }
10206
10207    async fn build_inner(
10208        conf: gaxi::options::ClientConfig,
10209    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionCommitments>>
10210    {
10211        if gaxi::options::tracing_enabled(&conf) {
10212            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10213        }
10214        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10215    }
10216
10217    async fn build_transport(
10218        conf: gaxi::options::ClientConfig,
10219    ) -> crate::ClientBuilderResult<impl super::stub::RegionCommitments> {
10220        super::transport::RegionCommitments::new(conf).await
10221    }
10222
10223    async fn build_with_tracing(
10224        conf: gaxi::options::ClientConfig,
10225    ) -> crate::ClientBuilderResult<impl super::stub::RegionCommitments> {
10226        Self::build_transport(conf)
10227            .await
10228            .map(super::tracing::RegionCommitments::new)
10229    }
10230
10231    /// Retrieves an aggregated list of commitments by region.
10232    ///
10233    /// To prevent failure, it is recommended that you set the
10234    /// `returnPartialSuccess` parameter to `true`.
10235    pub fn aggregated_list(&self) -> super::builder::region_commitments::AggregatedList {
10236        super::builder::region_commitments::AggregatedList::new(self.inner.clone())
10237    }
10238
10239    /// Returns the specified commitment resource.
10240    pub fn get(&self) -> super::builder::region_commitments::Get {
10241        super::builder::region_commitments::Get::new(self.inner.clone())
10242    }
10243
10244    /// Creates a commitment in the specified project using the data
10245    /// included in the request.
10246    pub fn insert(&self) -> super::builder::region_commitments::Insert {
10247        super::builder::region_commitments::Insert::new(self.inner.clone())
10248    }
10249
10250    /// Retrieves a list of commitments contained within
10251    /// the specified region.
10252    pub fn list(&self) -> super::builder::region_commitments::List {
10253        super::builder::region_commitments::List::new(self.inner.clone())
10254    }
10255
10256    /// Updates the specified commitment with the data included in the request.
10257    /// Update is performed only on selected fields included as part of
10258    /// update-mask. Only the following fields can be updated: auto_renew and plan.
10259    pub fn update(&self) -> super::builder::region_commitments::Update {
10260        super::builder::region_commitments::Update::new(self.inner.clone())
10261    }
10262
10263    /// Retrieves the specified region-specific Operations resource.
10264    pub fn get_operation(&self) -> super::builder::region_commitments::GetOperation {
10265        super::builder::region_commitments::GetOperation::new(self.inner.clone())
10266    }
10267}
10268
10269/// Implements a client for the Google Compute Engine API.
10270///
10271/// # Example
10272/// ```
10273/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10274/// # use google_cloud_compute_v1::client::RegionDiskTypes;
10275/// let client = RegionDiskTypes::builder().build().await?;
10276/// // use `client` to make requests to the Google Compute Engine API.
10277/// # Ok(()) }
10278/// ```
10279///
10280/// # Service Description
10281///
10282/// Service for the `regionDiskTypes` resource.
10283///
10284/// # Configuration
10285///
10286/// To configure `RegionDiskTypes` use the `with_*` methods in the type returned
10287/// by [builder()][RegionDiskTypes::builder]. The default configuration should
10288/// work for most applications. Common configuration changes include
10289///
10290/// * [with_endpoint()]: by default this client uses the global default endpoint
10291///   (`https://compute.googleapis.com`). Applications using regional
10292///   endpoints or running in restricted networks (e.g. a network configured
10293//    with [Private Google Access with VPC Service Controls]) may want to
10294///   override this default.
10295/// * [with_credentials()]: by default this client uses
10296///   [Application Default Credentials]. Applications using custom
10297///   authentication may need to override this default.
10298///
10299/// [with_endpoint()]: super::builder::region_disk_types::ClientBuilder::with_endpoint
10300/// [with_credentials()]: super::builder::region_disk_types::ClientBuilder::credentials
10301/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10302/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10303///
10304/// # Pooling and Cloning
10305///
10306/// `RegionDiskTypes` holds a connection pool internally, it is advised to
10307/// create one and the reuse it.  You do not need to wrap `RegionDiskTypes` in
10308/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10309/// already uses an `Arc` internally.
10310#[cfg(feature = "region-disk-types")]
10311#[cfg_attr(docsrs, doc(cfg(feature = "region-disk-types")))]
10312#[derive(Clone, Debug)]
10313pub struct RegionDiskTypes {
10314    inner: std::sync::Arc<dyn super::stub::dynamic::RegionDiskTypes>,
10315}
10316
10317#[cfg(feature = "region-disk-types")]
10318impl RegionDiskTypes {
10319    /// Returns a builder for [RegionDiskTypes].
10320    ///
10321    /// ```
10322    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10323    /// # use google_cloud_compute_v1::client::RegionDiskTypes;
10324    /// let client = RegionDiskTypes::builder().build().await?;
10325    /// # Ok(()) }
10326    /// ```
10327    pub fn builder() -> super::builder::region_disk_types::ClientBuilder {
10328        crate::new_client_builder(super::builder::region_disk_types::client::Factory)
10329    }
10330
10331    /// Creates a new client from the provided stub.
10332    ///
10333    /// The most common case for calling this function is in tests mocking the
10334    /// client's behavior.
10335    pub fn from_stub<T>(stub: T) -> Self
10336    where
10337        T: super::stub::RegionDiskTypes + 'static,
10338    {
10339        Self {
10340            inner: std::sync::Arc::new(stub),
10341        }
10342    }
10343
10344    pub(crate) async fn new(
10345        config: gaxi::options::ClientConfig,
10346    ) -> crate::ClientBuilderResult<Self> {
10347        let inner = Self::build_inner(config).await?;
10348        Ok(Self { inner })
10349    }
10350
10351    async fn build_inner(
10352        conf: gaxi::options::ClientConfig,
10353    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionDiskTypes>> {
10354        if gaxi::options::tracing_enabled(&conf) {
10355            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10356        }
10357        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10358    }
10359
10360    async fn build_transport(
10361        conf: gaxi::options::ClientConfig,
10362    ) -> crate::ClientBuilderResult<impl super::stub::RegionDiskTypes> {
10363        super::transport::RegionDiskTypes::new(conf).await
10364    }
10365
10366    async fn build_with_tracing(
10367        conf: gaxi::options::ClientConfig,
10368    ) -> crate::ClientBuilderResult<impl super::stub::RegionDiskTypes> {
10369        Self::build_transport(conf)
10370            .await
10371            .map(super::tracing::RegionDiskTypes::new)
10372    }
10373
10374    /// Returns the specified regional disk type.
10375    pub fn get(&self) -> super::builder::region_disk_types::Get {
10376        super::builder::region_disk_types::Get::new(self.inner.clone())
10377    }
10378
10379    /// Retrieves a list of regional disk types available to the specified project.
10380    pub fn list(&self) -> super::builder::region_disk_types::List {
10381        super::builder::region_disk_types::List::new(self.inner.clone())
10382    }
10383}
10384
10385/// Implements a client for the Google Compute Engine API.
10386///
10387/// # Example
10388/// ```
10389/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10390/// # use google_cloud_compute_v1::client::RegionDisks;
10391/// let client = RegionDisks::builder().build().await?;
10392/// // use `client` to make requests to the Google Compute Engine API.
10393/// # Ok(()) }
10394/// ```
10395///
10396/// # Service Description
10397///
10398/// Service for the `regionDisks` resource.
10399///
10400/// # Configuration
10401///
10402/// To configure `RegionDisks` use the `with_*` methods in the type returned
10403/// by [builder()][RegionDisks::builder]. The default configuration should
10404/// work for most applications. Common configuration changes include
10405///
10406/// * [with_endpoint()]: by default this client uses the global default endpoint
10407///   (`https://compute.googleapis.com`). Applications using regional
10408///   endpoints or running in restricted networks (e.g. a network configured
10409//    with [Private Google Access with VPC Service Controls]) may want to
10410///   override this default.
10411/// * [with_credentials()]: by default this client uses
10412///   [Application Default Credentials]. Applications using custom
10413///   authentication may need to override this default.
10414///
10415/// [with_endpoint()]: super::builder::region_disks::ClientBuilder::with_endpoint
10416/// [with_credentials()]: super::builder::region_disks::ClientBuilder::credentials
10417/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10418/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10419///
10420/// # Pooling and Cloning
10421///
10422/// `RegionDisks` holds a connection pool internally, it is advised to
10423/// create one and the reuse it.  You do not need to wrap `RegionDisks` in
10424/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10425/// already uses an `Arc` internally.
10426#[cfg(feature = "region-disks")]
10427#[cfg_attr(docsrs, doc(cfg(feature = "region-disks")))]
10428#[derive(Clone, Debug)]
10429pub struct RegionDisks {
10430    inner: std::sync::Arc<dyn super::stub::dynamic::RegionDisks>,
10431}
10432
10433#[cfg(feature = "region-disks")]
10434impl RegionDisks {
10435    /// Returns a builder for [RegionDisks].
10436    ///
10437    /// ```
10438    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10439    /// # use google_cloud_compute_v1::client::RegionDisks;
10440    /// let client = RegionDisks::builder().build().await?;
10441    /// # Ok(()) }
10442    /// ```
10443    pub fn builder() -> super::builder::region_disks::ClientBuilder {
10444        crate::new_client_builder(super::builder::region_disks::client::Factory)
10445    }
10446
10447    /// Creates a new client from the provided stub.
10448    ///
10449    /// The most common case for calling this function is in tests mocking the
10450    /// client's behavior.
10451    pub fn from_stub<T>(stub: T) -> Self
10452    where
10453        T: super::stub::RegionDisks + 'static,
10454    {
10455        Self {
10456            inner: std::sync::Arc::new(stub),
10457        }
10458    }
10459
10460    pub(crate) async fn new(
10461        config: gaxi::options::ClientConfig,
10462    ) -> crate::ClientBuilderResult<Self> {
10463        let inner = Self::build_inner(config).await?;
10464        Ok(Self { inner })
10465    }
10466
10467    async fn build_inner(
10468        conf: gaxi::options::ClientConfig,
10469    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionDisks>> {
10470        if gaxi::options::tracing_enabled(&conf) {
10471            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10472        }
10473        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10474    }
10475
10476    async fn build_transport(
10477        conf: gaxi::options::ClientConfig,
10478    ) -> crate::ClientBuilderResult<impl super::stub::RegionDisks> {
10479        super::transport::RegionDisks::new(conf).await
10480    }
10481
10482    async fn build_with_tracing(
10483        conf: gaxi::options::ClientConfig,
10484    ) -> crate::ClientBuilderResult<impl super::stub::RegionDisks> {
10485        Self::build_transport(conf)
10486            .await
10487            .map(super::tracing::RegionDisks::new)
10488    }
10489
10490    /// Adds existing resource policies to a regional disk. You can only add one
10491    /// policy which will be applied to this disk for scheduling snapshot
10492    /// creation.
10493    pub fn add_resource_policies(&self) -> super::builder::region_disks::AddResourcePolicies {
10494        super::builder::region_disks::AddResourcePolicies::new(self.inner.clone())
10495    }
10496
10497    /// Bulk create a set of disks.
10498    pub fn bulk_insert(&self) -> super::builder::region_disks::BulkInsert {
10499        super::builder::region_disks::BulkInsert::new(self.inner.clone())
10500    }
10501
10502    /// Creates a snapshot of a specified persistent disk. For regular snapshot
10503    /// creation, consider using snapshots.insert
10504    /// instead, as that method supports more features, such as creating snapshots
10505    /// in a project different from the source disk project.
10506    pub fn create_snapshot(&self) -> super::builder::region_disks::CreateSnapshot {
10507        super::builder::region_disks::CreateSnapshot::new(self.inner.clone())
10508    }
10509
10510    /// Deletes the specified regional persistent disk. Deleting a regional disk
10511    /// removes all the replicas of its data permanently and is irreversible.
10512    /// However, deleting a disk does not delete anysnapshots
10513    /// previously made from the disk. You must separatelydelete
10514    /// snapshots.
10515    pub fn delete(&self) -> super::builder::region_disks::Delete {
10516        super::builder::region_disks::Delete::new(self.inner.clone())
10517    }
10518
10519    /// Returns a specified regional persistent disk.
10520    pub fn get(&self) -> super::builder::region_disks::Get {
10521        super::builder::region_disks::Get::new(self.inner.clone())
10522    }
10523
10524    /// Gets the access control policy for a resource. May be empty if no such
10525    /// policy or resource exists.
10526    pub fn get_iam_policy(&self) -> super::builder::region_disks::GetIamPolicy {
10527        super::builder::region_disks::GetIamPolicy::new(self.inner.clone())
10528    }
10529
10530    /// Creates a persistent regional disk in the specified project using the data
10531    /// included in the request.
10532    pub fn insert(&self) -> super::builder::region_disks::Insert {
10533        super::builder::region_disks::Insert::new(self.inner.clone())
10534    }
10535
10536    /// Retrieves the list of persistent disks contained within
10537    /// the specified region.
10538    pub fn list(&self) -> super::builder::region_disks::List {
10539        super::builder::region_disks::List::new(self.inner.clone())
10540    }
10541
10542    /// Removes resource policies from a regional disk.
10543    pub fn remove_resource_policies(&self) -> super::builder::region_disks::RemoveResourcePolicies {
10544        super::builder::region_disks::RemoveResourcePolicies::new(self.inner.clone())
10545    }
10546
10547    /// Resizes the specified regional persistent disk.
10548    pub fn resize(&self) -> super::builder::region_disks::Resize {
10549        super::builder::region_disks::Resize::new(self.inner.clone())
10550    }
10551
10552    /// Sets the access control policy on the specified resource.
10553    /// Replaces any existing policy.
10554    pub fn set_iam_policy(&self) -> super::builder::region_disks::SetIamPolicy {
10555        super::builder::region_disks::SetIamPolicy::new(self.inner.clone())
10556    }
10557
10558    /// Sets the labels on the target regional disk.
10559    pub fn set_labels(&self) -> super::builder::region_disks::SetLabels {
10560        super::builder::region_disks::SetLabels::new(self.inner.clone())
10561    }
10562
10563    /// Starts asynchronous replication.
10564    /// Must be invoked on the primary disk.
10565    pub fn start_async_replication(&self) -> super::builder::region_disks::StartAsyncReplication {
10566        super::builder::region_disks::StartAsyncReplication::new(self.inner.clone())
10567    }
10568
10569    /// Stops asynchronous replication.
10570    /// Can be invoked either on the primary or on the secondary disk.
10571    pub fn stop_async_replication(&self) -> super::builder::region_disks::StopAsyncReplication {
10572        super::builder::region_disks::StopAsyncReplication::new(self.inner.clone())
10573    }
10574
10575    /// Stops asynchronous replication for a consistency group of disks.
10576    /// Can be invoked either in the primary or secondary scope.
10577    pub fn stop_group_async_replication(
10578        &self,
10579    ) -> super::builder::region_disks::StopGroupAsyncReplication {
10580        super::builder::region_disks::StopGroupAsyncReplication::new(self.inner.clone())
10581    }
10582
10583    /// Returns permissions that a caller has on the specified resource.
10584    pub fn test_iam_permissions(&self) -> super::builder::region_disks::TestIamPermissions {
10585        super::builder::region_disks::TestIamPermissions::new(self.inner.clone())
10586    }
10587
10588    /// Update the specified disk with the data included in the request. Update is
10589    /// performed only on selected fields included as part of update-mask. Only the
10590    /// following fields can be modified: user_license.
10591    pub fn update(&self) -> super::builder::region_disks::Update {
10592        super::builder::region_disks::Update::new(self.inner.clone())
10593    }
10594
10595    /// Retrieves the specified region-specific Operations resource.
10596    pub fn get_operation(&self) -> super::builder::region_disks::GetOperation {
10597        super::builder::region_disks::GetOperation::new(self.inner.clone())
10598    }
10599}
10600
10601/// Implements a client for the Google Compute Engine API.
10602///
10603/// # Example
10604/// ```
10605/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10606/// # use google_cloud_compute_v1::client::RegionHealthCheckServices;
10607/// let client = RegionHealthCheckServices::builder().build().await?;
10608/// // use `client` to make requests to the Google Compute Engine API.
10609/// # Ok(()) }
10610/// ```
10611///
10612/// # Service Description
10613///
10614/// Service for the `regionHealthCheckServices` resource.
10615///
10616/// # Configuration
10617///
10618/// To configure `RegionHealthCheckServices` use the `with_*` methods in the type returned
10619/// by [builder()][RegionHealthCheckServices::builder]. The default configuration should
10620/// work for most applications. Common configuration changes include
10621///
10622/// * [with_endpoint()]: by default this client uses the global default endpoint
10623///   (`https://compute.googleapis.com`). Applications using regional
10624///   endpoints or running in restricted networks (e.g. a network configured
10625//    with [Private Google Access with VPC Service Controls]) may want to
10626///   override this default.
10627/// * [with_credentials()]: by default this client uses
10628///   [Application Default Credentials]. Applications using custom
10629///   authentication may need to override this default.
10630///
10631/// [with_endpoint()]: super::builder::region_health_check_services::ClientBuilder::with_endpoint
10632/// [with_credentials()]: super::builder::region_health_check_services::ClientBuilder::credentials
10633/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10634/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10635///
10636/// # Pooling and Cloning
10637///
10638/// `RegionHealthCheckServices` holds a connection pool internally, it is advised to
10639/// create one and the reuse it.  You do not need to wrap `RegionHealthCheckServices` in
10640/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10641/// already uses an `Arc` internally.
10642#[cfg(feature = "region-health-check-services")]
10643#[cfg_attr(docsrs, doc(cfg(feature = "region-health-check-services")))]
10644#[derive(Clone, Debug)]
10645pub struct RegionHealthCheckServices {
10646    inner: std::sync::Arc<dyn super::stub::dynamic::RegionHealthCheckServices>,
10647}
10648
10649#[cfg(feature = "region-health-check-services")]
10650impl RegionHealthCheckServices {
10651    /// Returns a builder for [RegionHealthCheckServices].
10652    ///
10653    /// ```
10654    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10655    /// # use google_cloud_compute_v1::client::RegionHealthCheckServices;
10656    /// let client = RegionHealthCheckServices::builder().build().await?;
10657    /// # Ok(()) }
10658    /// ```
10659    pub fn builder() -> super::builder::region_health_check_services::ClientBuilder {
10660        crate::new_client_builder(super::builder::region_health_check_services::client::Factory)
10661    }
10662
10663    /// Creates a new client from the provided stub.
10664    ///
10665    /// The most common case for calling this function is in tests mocking the
10666    /// client's behavior.
10667    pub fn from_stub<T>(stub: T) -> Self
10668    where
10669        T: super::stub::RegionHealthCheckServices + 'static,
10670    {
10671        Self {
10672            inner: std::sync::Arc::new(stub),
10673        }
10674    }
10675
10676    pub(crate) async fn new(
10677        config: gaxi::options::ClientConfig,
10678    ) -> crate::ClientBuilderResult<Self> {
10679        let inner = Self::build_inner(config).await?;
10680        Ok(Self { inner })
10681    }
10682
10683    async fn build_inner(
10684        conf: gaxi::options::ClientConfig,
10685    ) -> crate::ClientBuilderResult<
10686        std::sync::Arc<dyn super::stub::dynamic::RegionHealthCheckServices>,
10687    > {
10688        if gaxi::options::tracing_enabled(&conf) {
10689            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10690        }
10691        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10692    }
10693
10694    async fn build_transport(
10695        conf: gaxi::options::ClientConfig,
10696    ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthCheckServices> {
10697        super::transport::RegionHealthCheckServices::new(conf).await
10698    }
10699
10700    async fn build_with_tracing(
10701        conf: gaxi::options::ClientConfig,
10702    ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthCheckServices> {
10703        Self::build_transport(conf)
10704            .await
10705            .map(super::tracing::RegionHealthCheckServices::new)
10706    }
10707
10708    /// Deletes the specified regional HealthCheckService.
10709    pub fn delete(&self) -> super::builder::region_health_check_services::Delete {
10710        super::builder::region_health_check_services::Delete::new(self.inner.clone())
10711    }
10712
10713    /// Returns the specified regional HealthCheckService resource.
10714    pub fn get(&self) -> super::builder::region_health_check_services::Get {
10715        super::builder::region_health_check_services::Get::new(self.inner.clone())
10716    }
10717
10718    /// Creates a regional HealthCheckService resource in the
10719    /// specified project and region using the data included in the request.
10720    pub fn insert(&self) -> super::builder::region_health_check_services::Insert {
10721        super::builder::region_health_check_services::Insert::new(self.inner.clone())
10722    }
10723
10724    /// Lists all the HealthCheckService resources that have been
10725    /// configured for the specified project in the given region.
10726    pub fn list(&self) -> super::builder::region_health_check_services::List {
10727        super::builder::region_health_check_services::List::new(self.inner.clone())
10728    }
10729
10730    /// Updates the specified regional HealthCheckService resource
10731    /// with the data included in the request.  This method supportsPATCH
10732    /// semantics and uses theJSON merge
10733    /// patch format and processing rules.
10734    pub fn patch(&self) -> super::builder::region_health_check_services::Patch {
10735        super::builder::region_health_check_services::Patch::new(self.inner.clone())
10736    }
10737
10738    /// Returns permissions that a caller has on the specified resource.
10739    pub fn test_iam_permissions(
10740        &self,
10741    ) -> super::builder::region_health_check_services::TestIamPermissions {
10742        super::builder::region_health_check_services::TestIamPermissions::new(self.inner.clone())
10743    }
10744
10745    /// Retrieves the specified region-specific Operations resource.
10746    pub fn get_operation(&self) -> super::builder::region_health_check_services::GetOperation {
10747        super::builder::region_health_check_services::GetOperation::new(self.inner.clone())
10748    }
10749}
10750
10751/// Implements a client for the Google Compute Engine API.
10752///
10753/// # Example
10754/// ```
10755/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10756/// # use google_cloud_compute_v1::client::RegionHealthChecks;
10757/// let client = RegionHealthChecks::builder().build().await?;
10758/// // use `client` to make requests to the Google Compute Engine API.
10759/// # Ok(()) }
10760/// ```
10761///
10762/// # Service Description
10763///
10764/// Service for the `regionHealthChecks` resource.
10765///
10766/// # Configuration
10767///
10768/// To configure `RegionHealthChecks` use the `with_*` methods in the type returned
10769/// by [builder()][RegionHealthChecks::builder]. The default configuration should
10770/// work for most applications. Common configuration changes include
10771///
10772/// * [with_endpoint()]: by default this client uses the global default endpoint
10773///   (`https://compute.googleapis.com`). Applications using regional
10774///   endpoints or running in restricted networks (e.g. a network configured
10775//    with [Private Google Access with VPC Service Controls]) may want to
10776///   override this default.
10777/// * [with_credentials()]: by default this client uses
10778///   [Application Default Credentials]. Applications using custom
10779///   authentication may need to override this default.
10780///
10781/// [with_endpoint()]: super::builder::region_health_checks::ClientBuilder::with_endpoint
10782/// [with_credentials()]: super::builder::region_health_checks::ClientBuilder::credentials
10783/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10784/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10785///
10786/// # Pooling and Cloning
10787///
10788/// `RegionHealthChecks` holds a connection pool internally, it is advised to
10789/// create one and the reuse it.  You do not need to wrap `RegionHealthChecks` in
10790/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10791/// already uses an `Arc` internally.
10792#[cfg(feature = "region-health-checks")]
10793#[cfg_attr(docsrs, doc(cfg(feature = "region-health-checks")))]
10794#[derive(Clone, Debug)]
10795pub struct RegionHealthChecks {
10796    inner: std::sync::Arc<dyn super::stub::dynamic::RegionHealthChecks>,
10797}
10798
10799#[cfg(feature = "region-health-checks")]
10800impl RegionHealthChecks {
10801    /// Returns a builder for [RegionHealthChecks].
10802    ///
10803    /// ```
10804    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10805    /// # use google_cloud_compute_v1::client::RegionHealthChecks;
10806    /// let client = RegionHealthChecks::builder().build().await?;
10807    /// # Ok(()) }
10808    /// ```
10809    pub fn builder() -> super::builder::region_health_checks::ClientBuilder {
10810        crate::new_client_builder(super::builder::region_health_checks::client::Factory)
10811    }
10812
10813    /// Creates a new client from the provided stub.
10814    ///
10815    /// The most common case for calling this function is in tests mocking the
10816    /// client's behavior.
10817    pub fn from_stub<T>(stub: T) -> Self
10818    where
10819        T: super::stub::RegionHealthChecks + 'static,
10820    {
10821        Self {
10822            inner: std::sync::Arc::new(stub),
10823        }
10824    }
10825
10826    pub(crate) async fn new(
10827        config: gaxi::options::ClientConfig,
10828    ) -> crate::ClientBuilderResult<Self> {
10829        let inner = Self::build_inner(config).await?;
10830        Ok(Self { inner })
10831    }
10832
10833    async fn build_inner(
10834        conf: gaxi::options::ClientConfig,
10835    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionHealthChecks>>
10836    {
10837        if gaxi::options::tracing_enabled(&conf) {
10838            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10839        }
10840        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10841    }
10842
10843    async fn build_transport(
10844        conf: gaxi::options::ClientConfig,
10845    ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthChecks> {
10846        super::transport::RegionHealthChecks::new(conf).await
10847    }
10848
10849    async fn build_with_tracing(
10850        conf: gaxi::options::ClientConfig,
10851    ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthChecks> {
10852        Self::build_transport(conf)
10853            .await
10854            .map(super::tracing::RegionHealthChecks::new)
10855    }
10856
10857    /// Deletes the specified HealthCheck resource.
10858    pub fn delete(&self) -> super::builder::region_health_checks::Delete {
10859        super::builder::region_health_checks::Delete::new(self.inner.clone())
10860    }
10861
10862    /// Returns the specified HealthCheck resource.
10863    pub fn get(&self) -> super::builder::region_health_checks::Get {
10864        super::builder::region_health_checks::Get::new(self.inner.clone())
10865    }
10866
10867    /// Creates a HealthCheck resource in the specified project using the data
10868    /// included in the request.
10869    pub fn insert(&self) -> super::builder::region_health_checks::Insert {
10870        super::builder::region_health_checks::Insert::new(self.inner.clone())
10871    }
10872
10873    /// Retrieves the list of HealthCheck resources available to the specified
10874    /// project.
10875    pub fn list(&self) -> super::builder::region_health_checks::List {
10876        super::builder::region_health_checks::List::new(self.inner.clone())
10877    }
10878
10879    /// Updates a HealthCheck resource in the specified project using the data
10880    /// included in the request. This method supportsPATCH
10881    /// semantics and uses theJSON merge
10882    /// patch format and processing rules.
10883    pub fn patch(&self) -> super::builder::region_health_checks::Patch {
10884        super::builder::region_health_checks::Patch::new(self.inner.clone())
10885    }
10886
10887    /// Returns permissions that a caller has on the specified resource.
10888    pub fn test_iam_permissions(&self) -> super::builder::region_health_checks::TestIamPermissions {
10889        super::builder::region_health_checks::TestIamPermissions::new(self.inner.clone())
10890    }
10891
10892    /// Updates a HealthCheck resource in the specified project using the data
10893    /// included in the request.
10894    pub fn update(&self) -> super::builder::region_health_checks::Update {
10895        super::builder::region_health_checks::Update::new(self.inner.clone())
10896    }
10897
10898    /// Retrieves the specified region-specific Operations resource.
10899    pub fn get_operation(&self) -> super::builder::region_health_checks::GetOperation {
10900        super::builder::region_health_checks::GetOperation::new(self.inner.clone())
10901    }
10902}
10903
10904/// Implements a client for the Google Compute Engine API.
10905///
10906/// # Example
10907/// ```
10908/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10909/// # use google_cloud_compute_v1::client::RegionInstanceGroupManagers;
10910/// let client = RegionInstanceGroupManagers::builder().build().await?;
10911/// // use `client` to make requests to the Google Compute Engine API.
10912/// # Ok(()) }
10913/// ```
10914///
10915/// # Service Description
10916///
10917/// Service for the `regionInstanceGroupManagers` resource.
10918///
10919/// # Configuration
10920///
10921/// To configure `RegionInstanceGroupManagers` use the `with_*` methods in the type returned
10922/// by [builder()][RegionInstanceGroupManagers::builder]. The default configuration should
10923/// work for most applications. Common configuration changes include
10924///
10925/// * [with_endpoint()]: by default this client uses the global default endpoint
10926///   (`https://compute.googleapis.com`). Applications using regional
10927///   endpoints or running in restricted networks (e.g. a network configured
10928//    with [Private Google Access with VPC Service Controls]) may want to
10929///   override this default.
10930/// * [with_credentials()]: by default this client uses
10931///   [Application Default Credentials]. Applications using custom
10932///   authentication may need to override this default.
10933///
10934/// [with_endpoint()]: super::builder::region_instance_group_managers::ClientBuilder::with_endpoint
10935/// [with_credentials()]: super::builder::region_instance_group_managers::ClientBuilder::credentials
10936/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10937/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10938///
10939/// # Pooling and Cloning
10940///
10941/// `RegionInstanceGroupManagers` holds a connection pool internally, it is advised to
10942/// create one and the reuse it.  You do not need to wrap `RegionInstanceGroupManagers` in
10943/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10944/// already uses an `Arc` internally.
10945#[cfg(feature = "region-instance-group-managers")]
10946#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-group-managers")))]
10947#[derive(Clone, Debug)]
10948pub struct RegionInstanceGroupManagers {
10949    inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroupManagers>,
10950}
10951
10952#[cfg(feature = "region-instance-group-managers")]
10953impl RegionInstanceGroupManagers {
10954    /// Returns a builder for [RegionInstanceGroupManagers].
10955    ///
10956    /// ```
10957    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10958    /// # use google_cloud_compute_v1::client::RegionInstanceGroupManagers;
10959    /// let client = RegionInstanceGroupManagers::builder().build().await?;
10960    /// # Ok(()) }
10961    /// ```
10962    pub fn builder() -> super::builder::region_instance_group_managers::ClientBuilder {
10963        crate::new_client_builder(super::builder::region_instance_group_managers::client::Factory)
10964    }
10965
10966    /// Creates a new client from the provided stub.
10967    ///
10968    /// The most common case for calling this function is in tests mocking the
10969    /// client's behavior.
10970    pub fn from_stub<T>(stub: T) -> Self
10971    where
10972        T: super::stub::RegionInstanceGroupManagers + 'static,
10973    {
10974        Self {
10975            inner: std::sync::Arc::new(stub),
10976        }
10977    }
10978
10979    pub(crate) async fn new(
10980        config: gaxi::options::ClientConfig,
10981    ) -> crate::ClientBuilderResult<Self> {
10982        let inner = Self::build_inner(config).await?;
10983        Ok(Self { inner })
10984    }
10985
10986    async fn build_inner(
10987        conf: gaxi::options::ClientConfig,
10988    ) -> crate::ClientBuilderResult<
10989        std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroupManagers>,
10990    > {
10991        if gaxi::options::tracing_enabled(&conf) {
10992            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10993        }
10994        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10995    }
10996
10997    async fn build_transport(
10998        conf: gaxi::options::ClientConfig,
10999    ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroupManagers> {
11000        super::transport::RegionInstanceGroupManagers::new(conf).await
11001    }
11002
11003    async fn build_with_tracing(
11004        conf: gaxi::options::ClientConfig,
11005    ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroupManagers> {
11006        Self::build_transport(conf)
11007            .await
11008            .map(super::tracing::RegionInstanceGroupManagers::new)
11009    }
11010
11011    /// Flags the specified instances to be immediately removed from the managed
11012    /// instance group. Abandoning an instance does not delete the
11013    /// instance, but it does remove the instance from any target pools that are
11014    /// applied by the managed instance group. This method reduces thetargetSize of the managed instance group by the
11015    /// number of instances that you abandon. This operation is marked asDONE when the action is scheduled even if the instances have
11016    /// not yet been removed from the group. You must separately verify the
11017    /// status of the abandoning action with thelistmanagedinstances
11018    /// method.
11019    ///
11020    /// If the group is part of a backend
11021    /// service that has enabled
11022    /// connection draining, it can take up to 60 seconds after the connection
11023    /// draining duration has elapsed before the VM instance is removed or deleted.
11024    ///
11025    /// You can specify a maximum of 1000 instances with this method per request.
11026    pub fn abandon_instances(
11027        &self,
11028    ) -> super::builder::region_instance_group_managers::AbandonInstances {
11029        super::builder::region_instance_group_managers::AbandonInstances::new(self.inner.clone())
11030    }
11031
11032    /// Apply updates to selected instances the managed instance group.
11033    pub fn apply_updates_to_instances(
11034        &self,
11035    ) -> super::builder::region_instance_group_managers::ApplyUpdatesToInstances {
11036        super::builder::region_instance_group_managers::ApplyUpdatesToInstances::new(
11037            self.inner.clone(),
11038        )
11039    }
11040
11041    /// Creates instances with per-instance configurations in this regional managed
11042    /// instance group. Instances are created using the current instance template.
11043    /// The create instances operation is marked DONE if
11044    /// the createInstances request is successful. The underlying
11045    /// actions take additional time. You must separately verify the status of thecreating or actions with the listmanagedinstances
11046    /// method.
11047    pub fn create_instances(
11048        &self,
11049    ) -> super::builder::region_instance_group_managers::CreateInstances {
11050        super::builder::region_instance_group_managers::CreateInstances::new(self.inner.clone())
11051    }
11052
11053    /// Deletes the specified managed instance group and all of the instances
11054    /// in that group.
11055    pub fn delete(&self) -> super::builder::region_instance_group_managers::Delete {
11056        super::builder::region_instance_group_managers::Delete::new(self.inner.clone())
11057    }
11058
11059    /// Flags the specified instances in the managed instance group to be
11060    /// immediately deleted. The instances are also removed from any target
11061    /// pools of which they were a member. This method reduces thetargetSize of the managed instance group by the number of
11062    /// instances that you delete.
11063    /// The deleteInstances operation is marked DONE if
11064    /// the deleteInstances request is successful. The underlying
11065    /// actions take additional time. You must separately verify the status of thedeleting action with thelistmanagedinstances
11066    /// method.
11067    ///
11068    /// If the group is part of a backend
11069    /// service that has enabled
11070    /// connection draining, it can take up to 60 seconds after the connection
11071    /// draining duration has elapsed before the VM instance is removed or deleted.
11072    ///
11073    /// You can specify a maximum of 1000 instances with this method per request.
11074    pub fn delete_instances(
11075        &self,
11076    ) -> super::builder::region_instance_group_managers::DeleteInstances {
11077        super::builder::region_instance_group_managers::DeleteInstances::new(self.inner.clone())
11078    }
11079
11080    /// Deletes selected per-instance configurations for the managed instance
11081    /// group.
11082    pub fn delete_per_instance_configs(
11083        &self,
11084    ) -> super::builder::region_instance_group_managers::DeletePerInstanceConfigs {
11085        super::builder::region_instance_group_managers::DeletePerInstanceConfigs::new(
11086            self.inner.clone(),
11087        )
11088    }
11089
11090    /// Returns all of the details about the specified managed instance group.
11091    pub fn get(&self) -> super::builder::region_instance_group_managers::Get {
11092        super::builder::region_instance_group_managers::Get::new(self.inner.clone())
11093    }
11094
11095    /// Creates a managed instance group using the information that you specify
11096    /// in the request. After the group is created, instances in the group are
11097    /// created using the specified instance template.
11098    /// This operation is marked as DONE when the group is created
11099    /// even if the instances in the group have not yet been created. You must
11100    /// separately verify the status of the individual instances with thelistmanagedinstances
11101    /// method.
11102    ///
11103    /// A regional managed instance group can contain up to 2000 instances.
11104    pub fn insert(&self) -> super::builder::region_instance_group_managers::Insert {
11105        super::builder::region_instance_group_managers::Insert::new(self.inner.clone())
11106    }
11107
11108    /// Retrieves the list of managed instance groups that are contained
11109    /// within the specified region.
11110    pub fn list(&self) -> super::builder::region_instance_group_managers::List {
11111        super::builder::region_instance_group_managers::List::new(self.inner.clone())
11112    }
11113
11114    /// Lists all errors thrown by actions on instances for a given regional
11115    /// managed instance group. The filter andorderBy query parameters are not supported.
11116    pub fn list_errors(&self) -> super::builder::region_instance_group_managers::ListErrors {
11117        super::builder::region_instance_group_managers::ListErrors::new(self.inner.clone())
11118    }
11119
11120    /// Lists the instances in the managed instance group and instances that are
11121    /// scheduled to be created. The list includes any current actions
11122    /// that the group has scheduled for its instances. The orderBy
11123    /// query parameter is not supported.   The `pageToken` query parameter is
11124    /// supported only if the group's `listManagedInstancesResults` field is set
11125    /// to `PAGINATED`.
11126    pub fn list_managed_instances(
11127        &self,
11128    ) -> super::builder::region_instance_group_managers::ListManagedInstances {
11129        super::builder::region_instance_group_managers::ListManagedInstances::new(
11130            self.inner.clone(),
11131        )
11132    }
11133
11134    /// Lists all of the per-instance configurations defined for the managed
11135    /// instance group. The orderBy query parameter is not supported.
11136    pub fn list_per_instance_configs(
11137        &self,
11138    ) -> super::builder::region_instance_group_managers::ListPerInstanceConfigs {
11139        super::builder::region_instance_group_managers::ListPerInstanceConfigs::new(
11140            self.inner.clone(),
11141        )
11142    }
11143
11144    /// Updates a managed instance group using the information that you specify
11145    /// in the request.
11146    /// This operation is marked as DONE when the group is patched
11147    /// even if the instances in the group are still in the process of being
11148    /// patched. You must separately verify the status of the individual instances
11149    /// with the listmanagedinstances
11150    /// method. This method supportsPATCH
11151    /// semantics and uses theJSON merge
11152    /// patch format and processing rules.
11153    ///
11154    /// If you update your group to specify a new template or instance
11155    /// configuration, it's possible that your intended specification for each VM
11156    /// in the group is different from the current state of that VM. To learn how
11157    /// to apply an updated configuration to the VMs in a MIG, seeUpdating instances in
11158    /// a MIG.
11159    pub fn patch(&self) -> super::builder::region_instance_group_managers::Patch {
11160        super::builder::region_instance_group_managers::Patch::new(self.inner.clone())
11161    }
11162
11163    /// Inserts or patches per-instance configurations for the managed instance
11164    /// group. perInstanceConfig.name serves as a key used to
11165    /// distinguish whether to perform insert or patch.
11166    pub fn patch_per_instance_configs(
11167        &self,
11168    ) -> super::builder::region_instance_group_managers::PatchPerInstanceConfigs {
11169        super::builder::region_instance_group_managers::PatchPerInstanceConfigs::new(
11170            self.inner.clone(),
11171        )
11172    }
11173
11174    /// Flags the specified VM instances in the managed instance group to be
11175    /// immediately recreated. Each instance is recreated using the group's current
11176    /// configuration. This operation is marked as DONE when the flag
11177    /// is set even if the instances have not yet been recreated. You must
11178    /// separately verify the status of each instance by checking itscurrentAction field; for more information, see Checking
11179    /// the status of managed instances.
11180    ///
11181    /// If the group is part of a backend
11182    /// service that has enabled
11183    /// connection draining, it can take up to 60 seconds after the connection
11184    /// draining duration has elapsed before the VM instance is removed or deleted.
11185    ///
11186    /// You can specify a maximum of 1000 instances with this method per request.
11187    pub fn recreate_instances(
11188        &self,
11189    ) -> super::builder::region_instance_group_managers::RecreateInstances {
11190        super::builder::region_instance_group_managers::RecreateInstances::new(self.inner.clone())
11191    }
11192
11193    /// Changes the intended size of the managed instance group. If you increase
11194    /// the size, the group creates new instances using the current instance
11195    /// template. If you decrease the size, the group deletes one or more
11196    /// instances.
11197    ///
11198    /// The resize operation is marked DONE if theresize request is successful. The underlying actions take
11199    /// additional time. You must separately verify the status of thecreating or deleting actions with thelistmanagedinstances
11200    /// method.
11201    ///
11202    /// If the group is part of a backend
11203    /// service that has enabled
11204    /// connection draining, it can take up to 60 seconds after the connection
11205    /// draining duration has elapsed before the VM instance is removed or deleted.
11206    pub fn resize(&self) -> super::builder::region_instance_group_managers::Resize {
11207        super::builder::region_instance_group_managers::Resize::new(self.inner.clone())
11208    }
11209
11210    /// Flags the specified instances in the managed instance group to be
11211    /// resumed. This method increases thetargetSize and decreases the targetSuspendedSize
11212    /// of the managed instance group by the number of instances that you resume.
11213    /// The resumeInstances operation is marked DONE if
11214    /// the resumeInstances request is successful. The underlying
11215    /// actions take additional time. You must separately verify the status of theRESUMING action with thelistmanagedinstances
11216    /// method.
11217    ///
11218    /// In this request, you can only specify instances that are suspended. For
11219    /// example, if an instance was previously suspended using the suspendInstances
11220    /// method, it can be resumed using the resumeInstances method.
11221    ///
11222    /// If a health check is attached to the managed instance group, the specified
11223    /// instances will be verified as healthy after they are resumed.
11224    ///
11225    /// You can specify a maximum of 1000 instances with this method per request.
11226    pub fn resume_instances(
11227        &self,
11228    ) -> super::builder::region_instance_group_managers::ResumeInstances {
11229        super::builder::region_instance_group_managers::ResumeInstances::new(self.inner.clone())
11230    }
11231
11232    /// Sets the instance template to use when creating new instances or recreating
11233    /// instances in this group. Existing instances are not affected.
11234    pub fn set_instance_template(
11235        &self,
11236    ) -> super::builder::region_instance_group_managers::SetInstanceTemplate {
11237        super::builder::region_instance_group_managers::SetInstanceTemplate::new(self.inner.clone())
11238    }
11239
11240    /// Modifies the target pools to which all new instances in this group are
11241    /// assigned. Existing instances in the group are not affected.
11242    pub fn set_target_pools(
11243        &self,
11244    ) -> super::builder::region_instance_group_managers::SetTargetPools {
11245        super::builder::region_instance_group_managers::SetTargetPools::new(self.inner.clone())
11246    }
11247
11248    /// Flags the specified instances in the managed instance group to be
11249    /// started. This method increases thetargetSize and decreases the targetStoppedSize
11250    /// of the managed instance group by the number of instances that you start.
11251    /// The startInstances operation is marked DONE if
11252    /// the startInstances request is successful. The underlying
11253    /// actions take additional time. You must separately verify the status of theSTARTING action with thelistmanagedinstances
11254    /// method.
11255    ///
11256    /// In this request, you can only specify instances that are stopped. For
11257    /// example, if an instance was previously stopped using the stopInstances
11258    /// method, it can be started using the startInstances method.
11259    ///
11260    /// If a health check is attached to the managed instance group, the specified
11261    /// instances will be verified as healthy after they are started.
11262    ///
11263    /// You can specify a maximum of 1000 instances with this method per request.
11264    pub fn start_instances(
11265        &self,
11266    ) -> super::builder::region_instance_group_managers::StartInstances {
11267        super::builder::region_instance_group_managers::StartInstances::new(self.inner.clone())
11268    }
11269
11270    /// Flags the specified instances in the managed instance group to be
11271    /// immediately stopped. You can only specify instances that are running in
11272    /// this request. This method reduces thetargetSize and increases the targetStoppedSize
11273    /// of the managed instance group by the number of instances that you stop.
11274    /// The stopInstances operation is marked DONE if
11275    /// the stopInstances request is successful. The underlying
11276    /// actions take additional time. You must separately verify the status of theSTOPPING action with thelistmanagedinstances
11277    /// method.
11278    ///
11279    /// If the standbyPolicy.initialDelaySec field is set, the group
11280    /// delays stopping the instances until initialDelaySec have
11281    /// passed from instance.creationTimestamp (that is, when the
11282    /// instance was created). This delay gives your application time to
11283    /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
11284    /// will be zero delay.
11285    ///
11286    /// If the group is part of a backend
11287    /// service that has enabled
11288    /// connection draining, it can take up to 60 seconds after the connection
11289    /// draining duration has elapsed before the VM instance is stopped.
11290    ///
11291    /// Stopped instances can be started using the startInstances
11292    /// method.
11293    ///
11294    /// You can specify a maximum of 1000 instances with this method per request.
11295    pub fn stop_instances(&self) -> super::builder::region_instance_group_managers::StopInstances {
11296        super::builder::region_instance_group_managers::StopInstances::new(self.inner.clone())
11297    }
11298
11299    /// Flags the specified instances in the managed instance group to be
11300    /// immediately suspended. You can only specify instances that are running in
11301    /// this request. This method reduces thetargetSize and increases the targetSuspendedSize
11302    /// of the managed instance group by the number of instances that you suspend.
11303    /// The suspendInstances operation is marked DONE if
11304    /// the suspendInstances request is successful. The underlying
11305    /// actions take additional time. You must separately verify the status of theSUSPENDING action with thelistmanagedinstances
11306    /// method.
11307    ///
11308    /// If the standbyPolicy.initialDelaySec field is set, the group
11309    /// delays suspension of the instances until initialDelaySec have
11310    /// passed from instance.creationTimestamp (that is, when the
11311    /// instance was created). This delay gives your application time to
11312    /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
11313    /// will be zero delay.
11314    ///
11315    /// If the group is part of a backend
11316    /// service that has enabled
11317    /// connection draining, it can take up to 60 seconds after the connection
11318    /// draining duration has elapsed before the VM instance is suspended.
11319    ///
11320    /// Suspended instances can be resumed using the resumeInstances
11321    /// method.
11322    ///
11323    /// You can specify a maximum of 1000 instances with this method per request.
11324    pub fn suspend_instances(
11325        &self,
11326    ) -> super::builder::region_instance_group_managers::SuspendInstances {
11327        super::builder::region_instance_group_managers::SuspendInstances::new(self.inner.clone())
11328    }
11329
11330    /// Inserts or updates per-instance configurations for the managed instance
11331    /// group. perInstanceConfig.name serves as a key used to
11332    /// distinguish whether to perform insert or patch.
11333    pub fn update_per_instance_configs(
11334        &self,
11335    ) -> super::builder::region_instance_group_managers::UpdatePerInstanceConfigs {
11336        super::builder::region_instance_group_managers::UpdatePerInstanceConfigs::new(
11337            self.inner.clone(),
11338        )
11339    }
11340
11341    /// Retrieves the specified region-specific Operations resource.
11342    pub fn get_operation(&self) -> super::builder::region_instance_group_managers::GetOperation {
11343        super::builder::region_instance_group_managers::GetOperation::new(self.inner.clone())
11344    }
11345}
11346
11347/// Implements a client for the Google Compute Engine API.
11348///
11349/// # Example
11350/// ```
11351/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11352/// # use google_cloud_compute_v1::client::RegionInstanceGroups;
11353/// let client = RegionInstanceGroups::builder().build().await?;
11354/// // use `client` to make requests to the Google Compute Engine API.
11355/// # Ok(()) }
11356/// ```
11357///
11358/// # Service Description
11359///
11360/// Service for the `regionInstanceGroups` resource.
11361///
11362/// # Configuration
11363///
11364/// To configure `RegionInstanceGroups` use the `with_*` methods in the type returned
11365/// by [builder()][RegionInstanceGroups::builder]. The default configuration should
11366/// work for most applications. Common configuration changes include
11367///
11368/// * [with_endpoint()]: by default this client uses the global default endpoint
11369///   (`https://compute.googleapis.com`). Applications using regional
11370///   endpoints or running in restricted networks (e.g. a network configured
11371//    with [Private Google Access with VPC Service Controls]) may want to
11372///   override this default.
11373/// * [with_credentials()]: by default this client uses
11374///   [Application Default Credentials]. Applications using custom
11375///   authentication may need to override this default.
11376///
11377/// [with_endpoint()]: super::builder::region_instance_groups::ClientBuilder::with_endpoint
11378/// [with_credentials()]: super::builder::region_instance_groups::ClientBuilder::credentials
11379/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11380/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11381///
11382/// # Pooling and Cloning
11383///
11384/// `RegionInstanceGroups` holds a connection pool internally, it is advised to
11385/// create one and the reuse it.  You do not need to wrap `RegionInstanceGroups` in
11386/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11387/// already uses an `Arc` internally.
11388#[cfg(feature = "region-instance-groups")]
11389#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-groups")))]
11390#[derive(Clone, Debug)]
11391pub struct RegionInstanceGroups {
11392    inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroups>,
11393}
11394
11395#[cfg(feature = "region-instance-groups")]
11396impl RegionInstanceGroups {
11397    /// Returns a builder for [RegionInstanceGroups].
11398    ///
11399    /// ```
11400    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11401    /// # use google_cloud_compute_v1::client::RegionInstanceGroups;
11402    /// let client = RegionInstanceGroups::builder().build().await?;
11403    /// # Ok(()) }
11404    /// ```
11405    pub fn builder() -> super::builder::region_instance_groups::ClientBuilder {
11406        crate::new_client_builder(super::builder::region_instance_groups::client::Factory)
11407    }
11408
11409    /// Creates a new client from the provided stub.
11410    ///
11411    /// The most common case for calling this function is in tests mocking the
11412    /// client's behavior.
11413    pub fn from_stub<T>(stub: T) -> Self
11414    where
11415        T: super::stub::RegionInstanceGroups + 'static,
11416    {
11417        Self {
11418            inner: std::sync::Arc::new(stub),
11419        }
11420    }
11421
11422    pub(crate) async fn new(
11423        config: gaxi::options::ClientConfig,
11424    ) -> crate::ClientBuilderResult<Self> {
11425        let inner = Self::build_inner(config).await?;
11426        Ok(Self { inner })
11427    }
11428
11429    async fn build_inner(
11430        conf: gaxi::options::ClientConfig,
11431    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroups>>
11432    {
11433        if gaxi::options::tracing_enabled(&conf) {
11434            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11435        }
11436        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11437    }
11438
11439    async fn build_transport(
11440        conf: gaxi::options::ClientConfig,
11441    ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroups> {
11442        super::transport::RegionInstanceGroups::new(conf).await
11443    }
11444
11445    async fn build_with_tracing(
11446        conf: gaxi::options::ClientConfig,
11447    ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroups> {
11448        Self::build_transport(conf)
11449            .await
11450            .map(super::tracing::RegionInstanceGroups::new)
11451    }
11452
11453    /// Returns the specified instance group resource.
11454    pub fn get(&self) -> super::builder::region_instance_groups::Get {
11455        super::builder::region_instance_groups::Get::new(self.inner.clone())
11456    }
11457
11458    /// Retrieves the list of instance group resources contained within
11459    /// the specified region.
11460    pub fn list(&self) -> super::builder::region_instance_groups::List {
11461        super::builder::region_instance_groups::List::new(self.inner.clone())
11462    }
11463
11464    /// Lists the instances in the specified instance group and displays
11465    /// information about the named ports. Depending on the specified options, this
11466    /// method can list all instances or only the instances that are running.
11467    /// The orderBy query parameter is not supported.
11468    pub fn list_instances(&self) -> super::builder::region_instance_groups::ListInstances {
11469        super::builder::region_instance_groups::ListInstances::new(self.inner.clone())
11470    }
11471
11472    /// Sets the named ports for the specified regional instance group.
11473    pub fn set_named_ports(&self) -> super::builder::region_instance_groups::SetNamedPorts {
11474        super::builder::region_instance_groups::SetNamedPorts::new(self.inner.clone())
11475    }
11476
11477    /// Returns permissions that a caller has on the specified resource.
11478    pub fn test_iam_permissions(
11479        &self,
11480    ) -> super::builder::region_instance_groups::TestIamPermissions {
11481        super::builder::region_instance_groups::TestIamPermissions::new(self.inner.clone())
11482    }
11483
11484    /// Retrieves the specified region-specific Operations resource.
11485    pub fn get_operation(&self) -> super::builder::region_instance_groups::GetOperation {
11486        super::builder::region_instance_groups::GetOperation::new(self.inner.clone())
11487    }
11488}
11489
11490/// Implements a client for the Google Compute Engine API.
11491///
11492/// # Example
11493/// ```
11494/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11495/// # use google_cloud_compute_v1::client::RegionInstanceTemplates;
11496/// let client = RegionInstanceTemplates::builder().build().await?;
11497/// // use `client` to make requests to the Google Compute Engine API.
11498/// # Ok(()) }
11499/// ```
11500///
11501/// # Service Description
11502///
11503/// Service for the `regionInstanceTemplates` resource.
11504///
11505/// # Configuration
11506///
11507/// To configure `RegionInstanceTemplates` use the `with_*` methods in the type returned
11508/// by [builder()][RegionInstanceTemplates::builder]. The default configuration should
11509/// work for most applications. Common configuration changes include
11510///
11511/// * [with_endpoint()]: by default this client uses the global default endpoint
11512///   (`https://compute.googleapis.com`). Applications using regional
11513///   endpoints or running in restricted networks (e.g. a network configured
11514//    with [Private Google Access with VPC Service Controls]) may want to
11515///   override this default.
11516/// * [with_credentials()]: by default this client uses
11517///   [Application Default Credentials]. Applications using custom
11518///   authentication may need to override this default.
11519///
11520/// [with_endpoint()]: super::builder::region_instance_templates::ClientBuilder::with_endpoint
11521/// [with_credentials()]: super::builder::region_instance_templates::ClientBuilder::credentials
11522/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11523/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11524///
11525/// # Pooling and Cloning
11526///
11527/// `RegionInstanceTemplates` holds a connection pool internally, it is advised to
11528/// create one and the reuse it.  You do not need to wrap `RegionInstanceTemplates` in
11529/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11530/// already uses an `Arc` internally.
11531#[cfg(feature = "region-instance-templates")]
11532#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-templates")))]
11533#[derive(Clone, Debug)]
11534pub struct RegionInstanceTemplates {
11535    inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceTemplates>,
11536}
11537
11538#[cfg(feature = "region-instance-templates")]
11539impl RegionInstanceTemplates {
11540    /// Returns a builder for [RegionInstanceTemplates].
11541    ///
11542    /// ```
11543    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11544    /// # use google_cloud_compute_v1::client::RegionInstanceTemplates;
11545    /// let client = RegionInstanceTemplates::builder().build().await?;
11546    /// # Ok(()) }
11547    /// ```
11548    pub fn builder() -> super::builder::region_instance_templates::ClientBuilder {
11549        crate::new_client_builder(super::builder::region_instance_templates::client::Factory)
11550    }
11551
11552    /// Creates a new client from the provided stub.
11553    ///
11554    /// The most common case for calling this function is in tests mocking the
11555    /// client's behavior.
11556    pub fn from_stub<T>(stub: T) -> Self
11557    where
11558        T: super::stub::RegionInstanceTemplates + 'static,
11559    {
11560        Self {
11561            inner: std::sync::Arc::new(stub),
11562        }
11563    }
11564
11565    pub(crate) async fn new(
11566        config: gaxi::options::ClientConfig,
11567    ) -> crate::ClientBuilderResult<Self> {
11568        let inner = Self::build_inner(config).await?;
11569        Ok(Self { inner })
11570    }
11571
11572    async fn build_inner(
11573        conf: gaxi::options::ClientConfig,
11574    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionInstanceTemplates>>
11575    {
11576        if gaxi::options::tracing_enabled(&conf) {
11577            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11578        }
11579        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11580    }
11581
11582    async fn build_transport(
11583        conf: gaxi::options::ClientConfig,
11584    ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceTemplates> {
11585        super::transport::RegionInstanceTemplates::new(conf).await
11586    }
11587
11588    async fn build_with_tracing(
11589        conf: gaxi::options::ClientConfig,
11590    ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceTemplates> {
11591        Self::build_transport(conf)
11592            .await
11593            .map(super::tracing::RegionInstanceTemplates::new)
11594    }
11595
11596    /// Deletes the specified instance template. Deleting an instance template is
11597    /// permanent and cannot be undone.
11598    pub fn delete(&self) -> super::builder::region_instance_templates::Delete {
11599        super::builder::region_instance_templates::Delete::new(self.inner.clone())
11600    }
11601
11602    /// Returns the specified instance template.
11603    pub fn get(&self) -> super::builder::region_instance_templates::Get {
11604        super::builder::region_instance_templates::Get::new(self.inner.clone())
11605    }
11606
11607    /// Creates an instance template in the specified project and region using the
11608    /// global instance template whose URL is included in the request.
11609    pub fn insert(&self) -> super::builder::region_instance_templates::Insert {
11610        super::builder::region_instance_templates::Insert::new(self.inner.clone())
11611    }
11612
11613    /// Retrieves a list of instance templates that are contained within the
11614    /// specified project and region.
11615    pub fn list(&self) -> super::builder::region_instance_templates::List {
11616        super::builder::region_instance_templates::List::new(self.inner.clone())
11617    }
11618
11619    /// Retrieves the specified region-specific Operations resource.
11620    pub fn get_operation(&self) -> super::builder::region_instance_templates::GetOperation {
11621        super::builder::region_instance_templates::GetOperation::new(self.inner.clone())
11622    }
11623}
11624
11625/// Implements a client for the Google Compute Engine API.
11626///
11627/// # Example
11628/// ```
11629/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11630/// # use google_cloud_compute_v1::client::RegionInstances;
11631/// let client = RegionInstances::builder().build().await?;
11632/// // use `client` to make requests to the Google Compute Engine API.
11633/// # Ok(()) }
11634/// ```
11635///
11636/// # Service Description
11637///
11638/// Service for the `regionInstances` resource.
11639///
11640/// # Configuration
11641///
11642/// To configure `RegionInstances` use the `with_*` methods in the type returned
11643/// by [builder()][RegionInstances::builder]. The default configuration should
11644/// work for most applications. Common configuration changes include
11645///
11646/// * [with_endpoint()]: by default this client uses the global default endpoint
11647///   (`https://compute.googleapis.com`). Applications using regional
11648///   endpoints or running in restricted networks (e.g. a network configured
11649//    with [Private Google Access with VPC Service Controls]) may want to
11650///   override this default.
11651/// * [with_credentials()]: by default this client uses
11652///   [Application Default Credentials]. Applications using custom
11653///   authentication may need to override this default.
11654///
11655/// [with_endpoint()]: super::builder::region_instances::ClientBuilder::with_endpoint
11656/// [with_credentials()]: super::builder::region_instances::ClientBuilder::credentials
11657/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11658/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11659///
11660/// # Pooling and Cloning
11661///
11662/// `RegionInstances` holds a connection pool internally, it is advised to
11663/// create one and the reuse it.  You do not need to wrap `RegionInstances` in
11664/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11665/// already uses an `Arc` internally.
11666#[cfg(feature = "region-instances")]
11667#[cfg_attr(docsrs, doc(cfg(feature = "region-instances")))]
11668#[derive(Clone, Debug)]
11669pub struct RegionInstances {
11670    inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstances>,
11671}
11672
11673#[cfg(feature = "region-instances")]
11674impl RegionInstances {
11675    /// Returns a builder for [RegionInstances].
11676    ///
11677    /// ```
11678    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11679    /// # use google_cloud_compute_v1::client::RegionInstances;
11680    /// let client = RegionInstances::builder().build().await?;
11681    /// # Ok(()) }
11682    /// ```
11683    pub fn builder() -> super::builder::region_instances::ClientBuilder {
11684        crate::new_client_builder(super::builder::region_instances::client::Factory)
11685    }
11686
11687    /// Creates a new client from the provided stub.
11688    ///
11689    /// The most common case for calling this function is in tests mocking the
11690    /// client's behavior.
11691    pub fn from_stub<T>(stub: T) -> Self
11692    where
11693        T: super::stub::RegionInstances + 'static,
11694    {
11695        Self {
11696            inner: std::sync::Arc::new(stub),
11697        }
11698    }
11699
11700    pub(crate) async fn new(
11701        config: gaxi::options::ClientConfig,
11702    ) -> crate::ClientBuilderResult<Self> {
11703        let inner = Self::build_inner(config).await?;
11704        Ok(Self { inner })
11705    }
11706
11707    async fn build_inner(
11708        conf: gaxi::options::ClientConfig,
11709    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionInstances>> {
11710        if gaxi::options::tracing_enabled(&conf) {
11711            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11712        }
11713        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11714    }
11715
11716    async fn build_transport(
11717        conf: gaxi::options::ClientConfig,
11718    ) -> crate::ClientBuilderResult<impl super::stub::RegionInstances> {
11719        super::transport::RegionInstances::new(conf).await
11720    }
11721
11722    async fn build_with_tracing(
11723        conf: gaxi::options::ClientConfig,
11724    ) -> crate::ClientBuilderResult<impl super::stub::RegionInstances> {
11725        Self::build_transport(conf)
11726            .await
11727            .map(super::tracing::RegionInstances::new)
11728    }
11729
11730    /// Creates multiple instances in a given region. Count specifies the number of
11731    /// instances to create.
11732    pub fn bulk_insert(&self) -> super::builder::region_instances::BulkInsert {
11733        super::builder::region_instances::BulkInsert::new(self.inner.clone())
11734    }
11735
11736    /// Retrieves the specified region-specific Operations resource.
11737    pub fn get_operation(&self) -> super::builder::region_instances::GetOperation {
11738        super::builder::region_instances::GetOperation::new(self.inner.clone())
11739    }
11740}
11741
11742/// Implements a client for the Google Compute Engine API.
11743///
11744/// # Example
11745/// ```
11746/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11747/// # use google_cloud_compute_v1::client::RegionInstantSnapshots;
11748/// let client = RegionInstantSnapshots::builder().build().await?;
11749/// // use `client` to make requests to the Google Compute Engine API.
11750/// # Ok(()) }
11751/// ```
11752///
11753/// # Service Description
11754///
11755/// Service for the `regionInstantSnapshots` resource.
11756///
11757/// # Configuration
11758///
11759/// To configure `RegionInstantSnapshots` use the `with_*` methods in the type returned
11760/// by [builder()][RegionInstantSnapshots::builder]. The default configuration should
11761/// work for most applications. Common configuration changes include
11762///
11763/// * [with_endpoint()]: by default this client uses the global default endpoint
11764///   (`https://compute.googleapis.com`). Applications using regional
11765///   endpoints or running in restricted networks (e.g. a network configured
11766//    with [Private Google Access with VPC Service Controls]) may want to
11767///   override this default.
11768/// * [with_credentials()]: by default this client uses
11769///   [Application Default Credentials]. Applications using custom
11770///   authentication may need to override this default.
11771///
11772/// [with_endpoint()]: super::builder::region_instant_snapshots::ClientBuilder::with_endpoint
11773/// [with_credentials()]: super::builder::region_instant_snapshots::ClientBuilder::credentials
11774/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11775/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11776///
11777/// # Pooling and Cloning
11778///
11779/// `RegionInstantSnapshots` holds a connection pool internally, it is advised to
11780/// create one and the reuse it.  You do not need to wrap `RegionInstantSnapshots` in
11781/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11782/// already uses an `Arc` internally.
11783#[cfg(feature = "region-instant-snapshots")]
11784#[cfg_attr(docsrs, doc(cfg(feature = "region-instant-snapshots")))]
11785#[derive(Clone, Debug)]
11786pub struct RegionInstantSnapshots {
11787    inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstantSnapshots>,
11788}
11789
11790#[cfg(feature = "region-instant-snapshots")]
11791impl RegionInstantSnapshots {
11792    /// Returns a builder for [RegionInstantSnapshots].
11793    ///
11794    /// ```
11795    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11796    /// # use google_cloud_compute_v1::client::RegionInstantSnapshots;
11797    /// let client = RegionInstantSnapshots::builder().build().await?;
11798    /// # Ok(()) }
11799    /// ```
11800    pub fn builder() -> super::builder::region_instant_snapshots::ClientBuilder {
11801        crate::new_client_builder(super::builder::region_instant_snapshots::client::Factory)
11802    }
11803
11804    /// Creates a new client from the provided stub.
11805    ///
11806    /// The most common case for calling this function is in tests mocking the
11807    /// client's behavior.
11808    pub fn from_stub<T>(stub: T) -> Self
11809    where
11810        T: super::stub::RegionInstantSnapshots + 'static,
11811    {
11812        Self {
11813            inner: std::sync::Arc::new(stub),
11814        }
11815    }
11816
11817    pub(crate) async fn new(
11818        config: gaxi::options::ClientConfig,
11819    ) -> crate::ClientBuilderResult<Self> {
11820        let inner = Self::build_inner(config).await?;
11821        Ok(Self { inner })
11822    }
11823
11824    async fn build_inner(
11825        conf: gaxi::options::ClientConfig,
11826    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionInstantSnapshots>>
11827    {
11828        if gaxi::options::tracing_enabled(&conf) {
11829            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11830        }
11831        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11832    }
11833
11834    async fn build_transport(
11835        conf: gaxi::options::ClientConfig,
11836    ) -> crate::ClientBuilderResult<impl super::stub::RegionInstantSnapshots> {
11837        super::transport::RegionInstantSnapshots::new(conf).await
11838    }
11839
11840    async fn build_with_tracing(
11841        conf: gaxi::options::ClientConfig,
11842    ) -> crate::ClientBuilderResult<impl super::stub::RegionInstantSnapshots> {
11843        Self::build_transport(conf)
11844            .await
11845            .map(super::tracing::RegionInstantSnapshots::new)
11846    }
11847
11848    /// Deletes the specified InstantSnapshot resource. Keep in mind that deleting
11849    /// a single instantSnapshot might not necessarily delete all the data on that
11850    /// instantSnapshot. If any data on the instantSnapshot that is marked for
11851    /// deletion is needed for subsequent instantSnapshots, the data will be moved
11852    /// to the next corresponding instantSnapshot.
11853    ///
11854    /// For more information, seeDeleting
11855    /// instantSnapshots.
11856    pub fn delete(&self) -> super::builder::region_instant_snapshots::Delete {
11857        super::builder::region_instant_snapshots::Delete::new(self.inner.clone())
11858    }
11859
11860    /// Returns the specified InstantSnapshot resource in the specified region.
11861    pub fn get(&self) -> super::builder::region_instant_snapshots::Get {
11862        super::builder::region_instant_snapshots::Get::new(self.inner.clone())
11863    }
11864
11865    /// Gets the access control policy for a resource. May be empty if no such
11866    /// policy or resource exists.
11867    pub fn get_iam_policy(&self) -> super::builder::region_instant_snapshots::GetIamPolicy {
11868        super::builder::region_instant_snapshots::GetIamPolicy::new(self.inner.clone())
11869    }
11870
11871    /// Creates an instant snapshot in the specified region.
11872    pub fn insert(&self) -> super::builder::region_instant_snapshots::Insert {
11873        super::builder::region_instant_snapshots::Insert::new(self.inner.clone())
11874    }
11875
11876    /// Retrieves the list of InstantSnapshot resources contained within
11877    /// the specified region.
11878    pub fn list(&self) -> super::builder::region_instant_snapshots::List {
11879        super::builder::region_instant_snapshots::List::new(self.inner.clone())
11880    }
11881
11882    /// Sets the access control policy on the specified resource.
11883    /// Replaces any existing policy.
11884    pub fn set_iam_policy(&self) -> super::builder::region_instant_snapshots::SetIamPolicy {
11885        super::builder::region_instant_snapshots::SetIamPolicy::new(self.inner.clone())
11886    }
11887
11888    /// Sets the labels on a instantSnapshot in the given region. To learn more
11889    /// about labels, read the Labeling
11890    /// Resources documentation.
11891    pub fn set_labels(&self) -> super::builder::region_instant_snapshots::SetLabels {
11892        super::builder::region_instant_snapshots::SetLabels::new(self.inner.clone())
11893    }
11894
11895    /// Returns permissions that a caller has on the specified resource.
11896    pub fn test_iam_permissions(
11897        &self,
11898    ) -> super::builder::region_instant_snapshots::TestIamPermissions {
11899        super::builder::region_instant_snapshots::TestIamPermissions::new(self.inner.clone())
11900    }
11901
11902    /// Retrieves the specified region-specific Operations resource.
11903    pub fn get_operation(&self) -> super::builder::region_instant_snapshots::GetOperation {
11904        super::builder::region_instant_snapshots::GetOperation::new(self.inner.clone())
11905    }
11906}
11907
11908/// Implements a client for the Google Compute Engine API.
11909///
11910/// # Example
11911/// ```
11912/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11913/// # use google_cloud_compute_v1::client::RegionNetworkEndpointGroups;
11914/// let client = RegionNetworkEndpointGroups::builder().build().await?;
11915/// // use `client` to make requests to the Google Compute Engine API.
11916/// # Ok(()) }
11917/// ```
11918///
11919/// # Service Description
11920///
11921/// Service for the `regionNetworkEndpointGroups` resource.
11922///
11923/// # Configuration
11924///
11925/// To configure `RegionNetworkEndpointGroups` use the `with_*` methods in the type returned
11926/// by [builder()][RegionNetworkEndpointGroups::builder]. The default configuration should
11927/// work for most applications. Common configuration changes include
11928///
11929/// * [with_endpoint()]: by default this client uses the global default endpoint
11930///   (`https://compute.googleapis.com`). Applications using regional
11931///   endpoints or running in restricted networks (e.g. a network configured
11932//    with [Private Google Access with VPC Service Controls]) may want to
11933///   override this default.
11934/// * [with_credentials()]: by default this client uses
11935///   [Application Default Credentials]. Applications using custom
11936///   authentication may need to override this default.
11937///
11938/// [with_endpoint()]: super::builder::region_network_endpoint_groups::ClientBuilder::with_endpoint
11939/// [with_credentials()]: super::builder::region_network_endpoint_groups::ClientBuilder::credentials
11940/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11941/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11942///
11943/// # Pooling and Cloning
11944///
11945/// `RegionNetworkEndpointGroups` holds a connection pool internally, it is advised to
11946/// create one and the reuse it.  You do not need to wrap `RegionNetworkEndpointGroups` in
11947/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11948/// already uses an `Arc` internally.
11949#[cfg(feature = "region-network-endpoint-groups")]
11950#[cfg_attr(docsrs, doc(cfg(feature = "region-network-endpoint-groups")))]
11951#[derive(Clone, Debug)]
11952pub struct RegionNetworkEndpointGroups {
11953    inner: std::sync::Arc<dyn super::stub::dynamic::RegionNetworkEndpointGroups>,
11954}
11955
11956#[cfg(feature = "region-network-endpoint-groups")]
11957impl RegionNetworkEndpointGroups {
11958    /// Returns a builder for [RegionNetworkEndpointGroups].
11959    ///
11960    /// ```
11961    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11962    /// # use google_cloud_compute_v1::client::RegionNetworkEndpointGroups;
11963    /// let client = RegionNetworkEndpointGroups::builder().build().await?;
11964    /// # Ok(()) }
11965    /// ```
11966    pub fn builder() -> super::builder::region_network_endpoint_groups::ClientBuilder {
11967        crate::new_client_builder(super::builder::region_network_endpoint_groups::client::Factory)
11968    }
11969
11970    /// Creates a new client from the provided stub.
11971    ///
11972    /// The most common case for calling this function is in tests mocking the
11973    /// client's behavior.
11974    pub fn from_stub<T>(stub: T) -> Self
11975    where
11976        T: super::stub::RegionNetworkEndpointGroups + 'static,
11977    {
11978        Self {
11979            inner: std::sync::Arc::new(stub),
11980        }
11981    }
11982
11983    pub(crate) async fn new(
11984        config: gaxi::options::ClientConfig,
11985    ) -> crate::ClientBuilderResult<Self> {
11986        let inner = Self::build_inner(config).await?;
11987        Ok(Self { inner })
11988    }
11989
11990    async fn build_inner(
11991        conf: gaxi::options::ClientConfig,
11992    ) -> crate::ClientBuilderResult<
11993        std::sync::Arc<dyn super::stub::dynamic::RegionNetworkEndpointGroups>,
11994    > {
11995        if gaxi::options::tracing_enabled(&conf) {
11996            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11997        }
11998        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11999    }
12000
12001    async fn build_transport(
12002        conf: gaxi::options::ClientConfig,
12003    ) -> crate::ClientBuilderResult<impl super::stub::RegionNetworkEndpointGroups> {
12004        super::transport::RegionNetworkEndpointGroups::new(conf).await
12005    }
12006
12007    async fn build_with_tracing(
12008        conf: gaxi::options::ClientConfig,
12009    ) -> crate::ClientBuilderResult<impl super::stub::RegionNetworkEndpointGroups> {
12010        Self::build_transport(conf)
12011            .await
12012            .map(super::tracing::RegionNetworkEndpointGroups::new)
12013    }
12014
12015    /// Attach a list of network endpoints to the specified network endpoint group.
12016    pub fn attach_network_endpoints(
12017        &self,
12018    ) -> super::builder::region_network_endpoint_groups::AttachNetworkEndpoints {
12019        super::builder::region_network_endpoint_groups::AttachNetworkEndpoints::new(
12020            self.inner.clone(),
12021        )
12022    }
12023
12024    /// Deletes the specified network endpoint group. Note that the NEG cannot be
12025    /// deleted if it is configured as a backend of a backend service.
12026    pub fn delete(&self) -> super::builder::region_network_endpoint_groups::Delete {
12027        super::builder::region_network_endpoint_groups::Delete::new(self.inner.clone())
12028    }
12029
12030    /// Detach the network endpoint from the specified network endpoint group.
12031    pub fn detach_network_endpoints(
12032        &self,
12033    ) -> super::builder::region_network_endpoint_groups::DetachNetworkEndpoints {
12034        super::builder::region_network_endpoint_groups::DetachNetworkEndpoints::new(
12035            self.inner.clone(),
12036        )
12037    }
12038
12039    /// Returns the specified network endpoint group.
12040    pub fn get(&self) -> super::builder::region_network_endpoint_groups::Get {
12041        super::builder::region_network_endpoint_groups::Get::new(self.inner.clone())
12042    }
12043
12044    /// Creates a network endpoint group in the specified project using the
12045    /// parameters that are included in the request.
12046    ///
12047    /// Note: Use the following APIs to manage network endpoint groups:
12048    ///
12049    /// - To manage NEGs with zonal scope (such as zonal NEGs, hybrid connectivity
12050    ///   NEGs): zonal
12051    ///   API
12052    /// - To manage NEGs with regional scope (such as regional internet NEGs,
12053    ///   serverless NEGs, Private Service Connect NEGs): regional
12054    ///   API
12055    /// - To manage NEGs with global scope (such as global internet NEGs):global
12056    ///   API
12057    pub fn insert(&self) -> super::builder::region_network_endpoint_groups::Insert {
12058        super::builder::region_network_endpoint_groups::Insert::new(self.inner.clone())
12059    }
12060
12061    /// Retrieves the list of regional network endpoint groups available to the
12062    /// specified project in the given region.
12063    pub fn list(&self) -> super::builder::region_network_endpoint_groups::List {
12064        super::builder::region_network_endpoint_groups::List::new(self.inner.clone())
12065    }
12066
12067    /// Lists the network endpoints in the specified network endpoint group.
12068    pub fn list_network_endpoints(
12069        &self,
12070    ) -> super::builder::region_network_endpoint_groups::ListNetworkEndpoints {
12071        super::builder::region_network_endpoint_groups::ListNetworkEndpoints::new(
12072            self.inner.clone(),
12073        )
12074    }
12075
12076    /// Retrieves the specified region-specific Operations resource.
12077    pub fn get_operation(&self) -> super::builder::region_network_endpoint_groups::GetOperation {
12078        super::builder::region_network_endpoint_groups::GetOperation::new(self.inner.clone())
12079    }
12080}
12081
12082/// Implements a client for the Google Compute Engine API.
12083///
12084/// # Example
12085/// ```
12086/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12087/// # use google_cloud_compute_v1::client::RegionNetworkFirewallPolicies;
12088/// let client = RegionNetworkFirewallPolicies::builder().build().await?;
12089/// // use `client` to make requests to the Google Compute Engine API.
12090/// # Ok(()) }
12091/// ```
12092///
12093/// # Service Description
12094///
12095/// Service for the `regionNetworkFirewallPolicies` resource.
12096///
12097/// # Configuration
12098///
12099/// To configure `RegionNetworkFirewallPolicies` use the `with_*` methods in the type returned
12100/// by [builder()][RegionNetworkFirewallPolicies::builder]. The default configuration should
12101/// work for most applications. Common configuration changes include
12102///
12103/// * [with_endpoint()]: by default this client uses the global default endpoint
12104///   (`https://compute.googleapis.com`). Applications using regional
12105///   endpoints or running in restricted networks (e.g. a network configured
12106//    with [Private Google Access with VPC Service Controls]) may want to
12107///   override this default.
12108/// * [with_credentials()]: by default this client uses
12109///   [Application Default Credentials]. Applications using custom
12110///   authentication may need to override this default.
12111///
12112/// [with_endpoint()]: super::builder::region_network_firewall_policies::ClientBuilder::with_endpoint
12113/// [with_credentials()]: super::builder::region_network_firewall_policies::ClientBuilder::credentials
12114/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12115/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12116///
12117/// # Pooling and Cloning
12118///
12119/// `RegionNetworkFirewallPolicies` holds a connection pool internally, it is advised to
12120/// create one and the reuse it.  You do not need to wrap `RegionNetworkFirewallPolicies` in
12121/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12122/// already uses an `Arc` internally.
12123#[cfg(feature = "region-network-firewall-policies")]
12124#[cfg_attr(docsrs, doc(cfg(feature = "region-network-firewall-policies")))]
12125#[derive(Clone, Debug)]
12126pub struct RegionNetworkFirewallPolicies {
12127    inner: std::sync::Arc<dyn super::stub::dynamic::RegionNetworkFirewallPolicies>,
12128}
12129
12130#[cfg(feature = "region-network-firewall-policies")]
12131impl RegionNetworkFirewallPolicies {
12132    /// Returns a builder for [RegionNetworkFirewallPolicies].
12133    ///
12134    /// ```
12135    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12136    /// # use google_cloud_compute_v1::client::RegionNetworkFirewallPolicies;
12137    /// let client = RegionNetworkFirewallPolicies::builder().build().await?;
12138    /// # Ok(()) }
12139    /// ```
12140    pub fn builder() -> super::builder::region_network_firewall_policies::ClientBuilder {
12141        crate::new_client_builder(super::builder::region_network_firewall_policies::client::Factory)
12142    }
12143
12144    /// Creates a new client from the provided stub.
12145    ///
12146    /// The most common case for calling this function is in tests mocking the
12147    /// client's behavior.
12148    pub fn from_stub<T>(stub: T) -> Self
12149    where
12150        T: super::stub::RegionNetworkFirewallPolicies + 'static,
12151    {
12152        Self {
12153            inner: std::sync::Arc::new(stub),
12154        }
12155    }
12156
12157    pub(crate) async fn new(
12158        config: gaxi::options::ClientConfig,
12159    ) -> crate::ClientBuilderResult<Self> {
12160        let inner = Self::build_inner(config).await?;
12161        Ok(Self { inner })
12162    }
12163
12164    async fn build_inner(
12165        conf: gaxi::options::ClientConfig,
12166    ) -> crate::ClientBuilderResult<
12167        std::sync::Arc<dyn super::stub::dynamic::RegionNetworkFirewallPolicies>,
12168    > {
12169        if gaxi::options::tracing_enabled(&conf) {
12170            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12171        }
12172        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12173    }
12174
12175    async fn build_transport(
12176        conf: gaxi::options::ClientConfig,
12177    ) -> crate::ClientBuilderResult<impl super::stub::RegionNetworkFirewallPolicies> {
12178        super::transport::RegionNetworkFirewallPolicies::new(conf).await
12179    }
12180
12181    async fn build_with_tracing(
12182        conf: gaxi::options::ClientConfig,
12183    ) -> crate::ClientBuilderResult<impl super::stub::RegionNetworkFirewallPolicies> {
12184        Self::build_transport(conf)
12185            .await
12186            .map(super::tracing::RegionNetworkFirewallPolicies::new)
12187    }
12188
12189    /// Inserts an association for the specified network firewall policy.
12190    pub fn add_association(
12191        &self,
12192    ) -> super::builder::region_network_firewall_policies::AddAssociation {
12193        super::builder::region_network_firewall_policies::AddAssociation::new(self.inner.clone())
12194    }
12195
12196    /// Inserts a rule into a network firewall policy.
12197    pub fn add_rule(&self) -> super::builder::region_network_firewall_policies::AddRule {
12198        super::builder::region_network_firewall_policies::AddRule::new(self.inner.clone())
12199    }
12200
12201    /// Copies rules to the specified network firewall policy.
12202    pub fn clone_rules(&self) -> super::builder::region_network_firewall_policies::CloneRules {
12203        super::builder::region_network_firewall_policies::CloneRules::new(self.inner.clone())
12204    }
12205
12206    /// Deletes the specified network firewall policy.
12207    pub fn delete(&self) -> super::builder::region_network_firewall_policies::Delete {
12208        super::builder::region_network_firewall_policies::Delete::new(self.inner.clone())
12209    }
12210
12211    /// Returns the specified network firewall policy.
12212    pub fn get(&self) -> super::builder::region_network_firewall_policies::Get {
12213        super::builder::region_network_firewall_policies::Get::new(self.inner.clone())
12214    }
12215
12216    /// Gets an association with the specified name.
12217    pub fn get_association(
12218        &self,
12219    ) -> super::builder::region_network_firewall_policies::GetAssociation {
12220        super::builder::region_network_firewall_policies::GetAssociation::new(self.inner.clone())
12221    }
12222
12223    /// Returns the effective firewalls on a given network.
12224    pub fn get_effective_firewalls(
12225        &self,
12226    ) -> super::builder::region_network_firewall_policies::GetEffectiveFirewalls {
12227        super::builder::region_network_firewall_policies::GetEffectiveFirewalls::new(
12228            self.inner.clone(),
12229        )
12230    }
12231
12232    /// Gets the access control policy for a resource. May be empty if no such
12233    /// policy or resource exists.
12234    pub fn get_iam_policy(&self) -> super::builder::region_network_firewall_policies::GetIamPolicy {
12235        super::builder::region_network_firewall_policies::GetIamPolicy::new(self.inner.clone())
12236    }
12237
12238    /// Gets a rule of the specified priority.
12239    pub fn get_rule(&self) -> super::builder::region_network_firewall_policies::GetRule {
12240        super::builder::region_network_firewall_policies::GetRule::new(self.inner.clone())
12241    }
12242
12243    /// Creates a new network firewall policy in the specified project and region.
12244    pub fn insert(&self) -> super::builder::region_network_firewall_policies::Insert {
12245        super::builder::region_network_firewall_policies::Insert::new(self.inner.clone())
12246    }
12247
12248    /// Lists all the network firewall policies that have been configured
12249    /// for the specified project in the given region.
12250    pub fn list(&self) -> super::builder::region_network_firewall_policies::List {
12251        super::builder::region_network_firewall_policies::List::new(self.inner.clone())
12252    }
12253
12254    /// Patches the specified network firewall policy.
12255    pub fn patch(&self) -> super::builder::region_network_firewall_policies::Patch {
12256        super::builder::region_network_firewall_policies::Patch::new(self.inner.clone())
12257    }
12258
12259    /// Patches a rule of the specified priority.
12260    pub fn patch_rule(&self) -> super::builder::region_network_firewall_policies::PatchRule {
12261        super::builder::region_network_firewall_policies::PatchRule::new(self.inner.clone())
12262    }
12263
12264    /// Removes an association for the specified network firewall policy.
12265    pub fn remove_association(
12266        &self,
12267    ) -> super::builder::region_network_firewall_policies::RemoveAssociation {
12268        super::builder::region_network_firewall_policies::RemoveAssociation::new(self.inner.clone())
12269    }
12270
12271    /// Deletes a rule of the specified priority.
12272    pub fn remove_rule(&self) -> super::builder::region_network_firewall_policies::RemoveRule {
12273        super::builder::region_network_firewall_policies::RemoveRule::new(self.inner.clone())
12274    }
12275
12276    /// Sets the access control policy on the specified resource.
12277    /// Replaces any existing policy.
12278    pub fn set_iam_policy(&self) -> super::builder::region_network_firewall_policies::SetIamPolicy {
12279        super::builder::region_network_firewall_policies::SetIamPolicy::new(self.inner.clone())
12280    }
12281
12282    /// Returns permissions that a caller has on the specified resource.
12283    pub fn test_iam_permissions(
12284        &self,
12285    ) -> super::builder::region_network_firewall_policies::TestIamPermissions {
12286        super::builder::region_network_firewall_policies::TestIamPermissions::new(
12287            self.inner.clone(),
12288        )
12289    }
12290
12291    /// Retrieves the specified region-specific Operations resource.
12292    pub fn get_operation(&self) -> super::builder::region_network_firewall_policies::GetOperation {
12293        super::builder::region_network_firewall_policies::GetOperation::new(self.inner.clone())
12294    }
12295}
12296
12297/// Implements a client for the Google Compute Engine API.
12298///
12299/// # Example
12300/// ```
12301/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12302/// # use google_cloud_compute_v1::client::RegionNotificationEndpoints;
12303/// let client = RegionNotificationEndpoints::builder().build().await?;
12304/// // use `client` to make requests to the Google Compute Engine API.
12305/// # Ok(()) }
12306/// ```
12307///
12308/// # Service Description
12309///
12310/// Service for the `regionNotificationEndpoints` resource.
12311///
12312/// # Configuration
12313///
12314/// To configure `RegionNotificationEndpoints` use the `with_*` methods in the type returned
12315/// by [builder()][RegionNotificationEndpoints::builder]. The default configuration should
12316/// work for most applications. Common configuration changes include
12317///
12318/// * [with_endpoint()]: by default this client uses the global default endpoint
12319///   (`https://compute.googleapis.com`). Applications using regional
12320///   endpoints or running in restricted networks (e.g. a network configured
12321//    with [Private Google Access with VPC Service Controls]) may want to
12322///   override this default.
12323/// * [with_credentials()]: by default this client uses
12324///   [Application Default Credentials]. Applications using custom
12325///   authentication may need to override this default.
12326///
12327/// [with_endpoint()]: super::builder::region_notification_endpoints::ClientBuilder::with_endpoint
12328/// [with_credentials()]: super::builder::region_notification_endpoints::ClientBuilder::credentials
12329/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12330/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12331///
12332/// # Pooling and Cloning
12333///
12334/// `RegionNotificationEndpoints` holds a connection pool internally, it is advised to
12335/// create one and the reuse it.  You do not need to wrap `RegionNotificationEndpoints` in
12336/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12337/// already uses an `Arc` internally.
12338#[cfg(feature = "region-notification-endpoints")]
12339#[cfg_attr(docsrs, doc(cfg(feature = "region-notification-endpoints")))]
12340#[derive(Clone, Debug)]
12341pub struct RegionNotificationEndpoints {
12342    inner: std::sync::Arc<dyn super::stub::dynamic::RegionNotificationEndpoints>,
12343}
12344
12345#[cfg(feature = "region-notification-endpoints")]
12346impl RegionNotificationEndpoints {
12347    /// Returns a builder for [RegionNotificationEndpoints].
12348    ///
12349    /// ```
12350    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12351    /// # use google_cloud_compute_v1::client::RegionNotificationEndpoints;
12352    /// let client = RegionNotificationEndpoints::builder().build().await?;
12353    /// # Ok(()) }
12354    /// ```
12355    pub fn builder() -> super::builder::region_notification_endpoints::ClientBuilder {
12356        crate::new_client_builder(super::builder::region_notification_endpoints::client::Factory)
12357    }
12358
12359    /// Creates a new client from the provided stub.
12360    ///
12361    /// The most common case for calling this function is in tests mocking the
12362    /// client's behavior.
12363    pub fn from_stub<T>(stub: T) -> Self
12364    where
12365        T: super::stub::RegionNotificationEndpoints + 'static,
12366    {
12367        Self {
12368            inner: std::sync::Arc::new(stub),
12369        }
12370    }
12371
12372    pub(crate) async fn new(
12373        config: gaxi::options::ClientConfig,
12374    ) -> crate::ClientBuilderResult<Self> {
12375        let inner = Self::build_inner(config).await?;
12376        Ok(Self { inner })
12377    }
12378
12379    async fn build_inner(
12380        conf: gaxi::options::ClientConfig,
12381    ) -> crate::ClientBuilderResult<
12382        std::sync::Arc<dyn super::stub::dynamic::RegionNotificationEndpoints>,
12383    > {
12384        if gaxi::options::tracing_enabled(&conf) {
12385            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12386        }
12387        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12388    }
12389
12390    async fn build_transport(
12391        conf: gaxi::options::ClientConfig,
12392    ) -> crate::ClientBuilderResult<impl super::stub::RegionNotificationEndpoints> {
12393        super::transport::RegionNotificationEndpoints::new(conf).await
12394    }
12395
12396    async fn build_with_tracing(
12397        conf: gaxi::options::ClientConfig,
12398    ) -> crate::ClientBuilderResult<impl super::stub::RegionNotificationEndpoints> {
12399        Self::build_transport(conf)
12400            .await
12401            .map(super::tracing::RegionNotificationEndpoints::new)
12402    }
12403
12404    /// Deletes the specified NotificationEndpoint in the given region
12405    pub fn delete(&self) -> super::builder::region_notification_endpoints::Delete {
12406        super::builder::region_notification_endpoints::Delete::new(self.inner.clone())
12407    }
12408
12409    /// Returns the specified NotificationEndpoint resource in the given region.
12410    pub fn get(&self) -> super::builder::region_notification_endpoints::Get {
12411        super::builder::region_notification_endpoints::Get::new(self.inner.clone())
12412    }
12413
12414    /// Create a NotificationEndpoint in the specified project in the given region
12415    /// using the parameters that are included in the request.
12416    pub fn insert(&self) -> super::builder::region_notification_endpoints::Insert {
12417        super::builder::region_notification_endpoints::Insert::new(self.inner.clone())
12418    }
12419
12420    /// Lists the NotificationEndpoints for a project in the given region.
12421    pub fn list(&self) -> super::builder::region_notification_endpoints::List {
12422        super::builder::region_notification_endpoints::List::new(self.inner.clone())
12423    }
12424
12425    /// Returns permissions that a caller has on the specified resource.
12426    pub fn test_iam_permissions(
12427        &self,
12428    ) -> super::builder::region_notification_endpoints::TestIamPermissions {
12429        super::builder::region_notification_endpoints::TestIamPermissions::new(self.inner.clone())
12430    }
12431
12432    /// Retrieves the specified region-specific Operations resource.
12433    pub fn get_operation(&self) -> super::builder::region_notification_endpoints::GetOperation {
12434        super::builder::region_notification_endpoints::GetOperation::new(self.inner.clone())
12435    }
12436}
12437
12438/// Implements a client for the Google Compute Engine API.
12439///
12440/// # Example
12441/// ```
12442/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12443/// # use google_cloud_compute_v1::client::RegionOperations;
12444/// let client = RegionOperations::builder().build().await?;
12445/// // use `client` to make requests to the Google Compute Engine API.
12446/// # Ok(()) }
12447/// ```
12448///
12449/// # Service Description
12450///
12451/// Service for the `regionOperations` resource.
12452///
12453/// # Configuration
12454///
12455/// To configure `RegionOperations` use the `with_*` methods in the type returned
12456/// by [builder()][RegionOperations::builder]. The default configuration should
12457/// work for most applications. Common configuration changes include
12458///
12459/// * [with_endpoint()]: by default this client uses the global default endpoint
12460///   (`https://compute.googleapis.com`). Applications using regional
12461///   endpoints or running in restricted networks (e.g. a network configured
12462//    with [Private Google Access with VPC Service Controls]) may want to
12463///   override this default.
12464/// * [with_credentials()]: by default this client uses
12465///   [Application Default Credentials]. Applications using custom
12466///   authentication may need to override this default.
12467///
12468/// [with_endpoint()]: super::builder::region_operations::ClientBuilder::with_endpoint
12469/// [with_credentials()]: super::builder::region_operations::ClientBuilder::credentials
12470/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12471/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12472///
12473/// # Pooling and Cloning
12474///
12475/// `RegionOperations` holds a connection pool internally, it is advised to
12476/// create one and the reuse it.  You do not need to wrap `RegionOperations` in
12477/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12478/// already uses an `Arc` internally.
12479#[cfg(feature = "region-operations")]
12480#[cfg_attr(docsrs, doc(cfg(feature = "region-operations")))]
12481#[derive(Clone, Debug)]
12482pub struct RegionOperations {
12483    inner: std::sync::Arc<dyn super::stub::dynamic::RegionOperations>,
12484}
12485
12486#[cfg(feature = "region-operations")]
12487impl RegionOperations {
12488    /// Returns a builder for [RegionOperations].
12489    ///
12490    /// ```
12491    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12492    /// # use google_cloud_compute_v1::client::RegionOperations;
12493    /// let client = RegionOperations::builder().build().await?;
12494    /// # Ok(()) }
12495    /// ```
12496    pub fn builder() -> super::builder::region_operations::ClientBuilder {
12497        crate::new_client_builder(super::builder::region_operations::client::Factory)
12498    }
12499
12500    /// Creates a new client from the provided stub.
12501    ///
12502    /// The most common case for calling this function is in tests mocking the
12503    /// client's behavior.
12504    pub fn from_stub<T>(stub: T) -> Self
12505    where
12506        T: super::stub::RegionOperations + 'static,
12507    {
12508        Self {
12509            inner: std::sync::Arc::new(stub),
12510        }
12511    }
12512
12513    pub(crate) async fn new(
12514        config: gaxi::options::ClientConfig,
12515    ) -> crate::ClientBuilderResult<Self> {
12516        let inner = Self::build_inner(config).await?;
12517        Ok(Self { inner })
12518    }
12519
12520    async fn build_inner(
12521        conf: gaxi::options::ClientConfig,
12522    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionOperations>>
12523    {
12524        if gaxi::options::tracing_enabled(&conf) {
12525            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12526        }
12527        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12528    }
12529
12530    async fn build_transport(
12531        conf: gaxi::options::ClientConfig,
12532    ) -> crate::ClientBuilderResult<impl super::stub::RegionOperations> {
12533        super::transport::RegionOperations::new(conf).await
12534    }
12535
12536    async fn build_with_tracing(
12537        conf: gaxi::options::ClientConfig,
12538    ) -> crate::ClientBuilderResult<impl super::stub::RegionOperations> {
12539        Self::build_transport(conf)
12540            .await
12541            .map(super::tracing::RegionOperations::new)
12542    }
12543
12544    /// Deletes the specified region-specific Operations resource.
12545    pub fn delete(&self) -> super::builder::region_operations::Delete {
12546        super::builder::region_operations::Delete::new(self.inner.clone())
12547    }
12548
12549    /// Retrieves the specified region-specific Operations resource.
12550    pub fn get(&self) -> super::builder::region_operations::Get {
12551        super::builder::region_operations::Get::new(self.inner.clone())
12552    }
12553
12554    /// Retrieves a list of Operation resources contained within
12555    /// the specified region.
12556    pub fn list(&self) -> super::builder::region_operations::List {
12557        super::builder::region_operations::List::new(self.inner.clone())
12558    }
12559
12560    /// Waits for the specified Operation resource to return as `DONE`
12561    /// or for the request to approach the 2 minute deadline, and retrieves the
12562    /// specified Operation resource. This method differs from the
12563    /// `GET` method in that it waits for no more than the default
12564    /// deadline (2 minutes) and then returns the current state of the operation,
12565    /// which might be `DONE` or still in progress.
12566    ///
12567    /// This method is called on a best-effort basis. Specifically:
12568    ///
12569    /// ```norust
12570    /// - In uncommon cases, when the server is overloaded, the request might
12571    /// return before the default deadline is reached, or might return after zero
12572    /// seconds.
12573    /// ```
12574    ///
12575    /// - If the default deadline is reached, there is no guarantee that the
12576    ///   operation is actually done when the method returns. Be prepared to retry
12577    ///   if the operation is not `DONE`.
12578    pub fn wait(&self) -> super::builder::region_operations::Wait {
12579        super::builder::region_operations::Wait::new(self.inner.clone())
12580    }
12581}
12582
12583/// Implements a client for the Google Compute Engine API.
12584///
12585/// # Example
12586/// ```
12587/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12588/// # use google_cloud_compute_v1::client::RegionSecurityPolicies;
12589/// let client = RegionSecurityPolicies::builder().build().await?;
12590/// // use `client` to make requests to the Google Compute Engine API.
12591/// # Ok(()) }
12592/// ```
12593///
12594/// # Service Description
12595///
12596/// Service for the `regionSecurityPolicies` resource.
12597///
12598/// # Configuration
12599///
12600/// To configure `RegionSecurityPolicies` use the `with_*` methods in the type returned
12601/// by [builder()][RegionSecurityPolicies::builder]. The default configuration should
12602/// work for most applications. Common configuration changes include
12603///
12604/// * [with_endpoint()]: by default this client uses the global default endpoint
12605///   (`https://compute.googleapis.com`). Applications using regional
12606///   endpoints or running in restricted networks (e.g. a network configured
12607//    with [Private Google Access with VPC Service Controls]) may want to
12608///   override this default.
12609/// * [with_credentials()]: by default this client uses
12610///   [Application Default Credentials]. Applications using custom
12611///   authentication may need to override this default.
12612///
12613/// [with_endpoint()]: super::builder::region_security_policies::ClientBuilder::with_endpoint
12614/// [with_credentials()]: super::builder::region_security_policies::ClientBuilder::credentials
12615/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12616/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12617///
12618/// # Pooling and Cloning
12619///
12620/// `RegionSecurityPolicies` holds a connection pool internally, it is advised to
12621/// create one and the reuse it.  You do not need to wrap `RegionSecurityPolicies` in
12622/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12623/// already uses an `Arc` internally.
12624#[cfg(feature = "region-security-policies")]
12625#[cfg_attr(docsrs, doc(cfg(feature = "region-security-policies")))]
12626#[derive(Clone, Debug)]
12627pub struct RegionSecurityPolicies {
12628    inner: std::sync::Arc<dyn super::stub::dynamic::RegionSecurityPolicies>,
12629}
12630
12631#[cfg(feature = "region-security-policies")]
12632impl RegionSecurityPolicies {
12633    /// Returns a builder for [RegionSecurityPolicies].
12634    ///
12635    /// ```
12636    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12637    /// # use google_cloud_compute_v1::client::RegionSecurityPolicies;
12638    /// let client = RegionSecurityPolicies::builder().build().await?;
12639    /// # Ok(()) }
12640    /// ```
12641    pub fn builder() -> super::builder::region_security_policies::ClientBuilder {
12642        crate::new_client_builder(super::builder::region_security_policies::client::Factory)
12643    }
12644
12645    /// Creates a new client from the provided stub.
12646    ///
12647    /// The most common case for calling this function is in tests mocking the
12648    /// client's behavior.
12649    pub fn from_stub<T>(stub: T) -> Self
12650    where
12651        T: super::stub::RegionSecurityPolicies + 'static,
12652    {
12653        Self {
12654            inner: std::sync::Arc::new(stub),
12655        }
12656    }
12657
12658    pub(crate) async fn new(
12659        config: gaxi::options::ClientConfig,
12660    ) -> crate::ClientBuilderResult<Self> {
12661        let inner = Self::build_inner(config).await?;
12662        Ok(Self { inner })
12663    }
12664
12665    async fn build_inner(
12666        conf: gaxi::options::ClientConfig,
12667    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionSecurityPolicies>>
12668    {
12669        if gaxi::options::tracing_enabled(&conf) {
12670            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12671        }
12672        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12673    }
12674
12675    async fn build_transport(
12676        conf: gaxi::options::ClientConfig,
12677    ) -> crate::ClientBuilderResult<impl super::stub::RegionSecurityPolicies> {
12678        super::transport::RegionSecurityPolicies::new(conf).await
12679    }
12680
12681    async fn build_with_tracing(
12682        conf: gaxi::options::ClientConfig,
12683    ) -> crate::ClientBuilderResult<impl super::stub::RegionSecurityPolicies> {
12684        Self::build_transport(conf)
12685            .await
12686            .map(super::tracing::RegionSecurityPolicies::new)
12687    }
12688
12689    /// Inserts a rule into a security policy.
12690    pub fn add_rule(&self) -> super::builder::region_security_policies::AddRule {
12691        super::builder::region_security_policies::AddRule::new(self.inner.clone())
12692    }
12693
12694    /// Deletes the specified policy.
12695    pub fn delete(&self) -> super::builder::region_security_policies::Delete {
12696        super::builder::region_security_policies::Delete::new(self.inner.clone())
12697    }
12698
12699    /// List all of the ordered rules present in a single specified policy.
12700    pub fn get(&self) -> super::builder::region_security_policies::Get {
12701        super::builder::region_security_policies::Get::new(self.inner.clone())
12702    }
12703
12704    /// Gets a rule at the specified priority.
12705    pub fn get_rule(&self) -> super::builder::region_security_policies::GetRule {
12706        super::builder::region_security_policies::GetRule::new(self.inner.clone())
12707    }
12708
12709    /// Creates a new policy in the specified project using the data included in
12710    /// the request.
12711    pub fn insert(&self) -> super::builder::region_security_policies::Insert {
12712        super::builder::region_security_policies::Insert::new(self.inner.clone())
12713    }
12714
12715    /// List all the policies that have been configured for the specified project
12716    /// and region.
12717    pub fn list(&self) -> super::builder::region_security_policies::List {
12718        super::builder::region_security_policies::List::new(self.inner.clone())
12719    }
12720
12721    /// Patches the specified policy with the data included in the request. To
12722    /// clear fields in the policy, leave the fields empty and specify them in the
12723    /// updateMask. This cannot be used to be update the rules in the policy.
12724    /// Please use the per rule methods like addRule, patchRule, and removeRule
12725    /// instead.
12726    pub fn patch(&self) -> super::builder::region_security_policies::Patch {
12727        super::builder::region_security_policies::Patch::new(self.inner.clone())
12728    }
12729
12730    /// Patches a rule at the specified priority. To clear fields in the rule,
12731    /// leave the fields empty and specify them in the updateMask.
12732    pub fn patch_rule(&self) -> super::builder::region_security_policies::PatchRule {
12733        super::builder::region_security_policies::PatchRule::new(self.inner.clone())
12734    }
12735
12736    /// Deletes a rule at the specified priority.
12737    pub fn remove_rule(&self) -> super::builder::region_security_policies::RemoveRule {
12738        super::builder::region_security_policies::RemoveRule::new(self.inner.clone())
12739    }
12740
12741    /// Sets the labels on a security policy. To learn more about labels,
12742    /// read the Labeling Resources
12743    /// documentation.
12744    pub fn set_labels(&self) -> super::builder::region_security_policies::SetLabels {
12745        super::builder::region_security_policies::SetLabels::new(self.inner.clone())
12746    }
12747
12748    /// Retrieves the specified region-specific Operations resource.
12749    pub fn get_operation(&self) -> super::builder::region_security_policies::GetOperation {
12750        super::builder::region_security_policies::GetOperation::new(self.inner.clone())
12751    }
12752}
12753
12754/// Implements a client for the Google Compute Engine API.
12755///
12756/// # Example
12757/// ```
12758/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12759/// # use google_cloud_compute_v1::client::RegionSslCertificates;
12760/// let client = RegionSslCertificates::builder().build().await?;
12761/// // use `client` to make requests to the Google Compute Engine API.
12762/// # Ok(()) }
12763/// ```
12764///
12765/// # Service Description
12766///
12767/// Service for the `regionSslCertificates` resource.
12768///
12769/// # Configuration
12770///
12771/// To configure `RegionSslCertificates` use the `with_*` methods in the type returned
12772/// by [builder()][RegionSslCertificates::builder]. The default configuration should
12773/// work for most applications. Common configuration changes include
12774///
12775/// * [with_endpoint()]: by default this client uses the global default endpoint
12776///   (`https://compute.googleapis.com`). Applications using regional
12777///   endpoints or running in restricted networks (e.g. a network configured
12778//    with [Private Google Access with VPC Service Controls]) may want to
12779///   override this default.
12780/// * [with_credentials()]: by default this client uses
12781///   [Application Default Credentials]. Applications using custom
12782///   authentication may need to override this default.
12783///
12784/// [with_endpoint()]: super::builder::region_ssl_certificates::ClientBuilder::with_endpoint
12785/// [with_credentials()]: super::builder::region_ssl_certificates::ClientBuilder::credentials
12786/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12787/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12788///
12789/// # Pooling and Cloning
12790///
12791/// `RegionSslCertificates` holds a connection pool internally, it is advised to
12792/// create one and the reuse it.  You do not need to wrap `RegionSslCertificates` in
12793/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12794/// already uses an `Arc` internally.
12795#[cfg(feature = "region-ssl-certificates")]
12796#[cfg_attr(docsrs, doc(cfg(feature = "region-ssl-certificates")))]
12797#[derive(Clone, Debug)]
12798pub struct RegionSslCertificates {
12799    inner: std::sync::Arc<dyn super::stub::dynamic::RegionSslCertificates>,
12800}
12801
12802#[cfg(feature = "region-ssl-certificates")]
12803impl RegionSslCertificates {
12804    /// Returns a builder for [RegionSslCertificates].
12805    ///
12806    /// ```
12807    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12808    /// # use google_cloud_compute_v1::client::RegionSslCertificates;
12809    /// let client = RegionSslCertificates::builder().build().await?;
12810    /// # Ok(()) }
12811    /// ```
12812    pub fn builder() -> super::builder::region_ssl_certificates::ClientBuilder {
12813        crate::new_client_builder(super::builder::region_ssl_certificates::client::Factory)
12814    }
12815
12816    /// Creates a new client from the provided stub.
12817    ///
12818    /// The most common case for calling this function is in tests mocking the
12819    /// client's behavior.
12820    pub fn from_stub<T>(stub: T) -> Self
12821    where
12822        T: super::stub::RegionSslCertificates + 'static,
12823    {
12824        Self {
12825            inner: std::sync::Arc::new(stub),
12826        }
12827    }
12828
12829    pub(crate) async fn new(
12830        config: gaxi::options::ClientConfig,
12831    ) -> crate::ClientBuilderResult<Self> {
12832        let inner = Self::build_inner(config).await?;
12833        Ok(Self { inner })
12834    }
12835
12836    async fn build_inner(
12837        conf: gaxi::options::ClientConfig,
12838    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionSslCertificates>>
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::RegionSslCertificates> {
12849        super::transport::RegionSslCertificates::new(conf).await
12850    }
12851
12852    async fn build_with_tracing(
12853        conf: gaxi::options::ClientConfig,
12854    ) -> crate::ClientBuilderResult<impl super::stub::RegionSslCertificates> {
12855        Self::build_transport(conf)
12856            .await
12857            .map(super::tracing::RegionSslCertificates::new)
12858    }
12859
12860    /// Deletes the specified SslCertificate resource in the region.
12861    pub fn delete(&self) -> super::builder::region_ssl_certificates::Delete {
12862        super::builder::region_ssl_certificates::Delete::new(self.inner.clone())
12863    }
12864
12865    /// Returns the specified SslCertificate resource in the specified region. Get
12866    /// a list of available SSL certificates by making a list()
12867    /// request.
12868    pub fn get(&self) -> super::builder::region_ssl_certificates::Get {
12869        super::builder::region_ssl_certificates::Get::new(self.inner.clone())
12870    }
12871
12872    /// Creates a SslCertificate resource in the specified project and region using
12873    /// the data included in the request
12874    pub fn insert(&self) -> super::builder::region_ssl_certificates::Insert {
12875        super::builder::region_ssl_certificates::Insert::new(self.inner.clone())
12876    }
12877
12878    /// Retrieves the list of SslCertificate resources available to the specified
12879    /// project in the specified region.
12880    pub fn list(&self) -> super::builder::region_ssl_certificates::List {
12881        super::builder::region_ssl_certificates::List::new(self.inner.clone())
12882    }
12883
12884    /// Retrieves the specified region-specific Operations resource.
12885    pub fn get_operation(&self) -> super::builder::region_ssl_certificates::GetOperation {
12886        super::builder::region_ssl_certificates::GetOperation::new(self.inner.clone())
12887    }
12888}
12889
12890/// Implements a client for the Google Compute Engine API.
12891///
12892/// # Example
12893/// ```
12894/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12895/// # use google_cloud_compute_v1::client::RegionSslPolicies;
12896/// let client = RegionSslPolicies::builder().build().await?;
12897/// // use `client` to make requests to the Google Compute Engine API.
12898/// # Ok(()) }
12899/// ```
12900///
12901/// # Service Description
12902///
12903/// Service for the `regionSslPolicies` resource.
12904///
12905/// # Configuration
12906///
12907/// To configure `RegionSslPolicies` use the `with_*` methods in the type returned
12908/// by [builder()][RegionSslPolicies::builder]. The default configuration should
12909/// work for most applications. Common configuration changes include
12910///
12911/// * [with_endpoint()]: by default this client uses the global default endpoint
12912///   (`https://compute.googleapis.com`). Applications using regional
12913///   endpoints or running in restricted networks (e.g. a network configured
12914//    with [Private Google Access with VPC Service Controls]) may want to
12915///   override this default.
12916/// * [with_credentials()]: by default this client uses
12917///   [Application Default Credentials]. Applications using custom
12918///   authentication may need to override this default.
12919///
12920/// [with_endpoint()]: super::builder::region_ssl_policies::ClientBuilder::with_endpoint
12921/// [with_credentials()]: super::builder::region_ssl_policies::ClientBuilder::credentials
12922/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12923/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12924///
12925/// # Pooling and Cloning
12926///
12927/// `RegionSslPolicies` holds a connection pool internally, it is advised to
12928/// create one and the reuse it.  You do not need to wrap `RegionSslPolicies` in
12929/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12930/// already uses an `Arc` internally.
12931#[cfg(feature = "region-ssl-policies")]
12932#[cfg_attr(docsrs, doc(cfg(feature = "region-ssl-policies")))]
12933#[derive(Clone, Debug)]
12934pub struct RegionSslPolicies {
12935    inner: std::sync::Arc<dyn super::stub::dynamic::RegionSslPolicies>,
12936}
12937
12938#[cfg(feature = "region-ssl-policies")]
12939impl RegionSslPolicies {
12940    /// Returns a builder for [RegionSslPolicies].
12941    ///
12942    /// ```
12943    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12944    /// # use google_cloud_compute_v1::client::RegionSslPolicies;
12945    /// let client = RegionSslPolicies::builder().build().await?;
12946    /// # Ok(()) }
12947    /// ```
12948    pub fn builder() -> super::builder::region_ssl_policies::ClientBuilder {
12949        crate::new_client_builder(super::builder::region_ssl_policies::client::Factory)
12950    }
12951
12952    /// Creates a new client from the provided stub.
12953    ///
12954    /// The most common case for calling this function is in tests mocking the
12955    /// client's behavior.
12956    pub fn from_stub<T>(stub: T) -> Self
12957    where
12958        T: super::stub::RegionSslPolicies + 'static,
12959    {
12960        Self {
12961            inner: std::sync::Arc::new(stub),
12962        }
12963    }
12964
12965    pub(crate) async fn new(
12966        config: gaxi::options::ClientConfig,
12967    ) -> crate::ClientBuilderResult<Self> {
12968        let inner = Self::build_inner(config).await?;
12969        Ok(Self { inner })
12970    }
12971
12972    async fn build_inner(
12973        conf: gaxi::options::ClientConfig,
12974    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionSslPolicies>>
12975    {
12976        if gaxi::options::tracing_enabled(&conf) {
12977            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12978        }
12979        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12980    }
12981
12982    async fn build_transport(
12983        conf: gaxi::options::ClientConfig,
12984    ) -> crate::ClientBuilderResult<impl super::stub::RegionSslPolicies> {
12985        super::transport::RegionSslPolicies::new(conf).await
12986    }
12987
12988    async fn build_with_tracing(
12989        conf: gaxi::options::ClientConfig,
12990    ) -> crate::ClientBuilderResult<impl super::stub::RegionSslPolicies> {
12991        Self::build_transport(conf)
12992            .await
12993            .map(super::tracing::RegionSslPolicies::new)
12994    }
12995
12996    /// Deletes the specified SSL policy. The SSL policy resource can be deleted
12997    /// only if it is not in use by any TargetHttpsProxy or TargetSslProxy
12998    /// resources.
12999    pub fn delete(&self) -> super::builder::region_ssl_policies::Delete {
13000        super::builder::region_ssl_policies::Delete::new(self.inner.clone())
13001    }
13002
13003    /// Lists all of the ordered rules present in a single specified policy.
13004    pub fn get(&self) -> super::builder::region_ssl_policies::Get {
13005        super::builder::region_ssl_policies::Get::new(self.inner.clone())
13006    }
13007
13008    /// Creates a new policy in the specified project and region using the data
13009    /// included in the request.
13010    pub fn insert(&self) -> super::builder::region_ssl_policies::Insert {
13011        super::builder::region_ssl_policies::Insert::new(self.inner.clone())
13012    }
13013
13014    /// Lists all the SSL policies that have been configured for the specified
13015    /// project and region.
13016    pub fn list(&self) -> super::builder::region_ssl_policies::List {
13017        super::builder::region_ssl_policies::List::new(self.inner.clone())
13018    }
13019
13020    /// Lists all features that can be specified in the SSL policy when using
13021    /// custom profile.
13022    pub fn list_available_features(
13023        &self,
13024    ) -> super::builder::region_ssl_policies::ListAvailableFeatures {
13025        super::builder::region_ssl_policies::ListAvailableFeatures::new(self.inner.clone())
13026    }
13027
13028    /// Patches the specified SSL policy with the data included in the request.
13029    pub fn patch(&self) -> super::builder::region_ssl_policies::Patch {
13030        super::builder::region_ssl_policies::Patch::new(self.inner.clone())
13031    }
13032
13033    /// Retrieves the specified region-specific Operations resource.
13034    pub fn get_operation(&self) -> super::builder::region_ssl_policies::GetOperation {
13035        super::builder::region_ssl_policies::GetOperation::new(self.inner.clone())
13036    }
13037}
13038
13039/// Implements a client for the Google Compute Engine API.
13040///
13041/// # Example
13042/// ```
13043/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13044/// # use google_cloud_compute_v1::client::RegionTargetHttpProxies;
13045/// let client = RegionTargetHttpProxies::builder().build().await?;
13046/// // use `client` to make requests to the Google Compute Engine API.
13047/// # Ok(()) }
13048/// ```
13049///
13050/// # Service Description
13051///
13052/// Service for the `regionTargetHttpProxies` resource.
13053///
13054/// # Configuration
13055///
13056/// To configure `RegionTargetHttpProxies` use the `with_*` methods in the type returned
13057/// by [builder()][RegionTargetHttpProxies::builder]. The default configuration should
13058/// work for most applications. Common configuration changes include
13059///
13060/// * [with_endpoint()]: by default this client uses the global default endpoint
13061///   (`https://compute.googleapis.com`). Applications using regional
13062///   endpoints or running in restricted networks (e.g. a network configured
13063//    with [Private Google Access with VPC Service Controls]) may want to
13064///   override this default.
13065/// * [with_credentials()]: by default this client uses
13066///   [Application Default Credentials]. Applications using custom
13067///   authentication may need to override this default.
13068///
13069/// [with_endpoint()]: super::builder::region_target_http_proxies::ClientBuilder::with_endpoint
13070/// [with_credentials()]: super::builder::region_target_http_proxies::ClientBuilder::credentials
13071/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13072/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13073///
13074/// # Pooling and Cloning
13075///
13076/// `RegionTargetHttpProxies` holds a connection pool internally, it is advised to
13077/// create one and the reuse it.  You do not need to wrap `RegionTargetHttpProxies` in
13078/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13079/// already uses an `Arc` internally.
13080#[cfg(feature = "region-target-http-proxies")]
13081#[cfg_attr(docsrs, doc(cfg(feature = "region-target-http-proxies")))]
13082#[derive(Clone, Debug)]
13083pub struct RegionTargetHttpProxies {
13084    inner: std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpProxies>,
13085}
13086
13087#[cfg(feature = "region-target-http-proxies")]
13088impl RegionTargetHttpProxies {
13089    /// Returns a builder for [RegionTargetHttpProxies].
13090    ///
13091    /// ```
13092    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13093    /// # use google_cloud_compute_v1::client::RegionTargetHttpProxies;
13094    /// let client = RegionTargetHttpProxies::builder().build().await?;
13095    /// # Ok(()) }
13096    /// ```
13097    pub fn builder() -> super::builder::region_target_http_proxies::ClientBuilder {
13098        crate::new_client_builder(super::builder::region_target_http_proxies::client::Factory)
13099    }
13100
13101    /// Creates a new client from the provided stub.
13102    ///
13103    /// The most common case for calling this function is in tests mocking the
13104    /// client's behavior.
13105    pub fn from_stub<T>(stub: T) -> Self
13106    where
13107        T: super::stub::RegionTargetHttpProxies + 'static,
13108    {
13109        Self {
13110            inner: std::sync::Arc::new(stub),
13111        }
13112    }
13113
13114    pub(crate) async fn new(
13115        config: gaxi::options::ClientConfig,
13116    ) -> crate::ClientBuilderResult<Self> {
13117        let inner = Self::build_inner(config).await?;
13118        Ok(Self { inner })
13119    }
13120
13121    async fn build_inner(
13122        conf: gaxi::options::ClientConfig,
13123    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpProxies>>
13124    {
13125        if gaxi::options::tracing_enabled(&conf) {
13126            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13127        }
13128        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13129    }
13130
13131    async fn build_transport(
13132        conf: gaxi::options::ClientConfig,
13133    ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetHttpProxies> {
13134        super::transport::RegionTargetHttpProxies::new(conf).await
13135    }
13136
13137    async fn build_with_tracing(
13138        conf: gaxi::options::ClientConfig,
13139    ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetHttpProxies> {
13140        Self::build_transport(conf)
13141            .await
13142            .map(super::tracing::RegionTargetHttpProxies::new)
13143    }
13144
13145    /// Deletes the specified TargetHttpProxy resource.
13146    pub fn delete(&self) -> super::builder::region_target_http_proxies::Delete {
13147        super::builder::region_target_http_proxies::Delete::new(self.inner.clone())
13148    }
13149
13150    /// Returns the specified TargetHttpProxy resource in the specified region.
13151    pub fn get(&self) -> super::builder::region_target_http_proxies::Get {
13152        super::builder::region_target_http_proxies::Get::new(self.inner.clone())
13153    }
13154
13155    /// Creates a TargetHttpProxy resource in the specified project and region
13156    /// using the data included in the request.
13157    pub fn insert(&self) -> super::builder::region_target_http_proxies::Insert {
13158        super::builder::region_target_http_proxies::Insert::new(self.inner.clone())
13159    }
13160
13161    /// Retrieves the list of TargetHttpProxy resources available
13162    /// to the specified project in the specified region.
13163    pub fn list(&self) -> super::builder::region_target_http_proxies::List {
13164        super::builder::region_target_http_proxies::List::new(self.inner.clone())
13165    }
13166
13167    /// Changes the URL map for TargetHttpProxy.
13168    pub fn set_url_map(&self) -> super::builder::region_target_http_proxies::SetUrlMap {
13169        super::builder::region_target_http_proxies::SetUrlMap::new(self.inner.clone())
13170    }
13171
13172    /// Retrieves the specified region-specific Operations resource.
13173    pub fn get_operation(&self) -> super::builder::region_target_http_proxies::GetOperation {
13174        super::builder::region_target_http_proxies::GetOperation::new(self.inner.clone())
13175    }
13176}
13177
13178/// Implements a client for the Google Compute Engine API.
13179///
13180/// # Example
13181/// ```
13182/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13183/// # use google_cloud_compute_v1::client::RegionTargetHttpsProxies;
13184/// let client = RegionTargetHttpsProxies::builder().build().await?;
13185/// // use `client` to make requests to the Google Compute Engine API.
13186/// # Ok(()) }
13187/// ```
13188///
13189/// # Service Description
13190///
13191/// Service for the `regionTargetHttpsProxies` resource.
13192///
13193/// # Configuration
13194///
13195/// To configure `RegionTargetHttpsProxies` use the `with_*` methods in the type returned
13196/// by [builder()][RegionTargetHttpsProxies::builder]. The default configuration should
13197/// work for most applications. Common configuration changes include
13198///
13199/// * [with_endpoint()]: by default this client uses the global default endpoint
13200///   (`https://compute.googleapis.com`). Applications using regional
13201///   endpoints or running in restricted networks (e.g. a network configured
13202//    with [Private Google Access with VPC Service Controls]) may want to
13203///   override this default.
13204/// * [with_credentials()]: by default this client uses
13205///   [Application Default Credentials]. Applications using custom
13206///   authentication may need to override this default.
13207///
13208/// [with_endpoint()]: super::builder::region_target_https_proxies::ClientBuilder::with_endpoint
13209/// [with_credentials()]: super::builder::region_target_https_proxies::ClientBuilder::credentials
13210/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13211/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13212///
13213/// # Pooling and Cloning
13214///
13215/// `RegionTargetHttpsProxies` holds a connection pool internally, it is advised to
13216/// create one and the reuse it.  You do not need to wrap `RegionTargetHttpsProxies` in
13217/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13218/// already uses an `Arc` internally.
13219#[cfg(feature = "region-target-https-proxies")]
13220#[cfg_attr(docsrs, doc(cfg(feature = "region-target-https-proxies")))]
13221#[derive(Clone, Debug)]
13222pub struct RegionTargetHttpsProxies {
13223    inner: std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpsProxies>,
13224}
13225
13226#[cfg(feature = "region-target-https-proxies")]
13227impl RegionTargetHttpsProxies {
13228    /// Returns a builder for [RegionTargetHttpsProxies].
13229    ///
13230    /// ```
13231    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13232    /// # use google_cloud_compute_v1::client::RegionTargetHttpsProxies;
13233    /// let client = RegionTargetHttpsProxies::builder().build().await?;
13234    /// # Ok(()) }
13235    /// ```
13236    pub fn builder() -> super::builder::region_target_https_proxies::ClientBuilder {
13237        crate::new_client_builder(super::builder::region_target_https_proxies::client::Factory)
13238    }
13239
13240    /// Creates a new client from the provided stub.
13241    ///
13242    /// The most common case for calling this function is in tests mocking the
13243    /// client's behavior.
13244    pub fn from_stub<T>(stub: T) -> Self
13245    where
13246        T: super::stub::RegionTargetHttpsProxies + 'static,
13247    {
13248        Self {
13249            inner: std::sync::Arc::new(stub),
13250        }
13251    }
13252
13253    pub(crate) async fn new(
13254        config: gaxi::options::ClientConfig,
13255    ) -> crate::ClientBuilderResult<Self> {
13256        let inner = Self::build_inner(config).await?;
13257        Ok(Self { inner })
13258    }
13259
13260    async fn build_inner(
13261        conf: gaxi::options::ClientConfig,
13262    ) -> crate::ClientBuilderResult<
13263        std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpsProxies>,
13264    > {
13265        if gaxi::options::tracing_enabled(&conf) {
13266            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13267        }
13268        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13269    }
13270
13271    async fn build_transport(
13272        conf: gaxi::options::ClientConfig,
13273    ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetHttpsProxies> {
13274        super::transport::RegionTargetHttpsProxies::new(conf).await
13275    }
13276
13277    async fn build_with_tracing(
13278        conf: gaxi::options::ClientConfig,
13279    ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetHttpsProxies> {
13280        Self::build_transport(conf)
13281            .await
13282            .map(super::tracing::RegionTargetHttpsProxies::new)
13283    }
13284
13285    /// Deletes the specified TargetHttpsProxy resource.
13286    pub fn delete(&self) -> super::builder::region_target_https_proxies::Delete {
13287        super::builder::region_target_https_proxies::Delete::new(self.inner.clone())
13288    }
13289
13290    /// Returns the specified TargetHttpsProxy resource in the specified region.
13291    pub fn get(&self) -> super::builder::region_target_https_proxies::Get {
13292        super::builder::region_target_https_proxies::Get::new(self.inner.clone())
13293    }
13294
13295    /// Creates a TargetHttpsProxy resource in the specified project and region
13296    /// using the data included in the request.
13297    pub fn insert(&self) -> super::builder::region_target_https_proxies::Insert {
13298        super::builder::region_target_https_proxies::Insert::new(self.inner.clone())
13299    }
13300
13301    /// Retrieves the list of TargetHttpsProxy resources available
13302    /// to the specified project in the specified region.
13303    pub fn list(&self) -> super::builder::region_target_https_proxies::List {
13304        super::builder::region_target_https_proxies::List::new(self.inner.clone())
13305    }
13306
13307    /// Patches the specified regional TargetHttpsProxy resource with the data
13308    /// included in the request. This method supports PATCH
13309    /// semantics and usesJSON merge
13310    /// patch format and processing rules.
13311    pub fn patch(&self) -> super::builder::region_target_https_proxies::Patch {
13312        super::builder::region_target_https_proxies::Patch::new(self.inner.clone())
13313    }
13314
13315    /// Replaces SslCertificates for TargetHttpsProxy.
13316    pub fn set_ssl_certificates(
13317        &self,
13318    ) -> super::builder::region_target_https_proxies::SetSslCertificates {
13319        super::builder::region_target_https_proxies::SetSslCertificates::new(self.inner.clone())
13320    }
13321
13322    /// Changes the URL map for TargetHttpsProxy.
13323    pub fn set_url_map(&self) -> super::builder::region_target_https_proxies::SetUrlMap {
13324        super::builder::region_target_https_proxies::SetUrlMap::new(self.inner.clone())
13325    }
13326
13327    /// Retrieves the specified region-specific Operations resource.
13328    pub fn get_operation(&self) -> super::builder::region_target_https_proxies::GetOperation {
13329        super::builder::region_target_https_proxies::GetOperation::new(self.inner.clone())
13330    }
13331}
13332
13333/// Implements a client for the Google Compute Engine API.
13334///
13335/// # Example
13336/// ```
13337/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13338/// # use google_cloud_compute_v1::client::RegionTargetTcpProxies;
13339/// let client = RegionTargetTcpProxies::builder().build().await?;
13340/// // use `client` to make requests to the Google Compute Engine API.
13341/// # Ok(()) }
13342/// ```
13343///
13344/// # Service Description
13345///
13346/// Service for the `regionTargetTcpProxies` resource.
13347///
13348/// # Configuration
13349///
13350/// To configure `RegionTargetTcpProxies` use the `with_*` methods in the type returned
13351/// by [builder()][RegionTargetTcpProxies::builder]. The default configuration should
13352/// work for most applications. Common configuration changes include
13353///
13354/// * [with_endpoint()]: by default this client uses the global default endpoint
13355///   (`https://compute.googleapis.com`). Applications using regional
13356///   endpoints or running in restricted networks (e.g. a network configured
13357//    with [Private Google Access with VPC Service Controls]) may want to
13358///   override this default.
13359/// * [with_credentials()]: by default this client uses
13360///   [Application Default Credentials]. Applications using custom
13361///   authentication may need to override this default.
13362///
13363/// [with_endpoint()]: super::builder::region_target_tcp_proxies::ClientBuilder::with_endpoint
13364/// [with_credentials()]: super::builder::region_target_tcp_proxies::ClientBuilder::credentials
13365/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13366/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13367///
13368/// # Pooling and Cloning
13369///
13370/// `RegionTargetTcpProxies` holds a connection pool internally, it is advised to
13371/// create one and the reuse it.  You do not need to wrap `RegionTargetTcpProxies` in
13372/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13373/// already uses an `Arc` internally.
13374#[cfg(feature = "region-target-tcp-proxies")]
13375#[cfg_attr(docsrs, doc(cfg(feature = "region-target-tcp-proxies")))]
13376#[derive(Clone, Debug)]
13377pub struct RegionTargetTcpProxies {
13378    inner: std::sync::Arc<dyn super::stub::dynamic::RegionTargetTcpProxies>,
13379}
13380
13381#[cfg(feature = "region-target-tcp-proxies")]
13382impl RegionTargetTcpProxies {
13383    /// Returns a builder for [RegionTargetTcpProxies].
13384    ///
13385    /// ```
13386    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13387    /// # use google_cloud_compute_v1::client::RegionTargetTcpProxies;
13388    /// let client = RegionTargetTcpProxies::builder().build().await?;
13389    /// # Ok(()) }
13390    /// ```
13391    pub fn builder() -> super::builder::region_target_tcp_proxies::ClientBuilder {
13392        crate::new_client_builder(super::builder::region_target_tcp_proxies::client::Factory)
13393    }
13394
13395    /// Creates a new client from the provided stub.
13396    ///
13397    /// The most common case for calling this function is in tests mocking the
13398    /// client's behavior.
13399    pub fn from_stub<T>(stub: T) -> Self
13400    where
13401        T: super::stub::RegionTargetTcpProxies + 'static,
13402    {
13403        Self {
13404            inner: std::sync::Arc::new(stub),
13405        }
13406    }
13407
13408    pub(crate) async fn new(
13409        config: gaxi::options::ClientConfig,
13410    ) -> crate::ClientBuilderResult<Self> {
13411        let inner = Self::build_inner(config).await?;
13412        Ok(Self { inner })
13413    }
13414
13415    async fn build_inner(
13416        conf: gaxi::options::ClientConfig,
13417    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionTargetTcpProxies>>
13418    {
13419        if gaxi::options::tracing_enabled(&conf) {
13420            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13421        }
13422        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13423    }
13424
13425    async fn build_transport(
13426        conf: gaxi::options::ClientConfig,
13427    ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetTcpProxies> {
13428        super::transport::RegionTargetTcpProxies::new(conf).await
13429    }
13430
13431    async fn build_with_tracing(
13432        conf: gaxi::options::ClientConfig,
13433    ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetTcpProxies> {
13434        Self::build_transport(conf)
13435            .await
13436            .map(super::tracing::RegionTargetTcpProxies::new)
13437    }
13438
13439    /// Deletes the specified TargetTcpProxy resource.
13440    pub fn delete(&self) -> super::builder::region_target_tcp_proxies::Delete {
13441        super::builder::region_target_tcp_proxies::Delete::new(self.inner.clone())
13442    }
13443
13444    /// Returns the specified TargetTcpProxy resource.
13445    pub fn get(&self) -> super::builder::region_target_tcp_proxies::Get {
13446        super::builder::region_target_tcp_proxies::Get::new(self.inner.clone())
13447    }
13448
13449    /// Creates a TargetTcpProxy resource in the specified project and region using
13450    /// the data included in the request.
13451    pub fn insert(&self) -> super::builder::region_target_tcp_proxies::Insert {
13452        super::builder::region_target_tcp_proxies::Insert::new(self.inner.clone())
13453    }
13454
13455    /// Retrieves a list of TargetTcpProxy resources
13456    /// available to the specified project in a given region.
13457    pub fn list(&self) -> super::builder::region_target_tcp_proxies::List {
13458        super::builder::region_target_tcp_proxies::List::new(self.inner.clone())
13459    }
13460
13461    /// Retrieves the specified region-specific Operations resource.
13462    pub fn get_operation(&self) -> super::builder::region_target_tcp_proxies::GetOperation {
13463        super::builder::region_target_tcp_proxies::GetOperation::new(self.inner.clone())
13464    }
13465}
13466
13467/// Implements a client for the Google Compute Engine API.
13468///
13469/// # Example
13470/// ```
13471/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13472/// # use google_cloud_compute_v1::client::RegionUrlMaps;
13473/// let client = RegionUrlMaps::builder().build().await?;
13474/// // use `client` to make requests to the Google Compute Engine API.
13475/// # Ok(()) }
13476/// ```
13477///
13478/// # Service Description
13479///
13480/// Service for the `regionUrlMaps` resource.
13481///
13482/// # Configuration
13483///
13484/// To configure `RegionUrlMaps` use the `with_*` methods in the type returned
13485/// by [builder()][RegionUrlMaps::builder]. The default configuration should
13486/// work for most applications. Common configuration changes include
13487///
13488/// * [with_endpoint()]: by default this client uses the global default endpoint
13489///   (`https://compute.googleapis.com`). Applications using regional
13490///   endpoints or running in restricted networks (e.g. a network configured
13491//    with [Private Google Access with VPC Service Controls]) may want to
13492///   override this default.
13493/// * [with_credentials()]: by default this client uses
13494///   [Application Default Credentials]. Applications using custom
13495///   authentication may need to override this default.
13496///
13497/// [with_endpoint()]: super::builder::region_url_maps::ClientBuilder::with_endpoint
13498/// [with_credentials()]: super::builder::region_url_maps::ClientBuilder::credentials
13499/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13500/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13501///
13502/// # Pooling and Cloning
13503///
13504/// `RegionUrlMaps` holds a connection pool internally, it is advised to
13505/// create one and the reuse it.  You do not need to wrap `RegionUrlMaps` in
13506/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13507/// already uses an `Arc` internally.
13508#[cfg(feature = "region-url-maps")]
13509#[cfg_attr(docsrs, doc(cfg(feature = "region-url-maps")))]
13510#[derive(Clone, Debug)]
13511pub struct RegionUrlMaps {
13512    inner: std::sync::Arc<dyn super::stub::dynamic::RegionUrlMaps>,
13513}
13514
13515#[cfg(feature = "region-url-maps")]
13516impl RegionUrlMaps {
13517    /// Returns a builder for [RegionUrlMaps].
13518    ///
13519    /// ```
13520    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13521    /// # use google_cloud_compute_v1::client::RegionUrlMaps;
13522    /// let client = RegionUrlMaps::builder().build().await?;
13523    /// # Ok(()) }
13524    /// ```
13525    pub fn builder() -> super::builder::region_url_maps::ClientBuilder {
13526        crate::new_client_builder(super::builder::region_url_maps::client::Factory)
13527    }
13528
13529    /// Creates a new client from the provided stub.
13530    ///
13531    /// The most common case for calling this function is in tests mocking the
13532    /// client's behavior.
13533    pub fn from_stub<T>(stub: T) -> Self
13534    where
13535        T: super::stub::RegionUrlMaps + 'static,
13536    {
13537        Self {
13538            inner: std::sync::Arc::new(stub),
13539        }
13540    }
13541
13542    pub(crate) async fn new(
13543        config: gaxi::options::ClientConfig,
13544    ) -> crate::ClientBuilderResult<Self> {
13545        let inner = Self::build_inner(config).await?;
13546        Ok(Self { inner })
13547    }
13548
13549    async fn build_inner(
13550        conf: gaxi::options::ClientConfig,
13551    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionUrlMaps>> {
13552        if gaxi::options::tracing_enabled(&conf) {
13553            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13554        }
13555        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13556    }
13557
13558    async fn build_transport(
13559        conf: gaxi::options::ClientConfig,
13560    ) -> crate::ClientBuilderResult<impl super::stub::RegionUrlMaps> {
13561        super::transport::RegionUrlMaps::new(conf).await
13562    }
13563
13564    async fn build_with_tracing(
13565        conf: gaxi::options::ClientConfig,
13566    ) -> crate::ClientBuilderResult<impl super::stub::RegionUrlMaps> {
13567        Self::build_transport(conf)
13568            .await
13569            .map(super::tracing::RegionUrlMaps::new)
13570    }
13571
13572    /// Deletes the specified UrlMap resource.
13573    pub fn delete(&self) -> super::builder::region_url_maps::Delete {
13574        super::builder::region_url_maps::Delete::new(self.inner.clone())
13575    }
13576
13577    /// Returns the specified UrlMap resource.
13578    pub fn get(&self) -> super::builder::region_url_maps::Get {
13579        super::builder::region_url_maps::Get::new(self.inner.clone())
13580    }
13581
13582    /// Creates a UrlMap resource in the specified project using
13583    /// the data included in the request.
13584    pub fn insert(&self) -> super::builder::region_url_maps::Insert {
13585        super::builder::region_url_maps::Insert::new(self.inner.clone())
13586    }
13587
13588    /// Retrieves the list of UrlMap resources available to the specified
13589    /// project in the specified region.
13590    pub fn list(&self) -> super::builder::region_url_maps::List {
13591        super::builder::region_url_maps::List::new(self.inner.clone())
13592    }
13593
13594    /// Patches the specified UrlMap resource with the data included in the
13595    /// request. This method supportsPATCH
13596    /// semantics and usesJSON merge
13597    /// patch format and processing rules.
13598    pub fn patch(&self) -> super::builder::region_url_maps::Patch {
13599        super::builder::region_url_maps::Patch::new(self.inner.clone())
13600    }
13601
13602    /// Updates the specified UrlMap resource with the data included in the
13603    /// request.
13604    pub fn update(&self) -> super::builder::region_url_maps::Update {
13605        super::builder::region_url_maps::Update::new(self.inner.clone())
13606    }
13607
13608    /// Runs static validation for the UrlMap. In particular, the tests of the
13609    /// provided UrlMap will be run. Calling this method does NOT create the
13610    /// UrlMap.
13611    pub fn validate(&self) -> super::builder::region_url_maps::Validate {
13612        super::builder::region_url_maps::Validate::new(self.inner.clone())
13613    }
13614
13615    /// Retrieves the specified region-specific Operations resource.
13616    pub fn get_operation(&self) -> super::builder::region_url_maps::GetOperation {
13617        super::builder::region_url_maps::GetOperation::new(self.inner.clone())
13618    }
13619}
13620
13621/// Implements a client for the Google Compute Engine API.
13622///
13623/// # Example
13624/// ```
13625/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13626/// # use google_cloud_compute_v1::client::RegionZones;
13627/// let client = RegionZones::builder().build().await?;
13628/// // use `client` to make requests to the Google Compute Engine API.
13629/// # Ok(()) }
13630/// ```
13631///
13632/// # Service Description
13633///
13634/// Service for the `regionZones` resource.
13635///
13636/// # Configuration
13637///
13638/// To configure `RegionZones` use the `with_*` methods in the type returned
13639/// by [builder()][RegionZones::builder]. The default configuration should
13640/// work for most applications. Common configuration changes include
13641///
13642/// * [with_endpoint()]: by default this client uses the global default endpoint
13643///   (`https://compute.googleapis.com`). Applications using regional
13644///   endpoints or running in restricted networks (e.g. a network configured
13645//    with [Private Google Access with VPC Service Controls]) may want to
13646///   override this default.
13647/// * [with_credentials()]: by default this client uses
13648///   [Application Default Credentials]. Applications using custom
13649///   authentication may need to override this default.
13650///
13651/// [with_endpoint()]: super::builder::region_zones::ClientBuilder::with_endpoint
13652/// [with_credentials()]: super::builder::region_zones::ClientBuilder::credentials
13653/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13654/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13655///
13656/// # Pooling and Cloning
13657///
13658/// `RegionZones` holds a connection pool internally, it is advised to
13659/// create one and the reuse it.  You do not need to wrap `RegionZones` in
13660/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13661/// already uses an `Arc` internally.
13662#[cfg(feature = "region-zones")]
13663#[cfg_attr(docsrs, doc(cfg(feature = "region-zones")))]
13664#[derive(Clone, Debug)]
13665pub struct RegionZones {
13666    inner: std::sync::Arc<dyn super::stub::dynamic::RegionZones>,
13667}
13668
13669#[cfg(feature = "region-zones")]
13670impl RegionZones {
13671    /// Returns a builder for [RegionZones].
13672    ///
13673    /// ```
13674    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13675    /// # use google_cloud_compute_v1::client::RegionZones;
13676    /// let client = RegionZones::builder().build().await?;
13677    /// # Ok(()) }
13678    /// ```
13679    pub fn builder() -> super::builder::region_zones::ClientBuilder {
13680        crate::new_client_builder(super::builder::region_zones::client::Factory)
13681    }
13682
13683    /// Creates a new client from the provided stub.
13684    ///
13685    /// The most common case for calling this function is in tests mocking the
13686    /// client's behavior.
13687    pub fn from_stub<T>(stub: T) -> Self
13688    where
13689        T: super::stub::RegionZones + 'static,
13690    {
13691        Self {
13692            inner: std::sync::Arc::new(stub),
13693        }
13694    }
13695
13696    pub(crate) async fn new(
13697        config: gaxi::options::ClientConfig,
13698    ) -> crate::ClientBuilderResult<Self> {
13699        let inner = Self::build_inner(config).await?;
13700        Ok(Self { inner })
13701    }
13702
13703    async fn build_inner(
13704        conf: gaxi::options::ClientConfig,
13705    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionZones>> {
13706        if gaxi::options::tracing_enabled(&conf) {
13707            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13708        }
13709        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13710    }
13711
13712    async fn build_transport(
13713        conf: gaxi::options::ClientConfig,
13714    ) -> crate::ClientBuilderResult<impl super::stub::RegionZones> {
13715        super::transport::RegionZones::new(conf).await
13716    }
13717
13718    async fn build_with_tracing(
13719        conf: gaxi::options::ClientConfig,
13720    ) -> crate::ClientBuilderResult<impl super::stub::RegionZones> {
13721        Self::build_transport(conf)
13722            .await
13723            .map(super::tracing::RegionZones::new)
13724    }
13725
13726    /// Retrieves the list of Zone resources under the specific region available to
13727    /// the specified project.
13728    pub fn list(&self) -> super::builder::region_zones::List {
13729        super::builder::region_zones::List::new(self.inner.clone())
13730    }
13731}
13732
13733/// Implements a client for the Google Compute Engine API.
13734///
13735/// # Example
13736/// ```
13737/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13738/// # use google_cloud_compute_v1::client::Regions;
13739/// let client = Regions::builder().build().await?;
13740/// // use `client` to make requests to the Google Compute Engine API.
13741/// # Ok(()) }
13742/// ```
13743///
13744/// # Service Description
13745///
13746/// Service for the `regions` resource.
13747///
13748/// # Configuration
13749///
13750/// To configure `Regions` use the `with_*` methods in the type returned
13751/// by [builder()][Regions::builder]. The default configuration should
13752/// work for most applications. Common configuration changes include
13753///
13754/// * [with_endpoint()]: by default this client uses the global default endpoint
13755///   (`https://compute.googleapis.com`). Applications using regional
13756///   endpoints or running in restricted networks (e.g. a network configured
13757//    with [Private Google Access with VPC Service Controls]) may want to
13758///   override this default.
13759/// * [with_credentials()]: by default this client uses
13760///   [Application Default Credentials]. Applications using custom
13761///   authentication may need to override this default.
13762///
13763/// [with_endpoint()]: super::builder::regions::ClientBuilder::with_endpoint
13764/// [with_credentials()]: super::builder::regions::ClientBuilder::credentials
13765/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13766/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13767///
13768/// # Pooling and Cloning
13769///
13770/// `Regions` holds a connection pool internally, it is advised to
13771/// create one and the reuse it.  You do not need to wrap `Regions` in
13772/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13773/// already uses an `Arc` internally.
13774#[cfg(feature = "regions")]
13775#[cfg_attr(docsrs, doc(cfg(feature = "regions")))]
13776#[derive(Clone, Debug)]
13777pub struct Regions {
13778    inner: std::sync::Arc<dyn super::stub::dynamic::Regions>,
13779}
13780
13781#[cfg(feature = "regions")]
13782impl Regions {
13783    /// Returns a builder for [Regions].
13784    ///
13785    /// ```
13786    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13787    /// # use google_cloud_compute_v1::client::Regions;
13788    /// let client = Regions::builder().build().await?;
13789    /// # Ok(()) }
13790    /// ```
13791    pub fn builder() -> super::builder::regions::ClientBuilder {
13792        crate::new_client_builder(super::builder::regions::client::Factory)
13793    }
13794
13795    /// Creates a new client from the provided stub.
13796    ///
13797    /// The most common case for calling this function is in tests mocking the
13798    /// client's behavior.
13799    pub fn from_stub<T>(stub: T) -> Self
13800    where
13801        T: super::stub::Regions + 'static,
13802    {
13803        Self {
13804            inner: std::sync::Arc::new(stub),
13805        }
13806    }
13807
13808    pub(crate) async fn new(
13809        config: gaxi::options::ClientConfig,
13810    ) -> crate::ClientBuilderResult<Self> {
13811        let inner = Self::build_inner(config).await?;
13812        Ok(Self { inner })
13813    }
13814
13815    async fn build_inner(
13816        conf: gaxi::options::ClientConfig,
13817    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Regions>> {
13818        if gaxi::options::tracing_enabled(&conf) {
13819            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13820        }
13821        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13822    }
13823
13824    async fn build_transport(
13825        conf: gaxi::options::ClientConfig,
13826    ) -> crate::ClientBuilderResult<impl super::stub::Regions> {
13827        super::transport::Regions::new(conf).await
13828    }
13829
13830    async fn build_with_tracing(
13831        conf: gaxi::options::ClientConfig,
13832    ) -> crate::ClientBuilderResult<impl super::stub::Regions> {
13833        Self::build_transport(conf)
13834            .await
13835            .map(super::tracing::Regions::new)
13836    }
13837
13838    /// Returns the specified Region resource.
13839    ///
13840    /// To decrease latency for this method, you can optionally omit any unneeded
13841    /// information from the response by using a field mask. This practice is
13842    /// especially recommended for unused quota information (the `quotas` field).
13843    /// To exclude one or more fields, set your request's `fields` query parameter
13844    /// to only include the fields you need. For example, to only include the `id`
13845    /// and `selfLink` fields, add the query parameter `?fields=id,selfLink` to
13846    /// your request.
13847    ///
13848    /// This method fails if the quota information is unavailable for the region
13849    /// and if the organization policy constraint
13850    /// compute.requireBasicQuotaInResponse is enforced. This
13851    /// constraint, when enforced, disables the fail-open behaviour when quota
13852    /// information (the `items.quotas` field) is unavailable for the region.
13853    /// It is recommended to use the default setting
13854    /// for the constraint unless your application requires the fail-closed
13855    /// behaviour for this method.
13856    pub fn get(&self) -> super::builder::regions::Get {
13857        super::builder::regions::Get::new(self.inner.clone())
13858    }
13859
13860    /// Retrieves the list of region resources available to the specified project.
13861    ///
13862    /// To decrease latency for this method, you can optionally omit any unneeded
13863    /// information from the response by using a field mask. This practice is
13864    /// especially recommended for unused quota information
13865    /// (the `items.quotas` field).
13866    /// To exclude one or more fields, set your request's `fields` query parameter
13867    /// to only include the fields you need. For example, to only include the `id`
13868    /// and `selfLink` fields, add the query parameter `?fields=id,selfLink` to
13869    /// your request.
13870    ///
13871    /// This method fails if the quota information is unavailable for the region
13872    /// and if the organization policy constraint
13873    /// compute.requireBasicQuotaInResponse is enforced. This
13874    /// constraint, when enforced, disables the fail-open behaviour when quota
13875    /// information (the `items.quotas` field) is unavailable for the region.
13876    /// It is recommended to use the default setting
13877    /// for the constraint unless your application requires the fail-closed
13878    /// behaviour for this method.
13879    pub fn list(&self) -> super::builder::regions::List {
13880        super::builder::regions::List::new(self.inner.clone())
13881    }
13882}
13883
13884/// Implements a client for the Google Compute Engine API.
13885///
13886/// # Example
13887/// ```
13888/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13889/// # use google_cloud_compute_v1::client::ReservationBlocks;
13890/// let client = ReservationBlocks::builder().build().await?;
13891/// // use `client` to make requests to the Google Compute Engine API.
13892/// # Ok(()) }
13893/// ```
13894///
13895/// # Service Description
13896///
13897/// Service for the `reservationBlocks` resource.
13898///
13899/// # Configuration
13900///
13901/// To configure `ReservationBlocks` use the `with_*` methods in the type returned
13902/// by [builder()][ReservationBlocks::builder]. The default configuration should
13903/// work for most applications. Common configuration changes include
13904///
13905/// * [with_endpoint()]: by default this client uses the global default endpoint
13906///   (`https://compute.googleapis.com`). Applications using regional
13907///   endpoints or running in restricted networks (e.g. a network configured
13908//    with [Private Google Access with VPC Service Controls]) may want to
13909///   override this default.
13910/// * [with_credentials()]: by default this client uses
13911///   [Application Default Credentials]. Applications using custom
13912///   authentication may need to override this default.
13913///
13914/// [with_endpoint()]: super::builder::reservation_blocks::ClientBuilder::with_endpoint
13915/// [with_credentials()]: super::builder::reservation_blocks::ClientBuilder::credentials
13916/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13917/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13918///
13919/// # Pooling and Cloning
13920///
13921/// `ReservationBlocks` holds a connection pool internally, it is advised to
13922/// create one and the reuse it.  You do not need to wrap `ReservationBlocks` in
13923/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13924/// already uses an `Arc` internally.
13925#[cfg(feature = "reservation-blocks")]
13926#[cfg_attr(docsrs, doc(cfg(feature = "reservation-blocks")))]
13927#[derive(Clone, Debug)]
13928pub struct ReservationBlocks {
13929    inner: std::sync::Arc<dyn super::stub::dynamic::ReservationBlocks>,
13930}
13931
13932#[cfg(feature = "reservation-blocks")]
13933impl ReservationBlocks {
13934    /// Returns a builder for [ReservationBlocks].
13935    ///
13936    /// ```
13937    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13938    /// # use google_cloud_compute_v1::client::ReservationBlocks;
13939    /// let client = ReservationBlocks::builder().build().await?;
13940    /// # Ok(()) }
13941    /// ```
13942    pub fn builder() -> super::builder::reservation_blocks::ClientBuilder {
13943        crate::new_client_builder(super::builder::reservation_blocks::client::Factory)
13944    }
13945
13946    /// Creates a new client from the provided stub.
13947    ///
13948    /// The most common case for calling this function is in tests mocking the
13949    /// client's behavior.
13950    pub fn from_stub<T>(stub: T) -> Self
13951    where
13952        T: super::stub::ReservationBlocks + 'static,
13953    {
13954        Self {
13955            inner: std::sync::Arc::new(stub),
13956        }
13957    }
13958
13959    pub(crate) async fn new(
13960        config: gaxi::options::ClientConfig,
13961    ) -> crate::ClientBuilderResult<Self> {
13962        let inner = Self::build_inner(config).await?;
13963        Ok(Self { inner })
13964    }
13965
13966    async fn build_inner(
13967        conf: gaxi::options::ClientConfig,
13968    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ReservationBlocks>>
13969    {
13970        if gaxi::options::tracing_enabled(&conf) {
13971            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13972        }
13973        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13974    }
13975
13976    async fn build_transport(
13977        conf: gaxi::options::ClientConfig,
13978    ) -> crate::ClientBuilderResult<impl super::stub::ReservationBlocks> {
13979        super::transport::ReservationBlocks::new(conf).await
13980    }
13981
13982    async fn build_with_tracing(
13983        conf: gaxi::options::ClientConfig,
13984    ) -> crate::ClientBuilderResult<impl super::stub::ReservationBlocks> {
13985        Self::build_transport(conf)
13986            .await
13987            .map(super::tracing::ReservationBlocks::new)
13988    }
13989
13990    /// Retrieves information about the specified reservation block.
13991    pub fn get(&self) -> super::builder::reservation_blocks::Get {
13992        super::builder::reservation_blocks::Get::new(self.inner.clone())
13993    }
13994
13995    /// Gets the access control policy for a resource. May be empty if no such
13996    /// policy or resource exists.
13997    pub fn get_iam_policy(&self) -> super::builder::reservation_blocks::GetIamPolicy {
13998        super::builder::reservation_blocks::GetIamPolicy::new(self.inner.clone())
13999    }
14000
14001    /// Retrieves a list of reservation blocks under a single reservation.
14002    pub fn list(&self) -> super::builder::reservation_blocks::List {
14003        super::builder::reservation_blocks::List::new(self.inner.clone())
14004    }
14005
14006    /// Allows customers to perform maintenance on a reservation block
14007    pub fn perform_maintenance(&self) -> super::builder::reservation_blocks::PerformMaintenance {
14008        super::builder::reservation_blocks::PerformMaintenance::new(self.inner.clone())
14009    }
14010
14011    /// Sets the access control policy on the specified resource.
14012    /// Replaces any existing policy.
14013    pub fn set_iam_policy(&self) -> super::builder::reservation_blocks::SetIamPolicy {
14014        super::builder::reservation_blocks::SetIamPolicy::new(self.inner.clone())
14015    }
14016
14017    /// Returns permissions that a caller has on the specified resource.
14018    pub fn test_iam_permissions(&self) -> super::builder::reservation_blocks::TestIamPermissions {
14019        super::builder::reservation_blocks::TestIamPermissions::new(self.inner.clone())
14020    }
14021
14022    /// Retrieves the specified zone-specific Operations resource.
14023    pub fn get_operation(&self) -> super::builder::reservation_blocks::GetOperation {
14024        super::builder::reservation_blocks::GetOperation::new(self.inner.clone())
14025    }
14026}
14027
14028/// Implements a client for the Google Compute Engine API.
14029///
14030/// # Example
14031/// ```
14032/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14033/// # use google_cloud_compute_v1::client::ReservationSlots;
14034/// let client = ReservationSlots::builder().build().await?;
14035/// // use `client` to make requests to the Google Compute Engine API.
14036/// # Ok(()) }
14037/// ```
14038///
14039/// # Service Description
14040///
14041/// Service for the `reservationSlots` resource.
14042///
14043/// # Configuration
14044///
14045/// To configure `ReservationSlots` use the `with_*` methods in the type returned
14046/// by [builder()][ReservationSlots::builder]. The default configuration should
14047/// work for most applications. Common configuration changes include
14048///
14049/// * [with_endpoint()]: by default this client uses the global default endpoint
14050///   (`https://compute.googleapis.com`). Applications using regional
14051///   endpoints or running in restricted networks (e.g. a network configured
14052//    with [Private Google Access with VPC Service Controls]) may want to
14053///   override this default.
14054/// * [with_credentials()]: by default this client uses
14055///   [Application Default Credentials]. Applications using custom
14056///   authentication may need to override this default.
14057///
14058/// [with_endpoint()]: super::builder::reservation_slots::ClientBuilder::with_endpoint
14059/// [with_credentials()]: super::builder::reservation_slots::ClientBuilder::credentials
14060/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14061/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14062///
14063/// # Pooling and Cloning
14064///
14065/// `ReservationSlots` holds a connection pool internally, it is advised to
14066/// create one and the reuse it.  You do not need to wrap `ReservationSlots` in
14067/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14068/// already uses an `Arc` internally.
14069#[cfg(feature = "reservation-slots")]
14070#[cfg_attr(docsrs, doc(cfg(feature = "reservation-slots")))]
14071#[derive(Clone, Debug)]
14072pub struct ReservationSlots {
14073    inner: std::sync::Arc<dyn super::stub::dynamic::ReservationSlots>,
14074}
14075
14076#[cfg(feature = "reservation-slots")]
14077impl ReservationSlots {
14078    /// Returns a builder for [ReservationSlots].
14079    ///
14080    /// ```
14081    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14082    /// # use google_cloud_compute_v1::client::ReservationSlots;
14083    /// let client = ReservationSlots::builder().build().await?;
14084    /// # Ok(()) }
14085    /// ```
14086    pub fn builder() -> super::builder::reservation_slots::ClientBuilder {
14087        crate::new_client_builder(super::builder::reservation_slots::client::Factory)
14088    }
14089
14090    /// Creates a new client from the provided stub.
14091    ///
14092    /// The most common case for calling this function is in tests mocking the
14093    /// client's behavior.
14094    pub fn from_stub<T>(stub: T) -> Self
14095    where
14096        T: super::stub::ReservationSlots + 'static,
14097    {
14098        Self {
14099            inner: std::sync::Arc::new(stub),
14100        }
14101    }
14102
14103    pub(crate) async fn new(
14104        config: gaxi::options::ClientConfig,
14105    ) -> crate::ClientBuilderResult<Self> {
14106        let inner = Self::build_inner(config).await?;
14107        Ok(Self { inner })
14108    }
14109
14110    async fn build_inner(
14111        conf: gaxi::options::ClientConfig,
14112    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ReservationSlots>>
14113    {
14114        if gaxi::options::tracing_enabled(&conf) {
14115            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14116        }
14117        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14118    }
14119
14120    async fn build_transport(
14121        conf: gaxi::options::ClientConfig,
14122    ) -> crate::ClientBuilderResult<impl super::stub::ReservationSlots> {
14123        super::transport::ReservationSlots::new(conf).await
14124    }
14125
14126    async fn build_with_tracing(
14127        conf: gaxi::options::ClientConfig,
14128    ) -> crate::ClientBuilderResult<impl super::stub::ReservationSlots> {
14129        Self::build_transport(conf)
14130            .await
14131            .map(super::tracing::ReservationSlots::new)
14132    }
14133
14134    /// Retrieves information about the specified reservation slot.
14135    pub fn get(&self) -> super::builder::reservation_slots::Get {
14136        super::builder::reservation_slots::Get::new(self.inner.clone())
14137    }
14138
14139    /// Retrieves a list of reservation slots under a single reservation.
14140    pub fn list(&self) -> super::builder::reservation_slots::List {
14141        super::builder::reservation_slots::List::new(self.inner.clone())
14142    }
14143
14144    /// Update a reservation slot in the specified sub-block.
14145    pub fn update(&self) -> super::builder::reservation_slots::Update {
14146        super::builder::reservation_slots::Update::new(self.inner.clone())
14147    }
14148
14149    /// Retrieves the specified zone-specific Operations resource.
14150    pub fn get_operation(&self) -> super::builder::reservation_slots::GetOperation {
14151        super::builder::reservation_slots::GetOperation::new(self.inner.clone())
14152    }
14153}
14154
14155/// Implements a client for the Google Compute Engine API.
14156///
14157/// # Example
14158/// ```
14159/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14160/// # use google_cloud_compute_v1::client::ReservationSubBlocks;
14161/// let client = ReservationSubBlocks::builder().build().await?;
14162/// // use `client` to make requests to the Google Compute Engine API.
14163/// # Ok(()) }
14164/// ```
14165///
14166/// # Service Description
14167///
14168/// Service for the `reservationSubBlocks` resource.
14169///
14170/// # Configuration
14171///
14172/// To configure `ReservationSubBlocks` use the `with_*` methods in the type returned
14173/// by [builder()][ReservationSubBlocks::builder]. The default configuration should
14174/// work for most applications. Common configuration changes include
14175///
14176/// * [with_endpoint()]: by default this client uses the global default endpoint
14177///   (`https://compute.googleapis.com`). Applications using regional
14178///   endpoints or running in restricted networks (e.g. a network configured
14179//    with [Private Google Access with VPC Service Controls]) may want to
14180///   override this default.
14181/// * [with_credentials()]: by default this client uses
14182///   [Application Default Credentials]. Applications using custom
14183///   authentication may need to override this default.
14184///
14185/// [with_endpoint()]: super::builder::reservation_sub_blocks::ClientBuilder::with_endpoint
14186/// [with_credentials()]: super::builder::reservation_sub_blocks::ClientBuilder::credentials
14187/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14188/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14189///
14190/// # Pooling and Cloning
14191///
14192/// `ReservationSubBlocks` holds a connection pool internally, it is advised to
14193/// create one and the reuse it.  You do not need to wrap `ReservationSubBlocks` in
14194/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14195/// already uses an `Arc` internally.
14196#[cfg(feature = "reservation-sub-blocks")]
14197#[cfg_attr(docsrs, doc(cfg(feature = "reservation-sub-blocks")))]
14198#[derive(Clone, Debug)]
14199pub struct ReservationSubBlocks {
14200    inner: std::sync::Arc<dyn super::stub::dynamic::ReservationSubBlocks>,
14201}
14202
14203#[cfg(feature = "reservation-sub-blocks")]
14204impl ReservationSubBlocks {
14205    /// Returns a builder for [ReservationSubBlocks].
14206    ///
14207    /// ```
14208    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14209    /// # use google_cloud_compute_v1::client::ReservationSubBlocks;
14210    /// let client = ReservationSubBlocks::builder().build().await?;
14211    /// # Ok(()) }
14212    /// ```
14213    pub fn builder() -> super::builder::reservation_sub_blocks::ClientBuilder {
14214        crate::new_client_builder(super::builder::reservation_sub_blocks::client::Factory)
14215    }
14216
14217    /// Creates a new client from the provided stub.
14218    ///
14219    /// The most common case for calling this function is in tests mocking the
14220    /// client's behavior.
14221    pub fn from_stub<T>(stub: T) -> Self
14222    where
14223        T: super::stub::ReservationSubBlocks + 'static,
14224    {
14225        Self {
14226            inner: std::sync::Arc::new(stub),
14227        }
14228    }
14229
14230    pub(crate) async fn new(
14231        config: gaxi::options::ClientConfig,
14232    ) -> crate::ClientBuilderResult<Self> {
14233        let inner = Self::build_inner(config).await?;
14234        Ok(Self { inner })
14235    }
14236
14237    async fn build_inner(
14238        conf: gaxi::options::ClientConfig,
14239    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ReservationSubBlocks>>
14240    {
14241        if gaxi::options::tracing_enabled(&conf) {
14242            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14243        }
14244        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14245    }
14246
14247    async fn build_transport(
14248        conf: gaxi::options::ClientConfig,
14249    ) -> crate::ClientBuilderResult<impl super::stub::ReservationSubBlocks> {
14250        super::transport::ReservationSubBlocks::new(conf).await
14251    }
14252
14253    async fn build_with_tracing(
14254        conf: gaxi::options::ClientConfig,
14255    ) -> crate::ClientBuilderResult<impl super::stub::ReservationSubBlocks> {
14256        Self::build_transport(conf)
14257            .await
14258            .map(super::tracing::ReservationSubBlocks::new)
14259    }
14260
14261    /// Retrieves information about the specified reservation subBlock.
14262    pub fn get(&self) -> super::builder::reservation_sub_blocks::Get {
14263        super::builder::reservation_sub_blocks::Get::new(self.inner.clone())
14264    }
14265
14266    /// Gets the access control policy for a resource. May be empty if no such
14267    /// policy or resource exists.
14268    pub fn get_iam_policy(&self) -> super::builder::reservation_sub_blocks::GetIamPolicy {
14269        super::builder::reservation_sub_blocks::GetIamPolicy::new(self.inner.clone())
14270    }
14271
14272    /// Retrieves a list of reservation subBlocks under a single reservation.
14273    pub fn list(&self) -> super::builder::reservation_sub_blocks::List {
14274        super::builder::reservation_sub_blocks::List::new(self.inner.clone())
14275    }
14276
14277    /// Allows customers to perform maintenance on a reservation subBlock
14278    pub fn perform_maintenance(
14279        &self,
14280    ) -> super::builder::reservation_sub_blocks::PerformMaintenance {
14281        super::builder::reservation_sub_blocks::PerformMaintenance::new(self.inner.clone())
14282    }
14283
14284    /// Allows customers to report a faulty subBlock.
14285    pub fn report_faulty(&self) -> super::builder::reservation_sub_blocks::ReportFaulty {
14286        super::builder::reservation_sub_blocks::ReportFaulty::new(self.inner.clone())
14287    }
14288
14289    /// Sets the access control policy on the specified resource.
14290    /// Replaces any existing policy.
14291    pub fn set_iam_policy(&self) -> super::builder::reservation_sub_blocks::SetIamPolicy {
14292        super::builder::reservation_sub_blocks::SetIamPolicy::new(self.inner.clone())
14293    }
14294
14295    /// Returns permissions that a caller has on the specified resource.
14296    pub fn test_iam_permissions(
14297        &self,
14298    ) -> super::builder::reservation_sub_blocks::TestIamPermissions {
14299        super::builder::reservation_sub_blocks::TestIamPermissions::new(self.inner.clone())
14300    }
14301
14302    /// Retrieves the specified zone-specific Operations resource.
14303    pub fn get_operation(&self) -> super::builder::reservation_sub_blocks::GetOperation {
14304        super::builder::reservation_sub_blocks::GetOperation::new(self.inner.clone())
14305    }
14306}
14307
14308/// Implements a client for the Google Compute Engine API.
14309///
14310/// # Example
14311/// ```
14312/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14313/// # use google_cloud_compute_v1::client::Reservations;
14314/// let client = Reservations::builder().build().await?;
14315/// // use `client` to make requests to the Google Compute Engine API.
14316/// # Ok(()) }
14317/// ```
14318///
14319/// # Service Description
14320///
14321/// Service for the `reservations` resource.
14322///
14323/// # Configuration
14324///
14325/// To configure `Reservations` use the `with_*` methods in the type returned
14326/// by [builder()][Reservations::builder]. The default configuration should
14327/// work for most applications. Common configuration changes include
14328///
14329/// * [with_endpoint()]: by default this client uses the global default endpoint
14330///   (`https://compute.googleapis.com`). Applications using regional
14331///   endpoints or running in restricted networks (e.g. a network configured
14332//    with [Private Google Access with VPC Service Controls]) may want to
14333///   override this default.
14334/// * [with_credentials()]: by default this client uses
14335///   [Application Default Credentials]. Applications using custom
14336///   authentication may need to override this default.
14337///
14338/// [with_endpoint()]: super::builder::reservations::ClientBuilder::with_endpoint
14339/// [with_credentials()]: super::builder::reservations::ClientBuilder::credentials
14340/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14341/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14342///
14343/// # Pooling and Cloning
14344///
14345/// `Reservations` holds a connection pool internally, it is advised to
14346/// create one and the reuse it.  You do not need to wrap `Reservations` in
14347/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14348/// already uses an `Arc` internally.
14349#[cfg(feature = "reservations")]
14350#[cfg_attr(docsrs, doc(cfg(feature = "reservations")))]
14351#[derive(Clone, Debug)]
14352pub struct Reservations {
14353    inner: std::sync::Arc<dyn super::stub::dynamic::Reservations>,
14354}
14355
14356#[cfg(feature = "reservations")]
14357impl Reservations {
14358    /// Returns a builder for [Reservations].
14359    ///
14360    /// ```
14361    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14362    /// # use google_cloud_compute_v1::client::Reservations;
14363    /// let client = Reservations::builder().build().await?;
14364    /// # Ok(()) }
14365    /// ```
14366    pub fn builder() -> super::builder::reservations::ClientBuilder {
14367        crate::new_client_builder(super::builder::reservations::client::Factory)
14368    }
14369
14370    /// Creates a new client from the provided stub.
14371    ///
14372    /// The most common case for calling this function is in tests mocking the
14373    /// client's behavior.
14374    pub fn from_stub<T>(stub: T) -> Self
14375    where
14376        T: super::stub::Reservations + 'static,
14377    {
14378        Self {
14379            inner: std::sync::Arc::new(stub),
14380        }
14381    }
14382
14383    pub(crate) async fn new(
14384        config: gaxi::options::ClientConfig,
14385    ) -> crate::ClientBuilderResult<Self> {
14386        let inner = Self::build_inner(config).await?;
14387        Ok(Self { inner })
14388    }
14389
14390    async fn build_inner(
14391        conf: gaxi::options::ClientConfig,
14392    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Reservations>> {
14393        if gaxi::options::tracing_enabled(&conf) {
14394            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14395        }
14396        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14397    }
14398
14399    async fn build_transport(
14400        conf: gaxi::options::ClientConfig,
14401    ) -> crate::ClientBuilderResult<impl super::stub::Reservations> {
14402        super::transport::Reservations::new(conf).await
14403    }
14404
14405    async fn build_with_tracing(
14406        conf: gaxi::options::ClientConfig,
14407    ) -> crate::ClientBuilderResult<impl super::stub::Reservations> {
14408        Self::build_transport(conf)
14409            .await
14410            .map(super::tracing::Reservations::new)
14411    }
14412
14413    /// Retrieves an aggregated list of reservations.
14414    ///
14415    /// To prevent failure, it is recommended that you set the
14416    /// `returnPartialSuccess` parameter to `true`.
14417    pub fn aggregated_list(&self) -> super::builder::reservations::AggregatedList {
14418        super::builder::reservations::AggregatedList::new(self.inner.clone())
14419    }
14420
14421    /// Deletes the specified reservation.
14422    pub fn delete(&self) -> super::builder::reservations::Delete {
14423        super::builder::reservations::Delete::new(self.inner.clone())
14424    }
14425
14426    /// Retrieves information about the specified reservation.
14427    pub fn get(&self) -> super::builder::reservations::Get {
14428        super::builder::reservations::Get::new(self.inner.clone())
14429    }
14430
14431    /// Gets the access control policy for a resource. May be empty if no such
14432    /// policy or resource exists.
14433    pub fn get_iam_policy(&self) -> super::builder::reservations::GetIamPolicy {
14434        super::builder::reservations::GetIamPolicy::new(self.inner.clone())
14435    }
14436
14437    /// Creates a new reservation. For more information, readReserving zonal
14438    /// resources.
14439    pub fn insert(&self) -> super::builder::reservations::Insert {
14440        super::builder::reservations::Insert::new(self.inner.clone())
14441    }
14442
14443    /// A list of all the reservations that have been configured for the
14444    /// specified project in specified zone.
14445    pub fn list(&self) -> super::builder::reservations::List {
14446        super::builder::reservations::List::new(self.inner.clone())
14447    }
14448
14449    /// Perform maintenance on an extended reservation
14450    pub fn perform_maintenance(&self) -> super::builder::reservations::PerformMaintenance {
14451        super::builder::reservations::PerformMaintenance::new(self.inner.clone())
14452    }
14453
14454    /// Resizes the reservation (applicable to standalone reservations only). For
14455    /// more information, readModifying
14456    /// reservations.
14457    pub fn resize(&self) -> super::builder::reservations::Resize {
14458        super::builder::reservations::Resize::new(self.inner.clone())
14459    }
14460
14461    /// Sets the access control policy on the specified resource.
14462    /// Replaces any existing policy.
14463    pub fn set_iam_policy(&self) -> super::builder::reservations::SetIamPolicy {
14464        super::builder::reservations::SetIamPolicy::new(self.inner.clone())
14465    }
14466
14467    /// Returns permissions that a caller has on the specified resource.
14468    pub fn test_iam_permissions(&self) -> super::builder::reservations::TestIamPermissions {
14469        super::builder::reservations::TestIamPermissions::new(self.inner.clone())
14470    }
14471
14472    /// Update share settings of the reservation.
14473    pub fn update(&self) -> super::builder::reservations::Update {
14474        super::builder::reservations::Update::new(self.inner.clone())
14475    }
14476
14477    /// Retrieves the specified zone-specific Operations resource.
14478    pub fn get_operation(&self) -> super::builder::reservations::GetOperation {
14479        super::builder::reservations::GetOperation::new(self.inner.clone())
14480    }
14481}
14482
14483/// Implements a client for the Google Compute Engine API.
14484///
14485/// # Example
14486/// ```
14487/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14488/// # use google_cloud_compute_v1::client::ResourcePolicies;
14489/// let client = ResourcePolicies::builder().build().await?;
14490/// // use `client` to make requests to the Google Compute Engine API.
14491/// # Ok(()) }
14492/// ```
14493///
14494/// # Service Description
14495///
14496/// Service for the `resourcePolicies` resource.
14497///
14498/// # Configuration
14499///
14500/// To configure `ResourcePolicies` use the `with_*` methods in the type returned
14501/// by [builder()][ResourcePolicies::builder]. The default configuration should
14502/// work for most applications. Common configuration changes include
14503///
14504/// * [with_endpoint()]: by default this client uses the global default endpoint
14505///   (`https://compute.googleapis.com`). Applications using regional
14506///   endpoints or running in restricted networks (e.g. a network configured
14507//    with [Private Google Access with VPC Service Controls]) may want to
14508///   override this default.
14509/// * [with_credentials()]: by default this client uses
14510///   [Application Default Credentials]. Applications using custom
14511///   authentication may need to override this default.
14512///
14513/// [with_endpoint()]: super::builder::resource_policies::ClientBuilder::with_endpoint
14514/// [with_credentials()]: super::builder::resource_policies::ClientBuilder::credentials
14515/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14516/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14517///
14518/// # Pooling and Cloning
14519///
14520/// `ResourcePolicies` holds a connection pool internally, it is advised to
14521/// create one and the reuse it.  You do not need to wrap `ResourcePolicies` in
14522/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14523/// already uses an `Arc` internally.
14524#[cfg(feature = "resource-policies")]
14525#[cfg_attr(docsrs, doc(cfg(feature = "resource-policies")))]
14526#[derive(Clone, Debug)]
14527pub struct ResourcePolicies {
14528    inner: std::sync::Arc<dyn super::stub::dynamic::ResourcePolicies>,
14529}
14530
14531#[cfg(feature = "resource-policies")]
14532impl ResourcePolicies {
14533    /// Returns a builder for [ResourcePolicies].
14534    ///
14535    /// ```
14536    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14537    /// # use google_cloud_compute_v1::client::ResourcePolicies;
14538    /// let client = ResourcePolicies::builder().build().await?;
14539    /// # Ok(()) }
14540    /// ```
14541    pub fn builder() -> super::builder::resource_policies::ClientBuilder {
14542        crate::new_client_builder(super::builder::resource_policies::client::Factory)
14543    }
14544
14545    /// Creates a new client from the provided stub.
14546    ///
14547    /// The most common case for calling this function is in tests mocking the
14548    /// client's behavior.
14549    pub fn from_stub<T>(stub: T) -> Self
14550    where
14551        T: super::stub::ResourcePolicies + 'static,
14552    {
14553        Self {
14554            inner: std::sync::Arc::new(stub),
14555        }
14556    }
14557
14558    pub(crate) async fn new(
14559        config: gaxi::options::ClientConfig,
14560    ) -> crate::ClientBuilderResult<Self> {
14561        let inner = Self::build_inner(config).await?;
14562        Ok(Self { inner })
14563    }
14564
14565    async fn build_inner(
14566        conf: gaxi::options::ClientConfig,
14567    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ResourcePolicies>>
14568    {
14569        if gaxi::options::tracing_enabled(&conf) {
14570            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14571        }
14572        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14573    }
14574
14575    async fn build_transport(
14576        conf: gaxi::options::ClientConfig,
14577    ) -> crate::ClientBuilderResult<impl super::stub::ResourcePolicies> {
14578        super::transport::ResourcePolicies::new(conf).await
14579    }
14580
14581    async fn build_with_tracing(
14582        conf: gaxi::options::ClientConfig,
14583    ) -> crate::ClientBuilderResult<impl super::stub::ResourcePolicies> {
14584        Self::build_transport(conf)
14585            .await
14586            .map(super::tracing::ResourcePolicies::new)
14587    }
14588
14589    /// Retrieves an aggregated list of resource policies.
14590    ///
14591    /// To prevent failure, Google recommends that you set the
14592    /// `returnPartialSuccess` parameter to `true`.
14593    pub fn aggregated_list(&self) -> super::builder::resource_policies::AggregatedList {
14594        super::builder::resource_policies::AggregatedList::new(self.inner.clone())
14595    }
14596
14597    /// Deletes the specified resource policy.
14598    pub fn delete(&self) -> super::builder::resource_policies::Delete {
14599        super::builder::resource_policies::Delete::new(self.inner.clone())
14600    }
14601
14602    /// Retrieves all information of the specified resource policy.
14603    pub fn get(&self) -> super::builder::resource_policies::Get {
14604        super::builder::resource_policies::Get::new(self.inner.clone())
14605    }
14606
14607    /// Gets the access control policy for a resource. May be empty if no such
14608    /// policy or resource exists.
14609    pub fn get_iam_policy(&self) -> super::builder::resource_policies::GetIamPolicy {
14610        super::builder::resource_policies::GetIamPolicy::new(self.inner.clone())
14611    }
14612
14613    /// Creates a new resource policy.
14614    pub fn insert(&self) -> super::builder::resource_policies::Insert {
14615        super::builder::resource_policies::Insert::new(self.inner.clone())
14616    }
14617
14618    /// A list all the resource policies that have been configured for the
14619    /// specified project in specified region.
14620    pub fn list(&self) -> super::builder::resource_policies::List {
14621        super::builder::resource_policies::List::new(self.inner.clone())
14622    }
14623
14624    /// Modify the specified resource policy.
14625    pub fn patch(&self) -> super::builder::resource_policies::Patch {
14626        super::builder::resource_policies::Patch::new(self.inner.clone())
14627    }
14628
14629    /// Sets the access control policy on the specified resource.
14630    /// Replaces any existing policy.
14631    pub fn set_iam_policy(&self) -> super::builder::resource_policies::SetIamPolicy {
14632        super::builder::resource_policies::SetIamPolicy::new(self.inner.clone())
14633    }
14634
14635    /// Returns permissions that a caller has on the specified resource.
14636    pub fn test_iam_permissions(&self) -> super::builder::resource_policies::TestIamPermissions {
14637        super::builder::resource_policies::TestIamPermissions::new(self.inner.clone())
14638    }
14639
14640    /// Retrieves the specified region-specific Operations resource.
14641    pub fn get_operation(&self) -> super::builder::resource_policies::GetOperation {
14642        super::builder::resource_policies::GetOperation::new(self.inner.clone())
14643    }
14644}
14645
14646/// Implements a client for the Google Compute Engine API.
14647///
14648/// # Example
14649/// ```
14650/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14651/// # use google_cloud_compute_v1::client::Routers;
14652/// let client = Routers::builder().build().await?;
14653/// // use `client` to make requests to the Google Compute Engine API.
14654/// # Ok(()) }
14655/// ```
14656///
14657/// # Service Description
14658///
14659/// Service for the `routers` resource.
14660///
14661/// # Configuration
14662///
14663/// To configure `Routers` use the `with_*` methods in the type returned
14664/// by [builder()][Routers::builder]. The default configuration should
14665/// work for most applications. Common configuration changes include
14666///
14667/// * [with_endpoint()]: by default this client uses the global default endpoint
14668///   (`https://compute.googleapis.com`). Applications using regional
14669///   endpoints or running in restricted networks (e.g. a network configured
14670//    with [Private Google Access with VPC Service Controls]) may want to
14671///   override this default.
14672/// * [with_credentials()]: by default this client uses
14673///   [Application Default Credentials]. Applications using custom
14674///   authentication may need to override this default.
14675///
14676/// [with_endpoint()]: super::builder::routers::ClientBuilder::with_endpoint
14677/// [with_credentials()]: super::builder::routers::ClientBuilder::credentials
14678/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14679/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14680///
14681/// # Pooling and Cloning
14682///
14683/// `Routers` holds a connection pool internally, it is advised to
14684/// create one and the reuse it.  You do not need to wrap `Routers` in
14685/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14686/// already uses an `Arc` internally.
14687#[cfg(feature = "routers")]
14688#[cfg_attr(docsrs, doc(cfg(feature = "routers")))]
14689#[derive(Clone, Debug)]
14690pub struct Routers {
14691    inner: std::sync::Arc<dyn super::stub::dynamic::Routers>,
14692}
14693
14694#[cfg(feature = "routers")]
14695impl Routers {
14696    /// Returns a builder for [Routers].
14697    ///
14698    /// ```
14699    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14700    /// # use google_cloud_compute_v1::client::Routers;
14701    /// let client = Routers::builder().build().await?;
14702    /// # Ok(()) }
14703    /// ```
14704    pub fn builder() -> super::builder::routers::ClientBuilder {
14705        crate::new_client_builder(super::builder::routers::client::Factory)
14706    }
14707
14708    /// Creates a new client from the provided stub.
14709    ///
14710    /// The most common case for calling this function is in tests mocking the
14711    /// client's behavior.
14712    pub fn from_stub<T>(stub: T) -> Self
14713    where
14714        T: super::stub::Routers + 'static,
14715    {
14716        Self {
14717            inner: std::sync::Arc::new(stub),
14718        }
14719    }
14720
14721    pub(crate) async fn new(
14722        config: gaxi::options::ClientConfig,
14723    ) -> crate::ClientBuilderResult<Self> {
14724        let inner = Self::build_inner(config).await?;
14725        Ok(Self { inner })
14726    }
14727
14728    async fn build_inner(
14729        conf: gaxi::options::ClientConfig,
14730    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Routers>> {
14731        if gaxi::options::tracing_enabled(&conf) {
14732            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14733        }
14734        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14735    }
14736
14737    async fn build_transport(
14738        conf: gaxi::options::ClientConfig,
14739    ) -> crate::ClientBuilderResult<impl super::stub::Routers> {
14740        super::transport::Routers::new(conf).await
14741    }
14742
14743    async fn build_with_tracing(
14744        conf: gaxi::options::ClientConfig,
14745    ) -> crate::ClientBuilderResult<impl super::stub::Routers> {
14746        Self::build_transport(conf)
14747            .await
14748            .map(super::tracing::Routers::new)
14749    }
14750
14751    /// Retrieves an aggregated list of routers.
14752    ///
14753    /// To prevent failure, Google recommends that you set the
14754    /// `returnPartialSuccess` parameter to `true`.
14755    pub fn aggregated_list(&self) -> super::builder::routers::AggregatedList {
14756        super::builder::routers::AggregatedList::new(self.inner.clone())
14757    }
14758
14759    /// Deletes the specified Router resource.
14760    pub fn delete(&self) -> super::builder::routers::Delete {
14761        super::builder::routers::Delete::new(self.inner.clone())
14762    }
14763
14764    /// Deletes Route Policy
14765    pub fn delete_route_policy(&self) -> super::builder::routers::DeleteRoutePolicy {
14766        super::builder::routers::DeleteRoutePolicy::new(self.inner.clone())
14767    }
14768
14769    /// Returns the specified Router resource.
14770    pub fn get(&self) -> super::builder::routers::Get {
14771        super::builder::routers::Get::new(self.inner.clone())
14772    }
14773
14774    /// Retrieves runtime NAT IP information.
14775    pub fn get_nat_ip_info(&self) -> super::builder::routers::GetNatIpInfo {
14776        super::builder::routers::GetNatIpInfo::new(self.inner.clone())
14777    }
14778
14779    /// Retrieves runtime Nat mapping information of VM endpoints.
14780    pub fn get_nat_mapping_info(&self) -> super::builder::routers::GetNatMappingInfo {
14781        super::builder::routers::GetNatMappingInfo::new(self.inner.clone())
14782    }
14783
14784    /// Returns specified Route Policy
14785    pub fn get_route_policy(&self) -> super::builder::routers::GetRoutePolicy {
14786        super::builder::routers::GetRoutePolicy::new(self.inner.clone())
14787    }
14788
14789    /// Retrieves runtime information of the specified router.
14790    pub fn get_router_status(&self) -> super::builder::routers::GetRouterStatus {
14791        super::builder::routers::GetRouterStatus::new(self.inner.clone())
14792    }
14793
14794    /// Creates a Router resource in the specified project and region using
14795    /// the data included in the request.
14796    pub fn insert(&self) -> super::builder::routers::Insert {
14797        super::builder::routers::Insert::new(self.inner.clone())
14798    }
14799
14800    /// Retrieves a list of Router resources available to the specified project.
14801    pub fn list(&self) -> super::builder::routers::List {
14802        super::builder::routers::List::new(self.inner.clone())
14803    }
14804
14805    /// Retrieves a list of router bgp routes available to the specified project.
14806    pub fn list_bgp_routes(&self) -> super::builder::routers::ListBgpRoutes {
14807        super::builder::routers::ListBgpRoutes::new(self.inner.clone())
14808    }
14809
14810    /// Retrieves a list of router route policy subresources available to the
14811    /// specified project.
14812    pub fn list_route_policies(&self) -> super::builder::routers::ListRoutePolicies {
14813        super::builder::routers::ListRoutePolicies::new(self.inner.clone())
14814    }
14815
14816    /// Patches the specified Router resource with the data included in the
14817    /// request. This method supportsPATCH
14818    /// semantics and usesJSON merge
14819    /// patch format and processing rules.
14820    pub fn patch(&self) -> super::builder::routers::Patch {
14821        super::builder::routers::Patch::new(self.inner.clone())
14822    }
14823
14824    /// Patches Route Policy
14825    pub fn patch_route_policy(&self) -> super::builder::routers::PatchRoutePolicy {
14826        super::builder::routers::PatchRoutePolicy::new(self.inner.clone())
14827    }
14828
14829    /// Preview fields auto-generated during router create andupdate operations.
14830    /// Calling this method does NOT create or update the router.
14831    pub fn preview(&self) -> super::builder::routers::Preview {
14832        super::builder::routers::Preview::new(self.inner.clone())
14833    }
14834
14835    /// Updates the specified Router resource with the data included in the
14836    /// request.  This method conforms toPUT semantics, which requests that the state of the
14837    /// target resource be created or replaced with the state defined by the
14838    /// representation enclosed in the request message payload.
14839    pub fn update(&self) -> super::builder::routers::Update {
14840        super::builder::routers::Update::new(self.inner.clone())
14841    }
14842
14843    /// Updates or creates new Route Policy
14844    pub fn update_route_policy(&self) -> super::builder::routers::UpdateRoutePolicy {
14845        super::builder::routers::UpdateRoutePolicy::new(self.inner.clone())
14846    }
14847
14848    /// Retrieves the specified region-specific Operations resource.
14849    pub fn get_operation(&self) -> super::builder::routers::GetOperation {
14850        super::builder::routers::GetOperation::new(self.inner.clone())
14851    }
14852}
14853
14854/// Implements a client for the Google Compute Engine API.
14855///
14856/// # Example
14857/// ```
14858/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14859/// # use google_cloud_compute_v1::client::Routes;
14860/// let client = Routes::builder().build().await?;
14861/// // use `client` to make requests to the Google Compute Engine API.
14862/// # Ok(()) }
14863/// ```
14864///
14865/// # Service Description
14866///
14867/// Service for the `routes` resource.
14868///
14869/// # Configuration
14870///
14871/// To configure `Routes` use the `with_*` methods in the type returned
14872/// by [builder()][Routes::builder]. The default configuration should
14873/// work for most applications. Common configuration changes include
14874///
14875/// * [with_endpoint()]: by default this client uses the global default endpoint
14876///   (`https://compute.googleapis.com`). Applications using regional
14877///   endpoints or running in restricted networks (e.g. a network configured
14878//    with [Private Google Access with VPC Service Controls]) may want to
14879///   override this default.
14880/// * [with_credentials()]: by default this client uses
14881///   [Application Default Credentials]. Applications using custom
14882///   authentication may need to override this default.
14883///
14884/// [with_endpoint()]: super::builder::routes::ClientBuilder::with_endpoint
14885/// [with_credentials()]: super::builder::routes::ClientBuilder::credentials
14886/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14887/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14888///
14889/// # Pooling and Cloning
14890///
14891/// `Routes` holds a connection pool internally, it is advised to
14892/// create one and the reuse it.  You do not need to wrap `Routes` in
14893/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14894/// already uses an `Arc` internally.
14895#[cfg(feature = "routes")]
14896#[cfg_attr(docsrs, doc(cfg(feature = "routes")))]
14897#[derive(Clone, Debug)]
14898pub struct Routes {
14899    inner: std::sync::Arc<dyn super::stub::dynamic::Routes>,
14900}
14901
14902#[cfg(feature = "routes")]
14903impl Routes {
14904    /// Returns a builder for [Routes].
14905    ///
14906    /// ```
14907    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14908    /// # use google_cloud_compute_v1::client::Routes;
14909    /// let client = Routes::builder().build().await?;
14910    /// # Ok(()) }
14911    /// ```
14912    pub fn builder() -> super::builder::routes::ClientBuilder {
14913        crate::new_client_builder(super::builder::routes::client::Factory)
14914    }
14915
14916    /// Creates a new client from the provided stub.
14917    ///
14918    /// The most common case for calling this function is in tests mocking the
14919    /// client's behavior.
14920    pub fn from_stub<T>(stub: T) -> Self
14921    where
14922        T: super::stub::Routes + 'static,
14923    {
14924        Self {
14925            inner: std::sync::Arc::new(stub),
14926        }
14927    }
14928
14929    pub(crate) async fn new(
14930        config: gaxi::options::ClientConfig,
14931    ) -> crate::ClientBuilderResult<Self> {
14932        let inner = Self::build_inner(config).await?;
14933        Ok(Self { inner })
14934    }
14935
14936    async fn build_inner(
14937        conf: gaxi::options::ClientConfig,
14938    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Routes>> {
14939        if gaxi::options::tracing_enabled(&conf) {
14940            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14941        }
14942        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14943    }
14944
14945    async fn build_transport(
14946        conf: gaxi::options::ClientConfig,
14947    ) -> crate::ClientBuilderResult<impl super::stub::Routes> {
14948        super::transport::Routes::new(conf).await
14949    }
14950
14951    async fn build_with_tracing(
14952        conf: gaxi::options::ClientConfig,
14953    ) -> crate::ClientBuilderResult<impl super::stub::Routes> {
14954        Self::build_transport(conf)
14955            .await
14956            .map(super::tracing::Routes::new)
14957    }
14958
14959    /// Deletes the specified Route resource.
14960    pub fn delete(&self) -> super::builder::routes::Delete {
14961        super::builder::routes::Delete::new(self.inner.clone())
14962    }
14963
14964    /// Returns the specified Route resource.
14965    pub fn get(&self) -> super::builder::routes::Get {
14966        super::builder::routes::Get::new(self.inner.clone())
14967    }
14968
14969    /// Creates a Route resource in the specified project using the data included
14970    /// in the request.
14971    pub fn insert(&self) -> super::builder::routes::Insert {
14972        super::builder::routes::Insert::new(self.inner.clone())
14973    }
14974
14975    /// Retrieves the list of Route resources available to the specified project.
14976    pub fn list(&self) -> super::builder::routes::List {
14977        super::builder::routes::List::new(self.inner.clone())
14978    }
14979
14980    /// Returns permissions that a caller has on the specified resource.
14981    pub fn test_iam_permissions(&self) -> super::builder::routes::TestIamPermissions {
14982        super::builder::routes::TestIamPermissions::new(self.inner.clone())
14983    }
14984
14985    /// Retrieves the specified Operations resource.
14986    pub fn get_operation(&self) -> super::builder::routes::GetOperation {
14987        super::builder::routes::GetOperation::new(self.inner.clone())
14988    }
14989}
14990
14991/// Implements a client for the Google Compute Engine API.
14992///
14993/// # Example
14994/// ```
14995/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14996/// # use google_cloud_compute_v1::client::SecurityPolicies;
14997/// let client = SecurityPolicies::builder().build().await?;
14998/// // use `client` to make requests to the Google Compute Engine API.
14999/// # Ok(()) }
15000/// ```
15001///
15002/// # Service Description
15003///
15004/// Service for the `securityPolicies` resource.
15005///
15006/// # Configuration
15007///
15008/// To configure `SecurityPolicies` use the `with_*` methods in the type returned
15009/// by [builder()][SecurityPolicies::builder]. The default configuration should
15010/// work for most applications. Common configuration changes include
15011///
15012/// * [with_endpoint()]: by default this client uses the global default endpoint
15013///   (`https://compute.googleapis.com`). Applications using regional
15014///   endpoints or running in restricted networks (e.g. a network configured
15015//    with [Private Google Access with VPC Service Controls]) may want to
15016///   override this default.
15017/// * [with_credentials()]: by default this client uses
15018///   [Application Default Credentials]. Applications using custom
15019///   authentication may need to override this default.
15020///
15021/// [with_endpoint()]: super::builder::security_policies::ClientBuilder::with_endpoint
15022/// [with_credentials()]: super::builder::security_policies::ClientBuilder::credentials
15023/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15024/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15025///
15026/// # Pooling and Cloning
15027///
15028/// `SecurityPolicies` holds a connection pool internally, it is advised to
15029/// create one and the reuse it.  You do not need to wrap `SecurityPolicies` in
15030/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15031/// already uses an `Arc` internally.
15032#[cfg(feature = "security-policies")]
15033#[cfg_attr(docsrs, doc(cfg(feature = "security-policies")))]
15034#[derive(Clone, Debug)]
15035pub struct SecurityPolicies {
15036    inner: std::sync::Arc<dyn super::stub::dynamic::SecurityPolicies>,
15037}
15038
15039#[cfg(feature = "security-policies")]
15040impl SecurityPolicies {
15041    /// Returns a builder for [SecurityPolicies].
15042    ///
15043    /// ```
15044    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15045    /// # use google_cloud_compute_v1::client::SecurityPolicies;
15046    /// let client = SecurityPolicies::builder().build().await?;
15047    /// # Ok(()) }
15048    /// ```
15049    pub fn builder() -> super::builder::security_policies::ClientBuilder {
15050        crate::new_client_builder(super::builder::security_policies::client::Factory)
15051    }
15052
15053    /// Creates a new client from the provided stub.
15054    ///
15055    /// The most common case for calling this function is in tests mocking the
15056    /// client's behavior.
15057    pub fn from_stub<T>(stub: T) -> Self
15058    where
15059        T: super::stub::SecurityPolicies + 'static,
15060    {
15061        Self {
15062            inner: std::sync::Arc::new(stub),
15063        }
15064    }
15065
15066    pub(crate) async fn new(
15067        config: gaxi::options::ClientConfig,
15068    ) -> crate::ClientBuilderResult<Self> {
15069        let inner = Self::build_inner(config).await?;
15070        Ok(Self { inner })
15071    }
15072
15073    async fn build_inner(
15074        conf: gaxi::options::ClientConfig,
15075    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SecurityPolicies>>
15076    {
15077        if gaxi::options::tracing_enabled(&conf) {
15078            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15079        }
15080        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15081    }
15082
15083    async fn build_transport(
15084        conf: gaxi::options::ClientConfig,
15085    ) -> crate::ClientBuilderResult<impl super::stub::SecurityPolicies> {
15086        super::transport::SecurityPolicies::new(conf).await
15087    }
15088
15089    async fn build_with_tracing(
15090        conf: gaxi::options::ClientConfig,
15091    ) -> crate::ClientBuilderResult<impl super::stub::SecurityPolicies> {
15092        Self::build_transport(conf)
15093            .await
15094            .map(super::tracing::SecurityPolicies::new)
15095    }
15096
15097    /// Inserts a rule into a security policy.
15098    pub fn add_rule(&self) -> super::builder::security_policies::AddRule {
15099        super::builder::security_policies::AddRule::new(self.inner.clone())
15100    }
15101
15102    /// Retrieves the list of all SecurityPolicy resources, regional and global,
15103    /// available to the specified project.
15104    ///
15105    /// To prevent failure, Google recommends that you set the
15106    /// `returnPartialSuccess` parameter to `true`.
15107    pub fn aggregated_list(&self) -> super::builder::security_policies::AggregatedList {
15108        super::builder::security_policies::AggregatedList::new(self.inner.clone())
15109    }
15110
15111    /// Deletes the specified policy.
15112    pub fn delete(&self) -> super::builder::security_policies::Delete {
15113        super::builder::security_policies::Delete::new(self.inner.clone())
15114    }
15115
15116    /// List all of the ordered rules present in a single specified policy.
15117    pub fn get(&self) -> super::builder::security_policies::Get {
15118        super::builder::security_policies::Get::new(self.inner.clone())
15119    }
15120
15121    /// Gets a rule at the specified priority.
15122    pub fn get_rule(&self) -> super::builder::security_policies::GetRule {
15123        super::builder::security_policies::GetRule::new(self.inner.clone())
15124    }
15125
15126    /// Creates a new policy in the specified project using the data included in
15127    /// the request.
15128    pub fn insert(&self) -> super::builder::security_policies::Insert {
15129        super::builder::security_policies::Insert::new(self.inner.clone())
15130    }
15131
15132    /// List all the policies that have been configured for the specified project.
15133    pub fn list(&self) -> super::builder::security_policies::List {
15134        super::builder::security_policies::List::new(self.inner.clone())
15135    }
15136
15137    /// Gets the current list of preconfigured Web Application Firewall (WAF)
15138    /// expressions.
15139    pub fn list_preconfigured_expression_sets(
15140        &self,
15141    ) -> super::builder::security_policies::ListPreconfiguredExpressionSets {
15142        super::builder::security_policies::ListPreconfiguredExpressionSets::new(self.inner.clone())
15143    }
15144
15145    /// Patches the specified policy with the data included in the request. To
15146    /// clear fields in the policy, leave the fields empty and specify them in the
15147    /// updateMask. This cannot be used to be update the rules in the policy.
15148    /// Please use the per rule methods like addRule, patchRule, and removeRule
15149    /// instead.
15150    pub fn patch(&self) -> super::builder::security_policies::Patch {
15151        super::builder::security_policies::Patch::new(self.inner.clone())
15152    }
15153
15154    /// Patches a rule at the specified priority. To clear fields in the rule,
15155    /// leave the fields empty and specify them in the updateMask.
15156    pub fn patch_rule(&self) -> super::builder::security_policies::PatchRule {
15157        super::builder::security_policies::PatchRule::new(self.inner.clone())
15158    }
15159
15160    /// Deletes a rule at the specified priority.
15161    pub fn remove_rule(&self) -> super::builder::security_policies::RemoveRule {
15162        super::builder::security_policies::RemoveRule::new(self.inner.clone())
15163    }
15164
15165    /// Sets the labels on a security policy. To learn more about labels,
15166    /// read the Labeling Resources
15167    /// documentation.
15168    pub fn set_labels(&self) -> super::builder::security_policies::SetLabels {
15169        super::builder::security_policies::SetLabels::new(self.inner.clone())
15170    }
15171
15172    /// Retrieves the specified Operations resource.
15173    pub fn get_operation(&self) -> super::builder::security_policies::GetOperation {
15174        super::builder::security_policies::GetOperation::new(self.inner.clone())
15175    }
15176}
15177
15178/// Implements a client for the Google Compute Engine API.
15179///
15180/// # Example
15181/// ```
15182/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15183/// # use google_cloud_compute_v1::client::ServiceAttachments;
15184/// let client = ServiceAttachments::builder().build().await?;
15185/// // use `client` to make requests to the Google Compute Engine API.
15186/// # Ok(()) }
15187/// ```
15188///
15189/// # Service Description
15190///
15191/// Service for the `serviceAttachments` resource.
15192///
15193/// # Configuration
15194///
15195/// To configure `ServiceAttachments` use the `with_*` methods in the type returned
15196/// by [builder()][ServiceAttachments::builder]. The default configuration should
15197/// work for most applications. Common configuration changes include
15198///
15199/// * [with_endpoint()]: by default this client uses the global default endpoint
15200///   (`https://compute.googleapis.com`). Applications using regional
15201///   endpoints or running in restricted networks (e.g. a network configured
15202//    with [Private Google Access with VPC Service Controls]) may want to
15203///   override this default.
15204/// * [with_credentials()]: by default this client uses
15205///   [Application Default Credentials]. Applications using custom
15206///   authentication may need to override this default.
15207///
15208/// [with_endpoint()]: super::builder::service_attachments::ClientBuilder::with_endpoint
15209/// [with_credentials()]: super::builder::service_attachments::ClientBuilder::credentials
15210/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15211/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15212///
15213/// # Pooling and Cloning
15214///
15215/// `ServiceAttachments` holds a connection pool internally, it is advised to
15216/// create one and the reuse it.  You do not need to wrap `ServiceAttachments` in
15217/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15218/// already uses an `Arc` internally.
15219#[cfg(feature = "service-attachments")]
15220#[cfg_attr(docsrs, doc(cfg(feature = "service-attachments")))]
15221#[derive(Clone, Debug)]
15222pub struct ServiceAttachments {
15223    inner: std::sync::Arc<dyn super::stub::dynamic::ServiceAttachments>,
15224}
15225
15226#[cfg(feature = "service-attachments")]
15227impl ServiceAttachments {
15228    /// Returns a builder for [ServiceAttachments].
15229    ///
15230    /// ```
15231    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15232    /// # use google_cloud_compute_v1::client::ServiceAttachments;
15233    /// let client = ServiceAttachments::builder().build().await?;
15234    /// # Ok(()) }
15235    /// ```
15236    pub fn builder() -> super::builder::service_attachments::ClientBuilder {
15237        crate::new_client_builder(super::builder::service_attachments::client::Factory)
15238    }
15239
15240    /// Creates a new client from the provided stub.
15241    ///
15242    /// The most common case for calling this function is in tests mocking the
15243    /// client's behavior.
15244    pub fn from_stub<T>(stub: T) -> Self
15245    where
15246        T: super::stub::ServiceAttachments + 'static,
15247    {
15248        Self {
15249            inner: std::sync::Arc::new(stub),
15250        }
15251    }
15252
15253    pub(crate) async fn new(
15254        config: gaxi::options::ClientConfig,
15255    ) -> crate::ClientBuilderResult<Self> {
15256        let inner = Self::build_inner(config).await?;
15257        Ok(Self { inner })
15258    }
15259
15260    async fn build_inner(
15261        conf: gaxi::options::ClientConfig,
15262    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ServiceAttachments>>
15263    {
15264        if gaxi::options::tracing_enabled(&conf) {
15265            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15266        }
15267        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15268    }
15269
15270    async fn build_transport(
15271        conf: gaxi::options::ClientConfig,
15272    ) -> crate::ClientBuilderResult<impl super::stub::ServiceAttachments> {
15273        super::transport::ServiceAttachments::new(conf).await
15274    }
15275
15276    async fn build_with_tracing(
15277        conf: gaxi::options::ClientConfig,
15278    ) -> crate::ClientBuilderResult<impl super::stub::ServiceAttachments> {
15279        Self::build_transport(conf)
15280            .await
15281            .map(super::tracing::ServiceAttachments::new)
15282    }
15283
15284    /// Retrieves the list of all ServiceAttachment resources,
15285    /// regional and global, available to the specified project.
15286    ///
15287    /// To prevent failure, Google recommends that you set the
15288    /// `returnPartialSuccess` parameter to `true`.
15289    pub fn aggregated_list(&self) -> super::builder::service_attachments::AggregatedList {
15290        super::builder::service_attachments::AggregatedList::new(self.inner.clone())
15291    }
15292
15293    /// Deletes the specified ServiceAttachment in the given scope
15294    pub fn delete(&self) -> super::builder::service_attachments::Delete {
15295        super::builder::service_attachments::Delete::new(self.inner.clone())
15296    }
15297
15298    /// Returns the specified ServiceAttachment resource in the given scope.
15299    pub fn get(&self) -> super::builder::service_attachments::Get {
15300        super::builder::service_attachments::Get::new(self.inner.clone())
15301    }
15302
15303    /// Gets the access control policy for a resource. May be empty if no such
15304    /// policy or resource exists.
15305    pub fn get_iam_policy(&self) -> super::builder::service_attachments::GetIamPolicy {
15306        super::builder::service_attachments::GetIamPolicy::new(self.inner.clone())
15307    }
15308
15309    /// Creates a ServiceAttachment in the specified project in the given scope
15310    /// using the parameters that are included in the request.
15311    pub fn insert(&self) -> super::builder::service_attachments::Insert {
15312        super::builder::service_attachments::Insert::new(self.inner.clone())
15313    }
15314
15315    /// Lists the ServiceAttachments for a project in the given scope.
15316    pub fn list(&self) -> super::builder::service_attachments::List {
15317        super::builder::service_attachments::List::new(self.inner.clone())
15318    }
15319
15320    /// Patches the specified ServiceAttachment resource with the data included in
15321    /// the request. This method supports PATCH
15322    /// semantics and usesJSON merge
15323    /// patch format and processing rules.
15324    pub fn patch(&self) -> super::builder::service_attachments::Patch {
15325        super::builder::service_attachments::Patch::new(self.inner.clone())
15326    }
15327
15328    /// Sets the access control policy on the specified resource.
15329    /// Replaces any existing policy.
15330    pub fn set_iam_policy(&self) -> super::builder::service_attachments::SetIamPolicy {
15331        super::builder::service_attachments::SetIamPolicy::new(self.inner.clone())
15332    }
15333
15334    /// Returns permissions that a caller has on the specified resource.
15335    pub fn test_iam_permissions(&self) -> super::builder::service_attachments::TestIamPermissions {
15336        super::builder::service_attachments::TestIamPermissions::new(self.inner.clone())
15337    }
15338
15339    /// Retrieves the specified region-specific Operations resource.
15340    pub fn get_operation(&self) -> super::builder::service_attachments::GetOperation {
15341        super::builder::service_attachments::GetOperation::new(self.inner.clone())
15342    }
15343}
15344
15345/// Implements a client for the Google Compute Engine API.
15346///
15347/// # Example
15348/// ```
15349/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15350/// # use google_cloud_compute_v1::client::SnapshotSettings;
15351/// let client = SnapshotSettings::builder().build().await?;
15352/// // use `client` to make requests to the Google Compute Engine API.
15353/// # Ok(()) }
15354/// ```
15355///
15356/// # Service Description
15357///
15358/// Service for the `snapshotSettings` resource.
15359///
15360/// # Configuration
15361///
15362/// To configure `SnapshotSettings` use the `with_*` methods in the type returned
15363/// by [builder()][SnapshotSettings::builder]. The default configuration should
15364/// work for most applications. Common configuration changes include
15365///
15366/// * [with_endpoint()]: by default this client uses the global default endpoint
15367///   (`https://compute.googleapis.com`). Applications using regional
15368///   endpoints or running in restricted networks (e.g. a network configured
15369//    with [Private Google Access with VPC Service Controls]) may want to
15370///   override this default.
15371/// * [with_credentials()]: by default this client uses
15372///   [Application Default Credentials]. Applications using custom
15373///   authentication may need to override this default.
15374///
15375/// [with_endpoint()]: super::builder::snapshot_settings::ClientBuilder::with_endpoint
15376/// [with_credentials()]: super::builder::snapshot_settings::ClientBuilder::credentials
15377/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15378/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15379///
15380/// # Pooling and Cloning
15381///
15382/// `SnapshotSettings` holds a connection pool internally, it is advised to
15383/// create one and the reuse it.  You do not need to wrap `SnapshotSettings` in
15384/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15385/// already uses an `Arc` internally.
15386#[cfg(feature = "snapshot-settings")]
15387#[cfg_attr(docsrs, doc(cfg(feature = "snapshot-settings")))]
15388#[derive(Clone, Debug)]
15389pub struct SnapshotSettings {
15390    inner: std::sync::Arc<dyn super::stub::dynamic::SnapshotSettings>,
15391}
15392
15393#[cfg(feature = "snapshot-settings")]
15394impl SnapshotSettings {
15395    /// Returns a builder for [SnapshotSettings].
15396    ///
15397    /// ```
15398    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15399    /// # use google_cloud_compute_v1::client::SnapshotSettings;
15400    /// let client = SnapshotSettings::builder().build().await?;
15401    /// # Ok(()) }
15402    /// ```
15403    pub fn builder() -> super::builder::snapshot_settings::ClientBuilder {
15404        crate::new_client_builder(super::builder::snapshot_settings::client::Factory)
15405    }
15406
15407    /// Creates a new client from the provided stub.
15408    ///
15409    /// The most common case for calling this function is in tests mocking the
15410    /// client's behavior.
15411    pub fn from_stub<T>(stub: T) -> Self
15412    where
15413        T: super::stub::SnapshotSettings + 'static,
15414    {
15415        Self {
15416            inner: std::sync::Arc::new(stub),
15417        }
15418    }
15419
15420    pub(crate) async fn new(
15421        config: gaxi::options::ClientConfig,
15422    ) -> crate::ClientBuilderResult<Self> {
15423        let inner = Self::build_inner(config).await?;
15424        Ok(Self { inner })
15425    }
15426
15427    async fn build_inner(
15428        conf: gaxi::options::ClientConfig,
15429    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SnapshotSettings>>
15430    {
15431        if gaxi::options::tracing_enabled(&conf) {
15432            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15433        }
15434        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15435    }
15436
15437    async fn build_transport(
15438        conf: gaxi::options::ClientConfig,
15439    ) -> crate::ClientBuilderResult<impl super::stub::SnapshotSettings> {
15440        super::transport::SnapshotSettings::new(conf).await
15441    }
15442
15443    async fn build_with_tracing(
15444        conf: gaxi::options::ClientConfig,
15445    ) -> crate::ClientBuilderResult<impl super::stub::SnapshotSettings> {
15446        Self::build_transport(conf)
15447            .await
15448            .map(super::tracing::SnapshotSettings::new)
15449    }
15450
15451    /// Get snapshot settings.
15452    pub fn get(&self) -> super::builder::snapshot_settings::Get {
15453        super::builder::snapshot_settings::Get::new(self.inner.clone())
15454    }
15455
15456    /// Patch snapshot settings.
15457    pub fn patch(&self) -> super::builder::snapshot_settings::Patch {
15458        super::builder::snapshot_settings::Patch::new(self.inner.clone())
15459    }
15460
15461    /// Retrieves the specified Operations resource.
15462    pub fn get_operation(&self) -> super::builder::snapshot_settings::GetOperation {
15463        super::builder::snapshot_settings::GetOperation::new(self.inner.clone())
15464    }
15465}
15466
15467/// Implements a client for the Google Compute Engine API.
15468///
15469/// # Example
15470/// ```
15471/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15472/// # use google_cloud_compute_v1::client::Snapshots;
15473/// let client = Snapshots::builder().build().await?;
15474/// // use `client` to make requests to the Google Compute Engine API.
15475/// # Ok(()) }
15476/// ```
15477///
15478/// # Service Description
15479///
15480/// Service for the `snapshots` resource.
15481///
15482/// # Configuration
15483///
15484/// To configure `Snapshots` use the `with_*` methods in the type returned
15485/// by [builder()][Snapshots::builder]. The default configuration should
15486/// work for most applications. Common configuration changes include
15487///
15488/// * [with_endpoint()]: by default this client uses the global default endpoint
15489///   (`https://compute.googleapis.com`). Applications using regional
15490///   endpoints or running in restricted networks (e.g. a network configured
15491//    with [Private Google Access with VPC Service Controls]) may want to
15492///   override this default.
15493/// * [with_credentials()]: by default this client uses
15494///   [Application Default Credentials]. Applications using custom
15495///   authentication may need to override this default.
15496///
15497/// [with_endpoint()]: super::builder::snapshots::ClientBuilder::with_endpoint
15498/// [with_credentials()]: super::builder::snapshots::ClientBuilder::credentials
15499/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15500/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15501///
15502/// # Pooling and Cloning
15503///
15504/// `Snapshots` holds a connection pool internally, it is advised to
15505/// create one and the reuse it.  You do not need to wrap `Snapshots` in
15506/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15507/// already uses an `Arc` internally.
15508#[cfg(feature = "snapshots")]
15509#[cfg_attr(docsrs, doc(cfg(feature = "snapshots")))]
15510#[derive(Clone, Debug)]
15511pub struct Snapshots {
15512    inner: std::sync::Arc<dyn super::stub::dynamic::Snapshots>,
15513}
15514
15515#[cfg(feature = "snapshots")]
15516impl Snapshots {
15517    /// Returns a builder for [Snapshots].
15518    ///
15519    /// ```
15520    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15521    /// # use google_cloud_compute_v1::client::Snapshots;
15522    /// let client = Snapshots::builder().build().await?;
15523    /// # Ok(()) }
15524    /// ```
15525    pub fn builder() -> super::builder::snapshots::ClientBuilder {
15526        crate::new_client_builder(super::builder::snapshots::client::Factory)
15527    }
15528
15529    /// Creates a new client from the provided stub.
15530    ///
15531    /// The most common case for calling this function is in tests mocking the
15532    /// client's behavior.
15533    pub fn from_stub<T>(stub: T) -> Self
15534    where
15535        T: super::stub::Snapshots + 'static,
15536    {
15537        Self {
15538            inner: std::sync::Arc::new(stub),
15539        }
15540    }
15541
15542    pub(crate) async fn new(
15543        config: gaxi::options::ClientConfig,
15544    ) -> crate::ClientBuilderResult<Self> {
15545        let inner = Self::build_inner(config).await?;
15546        Ok(Self { inner })
15547    }
15548
15549    async fn build_inner(
15550        conf: gaxi::options::ClientConfig,
15551    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Snapshots>> {
15552        if gaxi::options::tracing_enabled(&conf) {
15553            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15554        }
15555        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15556    }
15557
15558    async fn build_transport(
15559        conf: gaxi::options::ClientConfig,
15560    ) -> crate::ClientBuilderResult<impl super::stub::Snapshots> {
15561        super::transport::Snapshots::new(conf).await
15562    }
15563
15564    async fn build_with_tracing(
15565        conf: gaxi::options::ClientConfig,
15566    ) -> crate::ClientBuilderResult<impl super::stub::Snapshots> {
15567        Self::build_transport(conf)
15568            .await
15569            .map(super::tracing::Snapshots::new)
15570    }
15571
15572    /// Deletes the specified Snapshot resource. Keep in mind that deleting
15573    /// a single snapshot might not necessarily delete all the data on that
15574    /// snapshot. If any data on the snapshot that is marked for deletion is
15575    /// needed for subsequent snapshots, the data will be moved to the next
15576    /// corresponding snapshot.
15577    ///
15578    /// For more information, seeDeleting
15579    /// snapshots.
15580    pub fn delete(&self) -> super::builder::snapshots::Delete {
15581        super::builder::snapshots::Delete::new(self.inner.clone())
15582    }
15583
15584    /// Returns the specified Snapshot resource.
15585    pub fn get(&self) -> super::builder::snapshots::Get {
15586        super::builder::snapshots::Get::new(self.inner.clone())
15587    }
15588
15589    /// Gets the access control policy for a resource. May be empty if no such
15590    /// policy or resource exists.
15591    pub fn get_iam_policy(&self) -> super::builder::snapshots::GetIamPolicy {
15592        super::builder::snapshots::GetIamPolicy::new(self.inner.clone())
15593    }
15594
15595    /// Creates a snapshot in the specified project using the data included
15596    /// in the request. For regular snapshot creation, consider using this method
15597    /// instead of disks.createSnapshot,
15598    /// as this method supports more features, such as creating snapshots in a
15599    /// project different from the source disk project.
15600    pub fn insert(&self) -> super::builder::snapshots::Insert {
15601        super::builder::snapshots::Insert::new(self.inner.clone())
15602    }
15603
15604    /// Retrieves the list of Snapshot resources contained within
15605    /// the specified project.
15606    pub fn list(&self) -> super::builder::snapshots::List {
15607        super::builder::snapshots::List::new(self.inner.clone())
15608    }
15609
15610    /// Sets the access control policy on the specified resource.
15611    /// Replaces any existing policy.
15612    pub fn set_iam_policy(&self) -> super::builder::snapshots::SetIamPolicy {
15613        super::builder::snapshots::SetIamPolicy::new(self.inner.clone())
15614    }
15615
15616    /// Sets the labels on a snapshot. To learn more about labels, read theLabeling
15617    /// Resources documentation.
15618    pub fn set_labels(&self) -> super::builder::snapshots::SetLabels {
15619        super::builder::snapshots::SetLabels::new(self.inner.clone())
15620    }
15621
15622    /// Returns permissions that a caller has on the specified resource.
15623    pub fn test_iam_permissions(&self) -> super::builder::snapshots::TestIamPermissions {
15624        super::builder::snapshots::TestIamPermissions::new(self.inner.clone())
15625    }
15626
15627    /// Retrieves the specified Operations resource.
15628    pub fn get_operation(&self) -> super::builder::snapshots::GetOperation {
15629        super::builder::snapshots::GetOperation::new(self.inner.clone())
15630    }
15631}
15632
15633/// Implements a client for the Google Compute Engine API.
15634///
15635/// # Example
15636/// ```
15637/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15638/// # use google_cloud_compute_v1::client::SslCertificates;
15639/// let client = SslCertificates::builder().build().await?;
15640/// // use `client` to make requests to the Google Compute Engine API.
15641/// # Ok(()) }
15642/// ```
15643///
15644/// # Service Description
15645///
15646/// Service for the `sslCertificates` resource.
15647///
15648/// # Configuration
15649///
15650/// To configure `SslCertificates` use the `with_*` methods in the type returned
15651/// by [builder()][SslCertificates::builder]. The default configuration should
15652/// work for most applications. Common configuration changes include
15653///
15654/// * [with_endpoint()]: by default this client uses the global default endpoint
15655///   (`https://compute.googleapis.com`). Applications using regional
15656///   endpoints or running in restricted networks (e.g. a network configured
15657//    with [Private Google Access with VPC Service Controls]) may want to
15658///   override this default.
15659/// * [with_credentials()]: by default this client uses
15660///   [Application Default Credentials]. Applications using custom
15661///   authentication may need to override this default.
15662///
15663/// [with_endpoint()]: super::builder::ssl_certificates::ClientBuilder::with_endpoint
15664/// [with_credentials()]: super::builder::ssl_certificates::ClientBuilder::credentials
15665/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15666/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15667///
15668/// # Pooling and Cloning
15669///
15670/// `SslCertificates` holds a connection pool internally, it is advised to
15671/// create one and the reuse it.  You do not need to wrap `SslCertificates` in
15672/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15673/// already uses an `Arc` internally.
15674#[cfg(feature = "ssl-certificates")]
15675#[cfg_attr(docsrs, doc(cfg(feature = "ssl-certificates")))]
15676#[derive(Clone, Debug)]
15677pub struct SslCertificates {
15678    inner: std::sync::Arc<dyn super::stub::dynamic::SslCertificates>,
15679}
15680
15681#[cfg(feature = "ssl-certificates")]
15682impl SslCertificates {
15683    /// Returns a builder for [SslCertificates].
15684    ///
15685    /// ```
15686    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15687    /// # use google_cloud_compute_v1::client::SslCertificates;
15688    /// let client = SslCertificates::builder().build().await?;
15689    /// # Ok(()) }
15690    /// ```
15691    pub fn builder() -> super::builder::ssl_certificates::ClientBuilder {
15692        crate::new_client_builder(super::builder::ssl_certificates::client::Factory)
15693    }
15694
15695    /// Creates a new client from the provided stub.
15696    ///
15697    /// The most common case for calling this function is in tests mocking the
15698    /// client's behavior.
15699    pub fn from_stub<T>(stub: T) -> Self
15700    where
15701        T: super::stub::SslCertificates + 'static,
15702    {
15703        Self {
15704            inner: std::sync::Arc::new(stub),
15705        }
15706    }
15707
15708    pub(crate) async fn new(
15709        config: gaxi::options::ClientConfig,
15710    ) -> crate::ClientBuilderResult<Self> {
15711        let inner = Self::build_inner(config).await?;
15712        Ok(Self { inner })
15713    }
15714
15715    async fn build_inner(
15716        conf: gaxi::options::ClientConfig,
15717    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SslCertificates>> {
15718        if gaxi::options::tracing_enabled(&conf) {
15719            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15720        }
15721        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15722    }
15723
15724    async fn build_transport(
15725        conf: gaxi::options::ClientConfig,
15726    ) -> crate::ClientBuilderResult<impl super::stub::SslCertificates> {
15727        super::transport::SslCertificates::new(conf).await
15728    }
15729
15730    async fn build_with_tracing(
15731        conf: gaxi::options::ClientConfig,
15732    ) -> crate::ClientBuilderResult<impl super::stub::SslCertificates> {
15733        Self::build_transport(conf)
15734            .await
15735            .map(super::tracing::SslCertificates::new)
15736    }
15737
15738    /// Retrieves the list of all SslCertificate resources, regional and global,
15739    /// available to the specified project.
15740    ///
15741    /// To prevent failure, Google recommends that you set the
15742    /// `returnPartialSuccess` parameter to `true`.
15743    pub fn aggregated_list(&self) -> super::builder::ssl_certificates::AggregatedList {
15744        super::builder::ssl_certificates::AggregatedList::new(self.inner.clone())
15745    }
15746
15747    /// Deletes the specified SslCertificate resource.
15748    pub fn delete(&self) -> super::builder::ssl_certificates::Delete {
15749        super::builder::ssl_certificates::Delete::new(self.inner.clone())
15750    }
15751
15752    /// Returns the specified SslCertificate resource.
15753    pub fn get(&self) -> super::builder::ssl_certificates::Get {
15754        super::builder::ssl_certificates::Get::new(self.inner.clone())
15755    }
15756
15757    /// Creates a SslCertificate resource in the specified project using the data
15758    /// included in the request.
15759    pub fn insert(&self) -> super::builder::ssl_certificates::Insert {
15760        super::builder::ssl_certificates::Insert::new(self.inner.clone())
15761    }
15762
15763    /// Retrieves the list of SslCertificate resources available to the specified
15764    /// project.
15765    pub fn list(&self) -> super::builder::ssl_certificates::List {
15766        super::builder::ssl_certificates::List::new(self.inner.clone())
15767    }
15768
15769    /// Retrieves the specified Operations resource.
15770    pub fn get_operation(&self) -> super::builder::ssl_certificates::GetOperation {
15771        super::builder::ssl_certificates::GetOperation::new(self.inner.clone())
15772    }
15773}
15774
15775/// Implements a client for the Google Compute Engine API.
15776///
15777/// # Example
15778/// ```
15779/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15780/// # use google_cloud_compute_v1::client::SslPolicies;
15781/// let client = SslPolicies::builder().build().await?;
15782/// // use `client` to make requests to the Google Compute Engine API.
15783/// # Ok(()) }
15784/// ```
15785///
15786/// # Service Description
15787///
15788/// Service for the `sslPolicies` resource.
15789///
15790/// # Configuration
15791///
15792/// To configure `SslPolicies` use the `with_*` methods in the type returned
15793/// by [builder()][SslPolicies::builder]. The default configuration should
15794/// work for most applications. Common configuration changes include
15795///
15796/// * [with_endpoint()]: by default this client uses the global default endpoint
15797///   (`https://compute.googleapis.com`). Applications using regional
15798///   endpoints or running in restricted networks (e.g. a network configured
15799//    with [Private Google Access with VPC Service Controls]) may want to
15800///   override this default.
15801/// * [with_credentials()]: by default this client uses
15802///   [Application Default Credentials]. Applications using custom
15803///   authentication may need to override this default.
15804///
15805/// [with_endpoint()]: super::builder::ssl_policies::ClientBuilder::with_endpoint
15806/// [with_credentials()]: super::builder::ssl_policies::ClientBuilder::credentials
15807/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15808/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15809///
15810/// # Pooling and Cloning
15811///
15812/// `SslPolicies` holds a connection pool internally, it is advised to
15813/// create one and the reuse it.  You do not need to wrap `SslPolicies` in
15814/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15815/// already uses an `Arc` internally.
15816#[cfg(feature = "ssl-policies")]
15817#[cfg_attr(docsrs, doc(cfg(feature = "ssl-policies")))]
15818#[derive(Clone, Debug)]
15819pub struct SslPolicies {
15820    inner: std::sync::Arc<dyn super::stub::dynamic::SslPolicies>,
15821}
15822
15823#[cfg(feature = "ssl-policies")]
15824impl SslPolicies {
15825    /// Returns a builder for [SslPolicies].
15826    ///
15827    /// ```
15828    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15829    /// # use google_cloud_compute_v1::client::SslPolicies;
15830    /// let client = SslPolicies::builder().build().await?;
15831    /// # Ok(()) }
15832    /// ```
15833    pub fn builder() -> super::builder::ssl_policies::ClientBuilder {
15834        crate::new_client_builder(super::builder::ssl_policies::client::Factory)
15835    }
15836
15837    /// Creates a new client from the provided stub.
15838    ///
15839    /// The most common case for calling this function is in tests mocking the
15840    /// client's behavior.
15841    pub fn from_stub<T>(stub: T) -> Self
15842    where
15843        T: super::stub::SslPolicies + 'static,
15844    {
15845        Self {
15846            inner: std::sync::Arc::new(stub),
15847        }
15848    }
15849
15850    pub(crate) async fn new(
15851        config: gaxi::options::ClientConfig,
15852    ) -> crate::ClientBuilderResult<Self> {
15853        let inner = Self::build_inner(config).await?;
15854        Ok(Self { inner })
15855    }
15856
15857    async fn build_inner(
15858        conf: gaxi::options::ClientConfig,
15859    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SslPolicies>> {
15860        if gaxi::options::tracing_enabled(&conf) {
15861            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15862        }
15863        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15864    }
15865
15866    async fn build_transport(
15867        conf: gaxi::options::ClientConfig,
15868    ) -> crate::ClientBuilderResult<impl super::stub::SslPolicies> {
15869        super::transport::SslPolicies::new(conf).await
15870    }
15871
15872    async fn build_with_tracing(
15873        conf: gaxi::options::ClientConfig,
15874    ) -> crate::ClientBuilderResult<impl super::stub::SslPolicies> {
15875        Self::build_transport(conf)
15876            .await
15877            .map(super::tracing::SslPolicies::new)
15878    }
15879
15880    /// Retrieves the list of all SslPolicy resources, regional and global,
15881    /// available to the specified project.
15882    ///
15883    /// To prevent failure, Google recommends that you set the
15884    /// `returnPartialSuccess` parameter to `true`.
15885    pub fn aggregated_list(&self) -> super::builder::ssl_policies::AggregatedList {
15886        super::builder::ssl_policies::AggregatedList::new(self.inner.clone())
15887    }
15888
15889    /// Deletes the specified SSL policy. The SSL policy resource can be deleted
15890    /// only if it is not in use by any TargetHttpsProxy or TargetSslProxy
15891    /// resources.
15892    pub fn delete(&self) -> super::builder::ssl_policies::Delete {
15893        super::builder::ssl_policies::Delete::new(self.inner.clone())
15894    }
15895
15896    /// Lists all of the ordered rules present in a single specified policy.
15897    pub fn get(&self) -> super::builder::ssl_policies::Get {
15898        super::builder::ssl_policies::Get::new(self.inner.clone())
15899    }
15900
15901    /// Returns the specified SSL policy resource.
15902    pub fn insert(&self) -> super::builder::ssl_policies::Insert {
15903        super::builder::ssl_policies::Insert::new(self.inner.clone())
15904    }
15905
15906    /// Lists all the SSL policies that have been configured for the specified
15907    /// project.
15908    pub fn list(&self) -> super::builder::ssl_policies::List {
15909        super::builder::ssl_policies::List::new(self.inner.clone())
15910    }
15911
15912    /// Lists all features that can be specified in the SSL policy when using
15913    /// custom profile.
15914    pub fn list_available_features(&self) -> super::builder::ssl_policies::ListAvailableFeatures {
15915        super::builder::ssl_policies::ListAvailableFeatures::new(self.inner.clone())
15916    }
15917
15918    /// Patches the specified SSL policy with the data included in the request.
15919    pub fn patch(&self) -> super::builder::ssl_policies::Patch {
15920        super::builder::ssl_policies::Patch::new(self.inner.clone())
15921    }
15922
15923    /// Retrieves the specified Operations resource.
15924    pub fn get_operation(&self) -> super::builder::ssl_policies::GetOperation {
15925        super::builder::ssl_policies::GetOperation::new(self.inner.clone())
15926    }
15927}
15928
15929/// Implements a client for the Google Compute Engine API.
15930///
15931/// # Example
15932/// ```
15933/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15934/// # use google_cloud_compute_v1::client::StoragePoolTypes;
15935/// let client = StoragePoolTypes::builder().build().await?;
15936/// // use `client` to make requests to the Google Compute Engine API.
15937/// # Ok(()) }
15938/// ```
15939///
15940/// # Service Description
15941///
15942/// Service for the `storagePoolTypes` resource.
15943///
15944/// # Configuration
15945///
15946/// To configure `StoragePoolTypes` use the `with_*` methods in the type returned
15947/// by [builder()][StoragePoolTypes::builder]. The default configuration should
15948/// work for most applications. Common configuration changes include
15949///
15950/// * [with_endpoint()]: by default this client uses the global default endpoint
15951///   (`https://compute.googleapis.com`). Applications using regional
15952///   endpoints or running in restricted networks (e.g. a network configured
15953//    with [Private Google Access with VPC Service Controls]) may want to
15954///   override this default.
15955/// * [with_credentials()]: by default this client uses
15956///   [Application Default Credentials]. Applications using custom
15957///   authentication may need to override this default.
15958///
15959/// [with_endpoint()]: super::builder::storage_pool_types::ClientBuilder::with_endpoint
15960/// [with_credentials()]: super::builder::storage_pool_types::ClientBuilder::credentials
15961/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15962/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15963///
15964/// # Pooling and Cloning
15965///
15966/// `StoragePoolTypes` holds a connection pool internally, it is advised to
15967/// create one and the reuse it.  You do not need to wrap `StoragePoolTypes` in
15968/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15969/// already uses an `Arc` internally.
15970#[cfg(feature = "storage-pool-types")]
15971#[cfg_attr(docsrs, doc(cfg(feature = "storage-pool-types")))]
15972#[derive(Clone, Debug)]
15973pub struct StoragePoolTypes {
15974    inner: std::sync::Arc<dyn super::stub::dynamic::StoragePoolTypes>,
15975}
15976
15977#[cfg(feature = "storage-pool-types")]
15978impl StoragePoolTypes {
15979    /// Returns a builder for [StoragePoolTypes].
15980    ///
15981    /// ```
15982    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15983    /// # use google_cloud_compute_v1::client::StoragePoolTypes;
15984    /// let client = StoragePoolTypes::builder().build().await?;
15985    /// # Ok(()) }
15986    /// ```
15987    pub fn builder() -> super::builder::storage_pool_types::ClientBuilder {
15988        crate::new_client_builder(super::builder::storage_pool_types::client::Factory)
15989    }
15990
15991    /// Creates a new client from the provided stub.
15992    ///
15993    /// The most common case for calling this function is in tests mocking the
15994    /// client's behavior.
15995    pub fn from_stub<T>(stub: T) -> Self
15996    where
15997        T: super::stub::StoragePoolTypes + 'static,
15998    {
15999        Self {
16000            inner: std::sync::Arc::new(stub),
16001        }
16002    }
16003
16004    pub(crate) async fn new(
16005        config: gaxi::options::ClientConfig,
16006    ) -> crate::ClientBuilderResult<Self> {
16007        let inner = Self::build_inner(config).await?;
16008        Ok(Self { inner })
16009    }
16010
16011    async fn build_inner(
16012        conf: gaxi::options::ClientConfig,
16013    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::StoragePoolTypes>>
16014    {
16015        if gaxi::options::tracing_enabled(&conf) {
16016            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16017        }
16018        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16019    }
16020
16021    async fn build_transport(
16022        conf: gaxi::options::ClientConfig,
16023    ) -> crate::ClientBuilderResult<impl super::stub::StoragePoolTypes> {
16024        super::transport::StoragePoolTypes::new(conf).await
16025    }
16026
16027    async fn build_with_tracing(
16028        conf: gaxi::options::ClientConfig,
16029    ) -> crate::ClientBuilderResult<impl super::stub::StoragePoolTypes> {
16030        Self::build_transport(conf)
16031            .await
16032            .map(super::tracing::StoragePoolTypes::new)
16033    }
16034
16035    /// Retrieves an aggregated list of storage pool types.
16036    ///
16037    /// To prevent failure, Google recommends that you set the
16038    /// `returnPartialSuccess` parameter to `true`.
16039    pub fn aggregated_list(&self) -> super::builder::storage_pool_types::AggregatedList {
16040        super::builder::storage_pool_types::AggregatedList::new(self.inner.clone())
16041    }
16042
16043    /// Returns the specified storage pool type.
16044    pub fn get(&self) -> super::builder::storage_pool_types::Get {
16045        super::builder::storage_pool_types::Get::new(self.inner.clone())
16046    }
16047
16048    /// Retrieves a list of storage pool types available to the specified
16049    /// project.
16050    pub fn list(&self) -> super::builder::storage_pool_types::List {
16051        super::builder::storage_pool_types::List::new(self.inner.clone())
16052    }
16053}
16054
16055/// Implements a client for the Google Compute Engine API.
16056///
16057/// # Example
16058/// ```
16059/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16060/// # use google_cloud_compute_v1::client::StoragePools;
16061/// let client = StoragePools::builder().build().await?;
16062/// // use `client` to make requests to the Google Compute Engine API.
16063/// # Ok(()) }
16064/// ```
16065///
16066/// # Service Description
16067///
16068/// Service for the `storagePools` resource.
16069///
16070/// # Configuration
16071///
16072/// To configure `StoragePools` use the `with_*` methods in the type returned
16073/// by [builder()][StoragePools::builder]. The default configuration should
16074/// work for most applications. Common configuration changes include
16075///
16076/// * [with_endpoint()]: by default this client uses the global default endpoint
16077///   (`https://compute.googleapis.com`). Applications using regional
16078///   endpoints or running in restricted networks (e.g. a network configured
16079//    with [Private Google Access with VPC Service Controls]) may want to
16080///   override this default.
16081/// * [with_credentials()]: by default this client uses
16082///   [Application Default Credentials]. Applications using custom
16083///   authentication may need to override this default.
16084///
16085/// [with_endpoint()]: super::builder::storage_pools::ClientBuilder::with_endpoint
16086/// [with_credentials()]: super::builder::storage_pools::ClientBuilder::credentials
16087/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16088/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16089///
16090/// # Pooling and Cloning
16091///
16092/// `StoragePools` holds a connection pool internally, it is advised to
16093/// create one and the reuse it.  You do not need to wrap `StoragePools` in
16094/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16095/// already uses an `Arc` internally.
16096#[cfg(feature = "storage-pools")]
16097#[cfg_attr(docsrs, doc(cfg(feature = "storage-pools")))]
16098#[derive(Clone, Debug)]
16099pub struct StoragePools {
16100    inner: std::sync::Arc<dyn super::stub::dynamic::StoragePools>,
16101}
16102
16103#[cfg(feature = "storage-pools")]
16104impl StoragePools {
16105    /// Returns a builder for [StoragePools].
16106    ///
16107    /// ```
16108    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16109    /// # use google_cloud_compute_v1::client::StoragePools;
16110    /// let client = StoragePools::builder().build().await?;
16111    /// # Ok(()) }
16112    /// ```
16113    pub fn builder() -> super::builder::storage_pools::ClientBuilder {
16114        crate::new_client_builder(super::builder::storage_pools::client::Factory)
16115    }
16116
16117    /// Creates a new client from the provided stub.
16118    ///
16119    /// The most common case for calling this function is in tests mocking the
16120    /// client's behavior.
16121    pub fn from_stub<T>(stub: T) -> Self
16122    where
16123        T: super::stub::StoragePools + 'static,
16124    {
16125        Self {
16126            inner: std::sync::Arc::new(stub),
16127        }
16128    }
16129
16130    pub(crate) async fn new(
16131        config: gaxi::options::ClientConfig,
16132    ) -> crate::ClientBuilderResult<Self> {
16133        let inner = Self::build_inner(config).await?;
16134        Ok(Self { inner })
16135    }
16136
16137    async fn build_inner(
16138        conf: gaxi::options::ClientConfig,
16139    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::StoragePools>> {
16140        if gaxi::options::tracing_enabled(&conf) {
16141            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16142        }
16143        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16144    }
16145
16146    async fn build_transport(
16147        conf: gaxi::options::ClientConfig,
16148    ) -> crate::ClientBuilderResult<impl super::stub::StoragePools> {
16149        super::transport::StoragePools::new(conf).await
16150    }
16151
16152    async fn build_with_tracing(
16153        conf: gaxi::options::ClientConfig,
16154    ) -> crate::ClientBuilderResult<impl super::stub::StoragePools> {
16155        Self::build_transport(conf)
16156            .await
16157            .map(super::tracing::StoragePools::new)
16158    }
16159
16160    /// Retrieves an aggregated list of storage pools.
16161    ///
16162    /// To prevent failure, Google recommends that you set the
16163    /// `returnPartialSuccess` parameter to `true`.
16164    pub fn aggregated_list(&self) -> super::builder::storage_pools::AggregatedList {
16165        super::builder::storage_pools::AggregatedList::new(self.inner.clone())
16166    }
16167
16168    /// Deletes the specified storage pool. Deleting a storagePool
16169    /// removes its data permanently and is irreversible. However, deleting a
16170    /// storagePool does not delete any snapshots previously
16171    /// made from the storagePool. You must separately delete
16172    /// snapshots.
16173    pub fn delete(&self) -> super::builder::storage_pools::Delete {
16174        super::builder::storage_pools::Delete::new(self.inner.clone())
16175    }
16176
16177    /// Returns a specified storage pool. Gets a list of available
16178    /// storage pools by making a list() request.
16179    pub fn get(&self) -> super::builder::storage_pools::Get {
16180        super::builder::storage_pools::Get::new(self.inner.clone())
16181    }
16182
16183    /// Gets the access control policy for a resource. May be empty if no such
16184    /// policy or resource exists.
16185    pub fn get_iam_policy(&self) -> super::builder::storage_pools::GetIamPolicy {
16186        super::builder::storage_pools::GetIamPolicy::new(self.inner.clone())
16187    }
16188
16189    /// Creates a storage pool in the specified project using the data
16190    /// in the request.
16191    pub fn insert(&self) -> super::builder::storage_pools::Insert {
16192        super::builder::storage_pools::Insert::new(self.inner.clone())
16193    }
16194
16195    /// Retrieves a list of storage pools contained within
16196    /// the specified zone.
16197    pub fn list(&self) -> super::builder::storage_pools::List {
16198        super::builder::storage_pools::List::new(self.inner.clone())
16199    }
16200
16201    /// Lists the disks in a specified storage pool.
16202    pub fn list_disks(&self) -> super::builder::storage_pools::ListDisks {
16203        super::builder::storage_pools::ListDisks::new(self.inner.clone())
16204    }
16205
16206    /// Sets the access control policy on the specified resource.
16207    /// Replaces any existing policy.
16208    pub fn set_iam_policy(&self) -> super::builder::storage_pools::SetIamPolicy {
16209        super::builder::storage_pools::SetIamPolicy::new(self.inner.clone())
16210    }
16211
16212    /// Returns permissions that a caller has on the specified resource.
16213    pub fn test_iam_permissions(&self) -> super::builder::storage_pools::TestIamPermissions {
16214        super::builder::storage_pools::TestIamPermissions::new(self.inner.clone())
16215    }
16216
16217    /// Updates the specified storagePool with the data included in the request.
16218    /// The update is performed only on selected fields included as part
16219    /// of update-mask. Only the following fields can be modified:
16220    /// pool_provisioned_capacity_gb, pool_provisioned_iops and
16221    /// pool_provisioned_throughput.
16222    pub fn update(&self) -> super::builder::storage_pools::Update {
16223        super::builder::storage_pools::Update::new(self.inner.clone())
16224    }
16225
16226    /// Retrieves the specified zone-specific Operations resource.
16227    pub fn get_operation(&self) -> super::builder::storage_pools::GetOperation {
16228        super::builder::storage_pools::GetOperation::new(self.inner.clone())
16229    }
16230}
16231
16232/// Implements a client for the Google Compute Engine API.
16233///
16234/// # Example
16235/// ```
16236/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16237/// # use google_cloud_compute_v1::client::Subnetworks;
16238/// let client = Subnetworks::builder().build().await?;
16239/// // use `client` to make requests to the Google Compute Engine API.
16240/// # Ok(()) }
16241/// ```
16242///
16243/// # Service Description
16244///
16245/// Service for the `subnetworks` resource.
16246///
16247/// # Configuration
16248///
16249/// To configure `Subnetworks` use the `with_*` methods in the type returned
16250/// by [builder()][Subnetworks::builder]. The default configuration should
16251/// work for most applications. Common configuration changes include
16252///
16253/// * [with_endpoint()]: by default this client uses the global default endpoint
16254///   (`https://compute.googleapis.com`). Applications using regional
16255///   endpoints or running in restricted networks (e.g. a network configured
16256//    with [Private Google Access with VPC Service Controls]) may want to
16257///   override this default.
16258/// * [with_credentials()]: by default this client uses
16259///   [Application Default Credentials]. Applications using custom
16260///   authentication may need to override this default.
16261///
16262/// [with_endpoint()]: super::builder::subnetworks::ClientBuilder::with_endpoint
16263/// [with_credentials()]: super::builder::subnetworks::ClientBuilder::credentials
16264/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16265/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16266///
16267/// # Pooling and Cloning
16268///
16269/// `Subnetworks` holds a connection pool internally, it is advised to
16270/// create one and the reuse it.  You do not need to wrap `Subnetworks` in
16271/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16272/// already uses an `Arc` internally.
16273#[cfg(feature = "subnetworks")]
16274#[cfg_attr(docsrs, doc(cfg(feature = "subnetworks")))]
16275#[derive(Clone, Debug)]
16276pub struct Subnetworks {
16277    inner: std::sync::Arc<dyn super::stub::dynamic::Subnetworks>,
16278}
16279
16280#[cfg(feature = "subnetworks")]
16281impl Subnetworks {
16282    /// Returns a builder for [Subnetworks].
16283    ///
16284    /// ```
16285    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16286    /// # use google_cloud_compute_v1::client::Subnetworks;
16287    /// let client = Subnetworks::builder().build().await?;
16288    /// # Ok(()) }
16289    /// ```
16290    pub fn builder() -> super::builder::subnetworks::ClientBuilder {
16291        crate::new_client_builder(super::builder::subnetworks::client::Factory)
16292    }
16293
16294    /// Creates a new client from the provided stub.
16295    ///
16296    /// The most common case for calling this function is in tests mocking the
16297    /// client's behavior.
16298    pub fn from_stub<T>(stub: T) -> Self
16299    where
16300        T: super::stub::Subnetworks + 'static,
16301    {
16302        Self {
16303            inner: std::sync::Arc::new(stub),
16304        }
16305    }
16306
16307    pub(crate) async fn new(
16308        config: gaxi::options::ClientConfig,
16309    ) -> crate::ClientBuilderResult<Self> {
16310        let inner = Self::build_inner(config).await?;
16311        Ok(Self { inner })
16312    }
16313
16314    async fn build_inner(
16315        conf: gaxi::options::ClientConfig,
16316    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Subnetworks>> {
16317        if gaxi::options::tracing_enabled(&conf) {
16318            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16319        }
16320        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16321    }
16322
16323    async fn build_transport(
16324        conf: gaxi::options::ClientConfig,
16325    ) -> crate::ClientBuilderResult<impl super::stub::Subnetworks> {
16326        super::transport::Subnetworks::new(conf).await
16327    }
16328
16329    async fn build_with_tracing(
16330        conf: gaxi::options::ClientConfig,
16331    ) -> crate::ClientBuilderResult<impl super::stub::Subnetworks> {
16332        Self::build_transport(conf)
16333            .await
16334            .map(super::tracing::Subnetworks::new)
16335    }
16336
16337    /// Retrieves an aggregated list of subnetworks.
16338    ///
16339    /// To prevent failure, Google recommends that you set the
16340    /// `returnPartialSuccess` parameter to `true`.
16341    pub fn aggregated_list(&self) -> super::builder::subnetworks::AggregatedList {
16342        super::builder::subnetworks::AggregatedList::new(self.inner.clone())
16343    }
16344
16345    /// Deletes the specified subnetwork.
16346    pub fn delete(&self) -> super::builder::subnetworks::Delete {
16347        super::builder::subnetworks::Delete::new(self.inner.clone())
16348    }
16349
16350    /// Expands the IP CIDR range of the subnetwork to a specified value.
16351    pub fn expand_ip_cidr_range(&self) -> super::builder::subnetworks::ExpandIpCidrRange {
16352        super::builder::subnetworks::ExpandIpCidrRange::new(self.inner.clone())
16353    }
16354
16355    /// Returns the specified subnetwork.
16356    pub fn get(&self) -> super::builder::subnetworks::Get {
16357        super::builder::subnetworks::Get::new(self.inner.clone())
16358    }
16359
16360    /// Gets the access control policy for a resource. May be empty if no such
16361    /// policy or resource exists.
16362    pub fn get_iam_policy(&self) -> super::builder::subnetworks::GetIamPolicy {
16363        super::builder::subnetworks::GetIamPolicy::new(self.inner.clone())
16364    }
16365
16366    /// Creates a subnetwork in the specified project using the data
16367    /// included in the request.
16368    pub fn insert(&self) -> super::builder::subnetworks::Insert {
16369        super::builder::subnetworks::Insert::new(self.inner.clone())
16370    }
16371
16372    /// Retrieves a list of subnetworks available to the specified
16373    /// project.
16374    pub fn list(&self) -> super::builder::subnetworks::List {
16375        super::builder::subnetworks::List::new(self.inner.clone())
16376    }
16377
16378    /// Retrieves an aggregated list of all usable subnetworks in the project.
16379    pub fn list_usable(&self) -> super::builder::subnetworks::ListUsable {
16380        super::builder::subnetworks::ListUsable::new(self.inner.clone())
16381    }
16382
16383    /// Patches the specified subnetwork with the data included in the request.
16384    /// Only certain fields can be updated with a patch request
16385    /// as indicated in the field descriptions.
16386    /// You must specify the current fingerprint of the
16387    /// subnetwork resource being patched.
16388    pub fn patch(&self) -> super::builder::subnetworks::Patch {
16389        super::builder::subnetworks::Patch::new(self.inner.clone())
16390    }
16391
16392    /// Sets the access control policy on the specified resource.
16393    /// Replaces any existing policy.
16394    pub fn set_iam_policy(&self) -> super::builder::subnetworks::SetIamPolicy {
16395        super::builder::subnetworks::SetIamPolicy::new(self.inner.clone())
16396    }
16397
16398    /// Set whether VMs in this subnet can access Google services without assigning
16399    /// external IP addresses through Private Google Access.
16400    pub fn set_private_ip_google_access(
16401        &self,
16402    ) -> super::builder::subnetworks::SetPrivateIpGoogleAccess {
16403        super::builder::subnetworks::SetPrivateIpGoogleAccess::new(self.inner.clone())
16404    }
16405
16406    /// Returns permissions that a caller has on the specified resource.
16407    pub fn test_iam_permissions(&self) -> super::builder::subnetworks::TestIamPermissions {
16408        super::builder::subnetworks::TestIamPermissions::new(self.inner.clone())
16409    }
16410
16411    /// Retrieves the specified region-specific Operations resource.
16412    pub fn get_operation(&self) -> super::builder::subnetworks::GetOperation {
16413        super::builder::subnetworks::GetOperation::new(self.inner.clone())
16414    }
16415}
16416
16417/// Implements a client for the Google Compute Engine API.
16418///
16419/// # Example
16420/// ```
16421/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16422/// # use google_cloud_compute_v1::client::TargetGrpcProxies;
16423/// let client = TargetGrpcProxies::builder().build().await?;
16424/// // use `client` to make requests to the Google Compute Engine API.
16425/// # Ok(()) }
16426/// ```
16427///
16428/// # Service Description
16429///
16430/// Service for the `targetGrpcProxies` resource.
16431///
16432/// # Configuration
16433///
16434/// To configure `TargetGrpcProxies` use the `with_*` methods in the type returned
16435/// by [builder()][TargetGrpcProxies::builder]. The default configuration should
16436/// work for most applications. Common configuration changes include
16437///
16438/// * [with_endpoint()]: by default this client uses the global default endpoint
16439///   (`https://compute.googleapis.com`). Applications using regional
16440///   endpoints or running in restricted networks (e.g. a network configured
16441//    with [Private Google Access with VPC Service Controls]) may want to
16442///   override this default.
16443/// * [with_credentials()]: by default this client uses
16444///   [Application Default Credentials]. Applications using custom
16445///   authentication may need to override this default.
16446///
16447/// [with_endpoint()]: super::builder::target_grpc_proxies::ClientBuilder::with_endpoint
16448/// [with_credentials()]: super::builder::target_grpc_proxies::ClientBuilder::credentials
16449/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16450/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16451///
16452/// # Pooling and Cloning
16453///
16454/// `TargetGrpcProxies` holds a connection pool internally, it is advised to
16455/// create one and the reuse it.  You do not need to wrap `TargetGrpcProxies` in
16456/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16457/// already uses an `Arc` internally.
16458#[cfg(feature = "target-grpc-proxies")]
16459#[cfg_attr(docsrs, doc(cfg(feature = "target-grpc-proxies")))]
16460#[derive(Clone, Debug)]
16461pub struct TargetGrpcProxies {
16462    inner: std::sync::Arc<dyn super::stub::dynamic::TargetGrpcProxies>,
16463}
16464
16465#[cfg(feature = "target-grpc-proxies")]
16466impl TargetGrpcProxies {
16467    /// Returns a builder for [TargetGrpcProxies].
16468    ///
16469    /// ```
16470    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16471    /// # use google_cloud_compute_v1::client::TargetGrpcProxies;
16472    /// let client = TargetGrpcProxies::builder().build().await?;
16473    /// # Ok(()) }
16474    /// ```
16475    pub fn builder() -> super::builder::target_grpc_proxies::ClientBuilder {
16476        crate::new_client_builder(super::builder::target_grpc_proxies::client::Factory)
16477    }
16478
16479    /// Creates a new client from the provided stub.
16480    ///
16481    /// The most common case for calling this function is in tests mocking the
16482    /// client's behavior.
16483    pub fn from_stub<T>(stub: T) -> Self
16484    where
16485        T: super::stub::TargetGrpcProxies + 'static,
16486    {
16487        Self {
16488            inner: std::sync::Arc::new(stub),
16489        }
16490    }
16491
16492    pub(crate) async fn new(
16493        config: gaxi::options::ClientConfig,
16494    ) -> crate::ClientBuilderResult<Self> {
16495        let inner = Self::build_inner(config).await?;
16496        Ok(Self { inner })
16497    }
16498
16499    async fn build_inner(
16500        conf: gaxi::options::ClientConfig,
16501    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetGrpcProxies>>
16502    {
16503        if gaxi::options::tracing_enabled(&conf) {
16504            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16505        }
16506        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16507    }
16508
16509    async fn build_transport(
16510        conf: gaxi::options::ClientConfig,
16511    ) -> crate::ClientBuilderResult<impl super::stub::TargetGrpcProxies> {
16512        super::transport::TargetGrpcProxies::new(conf).await
16513    }
16514
16515    async fn build_with_tracing(
16516        conf: gaxi::options::ClientConfig,
16517    ) -> crate::ClientBuilderResult<impl super::stub::TargetGrpcProxies> {
16518        Self::build_transport(conf)
16519            .await
16520            .map(super::tracing::TargetGrpcProxies::new)
16521    }
16522
16523    /// Deletes the specified TargetGrpcProxy in the given scope
16524    pub fn delete(&self) -> super::builder::target_grpc_proxies::Delete {
16525        super::builder::target_grpc_proxies::Delete::new(self.inner.clone())
16526    }
16527
16528    /// Returns the specified TargetGrpcProxy resource in the given scope.
16529    pub fn get(&self) -> super::builder::target_grpc_proxies::Get {
16530        super::builder::target_grpc_proxies::Get::new(self.inner.clone())
16531    }
16532
16533    /// Creates a TargetGrpcProxy in the specified project in the given scope
16534    /// using the parameters that are included in the request.
16535    pub fn insert(&self) -> super::builder::target_grpc_proxies::Insert {
16536        super::builder::target_grpc_proxies::Insert::new(self.inner.clone())
16537    }
16538
16539    /// Lists the TargetGrpcProxies for a project in the given scope.
16540    pub fn list(&self) -> super::builder::target_grpc_proxies::List {
16541        super::builder::target_grpc_proxies::List::new(self.inner.clone())
16542    }
16543
16544    /// Patches the specified TargetGrpcProxy resource with the data included in
16545    /// the request. This method supports PATCH
16546    /// semantics and usesJSON merge
16547    /// patch format and processing rules.
16548    pub fn patch(&self) -> super::builder::target_grpc_proxies::Patch {
16549        super::builder::target_grpc_proxies::Patch::new(self.inner.clone())
16550    }
16551
16552    /// Retrieves the specified Operations resource.
16553    pub fn get_operation(&self) -> super::builder::target_grpc_proxies::GetOperation {
16554        super::builder::target_grpc_proxies::GetOperation::new(self.inner.clone())
16555    }
16556}
16557
16558/// Implements a client for the Google Compute Engine API.
16559///
16560/// # Example
16561/// ```
16562/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16563/// # use google_cloud_compute_v1::client::TargetHttpProxies;
16564/// let client = TargetHttpProxies::builder().build().await?;
16565/// // use `client` to make requests to the Google Compute Engine API.
16566/// # Ok(()) }
16567/// ```
16568///
16569/// # Service Description
16570///
16571/// Service for the `targetHttpProxies` resource.
16572///
16573/// # Configuration
16574///
16575/// To configure `TargetHttpProxies` use the `with_*` methods in the type returned
16576/// by [builder()][TargetHttpProxies::builder]. The default configuration should
16577/// work for most applications. Common configuration changes include
16578///
16579/// * [with_endpoint()]: by default this client uses the global default endpoint
16580///   (`https://compute.googleapis.com`). Applications using regional
16581///   endpoints or running in restricted networks (e.g. a network configured
16582//    with [Private Google Access with VPC Service Controls]) may want to
16583///   override this default.
16584/// * [with_credentials()]: by default this client uses
16585///   [Application Default Credentials]. Applications using custom
16586///   authentication may need to override this default.
16587///
16588/// [with_endpoint()]: super::builder::target_http_proxies::ClientBuilder::with_endpoint
16589/// [with_credentials()]: super::builder::target_http_proxies::ClientBuilder::credentials
16590/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16591/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16592///
16593/// # Pooling and Cloning
16594///
16595/// `TargetHttpProxies` holds a connection pool internally, it is advised to
16596/// create one and the reuse it.  You do not need to wrap `TargetHttpProxies` in
16597/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16598/// already uses an `Arc` internally.
16599#[cfg(feature = "target-http-proxies")]
16600#[cfg_attr(docsrs, doc(cfg(feature = "target-http-proxies")))]
16601#[derive(Clone, Debug)]
16602pub struct TargetHttpProxies {
16603    inner: std::sync::Arc<dyn super::stub::dynamic::TargetHttpProxies>,
16604}
16605
16606#[cfg(feature = "target-http-proxies")]
16607impl TargetHttpProxies {
16608    /// Returns a builder for [TargetHttpProxies].
16609    ///
16610    /// ```
16611    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16612    /// # use google_cloud_compute_v1::client::TargetHttpProxies;
16613    /// let client = TargetHttpProxies::builder().build().await?;
16614    /// # Ok(()) }
16615    /// ```
16616    pub fn builder() -> super::builder::target_http_proxies::ClientBuilder {
16617        crate::new_client_builder(super::builder::target_http_proxies::client::Factory)
16618    }
16619
16620    /// Creates a new client from the provided stub.
16621    ///
16622    /// The most common case for calling this function is in tests mocking the
16623    /// client's behavior.
16624    pub fn from_stub<T>(stub: T) -> Self
16625    where
16626        T: super::stub::TargetHttpProxies + 'static,
16627    {
16628        Self {
16629            inner: std::sync::Arc::new(stub),
16630        }
16631    }
16632
16633    pub(crate) async fn new(
16634        config: gaxi::options::ClientConfig,
16635    ) -> crate::ClientBuilderResult<Self> {
16636        let inner = Self::build_inner(config).await?;
16637        Ok(Self { inner })
16638    }
16639
16640    async fn build_inner(
16641        conf: gaxi::options::ClientConfig,
16642    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetHttpProxies>>
16643    {
16644        if gaxi::options::tracing_enabled(&conf) {
16645            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16646        }
16647        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16648    }
16649
16650    async fn build_transport(
16651        conf: gaxi::options::ClientConfig,
16652    ) -> crate::ClientBuilderResult<impl super::stub::TargetHttpProxies> {
16653        super::transport::TargetHttpProxies::new(conf).await
16654    }
16655
16656    async fn build_with_tracing(
16657        conf: gaxi::options::ClientConfig,
16658    ) -> crate::ClientBuilderResult<impl super::stub::TargetHttpProxies> {
16659        Self::build_transport(conf)
16660            .await
16661            .map(super::tracing::TargetHttpProxies::new)
16662    }
16663
16664    /// Retrieves the list of all TargetHttpProxy resources, regional and global,
16665    /// available to the specified project.
16666    ///
16667    /// To prevent failure, Google recommends that you set the
16668    /// `returnPartialSuccess` parameter to `true`.
16669    pub fn aggregated_list(&self) -> super::builder::target_http_proxies::AggregatedList {
16670        super::builder::target_http_proxies::AggregatedList::new(self.inner.clone())
16671    }
16672
16673    /// Deletes the specified TargetHttpProxy resource.
16674    pub fn delete(&self) -> super::builder::target_http_proxies::Delete {
16675        super::builder::target_http_proxies::Delete::new(self.inner.clone())
16676    }
16677
16678    /// Returns the specified TargetHttpProxy resource.
16679    pub fn get(&self) -> super::builder::target_http_proxies::Get {
16680        super::builder::target_http_proxies::Get::new(self.inner.clone())
16681    }
16682
16683    /// Creates a TargetHttpProxy resource in the specified
16684    /// project using the data included in the request.
16685    pub fn insert(&self) -> super::builder::target_http_proxies::Insert {
16686        super::builder::target_http_proxies::Insert::new(self.inner.clone())
16687    }
16688
16689    /// Retrieves the list of TargetHttpProxy resources available
16690    /// to the specified project.
16691    pub fn list(&self) -> super::builder::target_http_proxies::List {
16692        super::builder::target_http_proxies::List::new(self.inner.clone())
16693    }
16694
16695    /// Patches the specified TargetHttpProxy resource with the data included in
16696    /// the request. This method supports PATCH
16697    /// semantics and usesJSON merge
16698    /// patch format and processing rules.
16699    pub fn patch(&self) -> super::builder::target_http_proxies::Patch {
16700        super::builder::target_http_proxies::Patch::new(self.inner.clone())
16701    }
16702
16703    /// Changes the URL map for TargetHttpProxy.
16704    pub fn set_url_map(&self) -> super::builder::target_http_proxies::SetUrlMap {
16705        super::builder::target_http_proxies::SetUrlMap::new(self.inner.clone())
16706    }
16707
16708    /// Retrieves the specified Operations resource.
16709    pub fn get_operation(&self) -> super::builder::target_http_proxies::GetOperation {
16710        super::builder::target_http_proxies::GetOperation::new(self.inner.clone())
16711    }
16712}
16713
16714/// Implements a client for the Google Compute Engine API.
16715///
16716/// # Example
16717/// ```
16718/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16719/// # use google_cloud_compute_v1::client::TargetHttpsProxies;
16720/// let client = TargetHttpsProxies::builder().build().await?;
16721/// // use `client` to make requests to the Google Compute Engine API.
16722/// # Ok(()) }
16723/// ```
16724///
16725/// # Service Description
16726///
16727/// Service for the `targetHttpsProxies` resource.
16728///
16729/// # Configuration
16730///
16731/// To configure `TargetHttpsProxies` use the `with_*` methods in the type returned
16732/// by [builder()][TargetHttpsProxies::builder]. The default configuration should
16733/// work for most applications. Common configuration changes include
16734///
16735/// * [with_endpoint()]: by default this client uses the global default endpoint
16736///   (`https://compute.googleapis.com`). Applications using regional
16737///   endpoints or running in restricted networks (e.g. a network configured
16738//    with [Private Google Access with VPC Service Controls]) may want to
16739///   override this default.
16740/// * [with_credentials()]: by default this client uses
16741///   [Application Default Credentials]. Applications using custom
16742///   authentication may need to override this default.
16743///
16744/// [with_endpoint()]: super::builder::target_https_proxies::ClientBuilder::with_endpoint
16745/// [with_credentials()]: super::builder::target_https_proxies::ClientBuilder::credentials
16746/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16747/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16748///
16749/// # Pooling and Cloning
16750///
16751/// `TargetHttpsProxies` holds a connection pool internally, it is advised to
16752/// create one and the reuse it.  You do not need to wrap `TargetHttpsProxies` in
16753/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16754/// already uses an `Arc` internally.
16755#[cfg(feature = "target-https-proxies")]
16756#[cfg_attr(docsrs, doc(cfg(feature = "target-https-proxies")))]
16757#[derive(Clone, Debug)]
16758pub struct TargetHttpsProxies {
16759    inner: std::sync::Arc<dyn super::stub::dynamic::TargetHttpsProxies>,
16760}
16761
16762#[cfg(feature = "target-https-proxies")]
16763impl TargetHttpsProxies {
16764    /// Returns a builder for [TargetHttpsProxies].
16765    ///
16766    /// ```
16767    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16768    /// # use google_cloud_compute_v1::client::TargetHttpsProxies;
16769    /// let client = TargetHttpsProxies::builder().build().await?;
16770    /// # Ok(()) }
16771    /// ```
16772    pub fn builder() -> super::builder::target_https_proxies::ClientBuilder {
16773        crate::new_client_builder(super::builder::target_https_proxies::client::Factory)
16774    }
16775
16776    /// Creates a new client from the provided stub.
16777    ///
16778    /// The most common case for calling this function is in tests mocking the
16779    /// client's behavior.
16780    pub fn from_stub<T>(stub: T) -> Self
16781    where
16782        T: super::stub::TargetHttpsProxies + 'static,
16783    {
16784        Self {
16785            inner: std::sync::Arc::new(stub),
16786        }
16787    }
16788
16789    pub(crate) async fn new(
16790        config: gaxi::options::ClientConfig,
16791    ) -> crate::ClientBuilderResult<Self> {
16792        let inner = Self::build_inner(config).await?;
16793        Ok(Self { inner })
16794    }
16795
16796    async fn build_inner(
16797        conf: gaxi::options::ClientConfig,
16798    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetHttpsProxies>>
16799    {
16800        if gaxi::options::tracing_enabled(&conf) {
16801            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16802        }
16803        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16804    }
16805
16806    async fn build_transport(
16807        conf: gaxi::options::ClientConfig,
16808    ) -> crate::ClientBuilderResult<impl super::stub::TargetHttpsProxies> {
16809        super::transport::TargetHttpsProxies::new(conf).await
16810    }
16811
16812    async fn build_with_tracing(
16813        conf: gaxi::options::ClientConfig,
16814    ) -> crate::ClientBuilderResult<impl super::stub::TargetHttpsProxies> {
16815        Self::build_transport(conf)
16816            .await
16817            .map(super::tracing::TargetHttpsProxies::new)
16818    }
16819
16820    /// Retrieves the list of all TargetHttpsProxy resources, regional and global,
16821    /// available to the specified project.
16822    ///
16823    /// To prevent failure, Google recommends that you set the
16824    /// `returnPartialSuccess` parameter to `true`.
16825    pub fn aggregated_list(&self) -> super::builder::target_https_proxies::AggregatedList {
16826        super::builder::target_https_proxies::AggregatedList::new(self.inner.clone())
16827    }
16828
16829    /// Deletes the specified TargetHttpsProxy resource.
16830    pub fn delete(&self) -> super::builder::target_https_proxies::Delete {
16831        super::builder::target_https_proxies::Delete::new(self.inner.clone())
16832    }
16833
16834    /// Returns the specified TargetHttpsProxy resource.
16835    pub fn get(&self) -> super::builder::target_https_proxies::Get {
16836        super::builder::target_https_proxies::Get::new(self.inner.clone())
16837    }
16838
16839    /// Creates a TargetHttpsProxy resource in the specified
16840    /// project using the data included in the request.
16841    pub fn insert(&self) -> super::builder::target_https_proxies::Insert {
16842        super::builder::target_https_proxies::Insert::new(self.inner.clone())
16843    }
16844
16845    /// Retrieves the list of TargetHttpsProxy resources
16846    /// available to the specified project.
16847    pub fn list(&self) -> super::builder::target_https_proxies::List {
16848        super::builder::target_https_proxies::List::new(self.inner.clone())
16849    }
16850
16851    /// Patches the specified TargetHttpsProxy resource with the data included in
16852    /// the request. This method supports PATCH
16853    /// semantics and usesJSON merge
16854    /// patch format and processing rules.
16855    pub fn patch(&self) -> super::builder::target_https_proxies::Patch {
16856        super::builder::target_https_proxies::Patch::new(self.inner.clone())
16857    }
16858
16859    /// Changes the Certificate Map for TargetHttpsProxy.
16860    pub fn set_certificate_map(&self) -> super::builder::target_https_proxies::SetCertificateMap {
16861        super::builder::target_https_proxies::SetCertificateMap::new(self.inner.clone())
16862    }
16863
16864    /// Sets the QUIC override policy for TargetHttpsProxy.
16865    pub fn set_quic_override(&self) -> super::builder::target_https_proxies::SetQuicOverride {
16866        super::builder::target_https_proxies::SetQuicOverride::new(self.inner.clone())
16867    }
16868
16869    /// Replaces SslCertificates for TargetHttpsProxy.
16870    pub fn set_ssl_certificates(&self) -> super::builder::target_https_proxies::SetSslCertificates {
16871        super::builder::target_https_proxies::SetSslCertificates::new(self.inner.clone())
16872    }
16873
16874    /// Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies the
16875    /// server-side support for SSL features. This affects connections between
16876    /// clients and the HTTPS proxy load balancer. They do not affect the
16877    /// connection between the load balancer and the backends.
16878    pub fn set_ssl_policy(&self) -> super::builder::target_https_proxies::SetSslPolicy {
16879        super::builder::target_https_proxies::SetSslPolicy::new(self.inner.clone())
16880    }
16881
16882    /// Changes the URL map for TargetHttpsProxy.
16883    pub fn set_url_map(&self) -> super::builder::target_https_proxies::SetUrlMap {
16884        super::builder::target_https_proxies::SetUrlMap::new(self.inner.clone())
16885    }
16886
16887    /// Retrieves the specified Operations resource.
16888    pub fn get_operation(&self) -> super::builder::target_https_proxies::GetOperation {
16889        super::builder::target_https_proxies::GetOperation::new(self.inner.clone())
16890    }
16891}
16892
16893/// Implements a client for the Google Compute Engine API.
16894///
16895/// # Example
16896/// ```
16897/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16898/// # use google_cloud_compute_v1::client::TargetInstances;
16899/// let client = TargetInstances::builder().build().await?;
16900/// // use `client` to make requests to the Google Compute Engine API.
16901/// # Ok(()) }
16902/// ```
16903///
16904/// # Service Description
16905///
16906/// Service for the `targetInstances` resource.
16907///
16908/// # Configuration
16909///
16910/// To configure `TargetInstances` use the `with_*` methods in the type returned
16911/// by [builder()][TargetInstances::builder]. The default configuration should
16912/// work for most applications. Common configuration changes include
16913///
16914/// * [with_endpoint()]: by default this client uses the global default endpoint
16915///   (`https://compute.googleapis.com`). Applications using regional
16916///   endpoints or running in restricted networks (e.g. a network configured
16917//    with [Private Google Access with VPC Service Controls]) may want to
16918///   override this default.
16919/// * [with_credentials()]: by default this client uses
16920///   [Application Default Credentials]. Applications using custom
16921///   authentication may need to override this default.
16922///
16923/// [with_endpoint()]: super::builder::target_instances::ClientBuilder::with_endpoint
16924/// [with_credentials()]: super::builder::target_instances::ClientBuilder::credentials
16925/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16926/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16927///
16928/// # Pooling and Cloning
16929///
16930/// `TargetInstances` holds a connection pool internally, it is advised to
16931/// create one and the reuse it.  You do not need to wrap `TargetInstances` in
16932/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16933/// already uses an `Arc` internally.
16934#[cfg(feature = "target-instances")]
16935#[cfg_attr(docsrs, doc(cfg(feature = "target-instances")))]
16936#[derive(Clone, Debug)]
16937pub struct TargetInstances {
16938    inner: std::sync::Arc<dyn super::stub::dynamic::TargetInstances>,
16939}
16940
16941#[cfg(feature = "target-instances")]
16942impl TargetInstances {
16943    /// Returns a builder for [TargetInstances].
16944    ///
16945    /// ```
16946    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16947    /// # use google_cloud_compute_v1::client::TargetInstances;
16948    /// let client = TargetInstances::builder().build().await?;
16949    /// # Ok(()) }
16950    /// ```
16951    pub fn builder() -> super::builder::target_instances::ClientBuilder {
16952        crate::new_client_builder(super::builder::target_instances::client::Factory)
16953    }
16954
16955    /// Creates a new client from the provided stub.
16956    ///
16957    /// The most common case for calling this function is in tests mocking the
16958    /// client's behavior.
16959    pub fn from_stub<T>(stub: T) -> Self
16960    where
16961        T: super::stub::TargetInstances + 'static,
16962    {
16963        Self {
16964            inner: std::sync::Arc::new(stub),
16965        }
16966    }
16967
16968    pub(crate) async fn new(
16969        config: gaxi::options::ClientConfig,
16970    ) -> crate::ClientBuilderResult<Self> {
16971        let inner = Self::build_inner(config).await?;
16972        Ok(Self { inner })
16973    }
16974
16975    async fn build_inner(
16976        conf: gaxi::options::ClientConfig,
16977    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetInstances>> {
16978        if gaxi::options::tracing_enabled(&conf) {
16979            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16980        }
16981        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16982    }
16983
16984    async fn build_transport(
16985        conf: gaxi::options::ClientConfig,
16986    ) -> crate::ClientBuilderResult<impl super::stub::TargetInstances> {
16987        super::transport::TargetInstances::new(conf).await
16988    }
16989
16990    async fn build_with_tracing(
16991        conf: gaxi::options::ClientConfig,
16992    ) -> crate::ClientBuilderResult<impl super::stub::TargetInstances> {
16993        Self::build_transport(conf)
16994            .await
16995            .map(super::tracing::TargetInstances::new)
16996    }
16997
16998    /// Retrieves an aggregated list of target instances.
16999    ///
17000    /// To prevent failure, Google recommends that you set the
17001    /// `returnPartialSuccess` parameter to `true`.
17002    pub fn aggregated_list(&self) -> super::builder::target_instances::AggregatedList {
17003        super::builder::target_instances::AggregatedList::new(self.inner.clone())
17004    }
17005
17006    /// Deletes the specified TargetInstance resource.
17007    pub fn delete(&self) -> super::builder::target_instances::Delete {
17008        super::builder::target_instances::Delete::new(self.inner.clone())
17009    }
17010
17011    /// Returns the specified TargetInstance resource.
17012    pub fn get(&self) -> super::builder::target_instances::Get {
17013        super::builder::target_instances::Get::new(self.inner.clone())
17014    }
17015
17016    /// Creates a TargetInstance resource in the specified project and zone using
17017    /// the data included in the request.
17018    pub fn insert(&self) -> super::builder::target_instances::Insert {
17019        super::builder::target_instances::Insert::new(self.inner.clone())
17020    }
17021
17022    /// Retrieves a list of TargetInstance resources available to the specified
17023    /// project and zone.
17024    pub fn list(&self) -> super::builder::target_instances::List {
17025        super::builder::target_instances::List::new(self.inner.clone())
17026    }
17027
17028    /// Sets the Google Cloud Armor security policy for the specified target
17029    /// instance. For more information, seeGoogle
17030    /// Cloud Armor Overview
17031    pub fn set_security_policy(&self) -> super::builder::target_instances::SetSecurityPolicy {
17032        super::builder::target_instances::SetSecurityPolicy::new(self.inner.clone())
17033    }
17034
17035    /// Returns permissions that a caller has on the specified resource.
17036    pub fn test_iam_permissions(&self) -> super::builder::target_instances::TestIamPermissions {
17037        super::builder::target_instances::TestIamPermissions::new(self.inner.clone())
17038    }
17039
17040    /// Retrieves the specified zone-specific Operations resource.
17041    pub fn get_operation(&self) -> super::builder::target_instances::GetOperation {
17042        super::builder::target_instances::GetOperation::new(self.inner.clone())
17043    }
17044}
17045
17046/// Implements a client for the Google Compute Engine API.
17047///
17048/// # Example
17049/// ```
17050/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17051/// # use google_cloud_compute_v1::client::TargetPools;
17052/// let client = TargetPools::builder().build().await?;
17053/// // use `client` to make requests to the Google Compute Engine API.
17054/// # Ok(()) }
17055/// ```
17056///
17057/// # Service Description
17058///
17059/// Service for the `targetPools` resource.
17060///
17061/// # Configuration
17062///
17063/// To configure `TargetPools` use the `with_*` methods in the type returned
17064/// by [builder()][TargetPools::builder]. The default configuration should
17065/// work for most applications. Common configuration changes include
17066///
17067/// * [with_endpoint()]: by default this client uses the global default endpoint
17068///   (`https://compute.googleapis.com`). Applications using regional
17069///   endpoints or running in restricted networks (e.g. a network configured
17070//    with [Private Google Access with VPC Service Controls]) may want to
17071///   override this default.
17072/// * [with_credentials()]: by default this client uses
17073///   [Application Default Credentials]. Applications using custom
17074///   authentication may need to override this default.
17075///
17076/// [with_endpoint()]: super::builder::target_pools::ClientBuilder::with_endpoint
17077/// [with_credentials()]: super::builder::target_pools::ClientBuilder::credentials
17078/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17079/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17080///
17081/// # Pooling and Cloning
17082///
17083/// `TargetPools` holds a connection pool internally, it is advised to
17084/// create one and the reuse it.  You do not need to wrap `TargetPools` in
17085/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17086/// already uses an `Arc` internally.
17087#[cfg(feature = "target-pools")]
17088#[cfg_attr(docsrs, doc(cfg(feature = "target-pools")))]
17089#[derive(Clone, Debug)]
17090pub struct TargetPools {
17091    inner: std::sync::Arc<dyn super::stub::dynamic::TargetPools>,
17092}
17093
17094#[cfg(feature = "target-pools")]
17095impl TargetPools {
17096    /// Returns a builder for [TargetPools].
17097    ///
17098    /// ```
17099    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17100    /// # use google_cloud_compute_v1::client::TargetPools;
17101    /// let client = TargetPools::builder().build().await?;
17102    /// # Ok(()) }
17103    /// ```
17104    pub fn builder() -> super::builder::target_pools::ClientBuilder {
17105        crate::new_client_builder(super::builder::target_pools::client::Factory)
17106    }
17107
17108    /// Creates a new client from the provided stub.
17109    ///
17110    /// The most common case for calling this function is in tests mocking the
17111    /// client's behavior.
17112    pub fn from_stub<T>(stub: T) -> Self
17113    where
17114        T: super::stub::TargetPools + 'static,
17115    {
17116        Self {
17117            inner: std::sync::Arc::new(stub),
17118        }
17119    }
17120
17121    pub(crate) async fn new(
17122        config: gaxi::options::ClientConfig,
17123    ) -> crate::ClientBuilderResult<Self> {
17124        let inner = Self::build_inner(config).await?;
17125        Ok(Self { inner })
17126    }
17127
17128    async fn build_inner(
17129        conf: gaxi::options::ClientConfig,
17130    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetPools>> {
17131        if gaxi::options::tracing_enabled(&conf) {
17132            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17133        }
17134        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17135    }
17136
17137    async fn build_transport(
17138        conf: gaxi::options::ClientConfig,
17139    ) -> crate::ClientBuilderResult<impl super::stub::TargetPools> {
17140        super::transport::TargetPools::new(conf).await
17141    }
17142
17143    async fn build_with_tracing(
17144        conf: gaxi::options::ClientConfig,
17145    ) -> crate::ClientBuilderResult<impl super::stub::TargetPools> {
17146        Self::build_transport(conf)
17147            .await
17148            .map(super::tracing::TargetPools::new)
17149    }
17150
17151    /// Adds health check URLs to a target pool.
17152    pub fn add_health_check(&self) -> super::builder::target_pools::AddHealthCheck {
17153        super::builder::target_pools::AddHealthCheck::new(self.inner.clone())
17154    }
17155
17156    /// Adds an instance to a target pool.
17157    pub fn add_instance(&self) -> super::builder::target_pools::AddInstance {
17158        super::builder::target_pools::AddInstance::new(self.inner.clone())
17159    }
17160
17161    /// Retrieves an aggregated list of target pools.
17162    ///
17163    /// To prevent failure, Google recommends that you set the
17164    /// `returnPartialSuccess` parameter to `true`.
17165    pub fn aggregated_list(&self) -> super::builder::target_pools::AggregatedList {
17166        super::builder::target_pools::AggregatedList::new(self.inner.clone())
17167    }
17168
17169    /// Deletes the specified target pool.
17170    pub fn delete(&self) -> super::builder::target_pools::Delete {
17171        super::builder::target_pools::Delete::new(self.inner.clone())
17172    }
17173
17174    /// Returns the specified target pool.
17175    pub fn get(&self) -> super::builder::target_pools::Get {
17176        super::builder::target_pools::Get::new(self.inner.clone())
17177    }
17178
17179    /// Gets the most recent health check results for each IP for the
17180    /// instance that is referenced by the given target pool.
17181    pub fn get_health(&self) -> super::builder::target_pools::GetHealth {
17182        super::builder::target_pools::GetHealth::new(self.inner.clone())
17183    }
17184
17185    /// Creates a target pool in the specified project and region using
17186    /// the data included in the request.
17187    pub fn insert(&self) -> super::builder::target_pools::Insert {
17188        super::builder::target_pools::Insert::new(self.inner.clone())
17189    }
17190
17191    /// Retrieves a list of target pools available to the specified
17192    /// project and region.
17193    pub fn list(&self) -> super::builder::target_pools::List {
17194        super::builder::target_pools::List::new(self.inner.clone())
17195    }
17196
17197    /// Removes health check URL from a target pool.
17198    pub fn remove_health_check(&self) -> super::builder::target_pools::RemoveHealthCheck {
17199        super::builder::target_pools::RemoveHealthCheck::new(self.inner.clone())
17200    }
17201
17202    /// Removes instance URL from a target pool.
17203    pub fn remove_instance(&self) -> super::builder::target_pools::RemoveInstance {
17204        super::builder::target_pools::RemoveInstance::new(self.inner.clone())
17205    }
17206
17207    /// Changes a backup target pool's configurations.
17208    pub fn set_backup(&self) -> super::builder::target_pools::SetBackup {
17209        super::builder::target_pools::SetBackup::new(self.inner.clone())
17210    }
17211
17212    /// Sets the Google Cloud Armor security policy for the specified target pool.
17213    /// For more information, seeGoogle
17214    /// Cloud Armor Overview
17215    pub fn set_security_policy(&self) -> super::builder::target_pools::SetSecurityPolicy {
17216        super::builder::target_pools::SetSecurityPolicy::new(self.inner.clone())
17217    }
17218
17219    /// Returns permissions that a caller has on the specified resource.
17220    pub fn test_iam_permissions(&self) -> super::builder::target_pools::TestIamPermissions {
17221        super::builder::target_pools::TestIamPermissions::new(self.inner.clone())
17222    }
17223
17224    /// Retrieves the specified region-specific Operations resource.
17225    pub fn get_operation(&self) -> super::builder::target_pools::GetOperation {
17226        super::builder::target_pools::GetOperation::new(self.inner.clone())
17227    }
17228}
17229
17230/// Implements a client for the Google Compute Engine API.
17231///
17232/// # Example
17233/// ```
17234/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17235/// # use google_cloud_compute_v1::client::TargetSslProxies;
17236/// let client = TargetSslProxies::builder().build().await?;
17237/// // use `client` to make requests to the Google Compute Engine API.
17238/// # Ok(()) }
17239/// ```
17240///
17241/// # Service Description
17242///
17243/// Service for the `targetSslProxies` resource.
17244///
17245/// # Configuration
17246///
17247/// To configure `TargetSslProxies` use the `with_*` methods in the type returned
17248/// by [builder()][TargetSslProxies::builder]. The default configuration should
17249/// work for most applications. Common configuration changes include
17250///
17251/// * [with_endpoint()]: by default this client uses the global default endpoint
17252///   (`https://compute.googleapis.com`). Applications using regional
17253///   endpoints or running in restricted networks (e.g. a network configured
17254//    with [Private Google Access with VPC Service Controls]) may want to
17255///   override this default.
17256/// * [with_credentials()]: by default this client uses
17257///   [Application Default Credentials]. Applications using custom
17258///   authentication may need to override this default.
17259///
17260/// [with_endpoint()]: super::builder::target_ssl_proxies::ClientBuilder::with_endpoint
17261/// [with_credentials()]: super::builder::target_ssl_proxies::ClientBuilder::credentials
17262/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17263/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17264///
17265/// # Pooling and Cloning
17266///
17267/// `TargetSslProxies` holds a connection pool internally, it is advised to
17268/// create one and the reuse it.  You do not need to wrap `TargetSslProxies` in
17269/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17270/// already uses an `Arc` internally.
17271#[cfg(feature = "target-ssl-proxies")]
17272#[cfg_attr(docsrs, doc(cfg(feature = "target-ssl-proxies")))]
17273#[derive(Clone, Debug)]
17274pub struct TargetSslProxies {
17275    inner: std::sync::Arc<dyn super::stub::dynamic::TargetSslProxies>,
17276}
17277
17278#[cfg(feature = "target-ssl-proxies")]
17279impl TargetSslProxies {
17280    /// Returns a builder for [TargetSslProxies].
17281    ///
17282    /// ```
17283    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17284    /// # use google_cloud_compute_v1::client::TargetSslProxies;
17285    /// let client = TargetSslProxies::builder().build().await?;
17286    /// # Ok(()) }
17287    /// ```
17288    pub fn builder() -> super::builder::target_ssl_proxies::ClientBuilder {
17289        crate::new_client_builder(super::builder::target_ssl_proxies::client::Factory)
17290    }
17291
17292    /// Creates a new client from the provided stub.
17293    ///
17294    /// The most common case for calling this function is in tests mocking the
17295    /// client's behavior.
17296    pub fn from_stub<T>(stub: T) -> Self
17297    where
17298        T: super::stub::TargetSslProxies + 'static,
17299    {
17300        Self {
17301            inner: std::sync::Arc::new(stub),
17302        }
17303    }
17304
17305    pub(crate) async fn new(
17306        config: gaxi::options::ClientConfig,
17307    ) -> crate::ClientBuilderResult<Self> {
17308        let inner = Self::build_inner(config).await?;
17309        Ok(Self { inner })
17310    }
17311
17312    async fn build_inner(
17313        conf: gaxi::options::ClientConfig,
17314    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetSslProxies>>
17315    {
17316        if gaxi::options::tracing_enabled(&conf) {
17317            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17318        }
17319        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17320    }
17321
17322    async fn build_transport(
17323        conf: gaxi::options::ClientConfig,
17324    ) -> crate::ClientBuilderResult<impl super::stub::TargetSslProxies> {
17325        super::transport::TargetSslProxies::new(conf).await
17326    }
17327
17328    async fn build_with_tracing(
17329        conf: gaxi::options::ClientConfig,
17330    ) -> crate::ClientBuilderResult<impl super::stub::TargetSslProxies> {
17331        Self::build_transport(conf)
17332            .await
17333            .map(super::tracing::TargetSslProxies::new)
17334    }
17335
17336    /// Deletes the specified TargetSslProxy resource.
17337    pub fn delete(&self) -> super::builder::target_ssl_proxies::Delete {
17338        super::builder::target_ssl_proxies::Delete::new(self.inner.clone())
17339    }
17340
17341    /// Returns the specified TargetSslProxy resource.
17342    pub fn get(&self) -> super::builder::target_ssl_proxies::Get {
17343        super::builder::target_ssl_proxies::Get::new(self.inner.clone())
17344    }
17345
17346    /// Creates a TargetSslProxy resource in the specified project using
17347    /// the data included in the request.
17348    pub fn insert(&self) -> super::builder::target_ssl_proxies::Insert {
17349        super::builder::target_ssl_proxies::Insert::new(self.inner.clone())
17350    }
17351
17352    /// Retrieves the list of TargetSslProxy resources
17353    /// available to the specified project.
17354    pub fn list(&self) -> super::builder::target_ssl_proxies::List {
17355        super::builder::target_ssl_proxies::List::new(self.inner.clone())
17356    }
17357
17358    /// Changes the BackendService for TargetSslProxy.
17359    pub fn set_backend_service(&self) -> super::builder::target_ssl_proxies::SetBackendService {
17360        super::builder::target_ssl_proxies::SetBackendService::new(self.inner.clone())
17361    }
17362
17363    /// Changes the Certificate Map for TargetSslProxy.
17364    pub fn set_certificate_map(&self) -> super::builder::target_ssl_proxies::SetCertificateMap {
17365        super::builder::target_ssl_proxies::SetCertificateMap::new(self.inner.clone())
17366    }
17367
17368    /// Changes the ProxyHeaderType for TargetSslProxy.
17369    pub fn set_proxy_header(&self) -> super::builder::target_ssl_proxies::SetProxyHeader {
17370        super::builder::target_ssl_proxies::SetProxyHeader::new(self.inner.clone())
17371    }
17372
17373    /// Changes SslCertificates for TargetSslProxy.
17374    pub fn set_ssl_certificates(&self) -> super::builder::target_ssl_proxies::SetSslCertificates {
17375        super::builder::target_ssl_proxies::SetSslCertificates::new(self.inner.clone())
17376    }
17377
17378    /// Sets the SSL policy for TargetSslProxy. The SSL policy specifies the
17379    /// server-side support for SSL features. This affects connections between
17380    /// clients and the load balancer. They do not affect the
17381    /// connection between the load balancer and the backends.
17382    pub fn set_ssl_policy(&self) -> super::builder::target_ssl_proxies::SetSslPolicy {
17383        super::builder::target_ssl_proxies::SetSslPolicy::new(self.inner.clone())
17384    }
17385
17386    /// Returns permissions that a caller has on the specified resource.
17387    pub fn test_iam_permissions(&self) -> super::builder::target_ssl_proxies::TestIamPermissions {
17388        super::builder::target_ssl_proxies::TestIamPermissions::new(self.inner.clone())
17389    }
17390
17391    /// Retrieves the specified Operations resource.
17392    pub fn get_operation(&self) -> super::builder::target_ssl_proxies::GetOperation {
17393        super::builder::target_ssl_proxies::GetOperation::new(self.inner.clone())
17394    }
17395}
17396
17397/// Implements a client for the Google Compute Engine API.
17398///
17399/// # Example
17400/// ```
17401/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17402/// # use google_cloud_compute_v1::client::TargetTcpProxies;
17403/// let client = TargetTcpProxies::builder().build().await?;
17404/// // use `client` to make requests to the Google Compute Engine API.
17405/// # Ok(()) }
17406/// ```
17407///
17408/// # Service Description
17409///
17410/// Service for the `targetTcpProxies` resource.
17411///
17412/// # Configuration
17413///
17414/// To configure `TargetTcpProxies` use the `with_*` methods in the type returned
17415/// by [builder()][TargetTcpProxies::builder]. The default configuration should
17416/// work for most applications. Common configuration changes include
17417///
17418/// * [with_endpoint()]: by default this client uses the global default endpoint
17419///   (`https://compute.googleapis.com`). Applications using regional
17420///   endpoints or running in restricted networks (e.g. a network configured
17421//    with [Private Google Access with VPC Service Controls]) may want to
17422///   override this default.
17423/// * [with_credentials()]: by default this client uses
17424///   [Application Default Credentials]. Applications using custom
17425///   authentication may need to override this default.
17426///
17427/// [with_endpoint()]: super::builder::target_tcp_proxies::ClientBuilder::with_endpoint
17428/// [with_credentials()]: super::builder::target_tcp_proxies::ClientBuilder::credentials
17429/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17430/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17431///
17432/// # Pooling and Cloning
17433///
17434/// `TargetTcpProxies` holds a connection pool internally, it is advised to
17435/// create one and the reuse it.  You do not need to wrap `TargetTcpProxies` in
17436/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17437/// already uses an `Arc` internally.
17438#[cfg(feature = "target-tcp-proxies")]
17439#[cfg_attr(docsrs, doc(cfg(feature = "target-tcp-proxies")))]
17440#[derive(Clone, Debug)]
17441pub struct TargetTcpProxies {
17442    inner: std::sync::Arc<dyn super::stub::dynamic::TargetTcpProxies>,
17443}
17444
17445#[cfg(feature = "target-tcp-proxies")]
17446impl TargetTcpProxies {
17447    /// Returns a builder for [TargetTcpProxies].
17448    ///
17449    /// ```
17450    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17451    /// # use google_cloud_compute_v1::client::TargetTcpProxies;
17452    /// let client = TargetTcpProxies::builder().build().await?;
17453    /// # Ok(()) }
17454    /// ```
17455    pub fn builder() -> super::builder::target_tcp_proxies::ClientBuilder {
17456        crate::new_client_builder(super::builder::target_tcp_proxies::client::Factory)
17457    }
17458
17459    /// Creates a new client from the provided stub.
17460    ///
17461    /// The most common case for calling this function is in tests mocking the
17462    /// client's behavior.
17463    pub fn from_stub<T>(stub: T) -> Self
17464    where
17465        T: super::stub::TargetTcpProxies + 'static,
17466    {
17467        Self {
17468            inner: std::sync::Arc::new(stub),
17469        }
17470    }
17471
17472    pub(crate) async fn new(
17473        config: gaxi::options::ClientConfig,
17474    ) -> crate::ClientBuilderResult<Self> {
17475        let inner = Self::build_inner(config).await?;
17476        Ok(Self { inner })
17477    }
17478
17479    async fn build_inner(
17480        conf: gaxi::options::ClientConfig,
17481    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetTcpProxies>>
17482    {
17483        if gaxi::options::tracing_enabled(&conf) {
17484            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17485        }
17486        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17487    }
17488
17489    async fn build_transport(
17490        conf: gaxi::options::ClientConfig,
17491    ) -> crate::ClientBuilderResult<impl super::stub::TargetTcpProxies> {
17492        super::transport::TargetTcpProxies::new(conf).await
17493    }
17494
17495    async fn build_with_tracing(
17496        conf: gaxi::options::ClientConfig,
17497    ) -> crate::ClientBuilderResult<impl super::stub::TargetTcpProxies> {
17498        Self::build_transport(conf)
17499            .await
17500            .map(super::tracing::TargetTcpProxies::new)
17501    }
17502
17503    /// Retrieves the list of all TargetTcpProxy resources, regional and global,
17504    /// available to the specified project.
17505    ///
17506    /// To prevent failure, Google recommends that you set the
17507    /// `returnPartialSuccess` parameter to `true`.
17508    pub fn aggregated_list(&self) -> super::builder::target_tcp_proxies::AggregatedList {
17509        super::builder::target_tcp_proxies::AggregatedList::new(self.inner.clone())
17510    }
17511
17512    /// Deletes the specified TargetTcpProxy resource.
17513    pub fn delete(&self) -> super::builder::target_tcp_proxies::Delete {
17514        super::builder::target_tcp_proxies::Delete::new(self.inner.clone())
17515    }
17516
17517    /// Returns the specified TargetTcpProxy resource.
17518    pub fn get(&self) -> super::builder::target_tcp_proxies::Get {
17519        super::builder::target_tcp_proxies::Get::new(self.inner.clone())
17520    }
17521
17522    /// Creates a TargetTcpProxy resource in the specified project using
17523    /// the data included in the request.
17524    pub fn insert(&self) -> super::builder::target_tcp_proxies::Insert {
17525        super::builder::target_tcp_proxies::Insert::new(self.inner.clone())
17526    }
17527
17528    /// Retrieves the list of TargetTcpProxy resources
17529    /// available to the specified project.
17530    pub fn list(&self) -> super::builder::target_tcp_proxies::List {
17531        super::builder::target_tcp_proxies::List::new(self.inner.clone())
17532    }
17533
17534    /// Changes the BackendService for TargetTcpProxy.
17535    pub fn set_backend_service(&self) -> super::builder::target_tcp_proxies::SetBackendService {
17536        super::builder::target_tcp_proxies::SetBackendService::new(self.inner.clone())
17537    }
17538
17539    /// Changes the ProxyHeaderType for TargetTcpProxy.
17540    pub fn set_proxy_header(&self) -> super::builder::target_tcp_proxies::SetProxyHeader {
17541        super::builder::target_tcp_proxies::SetProxyHeader::new(self.inner.clone())
17542    }
17543
17544    /// Returns permissions that a caller has on the specified resource.
17545    pub fn test_iam_permissions(&self) -> super::builder::target_tcp_proxies::TestIamPermissions {
17546        super::builder::target_tcp_proxies::TestIamPermissions::new(self.inner.clone())
17547    }
17548
17549    /// Retrieves the specified Operations resource.
17550    pub fn get_operation(&self) -> super::builder::target_tcp_proxies::GetOperation {
17551        super::builder::target_tcp_proxies::GetOperation::new(self.inner.clone())
17552    }
17553}
17554
17555/// Implements a client for the Google Compute Engine API.
17556///
17557/// # Example
17558/// ```
17559/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17560/// # use google_cloud_compute_v1::client::TargetVpnGateways;
17561/// let client = TargetVpnGateways::builder().build().await?;
17562/// // use `client` to make requests to the Google Compute Engine API.
17563/// # Ok(()) }
17564/// ```
17565///
17566/// # Service Description
17567///
17568/// Service for the `targetVpnGateways` resource.
17569///
17570/// # Configuration
17571///
17572/// To configure `TargetVpnGateways` use the `with_*` methods in the type returned
17573/// by [builder()][TargetVpnGateways::builder]. The default configuration should
17574/// work for most applications. Common configuration changes include
17575///
17576/// * [with_endpoint()]: by default this client uses the global default endpoint
17577///   (`https://compute.googleapis.com`). Applications using regional
17578///   endpoints or running in restricted networks (e.g. a network configured
17579//    with [Private Google Access with VPC Service Controls]) may want to
17580///   override this default.
17581/// * [with_credentials()]: by default this client uses
17582///   [Application Default Credentials]. Applications using custom
17583///   authentication may need to override this default.
17584///
17585/// [with_endpoint()]: super::builder::target_vpn_gateways::ClientBuilder::with_endpoint
17586/// [with_credentials()]: super::builder::target_vpn_gateways::ClientBuilder::credentials
17587/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17588/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17589///
17590/// # Pooling and Cloning
17591///
17592/// `TargetVpnGateways` holds a connection pool internally, it is advised to
17593/// create one and the reuse it.  You do not need to wrap `TargetVpnGateways` in
17594/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17595/// already uses an `Arc` internally.
17596#[cfg(feature = "target-vpn-gateways")]
17597#[cfg_attr(docsrs, doc(cfg(feature = "target-vpn-gateways")))]
17598#[derive(Clone, Debug)]
17599pub struct TargetVpnGateways {
17600    inner: std::sync::Arc<dyn super::stub::dynamic::TargetVpnGateways>,
17601}
17602
17603#[cfg(feature = "target-vpn-gateways")]
17604impl TargetVpnGateways {
17605    /// Returns a builder for [TargetVpnGateways].
17606    ///
17607    /// ```
17608    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17609    /// # use google_cloud_compute_v1::client::TargetVpnGateways;
17610    /// let client = TargetVpnGateways::builder().build().await?;
17611    /// # Ok(()) }
17612    /// ```
17613    pub fn builder() -> super::builder::target_vpn_gateways::ClientBuilder {
17614        crate::new_client_builder(super::builder::target_vpn_gateways::client::Factory)
17615    }
17616
17617    /// Creates a new client from the provided stub.
17618    ///
17619    /// The most common case for calling this function is in tests mocking the
17620    /// client's behavior.
17621    pub fn from_stub<T>(stub: T) -> Self
17622    where
17623        T: super::stub::TargetVpnGateways + 'static,
17624    {
17625        Self {
17626            inner: std::sync::Arc::new(stub),
17627        }
17628    }
17629
17630    pub(crate) async fn new(
17631        config: gaxi::options::ClientConfig,
17632    ) -> crate::ClientBuilderResult<Self> {
17633        let inner = Self::build_inner(config).await?;
17634        Ok(Self { inner })
17635    }
17636
17637    async fn build_inner(
17638        conf: gaxi::options::ClientConfig,
17639    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetVpnGateways>>
17640    {
17641        if gaxi::options::tracing_enabled(&conf) {
17642            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17643        }
17644        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17645    }
17646
17647    async fn build_transport(
17648        conf: gaxi::options::ClientConfig,
17649    ) -> crate::ClientBuilderResult<impl super::stub::TargetVpnGateways> {
17650        super::transport::TargetVpnGateways::new(conf).await
17651    }
17652
17653    async fn build_with_tracing(
17654        conf: gaxi::options::ClientConfig,
17655    ) -> crate::ClientBuilderResult<impl super::stub::TargetVpnGateways> {
17656        Self::build_transport(conf)
17657            .await
17658            .map(super::tracing::TargetVpnGateways::new)
17659    }
17660
17661    /// Retrieves an aggregated list of target VPN gateways.
17662    ///
17663    /// To prevent failure, Google recommends that you set the
17664    /// `returnPartialSuccess` parameter to `true`.
17665    pub fn aggregated_list(&self) -> super::builder::target_vpn_gateways::AggregatedList {
17666        super::builder::target_vpn_gateways::AggregatedList::new(self.inner.clone())
17667    }
17668
17669    /// Deletes the specified target VPN gateway.
17670    pub fn delete(&self) -> super::builder::target_vpn_gateways::Delete {
17671        super::builder::target_vpn_gateways::Delete::new(self.inner.clone())
17672    }
17673
17674    /// Returns the specified target VPN gateway.
17675    pub fn get(&self) -> super::builder::target_vpn_gateways::Get {
17676        super::builder::target_vpn_gateways::Get::new(self.inner.clone())
17677    }
17678
17679    /// Creates a target VPN gateway in the specified project and region using
17680    /// the data included in the request.
17681    pub fn insert(&self) -> super::builder::target_vpn_gateways::Insert {
17682        super::builder::target_vpn_gateways::Insert::new(self.inner.clone())
17683    }
17684
17685    /// Retrieves a list of target VPN gateways available to the specified
17686    /// project and region.
17687    pub fn list(&self) -> super::builder::target_vpn_gateways::List {
17688        super::builder::target_vpn_gateways::List::new(self.inner.clone())
17689    }
17690
17691    /// Sets the labels on a TargetVpnGateway. To learn more about labels, read theLabeling
17692    /// Resources documentation.
17693    pub fn set_labels(&self) -> super::builder::target_vpn_gateways::SetLabels {
17694        super::builder::target_vpn_gateways::SetLabels::new(self.inner.clone())
17695    }
17696
17697    /// Retrieves the specified region-specific Operations resource.
17698    pub fn get_operation(&self) -> super::builder::target_vpn_gateways::GetOperation {
17699        super::builder::target_vpn_gateways::GetOperation::new(self.inner.clone())
17700    }
17701}
17702
17703/// Implements a client for the Google Compute Engine API.
17704///
17705/// # Example
17706/// ```
17707/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17708/// # use google_cloud_compute_v1::client::UrlMaps;
17709/// let client = UrlMaps::builder().build().await?;
17710/// // use `client` to make requests to the Google Compute Engine API.
17711/// # Ok(()) }
17712/// ```
17713///
17714/// # Service Description
17715///
17716/// Service for the `urlMaps` resource.
17717///
17718/// # Configuration
17719///
17720/// To configure `UrlMaps` use the `with_*` methods in the type returned
17721/// by [builder()][UrlMaps::builder]. The default configuration should
17722/// work for most applications. Common configuration changes include
17723///
17724/// * [with_endpoint()]: by default this client uses the global default endpoint
17725///   (`https://compute.googleapis.com`). Applications using regional
17726///   endpoints or running in restricted networks (e.g. a network configured
17727//    with [Private Google Access with VPC Service Controls]) may want to
17728///   override this default.
17729/// * [with_credentials()]: by default this client uses
17730///   [Application Default Credentials]. Applications using custom
17731///   authentication may need to override this default.
17732///
17733/// [with_endpoint()]: super::builder::url_maps::ClientBuilder::with_endpoint
17734/// [with_credentials()]: super::builder::url_maps::ClientBuilder::credentials
17735/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17736/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17737///
17738/// # Pooling and Cloning
17739///
17740/// `UrlMaps` holds a connection pool internally, it is advised to
17741/// create one and the reuse it.  You do not need to wrap `UrlMaps` in
17742/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17743/// already uses an `Arc` internally.
17744#[cfg(feature = "url-maps")]
17745#[cfg_attr(docsrs, doc(cfg(feature = "url-maps")))]
17746#[derive(Clone, Debug)]
17747pub struct UrlMaps {
17748    inner: std::sync::Arc<dyn super::stub::dynamic::UrlMaps>,
17749}
17750
17751#[cfg(feature = "url-maps")]
17752impl UrlMaps {
17753    /// Returns a builder for [UrlMaps].
17754    ///
17755    /// ```
17756    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17757    /// # use google_cloud_compute_v1::client::UrlMaps;
17758    /// let client = UrlMaps::builder().build().await?;
17759    /// # Ok(()) }
17760    /// ```
17761    pub fn builder() -> super::builder::url_maps::ClientBuilder {
17762        crate::new_client_builder(super::builder::url_maps::client::Factory)
17763    }
17764
17765    /// Creates a new client from the provided stub.
17766    ///
17767    /// The most common case for calling this function is in tests mocking the
17768    /// client's behavior.
17769    pub fn from_stub<T>(stub: T) -> Self
17770    where
17771        T: super::stub::UrlMaps + 'static,
17772    {
17773        Self {
17774            inner: std::sync::Arc::new(stub),
17775        }
17776    }
17777
17778    pub(crate) async fn new(
17779        config: gaxi::options::ClientConfig,
17780    ) -> crate::ClientBuilderResult<Self> {
17781        let inner = Self::build_inner(config).await?;
17782        Ok(Self { inner })
17783    }
17784
17785    async fn build_inner(
17786        conf: gaxi::options::ClientConfig,
17787    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::UrlMaps>> {
17788        if gaxi::options::tracing_enabled(&conf) {
17789            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17790        }
17791        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17792    }
17793
17794    async fn build_transport(
17795        conf: gaxi::options::ClientConfig,
17796    ) -> crate::ClientBuilderResult<impl super::stub::UrlMaps> {
17797        super::transport::UrlMaps::new(conf).await
17798    }
17799
17800    async fn build_with_tracing(
17801        conf: gaxi::options::ClientConfig,
17802    ) -> crate::ClientBuilderResult<impl super::stub::UrlMaps> {
17803        Self::build_transport(conf)
17804            .await
17805            .map(super::tracing::UrlMaps::new)
17806    }
17807
17808    /// Retrieves the list of all UrlMap resources, regional and global,
17809    /// available to the specified project.
17810    ///
17811    /// To prevent failure, Google recommends that you set the
17812    /// `returnPartialSuccess` parameter to `true`.
17813    pub fn aggregated_list(&self) -> super::builder::url_maps::AggregatedList {
17814        super::builder::url_maps::AggregatedList::new(self.inner.clone())
17815    }
17816
17817    /// Deletes the specified UrlMap resource.
17818    pub fn delete(&self) -> super::builder::url_maps::Delete {
17819        super::builder::url_maps::Delete::new(self.inner.clone())
17820    }
17821
17822    /// Returns the specified UrlMap resource.
17823    pub fn get(&self) -> super::builder::url_maps::Get {
17824        super::builder::url_maps::Get::new(self.inner.clone())
17825    }
17826
17827    /// Creates a UrlMap resource in the specified project using
17828    /// the data included in the request.
17829    pub fn insert(&self) -> super::builder::url_maps::Insert {
17830        super::builder::url_maps::Insert::new(self.inner.clone())
17831    }
17832
17833    /// Initiates a cache invalidation operation, invalidating the specified path,
17834    /// scoped to the specified UrlMap.
17835    ///
17836    /// For more information, see [Invalidating cached
17837    /// content](/cdn/docs/invalidating-cached-content).
17838    pub fn invalidate_cache(&self) -> super::builder::url_maps::InvalidateCache {
17839        super::builder::url_maps::InvalidateCache::new(self.inner.clone())
17840    }
17841
17842    /// Retrieves the list of UrlMap resources available to the specified
17843    /// project.
17844    pub fn list(&self) -> super::builder::url_maps::List {
17845        super::builder::url_maps::List::new(self.inner.clone())
17846    }
17847
17848    /// Patches the specified UrlMap resource with the data included in the
17849    /// request. This method supportsPATCH
17850    /// semantics and uses theJSON merge
17851    /// patch format and processing rules.
17852    pub fn patch(&self) -> super::builder::url_maps::Patch {
17853        super::builder::url_maps::Patch::new(self.inner.clone())
17854    }
17855
17856    /// Returns permissions that a caller has on the specified resource.
17857    pub fn test_iam_permissions(&self) -> super::builder::url_maps::TestIamPermissions {
17858        super::builder::url_maps::TestIamPermissions::new(self.inner.clone())
17859    }
17860
17861    /// Updates the specified UrlMap resource with the data included in the
17862    /// request.
17863    pub fn update(&self) -> super::builder::url_maps::Update {
17864        super::builder::url_maps::Update::new(self.inner.clone())
17865    }
17866
17867    /// Runs static validation for the UrlMap. In particular, the tests of the
17868    /// provided UrlMap will be run. Calling this method does NOT create the
17869    /// UrlMap.
17870    pub fn validate(&self) -> super::builder::url_maps::Validate {
17871        super::builder::url_maps::Validate::new(self.inner.clone())
17872    }
17873
17874    /// Retrieves the specified Operations resource.
17875    pub fn get_operation(&self) -> super::builder::url_maps::GetOperation {
17876        super::builder::url_maps::GetOperation::new(self.inner.clone())
17877    }
17878}
17879
17880/// Implements a client for the Google Compute Engine API.
17881///
17882/// # Example
17883/// ```
17884/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17885/// # use google_cloud_compute_v1::client::VpnGateways;
17886/// let client = VpnGateways::builder().build().await?;
17887/// // use `client` to make requests to the Google Compute Engine API.
17888/// # Ok(()) }
17889/// ```
17890///
17891/// # Service Description
17892///
17893/// Service for the `vpnGateways` resource.
17894///
17895/// # Configuration
17896///
17897/// To configure `VpnGateways` use the `with_*` methods in the type returned
17898/// by [builder()][VpnGateways::builder]. The default configuration should
17899/// work for most applications. Common configuration changes include
17900///
17901/// * [with_endpoint()]: by default this client uses the global default endpoint
17902///   (`https://compute.googleapis.com`). Applications using regional
17903///   endpoints or running in restricted networks (e.g. a network configured
17904//    with [Private Google Access with VPC Service Controls]) may want to
17905///   override this default.
17906/// * [with_credentials()]: by default this client uses
17907///   [Application Default Credentials]. Applications using custom
17908///   authentication may need to override this default.
17909///
17910/// [with_endpoint()]: super::builder::vpn_gateways::ClientBuilder::with_endpoint
17911/// [with_credentials()]: super::builder::vpn_gateways::ClientBuilder::credentials
17912/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17913/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17914///
17915/// # Pooling and Cloning
17916///
17917/// `VpnGateways` holds a connection pool internally, it is advised to
17918/// create one and the reuse it.  You do not need to wrap `VpnGateways` in
17919/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17920/// already uses an `Arc` internally.
17921#[cfg(feature = "vpn-gateways")]
17922#[cfg_attr(docsrs, doc(cfg(feature = "vpn-gateways")))]
17923#[derive(Clone, Debug)]
17924pub struct VpnGateways {
17925    inner: std::sync::Arc<dyn super::stub::dynamic::VpnGateways>,
17926}
17927
17928#[cfg(feature = "vpn-gateways")]
17929impl VpnGateways {
17930    /// Returns a builder for [VpnGateways].
17931    ///
17932    /// ```
17933    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17934    /// # use google_cloud_compute_v1::client::VpnGateways;
17935    /// let client = VpnGateways::builder().build().await?;
17936    /// # Ok(()) }
17937    /// ```
17938    pub fn builder() -> super::builder::vpn_gateways::ClientBuilder {
17939        crate::new_client_builder(super::builder::vpn_gateways::client::Factory)
17940    }
17941
17942    /// Creates a new client from the provided stub.
17943    ///
17944    /// The most common case for calling this function is in tests mocking the
17945    /// client's behavior.
17946    pub fn from_stub<T>(stub: T) -> Self
17947    where
17948        T: super::stub::VpnGateways + 'static,
17949    {
17950        Self {
17951            inner: std::sync::Arc::new(stub),
17952        }
17953    }
17954
17955    pub(crate) async fn new(
17956        config: gaxi::options::ClientConfig,
17957    ) -> crate::ClientBuilderResult<Self> {
17958        let inner = Self::build_inner(config).await?;
17959        Ok(Self { inner })
17960    }
17961
17962    async fn build_inner(
17963        conf: gaxi::options::ClientConfig,
17964    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::VpnGateways>> {
17965        if gaxi::options::tracing_enabled(&conf) {
17966            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17967        }
17968        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17969    }
17970
17971    async fn build_transport(
17972        conf: gaxi::options::ClientConfig,
17973    ) -> crate::ClientBuilderResult<impl super::stub::VpnGateways> {
17974        super::transport::VpnGateways::new(conf).await
17975    }
17976
17977    async fn build_with_tracing(
17978        conf: gaxi::options::ClientConfig,
17979    ) -> crate::ClientBuilderResult<impl super::stub::VpnGateways> {
17980        Self::build_transport(conf)
17981            .await
17982            .map(super::tracing::VpnGateways::new)
17983    }
17984
17985    /// Retrieves an aggregated list of VPN gateways.
17986    ///
17987    /// To prevent failure, Google recommends that you set the
17988    /// `returnPartialSuccess` parameter to `true`.
17989    pub fn aggregated_list(&self) -> super::builder::vpn_gateways::AggregatedList {
17990        super::builder::vpn_gateways::AggregatedList::new(self.inner.clone())
17991    }
17992
17993    /// Deletes the specified VPN gateway.
17994    pub fn delete(&self) -> super::builder::vpn_gateways::Delete {
17995        super::builder::vpn_gateways::Delete::new(self.inner.clone())
17996    }
17997
17998    /// Returns the specified VPN gateway.
17999    pub fn get(&self) -> super::builder::vpn_gateways::Get {
18000        super::builder::vpn_gateways::Get::new(self.inner.clone())
18001    }
18002
18003    /// Returns the status for the specified VPN gateway.
18004    pub fn get_status(&self) -> super::builder::vpn_gateways::GetStatus {
18005        super::builder::vpn_gateways::GetStatus::new(self.inner.clone())
18006    }
18007
18008    /// Creates a VPN gateway in the specified project and region using
18009    /// the data included in the request.
18010    pub fn insert(&self) -> super::builder::vpn_gateways::Insert {
18011        super::builder::vpn_gateways::Insert::new(self.inner.clone())
18012    }
18013
18014    /// Retrieves a list of VPN gateways available to the specified
18015    /// project and region.
18016    pub fn list(&self) -> super::builder::vpn_gateways::List {
18017        super::builder::vpn_gateways::List::new(self.inner.clone())
18018    }
18019
18020    /// Sets the labels on a VpnGateway. To learn more about labels, read theLabeling
18021    /// Resources documentation.
18022    pub fn set_labels(&self) -> super::builder::vpn_gateways::SetLabels {
18023        super::builder::vpn_gateways::SetLabels::new(self.inner.clone())
18024    }
18025
18026    /// Returns permissions that a caller has on the specified resource.
18027    pub fn test_iam_permissions(&self) -> super::builder::vpn_gateways::TestIamPermissions {
18028        super::builder::vpn_gateways::TestIamPermissions::new(self.inner.clone())
18029    }
18030
18031    /// Retrieves the specified region-specific Operations resource.
18032    pub fn get_operation(&self) -> super::builder::vpn_gateways::GetOperation {
18033        super::builder::vpn_gateways::GetOperation::new(self.inner.clone())
18034    }
18035}
18036
18037/// Implements a client for the Google Compute Engine API.
18038///
18039/// # Example
18040/// ```
18041/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18042/// # use google_cloud_compute_v1::client::VpnTunnels;
18043/// let client = VpnTunnels::builder().build().await?;
18044/// // use `client` to make requests to the Google Compute Engine API.
18045/// # Ok(()) }
18046/// ```
18047///
18048/// # Service Description
18049///
18050/// Service for the `vpnTunnels` resource.
18051///
18052/// # Configuration
18053///
18054/// To configure `VpnTunnels` use the `with_*` methods in the type returned
18055/// by [builder()][VpnTunnels::builder]. The default configuration should
18056/// work for most applications. Common configuration changes include
18057///
18058/// * [with_endpoint()]: by default this client uses the global default endpoint
18059///   (`https://compute.googleapis.com`). Applications using regional
18060///   endpoints or running in restricted networks (e.g. a network configured
18061//    with [Private Google Access with VPC Service Controls]) may want to
18062///   override this default.
18063/// * [with_credentials()]: by default this client uses
18064///   [Application Default Credentials]. Applications using custom
18065///   authentication may need to override this default.
18066///
18067/// [with_endpoint()]: super::builder::vpn_tunnels::ClientBuilder::with_endpoint
18068/// [with_credentials()]: super::builder::vpn_tunnels::ClientBuilder::credentials
18069/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18070/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18071///
18072/// # Pooling and Cloning
18073///
18074/// `VpnTunnels` holds a connection pool internally, it is advised to
18075/// create one and the reuse it.  You do not need to wrap `VpnTunnels` in
18076/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18077/// already uses an `Arc` internally.
18078#[cfg(feature = "vpn-tunnels")]
18079#[cfg_attr(docsrs, doc(cfg(feature = "vpn-tunnels")))]
18080#[derive(Clone, Debug)]
18081pub struct VpnTunnels {
18082    inner: std::sync::Arc<dyn super::stub::dynamic::VpnTunnels>,
18083}
18084
18085#[cfg(feature = "vpn-tunnels")]
18086impl VpnTunnels {
18087    /// Returns a builder for [VpnTunnels].
18088    ///
18089    /// ```
18090    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18091    /// # use google_cloud_compute_v1::client::VpnTunnels;
18092    /// let client = VpnTunnels::builder().build().await?;
18093    /// # Ok(()) }
18094    /// ```
18095    pub fn builder() -> super::builder::vpn_tunnels::ClientBuilder {
18096        crate::new_client_builder(super::builder::vpn_tunnels::client::Factory)
18097    }
18098
18099    /// Creates a new client from the provided stub.
18100    ///
18101    /// The most common case for calling this function is in tests mocking the
18102    /// client's behavior.
18103    pub fn from_stub<T>(stub: T) -> Self
18104    where
18105        T: super::stub::VpnTunnels + 'static,
18106    {
18107        Self {
18108            inner: std::sync::Arc::new(stub),
18109        }
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::VpnTunnels>> {
18122        if gaxi::options::tracing_enabled(&conf) {
18123            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18124        }
18125        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18126    }
18127
18128    async fn build_transport(
18129        conf: gaxi::options::ClientConfig,
18130    ) -> crate::ClientBuilderResult<impl super::stub::VpnTunnels> {
18131        super::transport::VpnTunnels::new(conf).await
18132    }
18133
18134    async fn build_with_tracing(
18135        conf: gaxi::options::ClientConfig,
18136    ) -> crate::ClientBuilderResult<impl super::stub::VpnTunnels> {
18137        Self::build_transport(conf)
18138            .await
18139            .map(super::tracing::VpnTunnels::new)
18140    }
18141
18142    /// Retrieves an aggregated list of VPN tunnels.
18143    ///
18144    /// To prevent failure, Google recommends that you set the
18145    /// `returnPartialSuccess` parameter to `true`.
18146    pub fn aggregated_list(&self) -> super::builder::vpn_tunnels::AggregatedList {
18147        super::builder::vpn_tunnels::AggregatedList::new(self.inner.clone())
18148    }
18149
18150    /// Deletes the specified VpnTunnel resource.
18151    pub fn delete(&self) -> super::builder::vpn_tunnels::Delete {
18152        super::builder::vpn_tunnels::Delete::new(self.inner.clone())
18153    }
18154
18155    /// Returns the specified VpnTunnel resource.
18156    pub fn get(&self) -> super::builder::vpn_tunnels::Get {
18157        super::builder::vpn_tunnels::Get::new(self.inner.clone())
18158    }
18159
18160    /// Creates a VpnTunnel resource in the specified project and region using
18161    /// the data included in the request.
18162    pub fn insert(&self) -> super::builder::vpn_tunnels::Insert {
18163        super::builder::vpn_tunnels::Insert::new(self.inner.clone())
18164    }
18165
18166    /// Retrieves a list of VpnTunnel resources contained in the specified
18167    /// project and region.
18168    pub fn list(&self) -> super::builder::vpn_tunnels::List {
18169        super::builder::vpn_tunnels::List::new(self.inner.clone())
18170    }
18171
18172    /// Sets the labels on a VpnTunnel. To learn more about labels, read theLabeling
18173    /// Resources documentation.
18174    pub fn set_labels(&self) -> super::builder::vpn_tunnels::SetLabels {
18175        super::builder::vpn_tunnels::SetLabels::new(self.inner.clone())
18176    }
18177
18178    /// Retrieves the specified region-specific Operations resource.
18179    pub fn get_operation(&self) -> super::builder::vpn_tunnels::GetOperation {
18180        super::builder::vpn_tunnels::GetOperation::new(self.inner.clone())
18181    }
18182}
18183
18184/// Implements a client for the Google Compute Engine API.
18185///
18186/// # Example
18187/// ```
18188/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18189/// # use google_cloud_compute_v1::client::WireGroups;
18190/// let client = WireGroups::builder().build().await?;
18191/// // use `client` to make requests to the Google Compute Engine API.
18192/// # Ok(()) }
18193/// ```
18194///
18195/// # Service Description
18196///
18197/// Service for the `wireGroups` resource.
18198///
18199/// # Configuration
18200///
18201/// To configure `WireGroups` use the `with_*` methods in the type returned
18202/// by [builder()][WireGroups::builder]. The default configuration should
18203/// work for most applications. Common configuration changes include
18204///
18205/// * [with_endpoint()]: by default this client uses the global default endpoint
18206///   (`https://compute.googleapis.com`). Applications using regional
18207///   endpoints or running in restricted networks (e.g. a network configured
18208//    with [Private Google Access with VPC Service Controls]) may want to
18209///   override this default.
18210/// * [with_credentials()]: by default this client uses
18211///   [Application Default Credentials]. Applications using custom
18212///   authentication may need to override this default.
18213///
18214/// [with_endpoint()]: super::builder::wire_groups::ClientBuilder::with_endpoint
18215/// [with_credentials()]: super::builder::wire_groups::ClientBuilder::credentials
18216/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18217/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18218///
18219/// # Pooling and Cloning
18220///
18221/// `WireGroups` holds a connection pool internally, it is advised to
18222/// create one and the reuse it.  You do not need to wrap `WireGroups` in
18223/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18224/// already uses an `Arc` internally.
18225#[cfg(feature = "wire-groups")]
18226#[cfg_attr(docsrs, doc(cfg(feature = "wire-groups")))]
18227#[derive(Clone, Debug)]
18228pub struct WireGroups {
18229    inner: std::sync::Arc<dyn super::stub::dynamic::WireGroups>,
18230}
18231
18232#[cfg(feature = "wire-groups")]
18233impl WireGroups {
18234    /// Returns a builder for [WireGroups].
18235    ///
18236    /// ```
18237    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18238    /// # use google_cloud_compute_v1::client::WireGroups;
18239    /// let client = WireGroups::builder().build().await?;
18240    /// # Ok(()) }
18241    /// ```
18242    pub fn builder() -> super::builder::wire_groups::ClientBuilder {
18243        crate::new_client_builder(super::builder::wire_groups::client::Factory)
18244    }
18245
18246    /// Creates a new client from the provided stub.
18247    ///
18248    /// The most common case for calling this function is in tests mocking the
18249    /// client's behavior.
18250    pub fn from_stub<T>(stub: T) -> Self
18251    where
18252        T: super::stub::WireGroups + 'static,
18253    {
18254        Self {
18255            inner: std::sync::Arc::new(stub),
18256        }
18257    }
18258
18259    pub(crate) async fn new(
18260        config: gaxi::options::ClientConfig,
18261    ) -> crate::ClientBuilderResult<Self> {
18262        let inner = Self::build_inner(config).await?;
18263        Ok(Self { inner })
18264    }
18265
18266    async fn build_inner(
18267        conf: gaxi::options::ClientConfig,
18268    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::WireGroups>> {
18269        if gaxi::options::tracing_enabled(&conf) {
18270            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18271        }
18272        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18273    }
18274
18275    async fn build_transport(
18276        conf: gaxi::options::ClientConfig,
18277    ) -> crate::ClientBuilderResult<impl super::stub::WireGroups> {
18278        super::transport::WireGroups::new(conf).await
18279    }
18280
18281    async fn build_with_tracing(
18282        conf: gaxi::options::ClientConfig,
18283    ) -> crate::ClientBuilderResult<impl super::stub::WireGroups> {
18284        Self::build_transport(conf)
18285            .await
18286            .map(super::tracing::WireGroups::new)
18287    }
18288
18289    /// Deletes the specified wire group in the given scope.
18290    pub fn delete(&self) -> super::builder::wire_groups::Delete {
18291        super::builder::wire_groups::Delete::new(self.inner.clone())
18292    }
18293
18294    /// Gets the specified wire group resource in the given scope.
18295    pub fn get(&self) -> super::builder::wire_groups::Get {
18296        super::builder::wire_groups::Get::new(self.inner.clone())
18297    }
18298
18299    /// Creates a wire group in the specified project in the given scope
18300    /// using the parameters that are included in the request.
18301    pub fn insert(&self) -> super::builder::wire_groups::Insert {
18302        super::builder::wire_groups::Insert::new(self.inner.clone())
18303    }
18304
18305    /// Lists the wire groups for a project in the given scope.
18306    pub fn list(&self) -> super::builder::wire_groups::List {
18307        super::builder::wire_groups::List::new(self.inner.clone())
18308    }
18309
18310    /// Updates the specified wire group resource with the data included in the
18311    /// request. This method supportsPATCH
18312    /// semantics and usesJSON merge
18313    /// patch format and processing rules.
18314    pub fn patch(&self) -> super::builder::wire_groups::Patch {
18315        super::builder::wire_groups::Patch::new(self.inner.clone())
18316    }
18317
18318    /// Retrieves the specified Operations resource.
18319    pub fn get_operation(&self) -> super::builder::wire_groups::GetOperation {
18320        super::builder::wire_groups::GetOperation::new(self.inner.clone())
18321    }
18322}
18323
18324/// Implements a client for the Google Compute Engine API.
18325///
18326/// # Example
18327/// ```
18328/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18329/// # use google_cloud_compute_v1::client::ZoneOperations;
18330/// let client = ZoneOperations::builder().build().await?;
18331/// // use `client` to make requests to the Google Compute Engine API.
18332/// # Ok(()) }
18333/// ```
18334///
18335/// # Service Description
18336///
18337/// Service for the `zoneOperations` resource.
18338///
18339/// # Configuration
18340///
18341/// To configure `ZoneOperations` use the `with_*` methods in the type returned
18342/// by [builder()][ZoneOperations::builder]. The default configuration should
18343/// work for most applications. Common configuration changes include
18344///
18345/// * [with_endpoint()]: by default this client uses the global default endpoint
18346///   (`https://compute.googleapis.com`). Applications using regional
18347///   endpoints or running in restricted networks (e.g. a network configured
18348//    with [Private Google Access with VPC Service Controls]) may want to
18349///   override this default.
18350/// * [with_credentials()]: by default this client uses
18351///   [Application Default Credentials]. Applications using custom
18352///   authentication may need to override this default.
18353///
18354/// [with_endpoint()]: super::builder::zone_operations::ClientBuilder::with_endpoint
18355/// [with_credentials()]: super::builder::zone_operations::ClientBuilder::credentials
18356/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18357/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18358///
18359/// # Pooling and Cloning
18360///
18361/// `ZoneOperations` holds a connection pool internally, it is advised to
18362/// create one and the reuse it.  You do not need to wrap `ZoneOperations` in
18363/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18364/// already uses an `Arc` internally.
18365#[cfg(feature = "zone-operations")]
18366#[cfg_attr(docsrs, doc(cfg(feature = "zone-operations")))]
18367#[derive(Clone, Debug)]
18368pub struct ZoneOperations {
18369    inner: std::sync::Arc<dyn super::stub::dynamic::ZoneOperations>,
18370}
18371
18372#[cfg(feature = "zone-operations")]
18373impl ZoneOperations {
18374    /// Returns a builder for [ZoneOperations].
18375    ///
18376    /// ```
18377    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18378    /// # use google_cloud_compute_v1::client::ZoneOperations;
18379    /// let client = ZoneOperations::builder().build().await?;
18380    /// # Ok(()) }
18381    /// ```
18382    pub fn builder() -> super::builder::zone_operations::ClientBuilder {
18383        crate::new_client_builder(super::builder::zone_operations::client::Factory)
18384    }
18385
18386    /// Creates a new client from the provided stub.
18387    ///
18388    /// The most common case for calling this function is in tests mocking the
18389    /// client's behavior.
18390    pub fn from_stub<T>(stub: T) -> Self
18391    where
18392        T: super::stub::ZoneOperations + 'static,
18393    {
18394        Self {
18395            inner: std::sync::Arc::new(stub),
18396        }
18397    }
18398
18399    pub(crate) async fn new(
18400        config: gaxi::options::ClientConfig,
18401    ) -> crate::ClientBuilderResult<Self> {
18402        let inner = Self::build_inner(config).await?;
18403        Ok(Self { inner })
18404    }
18405
18406    async fn build_inner(
18407        conf: gaxi::options::ClientConfig,
18408    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ZoneOperations>> {
18409        if gaxi::options::tracing_enabled(&conf) {
18410            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18411        }
18412        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18413    }
18414
18415    async fn build_transport(
18416        conf: gaxi::options::ClientConfig,
18417    ) -> crate::ClientBuilderResult<impl super::stub::ZoneOperations> {
18418        super::transport::ZoneOperations::new(conf).await
18419    }
18420
18421    async fn build_with_tracing(
18422        conf: gaxi::options::ClientConfig,
18423    ) -> crate::ClientBuilderResult<impl super::stub::ZoneOperations> {
18424        Self::build_transport(conf)
18425            .await
18426            .map(super::tracing::ZoneOperations::new)
18427    }
18428
18429    /// Deletes the specified zone-specific Operations resource.
18430    pub fn delete(&self) -> super::builder::zone_operations::Delete {
18431        super::builder::zone_operations::Delete::new(self.inner.clone())
18432    }
18433
18434    /// Retrieves the specified zone-specific Operations resource.
18435    pub fn get(&self) -> super::builder::zone_operations::Get {
18436        super::builder::zone_operations::Get::new(self.inner.clone())
18437    }
18438
18439    /// Retrieves a list of Operation resources contained within
18440    /// the specified zone.
18441    pub fn list(&self) -> super::builder::zone_operations::List {
18442        super::builder::zone_operations::List::new(self.inner.clone())
18443    }
18444
18445    /// Waits for the specified Operation resource to return as `DONE`
18446    /// or for the request to approach the 2 minute deadline, and retrieves the
18447    /// specified Operation resource. This method waits for no more than the
18448    /// 2 minutes and then returns the current state of the
18449    /// operation, which might be `DONE` or still in progress.
18450    ///
18451    /// This method is called on a best-effort basis. Specifically:
18452    ///
18453    /// ```norust
18454    /// - In uncommon cases, when the server is overloaded, the request might
18455    /// return before the default deadline is reached, or might return after zero
18456    /// seconds.
18457    /// ```
18458    ///
18459    /// - If the default deadline is reached, there is no guarantee that the
18460    ///   operation is actually done when the method returns. Be prepared to retry
18461    ///   if the operation is not `DONE`.
18462    pub fn wait(&self) -> super::builder::zone_operations::Wait {
18463        super::builder::zone_operations::Wait::new(self.inner.clone())
18464    }
18465}
18466
18467/// Implements a client for the Google Compute Engine API.
18468///
18469/// # Example
18470/// ```
18471/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18472/// # use google_cloud_compute_v1::client::Zones;
18473/// let client = Zones::builder().build().await?;
18474/// // use `client` to make requests to the Google Compute Engine API.
18475/// # Ok(()) }
18476/// ```
18477///
18478/// # Service Description
18479///
18480/// Service for the `zones` resource.
18481///
18482/// # Configuration
18483///
18484/// To configure `Zones` use the `with_*` methods in the type returned
18485/// by [builder()][Zones::builder]. The default configuration should
18486/// work for most applications. Common configuration changes include
18487///
18488/// * [with_endpoint()]: by default this client uses the global default endpoint
18489///   (`https://compute.googleapis.com`). Applications using regional
18490///   endpoints or running in restricted networks (e.g. a network configured
18491//    with [Private Google Access with VPC Service Controls]) may want to
18492///   override this default.
18493/// * [with_credentials()]: by default this client uses
18494///   [Application Default Credentials]. Applications using custom
18495///   authentication may need to override this default.
18496///
18497/// [with_endpoint()]: super::builder::zones::ClientBuilder::with_endpoint
18498/// [with_credentials()]: super::builder::zones::ClientBuilder::credentials
18499/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18500/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18501///
18502/// # Pooling and Cloning
18503///
18504/// `Zones` holds a connection pool internally, it is advised to
18505/// create one and the reuse it.  You do not need to wrap `Zones` in
18506/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18507/// already uses an `Arc` internally.
18508#[cfg(feature = "zones")]
18509#[cfg_attr(docsrs, doc(cfg(feature = "zones")))]
18510#[derive(Clone, Debug)]
18511pub struct Zones {
18512    inner: std::sync::Arc<dyn super::stub::dynamic::Zones>,
18513}
18514
18515#[cfg(feature = "zones")]
18516impl Zones {
18517    /// Returns a builder for [Zones].
18518    ///
18519    /// ```
18520    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18521    /// # use google_cloud_compute_v1::client::Zones;
18522    /// let client = Zones::builder().build().await?;
18523    /// # Ok(()) }
18524    /// ```
18525    pub fn builder() -> super::builder::zones::ClientBuilder {
18526        crate::new_client_builder(super::builder::zones::client::Factory)
18527    }
18528
18529    /// Creates a new client from the provided stub.
18530    ///
18531    /// The most common case for calling this function is in tests mocking the
18532    /// client's behavior.
18533    pub fn from_stub<T>(stub: T) -> Self
18534    where
18535        T: super::stub::Zones + 'static,
18536    {
18537        Self {
18538            inner: std::sync::Arc::new(stub),
18539        }
18540    }
18541
18542    pub(crate) async fn new(
18543        config: gaxi::options::ClientConfig,
18544    ) -> crate::ClientBuilderResult<Self> {
18545        let inner = Self::build_inner(config).await?;
18546        Ok(Self { inner })
18547    }
18548
18549    async fn build_inner(
18550        conf: gaxi::options::ClientConfig,
18551    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Zones>> {
18552        if gaxi::options::tracing_enabled(&conf) {
18553            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18554        }
18555        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18556    }
18557
18558    async fn build_transport(
18559        conf: gaxi::options::ClientConfig,
18560    ) -> crate::ClientBuilderResult<impl super::stub::Zones> {
18561        super::transport::Zones::new(conf).await
18562    }
18563
18564    async fn build_with_tracing(
18565        conf: gaxi::options::ClientConfig,
18566    ) -> crate::ClientBuilderResult<impl super::stub::Zones> {
18567        Self::build_transport(conf)
18568            .await
18569            .map(super::tracing::Zones::new)
18570    }
18571
18572    /// Returns the specified Zone resource.
18573    pub fn get(&self) -> super::builder::zones::Get {
18574        super::builder::zones::Get::new(self.inner.clone())
18575    }
18576
18577    /// Retrieves the list of Zone resources available to the specified project.
18578    pub fn list(&self) -> super::builder::zones::List {
18579        super::builder::zones::List::new(self.inner.clone())
18580    }
18581}