google_cloud_compute_v1/client.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16#![allow(rustdoc::bare_urls)]
17#![allow(rustdoc::broken_intra_doc_links)]
18#![allow(rustdoc::invalid_html_tags)]
19#![allow(rustdoc::redundant_explicit_links)]
20
21/// Implements a client for the Compute Engine API.
22///
23/// # Example
24/// ```
25/// # use google_cloud_compute_v1::client::AcceleratorTypes;
26/// async fn sample(
27/// ) -> anyhow::Result<()> {
28/// let client = AcceleratorTypes::builder().build().await?;
29/// // use `client` to make requests to the Compute Engine API.
30/// Ok(())
31/// }
32/// ```
33///
34/// # Service Description
35///
36/// Service for the `acceleratorTypes` resource.
37///
38/// # Configuration
39///
40/// To configure `AcceleratorTypes` use the `with_*` methods in the type returned
41/// by [builder()][AcceleratorTypes::builder]. The default configuration should
42/// work for most applications. Common configuration changes include
43///
44/// * [with_endpoint()]: by default this client uses the global default endpoint
45/// (`https://compute.googleapis.com`). Applications using regional
46/// endpoints or running in restricted networks (e.g. a network configured
47/// with [Private Google Access with VPC Service Controls]) may want to
48/// override this default.
49/// * [with_credentials()]: by default this client uses
50/// [Application Default Credentials]. Applications using custom
51/// authentication may need to override this default.
52///
53/// [with_endpoint()]: super::builder::accelerator_types::ClientBuilder::with_endpoint
54/// [with_credentials()]: super::builder::accelerator_types::ClientBuilder::with_credentials
55/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
56/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
57///
58/// # Pooling and Cloning
59///
60/// `AcceleratorTypes` holds a connection pool internally, it is advised to
61/// create one and reuse it. You do not need to wrap `AcceleratorTypes` in
62/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
63/// already uses an `Arc` internally.
64#[cfg(feature = "accelerator-types")]
65#[cfg_attr(docsrs, doc(cfg(feature = "accelerator-types")))]
66#[derive(Clone, Debug)]
67pub struct AcceleratorTypes {
68 inner: std::sync::Arc<dyn super::stub::dynamic::AcceleratorTypes>,
69}
70
71#[cfg(feature = "accelerator-types")]
72impl AcceleratorTypes {
73 /// Returns a builder for [AcceleratorTypes].
74 ///
75 /// ```
76 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
77 /// # use google_cloud_compute_v1::client::AcceleratorTypes;
78 /// let client = AcceleratorTypes::builder().build().await?;
79 /// # Ok(()) }
80 /// ```
81 pub fn builder() -> super::builder::accelerator_types::ClientBuilder {
82 crate::new_client_builder(super::builder::accelerator_types::client::Factory)
83 }
84
85 /// Creates a new client from the provided stub.
86 ///
87 /// The most common case for calling this function is in tests mocking the
88 /// client's behavior.
89 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
90 where
91 T: super::stub::AcceleratorTypes + 'static,
92 {
93 Self { inner: stub.into() }
94 }
95
96 pub(crate) async fn new(
97 config: gaxi::options::ClientConfig,
98 ) -> crate::ClientBuilderResult<Self> {
99 let inner = Self::build_inner(config).await?;
100 Ok(Self { inner })
101 }
102
103 async fn build_inner(
104 conf: gaxi::options::ClientConfig,
105 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::AcceleratorTypes>>
106 {
107 if gaxi::options::tracing_enabled(&conf) {
108 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
109 }
110 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
111 }
112
113 async fn build_transport(
114 conf: gaxi::options::ClientConfig,
115 ) -> crate::ClientBuilderResult<impl super::stub::AcceleratorTypes> {
116 super::transport::AcceleratorTypes::new(conf).await
117 }
118
119 async fn build_with_tracing(
120 conf: gaxi::options::ClientConfig,
121 ) -> crate::ClientBuilderResult<impl super::stub::AcceleratorTypes> {
122 Self::build_transport(conf)
123 .await
124 .map(super::tracing::AcceleratorTypes::new)
125 }
126
127 /// Retrieves an aggregated list of accelerator types.
128 ///
129 /// To prevent failure, it is recommended that you set the
130 /// `returnPartialSuccess` parameter to `true`.
131 pub fn aggregated_list(&self) -> super::builder::accelerator_types::AggregatedList {
132 super::builder::accelerator_types::AggregatedList::new(self.inner.clone())
133 }
134
135 /// Returns the specified accelerator type.
136 pub fn get(&self) -> super::builder::accelerator_types::Get {
137 super::builder::accelerator_types::Get::new(self.inner.clone())
138 }
139
140 /// Retrieves a list of accelerator types that are available to the specified
141 /// project.
142 pub fn list(&self) -> super::builder::accelerator_types::List {
143 super::builder::accelerator_types::List::new(self.inner.clone())
144 }
145}
146
147/// Implements a client for the Compute Engine API.
148///
149/// # Example
150/// ```
151/// # use google_cloud_compute_v1::client::Addresses;
152/// async fn sample(
153/// ) -> anyhow::Result<()> {
154/// let client = Addresses::builder().build().await?;
155/// // use `client` to make requests to the Compute Engine API.
156/// Ok(())
157/// }
158/// ```
159///
160/// # Service Description
161///
162/// Service for the `addresses` resource.
163///
164/// # Configuration
165///
166/// To configure `Addresses` use the `with_*` methods in the type returned
167/// by [builder()][Addresses::builder]. The default configuration should
168/// work for most applications. Common configuration changes include
169///
170/// * [with_endpoint()]: by default this client uses the global default endpoint
171/// (`https://compute.googleapis.com`). Applications using regional
172/// endpoints or running in restricted networks (e.g. a network configured
173/// with [Private Google Access with VPC Service Controls]) may want to
174/// override this default.
175/// * [with_credentials()]: by default this client uses
176/// [Application Default Credentials]. Applications using custom
177/// authentication may need to override this default.
178///
179/// [with_endpoint()]: super::builder::addresses::ClientBuilder::with_endpoint
180/// [with_credentials()]: super::builder::addresses::ClientBuilder::with_credentials
181/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
182/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
183///
184/// # Pooling and Cloning
185///
186/// `Addresses` holds a connection pool internally, it is advised to
187/// create one and reuse it. You do not need to wrap `Addresses` in
188/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
189/// already uses an `Arc` internally.
190#[cfg(feature = "addresses")]
191#[cfg_attr(docsrs, doc(cfg(feature = "addresses")))]
192#[derive(Clone, Debug)]
193pub struct Addresses {
194 inner: std::sync::Arc<dyn super::stub::dynamic::Addresses>,
195}
196
197#[cfg(feature = "addresses")]
198impl Addresses {
199 /// Returns a builder for [Addresses].
200 ///
201 /// ```
202 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
203 /// # use google_cloud_compute_v1::client::Addresses;
204 /// let client = Addresses::builder().build().await?;
205 /// # Ok(()) }
206 /// ```
207 pub fn builder() -> super::builder::addresses::ClientBuilder {
208 crate::new_client_builder(super::builder::addresses::client::Factory)
209 }
210
211 /// Creates a new client from the provided stub.
212 ///
213 /// The most common case for calling this function is in tests mocking the
214 /// client's behavior.
215 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
216 where
217 T: super::stub::Addresses + 'static,
218 {
219 Self { inner: stub.into() }
220 }
221
222 pub(crate) async fn new(
223 config: gaxi::options::ClientConfig,
224 ) -> crate::ClientBuilderResult<Self> {
225 let inner = Self::build_inner(config).await?;
226 Ok(Self { inner })
227 }
228
229 async fn build_inner(
230 conf: gaxi::options::ClientConfig,
231 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Addresses>> {
232 if gaxi::options::tracing_enabled(&conf) {
233 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
234 }
235 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
236 }
237
238 async fn build_transport(
239 conf: gaxi::options::ClientConfig,
240 ) -> crate::ClientBuilderResult<impl super::stub::Addresses> {
241 super::transport::Addresses::new(conf).await
242 }
243
244 async fn build_with_tracing(
245 conf: gaxi::options::ClientConfig,
246 ) -> crate::ClientBuilderResult<impl super::stub::Addresses> {
247 Self::build_transport(conf)
248 .await
249 .map(super::tracing::Addresses::new)
250 }
251
252 /// Retrieves an aggregated list of addresses.
253 ///
254 /// To prevent failure, it is recommended that you set the
255 /// `returnPartialSuccess` parameter to `true`.
256 pub fn aggregated_list(&self) -> super::builder::addresses::AggregatedList {
257 super::builder::addresses::AggregatedList::new(self.inner.clone())
258 }
259
260 /// Deletes the specified address resource.
261 pub fn delete(&self) -> super::builder::addresses::Delete {
262 super::builder::addresses::Delete::new(self.inner.clone())
263 }
264
265 /// Returns the specified address resource.
266 pub fn get(&self) -> super::builder::addresses::Get {
267 super::builder::addresses::Get::new(self.inner.clone())
268 }
269
270 /// Creates an address resource in the specified project by using the data
271 /// included in the request.
272 pub fn insert(&self) -> super::builder::addresses::Insert {
273 super::builder::addresses::Insert::new(self.inner.clone())
274 }
275
276 /// Retrieves a list of addresses contained within
277 /// the specified region.
278 pub fn list(&self) -> super::builder::addresses::List {
279 super::builder::addresses::List::new(self.inner.clone())
280 }
281
282 /// Moves the specified address resource.
283 pub fn r#move(&self) -> super::builder::addresses::Move {
284 super::builder::addresses::Move::new(self.inner.clone())
285 }
286
287 /// Sets the labels on an Address. To learn more about labels, read theLabeling
288 /// Resources documentation.
289 pub fn set_labels(&self) -> super::builder::addresses::SetLabels {
290 super::builder::addresses::SetLabels::new(self.inner.clone())
291 }
292
293 /// Returns permissions that a caller has on the specified resource.
294 pub fn test_iam_permissions(&self) -> super::builder::addresses::TestIamPermissions {
295 super::builder::addresses::TestIamPermissions::new(self.inner.clone())
296 }
297
298 /// Retrieves the specified region-specific Operations resource.
299 pub fn get_operation(&self) -> super::builder::addresses::GetOperation {
300 super::builder::addresses::GetOperation::new(self.inner.clone())
301 }
302}
303
304/// Implements a client for the Compute Engine API.
305///
306/// # Example
307/// ```
308/// # use google_cloud_compute_v1::client::Advice;
309/// async fn sample(
310/// ) -> anyhow::Result<()> {
311/// let client = Advice::builder().build().await?;
312/// // use `client` to make requests to the Compute Engine API.
313/// Ok(())
314/// }
315/// ```
316///
317/// # Service Description
318///
319/// Service for the `advice` resource.
320///
321/// # Configuration
322///
323/// To configure `Advice` use the `with_*` methods in the type returned
324/// by [builder()][Advice::builder]. The default configuration should
325/// work for most applications. Common configuration changes include
326///
327/// * [with_endpoint()]: by default this client uses the global default endpoint
328/// (`https://compute.googleapis.com`). Applications using regional
329/// endpoints or running in restricted networks (e.g. a network configured
330/// with [Private Google Access with VPC Service Controls]) may want to
331/// override this default.
332/// * [with_credentials()]: by default this client uses
333/// [Application Default Credentials]. Applications using custom
334/// authentication may need to override this default.
335///
336/// [with_endpoint()]: super::builder::advice::ClientBuilder::with_endpoint
337/// [with_credentials()]: super::builder::advice::ClientBuilder::with_credentials
338/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
339/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
340///
341/// # Pooling and Cloning
342///
343/// `Advice` holds a connection pool internally, it is advised to
344/// create one and reuse it. You do not need to wrap `Advice` in
345/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
346/// already uses an `Arc` internally.
347#[cfg(feature = "advice")]
348#[cfg_attr(docsrs, doc(cfg(feature = "advice")))]
349#[derive(Clone, Debug)]
350pub struct Advice {
351 inner: std::sync::Arc<dyn super::stub::dynamic::Advice>,
352}
353
354#[cfg(feature = "advice")]
355impl Advice {
356 /// Returns a builder for [Advice].
357 ///
358 /// ```
359 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
360 /// # use google_cloud_compute_v1::client::Advice;
361 /// let client = Advice::builder().build().await?;
362 /// # Ok(()) }
363 /// ```
364 pub fn builder() -> super::builder::advice::ClientBuilder {
365 crate::new_client_builder(super::builder::advice::client::Factory)
366 }
367
368 /// Creates a new client from the provided stub.
369 ///
370 /// The most common case for calling this function is in tests mocking the
371 /// client's behavior.
372 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
373 where
374 T: super::stub::Advice + 'static,
375 {
376 Self { inner: stub.into() }
377 }
378
379 pub(crate) async fn new(
380 config: gaxi::options::ClientConfig,
381 ) -> crate::ClientBuilderResult<Self> {
382 let inner = Self::build_inner(config).await?;
383 Ok(Self { inner })
384 }
385
386 async fn build_inner(
387 conf: gaxi::options::ClientConfig,
388 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Advice>> {
389 if gaxi::options::tracing_enabled(&conf) {
390 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
391 }
392 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
393 }
394
395 async fn build_transport(
396 conf: gaxi::options::ClientConfig,
397 ) -> crate::ClientBuilderResult<impl super::stub::Advice> {
398 super::transport::Advice::new(conf).await
399 }
400
401 async fn build_with_tracing(
402 conf: gaxi::options::ClientConfig,
403 ) -> crate::ClientBuilderResult<impl super::stub::Advice> {
404 Self::build_transport(conf)
405 .await
406 .map(super::tracing::Advice::new)
407 }
408
409 /// Advise how, where and when to create the requested amount of instances
410 /// with specified accelerators, within the specified time and location limits.
411 /// The method recommends creating future reservations for the requested
412 /// resources.
413 pub fn calendar_mode(&self) -> super::builder::advice::CalendarMode {
414 super::builder::advice::CalendarMode::new(self.inner.clone())
415 }
416
417 /// Advice on making real-time decisions (such as choosing zone or
418 /// machine types) during deployment to maximize your chances of obtaining
419 /// capacity.
420 pub fn capacity(&self) -> super::builder::advice::Capacity {
421 super::builder::advice::Capacity::new(self.inner.clone())
422 }
423
424 /// Gets the capacity history.
425 pub fn capacity_history(&self) -> super::builder::advice::CapacityHistory {
426 super::builder::advice::CapacityHistory::new(self.inner.clone())
427 }
428}
429
430/// Implements a client for the Compute Engine API.
431///
432/// # Example
433/// ```
434/// # use google_cloud_compute_v1::client::Autoscalers;
435/// async fn sample(
436/// ) -> anyhow::Result<()> {
437/// let client = Autoscalers::builder().build().await?;
438/// // use `client` to make requests to the Compute Engine API.
439/// Ok(())
440/// }
441/// ```
442///
443/// # Service Description
444///
445/// Service for the `autoscalers` resource.
446///
447/// # Configuration
448///
449/// To configure `Autoscalers` use the `with_*` methods in the type returned
450/// by [builder()][Autoscalers::builder]. The default configuration should
451/// work for most applications. Common configuration changes include
452///
453/// * [with_endpoint()]: by default this client uses the global default endpoint
454/// (`https://compute.googleapis.com`). Applications using regional
455/// endpoints or running in restricted networks (e.g. a network configured
456/// with [Private Google Access with VPC Service Controls]) may want to
457/// override this default.
458/// * [with_credentials()]: by default this client uses
459/// [Application Default Credentials]. Applications using custom
460/// authentication may need to override this default.
461///
462/// [with_endpoint()]: super::builder::autoscalers::ClientBuilder::with_endpoint
463/// [with_credentials()]: super::builder::autoscalers::ClientBuilder::with_credentials
464/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
465/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
466///
467/// # Pooling and Cloning
468///
469/// `Autoscalers` holds a connection pool internally, it is advised to
470/// create one and reuse it. You do not need to wrap `Autoscalers` in
471/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
472/// already uses an `Arc` internally.
473#[cfg(feature = "autoscalers")]
474#[cfg_attr(docsrs, doc(cfg(feature = "autoscalers")))]
475#[derive(Clone, Debug)]
476pub struct Autoscalers {
477 inner: std::sync::Arc<dyn super::stub::dynamic::Autoscalers>,
478}
479
480#[cfg(feature = "autoscalers")]
481impl Autoscalers {
482 /// Returns a builder for [Autoscalers].
483 ///
484 /// ```
485 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
486 /// # use google_cloud_compute_v1::client::Autoscalers;
487 /// let client = Autoscalers::builder().build().await?;
488 /// # Ok(()) }
489 /// ```
490 pub fn builder() -> super::builder::autoscalers::ClientBuilder {
491 crate::new_client_builder(super::builder::autoscalers::client::Factory)
492 }
493
494 /// Creates a new client from the provided stub.
495 ///
496 /// The most common case for calling this function is in tests mocking the
497 /// client's behavior.
498 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
499 where
500 T: super::stub::Autoscalers + 'static,
501 {
502 Self { inner: stub.into() }
503 }
504
505 pub(crate) async fn new(
506 config: gaxi::options::ClientConfig,
507 ) -> crate::ClientBuilderResult<Self> {
508 let inner = Self::build_inner(config).await?;
509 Ok(Self { inner })
510 }
511
512 async fn build_inner(
513 conf: gaxi::options::ClientConfig,
514 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Autoscalers>> {
515 if gaxi::options::tracing_enabled(&conf) {
516 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
517 }
518 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
519 }
520
521 async fn build_transport(
522 conf: gaxi::options::ClientConfig,
523 ) -> crate::ClientBuilderResult<impl super::stub::Autoscalers> {
524 super::transport::Autoscalers::new(conf).await
525 }
526
527 async fn build_with_tracing(
528 conf: gaxi::options::ClientConfig,
529 ) -> crate::ClientBuilderResult<impl super::stub::Autoscalers> {
530 Self::build_transport(conf)
531 .await
532 .map(super::tracing::Autoscalers::new)
533 }
534
535 /// Retrieves an aggregated list of autoscalers.
536 ///
537 /// To prevent failure, it is recommended that you set the
538 /// `returnPartialSuccess` parameter to `true`.
539 pub fn aggregated_list(&self) -> super::builder::autoscalers::AggregatedList {
540 super::builder::autoscalers::AggregatedList::new(self.inner.clone())
541 }
542
543 /// Deletes the specified autoscaler.
544 pub fn delete(&self) -> super::builder::autoscalers::Delete {
545 super::builder::autoscalers::Delete::new(self.inner.clone())
546 }
547
548 /// Returns the specified autoscaler resource.
549 pub fn get(&self) -> super::builder::autoscalers::Get {
550 super::builder::autoscalers::Get::new(self.inner.clone())
551 }
552
553 /// Creates an autoscaler in the specified project using the data
554 /// included in the request.
555 pub fn insert(&self) -> super::builder::autoscalers::Insert {
556 super::builder::autoscalers::Insert::new(self.inner.clone())
557 }
558
559 /// Retrieves a list of autoscalers contained within
560 /// the specified zone.
561 pub fn list(&self) -> super::builder::autoscalers::List {
562 super::builder::autoscalers::List::new(self.inner.clone())
563 }
564
565 /// Updates an autoscaler in the specified project using the data
566 /// included in the request. This method supportsPATCH
567 /// semantics and uses theJSON merge
568 /// patch format and processing rules.
569 pub fn patch(&self) -> super::builder::autoscalers::Patch {
570 super::builder::autoscalers::Patch::new(self.inner.clone())
571 }
572
573 /// Returns permissions that a caller has on the specified resource.
574 pub fn test_iam_permissions(&self) -> super::builder::autoscalers::TestIamPermissions {
575 super::builder::autoscalers::TestIamPermissions::new(self.inner.clone())
576 }
577
578 /// Updates an autoscaler in the specified project using the data
579 /// included in the request.
580 pub fn update(&self) -> super::builder::autoscalers::Update {
581 super::builder::autoscalers::Update::new(self.inner.clone())
582 }
583
584 /// Retrieves the specified zone-specific Operations resource.
585 pub fn get_operation(&self) -> super::builder::autoscalers::GetOperation {
586 super::builder::autoscalers::GetOperation::new(self.inner.clone())
587 }
588}
589
590/// Implements a client for the Compute Engine API.
591///
592/// # Example
593/// ```
594/// # use google_cloud_compute_v1::client::BackendBuckets;
595/// async fn sample(
596/// ) -> anyhow::Result<()> {
597/// let client = BackendBuckets::builder().build().await?;
598/// // use `client` to make requests to the Compute Engine API.
599/// Ok(())
600/// }
601/// ```
602///
603/// # Service Description
604///
605/// Service for the `backendBuckets` resource.
606///
607/// # Configuration
608///
609/// To configure `BackendBuckets` use the `with_*` methods in the type returned
610/// by [builder()][BackendBuckets::builder]. The default configuration should
611/// work for most applications. Common configuration changes include
612///
613/// * [with_endpoint()]: by default this client uses the global default endpoint
614/// (`https://compute.googleapis.com`). Applications using regional
615/// endpoints or running in restricted networks (e.g. a network configured
616/// with [Private Google Access with VPC Service Controls]) may want to
617/// override this default.
618/// * [with_credentials()]: by default this client uses
619/// [Application Default Credentials]. Applications using custom
620/// authentication may need to override this default.
621///
622/// [with_endpoint()]: super::builder::backend_buckets::ClientBuilder::with_endpoint
623/// [with_credentials()]: super::builder::backend_buckets::ClientBuilder::with_credentials
624/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
625/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
626///
627/// # Pooling and Cloning
628///
629/// `BackendBuckets` holds a connection pool internally, it is advised to
630/// create one and reuse it. You do not need to wrap `BackendBuckets` in
631/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
632/// already uses an `Arc` internally.
633#[cfg(feature = "backend-buckets")]
634#[cfg_attr(docsrs, doc(cfg(feature = "backend-buckets")))]
635#[derive(Clone, Debug)]
636pub struct BackendBuckets {
637 inner: std::sync::Arc<dyn super::stub::dynamic::BackendBuckets>,
638}
639
640#[cfg(feature = "backend-buckets")]
641impl BackendBuckets {
642 /// Returns a builder for [BackendBuckets].
643 ///
644 /// ```
645 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
646 /// # use google_cloud_compute_v1::client::BackendBuckets;
647 /// let client = BackendBuckets::builder().build().await?;
648 /// # Ok(()) }
649 /// ```
650 pub fn builder() -> super::builder::backend_buckets::ClientBuilder {
651 crate::new_client_builder(super::builder::backend_buckets::client::Factory)
652 }
653
654 /// Creates a new client from the provided stub.
655 ///
656 /// The most common case for calling this function is in tests mocking the
657 /// client's behavior.
658 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
659 where
660 T: super::stub::BackendBuckets + 'static,
661 {
662 Self { inner: stub.into() }
663 }
664
665 pub(crate) async fn new(
666 config: gaxi::options::ClientConfig,
667 ) -> crate::ClientBuilderResult<Self> {
668 let inner = Self::build_inner(config).await?;
669 Ok(Self { inner })
670 }
671
672 async fn build_inner(
673 conf: gaxi::options::ClientConfig,
674 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::BackendBuckets>> {
675 if gaxi::options::tracing_enabled(&conf) {
676 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
677 }
678 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
679 }
680
681 async fn build_transport(
682 conf: gaxi::options::ClientConfig,
683 ) -> crate::ClientBuilderResult<impl super::stub::BackendBuckets> {
684 super::transport::BackendBuckets::new(conf).await
685 }
686
687 async fn build_with_tracing(
688 conf: gaxi::options::ClientConfig,
689 ) -> crate::ClientBuilderResult<impl super::stub::BackendBuckets> {
690 Self::build_transport(conf)
691 .await
692 .map(super::tracing::BackendBuckets::new)
693 }
694
695 /// Adds a key for validating requests with signed URLs for this backend
696 /// bucket.
697 pub fn add_signed_url_key(&self) -> super::builder::backend_buckets::AddSignedUrlKey {
698 super::builder::backend_buckets::AddSignedUrlKey::new(self.inner.clone())
699 }
700
701 /// Retrieves the list of all BackendBucket resources, regional and global,
702 /// available to the specified project.
703 ///
704 /// To prevent failure, it is recommended that you set the
705 /// `returnPartialSuccess` parameter to `true`.
706 pub fn aggregated_list(&self) -> super::builder::backend_buckets::AggregatedList {
707 super::builder::backend_buckets::AggregatedList::new(self.inner.clone())
708 }
709
710 /// Deletes the specified BackendBucket resource.
711 pub fn delete(&self) -> super::builder::backend_buckets::Delete {
712 super::builder::backend_buckets::Delete::new(self.inner.clone())
713 }
714
715 /// Deletes a key for validating requests with signed URLs for this backend
716 /// bucket.
717 pub fn delete_signed_url_key(&self) -> super::builder::backend_buckets::DeleteSignedUrlKey {
718 super::builder::backend_buckets::DeleteSignedUrlKey::new(self.inner.clone())
719 }
720
721 /// Returns the specified BackendBucket resource.
722 pub fn get(&self) -> super::builder::backend_buckets::Get {
723 super::builder::backend_buckets::Get::new(self.inner.clone())
724 }
725
726 /// Gets the access control policy for a resource. May be empty if no such
727 /// policy or resource exists.
728 pub fn get_iam_policy(&self) -> super::builder::backend_buckets::GetIamPolicy {
729 super::builder::backend_buckets::GetIamPolicy::new(self.inner.clone())
730 }
731
732 /// Creates a BackendBucket resource in the specified project using
733 /// the data included in the request.
734 pub fn insert(&self) -> super::builder::backend_buckets::Insert {
735 super::builder::backend_buckets::Insert::new(self.inner.clone())
736 }
737
738 /// Retrieves the list of BackendBucket resources available to the specified
739 /// project.
740 pub fn list(&self) -> super::builder::backend_buckets::List {
741 super::builder::backend_buckets::List::new(self.inner.clone())
742 }
743
744 /// Retrieves a list of all usable backend buckets in the specified project.
745 pub fn list_usable(&self) -> super::builder::backend_buckets::ListUsable {
746 super::builder::backend_buckets::ListUsable::new(self.inner.clone())
747 }
748
749 /// Updates the specified BackendBucket resource with the data included in the
750 /// request. This method supportsPATCH
751 /// semantics and uses theJSON merge
752 /// patch format and processing rules.
753 pub fn patch(&self) -> super::builder::backend_buckets::Patch {
754 super::builder::backend_buckets::Patch::new(self.inner.clone())
755 }
756
757 /// Sets the edge security policy for the specified backend bucket.
758 pub fn set_edge_security_policy(
759 &self,
760 ) -> super::builder::backend_buckets::SetEdgeSecurityPolicy {
761 super::builder::backend_buckets::SetEdgeSecurityPolicy::new(self.inner.clone())
762 }
763
764 /// Sets the access control policy on the specified resource.
765 /// Replaces any existing policy.
766 pub fn set_iam_policy(&self) -> super::builder::backend_buckets::SetIamPolicy {
767 super::builder::backend_buckets::SetIamPolicy::new(self.inner.clone())
768 }
769
770 /// Returns permissions that a caller has on the specified resource.
771 pub fn test_iam_permissions(&self) -> super::builder::backend_buckets::TestIamPermissions {
772 super::builder::backend_buckets::TestIamPermissions::new(self.inner.clone())
773 }
774
775 /// Updates the specified BackendBucket resource with the data included in the
776 /// request.
777 pub fn update(&self) -> super::builder::backend_buckets::Update {
778 super::builder::backend_buckets::Update::new(self.inner.clone())
779 }
780
781 /// Retrieves the specified Operations resource.
782 pub fn get_operation(&self) -> super::builder::backend_buckets::GetOperation {
783 super::builder::backend_buckets::GetOperation::new(self.inner.clone())
784 }
785}
786
787/// Implements a client for the Compute Engine API.
788///
789/// # Example
790/// ```
791/// # use google_cloud_compute_v1::client::BackendServices;
792/// async fn sample(
793/// ) -> anyhow::Result<()> {
794/// let client = BackendServices::builder().build().await?;
795/// // use `client` to make requests to the Compute Engine API.
796/// Ok(())
797/// }
798/// ```
799///
800/// # Service Description
801///
802/// Service for the `backendServices` resource.
803///
804/// # Configuration
805///
806/// To configure `BackendServices` use the `with_*` methods in the type returned
807/// by [builder()][BackendServices::builder]. The default configuration should
808/// work for most applications. Common configuration changes include
809///
810/// * [with_endpoint()]: by default this client uses the global default endpoint
811/// (`https://compute.googleapis.com`). Applications using regional
812/// endpoints or running in restricted networks (e.g. a network configured
813/// with [Private Google Access with VPC Service Controls]) may want to
814/// override this default.
815/// * [with_credentials()]: by default this client uses
816/// [Application Default Credentials]. Applications using custom
817/// authentication may need to override this default.
818///
819/// [with_endpoint()]: super::builder::backend_services::ClientBuilder::with_endpoint
820/// [with_credentials()]: super::builder::backend_services::ClientBuilder::with_credentials
821/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
822/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
823///
824/// # Pooling and Cloning
825///
826/// `BackendServices` holds a connection pool internally, it is advised to
827/// create one and reuse it. You do not need to wrap `BackendServices` in
828/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
829/// already uses an `Arc` internally.
830#[cfg(feature = "backend-services")]
831#[cfg_attr(docsrs, doc(cfg(feature = "backend-services")))]
832#[derive(Clone, Debug)]
833pub struct BackendServices {
834 inner: std::sync::Arc<dyn super::stub::dynamic::BackendServices>,
835}
836
837#[cfg(feature = "backend-services")]
838impl BackendServices {
839 /// Returns a builder for [BackendServices].
840 ///
841 /// ```
842 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
843 /// # use google_cloud_compute_v1::client::BackendServices;
844 /// let client = BackendServices::builder().build().await?;
845 /// # Ok(()) }
846 /// ```
847 pub fn builder() -> super::builder::backend_services::ClientBuilder {
848 crate::new_client_builder(super::builder::backend_services::client::Factory)
849 }
850
851 /// Creates a new client from the provided stub.
852 ///
853 /// The most common case for calling this function is in tests mocking the
854 /// client's behavior.
855 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
856 where
857 T: super::stub::BackendServices + 'static,
858 {
859 Self { inner: stub.into() }
860 }
861
862 pub(crate) async fn new(
863 config: gaxi::options::ClientConfig,
864 ) -> crate::ClientBuilderResult<Self> {
865 let inner = Self::build_inner(config).await?;
866 Ok(Self { inner })
867 }
868
869 async fn build_inner(
870 conf: gaxi::options::ClientConfig,
871 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::BackendServices>> {
872 if gaxi::options::tracing_enabled(&conf) {
873 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
874 }
875 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
876 }
877
878 async fn build_transport(
879 conf: gaxi::options::ClientConfig,
880 ) -> crate::ClientBuilderResult<impl super::stub::BackendServices> {
881 super::transport::BackendServices::new(conf).await
882 }
883
884 async fn build_with_tracing(
885 conf: gaxi::options::ClientConfig,
886 ) -> crate::ClientBuilderResult<impl super::stub::BackendServices> {
887 Self::build_transport(conf)
888 .await
889 .map(super::tracing::BackendServices::new)
890 }
891
892 /// Adds a key for validating requests with signed URLs for this backend
893 /// service.
894 pub fn add_signed_url_key(&self) -> super::builder::backend_services::AddSignedUrlKey {
895 super::builder::backend_services::AddSignedUrlKey::new(self.inner.clone())
896 }
897
898 /// Retrieves the list of all BackendService resources, regional and global,
899 /// available to the specified project.
900 ///
901 /// To prevent failure, it is recommended that you set the
902 /// `returnPartialSuccess` parameter to `true`.
903 pub fn aggregated_list(&self) -> super::builder::backend_services::AggregatedList {
904 super::builder::backend_services::AggregatedList::new(self.inner.clone())
905 }
906
907 /// Deletes the specified BackendService resource.
908 pub fn delete(&self) -> super::builder::backend_services::Delete {
909 super::builder::backend_services::Delete::new(self.inner.clone())
910 }
911
912 /// Deletes a key for validating requests with signed URLs for this backend
913 /// service.
914 pub fn delete_signed_url_key(&self) -> super::builder::backend_services::DeleteSignedUrlKey {
915 super::builder::backend_services::DeleteSignedUrlKey::new(self.inner.clone())
916 }
917
918 /// Returns the specified BackendService resource.
919 pub fn get(&self) -> super::builder::backend_services::Get {
920 super::builder::backend_services::Get::new(self.inner.clone())
921 }
922
923 /// Returns effective security policies applied to this backend service.
924 pub fn get_effective_security_policies(
925 &self,
926 ) -> super::builder::backend_services::GetEffectiveSecurityPolicies {
927 super::builder::backend_services::GetEffectiveSecurityPolicies::new(self.inner.clone())
928 }
929
930 /// Gets the most recent health check results for this
931 /// BackendService.
932 ///
933 /// Example request body:
934 ///
935 /// {
936 /// "group": "/zones/us-east1-b/instanceGroups/lb-backend-example"
937 /// }
938 pub fn get_health(&self) -> super::builder::backend_services::GetHealth {
939 super::builder::backend_services::GetHealth::new(self.inner.clone())
940 }
941
942 /// Gets the access control policy for a resource. May be empty if no such
943 /// policy or resource exists.
944 pub fn get_iam_policy(&self) -> super::builder::backend_services::GetIamPolicy {
945 super::builder::backend_services::GetIamPolicy::new(self.inner.clone())
946 }
947
948 /// Creates a BackendService resource in the specified project using
949 /// the data included in the request. For more information, see
950 /// Backend services overview.
951 pub fn insert(&self) -> super::builder::backend_services::Insert {
952 super::builder::backend_services::Insert::new(self.inner.clone())
953 }
954
955 /// Retrieves the list of BackendService resources available to the specified
956 /// project.
957 pub fn list(&self) -> super::builder::backend_services::List {
958 super::builder::backend_services::List::new(self.inner.clone())
959 }
960
961 /// Retrieves a list of all usable backend services for Application Load
962 /// Balancers and Proxy Network Load Balancers in the specified project.
963 /// Backend services for external and internal passthrough Network Load
964 /// Balancers are not included in the response.
965 pub fn list_usable(&self) -> super::builder::backend_services::ListUsable {
966 super::builder::backend_services::ListUsable::new(self.inner.clone())
967 }
968
969 /// Patches the specified BackendService resource with the data included in the
970 /// request. For more information, see
971 /// Backend services overview. This method
972 /// supports PATCH semantics and uses the JSON merge
973 /// patch format and processing rules.
974 pub fn patch(&self) -> super::builder::backend_services::Patch {
975 super::builder::backend_services::Patch::new(self.inner.clone())
976 }
977
978 /// Sets the edge security policy for the specified backend service.
979 pub fn set_edge_security_policy(
980 &self,
981 ) -> super::builder::backend_services::SetEdgeSecurityPolicy {
982 super::builder::backend_services::SetEdgeSecurityPolicy::new(self.inner.clone())
983 }
984
985 /// Sets the access control policy on the specified resource.
986 /// Replaces any existing policy.
987 pub fn set_iam_policy(&self) -> super::builder::backend_services::SetIamPolicy {
988 super::builder::backend_services::SetIamPolicy::new(self.inner.clone())
989 }
990
991 /// Sets the Google Cloud Armor security policy for the specified backend
992 /// service. For more information, seeGoogle
993 /// Cloud Armor Overview
994 pub fn set_security_policy(&self) -> super::builder::backend_services::SetSecurityPolicy {
995 super::builder::backend_services::SetSecurityPolicy::new(self.inner.clone())
996 }
997
998 /// Returns permissions that a caller has on the specified resource.
999 pub fn test_iam_permissions(&self) -> super::builder::backend_services::TestIamPermissions {
1000 super::builder::backend_services::TestIamPermissions::new(self.inner.clone())
1001 }
1002
1003 /// Updates the specified BackendService resource with the data included in the
1004 /// request. For more information, seeBackend
1005 /// services overview.
1006 pub fn update(&self) -> super::builder::backend_services::Update {
1007 super::builder::backend_services::Update::new(self.inner.clone())
1008 }
1009
1010 /// Retrieves the specified Operations resource.
1011 pub fn get_operation(&self) -> super::builder::backend_services::GetOperation {
1012 super::builder::backend_services::GetOperation::new(self.inner.clone())
1013 }
1014}
1015
1016/// Implements a client for the Compute Engine API.
1017///
1018/// # Example
1019/// ```
1020/// # use google_cloud_compute_v1::client::CrossSiteNetworks;
1021/// async fn sample(
1022/// ) -> anyhow::Result<()> {
1023/// let client = CrossSiteNetworks::builder().build().await?;
1024/// // use `client` to make requests to the Compute Engine API.
1025/// Ok(())
1026/// }
1027/// ```
1028///
1029/// # Service Description
1030///
1031/// Service for the `crossSiteNetworks` resource.
1032///
1033/// # Configuration
1034///
1035/// To configure `CrossSiteNetworks` use the `with_*` methods in the type returned
1036/// by [builder()][CrossSiteNetworks::builder]. The default configuration should
1037/// work for most applications. Common configuration changes include
1038///
1039/// * [with_endpoint()]: by default this client uses the global default endpoint
1040/// (`https://compute.googleapis.com`). Applications using regional
1041/// endpoints or running in restricted networks (e.g. a network configured
1042/// with [Private Google Access with VPC Service Controls]) may want to
1043/// override this default.
1044/// * [with_credentials()]: by default this client uses
1045/// [Application Default Credentials]. Applications using custom
1046/// authentication may need to override this default.
1047///
1048/// [with_endpoint()]: super::builder::cross_site_networks::ClientBuilder::with_endpoint
1049/// [with_credentials()]: super::builder::cross_site_networks::ClientBuilder::with_credentials
1050/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1051/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1052///
1053/// # Pooling and Cloning
1054///
1055/// `CrossSiteNetworks` holds a connection pool internally, it is advised to
1056/// create one and reuse it. You do not need to wrap `CrossSiteNetworks` in
1057/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1058/// already uses an `Arc` internally.
1059#[cfg(feature = "cross-site-networks")]
1060#[cfg_attr(docsrs, doc(cfg(feature = "cross-site-networks")))]
1061#[derive(Clone, Debug)]
1062pub struct CrossSiteNetworks {
1063 inner: std::sync::Arc<dyn super::stub::dynamic::CrossSiteNetworks>,
1064}
1065
1066#[cfg(feature = "cross-site-networks")]
1067impl CrossSiteNetworks {
1068 /// Returns a builder for [CrossSiteNetworks].
1069 ///
1070 /// ```
1071 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1072 /// # use google_cloud_compute_v1::client::CrossSiteNetworks;
1073 /// let client = CrossSiteNetworks::builder().build().await?;
1074 /// # Ok(()) }
1075 /// ```
1076 pub fn builder() -> super::builder::cross_site_networks::ClientBuilder {
1077 crate::new_client_builder(super::builder::cross_site_networks::client::Factory)
1078 }
1079
1080 /// Creates a new client from the provided stub.
1081 ///
1082 /// The most common case for calling this function is in tests mocking the
1083 /// client's behavior.
1084 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
1085 where
1086 T: super::stub::CrossSiteNetworks + 'static,
1087 {
1088 Self { inner: stub.into() }
1089 }
1090
1091 pub(crate) async fn new(
1092 config: gaxi::options::ClientConfig,
1093 ) -> crate::ClientBuilderResult<Self> {
1094 let inner = Self::build_inner(config).await?;
1095 Ok(Self { inner })
1096 }
1097
1098 async fn build_inner(
1099 conf: gaxi::options::ClientConfig,
1100 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::CrossSiteNetworks>>
1101 {
1102 if gaxi::options::tracing_enabled(&conf) {
1103 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1104 }
1105 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1106 }
1107
1108 async fn build_transport(
1109 conf: gaxi::options::ClientConfig,
1110 ) -> crate::ClientBuilderResult<impl super::stub::CrossSiteNetworks> {
1111 super::transport::CrossSiteNetworks::new(conf).await
1112 }
1113
1114 async fn build_with_tracing(
1115 conf: gaxi::options::ClientConfig,
1116 ) -> crate::ClientBuilderResult<impl super::stub::CrossSiteNetworks> {
1117 Self::build_transport(conf)
1118 .await
1119 .map(super::tracing::CrossSiteNetworks::new)
1120 }
1121
1122 /// Deletes the specified cross-site network in the given scope.
1123 pub fn delete(&self) -> super::builder::cross_site_networks::Delete {
1124 super::builder::cross_site_networks::Delete::new(self.inner.clone())
1125 }
1126
1127 /// Returns the specified cross-site network in the given scope.
1128 pub fn get(&self) -> super::builder::cross_site_networks::Get {
1129 super::builder::cross_site_networks::Get::new(self.inner.clone())
1130 }
1131
1132 /// Creates a cross-site network in the specified project in the given scope
1133 /// using the parameters that are included in the request.
1134 pub fn insert(&self) -> super::builder::cross_site_networks::Insert {
1135 super::builder::cross_site_networks::Insert::new(self.inner.clone())
1136 }
1137
1138 /// Lists the cross-site networks for a project in the given scope.
1139 pub fn list(&self) -> super::builder::cross_site_networks::List {
1140 super::builder::cross_site_networks::List::new(self.inner.clone())
1141 }
1142
1143 /// Updates the specified cross-site network with the data included in
1144 /// the request. This method supportsPATCH
1145 /// semantics and uses theJSON merge
1146 /// patch format and processing rules.
1147 pub fn patch(&self) -> super::builder::cross_site_networks::Patch {
1148 super::builder::cross_site_networks::Patch::new(self.inner.clone())
1149 }
1150
1151 /// Retrieves the specified Operations resource.
1152 pub fn get_operation(&self) -> super::builder::cross_site_networks::GetOperation {
1153 super::builder::cross_site_networks::GetOperation::new(self.inner.clone())
1154 }
1155}
1156
1157/// Implements a client for the Compute Engine API.
1158///
1159/// # Example
1160/// ```
1161/// # use google_cloud_compute_v1::client::DiskTypes;
1162/// async fn sample(
1163/// ) -> anyhow::Result<()> {
1164/// let client = DiskTypes::builder().build().await?;
1165/// // use `client` to make requests to the Compute Engine API.
1166/// Ok(())
1167/// }
1168/// ```
1169///
1170/// # Service Description
1171///
1172/// Service for the `diskTypes` resource.
1173///
1174/// # Configuration
1175///
1176/// To configure `DiskTypes` use the `with_*` methods in the type returned
1177/// by [builder()][DiskTypes::builder]. The default configuration should
1178/// work for most applications. Common configuration changes include
1179///
1180/// * [with_endpoint()]: by default this client uses the global default endpoint
1181/// (`https://compute.googleapis.com`). Applications using regional
1182/// endpoints or running in restricted networks (e.g. a network configured
1183/// with [Private Google Access with VPC Service Controls]) may want to
1184/// override this default.
1185/// * [with_credentials()]: by default this client uses
1186/// [Application Default Credentials]. Applications using custom
1187/// authentication may need to override this default.
1188///
1189/// [with_endpoint()]: super::builder::disk_types::ClientBuilder::with_endpoint
1190/// [with_credentials()]: super::builder::disk_types::ClientBuilder::with_credentials
1191/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1192/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1193///
1194/// # Pooling and Cloning
1195///
1196/// `DiskTypes` holds a connection pool internally, it is advised to
1197/// create one and reuse it. You do not need to wrap `DiskTypes` in
1198/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1199/// already uses an `Arc` internally.
1200#[cfg(feature = "disk-types")]
1201#[cfg_attr(docsrs, doc(cfg(feature = "disk-types")))]
1202#[derive(Clone, Debug)]
1203pub struct DiskTypes {
1204 inner: std::sync::Arc<dyn super::stub::dynamic::DiskTypes>,
1205}
1206
1207#[cfg(feature = "disk-types")]
1208impl DiskTypes {
1209 /// Returns a builder for [DiskTypes].
1210 ///
1211 /// ```
1212 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1213 /// # use google_cloud_compute_v1::client::DiskTypes;
1214 /// let client = DiskTypes::builder().build().await?;
1215 /// # Ok(()) }
1216 /// ```
1217 pub fn builder() -> super::builder::disk_types::ClientBuilder {
1218 crate::new_client_builder(super::builder::disk_types::client::Factory)
1219 }
1220
1221 /// Creates a new client from the provided stub.
1222 ///
1223 /// The most common case for calling this function is in tests mocking the
1224 /// client's behavior.
1225 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
1226 where
1227 T: super::stub::DiskTypes + 'static,
1228 {
1229 Self { inner: stub.into() }
1230 }
1231
1232 pub(crate) async fn new(
1233 config: gaxi::options::ClientConfig,
1234 ) -> crate::ClientBuilderResult<Self> {
1235 let inner = Self::build_inner(config).await?;
1236 Ok(Self { inner })
1237 }
1238
1239 async fn build_inner(
1240 conf: gaxi::options::ClientConfig,
1241 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::DiskTypes>> {
1242 if gaxi::options::tracing_enabled(&conf) {
1243 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1244 }
1245 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1246 }
1247
1248 async fn build_transport(
1249 conf: gaxi::options::ClientConfig,
1250 ) -> crate::ClientBuilderResult<impl super::stub::DiskTypes> {
1251 super::transport::DiskTypes::new(conf).await
1252 }
1253
1254 async fn build_with_tracing(
1255 conf: gaxi::options::ClientConfig,
1256 ) -> crate::ClientBuilderResult<impl super::stub::DiskTypes> {
1257 Self::build_transport(conf)
1258 .await
1259 .map(super::tracing::DiskTypes::new)
1260 }
1261
1262 /// Retrieves an aggregated list of disk types.
1263 ///
1264 /// To prevent failure, it is recommended that you set the
1265 /// `returnPartialSuccess` parameter to `true`.
1266 pub fn aggregated_list(&self) -> super::builder::disk_types::AggregatedList {
1267 super::builder::disk_types::AggregatedList::new(self.inner.clone())
1268 }
1269
1270 /// Returns the specified disk type.
1271 pub fn get(&self) -> super::builder::disk_types::Get {
1272 super::builder::disk_types::Get::new(self.inner.clone())
1273 }
1274
1275 /// Retrieves a list of disk types available to the specified
1276 /// project.
1277 pub fn list(&self) -> super::builder::disk_types::List {
1278 super::builder::disk_types::List::new(self.inner.clone())
1279 }
1280}
1281
1282/// Implements a client for the Compute Engine API.
1283///
1284/// # Example
1285/// ```
1286/// # use google_cloud_compute_v1::client::Disks;
1287/// async fn sample(
1288/// ) -> anyhow::Result<()> {
1289/// let client = Disks::builder().build().await?;
1290/// // use `client` to make requests to the Compute Engine API.
1291/// Ok(())
1292/// }
1293/// ```
1294///
1295/// # Service Description
1296///
1297/// Service for the `disks` resource.
1298///
1299/// # Configuration
1300///
1301/// To configure `Disks` use the `with_*` methods in the type returned
1302/// by [builder()][Disks::builder]. The default configuration should
1303/// work for most applications. Common configuration changes include
1304///
1305/// * [with_endpoint()]: by default this client uses the global default endpoint
1306/// (`https://compute.googleapis.com`). Applications using regional
1307/// endpoints or running in restricted networks (e.g. a network configured
1308/// with [Private Google Access with VPC Service Controls]) may want to
1309/// override this default.
1310/// * [with_credentials()]: by default this client uses
1311/// [Application Default Credentials]. Applications using custom
1312/// authentication may need to override this default.
1313///
1314/// [with_endpoint()]: super::builder::disks::ClientBuilder::with_endpoint
1315/// [with_credentials()]: super::builder::disks::ClientBuilder::with_credentials
1316/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1317/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1318///
1319/// # Pooling and Cloning
1320///
1321/// `Disks` holds a connection pool internally, it is advised to
1322/// create one and reuse it. You do not need to wrap `Disks` in
1323/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1324/// already uses an `Arc` internally.
1325#[cfg(feature = "disks")]
1326#[cfg_attr(docsrs, doc(cfg(feature = "disks")))]
1327#[derive(Clone, Debug)]
1328pub struct Disks {
1329 inner: std::sync::Arc<dyn super::stub::dynamic::Disks>,
1330}
1331
1332#[cfg(feature = "disks")]
1333impl Disks {
1334 /// Returns a builder for [Disks].
1335 ///
1336 /// ```
1337 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1338 /// # use google_cloud_compute_v1::client::Disks;
1339 /// let client = Disks::builder().build().await?;
1340 /// # Ok(()) }
1341 /// ```
1342 pub fn builder() -> super::builder::disks::ClientBuilder {
1343 crate::new_client_builder(super::builder::disks::client::Factory)
1344 }
1345
1346 /// Creates a new client from the provided stub.
1347 ///
1348 /// The most common case for calling this function is in tests mocking the
1349 /// client's behavior.
1350 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
1351 where
1352 T: super::stub::Disks + 'static,
1353 {
1354 Self { inner: stub.into() }
1355 }
1356
1357 pub(crate) async fn new(
1358 config: gaxi::options::ClientConfig,
1359 ) -> crate::ClientBuilderResult<Self> {
1360 let inner = Self::build_inner(config).await?;
1361 Ok(Self { inner })
1362 }
1363
1364 async fn build_inner(
1365 conf: gaxi::options::ClientConfig,
1366 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Disks>> {
1367 if gaxi::options::tracing_enabled(&conf) {
1368 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1369 }
1370 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1371 }
1372
1373 async fn build_transport(
1374 conf: gaxi::options::ClientConfig,
1375 ) -> crate::ClientBuilderResult<impl super::stub::Disks> {
1376 super::transport::Disks::new(conf).await
1377 }
1378
1379 async fn build_with_tracing(
1380 conf: gaxi::options::ClientConfig,
1381 ) -> crate::ClientBuilderResult<impl super::stub::Disks> {
1382 Self::build_transport(conf)
1383 .await
1384 .map(super::tracing::Disks::new)
1385 }
1386
1387 /// Adds existing resource policies to a disk. You can only add one
1388 /// policy which will be applied to this disk for scheduling snapshot
1389 /// creation.
1390 pub fn add_resource_policies(&self) -> super::builder::disks::AddResourcePolicies {
1391 super::builder::disks::AddResourcePolicies::new(self.inner.clone())
1392 }
1393
1394 /// Retrieves an aggregated list of persistent disks.
1395 ///
1396 /// To prevent failure, it is recommended that you set the
1397 /// `returnPartialSuccess` parameter to `true`.
1398 pub fn aggregated_list(&self) -> super::builder::disks::AggregatedList {
1399 super::builder::disks::AggregatedList::new(self.inner.clone())
1400 }
1401
1402 /// Bulk create a set of disks.
1403 pub fn bulk_insert(&self) -> super::builder::disks::BulkInsert {
1404 super::builder::disks::BulkInsert::new(self.inner.clone())
1405 }
1406
1407 /// Sets the labels on many disks at once. To learn more about labels, read theLabeling
1408 /// Resources documentation.
1409 pub fn bulk_set_labels(&self) -> super::builder::disks::BulkSetLabels {
1410 super::builder::disks::BulkSetLabels::new(self.inner.clone())
1411 }
1412
1413 /// Creates a snapshot of a specified persistent disk. For regular snapshot
1414 /// creation, consider using snapshots.insert
1415 /// instead, as that method supports more features, such as creating snapshots
1416 /// in a project different from the source disk project.
1417 pub fn create_snapshot(&self) -> super::builder::disks::CreateSnapshot {
1418 super::builder::disks::CreateSnapshot::new(self.inner.clone())
1419 }
1420
1421 /// Deletes the specified persistent disk. Deleting a disk removes its data
1422 /// permanently and is irreversible. However, deleting a disk does not
1423 /// delete any snapshots
1424 /// previously made from the disk. You must separatelydelete
1425 /// snapshots.
1426 pub fn delete(&self) -> super::builder::disks::Delete {
1427 super::builder::disks::Delete::new(self.inner.clone())
1428 }
1429
1430 /// Returns the specified persistent disk.
1431 pub fn get(&self) -> super::builder::disks::Get {
1432 super::builder::disks::Get::new(self.inner.clone())
1433 }
1434
1435 /// Gets the access control policy for a resource. May be empty if no such
1436 /// policy or resource exists.
1437 pub fn get_iam_policy(&self) -> super::builder::disks::GetIamPolicy {
1438 super::builder::disks::GetIamPolicy::new(self.inner.clone())
1439 }
1440
1441 /// Creates a persistent disk in the specified project using the data
1442 /// in the request. You can create a disk from a source
1443 /// (sourceImage, sourceSnapshot, orsourceDisk) or create an empty 500 GB data disk by
1444 /// omitting all properties. You can also create a disk that is larger than
1445 /// the default size by specifying the sizeGb property.
1446 pub fn insert(&self) -> super::builder::disks::Insert {
1447 super::builder::disks::Insert::new(self.inner.clone())
1448 }
1449
1450 /// Retrieves a list of persistent disks contained within
1451 /// the specified zone.
1452 pub fn list(&self) -> super::builder::disks::List {
1453 super::builder::disks::List::new(self.inner.clone())
1454 }
1455
1456 /// Removes resource policies from a disk.
1457 pub fn remove_resource_policies(&self) -> super::builder::disks::RemoveResourcePolicies {
1458 super::builder::disks::RemoveResourcePolicies::new(self.inner.clone())
1459 }
1460
1461 /// Resizes the specified persistent disk.
1462 /// You can only increase the size of the disk.
1463 pub fn resize(&self) -> super::builder::disks::Resize {
1464 super::builder::disks::Resize::new(self.inner.clone())
1465 }
1466
1467 /// Sets the access control policy on the specified resource.
1468 /// Replaces any existing policy.
1469 pub fn set_iam_policy(&self) -> super::builder::disks::SetIamPolicy {
1470 super::builder::disks::SetIamPolicy::new(self.inner.clone())
1471 }
1472
1473 /// Sets the labels on a disk. To learn more about labels, read theLabeling
1474 /// Resources documentation.
1475 pub fn set_labels(&self) -> super::builder::disks::SetLabels {
1476 super::builder::disks::SetLabels::new(self.inner.clone())
1477 }
1478
1479 /// Starts asynchronous replication.
1480 /// Must be invoked on the primary disk.
1481 pub fn start_async_replication(&self) -> super::builder::disks::StartAsyncReplication {
1482 super::builder::disks::StartAsyncReplication::new(self.inner.clone())
1483 }
1484
1485 /// Stops asynchronous replication.
1486 /// Can be invoked either on the primary or on the secondary disk.
1487 pub fn stop_async_replication(&self) -> super::builder::disks::StopAsyncReplication {
1488 super::builder::disks::StopAsyncReplication::new(self.inner.clone())
1489 }
1490
1491 /// Stops asynchronous replication for a consistency group of disks.
1492 /// Can be invoked either in the primary or secondary scope.
1493 pub fn stop_group_async_replication(&self) -> super::builder::disks::StopGroupAsyncReplication {
1494 super::builder::disks::StopGroupAsyncReplication::new(self.inner.clone())
1495 }
1496
1497 /// Returns permissions that a caller has on the specified resource.
1498 pub fn test_iam_permissions(&self) -> super::builder::disks::TestIamPermissions {
1499 super::builder::disks::TestIamPermissions::new(self.inner.clone())
1500 }
1501
1502 /// Updates the specified disk with the data included in the request.
1503 /// The update is performed only on selected fields included as part
1504 /// of update-mask.
1505 pub fn update(&self) -> super::builder::disks::Update {
1506 super::builder::disks::Update::new(self.inner.clone())
1507 }
1508
1509 /// Rotates the customer-managed
1510 /// encryption key to the latest version for the specified persistent disk.
1511 pub fn update_kms_key(&self) -> super::builder::disks::UpdateKmsKey {
1512 super::builder::disks::UpdateKmsKey::new(self.inner.clone())
1513 }
1514
1515 /// Retrieves the specified zone-specific Operations resource.
1516 pub fn get_operation(&self) -> super::builder::disks::GetOperation {
1517 super::builder::disks::GetOperation::new(self.inner.clone())
1518 }
1519}
1520
1521/// Implements a client for the Compute Engine API.
1522///
1523/// # Example
1524/// ```
1525/// # use google_cloud_compute_v1::client::ExternalVpnGateways;
1526/// async fn sample(
1527/// ) -> anyhow::Result<()> {
1528/// let client = ExternalVpnGateways::builder().build().await?;
1529/// // use `client` to make requests to the Compute Engine API.
1530/// Ok(())
1531/// }
1532/// ```
1533///
1534/// # Service Description
1535///
1536/// Service for the `externalVpnGateways` resource.
1537///
1538/// # Configuration
1539///
1540/// To configure `ExternalVpnGateways` use the `with_*` methods in the type returned
1541/// by [builder()][ExternalVpnGateways::builder]. The default configuration should
1542/// work for most applications. Common configuration changes include
1543///
1544/// * [with_endpoint()]: by default this client uses the global default endpoint
1545/// (`https://compute.googleapis.com`). Applications using regional
1546/// endpoints or running in restricted networks (e.g. a network configured
1547/// with [Private Google Access with VPC Service Controls]) may want to
1548/// override this default.
1549/// * [with_credentials()]: by default this client uses
1550/// [Application Default Credentials]. Applications using custom
1551/// authentication may need to override this default.
1552///
1553/// [with_endpoint()]: super::builder::external_vpn_gateways::ClientBuilder::with_endpoint
1554/// [with_credentials()]: super::builder::external_vpn_gateways::ClientBuilder::with_credentials
1555/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1556/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1557///
1558/// # Pooling and Cloning
1559///
1560/// `ExternalVpnGateways` holds a connection pool internally, it is advised to
1561/// create one and reuse it. You do not need to wrap `ExternalVpnGateways` in
1562/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1563/// already uses an `Arc` internally.
1564#[cfg(feature = "external-vpn-gateways")]
1565#[cfg_attr(docsrs, doc(cfg(feature = "external-vpn-gateways")))]
1566#[derive(Clone, Debug)]
1567pub struct ExternalVpnGateways {
1568 inner: std::sync::Arc<dyn super::stub::dynamic::ExternalVpnGateways>,
1569}
1570
1571#[cfg(feature = "external-vpn-gateways")]
1572impl ExternalVpnGateways {
1573 /// Returns a builder for [ExternalVpnGateways].
1574 ///
1575 /// ```
1576 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1577 /// # use google_cloud_compute_v1::client::ExternalVpnGateways;
1578 /// let client = ExternalVpnGateways::builder().build().await?;
1579 /// # Ok(()) }
1580 /// ```
1581 pub fn builder() -> super::builder::external_vpn_gateways::ClientBuilder {
1582 crate::new_client_builder(super::builder::external_vpn_gateways::client::Factory)
1583 }
1584
1585 /// Creates a new client from the provided stub.
1586 ///
1587 /// The most common case for calling this function is in tests mocking the
1588 /// client's behavior.
1589 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
1590 where
1591 T: super::stub::ExternalVpnGateways + 'static,
1592 {
1593 Self { inner: stub.into() }
1594 }
1595
1596 pub(crate) async fn new(
1597 config: gaxi::options::ClientConfig,
1598 ) -> crate::ClientBuilderResult<Self> {
1599 let inner = Self::build_inner(config).await?;
1600 Ok(Self { inner })
1601 }
1602
1603 async fn build_inner(
1604 conf: gaxi::options::ClientConfig,
1605 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ExternalVpnGateways>>
1606 {
1607 if gaxi::options::tracing_enabled(&conf) {
1608 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1609 }
1610 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1611 }
1612
1613 async fn build_transport(
1614 conf: gaxi::options::ClientConfig,
1615 ) -> crate::ClientBuilderResult<impl super::stub::ExternalVpnGateways> {
1616 super::transport::ExternalVpnGateways::new(conf).await
1617 }
1618
1619 async fn build_with_tracing(
1620 conf: gaxi::options::ClientConfig,
1621 ) -> crate::ClientBuilderResult<impl super::stub::ExternalVpnGateways> {
1622 Self::build_transport(conf)
1623 .await
1624 .map(super::tracing::ExternalVpnGateways::new)
1625 }
1626
1627 /// Deletes the specified externalVpnGateway.
1628 pub fn delete(&self) -> super::builder::external_vpn_gateways::Delete {
1629 super::builder::external_vpn_gateways::Delete::new(self.inner.clone())
1630 }
1631
1632 /// Returns the specified externalVpnGateway. Get a list of available
1633 /// externalVpnGateways by making a list() request.
1634 pub fn get(&self) -> super::builder::external_vpn_gateways::Get {
1635 super::builder::external_vpn_gateways::Get::new(self.inner.clone())
1636 }
1637
1638 /// Creates a ExternalVpnGateway in the specified project using
1639 /// the data included in the request.
1640 pub fn insert(&self) -> super::builder::external_vpn_gateways::Insert {
1641 super::builder::external_vpn_gateways::Insert::new(self.inner.clone())
1642 }
1643
1644 /// Retrieves the list of ExternalVpnGateway available to the specified
1645 /// project.
1646 pub fn list(&self) -> super::builder::external_vpn_gateways::List {
1647 super::builder::external_vpn_gateways::List::new(self.inner.clone())
1648 }
1649
1650 /// Sets the labels on an ExternalVpnGateway. To learn more about labels,
1651 /// read the Labeling
1652 /// Resources documentation.
1653 pub fn set_labels(&self) -> super::builder::external_vpn_gateways::SetLabels {
1654 super::builder::external_vpn_gateways::SetLabels::new(self.inner.clone())
1655 }
1656
1657 /// Returns permissions that a caller has on the specified resource.
1658 pub fn test_iam_permissions(
1659 &self,
1660 ) -> super::builder::external_vpn_gateways::TestIamPermissions {
1661 super::builder::external_vpn_gateways::TestIamPermissions::new(self.inner.clone())
1662 }
1663
1664 /// Retrieves the specified Operations resource.
1665 pub fn get_operation(&self) -> super::builder::external_vpn_gateways::GetOperation {
1666 super::builder::external_vpn_gateways::GetOperation::new(self.inner.clone())
1667 }
1668}
1669
1670/// Implements a client for the Compute Engine API.
1671///
1672/// # Example
1673/// ```
1674/// # use google_cloud_compute_v1::client::FirewallPolicies;
1675/// async fn sample(
1676/// ) -> anyhow::Result<()> {
1677/// let client = FirewallPolicies::builder().build().await?;
1678/// // use `client` to make requests to the Compute Engine API.
1679/// Ok(())
1680/// }
1681/// ```
1682///
1683/// # Service Description
1684///
1685/// Service for the `firewallPolicies` resource.
1686///
1687/// # Configuration
1688///
1689/// To configure `FirewallPolicies` use the `with_*` methods in the type returned
1690/// by [builder()][FirewallPolicies::builder]. The default configuration should
1691/// work for most applications. Common configuration changes include
1692///
1693/// * [with_endpoint()]: by default this client uses the global default endpoint
1694/// (`https://compute.googleapis.com`). Applications using regional
1695/// endpoints or running in restricted networks (e.g. a network configured
1696/// with [Private Google Access with VPC Service Controls]) may want to
1697/// override this default.
1698/// * [with_credentials()]: by default this client uses
1699/// [Application Default Credentials]. Applications using custom
1700/// authentication may need to override this default.
1701///
1702/// [with_endpoint()]: super::builder::firewall_policies::ClientBuilder::with_endpoint
1703/// [with_credentials()]: super::builder::firewall_policies::ClientBuilder::with_credentials
1704/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1705/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1706///
1707/// # Pooling and Cloning
1708///
1709/// `FirewallPolicies` holds a connection pool internally, it is advised to
1710/// create one and reuse it. You do not need to wrap `FirewallPolicies` in
1711/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1712/// already uses an `Arc` internally.
1713#[cfg(feature = "firewall-policies")]
1714#[cfg_attr(docsrs, doc(cfg(feature = "firewall-policies")))]
1715#[derive(Clone, Debug)]
1716pub struct FirewallPolicies {
1717 inner: std::sync::Arc<dyn super::stub::dynamic::FirewallPolicies>,
1718}
1719
1720#[cfg(feature = "firewall-policies")]
1721impl FirewallPolicies {
1722 /// Returns a builder for [FirewallPolicies].
1723 ///
1724 /// ```
1725 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1726 /// # use google_cloud_compute_v1::client::FirewallPolicies;
1727 /// let client = FirewallPolicies::builder().build().await?;
1728 /// # Ok(()) }
1729 /// ```
1730 pub fn builder() -> super::builder::firewall_policies::ClientBuilder {
1731 crate::new_client_builder(super::builder::firewall_policies::client::Factory)
1732 }
1733
1734 /// Creates a new client from the provided stub.
1735 ///
1736 /// The most common case for calling this function is in tests mocking the
1737 /// client's behavior.
1738 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
1739 where
1740 T: super::stub::FirewallPolicies + 'static,
1741 {
1742 Self { inner: stub.into() }
1743 }
1744
1745 pub(crate) async fn new(
1746 config: gaxi::options::ClientConfig,
1747 ) -> crate::ClientBuilderResult<Self> {
1748 let inner = Self::build_inner(config).await?;
1749 Ok(Self { inner })
1750 }
1751
1752 async fn build_inner(
1753 conf: gaxi::options::ClientConfig,
1754 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::FirewallPolicies>>
1755 {
1756 if gaxi::options::tracing_enabled(&conf) {
1757 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1758 }
1759 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1760 }
1761
1762 async fn build_transport(
1763 conf: gaxi::options::ClientConfig,
1764 ) -> crate::ClientBuilderResult<impl super::stub::FirewallPolicies> {
1765 super::transport::FirewallPolicies::new(conf).await
1766 }
1767
1768 async fn build_with_tracing(
1769 conf: gaxi::options::ClientConfig,
1770 ) -> crate::ClientBuilderResult<impl super::stub::FirewallPolicies> {
1771 Self::build_transport(conf)
1772 .await
1773 .map(super::tracing::FirewallPolicies::new)
1774 }
1775
1776 /// Inserts an association for the specified firewall policy.
1777 pub fn add_association(&self) -> super::builder::firewall_policies::AddAssociation {
1778 super::builder::firewall_policies::AddAssociation::new(self.inner.clone())
1779 }
1780
1781 /// Inserts a rule into a firewall policy.
1782 pub fn add_rule(&self) -> super::builder::firewall_policies::AddRule {
1783 super::builder::firewall_policies::AddRule::new(self.inner.clone())
1784 }
1785
1786 /// Copies rules to the specified firewall policy.
1787 pub fn clone_rules(&self) -> super::builder::firewall_policies::CloneRules {
1788 super::builder::firewall_policies::CloneRules::new(self.inner.clone())
1789 }
1790
1791 /// Deletes the specified policy.
1792 pub fn delete(&self) -> super::builder::firewall_policies::Delete {
1793 super::builder::firewall_policies::Delete::new(self.inner.clone())
1794 }
1795
1796 /// Returns the specified firewall policy.
1797 pub fn get(&self) -> super::builder::firewall_policies::Get {
1798 super::builder::firewall_policies::Get::new(self.inner.clone())
1799 }
1800
1801 /// Gets an association with the specified name.
1802 pub fn get_association(&self) -> super::builder::firewall_policies::GetAssociation {
1803 super::builder::firewall_policies::GetAssociation::new(self.inner.clone())
1804 }
1805
1806 /// Gets the access control policy for a resource. May be empty if no such
1807 /// policy or resource exists.
1808 pub fn get_iam_policy(&self) -> super::builder::firewall_policies::GetIamPolicy {
1809 super::builder::firewall_policies::GetIamPolicy::new(self.inner.clone())
1810 }
1811
1812 /// Gets a rule of the specified priority.
1813 pub fn get_rule(&self) -> super::builder::firewall_policies::GetRule {
1814 super::builder::firewall_policies::GetRule::new(self.inner.clone())
1815 }
1816
1817 /// Creates a new policy in the specified project using the data included in
1818 /// the request.
1819 pub fn insert(&self) -> super::builder::firewall_policies::Insert {
1820 super::builder::firewall_policies::Insert::new(self.inner.clone())
1821 }
1822
1823 /// Lists all the policies that have been configured for the specified
1824 /// folder or organization.
1825 pub fn list(&self) -> super::builder::firewall_policies::List {
1826 super::builder::firewall_policies::List::new(self.inner.clone())
1827 }
1828
1829 /// Lists associations of a specified target, i.e., organization or folder.
1830 pub fn list_associations(&self) -> super::builder::firewall_policies::ListAssociations {
1831 super::builder::firewall_policies::ListAssociations::new(self.inner.clone())
1832 }
1833
1834 /// Moves the specified firewall policy.
1835 pub fn r#move(&self) -> super::builder::firewall_policies::Move {
1836 super::builder::firewall_policies::Move::new(self.inner.clone())
1837 }
1838
1839 /// Patches the specified policy with the data included in the request.
1840 pub fn patch(&self) -> super::builder::firewall_policies::Patch {
1841 super::builder::firewall_policies::Patch::new(self.inner.clone())
1842 }
1843
1844 /// Patches a rule of the specified priority.
1845 pub fn patch_rule(&self) -> super::builder::firewall_policies::PatchRule {
1846 super::builder::firewall_policies::PatchRule::new(self.inner.clone())
1847 }
1848
1849 /// Removes an association for the specified firewall policy.
1850 pub fn remove_association(&self) -> super::builder::firewall_policies::RemoveAssociation {
1851 super::builder::firewall_policies::RemoveAssociation::new(self.inner.clone())
1852 }
1853
1854 /// Deletes a rule of the specified priority.
1855 pub fn remove_rule(&self) -> super::builder::firewall_policies::RemoveRule {
1856 super::builder::firewall_policies::RemoveRule::new(self.inner.clone())
1857 }
1858
1859 /// Sets the access control policy on the specified resource.
1860 /// Replaces any existing policy.
1861 pub fn set_iam_policy(&self) -> super::builder::firewall_policies::SetIamPolicy {
1862 super::builder::firewall_policies::SetIamPolicy::new(self.inner.clone())
1863 }
1864
1865 /// Returns permissions that a caller has on the specified resource.
1866 pub fn test_iam_permissions(&self) -> super::builder::firewall_policies::TestIamPermissions {
1867 super::builder::firewall_policies::TestIamPermissions::new(self.inner.clone())
1868 }
1869
1870 /// Retrieves the specified Operations resource. Gets a list of operations
1871 /// by making a `list()` request.
1872 pub fn get_operation(&self) -> super::builder::firewall_policies::GetOperation {
1873 super::builder::firewall_policies::GetOperation::new(self.inner.clone())
1874 }
1875}
1876
1877/// Implements a client for the Compute Engine API.
1878///
1879/// # Example
1880/// ```
1881/// # use google_cloud_compute_v1::client::Firewalls;
1882/// async fn sample(
1883/// ) -> anyhow::Result<()> {
1884/// let client = Firewalls::builder().build().await?;
1885/// // use `client` to make requests to the Compute Engine API.
1886/// Ok(())
1887/// }
1888/// ```
1889///
1890/// # Service Description
1891///
1892/// Service for the `firewalls` resource.
1893///
1894/// # Configuration
1895///
1896/// To configure `Firewalls` use the `with_*` methods in the type returned
1897/// by [builder()][Firewalls::builder]. The default configuration should
1898/// work for most applications. Common configuration changes include
1899///
1900/// * [with_endpoint()]: by default this client uses the global default endpoint
1901/// (`https://compute.googleapis.com`). Applications using regional
1902/// endpoints or running in restricted networks (e.g. a network configured
1903/// with [Private Google Access with VPC Service Controls]) may want to
1904/// override this default.
1905/// * [with_credentials()]: by default this client uses
1906/// [Application Default Credentials]. Applications using custom
1907/// authentication may need to override this default.
1908///
1909/// [with_endpoint()]: super::builder::firewalls::ClientBuilder::with_endpoint
1910/// [with_credentials()]: super::builder::firewalls::ClientBuilder::with_credentials
1911/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1912/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1913///
1914/// # Pooling and Cloning
1915///
1916/// `Firewalls` holds a connection pool internally, it is advised to
1917/// create one and reuse it. You do not need to wrap `Firewalls` in
1918/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1919/// already uses an `Arc` internally.
1920#[cfg(feature = "firewalls")]
1921#[cfg_attr(docsrs, doc(cfg(feature = "firewalls")))]
1922#[derive(Clone, Debug)]
1923pub struct Firewalls {
1924 inner: std::sync::Arc<dyn super::stub::dynamic::Firewalls>,
1925}
1926
1927#[cfg(feature = "firewalls")]
1928impl Firewalls {
1929 /// Returns a builder for [Firewalls].
1930 ///
1931 /// ```
1932 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1933 /// # use google_cloud_compute_v1::client::Firewalls;
1934 /// let client = Firewalls::builder().build().await?;
1935 /// # Ok(()) }
1936 /// ```
1937 pub fn builder() -> super::builder::firewalls::ClientBuilder {
1938 crate::new_client_builder(super::builder::firewalls::client::Factory)
1939 }
1940
1941 /// Creates a new client from the provided stub.
1942 ///
1943 /// The most common case for calling this function is in tests mocking the
1944 /// client's behavior.
1945 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
1946 where
1947 T: super::stub::Firewalls + 'static,
1948 {
1949 Self { inner: stub.into() }
1950 }
1951
1952 pub(crate) async fn new(
1953 config: gaxi::options::ClientConfig,
1954 ) -> crate::ClientBuilderResult<Self> {
1955 let inner = Self::build_inner(config).await?;
1956 Ok(Self { inner })
1957 }
1958
1959 async fn build_inner(
1960 conf: gaxi::options::ClientConfig,
1961 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Firewalls>> {
1962 if gaxi::options::tracing_enabled(&conf) {
1963 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1964 }
1965 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1966 }
1967
1968 async fn build_transport(
1969 conf: gaxi::options::ClientConfig,
1970 ) -> crate::ClientBuilderResult<impl super::stub::Firewalls> {
1971 super::transport::Firewalls::new(conf).await
1972 }
1973
1974 async fn build_with_tracing(
1975 conf: gaxi::options::ClientConfig,
1976 ) -> crate::ClientBuilderResult<impl super::stub::Firewalls> {
1977 Self::build_transport(conf)
1978 .await
1979 .map(super::tracing::Firewalls::new)
1980 }
1981
1982 /// Deletes the specified firewall.
1983 pub fn delete(&self) -> super::builder::firewalls::Delete {
1984 super::builder::firewalls::Delete::new(self.inner.clone())
1985 }
1986
1987 /// Returns the specified firewall.
1988 pub fn get(&self) -> super::builder::firewalls::Get {
1989 super::builder::firewalls::Get::new(self.inner.clone())
1990 }
1991
1992 /// Creates a firewall rule in the specified project using the data
1993 /// included in the request.
1994 pub fn insert(&self) -> super::builder::firewalls::Insert {
1995 super::builder::firewalls::Insert::new(self.inner.clone())
1996 }
1997
1998 /// Retrieves the list of firewall rules available to the specified
1999 /// project.
2000 pub fn list(&self) -> super::builder::firewalls::List {
2001 super::builder::firewalls::List::new(self.inner.clone())
2002 }
2003
2004 /// Updates the specified firewall rule with the data included in the
2005 /// request. This method supportsPATCH
2006 /// semantics and uses theJSON merge
2007 /// patch format and processing rules.
2008 pub fn patch(&self) -> super::builder::firewalls::Patch {
2009 super::builder::firewalls::Patch::new(self.inner.clone())
2010 }
2011
2012 /// Returns permissions that a caller has on the specified resource.
2013 pub fn test_iam_permissions(&self) -> super::builder::firewalls::TestIamPermissions {
2014 super::builder::firewalls::TestIamPermissions::new(self.inner.clone())
2015 }
2016
2017 /// Updates the specified firewall rule with the data included in the
2018 /// request.
2019 /// Note that all fields will be updated if using PUT, even fields that are not
2020 /// specified. To update individual fields, please use PATCH instead.
2021 pub fn update(&self) -> super::builder::firewalls::Update {
2022 super::builder::firewalls::Update::new(self.inner.clone())
2023 }
2024
2025 /// Retrieves the specified Operations resource.
2026 pub fn get_operation(&self) -> super::builder::firewalls::GetOperation {
2027 super::builder::firewalls::GetOperation::new(self.inner.clone())
2028 }
2029}
2030
2031/// Implements a client for the Compute Engine API.
2032///
2033/// # Example
2034/// ```
2035/// # use google_cloud_compute_v1::client::ForwardingRules;
2036/// async fn sample(
2037/// ) -> anyhow::Result<()> {
2038/// let client = ForwardingRules::builder().build().await?;
2039/// // use `client` to make requests to the Compute Engine API.
2040/// Ok(())
2041/// }
2042/// ```
2043///
2044/// # Service Description
2045///
2046/// Service for the `forwardingRules` resource.
2047///
2048/// # Configuration
2049///
2050/// To configure `ForwardingRules` use the `with_*` methods in the type returned
2051/// by [builder()][ForwardingRules::builder]. The default configuration should
2052/// work for most applications. Common configuration changes include
2053///
2054/// * [with_endpoint()]: by default this client uses the global default endpoint
2055/// (`https://compute.googleapis.com`). Applications using regional
2056/// endpoints or running in restricted networks (e.g. a network configured
2057/// with [Private Google Access with VPC Service Controls]) may want to
2058/// override this default.
2059/// * [with_credentials()]: by default this client uses
2060/// [Application Default Credentials]. Applications using custom
2061/// authentication may need to override this default.
2062///
2063/// [with_endpoint()]: super::builder::forwarding_rules::ClientBuilder::with_endpoint
2064/// [with_credentials()]: super::builder::forwarding_rules::ClientBuilder::with_credentials
2065/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2066/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2067///
2068/// # Pooling and Cloning
2069///
2070/// `ForwardingRules` holds a connection pool internally, it is advised to
2071/// create one and reuse it. You do not need to wrap `ForwardingRules` in
2072/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2073/// already uses an `Arc` internally.
2074#[cfg(feature = "forwarding-rules")]
2075#[cfg_attr(docsrs, doc(cfg(feature = "forwarding-rules")))]
2076#[derive(Clone, Debug)]
2077pub struct ForwardingRules {
2078 inner: std::sync::Arc<dyn super::stub::dynamic::ForwardingRules>,
2079}
2080
2081#[cfg(feature = "forwarding-rules")]
2082impl ForwardingRules {
2083 /// Returns a builder for [ForwardingRules].
2084 ///
2085 /// ```
2086 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2087 /// # use google_cloud_compute_v1::client::ForwardingRules;
2088 /// let client = ForwardingRules::builder().build().await?;
2089 /// # Ok(()) }
2090 /// ```
2091 pub fn builder() -> super::builder::forwarding_rules::ClientBuilder {
2092 crate::new_client_builder(super::builder::forwarding_rules::client::Factory)
2093 }
2094
2095 /// Creates a new client from the provided stub.
2096 ///
2097 /// The most common case for calling this function is in tests mocking the
2098 /// client's behavior.
2099 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
2100 where
2101 T: super::stub::ForwardingRules + 'static,
2102 {
2103 Self { inner: stub.into() }
2104 }
2105
2106 pub(crate) async fn new(
2107 config: gaxi::options::ClientConfig,
2108 ) -> crate::ClientBuilderResult<Self> {
2109 let inner = Self::build_inner(config).await?;
2110 Ok(Self { inner })
2111 }
2112
2113 async fn build_inner(
2114 conf: gaxi::options::ClientConfig,
2115 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ForwardingRules>> {
2116 if gaxi::options::tracing_enabled(&conf) {
2117 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2118 }
2119 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2120 }
2121
2122 async fn build_transport(
2123 conf: gaxi::options::ClientConfig,
2124 ) -> crate::ClientBuilderResult<impl super::stub::ForwardingRules> {
2125 super::transport::ForwardingRules::new(conf).await
2126 }
2127
2128 async fn build_with_tracing(
2129 conf: gaxi::options::ClientConfig,
2130 ) -> crate::ClientBuilderResult<impl super::stub::ForwardingRules> {
2131 Self::build_transport(conf)
2132 .await
2133 .map(super::tracing::ForwardingRules::new)
2134 }
2135
2136 /// Retrieves an aggregated list of forwarding rules.
2137 ///
2138 /// To prevent failure, it is recommended that you set the
2139 /// `returnPartialSuccess` parameter to `true`.
2140 pub fn aggregated_list(&self) -> super::builder::forwarding_rules::AggregatedList {
2141 super::builder::forwarding_rules::AggregatedList::new(self.inner.clone())
2142 }
2143
2144 /// Deletes the specified ForwardingRule resource.
2145 pub fn delete(&self) -> super::builder::forwarding_rules::Delete {
2146 super::builder::forwarding_rules::Delete::new(self.inner.clone())
2147 }
2148
2149 /// Returns the specified ForwardingRule resource.
2150 pub fn get(&self) -> super::builder::forwarding_rules::Get {
2151 super::builder::forwarding_rules::Get::new(self.inner.clone())
2152 }
2153
2154 /// Creates a ForwardingRule resource in the specified project and region using
2155 /// the data included in the request.
2156 pub fn insert(&self) -> super::builder::forwarding_rules::Insert {
2157 super::builder::forwarding_rules::Insert::new(self.inner.clone())
2158 }
2159
2160 /// Retrieves a list of ForwardingRule resources available to the specified
2161 /// project and region.
2162 pub fn list(&self) -> super::builder::forwarding_rules::List {
2163 super::builder::forwarding_rules::List::new(self.inner.clone())
2164 }
2165
2166 /// Updates the specified forwarding rule with the data included in the
2167 /// request. This method supportsPATCH
2168 /// semantics and uses theJSON merge
2169 /// patch format and processing rules. Currently, you can only
2170 /// patch the network_tier field.
2171 pub fn patch(&self) -> super::builder::forwarding_rules::Patch {
2172 super::builder::forwarding_rules::Patch::new(self.inner.clone())
2173 }
2174
2175 /// Sets the labels on the specified resource. To learn more about labels,
2176 /// read the
2177 /// Labeling Resources documentation.
2178 pub fn set_labels(&self) -> super::builder::forwarding_rules::SetLabels {
2179 super::builder::forwarding_rules::SetLabels::new(self.inner.clone())
2180 }
2181
2182 /// Changes target URL for forwarding rule. The new target should be of the
2183 /// same type as the old target.
2184 pub fn set_target(&self) -> super::builder::forwarding_rules::SetTarget {
2185 super::builder::forwarding_rules::SetTarget::new(self.inner.clone())
2186 }
2187
2188 /// Retrieves the specified region-specific Operations resource.
2189 pub fn get_operation(&self) -> super::builder::forwarding_rules::GetOperation {
2190 super::builder::forwarding_rules::GetOperation::new(self.inner.clone())
2191 }
2192}
2193
2194/// Implements a client for the Compute Engine API.
2195///
2196/// # Example
2197/// ```
2198/// # use google_cloud_compute_v1::client::FutureReservations;
2199/// async fn sample(
2200/// ) -> anyhow::Result<()> {
2201/// let client = FutureReservations::builder().build().await?;
2202/// // use `client` to make requests to the Compute Engine API.
2203/// Ok(())
2204/// }
2205/// ```
2206///
2207/// # Service Description
2208///
2209/// Service for the `futureReservations` resource.
2210///
2211/// # Configuration
2212///
2213/// To configure `FutureReservations` use the `with_*` methods in the type returned
2214/// by [builder()][FutureReservations::builder]. The default configuration should
2215/// work for most applications. Common configuration changes include
2216///
2217/// * [with_endpoint()]: by default this client uses the global default endpoint
2218/// (`https://compute.googleapis.com`). Applications using regional
2219/// endpoints or running in restricted networks (e.g. a network configured
2220/// with [Private Google Access with VPC Service Controls]) may want to
2221/// override this default.
2222/// * [with_credentials()]: by default this client uses
2223/// [Application Default Credentials]. Applications using custom
2224/// authentication may need to override this default.
2225///
2226/// [with_endpoint()]: super::builder::future_reservations::ClientBuilder::with_endpoint
2227/// [with_credentials()]: super::builder::future_reservations::ClientBuilder::with_credentials
2228/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2229/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2230///
2231/// # Pooling and Cloning
2232///
2233/// `FutureReservations` holds a connection pool internally, it is advised to
2234/// create one and reuse it. You do not need to wrap `FutureReservations` in
2235/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2236/// already uses an `Arc` internally.
2237#[cfg(feature = "future-reservations")]
2238#[cfg_attr(docsrs, doc(cfg(feature = "future-reservations")))]
2239#[derive(Clone, Debug)]
2240pub struct FutureReservations {
2241 inner: std::sync::Arc<dyn super::stub::dynamic::FutureReservations>,
2242}
2243
2244#[cfg(feature = "future-reservations")]
2245impl FutureReservations {
2246 /// Returns a builder for [FutureReservations].
2247 ///
2248 /// ```
2249 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2250 /// # use google_cloud_compute_v1::client::FutureReservations;
2251 /// let client = FutureReservations::builder().build().await?;
2252 /// # Ok(()) }
2253 /// ```
2254 pub fn builder() -> super::builder::future_reservations::ClientBuilder {
2255 crate::new_client_builder(super::builder::future_reservations::client::Factory)
2256 }
2257
2258 /// Creates a new client from the provided stub.
2259 ///
2260 /// The most common case for calling this function is in tests mocking the
2261 /// client's behavior.
2262 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
2263 where
2264 T: super::stub::FutureReservations + 'static,
2265 {
2266 Self { inner: stub.into() }
2267 }
2268
2269 pub(crate) async fn new(
2270 config: gaxi::options::ClientConfig,
2271 ) -> crate::ClientBuilderResult<Self> {
2272 let inner = Self::build_inner(config).await?;
2273 Ok(Self { inner })
2274 }
2275
2276 async fn build_inner(
2277 conf: gaxi::options::ClientConfig,
2278 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::FutureReservations>>
2279 {
2280 if gaxi::options::tracing_enabled(&conf) {
2281 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2282 }
2283 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2284 }
2285
2286 async fn build_transport(
2287 conf: gaxi::options::ClientConfig,
2288 ) -> crate::ClientBuilderResult<impl super::stub::FutureReservations> {
2289 super::transport::FutureReservations::new(conf).await
2290 }
2291
2292 async fn build_with_tracing(
2293 conf: gaxi::options::ClientConfig,
2294 ) -> crate::ClientBuilderResult<impl super::stub::FutureReservations> {
2295 Self::build_transport(conf)
2296 .await
2297 .map(super::tracing::FutureReservations::new)
2298 }
2299
2300 /// Retrieves an aggregated list of future reservations.
2301 ///
2302 /// To prevent failure, it is recommended that you set the
2303 /// `returnPartialSuccess` parameter to `true`.
2304 pub fn aggregated_list(&self) -> super::builder::future_reservations::AggregatedList {
2305 super::builder::future_reservations::AggregatedList::new(self.inner.clone())
2306 }
2307
2308 /// Cancel the specified future reservation.
2309 pub fn cancel(&self) -> super::builder::future_reservations::Cancel {
2310 super::builder::future_reservations::Cancel::new(self.inner.clone())
2311 }
2312
2313 /// Deletes the specified future reservation.
2314 pub fn delete(&self) -> super::builder::future_reservations::Delete {
2315 super::builder::future_reservations::Delete::new(self.inner.clone())
2316 }
2317
2318 /// Retrieves information about the specified future reservation.
2319 pub fn get(&self) -> super::builder::future_reservations::Get {
2320 super::builder::future_reservations::Get::new(self.inner.clone())
2321 }
2322
2323 /// Creates a new Future Reservation.
2324 pub fn insert(&self) -> super::builder::future_reservations::Insert {
2325 super::builder::future_reservations::Insert::new(self.inner.clone())
2326 }
2327
2328 /// A list of all the future reservations that have been configured for the
2329 /// specified project in specified zone.
2330 pub fn list(&self) -> super::builder::future_reservations::List {
2331 super::builder::future_reservations::List::new(self.inner.clone())
2332 }
2333
2334 /// Updates the specified future reservation.
2335 pub fn update(&self) -> super::builder::future_reservations::Update {
2336 super::builder::future_reservations::Update::new(self.inner.clone())
2337 }
2338
2339 /// Retrieves the specified zone-specific Operations resource.
2340 pub fn get_operation(&self) -> super::builder::future_reservations::GetOperation {
2341 super::builder::future_reservations::GetOperation::new(self.inner.clone())
2342 }
2343}
2344
2345/// Implements a client for the Compute Engine API.
2346///
2347/// # Example
2348/// ```
2349/// # use google_cloud_compute_v1::client::GlobalAddresses;
2350/// async fn sample(
2351/// ) -> anyhow::Result<()> {
2352/// let client = GlobalAddresses::builder().build().await?;
2353/// // use `client` to make requests to the Compute Engine API.
2354/// Ok(())
2355/// }
2356/// ```
2357///
2358/// # Service Description
2359///
2360/// Service for the `globalAddresses` resource.
2361///
2362/// # Configuration
2363///
2364/// To configure `GlobalAddresses` use the `with_*` methods in the type returned
2365/// by [builder()][GlobalAddresses::builder]. The default configuration should
2366/// work for most applications. Common configuration changes include
2367///
2368/// * [with_endpoint()]: by default this client uses the global default endpoint
2369/// (`https://compute.googleapis.com`). Applications using regional
2370/// endpoints or running in restricted networks (e.g. a network configured
2371/// with [Private Google Access with VPC Service Controls]) may want to
2372/// override this default.
2373/// * [with_credentials()]: by default this client uses
2374/// [Application Default Credentials]. Applications using custom
2375/// authentication may need to override this default.
2376///
2377/// [with_endpoint()]: super::builder::global_addresses::ClientBuilder::with_endpoint
2378/// [with_credentials()]: super::builder::global_addresses::ClientBuilder::with_credentials
2379/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2380/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2381///
2382/// # Pooling and Cloning
2383///
2384/// `GlobalAddresses` holds a connection pool internally, it is advised to
2385/// create one and reuse it. You do not need to wrap `GlobalAddresses` in
2386/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2387/// already uses an `Arc` internally.
2388#[cfg(feature = "global-addresses")]
2389#[cfg_attr(docsrs, doc(cfg(feature = "global-addresses")))]
2390#[derive(Clone, Debug)]
2391pub struct GlobalAddresses {
2392 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalAddresses>,
2393}
2394
2395#[cfg(feature = "global-addresses")]
2396impl GlobalAddresses {
2397 /// Returns a builder for [GlobalAddresses].
2398 ///
2399 /// ```
2400 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2401 /// # use google_cloud_compute_v1::client::GlobalAddresses;
2402 /// let client = GlobalAddresses::builder().build().await?;
2403 /// # Ok(()) }
2404 /// ```
2405 pub fn builder() -> super::builder::global_addresses::ClientBuilder {
2406 crate::new_client_builder(super::builder::global_addresses::client::Factory)
2407 }
2408
2409 /// Creates a new client from the provided stub.
2410 ///
2411 /// The most common case for calling this function is in tests mocking the
2412 /// client's behavior.
2413 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
2414 where
2415 T: super::stub::GlobalAddresses + 'static,
2416 {
2417 Self { inner: stub.into() }
2418 }
2419
2420 pub(crate) async fn new(
2421 config: gaxi::options::ClientConfig,
2422 ) -> crate::ClientBuilderResult<Self> {
2423 let inner = Self::build_inner(config).await?;
2424 Ok(Self { inner })
2425 }
2426
2427 async fn build_inner(
2428 conf: gaxi::options::ClientConfig,
2429 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::GlobalAddresses>> {
2430 if gaxi::options::tracing_enabled(&conf) {
2431 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2432 }
2433 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2434 }
2435
2436 async fn build_transport(
2437 conf: gaxi::options::ClientConfig,
2438 ) -> crate::ClientBuilderResult<impl super::stub::GlobalAddresses> {
2439 super::transport::GlobalAddresses::new(conf).await
2440 }
2441
2442 async fn build_with_tracing(
2443 conf: gaxi::options::ClientConfig,
2444 ) -> crate::ClientBuilderResult<impl super::stub::GlobalAddresses> {
2445 Self::build_transport(conf)
2446 .await
2447 .map(super::tracing::GlobalAddresses::new)
2448 }
2449
2450 /// Deletes the specified address resource.
2451 pub fn delete(&self) -> super::builder::global_addresses::Delete {
2452 super::builder::global_addresses::Delete::new(self.inner.clone())
2453 }
2454
2455 /// Returns the specified address resource.
2456 pub fn get(&self) -> super::builder::global_addresses::Get {
2457 super::builder::global_addresses::Get::new(self.inner.clone())
2458 }
2459
2460 /// Creates an address resource in the specified project by using the data
2461 /// included in the request.
2462 pub fn insert(&self) -> super::builder::global_addresses::Insert {
2463 super::builder::global_addresses::Insert::new(self.inner.clone())
2464 }
2465
2466 /// Retrieves a list of global addresses.
2467 pub fn list(&self) -> super::builder::global_addresses::List {
2468 super::builder::global_addresses::List::new(self.inner.clone())
2469 }
2470
2471 /// Moves the specified address resource from one project to another project.
2472 pub fn r#move(&self) -> super::builder::global_addresses::Move {
2473 super::builder::global_addresses::Move::new(self.inner.clone())
2474 }
2475
2476 /// Sets the labels on a GlobalAddress. To learn more about labels, read theLabeling
2477 /// Resources documentation.
2478 pub fn set_labels(&self) -> super::builder::global_addresses::SetLabels {
2479 super::builder::global_addresses::SetLabels::new(self.inner.clone())
2480 }
2481
2482 /// Returns permissions that a caller has on the specified resource.
2483 pub fn test_iam_permissions(&self) -> super::builder::global_addresses::TestIamPermissions {
2484 super::builder::global_addresses::TestIamPermissions::new(self.inner.clone())
2485 }
2486
2487 /// Retrieves the specified Operations resource.
2488 pub fn get_operation(&self) -> super::builder::global_addresses::GetOperation {
2489 super::builder::global_addresses::GetOperation::new(self.inner.clone())
2490 }
2491}
2492
2493/// Implements a client for the Compute Engine API.
2494///
2495/// # Example
2496/// ```
2497/// # use google_cloud_compute_v1::client::GlobalForwardingRules;
2498/// async fn sample(
2499/// ) -> anyhow::Result<()> {
2500/// let client = GlobalForwardingRules::builder().build().await?;
2501/// // use `client` to make requests to the Compute Engine API.
2502/// Ok(())
2503/// }
2504/// ```
2505///
2506/// # Service Description
2507///
2508/// Service for the `globalForwardingRules` resource.
2509///
2510/// # Configuration
2511///
2512/// To configure `GlobalForwardingRules` use the `with_*` methods in the type returned
2513/// by [builder()][GlobalForwardingRules::builder]. The default configuration should
2514/// work for most applications. Common configuration changes include
2515///
2516/// * [with_endpoint()]: by default this client uses the global default endpoint
2517/// (`https://compute.googleapis.com`). Applications using regional
2518/// endpoints or running in restricted networks (e.g. a network configured
2519/// with [Private Google Access with VPC Service Controls]) may want to
2520/// override this default.
2521/// * [with_credentials()]: by default this client uses
2522/// [Application Default Credentials]. Applications using custom
2523/// authentication may need to override this default.
2524///
2525/// [with_endpoint()]: super::builder::global_forwarding_rules::ClientBuilder::with_endpoint
2526/// [with_credentials()]: super::builder::global_forwarding_rules::ClientBuilder::with_credentials
2527/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2528/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2529///
2530/// # Pooling and Cloning
2531///
2532/// `GlobalForwardingRules` holds a connection pool internally, it is advised to
2533/// create one and reuse it. You do not need to wrap `GlobalForwardingRules` in
2534/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2535/// already uses an `Arc` internally.
2536#[cfg(feature = "global-forwarding-rules")]
2537#[cfg_attr(docsrs, doc(cfg(feature = "global-forwarding-rules")))]
2538#[derive(Clone, Debug)]
2539pub struct GlobalForwardingRules {
2540 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalForwardingRules>,
2541}
2542
2543#[cfg(feature = "global-forwarding-rules")]
2544impl GlobalForwardingRules {
2545 /// Returns a builder for [GlobalForwardingRules].
2546 ///
2547 /// ```
2548 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2549 /// # use google_cloud_compute_v1::client::GlobalForwardingRules;
2550 /// let client = GlobalForwardingRules::builder().build().await?;
2551 /// # Ok(()) }
2552 /// ```
2553 pub fn builder() -> super::builder::global_forwarding_rules::ClientBuilder {
2554 crate::new_client_builder(super::builder::global_forwarding_rules::client::Factory)
2555 }
2556
2557 /// Creates a new client from the provided stub.
2558 ///
2559 /// The most common case for calling this function is in tests mocking the
2560 /// client's behavior.
2561 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
2562 where
2563 T: super::stub::GlobalForwardingRules + 'static,
2564 {
2565 Self { inner: stub.into() }
2566 }
2567
2568 pub(crate) async fn new(
2569 config: gaxi::options::ClientConfig,
2570 ) -> crate::ClientBuilderResult<Self> {
2571 let inner = Self::build_inner(config).await?;
2572 Ok(Self { inner })
2573 }
2574
2575 async fn build_inner(
2576 conf: gaxi::options::ClientConfig,
2577 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::GlobalForwardingRules>>
2578 {
2579 if gaxi::options::tracing_enabled(&conf) {
2580 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2581 }
2582 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2583 }
2584
2585 async fn build_transport(
2586 conf: gaxi::options::ClientConfig,
2587 ) -> crate::ClientBuilderResult<impl super::stub::GlobalForwardingRules> {
2588 super::transport::GlobalForwardingRules::new(conf).await
2589 }
2590
2591 async fn build_with_tracing(
2592 conf: gaxi::options::ClientConfig,
2593 ) -> crate::ClientBuilderResult<impl super::stub::GlobalForwardingRules> {
2594 Self::build_transport(conf)
2595 .await
2596 .map(super::tracing::GlobalForwardingRules::new)
2597 }
2598
2599 /// Deletes the specified GlobalForwardingRule resource.
2600 pub fn delete(&self) -> super::builder::global_forwarding_rules::Delete {
2601 super::builder::global_forwarding_rules::Delete::new(self.inner.clone())
2602 }
2603
2604 /// Returns the specified GlobalForwardingRule resource. Gets a list of
2605 /// available forwarding rules by making a list() request.
2606 pub fn get(&self) -> super::builder::global_forwarding_rules::Get {
2607 super::builder::global_forwarding_rules::Get::new(self.inner.clone())
2608 }
2609
2610 /// Creates a GlobalForwardingRule resource in the specified project using
2611 /// the data included in the request.
2612 pub fn insert(&self) -> super::builder::global_forwarding_rules::Insert {
2613 super::builder::global_forwarding_rules::Insert::new(self.inner.clone())
2614 }
2615
2616 /// Retrieves a list of GlobalForwardingRule resources available to the
2617 /// specified project.
2618 pub fn list(&self) -> super::builder::global_forwarding_rules::List {
2619 super::builder::global_forwarding_rules::List::new(self.inner.clone())
2620 }
2621
2622 /// Updates the specified forwarding rule with the data included in the
2623 /// request. This method supportsPATCH
2624 /// semantics and uses theJSON merge
2625 /// patch format and processing rules. Currently, you can only
2626 /// patch the network_tier field.
2627 pub fn patch(&self) -> super::builder::global_forwarding_rules::Patch {
2628 super::builder::global_forwarding_rules::Patch::new(self.inner.clone())
2629 }
2630
2631 /// Sets the labels on the specified resource. To learn more about labels,
2632 /// read the
2633 /// Labeling resources documentation.
2634 pub fn set_labels(&self) -> super::builder::global_forwarding_rules::SetLabels {
2635 super::builder::global_forwarding_rules::SetLabels::new(self.inner.clone())
2636 }
2637
2638 /// Changes target URL for the GlobalForwardingRule resource. The new target
2639 /// should be of the same type as the old target.
2640 pub fn set_target(&self) -> super::builder::global_forwarding_rules::SetTarget {
2641 super::builder::global_forwarding_rules::SetTarget::new(self.inner.clone())
2642 }
2643
2644 /// Retrieves the specified Operations resource.
2645 pub fn get_operation(&self) -> super::builder::global_forwarding_rules::GetOperation {
2646 super::builder::global_forwarding_rules::GetOperation::new(self.inner.clone())
2647 }
2648}
2649
2650/// Implements a client for the Compute Engine API.
2651///
2652/// # Example
2653/// ```
2654/// # use google_cloud_compute_v1::client::GlobalNetworkEndpointGroups;
2655/// async fn sample(
2656/// ) -> anyhow::Result<()> {
2657/// let client = GlobalNetworkEndpointGroups::builder().build().await?;
2658/// // use `client` to make requests to the Compute Engine API.
2659/// Ok(())
2660/// }
2661/// ```
2662///
2663/// # Service Description
2664///
2665/// Service for the `globalNetworkEndpointGroups` resource.
2666///
2667/// # Configuration
2668///
2669/// To configure `GlobalNetworkEndpointGroups` use the `with_*` methods in the type returned
2670/// by [builder()][GlobalNetworkEndpointGroups::builder]. The default configuration should
2671/// work for most applications. Common configuration changes include
2672///
2673/// * [with_endpoint()]: by default this client uses the global default endpoint
2674/// (`https://compute.googleapis.com`). Applications using regional
2675/// endpoints or running in restricted networks (e.g. a network configured
2676/// with [Private Google Access with VPC Service Controls]) may want to
2677/// override this default.
2678/// * [with_credentials()]: by default this client uses
2679/// [Application Default Credentials]. Applications using custom
2680/// authentication may need to override this default.
2681///
2682/// [with_endpoint()]: super::builder::global_network_endpoint_groups::ClientBuilder::with_endpoint
2683/// [with_credentials()]: super::builder::global_network_endpoint_groups::ClientBuilder::with_credentials
2684/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2685/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2686///
2687/// # Pooling and Cloning
2688///
2689/// `GlobalNetworkEndpointGroups` holds a connection pool internally, it is advised to
2690/// create one and reuse it. You do not need to wrap `GlobalNetworkEndpointGroups` in
2691/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2692/// already uses an `Arc` internally.
2693#[cfg(feature = "global-network-endpoint-groups")]
2694#[cfg_attr(docsrs, doc(cfg(feature = "global-network-endpoint-groups")))]
2695#[derive(Clone, Debug)]
2696pub struct GlobalNetworkEndpointGroups {
2697 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalNetworkEndpointGroups>,
2698}
2699
2700#[cfg(feature = "global-network-endpoint-groups")]
2701impl GlobalNetworkEndpointGroups {
2702 /// Returns a builder for [GlobalNetworkEndpointGroups].
2703 ///
2704 /// ```
2705 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2706 /// # use google_cloud_compute_v1::client::GlobalNetworkEndpointGroups;
2707 /// let client = GlobalNetworkEndpointGroups::builder().build().await?;
2708 /// # Ok(()) }
2709 /// ```
2710 pub fn builder() -> super::builder::global_network_endpoint_groups::ClientBuilder {
2711 crate::new_client_builder(super::builder::global_network_endpoint_groups::client::Factory)
2712 }
2713
2714 /// Creates a new client from the provided stub.
2715 ///
2716 /// The most common case for calling this function is in tests mocking the
2717 /// client's behavior.
2718 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
2719 where
2720 T: super::stub::GlobalNetworkEndpointGroups + 'static,
2721 {
2722 Self { inner: stub.into() }
2723 }
2724
2725 pub(crate) async fn new(
2726 config: gaxi::options::ClientConfig,
2727 ) -> crate::ClientBuilderResult<Self> {
2728 let inner = Self::build_inner(config).await?;
2729 Ok(Self { inner })
2730 }
2731
2732 async fn build_inner(
2733 conf: gaxi::options::ClientConfig,
2734 ) -> crate::ClientBuilderResult<
2735 std::sync::Arc<dyn super::stub::dynamic::GlobalNetworkEndpointGroups>,
2736 > {
2737 if gaxi::options::tracing_enabled(&conf) {
2738 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2739 }
2740 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2741 }
2742
2743 async fn build_transport(
2744 conf: gaxi::options::ClientConfig,
2745 ) -> crate::ClientBuilderResult<impl super::stub::GlobalNetworkEndpointGroups> {
2746 super::transport::GlobalNetworkEndpointGroups::new(conf).await
2747 }
2748
2749 async fn build_with_tracing(
2750 conf: gaxi::options::ClientConfig,
2751 ) -> crate::ClientBuilderResult<impl super::stub::GlobalNetworkEndpointGroups> {
2752 Self::build_transport(conf)
2753 .await
2754 .map(super::tracing::GlobalNetworkEndpointGroups::new)
2755 }
2756
2757 /// Attach a network endpoint to the specified network endpoint group.
2758 pub fn attach_network_endpoints(
2759 &self,
2760 ) -> super::builder::global_network_endpoint_groups::AttachNetworkEndpoints {
2761 super::builder::global_network_endpoint_groups::AttachNetworkEndpoints::new(
2762 self.inner.clone(),
2763 )
2764 }
2765
2766 /// Deletes the specified network endpoint group.Note that the NEG cannot be
2767 /// deleted if there are backend services referencing it.
2768 pub fn delete(&self) -> super::builder::global_network_endpoint_groups::Delete {
2769 super::builder::global_network_endpoint_groups::Delete::new(self.inner.clone())
2770 }
2771
2772 /// Detach the network endpoint from the specified network endpoint group.
2773 pub fn detach_network_endpoints(
2774 &self,
2775 ) -> super::builder::global_network_endpoint_groups::DetachNetworkEndpoints {
2776 super::builder::global_network_endpoint_groups::DetachNetworkEndpoints::new(
2777 self.inner.clone(),
2778 )
2779 }
2780
2781 /// Returns the specified network endpoint group.
2782 pub fn get(&self) -> super::builder::global_network_endpoint_groups::Get {
2783 super::builder::global_network_endpoint_groups::Get::new(self.inner.clone())
2784 }
2785
2786 /// Creates a network endpoint group in the specified project using the
2787 /// parameters that are included in the request.
2788 ///
2789 /// Note: Use the following APIs to manage network endpoint groups:
2790 ///
2791 /// - To manage NEGs with zonal scope (such as zonal NEGs, hybrid connectivity
2792 /// NEGs): zonal
2793 /// API
2794 /// - To manage NEGs with regional scope (such as regional internet NEGs,
2795 /// serverless NEGs, Private Service Connect NEGs): regional
2796 /// API
2797 /// - To manage NEGs with global scope (such as global internet NEGs):global
2798 /// API
2799 pub fn insert(&self) -> super::builder::global_network_endpoint_groups::Insert {
2800 super::builder::global_network_endpoint_groups::Insert::new(self.inner.clone())
2801 }
2802
2803 /// Retrieves the list of network endpoint groups that are located in the
2804 /// specified project.
2805 pub fn list(&self) -> super::builder::global_network_endpoint_groups::List {
2806 super::builder::global_network_endpoint_groups::List::new(self.inner.clone())
2807 }
2808
2809 /// Lists the network endpoints in the specified network endpoint group.
2810 pub fn list_network_endpoints(
2811 &self,
2812 ) -> super::builder::global_network_endpoint_groups::ListNetworkEndpoints {
2813 super::builder::global_network_endpoint_groups::ListNetworkEndpoints::new(
2814 self.inner.clone(),
2815 )
2816 }
2817
2818 /// Retrieves the specified Operations resource.
2819 pub fn get_operation(&self) -> super::builder::global_network_endpoint_groups::GetOperation {
2820 super::builder::global_network_endpoint_groups::GetOperation::new(self.inner.clone())
2821 }
2822}
2823
2824/// Implements a client for the Compute Engine API.
2825///
2826/// # Example
2827/// ```
2828/// # use google_cloud_compute_v1::client::GlobalOperations;
2829/// async fn sample(
2830/// ) -> anyhow::Result<()> {
2831/// let client = GlobalOperations::builder().build().await?;
2832/// // use `client` to make requests to the Compute Engine API.
2833/// Ok(())
2834/// }
2835/// ```
2836///
2837/// # Service Description
2838///
2839/// Service for the `globalOperations` resource.
2840///
2841/// # Configuration
2842///
2843/// To configure `GlobalOperations` use the `with_*` methods in the type returned
2844/// by [builder()][GlobalOperations::builder]. The default configuration should
2845/// work for most applications. Common configuration changes include
2846///
2847/// * [with_endpoint()]: by default this client uses the global default endpoint
2848/// (`https://compute.googleapis.com`). Applications using regional
2849/// endpoints or running in restricted networks (e.g. a network configured
2850/// with [Private Google Access with VPC Service Controls]) may want to
2851/// override this default.
2852/// * [with_credentials()]: by default this client uses
2853/// [Application Default Credentials]. Applications using custom
2854/// authentication may need to override this default.
2855///
2856/// [with_endpoint()]: super::builder::global_operations::ClientBuilder::with_endpoint
2857/// [with_credentials()]: super::builder::global_operations::ClientBuilder::with_credentials
2858/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2859/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2860///
2861/// # Pooling and Cloning
2862///
2863/// `GlobalOperations` holds a connection pool internally, it is advised to
2864/// create one and reuse it. You do not need to wrap `GlobalOperations` in
2865/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2866/// already uses an `Arc` internally.
2867#[cfg(feature = "global-operations")]
2868#[cfg_attr(docsrs, doc(cfg(feature = "global-operations")))]
2869#[derive(Clone, Debug)]
2870pub struct GlobalOperations {
2871 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalOperations>,
2872}
2873
2874#[cfg(feature = "global-operations")]
2875impl GlobalOperations {
2876 /// Returns a builder for [GlobalOperations].
2877 ///
2878 /// ```
2879 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2880 /// # use google_cloud_compute_v1::client::GlobalOperations;
2881 /// let client = GlobalOperations::builder().build().await?;
2882 /// # Ok(()) }
2883 /// ```
2884 pub fn builder() -> super::builder::global_operations::ClientBuilder {
2885 crate::new_client_builder(super::builder::global_operations::client::Factory)
2886 }
2887
2888 /// Creates a new client from the provided stub.
2889 ///
2890 /// The most common case for calling this function is in tests mocking the
2891 /// client's behavior.
2892 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
2893 where
2894 T: super::stub::GlobalOperations + 'static,
2895 {
2896 Self { inner: stub.into() }
2897 }
2898
2899 pub(crate) async fn new(
2900 config: gaxi::options::ClientConfig,
2901 ) -> crate::ClientBuilderResult<Self> {
2902 let inner = Self::build_inner(config).await?;
2903 Ok(Self { inner })
2904 }
2905
2906 async fn build_inner(
2907 conf: gaxi::options::ClientConfig,
2908 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::GlobalOperations>>
2909 {
2910 if gaxi::options::tracing_enabled(&conf) {
2911 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2912 }
2913 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2914 }
2915
2916 async fn build_transport(
2917 conf: gaxi::options::ClientConfig,
2918 ) -> crate::ClientBuilderResult<impl super::stub::GlobalOperations> {
2919 super::transport::GlobalOperations::new(conf).await
2920 }
2921
2922 async fn build_with_tracing(
2923 conf: gaxi::options::ClientConfig,
2924 ) -> crate::ClientBuilderResult<impl super::stub::GlobalOperations> {
2925 Self::build_transport(conf)
2926 .await
2927 .map(super::tracing::GlobalOperations::new)
2928 }
2929
2930 /// Retrieves an aggregated list of all operations.
2931 ///
2932 /// To prevent failure, Google recommends that you set the
2933 /// `returnPartialSuccess` parameter to `true`.
2934 pub fn aggregated_list(&self) -> super::builder::global_operations::AggregatedList {
2935 super::builder::global_operations::AggregatedList::new(self.inner.clone())
2936 }
2937
2938 /// Deletes the specified Operations resource.
2939 pub fn delete(&self) -> super::builder::global_operations::Delete {
2940 super::builder::global_operations::Delete::new(self.inner.clone())
2941 }
2942
2943 /// Retrieves the specified Operations resource.
2944 pub fn get(&self) -> super::builder::global_operations::Get {
2945 super::builder::global_operations::Get::new(self.inner.clone())
2946 }
2947
2948 /// Retrieves a list of Operation resources contained within the specified
2949 /// project.
2950 pub fn list(&self) -> super::builder::global_operations::List {
2951 super::builder::global_operations::List::new(self.inner.clone())
2952 }
2953
2954 /// Waits for the specified Operation resource to return as `DONE`
2955 /// or for the request to approach the 2 minute deadline, and retrieves the
2956 /// specified Operation resource. This method differs from the
2957 /// `GET` method in that it waits for no more than the default
2958 /// deadline (2 minutes) and then returns the current state of the operation,
2959 /// which might be `DONE` or still in progress.
2960 ///
2961 /// This method is called on a best-effort basis. Specifically:
2962 ///
2963 /// ```norust
2964 /// - In uncommon cases, when the server is overloaded, the request might
2965 /// return before the default deadline is reached, or might return after zero
2966 /// seconds.
2967 /// ```
2968 ///
2969 /// - If the default deadline is reached, there is no guarantee that the
2970 /// operation is actually done when the method returns. Be prepared to retry
2971 /// if the operation is not `DONE`.
2972 pub fn wait(&self) -> super::builder::global_operations::Wait {
2973 super::builder::global_operations::Wait::new(self.inner.clone())
2974 }
2975}
2976
2977/// Implements a client for the Compute Engine API.
2978///
2979/// # Example
2980/// ```
2981/// # use google_cloud_compute_v1::client::GlobalOrganizationOperations;
2982/// async fn sample(
2983/// ) -> anyhow::Result<()> {
2984/// let client = GlobalOrganizationOperations::builder().build().await?;
2985/// // use `client` to make requests to the Compute Engine API.
2986/// Ok(())
2987/// }
2988/// ```
2989///
2990/// # Service Description
2991///
2992/// Service for the `globalOrganizationOperations` resource.
2993///
2994/// # Configuration
2995///
2996/// To configure `GlobalOrganizationOperations` use the `with_*` methods in the type returned
2997/// by [builder()][GlobalOrganizationOperations::builder]. The default configuration should
2998/// work for most applications. Common configuration changes include
2999///
3000/// * [with_endpoint()]: by default this client uses the global default endpoint
3001/// (`https://compute.googleapis.com`). Applications using regional
3002/// endpoints or running in restricted networks (e.g. a network configured
3003/// with [Private Google Access with VPC Service Controls]) may want to
3004/// override this default.
3005/// * [with_credentials()]: by default this client uses
3006/// [Application Default Credentials]. Applications using custom
3007/// authentication may need to override this default.
3008///
3009/// [with_endpoint()]: super::builder::global_organization_operations::ClientBuilder::with_endpoint
3010/// [with_credentials()]: super::builder::global_organization_operations::ClientBuilder::with_credentials
3011/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3012/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3013///
3014/// # Pooling and Cloning
3015///
3016/// `GlobalOrganizationOperations` holds a connection pool internally, it is advised to
3017/// create one and reuse it. You do not need to wrap `GlobalOrganizationOperations` in
3018/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3019/// already uses an `Arc` internally.
3020#[cfg(feature = "global-organization-operations")]
3021#[cfg_attr(docsrs, doc(cfg(feature = "global-organization-operations")))]
3022#[derive(Clone, Debug)]
3023pub struct GlobalOrganizationOperations {
3024 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalOrganizationOperations>,
3025}
3026
3027#[cfg(feature = "global-organization-operations")]
3028impl GlobalOrganizationOperations {
3029 /// Returns a builder for [GlobalOrganizationOperations].
3030 ///
3031 /// ```
3032 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3033 /// # use google_cloud_compute_v1::client::GlobalOrganizationOperations;
3034 /// let client = GlobalOrganizationOperations::builder().build().await?;
3035 /// # Ok(()) }
3036 /// ```
3037 pub fn builder() -> super::builder::global_organization_operations::ClientBuilder {
3038 crate::new_client_builder(super::builder::global_organization_operations::client::Factory)
3039 }
3040
3041 /// Creates a new client from the provided stub.
3042 ///
3043 /// The most common case for calling this function is in tests mocking the
3044 /// client's behavior.
3045 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
3046 where
3047 T: super::stub::GlobalOrganizationOperations + 'static,
3048 {
3049 Self { inner: stub.into() }
3050 }
3051
3052 pub(crate) async fn new(
3053 config: gaxi::options::ClientConfig,
3054 ) -> crate::ClientBuilderResult<Self> {
3055 let inner = Self::build_inner(config).await?;
3056 Ok(Self { inner })
3057 }
3058
3059 async fn build_inner(
3060 conf: gaxi::options::ClientConfig,
3061 ) -> crate::ClientBuilderResult<
3062 std::sync::Arc<dyn super::stub::dynamic::GlobalOrganizationOperations>,
3063 > {
3064 if gaxi::options::tracing_enabled(&conf) {
3065 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3066 }
3067 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3068 }
3069
3070 async fn build_transport(
3071 conf: gaxi::options::ClientConfig,
3072 ) -> crate::ClientBuilderResult<impl super::stub::GlobalOrganizationOperations> {
3073 super::transport::GlobalOrganizationOperations::new(conf).await
3074 }
3075
3076 async fn build_with_tracing(
3077 conf: gaxi::options::ClientConfig,
3078 ) -> crate::ClientBuilderResult<impl super::stub::GlobalOrganizationOperations> {
3079 Self::build_transport(conf)
3080 .await
3081 .map(super::tracing::GlobalOrganizationOperations::new)
3082 }
3083
3084 /// Deletes the specified Operations resource.
3085 pub fn delete(&self) -> super::builder::global_organization_operations::Delete {
3086 super::builder::global_organization_operations::Delete::new(self.inner.clone())
3087 }
3088
3089 /// Retrieves the specified Operations resource. Gets a list of operations
3090 /// by making a `list()` request.
3091 pub fn get(&self) -> super::builder::global_organization_operations::Get {
3092 super::builder::global_organization_operations::Get::new(self.inner.clone())
3093 }
3094
3095 /// Retrieves a list of Operation resources contained within the specified
3096 /// organization.
3097 pub fn list(&self) -> super::builder::global_organization_operations::List {
3098 super::builder::global_organization_operations::List::new(self.inner.clone())
3099 }
3100}
3101
3102/// Implements a client for the Compute Engine API.
3103///
3104/// # Example
3105/// ```
3106/// # use google_cloud_compute_v1::client::GlobalPublicDelegatedPrefixes;
3107/// async fn sample(
3108/// ) -> anyhow::Result<()> {
3109/// let client = GlobalPublicDelegatedPrefixes::builder().build().await?;
3110/// // use `client` to make requests to the Compute Engine API.
3111/// Ok(())
3112/// }
3113/// ```
3114///
3115/// # Service Description
3116///
3117/// Service for the `globalPublicDelegatedPrefixes` resource.
3118///
3119/// # Configuration
3120///
3121/// To configure `GlobalPublicDelegatedPrefixes` use the `with_*` methods in the type returned
3122/// by [builder()][GlobalPublicDelegatedPrefixes::builder]. The default configuration should
3123/// work for most applications. Common configuration changes include
3124///
3125/// * [with_endpoint()]: by default this client uses the global default endpoint
3126/// (`https://compute.googleapis.com`). Applications using regional
3127/// endpoints or running in restricted networks (e.g. a network configured
3128/// with [Private Google Access with VPC Service Controls]) may want to
3129/// override this default.
3130/// * [with_credentials()]: by default this client uses
3131/// [Application Default Credentials]. Applications using custom
3132/// authentication may need to override this default.
3133///
3134/// [with_endpoint()]: super::builder::global_public_delegated_prefixes::ClientBuilder::with_endpoint
3135/// [with_credentials()]: super::builder::global_public_delegated_prefixes::ClientBuilder::with_credentials
3136/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3137/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3138///
3139/// # Pooling and Cloning
3140///
3141/// `GlobalPublicDelegatedPrefixes` holds a connection pool internally, it is advised to
3142/// create one and reuse it. You do not need to wrap `GlobalPublicDelegatedPrefixes` in
3143/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3144/// already uses an `Arc` internally.
3145#[cfg(feature = "global-public-delegated-prefixes")]
3146#[cfg_attr(docsrs, doc(cfg(feature = "global-public-delegated-prefixes")))]
3147#[derive(Clone, Debug)]
3148pub struct GlobalPublicDelegatedPrefixes {
3149 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalPublicDelegatedPrefixes>,
3150}
3151
3152#[cfg(feature = "global-public-delegated-prefixes")]
3153impl GlobalPublicDelegatedPrefixes {
3154 /// Returns a builder for [GlobalPublicDelegatedPrefixes].
3155 ///
3156 /// ```
3157 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3158 /// # use google_cloud_compute_v1::client::GlobalPublicDelegatedPrefixes;
3159 /// let client = GlobalPublicDelegatedPrefixes::builder().build().await?;
3160 /// # Ok(()) }
3161 /// ```
3162 pub fn builder() -> super::builder::global_public_delegated_prefixes::ClientBuilder {
3163 crate::new_client_builder(super::builder::global_public_delegated_prefixes::client::Factory)
3164 }
3165
3166 /// Creates a new client from the provided stub.
3167 ///
3168 /// The most common case for calling this function is in tests mocking the
3169 /// client's behavior.
3170 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
3171 where
3172 T: super::stub::GlobalPublicDelegatedPrefixes + 'static,
3173 {
3174 Self { inner: stub.into() }
3175 }
3176
3177 pub(crate) async fn new(
3178 config: gaxi::options::ClientConfig,
3179 ) -> crate::ClientBuilderResult<Self> {
3180 let inner = Self::build_inner(config).await?;
3181 Ok(Self { inner })
3182 }
3183
3184 async fn build_inner(
3185 conf: gaxi::options::ClientConfig,
3186 ) -> crate::ClientBuilderResult<
3187 std::sync::Arc<dyn super::stub::dynamic::GlobalPublicDelegatedPrefixes>,
3188 > {
3189 if gaxi::options::tracing_enabled(&conf) {
3190 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3191 }
3192 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3193 }
3194
3195 async fn build_transport(
3196 conf: gaxi::options::ClientConfig,
3197 ) -> crate::ClientBuilderResult<impl super::stub::GlobalPublicDelegatedPrefixes> {
3198 super::transport::GlobalPublicDelegatedPrefixes::new(conf).await
3199 }
3200
3201 async fn build_with_tracing(
3202 conf: gaxi::options::ClientConfig,
3203 ) -> crate::ClientBuilderResult<impl super::stub::GlobalPublicDelegatedPrefixes> {
3204 Self::build_transport(conf)
3205 .await
3206 .map(super::tracing::GlobalPublicDelegatedPrefixes::new)
3207 }
3208
3209 /// Deletes the specified global PublicDelegatedPrefix.
3210 pub fn delete(&self) -> super::builder::global_public_delegated_prefixes::Delete {
3211 super::builder::global_public_delegated_prefixes::Delete::new(self.inner.clone())
3212 }
3213
3214 /// Returns the specified global PublicDelegatedPrefix resource.
3215 pub fn get(&self) -> super::builder::global_public_delegated_prefixes::Get {
3216 super::builder::global_public_delegated_prefixes::Get::new(self.inner.clone())
3217 }
3218
3219 /// Creates a global PublicDelegatedPrefix in the specified project using the
3220 /// parameters that are included in the request.
3221 pub fn insert(&self) -> super::builder::global_public_delegated_prefixes::Insert {
3222 super::builder::global_public_delegated_prefixes::Insert::new(self.inner.clone())
3223 }
3224
3225 /// Lists the global PublicDelegatedPrefixes for a project.
3226 pub fn list(&self) -> super::builder::global_public_delegated_prefixes::List {
3227 super::builder::global_public_delegated_prefixes::List::new(self.inner.clone())
3228 }
3229
3230 /// Patches the specified global PublicDelegatedPrefix resource with the data
3231 /// included in the request. This method supportsPATCH
3232 /// semantics and usesJSON merge
3233 /// patch format and processing rules.
3234 pub fn patch(&self) -> super::builder::global_public_delegated_prefixes::Patch {
3235 super::builder::global_public_delegated_prefixes::Patch::new(self.inner.clone())
3236 }
3237
3238 /// Retrieves the specified Operations resource.
3239 pub fn get_operation(&self) -> super::builder::global_public_delegated_prefixes::GetOperation {
3240 super::builder::global_public_delegated_prefixes::GetOperation::new(self.inner.clone())
3241 }
3242}
3243
3244/// Implements a client for the Compute Engine API.
3245///
3246/// # Example
3247/// ```
3248/// # use google_cloud_compute_v1::client::GlobalVmExtensionPolicies;
3249/// async fn sample(
3250/// ) -> anyhow::Result<()> {
3251/// let client = GlobalVmExtensionPolicies::builder().build().await?;
3252/// // use `client` to make requests to the Compute Engine API.
3253/// Ok(())
3254/// }
3255/// ```
3256///
3257/// # Service Description
3258///
3259/// Service for the `globalVmExtensionPolicies` resource.
3260///
3261/// # Configuration
3262///
3263/// To configure `GlobalVmExtensionPolicies` use the `with_*` methods in the type returned
3264/// by [builder()][GlobalVmExtensionPolicies::builder]. The default configuration should
3265/// work for most applications. Common configuration changes include
3266///
3267/// * [with_endpoint()]: by default this client uses the global default endpoint
3268/// (`https://compute.googleapis.com`). Applications using regional
3269/// endpoints or running in restricted networks (e.g. a network configured
3270/// with [Private Google Access with VPC Service Controls]) may want to
3271/// override this default.
3272/// * [with_credentials()]: by default this client uses
3273/// [Application Default Credentials]. Applications using custom
3274/// authentication may need to override this default.
3275///
3276/// [with_endpoint()]: super::builder::global_vm_extension_policies::ClientBuilder::with_endpoint
3277/// [with_credentials()]: super::builder::global_vm_extension_policies::ClientBuilder::with_credentials
3278/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3279/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3280///
3281/// # Pooling and Cloning
3282///
3283/// `GlobalVmExtensionPolicies` holds a connection pool internally, it is advised to
3284/// create one and reuse it. You do not need to wrap `GlobalVmExtensionPolicies` in
3285/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3286/// already uses an `Arc` internally.
3287#[cfg(feature = "global-vm-extension-policies")]
3288#[cfg_attr(docsrs, doc(cfg(feature = "global-vm-extension-policies")))]
3289#[derive(Clone, Debug)]
3290pub struct GlobalVmExtensionPolicies {
3291 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalVmExtensionPolicies>,
3292}
3293
3294#[cfg(feature = "global-vm-extension-policies")]
3295impl GlobalVmExtensionPolicies {
3296 /// Returns a builder for [GlobalVmExtensionPolicies].
3297 ///
3298 /// ```
3299 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3300 /// # use google_cloud_compute_v1::client::GlobalVmExtensionPolicies;
3301 /// let client = GlobalVmExtensionPolicies::builder().build().await?;
3302 /// # Ok(()) }
3303 /// ```
3304 pub fn builder() -> super::builder::global_vm_extension_policies::ClientBuilder {
3305 crate::new_client_builder(super::builder::global_vm_extension_policies::client::Factory)
3306 }
3307
3308 /// Creates a new client from the provided stub.
3309 ///
3310 /// The most common case for calling this function is in tests mocking the
3311 /// client's behavior.
3312 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
3313 where
3314 T: super::stub::GlobalVmExtensionPolicies + 'static,
3315 {
3316 Self { inner: stub.into() }
3317 }
3318
3319 pub(crate) async fn new(
3320 config: gaxi::options::ClientConfig,
3321 ) -> crate::ClientBuilderResult<Self> {
3322 let inner = Self::build_inner(config).await?;
3323 Ok(Self { inner })
3324 }
3325
3326 async fn build_inner(
3327 conf: gaxi::options::ClientConfig,
3328 ) -> crate::ClientBuilderResult<
3329 std::sync::Arc<dyn super::stub::dynamic::GlobalVmExtensionPolicies>,
3330 > {
3331 if gaxi::options::tracing_enabled(&conf) {
3332 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3333 }
3334 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3335 }
3336
3337 async fn build_transport(
3338 conf: gaxi::options::ClientConfig,
3339 ) -> crate::ClientBuilderResult<impl super::stub::GlobalVmExtensionPolicies> {
3340 super::transport::GlobalVmExtensionPolicies::new(conf).await
3341 }
3342
3343 async fn build_with_tracing(
3344 conf: gaxi::options::ClientConfig,
3345 ) -> crate::ClientBuilderResult<impl super::stub::GlobalVmExtensionPolicies> {
3346 Self::build_transport(conf)
3347 .await
3348 .map(super::tracing::GlobalVmExtensionPolicies::new)
3349 }
3350
3351 /// Retrieves the list of all VM Extension Policy resources
3352 /// available to the specified project.
3353 ///
3354 /// To prevent failure, it's recommended that you set the
3355 /// `returnPartialSuccess` parameter to `true`.
3356 pub fn aggregated_list(&self) -> super::builder::global_vm_extension_policies::AggregatedList {
3357 super::builder::global_vm_extension_policies::AggregatedList::new(self.inner.clone())
3358 }
3359
3360 /// Purge scoped resources (zonal policies) from a global VM extension
3361 /// policy, and then delete the global VM extension policy. Purge of the scoped
3362 /// resources is a pre-condition of the global VM extension policy deletion.
3363 /// The deletion of the global VM extension policy happens after the purge
3364 /// rollout is done, so it's not a part of the LRO. It's an automatic process
3365 /// that triggers in the backend.
3366 pub fn delete(&self) -> super::builder::global_vm_extension_policies::Delete {
3367 super::builder::global_vm_extension_policies::Delete::new(self.inner.clone())
3368 }
3369
3370 /// Gets details of a global VM extension policy.
3371 pub fn get(&self) -> super::builder::global_vm_extension_policies::Get {
3372 super::builder::global_vm_extension_policies::Get::new(self.inner.clone())
3373 }
3374
3375 /// Creates a new project level GlobalVmExtensionPolicy.
3376 pub fn insert(&self) -> super::builder::global_vm_extension_policies::Insert {
3377 super::builder::global_vm_extension_policies::Insert::new(self.inner.clone())
3378 }
3379
3380 /// Lists global VM extension policies.
3381 pub fn list(&self) -> super::builder::global_vm_extension_policies::List {
3382 super::builder::global_vm_extension_policies::List::new(self.inner.clone())
3383 }
3384
3385 /// Updates a global VM extension policy.
3386 pub fn update(&self) -> super::builder::global_vm_extension_policies::Update {
3387 super::builder::global_vm_extension_policies::Update::new(self.inner.clone())
3388 }
3389
3390 /// Retrieves the specified Operations resource.
3391 pub fn get_operation(&self) -> super::builder::global_vm_extension_policies::GetOperation {
3392 super::builder::global_vm_extension_policies::GetOperation::new(self.inner.clone())
3393 }
3394}
3395
3396/// Implements a client for the Compute Engine API.
3397///
3398/// # Example
3399/// ```
3400/// # use google_cloud_compute_v1::client::HealthChecks;
3401/// async fn sample(
3402/// ) -> anyhow::Result<()> {
3403/// let client = HealthChecks::builder().build().await?;
3404/// // use `client` to make requests to the Compute Engine API.
3405/// Ok(())
3406/// }
3407/// ```
3408///
3409/// # Service Description
3410///
3411/// Service for the `healthChecks` resource.
3412///
3413/// # Configuration
3414///
3415/// To configure `HealthChecks` use the `with_*` methods in the type returned
3416/// by [builder()][HealthChecks::builder]. The default configuration should
3417/// work for most applications. Common configuration changes include
3418///
3419/// * [with_endpoint()]: by default this client uses the global default endpoint
3420/// (`https://compute.googleapis.com`). Applications using regional
3421/// endpoints or running in restricted networks (e.g. a network configured
3422/// with [Private Google Access with VPC Service Controls]) may want to
3423/// override this default.
3424/// * [with_credentials()]: by default this client uses
3425/// [Application Default Credentials]. Applications using custom
3426/// authentication may need to override this default.
3427///
3428/// [with_endpoint()]: super::builder::health_checks::ClientBuilder::with_endpoint
3429/// [with_credentials()]: super::builder::health_checks::ClientBuilder::with_credentials
3430/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3431/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3432///
3433/// # Pooling and Cloning
3434///
3435/// `HealthChecks` holds a connection pool internally, it is advised to
3436/// create one and reuse it. You do not need to wrap `HealthChecks` in
3437/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3438/// already uses an `Arc` internally.
3439#[cfg(feature = "health-checks")]
3440#[cfg_attr(docsrs, doc(cfg(feature = "health-checks")))]
3441#[derive(Clone, Debug)]
3442pub struct HealthChecks {
3443 inner: std::sync::Arc<dyn super::stub::dynamic::HealthChecks>,
3444}
3445
3446#[cfg(feature = "health-checks")]
3447impl HealthChecks {
3448 /// Returns a builder for [HealthChecks].
3449 ///
3450 /// ```
3451 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3452 /// # use google_cloud_compute_v1::client::HealthChecks;
3453 /// let client = HealthChecks::builder().build().await?;
3454 /// # Ok(()) }
3455 /// ```
3456 pub fn builder() -> super::builder::health_checks::ClientBuilder {
3457 crate::new_client_builder(super::builder::health_checks::client::Factory)
3458 }
3459
3460 /// Creates a new client from the provided stub.
3461 ///
3462 /// The most common case for calling this function is in tests mocking the
3463 /// client's behavior.
3464 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
3465 where
3466 T: super::stub::HealthChecks + 'static,
3467 {
3468 Self { inner: stub.into() }
3469 }
3470
3471 pub(crate) async fn new(
3472 config: gaxi::options::ClientConfig,
3473 ) -> crate::ClientBuilderResult<Self> {
3474 let inner = Self::build_inner(config).await?;
3475 Ok(Self { inner })
3476 }
3477
3478 async fn build_inner(
3479 conf: gaxi::options::ClientConfig,
3480 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::HealthChecks>> {
3481 if gaxi::options::tracing_enabled(&conf) {
3482 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3483 }
3484 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3485 }
3486
3487 async fn build_transport(
3488 conf: gaxi::options::ClientConfig,
3489 ) -> crate::ClientBuilderResult<impl super::stub::HealthChecks> {
3490 super::transport::HealthChecks::new(conf).await
3491 }
3492
3493 async fn build_with_tracing(
3494 conf: gaxi::options::ClientConfig,
3495 ) -> crate::ClientBuilderResult<impl super::stub::HealthChecks> {
3496 Self::build_transport(conf)
3497 .await
3498 .map(super::tracing::HealthChecks::new)
3499 }
3500
3501 /// Retrieves the list of all HealthCheck resources, regional and global,
3502 /// available to the specified project.
3503 ///
3504 /// To prevent failure, Google recommends that you set the
3505 /// `returnPartialSuccess` parameter to `true`.
3506 pub fn aggregated_list(&self) -> super::builder::health_checks::AggregatedList {
3507 super::builder::health_checks::AggregatedList::new(self.inner.clone())
3508 }
3509
3510 /// Deletes the specified HealthCheck resource.
3511 pub fn delete(&self) -> super::builder::health_checks::Delete {
3512 super::builder::health_checks::Delete::new(self.inner.clone())
3513 }
3514
3515 /// Returns the specified HealthCheck resource.
3516 pub fn get(&self) -> super::builder::health_checks::Get {
3517 super::builder::health_checks::Get::new(self.inner.clone())
3518 }
3519
3520 /// Creates a HealthCheck resource in the specified project using the data
3521 /// included in the request.
3522 pub fn insert(&self) -> super::builder::health_checks::Insert {
3523 super::builder::health_checks::Insert::new(self.inner.clone())
3524 }
3525
3526 /// Retrieves the list of HealthCheck resources available to the specified
3527 /// project.
3528 pub fn list(&self) -> super::builder::health_checks::List {
3529 super::builder::health_checks::List::new(self.inner.clone())
3530 }
3531
3532 /// Updates a HealthCheck resource in the specified project using the data
3533 /// included in the request. This method supportsPATCH
3534 /// semantics and uses theJSON merge
3535 /// patch format and processing rules.
3536 pub fn patch(&self) -> super::builder::health_checks::Patch {
3537 super::builder::health_checks::Patch::new(self.inner.clone())
3538 }
3539
3540 /// Returns permissions that a caller has on the specified resource.
3541 pub fn test_iam_permissions(&self) -> super::builder::health_checks::TestIamPermissions {
3542 super::builder::health_checks::TestIamPermissions::new(self.inner.clone())
3543 }
3544
3545 /// Updates a HealthCheck resource in the specified project using the data
3546 /// included in the request.
3547 pub fn update(&self) -> super::builder::health_checks::Update {
3548 super::builder::health_checks::Update::new(self.inner.clone())
3549 }
3550
3551 /// Retrieves the specified Operations resource.
3552 pub fn get_operation(&self) -> super::builder::health_checks::GetOperation {
3553 super::builder::health_checks::GetOperation::new(self.inner.clone())
3554 }
3555}
3556
3557/// Implements a client for the Compute Engine API.
3558///
3559/// # Example
3560/// ```
3561/// # use google_cloud_compute_v1::client::Hosts;
3562/// async fn sample(
3563/// ) -> anyhow::Result<()> {
3564/// let client = Hosts::builder().build().await?;
3565/// // use `client` to make requests to the Compute Engine API.
3566/// Ok(())
3567/// }
3568/// ```
3569///
3570/// # Service Description
3571///
3572/// Service for the `hosts` resource.
3573///
3574/// # Configuration
3575///
3576/// To configure `Hosts` use the `with_*` methods in the type returned
3577/// by [builder()][Hosts::builder]. The default configuration should
3578/// work for most applications. Common configuration changes include
3579///
3580/// * [with_endpoint()]: by default this client uses the global default endpoint
3581/// (`https://compute.googleapis.com`). Applications using regional
3582/// endpoints or running in restricted networks (e.g. a network configured
3583/// with [Private Google Access with VPC Service Controls]) may want to
3584/// override this default.
3585/// * [with_credentials()]: by default this client uses
3586/// [Application Default Credentials]. Applications using custom
3587/// authentication may need to override this default.
3588///
3589/// [with_endpoint()]: super::builder::hosts::ClientBuilder::with_endpoint
3590/// [with_credentials()]: super::builder::hosts::ClientBuilder::with_credentials
3591/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3592/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3593///
3594/// # Pooling and Cloning
3595///
3596/// `Hosts` holds a connection pool internally, it is advised to
3597/// create one and reuse it. You do not need to wrap `Hosts` in
3598/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3599/// already uses an `Arc` internally.
3600#[cfg(feature = "hosts")]
3601#[cfg_attr(docsrs, doc(cfg(feature = "hosts")))]
3602#[derive(Clone, Debug)]
3603pub struct Hosts {
3604 inner: std::sync::Arc<dyn super::stub::dynamic::Hosts>,
3605}
3606
3607#[cfg(feature = "hosts")]
3608impl Hosts {
3609 /// Returns a builder for [Hosts].
3610 ///
3611 /// ```
3612 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3613 /// # use google_cloud_compute_v1::client::Hosts;
3614 /// let client = Hosts::builder().build().await?;
3615 /// # Ok(()) }
3616 /// ```
3617 pub fn builder() -> super::builder::hosts::ClientBuilder {
3618 crate::new_client_builder(super::builder::hosts::client::Factory)
3619 }
3620
3621 /// Creates a new client from the provided stub.
3622 ///
3623 /// The most common case for calling this function is in tests mocking the
3624 /// client's behavior.
3625 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
3626 where
3627 T: super::stub::Hosts + 'static,
3628 {
3629 Self { inner: stub.into() }
3630 }
3631
3632 pub(crate) async fn new(
3633 config: gaxi::options::ClientConfig,
3634 ) -> crate::ClientBuilderResult<Self> {
3635 let inner = Self::build_inner(config).await?;
3636 Ok(Self { inner })
3637 }
3638
3639 async fn build_inner(
3640 conf: gaxi::options::ClientConfig,
3641 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Hosts>> {
3642 if gaxi::options::tracing_enabled(&conf) {
3643 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3644 }
3645 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3646 }
3647
3648 async fn build_transport(
3649 conf: gaxi::options::ClientConfig,
3650 ) -> crate::ClientBuilderResult<impl super::stub::Hosts> {
3651 super::transport::Hosts::new(conf).await
3652 }
3653
3654 async fn build_with_tracing(
3655 conf: gaxi::options::ClientConfig,
3656 ) -> crate::ClientBuilderResult<impl super::stub::Hosts> {
3657 Self::build_transport(conf)
3658 .await
3659 .map(super::tracing::Hosts::new)
3660 }
3661
3662 /// Retrieves information about the specified host.
3663 pub fn get(&self) -> super::builder::hosts::Get {
3664 super::builder::hosts::Get::new(self.inner.clone())
3665 }
3666
3667 /// Allows customers to get SBOM versions of a host.
3668 pub fn get_version(&self) -> super::builder::hosts::GetVersion {
3669 super::builder::hosts::GetVersion::new(self.inner.clone())
3670 }
3671
3672 /// Retrieves a list of hosts.
3673 pub fn list(&self) -> super::builder::hosts::List {
3674 super::builder::hosts::List::new(self.inner.clone())
3675 }
3676
3677 /// Retrieves the specified zone-specific Operations resource.
3678 pub fn get_operation(&self) -> super::builder::hosts::GetOperation {
3679 super::builder::hosts::GetOperation::new(self.inner.clone())
3680 }
3681}
3682
3683/// Implements a client for the Compute Engine API.
3684///
3685/// # Example
3686/// ```
3687/// # use google_cloud_compute_v1::client::HttpHealthChecks;
3688/// async fn sample(
3689/// ) -> anyhow::Result<()> {
3690/// let client = HttpHealthChecks::builder().build().await?;
3691/// // use `client` to make requests to the Compute Engine API.
3692/// Ok(())
3693/// }
3694/// ```
3695///
3696/// # Service Description
3697///
3698/// Service for the `httpHealthChecks` resource.
3699///
3700/// # Configuration
3701///
3702/// To configure `HttpHealthChecks` use the `with_*` methods in the type returned
3703/// by [builder()][HttpHealthChecks::builder]. The default configuration should
3704/// work for most applications. Common configuration changes include
3705///
3706/// * [with_endpoint()]: by default this client uses the global default endpoint
3707/// (`https://compute.googleapis.com`). Applications using regional
3708/// endpoints or running in restricted networks (e.g. a network configured
3709/// with [Private Google Access with VPC Service Controls]) may want to
3710/// override this default.
3711/// * [with_credentials()]: by default this client uses
3712/// [Application Default Credentials]. Applications using custom
3713/// authentication may need to override this default.
3714///
3715/// [with_endpoint()]: super::builder::http_health_checks::ClientBuilder::with_endpoint
3716/// [with_credentials()]: super::builder::http_health_checks::ClientBuilder::with_credentials
3717/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3718/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3719///
3720/// # Pooling and Cloning
3721///
3722/// `HttpHealthChecks` holds a connection pool internally, it is advised to
3723/// create one and reuse it. You do not need to wrap `HttpHealthChecks` in
3724/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3725/// already uses an `Arc` internally.
3726#[cfg(feature = "http-health-checks")]
3727#[cfg_attr(docsrs, doc(cfg(feature = "http-health-checks")))]
3728#[derive(Clone, Debug)]
3729pub struct HttpHealthChecks {
3730 inner: std::sync::Arc<dyn super::stub::dynamic::HttpHealthChecks>,
3731}
3732
3733#[cfg(feature = "http-health-checks")]
3734impl HttpHealthChecks {
3735 /// Returns a builder for [HttpHealthChecks].
3736 ///
3737 /// ```
3738 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3739 /// # use google_cloud_compute_v1::client::HttpHealthChecks;
3740 /// let client = HttpHealthChecks::builder().build().await?;
3741 /// # Ok(()) }
3742 /// ```
3743 pub fn builder() -> super::builder::http_health_checks::ClientBuilder {
3744 crate::new_client_builder(super::builder::http_health_checks::client::Factory)
3745 }
3746
3747 /// Creates a new client from the provided stub.
3748 ///
3749 /// The most common case for calling this function is in tests mocking the
3750 /// client's behavior.
3751 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
3752 where
3753 T: super::stub::HttpHealthChecks + 'static,
3754 {
3755 Self { inner: stub.into() }
3756 }
3757
3758 pub(crate) async fn new(
3759 config: gaxi::options::ClientConfig,
3760 ) -> crate::ClientBuilderResult<Self> {
3761 let inner = Self::build_inner(config).await?;
3762 Ok(Self { inner })
3763 }
3764
3765 async fn build_inner(
3766 conf: gaxi::options::ClientConfig,
3767 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::HttpHealthChecks>>
3768 {
3769 if gaxi::options::tracing_enabled(&conf) {
3770 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3771 }
3772 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3773 }
3774
3775 async fn build_transport(
3776 conf: gaxi::options::ClientConfig,
3777 ) -> crate::ClientBuilderResult<impl super::stub::HttpHealthChecks> {
3778 super::transport::HttpHealthChecks::new(conf).await
3779 }
3780
3781 async fn build_with_tracing(
3782 conf: gaxi::options::ClientConfig,
3783 ) -> crate::ClientBuilderResult<impl super::stub::HttpHealthChecks> {
3784 Self::build_transport(conf)
3785 .await
3786 .map(super::tracing::HttpHealthChecks::new)
3787 }
3788
3789 /// Deletes the specified HttpHealthCheck resource.
3790 pub fn delete(&self) -> super::builder::http_health_checks::Delete {
3791 super::builder::http_health_checks::Delete::new(self.inner.clone())
3792 }
3793
3794 /// Returns the specified HttpHealthCheck resource.
3795 pub fn get(&self) -> super::builder::http_health_checks::Get {
3796 super::builder::http_health_checks::Get::new(self.inner.clone())
3797 }
3798
3799 /// Creates a HttpHealthCheck resource in the specified project using the data
3800 /// included in the request.
3801 pub fn insert(&self) -> super::builder::http_health_checks::Insert {
3802 super::builder::http_health_checks::Insert::new(self.inner.clone())
3803 }
3804
3805 /// Retrieves the list of HttpHealthCheck resources available to the specified
3806 /// project.
3807 pub fn list(&self) -> super::builder::http_health_checks::List {
3808 super::builder::http_health_checks::List::new(self.inner.clone())
3809 }
3810
3811 /// Updates a HttpHealthCheck resource in the specified project using the data
3812 /// included in the request. This method supportsPATCH
3813 /// semantics and uses theJSON merge
3814 /// patch format and processing rules.
3815 pub fn patch(&self) -> super::builder::http_health_checks::Patch {
3816 super::builder::http_health_checks::Patch::new(self.inner.clone())
3817 }
3818
3819 /// Returns permissions that a caller has on the specified resource.
3820 pub fn test_iam_permissions(&self) -> super::builder::http_health_checks::TestIamPermissions {
3821 super::builder::http_health_checks::TestIamPermissions::new(self.inner.clone())
3822 }
3823
3824 /// Updates a HttpHealthCheck resource in the specified project using the data
3825 /// included in the request.
3826 pub fn update(&self) -> super::builder::http_health_checks::Update {
3827 super::builder::http_health_checks::Update::new(self.inner.clone())
3828 }
3829
3830 /// Retrieves the specified Operations resource.
3831 pub fn get_operation(&self) -> super::builder::http_health_checks::GetOperation {
3832 super::builder::http_health_checks::GetOperation::new(self.inner.clone())
3833 }
3834}
3835
3836/// Implements a client for the Compute Engine API.
3837///
3838/// # Example
3839/// ```
3840/// # use google_cloud_compute_v1::client::HttpsHealthChecks;
3841/// async fn sample(
3842/// ) -> anyhow::Result<()> {
3843/// let client = HttpsHealthChecks::builder().build().await?;
3844/// // use `client` to make requests to the Compute Engine API.
3845/// Ok(())
3846/// }
3847/// ```
3848///
3849/// # Service Description
3850///
3851/// Service for the `httpsHealthChecks` resource.
3852///
3853/// # Configuration
3854///
3855/// To configure `HttpsHealthChecks` use the `with_*` methods in the type returned
3856/// by [builder()][HttpsHealthChecks::builder]. The default configuration should
3857/// work for most applications. Common configuration changes include
3858///
3859/// * [with_endpoint()]: by default this client uses the global default endpoint
3860/// (`https://compute.googleapis.com`). Applications using regional
3861/// endpoints or running in restricted networks (e.g. a network configured
3862/// with [Private Google Access with VPC Service Controls]) may want to
3863/// override this default.
3864/// * [with_credentials()]: by default this client uses
3865/// [Application Default Credentials]. Applications using custom
3866/// authentication may need to override this default.
3867///
3868/// [with_endpoint()]: super::builder::https_health_checks::ClientBuilder::with_endpoint
3869/// [with_credentials()]: super::builder::https_health_checks::ClientBuilder::with_credentials
3870/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3871/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3872///
3873/// # Pooling and Cloning
3874///
3875/// `HttpsHealthChecks` holds a connection pool internally, it is advised to
3876/// create one and reuse it. You do not need to wrap `HttpsHealthChecks` in
3877/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3878/// already uses an `Arc` internally.
3879#[cfg(feature = "https-health-checks")]
3880#[cfg_attr(docsrs, doc(cfg(feature = "https-health-checks")))]
3881#[derive(Clone, Debug)]
3882pub struct HttpsHealthChecks {
3883 inner: std::sync::Arc<dyn super::stub::dynamic::HttpsHealthChecks>,
3884}
3885
3886#[cfg(feature = "https-health-checks")]
3887impl HttpsHealthChecks {
3888 /// Returns a builder for [HttpsHealthChecks].
3889 ///
3890 /// ```
3891 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3892 /// # use google_cloud_compute_v1::client::HttpsHealthChecks;
3893 /// let client = HttpsHealthChecks::builder().build().await?;
3894 /// # Ok(()) }
3895 /// ```
3896 pub fn builder() -> super::builder::https_health_checks::ClientBuilder {
3897 crate::new_client_builder(super::builder::https_health_checks::client::Factory)
3898 }
3899
3900 /// Creates a new client from the provided stub.
3901 ///
3902 /// The most common case for calling this function is in tests mocking the
3903 /// client's behavior.
3904 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
3905 where
3906 T: super::stub::HttpsHealthChecks + 'static,
3907 {
3908 Self { inner: stub.into() }
3909 }
3910
3911 pub(crate) async fn new(
3912 config: gaxi::options::ClientConfig,
3913 ) -> crate::ClientBuilderResult<Self> {
3914 let inner = Self::build_inner(config).await?;
3915 Ok(Self { inner })
3916 }
3917
3918 async fn build_inner(
3919 conf: gaxi::options::ClientConfig,
3920 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::HttpsHealthChecks>>
3921 {
3922 if gaxi::options::tracing_enabled(&conf) {
3923 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3924 }
3925 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3926 }
3927
3928 async fn build_transport(
3929 conf: gaxi::options::ClientConfig,
3930 ) -> crate::ClientBuilderResult<impl super::stub::HttpsHealthChecks> {
3931 super::transport::HttpsHealthChecks::new(conf).await
3932 }
3933
3934 async fn build_with_tracing(
3935 conf: gaxi::options::ClientConfig,
3936 ) -> crate::ClientBuilderResult<impl super::stub::HttpsHealthChecks> {
3937 Self::build_transport(conf)
3938 .await
3939 .map(super::tracing::HttpsHealthChecks::new)
3940 }
3941
3942 /// Deletes the specified HttpsHealthCheck resource.
3943 pub fn delete(&self) -> super::builder::https_health_checks::Delete {
3944 super::builder::https_health_checks::Delete::new(self.inner.clone())
3945 }
3946
3947 /// Returns the specified HttpsHealthCheck resource.
3948 pub fn get(&self) -> super::builder::https_health_checks::Get {
3949 super::builder::https_health_checks::Get::new(self.inner.clone())
3950 }
3951
3952 /// Creates a HttpsHealthCheck resource in the specified project using the data
3953 /// included in the request.
3954 pub fn insert(&self) -> super::builder::https_health_checks::Insert {
3955 super::builder::https_health_checks::Insert::new(self.inner.clone())
3956 }
3957
3958 /// Retrieves the list of HttpsHealthCheck resources available to the specified
3959 /// project.
3960 pub fn list(&self) -> super::builder::https_health_checks::List {
3961 super::builder::https_health_checks::List::new(self.inner.clone())
3962 }
3963
3964 /// Updates a HttpsHealthCheck resource in the specified project using the data
3965 /// included in the request. This method supportsPATCH
3966 /// semantics and uses theJSON merge
3967 /// patch format and processing rules.
3968 pub fn patch(&self) -> super::builder::https_health_checks::Patch {
3969 super::builder::https_health_checks::Patch::new(self.inner.clone())
3970 }
3971
3972 /// Returns permissions that a caller has on the specified resource.
3973 pub fn test_iam_permissions(&self) -> super::builder::https_health_checks::TestIamPermissions {
3974 super::builder::https_health_checks::TestIamPermissions::new(self.inner.clone())
3975 }
3976
3977 /// Updates a HttpsHealthCheck resource in the specified project using the data
3978 /// included in the request.
3979 pub fn update(&self) -> super::builder::https_health_checks::Update {
3980 super::builder::https_health_checks::Update::new(self.inner.clone())
3981 }
3982
3983 /// Retrieves the specified Operations resource.
3984 pub fn get_operation(&self) -> super::builder::https_health_checks::GetOperation {
3985 super::builder::https_health_checks::GetOperation::new(self.inner.clone())
3986 }
3987}
3988
3989/// Implements a client for the Compute Engine API.
3990///
3991/// # Example
3992/// ```
3993/// # use google_cloud_compute_v1::client::ImageFamilyViews;
3994/// async fn sample(
3995/// ) -> anyhow::Result<()> {
3996/// let client = ImageFamilyViews::builder().build().await?;
3997/// // use `client` to make requests to the Compute Engine API.
3998/// Ok(())
3999/// }
4000/// ```
4001///
4002/// # Service Description
4003///
4004/// Service for the `imageFamilyViews` resource.
4005///
4006/// # Configuration
4007///
4008/// To configure `ImageFamilyViews` use the `with_*` methods in the type returned
4009/// by [builder()][ImageFamilyViews::builder]. The default configuration should
4010/// work for most applications. Common configuration changes include
4011///
4012/// * [with_endpoint()]: by default this client uses the global default endpoint
4013/// (`https://compute.googleapis.com`). Applications using regional
4014/// endpoints or running in restricted networks (e.g. a network configured
4015/// with [Private Google Access with VPC Service Controls]) may want to
4016/// override this default.
4017/// * [with_credentials()]: by default this client uses
4018/// [Application Default Credentials]. Applications using custom
4019/// authentication may need to override this default.
4020///
4021/// [with_endpoint()]: super::builder::image_family_views::ClientBuilder::with_endpoint
4022/// [with_credentials()]: super::builder::image_family_views::ClientBuilder::with_credentials
4023/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4024/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4025///
4026/// # Pooling and Cloning
4027///
4028/// `ImageFamilyViews` holds a connection pool internally, it is advised to
4029/// create one and reuse it. You do not need to wrap `ImageFamilyViews` in
4030/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4031/// already uses an `Arc` internally.
4032#[cfg(feature = "image-family-views")]
4033#[cfg_attr(docsrs, doc(cfg(feature = "image-family-views")))]
4034#[derive(Clone, Debug)]
4035pub struct ImageFamilyViews {
4036 inner: std::sync::Arc<dyn super::stub::dynamic::ImageFamilyViews>,
4037}
4038
4039#[cfg(feature = "image-family-views")]
4040impl ImageFamilyViews {
4041 /// Returns a builder for [ImageFamilyViews].
4042 ///
4043 /// ```
4044 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4045 /// # use google_cloud_compute_v1::client::ImageFamilyViews;
4046 /// let client = ImageFamilyViews::builder().build().await?;
4047 /// # Ok(()) }
4048 /// ```
4049 pub fn builder() -> super::builder::image_family_views::ClientBuilder {
4050 crate::new_client_builder(super::builder::image_family_views::client::Factory)
4051 }
4052
4053 /// Creates a new client from the provided stub.
4054 ///
4055 /// The most common case for calling this function is in tests mocking the
4056 /// client's behavior.
4057 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
4058 where
4059 T: super::stub::ImageFamilyViews + 'static,
4060 {
4061 Self { inner: stub.into() }
4062 }
4063
4064 pub(crate) async fn new(
4065 config: gaxi::options::ClientConfig,
4066 ) -> crate::ClientBuilderResult<Self> {
4067 let inner = Self::build_inner(config).await?;
4068 Ok(Self { inner })
4069 }
4070
4071 async fn build_inner(
4072 conf: gaxi::options::ClientConfig,
4073 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ImageFamilyViews>>
4074 {
4075 if gaxi::options::tracing_enabled(&conf) {
4076 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4077 }
4078 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4079 }
4080
4081 async fn build_transport(
4082 conf: gaxi::options::ClientConfig,
4083 ) -> crate::ClientBuilderResult<impl super::stub::ImageFamilyViews> {
4084 super::transport::ImageFamilyViews::new(conf).await
4085 }
4086
4087 async fn build_with_tracing(
4088 conf: gaxi::options::ClientConfig,
4089 ) -> crate::ClientBuilderResult<impl super::stub::ImageFamilyViews> {
4090 Self::build_transport(conf)
4091 .await
4092 .map(super::tracing::ImageFamilyViews::new)
4093 }
4094
4095 /// Returns the latest image that is part of an image family, is not
4096 /// deprecated and is rolled out in the specified zone.
4097 pub fn get(&self) -> super::builder::image_family_views::Get {
4098 super::builder::image_family_views::Get::new(self.inner.clone())
4099 }
4100}
4101
4102/// Implements a client for the Compute Engine API.
4103///
4104/// # Example
4105/// ```
4106/// # use google_cloud_compute_v1::client::Images;
4107/// async fn sample(
4108/// ) -> anyhow::Result<()> {
4109/// let client = Images::builder().build().await?;
4110/// // use `client` to make requests to the Compute Engine API.
4111/// Ok(())
4112/// }
4113/// ```
4114///
4115/// # Service Description
4116///
4117/// Service for the `images` resource.
4118///
4119/// # Configuration
4120///
4121/// To configure `Images` use the `with_*` methods in the type returned
4122/// by [builder()][Images::builder]. The default configuration should
4123/// work for most applications. Common configuration changes include
4124///
4125/// * [with_endpoint()]: by default this client uses the global default endpoint
4126/// (`https://compute.googleapis.com`). Applications using regional
4127/// endpoints or running in restricted networks (e.g. a network configured
4128/// with [Private Google Access with VPC Service Controls]) may want to
4129/// override this default.
4130/// * [with_credentials()]: by default this client uses
4131/// [Application Default Credentials]. Applications using custom
4132/// authentication may need to override this default.
4133///
4134/// [with_endpoint()]: super::builder::images::ClientBuilder::with_endpoint
4135/// [with_credentials()]: super::builder::images::ClientBuilder::with_credentials
4136/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4137/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4138///
4139/// # Pooling and Cloning
4140///
4141/// `Images` holds a connection pool internally, it is advised to
4142/// create one and reuse it. You do not need to wrap `Images` in
4143/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4144/// already uses an `Arc` internally.
4145#[cfg(feature = "images")]
4146#[cfg_attr(docsrs, doc(cfg(feature = "images")))]
4147#[derive(Clone, Debug)]
4148pub struct Images {
4149 inner: std::sync::Arc<dyn super::stub::dynamic::Images>,
4150}
4151
4152#[cfg(feature = "images")]
4153impl Images {
4154 /// Returns a builder for [Images].
4155 ///
4156 /// ```
4157 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4158 /// # use google_cloud_compute_v1::client::Images;
4159 /// let client = Images::builder().build().await?;
4160 /// # Ok(()) }
4161 /// ```
4162 pub fn builder() -> super::builder::images::ClientBuilder {
4163 crate::new_client_builder(super::builder::images::client::Factory)
4164 }
4165
4166 /// Creates a new client from the provided stub.
4167 ///
4168 /// The most common case for calling this function is in tests mocking the
4169 /// client's behavior.
4170 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
4171 where
4172 T: super::stub::Images + 'static,
4173 {
4174 Self { inner: stub.into() }
4175 }
4176
4177 pub(crate) async fn new(
4178 config: gaxi::options::ClientConfig,
4179 ) -> crate::ClientBuilderResult<Self> {
4180 let inner = Self::build_inner(config).await?;
4181 Ok(Self { inner })
4182 }
4183
4184 async fn build_inner(
4185 conf: gaxi::options::ClientConfig,
4186 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Images>> {
4187 if gaxi::options::tracing_enabled(&conf) {
4188 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4189 }
4190 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4191 }
4192
4193 async fn build_transport(
4194 conf: gaxi::options::ClientConfig,
4195 ) -> crate::ClientBuilderResult<impl super::stub::Images> {
4196 super::transport::Images::new(conf).await
4197 }
4198
4199 async fn build_with_tracing(
4200 conf: gaxi::options::ClientConfig,
4201 ) -> crate::ClientBuilderResult<impl super::stub::Images> {
4202 Self::build_transport(conf)
4203 .await
4204 .map(super::tracing::Images::new)
4205 }
4206
4207 /// Deletes the specified image.
4208 pub fn delete(&self) -> super::builder::images::Delete {
4209 super::builder::images::Delete::new(self.inner.clone())
4210 }
4211
4212 /// Sets the deprecation status of an image.
4213 ///
4214 /// If an empty request body is given, clears the deprecation status instead.
4215 pub fn deprecate(&self) -> super::builder::images::Deprecate {
4216 super::builder::images::Deprecate::new(self.inner.clone())
4217 }
4218
4219 /// Returns the specified image.
4220 pub fn get(&self) -> super::builder::images::Get {
4221 super::builder::images::Get::new(self.inner.clone())
4222 }
4223
4224 /// Returns the latest image that is part of an image family and is not
4225 /// deprecated. For more information on image families, seePublic
4226 /// image families documentation.
4227 pub fn get_from_family(&self) -> super::builder::images::GetFromFamily {
4228 super::builder::images::GetFromFamily::new(self.inner.clone())
4229 }
4230
4231 /// Gets the access control policy for a resource. May be empty if no such
4232 /// policy or resource exists.
4233 pub fn get_iam_policy(&self) -> super::builder::images::GetIamPolicy {
4234 super::builder::images::GetIamPolicy::new(self.inner.clone())
4235 }
4236
4237 /// Creates an image in the specified project using the data included
4238 /// in the request.
4239 pub fn insert(&self) -> super::builder::images::Insert {
4240 super::builder::images::Insert::new(self.inner.clone())
4241 }
4242
4243 /// Retrieves the list of custom images
4244 /// available to the specified project. Custom images are images you
4245 /// create that belong to your project. This method does not
4246 /// get any images that belong to other projects, including publicly-available
4247 /// images, like Debian 8. If you want to get a list of publicly-available
4248 /// images, use this method to make a request to the respective image project,
4249 /// such as debian-cloud or windows-cloud.
4250 pub fn list(&self) -> super::builder::images::List {
4251 super::builder::images::List::new(self.inner.clone())
4252 }
4253
4254 /// Patches the specified image with the data included in the request.
4255 /// Only the following fields can be modified: family, description,
4256 /// deprecation status.
4257 pub fn patch(&self) -> super::builder::images::Patch {
4258 super::builder::images::Patch::new(self.inner.clone())
4259 }
4260
4261 /// Sets the access control policy on the specified resource.
4262 /// Replaces any existing policy.
4263 pub fn set_iam_policy(&self) -> super::builder::images::SetIamPolicy {
4264 super::builder::images::SetIamPolicy::new(self.inner.clone())
4265 }
4266
4267 /// Sets the labels on an image. To learn more about labels, read theLabeling
4268 /// Resources documentation.
4269 pub fn set_labels(&self) -> super::builder::images::SetLabels {
4270 super::builder::images::SetLabels::new(self.inner.clone())
4271 }
4272
4273 /// Returns permissions that a caller has on the specified resource.
4274 pub fn test_iam_permissions(&self) -> super::builder::images::TestIamPermissions {
4275 super::builder::images::TestIamPermissions::new(self.inner.clone())
4276 }
4277
4278 /// Retrieves the specified Operations resource.
4279 pub fn get_operation(&self) -> super::builder::images::GetOperation {
4280 super::builder::images::GetOperation::new(self.inner.clone())
4281 }
4282}
4283
4284/// Implements a client for the Compute Engine API.
4285///
4286/// # Example
4287/// ```
4288/// # use google_cloud_compute_v1::client::InstanceGroupManagerResizeRequests;
4289/// async fn sample(
4290/// ) -> anyhow::Result<()> {
4291/// let client = InstanceGroupManagerResizeRequests::builder().build().await?;
4292/// // use `client` to make requests to the Compute Engine API.
4293/// Ok(())
4294/// }
4295/// ```
4296///
4297/// # Service Description
4298///
4299/// Service for the `instanceGroupManagerResizeRequests` resource.
4300///
4301/// # Configuration
4302///
4303/// To configure `InstanceGroupManagerResizeRequests` use the `with_*` methods in the type returned
4304/// by [builder()][InstanceGroupManagerResizeRequests::builder]. The default configuration should
4305/// work for most applications. Common configuration changes include
4306///
4307/// * [with_endpoint()]: by default this client uses the global default endpoint
4308/// (`https://compute.googleapis.com`). Applications using regional
4309/// endpoints or running in restricted networks (e.g. a network configured
4310/// with [Private Google Access with VPC Service Controls]) may want to
4311/// override this default.
4312/// * [with_credentials()]: by default this client uses
4313/// [Application Default Credentials]. Applications using custom
4314/// authentication may need to override this default.
4315///
4316/// [with_endpoint()]: super::builder::instance_group_manager_resize_requests::ClientBuilder::with_endpoint
4317/// [with_credentials()]: super::builder::instance_group_manager_resize_requests::ClientBuilder::with_credentials
4318/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4319/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4320///
4321/// # Pooling and Cloning
4322///
4323/// `InstanceGroupManagerResizeRequests` holds a connection pool internally, it is advised to
4324/// create one and reuse it. You do not need to wrap `InstanceGroupManagerResizeRequests` in
4325/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4326/// already uses an `Arc` internally.
4327#[cfg(feature = "instance-group-manager-resize-requests")]
4328#[cfg_attr(docsrs, doc(cfg(feature = "instance-group-manager-resize-requests")))]
4329#[derive(Clone, Debug)]
4330pub struct InstanceGroupManagerResizeRequests {
4331 inner: std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagerResizeRequests>,
4332}
4333
4334#[cfg(feature = "instance-group-manager-resize-requests")]
4335impl InstanceGroupManagerResizeRequests {
4336 /// Returns a builder for [InstanceGroupManagerResizeRequests].
4337 ///
4338 /// ```
4339 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4340 /// # use google_cloud_compute_v1::client::InstanceGroupManagerResizeRequests;
4341 /// let client = InstanceGroupManagerResizeRequests::builder().build().await?;
4342 /// # Ok(()) }
4343 /// ```
4344 pub fn builder() -> super::builder::instance_group_manager_resize_requests::ClientBuilder {
4345 crate::new_client_builder(
4346 super::builder::instance_group_manager_resize_requests::client::Factory,
4347 )
4348 }
4349
4350 /// Creates a new client from the provided stub.
4351 ///
4352 /// The most common case for calling this function is in tests mocking the
4353 /// client's behavior.
4354 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
4355 where
4356 T: super::stub::InstanceGroupManagerResizeRequests + 'static,
4357 {
4358 Self { inner: stub.into() }
4359 }
4360
4361 pub(crate) async fn new(
4362 config: gaxi::options::ClientConfig,
4363 ) -> crate::ClientBuilderResult<Self> {
4364 let inner = Self::build_inner(config).await?;
4365 Ok(Self { inner })
4366 }
4367
4368 async fn build_inner(
4369 conf: gaxi::options::ClientConfig,
4370 ) -> crate::ClientBuilderResult<
4371 std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagerResizeRequests>,
4372 > {
4373 if gaxi::options::tracing_enabled(&conf) {
4374 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4375 }
4376 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4377 }
4378
4379 async fn build_transport(
4380 conf: gaxi::options::ClientConfig,
4381 ) -> crate::ClientBuilderResult<impl super::stub::InstanceGroupManagerResizeRequests> {
4382 super::transport::InstanceGroupManagerResizeRequests::new(conf).await
4383 }
4384
4385 async fn build_with_tracing(
4386 conf: gaxi::options::ClientConfig,
4387 ) -> crate::ClientBuilderResult<impl super::stub::InstanceGroupManagerResizeRequests> {
4388 Self::build_transport(conf)
4389 .await
4390 .map(super::tracing::InstanceGroupManagerResizeRequests::new)
4391 }
4392
4393 /// Cancels the specified resize request and removes it from the queue.
4394 /// Cancelled resize request does no longer wait for the resources to be
4395 /// provisioned. Cancel is only possible for requests that are accepted in the
4396 /// queue.
4397 pub fn cancel(&self) -> super::builder::instance_group_manager_resize_requests::Cancel {
4398 super::builder::instance_group_manager_resize_requests::Cancel::new(self.inner.clone())
4399 }
4400
4401 /// Deletes the specified, inactive resize request. Requests that are still
4402 /// active cannot be deleted. Deleting request does not delete instances that
4403 /// were provisioned previously.
4404 pub fn delete(&self) -> super::builder::instance_group_manager_resize_requests::Delete {
4405 super::builder::instance_group_manager_resize_requests::Delete::new(self.inner.clone())
4406 }
4407
4408 /// Returns all of the details about the specified resize request.
4409 pub fn get(&self) -> super::builder::instance_group_manager_resize_requests::Get {
4410 super::builder::instance_group_manager_resize_requests::Get::new(self.inner.clone())
4411 }
4412
4413 /// Creates a new resize request that starts provisioning VMs immediately
4414 /// or queues VM creation.
4415 pub fn insert(&self) -> super::builder::instance_group_manager_resize_requests::Insert {
4416 super::builder::instance_group_manager_resize_requests::Insert::new(self.inner.clone())
4417 }
4418
4419 /// Retrieves a list of resize requests that are contained in the
4420 /// managed instance group.
4421 pub fn list(&self) -> super::builder::instance_group_manager_resize_requests::List {
4422 super::builder::instance_group_manager_resize_requests::List::new(self.inner.clone())
4423 }
4424
4425 /// Retrieves the specified zone-specific Operations resource.
4426 pub fn get_operation(
4427 &self,
4428 ) -> super::builder::instance_group_manager_resize_requests::GetOperation {
4429 super::builder::instance_group_manager_resize_requests::GetOperation::new(
4430 self.inner.clone(),
4431 )
4432 }
4433}
4434
4435/// Implements a client for the Compute Engine API.
4436///
4437/// # Example
4438/// ```
4439/// # use google_cloud_compute_v1::client::InstanceGroupManagers;
4440/// async fn sample(
4441/// ) -> anyhow::Result<()> {
4442/// let client = InstanceGroupManagers::builder().build().await?;
4443/// // use `client` to make requests to the Compute Engine API.
4444/// Ok(())
4445/// }
4446/// ```
4447///
4448/// # Service Description
4449///
4450/// Service for the `instanceGroupManagers` resource.
4451///
4452/// # Configuration
4453///
4454/// To configure `InstanceGroupManagers` use the `with_*` methods in the type returned
4455/// by [builder()][InstanceGroupManagers::builder]. The default configuration should
4456/// work for most applications. Common configuration changes include
4457///
4458/// * [with_endpoint()]: by default this client uses the global default endpoint
4459/// (`https://compute.googleapis.com`). Applications using regional
4460/// endpoints or running in restricted networks (e.g. a network configured
4461/// with [Private Google Access with VPC Service Controls]) may want to
4462/// override this default.
4463/// * [with_credentials()]: by default this client uses
4464/// [Application Default Credentials]. Applications using custom
4465/// authentication may need to override this default.
4466///
4467/// [with_endpoint()]: super::builder::instance_group_managers::ClientBuilder::with_endpoint
4468/// [with_credentials()]: super::builder::instance_group_managers::ClientBuilder::with_credentials
4469/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4470/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4471///
4472/// # Pooling and Cloning
4473///
4474/// `InstanceGroupManagers` holds a connection pool internally, it is advised to
4475/// create one and reuse it. You do not need to wrap `InstanceGroupManagers` in
4476/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4477/// already uses an `Arc` internally.
4478#[cfg(feature = "instance-group-managers")]
4479#[cfg_attr(docsrs, doc(cfg(feature = "instance-group-managers")))]
4480#[derive(Clone, Debug)]
4481pub struct InstanceGroupManagers {
4482 inner: std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagers>,
4483}
4484
4485#[cfg(feature = "instance-group-managers")]
4486impl InstanceGroupManagers {
4487 /// Returns a builder for [InstanceGroupManagers].
4488 ///
4489 /// ```
4490 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4491 /// # use google_cloud_compute_v1::client::InstanceGroupManagers;
4492 /// let client = InstanceGroupManagers::builder().build().await?;
4493 /// # Ok(()) }
4494 /// ```
4495 pub fn builder() -> super::builder::instance_group_managers::ClientBuilder {
4496 crate::new_client_builder(super::builder::instance_group_managers::client::Factory)
4497 }
4498
4499 /// Creates a new client from the provided stub.
4500 ///
4501 /// The most common case for calling this function is in tests mocking the
4502 /// client's behavior.
4503 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
4504 where
4505 T: super::stub::InstanceGroupManagers + 'static,
4506 {
4507 Self { inner: stub.into() }
4508 }
4509
4510 pub(crate) async fn new(
4511 config: gaxi::options::ClientConfig,
4512 ) -> crate::ClientBuilderResult<Self> {
4513 let inner = Self::build_inner(config).await?;
4514 Ok(Self { inner })
4515 }
4516
4517 async fn build_inner(
4518 conf: gaxi::options::ClientConfig,
4519 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagers>>
4520 {
4521 if gaxi::options::tracing_enabled(&conf) {
4522 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4523 }
4524 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4525 }
4526
4527 async fn build_transport(
4528 conf: gaxi::options::ClientConfig,
4529 ) -> crate::ClientBuilderResult<impl super::stub::InstanceGroupManagers> {
4530 super::transport::InstanceGroupManagers::new(conf).await
4531 }
4532
4533 async fn build_with_tracing(
4534 conf: gaxi::options::ClientConfig,
4535 ) -> crate::ClientBuilderResult<impl super::stub::InstanceGroupManagers> {
4536 Self::build_transport(conf)
4537 .await
4538 .map(super::tracing::InstanceGroupManagers::new)
4539 }
4540
4541 /// Flags the specified instances to be removed from the
4542 /// managed instance group. Abandoning an instance does not delete the
4543 /// instance, but it does remove the instance from any target pools that are
4544 /// applied by the managed instance group. This method reduces thetargetSize of the managed instance group by the
4545 /// number of instances that you abandon. This operation is marked asDONE when the action is scheduled even if the instances have
4546 /// not yet been removed from the group. You must separately verify the
4547 /// status of the abandoning action with thelistmanagedinstances
4548 /// method.
4549 ///
4550 /// If the group is part of a backend
4551 /// service that has enabled
4552 /// connection draining, it can take up to 60 seconds after the connection
4553 /// draining duration has elapsed before the VM instance is removed or deleted.
4554 ///
4555 /// You can specify a maximum of 1000 instances with this method per request.
4556 pub fn abandon_instances(&self) -> super::builder::instance_group_managers::AbandonInstances {
4557 super::builder::instance_group_managers::AbandonInstances::new(self.inner.clone())
4558 }
4559
4560 /// Retrieves the list of managed instance groups and groups them by zone.
4561 ///
4562 /// To prevent failure, Google recommends that you set the
4563 /// `returnPartialSuccess` parameter to `true`.
4564 pub fn aggregated_list(&self) -> super::builder::instance_group_managers::AggregatedList {
4565 super::builder::instance_group_managers::AggregatedList::new(self.inner.clone())
4566 }
4567
4568 /// Applies changes to selected instances on the managed instance group.
4569 /// This method can be used to apply new overrides and/or new versions.
4570 pub fn apply_updates_to_instances(
4571 &self,
4572 ) -> super::builder::instance_group_managers::ApplyUpdatesToInstances {
4573 super::builder::instance_group_managers::ApplyUpdatesToInstances::new(self.inner.clone())
4574 }
4575
4576 /// Creates instances with per-instance configurations in this managed instance
4577 /// group. Instances are created using the current instance template. Thecreate instances operation is marked DONE if thecreateInstances request is successful. The underlying actions
4578 /// take additional time. You must separately verify the status of thecreating or actions with the listmanagedinstances
4579 /// method.
4580 pub fn create_instances(&self) -> super::builder::instance_group_managers::CreateInstances {
4581 super::builder::instance_group_managers::CreateInstances::new(self.inner.clone())
4582 }
4583
4584 /// Deletes the specified managed instance group and all of the instances
4585 /// in that group. Note that the instance group must not belong to a
4586 /// backend service. Read
4587 /// Deleting an instance group for more information.
4588 pub fn delete(&self) -> super::builder::instance_group_managers::Delete {
4589 super::builder::instance_group_managers::Delete::new(self.inner.clone())
4590 }
4591
4592 /// Flags the specified instances in the managed instance group for immediate
4593 /// deletion. The instances are also removed from any target
4594 /// pools of which they were a member. This method reduces thetargetSize of the managed instance group by the number of
4595 /// instances that you delete. This operation is marked as DONE
4596 /// when the action is scheduled even if the instances are still being deleted.
4597 /// You must separately verify the status of the deleting action
4598 /// with thelistmanagedinstances
4599 /// method.
4600 ///
4601 /// If the group is part of a backend
4602 /// service that has enabled
4603 /// connection draining, it can take up to 60 seconds after the connection
4604 /// draining duration has elapsed before the VM instance is removed or deleted.
4605 ///
4606 /// You can specify a maximum of 1000 instances with this method per request.
4607 pub fn delete_instances(&self) -> super::builder::instance_group_managers::DeleteInstances {
4608 super::builder::instance_group_managers::DeleteInstances::new(self.inner.clone())
4609 }
4610
4611 /// Deletes selected per-instance configurations for the managed instance
4612 /// group.
4613 pub fn delete_per_instance_configs(
4614 &self,
4615 ) -> super::builder::instance_group_managers::DeletePerInstanceConfigs {
4616 super::builder::instance_group_managers::DeletePerInstanceConfigs::new(self.inner.clone())
4617 }
4618
4619 /// Returns all of the details about the specified managed instance group.
4620 pub fn get(&self) -> super::builder::instance_group_managers::Get {
4621 super::builder::instance_group_managers::Get::new(self.inner.clone())
4622 }
4623
4624 /// Creates a managed instance group using the information that you specify
4625 /// in the request. After the group is created, instances in the group are
4626 /// created using the specified instance template.
4627 /// This operation is marked as DONE when the group is created
4628 /// even if the instances in the group have not yet been created. You
4629 /// must separately verify the status of the individual instances with thelistmanagedinstances
4630 /// method.
4631 ///
4632 /// A managed instance group can have up to 1000 VM instances per group. Please
4633 /// contact Cloud Support if you need an increase in
4634 /// this limit.
4635 pub fn insert(&self) -> super::builder::instance_group_managers::Insert {
4636 super::builder::instance_group_managers::Insert::new(self.inner.clone())
4637 }
4638
4639 /// Retrieves a list of managed instance groups that are contained within the
4640 /// specified project and zone.
4641 pub fn list(&self) -> super::builder::instance_group_managers::List {
4642 super::builder::instance_group_managers::List::new(self.inner.clone())
4643 }
4644
4645 /// Lists all errors thrown by actions on instances for a given managed
4646 /// instance group. The filter and orderBy query
4647 /// parameters are not supported.
4648 pub fn list_errors(&self) -> super::builder::instance_group_managers::ListErrors {
4649 super::builder::instance_group_managers::ListErrors::new(self.inner.clone())
4650 }
4651
4652 /// Lists all of the instances in the managed instance group. Each instance
4653 /// in the list has a currentAction, which indicates the action
4654 /// that the managed instance group is performing on the instance. For example,
4655 /// if the group is still creating an instance, the currentAction
4656 /// is CREATING. If a previous action failed, the
4657 /// list displays the errors for that failed action. The orderBy
4658 /// query parameter is not supported. The `pageToken` query parameter is
4659 /// supported only if the group's `listManagedInstancesResults` field is set
4660 /// to `PAGINATED`.
4661 pub fn list_managed_instances(
4662 &self,
4663 ) -> super::builder::instance_group_managers::ListManagedInstances {
4664 super::builder::instance_group_managers::ListManagedInstances::new(self.inner.clone())
4665 }
4666
4667 /// Lists all of the per-instance configurations defined for the managed
4668 /// instance group. The orderBy query parameter is not supported.
4669 pub fn list_per_instance_configs(
4670 &self,
4671 ) -> super::builder::instance_group_managers::ListPerInstanceConfigs {
4672 super::builder::instance_group_managers::ListPerInstanceConfigs::new(self.inner.clone())
4673 }
4674
4675 /// Updates a managed instance group using the information that you specify
4676 /// in the request.
4677 /// This operation is marked as DONE when the group is patched
4678 /// even if the instances in the group are still in the process of being
4679 /// patched. You must separately verify the status of the individual instances
4680 /// with thelistManagedInstances
4681 /// method. This method supportsPATCH
4682 /// semantics and uses theJSON merge
4683 /// patch format and processing rules.
4684 ///
4685 /// If you update your group to specify a new template or instance
4686 /// configuration, it's possible that your intended specification for each VM
4687 /// in the group is different from the current state of that VM. To learn how
4688 /// to apply an updated configuration to the VMs in a MIG, seeUpdating instances in
4689 /// a MIG.
4690 pub fn patch(&self) -> super::builder::instance_group_managers::Patch {
4691 super::builder::instance_group_managers::Patch::new(self.inner.clone())
4692 }
4693
4694 /// Inserts or patches per-instance configurations for the managed instance
4695 /// group. perInstanceConfig.name serves as a key used to
4696 /// distinguish whether to perform insert or patch.
4697 pub fn patch_per_instance_configs(
4698 &self,
4699 ) -> super::builder::instance_group_managers::PatchPerInstanceConfigs {
4700 super::builder::instance_group_managers::PatchPerInstanceConfigs::new(self.inner.clone())
4701 }
4702
4703 /// Flags the specified VM instances in the managed instance group to be
4704 /// immediately recreated. Each instance is recreated using the group's current
4705 /// configuration. This operation is marked as DONE when the flag
4706 /// is set even if the instances have not yet been recreated. You must
4707 /// separately verify the status of each instance by checking itscurrentAction field; for more information, see Checking
4708 /// the status of managed instances.
4709 ///
4710 /// If the group is part of a backend
4711 /// service that has enabled
4712 /// connection draining, it can take up to 60 seconds after the connection
4713 /// draining duration has elapsed before the VM instance is removed or deleted.
4714 ///
4715 /// You can specify a maximum of 1000 instances with this method per request.
4716 pub fn recreate_instances(&self) -> super::builder::instance_group_managers::RecreateInstances {
4717 super::builder::instance_group_managers::RecreateInstances::new(self.inner.clone())
4718 }
4719
4720 /// Resizes the managed instance group. If you increase the size, the group
4721 /// creates new instances using the current instance template. If you decrease
4722 /// the size, the group deletes instances. The resize operation is markedDONE when the resize actions are scheduled even if the group
4723 /// has not yet added or deleted any instances. You must separately
4724 /// verify the status of the creating or deleting
4725 /// actions with thelistmanagedinstances
4726 /// method.
4727 ///
4728 /// When resizing down, the instance group arbitrarily chooses the order in
4729 /// which VMs are deleted. The group takes into account some VM attributes when
4730 /// making the selection including:
4731 ///
4732 /// + The status of the VM instance.
4733 /// + The health of the VM instance.
4734 /// + The instance template version the VM is based on.
4735 /// + For regional managed instance groups, the location of the VM instance.
4736 ///
4737 /// This list is subject to change.
4738 ///
4739 /// If the group is part of a backend
4740 /// service that has enabled
4741 /// connection draining, it can take up to 60 seconds after the connection
4742 /// draining duration has elapsed before the VM instance is removed or deleted.
4743 pub fn resize(&self) -> super::builder::instance_group_managers::Resize {
4744 super::builder::instance_group_managers::Resize::new(self.inner.clone())
4745 }
4746
4747 /// Flags the specified instances in the managed instance group to be
4748 /// resumed. This method increases thetargetSize and decreases the targetSuspendedSize
4749 /// of the managed instance group by the number of instances that you resume.
4750 /// The resumeInstances operation is marked DONE if
4751 /// the resumeInstances request is successful. The underlying
4752 /// actions take additional time. You must separately verify the status of theRESUMING action with thelistmanagedinstances
4753 /// method.
4754 ///
4755 /// In this request, you can only specify instances that are suspended. For
4756 /// example, if an instance was previously suspended using the suspendInstances
4757 /// method, it can be resumed using the resumeInstances method.
4758 ///
4759 /// If a health check is attached to the managed instance group, the specified
4760 /// instances will be verified as healthy after they are resumed.
4761 ///
4762 /// You can specify a maximum of 1000 instances with this method per request.
4763 pub fn resume_instances(&self) -> super::builder::instance_group_managers::ResumeInstances {
4764 super::builder::instance_group_managers::ResumeInstances::new(self.inner.clone())
4765 }
4766
4767 /// Specifies the instance template to use when creating new instances in this
4768 /// group. The templates for existing instances in the group do not change
4769 /// unless you run recreateInstances, runapplyUpdatesToInstances, or set the group'supdatePolicy.type to PROACTIVE.
4770 pub fn set_instance_template(
4771 &self,
4772 ) -> super::builder::instance_group_managers::SetInstanceTemplate {
4773 super::builder::instance_group_managers::SetInstanceTemplate::new(self.inner.clone())
4774 }
4775
4776 /// Modifies the target pools to which all instances in this managed instance
4777 /// group are assigned. The target pools automatically apply to all of the
4778 /// instances in the managed instance group. This operation is markedDONE when you make the request even if the instances have not
4779 /// yet been added to their target pools. The change might take some time to
4780 /// apply to all of the instances in the group depending on the size of the
4781 /// group.
4782 pub fn set_target_pools(&self) -> super::builder::instance_group_managers::SetTargetPools {
4783 super::builder::instance_group_managers::SetTargetPools::new(self.inner.clone())
4784 }
4785
4786 /// Flags the specified instances in the managed instance group to be
4787 /// started. This method increases thetargetSize and decreases the targetStoppedSize
4788 /// of the managed instance group by the number of instances that you start.
4789 /// The startInstances operation is marked DONE if
4790 /// the startInstances request is successful. The underlying
4791 /// actions take additional time. You must separately verify the status of theSTARTING action with thelistmanagedinstances
4792 /// method.
4793 ///
4794 /// In this request, you can only specify instances that are stopped. For
4795 /// example, if an instance was previously stopped using the stopInstances
4796 /// method, it can be started using the startInstances method.
4797 ///
4798 /// If a health check is attached to the managed instance group, the specified
4799 /// instances will be verified as healthy after they are started.
4800 ///
4801 /// You can specify a maximum of 1000 instances with this method per request.
4802 pub fn start_instances(&self) -> super::builder::instance_group_managers::StartInstances {
4803 super::builder::instance_group_managers::StartInstances::new(self.inner.clone())
4804 }
4805
4806 /// Flags the specified instances in the managed instance group to be
4807 /// immediately stopped. You can only specify instances that are running in
4808 /// this request. This method reduces thetargetSize and increases the targetStoppedSize
4809 /// of the managed instance group by the number of instances that you stop.
4810 /// The stopInstances operation is marked DONE if
4811 /// the stopInstances request is successful. The underlying
4812 /// actions take additional time. You must separately verify the status of theSTOPPING action with thelistmanagedinstances
4813 /// method.
4814 ///
4815 /// If the standbyPolicy.initialDelaySec field is set, the group
4816 /// delays stopping the instances until initialDelaySec have
4817 /// passed from instance.creationTimestamp (that is, when the
4818 /// instance was created). This delay gives your application time to
4819 /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
4820 /// will be zero delay.
4821 ///
4822 /// If the group is part of a backend
4823 /// service that has enabled
4824 /// connection draining, it can take up to 60 seconds after the connection
4825 /// draining duration has elapsed before the VM instance is stopped.
4826 ///
4827 /// Stopped instances can be started using the startInstances
4828 /// method.
4829 ///
4830 /// You can specify a maximum of 1000 instances with this method per request.
4831 pub fn stop_instances(&self) -> super::builder::instance_group_managers::StopInstances {
4832 super::builder::instance_group_managers::StopInstances::new(self.inner.clone())
4833 }
4834
4835 /// Flags the specified instances in the managed instance group to be
4836 /// immediately suspended. You can only specify instances that are running in
4837 /// this request. This method reduces thetargetSize and increases the targetSuspendedSize
4838 /// of the managed instance group by the number of instances that you suspend.
4839 /// The suspendInstances operation is marked DONE if
4840 /// the suspendInstances request is successful. The underlying
4841 /// actions take additional time. You must separately verify the status of theSUSPENDING action with thelistmanagedinstances
4842 /// method.
4843 ///
4844 /// If the standbyPolicy.initialDelaySec field is set, the group
4845 /// delays suspension of the instances until initialDelaySec have
4846 /// passed from instance.creationTimestamp (that is, when the
4847 /// instance was created). This delay gives your application time to
4848 /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
4849 /// will be zero delay.
4850 ///
4851 /// If the group is part of a backend
4852 /// service that has enabled
4853 /// connection draining, it can take up to 60 seconds after the connection
4854 /// draining duration has elapsed before the VM instance is suspended.
4855 ///
4856 /// Suspended instances can be resumed using the resumeInstances
4857 /// method.
4858 ///
4859 /// You can specify a maximum of 1000 instances with this method per request.
4860 pub fn suspend_instances(&self) -> super::builder::instance_group_managers::SuspendInstances {
4861 super::builder::instance_group_managers::SuspendInstances::new(self.inner.clone())
4862 }
4863
4864 /// Inserts or updates per-instance configurations for the managed instance
4865 /// group. perInstanceConfig.name serves as a key used to
4866 /// distinguish whether to perform insert or patch.
4867 pub fn update_per_instance_configs(
4868 &self,
4869 ) -> super::builder::instance_group_managers::UpdatePerInstanceConfigs {
4870 super::builder::instance_group_managers::UpdatePerInstanceConfigs::new(self.inner.clone())
4871 }
4872
4873 /// Retrieves the specified zone-specific Operations resource.
4874 pub fn get_operation(&self) -> super::builder::instance_group_managers::GetOperation {
4875 super::builder::instance_group_managers::GetOperation::new(self.inner.clone())
4876 }
4877}
4878
4879/// Implements a client for the Compute Engine API.
4880///
4881/// # Example
4882/// ```
4883/// # use google_cloud_compute_v1::client::InstanceGroups;
4884/// async fn sample(
4885/// ) -> anyhow::Result<()> {
4886/// let client = InstanceGroups::builder().build().await?;
4887/// // use `client` to make requests to the Compute Engine API.
4888/// Ok(())
4889/// }
4890/// ```
4891///
4892/// # Service Description
4893///
4894/// Service for the `instanceGroups` resource.
4895///
4896/// # Configuration
4897///
4898/// To configure `InstanceGroups` use the `with_*` methods in the type returned
4899/// by [builder()][InstanceGroups::builder]. The default configuration should
4900/// work for most applications. Common configuration changes include
4901///
4902/// * [with_endpoint()]: by default this client uses the global default endpoint
4903/// (`https://compute.googleapis.com`). Applications using regional
4904/// endpoints or running in restricted networks (e.g. a network configured
4905/// with [Private Google Access with VPC Service Controls]) may want to
4906/// override this default.
4907/// * [with_credentials()]: by default this client uses
4908/// [Application Default Credentials]. Applications using custom
4909/// authentication may need to override this default.
4910///
4911/// [with_endpoint()]: super::builder::instance_groups::ClientBuilder::with_endpoint
4912/// [with_credentials()]: super::builder::instance_groups::ClientBuilder::with_credentials
4913/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4914/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4915///
4916/// # Pooling and Cloning
4917///
4918/// `InstanceGroups` holds a connection pool internally, it is advised to
4919/// create one and reuse it. You do not need to wrap `InstanceGroups` in
4920/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4921/// already uses an `Arc` internally.
4922#[cfg(feature = "instance-groups")]
4923#[cfg_attr(docsrs, doc(cfg(feature = "instance-groups")))]
4924#[derive(Clone, Debug)]
4925pub struct InstanceGroups {
4926 inner: std::sync::Arc<dyn super::stub::dynamic::InstanceGroups>,
4927}
4928
4929#[cfg(feature = "instance-groups")]
4930impl InstanceGroups {
4931 /// Returns a builder for [InstanceGroups].
4932 ///
4933 /// ```
4934 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4935 /// # use google_cloud_compute_v1::client::InstanceGroups;
4936 /// let client = InstanceGroups::builder().build().await?;
4937 /// # Ok(()) }
4938 /// ```
4939 pub fn builder() -> super::builder::instance_groups::ClientBuilder {
4940 crate::new_client_builder(super::builder::instance_groups::client::Factory)
4941 }
4942
4943 /// Creates a new client from the provided stub.
4944 ///
4945 /// The most common case for calling this function is in tests mocking the
4946 /// client's behavior.
4947 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
4948 where
4949 T: super::stub::InstanceGroups + 'static,
4950 {
4951 Self { inner: stub.into() }
4952 }
4953
4954 pub(crate) async fn new(
4955 config: gaxi::options::ClientConfig,
4956 ) -> crate::ClientBuilderResult<Self> {
4957 let inner = Self::build_inner(config).await?;
4958 Ok(Self { inner })
4959 }
4960
4961 async fn build_inner(
4962 conf: gaxi::options::ClientConfig,
4963 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InstanceGroups>> {
4964 if gaxi::options::tracing_enabled(&conf) {
4965 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4966 }
4967 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4968 }
4969
4970 async fn build_transport(
4971 conf: gaxi::options::ClientConfig,
4972 ) -> crate::ClientBuilderResult<impl super::stub::InstanceGroups> {
4973 super::transport::InstanceGroups::new(conf).await
4974 }
4975
4976 async fn build_with_tracing(
4977 conf: gaxi::options::ClientConfig,
4978 ) -> crate::ClientBuilderResult<impl super::stub::InstanceGroups> {
4979 Self::build_transport(conf)
4980 .await
4981 .map(super::tracing::InstanceGroups::new)
4982 }
4983
4984 /// Adds a list of instances to the specified instance group. All of the
4985 /// instances in the instance group must be in the same network/subnetwork.
4986 /// Read
4987 /// Adding instances for more information.
4988 pub fn add_instances(&self) -> super::builder::instance_groups::AddInstances {
4989 super::builder::instance_groups::AddInstances::new(self.inner.clone())
4990 }
4991
4992 /// Retrieves the list of instance groups and sorts them by zone.
4993 ///
4994 /// To prevent failure, Google recommends that you set the
4995 /// `returnPartialSuccess` parameter to `true`.
4996 pub fn aggregated_list(&self) -> super::builder::instance_groups::AggregatedList {
4997 super::builder::instance_groups::AggregatedList::new(self.inner.clone())
4998 }
4999
5000 /// Deletes the specified instance group. The instances in the group are not
5001 /// deleted. Note that instance group must not belong to a backend service.
5002 /// Read
5003 /// Deleting an instance group for more information.
5004 pub fn delete(&self) -> super::builder::instance_groups::Delete {
5005 super::builder::instance_groups::Delete::new(self.inner.clone())
5006 }
5007
5008 /// Returns the specified zonal instance group. Get a list of available zonal
5009 /// instance groups by making a list() request.
5010 ///
5011 /// For managed instance groups, use theinstanceGroupManagers
5012 /// or regionInstanceGroupManagers
5013 /// methods instead.
5014 pub fn get(&self) -> super::builder::instance_groups::Get {
5015 super::builder::instance_groups::Get::new(self.inner.clone())
5016 }
5017
5018 /// Creates an instance group in the specified project using the
5019 /// parameters that are included in the request.
5020 pub fn insert(&self) -> super::builder::instance_groups::Insert {
5021 super::builder::instance_groups::Insert::new(self.inner.clone())
5022 }
5023
5024 /// Retrieves the list of zonal instance group resources contained within the
5025 /// specified zone.
5026 ///
5027 /// For managed instance groups, use theinstanceGroupManagers
5028 /// or regionInstanceGroupManagers
5029 /// methods instead.
5030 pub fn list(&self) -> super::builder::instance_groups::List {
5031 super::builder::instance_groups::List::new(self.inner.clone())
5032 }
5033
5034 /// Lists the instances in the specified instance group.
5035 /// The orderBy query parameter is not supported.
5036 /// The filter query parameter is supported, but only for
5037 /// expressions that use `eq` (equal) or `ne` (not equal) operators.
5038 pub fn list_instances(&self) -> super::builder::instance_groups::ListInstances {
5039 super::builder::instance_groups::ListInstances::new(self.inner.clone())
5040 }
5041
5042 /// Removes one or more instances from the specified instance group, but does
5043 /// not delete those instances.
5044 ///
5045 /// If the group is part of a backend
5046 /// service that has enabled
5047 /// connection draining, it can take up to 60 seconds after the connection
5048 /// draining duration before the VM instance is removed or deleted.
5049 pub fn remove_instances(&self) -> super::builder::instance_groups::RemoveInstances {
5050 super::builder::instance_groups::RemoveInstances::new(self.inner.clone())
5051 }
5052
5053 /// Sets the named ports for the specified instance group.
5054 pub fn set_named_ports(&self) -> super::builder::instance_groups::SetNamedPorts {
5055 super::builder::instance_groups::SetNamedPorts::new(self.inner.clone())
5056 }
5057
5058 /// Returns permissions that a caller has on the specified resource.
5059 pub fn test_iam_permissions(&self) -> super::builder::instance_groups::TestIamPermissions {
5060 super::builder::instance_groups::TestIamPermissions::new(self.inner.clone())
5061 }
5062
5063 /// Retrieves the specified zone-specific Operations resource.
5064 pub fn get_operation(&self) -> super::builder::instance_groups::GetOperation {
5065 super::builder::instance_groups::GetOperation::new(self.inner.clone())
5066 }
5067}
5068
5069/// Implements a client for the Compute Engine API.
5070///
5071/// # Example
5072/// ```
5073/// # use google_cloud_compute_v1::client::InstanceSettings;
5074/// async fn sample(
5075/// ) -> anyhow::Result<()> {
5076/// let client = InstanceSettings::builder().build().await?;
5077/// // use `client` to make requests to the Compute Engine API.
5078/// Ok(())
5079/// }
5080/// ```
5081///
5082/// # Service Description
5083///
5084/// Service for the `instanceSettings` resource.
5085///
5086/// # Configuration
5087///
5088/// To configure `InstanceSettings` use the `with_*` methods in the type returned
5089/// by [builder()][InstanceSettings::builder]. The default configuration should
5090/// work for most applications. Common configuration changes include
5091///
5092/// * [with_endpoint()]: by default this client uses the global default endpoint
5093/// (`https://compute.googleapis.com`). Applications using regional
5094/// endpoints or running in restricted networks (e.g. a network configured
5095/// with [Private Google Access with VPC Service Controls]) may want to
5096/// override this default.
5097/// * [with_credentials()]: by default this client uses
5098/// [Application Default Credentials]. Applications using custom
5099/// authentication may need to override this default.
5100///
5101/// [with_endpoint()]: super::builder::instance_settings::ClientBuilder::with_endpoint
5102/// [with_credentials()]: super::builder::instance_settings::ClientBuilder::with_credentials
5103/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5104/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5105///
5106/// # Pooling and Cloning
5107///
5108/// `InstanceSettings` holds a connection pool internally, it is advised to
5109/// create one and reuse it. You do not need to wrap `InstanceSettings` in
5110/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5111/// already uses an `Arc` internally.
5112#[cfg(feature = "instance-settings")]
5113#[cfg_attr(docsrs, doc(cfg(feature = "instance-settings")))]
5114#[derive(Clone, Debug)]
5115pub struct InstanceSettings {
5116 inner: std::sync::Arc<dyn super::stub::dynamic::InstanceSettings>,
5117}
5118
5119#[cfg(feature = "instance-settings")]
5120impl InstanceSettings {
5121 /// Returns a builder for [InstanceSettings].
5122 ///
5123 /// ```
5124 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5125 /// # use google_cloud_compute_v1::client::InstanceSettings;
5126 /// let client = InstanceSettings::builder().build().await?;
5127 /// # Ok(()) }
5128 /// ```
5129 pub fn builder() -> super::builder::instance_settings::ClientBuilder {
5130 crate::new_client_builder(super::builder::instance_settings::client::Factory)
5131 }
5132
5133 /// Creates a new client from the provided stub.
5134 ///
5135 /// The most common case for calling this function is in tests mocking the
5136 /// client's behavior.
5137 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
5138 where
5139 T: super::stub::InstanceSettings + 'static,
5140 {
5141 Self { inner: stub.into() }
5142 }
5143
5144 pub(crate) async fn new(
5145 config: gaxi::options::ClientConfig,
5146 ) -> crate::ClientBuilderResult<Self> {
5147 let inner = Self::build_inner(config).await?;
5148 Ok(Self { inner })
5149 }
5150
5151 async fn build_inner(
5152 conf: gaxi::options::ClientConfig,
5153 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InstanceSettings>>
5154 {
5155 if gaxi::options::tracing_enabled(&conf) {
5156 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5157 }
5158 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5159 }
5160
5161 async fn build_transport(
5162 conf: gaxi::options::ClientConfig,
5163 ) -> crate::ClientBuilderResult<impl super::stub::InstanceSettings> {
5164 super::transport::InstanceSettings::new(conf).await
5165 }
5166
5167 async fn build_with_tracing(
5168 conf: gaxi::options::ClientConfig,
5169 ) -> crate::ClientBuilderResult<impl super::stub::InstanceSettings> {
5170 Self::build_transport(conf)
5171 .await
5172 .map(super::tracing::InstanceSettings::new)
5173 }
5174
5175 /// Get Instance settings.
5176 pub fn get(&self) -> super::builder::instance_settings::Get {
5177 super::builder::instance_settings::Get::new(self.inner.clone())
5178 }
5179
5180 /// Patch Instance settings
5181 pub fn patch(&self) -> super::builder::instance_settings::Patch {
5182 super::builder::instance_settings::Patch::new(self.inner.clone())
5183 }
5184
5185 /// Retrieves the specified zone-specific Operations resource.
5186 pub fn get_operation(&self) -> super::builder::instance_settings::GetOperation {
5187 super::builder::instance_settings::GetOperation::new(self.inner.clone())
5188 }
5189}
5190
5191/// Implements a client for the Compute Engine API.
5192///
5193/// # Example
5194/// ```
5195/// # use google_cloud_compute_v1::client::InstanceTemplates;
5196/// async fn sample(
5197/// ) -> anyhow::Result<()> {
5198/// let client = InstanceTemplates::builder().build().await?;
5199/// // use `client` to make requests to the Compute Engine API.
5200/// Ok(())
5201/// }
5202/// ```
5203///
5204/// # Service Description
5205///
5206/// Service for the `instanceTemplates` resource.
5207///
5208/// # Configuration
5209///
5210/// To configure `InstanceTemplates` use the `with_*` methods in the type returned
5211/// by [builder()][InstanceTemplates::builder]. The default configuration should
5212/// work for most applications. Common configuration changes include
5213///
5214/// * [with_endpoint()]: by default this client uses the global default endpoint
5215/// (`https://compute.googleapis.com`). Applications using regional
5216/// endpoints or running in restricted networks (e.g. a network configured
5217/// with [Private Google Access with VPC Service Controls]) may want to
5218/// override this default.
5219/// * [with_credentials()]: by default this client uses
5220/// [Application Default Credentials]. Applications using custom
5221/// authentication may need to override this default.
5222///
5223/// [with_endpoint()]: super::builder::instance_templates::ClientBuilder::with_endpoint
5224/// [with_credentials()]: super::builder::instance_templates::ClientBuilder::with_credentials
5225/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5226/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5227///
5228/// # Pooling and Cloning
5229///
5230/// `InstanceTemplates` holds a connection pool internally, it is advised to
5231/// create one and reuse it. You do not need to wrap `InstanceTemplates` in
5232/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5233/// already uses an `Arc` internally.
5234#[cfg(feature = "instance-templates")]
5235#[cfg_attr(docsrs, doc(cfg(feature = "instance-templates")))]
5236#[derive(Clone, Debug)]
5237pub struct InstanceTemplates {
5238 inner: std::sync::Arc<dyn super::stub::dynamic::InstanceTemplates>,
5239}
5240
5241#[cfg(feature = "instance-templates")]
5242impl InstanceTemplates {
5243 /// Returns a builder for [InstanceTemplates].
5244 ///
5245 /// ```
5246 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5247 /// # use google_cloud_compute_v1::client::InstanceTemplates;
5248 /// let client = InstanceTemplates::builder().build().await?;
5249 /// # Ok(()) }
5250 /// ```
5251 pub fn builder() -> super::builder::instance_templates::ClientBuilder {
5252 crate::new_client_builder(super::builder::instance_templates::client::Factory)
5253 }
5254
5255 /// Creates a new client from the provided stub.
5256 ///
5257 /// The most common case for calling this function is in tests mocking the
5258 /// client's behavior.
5259 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
5260 where
5261 T: super::stub::InstanceTemplates + 'static,
5262 {
5263 Self { inner: stub.into() }
5264 }
5265
5266 pub(crate) async fn new(
5267 config: gaxi::options::ClientConfig,
5268 ) -> crate::ClientBuilderResult<Self> {
5269 let inner = Self::build_inner(config).await?;
5270 Ok(Self { inner })
5271 }
5272
5273 async fn build_inner(
5274 conf: gaxi::options::ClientConfig,
5275 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InstanceTemplates>>
5276 {
5277 if gaxi::options::tracing_enabled(&conf) {
5278 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5279 }
5280 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5281 }
5282
5283 async fn build_transport(
5284 conf: gaxi::options::ClientConfig,
5285 ) -> crate::ClientBuilderResult<impl super::stub::InstanceTemplates> {
5286 super::transport::InstanceTemplates::new(conf).await
5287 }
5288
5289 async fn build_with_tracing(
5290 conf: gaxi::options::ClientConfig,
5291 ) -> crate::ClientBuilderResult<impl super::stub::InstanceTemplates> {
5292 Self::build_transport(conf)
5293 .await
5294 .map(super::tracing::InstanceTemplates::new)
5295 }
5296
5297 /// Retrieves the list of all InstanceTemplates resources, regional and global,
5298 /// available to the specified project.
5299 ///
5300 /// To prevent failure, Google recommends that you set the
5301 /// `returnPartialSuccess` parameter to `true`.
5302 pub fn aggregated_list(&self) -> super::builder::instance_templates::AggregatedList {
5303 super::builder::instance_templates::AggregatedList::new(self.inner.clone())
5304 }
5305
5306 /// Deletes the specified instance template. Deleting an instance template is
5307 /// permanent and cannot be undone. It is not possible to delete templates
5308 /// that are already in use by a managed instance group.
5309 pub fn delete(&self) -> super::builder::instance_templates::Delete {
5310 super::builder::instance_templates::Delete::new(self.inner.clone())
5311 }
5312
5313 /// Returns the specified instance template.
5314 pub fn get(&self) -> super::builder::instance_templates::Get {
5315 super::builder::instance_templates::Get::new(self.inner.clone())
5316 }
5317
5318 /// Gets the access control policy for a resource. May be empty if no such
5319 /// policy or resource exists.
5320 pub fn get_iam_policy(&self) -> super::builder::instance_templates::GetIamPolicy {
5321 super::builder::instance_templates::GetIamPolicy::new(self.inner.clone())
5322 }
5323
5324 /// Creates an instance template in the specified project using the
5325 /// data that is included in the request. If you are creating a new template to
5326 /// update an existing instance group, your new instance template must use the
5327 /// same network or, if applicable, the same subnetwork as the original
5328 /// template.
5329 pub fn insert(&self) -> super::builder::instance_templates::Insert {
5330 super::builder::instance_templates::Insert::new(self.inner.clone())
5331 }
5332
5333 /// Retrieves a list of instance templates that are contained within
5334 /// the specified project.
5335 pub fn list(&self) -> super::builder::instance_templates::List {
5336 super::builder::instance_templates::List::new(self.inner.clone())
5337 }
5338
5339 /// Sets the access control policy on the specified resource.
5340 /// Replaces any existing policy.
5341 pub fn set_iam_policy(&self) -> super::builder::instance_templates::SetIamPolicy {
5342 super::builder::instance_templates::SetIamPolicy::new(self.inner.clone())
5343 }
5344
5345 /// Returns permissions that a caller has on the specified resource.
5346 pub fn test_iam_permissions(&self) -> super::builder::instance_templates::TestIamPermissions {
5347 super::builder::instance_templates::TestIamPermissions::new(self.inner.clone())
5348 }
5349
5350 /// Retrieves the specified Operations resource.
5351 pub fn get_operation(&self) -> super::builder::instance_templates::GetOperation {
5352 super::builder::instance_templates::GetOperation::new(self.inner.clone())
5353 }
5354}
5355
5356/// Implements a client for the Compute Engine API.
5357///
5358/// # Example
5359/// ```
5360/// # use google_cloud_compute_v1::client::Instances;
5361/// async fn sample(
5362/// ) -> anyhow::Result<()> {
5363/// let client = Instances::builder().build().await?;
5364/// // use `client` to make requests to the Compute Engine API.
5365/// Ok(())
5366/// }
5367/// ```
5368///
5369/// # Service Description
5370///
5371/// Service for the `instances` resource.
5372///
5373/// # Configuration
5374///
5375/// To configure `Instances` use the `with_*` methods in the type returned
5376/// by [builder()][Instances::builder]. The default configuration should
5377/// work for most applications. Common configuration changes include
5378///
5379/// * [with_endpoint()]: by default this client uses the global default endpoint
5380/// (`https://compute.googleapis.com`). Applications using regional
5381/// endpoints or running in restricted networks (e.g. a network configured
5382/// with [Private Google Access with VPC Service Controls]) may want to
5383/// override this default.
5384/// * [with_credentials()]: by default this client uses
5385/// [Application Default Credentials]. Applications using custom
5386/// authentication may need to override this default.
5387///
5388/// [with_endpoint()]: super::builder::instances::ClientBuilder::with_endpoint
5389/// [with_credentials()]: super::builder::instances::ClientBuilder::with_credentials
5390/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5391/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5392///
5393/// # Pooling and Cloning
5394///
5395/// `Instances` holds a connection pool internally, it is advised to
5396/// create one and reuse it. You do not need to wrap `Instances` in
5397/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5398/// already uses an `Arc` internally.
5399#[cfg(feature = "instances")]
5400#[cfg_attr(docsrs, doc(cfg(feature = "instances")))]
5401#[derive(Clone, Debug)]
5402pub struct Instances {
5403 inner: std::sync::Arc<dyn super::stub::dynamic::Instances>,
5404}
5405
5406#[cfg(feature = "instances")]
5407impl Instances {
5408 /// Returns a builder for [Instances].
5409 ///
5410 /// ```
5411 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5412 /// # use google_cloud_compute_v1::client::Instances;
5413 /// let client = Instances::builder().build().await?;
5414 /// # Ok(()) }
5415 /// ```
5416 pub fn builder() -> super::builder::instances::ClientBuilder {
5417 crate::new_client_builder(super::builder::instances::client::Factory)
5418 }
5419
5420 /// Creates a new client from the provided stub.
5421 ///
5422 /// The most common case for calling this function is in tests mocking the
5423 /// client's behavior.
5424 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
5425 where
5426 T: super::stub::Instances + 'static,
5427 {
5428 Self { inner: stub.into() }
5429 }
5430
5431 pub(crate) async fn new(
5432 config: gaxi::options::ClientConfig,
5433 ) -> crate::ClientBuilderResult<Self> {
5434 let inner = Self::build_inner(config).await?;
5435 Ok(Self { inner })
5436 }
5437
5438 async fn build_inner(
5439 conf: gaxi::options::ClientConfig,
5440 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Instances>> {
5441 if gaxi::options::tracing_enabled(&conf) {
5442 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5443 }
5444 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5445 }
5446
5447 async fn build_transport(
5448 conf: gaxi::options::ClientConfig,
5449 ) -> crate::ClientBuilderResult<impl super::stub::Instances> {
5450 super::transport::Instances::new(conf).await
5451 }
5452
5453 async fn build_with_tracing(
5454 conf: gaxi::options::ClientConfig,
5455 ) -> crate::ClientBuilderResult<impl super::stub::Instances> {
5456 Self::build_transport(conf)
5457 .await
5458 .map(super::tracing::Instances::new)
5459 }
5460
5461 /// Adds an access config to an instance's network interface.
5462 pub fn add_access_config(&self) -> super::builder::instances::AddAccessConfig {
5463 super::builder::instances::AddAccessConfig::new(self.inner.clone())
5464 }
5465
5466 /// Adds one dynamic network interface to an active instance.
5467 pub fn add_network_interface(&self) -> super::builder::instances::AddNetworkInterface {
5468 super::builder::instances::AddNetworkInterface::new(self.inner.clone())
5469 }
5470
5471 /// Adds existing resource policies to an instance. You can only add one
5472 /// policy right now which will be applied to this instance for scheduling live
5473 /// migrations.
5474 pub fn add_resource_policies(&self) -> super::builder::instances::AddResourcePolicies {
5475 super::builder::instances::AddResourcePolicies::new(self.inner.clone())
5476 }
5477
5478 /// Retrieves an aggregated list of all of the instances in your project
5479 /// across all regions and zones.
5480 ///
5481 /// The performance of this method degrades when a filter is specified on a
5482 /// project that has a very large number of instances.
5483 ///
5484 /// To prevent failure, Google recommends that you set the
5485 /// `returnPartialSuccess` parameter to `true`.
5486 pub fn aggregated_list(&self) -> super::builder::instances::AggregatedList {
5487 super::builder::instances::AggregatedList::new(self.inner.clone())
5488 }
5489
5490 /// Attaches an existing Disk resource to an instance. You must first
5491 /// create the disk before you can attach it. It is not possible to create
5492 /// and attach a disk at the same time. For more information, readAdding a
5493 /// persistent disk to your instance.
5494 pub fn attach_disk(&self) -> super::builder::instances::AttachDisk {
5495 super::builder::instances::AttachDisk::new(self.inner.clone())
5496 }
5497
5498 /// Creates multiple instances. Count specifies the number of instances to
5499 /// create. For more information, seeAbout bulk
5500 /// creation of VMs.
5501 pub fn bulk_insert(&self) -> super::builder::instances::BulkInsert {
5502 super::builder::instances::BulkInsert::new(self.inner.clone())
5503 }
5504
5505 /// Deletes the specified Instance resource. For more information, seeDeleting
5506 /// an instance.
5507 pub fn delete(&self) -> super::builder::instances::Delete {
5508 super::builder::instances::Delete::new(self.inner.clone())
5509 }
5510
5511 /// Deletes an access config from an instance's network interface.
5512 pub fn delete_access_config(&self) -> super::builder::instances::DeleteAccessConfig {
5513 super::builder::instances::DeleteAccessConfig::new(self.inner.clone())
5514 }
5515
5516 /// Deletes one dynamic network interface from an active instance.
5517 /// InstancesDeleteNetworkInterfaceRequest indicates:
5518 ///
5519 /// - instance from which to delete, using project+zone+resource_id fields;
5520 /// - dynamic network interface to be deleted, using network_interface_name
5521 /// field;
5522 pub fn delete_network_interface(&self) -> super::builder::instances::DeleteNetworkInterface {
5523 super::builder::instances::DeleteNetworkInterface::new(self.inner.clone())
5524 }
5525
5526 /// Detaches a disk from an instance.
5527 pub fn detach_disk(&self) -> super::builder::instances::DetachDisk {
5528 super::builder::instances::DetachDisk::new(self.inner.clone())
5529 }
5530
5531 /// Returns the specified Instance resource.
5532 pub fn get(&self) -> super::builder::instances::Get {
5533 super::builder::instances::Get::new(self.inner.clone())
5534 }
5535
5536 /// Returns effective firewalls applied to an interface of the instance.
5537 pub fn get_effective_firewalls(&self) -> super::builder::instances::GetEffectiveFirewalls {
5538 super::builder::instances::GetEffectiveFirewalls::new(self.inner.clone())
5539 }
5540
5541 /// Returns the specified guest attributes entry.
5542 pub fn get_guest_attributes(&self) -> super::builder::instances::GetGuestAttributes {
5543 super::builder::instances::GetGuestAttributes::new(self.inner.clone())
5544 }
5545
5546 /// Gets the access control policy for a resource. May be empty if no such
5547 /// policy or resource exists.
5548 pub fn get_iam_policy(&self) -> super::builder::instances::GetIamPolicy {
5549 super::builder::instances::GetIamPolicy::new(self.inner.clone())
5550 }
5551
5552 /// Returns the screenshot from the specified instance.
5553 pub fn get_screenshot(&self) -> super::builder::instances::GetScreenshot {
5554 super::builder::instances::GetScreenshot::new(self.inner.clone())
5555 }
5556
5557 /// Returns the last 1 MB of serial port output from the specified instance.
5558 pub fn get_serial_port_output(&self) -> super::builder::instances::GetSerialPortOutput {
5559 super::builder::instances::GetSerialPortOutput::new(self.inner.clone())
5560 }
5561
5562 /// Returns the Shielded Instance Identity of an instance
5563 pub fn get_shielded_instance_identity(
5564 &self,
5565 ) -> super::builder::instances::GetShieldedInstanceIdentity {
5566 super::builder::instances::GetShieldedInstanceIdentity::new(self.inner.clone())
5567 }
5568
5569 /// Creates an instance resource in the specified project using the data
5570 /// included in the request.
5571 pub fn insert(&self) -> super::builder::instances::Insert {
5572 super::builder::instances::Insert::new(self.inner.clone())
5573 }
5574
5575 /// Retrieves the list of instances contained within
5576 /// the specified zone.
5577 pub fn list(&self) -> super::builder::instances::List {
5578 super::builder::instances::List::new(self.inner.clone())
5579 }
5580
5581 /// Retrieves a list of resources that refer to the VM instance specified in
5582 /// the request. For example, if the VM instance is part of a managed or
5583 /// unmanaged instance group, the referrers list includes the instance group.
5584 /// For more information, readViewing
5585 /// referrers to VM instances.
5586 pub fn list_referrers(&self) -> super::builder::instances::ListReferrers {
5587 super::builder::instances::ListReferrers::new(self.inner.clone())
5588 }
5589
5590 /// Perform a manual maintenance on the instance.
5591 pub fn perform_maintenance(&self) -> super::builder::instances::PerformMaintenance {
5592 super::builder::instances::PerformMaintenance::new(self.inner.clone())
5593 }
5594
5595 /// Removes resource policies from an instance.
5596 pub fn remove_resource_policies(&self) -> super::builder::instances::RemoveResourcePolicies {
5597 super::builder::instances::RemoveResourcePolicies::new(self.inner.clone())
5598 }
5599
5600 /// Mark the host as faulty and try to restart the instance on a new host.
5601 pub fn report_host_as_faulty(&self) -> super::builder::instances::ReportHostAsFaulty {
5602 super::builder::instances::ReportHostAsFaulty::new(self.inner.clone())
5603 }
5604
5605 /// Performs a reset on the instance. This is a hard reset. The VM
5606 /// does not do a graceful shutdown. For more information, seeResetting
5607 /// an instance.
5608 pub fn reset(&self) -> super::builder::instances::Reset {
5609 super::builder::instances::Reset::new(self.inner.clone())
5610 }
5611
5612 /// Resumes an instance that was suspended using theinstances().suspend
5613 /// method.
5614 pub fn resume(&self) -> super::builder::instances::Resume {
5615 super::builder::instances::Resume::new(self.inner.clone())
5616 }
5617
5618 /// Sends diagnostic interrupt to the instance.
5619 pub fn send_diagnostic_interrupt(&self) -> super::builder::instances::SendDiagnosticInterrupt {
5620 super::builder::instances::SendDiagnosticInterrupt::new(self.inner.clone())
5621 }
5622
5623 /// Sets deletion protection on the instance.
5624 pub fn set_deletion_protection(&self) -> super::builder::instances::SetDeletionProtection {
5625 super::builder::instances::SetDeletionProtection::new(self.inner.clone())
5626 }
5627
5628 /// Sets the auto-delete flag for a disk attached to an instance.
5629 pub fn set_disk_auto_delete(&self) -> super::builder::instances::SetDiskAutoDelete {
5630 super::builder::instances::SetDiskAutoDelete::new(self.inner.clone())
5631 }
5632
5633 /// Sets the access control policy on the specified resource.
5634 /// Replaces any existing policy.
5635 pub fn set_iam_policy(&self) -> super::builder::instances::SetIamPolicy {
5636 super::builder::instances::SetIamPolicy::new(self.inner.clone())
5637 }
5638
5639 /// Sets labels on an instance. To learn more about labels, read theLabeling
5640 /// Resources documentation.
5641 pub fn set_labels(&self) -> super::builder::instances::SetLabels {
5642 super::builder::instances::SetLabels::new(self.inner.clone())
5643 }
5644
5645 /// Changes the number and/or type of accelerator for a stopped instance to the
5646 /// values specified in the request.
5647 pub fn set_machine_resources(&self) -> super::builder::instances::SetMachineResources {
5648 super::builder::instances::SetMachineResources::new(self.inner.clone())
5649 }
5650
5651 /// Changes the machine type for a stopped instance to the machine
5652 /// type specified in the request.
5653 pub fn set_machine_type(&self) -> super::builder::instances::SetMachineType {
5654 super::builder::instances::SetMachineType::new(self.inner.clone())
5655 }
5656
5657 /// Sets metadata for the specified instance to the data included
5658 /// in the request.
5659 pub fn set_metadata(&self) -> super::builder::instances::SetMetadata {
5660 super::builder::instances::SetMetadata::new(self.inner.clone())
5661 }
5662
5663 /// Changes the minimum CPU platform that this instance should use.
5664 /// This method can only
5665 /// be called on a stopped instance. For more information, readSpecifying a
5666 /// Minimum CPU Platform.
5667 pub fn set_min_cpu_platform(&self) -> super::builder::instances::SetMinCpuPlatform {
5668 super::builder::instances::SetMinCpuPlatform::new(self.inner.clone())
5669 }
5670
5671 /// Sets name of an instance.
5672 pub fn set_name(&self) -> super::builder::instances::SetName {
5673 super::builder::instances::SetName::new(self.inner.clone())
5674 }
5675
5676 /// Sets an instance's scheduling options. You can only call this method on astopped instance,
5677 /// that is, a VM instance that is in a `TERMINATED` state. SeeInstance Life
5678 /// Cycle for more information on the possible instance states.
5679 /// For more information about setting scheduling options for a VM, seeSet
5680 /// VM host maintenance policy.
5681 pub fn set_scheduling(&self) -> super::builder::instances::SetScheduling {
5682 super::builder::instances::SetScheduling::new(self.inner.clone())
5683 }
5684
5685 /// Sets the Google Cloud Armor security policy for the specified instance.
5686 /// For more information, seeGoogle
5687 /// Cloud Armor Overview
5688 pub fn set_security_policy(&self) -> super::builder::instances::SetSecurityPolicy {
5689 super::builder::instances::SetSecurityPolicy::new(self.inner.clone())
5690 }
5691
5692 /// Sets the service account on the instance. For more information,
5693 /// readChanging
5694 /// the service account and access scopes for an instance.
5695 pub fn set_service_account(&self) -> super::builder::instances::SetServiceAccount {
5696 super::builder::instances::SetServiceAccount::new(self.inner.clone())
5697 }
5698
5699 /// Sets the Shielded Instance integrity policy for an instance. You can
5700 /// only use this method on a running instance. This method
5701 /// supports PATCH semantics and uses the JSON merge
5702 /// patch format and processing rules.
5703 pub fn set_shielded_instance_integrity_policy(
5704 &self,
5705 ) -> super::builder::instances::SetShieldedInstanceIntegrityPolicy {
5706 super::builder::instances::SetShieldedInstanceIntegrityPolicy::new(self.inner.clone())
5707 }
5708
5709 /// Sets network tags
5710 /// for the specified instance to the data included in the request.
5711 pub fn set_tags(&self) -> super::builder::instances::SetTags {
5712 super::builder::instances::SetTags::new(self.inner.clone())
5713 }
5714
5715 /// Simulates a host maintenance event on a VM. For more information, see
5716 /// Simulate a host maintenance event.
5717 pub fn simulate_maintenance_event(
5718 &self,
5719 ) -> super::builder::instances::SimulateMaintenanceEvent {
5720 super::builder::instances::SimulateMaintenanceEvent::new(self.inner.clone())
5721 }
5722
5723 /// Starts an instance that was stopped using theinstances().stop
5724 /// method. For more information, seeRestart an
5725 /// instance.
5726 pub fn start(&self) -> super::builder::instances::Start {
5727 super::builder::instances::Start::new(self.inner.clone())
5728 }
5729
5730 /// Starts an instance that was stopped using theinstances().stop
5731 /// method. For more information, seeRestart an
5732 /// instance.
5733 pub fn start_with_encryption_key(&self) -> super::builder::instances::StartWithEncryptionKey {
5734 super::builder::instances::StartWithEncryptionKey::new(self.inner.clone())
5735 }
5736
5737 /// Stops a running instance, shutting it down cleanly, and allows
5738 /// you to restart the instance at a later time. Stopped instances do not incur
5739 /// VM usage charges while they are stopped. However, resources that the VM is
5740 /// using, such as persistent disks and static IP addresses, will continue to
5741 /// be charged until they are deleted. For more information, seeStopping
5742 /// an instance.
5743 pub fn stop(&self) -> super::builder::instances::Stop {
5744 super::builder::instances::Stop::new(self.inner.clone())
5745 }
5746
5747 /// This method suspends a running instance, saving its state to persistent
5748 /// storage, and allows you to resume the instance at a later time. Suspended
5749 /// instances have no compute costs (cores or RAM), and incur only storage
5750 /// charges for the saved VM memory and localSSD data. Any charged resources
5751 /// the virtual machine was using, such as persistent disks and static IP
5752 /// addresses, will continue to be charged while the instance is suspended.
5753 /// For more information, see
5754 /// Suspending and resuming an instance.
5755 pub fn suspend(&self) -> super::builder::instances::Suspend {
5756 super::builder::instances::Suspend::new(self.inner.clone())
5757 }
5758
5759 /// Returns permissions that a caller has on the specified resource.
5760 pub fn test_iam_permissions(&self) -> super::builder::instances::TestIamPermissions {
5761 super::builder::instances::TestIamPermissions::new(self.inner.clone())
5762 }
5763
5764 /// Updates an instance only if the necessary resources are available. This
5765 /// method can update only a specific set of instance properties. See
5766 /// Updating a running instance for a list of updatable instance
5767 /// properties.
5768 pub fn update(&self) -> super::builder::instances::Update {
5769 super::builder::instances::Update::new(self.inner.clone())
5770 }
5771
5772 /// Updates the specified access config from an instance's network interface
5773 /// with the data included in the request. This method supportsPATCH
5774 /// semantics and uses theJSON merge
5775 /// patch format and processing rules.
5776 pub fn update_access_config(&self) -> super::builder::instances::UpdateAccessConfig {
5777 super::builder::instances::UpdateAccessConfig::new(self.inner.clone())
5778 }
5779
5780 /// Updates the Display config for a VM instance. You can
5781 /// only use this method on a stopped VM instance. This method supportsPATCH
5782 /// semantics and uses theJSON merge
5783 /// patch format and processing rules.
5784 pub fn update_display_device(&self) -> super::builder::instances::UpdateDisplayDevice {
5785 super::builder::instances::UpdateDisplayDevice::new(self.inner.clone())
5786 }
5787
5788 /// Updates an instance's network interface. This method can only update an
5789 /// interface's alias IP range and attached network. See Modifying
5790 /// alias IP ranges for an existing instance for instructions on
5791 /// changing alias IP ranges. See Migrating
5792 /// a VM between networks for instructions on migrating an interface.
5793 /// This method follows PATCH semantics.
5794 pub fn update_network_interface(&self) -> super::builder::instances::UpdateNetworkInterface {
5795 super::builder::instances::UpdateNetworkInterface::new(self.inner.clone())
5796 }
5797
5798 /// Updates the Shielded Instance config for an instance. You can
5799 /// only use this method on a stopped instance. This method supportsPATCH
5800 /// semantics and uses theJSON merge
5801 /// patch format and processing rules.
5802 pub fn update_shielded_instance_config(
5803 &self,
5804 ) -> super::builder::instances::UpdateShieldedInstanceConfig {
5805 super::builder::instances::UpdateShieldedInstanceConfig::new(self.inner.clone())
5806 }
5807
5808 /// Retrieves the specified zone-specific Operations resource.
5809 pub fn get_operation(&self) -> super::builder::instances::GetOperation {
5810 super::builder::instances::GetOperation::new(self.inner.clone())
5811 }
5812}
5813
5814/// Implements a client for the Compute Engine API.
5815///
5816/// # Example
5817/// ```
5818/// # use google_cloud_compute_v1::client::InstantSnapshotGroups;
5819/// async fn sample(
5820/// ) -> anyhow::Result<()> {
5821/// let client = InstantSnapshotGroups::builder().build().await?;
5822/// // use `client` to make requests to the Compute Engine API.
5823/// Ok(())
5824/// }
5825/// ```
5826///
5827/// # Service Description
5828///
5829/// Service for the `instantSnapshotGroups` resource.
5830///
5831/// # Configuration
5832///
5833/// To configure `InstantSnapshotGroups` use the `with_*` methods in the type returned
5834/// by [builder()][InstantSnapshotGroups::builder]. The default configuration should
5835/// work for most applications. Common configuration changes include
5836///
5837/// * [with_endpoint()]: by default this client uses the global default endpoint
5838/// (`https://compute.googleapis.com`). Applications using regional
5839/// endpoints or running in restricted networks (e.g. a network configured
5840/// with [Private Google Access with VPC Service Controls]) may want to
5841/// override this default.
5842/// * [with_credentials()]: by default this client uses
5843/// [Application Default Credentials]. Applications using custom
5844/// authentication may need to override this default.
5845///
5846/// [with_endpoint()]: super::builder::instant_snapshot_groups::ClientBuilder::with_endpoint
5847/// [with_credentials()]: super::builder::instant_snapshot_groups::ClientBuilder::with_credentials
5848/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5849/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5850///
5851/// # Pooling and Cloning
5852///
5853/// `InstantSnapshotGroups` holds a connection pool internally, it is advised to
5854/// create one and reuse it. You do not need to wrap `InstantSnapshotGroups` in
5855/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5856/// already uses an `Arc` internally.
5857#[cfg(feature = "instant-snapshot-groups")]
5858#[cfg_attr(docsrs, doc(cfg(feature = "instant-snapshot-groups")))]
5859#[derive(Clone, Debug)]
5860pub struct InstantSnapshotGroups {
5861 inner: std::sync::Arc<dyn super::stub::dynamic::InstantSnapshotGroups>,
5862}
5863
5864#[cfg(feature = "instant-snapshot-groups")]
5865impl InstantSnapshotGroups {
5866 /// Returns a builder for [InstantSnapshotGroups].
5867 ///
5868 /// ```
5869 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5870 /// # use google_cloud_compute_v1::client::InstantSnapshotGroups;
5871 /// let client = InstantSnapshotGroups::builder().build().await?;
5872 /// # Ok(()) }
5873 /// ```
5874 pub fn builder() -> super::builder::instant_snapshot_groups::ClientBuilder {
5875 crate::new_client_builder(super::builder::instant_snapshot_groups::client::Factory)
5876 }
5877
5878 /// Creates a new client from the provided stub.
5879 ///
5880 /// The most common case for calling this function is in tests mocking the
5881 /// client's behavior.
5882 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
5883 where
5884 T: super::stub::InstantSnapshotGroups + 'static,
5885 {
5886 Self { inner: stub.into() }
5887 }
5888
5889 pub(crate) async fn new(
5890 config: gaxi::options::ClientConfig,
5891 ) -> crate::ClientBuilderResult<Self> {
5892 let inner = Self::build_inner(config).await?;
5893 Ok(Self { inner })
5894 }
5895
5896 async fn build_inner(
5897 conf: gaxi::options::ClientConfig,
5898 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InstantSnapshotGroups>>
5899 {
5900 if gaxi::options::tracing_enabled(&conf) {
5901 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5902 }
5903 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5904 }
5905
5906 async fn build_transport(
5907 conf: gaxi::options::ClientConfig,
5908 ) -> crate::ClientBuilderResult<impl super::stub::InstantSnapshotGroups> {
5909 super::transport::InstantSnapshotGroups::new(conf).await
5910 }
5911
5912 async fn build_with_tracing(
5913 conf: gaxi::options::ClientConfig,
5914 ) -> crate::ClientBuilderResult<impl super::stub::InstantSnapshotGroups> {
5915 Self::build_transport(conf)
5916 .await
5917 .map(super::tracing::InstantSnapshotGroups::new)
5918 }
5919
5920 /// deletes a Zonal InstantSnapshotGroup resource
5921 pub fn delete(&self) -> super::builder::instant_snapshot_groups::Delete {
5922 super::builder::instant_snapshot_groups::Delete::new(self.inner.clone())
5923 }
5924
5925 /// returns the specified InstantSnapshotGroup resource in the specified zone.
5926 pub fn get(&self) -> super::builder::instant_snapshot_groups::Get {
5927 super::builder::instant_snapshot_groups::Get::new(self.inner.clone())
5928 }
5929
5930 /// Gets the access control policy for a resource. May be empty if no such
5931 /// policy or resource exists.
5932 pub fn get_iam_policy(&self) -> super::builder::instant_snapshot_groups::GetIamPolicy {
5933 super::builder::instant_snapshot_groups::GetIamPolicy::new(self.inner.clone())
5934 }
5935
5936 /// inserts a Zonal InstantSnapshotGroup resource
5937 pub fn insert(&self) -> super::builder::instant_snapshot_groups::Insert {
5938 super::builder::instant_snapshot_groups::Insert::new(self.inner.clone())
5939 }
5940
5941 /// retrieves the list of InstantSnapshotGroup resources contained within
5942 /// the specified zone.
5943 pub fn list(&self) -> super::builder::instant_snapshot_groups::List {
5944 super::builder::instant_snapshot_groups::List::new(self.inner.clone())
5945 }
5946
5947 /// Sets the access control policy on the specified resource.
5948 /// Replaces any existing policy.
5949 pub fn set_iam_policy(&self) -> super::builder::instant_snapshot_groups::SetIamPolicy {
5950 super::builder::instant_snapshot_groups::SetIamPolicy::new(self.inner.clone())
5951 }
5952
5953 /// Returns permissions that a caller has on the specified resource.
5954 pub fn test_iam_permissions(
5955 &self,
5956 ) -> super::builder::instant_snapshot_groups::TestIamPermissions {
5957 super::builder::instant_snapshot_groups::TestIamPermissions::new(self.inner.clone())
5958 }
5959
5960 /// Retrieves the specified zone-specific Operations resource.
5961 pub fn get_operation(&self) -> super::builder::instant_snapshot_groups::GetOperation {
5962 super::builder::instant_snapshot_groups::GetOperation::new(self.inner.clone())
5963 }
5964}
5965
5966/// Implements a client for the Compute Engine API.
5967///
5968/// # Example
5969/// ```
5970/// # use google_cloud_compute_v1::client::InstantSnapshots;
5971/// async fn sample(
5972/// ) -> anyhow::Result<()> {
5973/// let client = InstantSnapshots::builder().build().await?;
5974/// // use `client` to make requests to the Compute Engine API.
5975/// Ok(())
5976/// }
5977/// ```
5978///
5979/// # Service Description
5980///
5981/// Service for the `instantSnapshots` resource.
5982///
5983/// # Configuration
5984///
5985/// To configure `InstantSnapshots` use the `with_*` methods in the type returned
5986/// by [builder()][InstantSnapshots::builder]. The default configuration should
5987/// work for most applications. Common configuration changes include
5988///
5989/// * [with_endpoint()]: by default this client uses the global default endpoint
5990/// (`https://compute.googleapis.com`). Applications using regional
5991/// endpoints or running in restricted networks (e.g. a network configured
5992/// with [Private Google Access with VPC Service Controls]) may want to
5993/// override this default.
5994/// * [with_credentials()]: by default this client uses
5995/// [Application Default Credentials]. Applications using custom
5996/// authentication may need to override this default.
5997///
5998/// [with_endpoint()]: super::builder::instant_snapshots::ClientBuilder::with_endpoint
5999/// [with_credentials()]: super::builder::instant_snapshots::ClientBuilder::with_credentials
6000/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6001/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6002///
6003/// # Pooling and Cloning
6004///
6005/// `InstantSnapshots` holds a connection pool internally, it is advised to
6006/// create one and reuse it. You do not need to wrap `InstantSnapshots` in
6007/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6008/// already uses an `Arc` internally.
6009#[cfg(feature = "instant-snapshots")]
6010#[cfg_attr(docsrs, doc(cfg(feature = "instant-snapshots")))]
6011#[derive(Clone, Debug)]
6012pub struct InstantSnapshots {
6013 inner: std::sync::Arc<dyn super::stub::dynamic::InstantSnapshots>,
6014}
6015
6016#[cfg(feature = "instant-snapshots")]
6017impl InstantSnapshots {
6018 /// Returns a builder for [InstantSnapshots].
6019 ///
6020 /// ```
6021 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6022 /// # use google_cloud_compute_v1::client::InstantSnapshots;
6023 /// let client = InstantSnapshots::builder().build().await?;
6024 /// # Ok(()) }
6025 /// ```
6026 pub fn builder() -> super::builder::instant_snapshots::ClientBuilder {
6027 crate::new_client_builder(super::builder::instant_snapshots::client::Factory)
6028 }
6029
6030 /// Creates a new client from the provided stub.
6031 ///
6032 /// The most common case for calling this function is in tests mocking the
6033 /// client's behavior.
6034 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
6035 where
6036 T: super::stub::InstantSnapshots + 'static,
6037 {
6038 Self { inner: stub.into() }
6039 }
6040
6041 pub(crate) async fn new(
6042 config: gaxi::options::ClientConfig,
6043 ) -> crate::ClientBuilderResult<Self> {
6044 let inner = Self::build_inner(config).await?;
6045 Ok(Self { inner })
6046 }
6047
6048 async fn build_inner(
6049 conf: gaxi::options::ClientConfig,
6050 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InstantSnapshots>>
6051 {
6052 if gaxi::options::tracing_enabled(&conf) {
6053 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6054 }
6055 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6056 }
6057
6058 async fn build_transport(
6059 conf: gaxi::options::ClientConfig,
6060 ) -> crate::ClientBuilderResult<impl super::stub::InstantSnapshots> {
6061 super::transport::InstantSnapshots::new(conf).await
6062 }
6063
6064 async fn build_with_tracing(
6065 conf: gaxi::options::ClientConfig,
6066 ) -> crate::ClientBuilderResult<impl super::stub::InstantSnapshots> {
6067 Self::build_transport(conf)
6068 .await
6069 .map(super::tracing::InstantSnapshots::new)
6070 }
6071
6072 /// Retrieves an aggregated list of instantSnapshots.
6073 ///
6074 /// To prevent failure, Google recommends that you set the
6075 /// `returnPartialSuccess` parameter to `true`.
6076 pub fn aggregated_list(&self) -> super::builder::instant_snapshots::AggregatedList {
6077 super::builder::instant_snapshots::AggregatedList::new(self.inner.clone())
6078 }
6079
6080 /// Deletes the specified InstantSnapshot resource. Keep in mind that deleting
6081 /// a single instantSnapshot might not necessarily delete all the data on that
6082 /// instantSnapshot. If any data on the instantSnapshot that is marked for
6083 /// deletion is needed for subsequent instantSnapshots, the data will be moved
6084 /// to the next corresponding instantSnapshot.
6085 ///
6086 /// For more information, seeDeleting
6087 /// instantSnapshots.
6088 pub fn delete(&self) -> super::builder::instant_snapshots::Delete {
6089 super::builder::instant_snapshots::Delete::new(self.inner.clone())
6090 }
6091
6092 /// Returns the specified InstantSnapshot resource in the specified zone.
6093 pub fn get(&self) -> super::builder::instant_snapshots::Get {
6094 super::builder::instant_snapshots::Get::new(self.inner.clone())
6095 }
6096
6097 /// Gets the access control policy for a resource. May be empty if no such
6098 /// policy or resource exists.
6099 pub fn get_iam_policy(&self) -> super::builder::instant_snapshots::GetIamPolicy {
6100 super::builder::instant_snapshots::GetIamPolicy::new(self.inner.clone())
6101 }
6102
6103 /// Creates an instant snapshot in the specified zone.
6104 pub fn insert(&self) -> super::builder::instant_snapshots::Insert {
6105 super::builder::instant_snapshots::Insert::new(self.inner.clone())
6106 }
6107
6108 /// Retrieves the list of InstantSnapshot resources contained within
6109 /// the specified zone.
6110 pub fn list(&self) -> super::builder::instant_snapshots::List {
6111 super::builder::instant_snapshots::List::new(self.inner.clone())
6112 }
6113
6114 /// Sets the access control policy on the specified resource.
6115 /// Replaces any existing policy.
6116 pub fn set_iam_policy(&self) -> super::builder::instant_snapshots::SetIamPolicy {
6117 super::builder::instant_snapshots::SetIamPolicy::new(self.inner.clone())
6118 }
6119
6120 /// Sets the labels on a instantSnapshot in the given zone. To learn more about
6121 /// labels, read the Labeling
6122 /// Resources documentation.
6123 pub fn set_labels(&self) -> super::builder::instant_snapshots::SetLabels {
6124 super::builder::instant_snapshots::SetLabels::new(self.inner.clone())
6125 }
6126
6127 /// Returns permissions that a caller has on the specified resource.
6128 pub fn test_iam_permissions(&self) -> super::builder::instant_snapshots::TestIamPermissions {
6129 super::builder::instant_snapshots::TestIamPermissions::new(self.inner.clone())
6130 }
6131
6132 /// Retrieves the specified zone-specific Operations resource.
6133 pub fn get_operation(&self) -> super::builder::instant_snapshots::GetOperation {
6134 super::builder::instant_snapshots::GetOperation::new(self.inner.clone())
6135 }
6136}
6137
6138/// Implements a client for the Compute Engine API.
6139///
6140/// # Example
6141/// ```
6142/// # use google_cloud_compute_v1::client::InterconnectAttachmentGroups;
6143/// async fn sample(
6144/// ) -> anyhow::Result<()> {
6145/// let client = InterconnectAttachmentGroups::builder().build().await?;
6146/// // use `client` to make requests to the Compute Engine API.
6147/// Ok(())
6148/// }
6149/// ```
6150///
6151/// # Service Description
6152///
6153/// Service for the `interconnectAttachmentGroups` resource.
6154///
6155/// # Configuration
6156///
6157/// To configure `InterconnectAttachmentGroups` use the `with_*` methods in the type returned
6158/// by [builder()][InterconnectAttachmentGroups::builder]. The default configuration should
6159/// work for most applications. Common configuration changes include
6160///
6161/// * [with_endpoint()]: by default this client uses the global default endpoint
6162/// (`https://compute.googleapis.com`). Applications using regional
6163/// endpoints or running in restricted networks (e.g. a network configured
6164/// with [Private Google Access with VPC Service Controls]) may want to
6165/// override this default.
6166/// * [with_credentials()]: by default this client uses
6167/// [Application Default Credentials]. Applications using custom
6168/// authentication may need to override this default.
6169///
6170/// [with_endpoint()]: super::builder::interconnect_attachment_groups::ClientBuilder::with_endpoint
6171/// [with_credentials()]: super::builder::interconnect_attachment_groups::ClientBuilder::with_credentials
6172/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6173/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6174///
6175/// # Pooling and Cloning
6176///
6177/// `InterconnectAttachmentGroups` holds a connection pool internally, it is advised to
6178/// create one and reuse it. You do not need to wrap `InterconnectAttachmentGroups` in
6179/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6180/// already uses an `Arc` internally.
6181#[cfg(feature = "interconnect-attachment-groups")]
6182#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-attachment-groups")))]
6183#[derive(Clone, Debug)]
6184pub struct InterconnectAttachmentGroups {
6185 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachmentGroups>,
6186}
6187
6188#[cfg(feature = "interconnect-attachment-groups")]
6189impl InterconnectAttachmentGroups {
6190 /// Returns a builder for [InterconnectAttachmentGroups].
6191 ///
6192 /// ```
6193 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6194 /// # use google_cloud_compute_v1::client::InterconnectAttachmentGroups;
6195 /// let client = InterconnectAttachmentGroups::builder().build().await?;
6196 /// # Ok(()) }
6197 /// ```
6198 pub fn builder() -> super::builder::interconnect_attachment_groups::ClientBuilder {
6199 crate::new_client_builder(super::builder::interconnect_attachment_groups::client::Factory)
6200 }
6201
6202 /// Creates a new client from the provided stub.
6203 ///
6204 /// The most common case for calling this function is in tests mocking the
6205 /// client's behavior.
6206 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
6207 where
6208 T: super::stub::InterconnectAttachmentGroups + 'static,
6209 {
6210 Self { inner: stub.into() }
6211 }
6212
6213 pub(crate) async fn new(
6214 config: gaxi::options::ClientConfig,
6215 ) -> crate::ClientBuilderResult<Self> {
6216 let inner = Self::build_inner(config).await?;
6217 Ok(Self { inner })
6218 }
6219
6220 async fn build_inner(
6221 conf: gaxi::options::ClientConfig,
6222 ) -> crate::ClientBuilderResult<
6223 std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachmentGroups>,
6224 > {
6225 if gaxi::options::tracing_enabled(&conf) {
6226 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6227 }
6228 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6229 }
6230
6231 async fn build_transport(
6232 conf: gaxi::options::ClientConfig,
6233 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectAttachmentGroups> {
6234 super::transport::InterconnectAttachmentGroups::new(conf).await
6235 }
6236
6237 async fn build_with_tracing(
6238 conf: gaxi::options::ClientConfig,
6239 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectAttachmentGroups> {
6240 Self::build_transport(conf)
6241 .await
6242 .map(super::tracing::InterconnectAttachmentGroups::new)
6243 }
6244
6245 /// Deletes the specified InterconnectAttachmentGroup in the given scope
6246 pub fn delete(&self) -> super::builder::interconnect_attachment_groups::Delete {
6247 super::builder::interconnect_attachment_groups::Delete::new(self.inner.clone())
6248 }
6249
6250 /// Returns the specified InterconnectAttachmentGroup resource in the given
6251 /// scope.
6252 pub fn get(&self) -> super::builder::interconnect_attachment_groups::Get {
6253 super::builder::interconnect_attachment_groups::Get::new(self.inner.clone())
6254 }
6255
6256 /// Gets the access control policy for a resource. May be empty if no such
6257 /// policy or resource exists.
6258 pub fn get_iam_policy(&self) -> super::builder::interconnect_attachment_groups::GetIamPolicy {
6259 super::builder::interconnect_attachment_groups::GetIamPolicy::new(self.inner.clone())
6260 }
6261
6262 /// Returns the InterconnectAttachmentStatuses for the specified
6263 /// InterconnectAttachmentGroup resource.
6264 pub fn get_operational_status(
6265 &self,
6266 ) -> super::builder::interconnect_attachment_groups::GetOperationalStatus {
6267 super::builder::interconnect_attachment_groups::GetOperationalStatus::new(
6268 self.inner.clone(),
6269 )
6270 }
6271
6272 /// Creates a InterconnectAttachmentGroup in the specified project in the given
6273 /// scope using the parameters that are included in the request.
6274 pub fn insert(&self) -> super::builder::interconnect_attachment_groups::Insert {
6275 super::builder::interconnect_attachment_groups::Insert::new(self.inner.clone())
6276 }
6277
6278 /// Lists the InterconnectAttachmentGroups for a project in the given scope.
6279 pub fn list(&self) -> super::builder::interconnect_attachment_groups::List {
6280 super::builder::interconnect_attachment_groups::List::new(self.inner.clone())
6281 }
6282
6283 /// Patches the specified InterconnectAttachmentGroup resource with the data
6284 /// included in the request. This method supports PATCH
6285 /// semantics and usesJSON merge
6286 /// patch format and processing rules.
6287 pub fn patch(&self) -> super::builder::interconnect_attachment_groups::Patch {
6288 super::builder::interconnect_attachment_groups::Patch::new(self.inner.clone())
6289 }
6290
6291 /// Sets the access control policy on the specified resource.
6292 /// Replaces any existing policy.
6293 pub fn set_iam_policy(&self) -> super::builder::interconnect_attachment_groups::SetIamPolicy {
6294 super::builder::interconnect_attachment_groups::SetIamPolicy::new(self.inner.clone())
6295 }
6296
6297 /// Returns permissions that a caller has on the specified resource.
6298 pub fn test_iam_permissions(
6299 &self,
6300 ) -> super::builder::interconnect_attachment_groups::TestIamPermissions {
6301 super::builder::interconnect_attachment_groups::TestIamPermissions::new(self.inner.clone())
6302 }
6303
6304 /// Retrieves the specified Operations resource.
6305 pub fn get_operation(&self) -> super::builder::interconnect_attachment_groups::GetOperation {
6306 super::builder::interconnect_attachment_groups::GetOperation::new(self.inner.clone())
6307 }
6308}
6309
6310/// Implements a client for the Compute Engine API.
6311///
6312/// # Example
6313/// ```
6314/// # use google_cloud_compute_v1::client::InterconnectAttachments;
6315/// async fn sample(
6316/// ) -> anyhow::Result<()> {
6317/// let client = InterconnectAttachments::builder().build().await?;
6318/// // use `client` to make requests to the Compute Engine API.
6319/// Ok(())
6320/// }
6321/// ```
6322///
6323/// # Service Description
6324///
6325/// Service for the `interconnectAttachments` resource.
6326///
6327/// # Configuration
6328///
6329/// To configure `InterconnectAttachments` use the `with_*` methods in the type returned
6330/// by [builder()][InterconnectAttachments::builder]. The default configuration should
6331/// work for most applications. Common configuration changes include
6332///
6333/// * [with_endpoint()]: by default this client uses the global default endpoint
6334/// (`https://compute.googleapis.com`). Applications using regional
6335/// endpoints or running in restricted networks (e.g. a network configured
6336/// with [Private Google Access with VPC Service Controls]) may want to
6337/// override this default.
6338/// * [with_credentials()]: by default this client uses
6339/// [Application Default Credentials]. Applications using custom
6340/// authentication may need to override this default.
6341///
6342/// [with_endpoint()]: super::builder::interconnect_attachments::ClientBuilder::with_endpoint
6343/// [with_credentials()]: super::builder::interconnect_attachments::ClientBuilder::with_credentials
6344/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6345/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6346///
6347/// # Pooling and Cloning
6348///
6349/// `InterconnectAttachments` holds a connection pool internally, it is advised to
6350/// create one and reuse it. You do not need to wrap `InterconnectAttachments` in
6351/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6352/// already uses an `Arc` internally.
6353#[cfg(feature = "interconnect-attachments")]
6354#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-attachments")))]
6355#[derive(Clone, Debug)]
6356pub struct InterconnectAttachments {
6357 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachments>,
6358}
6359
6360#[cfg(feature = "interconnect-attachments")]
6361impl InterconnectAttachments {
6362 /// Returns a builder for [InterconnectAttachments].
6363 ///
6364 /// ```
6365 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6366 /// # use google_cloud_compute_v1::client::InterconnectAttachments;
6367 /// let client = InterconnectAttachments::builder().build().await?;
6368 /// # Ok(()) }
6369 /// ```
6370 pub fn builder() -> super::builder::interconnect_attachments::ClientBuilder {
6371 crate::new_client_builder(super::builder::interconnect_attachments::client::Factory)
6372 }
6373
6374 /// Creates a new client from the provided stub.
6375 ///
6376 /// The most common case for calling this function is in tests mocking the
6377 /// client's behavior.
6378 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
6379 where
6380 T: super::stub::InterconnectAttachments + 'static,
6381 {
6382 Self { inner: stub.into() }
6383 }
6384
6385 pub(crate) async fn new(
6386 config: gaxi::options::ClientConfig,
6387 ) -> crate::ClientBuilderResult<Self> {
6388 let inner = Self::build_inner(config).await?;
6389 Ok(Self { inner })
6390 }
6391
6392 async fn build_inner(
6393 conf: gaxi::options::ClientConfig,
6394 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachments>>
6395 {
6396 if gaxi::options::tracing_enabled(&conf) {
6397 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6398 }
6399 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6400 }
6401
6402 async fn build_transport(
6403 conf: gaxi::options::ClientConfig,
6404 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectAttachments> {
6405 super::transport::InterconnectAttachments::new(conf).await
6406 }
6407
6408 async fn build_with_tracing(
6409 conf: gaxi::options::ClientConfig,
6410 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectAttachments> {
6411 Self::build_transport(conf)
6412 .await
6413 .map(super::tracing::InterconnectAttachments::new)
6414 }
6415
6416 /// Retrieves an aggregated list of interconnect attachments.
6417 ///
6418 /// To prevent failure, Google recommends that you set the
6419 /// `returnPartialSuccess` parameter to `true`.
6420 pub fn aggregated_list(&self) -> super::builder::interconnect_attachments::AggregatedList {
6421 super::builder::interconnect_attachments::AggregatedList::new(self.inner.clone())
6422 }
6423
6424 /// Deletes the specified interconnect attachment.
6425 pub fn delete(&self) -> super::builder::interconnect_attachments::Delete {
6426 super::builder::interconnect_attachments::Delete::new(self.inner.clone())
6427 }
6428
6429 /// Returns the specified interconnect attachment.
6430 pub fn get(&self) -> super::builder::interconnect_attachments::Get {
6431 super::builder::interconnect_attachments::Get::new(self.inner.clone())
6432 }
6433
6434 /// Creates an InterconnectAttachment in the specified project using the data
6435 /// included in the request.
6436 pub fn insert(&self) -> super::builder::interconnect_attachments::Insert {
6437 super::builder::interconnect_attachments::Insert::new(self.inner.clone())
6438 }
6439
6440 /// Retrieves the list of interconnect attachments contained within
6441 /// the specified region.
6442 pub fn list(&self) -> super::builder::interconnect_attachments::List {
6443 super::builder::interconnect_attachments::List::new(self.inner.clone())
6444 }
6445
6446 /// Updates the specified interconnect attachment with the data included in the
6447 /// request. This method supportsPATCH
6448 /// semantics and uses theJSON merge
6449 /// patch format and processing rules.
6450 pub fn patch(&self) -> super::builder::interconnect_attachments::Patch {
6451 super::builder::interconnect_attachments::Patch::new(self.inner.clone())
6452 }
6453
6454 /// Sets the labels on an InterconnectAttachment. To learn more about labels,
6455 /// read the Labeling
6456 /// Resources documentation.
6457 pub fn set_labels(&self) -> super::builder::interconnect_attachments::SetLabels {
6458 super::builder::interconnect_attachments::SetLabels::new(self.inner.clone())
6459 }
6460
6461 /// Retrieves the specified region-specific Operations resource.
6462 pub fn get_operation(&self) -> super::builder::interconnect_attachments::GetOperation {
6463 super::builder::interconnect_attachments::GetOperation::new(self.inner.clone())
6464 }
6465}
6466
6467/// Implements a client for the Compute Engine API.
6468///
6469/// # Example
6470/// ```
6471/// # use google_cloud_compute_v1::client::InterconnectGroups;
6472/// async fn sample(
6473/// ) -> anyhow::Result<()> {
6474/// let client = InterconnectGroups::builder().build().await?;
6475/// // use `client` to make requests to the Compute Engine API.
6476/// Ok(())
6477/// }
6478/// ```
6479///
6480/// # Service Description
6481///
6482/// Service for the `interconnectGroups` resource.
6483///
6484/// # Configuration
6485///
6486/// To configure `InterconnectGroups` use the `with_*` methods in the type returned
6487/// by [builder()][InterconnectGroups::builder]. The default configuration should
6488/// work for most applications. Common configuration changes include
6489///
6490/// * [with_endpoint()]: by default this client uses the global default endpoint
6491/// (`https://compute.googleapis.com`). Applications using regional
6492/// endpoints or running in restricted networks (e.g. a network configured
6493/// with [Private Google Access with VPC Service Controls]) may want to
6494/// override this default.
6495/// * [with_credentials()]: by default this client uses
6496/// [Application Default Credentials]. Applications using custom
6497/// authentication may need to override this default.
6498///
6499/// [with_endpoint()]: super::builder::interconnect_groups::ClientBuilder::with_endpoint
6500/// [with_credentials()]: super::builder::interconnect_groups::ClientBuilder::with_credentials
6501/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6502/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6503///
6504/// # Pooling and Cloning
6505///
6506/// `InterconnectGroups` holds a connection pool internally, it is advised to
6507/// create one and reuse it. You do not need to wrap `InterconnectGroups` in
6508/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6509/// already uses an `Arc` internally.
6510#[cfg(feature = "interconnect-groups")]
6511#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-groups")))]
6512#[derive(Clone, Debug)]
6513pub struct InterconnectGroups {
6514 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectGroups>,
6515}
6516
6517#[cfg(feature = "interconnect-groups")]
6518impl InterconnectGroups {
6519 /// Returns a builder for [InterconnectGroups].
6520 ///
6521 /// ```
6522 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6523 /// # use google_cloud_compute_v1::client::InterconnectGroups;
6524 /// let client = InterconnectGroups::builder().build().await?;
6525 /// # Ok(()) }
6526 /// ```
6527 pub fn builder() -> super::builder::interconnect_groups::ClientBuilder {
6528 crate::new_client_builder(super::builder::interconnect_groups::client::Factory)
6529 }
6530
6531 /// Creates a new client from the provided stub.
6532 ///
6533 /// The most common case for calling this function is in tests mocking the
6534 /// client's behavior.
6535 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
6536 where
6537 T: super::stub::InterconnectGroups + 'static,
6538 {
6539 Self { inner: stub.into() }
6540 }
6541
6542 pub(crate) async fn new(
6543 config: gaxi::options::ClientConfig,
6544 ) -> crate::ClientBuilderResult<Self> {
6545 let inner = Self::build_inner(config).await?;
6546 Ok(Self { inner })
6547 }
6548
6549 async fn build_inner(
6550 conf: gaxi::options::ClientConfig,
6551 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InterconnectGroups>>
6552 {
6553 if gaxi::options::tracing_enabled(&conf) {
6554 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6555 }
6556 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6557 }
6558
6559 async fn build_transport(
6560 conf: gaxi::options::ClientConfig,
6561 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectGroups> {
6562 super::transport::InterconnectGroups::new(conf).await
6563 }
6564
6565 async fn build_with_tracing(
6566 conf: gaxi::options::ClientConfig,
6567 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectGroups> {
6568 Self::build_transport(conf)
6569 .await
6570 .map(super::tracing::InterconnectGroups::new)
6571 }
6572
6573 /// Create Interconnects with redundancy by creating them in a specified
6574 /// interconnect group.
6575 pub fn create_members(&self) -> super::builder::interconnect_groups::CreateMembers {
6576 super::builder::interconnect_groups::CreateMembers::new(self.inner.clone())
6577 }
6578
6579 /// Deletes the specified InterconnectGroup in the given scope
6580 pub fn delete(&self) -> super::builder::interconnect_groups::Delete {
6581 super::builder::interconnect_groups::Delete::new(self.inner.clone())
6582 }
6583
6584 /// Returns the specified InterconnectGroup resource in the given scope.
6585 pub fn get(&self) -> super::builder::interconnect_groups::Get {
6586 super::builder::interconnect_groups::Get::new(self.inner.clone())
6587 }
6588
6589 /// Gets the access control policy for a resource. May be empty if no such
6590 /// policy or resource exists.
6591 pub fn get_iam_policy(&self) -> super::builder::interconnect_groups::GetIamPolicy {
6592 super::builder::interconnect_groups::GetIamPolicy::new(self.inner.clone())
6593 }
6594
6595 /// Returns the interconnectStatuses for the specified
6596 /// InterconnectGroup.
6597 pub fn get_operational_status(
6598 &self,
6599 ) -> super::builder::interconnect_groups::GetOperationalStatus {
6600 super::builder::interconnect_groups::GetOperationalStatus::new(self.inner.clone())
6601 }
6602
6603 /// Creates a InterconnectGroup in the specified project in the given scope
6604 /// using the parameters that are included in the request.
6605 pub fn insert(&self) -> super::builder::interconnect_groups::Insert {
6606 super::builder::interconnect_groups::Insert::new(self.inner.clone())
6607 }
6608
6609 /// Lists the InterconnectGroups for a project in the given scope.
6610 pub fn list(&self) -> super::builder::interconnect_groups::List {
6611 super::builder::interconnect_groups::List::new(self.inner.clone())
6612 }
6613
6614 /// Patches the specified InterconnectGroup resource with the data included in
6615 /// the request. This method supports PATCH
6616 /// semantics and usesJSON merge
6617 /// patch format and processing rules.
6618 pub fn patch(&self) -> super::builder::interconnect_groups::Patch {
6619 super::builder::interconnect_groups::Patch::new(self.inner.clone())
6620 }
6621
6622 /// Sets the access control policy on the specified resource.
6623 /// Replaces any existing policy.
6624 pub fn set_iam_policy(&self) -> super::builder::interconnect_groups::SetIamPolicy {
6625 super::builder::interconnect_groups::SetIamPolicy::new(self.inner.clone())
6626 }
6627
6628 /// Returns permissions that a caller has on the specified resource.
6629 pub fn test_iam_permissions(&self) -> super::builder::interconnect_groups::TestIamPermissions {
6630 super::builder::interconnect_groups::TestIamPermissions::new(self.inner.clone())
6631 }
6632
6633 /// Retrieves the specified Operations resource.
6634 pub fn get_operation(&self) -> super::builder::interconnect_groups::GetOperation {
6635 super::builder::interconnect_groups::GetOperation::new(self.inner.clone())
6636 }
6637}
6638
6639/// Implements a client for the Compute Engine API.
6640///
6641/// # Example
6642/// ```
6643/// # use google_cloud_compute_v1::client::InterconnectLocations;
6644/// async fn sample(
6645/// ) -> anyhow::Result<()> {
6646/// let client = InterconnectLocations::builder().build().await?;
6647/// // use `client` to make requests to the Compute Engine API.
6648/// Ok(())
6649/// }
6650/// ```
6651///
6652/// # Service Description
6653///
6654/// Service for the `interconnectLocations` resource.
6655///
6656/// # Configuration
6657///
6658/// To configure `InterconnectLocations` use the `with_*` methods in the type returned
6659/// by [builder()][InterconnectLocations::builder]. The default configuration should
6660/// work for most applications. Common configuration changes include
6661///
6662/// * [with_endpoint()]: by default this client uses the global default endpoint
6663/// (`https://compute.googleapis.com`). Applications using regional
6664/// endpoints or running in restricted networks (e.g. a network configured
6665/// with [Private Google Access with VPC Service Controls]) may want to
6666/// override this default.
6667/// * [with_credentials()]: by default this client uses
6668/// [Application Default Credentials]. Applications using custom
6669/// authentication may need to override this default.
6670///
6671/// [with_endpoint()]: super::builder::interconnect_locations::ClientBuilder::with_endpoint
6672/// [with_credentials()]: super::builder::interconnect_locations::ClientBuilder::with_credentials
6673/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6674/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6675///
6676/// # Pooling and Cloning
6677///
6678/// `InterconnectLocations` holds a connection pool internally, it is advised to
6679/// create one and reuse it. You do not need to wrap `InterconnectLocations` in
6680/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6681/// already uses an `Arc` internally.
6682#[cfg(feature = "interconnect-locations")]
6683#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-locations")))]
6684#[derive(Clone, Debug)]
6685pub struct InterconnectLocations {
6686 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectLocations>,
6687}
6688
6689#[cfg(feature = "interconnect-locations")]
6690impl InterconnectLocations {
6691 /// Returns a builder for [InterconnectLocations].
6692 ///
6693 /// ```
6694 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6695 /// # use google_cloud_compute_v1::client::InterconnectLocations;
6696 /// let client = InterconnectLocations::builder().build().await?;
6697 /// # Ok(()) }
6698 /// ```
6699 pub fn builder() -> super::builder::interconnect_locations::ClientBuilder {
6700 crate::new_client_builder(super::builder::interconnect_locations::client::Factory)
6701 }
6702
6703 /// Creates a new client from the provided stub.
6704 ///
6705 /// The most common case for calling this function is in tests mocking the
6706 /// client's behavior.
6707 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
6708 where
6709 T: super::stub::InterconnectLocations + 'static,
6710 {
6711 Self { inner: stub.into() }
6712 }
6713
6714 pub(crate) async fn new(
6715 config: gaxi::options::ClientConfig,
6716 ) -> crate::ClientBuilderResult<Self> {
6717 let inner = Self::build_inner(config).await?;
6718 Ok(Self { inner })
6719 }
6720
6721 async fn build_inner(
6722 conf: gaxi::options::ClientConfig,
6723 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InterconnectLocations>>
6724 {
6725 if gaxi::options::tracing_enabled(&conf) {
6726 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6727 }
6728 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6729 }
6730
6731 async fn build_transport(
6732 conf: gaxi::options::ClientConfig,
6733 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectLocations> {
6734 super::transport::InterconnectLocations::new(conf).await
6735 }
6736
6737 async fn build_with_tracing(
6738 conf: gaxi::options::ClientConfig,
6739 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectLocations> {
6740 Self::build_transport(conf)
6741 .await
6742 .map(super::tracing::InterconnectLocations::new)
6743 }
6744
6745 /// Returns the details for the specified interconnect location. Gets a list of
6746 /// available interconnect locations by making a list() request.
6747 pub fn get(&self) -> super::builder::interconnect_locations::Get {
6748 super::builder::interconnect_locations::Get::new(self.inner.clone())
6749 }
6750
6751 /// Retrieves the list of interconnect locations available to the specified
6752 /// project.
6753 pub fn list(&self) -> super::builder::interconnect_locations::List {
6754 super::builder::interconnect_locations::List::new(self.inner.clone())
6755 }
6756}
6757
6758/// Implements a client for the Compute Engine API.
6759///
6760/// # Example
6761/// ```
6762/// # use google_cloud_compute_v1::client::InterconnectRemoteLocations;
6763/// async fn sample(
6764/// ) -> anyhow::Result<()> {
6765/// let client = InterconnectRemoteLocations::builder().build().await?;
6766/// // use `client` to make requests to the Compute Engine API.
6767/// Ok(())
6768/// }
6769/// ```
6770///
6771/// # Service Description
6772///
6773/// Service for the `interconnectRemoteLocations` resource.
6774///
6775/// # Configuration
6776///
6777/// To configure `InterconnectRemoteLocations` use the `with_*` methods in the type returned
6778/// by [builder()][InterconnectRemoteLocations::builder]. The default configuration should
6779/// work for most applications. Common configuration changes include
6780///
6781/// * [with_endpoint()]: by default this client uses the global default endpoint
6782/// (`https://compute.googleapis.com`). Applications using regional
6783/// endpoints or running in restricted networks (e.g. a network configured
6784/// with [Private Google Access with VPC Service Controls]) may want to
6785/// override this default.
6786/// * [with_credentials()]: by default this client uses
6787/// [Application Default Credentials]. Applications using custom
6788/// authentication may need to override this default.
6789///
6790/// [with_endpoint()]: super::builder::interconnect_remote_locations::ClientBuilder::with_endpoint
6791/// [with_credentials()]: super::builder::interconnect_remote_locations::ClientBuilder::with_credentials
6792/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6793/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6794///
6795/// # Pooling and Cloning
6796///
6797/// `InterconnectRemoteLocations` holds a connection pool internally, it is advised to
6798/// create one and reuse it. You do not need to wrap `InterconnectRemoteLocations` in
6799/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6800/// already uses an `Arc` internally.
6801#[cfg(feature = "interconnect-remote-locations")]
6802#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-remote-locations")))]
6803#[derive(Clone, Debug)]
6804pub struct InterconnectRemoteLocations {
6805 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectRemoteLocations>,
6806}
6807
6808#[cfg(feature = "interconnect-remote-locations")]
6809impl InterconnectRemoteLocations {
6810 /// Returns a builder for [InterconnectRemoteLocations].
6811 ///
6812 /// ```
6813 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6814 /// # use google_cloud_compute_v1::client::InterconnectRemoteLocations;
6815 /// let client = InterconnectRemoteLocations::builder().build().await?;
6816 /// # Ok(()) }
6817 /// ```
6818 pub fn builder() -> super::builder::interconnect_remote_locations::ClientBuilder {
6819 crate::new_client_builder(super::builder::interconnect_remote_locations::client::Factory)
6820 }
6821
6822 /// Creates a new client from the provided stub.
6823 ///
6824 /// The most common case for calling this function is in tests mocking the
6825 /// client's behavior.
6826 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
6827 where
6828 T: super::stub::InterconnectRemoteLocations + 'static,
6829 {
6830 Self { inner: stub.into() }
6831 }
6832
6833 pub(crate) async fn new(
6834 config: gaxi::options::ClientConfig,
6835 ) -> crate::ClientBuilderResult<Self> {
6836 let inner = Self::build_inner(config).await?;
6837 Ok(Self { inner })
6838 }
6839
6840 async fn build_inner(
6841 conf: gaxi::options::ClientConfig,
6842 ) -> crate::ClientBuilderResult<
6843 std::sync::Arc<dyn super::stub::dynamic::InterconnectRemoteLocations>,
6844 > {
6845 if gaxi::options::tracing_enabled(&conf) {
6846 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6847 }
6848 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6849 }
6850
6851 async fn build_transport(
6852 conf: gaxi::options::ClientConfig,
6853 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectRemoteLocations> {
6854 super::transport::InterconnectRemoteLocations::new(conf).await
6855 }
6856
6857 async fn build_with_tracing(
6858 conf: gaxi::options::ClientConfig,
6859 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectRemoteLocations> {
6860 Self::build_transport(conf)
6861 .await
6862 .map(super::tracing::InterconnectRemoteLocations::new)
6863 }
6864
6865 /// Returns the details for the specified interconnect remote location. Gets a
6866 /// list of available interconnect remote locations by making alist() request.
6867 pub fn get(&self) -> super::builder::interconnect_remote_locations::Get {
6868 super::builder::interconnect_remote_locations::Get::new(self.inner.clone())
6869 }
6870
6871 /// Retrieves the list of interconnect remote locations available to the
6872 /// specified project.
6873 pub fn list(&self) -> super::builder::interconnect_remote_locations::List {
6874 super::builder::interconnect_remote_locations::List::new(self.inner.clone())
6875 }
6876}
6877
6878/// Implements a client for the Compute Engine API.
6879///
6880/// # Example
6881/// ```
6882/// # use google_cloud_compute_v1::client::Interconnects;
6883/// async fn sample(
6884/// ) -> anyhow::Result<()> {
6885/// let client = Interconnects::builder().build().await?;
6886/// // use `client` to make requests to the Compute Engine API.
6887/// Ok(())
6888/// }
6889/// ```
6890///
6891/// # Service Description
6892///
6893/// Service for the `interconnects` resource.
6894///
6895/// # Configuration
6896///
6897/// To configure `Interconnects` use the `with_*` methods in the type returned
6898/// by [builder()][Interconnects::builder]. The default configuration should
6899/// work for most applications. Common configuration changes include
6900///
6901/// * [with_endpoint()]: by default this client uses the global default endpoint
6902/// (`https://compute.googleapis.com`). Applications using regional
6903/// endpoints or running in restricted networks (e.g. a network configured
6904/// with [Private Google Access with VPC Service Controls]) may want to
6905/// override this default.
6906/// * [with_credentials()]: by default this client uses
6907/// [Application Default Credentials]. Applications using custom
6908/// authentication may need to override this default.
6909///
6910/// [with_endpoint()]: super::builder::interconnects::ClientBuilder::with_endpoint
6911/// [with_credentials()]: super::builder::interconnects::ClientBuilder::with_credentials
6912/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6913/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6914///
6915/// # Pooling and Cloning
6916///
6917/// `Interconnects` holds a connection pool internally, it is advised to
6918/// create one and reuse it. You do not need to wrap `Interconnects` in
6919/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6920/// already uses an `Arc` internally.
6921#[cfg(feature = "interconnects")]
6922#[cfg_attr(docsrs, doc(cfg(feature = "interconnects")))]
6923#[derive(Clone, Debug)]
6924pub struct Interconnects {
6925 inner: std::sync::Arc<dyn super::stub::dynamic::Interconnects>,
6926}
6927
6928#[cfg(feature = "interconnects")]
6929impl Interconnects {
6930 /// Returns a builder for [Interconnects].
6931 ///
6932 /// ```
6933 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6934 /// # use google_cloud_compute_v1::client::Interconnects;
6935 /// let client = Interconnects::builder().build().await?;
6936 /// # Ok(()) }
6937 /// ```
6938 pub fn builder() -> super::builder::interconnects::ClientBuilder {
6939 crate::new_client_builder(super::builder::interconnects::client::Factory)
6940 }
6941
6942 /// Creates a new client from the provided stub.
6943 ///
6944 /// The most common case for calling this function is in tests mocking the
6945 /// client's behavior.
6946 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
6947 where
6948 T: super::stub::Interconnects + 'static,
6949 {
6950 Self { inner: stub.into() }
6951 }
6952
6953 pub(crate) async fn new(
6954 config: gaxi::options::ClientConfig,
6955 ) -> crate::ClientBuilderResult<Self> {
6956 let inner = Self::build_inner(config).await?;
6957 Ok(Self { inner })
6958 }
6959
6960 async fn build_inner(
6961 conf: gaxi::options::ClientConfig,
6962 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Interconnects>> {
6963 if gaxi::options::tracing_enabled(&conf) {
6964 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6965 }
6966 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6967 }
6968
6969 async fn build_transport(
6970 conf: gaxi::options::ClientConfig,
6971 ) -> crate::ClientBuilderResult<impl super::stub::Interconnects> {
6972 super::transport::Interconnects::new(conf).await
6973 }
6974
6975 async fn build_with_tracing(
6976 conf: gaxi::options::ClientConfig,
6977 ) -> crate::ClientBuilderResult<impl super::stub::Interconnects> {
6978 Self::build_transport(conf)
6979 .await
6980 .map(super::tracing::Interconnects::new)
6981 }
6982
6983 /// Deletes the specified Interconnect.
6984 pub fn delete(&self) -> super::builder::interconnects::Delete {
6985 super::builder::interconnects::Delete::new(self.inner.clone())
6986 }
6987
6988 /// Returns the specified Interconnect. Get a list of available Interconnects
6989 /// by making a list() request.
6990 pub fn get(&self) -> super::builder::interconnects::Get {
6991 super::builder::interconnects::Get::new(self.inner.clone())
6992 }
6993
6994 /// Returns the interconnectDiagnostics for the specified
6995 /// Interconnect.
6996 ///
6997 /// In the event of a
6998 /// global outage, do not use this API to make decisions about where to
6999 /// redirect your network traffic.
7000 ///
7001 /// Unlike a VLAN attachment, which is regional, a Cloud Interconnect
7002 /// connection is a global resource. A global outage can prevent this
7003 /// API from functioning properly.
7004 pub fn get_diagnostics(&self) -> super::builder::interconnects::GetDiagnostics {
7005 super::builder::interconnects::GetDiagnostics::new(self.inner.clone())
7006 }
7007
7008 /// Returns the interconnectMacsecConfig for the specified
7009 /// Interconnect.
7010 pub fn get_macsec_config(&self) -> super::builder::interconnects::GetMacsecConfig {
7011 super::builder::interconnects::GetMacsecConfig::new(self.inner.clone())
7012 }
7013
7014 /// Creates an Interconnect in the specified project using
7015 /// the data included in the request.
7016 pub fn insert(&self) -> super::builder::interconnects::Insert {
7017 super::builder::interconnects::Insert::new(self.inner.clone())
7018 }
7019
7020 /// Retrieves the list of Interconnects available to the specified project.
7021 pub fn list(&self) -> super::builder::interconnects::List {
7022 super::builder::interconnects::List::new(self.inner.clone())
7023 }
7024
7025 /// Updates the specified Interconnect with the data included in the request.
7026 /// This method supportsPATCH
7027 /// semantics and uses theJSON merge
7028 /// patch format and processing rules.
7029 pub fn patch(&self) -> super::builder::interconnects::Patch {
7030 super::builder::interconnects::Patch::new(self.inner.clone())
7031 }
7032
7033 /// Sets the labels on an Interconnect. To learn more about labels,
7034 /// read the Labeling
7035 /// Resources documentation.
7036 pub fn set_labels(&self) -> super::builder::interconnects::SetLabels {
7037 super::builder::interconnects::SetLabels::new(self.inner.clone())
7038 }
7039
7040 /// Retrieves the specified Operations resource.
7041 pub fn get_operation(&self) -> super::builder::interconnects::GetOperation {
7042 super::builder::interconnects::GetOperation::new(self.inner.clone())
7043 }
7044}
7045
7046/// Implements a client for the Compute Engine API.
7047///
7048/// # Example
7049/// ```
7050/// # use google_cloud_compute_v1::client::LicenseCodes;
7051/// async fn sample(
7052/// ) -> anyhow::Result<()> {
7053/// let client = LicenseCodes::builder().build().await?;
7054/// // use `client` to make requests to the Compute Engine API.
7055/// Ok(())
7056/// }
7057/// ```
7058///
7059/// # Service Description
7060///
7061/// Service for the `licenseCodes` resource.
7062///
7063/// # Configuration
7064///
7065/// To configure `LicenseCodes` use the `with_*` methods in the type returned
7066/// by [builder()][LicenseCodes::builder]. The default configuration should
7067/// work for most applications. Common configuration changes include
7068///
7069/// * [with_endpoint()]: by default this client uses the global default endpoint
7070/// (`https://compute.googleapis.com`). Applications using regional
7071/// endpoints or running in restricted networks (e.g. a network configured
7072/// with [Private Google Access with VPC Service Controls]) may want to
7073/// override this default.
7074/// * [with_credentials()]: by default this client uses
7075/// [Application Default Credentials]. Applications using custom
7076/// authentication may need to override this default.
7077///
7078/// [with_endpoint()]: super::builder::license_codes::ClientBuilder::with_endpoint
7079/// [with_credentials()]: super::builder::license_codes::ClientBuilder::with_credentials
7080/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7081/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7082///
7083/// # Pooling and Cloning
7084///
7085/// `LicenseCodes` holds a connection pool internally, it is advised to
7086/// create one and reuse it. You do not need to wrap `LicenseCodes` in
7087/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7088/// already uses an `Arc` internally.
7089#[cfg(feature = "license-codes")]
7090#[cfg_attr(docsrs, doc(cfg(feature = "license-codes")))]
7091#[derive(Clone, Debug)]
7092pub struct LicenseCodes {
7093 inner: std::sync::Arc<dyn super::stub::dynamic::LicenseCodes>,
7094}
7095
7096#[cfg(feature = "license-codes")]
7097impl LicenseCodes {
7098 /// Returns a builder for [LicenseCodes].
7099 ///
7100 /// ```
7101 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7102 /// # use google_cloud_compute_v1::client::LicenseCodes;
7103 /// let client = LicenseCodes::builder().build().await?;
7104 /// # Ok(()) }
7105 /// ```
7106 pub fn builder() -> super::builder::license_codes::ClientBuilder {
7107 crate::new_client_builder(super::builder::license_codes::client::Factory)
7108 }
7109
7110 /// Creates a new client from the provided stub.
7111 ///
7112 /// The most common case for calling this function is in tests mocking the
7113 /// client's behavior.
7114 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
7115 where
7116 T: super::stub::LicenseCodes + 'static,
7117 {
7118 Self { inner: stub.into() }
7119 }
7120
7121 pub(crate) async fn new(
7122 config: gaxi::options::ClientConfig,
7123 ) -> crate::ClientBuilderResult<Self> {
7124 let inner = Self::build_inner(config).await?;
7125 Ok(Self { inner })
7126 }
7127
7128 async fn build_inner(
7129 conf: gaxi::options::ClientConfig,
7130 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::LicenseCodes>> {
7131 if gaxi::options::tracing_enabled(&conf) {
7132 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7133 }
7134 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7135 }
7136
7137 async fn build_transport(
7138 conf: gaxi::options::ClientConfig,
7139 ) -> crate::ClientBuilderResult<impl super::stub::LicenseCodes> {
7140 super::transport::LicenseCodes::new(conf).await
7141 }
7142
7143 async fn build_with_tracing(
7144 conf: gaxi::options::ClientConfig,
7145 ) -> crate::ClientBuilderResult<impl super::stub::LicenseCodes> {
7146 Self::build_transport(conf)
7147 .await
7148 .map(super::tracing::LicenseCodes::new)
7149 }
7150
7151 /// Return a specified license code. License codes are mirrored across
7152 /// all projects that have permissions to read the License Code.
7153 /// *Caution* This resource is intended
7154 /// for use only by third-party partners who are creatingCloud Marketplace
7155 /// images.
7156 pub fn get(&self) -> super::builder::license_codes::Get {
7157 super::builder::license_codes::Get::new(self.inner.clone())
7158 }
7159
7160 /// Gets the access control policy for a resource. May be empty if no such
7161 /// policy or resource exists.
7162 /// *Caution* This resource is intended
7163 /// for use only by third-party partners who are creatingCloud Marketplace
7164 /// images.
7165 pub fn get_iam_policy(&self) -> super::builder::license_codes::GetIamPolicy {
7166 super::builder::license_codes::GetIamPolicy::new(self.inner.clone())
7167 }
7168
7169 /// Sets the access control policy on the specified resource.
7170 /// Replaces any existing policy.
7171 /// *Caution* This resource is intended
7172 /// for use only by third-party partners who are creatingCloud Marketplace
7173 /// images.
7174 pub fn set_iam_policy(&self) -> super::builder::license_codes::SetIamPolicy {
7175 super::builder::license_codes::SetIamPolicy::new(self.inner.clone())
7176 }
7177
7178 /// Returns permissions that a caller has on the specified resource.
7179 /// *Caution* This resource is intended
7180 /// for use only by third-party partners who are creatingCloud Marketplace
7181 /// images.
7182 pub fn test_iam_permissions(&self) -> super::builder::license_codes::TestIamPermissions {
7183 super::builder::license_codes::TestIamPermissions::new(self.inner.clone())
7184 }
7185}
7186
7187/// Implements a client for the Compute Engine API.
7188///
7189/// # Example
7190/// ```
7191/// # use google_cloud_compute_v1::client::Licenses;
7192/// async fn sample(
7193/// ) -> anyhow::Result<()> {
7194/// let client = Licenses::builder().build().await?;
7195/// // use `client` to make requests to the Compute Engine API.
7196/// Ok(())
7197/// }
7198/// ```
7199///
7200/// # Service Description
7201///
7202/// Service for the `licenses` resource.
7203///
7204/// # Configuration
7205///
7206/// To configure `Licenses` use the `with_*` methods in the type returned
7207/// by [builder()][Licenses::builder]. The default configuration should
7208/// work for most applications. Common configuration changes include
7209///
7210/// * [with_endpoint()]: by default this client uses the global default endpoint
7211/// (`https://compute.googleapis.com`). Applications using regional
7212/// endpoints or running in restricted networks (e.g. a network configured
7213/// with [Private Google Access with VPC Service Controls]) may want to
7214/// override this default.
7215/// * [with_credentials()]: by default this client uses
7216/// [Application Default Credentials]. Applications using custom
7217/// authentication may need to override this default.
7218///
7219/// [with_endpoint()]: super::builder::licenses::ClientBuilder::with_endpoint
7220/// [with_credentials()]: super::builder::licenses::ClientBuilder::with_credentials
7221/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7222/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7223///
7224/// # Pooling and Cloning
7225///
7226/// `Licenses` holds a connection pool internally, it is advised to
7227/// create one and reuse it. You do not need to wrap `Licenses` in
7228/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7229/// already uses an `Arc` internally.
7230#[cfg(feature = "licenses")]
7231#[cfg_attr(docsrs, doc(cfg(feature = "licenses")))]
7232#[derive(Clone, Debug)]
7233pub struct Licenses {
7234 inner: std::sync::Arc<dyn super::stub::dynamic::Licenses>,
7235}
7236
7237#[cfg(feature = "licenses")]
7238impl Licenses {
7239 /// Returns a builder for [Licenses].
7240 ///
7241 /// ```
7242 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7243 /// # use google_cloud_compute_v1::client::Licenses;
7244 /// let client = Licenses::builder().build().await?;
7245 /// # Ok(()) }
7246 /// ```
7247 pub fn builder() -> super::builder::licenses::ClientBuilder {
7248 crate::new_client_builder(super::builder::licenses::client::Factory)
7249 }
7250
7251 /// Creates a new client from the provided stub.
7252 ///
7253 /// The most common case for calling this function is in tests mocking the
7254 /// client's behavior.
7255 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
7256 where
7257 T: super::stub::Licenses + 'static,
7258 {
7259 Self { inner: stub.into() }
7260 }
7261
7262 pub(crate) async fn new(
7263 config: gaxi::options::ClientConfig,
7264 ) -> crate::ClientBuilderResult<Self> {
7265 let inner = Self::build_inner(config).await?;
7266 Ok(Self { inner })
7267 }
7268
7269 async fn build_inner(
7270 conf: gaxi::options::ClientConfig,
7271 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Licenses>> {
7272 if gaxi::options::tracing_enabled(&conf) {
7273 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7274 }
7275 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7276 }
7277
7278 async fn build_transport(
7279 conf: gaxi::options::ClientConfig,
7280 ) -> crate::ClientBuilderResult<impl super::stub::Licenses> {
7281 super::transport::Licenses::new(conf).await
7282 }
7283
7284 async fn build_with_tracing(
7285 conf: gaxi::options::ClientConfig,
7286 ) -> crate::ClientBuilderResult<impl super::stub::Licenses> {
7287 Self::build_transport(conf)
7288 .await
7289 .map(super::tracing::Licenses::new)
7290 }
7291
7292 /// Deletes the specified license.
7293 /// *Caution* This resource is intended
7294 /// for use only by third-party partners who are creatingCloud Marketplace
7295 /// images.
7296 pub fn delete(&self) -> super::builder::licenses::Delete {
7297 super::builder::licenses::Delete::new(self.inner.clone())
7298 }
7299
7300 /// Returns the specified License resource.
7301 /// *Caution* This resource is intended
7302 /// for use only by third-party partners who are creatingCloud Marketplace
7303 /// images.
7304 pub fn get(&self) -> super::builder::licenses::Get {
7305 super::builder::licenses::Get::new(self.inner.clone())
7306 }
7307
7308 /// Gets the access control policy for a resource. May be empty if no such
7309 /// policy or resource exists.
7310 /// *Caution* This resource is intended
7311 /// for use only by third-party partners who are creatingCloud Marketplace
7312 /// images.
7313 pub fn get_iam_policy(&self) -> super::builder::licenses::GetIamPolicy {
7314 super::builder::licenses::GetIamPolicy::new(self.inner.clone())
7315 }
7316
7317 /// Create a License resource in the specified project.
7318 /// *Caution* This resource is intended
7319 /// for use only by third-party partners who are creatingCloud Marketplace
7320 /// images.
7321 pub fn insert(&self) -> super::builder::licenses::Insert {
7322 super::builder::licenses::Insert::new(self.inner.clone())
7323 }
7324
7325 /// Retrieves the list of licenses
7326 /// available in the specified project. This method does not
7327 /// get any licenses that belong to other projects, including licenses attached
7328 /// to publicly-available images, like Debian 9. If you want to get a list of
7329 /// publicly-available licenses, use this method to make a request to the
7330 /// respective image project, such as debian-cloud orwindows-cloud.
7331 /// *Caution* This resource is intended
7332 /// for use only by third-party partners who are creatingCloud Marketplace
7333 /// images.
7334 pub fn list(&self) -> super::builder::licenses::List {
7335 super::builder::licenses::List::new(self.inner.clone())
7336 }
7337
7338 /// Sets the access control policy on the specified resource.
7339 /// Replaces any existing policy.
7340 /// *Caution* This resource is intended
7341 /// for use only by third-party partners who are creatingCloud Marketplace
7342 /// images.
7343 pub fn set_iam_policy(&self) -> super::builder::licenses::SetIamPolicy {
7344 super::builder::licenses::SetIamPolicy::new(self.inner.clone())
7345 }
7346
7347 /// Returns permissions that a caller has on the specified resource.
7348 /// *Caution* This resource is intended
7349 /// for use only by third-party partners who are creatingCloud Marketplace
7350 /// images.
7351 pub fn test_iam_permissions(&self) -> super::builder::licenses::TestIamPermissions {
7352 super::builder::licenses::TestIamPermissions::new(self.inner.clone())
7353 }
7354
7355 /// Updates a License resource in the specified project.
7356 /// *Caution* This resource is intended
7357 /// for use only by third-party partners who are creatingCloud Marketplace
7358 /// images.
7359 pub fn update(&self) -> super::builder::licenses::Update {
7360 super::builder::licenses::Update::new(self.inner.clone())
7361 }
7362
7363 /// Retrieves the specified Operations resource.
7364 pub fn get_operation(&self) -> super::builder::licenses::GetOperation {
7365 super::builder::licenses::GetOperation::new(self.inner.clone())
7366 }
7367}
7368
7369/// Implements a client for the Compute Engine API.
7370///
7371/// # Example
7372/// ```
7373/// # use google_cloud_compute_v1::client::MachineImages;
7374/// async fn sample(
7375/// ) -> anyhow::Result<()> {
7376/// let client = MachineImages::builder().build().await?;
7377/// // use `client` to make requests to the Compute Engine API.
7378/// Ok(())
7379/// }
7380/// ```
7381///
7382/// # Service Description
7383///
7384/// Service for the `machineImages` resource.
7385///
7386/// # Configuration
7387///
7388/// To configure `MachineImages` use the `with_*` methods in the type returned
7389/// by [builder()][MachineImages::builder]. The default configuration should
7390/// work for most applications. Common configuration changes include
7391///
7392/// * [with_endpoint()]: by default this client uses the global default endpoint
7393/// (`https://compute.googleapis.com`). Applications using regional
7394/// endpoints or running in restricted networks (e.g. a network configured
7395/// with [Private Google Access with VPC Service Controls]) may want to
7396/// override this default.
7397/// * [with_credentials()]: by default this client uses
7398/// [Application Default Credentials]. Applications using custom
7399/// authentication may need to override this default.
7400///
7401/// [with_endpoint()]: super::builder::machine_images::ClientBuilder::with_endpoint
7402/// [with_credentials()]: super::builder::machine_images::ClientBuilder::with_credentials
7403/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7404/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7405///
7406/// # Pooling and Cloning
7407///
7408/// `MachineImages` holds a connection pool internally, it is advised to
7409/// create one and reuse it. You do not need to wrap `MachineImages` in
7410/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7411/// already uses an `Arc` internally.
7412#[cfg(feature = "machine-images")]
7413#[cfg_attr(docsrs, doc(cfg(feature = "machine-images")))]
7414#[derive(Clone, Debug)]
7415pub struct MachineImages {
7416 inner: std::sync::Arc<dyn super::stub::dynamic::MachineImages>,
7417}
7418
7419#[cfg(feature = "machine-images")]
7420impl MachineImages {
7421 /// Returns a builder for [MachineImages].
7422 ///
7423 /// ```
7424 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7425 /// # use google_cloud_compute_v1::client::MachineImages;
7426 /// let client = MachineImages::builder().build().await?;
7427 /// # Ok(()) }
7428 /// ```
7429 pub fn builder() -> super::builder::machine_images::ClientBuilder {
7430 crate::new_client_builder(super::builder::machine_images::client::Factory)
7431 }
7432
7433 /// Creates a new client from the provided stub.
7434 ///
7435 /// The most common case for calling this function is in tests mocking the
7436 /// client's behavior.
7437 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
7438 where
7439 T: super::stub::MachineImages + 'static,
7440 {
7441 Self { inner: stub.into() }
7442 }
7443
7444 pub(crate) async fn new(
7445 config: gaxi::options::ClientConfig,
7446 ) -> crate::ClientBuilderResult<Self> {
7447 let inner = Self::build_inner(config).await?;
7448 Ok(Self { inner })
7449 }
7450
7451 async fn build_inner(
7452 conf: gaxi::options::ClientConfig,
7453 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::MachineImages>> {
7454 if gaxi::options::tracing_enabled(&conf) {
7455 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7456 }
7457 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7458 }
7459
7460 async fn build_transport(
7461 conf: gaxi::options::ClientConfig,
7462 ) -> crate::ClientBuilderResult<impl super::stub::MachineImages> {
7463 super::transport::MachineImages::new(conf).await
7464 }
7465
7466 async fn build_with_tracing(
7467 conf: gaxi::options::ClientConfig,
7468 ) -> crate::ClientBuilderResult<impl super::stub::MachineImages> {
7469 Self::build_transport(conf)
7470 .await
7471 .map(super::tracing::MachineImages::new)
7472 }
7473
7474 /// Deletes the specified machine image. Deleting a machine image is permanent
7475 /// and cannot be undone.
7476 pub fn delete(&self) -> super::builder::machine_images::Delete {
7477 super::builder::machine_images::Delete::new(self.inner.clone())
7478 }
7479
7480 /// Returns the specified machine image.
7481 pub fn get(&self) -> super::builder::machine_images::Get {
7482 super::builder::machine_images::Get::new(self.inner.clone())
7483 }
7484
7485 /// Gets the access control policy for a resource. May be empty if no such
7486 /// policy or resource exists.
7487 pub fn get_iam_policy(&self) -> super::builder::machine_images::GetIamPolicy {
7488 super::builder::machine_images::GetIamPolicy::new(self.inner.clone())
7489 }
7490
7491 /// Creates a machine image in the specified project using the
7492 /// data that is included in the request. If you are creating a new machine
7493 /// image to update an existing instance, your new machine image should use the
7494 /// same network or, if applicable, the same subnetwork as the original
7495 /// instance.
7496 pub fn insert(&self) -> super::builder::machine_images::Insert {
7497 super::builder::machine_images::Insert::new(self.inner.clone())
7498 }
7499
7500 /// Retrieves a list of machine images that are contained within
7501 /// the specified project.
7502 pub fn list(&self) -> super::builder::machine_images::List {
7503 super::builder::machine_images::List::new(self.inner.clone())
7504 }
7505
7506 /// Sets the access control policy on the specified resource.
7507 /// Replaces any existing policy.
7508 pub fn set_iam_policy(&self) -> super::builder::machine_images::SetIamPolicy {
7509 super::builder::machine_images::SetIamPolicy::new(self.inner.clone())
7510 }
7511
7512 /// Sets the labels on a machine image. To learn more about labels, read theLabeling
7513 /// Resources documentation.
7514 pub fn set_labels(&self) -> super::builder::machine_images::SetLabels {
7515 super::builder::machine_images::SetLabels::new(self.inner.clone())
7516 }
7517
7518 /// Returns permissions that a caller has on the specified resource.
7519 pub fn test_iam_permissions(&self) -> super::builder::machine_images::TestIamPermissions {
7520 super::builder::machine_images::TestIamPermissions::new(self.inner.clone())
7521 }
7522
7523 /// Retrieves the specified Operations resource.
7524 pub fn get_operation(&self) -> super::builder::machine_images::GetOperation {
7525 super::builder::machine_images::GetOperation::new(self.inner.clone())
7526 }
7527}
7528
7529/// Implements a client for the Compute Engine API.
7530///
7531/// # Example
7532/// ```
7533/// # use google_cloud_compute_v1::client::MachineTypes;
7534/// async fn sample(
7535/// ) -> anyhow::Result<()> {
7536/// let client = MachineTypes::builder().build().await?;
7537/// // use `client` to make requests to the Compute Engine API.
7538/// Ok(())
7539/// }
7540/// ```
7541///
7542/// # Service Description
7543///
7544/// Service for the `machineTypes` resource.
7545///
7546/// # Configuration
7547///
7548/// To configure `MachineTypes` use the `with_*` methods in the type returned
7549/// by [builder()][MachineTypes::builder]. The default configuration should
7550/// work for most applications. Common configuration changes include
7551///
7552/// * [with_endpoint()]: by default this client uses the global default endpoint
7553/// (`https://compute.googleapis.com`). Applications using regional
7554/// endpoints or running in restricted networks (e.g. a network configured
7555/// with [Private Google Access with VPC Service Controls]) may want to
7556/// override this default.
7557/// * [with_credentials()]: by default this client uses
7558/// [Application Default Credentials]. Applications using custom
7559/// authentication may need to override this default.
7560///
7561/// [with_endpoint()]: super::builder::machine_types::ClientBuilder::with_endpoint
7562/// [with_credentials()]: super::builder::machine_types::ClientBuilder::with_credentials
7563/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7564/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7565///
7566/// # Pooling and Cloning
7567///
7568/// `MachineTypes` holds a connection pool internally, it is advised to
7569/// create one and reuse it. You do not need to wrap `MachineTypes` in
7570/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7571/// already uses an `Arc` internally.
7572#[cfg(feature = "machine-types")]
7573#[cfg_attr(docsrs, doc(cfg(feature = "machine-types")))]
7574#[derive(Clone, Debug)]
7575pub struct MachineTypes {
7576 inner: std::sync::Arc<dyn super::stub::dynamic::MachineTypes>,
7577}
7578
7579#[cfg(feature = "machine-types")]
7580impl MachineTypes {
7581 /// Returns a builder for [MachineTypes].
7582 ///
7583 /// ```
7584 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7585 /// # use google_cloud_compute_v1::client::MachineTypes;
7586 /// let client = MachineTypes::builder().build().await?;
7587 /// # Ok(()) }
7588 /// ```
7589 pub fn builder() -> super::builder::machine_types::ClientBuilder {
7590 crate::new_client_builder(super::builder::machine_types::client::Factory)
7591 }
7592
7593 /// Creates a new client from the provided stub.
7594 ///
7595 /// The most common case for calling this function is in tests mocking the
7596 /// client's behavior.
7597 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
7598 where
7599 T: super::stub::MachineTypes + 'static,
7600 {
7601 Self { inner: stub.into() }
7602 }
7603
7604 pub(crate) async fn new(
7605 config: gaxi::options::ClientConfig,
7606 ) -> crate::ClientBuilderResult<Self> {
7607 let inner = Self::build_inner(config).await?;
7608 Ok(Self { inner })
7609 }
7610
7611 async fn build_inner(
7612 conf: gaxi::options::ClientConfig,
7613 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::MachineTypes>> {
7614 if gaxi::options::tracing_enabled(&conf) {
7615 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7616 }
7617 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7618 }
7619
7620 async fn build_transport(
7621 conf: gaxi::options::ClientConfig,
7622 ) -> crate::ClientBuilderResult<impl super::stub::MachineTypes> {
7623 super::transport::MachineTypes::new(conf).await
7624 }
7625
7626 async fn build_with_tracing(
7627 conf: gaxi::options::ClientConfig,
7628 ) -> crate::ClientBuilderResult<impl super::stub::MachineTypes> {
7629 Self::build_transport(conf)
7630 .await
7631 .map(super::tracing::MachineTypes::new)
7632 }
7633
7634 /// Retrieves an aggregated list of machine types.
7635 ///
7636 /// To prevent failure, Google recommends that you set the
7637 /// `returnPartialSuccess` parameter to `true`.
7638 pub fn aggregated_list(&self) -> super::builder::machine_types::AggregatedList {
7639 super::builder::machine_types::AggregatedList::new(self.inner.clone())
7640 }
7641
7642 /// Returns the specified machine type.
7643 pub fn get(&self) -> super::builder::machine_types::Get {
7644 super::builder::machine_types::Get::new(self.inner.clone())
7645 }
7646
7647 /// Retrieves a list of machine types available to the specified
7648 /// project.
7649 pub fn list(&self) -> super::builder::machine_types::List {
7650 super::builder::machine_types::List::new(self.inner.clone())
7651 }
7652}
7653
7654/// Implements a client for the Compute Engine API.
7655///
7656/// # Example
7657/// ```
7658/// # use google_cloud_compute_v1::client::NetworkAttachments;
7659/// async fn sample(
7660/// ) -> anyhow::Result<()> {
7661/// let client = NetworkAttachments::builder().build().await?;
7662/// // use `client` to make requests to the Compute Engine API.
7663/// Ok(())
7664/// }
7665/// ```
7666///
7667/// # Service Description
7668///
7669/// Service for the `networkAttachments` resource.
7670///
7671/// # Configuration
7672///
7673/// To configure `NetworkAttachments` use the `with_*` methods in the type returned
7674/// by [builder()][NetworkAttachments::builder]. The default configuration should
7675/// work for most applications. Common configuration changes include
7676///
7677/// * [with_endpoint()]: by default this client uses the global default endpoint
7678/// (`https://compute.googleapis.com`). Applications using regional
7679/// endpoints or running in restricted networks (e.g. a network configured
7680/// with [Private Google Access with VPC Service Controls]) may want to
7681/// override this default.
7682/// * [with_credentials()]: by default this client uses
7683/// [Application Default Credentials]. Applications using custom
7684/// authentication may need to override this default.
7685///
7686/// [with_endpoint()]: super::builder::network_attachments::ClientBuilder::with_endpoint
7687/// [with_credentials()]: super::builder::network_attachments::ClientBuilder::with_credentials
7688/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7689/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7690///
7691/// # Pooling and Cloning
7692///
7693/// `NetworkAttachments` holds a connection pool internally, it is advised to
7694/// create one and reuse it. You do not need to wrap `NetworkAttachments` in
7695/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7696/// already uses an `Arc` internally.
7697#[cfg(feature = "network-attachments")]
7698#[cfg_attr(docsrs, doc(cfg(feature = "network-attachments")))]
7699#[derive(Clone, Debug)]
7700pub struct NetworkAttachments {
7701 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkAttachments>,
7702}
7703
7704#[cfg(feature = "network-attachments")]
7705impl NetworkAttachments {
7706 /// Returns a builder for [NetworkAttachments].
7707 ///
7708 /// ```
7709 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7710 /// # use google_cloud_compute_v1::client::NetworkAttachments;
7711 /// let client = NetworkAttachments::builder().build().await?;
7712 /// # Ok(()) }
7713 /// ```
7714 pub fn builder() -> super::builder::network_attachments::ClientBuilder {
7715 crate::new_client_builder(super::builder::network_attachments::client::Factory)
7716 }
7717
7718 /// Creates a new client from the provided stub.
7719 ///
7720 /// The most common case for calling this function is in tests mocking the
7721 /// client's behavior.
7722 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
7723 where
7724 T: super::stub::NetworkAttachments + 'static,
7725 {
7726 Self { inner: stub.into() }
7727 }
7728
7729 pub(crate) async fn new(
7730 config: gaxi::options::ClientConfig,
7731 ) -> crate::ClientBuilderResult<Self> {
7732 let inner = Self::build_inner(config).await?;
7733 Ok(Self { inner })
7734 }
7735
7736 async fn build_inner(
7737 conf: gaxi::options::ClientConfig,
7738 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NetworkAttachments>>
7739 {
7740 if gaxi::options::tracing_enabled(&conf) {
7741 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7742 }
7743 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7744 }
7745
7746 async fn build_transport(
7747 conf: gaxi::options::ClientConfig,
7748 ) -> crate::ClientBuilderResult<impl super::stub::NetworkAttachments> {
7749 super::transport::NetworkAttachments::new(conf).await
7750 }
7751
7752 async fn build_with_tracing(
7753 conf: gaxi::options::ClientConfig,
7754 ) -> crate::ClientBuilderResult<impl super::stub::NetworkAttachments> {
7755 Self::build_transport(conf)
7756 .await
7757 .map(super::tracing::NetworkAttachments::new)
7758 }
7759
7760 /// Retrieves the list of all NetworkAttachment resources,
7761 /// regional and global, available to the specified project.
7762 ///
7763 /// To prevent failure, Google recommends that you set the
7764 /// `returnPartialSuccess` parameter to `true`.
7765 pub fn aggregated_list(&self) -> super::builder::network_attachments::AggregatedList {
7766 super::builder::network_attachments::AggregatedList::new(self.inner.clone())
7767 }
7768
7769 /// Deletes the specified NetworkAttachment in the given scope
7770 pub fn delete(&self) -> super::builder::network_attachments::Delete {
7771 super::builder::network_attachments::Delete::new(self.inner.clone())
7772 }
7773
7774 /// Returns the specified NetworkAttachment resource in the given scope.
7775 pub fn get(&self) -> super::builder::network_attachments::Get {
7776 super::builder::network_attachments::Get::new(self.inner.clone())
7777 }
7778
7779 /// Gets the access control policy for a resource. May be empty if no such
7780 /// policy or resource exists.
7781 pub fn get_iam_policy(&self) -> super::builder::network_attachments::GetIamPolicy {
7782 super::builder::network_attachments::GetIamPolicy::new(self.inner.clone())
7783 }
7784
7785 /// Creates a NetworkAttachment in the specified project in the given scope
7786 /// using the parameters that are included in the request.
7787 pub fn insert(&self) -> super::builder::network_attachments::Insert {
7788 super::builder::network_attachments::Insert::new(self.inner.clone())
7789 }
7790
7791 /// Lists the NetworkAttachments for a project in the given scope.
7792 pub fn list(&self) -> super::builder::network_attachments::List {
7793 super::builder::network_attachments::List::new(self.inner.clone())
7794 }
7795
7796 /// Patches the specified NetworkAttachment resource with the data included in
7797 /// the request. This method supports PATCH
7798 /// semantics and usesJSON merge
7799 /// patch format and processing rules.
7800 pub fn patch(&self) -> super::builder::network_attachments::Patch {
7801 super::builder::network_attachments::Patch::new(self.inner.clone())
7802 }
7803
7804 /// Sets the access control policy on the specified resource.
7805 /// Replaces any existing policy.
7806 pub fn set_iam_policy(&self) -> super::builder::network_attachments::SetIamPolicy {
7807 super::builder::network_attachments::SetIamPolicy::new(self.inner.clone())
7808 }
7809
7810 /// Returns permissions that a caller has on the specified resource.
7811 pub fn test_iam_permissions(&self) -> super::builder::network_attachments::TestIamPermissions {
7812 super::builder::network_attachments::TestIamPermissions::new(self.inner.clone())
7813 }
7814
7815 /// Retrieves the specified region-specific Operations resource.
7816 pub fn get_operation(&self) -> super::builder::network_attachments::GetOperation {
7817 super::builder::network_attachments::GetOperation::new(self.inner.clone())
7818 }
7819}
7820
7821/// Implements a client for the Compute Engine API.
7822///
7823/// # Example
7824/// ```
7825/// # use google_cloud_compute_v1::client::NetworkEdgeSecurityServices;
7826/// async fn sample(
7827/// ) -> anyhow::Result<()> {
7828/// let client = NetworkEdgeSecurityServices::builder().build().await?;
7829/// // use `client` to make requests to the Compute Engine API.
7830/// Ok(())
7831/// }
7832/// ```
7833///
7834/// # Service Description
7835///
7836/// Service for the `networkEdgeSecurityServices` resource.
7837///
7838/// # Configuration
7839///
7840/// To configure `NetworkEdgeSecurityServices` use the `with_*` methods in the type returned
7841/// by [builder()][NetworkEdgeSecurityServices::builder]. The default configuration should
7842/// work for most applications. Common configuration changes include
7843///
7844/// * [with_endpoint()]: by default this client uses the global default endpoint
7845/// (`https://compute.googleapis.com`). Applications using regional
7846/// endpoints or running in restricted networks (e.g. a network configured
7847/// with [Private Google Access with VPC Service Controls]) may want to
7848/// override this default.
7849/// * [with_credentials()]: by default this client uses
7850/// [Application Default Credentials]. Applications using custom
7851/// authentication may need to override this default.
7852///
7853/// [with_endpoint()]: super::builder::network_edge_security_services::ClientBuilder::with_endpoint
7854/// [with_credentials()]: super::builder::network_edge_security_services::ClientBuilder::with_credentials
7855/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7856/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7857///
7858/// # Pooling and Cloning
7859///
7860/// `NetworkEdgeSecurityServices` holds a connection pool internally, it is advised to
7861/// create one and reuse it. You do not need to wrap `NetworkEdgeSecurityServices` in
7862/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7863/// already uses an `Arc` internally.
7864#[cfg(feature = "network-edge-security-services")]
7865#[cfg_attr(docsrs, doc(cfg(feature = "network-edge-security-services")))]
7866#[derive(Clone, Debug)]
7867pub struct NetworkEdgeSecurityServices {
7868 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkEdgeSecurityServices>,
7869}
7870
7871#[cfg(feature = "network-edge-security-services")]
7872impl NetworkEdgeSecurityServices {
7873 /// Returns a builder for [NetworkEdgeSecurityServices].
7874 ///
7875 /// ```
7876 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7877 /// # use google_cloud_compute_v1::client::NetworkEdgeSecurityServices;
7878 /// let client = NetworkEdgeSecurityServices::builder().build().await?;
7879 /// # Ok(()) }
7880 /// ```
7881 pub fn builder() -> super::builder::network_edge_security_services::ClientBuilder {
7882 crate::new_client_builder(super::builder::network_edge_security_services::client::Factory)
7883 }
7884
7885 /// Creates a new client from the provided stub.
7886 ///
7887 /// The most common case for calling this function is in tests mocking the
7888 /// client's behavior.
7889 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
7890 where
7891 T: super::stub::NetworkEdgeSecurityServices + 'static,
7892 {
7893 Self { inner: stub.into() }
7894 }
7895
7896 pub(crate) async fn new(
7897 config: gaxi::options::ClientConfig,
7898 ) -> crate::ClientBuilderResult<Self> {
7899 let inner = Self::build_inner(config).await?;
7900 Ok(Self { inner })
7901 }
7902
7903 async fn build_inner(
7904 conf: gaxi::options::ClientConfig,
7905 ) -> crate::ClientBuilderResult<
7906 std::sync::Arc<dyn super::stub::dynamic::NetworkEdgeSecurityServices>,
7907 > {
7908 if gaxi::options::tracing_enabled(&conf) {
7909 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7910 }
7911 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7912 }
7913
7914 async fn build_transport(
7915 conf: gaxi::options::ClientConfig,
7916 ) -> crate::ClientBuilderResult<impl super::stub::NetworkEdgeSecurityServices> {
7917 super::transport::NetworkEdgeSecurityServices::new(conf).await
7918 }
7919
7920 async fn build_with_tracing(
7921 conf: gaxi::options::ClientConfig,
7922 ) -> crate::ClientBuilderResult<impl super::stub::NetworkEdgeSecurityServices> {
7923 Self::build_transport(conf)
7924 .await
7925 .map(super::tracing::NetworkEdgeSecurityServices::new)
7926 }
7927
7928 /// Retrieves the list of all NetworkEdgeSecurityService resources available to
7929 /// the specified project.
7930 ///
7931 /// To prevent failure, Google recommends that you set the
7932 /// `returnPartialSuccess` parameter to `true`.
7933 pub fn aggregated_list(
7934 &self,
7935 ) -> super::builder::network_edge_security_services::AggregatedList {
7936 super::builder::network_edge_security_services::AggregatedList::new(self.inner.clone())
7937 }
7938
7939 /// Deletes the specified service.
7940 pub fn delete(&self) -> super::builder::network_edge_security_services::Delete {
7941 super::builder::network_edge_security_services::Delete::new(self.inner.clone())
7942 }
7943
7944 /// Gets a specified NetworkEdgeSecurityService.
7945 pub fn get(&self) -> super::builder::network_edge_security_services::Get {
7946 super::builder::network_edge_security_services::Get::new(self.inner.clone())
7947 }
7948
7949 /// Creates a new service in the specified project using the data included in
7950 /// the request.
7951 pub fn insert(&self) -> super::builder::network_edge_security_services::Insert {
7952 super::builder::network_edge_security_services::Insert::new(self.inner.clone())
7953 }
7954
7955 /// Patches the specified policy with the data included in the request.
7956 pub fn patch(&self) -> super::builder::network_edge_security_services::Patch {
7957 super::builder::network_edge_security_services::Patch::new(self.inner.clone())
7958 }
7959
7960 /// Retrieves the specified region-specific Operations resource.
7961 pub fn get_operation(&self) -> super::builder::network_edge_security_services::GetOperation {
7962 super::builder::network_edge_security_services::GetOperation::new(self.inner.clone())
7963 }
7964}
7965
7966/// Implements a client for the Compute Engine API.
7967///
7968/// # Example
7969/// ```
7970/// # use google_cloud_compute_v1::client::NetworkEndpointGroups;
7971/// async fn sample(
7972/// ) -> anyhow::Result<()> {
7973/// let client = NetworkEndpointGroups::builder().build().await?;
7974/// // use `client` to make requests to the Compute Engine API.
7975/// Ok(())
7976/// }
7977/// ```
7978///
7979/// # Service Description
7980///
7981/// Service for the `networkEndpointGroups` resource.
7982///
7983/// # Configuration
7984///
7985/// To configure `NetworkEndpointGroups` use the `with_*` methods in the type returned
7986/// by [builder()][NetworkEndpointGroups::builder]. The default configuration should
7987/// work for most applications. Common configuration changes include
7988///
7989/// * [with_endpoint()]: by default this client uses the global default endpoint
7990/// (`https://compute.googleapis.com`). Applications using regional
7991/// endpoints or running in restricted networks (e.g. a network configured
7992/// with [Private Google Access with VPC Service Controls]) may want to
7993/// override this default.
7994/// * [with_credentials()]: by default this client uses
7995/// [Application Default Credentials]. Applications using custom
7996/// authentication may need to override this default.
7997///
7998/// [with_endpoint()]: super::builder::network_endpoint_groups::ClientBuilder::with_endpoint
7999/// [with_credentials()]: super::builder::network_endpoint_groups::ClientBuilder::with_credentials
8000/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8001/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8002///
8003/// # Pooling and Cloning
8004///
8005/// `NetworkEndpointGroups` holds a connection pool internally, it is advised to
8006/// create one and reuse it. You do not need to wrap `NetworkEndpointGroups` in
8007/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8008/// already uses an `Arc` internally.
8009#[cfg(feature = "network-endpoint-groups")]
8010#[cfg_attr(docsrs, doc(cfg(feature = "network-endpoint-groups")))]
8011#[derive(Clone, Debug)]
8012pub struct NetworkEndpointGroups {
8013 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkEndpointGroups>,
8014}
8015
8016#[cfg(feature = "network-endpoint-groups")]
8017impl NetworkEndpointGroups {
8018 /// Returns a builder for [NetworkEndpointGroups].
8019 ///
8020 /// ```
8021 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8022 /// # use google_cloud_compute_v1::client::NetworkEndpointGroups;
8023 /// let client = NetworkEndpointGroups::builder().build().await?;
8024 /// # Ok(()) }
8025 /// ```
8026 pub fn builder() -> super::builder::network_endpoint_groups::ClientBuilder {
8027 crate::new_client_builder(super::builder::network_endpoint_groups::client::Factory)
8028 }
8029
8030 /// Creates a new client from the provided stub.
8031 ///
8032 /// The most common case for calling this function is in tests mocking the
8033 /// client's behavior.
8034 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
8035 where
8036 T: super::stub::NetworkEndpointGroups + 'static,
8037 {
8038 Self { inner: stub.into() }
8039 }
8040
8041 pub(crate) async fn new(
8042 config: gaxi::options::ClientConfig,
8043 ) -> crate::ClientBuilderResult<Self> {
8044 let inner = Self::build_inner(config).await?;
8045 Ok(Self { inner })
8046 }
8047
8048 async fn build_inner(
8049 conf: gaxi::options::ClientConfig,
8050 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NetworkEndpointGroups>>
8051 {
8052 if gaxi::options::tracing_enabled(&conf) {
8053 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8054 }
8055 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8056 }
8057
8058 async fn build_transport(
8059 conf: gaxi::options::ClientConfig,
8060 ) -> crate::ClientBuilderResult<impl super::stub::NetworkEndpointGroups> {
8061 super::transport::NetworkEndpointGroups::new(conf).await
8062 }
8063
8064 async fn build_with_tracing(
8065 conf: gaxi::options::ClientConfig,
8066 ) -> crate::ClientBuilderResult<impl super::stub::NetworkEndpointGroups> {
8067 Self::build_transport(conf)
8068 .await
8069 .map(super::tracing::NetworkEndpointGroups::new)
8070 }
8071
8072 /// Retrieves the list of network endpoint groups and sorts them by zone.
8073 ///
8074 /// To prevent failure, Google recommends that you set the
8075 /// `returnPartialSuccess` parameter to `true`.
8076 pub fn aggregated_list(&self) -> super::builder::network_endpoint_groups::AggregatedList {
8077 super::builder::network_endpoint_groups::AggregatedList::new(self.inner.clone())
8078 }
8079
8080 /// Attach a list of network endpoints to the specified network endpoint group.
8081 pub fn attach_network_endpoints(
8082 &self,
8083 ) -> super::builder::network_endpoint_groups::AttachNetworkEndpoints {
8084 super::builder::network_endpoint_groups::AttachNetworkEndpoints::new(self.inner.clone())
8085 }
8086
8087 /// Deletes the specified network endpoint group. The network endpoints in the
8088 /// NEG and the VM instances they belong to are not terminated when the NEG is
8089 /// deleted. Note that the NEG cannot be deleted if there are backend services
8090 /// referencing it.
8091 pub fn delete(&self) -> super::builder::network_endpoint_groups::Delete {
8092 super::builder::network_endpoint_groups::Delete::new(self.inner.clone())
8093 }
8094
8095 /// Detach a list of network endpoints from the specified network endpoint
8096 /// group.
8097 pub fn detach_network_endpoints(
8098 &self,
8099 ) -> super::builder::network_endpoint_groups::DetachNetworkEndpoints {
8100 super::builder::network_endpoint_groups::DetachNetworkEndpoints::new(self.inner.clone())
8101 }
8102
8103 /// Returns the specified network endpoint group.
8104 pub fn get(&self) -> super::builder::network_endpoint_groups::Get {
8105 super::builder::network_endpoint_groups::Get::new(self.inner.clone())
8106 }
8107
8108 /// Creates a network endpoint group in the specified project using the
8109 /// parameters that are included in the request.
8110 ///
8111 /// Note: Use the following APIs to manage network endpoint groups:
8112 ///
8113 /// - To manage NEGs with zonal scope (such as zonal NEGs, hybrid connectivity
8114 /// NEGs): zonal
8115 /// API
8116 /// - To manage NEGs with regional scope (such as regional internet NEGs,
8117 /// serverless NEGs, Private Service Connect NEGs): regional
8118 /// API
8119 /// - To manage NEGs with global scope (such as global internet NEGs):global
8120 /// API
8121 pub fn insert(&self) -> super::builder::network_endpoint_groups::Insert {
8122 super::builder::network_endpoint_groups::Insert::new(self.inner.clone())
8123 }
8124
8125 /// Retrieves the list of network endpoint groups that are located in the
8126 /// specified project and zone.
8127 pub fn list(&self) -> super::builder::network_endpoint_groups::List {
8128 super::builder::network_endpoint_groups::List::new(self.inner.clone())
8129 }
8130
8131 /// Lists the network endpoints in the specified network endpoint group.
8132 pub fn list_network_endpoints(
8133 &self,
8134 ) -> super::builder::network_endpoint_groups::ListNetworkEndpoints {
8135 super::builder::network_endpoint_groups::ListNetworkEndpoints::new(self.inner.clone())
8136 }
8137
8138 /// Returns permissions that a caller has on the specified resource.
8139 pub fn test_iam_permissions(
8140 &self,
8141 ) -> super::builder::network_endpoint_groups::TestIamPermissions {
8142 super::builder::network_endpoint_groups::TestIamPermissions::new(self.inner.clone())
8143 }
8144
8145 /// Retrieves the specified zone-specific Operations resource.
8146 pub fn get_operation(&self) -> super::builder::network_endpoint_groups::GetOperation {
8147 super::builder::network_endpoint_groups::GetOperation::new(self.inner.clone())
8148 }
8149}
8150
8151/// Implements a client for the Compute Engine API.
8152///
8153/// # Example
8154/// ```
8155/// # use google_cloud_compute_v1::client::NetworkFirewallPolicies;
8156/// async fn sample(
8157/// ) -> anyhow::Result<()> {
8158/// let client = NetworkFirewallPolicies::builder().build().await?;
8159/// // use `client` to make requests to the Compute Engine API.
8160/// Ok(())
8161/// }
8162/// ```
8163///
8164/// # Service Description
8165///
8166/// Service for the `networkFirewallPolicies` resource.
8167///
8168/// # Configuration
8169///
8170/// To configure `NetworkFirewallPolicies` use the `with_*` methods in the type returned
8171/// by [builder()][NetworkFirewallPolicies::builder]. The default configuration should
8172/// work for most applications. Common configuration changes include
8173///
8174/// * [with_endpoint()]: by default this client uses the global default endpoint
8175/// (`https://compute.googleapis.com`). Applications using regional
8176/// endpoints or running in restricted networks (e.g. a network configured
8177/// with [Private Google Access with VPC Service Controls]) may want to
8178/// override this default.
8179/// * [with_credentials()]: by default this client uses
8180/// [Application Default Credentials]. Applications using custom
8181/// authentication may need to override this default.
8182///
8183/// [with_endpoint()]: super::builder::network_firewall_policies::ClientBuilder::with_endpoint
8184/// [with_credentials()]: super::builder::network_firewall_policies::ClientBuilder::with_credentials
8185/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8186/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8187///
8188/// # Pooling and Cloning
8189///
8190/// `NetworkFirewallPolicies` holds a connection pool internally, it is advised to
8191/// create one and reuse it. You do not need to wrap `NetworkFirewallPolicies` in
8192/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8193/// already uses an `Arc` internally.
8194#[cfg(feature = "network-firewall-policies")]
8195#[cfg_attr(docsrs, doc(cfg(feature = "network-firewall-policies")))]
8196#[derive(Clone, Debug)]
8197pub struct NetworkFirewallPolicies {
8198 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkFirewallPolicies>,
8199}
8200
8201#[cfg(feature = "network-firewall-policies")]
8202impl NetworkFirewallPolicies {
8203 /// Returns a builder for [NetworkFirewallPolicies].
8204 ///
8205 /// ```
8206 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8207 /// # use google_cloud_compute_v1::client::NetworkFirewallPolicies;
8208 /// let client = NetworkFirewallPolicies::builder().build().await?;
8209 /// # Ok(()) }
8210 /// ```
8211 pub fn builder() -> super::builder::network_firewall_policies::ClientBuilder {
8212 crate::new_client_builder(super::builder::network_firewall_policies::client::Factory)
8213 }
8214
8215 /// Creates a new client from the provided stub.
8216 ///
8217 /// The most common case for calling this function is in tests mocking the
8218 /// client's behavior.
8219 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
8220 where
8221 T: super::stub::NetworkFirewallPolicies + 'static,
8222 {
8223 Self { inner: stub.into() }
8224 }
8225
8226 pub(crate) async fn new(
8227 config: gaxi::options::ClientConfig,
8228 ) -> crate::ClientBuilderResult<Self> {
8229 let inner = Self::build_inner(config).await?;
8230 Ok(Self { inner })
8231 }
8232
8233 async fn build_inner(
8234 conf: gaxi::options::ClientConfig,
8235 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NetworkFirewallPolicies>>
8236 {
8237 if gaxi::options::tracing_enabled(&conf) {
8238 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8239 }
8240 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8241 }
8242
8243 async fn build_transport(
8244 conf: gaxi::options::ClientConfig,
8245 ) -> crate::ClientBuilderResult<impl super::stub::NetworkFirewallPolicies> {
8246 super::transport::NetworkFirewallPolicies::new(conf).await
8247 }
8248
8249 async fn build_with_tracing(
8250 conf: gaxi::options::ClientConfig,
8251 ) -> crate::ClientBuilderResult<impl super::stub::NetworkFirewallPolicies> {
8252 Self::build_transport(conf)
8253 .await
8254 .map(super::tracing::NetworkFirewallPolicies::new)
8255 }
8256
8257 /// Inserts an association for the specified firewall policy.
8258 pub fn add_association(&self) -> super::builder::network_firewall_policies::AddAssociation {
8259 super::builder::network_firewall_policies::AddAssociation::new(self.inner.clone())
8260 }
8261
8262 /// Inserts a packet mirroring rule into a firewall policy.
8263 pub fn add_packet_mirroring_rule(
8264 &self,
8265 ) -> super::builder::network_firewall_policies::AddPacketMirroringRule {
8266 super::builder::network_firewall_policies::AddPacketMirroringRule::new(self.inner.clone())
8267 }
8268
8269 /// Inserts a rule into a firewall policy.
8270 pub fn add_rule(&self) -> super::builder::network_firewall_policies::AddRule {
8271 super::builder::network_firewall_policies::AddRule::new(self.inner.clone())
8272 }
8273
8274 /// Retrieves an aggregated list of network firewall policies, listing network
8275 /// firewall policies from all applicable scopes (global and regional) and
8276 /// grouping the results per scope.
8277 ///
8278 /// To prevent failure, it is recommended that you set the
8279 /// `returnPartialSuccess` parameter to `true`.
8280 pub fn aggregated_list(&self) -> super::builder::network_firewall_policies::AggregatedList {
8281 super::builder::network_firewall_policies::AggregatedList::new(self.inner.clone())
8282 }
8283
8284 /// Copies rules to the specified firewall policy.
8285 pub fn clone_rules(&self) -> super::builder::network_firewall_policies::CloneRules {
8286 super::builder::network_firewall_policies::CloneRules::new(self.inner.clone())
8287 }
8288
8289 /// Deletes the specified policy.
8290 pub fn delete(&self) -> super::builder::network_firewall_policies::Delete {
8291 super::builder::network_firewall_policies::Delete::new(self.inner.clone())
8292 }
8293
8294 /// Returns the specified network firewall policy.
8295 pub fn get(&self) -> super::builder::network_firewall_policies::Get {
8296 super::builder::network_firewall_policies::Get::new(self.inner.clone())
8297 }
8298
8299 /// Gets an association with the specified name.
8300 pub fn get_association(&self) -> super::builder::network_firewall_policies::GetAssociation {
8301 super::builder::network_firewall_policies::GetAssociation::new(self.inner.clone())
8302 }
8303
8304 /// Gets the access control policy for a resource. May be empty if no such
8305 /// policy or resource exists.
8306 pub fn get_iam_policy(&self) -> super::builder::network_firewall_policies::GetIamPolicy {
8307 super::builder::network_firewall_policies::GetIamPolicy::new(self.inner.clone())
8308 }
8309
8310 /// Gets a packet mirroring rule of the specified priority.
8311 pub fn get_packet_mirroring_rule(
8312 &self,
8313 ) -> super::builder::network_firewall_policies::GetPacketMirroringRule {
8314 super::builder::network_firewall_policies::GetPacketMirroringRule::new(self.inner.clone())
8315 }
8316
8317 /// Gets a rule of the specified priority.
8318 pub fn get_rule(&self) -> super::builder::network_firewall_policies::GetRule {
8319 super::builder::network_firewall_policies::GetRule::new(self.inner.clone())
8320 }
8321
8322 /// Creates a new policy in the specified project using the data included in
8323 /// the request.
8324 pub fn insert(&self) -> super::builder::network_firewall_policies::Insert {
8325 super::builder::network_firewall_policies::Insert::new(self.inner.clone())
8326 }
8327
8328 /// Lists all the policies that have been configured for the specified project.
8329 pub fn list(&self) -> super::builder::network_firewall_policies::List {
8330 super::builder::network_firewall_policies::List::new(self.inner.clone())
8331 }
8332
8333 /// Patches the specified policy with the data included in the request.
8334 pub fn patch(&self) -> super::builder::network_firewall_policies::Patch {
8335 super::builder::network_firewall_policies::Patch::new(self.inner.clone())
8336 }
8337
8338 /// Patches a packet mirroring rule of the specified priority.
8339 pub fn patch_packet_mirroring_rule(
8340 &self,
8341 ) -> super::builder::network_firewall_policies::PatchPacketMirroringRule {
8342 super::builder::network_firewall_policies::PatchPacketMirroringRule::new(self.inner.clone())
8343 }
8344
8345 /// Patches a rule of the specified priority.
8346 pub fn patch_rule(&self) -> super::builder::network_firewall_policies::PatchRule {
8347 super::builder::network_firewall_policies::PatchRule::new(self.inner.clone())
8348 }
8349
8350 /// Removes an association for the specified firewall policy.
8351 pub fn remove_association(
8352 &self,
8353 ) -> super::builder::network_firewall_policies::RemoveAssociation {
8354 super::builder::network_firewall_policies::RemoveAssociation::new(self.inner.clone())
8355 }
8356
8357 /// Deletes a packet mirroring rule of the specified priority.
8358 pub fn remove_packet_mirroring_rule(
8359 &self,
8360 ) -> super::builder::network_firewall_policies::RemovePacketMirroringRule {
8361 super::builder::network_firewall_policies::RemovePacketMirroringRule::new(
8362 self.inner.clone(),
8363 )
8364 }
8365
8366 /// Deletes a rule of the specified priority.
8367 pub fn remove_rule(&self) -> super::builder::network_firewall_policies::RemoveRule {
8368 super::builder::network_firewall_policies::RemoveRule::new(self.inner.clone())
8369 }
8370
8371 /// Sets the access control policy on the specified resource.
8372 /// Replaces any existing policy.
8373 pub fn set_iam_policy(&self) -> super::builder::network_firewall_policies::SetIamPolicy {
8374 super::builder::network_firewall_policies::SetIamPolicy::new(self.inner.clone())
8375 }
8376
8377 /// Returns permissions that a caller has on the specified resource.
8378 pub fn test_iam_permissions(
8379 &self,
8380 ) -> super::builder::network_firewall_policies::TestIamPermissions {
8381 super::builder::network_firewall_policies::TestIamPermissions::new(self.inner.clone())
8382 }
8383
8384 /// Retrieves the specified Operations resource.
8385 pub fn get_operation(&self) -> super::builder::network_firewall_policies::GetOperation {
8386 super::builder::network_firewall_policies::GetOperation::new(self.inner.clone())
8387 }
8388}
8389
8390/// Implements a client for the Compute Engine API.
8391///
8392/// # Example
8393/// ```
8394/// # use google_cloud_compute_v1::client::NetworkProfiles;
8395/// async fn sample(
8396/// ) -> anyhow::Result<()> {
8397/// let client = NetworkProfiles::builder().build().await?;
8398/// // use `client` to make requests to the Compute Engine API.
8399/// Ok(())
8400/// }
8401/// ```
8402///
8403/// # Service Description
8404///
8405/// Service for the `networkProfiles` resource.
8406///
8407/// # Configuration
8408///
8409/// To configure `NetworkProfiles` use the `with_*` methods in the type returned
8410/// by [builder()][NetworkProfiles::builder]. The default configuration should
8411/// work for most applications. Common configuration changes include
8412///
8413/// * [with_endpoint()]: by default this client uses the global default endpoint
8414/// (`https://compute.googleapis.com`). Applications using regional
8415/// endpoints or running in restricted networks (e.g. a network configured
8416/// with [Private Google Access with VPC Service Controls]) may want to
8417/// override this default.
8418/// * [with_credentials()]: by default this client uses
8419/// [Application Default Credentials]. Applications using custom
8420/// authentication may need to override this default.
8421///
8422/// [with_endpoint()]: super::builder::network_profiles::ClientBuilder::with_endpoint
8423/// [with_credentials()]: super::builder::network_profiles::ClientBuilder::with_credentials
8424/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8425/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8426///
8427/// # Pooling and Cloning
8428///
8429/// `NetworkProfiles` holds a connection pool internally, it is advised to
8430/// create one and reuse it. You do not need to wrap `NetworkProfiles` in
8431/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8432/// already uses an `Arc` internally.
8433#[cfg(feature = "network-profiles")]
8434#[cfg_attr(docsrs, doc(cfg(feature = "network-profiles")))]
8435#[derive(Clone, Debug)]
8436pub struct NetworkProfiles {
8437 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkProfiles>,
8438}
8439
8440#[cfg(feature = "network-profiles")]
8441impl NetworkProfiles {
8442 /// Returns a builder for [NetworkProfiles].
8443 ///
8444 /// ```
8445 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8446 /// # use google_cloud_compute_v1::client::NetworkProfiles;
8447 /// let client = NetworkProfiles::builder().build().await?;
8448 /// # Ok(()) }
8449 /// ```
8450 pub fn builder() -> super::builder::network_profiles::ClientBuilder {
8451 crate::new_client_builder(super::builder::network_profiles::client::Factory)
8452 }
8453
8454 /// Creates a new client from the provided stub.
8455 ///
8456 /// The most common case for calling this function is in tests mocking the
8457 /// client's behavior.
8458 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
8459 where
8460 T: super::stub::NetworkProfiles + 'static,
8461 {
8462 Self { inner: stub.into() }
8463 }
8464
8465 pub(crate) async fn new(
8466 config: gaxi::options::ClientConfig,
8467 ) -> crate::ClientBuilderResult<Self> {
8468 let inner = Self::build_inner(config).await?;
8469 Ok(Self { inner })
8470 }
8471
8472 async fn build_inner(
8473 conf: gaxi::options::ClientConfig,
8474 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NetworkProfiles>> {
8475 if gaxi::options::tracing_enabled(&conf) {
8476 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8477 }
8478 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8479 }
8480
8481 async fn build_transport(
8482 conf: gaxi::options::ClientConfig,
8483 ) -> crate::ClientBuilderResult<impl super::stub::NetworkProfiles> {
8484 super::transport::NetworkProfiles::new(conf).await
8485 }
8486
8487 async fn build_with_tracing(
8488 conf: gaxi::options::ClientConfig,
8489 ) -> crate::ClientBuilderResult<impl super::stub::NetworkProfiles> {
8490 Self::build_transport(conf)
8491 .await
8492 .map(super::tracing::NetworkProfiles::new)
8493 }
8494
8495 /// Returns the specified network profile.
8496 pub fn get(&self) -> super::builder::network_profiles::Get {
8497 super::builder::network_profiles::Get::new(self.inner.clone())
8498 }
8499
8500 /// Retrieves a list of network profiles available to the specified
8501 /// project.
8502 pub fn list(&self) -> super::builder::network_profiles::List {
8503 super::builder::network_profiles::List::new(self.inner.clone())
8504 }
8505}
8506
8507/// Implements a client for the Compute Engine API.
8508///
8509/// # Example
8510/// ```
8511/// # use google_cloud_compute_v1::client::Networks;
8512/// async fn sample(
8513/// ) -> anyhow::Result<()> {
8514/// let client = Networks::builder().build().await?;
8515/// // use `client` to make requests to the Compute Engine API.
8516/// Ok(())
8517/// }
8518/// ```
8519///
8520/// # Service Description
8521///
8522/// Service for the `networks` resource.
8523///
8524/// # Configuration
8525///
8526/// To configure `Networks` use the `with_*` methods in the type returned
8527/// by [builder()][Networks::builder]. The default configuration should
8528/// work for most applications. Common configuration changes include
8529///
8530/// * [with_endpoint()]: by default this client uses the global default endpoint
8531/// (`https://compute.googleapis.com`). Applications using regional
8532/// endpoints or running in restricted networks (e.g. a network configured
8533/// with [Private Google Access with VPC Service Controls]) may want to
8534/// override this default.
8535/// * [with_credentials()]: by default this client uses
8536/// [Application Default Credentials]. Applications using custom
8537/// authentication may need to override this default.
8538///
8539/// [with_endpoint()]: super::builder::networks::ClientBuilder::with_endpoint
8540/// [with_credentials()]: super::builder::networks::ClientBuilder::with_credentials
8541/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8542/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8543///
8544/// # Pooling and Cloning
8545///
8546/// `Networks` holds a connection pool internally, it is advised to
8547/// create one and reuse it. You do not need to wrap `Networks` in
8548/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8549/// already uses an `Arc` internally.
8550#[cfg(feature = "networks")]
8551#[cfg_attr(docsrs, doc(cfg(feature = "networks")))]
8552#[derive(Clone, Debug)]
8553pub struct Networks {
8554 inner: std::sync::Arc<dyn super::stub::dynamic::Networks>,
8555}
8556
8557#[cfg(feature = "networks")]
8558impl Networks {
8559 /// Returns a builder for [Networks].
8560 ///
8561 /// ```
8562 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8563 /// # use google_cloud_compute_v1::client::Networks;
8564 /// let client = Networks::builder().build().await?;
8565 /// # Ok(()) }
8566 /// ```
8567 pub fn builder() -> super::builder::networks::ClientBuilder {
8568 crate::new_client_builder(super::builder::networks::client::Factory)
8569 }
8570
8571 /// Creates a new client from the provided stub.
8572 ///
8573 /// The most common case for calling this function is in tests mocking the
8574 /// client's behavior.
8575 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
8576 where
8577 T: super::stub::Networks + 'static,
8578 {
8579 Self { inner: stub.into() }
8580 }
8581
8582 pub(crate) async fn new(
8583 config: gaxi::options::ClientConfig,
8584 ) -> crate::ClientBuilderResult<Self> {
8585 let inner = Self::build_inner(config).await?;
8586 Ok(Self { inner })
8587 }
8588
8589 async fn build_inner(
8590 conf: gaxi::options::ClientConfig,
8591 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Networks>> {
8592 if gaxi::options::tracing_enabled(&conf) {
8593 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8594 }
8595 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8596 }
8597
8598 async fn build_transport(
8599 conf: gaxi::options::ClientConfig,
8600 ) -> crate::ClientBuilderResult<impl super::stub::Networks> {
8601 super::transport::Networks::new(conf).await
8602 }
8603
8604 async fn build_with_tracing(
8605 conf: gaxi::options::ClientConfig,
8606 ) -> crate::ClientBuilderResult<impl super::stub::Networks> {
8607 Self::build_transport(conf)
8608 .await
8609 .map(super::tracing::Networks::new)
8610 }
8611
8612 /// Adds a peering to the specified network.
8613 pub fn add_peering(&self) -> super::builder::networks::AddPeering {
8614 super::builder::networks::AddPeering::new(self.inner.clone())
8615 }
8616
8617 /// Cancel requests to remove a peering from the specified network. Applicable
8618 /// only for PeeringConnection with update_strategy=CONSENSUS. Cancels a
8619 /// request to remove a peering from the specified network.
8620 pub fn cancel_request_remove_peering(
8621 &self,
8622 ) -> super::builder::networks::CancelRequestRemovePeering {
8623 super::builder::networks::CancelRequestRemovePeering::new(self.inner.clone())
8624 }
8625
8626 /// Deletes the specified network.
8627 pub fn delete(&self) -> super::builder::networks::Delete {
8628 super::builder::networks::Delete::new(self.inner.clone())
8629 }
8630
8631 /// Returns the specified network.
8632 pub fn get(&self) -> super::builder::networks::Get {
8633 super::builder::networks::Get::new(self.inner.clone())
8634 }
8635
8636 /// Returns the effective firewalls on a given network.
8637 pub fn get_effective_firewalls(&self) -> super::builder::networks::GetEffectiveFirewalls {
8638 super::builder::networks::GetEffectiveFirewalls::new(self.inner.clone())
8639 }
8640
8641 /// Creates a network in the specified project using the data included
8642 /// in the request.
8643 pub fn insert(&self) -> super::builder::networks::Insert {
8644 super::builder::networks::Insert::new(self.inner.clone())
8645 }
8646
8647 /// Retrieves the list of networks available to the specified project.
8648 pub fn list(&self) -> super::builder::networks::List {
8649 super::builder::networks::List::new(self.inner.clone())
8650 }
8651
8652 /// Lists the peering routes exchanged over peering connection.
8653 pub fn list_peering_routes(&self) -> super::builder::networks::ListPeeringRoutes {
8654 super::builder::networks::ListPeeringRoutes::new(self.inner.clone())
8655 }
8656
8657 /// Patches the specified network with the data included in the request.
8658 /// Only routingConfig can be modified.
8659 pub fn patch(&self) -> super::builder::networks::Patch {
8660 super::builder::networks::Patch::new(self.inner.clone())
8661 }
8662
8663 /// Removes a peering from the specified network.
8664 pub fn remove_peering(&self) -> super::builder::networks::RemovePeering {
8665 super::builder::networks::RemovePeering::new(self.inner.clone())
8666 }
8667
8668 /// Requests to remove a peering from the specified network. Applicable only
8669 /// for PeeringConnection with update_strategy=CONSENSUS.
8670 pub fn request_remove_peering(&self) -> super::builder::networks::RequestRemovePeering {
8671 super::builder::networks::RequestRemovePeering::new(self.inner.clone())
8672 }
8673
8674 /// Switches the network mode from auto subnet mode to custom subnet mode.
8675 pub fn switch_to_custom_mode(&self) -> super::builder::networks::SwitchToCustomMode {
8676 super::builder::networks::SwitchToCustomMode::new(self.inner.clone())
8677 }
8678
8679 /// Updates the specified network peering with the data included in the
8680 /// request. You can only modify the NetworkPeering.export_custom_routes field
8681 /// and the NetworkPeering.import_custom_routes field.
8682 pub fn update_peering(&self) -> super::builder::networks::UpdatePeering {
8683 super::builder::networks::UpdatePeering::new(self.inner.clone())
8684 }
8685
8686 /// Retrieves the specified Operations resource.
8687 pub fn get_operation(&self) -> super::builder::networks::GetOperation {
8688 super::builder::networks::GetOperation::new(self.inner.clone())
8689 }
8690}
8691
8692/// Implements a client for the Compute Engine API.
8693///
8694/// # Example
8695/// ```
8696/// # use google_cloud_compute_v1::client::NodeGroups;
8697/// async fn sample(
8698/// ) -> anyhow::Result<()> {
8699/// let client = NodeGroups::builder().build().await?;
8700/// // use `client` to make requests to the Compute Engine API.
8701/// Ok(())
8702/// }
8703/// ```
8704///
8705/// # Service Description
8706///
8707/// Service for the `nodeGroups` resource.
8708///
8709/// # Configuration
8710///
8711/// To configure `NodeGroups` use the `with_*` methods in the type returned
8712/// by [builder()][NodeGroups::builder]. The default configuration should
8713/// work for most applications. Common configuration changes include
8714///
8715/// * [with_endpoint()]: by default this client uses the global default endpoint
8716/// (`https://compute.googleapis.com`). Applications using regional
8717/// endpoints or running in restricted networks (e.g. a network configured
8718/// with [Private Google Access with VPC Service Controls]) may want to
8719/// override this default.
8720/// * [with_credentials()]: by default this client uses
8721/// [Application Default Credentials]. Applications using custom
8722/// authentication may need to override this default.
8723///
8724/// [with_endpoint()]: super::builder::node_groups::ClientBuilder::with_endpoint
8725/// [with_credentials()]: super::builder::node_groups::ClientBuilder::with_credentials
8726/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8727/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8728///
8729/// # Pooling and Cloning
8730///
8731/// `NodeGroups` holds a connection pool internally, it is advised to
8732/// create one and reuse it. You do not need to wrap `NodeGroups` in
8733/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8734/// already uses an `Arc` internally.
8735#[cfg(feature = "node-groups")]
8736#[cfg_attr(docsrs, doc(cfg(feature = "node-groups")))]
8737#[derive(Clone, Debug)]
8738pub struct NodeGroups {
8739 inner: std::sync::Arc<dyn super::stub::dynamic::NodeGroups>,
8740}
8741
8742#[cfg(feature = "node-groups")]
8743impl NodeGroups {
8744 /// Returns a builder for [NodeGroups].
8745 ///
8746 /// ```
8747 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8748 /// # use google_cloud_compute_v1::client::NodeGroups;
8749 /// let client = NodeGroups::builder().build().await?;
8750 /// # Ok(()) }
8751 /// ```
8752 pub fn builder() -> super::builder::node_groups::ClientBuilder {
8753 crate::new_client_builder(super::builder::node_groups::client::Factory)
8754 }
8755
8756 /// Creates a new client from the provided stub.
8757 ///
8758 /// The most common case for calling this function is in tests mocking the
8759 /// client's behavior.
8760 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
8761 where
8762 T: super::stub::NodeGroups + 'static,
8763 {
8764 Self { inner: stub.into() }
8765 }
8766
8767 pub(crate) async fn new(
8768 config: gaxi::options::ClientConfig,
8769 ) -> crate::ClientBuilderResult<Self> {
8770 let inner = Self::build_inner(config).await?;
8771 Ok(Self { inner })
8772 }
8773
8774 async fn build_inner(
8775 conf: gaxi::options::ClientConfig,
8776 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NodeGroups>> {
8777 if gaxi::options::tracing_enabled(&conf) {
8778 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8779 }
8780 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8781 }
8782
8783 async fn build_transport(
8784 conf: gaxi::options::ClientConfig,
8785 ) -> crate::ClientBuilderResult<impl super::stub::NodeGroups> {
8786 super::transport::NodeGroups::new(conf).await
8787 }
8788
8789 async fn build_with_tracing(
8790 conf: gaxi::options::ClientConfig,
8791 ) -> crate::ClientBuilderResult<impl super::stub::NodeGroups> {
8792 Self::build_transport(conf)
8793 .await
8794 .map(super::tracing::NodeGroups::new)
8795 }
8796
8797 /// Adds specified number of nodes to the node group.
8798 pub fn add_nodes(&self) -> super::builder::node_groups::AddNodes {
8799 super::builder::node_groups::AddNodes::new(self.inner.clone())
8800 }
8801
8802 /// Retrieves an aggregated list of node groups.
8803 /// Note: use nodeGroups.listNodes for more details about each group.
8804 ///
8805 /// To prevent failure, Google recommends that you set the
8806 /// `returnPartialSuccess` parameter to `true`.
8807 pub fn aggregated_list(&self) -> super::builder::node_groups::AggregatedList {
8808 super::builder::node_groups::AggregatedList::new(self.inner.clone())
8809 }
8810
8811 /// Deletes the specified NodeGroup resource.
8812 pub fn delete(&self) -> super::builder::node_groups::Delete {
8813 super::builder::node_groups::Delete::new(self.inner.clone())
8814 }
8815
8816 /// Deletes specified nodes from the node group.
8817 pub fn delete_nodes(&self) -> super::builder::node_groups::DeleteNodes {
8818 super::builder::node_groups::DeleteNodes::new(self.inner.clone())
8819 }
8820
8821 /// Returns the specified NodeGroup. Get a list of available NodeGroups
8822 /// by making a list() request.
8823 /// Note: the "nodes" field should not be used. Use nodeGroups.listNodes
8824 /// instead.
8825 pub fn get(&self) -> super::builder::node_groups::Get {
8826 super::builder::node_groups::Get::new(self.inner.clone())
8827 }
8828
8829 /// Gets the access control policy for a resource. May be empty if no such
8830 /// policy or resource exists.
8831 pub fn get_iam_policy(&self) -> super::builder::node_groups::GetIamPolicy {
8832 super::builder::node_groups::GetIamPolicy::new(self.inner.clone())
8833 }
8834
8835 /// Creates a NodeGroup resource in the specified project using the data
8836 /// included in the request.
8837 pub fn insert(&self) -> super::builder::node_groups::Insert {
8838 super::builder::node_groups::Insert::new(self.inner.clone())
8839 }
8840
8841 /// Retrieves a list of node groups available to the specified project.
8842 /// Note: use nodeGroups.listNodes for more details about each group.
8843 pub fn list(&self) -> super::builder::node_groups::List {
8844 super::builder::node_groups::List::new(self.inner.clone())
8845 }
8846
8847 /// Lists nodes in the node group.
8848 pub fn list_nodes(&self) -> super::builder::node_groups::ListNodes {
8849 super::builder::node_groups::ListNodes::new(self.inner.clone())
8850 }
8851
8852 /// Updates the specified node group.
8853 pub fn patch(&self) -> super::builder::node_groups::Patch {
8854 super::builder::node_groups::Patch::new(self.inner.clone())
8855 }
8856
8857 /// Perform maintenance on a subset of nodes in the node group.
8858 pub fn perform_maintenance(&self) -> super::builder::node_groups::PerformMaintenance {
8859 super::builder::node_groups::PerformMaintenance::new(self.inner.clone())
8860 }
8861
8862 /// Sets the access control policy on the specified resource.
8863 /// Replaces any existing policy.
8864 pub fn set_iam_policy(&self) -> super::builder::node_groups::SetIamPolicy {
8865 super::builder::node_groups::SetIamPolicy::new(self.inner.clone())
8866 }
8867
8868 /// Updates the node template of the node group.
8869 pub fn set_node_template(&self) -> super::builder::node_groups::SetNodeTemplate {
8870 super::builder::node_groups::SetNodeTemplate::new(self.inner.clone())
8871 }
8872
8873 /// Simulates maintenance event on specified nodes from the node group.
8874 pub fn simulate_maintenance_event(
8875 &self,
8876 ) -> super::builder::node_groups::SimulateMaintenanceEvent {
8877 super::builder::node_groups::SimulateMaintenanceEvent::new(self.inner.clone())
8878 }
8879
8880 /// Returns permissions that a caller has on the specified resource.
8881 pub fn test_iam_permissions(&self) -> super::builder::node_groups::TestIamPermissions {
8882 super::builder::node_groups::TestIamPermissions::new(self.inner.clone())
8883 }
8884
8885 /// Retrieves the specified zone-specific Operations resource.
8886 pub fn get_operation(&self) -> super::builder::node_groups::GetOperation {
8887 super::builder::node_groups::GetOperation::new(self.inner.clone())
8888 }
8889}
8890
8891/// Implements a client for the Compute Engine API.
8892///
8893/// # Example
8894/// ```
8895/// # use google_cloud_compute_v1::client::NodeTemplates;
8896/// async fn sample(
8897/// ) -> anyhow::Result<()> {
8898/// let client = NodeTemplates::builder().build().await?;
8899/// // use `client` to make requests to the Compute Engine API.
8900/// Ok(())
8901/// }
8902/// ```
8903///
8904/// # Service Description
8905///
8906/// Service for the `nodeTemplates` resource.
8907///
8908/// # Configuration
8909///
8910/// To configure `NodeTemplates` use the `with_*` methods in the type returned
8911/// by [builder()][NodeTemplates::builder]. The default configuration should
8912/// work for most applications. Common configuration changes include
8913///
8914/// * [with_endpoint()]: by default this client uses the global default endpoint
8915/// (`https://compute.googleapis.com`). Applications using regional
8916/// endpoints or running in restricted networks (e.g. a network configured
8917/// with [Private Google Access with VPC Service Controls]) may want to
8918/// override this default.
8919/// * [with_credentials()]: by default this client uses
8920/// [Application Default Credentials]. Applications using custom
8921/// authentication may need to override this default.
8922///
8923/// [with_endpoint()]: super::builder::node_templates::ClientBuilder::with_endpoint
8924/// [with_credentials()]: super::builder::node_templates::ClientBuilder::with_credentials
8925/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8926/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8927///
8928/// # Pooling and Cloning
8929///
8930/// `NodeTemplates` holds a connection pool internally, it is advised to
8931/// create one and reuse it. You do not need to wrap `NodeTemplates` in
8932/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8933/// already uses an `Arc` internally.
8934#[cfg(feature = "node-templates")]
8935#[cfg_attr(docsrs, doc(cfg(feature = "node-templates")))]
8936#[derive(Clone, Debug)]
8937pub struct NodeTemplates {
8938 inner: std::sync::Arc<dyn super::stub::dynamic::NodeTemplates>,
8939}
8940
8941#[cfg(feature = "node-templates")]
8942impl NodeTemplates {
8943 /// Returns a builder for [NodeTemplates].
8944 ///
8945 /// ```
8946 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8947 /// # use google_cloud_compute_v1::client::NodeTemplates;
8948 /// let client = NodeTemplates::builder().build().await?;
8949 /// # Ok(()) }
8950 /// ```
8951 pub fn builder() -> super::builder::node_templates::ClientBuilder {
8952 crate::new_client_builder(super::builder::node_templates::client::Factory)
8953 }
8954
8955 /// Creates a new client from the provided stub.
8956 ///
8957 /// The most common case for calling this function is in tests mocking the
8958 /// client's behavior.
8959 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
8960 where
8961 T: super::stub::NodeTemplates + 'static,
8962 {
8963 Self { inner: stub.into() }
8964 }
8965
8966 pub(crate) async fn new(
8967 config: gaxi::options::ClientConfig,
8968 ) -> crate::ClientBuilderResult<Self> {
8969 let inner = Self::build_inner(config).await?;
8970 Ok(Self { inner })
8971 }
8972
8973 async fn build_inner(
8974 conf: gaxi::options::ClientConfig,
8975 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NodeTemplates>> {
8976 if gaxi::options::tracing_enabled(&conf) {
8977 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8978 }
8979 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8980 }
8981
8982 async fn build_transport(
8983 conf: gaxi::options::ClientConfig,
8984 ) -> crate::ClientBuilderResult<impl super::stub::NodeTemplates> {
8985 super::transport::NodeTemplates::new(conf).await
8986 }
8987
8988 async fn build_with_tracing(
8989 conf: gaxi::options::ClientConfig,
8990 ) -> crate::ClientBuilderResult<impl super::stub::NodeTemplates> {
8991 Self::build_transport(conf)
8992 .await
8993 .map(super::tracing::NodeTemplates::new)
8994 }
8995
8996 /// Retrieves an aggregated list of node templates.
8997 ///
8998 /// To prevent failure, Google recommends that you set the
8999 /// `returnPartialSuccess` parameter to `true`.
9000 pub fn aggregated_list(&self) -> super::builder::node_templates::AggregatedList {
9001 super::builder::node_templates::AggregatedList::new(self.inner.clone())
9002 }
9003
9004 /// Deletes the specified NodeTemplate resource.
9005 pub fn delete(&self) -> super::builder::node_templates::Delete {
9006 super::builder::node_templates::Delete::new(self.inner.clone())
9007 }
9008
9009 /// Returns the specified node template.
9010 pub fn get(&self) -> super::builder::node_templates::Get {
9011 super::builder::node_templates::Get::new(self.inner.clone())
9012 }
9013
9014 /// Gets the access control policy for a resource. May be empty if no such
9015 /// policy or resource exists.
9016 pub fn get_iam_policy(&self) -> super::builder::node_templates::GetIamPolicy {
9017 super::builder::node_templates::GetIamPolicy::new(self.inner.clone())
9018 }
9019
9020 /// Creates a NodeTemplate resource in the specified project using the data
9021 /// included in the request.
9022 pub fn insert(&self) -> super::builder::node_templates::Insert {
9023 super::builder::node_templates::Insert::new(self.inner.clone())
9024 }
9025
9026 /// Retrieves a list of node templates available to the specified
9027 /// project.
9028 pub fn list(&self) -> super::builder::node_templates::List {
9029 super::builder::node_templates::List::new(self.inner.clone())
9030 }
9031
9032 /// Sets the access control policy on the specified resource.
9033 /// Replaces any existing policy.
9034 pub fn set_iam_policy(&self) -> super::builder::node_templates::SetIamPolicy {
9035 super::builder::node_templates::SetIamPolicy::new(self.inner.clone())
9036 }
9037
9038 /// Returns permissions that a caller has on the specified resource.
9039 pub fn test_iam_permissions(&self) -> super::builder::node_templates::TestIamPermissions {
9040 super::builder::node_templates::TestIamPermissions::new(self.inner.clone())
9041 }
9042
9043 /// Retrieves the specified region-specific Operations resource.
9044 pub fn get_operation(&self) -> super::builder::node_templates::GetOperation {
9045 super::builder::node_templates::GetOperation::new(self.inner.clone())
9046 }
9047}
9048
9049/// Implements a client for the Compute Engine API.
9050///
9051/// # Example
9052/// ```
9053/// # use google_cloud_compute_v1::client::NodeTypes;
9054/// async fn sample(
9055/// ) -> anyhow::Result<()> {
9056/// let client = NodeTypes::builder().build().await?;
9057/// // use `client` to make requests to the Compute Engine API.
9058/// Ok(())
9059/// }
9060/// ```
9061///
9062/// # Service Description
9063///
9064/// Service for the `nodeTypes` resource.
9065///
9066/// # Configuration
9067///
9068/// To configure `NodeTypes` use the `with_*` methods in the type returned
9069/// by [builder()][NodeTypes::builder]. The default configuration should
9070/// work for most applications. Common configuration changes include
9071///
9072/// * [with_endpoint()]: by default this client uses the global default endpoint
9073/// (`https://compute.googleapis.com`). Applications using regional
9074/// endpoints or running in restricted networks (e.g. a network configured
9075/// with [Private Google Access with VPC Service Controls]) may want to
9076/// override this default.
9077/// * [with_credentials()]: by default this client uses
9078/// [Application Default Credentials]. Applications using custom
9079/// authentication may need to override this default.
9080///
9081/// [with_endpoint()]: super::builder::node_types::ClientBuilder::with_endpoint
9082/// [with_credentials()]: super::builder::node_types::ClientBuilder::with_credentials
9083/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9084/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9085///
9086/// # Pooling and Cloning
9087///
9088/// `NodeTypes` holds a connection pool internally, it is advised to
9089/// create one and reuse it. You do not need to wrap `NodeTypes` in
9090/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9091/// already uses an `Arc` internally.
9092#[cfg(feature = "node-types")]
9093#[cfg_attr(docsrs, doc(cfg(feature = "node-types")))]
9094#[derive(Clone, Debug)]
9095pub struct NodeTypes {
9096 inner: std::sync::Arc<dyn super::stub::dynamic::NodeTypes>,
9097}
9098
9099#[cfg(feature = "node-types")]
9100impl NodeTypes {
9101 /// Returns a builder for [NodeTypes].
9102 ///
9103 /// ```
9104 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9105 /// # use google_cloud_compute_v1::client::NodeTypes;
9106 /// let client = NodeTypes::builder().build().await?;
9107 /// # Ok(()) }
9108 /// ```
9109 pub fn builder() -> super::builder::node_types::ClientBuilder {
9110 crate::new_client_builder(super::builder::node_types::client::Factory)
9111 }
9112
9113 /// Creates a new client from the provided stub.
9114 ///
9115 /// The most common case for calling this function is in tests mocking the
9116 /// client's behavior.
9117 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
9118 where
9119 T: super::stub::NodeTypes + 'static,
9120 {
9121 Self { inner: stub.into() }
9122 }
9123
9124 pub(crate) async fn new(
9125 config: gaxi::options::ClientConfig,
9126 ) -> crate::ClientBuilderResult<Self> {
9127 let inner = Self::build_inner(config).await?;
9128 Ok(Self { inner })
9129 }
9130
9131 async fn build_inner(
9132 conf: gaxi::options::ClientConfig,
9133 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NodeTypes>> {
9134 if gaxi::options::tracing_enabled(&conf) {
9135 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9136 }
9137 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9138 }
9139
9140 async fn build_transport(
9141 conf: gaxi::options::ClientConfig,
9142 ) -> crate::ClientBuilderResult<impl super::stub::NodeTypes> {
9143 super::transport::NodeTypes::new(conf).await
9144 }
9145
9146 async fn build_with_tracing(
9147 conf: gaxi::options::ClientConfig,
9148 ) -> crate::ClientBuilderResult<impl super::stub::NodeTypes> {
9149 Self::build_transport(conf)
9150 .await
9151 .map(super::tracing::NodeTypes::new)
9152 }
9153
9154 /// Retrieves an aggregated list of node types.
9155 ///
9156 /// To prevent failure, Google recommends that you set the
9157 /// `returnPartialSuccess` parameter to `true`.
9158 pub fn aggregated_list(&self) -> super::builder::node_types::AggregatedList {
9159 super::builder::node_types::AggregatedList::new(self.inner.clone())
9160 }
9161
9162 /// Returns the specified node type.
9163 pub fn get(&self) -> super::builder::node_types::Get {
9164 super::builder::node_types::Get::new(self.inner.clone())
9165 }
9166
9167 /// Retrieves a list of node types available to the specified
9168 /// project.
9169 pub fn list(&self) -> super::builder::node_types::List {
9170 super::builder::node_types::List::new(self.inner.clone())
9171 }
9172}
9173
9174/// Implements a client for the Compute Engine API.
9175///
9176/// # Example
9177/// ```
9178/// # use google_cloud_compute_v1::client::OrganizationSecurityPolicies;
9179/// async fn sample(
9180/// ) -> anyhow::Result<()> {
9181/// let client = OrganizationSecurityPolicies::builder().build().await?;
9182/// // use `client` to make requests to the Compute Engine API.
9183/// Ok(())
9184/// }
9185/// ```
9186///
9187/// # Service Description
9188///
9189/// Service for the `organizationSecurityPolicies` resource.
9190///
9191/// # Configuration
9192///
9193/// To configure `OrganizationSecurityPolicies` use the `with_*` methods in the type returned
9194/// by [builder()][OrganizationSecurityPolicies::builder]. The default configuration should
9195/// work for most applications. Common configuration changes include
9196///
9197/// * [with_endpoint()]: by default this client uses the global default endpoint
9198/// (`https://compute.googleapis.com`). Applications using regional
9199/// endpoints or running in restricted networks (e.g. a network configured
9200/// with [Private Google Access with VPC Service Controls]) may want to
9201/// override this default.
9202/// * [with_credentials()]: by default this client uses
9203/// [Application Default Credentials]. Applications using custom
9204/// authentication may need to override this default.
9205///
9206/// [with_endpoint()]: super::builder::organization_security_policies::ClientBuilder::with_endpoint
9207/// [with_credentials()]: super::builder::organization_security_policies::ClientBuilder::with_credentials
9208/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9209/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9210///
9211/// # Pooling and Cloning
9212///
9213/// `OrganizationSecurityPolicies` holds a connection pool internally, it is advised to
9214/// create one and reuse it. You do not need to wrap `OrganizationSecurityPolicies` in
9215/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9216/// already uses an `Arc` internally.
9217#[cfg(feature = "organization-security-policies")]
9218#[cfg_attr(docsrs, doc(cfg(feature = "organization-security-policies")))]
9219#[derive(Clone, Debug)]
9220pub struct OrganizationSecurityPolicies {
9221 inner: std::sync::Arc<dyn super::stub::dynamic::OrganizationSecurityPolicies>,
9222}
9223
9224#[cfg(feature = "organization-security-policies")]
9225impl OrganizationSecurityPolicies {
9226 /// Returns a builder for [OrganizationSecurityPolicies].
9227 ///
9228 /// ```
9229 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9230 /// # use google_cloud_compute_v1::client::OrganizationSecurityPolicies;
9231 /// let client = OrganizationSecurityPolicies::builder().build().await?;
9232 /// # Ok(()) }
9233 /// ```
9234 pub fn builder() -> super::builder::organization_security_policies::ClientBuilder {
9235 crate::new_client_builder(super::builder::organization_security_policies::client::Factory)
9236 }
9237
9238 /// Creates a new client from the provided stub.
9239 ///
9240 /// The most common case for calling this function is in tests mocking the
9241 /// client's behavior.
9242 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
9243 where
9244 T: super::stub::OrganizationSecurityPolicies + 'static,
9245 {
9246 Self { inner: stub.into() }
9247 }
9248
9249 pub(crate) async fn new(
9250 config: gaxi::options::ClientConfig,
9251 ) -> crate::ClientBuilderResult<Self> {
9252 let inner = Self::build_inner(config).await?;
9253 Ok(Self { inner })
9254 }
9255
9256 async fn build_inner(
9257 conf: gaxi::options::ClientConfig,
9258 ) -> crate::ClientBuilderResult<
9259 std::sync::Arc<dyn super::stub::dynamic::OrganizationSecurityPolicies>,
9260 > {
9261 if gaxi::options::tracing_enabled(&conf) {
9262 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9263 }
9264 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9265 }
9266
9267 async fn build_transport(
9268 conf: gaxi::options::ClientConfig,
9269 ) -> crate::ClientBuilderResult<impl super::stub::OrganizationSecurityPolicies> {
9270 super::transport::OrganizationSecurityPolicies::new(conf).await
9271 }
9272
9273 async fn build_with_tracing(
9274 conf: gaxi::options::ClientConfig,
9275 ) -> crate::ClientBuilderResult<impl super::stub::OrganizationSecurityPolicies> {
9276 Self::build_transport(conf)
9277 .await
9278 .map(super::tracing::OrganizationSecurityPolicies::new)
9279 }
9280
9281 /// Inserts an association for the specified security policy.
9282 ///
9283 /// This has billing implications. Projects in the hierarchy with effective
9284 /// hierarchical security policies will be automatically enrolled into Cloud
9285 /// Armor Enterprise if not already enrolled.
9286 ///
9287 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
9288 /// versions of this API were used to modify firewall policies. This usage is
9289 /// now disabled for most organizations. Use firewallPolicies.addAssociation
9290 /// instead.
9291 pub fn add_association(
9292 &self,
9293 ) -> super::builder::organization_security_policies::AddAssociation {
9294 super::builder::organization_security_policies::AddAssociation::new(self.inner.clone())
9295 }
9296
9297 /// Inserts a rule into a security policy.
9298 ///
9299 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
9300 /// versions of this API were used to modify firewall policies. This usage is
9301 /// now disabled for most organizations. Use firewallPolicies.addRule instead.
9302 pub fn add_rule(&self) -> super::builder::organization_security_policies::AddRule {
9303 super::builder::organization_security_policies::AddRule::new(self.inner.clone())
9304 }
9305
9306 /// Copies rules to the specified security policy.
9307 ///
9308 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
9309 /// versions of this API were used to modify firewall policies. This usage is
9310 /// now disabled for most organizations. Use firewallPolicies.cloneRules
9311 /// instead.
9312 pub fn copy_rules(&self) -> super::builder::organization_security_policies::CopyRules {
9313 super::builder::organization_security_policies::CopyRules::new(self.inner.clone())
9314 }
9315
9316 /// Deletes the specified policy.
9317 ///
9318 /// Use this API to remove Cloud Armor policies. Previously, alpha and beta
9319 /// versions of this API were used to remove firewall policies. This usage is
9320 /// now disabled for most organizations. Use firewallPolicies.delete instead.
9321 pub fn delete(&self) -> super::builder::organization_security_policies::Delete {
9322 super::builder::organization_security_policies::Delete::new(self.inner.clone())
9323 }
9324
9325 /// List all of the ordered rules present in a single specified policy.
9326 ///
9327 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
9328 /// versions of this API were used to read firewall policies. This usage is now
9329 /// disabled for most organizations. Use firewallPolicies.get instead.
9330 pub fn get(&self) -> super::builder::organization_security_policies::Get {
9331 super::builder::organization_security_policies::Get::new(self.inner.clone())
9332 }
9333
9334 /// Gets an association with the specified name.
9335 ///
9336 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
9337 /// versions of this API were used to read firewall policies. This usage is
9338 /// now disabled for most organizations. Use firewallPolicies.getAssociation
9339 /// instead.
9340 pub fn get_association(
9341 &self,
9342 ) -> super::builder::organization_security_policies::GetAssociation {
9343 super::builder::organization_security_policies::GetAssociation::new(self.inner.clone())
9344 }
9345
9346 /// Gets a rule at the specified priority.
9347 ///
9348 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
9349 /// versions of this API were used to read firewall policies. This usage is now
9350 /// disabled for most organizations. Use firewallPolicies.getRule instead.
9351 pub fn get_rule(&self) -> super::builder::organization_security_policies::GetRule {
9352 super::builder::organization_security_policies::GetRule::new(self.inner.clone())
9353 }
9354
9355 /// Creates a new policy in the specified organization using the data included
9356 /// in the request.
9357 ///
9358 /// Use this API to add Cloud Armor policies. Previously, alpha and beta
9359 /// versions of this API were used to add firewall policies. This usage is now
9360 /// disabled for most organizations. Use firewallPolicies.insert instead.
9361 pub fn insert(&self) -> super::builder::organization_security_policies::Insert {
9362 super::builder::organization_security_policies::Insert::new(self.inner.clone())
9363 }
9364
9365 /// List all the policies that have been configured for the specified
9366 /// organization.
9367 ///
9368 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
9369 /// versions of this API were used to read firewall policies. This usage is now
9370 /// disabled for most organizations. Use firewallPolicies.list instead.
9371 pub fn list(&self) -> super::builder::organization_security_policies::List {
9372 super::builder::organization_security_policies::List::new(self.inner.clone())
9373 }
9374
9375 /// Lists associations of a specified target, i.e., organization or folder.
9376 ///
9377 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
9378 /// versions of this API were used to read firewall policies. This usage is
9379 /// now disabled for most organizations. Use firewallPolicies.listAssociations
9380 /// instead.
9381 pub fn list_associations(
9382 &self,
9383 ) -> super::builder::organization_security_policies::ListAssociations {
9384 super::builder::organization_security_policies::ListAssociations::new(self.inner.clone())
9385 }
9386
9387 /// Gets the current list of preconfigured Web Application Firewall (WAF)
9388 /// expressions.
9389 pub fn list_preconfigured_expression_sets(
9390 &self,
9391 ) -> super::builder::organization_security_policies::ListPreconfiguredExpressionSets {
9392 super::builder::organization_security_policies::ListPreconfiguredExpressionSets::new(
9393 self.inner.clone(),
9394 )
9395 }
9396
9397 /// Moves the specified security policy.
9398 ///
9399 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
9400 /// versions of this API were used to modify firewall policies. This usage is
9401 /// now disabled for most organizations. Use firewallPolicies.move instead.
9402 pub fn r#move(&self) -> super::builder::organization_security_policies::Move {
9403 super::builder::organization_security_policies::Move::new(self.inner.clone())
9404 }
9405
9406 /// Patches the specified policy with the data included in the request.
9407 ///
9408 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
9409 /// versions of this API were used to modify firewall policies. This usage is
9410 /// now disabled for most organizations. Use firewallPolicies.patch instead.
9411 pub fn patch(&self) -> super::builder::organization_security_policies::Patch {
9412 super::builder::organization_security_policies::Patch::new(self.inner.clone())
9413 }
9414
9415 /// Patches a rule at the specified priority.
9416 ///
9417 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
9418 /// versions of this API were used to modify firewall policies. This usage is
9419 /// now disabled for most organizations. Use firewallPolicies.patchRule
9420 /// instead.
9421 pub fn patch_rule(&self) -> super::builder::organization_security_policies::PatchRule {
9422 super::builder::organization_security_policies::PatchRule::new(self.inner.clone())
9423 }
9424
9425 /// Removes an association for the specified security policy.
9426 ///
9427 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
9428 /// versions of this API were used to modify firewall policies. This usage is
9429 /// now disabled for most organizations. Use firewallPolicies.removeAssociation
9430 /// instead.
9431 pub fn remove_association(
9432 &self,
9433 ) -> super::builder::organization_security_policies::RemoveAssociation {
9434 super::builder::organization_security_policies::RemoveAssociation::new(self.inner.clone())
9435 }
9436
9437 /// Deletes a rule at the specified priority.
9438 ///
9439 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
9440 /// versions of this API were used to modify firewall policies. This usage is
9441 /// now disabled for most organizations. Use firewallPolicies.removeRule
9442 /// instead.
9443 pub fn remove_rule(&self) -> super::builder::organization_security_policies::RemoveRule {
9444 super::builder::organization_security_policies::RemoveRule::new(self.inner.clone())
9445 }
9446
9447 /// Retrieves the specified Operations resource. Gets a list of operations
9448 /// by making a `list()` request.
9449 pub fn get_operation(&self) -> super::builder::organization_security_policies::GetOperation {
9450 super::builder::organization_security_policies::GetOperation::new(self.inner.clone())
9451 }
9452}
9453
9454/// Implements a client for the Compute Engine API.
9455///
9456/// # Example
9457/// ```
9458/// # use google_cloud_compute_v1::client::PacketMirrorings;
9459/// async fn sample(
9460/// ) -> anyhow::Result<()> {
9461/// let client = PacketMirrorings::builder().build().await?;
9462/// // use `client` to make requests to the Compute Engine API.
9463/// Ok(())
9464/// }
9465/// ```
9466///
9467/// # Service Description
9468///
9469/// Service for the `packetMirrorings` resource.
9470///
9471/// # Configuration
9472///
9473/// To configure `PacketMirrorings` use the `with_*` methods in the type returned
9474/// by [builder()][PacketMirrorings::builder]. The default configuration should
9475/// work for most applications. Common configuration changes include
9476///
9477/// * [with_endpoint()]: by default this client uses the global default endpoint
9478/// (`https://compute.googleapis.com`). Applications using regional
9479/// endpoints or running in restricted networks (e.g. a network configured
9480/// with [Private Google Access with VPC Service Controls]) may want to
9481/// override this default.
9482/// * [with_credentials()]: by default this client uses
9483/// [Application Default Credentials]. Applications using custom
9484/// authentication may need to override this default.
9485///
9486/// [with_endpoint()]: super::builder::packet_mirrorings::ClientBuilder::with_endpoint
9487/// [with_credentials()]: super::builder::packet_mirrorings::ClientBuilder::with_credentials
9488/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9489/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9490///
9491/// # Pooling and Cloning
9492///
9493/// `PacketMirrorings` holds a connection pool internally, it is advised to
9494/// create one and reuse it. You do not need to wrap `PacketMirrorings` in
9495/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9496/// already uses an `Arc` internally.
9497#[cfg(feature = "packet-mirrorings")]
9498#[cfg_attr(docsrs, doc(cfg(feature = "packet-mirrorings")))]
9499#[derive(Clone, Debug)]
9500pub struct PacketMirrorings {
9501 inner: std::sync::Arc<dyn super::stub::dynamic::PacketMirrorings>,
9502}
9503
9504#[cfg(feature = "packet-mirrorings")]
9505impl PacketMirrorings {
9506 /// Returns a builder for [PacketMirrorings].
9507 ///
9508 /// ```
9509 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9510 /// # use google_cloud_compute_v1::client::PacketMirrorings;
9511 /// let client = PacketMirrorings::builder().build().await?;
9512 /// # Ok(()) }
9513 /// ```
9514 pub fn builder() -> super::builder::packet_mirrorings::ClientBuilder {
9515 crate::new_client_builder(super::builder::packet_mirrorings::client::Factory)
9516 }
9517
9518 /// Creates a new client from the provided stub.
9519 ///
9520 /// The most common case for calling this function is in tests mocking the
9521 /// client's behavior.
9522 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
9523 where
9524 T: super::stub::PacketMirrorings + 'static,
9525 {
9526 Self { inner: stub.into() }
9527 }
9528
9529 pub(crate) async fn new(
9530 config: gaxi::options::ClientConfig,
9531 ) -> crate::ClientBuilderResult<Self> {
9532 let inner = Self::build_inner(config).await?;
9533 Ok(Self { inner })
9534 }
9535
9536 async fn build_inner(
9537 conf: gaxi::options::ClientConfig,
9538 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::PacketMirrorings>>
9539 {
9540 if gaxi::options::tracing_enabled(&conf) {
9541 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9542 }
9543 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9544 }
9545
9546 async fn build_transport(
9547 conf: gaxi::options::ClientConfig,
9548 ) -> crate::ClientBuilderResult<impl super::stub::PacketMirrorings> {
9549 super::transport::PacketMirrorings::new(conf).await
9550 }
9551
9552 async fn build_with_tracing(
9553 conf: gaxi::options::ClientConfig,
9554 ) -> crate::ClientBuilderResult<impl super::stub::PacketMirrorings> {
9555 Self::build_transport(conf)
9556 .await
9557 .map(super::tracing::PacketMirrorings::new)
9558 }
9559
9560 /// Retrieves an aggregated list of packetMirrorings.
9561 ///
9562 /// To prevent failure, Google recommends that you set the
9563 /// `returnPartialSuccess` parameter to `true`.
9564 pub fn aggregated_list(&self) -> super::builder::packet_mirrorings::AggregatedList {
9565 super::builder::packet_mirrorings::AggregatedList::new(self.inner.clone())
9566 }
9567
9568 /// Deletes the specified PacketMirroring resource.
9569 pub fn delete(&self) -> super::builder::packet_mirrorings::Delete {
9570 super::builder::packet_mirrorings::Delete::new(self.inner.clone())
9571 }
9572
9573 /// Returns the specified PacketMirroring resource.
9574 pub fn get(&self) -> super::builder::packet_mirrorings::Get {
9575 super::builder::packet_mirrorings::Get::new(self.inner.clone())
9576 }
9577
9578 /// Creates a PacketMirroring resource in the specified project and region
9579 /// using the data included in the request.
9580 pub fn insert(&self) -> super::builder::packet_mirrorings::Insert {
9581 super::builder::packet_mirrorings::Insert::new(self.inner.clone())
9582 }
9583
9584 /// Retrieves a list of PacketMirroring resources available to the specified
9585 /// project and region.
9586 pub fn list(&self) -> super::builder::packet_mirrorings::List {
9587 super::builder::packet_mirrorings::List::new(self.inner.clone())
9588 }
9589
9590 /// Patches the specified PacketMirroring resource with the data included in
9591 /// the request. This method supportsPATCH
9592 /// semantics and usesJSON merge
9593 /// patch format and processing rules.
9594 pub fn patch(&self) -> super::builder::packet_mirrorings::Patch {
9595 super::builder::packet_mirrorings::Patch::new(self.inner.clone())
9596 }
9597
9598 /// Returns permissions that a caller has on the specified resource.
9599 pub fn test_iam_permissions(&self) -> super::builder::packet_mirrorings::TestIamPermissions {
9600 super::builder::packet_mirrorings::TestIamPermissions::new(self.inner.clone())
9601 }
9602
9603 /// Retrieves the specified region-specific Operations resource.
9604 pub fn get_operation(&self) -> super::builder::packet_mirrorings::GetOperation {
9605 super::builder::packet_mirrorings::GetOperation::new(self.inner.clone())
9606 }
9607}
9608
9609/// Implements a client for the Compute Engine API.
9610///
9611/// # Example
9612/// ```
9613/// # use google_cloud_compute_v1::client::PreviewFeatures;
9614/// async fn sample(
9615/// ) -> anyhow::Result<()> {
9616/// let client = PreviewFeatures::builder().build().await?;
9617/// // use `client` to make requests to the Compute Engine API.
9618/// Ok(())
9619/// }
9620/// ```
9621///
9622/// # Service Description
9623///
9624/// Service for the `previewFeatures` resource.
9625///
9626/// # Configuration
9627///
9628/// To configure `PreviewFeatures` use the `with_*` methods in the type returned
9629/// by [builder()][PreviewFeatures::builder]. The default configuration should
9630/// work for most applications. Common configuration changes include
9631///
9632/// * [with_endpoint()]: by default this client uses the global default endpoint
9633/// (`https://compute.googleapis.com`). Applications using regional
9634/// endpoints or running in restricted networks (e.g. a network configured
9635/// with [Private Google Access with VPC Service Controls]) may want to
9636/// override this default.
9637/// * [with_credentials()]: by default this client uses
9638/// [Application Default Credentials]. Applications using custom
9639/// authentication may need to override this default.
9640///
9641/// [with_endpoint()]: super::builder::preview_features::ClientBuilder::with_endpoint
9642/// [with_credentials()]: super::builder::preview_features::ClientBuilder::with_credentials
9643/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9644/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9645///
9646/// # Pooling and Cloning
9647///
9648/// `PreviewFeatures` holds a connection pool internally, it is advised to
9649/// create one and reuse it. You do not need to wrap `PreviewFeatures` in
9650/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9651/// already uses an `Arc` internally.
9652#[cfg(feature = "preview-features")]
9653#[cfg_attr(docsrs, doc(cfg(feature = "preview-features")))]
9654#[derive(Clone, Debug)]
9655pub struct PreviewFeatures {
9656 inner: std::sync::Arc<dyn super::stub::dynamic::PreviewFeatures>,
9657}
9658
9659#[cfg(feature = "preview-features")]
9660impl PreviewFeatures {
9661 /// Returns a builder for [PreviewFeatures].
9662 ///
9663 /// ```
9664 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9665 /// # use google_cloud_compute_v1::client::PreviewFeatures;
9666 /// let client = PreviewFeatures::builder().build().await?;
9667 /// # Ok(()) }
9668 /// ```
9669 pub fn builder() -> super::builder::preview_features::ClientBuilder {
9670 crate::new_client_builder(super::builder::preview_features::client::Factory)
9671 }
9672
9673 /// Creates a new client from the provided stub.
9674 ///
9675 /// The most common case for calling this function is in tests mocking the
9676 /// client's behavior.
9677 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
9678 where
9679 T: super::stub::PreviewFeatures + 'static,
9680 {
9681 Self { inner: stub.into() }
9682 }
9683
9684 pub(crate) async fn new(
9685 config: gaxi::options::ClientConfig,
9686 ) -> crate::ClientBuilderResult<Self> {
9687 let inner = Self::build_inner(config).await?;
9688 Ok(Self { inner })
9689 }
9690
9691 async fn build_inner(
9692 conf: gaxi::options::ClientConfig,
9693 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::PreviewFeatures>> {
9694 if gaxi::options::tracing_enabled(&conf) {
9695 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9696 }
9697 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9698 }
9699
9700 async fn build_transport(
9701 conf: gaxi::options::ClientConfig,
9702 ) -> crate::ClientBuilderResult<impl super::stub::PreviewFeatures> {
9703 super::transport::PreviewFeatures::new(conf).await
9704 }
9705
9706 async fn build_with_tracing(
9707 conf: gaxi::options::ClientConfig,
9708 ) -> crate::ClientBuilderResult<impl super::stub::PreviewFeatures> {
9709 Self::build_transport(conf)
9710 .await
9711 .map(super::tracing::PreviewFeatures::new)
9712 }
9713
9714 /// Returns the details of the given PreviewFeature.
9715 pub fn get(&self) -> super::builder::preview_features::Get {
9716 super::builder::preview_features::Get::new(self.inner.clone())
9717 }
9718
9719 /// Returns the details of the given PreviewFeature.
9720 pub fn list(&self) -> super::builder::preview_features::List {
9721 super::builder::preview_features::List::new(self.inner.clone())
9722 }
9723
9724 /// Patches the given PreviewFeature. This method is used to enable or disable
9725 /// a PreviewFeature.
9726 pub fn update(&self) -> super::builder::preview_features::Update {
9727 super::builder::preview_features::Update::new(self.inner.clone())
9728 }
9729
9730 /// Retrieves the specified Operations resource.
9731 pub fn get_operation(&self) -> super::builder::preview_features::GetOperation {
9732 super::builder::preview_features::GetOperation::new(self.inner.clone())
9733 }
9734}
9735
9736/// Implements a client for the Compute Engine API.
9737///
9738/// # Example
9739/// ```
9740/// # use google_cloud_compute_v1::client::ProjectViews;
9741/// async fn sample(
9742/// ) -> anyhow::Result<()> {
9743/// let client = ProjectViews::builder().build().await?;
9744/// // use `client` to make requests to the Compute Engine API.
9745/// Ok(())
9746/// }
9747/// ```
9748///
9749/// # Service Description
9750///
9751/// Service for the `projectViews` resource.
9752///
9753/// # Configuration
9754///
9755/// To configure `ProjectViews` use the `with_*` methods in the type returned
9756/// by [builder()][ProjectViews::builder]. The default configuration should
9757/// work for most applications. Common configuration changes include
9758///
9759/// * [with_endpoint()]: by default this client uses the global default endpoint
9760/// (`https://compute.googleapis.com`). Applications using regional
9761/// endpoints or running in restricted networks (e.g. a network configured
9762/// with [Private Google Access with VPC Service Controls]) may want to
9763/// override this default.
9764/// * [with_credentials()]: by default this client uses
9765/// [Application Default Credentials]. Applications using custom
9766/// authentication may need to override this default.
9767///
9768/// [with_endpoint()]: super::builder::project_views::ClientBuilder::with_endpoint
9769/// [with_credentials()]: super::builder::project_views::ClientBuilder::with_credentials
9770/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9771/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9772///
9773/// # Pooling and Cloning
9774///
9775/// `ProjectViews` holds a connection pool internally, it is advised to
9776/// create one and reuse it. You do not need to wrap `ProjectViews` in
9777/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9778/// already uses an `Arc` internally.
9779#[cfg(feature = "project-views")]
9780#[cfg_attr(docsrs, doc(cfg(feature = "project-views")))]
9781#[derive(Clone, Debug)]
9782pub struct ProjectViews {
9783 inner: std::sync::Arc<dyn super::stub::dynamic::ProjectViews>,
9784}
9785
9786#[cfg(feature = "project-views")]
9787impl ProjectViews {
9788 /// Returns a builder for [ProjectViews].
9789 ///
9790 /// ```
9791 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9792 /// # use google_cloud_compute_v1::client::ProjectViews;
9793 /// let client = ProjectViews::builder().build().await?;
9794 /// # Ok(()) }
9795 /// ```
9796 pub fn builder() -> super::builder::project_views::ClientBuilder {
9797 crate::new_client_builder(super::builder::project_views::client::Factory)
9798 }
9799
9800 /// Creates a new client from the provided stub.
9801 ///
9802 /// The most common case for calling this function is in tests mocking the
9803 /// client's behavior.
9804 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
9805 where
9806 T: super::stub::ProjectViews + 'static,
9807 {
9808 Self { inner: stub.into() }
9809 }
9810
9811 pub(crate) async fn new(
9812 config: gaxi::options::ClientConfig,
9813 ) -> crate::ClientBuilderResult<Self> {
9814 let inner = Self::build_inner(config).await?;
9815 Ok(Self { inner })
9816 }
9817
9818 async fn build_inner(
9819 conf: gaxi::options::ClientConfig,
9820 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ProjectViews>> {
9821 if gaxi::options::tracing_enabled(&conf) {
9822 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9823 }
9824 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9825 }
9826
9827 async fn build_transport(
9828 conf: gaxi::options::ClientConfig,
9829 ) -> crate::ClientBuilderResult<impl super::stub::ProjectViews> {
9830 super::transport::ProjectViews::new(conf).await
9831 }
9832
9833 async fn build_with_tracing(
9834 conf: gaxi::options::ClientConfig,
9835 ) -> crate::ClientBuilderResult<impl super::stub::ProjectViews> {
9836 Self::build_transport(conf)
9837 .await
9838 .map(super::tracing::ProjectViews::new)
9839 }
9840
9841 /// Returns the specified global ProjectViews resource, with a regional
9842 /// context.
9843 /// This regional API endpoint reads resource metadata from regional
9844 /// read-only replicas. Because changes are copied to these regional replicas
9845 /// asynchronously, for real-time resource reads or any write operations
9846 /// (creating, updating, or deleting resources), use the global
9847 /// [projects.get](https://cloud.google.com/compute/docs/reference/rest/v1/projects/get)
9848 /// endpoint.
9849 pub fn get(&self) -> super::builder::project_views::Get {
9850 super::builder::project_views::Get::new(self.inner.clone())
9851 }
9852}
9853
9854/// Implements a client for the Compute Engine API.
9855///
9856/// # Example
9857/// ```
9858/// # use google_cloud_compute_v1::client::Projects;
9859/// async fn sample(
9860/// ) -> anyhow::Result<()> {
9861/// let client = Projects::builder().build().await?;
9862/// // use `client` to make requests to the Compute Engine API.
9863/// Ok(())
9864/// }
9865/// ```
9866///
9867/// # Service Description
9868///
9869/// Service for the `projects` resource.
9870///
9871/// # Configuration
9872///
9873/// To configure `Projects` use the `with_*` methods in the type returned
9874/// by [builder()][Projects::builder]. The default configuration should
9875/// work for most applications. Common configuration changes include
9876///
9877/// * [with_endpoint()]: by default this client uses the global default endpoint
9878/// (`https://compute.googleapis.com`). Applications using regional
9879/// endpoints or running in restricted networks (e.g. a network configured
9880/// with [Private Google Access with VPC Service Controls]) may want to
9881/// override this default.
9882/// * [with_credentials()]: by default this client uses
9883/// [Application Default Credentials]. Applications using custom
9884/// authentication may need to override this default.
9885///
9886/// [with_endpoint()]: super::builder::projects::ClientBuilder::with_endpoint
9887/// [with_credentials()]: super::builder::projects::ClientBuilder::with_credentials
9888/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9889/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9890///
9891/// # Pooling and Cloning
9892///
9893/// `Projects` holds a connection pool internally, it is advised to
9894/// create one and reuse it. You do not need to wrap `Projects` in
9895/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9896/// already uses an `Arc` internally.
9897#[cfg(feature = "projects")]
9898#[cfg_attr(docsrs, doc(cfg(feature = "projects")))]
9899#[derive(Clone, Debug)]
9900pub struct Projects {
9901 inner: std::sync::Arc<dyn super::stub::dynamic::Projects>,
9902}
9903
9904#[cfg(feature = "projects")]
9905impl Projects {
9906 /// Returns a builder for [Projects].
9907 ///
9908 /// ```
9909 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9910 /// # use google_cloud_compute_v1::client::Projects;
9911 /// let client = Projects::builder().build().await?;
9912 /// # Ok(()) }
9913 /// ```
9914 pub fn builder() -> super::builder::projects::ClientBuilder {
9915 crate::new_client_builder(super::builder::projects::client::Factory)
9916 }
9917
9918 /// Creates a new client from the provided stub.
9919 ///
9920 /// The most common case for calling this function is in tests mocking the
9921 /// client's behavior.
9922 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
9923 where
9924 T: super::stub::Projects + 'static,
9925 {
9926 Self { inner: stub.into() }
9927 }
9928
9929 pub(crate) async fn new(
9930 config: gaxi::options::ClientConfig,
9931 ) -> crate::ClientBuilderResult<Self> {
9932 let inner = Self::build_inner(config).await?;
9933 Ok(Self { inner })
9934 }
9935
9936 async fn build_inner(
9937 conf: gaxi::options::ClientConfig,
9938 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Projects>> {
9939 if gaxi::options::tracing_enabled(&conf) {
9940 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9941 }
9942 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9943 }
9944
9945 async fn build_transport(
9946 conf: gaxi::options::ClientConfig,
9947 ) -> crate::ClientBuilderResult<impl super::stub::Projects> {
9948 super::transport::Projects::new(conf).await
9949 }
9950
9951 async fn build_with_tracing(
9952 conf: gaxi::options::ClientConfig,
9953 ) -> crate::ClientBuilderResult<impl super::stub::Projects> {
9954 Self::build_transport(conf)
9955 .await
9956 .map(super::tracing::Projects::new)
9957 }
9958
9959 /// Disable this project as a shared VPC host project.
9960 pub fn disable_xpn_host(&self) -> super::builder::projects::DisableXpnHost {
9961 super::builder::projects::DisableXpnHost::new(self.inner.clone())
9962 }
9963
9964 /// Disable a service resource (also known as service project) associated with
9965 /// this host project.
9966 pub fn disable_xpn_resource(&self) -> super::builder::projects::DisableXpnResource {
9967 super::builder::projects::DisableXpnResource::new(self.inner.clone())
9968 }
9969
9970 /// Enable this project as a shared VPC host project.
9971 pub fn enable_xpn_host(&self) -> super::builder::projects::EnableXpnHost {
9972 super::builder::projects::EnableXpnHost::new(self.inner.clone())
9973 }
9974
9975 /// Enable service resource (a.k.a service project) for a host project, so that
9976 /// subnets in the host project can be used by instances in the service
9977 /// project.
9978 pub fn enable_xpn_resource(&self) -> super::builder::projects::EnableXpnResource {
9979 super::builder::projects::EnableXpnResource::new(self.inner.clone())
9980 }
9981
9982 /// Returns the specified Project resource.
9983 ///
9984 /// To decrease latency for this method, you can optionally omit any unneeded
9985 /// information from the response by using a field mask. This practice is
9986 /// especially recommended for unused quota information (the `quotas` field).
9987 /// To exclude one or more fields, set your request's `fields` query parameter
9988 /// to only include the fields you need. For example, to only include the `id`
9989 /// and `selfLink` fields, add the query parameter `?fields=id,selfLink` to
9990 /// your request.
9991 pub fn get(&self) -> super::builder::projects::Get {
9992 super::builder::projects::Get::new(self.inner.clone())
9993 }
9994
9995 /// Gets the shared VPC host project that this project links to. May be empty
9996 /// if no link exists.
9997 pub fn get_xpn_host(&self) -> super::builder::projects::GetXpnHost {
9998 super::builder::projects::GetXpnHost::new(self.inner.clone())
9999 }
10000
10001 /// Gets service resources (a.k.a service project) associated with this host
10002 /// project.
10003 pub fn get_xpn_resources(&self) -> super::builder::projects::GetXpnResources {
10004 super::builder::projects::GetXpnResources::new(self.inner.clone())
10005 }
10006
10007 /// Lists all shared VPC host projects visible to the user in an organization.
10008 pub fn list_xpn_hosts(&self) -> super::builder::projects::ListXpnHosts {
10009 super::builder::projects::ListXpnHosts::new(self.inner.clone())
10010 }
10011
10012 /// Moves a persistent disk from one zone to another.
10013 /// *Note*: The moveDisk API will be deprecated on September 29, 2026.
10014 ///
10015 /// Starting September 29, 2025, you can't use the moveDisk API on new
10016 /// projects. To move a disk to a different region or zone, follow the steps in
10017 /// [Change the location of a
10018 /// disk](https://cloud.google.com/compute/docs/disks/migrate-to-hyperdisk#migrate-to-hd).
10019 ///
10020 /// Projects that already use the moveDisk API can continue usage until
10021 /// September 29, 2026.
10022 ///
10023 /// Starting November 1, 2025, API responses will include a warning message in
10024 /// the response body about the upcoming deprecation. You can skip the message
10025 /// to continue using the service without interruption.
10026 #[deprecated]
10027 pub fn move_disk(&self) -> super::builder::projects::MoveDisk {
10028 super::builder::projects::MoveDisk::new(self.inner.clone())
10029 }
10030
10031 /// Moves an instance and its attached persistent disks from one zone to
10032 /// another.
10033 /// *Note*: Moving VMs or disks by using this method might
10034 /// cause unexpected behavior. For more information, see the [known
10035 /// issue](/compute/docs/troubleshooting/known-issues#moving_vms_or_disks_using_the_moveinstance_api_or_the_causes_unexpected_behavior).
10036 /// [Deprecated] This method is deprecated. See [moving instance across
10037 /// zones](/compute/docs/instances/moving-instance-across-zones) instead.
10038 #[deprecated]
10039 pub fn move_instance(&self) -> super::builder::projects::MoveInstance {
10040 super::builder::projects::MoveInstance::new(self.inner.clone())
10041 }
10042
10043 /// Sets the Cloud Armor tier of the project. To set ENTERPRISE or above the
10044 /// billing account of the project must be subscribed to Cloud Armor
10045 /// Enterprise. See Subscribing
10046 /// to Cloud Armor Enterprise for more information.
10047 pub fn set_cloud_armor_tier(&self) -> super::builder::projects::SetCloudArmorTier {
10048 super::builder::projects::SetCloudArmorTier::new(self.inner.clone())
10049 }
10050
10051 /// Sets metadata common to all instances within the specified project using
10052 /// the data included in the request.
10053 pub fn set_common_instance_metadata(
10054 &self,
10055 ) -> super::builder::projects::SetCommonInstanceMetadata {
10056 super::builder::projects::SetCommonInstanceMetadata::new(self.inner.clone())
10057 }
10058
10059 /// Sets the default network tier of the project. The default network tier is
10060 /// used when an address/forwardingRule/instance is created without specifying
10061 /// the network tier field.
10062 pub fn set_default_network_tier(&self) -> super::builder::projects::SetDefaultNetworkTier {
10063 super::builder::projects::SetDefaultNetworkTier::new(self.inner.clone())
10064 }
10065
10066 /// Enables the usage export feature and sets theusage export bucket
10067 /// where reports are stored. If you provide an empty request body using this
10068 /// method, the usage export feature will be disabled.
10069 pub fn set_usage_export_bucket(&self) -> super::builder::projects::SetUsageExportBucket {
10070 super::builder::projects::SetUsageExportBucket::new(self.inner.clone())
10071 }
10072
10073 /// Retrieves the specified Operations resource.
10074 pub fn get_operation(&self) -> super::builder::projects::GetOperation {
10075 super::builder::projects::GetOperation::new(self.inner.clone())
10076 }
10077}
10078
10079/// Implements a client for the Compute Engine API.
10080///
10081/// # Example
10082/// ```
10083/// # use google_cloud_compute_v1::client::PublicAdvertisedPrefixes;
10084/// async fn sample(
10085/// ) -> anyhow::Result<()> {
10086/// let client = PublicAdvertisedPrefixes::builder().build().await?;
10087/// // use `client` to make requests to the Compute Engine API.
10088/// Ok(())
10089/// }
10090/// ```
10091///
10092/// # Service Description
10093///
10094/// Service for the `publicAdvertisedPrefixes` resource.
10095///
10096/// # Configuration
10097///
10098/// To configure `PublicAdvertisedPrefixes` use the `with_*` methods in the type returned
10099/// by [builder()][PublicAdvertisedPrefixes::builder]. The default configuration should
10100/// work for most applications. Common configuration changes include
10101///
10102/// * [with_endpoint()]: by default this client uses the global default endpoint
10103/// (`https://compute.googleapis.com`). Applications using regional
10104/// endpoints or running in restricted networks (e.g. a network configured
10105/// with [Private Google Access with VPC Service Controls]) may want to
10106/// override this default.
10107/// * [with_credentials()]: by default this client uses
10108/// [Application Default Credentials]. Applications using custom
10109/// authentication may need to override this default.
10110///
10111/// [with_endpoint()]: super::builder::public_advertised_prefixes::ClientBuilder::with_endpoint
10112/// [with_credentials()]: super::builder::public_advertised_prefixes::ClientBuilder::with_credentials
10113/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10114/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10115///
10116/// # Pooling and Cloning
10117///
10118/// `PublicAdvertisedPrefixes` holds a connection pool internally, it is advised to
10119/// create one and reuse it. You do not need to wrap `PublicAdvertisedPrefixes` in
10120/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10121/// already uses an `Arc` internally.
10122#[cfg(feature = "public-advertised-prefixes")]
10123#[cfg_attr(docsrs, doc(cfg(feature = "public-advertised-prefixes")))]
10124#[derive(Clone, Debug)]
10125pub struct PublicAdvertisedPrefixes {
10126 inner: std::sync::Arc<dyn super::stub::dynamic::PublicAdvertisedPrefixes>,
10127}
10128
10129#[cfg(feature = "public-advertised-prefixes")]
10130impl PublicAdvertisedPrefixes {
10131 /// Returns a builder for [PublicAdvertisedPrefixes].
10132 ///
10133 /// ```
10134 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10135 /// # use google_cloud_compute_v1::client::PublicAdvertisedPrefixes;
10136 /// let client = PublicAdvertisedPrefixes::builder().build().await?;
10137 /// # Ok(()) }
10138 /// ```
10139 pub fn builder() -> super::builder::public_advertised_prefixes::ClientBuilder {
10140 crate::new_client_builder(super::builder::public_advertised_prefixes::client::Factory)
10141 }
10142
10143 /// Creates a new client from the provided stub.
10144 ///
10145 /// The most common case for calling this function is in tests mocking the
10146 /// client's behavior.
10147 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
10148 where
10149 T: super::stub::PublicAdvertisedPrefixes + 'static,
10150 {
10151 Self { inner: stub.into() }
10152 }
10153
10154 pub(crate) async fn new(
10155 config: gaxi::options::ClientConfig,
10156 ) -> crate::ClientBuilderResult<Self> {
10157 let inner = Self::build_inner(config).await?;
10158 Ok(Self { inner })
10159 }
10160
10161 async fn build_inner(
10162 conf: gaxi::options::ClientConfig,
10163 ) -> crate::ClientBuilderResult<
10164 std::sync::Arc<dyn super::stub::dynamic::PublicAdvertisedPrefixes>,
10165 > {
10166 if gaxi::options::tracing_enabled(&conf) {
10167 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10168 }
10169 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10170 }
10171
10172 async fn build_transport(
10173 conf: gaxi::options::ClientConfig,
10174 ) -> crate::ClientBuilderResult<impl super::stub::PublicAdvertisedPrefixes> {
10175 super::transport::PublicAdvertisedPrefixes::new(conf).await
10176 }
10177
10178 async fn build_with_tracing(
10179 conf: gaxi::options::ClientConfig,
10180 ) -> crate::ClientBuilderResult<impl super::stub::PublicAdvertisedPrefixes> {
10181 Self::build_transport(conf)
10182 .await
10183 .map(super::tracing::PublicAdvertisedPrefixes::new)
10184 }
10185
10186 /// Announces the specified PublicAdvertisedPrefix
10187 pub fn announce(&self) -> super::builder::public_advertised_prefixes::Announce {
10188 super::builder::public_advertised_prefixes::Announce::new(self.inner.clone())
10189 }
10190
10191 /// Deletes the specified PublicAdvertisedPrefix
10192 pub fn delete(&self) -> super::builder::public_advertised_prefixes::Delete {
10193 super::builder::public_advertised_prefixes::Delete::new(self.inner.clone())
10194 }
10195
10196 /// Returns the specified PublicAdvertisedPrefix resource.
10197 pub fn get(&self) -> super::builder::public_advertised_prefixes::Get {
10198 super::builder::public_advertised_prefixes::Get::new(self.inner.clone())
10199 }
10200
10201 /// Creates a PublicAdvertisedPrefix in the specified project
10202 /// using the parameters that are included in the request.
10203 pub fn insert(&self) -> super::builder::public_advertised_prefixes::Insert {
10204 super::builder::public_advertised_prefixes::Insert::new(self.inner.clone())
10205 }
10206
10207 /// Lists the PublicAdvertisedPrefixes for a project.
10208 pub fn list(&self) -> super::builder::public_advertised_prefixes::List {
10209 super::builder::public_advertised_prefixes::List::new(self.inner.clone())
10210 }
10211
10212 /// Patches the specified Router resource with the data included in the
10213 /// request. This method supportsPATCH
10214 /// semantics and usesJSON merge
10215 /// patch format and processing rules.
10216 pub fn patch(&self) -> super::builder::public_advertised_prefixes::Patch {
10217 super::builder::public_advertised_prefixes::Patch::new(self.inner.clone())
10218 }
10219
10220 /// Withdraws the specified PublicAdvertisedPrefix
10221 pub fn withdraw(&self) -> super::builder::public_advertised_prefixes::Withdraw {
10222 super::builder::public_advertised_prefixes::Withdraw::new(self.inner.clone())
10223 }
10224
10225 /// Retrieves the specified Operations resource.
10226 pub fn get_operation(&self) -> super::builder::public_advertised_prefixes::GetOperation {
10227 super::builder::public_advertised_prefixes::GetOperation::new(self.inner.clone())
10228 }
10229}
10230
10231/// Implements a client for the Compute Engine API.
10232///
10233/// # Example
10234/// ```
10235/// # use google_cloud_compute_v1::client::PublicDelegatedPrefixes;
10236/// async fn sample(
10237/// ) -> anyhow::Result<()> {
10238/// let client = PublicDelegatedPrefixes::builder().build().await?;
10239/// // use `client` to make requests to the Compute Engine API.
10240/// Ok(())
10241/// }
10242/// ```
10243///
10244/// # Service Description
10245///
10246/// Service for the `publicDelegatedPrefixes` resource.
10247///
10248/// # Configuration
10249///
10250/// To configure `PublicDelegatedPrefixes` use the `with_*` methods in the type returned
10251/// by [builder()][PublicDelegatedPrefixes::builder]. The default configuration should
10252/// work for most applications. Common configuration changes include
10253///
10254/// * [with_endpoint()]: by default this client uses the global default endpoint
10255/// (`https://compute.googleapis.com`). Applications using regional
10256/// endpoints or running in restricted networks (e.g. a network configured
10257/// with [Private Google Access with VPC Service Controls]) may want to
10258/// override this default.
10259/// * [with_credentials()]: by default this client uses
10260/// [Application Default Credentials]. Applications using custom
10261/// authentication may need to override this default.
10262///
10263/// [with_endpoint()]: super::builder::public_delegated_prefixes::ClientBuilder::with_endpoint
10264/// [with_credentials()]: super::builder::public_delegated_prefixes::ClientBuilder::with_credentials
10265/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10266/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10267///
10268/// # Pooling and Cloning
10269///
10270/// `PublicDelegatedPrefixes` holds a connection pool internally, it is advised to
10271/// create one and reuse it. You do not need to wrap `PublicDelegatedPrefixes` in
10272/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10273/// already uses an `Arc` internally.
10274#[cfg(feature = "public-delegated-prefixes")]
10275#[cfg_attr(docsrs, doc(cfg(feature = "public-delegated-prefixes")))]
10276#[derive(Clone, Debug)]
10277pub struct PublicDelegatedPrefixes {
10278 inner: std::sync::Arc<dyn super::stub::dynamic::PublicDelegatedPrefixes>,
10279}
10280
10281#[cfg(feature = "public-delegated-prefixes")]
10282impl PublicDelegatedPrefixes {
10283 /// Returns a builder for [PublicDelegatedPrefixes].
10284 ///
10285 /// ```
10286 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10287 /// # use google_cloud_compute_v1::client::PublicDelegatedPrefixes;
10288 /// let client = PublicDelegatedPrefixes::builder().build().await?;
10289 /// # Ok(()) }
10290 /// ```
10291 pub fn builder() -> super::builder::public_delegated_prefixes::ClientBuilder {
10292 crate::new_client_builder(super::builder::public_delegated_prefixes::client::Factory)
10293 }
10294
10295 /// Creates a new client from the provided stub.
10296 ///
10297 /// The most common case for calling this function is in tests mocking the
10298 /// client's behavior.
10299 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
10300 where
10301 T: super::stub::PublicDelegatedPrefixes + 'static,
10302 {
10303 Self { inner: stub.into() }
10304 }
10305
10306 pub(crate) async fn new(
10307 config: gaxi::options::ClientConfig,
10308 ) -> crate::ClientBuilderResult<Self> {
10309 let inner = Self::build_inner(config).await?;
10310 Ok(Self { inner })
10311 }
10312
10313 async fn build_inner(
10314 conf: gaxi::options::ClientConfig,
10315 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::PublicDelegatedPrefixes>>
10316 {
10317 if gaxi::options::tracing_enabled(&conf) {
10318 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10319 }
10320 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10321 }
10322
10323 async fn build_transport(
10324 conf: gaxi::options::ClientConfig,
10325 ) -> crate::ClientBuilderResult<impl super::stub::PublicDelegatedPrefixes> {
10326 super::transport::PublicDelegatedPrefixes::new(conf).await
10327 }
10328
10329 async fn build_with_tracing(
10330 conf: gaxi::options::ClientConfig,
10331 ) -> crate::ClientBuilderResult<impl super::stub::PublicDelegatedPrefixes> {
10332 Self::build_transport(conf)
10333 .await
10334 .map(super::tracing::PublicDelegatedPrefixes::new)
10335 }
10336
10337 /// Lists all PublicDelegatedPrefix resources owned by the specific project
10338 /// across all scopes.
10339 ///
10340 /// To prevent failure, Google recommends that you set the
10341 /// `returnPartialSuccess` parameter to `true`.
10342 pub fn aggregated_list(&self) -> super::builder::public_delegated_prefixes::AggregatedList {
10343 super::builder::public_delegated_prefixes::AggregatedList::new(self.inner.clone())
10344 }
10345
10346 /// Announces the specified PublicDelegatedPrefix in the given region.
10347 pub fn announce(&self) -> super::builder::public_delegated_prefixes::Announce {
10348 super::builder::public_delegated_prefixes::Announce::new(self.inner.clone())
10349 }
10350
10351 /// Deletes the specified PublicDelegatedPrefix in the given region.
10352 pub fn delete(&self) -> super::builder::public_delegated_prefixes::Delete {
10353 super::builder::public_delegated_prefixes::Delete::new(self.inner.clone())
10354 }
10355
10356 /// Returns the specified PublicDelegatedPrefix resource in the given region.
10357 pub fn get(&self) -> super::builder::public_delegated_prefixes::Get {
10358 super::builder::public_delegated_prefixes::Get::new(self.inner.clone())
10359 }
10360
10361 /// Creates a PublicDelegatedPrefix in the specified project in the given
10362 /// region using the parameters that are included in the request.
10363 pub fn insert(&self) -> super::builder::public_delegated_prefixes::Insert {
10364 super::builder::public_delegated_prefixes::Insert::new(self.inner.clone())
10365 }
10366
10367 /// Lists the PublicDelegatedPrefixes for a project in the given region.
10368 pub fn list(&self) -> super::builder::public_delegated_prefixes::List {
10369 super::builder::public_delegated_prefixes::List::new(self.inner.clone())
10370 }
10371
10372 /// Patches the specified PublicDelegatedPrefix resource with the data included
10373 /// in the request. This method supportsPATCH
10374 /// semantics and usesJSON merge
10375 /// patch format and processing rules.
10376 pub fn patch(&self) -> super::builder::public_delegated_prefixes::Patch {
10377 super::builder::public_delegated_prefixes::Patch::new(self.inner.clone())
10378 }
10379
10380 /// Withdraws the specified PublicDelegatedPrefix in the given region.
10381 pub fn withdraw(&self) -> super::builder::public_delegated_prefixes::Withdraw {
10382 super::builder::public_delegated_prefixes::Withdraw::new(self.inner.clone())
10383 }
10384
10385 /// Retrieves the specified region-specific Operations resource.
10386 pub fn get_operation(&self) -> super::builder::public_delegated_prefixes::GetOperation {
10387 super::builder::public_delegated_prefixes::GetOperation::new(self.inner.clone())
10388 }
10389}
10390
10391/// Implements a client for the Compute Engine API.
10392///
10393/// # Example
10394/// ```
10395/// # use google_cloud_compute_v1::client::RegionAutoscalers;
10396/// async fn sample(
10397/// ) -> anyhow::Result<()> {
10398/// let client = RegionAutoscalers::builder().build().await?;
10399/// // use `client` to make requests to the Compute Engine API.
10400/// Ok(())
10401/// }
10402/// ```
10403///
10404/// # Service Description
10405///
10406/// Service for the `regionAutoscalers` resource.
10407///
10408/// # Configuration
10409///
10410/// To configure `RegionAutoscalers` use the `with_*` methods in the type returned
10411/// by [builder()][RegionAutoscalers::builder]. The default configuration should
10412/// work for most applications. Common configuration changes include
10413///
10414/// * [with_endpoint()]: by default this client uses the global default endpoint
10415/// (`https://compute.googleapis.com`). Applications using regional
10416/// endpoints or running in restricted networks (e.g. a network configured
10417/// with [Private Google Access with VPC Service Controls]) may want to
10418/// override this default.
10419/// * [with_credentials()]: by default this client uses
10420/// [Application Default Credentials]. Applications using custom
10421/// authentication may need to override this default.
10422///
10423/// [with_endpoint()]: super::builder::region_autoscalers::ClientBuilder::with_endpoint
10424/// [with_credentials()]: super::builder::region_autoscalers::ClientBuilder::with_credentials
10425/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10426/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10427///
10428/// # Pooling and Cloning
10429///
10430/// `RegionAutoscalers` holds a connection pool internally, it is advised to
10431/// create one and reuse it. You do not need to wrap `RegionAutoscalers` in
10432/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10433/// already uses an `Arc` internally.
10434#[cfg(feature = "region-autoscalers")]
10435#[cfg_attr(docsrs, doc(cfg(feature = "region-autoscalers")))]
10436#[derive(Clone, Debug)]
10437pub struct RegionAutoscalers {
10438 inner: std::sync::Arc<dyn super::stub::dynamic::RegionAutoscalers>,
10439}
10440
10441#[cfg(feature = "region-autoscalers")]
10442impl RegionAutoscalers {
10443 /// Returns a builder for [RegionAutoscalers].
10444 ///
10445 /// ```
10446 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10447 /// # use google_cloud_compute_v1::client::RegionAutoscalers;
10448 /// let client = RegionAutoscalers::builder().build().await?;
10449 /// # Ok(()) }
10450 /// ```
10451 pub fn builder() -> super::builder::region_autoscalers::ClientBuilder {
10452 crate::new_client_builder(super::builder::region_autoscalers::client::Factory)
10453 }
10454
10455 /// Creates a new client from the provided stub.
10456 ///
10457 /// The most common case for calling this function is in tests mocking the
10458 /// client's behavior.
10459 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
10460 where
10461 T: super::stub::RegionAutoscalers + 'static,
10462 {
10463 Self { inner: stub.into() }
10464 }
10465
10466 pub(crate) async fn new(
10467 config: gaxi::options::ClientConfig,
10468 ) -> crate::ClientBuilderResult<Self> {
10469 let inner = Self::build_inner(config).await?;
10470 Ok(Self { inner })
10471 }
10472
10473 async fn build_inner(
10474 conf: gaxi::options::ClientConfig,
10475 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionAutoscalers>>
10476 {
10477 if gaxi::options::tracing_enabled(&conf) {
10478 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10479 }
10480 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10481 }
10482
10483 async fn build_transport(
10484 conf: gaxi::options::ClientConfig,
10485 ) -> crate::ClientBuilderResult<impl super::stub::RegionAutoscalers> {
10486 super::transport::RegionAutoscalers::new(conf).await
10487 }
10488
10489 async fn build_with_tracing(
10490 conf: gaxi::options::ClientConfig,
10491 ) -> crate::ClientBuilderResult<impl super::stub::RegionAutoscalers> {
10492 Self::build_transport(conf)
10493 .await
10494 .map(super::tracing::RegionAutoscalers::new)
10495 }
10496
10497 /// Deletes the specified autoscaler.
10498 pub fn delete(&self) -> super::builder::region_autoscalers::Delete {
10499 super::builder::region_autoscalers::Delete::new(self.inner.clone())
10500 }
10501
10502 /// Returns the specified autoscaler.
10503 pub fn get(&self) -> super::builder::region_autoscalers::Get {
10504 super::builder::region_autoscalers::Get::new(self.inner.clone())
10505 }
10506
10507 /// Creates an autoscaler in the specified project using
10508 /// the data included in the request.
10509 pub fn insert(&self) -> super::builder::region_autoscalers::Insert {
10510 super::builder::region_autoscalers::Insert::new(self.inner.clone())
10511 }
10512
10513 /// Retrieves a list of autoscalers contained within
10514 /// the specified region.
10515 pub fn list(&self) -> super::builder::region_autoscalers::List {
10516 super::builder::region_autoscalers::List::new(self.inner.clone())
10517 }
10518
10519 /// Updates an autoscaler in the specified project using
10520 /// the data included in the request. This method supportsPATCH
10521 /// semantics and uses theJSON merge
10522 /// patch format and processing rules.
10523 pub fn patch(&self) -> super::builder::region_autoscalers::Patch {
10524 super::builder::region_autoscalers::Patch::new(self.inner.clone())
10525 }
10526
10527 /// Returns permissions that a caller has on the specified resource.
10528 pub fn test_iam_permissions(&self) -> super::builder::region_autoscalers::TestIamPermissions {
10529 super::builder::region_autoscalers::TestIamPermissions::new(self.inner.clone())
10530 }
10531
10532 /// Updates an autoscaler in the specified project using
10533 /// the data included in the request.
10534 pub fn update(&self) -> super::builder::region_autoscalers::Update {
10535 super::builder::region_autoscalers::Update::new(self.inner.clone())
10536 }
10537
10538 /// Retrieves the specified region-specific Operations resource.
10539 pub fn get_operation(&self) -> super::builder::region_autoscalers::GetOperation {
10540 super::builder::region_autoscalers::GetOperation::new(self.inner.clone())
10541 }
10542}
10543
10544/// Implements a client for the Compute Engine API.
10545///
10546/// # Example
10547/// ```
10548/// # use google_cloud_compute_v1::client::RegionBackendBuckets;
10549/// async fn sample(
10550/// ) -> anyhow::Result<()> {
10551/// let client = RegionBackendBuckets::builder().build().await?;
10552/// // use `client` to make requests to the Compute Engine API.
10553/// Ok(())
10554/// }
10555/// ```
10556///
10557/// # Service Description
10558///
10559/// Service for the `regionBackendBuckets` resource.
10560///
10561/// # Configuration
10562///
10563/// To configure `RegionBackendBuckets` use the `with_*` methods in the type returned
10564/// by [builder()][RegionBackendBuckets::builder]. The default configuration should
10565/// work for most applications. Common configuration changes include
10566///
10567/// * [with_endpoint()]: by default this client uses the global default endpoint
10568/// (`https://compute.googleapis.com`). Applications using regional
10569/// endpoints or running in restricted networks (e.g. a network configured
10570/// with [Private Google Access with VPC Service Controls]) may want to
10571/// override this default.
10572/// * [with_credentials()]: by default this client uses
10573/// [Application Default Credentials]. Applications using custom
10574/// authentication may need to override this default.
10575///
10576/// [with_endpoint()]: super::builder::region_backend_buckets::ClientBuilder::with_endpoint
10577/// [with_credentials()]: super::builder::region_backend_buckets::ClientBuilder::with_credentials
10578/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10579/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10580///
10581/// # Pooling and Cloning
10582///
10583/// `RegionBackendBuckets` holds a connection pool internally, it is advised to
10584/// create one and reuse it. You do not need to wrap `RegionBackendBuckets` in
10585/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10586/// already uses an `Arc` internally.
10587#[cfg(feature = "region-backend-buckets")]
10588#[cfg_attr(docsrs, doc(cfg(feature = "region-backend-buckets")))]
10589#[derive(Clone, Debug)]
10590pub struct RegionBackendBuckets {
10591 inner: std::sync::Arc<dyn super::stub::dynamic::RegionBackendBuckets>,
10592}
10593
10594#[cfg(feature = "region-backend-buckets")]
10595impl RegionBackendBuckets {
10596 /// Returns a builder for [RegionBackendBuckets].
10597 ///
10598 /// ```
10599 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10600 /// # use google_cloud_compute_v1::client::RegionBackendBuckets;
10601 /// let client = RegionBackendBuckets::builder().build().await?;
10602 /// # Ok(()) }
10603 /// ```
10604 pub fn builder() -> super::builder::region_backend_buckets::ClientBuilder {
10605 crate::new_client_builder(super::builder::region_backend_buckets::client::Factory)
10606 }
10607
10608 /// Creates a new client from the provided stub.
10609 ///
10610 /// The most common case for calling this function is in tests mocking the
10611 /// client's behavior.
10612 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
10613 where
10614 T: super::stub::RegionBackendBuckets + 'static,
10615 {
10616 Self { inner: stub.into() }
10617 }
10618
10619 pub(crate) async fn new(
10620 config: gaxi::options::ClientConfig,
10621 ) -> crate::ClientBuilderResult<Self> {
10622 let inner = Self::build_inner(config).await?;
10623 Ok(Self { inner })
10624 }
10625
10626 async fn build_inner(
10627 conf: gaxi::options::ClientConfig,
10628 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionBackendBuckets>>
10629 {
10630 if gaxi::options::tracing_enabled(&conf) {
10631 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10632 }
10633 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10634 }
10635
10636 async fn build_transport(
10637 conf: gaxi::options::ClientConfig,
10638 ) -> crate::ClientBuilderResult<impl super::stub::RegionBackendBuckets> {
10639 super::transport::RegionBackendBuckets::new(conf).await
10640 }
10641
10642 async fn build_with_tracing(
10643 conf: gaxi::options::ClientConfig,
10644 ) -> crate::ClientBuilderResult<impl super::stub::RegionBackendBuckets> {
10645 Self::build_transport(conf)
10646 .await
10647 .map(super::tracing::RegionBackendBuckets::new)
10648 }
10649
10650 /// Deletes the specified regional BackendBucket resource.
10651 pub fn delete(&self) -> super::builder::region_backend_buckets::Delete {
10652 super::builder::region_backend_buckets::Delete::new(self.inner.clone())
10653 }
10654
10655 /// Returns the specified regional BackendBucket resource.
10656 pub fn get(&self) -> super::builder::region_backend_buckets::Get {
10657 super::builder::region_backend_buckets::Get::new(self.inner.clone())
10658 }
10659
10660 /// Gets the access control policy for a resource. May be empty if no such
10661 /// policy or resource exists.
10662 pub fn get_iam_policy(&self) -> super::builder::region_backend_buckets::GetIamPolicy {
10663 super::builder::region_backend_buckets::GetIamPolicy::new(self.inner.clone())
10664 }
10665
10666 /// Creates a RegionBackendBucket in the specified project in the given scope
10667 /// using the parameters that are included in the request.
10668 pub fn insert(&self) -> super::builder::region_backend_buckets::Insert {
10669 super::builder::region_backend_buckets::Insert::new(self.inner.clone())
10670 }
10671
10672 /// Retrieves the list of BackendBucket resources available to the specified
10673 /// project in the given region.
10674 pub fn list(&self) -> super::builder::region_backend_buckets::List {
10675 super::builder::region_backend_buckets::List::new(self.inner.clone())
10676 }
10677
10678 /// Retrieves a list of all usable backend buckets in the specified project in
10679 /// the given region.
10680 pub fn list_usable(&self) -> super::builder::region_backend_buckets::ListUsable {
10681 super::builder::region_backend_buckets::ListUsable::new(self.inner.clone())
10682 }
10683
10684 /// Updates the specified BackendBucket resource with the data included in the
10685 /// request. This method supportsPATCH
10686 /// semantics and uses theJSON merge
10687 /// patch format and processing rules.
10688 pub fn patch(&self) -> super::builder::region_backend_buckets::Patch {
10689 super::builder::region_backend_buckets::Patch::new(self.inner.clone())
10690 }
10691
10692 /// Sets the access control policy on the specified resource.
10693 /// Replaces any existing policy.
10694 pub fn set_iam_policy(&self) -> super::builder::region_backend_buckets::SetIamPolicy {
10695 super::builder::region_backend_buckets::SetIamPolicy::new(self.inner.clone())
10696 }
10697
10698 /// Returns permissions that a caller has on the specified resource.
10699 pub fn test_iam_permissions(
10700 &self,
10701 ) -> super::builder::region_backend_buckets::TestIamPermissions {
10702 super::builder::region_backend_buckets::TestIamPermissions::new(self.inner.clone())
10703 }
10704
10705 /// Retrieves the specified region-specific Operations resource.
10706 pub fn get_operation(&self) -> super::builder::region_backend_buckets::GetOperation {
10707 super::builder::region_backend_buckets::GetOperation::new(self.inner.clone())
10708 }
10709}
10710
10711/// Implements a client for the Compute Engine API.
10712///
10713/// # Example
10714/// ```
10715/// # use google_cloud_compute_v1::client::RegionBackendServices;
10716/// async fn sample(
10717/// ) -> anyhow::Result<()> {
10718/// let client = RegionBackendServices::builder().build().await?;
10719/// // use `client` to make requests to the Compute Engine API.
10720/// Ok(())
10721/// }
10722/// ```
10723///
10724/// # Service Description
10725///
10726/// Service for the `regionBackendServices` resource.
10727///
10728/// # Configuration
10729///
10730/// To configure `RegionBackendServices` use the `with_*` methods in the type returned
10731/// by [builder()][RegionBackendServices::builder]. The default configuration should
10732/// work for most applications. Common configuration changes include
10733///
10734/// * [with_endpoint()]: by default this client uses the global default endpoint
10735/// (`https://compute.googleapis.com`). Applications using regional
10736/// endpoints or running in restricted networks (e.g. a network configured
10737/// with [Private Google Access with VPC Service Controls]) may want to
10738/// override this default.
10739/// * [with_credentials()]: by default this client uses
10740/// [Application Default Credentials]. Applications using custom
10741/// authentication may need to override this default.
10742///
10743/// [with_endpoint()]: super::builder::region_backend_services::ClientBuilder::with_endpoint
10744/// [with_credentials()]: super::builder::region_backend_services::ClientBuilder::with_credentials
10745/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10746/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10747///
10748/// # Pooling and Cloning
10749///
10750/// `RegionBackendServices` holds a connection pool internally, it is advised to
10751/// create one and reuse it. You do not need to wrap `RegionBackendServices` in
10752/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10753/// already uses an `Arc` internally.
10754#[cfg(feature = "region-backend-services")]
10755#[cfg_attr(docsrs, doc(cfg(feature = "region-backend-services")))]
10756#[derive(Clone, Debug)]
10757pub struct RegionBackendServices {
10758 inner: std::sync::Arc<dyn super::stub::dynamic::RegionBackendServices>,
10759}
10760
10761#[cfg(feature = "region-backend-services")]
10762impl RegionBackendServices {
10763 /// Returns a builder for [RegionBackendServices].
10764 ///
10765 /// ```
10766 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10767 /// # use google_cloud_compute_v1::client::RegionBackendServices;
10768 /// let client = RegionBackendServices::builder().build().await?;
10769 /// # Ok(()) }
10770 /// ```
10771 pub fn builder() -> super::builder::region_backend_services::ClientBuilder {
10772 crate::new_client_builder(super::builder::region_backend_services::client::Factory)
10773 }
10774
10775 /// Creates a new client from the provided stub.
10776 ///
10777 /// The most common case for calling this function is in tests mocking the
10778 /// client's behavior.
10779 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
10780 where
10781 T: super::stub::RegionBackendServices + 'static,
10782 {
10783 Self { inner: stub.into() }
10784 }
10785
10786 pub(crate) async fn new(
10787 config: gaxi::options::ClientConfig,
10788 ) -> crate::ClientBuilderResult<Self> {
10789 let inner = Self::build_inner(config).await?;
10790 Ok(Self { inner })
10791 }
10792
10793 async fn build_inner(
10794 conf: gaxi::options::ClientConfig,
10795 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionBackendServices>>
10796 {
10797 if gaxi::options::tracing_enabled(&conf) {
10798 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10799 }
10800 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10801 }
10802
10803 async fn build_transport(
10804 conf: gaxi::options::ClientConfig,
10805 ) -> crate::ClientBuilderResult<impl super::stub::RegionBackendServices> {
10806 super::transport::RegionBackendServices::new(conf).await
10807 }
10808
10809 async fn build_with_tracing(
10810 conf: gaxi::options::ClientConfig,
10811 ) -> crate::ClientBuilderResult<impl super::stub::RegionBackendServices> {
10812 Self::build_transport(conf)
10813 .await
10814 .map(super::tracing::RegionBackendServices::new)
10815 }
10816
10817 /// Deletes the specified regional BackendService resource.
10818 pub fn delete(&self) -> super::builder::region_backend_services::Delete {
10819 super::builder::region_backend_services::Delete::new(self.inner.clone())
10820 }
10821
10822 /// Returns the specified regional BackendService resource.
10823 pub fn get(&self) -> super::builder::region_backend_services::Get {
10824 super::builder::region_backend_services::Get::new(self.inner.clone())
10825 }
10826
10827 /// Gets the most recent health check results for this
10828 /// regional BackendService.
10829 pub fn get_health(&self) -> super::builder::region_backend_services::GetHealth {
10830 super::builder::region_backend_services::GetHealth::new(self.inner.clone())
10831 }
10832
10833 /// Gets the access control policy for a resource. May be empty if no such
10834 /// policy or resource exists.
10835 pub fn get_iam_policy(&self) -> super::builder::region_backend_services::GetIamPolicy {
10836 super::builder::region_backend_services::GetIamPolicy::new(self.inner.clone())
10837 }
10838
10839 /// Creates a regional BackendService resource in the specified project using
10840 /// the data included in the request. For more information, see
10841 /// Backend services overview.
10842 pub fn insert(&self) -> super::builder::region_backend_services::Insert {
10843 super::builder::region_backend_services::Insert::new(self.inner.clone())
10844 }
10845
10846 /// Retrieves the list of regional BackendService resources available to the
10847 /// specified project in the given region.
10848 pub fn list(&self) -> super::builder::region_backend_services::List {
10849 super::builder::region_backend_services::List::new(self.inner.clone())
10850 }
10851
10852 /// Retrieves a list of all usable backend services for Application Load
10853 /// Balancers and Proxy Network Load Balancers in the specified project in the
10854 /// given region. Backend services for external and internal passthrough
10855 /// Network Load Balancers are not included in the response.
10856 pub fn list_usable(&self) -> super::builder::region_backend_services::ListUsable {
10857 super::builder::region_backend_services::ListUsable::new(self.inner.clone())
10858 }
10859
10860 /// Updates the specified regional BackendService resource with the data
10861 /// included in the request. For more information, see
10862 /// Understanding backend services This method
10863 /// supports PATCH semantics and uses the JSON merge
10864 /// patch format and processing rules.
10865 pub fn patch(&self) -> super::builder::region_backend_services::Patch {
10866 super::builder::region_backend_services::Patch::new(self.inner.clone())
10867 }
10868
10869 /// Sets the access control policy on the specified resource.
10870 /// Replaces any existing policy.
10871 pub fn set_iam_policy(&self) -> super::builder::region_backend_services::SetIamPolicy {
10872 super::builder::region_backend_services::SetIamPolicy::new(self.inner.clone())
10873 }
10874
10875 /// Sets the Google Cloud Armor security policy for the specified backend
10876 /// service. For more information, seeGoogle
10877 /// Cloud Armor Overview
10878 pub fn set_security_policy(
10879 &self,
10880 ) -> super::builder::region_backend_services::SetSecurityPolicy {
10881 super::builder::region_backend_services::SetSecurityPolicy::new(self.inner.clone())
10882 }
10883
10884 /// Returns permissions that a caller has on the specified resource.
10885 pub fn test_iam_permissions(
10886 &self,
10887 ) -> super::builder::region_backend_services::TestIamPermissions {
10888 super::builder::region_backend_services::TestIamPermissions::new(self.inner.clone())
10889 }
10890
10891 /// Updates the specified regional BackendService resource with the data
10892 /// included in the request. For more information,
10893 /// see
10894 /// Backend services overview.
10895 pub fn update(&self) -> super::builder::region_backend_services::Update {
10896 super::builder::region_backend_services::Update::new(self.inner.clone())
10897 }
10898
10899 /// Retrieves the specified region-specific Operations resource.
10900 pub fn get_operation(&self) -> super::builder::region_backend_services::GetOperation {
10901 super::builder::region_backend_services::GetOperation::new(self.inner.clone())
10902 }
10903}
10904
10905/// Implements a client for the Compute Engine API.
10906///
10907/// # Example
10908/// ```
10909/// # use google_cloud_compute_v1::client::RegionCommitments;
10910/// async fn sample(
10911/// ) -> anyhow::Result<()> {
10912/// let client = RegionCommitments::builder().build().await?;
10913/// // use `client` to make requests to the Compute Engine API.
10914/// Ok(())
10915/// }
10916/// ```
10917///
10918/// # Service Description
10919///
10920/// Service for the `regionCommitments` resource.
10921///
10922/// # Configuration
10923///
10924/// To configure `RegionCommitments` use the `with_*` methods in the type returned
10925/// by [builder()][RegionCommitments::builder]. The default configuration should
10926/// work for most applications. Common configuration changes include
10927///
10928/// * [with_endpoint()]: by default this client uses the global default endpoint
10929/// (`https://compute.googleapis.com`). Applications using regional
10930/// endpoints or running in restricted networks (e.g. a network configured
10931/// with [Private Google Access with VPC Service Controls]) may want to
10932/// override this default.
10933/// * [with_credentials()]: by default this client uses
10934/// [Application Default Credentials]. Applications using custom
10935/// authentication may need to override this default.
10936///
10937/// [with_endpoint()]: super::builder::region_commitments::ClientBuilder::with_endpoint
10938/// [with_credentials()]: super::builder::region_commitments::ClientBuilder::with_credentials
10939/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10940/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10941///
10942/// # Pooling and Cloning
10943///
10944/// `RegionCommitments` holds a connection pool internally, it is advised to
10945/// create one and reuse it. You do not need to wrap `RegionCommitments` in
10946/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10947/// already uses an `Arc` internally.
10948#[cfg(feature = "region-commitments")]
10949#[cfg_attr(docsrs, doc(cfg(feature = "region-commitments")))]
10950#[derive(Clone, Debug)]
10951pub struct RegionCommitments {
10952 inner: std::sync::Arc<dyn super::stub::dynamic::RegionCommitments>,
10953}
10954
10955#[cfg(feature = "region-commitments")]
10956impl RegionCommitments {
10957 /// Returns a builder for [RegionCommitments].
10958 ///
10959 /// ```
10960 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10961 /// # use google_cloud_compute_v1::client::RegionCommitments;
10962 /// let client = RegionCommitments::builder().build().await?;
10963 /// # Ok(()) }
10964 /// ```
10965 pub fn builder() -> super::builder::region_commitments::ClientBuilder {
10966 crate::new_client_builder(super::builder::region_commitments::client::Factory)
10967 }
10968
10969 /// Creates a new client from the provided stub.
10970 ///
10971 /// The most common case for calling this function is in tests mocking the
10972 /// client's behavior.
10973 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
10974 where
10975 T: super::stub::RegionCommitments + 'static,
10976 {
10977 Self { inner: stub.into() }
10978 }
10979
10980 pub(crate) async fn new(
10981 config: gaxi::options::ClientConfig,
10982 ) -> crate::ClientBuilderResult<Self> {
10983 let inner = Self::build_inner(config).await?;
10984 Ok(Self { inner })
10985 }
10986
10987 async fn build_inner(
10988 conf: gaxi::options::ClientConfig,
10989 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionCommitments>>
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::RegionCommitments> {
11000 super::transport::RegionCommitments::new(conf).await
11001 }
11002
11003 async fn build_with_tracing(
11004 conf: gaxi::options::ClientConfig,
11005 ) -> crate::ClientBuilderResult<impl super::stub::RegionCommitments> {
11006 Self::build_transport(conf)
11007 .await
11008 .map(super::tracing::RegionCommitments::new)
11009 }
11010
11011 /// Retrieves an aggregated list of commitments by region.
11012 ///
11013 /// To prevent failure, it is recommended that you set the
11014 /// `returnPartialSuccess` parameter to `true`.
11015 pub fn aggregated_list(&self) -> super::builder::region_commitments::AggregatedList {
11016 super::builder::region_commitments::AggregatedList::new(self.inner.clone())
11017 }
11018
11019 /// Returns the specified commitment resource.
11020 pub fn get(&self) -> super::builder::region_commitments::Get {
11021 super::builder::region_commitments::Get::new(self.inner.clone())
11022 }
11023
11024 /// Creates a commitment in the specified project using the data
11025 /// included in the request.
11026 pub fn insert(&self) -> super::builder::region_commitments::Insert {
11027 super::builder::region_commitments::Insert::new(self.inner.clone())
11028 }
11029
11030 /// Retrieves a list of commitments contained within
11031 /// the specified region.
11032 pub fn list(&self) -> super::builder::region_commitments::List {
11033 super::builder::region_commitments::List::new(self.inner.clone())
11034 }
11035
11036 /// Updates the specified commitment with the data included in the request.
11037 /// Update is performed only on selected fields included as part of
11038 /// update-mask. Only the following fields can be updated: auto_renew and plan.
11039 pub fn update(&self) -> super::builder::region_commitments::Update {
11040 super::builder::region_commitments::Update::new(self.inner.clone())
11041 }
11042
11043 /// Retrieves the specified region-specific Operations resource.
11044 pub fn get_operation(&self) -> super::builder::region_commitments::GetOperation {
11045 super::builder::region_commitments::GetOperation::new(self.inner.clone())
11046 }
11047}
11048
11049/// Implements a client for the Compute Engine API.
11050///
11051/// # Example
11052/// ```
11053/// # use google_cloud_compute_v1::client::RegionCompositeHealthChecks;
11054/// async fn sample(
11055/// ) -> anyhow::Result<()> {
11056/// let client = RegionCompositeHealthChecks::builder().build().await?;
11057/// // use `client` to make requests to the Compute Engine API.
11058/// Ok(())
11059/// }
11060/// ```
11061///
11062/// # Service Description
11063///
11064/// Service for the `regionCompositeHealthChecks` resource.
11065///
11066/// # Configuration
11067///
11068/// To configure `RegionCompositeHealthChecks` use the `with_*` methods in the type returned
11069/// by [builder()][RegionCompositeHealthChecks::builder]. The default configuration should
11070/// work for most applications. Common configuration changes include
11071///
11072/// * [with_endpoint()]: by default this client uses the global default endpoint
11073/// (`https://compute.googleapis.com`). Applications using regional
11074/// endpoints or running in restricted networks (e.g. a network configured
11075/// with [Private Google Access with VPC Service Controls]) may want to
11076/// override this default.
11077/// * [with_credentials()]: by default this client uses
11078/// [Application Default Credentials]. Applications using custom
11079/// authentication may need to override this default.
11080///
11081/// [with_endpoint()]: super::builder::region_composite_health_checks::ClientBuilder::with_endpoint
11082/// [with_credentials()]: super::builder::region_composite_health_checks::ClientBuilder::with_credentials
11083/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11084/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11085///
11086/// # Pooling and Cloning
11087///
11088/// `RegionCompositeHealthChecks` holds a connection pool internally, it is advised to
11089/// create one and reuse it. You do not need to wrap `RegionCompositeHealthChecks` in
11090/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11091/// already uses an `Arc` internally.
11092#[cfg(feature = "region-composite-health-checks")]
11093#[cfg_attr(docsrs, doc(cfg(feature = "region-composite-health-checks")))]
11094#[derive(Clone, Debug)]
11095pub struct RegionCompositeHealthChecks {
11096 inner: std::sync::Arc<dyn super::stub::dynamic::RegionCompositeHealthChecks>,
11097}
11098
11099#[cfg(feature = "region-composite-health-checks")]
11100impl RegionCompositeHealthChecks {
11101 /// Returns a builder for [RegionCompositeHealthChecks].
11102 ///
11103 /// ```
11104 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11105 /// # use google_cloud_compute_v1::client::RegionCompositeHealthChecks;
11106 /// let client = RegionCompositeHealthChecks::builder().build().await?;
11107 /// # Ok(()) }
11108 /// ```
11109 pub fn builder() -> super::builder::region_composite_health_checks::ClientBuilder {
11110 crate::new_client_builder(super::builder::region_composite_health_checks::client::Factory)
11111 }
11112
11113 /// Creates a new client from the provided stub.
11114 ///
11115 /// The most common case for calling this function is in tests mocking the
11116 /// client's behavior.
11117 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
11118 where
11119 T: super::stub::RegionCompositeHealthChecks + 'static,
11120 {
11121 Self { inner: stub.into() }
11122 }
11123
11124 pub(crate) async fn new(
11125 config: gaxi::options::ClientConfig,
11126 ) -> crate::ClientBuilderResult<Self> {
11127 let inner = Self::build_inner(config).await?;
11128 Ok(Self { inner })
11129 }
11130
11131 async fn build_inner(
11132 conf: gaxi::options::ClientConfig,
11133 ) -> crate::ClientBuilderResult<
11134 std::sync::Arc<dyn super::stub::dynamic::RegionCompositeHealthChecks>,
11135 > {
11136 if gaxi::options::tracing_enabled(&conf) {
11137 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11138 }
11139 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11140 }
11141
11142 async fn build_transport(
11143 conf: gaxi::options::ClientConfig,
11144 ) -> crate::ClientBuilderResult<impl super::stub::RegionCompositeHealthChecks> {
11145 super::transport::RegionCompositeHealthChecks::new(conf).await
11146 }
11147
11148 async fn build_with_tracing(
11149 conf: gaxi::options::ClientConfig,
11150 ) -> crate::ClientBuilderResult<impl super::stub::RegionCompositeHealthChecks> {
11151 Self::build_transport(conf)
11152 .await
11153 .map(super::tracing::RegionCompositeHealthChecks::new)
11154 }
11155
11156 /// Retrieves the list of all CompositeHealthCheck resources (all
11157 /// regional) available to the specified project.
11158 ///
11159 /// To prevent failure, it is recommended that you set the
11160 /// `returnPartialSuccess` parameter to `true`.
11161 pub fn aggregated_list(
11162 &self,
11163 ) -> super::builder::region_composite_health_checks::AggregatedList {
11164 super::builder::region_composite_health_checks::AggregatedList::new(self.inner.clone())
11165 }
11166
11167 /// Deletes the specified CompositeHealthCheck in the given region
11168 pub fn delete(&self) -> super::builder::region_composite_health_checks::Delete {
11169 super::builder::region_composite_health_checks::Delete::new(self.inner.clone())
11170 }
11171
11172 /// Returns the specified CompositeHealthCheck resource in the given region.
11173 pub fn get(&self) -> super::builder::region_composite_health_checks::Get {
11174 super::builder::region_composite_health_checks::Get::new(self.inner.clone())
11175 }
11176
11177 /// Gets the most recent health check results for this
11178 /// regional CompositeHealthCheck.
11179 pub fn get_health(&self) -> super::builder::region_composite_health_checks::GetHealth {
11180 super::builder::region_composite_health_checks::GetHealth::new(self.inner.clone())
11181 }
11182
11183 /// Create a CompositeHealthCheck in the specified project in the given region
11184 /// using the parameters that are included in the request.
11185 pub fn insert(&self) -> super::builder::region_composite_health_checks::Insert {
11186 super::builder::region_composite_health_checks::Insert::new(self.inner.clone())
11187 }
11188
11189 /// Lists the CompositeHealthChecks for a project in the given region.
11190 pub fn list(&self) -> super::builder::region_composite_health_checks::List {
11191 super::builder::region_composite_health_checks::List::new(self.inner.clone())
11192 }
11193
11194 /// Updates the specified regional CompositeHealthCheck resource
11195 /// with the data included in the request. This method supportsPATCH
11196 /// semantics and uses theJSON merge
11197 /// patch format and processing rules.
11198 pub fn patch(&self) -> super::builder::region_composite_health_checks::Patch {
11199 super::builder::region_composite_health_checks::Patch::new(self.inner.clone())
11200 }
11201
11202 /// Returns permissions that a caller has on the specified resource.
11203 pub fn test_iam_permissions(
11204 &self,
11205 ) -> super::builder::region_composite_health_checks::TestIamPermissions {
11206 super::builder::region_composite_health_checks::TestIamPermissions::new(self.inner.clone())
11207 }
11208
11209 /// Retrieves the specified region-specific Operations resource.
11210 pub fn get_operation(&self) -> super::builder::region_composite_health_checks::GetOperation {
11211 super::builder::region_composite_health_checks::GetOperation::new(self.inner.clone())
11212 }
11213}
11214
11215/// Implements a client for the Compute Engine API.
11216///
11217/// # Example
11218/// ```
11219/// # use google_cloud_compute_v1::client::RegionDiskTypes;
11220/// async fn sample(
11221/// ) -> anyhow::Result<()> {
11222/// let client = RegionDiskTypes::builder().build().await?;
11223/// // use `client` to make requests to the Compute Engine API.
11224/// Ok(())
11225/// }
11226/// ```
11227///
11228/// # Service Description
11229///
11230/// Service for the `regionDiskTypes` resource.
11231///
11232/// # Configuration
11233///
11234/// To configure `RegionDiskTypes` use the `with_*` methods in the type returned
11235/// by [builder()][RegionDiskTypes::builder]. The default configuration should
11236/// work for most applications. Common configuration changes include
11237///
11238/// * [with_endpoint()]: by default this client uses the global default endpoint
11239/// (`https://compute.googleapis.com`). Applications using regional
11240/// endpoints or running in restricted networks (e.g. a network configured
11241/// with [Private Google Access with VPC Service Controls]) may want to
11242/// override this default.
11243/// * [with_credentials()]: by default this client uses
11244/// [Application Default Credentials]. Applications using custom
11245/// authentication may need to override this default.
11246///
11247/// [with_endpoint()]: super::builder::region_disk_types::ClientBuilder::with_endpoint
11248/// [with_credentials()]: super::builder::region_disk_types::ClientBuilder::with_credentials
11249/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11250/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11251///
11252/// # Pooling and Cloning
11253///
11254/// `RegionDiskTypes` holds a connection pool internally, it is advised to
11255/// create one and reuse it. You do not need to wrap `RegionDiskTypes` in
11256/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11257/// already uses an `Arc` internally.
11258#[cfg(feature = "region-disk-types")]
11259#[cfg_attr(docsrs, doc(cfg(feature = "region-disk-types")))]
11260#[derive(Clone, Debug)]
11261pub struct RegionDiskTypes {
11262 inner: std::sync::Arc<dyn super::stub::dynamic::RegionDiskTypes>,
11263}
11264
11265#[cfg(feature = "region-disk-types")]
11266impl RegionDiskTypes {
11267 /// Returns a builder for [RegionDiskTypes].
11268 ///
11269 /// ```
11270 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11271 /// # use google_cloud_compute_v1::client::RegionDiskTypes;
11272 /// let client = RegionDiskTypes::builder().build().await?;
11273 /// # Ok(()) }
11274 /// ```
11275 pub fn builder() -> super::builder::region_disk_types::ClientBuilder {
11276 crate::new_client_builder(super::builder::region_disk_types::client::Factory)
11277 }
11278
11279 /// Creates a new client from the provided stub.
11280 ///
11281 /// The most common case for calling this function is in tests mocking the
11282 /// client's behavior.
11283 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
11284 where
11285 T: super::stub::RegionDiskTypes + 'static,
11286 {
11287 Self { inner: stub.into() }
11288 }
11289
11290 pub(crate) async fn new(
11291 config: gaxi::options::ClientConfig,
11292 ) -> crate::ClientBuilderResult<Self> {
11293 let inner = Self::build_inner(config).await?;
11294 Ok(Self { inner })
11295 }
11296
11297 async fn build_inner(
11298 conf: gaxi::options::ClientConfig,
11299 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionDiskTypes>> {
11300 if gaxi::options::tracing_enabled(&conf) {
11301 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11302 }
11303 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11304 }
11305
11306 async fn build_transport(
11307 conf: gaxi::options::ClientConfig,
11308 ) -> crate::ClientBuilderResult<impl super::stub::RegionDiskTypes> {
11309 super::transport::RegionDiskTypes::new(conf).await
11310 }
11311
11312 async fn build_with_tracing(
11313 conf: gaxi::options::ClientConfig,
11314 ) -> crate::ClientBuilderResult<impl super::stub::RegionDiskTypes> {
11315 Self::build_transport(conf)
11316 .await
11317 .map(super::tracing::RegionDiskTypes::new)
11318 }
11319
11320 /// Returns the specified regional disk type.
11321 pub fn get(&self) -> super::builder::region_disk_types::Get {
11322 super::builder::region_disk_types::Get::new(self.inner.clone())
11323 }
11324
11325 /// Retrieves a list of regional disk types available to the specified project.
11326 pub fn list(&self) -> super::builder::region_disk_types::List {
11327 super::builder::region_disk_types::List::new(self.inner.clone())
11328 }
11329}
11330
11331/// Implements a client for the Compute Engine API.
11332///
11333/// # Example
11334/// ```
11335/// # use google_cloud_compute_v1::client::RegionDisks;
11336/// async fn sample(
11337/// ) -> anyhow::Result<()> {
11338/// let client = RegionDisks::builder().build().await?;
11339/// // use `client` to make requests to the Compute Engine API.
11340/// Ok(())
11341/// }
11342/// ```
11343///
11344/// # Service Description
11345///
11346/// Service for the `regionDisks` resource.
11347///
11348/// # Configuration
11349///
11350/// To configure `RegionDisks` use the `with_*` methods in the type returned
11351/// by [builder()][RegionDisks::builder]. The default configuration should
11352/// work for most applications. Common configuration changes include
11353///
11354/// * [with_endpoint()]: by default this client uses the global default endpoint
11355/// (`https://compute.googleapis.com`). Applications using regional
11356/// endpoints or running in restricted networks (e.g. a network configured
11357/// with [Private Google Access with VPC Service Controls]) may want to
11358/// override this default.
11359/// * [with_credentials()]: by default this client uses
11360/// [Application Default Credentials]. Applications using custom
11361/// authentication may need to override this default.
11362///
11363/// [with_endpoint()]: super::builder::region_disks::ClientBuilder::with_endpoint
11364/// [with_credentials()]: super::builder::region_disks::ClientBuilder::with_credentials
11365/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11366/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11367///
11368/// # Pooling and Cloning
11369///
11370/// `RegionDisks` holds a connection pool internally, it is advised to
11371/// create one and reuse it. You do not need to wrap `RegionDisks` in
11372/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11373/// already uses an `Arc` internally.
11374#[cfg(feature = "region-disks")]
11375#[cfg_attr(docsrs, doc(cfg(feature = "region-disks")))]
11376#[derive(Clone, Debug)]
11377pub struct RegionDisks {
11378 inner: std::sync::Arc<dyn super::stub::dynamic::RegionDisks>,
11379}
11380
11381#[cfg(feature = "region-disks")]
11382impl RegionDisks {
11383 /// Returns a builder for [RegionDisks].
11384 ///
11385 /// ```
11386 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11387 /// # use google_cloud_compute_v1::client::RegionDisks;
11388 /// let client = RegionDisks::builder().build().await?;
11389 /// # Ok(()) }
11390 /// ```
11391 pub fn builder() -> super::builder::region_disks::ClientBuilder {
11392 crate::new_client_builder(super::builder::region_disks::client::Factory)
11393 }
11394
11395 /// Creates a new client from the provided stub.
11396 ///
11397 /// The most common case for calling this function is in tests mocking the
11398 /// client's behavior.
11399 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
11400 where
11401 T: super::stub::RegionDisks + 'static,
11402 {
11403 Self { inner: stub.into() }
11404 }
11405
11406 pub(crate) async fn new(
11407 config: gaxi::options::ClientConfig,
11408 ) -> crate::ClientBuilderResult<Self> {
11409 let inner = Self::build_inner(config).await?;
11410 Ok(Self { inner })
11411 }
11412
11413 async fn build_inner(
11414 conf: gaxi::options::ClientConfig,
11415 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionDisks>> {
11416 if gaxi::options::tracing_enabled(&conf) {
11417 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11418 }
11419 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11420 }
11421
11422 async fn build_transport(
11423 conf: gaxi::options::ClientConfig,
11424 ) -> crate::ClientBuilderResult<impl super::stub::RegionDisks> {
11425 super::transport::RegionDisks::new(conf).await
11426 }
11427
11428 async fn build_with_tracing(
11429 conf: gaxi::options::ClientConfig,
11430 ) -> crate::ClientBuilderResult<impl super::stub::RegionDisks> {
11431 Self::build_transport(conf)
11432 .await
11433 .map(super::tracing::RegionDisks::new)
11434 }
11435
11436 /// Adds existing resource policies to a regional disk. You can only add one
11437 /// policy which will be applied to this disk for scheduling snapshot
11438 /// creation.
11439 pub fn add_resource_policies(&self) -> super::builder::region_disks::AddResourcePolicies {
11440 super::builder::region_disks::AddResourcePolicies::new(self.inner.clone())
11441 }
11442
11443 /// Bulk create a set of disks.
11444 pub fn bulk_insert(&self) -> super::builder::region_disks::BulkInsert {
11445 super::builder::region_disks::BulkInsert::new(self.inner.clone())
11446 }
11447
11448 /// Creates a snapshot of a specified persistent disk. For regular snapshot
11449 /// creation, consider using snapshots.insert
11450 /// instead, as that method supports more features, such as creating snapshots
11451 /// in a project different from the source disk project.
11452 pub fn create_snapshot(&self) -> super::builder::region_disks::CreateSnapshot {
11453 super::builder::region_disks::CreateSnapshot::new(self.inner.clone())
11454 }
11455
11456 /// Deletes the specified regional persistent disk. Deleting a regional disk
11457 /// removes all the replicas of its data permanently and is irreversible.
11458 /// However, deleting a disk does not delete anysnapshots
11459 /// previously made from the disk. You must separatelydelete
11460 /// snapshots.
11461 pub fn delete(&self) -> super::builder::region_disks::Delete {
11462 super::builder::region_disks::Delete::new(self.inner.clone())
11463 }
11464
11465 /// Returns a specified regional persistent disk.
11466 pub fn get(&self) -> super::builder::region_disks::Get {
11467 super::builder::region_disks::Get::new(self.inner.clone())
11468 }
11469
11470 /// Gets the access control policy for a resource. May be empty if no such
11471 /// policy or resource exists.
11472 pub fn get_iam_policy(&self) -> super::builder::region_disks::GetIamPolicy {
11473 super::builder::region_disks::GetIamPolicy::new(self.inner.clone())
11474 }
11475
11476 /// Creates a persistent regional disk in the specified project using the data
11477 /// included in the request.
11478 pub fn insert(&self) -> super::builder::region_disks::Insert {
11479 super::builder::region_disks::Insert::new(self.inner.clone())
11480 }
11481
11482 /// Retrieves the list of persistent disks contained within
11483 /// the specified region.
11484 pub fn list(&self) -> super::builder::region_disks::List {
11485 super::builder::region_disks::List::new(self.inner.clone())
11486 }
11487
11488 /// Removes resource policies from a regional disk.
11489 pub fn remove_resource_policies(&self) -> super::builder::region_disks::RemoveResourcePolicies {
11490 super::builder::region_disks::RemoveResourcePolicies::new(self.inner.clone())
11491 }
11492
11493 /// Resizes the specified regional persistent disk.
11494 pub fn resize(&self) -> super::builder::region_disks::Resize {
11495 super::builder::region_disks::Resize::new(self.inner.clone())
11496 }
11497
11498 /// Sets the access control policy on the specified resource.
11499 /// Replaces any existing policy.
11500 pub fn set_iam_policy(&self) -> super::builder::region_disks::SetIamPolicy {
11501 super::builder::region_disks::SetIamPolicy::new(self.inner.clone())
11502 }
11503
11504 /// Sets the labels on the target regional disk.
11505 pub fn set_labels(&self) -> super::builder::region_disks::SetLabels {
11506 super::builder::region_disks::SetLabels::new(self.inner.clone())
11507 }
11508
11509 /// Starts asynchronous replication.
11510 /// Must be invoked on the primary disk.
11511 pub fn start_async_replication(&self) -> super::builder::region_disks::StartAsyncReplication {
11512 super::builder::region_disks::StartAsyncReplication::new(self.inner.clone())
11513 }
11514
11515 /// Stops asynchronous replication.
11516 /// Can be invoked either on the primary or on the secondary disk.
11517 pub fn stop_async_replication(&self) -> super::builder::region_disks::StopAsyncReplication {
11518 super::builder::region_disks::StopAsyncReplication::new(self.inner.clone())
11519 }
11520
11521 /// Stops asynchronous replication for a consistency group of disks.
11522 /// Can be invoked either in the primary or secondary scope.
11523 pub fn stop_group_async_replication(
11524 &self,
11525 ) -> super::builder::region_disks::StopGroupAsyncReplication {
11526 super::builder::region_disks::StopGroupAsyncReplication::new(self.inner.clone())
11527 }
11528
11529 /// Returns permissions that a caller has on the specified resource.
11530 pub fn test_iam_permissions(&self) -> super::builder::region_disks::TestIamPermissions {
11531 super::builder::region_disks::TestIamPermissions::new(self.inner.clone())
11532 }
11533
11534 /// Update the specified disk with the data included in the request. Update is
11535 /// performed only on selected fields included as part of update-mask.
11536 pub fn update(&self) -> super::builder::region_disks::Update {
11537 super::builder::region_disks::Update::new(self.inner.clone())
11538 }
11539
11540 /// Rotates the customer-managed
11541 /// encryption key to the latest version for the specified persistent disk.
11542 pub fn update_kms_key(&self) -> super::builder::region_disks::UpdateKmsKey {
11543 super::builder::region_disks::UpdateKmsKey::new(self.inner.clone())
11544 }
11545
11546 /// Retrieves the specified region-specific Operations resource.
11547 pub fn get_operation(&self) -> super::builder::region_disks::GetOperation {
11548 super::builder::region_disks::GetOperation::new(self.inner.clone())
11549 }
11550}
11551
11552/// Implements a client for the Compute Engine API.
11553///
11554/// # Example
11555/// ```
11556/// # use google_cloud_compute_v1::client::RegionHealthAggregationPolicies;
11557/// async fn sample(
11558/// ) -> anyhow::Result<()> {
11559/// let client = RegionHealthAggregationPolicies::builder().build().await?;
11560/// // use `client` to make requests to the Compute Engine API.
11561/// Ok(())
11562/// }
11563/// ```
11564///
11565/// # Service Description
11566///
11567/// Service for the `regionHealthAggregationPolicies` resource.
11568///
11569/// # Configuration
11570///
11571/// To configure `RegionHealthAggregationPolicies` use the `with_*` methods in the type returned
11572/// by [builder()][RegionHealthAggregationPolicies::builder]. The default configuration should
11573/// work for most applications. Common configuration changes include
11574///
11575/// * [with_endpoint()]: by default this client uses the global default endpoint
11576/// (`https://compute.googleapis.com`). Applications using regional
11577/// endpoints or running in restricted networks (e.g. a network configured
11578/// with [Private Google Access with VPC Service Controls]) may want to
11579/// override this default.
11580/// * [with_credentials()]: by default this client uses
11581/// [Application Default Credentials]. Applications using custom
11582/// authentication may need to override this default.
11583///
11584/// [with_endpoint()]: super::builder::region_health_aggregation_policies::ClientBuilder::with_endpoint
11585/// [with_credentials()]: super::builder::region_health_aggregation_policies::ClientBuilder::with_credentials
11586/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11587/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11588///
11589/// # Pooling and Cloning
11590///
11591/// `RegionHealthAggregationPolicies` holds a connection pool internally, it is advised to
11592/// create one and reuse it. You do not need to wrap `RegionHealthAggregationPolicies` in
11593/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11594/// already uses an `Arc` internally.
11595#[cfg(feature = "region-health-aggregation-policies")]
11596#[cfg_attr(docsrs, doc(cfg(feature = "region-health-aggregation-policies")))]
11597#[derive(Clone, Debug)]
11598pub struct RegionHealthAggregationPolicies {
11599 inner: std::sync::Arc<dyn super::stub::dynamic::RegionHealthAggregationPolicies>,
11600}
11601
11602#[cfg(feature = "region-health-aggregation-policies")]
11603impl RegionHealthAggregationPolicies {
11604 /// Returns a builder for [RegionHealthAggregationPolicies].
11605 ///
11606 /// ```
11607 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11608 /// # use google_cloud_compute_v1::client::RegionHealthAggregationPolicies;
11609 /// let client = RegionHealthAggregationPolicies::builder().build().await?;
11610 /// # Ok(()) }
11611 /// ```
11612 pub fn builder() -> super::builder::region_health_aggregation_policies::ClientBuilder {
11613 crate::new_client_builder(
11614 super::builder::region_health_aggregation_policies::client::Factory,
11615 )
11616 }
11617
11618 /// Creates a new client from the provided stub.
11619 ///
11620 /// The most common case for calling this function is in tests mocking the
11621 /// client's behavior.
11622 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
11623 where
11624 T: super::stub::RegionHealthAggregationPolicies + 'static,
11625 {
11626 Self { inner: stub.into() }
11627 }
11628
11629 pub(crate) async fn new(
11630 config: gaxi::options::ClientConfig,
11631 ) -> crate::ClientBuilderResult<Self> {
11632 let inner = Self::build_inner(config).await?;
11633 Ok(Self { inner })
11634 }
11635
11636 async fn build_inner(
11637 conf: gaxi::options::ClientConfig,
11638 ) -> crate::ClientBuilderResult<
11639 std::sync::Arc<dyn super::stub::dynamic::RegionHealthAggregationPolicies>,
11640 > {
11641 if gaxi::options::tracing_enabled(&conf) {
11642 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11643 }
11644 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11645 }
11646
11647 async fn build_transport(
11648 conf: gaxi::options::ClientConfig,
11649 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthAggregationPolicies> {
11650 super::transport::RegionHealthAggregationPolicies::new(conf).await
11651 }
11652
11653 async fn build_with_tracing(
11654 conf: gaxi::options::ClientConfig,
11655 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthAggregationPolicies> {
11656 Self::build_transport(conf)
11657 .await
11658 .map(super::tracing::RegionHealthAggregationPolicies::new)
11659 }
11660
11661 /// Retrieves the list of all HealthAggregationPolicy resources,
11662 /// regional and global, available to the specified project.
11663 ///
11664 /// To prevent failure, it is recommended that you set the
11665 /// `returnPartialSuccess` parameter to `true`.
11666 pub fn aggregated_list(
11667 &self,
11668 ) -> super::builder::region_health_aggregation_policies::AggregatedList {
11669 super::builder::region_health_aggregation_policies::AggregatedList::new(self.inner.clone())
11670 }
11671
11672 /// Deletes the specified HealthAggregationPolicy in the given region.
11673 pub fn delete(&self) -> super::builder::region_health_aggregation_policies::Delete {
11674 super::builder::region_health_aggregation_policies::Delete::new(self.inner.clone())
11675 }
11676
11677 /// Returns the specified HealthAggregationPolicy resource in the given region.
11678 pub fn get(&self) -> super::builder::region_health_aggregation_policies::Get {
11679 super::builder::region_health_aggregation_policies::Get::new(self.inner.clone())
11680 }
11681
11682 /// Create a HealthAggregationPolicy in the specified project in the given
11683 /// region using the parameters that are included in the request.
11684 pub fn insert(&self) -> super::builder::region_health_aggregation_policies::Insert {
11685 super::builder::region_health_aggregation_policies::Insert::new(self.inner.clone())
11686 }
11687
11688 /// Lists the HealthAggregationPolicies for a project in the given region.
11689 pub fn list(&self) -> super::builder::region_health_aggregation_policies::List {
11690 super::builder::region_health_aggregation_policies::List::new(self.inner.clone())
11691 }
11692
11693 /// Updates the specified regional HealthAggregationPolicy
11694 /// resource with the data included in the request. This method supportsPATCH
11695 /// semantics and uses theJSON merge
11696 /// patch format and processing rules.
11697 pub fn patch(&self) -> super::builder::region_health_aggregation_policies::Patch {
11698 super::builder::region_health_aggregation_policies::Patch::new(self.inner.clone())
11699 }
11700
11701 /// Returns permissions that a caller has on the specified resource.
11702 pub fn test_iam_permissions(
11703 &self,
11704 ) -> super::builder::region_health_aggregation_policies::TestIamPermissions {
11705 super::builder::region_health_aggregation_policies::TestIamPermissions::new(
11706 self.inner.clone(),
11707 )
11708 }
11709
11710 /// Retrieves the specified region-specific Operations resource.
11711 pub fn get_operation(
11712 &self,
11713 ) -> super::builder::region_health_aggregation_policies::GetOperation {
11714 super::builder::region_health_aggregation_policies::GetOperation::new(self.inner.clone())
11715 }
11716}
11717
11718/// Implements a client for the Compute Engine API.
11719///
11720/// # Example
11721/// ```
11722/// # use google_cloud_compute_v1::client::RegionHealthCheckServices;
11723/// async fn sample(
11724/// ) -> anyhow::Result<()> {
11725/// let client = RegionHealthCheckServices::builder().build().await?;
11726/// // use `client` to make requests to the Compute Engine API.
11727/// Ok(())
11728/// }
11729/// ```
11730///
11731/// # Service Description
11732///
11733/// Service for the `regionHealthCheckServices` resource.
11734///
11735/// # Configuration
11736///
11737/// To configure `RegionHealthCheckServices` use the `with_*` methods in the type returned
11738/// by [builder()][RegionHealthCheckServices::builder]. The default configuration should
11739/// work for most applications. Common configuration changes include
11740///
11741/// * [with_endpoint()]: by default this client uses the global default endpoint
11742/// (`https://compute.googleapis.com`). Applications using regional
11743/// endpoints or running in restricted networks (e.g. a network configured
11744/// with [Private Google Access with VPC Service Controls]) may want to
11745/// override this default.
11746/// * [with_credentials()]: by default this client uses
11747/// [Application Default Credentials]. Applications using custom
11748/// authentication may need to override this default.
11749///
11750/// [with_endpoint()]: super::builder::region_health_check_services::ClientBuilder::with_endpoint
11751/// [with_credentials()]: super::builder::region_health_check_services::ClientBuilder::with_credentials
11752/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11753/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11754///
11755/// # Pooling and Cloning
11756///
11757/// `RegionHealthCheckServices` holds a connection pool internally, it is advised to
11758/// create one and reuse it. You do not need to wrap `RegionHealthCheckServices` in
11759/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11760/// already uses an `Arc` internally.
11761#[cfg(feature = "region-health-check-services")]
11762#[cfg_attr(docsrs, doc(cfg(feature = "region-health-check-services")))]
11763#[derive(Clone, Debug)]
11764pub struct RegionHealthCheckServices {
11765 inner: std::sync::Arc<dyn super::stub::dynamic::RegionHealthCheckServices>,
11766}
11767
11768#[cfg(feature = "region-health-check-services")]
11769impl RegionHealthCheckServices {
11770 /// Returns a builder for [RegionHealthCheckServices].
11771 ///
11772 /// ```
11773 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11774 /// # use google_cloud_compute_v1::client::RegionHealthCheckServices;
11775 /// let client = RegionHealthCheckServices::builder().build().await?;
11776 /// # Ok(()) }
11777 /// ```
11778 pub fn builder() -> super::builder::region_health_check_services::ClientBuilder {
11779 crate::new_client_builder(super::builder::region_health_check_services::client::Factory)
11780 }
11781
11782 /// Creates a new client from the provided stub.
11783 ///
11784 /// The most common case for calling this function is in tests mocking the
11785 /// client's behavior.
11786 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
11787 where
11788 T: super::stub::RegionHealthCheckServices + 'static,
11789 {
11790 Self { inner: stub.into() }
11791 }
11792
11793 pub(crate) async fn new(
11794 config: gaxi::options::ClientConfig,
11795 ) -> crate::ClientBuilderResult<Self> {
11796 let inner = Self::build_inner(config).await?;
11797 Ok(Self { inner })
11798 }
11799
11800 async fn build_inner(
11801 conf: gaxi::options::ClientConfig,
11802 ) -> crate::ClientBuilderResult<
11803 std::sync::Arc<dyn super::stub::dynamic::RegionHealthCheckServices>,
11804 > {
11805 if gaxi::options::tracing_enabled(&conf) {
11806 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11807 }
11808 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11809 }
11810
11811 async fn build_transport(
11812 conf: gaxi::options::ClientConfig,
11813 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthCheckServices> {
11814 super::transport::RegionHealthCheckServices::new(conf).await
11815 }
11816
11817 async fn build_with_tracing(
11818 conf: gaxi::options::ClientConfig,
11819 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthCheckServices> {
11820 Self::build_transport(conf)
11821 .await
11822 .map(super::tracing::RegionHealthCheckServices::new)
11823 }
11824
11825 /// Retrieves the list of all HealthCheckService resources,
11826 /// regional and global, available to the specified project.
11827 ///
11828 /// To prevent failure, it is recommended that you set the
11829 /// `returnPartialSuccess` parameter to `true`.
11830 pub fn aggregated_list(&self) -> super::builder::region_health_check_services::AggregatedList {
11831 super::builder::region_health_check_services::AggregatedList::new(self.inner.clone())
11832 }
11833
11834 /// Deletes the specified regional HealthCheckService.
11835 pub fn delete(&self) -> super::builder::region_health_check_services::Delete {
11836 super::builder::region_health_check_services::Delete::new(self.inner.clone())
11837 }
11838
11839 /// Returns the specified regional HealthCheckService resource.
11840 pub fn get(&self) -> super::builder::region_health_check_services::Get {
11841 super::builder::region_health_check_services::Get::new(self.inner.clone())
11842 }
11843
11844 /// Creates a regional HealthCheckService resource in the
11845 /// specified project and region using the data included in the request.
11846 pub fn insert(&self) -> super::builder::region_health_check_services::Insert {
11847 super::builder::region_health_check_services::Insert::new(self.inner.clone())
11848 }
11849
11850 /// Lists all the HealthCheckService resources that have been
11851 /// configured for the specified project in the given region.
11852 pub fn list(&self) -> super::builder::region_health_check_services::List {
11853 super::builder::region_health_check_services::List::new(self.inner.clone())
11854 }
11855
11856 /// Updates the specified regional HealthCheckService resource
11857 /// with the data included in the request. This method supportsPATCH
11858 /// semantics and uses theJSON merge
11859 /// patch format and processing rules.
11860 pub fn patch(&self) -> super::builder::region_health_check_services::Patch {
11861 super::builder::region_health_check_services::Patch::new(self.inner.clone())
11862 }
11863
11864 /// Returns permissions that a caller has on the specified resource.
11865 pub fn test_iam_permissions(
11866 &self,
11867 ) -> super::builder::region_health_check_services::TestIamPermissions {
11868 super::builder::region_health_check_services::TestIamPermissions::new(self.inner.clone())
11869 }
11870
11871 /// Retrieves the specified region-specific Operations resource.
11872 pub fn get_operation(&self) -> super::builder::region_health_check_services::GetOperation {
11873 super::builder::region_health_check_services::GetOperation::new(self.inner.clone())
11874 }
11875}
11876
11877/// Implements a client for the Compute Engine API.
11878///
11879/// # Example
11880/// ```
11881/// # use google_cloud_compute_v1::client::RegionHealthChecks;
11882/// async fn sample(
11883/// ) -> anyhow::Result<()> {
11884/// let client = RegionHealthChecks::builder().build().await?;
11885/// // use `client` to make requests to the Compute Engine API.
11886/// Ok(())
11887/// }
11888/// ```
11889///
11890/// # Service Description
11891///
11892/// Service for the `regionHealthChecks` resource.
11893///
11894/// # Configuration
11895///
11896/// To configure `RegionHealthChecks` use the `with_*` methods in the type returned
11897/// by [builder()][RegionHealthChecks::builder]. The default configuration should
11898/// work for most applications. Common configuration changes include
11899///
11900/// * [with_endpoint()]: by default this client uses the global default endpoint
11901/// (`https://compute.googleapis.com`). Applications using regional
11902/// endpoints or running in restricted networks (e.g. a network configured
11903/// with [Private Google Access with VPC Service Controls]) may want to
11904/// override this default.
11905/// * [with_credentials()]: by default this client uses
11906/// [Application Default Credentials]. Applications using custom
11907/// authentication may need to override this default.
11908///
11909/// [with_endpoint()]: super::builder::region_health_checks::ClientBuilder::with_endpoint
11910/// [with_credentials()]: super::builder::region_health_checks::ClientBuilder::with_credentials
11911/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11912/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11913///
11914/// # Pooling and Cloning
11915///
11916/// `RegionHealthChecks` holds a connection pool internally, it is advised to
11917/// create one and reuse it. You do not need to wrap `RegionHealthChecks` in
11918/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11919/// already uses an `Arc` internally.
11920#[cfg(feature = "region-health-checks")]
11921#[cfg_attr(docsrs, doc(cfg(feature = "region-health-checks")))]
11922#[derive(Clone, Debug)]
11923pub struct RegionHealthChecks {
11924 inner: std::sync::Arc<dyn super::stub::dynamic::RegionHealthChecks>,
11925}
11926
11927#[cfg(feature = "region-health-checks")]
11928impl RegionHealthChecks {
11929 /// Returns a builder for [RegionHealthChecks].
11930 ///
11931 /// ```
11932 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11933 /// # use google_cloud_compute_v1::client::RegionHealthChecks;
11934 /// let client = RegionHealthChecks::builder().build().await?;
11935 /// # Ok(()) }
11936 /// ```
11937 pub fn builder() -> super::builder::region_health_checks::ClientBuilder {
11938 crate::new_client_builder(super::builder::region_health_checks::client::Factory)
11939 }
11940
11941 /// Creates a new client from the provided stub.
11942 ///
11943 /// The most common case for calling this function is in tests mocking the
11944 /// client's behavior.
11945 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
11946 where
11947 T: super::stub::RegionHealthChecks + 'static,
11948 {
11949 Self { inner: stub.into() }
11950 }
11951
11952 pub(crate) async fn new(
11953 config: gaxi::options::ClientConfig,
11954 ) -> crate::ClientBuilderResult<Self> {
11955 let inner = Self::build_inner(config).await?;
11956 Ok(Self { inner })
11957 }
11958
11959 async fn build_inner(
11960 conf: gaxi::options::ClientConfig,
11961 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionHealthChecks>>
11962 {
11963 if gaxi::options::tracing_enabled(&conf) {
11964 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11965 }
11966 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11967 }
11968
11969 async fn build_transport(
11970 conf: gaxi::options::ClientConfig,
11971 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthChecks> {
11972 super::transport::RegionHealthChecks::new(conf).await
11973 }
11974
11975 async fn build_with_tracing(
11976 conf: gaxi::options::ClientConfig,
11977 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthChecks> {
11978 Self::build_transport(conf)
11979 .await
11980 .map(super::tracing::RegionHealthChecks::new)
11981 }
11982
11983 /// Deletes the specified HealthCheck resource.
11984 pub fn delete(&self) -> super::builder::region_health_checks::Delete {
11985 super::builder::region_health_checks::Delete::new(self.inner.clone())
11986 }
11987
11988 /// Returns the specified HealthCheck resource.
11989 pub fn get(&self) -> super::builder::region_health_checks::Get {
11990 super::builder::region_health_checks::Get::new(self.inner.clone())
11991 }
11992
11993 /// Creates a HealthCheck resource in the specified project using the data
11994 /// included in the request.
11995 pub fn insert(&self) -> super::builder::region_health_checks::Insert {
11996 super::builder::region_health_checks::Insert::new(self.inner.clone())
11997 }
11998
11999 /// Retrieves the list of HealthCheck resources available to the specified
12000 /// project.
12001 pub fn list(&self) -> super::builder::region_health_checks::List {
12002 super::builder::region_health_checks::List::new(self.inner.clone())
12003 }
12004
12005 /// Updates a HealthCheck resource in the specified project using the data
12006 /// included in the request. This method supportsPATCH
12007 /// semantics and uses theJSON merge
12008 /// patch format and processing rules.
12009 pub fn patch(&self) -> super::builder::region_health_checks::Patch {
12010 super::builder::region_health_checks::Patch::new(self.inner.clone())
12011 }
12012
12013 /// Returns permissions that a caller has on the specified resource.
12014 pub fn test_iam_permissions(&self) -> super::builder::region_health_checks::TestIamPermissions {
12015 super::builder::region_health_checks::TestIamPermissions::new(self.inner.clone())
12016 }
12017
12018 /// Updates a HealthCheck resource in the specified project using the data
12019 /// included in the request.
12020 pub fn update(&self) -> super::builder::region_health_checks::Update {
12021 super::builder::region_health_checks::Update::new(self.inner.clone())
12022 }
12023
12024 /// Retrieves the specified region-specific Operations resource.
12025 pub fn get_operation(&self) -> super::builder::region_health_checks::GetOperation {
12026 super::builder::region_health_checks::GetOperation::new(self.inner.clone())
12027 }
12028}
12029
12030/// Implements a client for the Compute Engine API.
12031///
12032/// # Example
12033/// ```
12034/// # use google_cloud_compute_v1::client::RegionHealthSources;
12035/// async fn sample(
12036/// ) -> anyhow::Result<()> {
12037/// let client = RegionHealthSources::builder().build().await?;
12038/// // use `client` to make requests to the Compute Engine API.
12039/// Ok(())
12040/// }
12041/// ```
12042///
12043/// # Service Description
12044///
12045/// Service for the `regionHealthSources` resource.
12046///
12047/// # Configuration
12048///
12049/// To configure `RegionHealthSources` use the `with_*` methods in the type returned
12050/// by [builder()][RegionHealthSources::builder]. The default configuration should
12051/// work for most applications. Common configuration changes include
12052///
12053/// * [with_endpoint()]: by default this client uses the global default endpoint
12054/// (`https://compute.googleapis.com`). Applications using regional
12055/// endpoints or running in restricted networks (e.g. a network configured
12056/// with [Private Google Access with VPC Service Controls]) may want to
12057/// override this default.
12058/// * [with_credentials()]: by default this client uses
12059/// [Application Default Credentials]. Applications using custom
12060/// authentication may need to override this default.
12061///
12062/// [with_endpoint()]: super::builder::region_health_sources::ClientBuilder::with_endpoint
12063/// [with_credentials()]: super::builder::region_health_sources::ClientBuilder::with_credentials
12064/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12065/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12066///
12067/// # Pooling and Cloning
12068///
12069/// `RegionHealthSources` holds a connection pool internally, it is advised to
12070/// create one and reuse it. You do not need to wrap `RegionHealthSources` in
12071/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12072/// already uses an `Arc` internally.
12073#[cfg(feature = "region-health-sources")]
12074#[cfg_attr(docsrs, doc(cfg(feature = "region-health-sources")))]
12075#[derive(Clone, Debug)]
12076pub struct RegionHealthSources {
12077 inner: std::sync::Arc<dyn super::stub::dynamic::RegionHealthSources>,
12078}
12079
12080#[cfg(feature = "region-health-sources")]
12081impl RegionHealthSources {
12082 /// Returns a builder for [RegionHealthSources].
12083 ///
12084 /// ```
12085 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12086 /// # use google_cloud_compute_v1::client::RegionHealthSources;
12087 /// let client = RegionHealthSources::builder().build().await?;
12088 /// # Ok(()) }
12089 /// ```
12090 pub fn builder() -> super::builder::region_health_sources::ClientBuilder {
12091 crate::new_client_builder(super::builder::region_health_sources::client::Factory)
12092 }
12093
12094 /// Creates a new client from the provided stub.
12095 ///
12096 /// The most common case for calling this function is in tests mocking the
12097 /// client's behavior.
12098 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
12099 where
12100 T: super::stub::RegionHealthSources + 'static,
12101 {
12102 Self { inner: stub.into() }
12103 }
12104
12105 pub(crate) async fn new(
12106 config: gaxi::options::ClientConfig,
12107 ) -> crate::ClientBuilderResult<Self> {
12108 let inner = Self::build_inner(config).await?;
12109 Ok(Self { inner })
12110 }
12111
12112 async fn build_inner(
12113 conf: gaxi::options::ClientConfig,
12114 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionHealthSources>>
12115 {
12116 if gaxi::options::tracing_enabled(&conf) {
12117 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12118 }
12119 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12120 }
12121
12122 async fn build_transport(
12123 conf: gaxi::options::ClientConfig,
12124 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthSources> {
12125 super::transport::RegionHealthSources::new(conf).await
12126 }
12127
12128 async fn build_with_tracing(
12129 conf: gaxi::options::ClientConfig,
12130 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthSources> {
12131 Self::build_transport(conf)
12132 .await
12133 .map(super::tracing::RegionHealthSources::new)
12134 }
12135
12136 /// Retrieves the list of all HealthSource resources (all
12137 /// regional) available to the specified project.
12138 ///
12139 /// To prevent failure, Google recommends that you set the
12140 /// `returnPartialSuccess` parameter to `true`.
12141 pub fn aggregated_list(&self) -> super::builder::region_health_sources::AggregatedList {
12142 super::builder::region_health_sources::AggregatedList::new(self.inner.clone())
12143 }
12144
12145 /// Deletes the specified HealthSource in the given region
12146 pub fn delete(&self) -> super::builder::region_health_sources::Delete {
12147 super::builder::region_health_sources::Delete::new(self.inner.clone())
12148 }
12149
12150 /// Returns the specified HealthSource resource in the given region.
12151 pub fn get(&self) -> super::builder::region_health_sources::Get {
12152 super::builder::region_health_sources::Get::new(self.inner.clone())
12153 }
12154
12155 /// Gets the most recent health check results for this
12156 /// regional HealthSource.
12157 pub fn get_health(&self) -> super::builder::region_health_sources::GetHealth {
12158 super::builder::region_health_sources::GetHealth::new(self.inner.clone())
12159 }
12160
12161 /// Create a HealthSource in the specified project in the given region
12162 /// using the parameters that are included in the request.
12163 pub fn insert(&self) -> super::builder::region_health_sources::Insert {
12164 super::builder::region_health_sources::Insert::new(self.inner.clone())
12165 }
12166
12167 /// Lists the HealthSources for a project in the given region.
12168 pub fn list(&self) -> super::builder::region_health_sources::List {
12169 super::builder::region_health_sources::List::new(self.inner.clone())
12170 }
12171
12172 /// Updates the specified regional HealthSource resource
12173 /// with the data included in the request. This method supportsPATCH
12174 /// semantics and uses theJSON merge
12175 /// patch format and processing rules.
12176 pub fn patch(&self) -> super::builder::region_health_sources::Patch {
12177 super::builder::region_health_sources::Patch::new(self.inner.clone())
12178 }
12179
12180 /// Returns permissions that a caller has on the specified resource.
12181 pub fn test_iam_permissions(
12182 &self,
12183 ) -> super::builder::region_health_sources::TestIamPermissions {
12184 super::builder::region_health_sources::TestIamPermissions::new(self.inner.clone())
12185 }
12186
12187 /// Retrieves the specified region-specific Operations resource.
12188 pub fn get_operation(&self) -> super::builder::region_health_sources::GetOperation {
12189 super::builder::region_health_sources::GetOperation::new(self.inner.clone())
12190 }
12191}
12192
12193/// Implements a client for the Compute Engine API.
12194///
12195/// # Example
12196/// ```
12197/// # use google_cloud_compute_v1::client::RegionInstanceGroupManagerResizeRequests;
12198/// async fn sample(
12199/// ) -> anyhow::Result<()> {
12200/// let client = RegionInstanceGroupManagerResizeRequests::builder().build().await?;
12201/// // use `client` to make requests to the Compute Engine API.
12202/// Ok(())
12203/// }
12204/// ```
12205///
12206/// # Service Description
12207///
12208/// Service for the `regionInstanceGroupManagerResizeRequests` resource.
12209///
12210/// # Configuration
12211///
12212/// To configure `RegionInstanceGroupManagerResizeRequests` use the `with_*` methods in the type returned
12213/// by [builder()][RegionInstanceGroupManagerResizeRequests::builder]. The default configuration should
12214/// work for most applications. Common configuration changes include
12215///
12216/// * [with_endpoint()]: by default this client uses the global default endpoint
12217/// (`https://compute.googleapis.com`). Applications using regional
12218/// endpoints or running in restricted networks (e.g. a network configured
12219/// with [Private Google Access with VPC Service Controls]) may want to
12220/// override this default.
12221/// * [with_credentials()]: by default this client uses
12222/// [Application Default Credentials]. Applications using custom
12223/// authentication may need to override this default.
12224///
12225/// [with_endpoint()]: super::builder::region_instance_group_manager_resize_requests::ClientBuilder::with_endpoint
12226/// [with_credentials()]: super::builder::region_instance_group_manager_resize_requests::ClientBuilder::with_credentials
12227/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12228/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12229///
12230/// # Pooling and Cloning
12231///
12232/// `RegionInstanceGroupManagerResizeRequests` holds a connection pool internally, it is advised to
12233/// create one and reuse it. You do not need to wrap `RegionInstanceGroupManagerResizeRequests` in
12234/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12235/// already uses an `Arc` internally.
12236#[cfg(feature = "region-instance-group-manager-resize-requests")]
12237#[cfg_attr(
12238 docsrs,
12239 doc(cfg(feature = "region-instance-group-manager-resize-requests"))
12240)]
12241#[derive(Clone, Debug)]
12242pub struct RegionInstanceGroupManagerResizeRequests {
12243 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroupManagerResizeRequests>,
12244}
12245
12246#[cfg(feature = "region-instance-group-manager-resize-requests")]
12247impl RegionInstanceGroupManagerResizeRequests {
12248 /// Returns a builder for [RegionInstanceGroupManagerResizeRequests].
12249 ///
12250 /// ```
12251 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12252 /// # use google_cloud_compute_v1::client::RegionInstanceGroupManagerResizeRequests;
12253 /// let client = RegionInstanceGroupManagerResizeRequests::builder().build().await?;
12254 /// # Ok(()) }
12255 /// ```
12256 pub fn builder() -> super::builder::region_instance_group_manager_resize_requests::ClientBuilder
12257 {
12258 crate::new_client_builder(
12259 super::builder::region_instance_group_manager_resize_requests::client::Factory,
12260 )
12261 }
12262
12263 /// Creates a new client from the provided stub.
12264 ///
12265 /// The most common case for calling this function is in tests mocking the
12266 /// client's behavior.
12267 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
12268 where
12269 T: super::stub::RegionInstanceGroupManagerResizeRequests + 'static,
12270 {
12271 Self { inner: stub.into() }
12272 }
12273
12274 pub(crate) async fn new(
12275 config: gaxi::options::ClientConfig,
12276 ) -> crate::ClientBuilderResult<Self> {
12277 let inner = Self::build_inner(config).await?;
12278 Ok(Self { inner })
12279 }
12280
12281 async fn build_inner(
12282 conf: gaxi::options::ClientConfig,
12283 ) -> crate::ClientBuilderResult<
12284 std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroupManagerResizeRequests>,
12285 > {
12286 if gaxi::options::tracing_enabled(&conf) {
12287 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12288 }
12289 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12290 }
12291
12292 async fn build_transport(
12293 conf: gaxi::options::ClientConfig,
12294 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroupManagerResizeRequests>
12295 {
12296 super::transport::RegionInstanceGroupManagerResizeRequests::new(conf).await
12297 }
12298
12299 async fn build_with_tracing(
12300 conf: gaxi::options::ClientConfig,
12301 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroupManagerResizeRequests>
12302 {
12303 Self::build_transport(conf)
12304 .await
12305 .map(super::tracing::RegionInstanceGroupManagerResizeRequests::new)
12306 }
12307
12308 /// Cancels the specified resize request.
12309 /// Cancelled resize request no longer waits for the resources to be
12310 /// provisioned. Cancel is only possible for requests that are in accepted
12311 /// state.
12312 pub fn cancel(&self) -> super::builder::region_instance_group_manager_resize_requests::Cancel {
12313 super::builder::region_instance_group_manager_resize_requests::Cancel::new(
12314 self.inner.clone(),
12315 )
12316 }
12317
12318 /// Deletes the specified, inactive resize request. Requests that are still
12319 /// active cannot be deleted. Deleting request does not delete instances that
12320 /// were provisioned previously.
12321 pub fn delete(&self) -> super::builder::region_instance_group_manager_resize_requests::Delete {
12322 super::builder::region_instance_group_manager_resize_requests::Delete::new(
12323 self.inner.clone(),
12324 )
12325 }
12326
12327 /// Returns all of the details about the specified resize request.
12328 pub fn get(&self) -> super::builder::region_instance_group_manager_resize_requests::Get {
12329 super::builder::region_instance_group_manager_resize_requests::Get::new(self.inner.clone())
12330 }
12331
12332 /// Creates a new Resize Request that starts provisioning VMs immediately
12333 /// or queues VM creation.
12334 pub fn insert(&self) -> super::builder::region_instance_group_manager_resize_requests::Insert {
12335 super::builder::region_instance_group_manager_resize_requests::Insert::new(
12336 self.inner.clone(),
12337 )
12338 }
12339
12340 /// Retrieves a list of Resize Requests that are contained in the
12341 /// managed instance group.
12342 pub fn list(&self) -> super::builder::region_instance_group_manager_resize_requests::List {
12343 super::builder::region_instance_group_manager_resize_requests::List::new(self.inner.clone())
12344 }
12345
12346 /// Retrieves the specified region-specific Operations resource.
12347 pub fn get_operation(
12348 &self,
12349 ) -> super::builder::region_instance_group_manager_resize_requests::GetOperation {
12350 super::builder::region_instance_group_manager_resize_requests::GetOperation::new(
12351 self.inner.clone(),
12352 )
12353 }
12354}
12355
12356/// Implements a client for the Compute Engine API.
12357///
12358/// # Example
12359/// ```
12360/// # use google_cloud_compute_v1::client::RegionInstanceGroupManagers;
12361/// async fn sample(
12362/// ) -> anyhow::Result<()> {
12363/// let client = RegionInstanceGroupManagers::builder().build().await?;
12364/// // use `client` to make requests to the Compute Engine API.
12365/// Ok(())
12366/// }
12367/// ```
12368///
12369/// # Service Description
12370///
12371/// Service for the `regionInstanceGroupManagers` resource.
12372///
12373/// # Configuration
12374///
12375/// To configure `RegionInstanceGroupManagers` use the `with_*` methods in the type returned
12376/// by [builder()][RegionInstanceGroupManagers::builder]. The default configuration should
12377/// work for most applications. Common configuration changes include
12378///
12379/// * [with_endpoint()]: by default this client uses the global default endpoint
12380/// (`https://compute.googleapis.com`). Applications using regional
12381/// endpoints or running in restricted networks (e.g. a network configured
12382/// with [Private Google Access with VPC Service Controls]) may want to
12383/// override this default.
12384/// * [with_credentials()]: by default this client uses
12385/// [Application Default Credentials]. Applications using custom
12386/// authentication may need to override this default.
12387///
12388/// [with_endpoint()]: super::builder::region_instance_group_managers::ClientBuilder::with_endpoint
12389/// [with_credentials()]: super::builder::region_instance_group_managers::ClientBuilder::with_credentials
12390/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12391/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12392///
12393/// # Pooling and Cloning
12394///
12395/// `RegionInstanceGroupManagers` holds a connection pool internally, it is advised to
12396/// create one and reuse it. You do not need to wrap `RegionInstanceGroupManagers` in
12397/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12398/// already uses an `Arc` internally.
12399#[cfg(feature = "region-instance-group-managers")]
12400#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-group-managers")))]
12401#[derive(Clone, Debug)]
12402pub struct RegionInstanceGroupManagers {
12403 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroupManagers>,
12404}
12405
12406#[cfg(feature = "region-instance-group-managers")]
12407impl RegionInstanceGroupManagers {
12408 /// Returns a builder for [RegionInstanceGroupManagers].
12409 ///
12410 /// ```
12411 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12412 /// # use google_cloud_compute_v1::client::RegionInstanceGroupManagers;
12413 /// let client = RegionInstanceGroupManagers::builder().build().await?;
12414 /// # Ok(()) }
12415 /// ```
12416 pub fn builder() -> super::builder::region_instance_group_managers::ClientBuilder {
12417 crate::new_client_builder(super::builder::region_instance_group_managers::client::Factory)
12418 }
12419
12420 /// Creates a new client from the provided stub.
12421 ///
12422 /// The most common case for calling this function is in tests mocking the
12423 /// client's behavior.
12424 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
12425 where
12426 T: super::stub::RegionInstanceGroupManagers + 'static,
12427 {
12428 Self { inner: stub.into() }
12429 }
12430
12431 pub(crate) async fn new(
12432 config: gaxi::options::ClientConfig,
12433 ) -> crate::ClientBuilderResult<Self> {
12434 let inner = Self::build_inner(config).await?;
12435 Ok(Self { inner })
12436 }
12437
12438 async fn build_inner(
12439 conf: gaxi::options::ClientConfig,
12440 ) -> crate::ClientBuilderResult<
12441 std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroupManagers>,
12442 > {
12443 if gaxi::options::tracing_enabled(&conf) {
12444 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12445 }
12446 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12447 }
12448
12449 async fn build_transport(
12450 conf: gaxi::options::ClientConfig,
12451 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroupManagers> {
12452 super::transport::RegionInstanceGroupManagers::new(conf).await
12453 }
12454
12455 async fn build_with_tracing(
12456 conf: gaxi::options::ClientConfig,
12457 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroupManagers> {
12458 Self::build_transport(conf)
12459 .await
12460 .map(super::tracing::RegionInstanceGroupManagers::new)
12461 }
12462
12463 /// Flags the specified instances to be immediately removed from the managed
12464 /// instance group. Abandoning an instance does not delete the
12465 /// instance, but it does remove the instance from any target pools that are
12466 /// applied by the managed instance group. This method reduces thetargetSize of the managed instance group by the
12467 /// number of instances that you abandon. This operation is marked asDONE when the action is scheduled even if the instances have
12468 /// not yet been removed from the group. You must separately verify the
12469 /// status of the abandoning action with thelistmanagedinstances
12470 /// method.
12471 ///
12472 /// If the group is part of a backend
12473 /// service that has enabled
12474 /// connection draining, it can take up to 60 seconds after the connection
12475 /// draining duration has elapsed before the VM instance is removed or deleted.
12476 ///
12477 /// You can specify a maximum of 1000 instances with this method per request.
12478 pub fn abandon_instances(
12479 &self,
12480 ) -> super::builder::region_instance_group_managers::AbandonInstances {
12481 super::builder::region_instance_group_managers::AbandonInstances::new(self.inner.clone())
12482 }
12483
12484 /// Apply updates to selected instances the managed instance group.
12485 pub fn apply_updates_to_instances(
12486 &self,
12487 ) -> super::builder::region_instance_group_managers::ApplyUpdatesToInstances {
12488 super::builder::region_instance_group_managers::ApplyUpdatesToInstances::new(
12489 self.inner.clone(),
12490 )
12491 }
12492
12493 /// Creates instances with per-instance configurations in this regional managed
12494 /// instance group. Instances are created using the current instance template.
12495 /// The create instances operation is marked DONE if
12496 /// the createInstances request is successful. The underlying
12497 /// actions take additional time. You must separately verify the status of thecreating or actions with the listmanagedinstances
12498 /// method.
12499 pub fn create_instances(
12500 &self,
12501 ) -> super::builder::region_instance_group_managers::CreateInstances {
12502 super::builder::region_instance_group_managers::CreateInstances::new(self.inner.clone())
12503 }
12504
12505 /// Deletes the specified managed instance group and all of the instances
12506 /// in that group.
12507 pub fn delete(&self) -> super::builder::region_instance_group_managers::Delete {
12508 super::builder::region_instance_group_managers::Delete::new(self.inner.clone())
12509 }
12510
12511 /// Flags the specified instances in the managed instance group to be
12512 /// immediately deleted. The instances are also removed from any target
12513 /// pools of which they were a member. This method reduces thetargetSize of the managed instance group by the number of
12514 /// instances that you delete.
12515 /// The deleteInstances operation is marked DONE if
12516 /// the deleteInstances request is successful. The underlying
12517 /// actions take additional time. You must separately verify the status of thedeleting action with thelistmanagedinstances
12518 /// method.
12519 ///
12520 /// If the group is part of a backend
12521 /// service that has enabled
12522 /// connection draining, it can take up to 60 seconds after the connection
12523 /// draining duration has elapsed before the VM instance is removed or deleted.
12524 ///
12525 /// You can specify a maximum of 1000 instances with this method per request.
12526 pub fn delete_instances(
12527 &self,
12528 ) -> super::builder::region_instance_group_managers::DeleteInstances {
12529 super::builder::region_instance_group_managers::DeleteInstances::new(self.inner.clone())
12530 }
12531
12532 /// Deletes selected per-instance configurations for the managed instance
12533 /// group.
12534 pub fn delete_per_instance_configs(
12535 &self,
12536 ) -> super::builder::region_instance_group_managers::DeletePerInstanceConfigs {
12537 super::builder::region_instance_group_managers::DeletePerInstanceConfigs::new(
12538 self.inner.clone(),
12539 )
12540 }
12541
12542 /// Returns all of the details about the specified managed instance group.
12543 pub fn get(&self) -> super::builder::region_instance_group_managers::Get {
12544 super::builder::region_instance_group_managers::Get::new(self.inner.clone())
12545 }
12546
12547 /// Creates a managed instance group using the information that you specify
12548 /// in the request. After the group is created, instances in the group are
12549 /// created using the specified instance template.
12550 /// This operation is marked as DONE when the group is created
12551 /// even if the instances in the group have not yet been created. You must
12552 /// separately verify the status of the individual instances with thelistmanagedinstances
12553 /// method.
12554 ///
12555 /// A regional managed instance group can contain up to 2000 instances.
12556 pub fn insert(&self) -> super::builder::region_instance_group_managers::Insert {
12557 super::builder::region_instance_group_managers::Insert::new(self.inner.clone())
12558 }
12559
12560 /// Retrieves the list of managed instance groups that are contained
12561 /// within the specified region.
12562 pub fn list(&self) -> super::builder::region_instance_group_managers::List {
12563 super::builder::region_instance_group_managers::List::new(self.inner.clone())
12564 }
12565
12566 /// Lists all errors thrown by actions on instances for a given regional
12567 /// managed instance group. The filter andorderBy query parameters are not supported.
12568 pub fn list_errors(&self) -> super::builder::region_instance_group_managers::ListErrors {
12569 super::builder::region_instance_group_managers::ListErrors::new(self.inner.clone())
12570 }
12571
12572 /// Lists the instances in the managed instance group and instances that are
12573 /// scheduled to be created. The list includes any current actions
12574 /// that the group has scheduled for its instances. The orderBy
12575 /// query parameter is not supported. The `pageToken` query parameter is
12576 /// supported only if the group's `listManagedInstancesResults` field is set
12577 /// to `PAGINATED`.
12578 pub fn list_managed_instances(
12579 &self,
12580 ) -> super::builder::region_instance_group_managers::ListManagedInstances {
12581 super::builder::region_instance_group_managers::ListManagedInstances::new(
12582 self.inner.clone(),
12583 )
12584 }
12585
12586 /// Lists all of the per-instance configurations defined for the managed
12587 /// instance group. The orderBy query parameter is not supported.
12588 pub fn list_per_instance_configs(
12589 &self,
12590 ) -> super::builder::region_instance_group_managers::ListPerInstanceConfigs {
12591 super::builder::region_instance_group_managers::ListPerInstanceConfigs::new(
12592 self.inner.clone(),
12593 )
12594 }
12595
12596 /// Updates a managed instance group using the information that you specify
12597 /// in the request.
12598 /// This operation is marked as DONE when the group is patched
12599 /// even if the instances in the group are still in the process of being
12600 /// patched. You must separately verify the status of the individual instances
12601 /// with the listmanagedinstances
12602 /// method. This method supportsPATCH
12603 /// semantics and uses theJSON merge
12604 /// patch format and processing rules.
12605 ///
12606 /// If you update your group to specify a new template or instance
12607 /// configuration, it's possible that your intended specification for each VM
12608 /// in the group is different from the current state of that VM. To learn how
12609 /// to apply an updated configuration to the VMs in a MIG, seeUpdating instances in
12610 /// a MIG.
12611 pub fn patch(&self) -> super::builder::region_instance_group_managers::Patch {
12612 super::builder::region_instance_group_managers::Patch::new(self.inner.clone())
12613 }
12614
12615 /// Inserts or patches per-instance configurations for the managed instance
12616 /// group. perInstanceConfig.name serves as a key used to
12617 /// distinguish whether to perform insert or patch.
12618 pub fn patch_per_instance_configs(
12619 &self,
12620 ) -> super::builder::region_instance_group_managers::PatchPerInstanceConfigs {
12621 super::builder::region_instance_group_managers::PatchPerInstanceConfigs::new(
12622 self.inner.clone(),
12623 )
12624 }
12625
12626 /// Flags the specified VM instances in the managed instance group to be
12627 /// immediately recreated. Each instance is recreated using the group's current
12628 /// configuration. This operation is marked as DONE when the flag
12629 /// is set even if the instances have not yet been recreated. You must
12630 /// separately verify the status of each instance by checking itscurrentAction field; for more information, see Checking
12631 /// the status of managed instances.
12632 ///
12633 /// If the group is part of a backend
12634 /// service that has enabled
12635 /// connection draining, it can take up to 60 seconds after the connection
12636 /// draining duration has elapsed before the VM instance is removed or deleted.
12637 ///
12638 /// You can specify a maximum of 1000 instances with this method per request.
12639 pub fn recreate_instances(
12640 &self,
12641 ) -> super::builder::region_instance_group_managers::RecreateInstances {
12642 super::builder::region_instance_group_managers::RecreateInstances::new(self.inner.clone())
12643 }
12644
12645 /// Changes the intended size of the managed instance group. If you increase
12646 /// the size, the group creates new instances using the current instance
12647 /// template. If you decrease the size, the group deletes one or more
12648 /// instances.
12649 ///
12650 /// The resize operation is marked DONE if theresize request is successful. The underlying actions take
12651 /// additional time. You must separately verify the status of thecreating or deleting actions with thelistmanagedinstances
12652 /// method.
12653 ///
12654 /// If the group is part of a backend
12655 /// service that has enabled
12656 /// connection draining, it can take up to 60 seconds after the connection
12657 /// draining duration has elapsed before the VM instance is removed or deleted.
12658 pub fn resize(&self) -> super::builder::region_instance_group_managers::Resize {
12659 super::builder::region_instance_group_managers::Resize::new(self.inner.clone())
12660 }
12661
12662 /// Flags the specified instances in the managed instance group to be
12663 /// resumed. This method increases thetargetSize and decreases the targetSuspendedSize
12664 /// of the managed instance group by the number of instances that you resume.
12665 /// The resumeInstances operation is marked DONE if
12666 /// the resumeInstances request is successful. The underlying
12667 /// actions take additional time. You must separately verify the status of theRESUMING action with thelistmanagedinstances
12668 /// method.
12669 ///
12670 /// In this request, you can only specify instances that are suspended. For
12671 /// example, if an instance was previously suspended using the suspendInstances
12672 /// method, it can be resumed using the resumeInstances method.
12673 ///
12674 /// If a health check is attached to the managed instance group, the specified
12675 /// instances will be verified as healthy after they are resumed.
12676 ///
12677 /// You can specify a maximum of 1000 instances with this method per request.
12678 pub fn resume_instances(
12679 &self,
12680 ) -> super::builder::region_instance_group_managers::ResumeInstances {
12681 super::builder::region_instance_group_managers::ResumeInstances::new(self.inner.clone())
12682 }
12683
12684 /// Sets the instance template to use when creating new instances or recreating
12685 /// instances in this group. Existing instances are not affected.
12686 pub fn set_instance_template(
12687 &self,
12688 ) -> super::builder::region_instance_group_managers::SetInstanceTemplate {
12689 super::builder::region_instance_group_managers::SetInstanceTemplate::new(self.inner.clone())
12690 }
12691
12692 /// Modifies the target pools to which all new instances in this group are
12693 /// assigned. Existing instances in the group are not affected.
12694 pub fn set_target_pools(
12695 &self,
12696 ) -> super::builder::region_instance_group_managers::SetTargetPools {
12697 super::builder::region_instance_group_managers::SetTargetPools::new(self.inner.clone())
12698 }
12699
12700 /// Flags the specified instances in the managed instance group to be
12701 /// started. This method increases thetargetSize and decreases the targetStoppedSize
12702 /// of the managed instance group by the number of instances that you start.
12703 /// The startInstances operation is marked DONE if
12704 /// the startInstances request is successful. The underlying
12705 /// actions take additional time. You must separately verify the status of theSTARTING action with thelistmanagedinstances
12706 /// method.
12707 ///
12708 /// In this request, you can only specify instances that are stopped. For
12709 /// example, if an instance was previously stopped using the stopInstances
12710 /// method, it can be started using the startInstances method.
12711 ///
12712 /// If a health check is attached to the managed instance group, the specified
12713 /// instances will be verified as healthy after they are started.
12714 ///
12715 /// You can specify a maximum of 1000 instances with this method per request.
12716 pub fn start_instances(
12717 &self,
12718 ) -> super::builder::region_instance_group_managers::StartInstances {
12719 super::builder::region_instance_group_managers::StartInstances::new(self.inner.clone())
12720 }
12721
12722 /// Flags the specified instances in the managed instance group to be
12723 /// immediately stopped. You can only specify instances that are running in
12724 /// this request. This method reduces thetargetSize and increases the targetStoppedSize
12725 /// of the managed instance group by the number of instances that you stop.
12726 /// The stopInstances operation is marked DONE if
12727 /// the stopInstances request is successful. The underlying
12728 /// actions take additional time. You must separately verify the status of theSTOPPING action with thelistmanagedinstances
12729 /// method.
12730 ///
12731 /// If the standbyPolicy.initialDelaySec field is set, the group
12732 /// delays stopping the instances until initialDelaySec have
12733 /// passed from instance.creationTimestamp (that is, when the
12734 /// instance was created). This delay gives your application time to
12735 /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
12736 /// will be zero delay.
12737 ///
12738 /// If the group is part of a backend
12739 /// service that has enabled
12740 /// connection draining, it can take up to 60 seconds after the connection
12741 /// draining duration has elapsed before the VM instance is stopped.
12742 ///
12743 /// Stopped instances can be started using the startInstances
12744 /// method.
12745 ///
12746 /// You can specify a maximum of 1000 instances with this method per request.
12747 pub fn stop_instances(&self) -> super::builder::region_instance_group_managers::StopInstances {
12748 super::builder::region_instance_group_managers::StopInstances::new(self.inner.clone())
12749 }
12750
12751 /// Flags the specified instances in the managed instance group to be
12752 /// immediately suspended. You can only specify instances that are running in
12753 /// this request. This method reduces thetargetSize and increases the targetSuspendedSize
12754 /// of the managed instance group by the number of instances that you suspend.
12755 /// The suspendInstances operation is marked DONE if
12756 /// the suspendInstances request is successful. The underlying
12757 /// actions take additional time. You must separately verify the status of theSUSPENDING action with thelistmanagedinstances
12758 /// method.
12759 ///
12760 /// If the standbyPolicy.initialDelaySec field is set, the group
12761 /// delays suspension of the instances until initialDelaySec have
12762 /// passed from instance.creationTimestamp (that is, when the
12763 /// instance was created). This delay gives your application time to
12764 /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
12765 /// will be zero delay.
12766 ///
12767 /// If the group is part of a backend
12768 /// service that has enabled
12769 /// connection draining, it can take up to 60 seconds after the connection
12770 /// draining duration has elapsed before the VM instance is suspended.
12771 ///
12772 /// Suspended instances can be resumed using the resumeInstances
12773 /// method.
12774 ///
12775 /// You can specify a maximum of 1000 instances with this method per request.
12776 pub fn suspend_instances(
12777 &self,
12778 ) -> super::builder::region_instance_group_managers::SuspendInstances {
12779 super::builder::region_instance_group_managers::SuspendInstances::new(self.inner.clone())
12780 }
12781
12782 /// Inserts or updates per-instance configurations for the managed instance
12783 /// group. perInstanceConfig.name serves as a key used to
12784 /// distinguish whether to perform insert or patch.
12785 pub fn update_per_instance_configs(
12786 &self,
12787 ) -> super::builder::region_instance_group_managers::UpdatePerInstanceConfigs {
12788 super::builder::region_instance_group_managers::UpdatePerInstanceConfigs::new(
12789 self.inner.clone(),
12790 )
12791 }
12792
12793 /// Retrieves the specified region-specific Operations resource.
12794 pub fn get_operation(&self) -> super::builder::region_instance_group_managers::GetOperation {
12795 super::builder::region_instance_group_managers::GetOperation::new(self.inner.clone())
12796 }
12797}
12798
12799/// Implements a client for the Compute Engine API.
12800///
12801/// # Example
12802/// ```
12803/// # use google_cloud_compute_v1::client::RegionInstanceGroups;
12804/// async fn sample(
12805/// ) -> anyhow::Result<()> {
12806/// let client = RegionInstanceGroups::builder().build().await?;
12807/// // use `client` to make requests to the Compute Engine API.
12808/// Ok(())
12809/// }
12810/// ```
12811///
12812/// # Service Description
12813///
12814/// Service for the `regionInstanceGroups` resource.
12815///
12816/// # Configuration
12817///
12818/// To configure `RegionInstanceGroups` use the `with_*` methods in the type returned
12819/// by [builder()][RegionInstanceGroups::builder]. The default configuration should
12820/// work for most applications. Common configuration changes include
12821///
12822/// * [with_endpoint()]: by default this client uses the global default endpoint
12823/// (`https://compute.googleapis.com`). Applications using regional
12824/// endpoints or running in restricted networks (e.g. a network configured
12825/// with [Private Google Access with VPC Service Controls]) may want to
12826/// override this default.
12827/// * [with_credentials()]: by default this client uses
12828/// [Application Default Credentials]. Applications using custom
12829/// authentication may need to override this default.
12830///
12831/// [with_endpoint()]: super::builder::region_instance_groups::ClientBuilder::with_endpoint
12832/// [with_credentials()]: super::builder::region_instance_groups::ClientBuilder::with_credentials
12833/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12834/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12835///
12836/// # Pooling and Cloning
12837///
12838/// `RegionInstanceGroups` holds a connection pool internally, it is advised to
12839/// create one and reuse it. You do not need to wrap `RegionInstanceGroups` in
12840/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12841/// already uses an `Arc` internally.
12842#[cfg(feature = "region-instance-groups")]
12843#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-groups")))]
12844#[derive(Clone, Debug)]
12845pub struct RegionInstanceGroups {
12846 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroups>,
12847}
12848
12849#[cfg(feature = "region-instance-groups")]
12850impl RegionInstanceGroups {
12851 /// Returns a builder for [RegionInstanceGroups].
12852 ///
12853 /// ```
12854 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12855 /// # use google_cloud_compute_v1::client::RegionInstanceGroups;
12856 /// let client = RegionInstanceGroups::builder().build().await?;
12857 /// # Ok(()) }
12858 /// ```
12859 pub fn builder() -> super::builder::region_instance_groups::ClientBuilder {
12860 crate::new_client_builder(super::builder::region_instance_groups::client::Factory)
12861 }
12862
12863 /// Creates a new client from the provided stub.
12864 ///
12865 /// The most common case for calling this function is in tests mocking the
12866 /// client's behavior.
12867 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
12868 where
12869 T: super::stub::RegionInstanceGroups + 'static,
12870 {
12871 Self { inner: stub.into() }
12872 }
12873
12874 pub(crate) async fn new(
12875 config: gaxi::options::ClientConfig,
12876 ) -> crate::ClientBuilderResult<Self> {
12877 let inner = Self::build_inner(config).await?;
12878 Ok(Self { inner })
12879 }
12880
12881 async fn build_inner(
12882 conf: gaxi::options::ClientConfig,
12883 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroups>>
12884 {
12885 if gaxi::options::tracing_enabled(&conf) {
12886 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12887 }
12888 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12889 }
12890
12891 async fn build_transport(
12892 conf: gaxi::options::ClientConfig,
12893 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroups> {
12894 super::transport::RegionInstanceGroups::new(conf).await
12895 }
12896
12897 async fn build_with_tracing(
12898 conf: gaxi::options::ClientConfig,
12899 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroups> {
12900 Self::build_transport(conf)
12901 .await
12902 .map(super::tracing::RegionInstanceGroups::new)
12903 }
12904
12905 /// Returns the specified instance group resource.
12906 pub fn get(&self) -> super::builder::region_instance_groups::Get {
12907 super::builder::region_instance_groups::Get::new(self.inner.clone())
12908 }
12909
12910 /// Retrieves the list of instance group resources contained within
12911 /// the specified region.
12912 pub fn list(&self) -> super::builder::region_instance_groups::List {
12913 super::builder::region_instance_groups::List::new(self.inner.clone())
12914 }
12915
12916 /// Lists the instances in the specified instance group and displays
12917 /// information about the named ports. Depending on the specified options, this
12918 /// method can list all instances or only the instances that are running.
12919 /// The orderBy query parameter is not supported.
12920 pub fn list_instances(&self) -> super::builder::region_instance_groups::ListInstances {
12921 super::builder::region_instance_groups::ListInstances::new(self.inner.clone())
12922 }
12923
12924 /// Sets the named ports for the specified regional instance group.
12925 pub fn set_named_ports(&self) -> super::builder::region_instance_groups::SetNamedPorts {
12926 super::builder::region_instance_groups::SetNamedPorts::new(self.inner.clone())
12927 }
12928
12929 /// Returns permissions that a caller has on the specified resource.
12930 pub fn test_iam_permissions(
12931 &self,
12932 ) -> super::builder::region_instance_groups::TestIamPermissions {
12933 super::builder::region_instance_groups::TestIamPermissions::new(self.inner.clone())
12934 }
12935
12936 /// Retrieves the specified region-specific Operations resource.
12937 pub fn get_operation(&self) -> super::builder::region_instance_groups::GetOperation {
12938 super::builder::region_instance_groups::GetOperation::new(self.inner.clone())
12939 }
12940}
12941
12942/// Implements a client for the Compute Engine API.
12943///
12944/// # Example
12945/// ```
12946/// # use google_cloud_compute_v1::client::RegionInstanceTemplates;
12947/// async fn sample(
12948/// ) -> anyhow::Result<()> {
12949/// let client = RegionInstanceTemplates::builder().build().await?;
12950/// // use `client` to make requests to the Compute Engine API.
12951/// Ok(())
12952/// }
12953/// ```
12954///
12955/// # Service Description
12956///
12957/// Service for the `regionInstanceTemplates` resource.
12958///
12959/// # Configuration
12960///
12961/// To configure `RegionInstanceTemplates` use the `with_*` methods in the type returned
12962/// by [builder()][RegionInstanceTemplates::builder]. The default configuration should
12963/// work for most applications. Common configuration changes include
12964///
12965/// * [with_endpoint()]: by default this client uses the global default endpoint
12966/// (`https://compute.googleapis.com`). Applications using regional
12967/// endpoints or running in restricted networks (e.g. a network configured
12968/// with [Private Google Access with VPC Service Controls]) may want to
12969/// override this default.
12970/// * [with_credentials()]: by default this client uses
12971/// [Application Default Credentials]. Applications using custom
12972/// authentication may need to override this default.
12973///
12974/// [with_endpoint()]: super::builder::region_instance_templates::ClientBuilder::with_endpoint
12975/// [with_credentials()]: super::builder::region_instance_templates::ClientBuilder::with_credentials
12976/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12977/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12978///
12979/// # Pooling and Cloning
12980///
12981/// `RegionInstanceTemplates` holds a connection pool internally, it is advised to
12982/// create one and reuse it. You do not need to wrap `RegionInstanceTemplates` in
12983/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12984/// already uses an `Arc` internally.
12985#[cfg(feature = "region-instance-templates")]
12986#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-templates")))]
12987#[derive(Clone, Debug)]
12988pub struct RegionInstanceTemplates {
12989 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceTemplates>,
12990}
12991
12992#[cfg(feature = "region-instance-templates")]
12993impl RegionInstanceTemplates {
12994 /// Returns a builder for [RegionInstanceTemplates].
12995 ///
12996 /// ```
12997 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12998 /// # use google_cloud_compute_v1::client::RegionInstanceTemplates;
12999 /// let client = RegionInstanceTemplates::builder().build().await?;
13000 /// # Ok(()) }
13001 /// ```
13002 pub fn builder() -> super::builder::region_instance_templates::ClientBuilder {
13003 crate::new_client_builder(super::builder::region_instance_templates::client::Factory)
13004 }
13005
13006 /// Creates a new client from the provided stub.
13007 ///
13008 /// The most common case for calling this function is in tests mocking the
13009 /// client's behavior.
13010 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
13011 where
13012 T: super::stub::RegionInstanceTemplates + 'static,
13013 {
13014 Self { inner: stub.into() }
13015 }
13016
13017 pub(crate) async fn new(
13018 config: gaxi::options::ClientConfig,
13019 ) -> crate::ClientBuilderResult<Self> {
13020 let inner = Self::build_inner(config).await?;
13021 Ok(Self { inner })
13022 }
13023
13024 async fn build_inner(
13025 conf: gaxi::options::ClientConfig,
13026 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionInstanceTemplates>>
13027 {
13028 if gaxi::options::tracing_enabled(&conf) {
13029 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13030 }
13031 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13032 }
13033
13034 async fn build_transport(
13035 conf: gaxi::options::ClientConfig,
13036 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceTemplates> {
13037 super::transport::RegionInstanceTemplates::new(conf).await
13038 }
13039
13040 async fn build_with_tracing(
13041 conf: gaxi::options::ClientConfig,
13042 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceTemplates> {
13043 Self::build_transport(conf)
13044 .await
13045 .map(super::tracing::RegionInstanceTemplates::new)
13046 }
13047
13048 /// Deletes the specified instance template. Deleting an instance template is
13049 /// permanent and cannot be undone.
13050 pub fn delete(&self) -> super::builder::region_instance_templates::Delete {
13051 super::builder::region_instance_templates::Delete::new(self.inner.clone())
13052 }
13053
13054 /// Returns the specified instance template.
13055 pub fn get(&self) -> super::builder::region_instance_templates::Get {
13056 super::builder::region_instance_templates::Get::new(self.inner.clone())
13057 }
13058
13059 /// Creates an instance template in the specified project and region using the
13060 /// global instance template whose URL is included in the request.
13061 pub fn insert(&self) -> super::builder::region_instance_templates::Insert {
13062 super::builder::region_instance_templates::Insert::new(self.inner.clone())
13063 }
13064
13065 /// Retrieves a list of instance templates that are contained within the
13066 /// specified project and region.
13067 pub fn list(&self) -> super::builder::region_instance_templates::List {
13068 super::builder::region_instance_templates::List::new(self.inner.clone())
13069 }
13070
13071 /// Retrieves the specified region-specific Operations resource.
13072 pub fn get_operation(&self) -> super::builder::region_instance_templates::GetOperation {
13073 super::builder::region_instance_templates::GetOperation::new(self.inner.clone())
13074 }
13075}
13076
13077/// Implements a client for the Compute Engine API.
13078///
13079/// # Example
13080/// ```
13081/// # use google_cloud_compute_v1::client::RegionInstances;
13082/// async fn sample(
13083/// ) -> anyhow::Result<()> {
13084/// let client = RegionInstances::builder().build().await?;
13085/// // use `client` to make requests to the Compute Engine API.
13086/// Ok(())
13087/// }
13088/// ```
13089///
13090/// # Service Description
13091///
13092/// Service for the `regionInstances` resource.
13093///
13094/// # Configuration
13095///
13096/// To configure `RegionInstances` use the `with_*` methods in the type returned
13097/// by [builder()][RegionInstances::builder]. The default configuration should
13098/// work for most applications. Common configuration changes include
13099///
13100/// * [with_endpoint()]: by default this client uses the global default endpoint
13101/// (`https://compute.googleapis.com`). Applications using regional
13102/// endpoints or running in restricted networks (e.g. a network configured
13103/// with [Private Google Access with VPC Service Controls]) may want to
13104/// override this default.
13105/// * [with_credentials()]: by default this client uses
13106/// [Application Default Credentials]. Applications using custom
13107/// authentication may need to override this default.
13108///
13109/// [with_endpoint()]: super::builder::region_instances::ClientBuilder::with_endpoint
13110/// [with_credentials()]: super::builder::region_instances::ClientBuilder::with_credentials
13111/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13112/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13113///
13114/// # Pooling and Cloning
13115///
13116/// `RegionInstances` holds a connection pool internally, it is advised to
13117/// create one and reuse it. You do not need to wrap `RegionInstances` in
13118/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13119/// already uses an `Arc` internally.
13120#[cfg(feature = "region-instances")]
13121#[cfg_attr(docsrs, doc(cfg(feature = "region-instances")))]
13122#[derive(Clone, Debug)]
13123pub struct RegionInstances {
13124 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstances>,
13125}
13126
13127#[cfg(feature = "region-instances")]
13128impl RegionInstances {
13129 /// Returns a builder for [RegionInstances].
13130 ///
13131 /// ```
13132 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13133 /// # use google_cloud_compute_v1::client::RegionInstances;
13134 /// let client = RegionInstances::builder().build().await?;
13135 /// # Ok(()) }
13136 /// ```
13137 pub fn builder() -> super::builder::region_instances::ClientBuilder {
13138 crate::new_client_builder(super::builder::region_instances::client::Factory)
13139 }
13140
13141 /// Creates a new client from the provided stub.
13142 ///
13143 /// The most common case for calling this function is in tests mocking the
13144 /// client's behavior.
13145 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
13146 where
13147 T: super::stub::RegionInstances + 'static,
13148 {
13149 Self { inner: stub.into() }
13150 }
13151
13152 pub(crate) async fn new(
13153 config: gaxi::options::ClientConfig,
13154 ) -> crate::ClientBuilderResult<Self> {
13155 let inner = Self::build_inner(config).await?;
13156 Ok(Self { inner })
13157 }
13158
13159 async fn build_inner(
13160 conf: gaxi::options::ClientConfig,
13161 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionInstances>> {
13162 if gaxi::options::tracing_enabled(&conf) {
13163 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13164 }
13165 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13166 }
13167
13168 async fn build_transport(
13169 conf: gaxi::options::ClientConfig,
13170 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstances> {
13171 super::transport::RegionInstances::new(conf).await
13172 }
13173
13174 async fn build_with_tracing(
13175 conf: gaxi::options::ClientConfig,
13176 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstances> {
13177 Self::build_transport(conf)
13178 .await
13179 .map(super::tracing::RegionInstances::new)
13180 }
13181
13182 /// Creates multiple instances in a given region. Count specifies the number of
13183 /// instances to create.
13184 pub fn bulk_insert(&self) -> super::builder::region_instances::BulkInsert {
13185 super::builder::region_instances::BulkInsert::new(self.inner.clone())
13186 }
13187
13188 /// Retrieves the specified region-specific Operations resource.
13189 pub fn get_operation(&self) -> super::builder::region_instances::GetOperation {
13190 super::builder::region_instances::GetOperation::new(self.inner.clone())
13191 }
13192}
13193
13194/// Implements a client for the Compute Engine API.
13195///
13196/// # Example
13197/// ```
13198/// # use google_cloud_compute_v1::client::RegionInstantSnapshotGroups;
13199/// async fn sample(
13200/// ) -> anyhow::Result<()> {
13201/// let client = RegionInstantSnapshotGroups::builder().build().await?;
13202/// // use `client` to make requests to the Compute Engine API.
13203/// Ok(())
13204/// }
13205/// ```
13206///
13207/// # Service Description
13208///
13209/// Service for the `regionInstantSnapshotGroups` resource.
13210///
13211/// # Configuration
13212///
13213/// To configure `RegionInstantSnapshotGroups` use the `with_*` methods in the type returned
13214/// by [builder()][RegionInstantSnapshotGroups::builder]. The default configuration should
13215/// work for most applications. Common configuration changes include
13216///
13217/// * [with_endpoint()]: by default this client uses the global default endpoint
13218/// (`https://compute.googleapis.com`). Applications using regional
13219/// endpoints or running in restricted networks (e.g. a network configured
13220/// with [Private Google Access with VPC Service Controls]) may want to
13221/// override this default.
13222/// * [with_credentials()]: by default this client uses
13223/// [Application Default Credentials]. Applications using custom
13224/// authentication may need to override this default.
13225///
13226/// [with_endpoint()]: super::builder::region_instant_snapshot_groups::ClientBuilder::with_endpoint
13227/// [with_credentials()]: super::builder::region_instant_snapshot_groups::ClientBuilder::with_credentials
13228/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13229/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13230///
13231/// # Pooling and Cloning
13232///
13233/// `RegionInstantSnapshotGroups` holds a connection pool internally, it is advised to
13234/// create one and reuse it. You do not need to wrap `RegionInstantSnapshotGroups` in
13235/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13236/// already uses an `Arc` internally.
13237#[cfg(feature = "region-instant-snapshot-groups")]
13238#[cfg_attr(docsrs, doc(cfg(feature = "region-instant-snapshot-groups")))]
13239#[derive(Clone, Debug)]
13240pub struct RegionInstantSnapshotGroups {
13241 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstantSnapshotGroups>,
13242}
13243
13244#[cfg(feature = "region-instant-snapshot-groups")]
13245impl RegionInstantSnapshotGroups {
13246 /// Returns a builder for [RegionInstantSnapshotGroups].
13247 ///
13248 /// ```
13249 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13250 /// # use google_cloud_compute_v1::client::RegionInstantSnapshotGroups;
13251 /// let client = RegionInstantSnapshotGroups::builder().build().await?;
13252 /// # Ok(()) }
13253 /// ```
13254 pub fn builder() -> super::builder::region_instant_snapshot_groups::ClientBuilder {
13255 crate::new_client_builder(super::builder::region_instant_snapshot_groups::client::Factory)
13256 }
13257
13258 /// Creates a new client from the provided stub.
13259 ///
13260 /// The most common case for calling this function is in tests mocking the
13261 /// client's behavior.
13262 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
13263 where
13264 T: super::stub::RegionInstantSnapshotGroups + 'static,
13265 {
13266 Self { inner: stub.into() }
13267 }
13268
13269 pub(crate) async fn new(
13270 config: gaxi::options::ClientConfig,
13271 ) -> crate::ClientBuilderResult<Self> {
13272 let inner = Self::build_inner(config).await?;
13273 Ok(Self { inner })
13274 }
13275
13276 async fn build_inner(
13277 conf: gaxi::options::ClientConfig,
13278 ) -> crate::ClientBuilderResult<
13279 std::sync::Arc<dyn super::stub::dynamic::RegionInstantSnapshotGroups>,
13280 > {
13281 if gaxi::options::tracing_enabled(&conf) {
13282 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13283 }
13284 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13285 }
13286
13287 async fn build_transport(
13288 conf: gaxi::options::ClientConfig,
13289 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstantSnapshotGroups> {
13290 super::transport::RegionInstantSnapshotGroups::new(conf).await
13291 }
13292
13293 async fn build_with_tracing(
13294 conf: gaxi::options::ClientConfig,
13295 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstantSnapshotGroups> {
13296 Self::build_transport(conf)
13297 .await
13298 .map(super::tracing::RegionInstantSnapshotGroups::new)
13299 }
13300
13301 /// deletes a Regional InstantSnapshotGroup resource
13302 pub fn delete(&self) -> super::builder::region_instant_snapshot_groups::Delete {
13303 super::builder::region_instant_snapshot_groups::Delete::new(self.inner.clone())
13304 }
13305
13306 /// returns the specified InstantSnapshotGroup resource in the specified
13307 /// region.
13308 pub fn get(&self) -> super::builder::region_instant_snapshot_groups::Get {
13309 super::builder::region_instant_snapshot_groups::Get::new(self.inner.clone())
13310 }
13311
13312 /// Gets the access control policy for a resource. May be empty if no such
13313 /// policy or resource exists.
13314 pub fn get_iam_policy(&self) -> super::builder::region_instant_snapshot_groups::GetIamPolicy {
13315 super::builder::region_instant_snapshot_groups::GetIamPolicy::new(self.inner.clone())
13316 }
13317
13318 /// creates a Regional InstantSnapshotGroup resource
13319 pub fn insert(&self) -> super::builder::region_instant_snapshot_groups::Insert {
13320 super::builder::region_instant_snapshot_groups::Insert::new(self.inner.clone())
13321 }
13322
13323 /// retrieves the list of InstantSnapshotGroup resources contained within
13324 /// the specified region.
13325 pub fn list(&self) -> super::builder::region_instant_snapshot_groups::List {
13326 super::builder::region_instant_snapshot_groups::List::new(self.inner.clone())
13327 }
13328
13329 /// Sets the access control policy on the specified resource.
13330 /// Replaces any existing policy.
13331 pub fn set_iam_policy(&self) -> super::builder::region_instant_snapshot_groups::SetIamPolicy {
13332 super::builder::region_instant_snapshot_groups::SetIamPolicy::new(self.inner.clone())
13333 }
13334
13335 /// Returns permissions that a caller has on the specified resource.
13336 pub fn test_iam_permissions(
13337 &self,
13338 ) -> super::builder::region_instant_snapshot_groups::TestIamPermissions {
13339 super::builder::region_instant_snapshot_groups::TestIamPermissions::new(self.inner.clone())
13340 }
13341
13342 /// Retrieves the specified region-specific Operations resource.
13343 pub fn get_operation(&self) -> super::builder::region_instant_snapshot_groups::GetOperation {
13344 super::builder::region_instant_snapshot_groups::GetOperation::new(self.inner.clone())
13345 }
13346}
13347
13348/// Implements a client for the Compute Engine API.
13349///
13350/// # Example
13351/// ```
13352/// # use google_cloud_compute_v1::client::RegionInstantSnapshots;
13353/// async fn sample(
13354/// ) -> anyhow::Result<()> {
13355/// let client = RegionInstantSnapshots::builder().build().await?;
13356/// // use `client` to make requests to the Compute Engine API.
13357/// Ok(())
13358/// }
13359/// ```
13360///
13361/// # Service Description
13362///
13363/// Service for the `regionInstantSnapshots` resource.
13364///
13365/// # Configuration
13366///
13367/// To configure `RegionInstantSnapshots` use the `with_*` methods in the type returned
13368/// by [builder()][RegionInstantSnapshots::builder]. The default configuration should
13369/// work for most applications. Common configuration changes include
13370///
13371/// * [with_endpoint()]: by default this client uses the global default endpoint
13372/// (`https://compute.googleapis.com`). Applications using regional
13373/// endpoints or running in restricted networks (e.g. a network configured
13374/// with [Private Google Access with VPC Service Controls]) may want to
13375/// override this default.
13376/// * [with_credentials()]: by default this client uses
13377/// [Application Default Credentials]. Applications using custom
13378/// authentication may need to override this default.
13379///
13380/// [with_endpoint()]: super::builder::region_instant_snapshots::ClientBuilder::with_endpoint
13381/// [with_credentials()]: super::builder::region_instant_snapshots::ClientBuilder::with_credentials
13382/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13383/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13384///
13385/// # Pooling and Cloning
13386///
13387/// `RegionInstantSnapshots` holds a connection pool internally, it is advised to
13388/// create one and reuse it. You do not need to wrap `RegionInstantSnapshots` in
13389/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13390/// already uses an `Arc` internally.
13391#[cfg(feature = "region-instant-snapshots")]
13392#[cfg_attr(docsrs, doc(cfg(feature = "region-instant-snapshots")))]
13393#[derive(Clone, Debug)]
13394pub struct RegionInstantSnapshots {
13395 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstantSnapshots>,
13396}
13397
13398#[cfg(feature = "region-instant-snapshots")]
13399impl RegionInstantSnapshots {
13400 /// Returns a builder for [RegionInstantSnapshots].
13401 ///
13402 /// ```
13403 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13404 /// # use google_cloud_compute_v1::client::RegionInstantSnapshots;
13405 /// let client = RegionInstantSnapshots::builder().build().await?;
13406 /// # Ok(()) }
13407 /// ```
13408 pub fn builder() -> super::builder::region_instant_snapshots::ClientBuilder {
13409 crate::new_client_builder(super::builder::region_instant_snapshots::client::Factory)
13410 }
13411
13412 /// Creates a new client from the provided stub.
13413 ///
13414 /// The most common case for calling this function is in tests mocking the
13415 /// client's behavior.
13416 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
13417 where
13418 T: super::stub::RegionInstantSnapshots + 'static,
13419 {
13420 Self { inner: stub.into() }
13421 }
13422
13423 pub(crate) async fn new(
13424 config: gaxi::options::ClientConfig,
13425 ) -> crate::ClientBuilderResult<Self> {
13426 let inner = Self::build_inner(config).await?;
13427 Ok(Self { inner })
13428 }
13429
13430 async fn build_inner(
13431 conf: gaxi::options::ClientConfig,
13432 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionInstantSnapshots>>
13433 {
13434 if gaxi::options::tracing_enabled(&conf) {
13435 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13436 }
13437 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13438 }
13439
13440 async fn build_transport(
13441 conf: gaxi::options::ClientConfig,
13442 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstantSnapshots> {
13443 super::transport::RegionInstantSnapshots::new(conf).await
13444 }
13445
13446 async fn build_with_tracing(
13447 conf: gaxi::options::ClientConfig,
13448 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstantSnapshots> {
13449 Self::build_transport(conf)
13450 .await
13451 .map(super::tracing::RegionInstantSnapshots::new)
13452 }
13453
13454 /// Deletes the specified InstantSnapshot resource. Keep in mind that deleting
13455 /// a single instantSnapshot might not necessarily delete all the data on that
13456 /// instantSnapshot. If any data on the instantSnapshot that is marked for
13457 /// deletion is needed for subsequent instantSnapshots, the data will be moved
13458 /// to the next corresponding instantSnapshot.
13459 ///
13460 /// For more information, seeDeleting
13461 /// instantSnapshots.
13462 pub fn delete(&self) -> super::builder::region_instant_snapshots::Delete {
13463 super::builder::region_instant_snapshots::Delete::new(self.inner.clone())
13464 }
13465
13466 /// Returns the specified InstantSnapshot resource in the specified region.
13467 pub fn get(&self) -> super::builder::region_instant_snapshots::Get {
13468 super::builder::region_instant_snapshots::Get::new(self.inner.clone())
13469 }
13470
13471 /// Gets the access control policy for a resource. May be empty if no such
13472 /// policy or resource exists.
13473 pub fn get_iam_policy(&self) -> super::builder::region_instant_snapshots::GetIamPolicy {
13474 super::builder::region_instant_snapshots::GetIamPolicy::new(self.inner.clone())
13475 }
13476
13477 /// Creates an instant snapshot in the specified region.
13478 pub fn insert(&self) -> super::builder::region_instant_snapshots::Insert {
13479 super::builder::region_instant_snapshots::Insert::new(self.inner.clone())
13480 }
13481
13482 /// Retrieves the list of InstantSnapshot resources contained within
13483 /// the specified region.
13484 pub fn list(&self) -> super::builder::region_instant_snapshots::List {
13485 super::builder::region_instant_snapshots::List::new(self.inner.clone())
13486 }
13487
13488 /// Sets the access control policy on the specified resource.
13489 /// Replaces any existing policy.
13490 pub fn set_iam_policy(&self) -> super::builder::region_instant_snapshots::SetIamPolicy {
13491 super::builder::region_instant_snapshots::SetIamPolicy::new(self.inner.clone())
13492 }
13493
13494 /// Sets the labels on a instantSnapshot in the given region. To learn more
13495 /// about labels, read the Labeling
13496 /// Resources documentation.
13497 pub fn set_labels(&self) -> super::builder::region_instant_snapshots::SetLabels {
13498 super::builder::region_instant_snapshots::SetLabels::new(self.inner.clone())
13499 }
13500
13501 /// Returns permissions that a caller has on the specified resource.
13502 pub fn test_iam_permissions(
13503 &self,
13504 ) -> super::builder::region_instant_snapshots::TestIamPermissions {
13505 super::builder::region_instant_snapshots::TestIamPermissions::new(self.inner.clone())
13506 }
13507
13508 /// Retrieves the specified region-specific Operations resource.
13509 pub fn get_operation(&self) -> super::builder::region_instant_snapshots::GetOperation {
13510 super::builder::region_instant_snapshots::GetOperation::new(self.inner.clone())
13511 }
13512}
13513
13514/// Implements a client for the Compute Engine API.
13515///
13516/// # Example
13517/// ```
13518/// # use google_cloud_compute_v1::client::RegionNetworkEndpointGroups;
13519/// async fn sample(
13520/// ) -> anyhow::Result<()> {
13521/// let client = RegionNetworkEndpointGroups::builder().build().await?;
13522/// // use `client` to make requests to the Compute Engine API.
13523/// Ok(())
13524/// }
13525/// ```
13526///
13527/// # Service Description
13528///
13529/// Service for the `regionNetworkEndpointGroups` resource.
13530///
13531/// # Configuration
13532///
13533/// To configure `RegionNetworkEndpointGroups` use the `with_*` methods in the type returned
13534/// by [builder()][RegionNetworkEndpointGroups::builder]. The default configuration should
13535/// work for most applications. Common configuration changes include
13536///
13537/// * [with_endpoint()]: by default this client uses the global default endpoint
13538/// (`https://compute.googleapis.com`). Applications using regional
13539/// endpoints or running in restricted networks (e.g. a network configured
13540/// with [Private Google Access with VPC Service Controls]) may want to
13541/// override this default.
13542/// * [with_credentials()]: by default this client uses
13543/// [Application Default Credentials]. Applications using custom
13544/// authentication may need to override this default.
13545///
13546/// [with_endpoint()]: super::builder::region_network_endpoint_groups::ClientBuilder::with_endpoint
13547/// [with_credentials()]: super::builder::region_network_endpoint_groups::ClientBuilder::with_credentials
13548/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13549/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13550///
13551/// # Pooling and Cloning
13552///
13553/// `RegionNetworkEndpointGroups` holds a connection pool internally, it is advised to
13554/// create one and reuse it. You do not need to wrap `RegionNetworkEndpointGroups` in
13555/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13556/// already uses an `Arc` internally.
13557#[cfg(feature = "region-network-endpoint-groups")]
13558#[cfg_attr(docsrs, doc(cfg(feature = "region-network-endpoint-groups")))]
13559#[derive(Clone, Debug)]
13560pub struct RegionNetworkEndpointGroups {
13561 inner: std::sync::Arc<dyn super::stub::dynamic::RegionNetworkEndpointGroups>,
13562}
13563
13564#[cfg(feature = "region-network-endpoint-groups")]
13565impl RegionNetworkEndpointGroups {
13566 /// Returns a builder for [RegionNetworkEndpointGroups].
13567 ///
13568 /// ```
13569 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13570 /// # use google_cloud_compute_v1::client::RegionNetworkEndpointGroups;
13571 /// let client = RegionNetworkEndpointGroups::builder().build().await?;
13572 /// # Ok(()) }
13573 /// ```
13574 pub fn builder() -> super::builder::region_network_endpoint_groups::ClientBuilder {
13575 crate::new_client_builder(super::builder::region_network_endpoint_groups::client::Factory)
13576 }
13577
13578 /// Creates a new client from the provided stub.
13579 ///
13580 /// The most common case for calling this function is in tests mocking the
13581 /// client's behavior.
13582 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
13583 where
13584 T: super::stub::RegionNetworkEndpointGroups + 'static,
13585 {
13586 Self { inner: stub.into() }
13587 }
13588
13589 pub(crate) async fn new(
13590 config: gaxi::options::ClientConfig,
13591 ) -> crate::ClientBuilderResult<Self> {
13592 let inner = Self::build_inner(config).await?;
13593 Ok(Self { inner })
13594 }
13595
13596 async fn build_inner(
13597 conf: gaxi::options::ClientConfig,
13598 ) -> crate::ClientBuilderResult<
13599 std::sync::Arc<dyn super::stub::dynamic::RegionNetworkEndpointGroups>,
13600 > {
13601 if gaxi::options::tracing_enabled(&conf) {
13602 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13603 }
13604 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13605 }
13606
13607 async fn build_transport(
13608 conf: gaxi::options::ClientConfig,
13609 ) -> crate::ClientBuilderResult<impl super::stub::RegionNetworkEndpointGroups> {
13610 super::transport::RegionNetworkEndpointGroups::new(conf).await
13611 }
13612
13613 async fn build_with_tracing(
13614 conf: gaxi::options::ClientConfig,
13615 ) -> crate::ClientBuilderResult<impl super::stub::RegionNetworkEndpointGroups> {
13616 Self::build_transport(conf)
13617 .await
13618 .map(super::tracing::RegionNetworkEndpointGroups::new)
13619 }
13620
13621 /// Attach a list of network endpoints to the specified network endpoint group.
13622 pub fn attach_network_endpoints(
13623 &self,
13624 ) -> super::builder::region_network_endpoint_groups::AttachNetworkEndpoints {
13625 super::builder::region_network_endpoint_groups::AttachNetworkEndpoints::new(
13626 self.inner.clone(),
13627 )
13628 }
13629
13630 /// Deletes the specified network endpoint group. Note that the NEG cannot be
13631 /// deleted if it is configured as a backend of a backend service.
13632 pub fn delete(&self) -> super::builder::region_network_endpoint_groups::Delete {
13633 super::builder::region_network_endpoint_groups::Delete::new(self.inner.clone())
13634 }
13635
13636 /// Detach the network endpoint from the specified network endpoint group.
13637 pub fn detach_network_endpoints(
13638 &self,
13639 ) -> super::builder::region_network_endpoint_groups::DetachNetworkEndpoints {
13640 super::builder::region_network_endpoint_groups::DetachNetworkEndpoints::new(
13641 self.inner.clone(),
13642 )
13643 }
13644
13645 /// Returns the specified network endpoint group.
13646 pub fn get(&self) -> super::builder::region_network_endpoint_groups::Get {
13647 super::builder::region_network_endpoint_groups::Get::new(self.inner.clone())
13648 }
13649
13650 /// Creates a network endpoint group in the specified project using the
13651 /// parameters that are included in the request.
13652 ///
13653 /// Note: Use the following APIs to manage network endpoint groups:
13654 ///
13655 /// - To manage NEGs with zonal scope (such as zonal NEGs, hybrid connectivity
13656 /// NEGs): zonal
13657 /// API
13658 /// - To manage NEGs with regional scope (such as regional internet NEGs,
13659 /// serverless NEGs, Private Service Connect NEGs): regional
13660 /// API
13661 /// - To manage NEGs with global scope (such as global internet NEGs):global
13662 /// API
13663 pub fn insert(&self) -> super::builder::region_network_endpoint_groups::Insert {
13664 super::builder::region_network_endpoint_groups::Insert::new(self.inner.clone())
13665 }
13666
13667 /// Retrieves the list of regional network endpoint groups available to the
13668 /// specified project in the given region.
13669 pub fn list(&self) -> super::builder::region_network_endpoint_groups::List {
13670 super::builder::region_network_endpoint_groups::List::new(self.inner.clone())
13671 }
13672
13673 /// Lists the network endpoints in the specified network endpoint group.
13674 pub fn list_network_endpoints(
13675 &self,
13676 ) -> super::builder::region_network_endpoint_groups::ListNetworkEndpoints {
13677 super::builder::region_network_endpoint_groups::ListNetworkEndpoints::new(
13678 self.inner.clone(),
13679 )
13680 }
13681
13682 /// Retrieves the specified region-specific Operations resource.
13683 pub fn get_operation(&self) -> super::builder::region_network_endpoint_groups::GetOperation {
13684 super::builder::region_network_endpoint_groups::GetOperation::new(self.inner.clone())
13685 }
13686}
13687
13688/// Implements a client for the Compute Engine API.
13689///
13690/// # Example
13691/// ```
13692/// # use google_cloud_compute_v1::client::RegionNetworkFirewallPolicies;
13693/// async fn sample(
13694/// ) -> anyhow::Result<()> {
13695/// let client = RegionNetworkFirewallPolicies::builder().build().await?;
13696/// // use `client` to make requests to the Compute Engine API.
13697/// Ok(())
13698/// }
13699/// ```
13700///
13701/// # Service Description
13702///
13703/// Service for the `regionNetworkFirewallPolicies` resource.
13704///
13705/// # Configuration
13706///
13707/// To configure `RegionNetworkFirewallPolicies` use the `with_*` methods in the type returned
13708/// by [builder()][RegionNetworkFirewallPolicies::builder]. The default configuration should
13709/// work for most applications. Common configuration changes include
13710///
13711/// * [with_endpoint()]: by default this client uses the global default endpoint
13712/// (`https://compute.googleapis.com`). Applications using regional
13713/// endpoints or running in restricted networks (e.g. a network configured
13714/// with [Private Google Access with VPC Service Controls]) may want to
13715/// override this default.
13716/// * [with_credentials()]: by default this client uses
13717/// [Application Default Credentials]. Applications using custom
13718/// authentication may need to override this default.
13719///
13720/// [with_endpoint()]: super::builder::region_network_firewall_policies::ClientBuilder::with_endpoint
13721/// [with_credentials()]: super::builder::region_network_firewall_policies::ClientBuilder::with_credentials
13722/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13723/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13724///
13725/// # Pooling and Cloning
13726///
13727/// `RegionNetworkFirewallPolicies` holds a connection pool internally, it is advised to
13728/// create one and reuse it. You do not need to wrap `RegionNetworkFirewallPolicies` in
13729/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13730/// already uses an `Arc` internally.
13731#[cfg(feature = "region-network-firewall-policies")]
13732#[cfg_attr(docsrs, doc(cfg(feature = "region-network-firewall-policies")))]
13733#[derive(Clone, Debug)]
13734pub struct RegionNetworkFirewallPolicies {
13735 inner: std::sync::Arc<dyn super::stub::dynamic::RegionNetworkFirewallPolicies>,
13736}
13737
13738#[cfg(feature = "region-network-firewall-policies")]
13739impl RegionNetworkFirewallPolicies {
13740 /// Returns a builder for [RegionNetworkFirewallPolicies].
13741 ///
13742 /// ```
13743 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13744 /// # use google_cloud_compute_v1::client::RegionNetworkFirewallPolicies;
13745 /// let client = RegionNetworkFirewallPolicies::builder().build().await?;
13746 /// # Ok(()) }
13747 /// ```
13748 pub fn builder() -> super::builder::region_network_firewall_policies::ClientBuilder {
13749 crate::new_client_builder(super::builder::region_network_firewall_policies::client::Factory)
13750 }
13751
13752 /// Creates a new client from the provided stub.
13753 ///
13754 /// The most common case for calling this function is in tests mocking the
13755 /// client's behavior.
13756 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
13757 where
13758 T: super::stub::RegionNetworkFirewallPolicies + 'static,
13759 {
13760 Self { inner: stub.into() }
13761 }
13762
13763 pub(crate) async fn new(
13764 config: gaxi::options::ClientConfig,
13765 ) -> crate::ClientBuilderResult<Self> {
13766 let inner = Self::build_inner(config).await?;
13767 Ok(Self { inner })
13768 }
13769
13770 async fn build_inner(
13771 conf: gaxi::options::ClientConfig,
13772 ) -> crate::ClientBuilderResult<
13773 std::sync::Arc<dyn super::stub::dynamic::RegionNetworkFirewallPolicies>,
13774 > {
13775 if gaxi::options::tracing_enabled(&conf) {
13776 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13777 }
13778 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13779 }
13780
13781 async fn build_transport(
13782 conf: gaxi::options::ClientConfig,
13783 ) -> crate::ClientBuilderResult<impl super::stub::RegionNetworkFirewallPolicies> {
13784 super::transport::RegionNetworkFirewallPolicies::new(conf).await
13785 }
13786
13787 async fn build_with_tracing(
13788 conf: gaxi::options::ClientConfig,
13789 ) -> crate::ClientBuilderResult<impl super::stub::RegionNetworkFirewallPolicies> {
13790 Self::build_transport(conf)
13791 .await
13792 .map(super::tracing::RegionNetworkFirewallPolicies::new)
13793 }
13794
13795 /// Inserts an association for the specified network firewall policy.
13796 pub fn add_association(
13797 &self,
13798 ) -> super::builder::region_network_firewall_policies::AddAssociation {
13799 super::builder::region_network_firewall_policies::AddAssociation::new(self.inner.clone())
13800 }
13801
13802 /// Inserts a rule into a network firewall policy.
13803 pub fn add_rule(&self) -> super::builder::region_network_firewall_policies::AddRule {
13804 super::builder::region_network_firewall_policies::AddRule::new(self.inner.clone())
13805 }
13806
13807 /// Copies rules to the specified network firewall policy.
13808 pub fn clone_rules(&self) -> super::builder::region_network_firewall_policies::CloneRules {
13809 super::builder::region_network_firewall_policies::CloneRules::new(self.inner.clone())
13810 }
13811
13812 /// Deletes the specified network firewall policy.
13813 pub fn delete(&self) -> super::builder::region_network_firewall_policies::Delete {
13814 super::builder::region_network_firewall_policies::Delete::new(self.inner.clone())
13815 }
13816
13817 /// Returns the specified network firewall policy.
13818 pub fn get(&self) -> super::builder::region_network_firewall_policies::Get {
13819 super::builder::region_network_firewall_policies::Get::new(self.inner.clone())
13820 }
13821
13822 /// Gets an association with the specified name.
13823 pub fn get_association(
13824 &self,
13825 ) -> super::builder::region_network_firewall_policies::GetAssociation {
13826 super::builder::region_network_firewall_policies::GetAssociation::new(self.inner.clone())
13827 }
13828
13829 /// Returns the effective firewalls on a given network.
13830 pub fn get_effective_firewalls(
13831 &self,
13832 ) -> super::builder::region_network_firewall_policies::GetEffectiveFirewalls {
13833 super::builder::region_network_firewall_policies::GetEffectiveFirewalls::new(
13834 self.inner.clone(),
13835 )
13836 }
13837
13838 /// Gets the access control policy for a resource. May be empty if no such
13839 /// policy or resource exists.
13840 pub fn get_iam_policy(&self) -> super::builder::region_network_firewall_policies::GetIamPolicy {
13841 super::builder::region_network_firewall_policies::GetIamPolicy::new(self.inner.clone())
13842 }
13843
13844 /// Gets a rule of the specified priority.
13845 pub fn get_rule(&self) -> super::builder::region_network_firewall_policies::GetRule {
13846 super::builder::region_network_firewall_policies::GetRule::new(self.inner.clone())
13847 }
13848
13849 /// Creates a new network firewall policy in the specified project and region.
13850 pub fn insert(&self) -> super::builder::region_network_firewall_policies::Insert {
13851 super::builder::region_network_firewall_policies::Insert::new(self.inner.clone())
13852 }
13853
13854 /// Lists all the network firewall policies that have been configured
13855 /// for the specified project in the given region.
13856 pub fn list(&self) -> super::builder::region_network_firewall_policies::List {
13857 super::builder::region_network_firewall_policies::List::new(self.inner.clone())
13858 }
13859
13860 /// Patches the specified network firewall policy.
13861 pub fn patch(&self) -> super::builder::region_network_firewall_policies::Patch {
13862 super::builder::region_network_firewall_policies::Patch::new(self.inner.clone())
13863 }
13864
13865 /// Patches a rule of the specified priority.
13866 pub fn patch_rule(&self) -> super::builder::region_network_firewall_policies::PatchRule {
13867 super::builder::region_network_firewall_policies::PatchRule::new(self.inner.clone())
13868 }
13869
13870 /// Removes an association for the specified network firewall policy.
13871 pub fn remove_association(
13872 &self,
13873 ) -> super::builder::region_network_firewall_policies::RemoveAssociation {
13874 super::builder::region_network_firewall_policies::RemoveAssociation::new(self.inner.clone())
13875 }
13876
13877 /// Deletes a rule of the specified priority.
13878 pub fn remove_rule(&self) -> super::builder::region_network_firewall_policies::RemoveRule {
13879 super::builder::region_network_firewall_policies::RemoveRule::new(self.inner.clone())
13880 }
13881
13882 /// Sets the access control policy on the specified resource.
13883 /// Replaces any existing policy.
13884 pub fn set_iam_policy(&self) -> super::builder::region_network_firewall_policies::SetIamPolicy {
13885 super::builder::region_network_firewall_policies::SetIamPolicy::new(self.inner.clone())
13886 }
13887
13888 /// Returns permissions that a caller has on the specified resource.
13889 pub fn test_iam_permissions(
13890 &self,
13891 ) -> super::builder::region_network_firewall_policies::TestIamPermissions {
13892 super::builder::region_network_firewall_policies::TestIamPermissions::new(
13893 self.inner.clone(),
13894 )
13895 }
13896
13897 /// Retrieves the specified region-specific Operations resource.
13898 pub fn get_operation(&self) -> super::builder::region_network_firewall_policies::GetOperation {
13899 super::builder::region_network_firewall_policies::GetOperation::new(self.inner.clone())
13900 }
13901}
13902
13903/// Implements a client for the Compute Engine API.
13904///
13905/// # Example
13906/// ```
13907/// # use google_cloud_compute_v1::client::RegionNotificationEndpoints;
13908/// async fn sample(
13909/// ) -> anyhow::Result<()> {
13910/// let client = RegionNotificationEndpoints::builder().build().await?;
13911/// // use `client` to make requests to the Compute Engine API.
13912/// Ok(())
13913/// }
13914/// ```
13915///
13916/// # Service Description
13917///
13918/// Service for the `regionNotificationEndpoints` resource.
13919///
13920/// # Configuration
13921///
13922/// To configure `RegionNotificationEndpoints` use the `with_*` methods in the type returned
13923/// by [builder()][RegionNotificationEndpoints::builder]. The default configuration should
13924/// work for most applications. Common configuration changes include
13925///
13926/// * [with_endpoint()]: by default this client uses the global default endpoint
13927/// (`https://compute.googleapis.com`). Applications using regional
13928/// endpoints or running in restricted networks (e.g. a network configured
13929/// with [Private Google Access with VPC Service Controls]) may want to
13930/// override this default.
13931/// * [with_credentials()]: by default this client uses
13932/// [Application Default Credentials]. Applications using custom
13933/// authentication may need to override this default.
13934///
13935/// [with_endpoint()]: super::builder::region_notification_endpoints::ClientBuilder::with_endpoint
13936/// [with_credentials()]: super::builder::region_notification_endpoints::ClientBuilder::with_credentials
13937/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13938/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13939///
13940/// # Pooling and Cloning
13941///
13942/// `RegionNotificationEndpoints` holds a connection pool internally, it is advised to
13943/// create one and reuse it. You do not need to wrap `RegionNotificationEndpoints` in
13944/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13945/// already uses an `Arc` internally.
13946#[cfg(feature = "region-notification-endpoints")]
13947#[cfg_attr(docsrs, doc(cfg(feature = "region-notification-endpoints")))]
13948#[derive(Clone, Debug)]
13949pub struct RegionNotificationEndpoints {
13950 inner: std::sync::Arc<dyn super::stub::dynamic::RegionNotificationEndpoints>,
13951}
13952
13953#[cfg(feature = "region-notification-endpoints")]
13954impl RegionNotificationEndpoints {
13955 /// Returns a builder for [RegionNotificationEndpoints].
13956 ///
13957 /// ```
13958 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13959 /// # use google_cloud_compute_v1::client::RegionNotificationEndpoints;
13960 /// let client = RegionNotificationEndpoints::builder().build().await?;
13961 /// # Ok(()) }
13962 /// ```
13963 pub fn builder() -> super::builder::region_notification_endpoints::ClientBuilder {
13964 crate::new_client_builder(super::builder::region_notification_endpoints::client::Factory)
13965 }
13966
13967 /// Creates a new client from the provided stub.
13968 ///
13969 /// The most common case for calling this function is in tests mocking the
13970 /// client's behavior.
13971 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
13972 where
13973 T: super::stub::RegionNotificationEndpoints + 'static,
13974 {
13975 Self { inner: stub.into() }
13976 }
13977
13978 pub(crate) async fn new(
13979 config: gaxi::options::ClientConfig,
13980 ) -> crate::ClientBuilderResult<Self> {
13981 let inner = Self::build_inner(config).await?;
13982 Ok(Self { inner })
13983 }
13984
13985 async fn build_inner(
13986 conf: gaxi::options::ClientConfig,
13987 ) -> crate::ClientBuilderResult<
13988 std::sync::Arc<dyn super::stub::dynamic::RegionNotificationEndpoints>,
13989 > {
13990 if gaxi::options::tracing_enabled(&conf) {
13991 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13992 }
13993 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13994 }
13995
13996 async fn build_transport(
13997 conf: gaxi::options::ClientConfig,
13998 ) -> crate::ClientBuilderResult<impl super::stub::RegionNotificationEndpoints> {
13999 super::transport::RegionNotificationEndpoints::new(conf).await
14000 }
14001
14002 async fn build_with_tracing(
14003 conf: gaxi::options::ClientConfig,
14004 ) -> crate::ClientBuilderResult<impl super::stub::RegionNotificationEndpoints> {
14005 Self::build_transport(conf)
14006 .await
14007 .map(super::tracing::RegionNotificationEndpoints::new)
14008 }
14009
14010 /// Retrieves the list of all NotificationEndpoint resources,
14011 /// regional and global, available to the specified project.
14012 pub fn aggregated_list(&self) -> super::builder::region_notification_endpoints::AggregatedList {
14013 super::builder::region_notification_endpoints::AggregatedList::new(self.inner.clone())
14014 }
14015
14016 /// Deletes the specified NotificationEndpoint in the given region
14017 pub fn delete(&self) -> super::builder::region_notification_endpoints::Delete {
14018 super::builder::region_notification_endpoints::Delete::new(self.inner.clone())
14019 }
14020
14021 /// Returns the specified NotificationEndpoint resource in the given region.
14022 pub fn get(&self) -> super::builder::region_notification_endpoints::Get {
14023 super::builder::region_notification_endpoints::Get::new(self.inner.clone())
14024 }
14025
14026 /// Create a NotificationEndpoint in the specified project in the given region
14027 /// using the parameters that are included in the request.
14028 pub fn insert(&self) -> super::builder::region_notification_endpoints::Insert {
14029 super::builder::region_notification_endpoints::Insert::new(self.inner.clone())
14030 }
14031
14032 /// Lists the NotificationEndpoints for a project in the given region.
14033 pub fn list(&self) -> super::builder::region_notification_endpoints::List {
14034 super::builder::region_notification_endpoints::List::new(self.inner.clone())
14035 }
14036
14037 /// Returns permissions that a caller has on the specified resource.
14038 pub fn test_iam_permissions(
14039 &self,
14040 ) -> super::builder::region_notification_endpoints::TestIamPermissions {
14041 super::builder::region_notification_endpoints::TestIamPermissions::new(self.inner.clone())
14042 }
14043
14044 /// Retrieves the specified region-specific Operations resource.
14045 pub fn get_operation(&self) -> super::builder::region_notification_endpoints::GetOperation {
14046 super::builder::region_notification_endpoints::GetOperation::new(self.inner.clone())
14047 }
14048}
14049
14050/// Implements a client for the Compute Engine API.
14051///
14052/// # Example
14053/// ```
14054/// # use google_cloud_compute_v1::client::RegionOperations;
14055/// async fn sample(
14056/// ) -> anyhow::Result<()> {
14057/// let client = RegionOperations::builder().build().await?;
14058/// // use `client` to make requests to the Compute Engine API.
14059/// Ok(())
14060/// }
14061/// ```
14062///
14063/// # Service Description
14064///
14065/// Service for the `regionOperations` resource.
14066///
14067/// # Configuration
14068///
14069/// To configure `RegionOperations` use the `with_*` methods in the type returned
14070/// by [builder()][RegionOperations::builder]. The default configuration should
14071/// work for most applications. Common configuration changes include
14072///
14073/// * [with_endpoint()]: by default this client uses the global default endpoint
14074/// (`https://compute.googleapis.com`). Applications using regional
14075/// endpoints or running in restricted networks (e.g. a network configured
14076/// with [Private Google Access with VPC Service Controls]) may want to
14077/// override this default.
14078/// * [with_credentials()]: by default this client uses
14079/// [Application Default Credentials]. Applications using custom
14080/// authentication may need to override this default.
14081///
14082/// [with_endpoint()]: super::builder::region_operations::ClientBuilder::with_endpoint
14083/// [with_credentials()]: super::builder::region_operations::ClientBuilder::with_credentials
14084/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14085/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14086///
14087/// # Pooling and Cloning
14088///
14089/// `RegionOperations` holds a connection pool internally, it is advised to
14090/// create one and reuse it. You do not need to wrap `RegionOperations` in
14091/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14092/// already uses an `Arc` internally.
14093#[cfg(feature = "region-operations")]
14094#[cfg_attr(docsrs, doc(cfg(feature = "region-operations")))]
14095#[derive(Clone, Debug)]
14096pub struct RegionOperations {
14097 inner: std::sync::Arc<dyn super::stub::dynamic::RegionOperations>,
14098}
14099
14100#[cfg(feature = "region-operations")]
14101impl RegionOperations {
14102 /// Returns a builder for [RegionOperations].
14103 ///
14104 /// ```
14105 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14106 /// # use google_cloud_compute_v1::client::RegionOperations;
14107 /// let client = RegionOperations::builder().build().await?;
14108 /// # Ok(()) }
14109 /// ```
14110 pub fn builder() -> super::builder::region_operations::ClientBuilder {
14111 crate::new_client_builder(super::builder::region_operations::client::Factory)
14112 }
14113
14114 /// Creates a new client from the provided stub.
14115 ///
14116 /// The most common case for calling this function is in tests mocking the
14117 /// client's behavior.
14118 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
14119 where
14120 T: super::stub::RegionOperations + 'static,
14121 {
14122 Self { inner: stub.into() }
14123 }
14124
14125 pub(crate) async fn new(
14126 config: gaxi::options::ClientConfig,
14127 ) -> crate::ClientBuilderResult<Self> {
14128 let inner = Self::build_inner(config).await?;
14129 Ok(Self { inner })
14130 }
14131
14132 async fn build_inner(
14133 conf: gaxi::options::ClientConfig,
14134 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionOperations>>
14135 {
14136 if gaxi::options::tracing_enabled(&conf) {
14137 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14138 }
14139 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14140 }
14141
14142 async fn build_transport(
14143 conf: gaxi::options::ClientConfig,
14144 ) -> crate::ClientBuilderResult<impl super::stub::RegionOperations> {
14145 super::transport::RegionOperations::new(conf).await
14146 }
14147
14148 async fn build_with_tracing(
14149 conf: gaxi::options::ClientConfig,
14150 ) -> crate::ClientBuilderResult<impl super::stub::RegionOperations> {
14151 Self::build_transport(conf)
14152 .await
14153 .map(super::tracing::RegionOperations::new)
14154 }
14155
14156 /// Deletes the specified region-specific Operations resource.
14157 pub fn delete(&self) -> super::builder::region_operations::Delete {
14158 super::builder::region_operations::Delete::new(self.inner.clone())
14159 }
14160
14161 /// Retrieves the specified region-specific Operations resource.
14162 pub fn get(&self) -> super::builder::region_operations::Get {
14163 super::builder::region_operations::Get::new(self.inner.clone())
14164 }
14165
14166 /// Retrieves a list of Operation resources contained within
14167 /// the specified region.
14168 pub fn list(&self) -> super::builder::region_operations::List {
14169 super::builder::region_operations::List::new(self.inner.clone())
14170 }
14171
14172 /// Waits for the specified Operation resource to return as `DONE`
14173 /// or for the request to approach the 2 minute deadline, and retrieves the
14174 /// specified Operation resource. This method differs from the
14175 /// `GET` method in that it waits for no more than the default
14176 /// deadline (2 minutes) and then returns the current state of the operation,
14177 /// which might be `DONE` or still in progress.
14178 ///
14179 /// This method is called on a best-effort basis. Specifically:
14180 ///
14181 /// ```norust
14182 /// - In uncommon cases, when the server is overloaded, the request might
14183 /// return before the default deadline is reached, or might return after zero
14184 /// seconds.
14185 /// ```
14186 ///
14187 /// - If the default deadline is reached, there is no guarantee that the
14188 /// operation is actually done when the method returns. Be prepared to retry
14189 /// if the operation is not `DONE`.
14190 pub fn wait(&self) -> super::builder::region_operations::Wait {
14191 super::builder::region_operations::Wait::new(self.inner.clone())
14192 }
14193}
14194
14195/// Implements a client for the Compute Engine API.
14196///
14197/// # Example
14198/// ```
14199/// # use google_cloud_compute_v1::client::RegionSecurityPolicies;
14200/// async fn sample(
14201/// ) -> anyhow::Result<()> {
14202/// let client = RegionSecurityPolicies::builder().build().await?;
14203/// // use `client` to make requests to the Compute Engine API.
14204/// Ok(())
14205/// }
14206/// ```
14207///
14208/// # Service Description
14209///
14210/// Service for the `regionSecurityPolicies` resource.
14211///
14212/// # Configuration
14213///
14214/// To configure `RegionSecurityPolicies` use the `with_*` methods in the type returned
14215/// by [builder()][RegionSecurityPolicies::builder]. The default configuration should
14216/// work for most applications. Common configuration changes include
14217///
14218/// * [with_endpoint()]: by default this client uses the global default endpoint
14219/// (`https://compute.googleapis.com`). Applications using regional
14220/// endpoints or running in restricted networks (e.g. a network configured
14221/// with [Private Google Access with VPC Service Controls]) may want to
14222/// override this default.
14223/// * [with_credentials()]: by default this client uses
14224/// [Application Default Credentials]. Applications using custom
14225/// authentication may need to override this default.
14226///
14227/// [with_endpoint()]: super::builder::region_security_policies::ClientBuilder::with_endpoint
14228/// [with_credentials()]: super::builder::region_security_policies::ClientBuilder::with_credentials
14229/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14230/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14231///
14232/// # Pooling and Cloning
14233///
14234/// `RegionSecurityPolicies` holds a connection pool internally, it is advised to
14235/// create one and reuse it. You do not need to wrap `RegionSecurityPolicies` in
14236/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14237/// already uses an `Arc` internally.
14238#[cfg(feature = "region-security-policies")]
14239#[cfg_attr(docsrs, doc(cfg(feature = "region-security-policies")))]
14240#[derive(Clone, Debug)]
14241pub struct RegionSecurityPolicies {
14242 inner: std::sync::Arc<dyn super::stub::dynamic::RegionSecurityPolicies>,
14243}
14244
14245#[cfg(feature = "region-security-policies")]
14246impl RegionSecurityPolicies {
14247 /// Returns a builder for [RegionSecurityPolicies].
14248 ///
14249 /// ```
14250 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14251 /// # use google_cloud_compute_v1::client::RegionSecurityPolicies;
14252 /// let client = RegionSecurityPolicies::builder().build().await?;
14253 /// # Ok(()) }
14254 /// ```
14255 pub fn builder() -> super::builder::region_security_policies::ClientBuilder {
14256 crate::new_client_builder(super::builder::region_security_policies::client::Factory)
14257 }
14258
14259 /// Creates a new client from the provided stub.
14260 ///
14261 /// The most common case for calling this function is in tests mocking the
14262 /// client's behavior.
14263 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
14264 where
14265 T: super::stub::RegionSecurityPolicies + 'static,
14266 {
14267 Self { inner: stub.into() }
14268 }
14269
14270 pub(crate) async fn new(
14271 config: gaxi::options::ClientConfig,
14272 ) -> crate::ClientBuilderResult<Self> {
14273 let inner = Self::build_inner(config).await?;
14274 Ok(Self { inner })
14275 }
14276
14277 async fn build_inner(
14278 conf: gaxi::options::ClientConfig,
14279 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionSecurityPolicies>>
14280 {
14281 if gaxi::options::tracing_enabled(&conf) {
14282 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14283 }
14284 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14285 }
14286
14287 async fn build_transport(
14288 conf: gaxi::options::ClientConfig,
14289 ) -> crate::ClientBuilderResult<impl super::stub::RegionSecurityPolicies> {
14290 super::transport::RegionSecurityPolicies::new(conf).await
14291 }
14292
14293 async fn build_with_tracing(
14294 conf: gaxi::options::ClientConfig,
14295 ) -> crate::ClientBuilderResult<impl super::stub::RegionSecurityPolicies> {
14296 Self::build_transport(conf)
14297 .await
14298 .map(super::tracing::RegionSecurityPolicies::new)
14299 }
14300
14301 /// Inserts a rule into a security policy.
14302 pub fn add_rule(&self) -> super::builder::region_security_policies::AddRule {
14303 super::builder::region_security_policies::AddRule::new(self.inner.clone())
14304 }
14305
14306 /// Deletes the specified policy.
14307 pub fn delete(&self) -> super::builder::region_security_policies::Delete {
14308 super::builder::region_security_policies::Delete::new(self.inner.clone())
14309 }
14310
14311 /// List all of the ordered rules present in a single specified policy.
14312 pub fn get(&self) -> super::builder::region_security_policies::Get {
14313 super::builder::region_security_policies::Get::new(self.inner.clone())
14314 }
14315
14316 /// Gets a rule at the specified priority.
14317 pub fn get_rule(&self) -> super::builder::region_security_policies::GetRule {
14318 super::builder::region_security_policies::GetRule::new(self.inner.clone())
14319 }
14320
14321 /// Creates a new policy in the specified project using the data included in
14322 /// the request.
14323 pub fn insert(&self) -> super::builder::region_security_policies::Insert {
14324 super::builder::region_security_policies::Insert::new(self.inner.clone())
14325 }
14326
14327 /// List all the policies that have been configured for the specified project
14328 /// and region.
14329 pub fn list(&self) -> super::builder::region_security_policies::List {
14330 super::builder::region_security_policies::List::new(self.inner.clone())
14331 }
14332
14333 /// Patches the specified policy with the data included in the request. To
14334 /// clear fields in the policy, leave the fields empty and specify them in the
14335 /// updateMask. This cannot be used to be update the rules in the policy.
14336 /// Please use the per rule methods like addRule, patchRule, and removeRule
14337 /// instead.
14338 pub fn patch(&self) -> super::builder::region_security_policies::Patch {
14339 super::builder::region_security_policies::Patch::new(self.inner.clone())
14340 }
14341
14342 /// Patches a rule at the specified priority. To clear fields in the rule,
14343 /// leave the fields empty and specify them in the updateMask.
14344 pub fn patch_rule(&self) -> super::builder::region_security_policies::PatchRule {
14345 super::builder::region_security_policies::PatchRule::new(self.inner.clone())
14346 }
14347
14348 /// Deletes a rule at the specified priority.
14349 pub fn remove_rule(&self) -> super::builder::region_security_policies::RemoveRule {
14350 super::builder::region_security_policies::RemoveRule::new(self.inner.clone())
14351 }
14352
14353 /// Sets the labels on a security policy. To learn more about labels,
14354 /// read the Labeling Resources
14355 /// documentation.
14356 pub fn set_labels(&self) -> super::builder::region_security_policies::SetLabels {
14357 super::builder::region_security_policies::SetLabels::new(self.inner.clone())
14358 }
14359
14360 /// Retrieves the specified region-specific Operations resource.
14361 pub fn get_operation(&self) -> super::builder::region_security_policies::GetOperation {
14362 super::builder::region_security_policies::GetOperation::new(self.inner.clone())
14363 }
14364}
14365
14366/// Implements a client for the Compute Engine API.
14367///
14368/// # Example
14369/// ```
14370/// # use google_cloud_compute_v1::client::RegionSnapshotSettings;
14371/// async fn sample(
14372/// ) -> anyhow::Result<()> {
14373/// let client = RegionSnapshotSettings::builder().build().await?;
14374/// // use `client` to make requests to the Compute Engine API.
14375/// Ok(())
14376/// }
14377/// ```
14378///
14379/// # Service Description
14380///
14381/// Service for the `regionSnapshotSettings` resource.
14382///
14383/// # Configuration
14384///
14385/// To configure `RegionSnapshotSettings` use the `with_*` methods in the type returned
14386/// by [builder()][RegionSnapshotSettings::builder]. The default configuration should
14387/// work for most applications. Common configuration changes include
14388///
14389/// * [with_endpoint()]: by default this client uses the global default endpoint
14390/// (`https://compute.googleapis.com`). Applications using regional
14391/// endpoints or running in restricted networks (e.g. a network configured
14392/// with [Private Google Access with VPC Service Controls]) may want to
14393/// override this default.
14394/// * [with_credentials()]: by default this client uses
14395/// [Application Default Credentials]. Applications using custom
14396/// authentication may need to override this default.
14397///
14398/// [with_endpoint()]: super::builder::region_snapshot_settings::ClientBuilder::with_endpoint
14399/// [with_credentials()]: super::builder::region_snapshot_settings::ClientBuilder::with_credentials
14400/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14401/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14402///
14403/// # Pooling and Cloning
14404///
14405/// `RegionSnapshotSettings` holds a connection pool internally, it is advised to
14406/// create one and reuse it. You do not need to wrap `RegionSnapshotSettings` in
14407/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14408/// already uses an `Arc` internally.
14409#[cfg(feature = "region-snapshot-settings")]
14410#[cfg_attr(docsrs, doc(cfg(feature = "region-snapshot-settings")))]
14411#[derive(Clone, Debug)]
14412pub struct RegionSnapshotSettings {
14413 inner: std::sync::Arc<dyn super::stub::dynamic::RegionSnapshotSettings>,
14414}
14415
14416#[cfg(feature = "region-snapshot-settings")]
14417impl RegionSnapshotSettings {
14418 /// Returns a builder for [RegionSnapshotSettings].
14419 ///
14420 /// ```
14421 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14422 /// # use google_cloud_compute_v1::client::RegionSnapshotSettings;
14423 /// let client = RegionSnapshotSettings::builder().build().await?;
14424 /// # Ok(()) }
14425 /// ```
14426 pub fn builder() -> super::builder::region_snapshot_settings::ClientBuilder {
14427 crate::new_client_builder(super::builder::region_snapshot_settings::client::Factory)
14428 }
14429
14430 /// Creates a new client from the provided stub.
14431 ///
14432 /// The most common case for calling this function is in tests mocking the
14433 /// client's behavior.
14434 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
14435 where
14436 T: super::stub::RegionSnapshotSettings + 'static,
14437 {
14438 Self { inner: stub.into() }
14439 }
14440
14441 pub(crate) async fn new(
14442 config: gaxi::options::ClientConfig,
14443 ) -> crate::ClientBuilderResult<Self> {
14444 let inner = Self::build_inner(config).await?;
14445 Ok(Self { inner })
14446 }
14447
14448 async fn build_inner(
14449 conf: gaxi::options::ClientConfig,
14450 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionSnapshotSettings>>
14451 {
14452 if gaxi::options::tracing_enabled(&conf) {
14453 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14454 }
14455 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14456 }
14457
14458 async fn build_transport(
14459 conf: gaxi::options::ClientConfig,
14460 ) -> crate::ClientBuilderResult<impl super::stub::RegionSnapshotSettings> {
14461 super::transport::RegionSnapshotSettings::new(conf).await
14462 }
14463
14464 async fn build_with_tracing(
14465 conf: gaxi::options::ClientConfig,
14466 ) -> crate::ClientBuilderResult<impl super::stub::RegionSnapshotSettings> {
14467 Self::build_transport(conf)
14468 .await
14469 .map(super::tracing::RegionSnapshotSettings::new)
14470 }
14471
14472 /// Get region snapshot settings.
14473 pub fn get(&self) -> super::builder::region_snapshot_settings::Get {
14474 super::builder::region_snapshot_settings::Get::new(self.inner.clone())
14475 }
14476
14477 /// Patch region snapshot settings.
14478 pub fn patch(&self) -> super::builder::region_snapshot_settings::Patch {
14479 super::builder::region_snapshot_settings::Patch::new(self.inner.clone())
14480 }
14481
14482 /// Retrieves the specified region-specific Operations resource.
14483 pub fn get_operation(&self) -> super::builder::region_snapshot_settings::GetOperation {
14484 super::builder::region_snapshot_settings::GetOperation::new(self.inner.clone())
14485 }
14486}
14487
14488/// Implements a client for the Compute Engine API.
14489///
14490/// # Example
14491/// ```
14492/// # use google_cloud_compute_v1::client::RegionSnapshots;
14493/// async fn sample(
14494/// ) -> anyhow::Result<()> {
14495/// let client = RegionSnapshots::builder().build().await?;
14496/// // use `client` to make requests to the Compute Engine API.
14497/// Ok(())
14498/// }
14499/// ```
14500///
14501/// # Service Description
14502///
14503/// Service for the `regionSnapshots` resource.
14504///
14505/// # Configuration
14506///
14507/// To configure `RegionSnapshots` use the `with_*` methods in the type returned
14508/// by [builder()][RegionSnapshots::builder]. The default configuration should
14509/// work for most applications. Common configuration changes include
14510///
14511/// * [with_endpoint()]: by default this client uses the global default endpoint
14512/// (`https://compute.googleapis.com`). Applications using regional
14513/// endpoints or running in restricted networks (e.g. a network configured
14514/// with [Private Google Access with VPC Service Controls]) may want to
14515/// override this default.
14516/// * [with_credentials()]: by default this client uses
14517/// [Application Default Credentials]. Applications using custom
14518/// authentication may need to override this default.
14519///
14520/// [with_endpoint()]: super::builder::region_snapshots::ClientBuilder::with_endpoint
14521/// [with_credentials()]: super::builder::region_snapshots::ClientBuilder::with_credentials
14522/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14523/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14524///
14525/// # Pooling and Cloning
14526///
14527/// `RegionSnapshots` holds a connection pool internally, it is advised to
14528/// create one and reuse it. You do not need to wrap `RegionSnapshots` in
14529/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14530/// already uses an `Arc` internally.
14531#[cfg(feature = "region-snapshots")]
14532#[cfg_attr(docsrs, doc(cfg(feature = "region-snapshots")))]
14533#[derive(Clone, Debug)]
14534pub struct RegionSnapshots {
14535 inner: std::sync::Arc<dyn super::stub::dynamic::RegionSnapshots>,
14536}
14537
14538#[cfg(feature = "region-snapshots")]
14539impl RegionSnapshots {
14540 /// Returns a builder for [RegionSnapshots].
14541 ///
14542 /// ```
14543 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14544 /// # use google_cloud_compute_v1::client::RegionSnapshots;
14545 /// let client = RegionSnapshots::builder().build().await?;
14546 /// # Ok(()) }
14547 /// ```
14548 pub fn builder() -> super::builder::region_snapshots::ClientBuilder {
14549 crate::new_client_builder(super::builder::region_snapshots::client::Factory)
14550 }
14551
14552 /// Creates a new client from the provided stub.
14553 ///
14554 /// The most common case for calling this function is in tests mocking the
14555 /// client's behavior.
14556 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
14557 where
14558 T: super::stub::RegionSnapshots + 'static,
14559 {
14560 Self { inner: stub.into() }
14561 }
14562
14563 pub(crate) async fn new(
14564 config: gaxi::options::ClientConfig,
14565 ) -> crate::ClientBuilderResult<Self> {
14566 let inner = Self::build_inner(config).await?;
14567 Ok(Self { inner })
14568 }
14569
14570 async fn build_inner(
14571 conf: gaxi::options::ClientConfig,
14572 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionSnapshots>> {
14573 if gaxi::options::tracing_enabled(&conf) {
14574 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14575 }
14576 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14577 }
14578
14579 async fn build_transport(
14580 conf: gaxi::options::ClientConfig,
14581 ) -> crate::ClientBuilderResult<impl super::stub::RegionSnapshots> {
14582 super::transport::RegionSnapshots::new(conf).await
14583 }
14584
14585 async fn build_with_tracing(
14586 conf: gaxi::options::ClientConfig,
14587 ) -> crate::ClientBuilderResult<impl super::stub::RegionSnapshots> {
14588 Self::build_transport(conf)
14589 .await
14590 .map(super::tracing::RegionSnapshots::new)
14591 }
14592
14593 /// Deletes the specified Snapshot resource. Keep in mind that deleting
14594 /// a single snapshot might not necessarily delete all the data on that
14595 /// snapshot. If any data on the snapshot that is marked for deletion is
14596 /// needed for subsequent snapshots, the data will be moved to the next
14597 /// corresponding snapshot.
14598 ///
14599 /// For more information, seeDeleting
14600 /// snapshots.
14601 pub fn delete(&self) -> super::builder::region_snapshots::Delete {
14602 super::builder::region_snapshots::Delete::new(self.inner.clone())
14603 }
14604
14605 /// Returns the specified Snapshot resource.
14606 pub fn get(&self) -> super::builder::region_snapshots::Get {
14607 super::builder::region_snapshots::Get::new(self.inner.clone())
14608 }
14609
14610 /// Gets the access control policy for a resource. May be empty if no such
14611 /// policy or resource exists.
14612 pub fn get_iam_policy(&self) -> super::builder::region_snapshots::GetIamPolicy {
14613 super::builder::region_snapshots::GetIamPolicy::new(self.inner.clone())
14614 }
14615
14616 /// Creates a snapshot in the specified region using the data included
14617 /// in the request.
14618 pub fn insert(&self) -> super::builder::region_snapshots::Insert {
14619 super::builder::region_snapshots::Insert::new(self.inner.clone())
14620 }
14621
14622 /// Retrieves the list of Snapshot resources contained within
14623 /// the specified region.
14624 pub fn list(&self) -> super::builder::region_snapshots::List {
14625 super::builder::region_snapshots::List::new(self.inner.clone())
14626 }
14627
14628 /// Sets the access control policy on the specified resource.
14629 /// Replaces any existing policy.
14630 pub fn set_iam_policy(&self) -> super::builder::region_snapshots::SetIamPolicy {
14631 super::builder::region_snapshots::SetIamPolicy::new(self.inner.clone())
14632 }
14633
14634 /// Sets the labels on a regional snapshot. To learn more about labels, read
14635 /// the Labeling Resources
14636 /// documentation.
14637 pub fn set_labels(&self) -> super::builder::region_snapshots::SetLabels {
14638 super::builder::region_snapshots::SetLabels::new(self.inner.clone())
14639 }
14640
14641 /// Returns permissions that a caller has on the specified resource.
14642 pub fn test_iam_permissions(&self) -> super::builder::region_snapshots::TestIamPermissions {
14643 super::builder::region_snapshots::TestIamPermissions::new(self.inner.clone())
14644 }
14645
14646 /// Rotates the customer-managed
14647 /// encryption key to the latest version for the specified snapshot.
14648 pub fn update_kms_key(&self) -> super::builder::region_snapshots::UpdateKmsKey {
14649 super::builder::region_snapshots::UpdateKmsKey::new(self.inner.clone())
14650 }
14651
14652 /// Retrieves the specified region-specific Operations resource.
14653 pub fn get_operation(&self) -> super::builder::region_snapshots::GetOperation {
14654 super::builder::region_snapshots::GetOperation::new(self.inner.clone())
14655 }
14656}
14657
14658/// Implements a client for the Compute Engine API.
14659///
14660/// # Example
14661/// ```
14662/// # use google_cloud_compute_v1::client::RegionSslCertificates;
14663/// async fn sample(
14664/// ) -> anyhow::Result<()> {
14665/// let client = RegionSslCertificates::builder().build().await?;
14666/// // use `client` to make requests to the Compute Engine API.
14667/// Ok(())
14668/// }
14669/// ```
14670///
14671/// # Service Description
14672///
14673/// Service for the `regionSslCertificates` resource.
14674///
14675/// # Configuration
14676///
14677/// To configure `RegionSslCertificates` use the `with_*` methods in the type returned
14678/// by [builder()][RegionSslCertificates::builder]. The default configuration should
14679/// work for most applications. Common configuration changes include
14680///
14681/// * [with_endpoint()]: by default this client uses the global default endpoint
14682/// (`https://compute.googleapis.com`). Applications using regional
14683/// endpoints or running in restricted networks (e.g. a network configured
14684/// with [Private Google Access with VPC Service Controls]) may want to
14685/// override this default.
14686/// * [with_credentials()]: by default this client uses
14687/// [Application Default Credentials]. Applications using custom
14688/// authentication may need to override this default.
14689///
14690/// [with_endpoint()]: super::builder::region_ssl_certificates::ClientBuilder::with_endpoint
14691/// [with_credentials()]: super::builder::region_ssl_certificates::ClientBuilder::with_credentials
14692/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14693/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14694///
14695/// # Pooling and Cloning
14696///
14697/// `RegionSslCertificates` holds a connection pool internally, it is advised to
14698/// create one and reuse it. You do not need to wrap `RegionSslCertificates` in
14699/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14700/// already uses an `Arc` internally.
14701#[cfg(feature = "region-ssl-certificates")]
14702#[cfg_attr(docsrs, doc(cfg(feature = "region-ssl-certificates")))]
14703#[derive(Clone, Debug)]
14704pub struct RegionSslCertificates {
14705 inner: std::sync::Arc<dyn super::stub::dynamic::RegionSslCertificates>,
14706}
14707
14708#[cfg(feature = "region-ssl-certificates")]
14709impl RegionSslCertificates {
14710 /// Returns a builder for [RegionSslCertificates].
14711 ///
14712 /// ```
14713 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14714 /// # use google_cloud_compute_v1::client::RegionSslCertificates;
14715 /// let client = RegionSslCertificates::builder().build().await?;
14716 /// # Ok(()) }
14717 /// ```
14718 pub fn builder() -> super::builder::region_ssl_certificates::ClientBuilder {
14719 crate::new_client_builder(super::builder::region_ssl_certificates::client::Factory)
14720 }
14721
14722 /// Creates a new client from the provided stub.
14723 ///
14724 /// The most common case for calling this function is in tests mocking the
14725 /// client's behavior.
14726 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
14727 where
14728 T: super::stub::RegionSslCertificates + 'static,
14729 {
14730 Self { inner: stub.into() }
14731 }
14732
14733 pub(crate) async fn new(
14734 config: gaxi::options::ClientConfig,
14735 ) -> crate::ClientBuilderResult<Self> {
14736 let inner = Self::build_inner(config).await?;
14737 Ok(Self { inner })
14738 }
14739
14740 async fn build_inner(
14741 conf: gaxi::options::ClientConfig,
14742 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionSslCertificates>>
14743 {
14744 if gaxi::options::tracing_enabled(&conf) {
14745 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14746 }
14747 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14748 }
14749
14750 async fn build_transport(
14751 conf: gaxi::options::ClientConfig,
14752 ) -> crate::ClientBuilderResult<impl super::stub::RegionSslCertificates> {
14753 super::transport::RegionSslCertificates::new(conf).await
14754 }
14755
14756 async fn build_with_tracing(
14757 conf: gaxi::options::ClientConfig,
14758 ) -> crate::ClientBuilderResult<impl super::stub::RegionSslCertificates> {
14759 Self::build_transport(conf)
14760 .await
14761 .map(super::tracing::RegionSslCertificates::new)
14762 }
14763
14764 /// Deletes the specified SslCertificate resource in the region.
14765 pub fn delete(&self) -> super::builder::region_ssl_certificates::Delete {
14766 super::builder::region_ssl_certificates::Delete::new(self.inner.clone())
14767 }
14768
14769 /// Returns the specified SslCertificate resource in the specified region. Get
14770 /// a list of available SSL certificates by making a list()
14771 /// request.
14772 pub fn get(&self) -> super::builder::region_ssl_certificates::Get {
14773 super::builder::region_ssl_certificates::Get::new(self.inner.clone())
14774 }
14775
14776 /// Creates a SslCertificate resource in the specified project and region using
14777 /// the data included in the request
14778 pub fn insert(&self) -> super::builder::region_ssl_certificates::Insert {
14779 super::builder::region_ssl_certificates::Insert::new(self.inner.clone())
14780 }
14781
14782 /// Retrieves the list of SslCertificate resources available to the specified
14783 /// project in the specified region.
14784 pub fn list(&self) -> super::builder::region_ssl_certificates::List {
14785 super::builder::region_ssl_certificates::List::new(self.inner.clone())
14786 }
14787
14788 /// Retrieves the specified region-specific Operations resource.
14789 pub fn get_operation(&self) -> super::builder::region_ssl_certificates::GetOperation {
14790 super::builder::region_ssl_certificates::GetOperation::new(self.inner.clone())
14791 }
14792}
14793
14794/// Implements a client for the Compute Engine API.
14795///
14796/// # Example
14797/// ```
14798/// # use google_cloud_compute_v1::client::RegionSslPolicies;
14799/// async fn sample(
14800/// ) -> anyhow::Result<()> {
14801/// let client = RegionSslPolicies::builder().build().await?;
14802/// // use `client` to make requests to the Compute Engine API.
14803/// Ok(())
14804/// }
14805/// ```
14806///
14807/// # Service Description
14808///
14809/// Service for the `regionSslPolicies` resource.
14810///
14811/// # Configuration
14812///
14813/// To configure `RegionSslPolicies` use the `with_*` methods in the type returned
14814/// by [builder()][RegionSslPolicies::builder]. The default configuration should
14815/// work for most applications. Common configuration changes include
14816///
14817/// * [with_endpoint()]: by default this client uses the global default endpoint
14818/// (`https://compute.googleapis.com`). Applications using regional
14819/// endpoints or running in restricted networks (e.g. a network configured
14820/// with [Private Google Access with VPC Service Controls]) may want to
14821/// override this default.
14822/// * [with_credentials()]: by default this client uses
14823/// [Application Default Credentials]. Applications using custom
14824/// authentication may need to override this default.
14825///
14826/// [with_endpoint()]: super::builder::region_ssl_policies::ClientBuilder::with_endpoint
14827/// [with_credentials()]: super::builder::region_ssl_policies::ClientBuilder::with_credentials
14828/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14829/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14830///
14831/// # Pooling and Cloning
14832///
14833/// `RegionSslPolicies` holds a connection pool internally, it is advised to
14834/// create one and reuse it. You do not need to wrap `RegionSslPolicies` in
14835/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14836/// already uses an `Arc` internally.
14837#[cfg(feature = "region-ssl-policies")]
14838#[cfg_attr(docsrs, doc(cfg(feature = "region-ssl-policies")))]
14839#[derive(Clone, Debug)]
14840pub struct RegionSslPolicies {
14841 inner: std::sync::Arc<dyn super::stub::dynamic::RegionSslPolicies>,
14842}
14843
14844#[cfg(feature = "region-ssl-policies")]
14845impl RegionSslPolicies {
14846 /// Returns a builder for [RegionSslPolicies].
14847 ///
14848 /// ```
14849 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14850 /// # use google_cloud_compute_v1::client::RegionSslPolicies;
14851 /// let client = RegionSslPolicies::builder().build().await?;
14852 /// # Ok(()) }
14853 /// ```
14854 pub fn builder() -> super::builder::region_ssl_policies::ClientBuilder {
14855 crate::new_client_builder(super::builder::region_ssl_policies::client::Factory)
14856 }
14857
14858 /// Creates a new client from the provided stub.
14859 ///
14860 /// The most common case for calling this function is in tests mocking the
14861 /// client's behavior.
14862 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
14863 where
14864 T: super::stub::RegionSslPolicies + 'static,
14865 {
14866 Self { inner: stub.into() }
14867 }
14868
14869 pub(crate) async fn new(
14870 config: gaxi::options::ClientConfig,
14871 ) -> crate::ClientBuilderResult<Self> {
14872 let inner = Self::build_inner(config).await?;
14873 Ok(Self { inner })
14874 }
14875
14876 async fn build_inner(
14877 conf: gaxi::options::ClientConfig,
14878 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionSslPolicies>>
14879 {
14880 if gaxi::options::tracing_enabled(&conf) {
14881 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14882 }
14883 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14884 }
14885
14886 async fn build_transport(
14887 conf: gaxi::options::ClientConfig,
14888 ) -> crate::ClientBuilderResult<impl super::stub::RegionSslPolicies> {
14889 super::transport::RegionSslPolicies::new(conf).await
14890 }
14891
14892 async fn build_with_tracing(
14893 conf: gaxi::options::ClientConfig,
14894 ) -> crate::ClientBuilderResult<impl super::stub::RegionSslPolicies> {
14895 Self::build_transport(conf)
14896 .await
14897 .map(super::tracing::RegionSslPolicies::new)
14898 }
14899
14900 /// Deletes the specified SSL policy. The SSL policy resource can be deleted
14901 /// only if it is not in use by any TargetHttpsProxy or TargetSslProxy
14902 /// resources.
14903 pub fn delete(&self) -> super::builder::region_ssl_policies::Delete {
14904 super::builder::region_ssl_policies::Delete::new(self.inner.clone())
14905 }
14906
14907 /// Lists all of the ordered rules present in a single specified policy.
14908 pub fn get(&self) -> super::builder::region_ssl_policies::Get {
14909 super::builder::region_ssl_policies::Get::new(self.inner.clone())
14910 }
14911
14912 /// Creates a new policy in the specified project and region using the data
14913 /// included in the request.
14914 pub fn insert(&self) -> super::builder::region_ssl_policies::Insert {
14915 super::builder::region_ssl_policies::Insert::new(self.inner.clone())
14916 }
14917
14918 /// Lists all the SSL policies that have been configured for the specified
14919 /// project and region.
14920 pub fn list(&self) -> super::builder::region_ssl_policies::List {
14921 super::builder::region_ssl_policies::List::new(self.inner.clone())
14922 }
14923
14924 /// Lists all features that can be specified in the SSL policy when using
14925 /// custom profile.
14926 pub fn list_available_features(
14927 &self,
14928 ) -> super::builder::region_ssl_policies::ListAvailableFeatures {
14929 super::builder::region_ssl_policies::ListAvailableFeatures::new(self.inner.clone())
14930 }
14931
14932 /// Patches the specified SSL policy with the data included in the request.
14933 pub fn patch(&self) -> super::builder::region_ssl_policies::Patch {
14934 super::builder::region_ssl_policies::Patch::new(self.inner.clone())
14935 }
14936
14937 /// Retrieves the specified region-specific Operations resource.
14938 pub fn get_operation(&self) -> super::builder::region_ssl_policies::GetOperation {
14939 super::builder::region_ssl_policies::GetOperation::new(self.inner.clone())
14940 }
14941}
14942
14943/// Implements a client for the Compute Engine API.
14944///
14945/// # Example
14946/// ```
14947/// # use google_cloud_compute_v1::client::RegionTargetHttpProxies;
14948/// async fn sample(
14949/// ) -> anyhow::Result<()> {
14950/// let client = RegionTargetHttpProxies::builder().build().await?;
14951/// // use `client` to make requests to the Compute Engine API.
14952/// Ok(())
14953/// }
14954/// ```
14955///
14956/// # Service Description
14957///
14958/// Service for the `regionTargetHttpProxies` resource.
14959///
14960/// # Configuration
14961///
14962/// To configure `RegionTargetHttpProxies` use the `with_*` methods in the type returned
14963/// by [builder()][RegionTargetHttpProxies::builder]. The default configuration should
14964/// work for most applications. Common configuration changes include
14965///
14966/// * [with_endpoint()]: by default this client uses the global default endpoint
14967/// (`https://compute.googleapis.com`). Applications using regional
14968/// endpoints or running in restricted networks (e.g. a network configured
14969/// with [Private Google Access with VPC Service Controls]) may want to
14970/// override this default.
14971/// * [with_credentials()]: by default this client uses
14972/// [Application Default Credentials]. Applications using custom
14973/// authentication may need to override this default.
14974///
14975/// [with_endpoint()]: super::builder::region_target_http_proxies::ClientBuilder::with_endpoint
14976/// [with_credentials()]: super::builder::region_target_http_proxies::ClientBuilder::with_credentials
14977/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14978/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14979///
14980/// # Pooling and Cloning
14981///
14982/// `RegionTargetHttpProxies` holds a connection pool internally, it is advised to
14983/// create one and reuse it. You do not need to wrap `RegionTargetHttpProxies` in
14984/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14985/// already uses an `Arc` internally.
14986#[cfg(feature = "region-target-http-proxies")]
14987#[cfg_attr(docsrs, doc(cfg(feature = "region-target-http-proxies")))]
14988#[derive(Clone, Debug)]
14989pub struct RegionTargetHttpProxies {
14990 inner: std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpProxies>,
14991}
14992
14993#[cfg(feature = "region-target-http-proxies")]
14994impl RegionTargetHttpProxies {
14995 /// Returns a builder for [RegionTargetHttpProxies].
14996 ///
14997 /// ```
14998 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14999 /// # use google_cloud_compute_v1::client::RegionTargetHttpProxies;
15000 /// let client = RegionTargetHttpProxies::builder().build().await?;
15001 /// # Ok(()) }
15002 /// ```
15003 pub fn builder() -> super::builder::region_target_http_proxies::ClientBuilder {
15004 crate::new_client_builder(super::builder::region_target_http_proxies::client::Factory)
15005 }
15006
15007 /// Creates a new client from the provided stub.
15008 ///
15009 /// The most common case for calling this function is in tests mocking the
15010 /// client's behavior.
15011 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
15012 where
15013 T: super::stub::RegionTargetHttpProxies + 'static,
15014 {
15015 Self { inner: stub.into() }
15016 }
15017
15018 pub(crate) async fn new(
15019 config: gaxi::options::ClientConfig,
15020 ) -> crate::ClientBuilderResult<Self> {
15021 let inner = Self::build_inner(config).await?;
15022 Ok(Self { inner })
15023 }
15024
15025 async fn build_inner(
15026 conf: gaxi::options::ClientConfig,
15027 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpProxies>>
15028 {
15029 if gaxi::options::tracing_enabled(&conf) {
15030 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15031 }
15032 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15033 }
15034
15035 async fn build_transport(
15036 conf: gaxi::options::ClientConfig,
15037 ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetHttpProxies> {
15038 super::transport::RegionTargetHttpProxies::new(conf).await
15039 }
15040
15041 async fn build_with_tracing(
15042 conf: gaxi::options::ClientConfig,
15043 ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetHttpProxies> {
15044 Self::build_transport(conf)
15045 .await
15046 .map(super::tracing::RegionTargetHttpProxies::new)
15047 }
15048
15049 /// Deletes the specified TargetHttpProxy resource.
15050 pub fn delete(&self) -> super::builder::region_target_http_proxies::Delete {
15051 super::builder::region_target_http_proxies::Delete::new(self.inner.clone())
15052 }
15053
15054 /// Returns the specified TargetHttpProxy resource in the specified region.
15055 pub fn get(&self) -> super::builder::region_target_http_proxies::Get {
15056 super::builder::region_target_http_proxies::Get::new(self.inner.clone())
15057 }
15058
15059 /// Creates a TargetHttpProxy resource in the specified project and region
15060 /// using the data included in the request.
15061 pub fn insert(&self) -> super::builder::region_target_http_proxies::Insert {
15062 super::builder::region_target_http_proxies::Insert::new(self.inner.clone())
15063 }
15064
15065 /// Retrieves the list of TargetHttpProxy resources available
15066 /// to the specified project in the specified region.
15067 pub fn list(&self) -> super::builder::region_target_http_proxies::List {
15068 super::builder::region_target_http_proxies::List::new(self.inner.clone())
15069 }
15070
15071 /// Changes the URL map for TargetHttpProxy.
15072 pub fn set_url_map(&self) -> super::builder::region_target_http_proxies::SetUrlMap {
15073 super::builder::region_target_http_proxies::SetUrlMap::new(self.inner.clone())
15074 }
15075
15076 /// Retrieves the specified region-specific Operations resource.
15077 pub fn get_operation(&self) -> super::builder::region_target_http_proxies::GetOperation {
15078 super::builder::region_target_http_proxies::GetOperation::new(self.inner.clone())
15079 }
15080}
15081
15082/// Implements a client for the Compute Engine API.
15083///
15084/// # Example
15085/// ```
15086/// # use google_cloud_compute_v1::client::RegionTargetHttpsProxies;
15087/// async fn sample(
15088/// ) -> anyhow::Result<()> {
15089/// let client = RegionTargetHttpsProxies::builder().build().await?;
15090/// // use `client` to make requests to the Compute Engine API.
15091/// Ok(())
15092/// }
15093/// ```
15094///
15095/// # Service Description
15096///
15097/// Service for the `regionTargetHttpsProxies` resource.
15098///
15099/// # Configuration
15100///
15101/// To configure `RegionTargetHttpsProxies` use the `with_*` methods in the type returned
15102/// by [builder()][RegionTargetHttpsProxies::builder]. The default configuration should
15103/// work for most applications. Common configuration changes include
15104///
15105/// * [with_endpoint()]: by default this client uses the global default endpoint
15106/// (`https://compute.googleapis.com`). Applications using regional
15107/// endpoints or running in restricted networks (e.g. a network configured
15108/// with [Private Google Access with VPC Service Controls]) may want to
15109/// override this default.
15110/// * [with_credentials()]: by default this client uses
15111/// [Application Default Credentials]. Applications using custom
15112/// authentication may need to override this default.
15113///
15114/// [with_endpoint()]: super::builder::region_target_https_proxies::ClientBuilder::with_endpoint
15115/// [with_credentials()]: super::builder::region_target_https_proxies::ClientBuilder::with_credentials
15116/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15117/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15118///
15119/// # Pooling and Cloning
15120///
15121/// `RegionTargetHttpsProxies` holds a connection pool internally, it is advised to
15122/// create one and reuse it. You do not need to wrap `RegionTargetHttpsProxies` in
15123/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15124/// already uses an `Arc` internally.
15125#[cfg(feature = "region-target-https-proxies")]
15126#[cfg_attr(docsrs, doc(cfg(feature = "region-target-https-proxies")))]
15127#[derive(Clone, Debug)]
15128pub struct RegionTargetHttpsProxies {
15129 inner: std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpsProxies>,
15130}
15131
15132#[cfg(feature = "region-target-https-proxies")]
15133impl RegionTargetHttpsProxies {
15134 /// Returns a builder for [RegionTargetHttpsProxies].
15135 ///
15136 /// ```
15137 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15138 /// # use google_cloud_compute_v1::client::RegionTargetHttpsProxies;
15139 /// let client = RegionTargetHttpsProxies::builder().build().await?;
15140 /// # Ok(()) }
15141 /// ```
15142 pub fn builder() -> super::builder::region_target_https_proxies::ClientBuilder {
15143 crate::new_client_builder(super::builder::region_target_https_proxies::client::Factory)
15144 }
15145
15146 /// Creates a new client from the provided stub.
15147 ///
15148 /// The most common case for calling this function is in tests mocking the
15149 /// client's behavior.
15150 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
15151 where
15152 T: super::stub::RegionTargetHttpsProxies + 'static,
15153 {
15154 Self { inner: stub.into() }
15155 }
15156
15157 pub(crate) async fn new(
15158 config: gaxi::options::ClientConfig,
15159 ) -> crate::ClientBuilderResult<Self> {
15160 let inner = Self::build_inner(config).await?;
15161 Ok(Self { inner })
15162 }
15163
15164 async fn build_inner(
15165 conf: gaxi::options::ClientConfig,
15166 ) -> crate::ClientBuilderResult<
15167 std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpsProxies>,
15168 > {
15169 if gaxi::options::tracing_enabled(&conf) {
15170 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15171 }
15172 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15173 }
15174
15175 async fn build_transport(
15176 conf: gaxi::options::ClientConfig,
15177 ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetHttpsProxies> {
15178 super::transport::RegionTargetHttpsProxies::new(conf).await
15179 }
15180
15181 async fn build_with_tracing(
15182 conf: gaxi::options::ClientConfig,
15183 ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetHttpsProxies> {
15184 Self::build_transport(conf)
15185 .await
15186 .map(super::tracing::RegionTargetHttpsProxies::new)
15187 }
15188
15189 /// Deletes the specified TargetHttpsProxy resource.
15190 pub fn delete(&self) -> super::builder::region_target_https_proxies::Delete {
15191 super::builder::region_target_https_proxies::Delete::new(self.inner.clone())
15192 }
15193
15194 /// Returns the specified TargetHttpsProxy resource in the specified region.
15195 pub fn get(&self) -> super::builder::region_target_https_proxies::Get {
15196 super::builder::region_target_https_proxies::Get::new(self.inner.clone())
15197 }
15198
15199 /// Creates a TargetHttpsProxy resource in the specified project and region
15200 /// using the data included in the request.
15201 pub fn insert(&self) -> super::builder::region_target_https_proxies::Insert {
15202 super::builder::region_target_https_proxies::Insert::new(self.inner.clone())
15203 }
15204
15205 /// Retrieves the list of TargetHttpsProxy resources available
15206 /// to the specified project in the specified region.
15207 pub fn list(&self) -> super::builder::region_target_https_proxies::List {
15208 super::builder::region_target_https_proxies::List::new(self.inner.clone())
15209 }
15210
15211 /// Patches the specified regional TargetHttpsProxy resource with the data
15212 /// included in the request. This method supports PATCH
15213 /// semantics and usesJSON merge
15214 /// patch format and processing rules.
15215 pub fn patch(&self) -> super::builder::region_target_https_proxies::Patch {
15216 super::builder::region_target_https_proxies::Patch::new(self.inner.clone())
15217 }
15218
15219 /// Replaces SslCertificates for TargetHttpsProxy.
15220 pub fn set_ssl_certificates(
15221 &self,
15222 ) -> super::builder::region_target_https_proxies::SetSslCertificates {
15223 super::builder::region_target_https_proxies::SetSslCertificates::new(self.inner.clone())
15224 }
15225
15226 /// Changes the URL map for TargetHttpsProxy.
15227 pub fn set_url_map(&self) -> super::builder::region_target_https_proxies::SetUrlMap {
15228 super::builder::region_target_https_proxies::SetUrlMap::new(self.inner.clone())
15229 }
15230
15231 /// Retrieves the specified region-specific Operations resource.
15232 pub fn get_operation(&self) -> super::builder::region_target_https_proxies::GetOperation {
15233 super::builder::region_target_https_proxies::GetOperation::new(self.inner.clone())
15234 }
15235}
15236
15237/// Implements a client for the Compute Engine API.
15238///
15239/// # Example
15240/// ```
15241/// # use google_cloud_compute_v1::client::RegionTargetTcpProxies;
15242/// async fn sample(
15243/// ) -> anyhow::Result<()> {
15244/// let client = RegionTargetTcpProxies::builder().build().await?;
15245/// // use `client` to make requests to the Compute Engine API.
15246/// Ok(())
15247/// }
15248/// ```
15249///
15250/// # Service Description
15251///
15252/// Service for the `regionTargetTcpProxies` resource.
15253///
15254/// # Configuration
15255///
15256/// To configure `RegionTargetTcpProxies` use the `with_*` methods in the type returned
15257/// by [builder()][RegionTargetTcpProxies::builder]. The default configuration should
15258/// work for most applications. Common configuration changes include
15259///
15260/// * [with_endpoint()]: by default this client uses the global default endpoint
15261/// (`https://compute.googleapis.com`). Applications using regional
15262/// endpoints or running in restricted networks (e.g. a network configured
15263/// with [Private Google Access with VPC Service Controls]) may want to
15264/// override this default.
15265/// * [with_credentials()]: by default this client uses
15266/// [Application Default Credentials]. Applications using custom
15267/// authentication may need to override this default.
15268///
15269/// [with_endpoint()]: super::builder::region_target_tcp_proxies::ClientBuilder::with_endpoint
15270/// [with_credentials()]: super::builder::region_target_tcp_proxies::ClientBuilder::with_credentials
15271/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15272/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15273///
15274/// # Pooling and Cloning
15275///
15276/// `RegionTargetTcpProxies` holds a connection pool internally, it is advised to
15277/// create one and reuse it. You do not need to wrap `RegionTargetTcpProxies` in
15278/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15279/// already uses an `Arc` internally.
15280#[cfg(feature = "region-target-tcp-proxies")]
15281#[cfg_attr(docsrs, doc(cfg(feature = "region-target-tcp-proxies")))]
15282#[derive(Clone, Debug)]
15283pub struct RegionTargetTcpProxies {
15284 inner: std::sync::Arc<dyn super::stub::dynamic::RegionTargetTcpProxies>,
15285}
15286
15287#[cfg(feature = "region-target-tcp-proxies")]
15288impl RegionTargetTcpProxies {
15289 /// Returns a builder for [RegionTargetTcpProxies].
15290 ///
15291 /// ```
15292 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15293 /// # use google_cloud_compute_v1::client::RegionTargetTcpProxies;
15294 /// let client = RegionTargetTcpProxies::builder().build().await?;
15295 /// # Ok(()) }
15296 /// ```
15297 pub fn builder() -> super::builder::region_target_tcp_proxies::ClientBuilder {
15298 crate::new_client_builder(super::builder::region_target_tcp_proxies::client::Factory)
15299 }
15300
15301 /// Creates a new client from the provided stub.
15302 ///
15303 /// The most common case for calling this function is in tests mocking the
15304 /// client's behavior.
15305 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
15306 where
15307 T: super::stub::RegionTargetTcpProxies + 'static,
15308 {
15309 Self { inner: stub.into() }
15310 }
15311
15312 pub(crate) async fn new(
15313 config: gaxi::options::ClientConfig,
15314 ) -> crate::ClientBuilderResult<Self> {
15315 let inner = Self::build_inner(config).await?;
15316 Ok(Self { inner })
15317 }
15318
15319 async fn build_inner(
15320 conf: gaxi::options::ClientConfig,
15321 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionTargetTcpProxies>>
15322 {
15323 if gaxi::options::tracing_enabled(&conf) {
15324 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15325 }
15326 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15327 }
15328
15329 async fn build_transport(
15330 conf: gaxi::options::ClientConfig,
15331 ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetTcpProxies> {
15332 super::transport::RegionTargetTcpProxies::new(conf).await
15333 }
15334
15335 async fn build_with_tracing(
15336 conf: gaxi::options::ClientConfig,
15337 ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetTcpProxies> {
15338 Self::build_transport(conf)
15339 .await
15340 .map(super::tracing::RegionTargetTcpProxies::new)
15341 }
15342
15343 /// Deletes the specified TargetTcpProxy resource.
15344 pub fn delete(&self) -> super::builder::region_target_tcp_proxies::Delete {
15345 super::builder::region_target_tcp_proxies::Delete::new(self.inner.clone())
15346 }
15347
15348 /// Returns the specified TargetTcpProxy resource.
15349 pub fn get(&self) -> super::builder::region_target_tcp_proxies::Get {
15350 super::builder::region_target_tcp_proxies::Get::new(self.inner.clone())
15351 }
15352
15353 /// Creates a TargetTcpProxy resource in the specified project and region using
15354 /// the data included in the request.
15355 pub fn insert(&self) -> super::builder::region_target_tcp_proxies::Insert {
15356 super::builder::region_target_tcp_proxies::Insert::new(self.inner.clone())
15357 }
15358
15359 /// Retrieves a list of TargetTcpProxy resources
15360 /// available to the specified project in a given region.
15361 pub fn list(&self) -> super::builder::region_target_tcp_proxies::List {
15362 super::builder::region_target_tcp_proxies::List::new(self.inner.clone())
15363 }
15364
15365 /// Retrieves the specified region-specific Operations resource.
15366 pub fn get_operation(&self) -> super::builder::region_target_tcp_proxies::GetOperation {
15367 super::builder::region_target_tcp_proxies::GetOperation::new(self.inner.clone())
15368 }
15369}
15370
15371/// Implements a client for the Compute Engine API.
15372///
15373/// # Example
15374/// ```
15375/// # use google_cloud_compute_v1::client::RegionUrlMaps;
15376/// async fn sample(
15377/// ) -> anyhow::Result<()> {
15378/// let client = RegionUrlMaps::builder().build().await?;
15379/// // use `client` to make requests to the Compute Engine API.
15380/// Ok(())
15381/// }
15382/// ```
15383///
15384/// # Service Description
15385///
15386/// Service for the `regionUrlMaps` resource.
15387///
15388/// # Configuration
15389///
15390/// To configure `RegionUrlMaps` use the `with_*` methods in the type returned
15391/// by [builder()][RegionUrlMaps::builder]. The default configuration should
15392/// work for most applications. Common configuration changes include
15393///
15394/// * [with_endpoint()]: by default this client uses the global default endpoint
15395/// (`https://compute.googleapis.com`). Applications using regional
15396/// endpoints or running in restricted networks (e.g. a network configured
15397/// with [Private Google Access with VPC Service Controls]) may want to
15398/// override this default.
15399/// * [with_credentials()]: by default this client uses
15400/// [Application Default Credentials]. Applications using custom
15401/// authentication may need to override this default.
15402///
15403/// [with_endpoint()]: super::builder::region_url_maps::ClientBuilder::with_endpoint
15404/// [with_credentials()]: super::builder::region_url_maps::ClientBuilder::with_credentials
15405/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15406/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15407///
15408/// # Pooling and Cloning
15409///
15410/// `RegionUrlMaps` holds a connection pool internally, it is advised to
15411/// create one and reuse it. You do not need to wrap `RegionUrlMaps` in
15412/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15413/// already uses an `Arc` internally.
15414#[cfg(feature = "region-url-maps")]
15415#[cfg_attr(docsrs, doc(cfg(feature = "region-url-maps")))]
15416#[derive(Clone, Debug)]
15417pub struct RegionUrlMaps {
15418 inner: std::sync::Arc<dyn super::stub::dynamic::RegionUrlMaps>,
15419}
15420
15421#[cfg(feature = "region-url-maps")]
15422impl RegionUrlMaps {
15423 /// Returns a builder for [RegionUrlMaps].
15424 ///
15425 /// ```
15426 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15427 /// # use google_cloud_compute_v1::client::RegionUrlMaps;
15428 /// let client = RegionUrlMaps::builder().build().await?;
15429 /// # Ok(()) }
15430 /// ```
15431 pub fn builder() -> super::builder::region_url_maps::ClientBuilder {
15432 crate::new_client_builder(super::builder::region_url_maps::client::Factory)
15433 }
15434
15435 /// Creates a new client from the provided stub.
15436 ///
15437 /// The most common case for calling this function is in tests mocking the
15438 /// client's behavior.
15439 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
15440 where
15441 T: super::stub::RegionUrlMaps + 'static,
15442 {
15443 Self { inner: stub.into() }
15444 }
15445
15446 pub(crate) async fn new(
15447 config: gaxi::options::ClientConfig,
15448 ) -> crate::ClientBuilderResult<Self> {
15449 let inner = Self::build_inner(config).await?;
15450 Ok(Self { inner })
15451 }
15452
15453 async fn build_inner(
15454 conf: gaxi::options::ClientConfig,
15455 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionUrlMaps>> {
15456 if gaxi::options::tracing_enabled(&conf) {
15457 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15458 }
15459 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15460 }
15461
15462 async fn build_transport(
15463 conf: gaxi::options::ClientConfig,
15464 ) -> crate::ClientBuilderResult<impl super::stub::RegionUrlMaps> {
15465 super::transport::RegionUrlMaps::new(conf).await
15466 }
15467
15468 async fn build_with_tracing(
15469 conf: gaxi::options::ClientConfig,
15470 ) -> crate::ClientBuilderResult<impl super::stub::RegionUrlMaps> {
15471 Self::build_transport(conf)
15472 .await
15473 .map(super::tracing::RegionUrlMaps::new)
15474 }
15475
15476 /// Deletes the specified UrlMap resource.
15477 pub fn delete(&self) -> super::builder::region_url_maps::Delete {
15478 super::builder::region_url_maps::Delete::new(self.inner.clone())
15479 }
15480
15481 /// Returns the specified UrlMap resource.
15482 pub fn get(&self) -> super::builder::region_url_maps::Get {
15483 super::builder::region_url_maps::Get::new(self.inner.clone())
15484 }
15485
15486 /// Creates a UrlMap resource in the specified project using
15487 /// the data included in the request.
15488 pub fn insert(&self) -> super::builder::region_url_maps::Insert {
15489 super::builder::region_url_maps::Insert::new(self.inner.clone())
15490 }
15491
15492 /// Retrieves the list of UrlMap resources available to the specified
15493 /// project in the specified region.
15494 pub fn list(&self) -> super::builder::region_url_maps::List {
15495 super::builder::region_url_maps::List::new(self.inner.clone())
15496 }
15497
15498 /// Patches the specified UrlMap resource with the data included in the
15499 /// request. This method supportsPATCH
15500 /// semantics and usesJSON merge
15501 /// patch format and processing rules.
15502 pub fn patch(&self) -> super::builder::region_url_maps::Patch {
15503 super::builder::region_url_maps::Patch::new(self.inner.clone())
15504 }
15505
15506 /// Updates the specified UrlMap resource with the data included in the
15507 /// request.
15508 pub fn update(&self) -> super::builder::region_url_maps::Update {
15509 super::builder::region_url_maps::Update::new(self.inner.clone())
15510 }
15511
15512 /// Runs static validation for the UrlMap. In particular, the tests of the
15513 /// provided UrlMap will be run. Calling this method does NOT create the
15514 /// UrlMap.
15515 pub fn validate(&self) -> super::builder::region_url_maps::Validate {
15516 super::builder::region_url_maps::Validate::new(self.inner.clone())
15517 }
15518
15519 /// Retrieves the specified region-specific Operations resource.
15520 pub fn get_operation(&self) -> super::builder::region_url_maps::GetOperation {
15521 super::builder::region_url_maps::GetOperation::new(self.inner.clone())
15522 }
15523}
15524
15525/// Implements a client for the Compute Engine API.
15526///
15527/// # Example
15528/// ```
15529/// # use google_cloud_compute_v1::client::RegionZones;
15530/// async fn sample(
15531/// ) -> anyhow::Result<()> {
15532/// let client = RegionZones::builder().build().await?;
15533/// // use `client` to make requests to the Compute Engine API.
15534/// Ok(())
15535/// }
15536/// ```
15537///
15538/// # Service Description
15539///
15540/// Service for the `regionZones` resource.
15541///
15542/// # Configuration
15543///
15544/// To configure `RegionZones` use the `with_*` methods in the type returned
15545/// by [builder()][RegionZones::builder]. The default configuration should
15546/// work for most applications. Common configuration changes include
15547///
15548/// * [with_endpoint()]: by default this client uses the global default endpoint
15549/// (`https://compute.googleapis.com`). Applications using regional
15550/// endpoints or running in restricted networks (e.g. a network configured
15551/// with [Private Google Access with VPC Service Controls]) may want to
15552/// override this default.
15553/// * [with_credentials()]: by default this client uses
15554/// [Application Default Credentials]. Applications using custom
15555/// authentication may need to override this default.
15556///
15557/// [with_endpoint()]: super::builder::region_zones::ClientBuilder::with_endpoint
15558/// [with_credentials()]: super::builder::region_zones::ClientBuilder::with_credentials
15559/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15560/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15561///
15562/// # Pooling and Cloning
15563///
15564/// `RegionZones` holds a connection pool internally, it is advised to
15565/// create one and reuse it. You do not need to wrap `RegionZones` in
15566/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15567/// already uses an `Arc` internally.
15568#[cfg(feature = "region-zones")]
15569#[cfg_attr(docsrs, doc(cfg(feature = "region-zones")))]
15570#[derive(Clone, Debug)]
15571pub struct RegionZones {
15572 inner: std::sync::Arc<dyn super::stub::dynamic::RegionZones>,
15573}
15574
15575#[cfg(feature = "region-zones")]
15576impl RegionZones {
15577 /// Returns a builder for [RegionZones].
15578 ///
15579 /// ```
15580 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15581 /// # use google_cloud_compute_v1::client::RegionZones;
15582 /// let client = RegionZones::builder().build().await?;
15583 /// # Ok(()) }
15584 /// ```
15585 pub fn builder() -> super::builder::region_zones::ClientBuilder {
15586 crate::new_client_builder(super::builder::region_zones::client::Factory)
15587 }
15588
15589 /// Creates a new client from the provided stub.
15590 ///
15591 /// The most common case for calling this function is in tests mocking the
15592 /// client's behavior.
15593 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
15594 where
15595 T: super::stub::RegionZones + 'static,
15596 {
15597 Self { inner: stub.into() }
15598 }
15599
15600 pub(crate) async fn new(
15601 config: gaxi::options::ClientConfig,
15602 ) -> crate::ClientBuilderResult<Self> {
15603 let inner = Self::build_inner(config).await?;
15604 Ok(Self { inner })
15605 }
15606
15607 async fn build_inner(
15608 conf: gaxi::options::ClientConfig,
15609 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionZones>> {
15610 if gaxi::options::tracing_enabled(&conf) {
15611 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15612 }
15613 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15614 }
15615
15616 async fn build_transport(
15617 conf: gaxi::options::ClientConfig,
15618 ) -> crate::ClientBuilderResult<impl super::stub::RegionZones> {
15619 super::transport::RegionZones::new(conf).await
15620 }
15621
15622 async fn build_with_tracing(
15623 conf: gaxi::options::ClientConfig,
15624 ) -> crate::ClientBuilderResult<impl super::stub::RegionZones> {
15625 Self::build_transport(conf)
15626 .await
15627 .map(super::tracing::RegionZones::new)
15628 }
15629
15630 /// Retrieves the list of Zone resources under the specific region available to
15631 /// the specified project.
15632 pub fn list(&self) -> super::builder::region_zones::List {
15633 super::builder::region_zones::List::new(self.inner.clone())
15634 }
15635}
15636
15637/// Implements a client for the Compute Engine API.
15638///
15639/// # Example
15640/// ```
15641/// # use google_cloud_compute_v1::client::Regions;
15642/// async fn sample(
15643/// ) -> anyhow::Result<()> {
15644/// let client = Regions::builder().build().await?;
15645/// // use `client` to make requests to the Compute Engine API.
15646/// Ok(())
15647/// }
15648/// ```
15649///
15650/// # Service Description
15651///
15652/// Service for the `regions` resource.
15653///
15654/// # Configuration
15655///
15656/// To configure `Regions` use the `with_*` methods in the type returned
15657/// by [builder()][Regions::builder]. The default configuration should
15658/// work for most applications. Common configuration changes include
15659///
15660/// * [with_endpoint()]: by default this client uses the global default endpoint
15661/// (`https://compute.googleapis.com`). Applications using regional
15662/// endpoints or running in restricted networks (e.g. a network configured
15663/// with [Private Google Access with VPC Service Controls]) may want to
15664/// override this default.
15665/// * [with_credentials()]: by default this client uses
15666/// [Application Default Credentials]. Applications using custom
15667/// authentication may need to override this default.
15668///
15669/// [with_endpoint()]: super::builder::regions::ClientBuilder::with_endpoint
15670/// [with_credentials()]: super::builder::regions::ClientBuilder::with_credentials
15671/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15672/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15673///
15674/// # Pooling and Cloning
15675///
15676/// `Regions` holds a connection pool internally, it is advised to
15677/// create one and reuse it. You do not need to wrap `Regions` in
15678/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15679/// already uses an `Arc` internally.
15680#[cfg(feature = "regions")]
15681#[cfg_attr(docsrs, doc(cfg(feature = "regions")))]
15682#[derive(Clone, Debug)]
15683pub struct Regions {
15684 inner: std::sync::Arc<dyn super::stub::dynamic::Regions>,
15685}
15686
15687#[cfg(feature = "regions")]
15688impl Regions {
15689 /// Returns a builder for [Regions].
15690 ///
15691 /// ```
15692 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15693 /// # use google_cloud_compute_v1::client::Regions;
15694 /// let client = Regions::builder().build().await?;
15695 /// # Ok(()) }
15696 /// ```
15697 pub fn builder() -> super::builder::regions::ClientBuilder {
15698 crate::new_client_builder(super::builder::regions::client::Factory)
15699 }
15700
15701 /// Creates a new client from the provided stub.
15702 ///
15703 /// The most common case for calling this function is in tests mocking the
15704 /// client's behavior.
15705 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
15706 where
15707 T: super::stub::Regions + 'static,
15708 {
15709 Self { inner: stub.into() }
15710 }
15711
15712 pub(crate) async fn new(
15713 config: gaxi::options::ClientConfig,
15714 ) -> crate::ClientBuilderResult<Self> {
15715 let inner = Self::build_inner(config).await?;
15716 Ok(Self { inner })
15717 }
15718
15719 async fn build_inner(
15720 conf: gaxi::options::ClientConfig,
15721 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Regions>> {
15722 if gaxi::options::tracing_enabled(&conf) {
15723 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15724 }
15725 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15726 }
15727
15728 async fn build_transport(
15729 conf: gaxi::options::ClientConfig,
15730 ) -> crate::ClientBuilderResult<impl super::stub::Regions> {
15731 super::transport::Regions::new(conf).await
15732 }
15733
15734 async fn build_with_tracing(
15735 conf: gaxi::options::ClientConfig,
15736 ) -> crate::ClientBuilderResult<impl super::stub::Regions> {
15737 Self::build_transport(conf)
15738 .await
15739 .map(super::tracing::Regions::new)
15740 }
15741
15742 /// Returns the specified Region resource.
15743 ///
15744 /// To decrease latency for this method, you can optionally omit any unneeded
15745 /// information from the response by using a field mask. This practice is
15746 /// especially recommended for unused quota information (the `quotas` field).
15747 /// To exclude one or more fields, set your request's `fields` query parameter
15748 /// to only include the fields you need. For example, to only include the `id`
15749 /// and `selfLink` fields, add the query parameter `?fields=id,selfLink` to
15750 /// your request.
15751 ///
15752 /// This method fails if the quota information is unavailable for the region
15753 /// and if the organization policy constraint
15754 /// compute.requireBasicQuotaInResponse is enforced. This
15755 /// constraint, when enforced, disables the fail-open behaviour when quota
15756 /// information (the `items.quotas` field) is unavailable for the region.
15757 /// It is recommended to use the default setting
15758 /// for the constraint unless your application requires the fail-closed
15759 /// behaviour for this method.
15760 pub fn get(&self) -> super::builder::regions::Get {
15761 super::builder::regions::Get::new(self.inner.clone())
15762 }
15763
15764 /// Retrieves the list of region resources available to the specified project.
15765 ///
15766 /// To decrease latency for this method, you can optionally omit any unneeded
15767 /// information from the response by using a field mask. This practice is
15768 /// especially recommended for unused quota information
15769 /// (the `items.quotas` field).
15770 /// To exclude one or more fields, set your request's `fields` query parameter
15771 /// to only include the fields you need. For example, to only include the `id`
15772 /// and `selfLink` fields, add the query parameter `?fields=id,selfLink` to
15773 /// your request.
15774 ///
15775 /// This method fails if the quota information is unavailable for the region
15776 /// and if the organization policy constraint
15777 /// compute.requireBasicQuotaInResponse is enforced. This
15778 /// constraint, when enforced, disables the fail-open behaviour when quota
15779 /// information (the `items.quotas` field) is unavailable for the region.
15780 /// It is recommended to use the default setting
15781 /// for the constraint unless your application requires the fail-closed
15782 /// behaviour for this method.
15783 pub fn list(&self) -> super::builder::regions::List {
15784 super::builder::regions::List::new(self.inner.clone())
15785 }
15786}
15787
15788/// Implements a client for the Compute Engine API.
15789///
15790/// # Example
15791/// ```
15792/// # use google_cloud_compute_v1::client::ReliabilityRisks;
15793/// async fn sample(
15794/// ) -> anyhow::Result<()> {
15795/// let client = ReliabilityRisks::builder().build().await?;
15796/// // use `client` to make requests to the Compute Engine API.
15797/// Ok(())
15798/// }
15799/// ```
15800///
15801/// # Service Description
15802///
15803/// Service for the `reliabilityRisks` resource.
15804///
15805/// # Configuration
15806///
15807/// To configure `ReliabilityRisks` use the `with_*` methods in the type returned
15808/// by [builder()][ReliabilityRisks::builder]. The default configuration should
15809/// work for most applications. Common configuration changes include
15810///
15811/// * [with_endpoint()]: by default this client uses the global default endpoint
15812/// (`https://compute.googleapis.com`). Applications using regional
15813/// endpoints or running in restricted networks (e.g. a network configured
15814/// with [Private Google Access with VPC Service Controls]) may want to
15815/// override this default.
15816/// * [with_credentials()]: by default this client uses
15817/// [Application Default Credentials]. Applications using custom
15818/// authentication may need to override this default.
15819///
15820/// [with_endpoint()]: super::builder::reliability_risks::ClientBuilder::with_endpoint
15821/// [with_credentials()]: super::builder::reliability_risks::ClientBuilder::with_credentials
15822/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15823/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15824///
15825/// # Pooling and Cloning
15826///
15827/// `ReliabilityRisks` holds a connection pool internally, it is advised to
15828/// create one and reuse it. You do not need to wrap `ReliabilityRisks` in
15829/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15830/// already uses an `Arc` internally.
15831#[cfg(feature = "reliability-risks")]
15832#[cfg_attr(docsrs, doc(cfg(feature = "reliability-risks")))]
15833#[derive(Clone, Debug)]
15834pub struct ReliabilityRisks {
15835 inner: std::sync::Arc<dyn super::stub::dynamic::ReliabilityRisks>,
15836}
15837
15838#[cfg(feature = "reliability-risks")]
15839impl ReliabilityRisks {
15840 /// Returns a builder for [ReliabilityRisks].
15841 ///
15842 /// ```
15843 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15844 /// # use google_cloud_compute_v1::client::ReliabilityRisks;
15845 /// let client = ReliabilityRisks::builder().build().await?;
15846 /// # Ok(()) }
15847 /// ```
15848 pub fn builder() -> super::builder::reliability_risks::ClientBuilder {
15849 crate::new_client_builder(super::builder::reliability_risks::client::Factory)
15850 }
15851
15852 /// Creates a new client from the provided stub.
15853 ///
15854 /// The most common case for calling this function is in tests mocking the
15855 /// client's behavior.
15856 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
15857 where
15858 T: super::stub::ReliabilityRisks + 'static,
15859 {
15860 Self { inner: stub.into() }
15861 }
15862
15863 pub(crate) async fn new(
15864 config: gaxi::options::ClientConfig,
15865 ) -> crate::ClientBuilderResult<Self> {
15866 let inner = Self::build_inner(config).await?;
15867 Ok(Self { inner })
15868 }
15869
15870 async fn build_inner(
15871 conf: gaxi::options::ClientConfig,
15872 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ReliabilityRisks>>
15873 {
15874 if gaxi::options::tracing_enabled(&conf) {
15875 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15876 }
15877 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15878 }
15879
15880 async fn build_transport(
15881 conf: gaxi::options::ClientConfig,
15882 ) -> crate::ClientBuilderResult<impl super::stub::ReliabilityRisks> {
15883 super::transport::ReliabilityRisks::new(conf).await
15884 }
15885
15886 async fn build_with_tracing(
15887 conf: gaxi::options::ClientConfig,
15888 ) -> crate::ClientBuilderResult<impl super::stub::ReliabilityRisks> {
15889 Self::build_transport(conf)
15890 .await
15891 .map(super::tracing::ReliabilityRisks::new)
15892 }
15893
15894 /// Returns the specified ReliabilityRisk resource.
15895 pub fn get(&self) -> super::builder::reliability_risks::Get {
15896 super::builder::reliability_risks::Get::new(self.inner.clone())
15897 }
15898
15899 /// Retrieves the list of reliabilityRisks available in the specified project.
15900 pub fn list(&self) -> super::builder::reliability_risks::List {
15901 super::builder::reliability_risks::List::new(self.inner.clone())
15902 }
15903}
15904
15905/// Implements a client for the Compute Engine API.
15906///
15907/// # Example
15908/// ```
15909/// # use google_cloud_compute_v1::client::ReservationBlocks;
15910/// async fn sample(
15911/// ) -> anyhow::Result<()> {
15912/// let client = ReservationBlocks::builder().build().await?;
15913/// // use `client` to make requests to the Compute Engine API.
15914/// Ok(())
15915/// }
15916/// ```
15917///
15918/// # Service Description
15919///
15920/// Service for the `reservationBlocks` resource.
15921///
15922/// # Configuration
15923///
15924/// To configure `ReservationBlocks` use the `with_*` methods in the type returned
15925/// by [builder()][ReservationBlocks::builder]. The default configuration should
15926/// work for most applications. Common configuration changes include
15927///
15928/// * [with_endpoint()]: by default this client uses the global default endpoint
15929/// (`https://compute.googleapis.com`). Applications using regional
15930/// endpoints or running in restricted networks (e.g. a network configured
15931/// with [Private Google Access with VPC Service Controls]) may want to
15932/// override this default.
15933/// * [with_credentials()]: by default this client uses
15934/// [Application Default Credentials]. Applications using custom
15935/// authentication may need to override this default.
15936///
15937/// [with_endpoint()]: super::builder::reservation_blocks::ClientBuilder::with_endpoint
15938/// [with_credentials()]: super::builder::reservation_blocks::ClientBuilder::with_credentials
15939/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15940/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15941///
15942/// # Pooling and Cloning
15943///
15944/// `ReservationBlocks` holds a connection pool internally, it is advised to
15945/// create one and reuse it. You do not need to wrap `ReservationBlocks` in
15946/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15947/// already uses an `Arc` internally.
15948#[cfg(feature = "reservation-blocks")]
15949#[cfg_attr(docsrs, doc(cfg(feature = "reservation-blocks")))]
15950#[derive(Clone, Debug)]
15951pub struct ReservationBlocks {
15952 inner: std::sync::Arc<dyn super::stub::dynamic::ReservationBlocks>,
15953}
15954
15955#[cfg(feature = "reservation-blocks")]
15956impl ReservationBlocks {
15957 /// Returns a builder for [ReservationBlocks].
15958 ///
15959 /// ```
15960 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15961 /// # use google_cloud_compute_v1::client::ReservationBlocks;
15962 /// let client = ReservationBlocks::builder().build().await?;
15963 /// # Ok(()) }
15964 /// ```
15965 pub fn builder() -> super::builder::reservation_blocks::ClientBuilder {
15966 crate::new_client_builder(super::builder::reservation_blocks::client::Factory)
15967 }
15968
15969 /// Creates a new client from the provided stub.
15970 ///
15971 /// The most common case for calling this function is in tests mocking the
15972 /// client's behavior.
15973 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
15974 where
15975 T: super::stub::ReservationBlocks + 'static,
15976 {
15977 Self { inner: stub.into() }
15978 }
15979
15980 pub(crate) async fn new(
15981 config: gaxi::options::ClientConfig,
15982 ) -> crate::ClientBuilderResult<Self> {
15983 let inner = Self::build_inner(config).await?;
15984 Ok(Self { inner })
15985 }
15986
15987 async fn build_inner(
15988 conf: gaxi::options::ClientConfig,
15989 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ReservationBlocks>>
15990 {
15991 if gaxi::options::tracing_enabled(&conf) {
15992 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15993 }
15994 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15995 }
15996
15997 async fn build_transport(
15998 conf: gaxi::options::ClientConfig,
15999 ) -> crate::ClientBuilderResult<impl super::stub::ReservationBlocks> {
16000 super::transport::ReservationBlocks::new(conf).await
16001 }
16002
16003 async fn build_with_tracing(
16004 conf: gaxi::options::ClientConfig,
16005 ) -> crate::ClientBuilderResult<impl super::stub::ReservationBlocks> {
16006 Self::build_transport(conf)
16007 .await
16008 .map(super::tracing::ReservationBlocks::new)
16009 }
16010
16011 /// Retrieves information about the specified reservation block.
16012 pub fn get(&self) -> super::builder::reservation_blocks::Get {
16013 super::builder::reservation_blocks::Get::new(self.inner.clone())
16014 }
16015
16016 /// Gets the access control policy for a resource. May be empty if no such
16017 /// policy or resource exists.
16018 pub fn get_iam_policy(&self) -> super::builder::reservation_blocks::GetIamPolicy {
16019 super::builder::reservation_blocks::GetIamPolicy::new(self.inner.clone())
16020 }
16021
16022 /// Retrieves a list of reservation blocks under a single reservation.
16023 pub fn list(&self) -> super::builder::reservation_blocks::List {
16024 super::builder::reservation_blocks::List::new(self.inner.clone())
16025 }
16026
16027 /// Allows customers to perform maintenance on a reservation block
16028 pub fn perform_maintenance(&self) -> super::builder::reservation_blocks::PerformMaintenance {
16029 super::builder::reservation_blocks::PerformMaintenance::new(self.inner.clone())
16030 }
16031
16032 /// Sets the access control policy on the specified resource.
16033 /// Replaces any existing policy.
16034 pub fn set_iam_policy(&self) -> super::builder::reservation_blocks::SetIamPolicy {
16035 super::builder::reservation_blocks::SetIamPolicy::new(self.inner.clone())
16036 }
16037
16038 /// Returns permissions that a caller has on the specified resource.
16039 pub fn test_iam_permissions(&self) -> super::builder::reservation_blocks::TestIamPermissions {
16040 super::builder::reservation_blocks::TestIamPermissions::new(self.inner.clone())
16041 }
16042
16043 /// Retrieves the specified zone-specific Operations resource.
16044 pub fn get_operation(&self) -> super::builder::reservation_blocks::GetOperation {
16045 super::builder::reservation_blocks::GetOperation::new(self.inner.clone())
16046 }
16047}
16048
16049/// Implements a client for the Compute Engine API.
16050///
16051/// # Example
16052/// ```
16053/// # use google_cloud_compute_v1::client::ReservationSlots;
16054/// async fn sample(
16055/// ) -> anyhow::Result<()> {
16056/// let client = ReservationSlots::builder().build().await?;
16057/// // use `client` to make requests to the Compute Engine API.
16058/// Ok(())
16059/// }
16060/// ```
16061///
16062/// # Service Description
16063///
16064/// Service for the `reservationSlots` resource.
16065///
16066/// # Configuration
16067///
16068/// To configure `ReservationSlots` use the `with_*` methods in the type returned
16069/// by [builder()][ReservationSlots::builder]. The default configuration should
16070/// work for most applications. Common configuration changes include
16071///
16072/// * [with_endpoint()]: by default this client uses the global default endpoint
16073/// (`https://compute.googleapis.com`). Applications using regional
16074/// endpoints or running in restricted networks (e.g. a network configured
16075/// with [Private Google Access with VPC Service Controls]) may want to
16076/// override this default.
16077/// * [with_credentials()]: by default this client uses
16078/// [Application Default Credentials]. Applications using custom
16079/// authentication may need to override this default.
16080///
16081/// [with_endpoint()]: super::builder::reservation_slots::ClientBuilder::with_endpoint
16082/// [with_credentials()]: super::builder::reservation_slots::ClientBuilder::with_credentials
16083/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16084/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16085///
16086/// # Pooling and Cloning
16087///
16088/// `ReservationSlots` holds a connection pool internally, it is advised to
16089/// create one and reuse it. You do not need to wrap `ReservationSlots` in
16090/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16091/// already uses an `Arc` internally.
16092#[cfg(feature = "reservation-slots")]
16093#[cfg_attr(docsrs, doc(cfg(feature = "reservation-slots")))]
16094#[derive(Clone, Debug)]
16095pub struct ReservationSlots {
16096 inner: std::sync::Arc<dyn super::stub::dynamic::ReservationSlots>,
16097}
16098
16099#[cfg(feature = "reservation-slots")]
16100impl ReservationSlots {
16101 /// Returns a builder for [ReservationSlots].
16102 ///
16103 /// ```
16104 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16105 /// # use google_cloud_compute_v1::client::ReservationSlots;
16106 /// let client = ReservationSlots::builder().build().await?;
16107 /// # Ok(()) }
16108 /// ```
16109 pub fn builder() -> super::builder::reservation_slots::ClientBuilder {
16110 crate::new_client_builder(super::builder::reservation_slots::client::Factory)
16111 }
16112
16113 /// Creates a new client from the provided stub.
16114 ///
16115 /// The most common case for calling this function is in tests mocking the
16116 /// client's behavior.
16117 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
16118 where
16119 T: super::stub::ReservationSlots + 'static,
16120 {
16121 Self { inner: stub.into() }
16122 }
16123
16124 pub(crate) async fn new(
16125 config: gaxi::options::ClientConfig,
16126 ) -> crate::ClientBuilderResult<Self> {
16127 let inner = Self::build_inner(config).await?;
16128 Ok(Self { inner })
16129 }
16130
16131 async fn build_inner(
16132 conf: gaxi::options::ClientConfig,
16133 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ReservationSlots>>
16134 {
16135 if gaxi::options::tracing_enabled(&conf) {
16136 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16137 }
16138 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16139 }
16140
16141 async fn build_transport(
16142 conf: gaxi::options::ClientConfig,
16143 ) -> crate::ClientBuilderResult<impl super::stub::ReservationSlots> {
16144 super::transport::ReservationSlots::new(conf).await
16145 }
16146
16147 async fn build_with_tracing(
16148 conf: gaxi::options::ClientConfig,
16149 ) -> crate::ClientBuilderResult<impl super::stub::ReservationSlots> {
16150 Self::build_transport(conf)
16151 .await
16152 .map(super::tracing::ReservationSlots::new)
16153 }
16154
16155 /// Retrieves information about the specified reservation slot.
16156 pub fn get(&self) -> super::builder::reservation_slots::Get {
16157 super::builder::reservation_slots::Get::new(self.inner.clone())
16158 }
16159
16160 /// Get health info on a reservation slot.
16161 pub fn get_health(&self) -> super::builder::reservation_slots::GetHealth {
16162 super::builder::reservation_slots::GetHealth::new(self.inner.clone())
16163 }
16164
16165 /// Allows customers to get SBOM versions of a reservation slot.
16166 pub fn get_version(&self) -> super::builder::reservation_slots::GetVersion {
16167 super::builder::reservation_slots::GetVersion::new(self.inner.clone())
16168 }
16169
16170 /// Retrieves a list of reservation slots under a single reservation.
16171 pub fn list(&self) -> super::builder::reservation_slots::List {
16172 super::builder::reservation_slots::List::new(self.inner.clone())
16173 }
16174
16175 /// Update a reservation slot in the specified sub-block.
16176 pub fn update(&self) -> super::builder::reservation_slots::Update {
16177 super::builder::reservation_slots::Update::new(self.inner.clone())
16178 }
16179
16180 /// Retrieves the specified zone-specific Operations resource.
16181 pub fn get_operation(&self) -> super::builder::reservation_slots::GetOperation {
16182 super::builder::reservation_slots::GetOperation::new(self.inner.clone())
16183 }
16184}
16185
16186/// Implements a client for the Compute Engine API.
16187///
16188/// # Example
16189/// ```
16190/// # use google_cloud_compute_v1::client::ReservationSubBlocks;
16191/// async fn sample(
16192/// ) -> anyhow::Result<()> {
16193/// let client = ReservationSubBlocks::builder().build().await?;
16194/// // use `client` to make requests to the Compute Engine API.
16195/// Ok(())
16196/// }
16197/// ```
16198///
16199/// # Service Description
16200///
16201/// Service for the `reservationSubBlocks` resource.
16202///
16203/// # Configuration
16204///
16205/// To configure `ReservationSubBlocks` use the `with_*` methods in the type returned
16206/// by [builder()][ReservationSubBlocks::builder]. The default configuration should
16207/// work for most applications. Common configuration changes include
16208///
16209/// * [with_endpoint()]: by default this client uses the global default endpoint
16210/// (`https://compute.googleapis.com`). Applications using regional
16211/// endpoints or running in restricted networks (e.g. a network configured
16212/// with [Private Google Access with VPC Service Controls]) may want to
16213/// override this default.
16214/// * [with_credentials()]: by default this client uses
16215/// [Application Default Credentials]. Applications using custom
16216/// authentication may need to override this default.
16217///
16218/// [with_endpoint()]: super::builder::reservation_sub_blocks::ClientBuilder::with_endpoint
16219/// [with_credentials()]: super::builder::reservation_sub_blocks::ClientBuilder::with_credentials
16220/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16221/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16222///
16223/// # Pooling and Cloning
16224///
16225/// `ReservationSubBlocks` holds a connection pool internally, it is advised to
16226/// create one and reuse it. You do not need to wrap `ReservationSubBlocks` in
16227/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16228/// already uses an `Arc` internally.
16229#[cfg(feature = "reservation-sub-blocks")]
16230#[cfg_attr(docsrs, doc(cfg(feature = "reservation-sub-blocks")))]
16231#[derive(Clone, Debug)]
16232pub struct ReservationSubBlocks {
16233 inner: std::sync::Arc<dyn super::stub::dynamic::ReservationSubBlocks>,
16234}
16235
16236#[cfg(feature = "reservation-sub-blocks")]
16237impl ReservationSubBlocks {
16238 /// Returns a builder for [ReservationSubBlocks].
16239 ///
16240 /// ```
16241 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16242 /// # use google_cloud_compute_v1::client::ReservationSubBlocks;
16243 /// let client = ReservationSubBlocks::builder().build().await?;
16244 /// # Ok(()) }
16245 /// ```
16246 pub fn builder() -> super::builder::reservation_sub_blocks::ClientBuilder {
16247 crate::new_client_builder(super::builder::reservation_sub_blocks::client::Factory)
16248 }
16249
16250 /// Creates a new client from the provided stub.
16251 ///
16252 /// The most common case for calling this function is in tests mocking the
16253 /// client's behavior.
16254 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
16255 where
16256 T: super::stub::ReservationSubBlocks + 'static,
16257 {
16258 Self { inner: stub.into() }
16259 }
16260
16261 pub(crate) async fn new(
16262 config: gaxi::options::ClientConfig,
16263 ) -> crate::ClientBuilderResult<Self> {
16264 let inner = Self::build_inner(config).await?;
16265 Ok(Self { inner })
16266 }
16267
16268 async fn build_inner(
16269 conf: gaxi::options::ClientConfig,
16270 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ReservationSubBlocks>>
16271 {
16272 if gaxi::options::tracing_enabled(&conf) {
16273 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16274 }
16275 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16276 }
16277
16278 async fn build_transport(
16279 conf: gaxi::options::ClientConfig,
16280 ) -> crate::ClientBuilderResult<impl super::stub::ReservationSubBlocks> {
16281 super::transport::ReservationSubBlocks::new(conf).await
16282 }
16283
16284 async fn build_with_tracing(
16285 conf: gaxi::options::ClientConfig,
16286 ) -> crate::ClientBuilderResult<impl super::stub::ReservationSubBlocks> {
16287 Self::build_transport(conf)
16288 .await
16289 .map(super::tracing::ReservationSubBlocks::new)
16290 }
16291
16292 /// Retrieves information about the specified reservation subBlock.
16293 pub fn get(&self) -> super::builder::reservation_sub_blocks::Get {
16294 super::builder::reservation_sub_blocks::Get::new(self.inner.clone())
16295 }
16296
16297 /// Gets the access control policy for a resource. May be empty if no such
16298 /// policy or resource exists.
16299 pub fn get_iam_policy(&self) -> super::builder::reservation_sub_blocks::GetIamPolicy {
16300 super::builder::reservation_sub_blocks::GetIamPolicy::new(self.inner.clone())
16301 }
16302
16303 /// Allows customers to get SBOM versions of a reservation subBlock.
16304 pub fn get_version(&self) -> super::builder::reservation_sub_blocks::GetVersion {
16305 super::builder::reservation_sub_blocks::GetVersion::new(self.inner.clone())
16306 }
16307
16308 /// Retrieves a list of reservation subBlocks under a single reservation.
16309 pub fn list(&self) -> super::builder::reservation_sub_blocks::List {
16310 super::builder::reservation_sub_blocks::List::new(self.inner.clone())
16311 }
16312
16313 /// Allows customers to perform maintenance on a reservation subBlock
16314 pub fn perform_maintenance(
16315 &self,
16316 ) -> super::builder::reservation_sub_blocks::PerformMaintenance {
16317 super::builder::reservation_sub_blocks::PerformMaintenance::new(self.inner.clone())
16318 }
16319
16320 /// Allows customers to report a faulty subBlock.
16321 pub fn report_faulty(&self) -> super::builder::reservation_sub_blocks::ReportFaulty {
16322 super::builder::reservation_sub_blocks::ReportFaulty::new(self.inner.clone())
16323 }
16324
16325 /// Sets the access control policy on the specified resource.
16326 /// Replaces any existing policy.
16327 pub fn set_iam_policy(&self) -> super::builder::reservation_sub_blocks::SetIamPolicy {
16328 super::builder::reservation_sub_blocks::SetIamPolicy::new(self.inner.clone())
16329 }
16330
16331 /// Returns permissions that a caller has on the specified resource.
16332 pub fn test_iam_permissions(
16333 &self,
16334 ) -> super::builder::reservation_sub_blocks::TestIamPermissions {
16335 super::builder::reservation_sub_blocks::TestIamPermissions::new(self.inner.clone())
16336 }
16337
16338 /// Retrieves the specified zone-specific Operations resource.
16339 pub fn get_operation(&self) -> super::builder::reservation_sub_blocks::GetOperation {
16340 super::builder::reservation_sub_blocks::GetOperation::new(self.inner.clone())
16341 }
16342}
16343
16344/// Implements a client for the Compute Engine API.
16345///
16346/// # Example
16347/// ```
16348/// # use google_cloud_compute_v1::client::Reservations;
16349/// async fn sample(
16350/// ) -> anyhow::Result<()> {
16351/// let client = Reservations::builder().build().await?;
16352/// // use `client` to make requests to the Compute Engine API.
16353/// Ok(())
16354/// }
16355/// ```
16356///
16357/// # Service Description
16358///
16359/// Service for the `reservations` resource.
16360///
16361/// # Configuration
16362///
16363/// To configure `Reservations` use the `with_*` methods in the type returned
16364/// by [builder()][Reservations::builder]. The default configuration should
16365/// work for most applications. Common configuration changes include
16366///
16367/// * [with_endpoint()]: by default this client uses the global default endpoint
16368/// (`https://compute.googleapis.com`). Applications using regional
16369/// endpoints or running in restricted networks (e.g. a network configured
16370/// with [Private Google Access with VPC Service Controls]) may want to
16371/// override this default.
16372/// * [with_credentials()]: by default this client uses
16373/// [Application Default Credentials]. Applications using custom
16374/// authentication may need to override this default.
16375///
16376/// [with_endpoint()]: super::builder::reservations::ClientBuilder::with_endpoint
16377/// [with_credentials()]: super::builder::reservations::ClientBuilder::with_credentials
16378/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16379/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16380///
16381/// # Pooling and Cloning
16382///
16383/// `Reservations` holds a connection pool internally, it is advised to
16384/// create one and reuse it. You do not need to wrap `Reservations` in
16385/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16386/// already uses an `Arc` internally.
16387#[cfg(feature = "reservations")]
16388#[cfg_attr(docsrs, doc(cfg(feature = "reservations")))]
16389#[derive(Clone, Debug)]
16390pub struct Reservations {
16391 inner: std::sync::Arc<dyn super::stub::dynamic::Reservations>,
16392}
16393
16394#[cfg(feature = "reservations")]
16395impl Reservations {
16396 /// Returns a builder for [Reservations].
16397 ///
16398 /// ```
16399 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16400 /// # use google_cloud_compute_v1::client::Reservations;
16401 /// let client = Reservations::builder().build().await?;
16402 /// # Ok(()) }
16403 /// ```
16404 pub fn builder() -> super::builder::reservations::ClientBuilder {
16405 crate::new_client_builder(super::builder::reservations::client::Factory)
16406 }
16407
16408 /// Creates a new client from the provided stub.
16409 ///
16410 /// The most common case for calling this function is in tests mocking the
16411 /// client's behavior.
16412 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
16413 where
16414 T: super::stub::Reservations + 'static,
16415 {
16416 Self { inner: stub.into() }
16417 }
16418
16419 pub(crate) async fn new(
16420 config: gaxi::options::ClientConfig,
16421 ) -> crate::ClientBuilderResult<Self> {
16422 let inner = Self::build_inner(config).await?;
16423 Ok(Self { inner })
16424 }
16425
16426 async fn build_inner(
16427 conf: gaxi::options::ClientConfig,
16428 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Reservations>> {
16429 if gaxi::options::tracing_enabled(&conf) {
16430 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16431 }
16432 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16433 }
16434
16435 async fn build_transport(
16436 conf: gaxi::options::ClientConfig,
16437 ) -> crate::ClientBuilderResult<impl super::stub::Reservations> {
16438 super::transport::Reservations::new(conf).await
16439 }
16440
16441 async fn build_with_tracing(
16442 conf: gaxi::options::ClientConfig,
16443 ) -> crate::ClientBuilderResult<impl super::stub::Reservations> {
16444 Self::build_transport(conf)
16445 .await
16446 .map(super::tracing::Reservations::new)
16447 }
16448
16449 /// Retrieves an aggregated list of reservations.
16450 ///
16451 /// To prevent failure, it is recommended that you set the
16452 /// `returnPartialSuccess` parameter to `true`.
16453 pub fn aggregated_list(&self) -> super::builder::reservations::AggregatedList {
16454 super::builder::reservations::AggregatedList::new(self.inner.clone())
16455 }
16456
16457 /// Deletes the specified reservation.
16458 pub fn delete(&self) -> super::builder::reservations::Delete {
16459 super::builder::reservations::Delete::new(self.inner.clone())
16460 }
16461
16462 /// Retrieves information about the specified reservation.
16463 pub fn get(&self) -> super::builder::reservations::Get {
16464 super::builder::reservations::Get::new(self.inner.clone())
16465 }
16466
16467 /// Gets the access control policy for a resource. May be empty if no such
16468 /// policy or resource exists.
16469 pub fn get_iam_policy(&self) -> super::builder::reservations::GetIamPolicy {
16470 super::builder::reservations::GetIamPolicy::new(self.inner.clone())
16471 }
16472
16473 /// Creates a new reservation. For more information, readReserving zonal
16474 /// resources.
16475 pub fn insert(&self) -> super::builder::reservations::Insert {
16476 super::builder::reservations::Insert::new(self.inner.clone())
16477 }
16478
16479 /// A list of all the reservations that have been configured for the
16480 /// specified project in specified zone.
16481 pub fn list(&self) -> super::builder::reservations::List {
16482 super::builder::reservations::List::new(self.inner.clone())
16483 }
16484
16485 /// Perform maintenance on an extended reservation
16486 pub fn perform_maintenance(&self) -> super::builder::reservations::PerformMaintenance {
16487 super::builder::reservations::PerformMaintenance::new(self.inner.clone())
16488 }
16489
16490 /// Resizes the reservation (applicable to standalone reservations only). For
16491 /// more information, readModifying
16492 /// reservations.
16493 pub fn resize(&self) -> super::builder::reservations::Resize {
16494 super::builder::reservations::Resize::new(self.inner.clone())
16495 }
16496
16497 /// Sets the access control policy on the specified resource.
16498 /// Replaces any existing policy.
16499 pub fn set_iam_policy(&self) -> super::builder::reservations::SetIamPolicy {
16500 super::builder::reservations::SetIamPolicy::new(self.inner.clone())
16501 }
16502
16503 /// Returns permissions that a caller has on the specified resource.
16504 pub fn test_iam_permissions(&self) -> super::builder::reservations::TestIamPermissions {
16505 super::builder::reservations::TestIamPermissions::new(self.inner.clone())
16506 }
16507
16508 /// Update share settings of the reservation.
16509 pub fn update(&self) -> super::builder::reservations::Update {
16510 super::builder::reservations::Update::new(self.inner.clone())
16511 }
16512
16513 /// Retrieves the specified zone-specific Operations resource.
16514 pub fn get_operation(&self) -> super::builder::reservations::GetOperation {
16515 super::builder::reservations::GetOperation::new(self.inner.clone())
16516 }
16517}
16518
16519/// Implements a client for the Compute Engine API.
16520///
16521/// # Example
16522/// ```
16523/// # use google_cloud_compute_v1::client::ResourcePolicies;
16524/// async fn sample(
16525/// ) -> anyhow::Result<()> {
16526/// let client = ResourcePolicies::builder().build().await?;
16527/// // use `client` to make requests to the Compute Engine API.
16528/// Ok(())
16529/// }
16530/// ```
16531///
16532/// # Service Description
16533///
16534/// Service for the `resourcePolicies` resource.
16535///
16536/// # Configuration
16537///
16538/// To configure `ResourcePolicies` use the `with_*` methods in the type returned
16539/// by [builder()][ResourcePolicies::builder]. The default configuration should
16540/// work for most applications. Common configuration changes include
16541///
16542/// * [with_endpoint()]: by default this client uses the global default endpoint
16543/// (`https://compute.googleapis.com`). Applications using regional
16544/// endpoints or running in restricted networks (e.g. a network configured
16545/// with [Private Google Access with VPC Service Controls]) may want to
16546/// override this default.
16547/// * [with_credentials()]: by default this client uses
16548/// [Application Default Credentials]. Applications using custom
16549/// authentication may need to override this default.
16550///
16551/// [with_endpoint()]: super::builder::resource_policies::ClientBuilder::with_endpoint
16552/// [with_credentials()]: super::builder::resource_policies::ClientBuilder::with_credentials
16553/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16554/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16555///
16556/// # Pooling and Cloning
16557///
16558/// `ResourcePolicies` holds a connection pool internally, it is advised to
16559/// create one and reuse it. You do not need to wrap `ResourcePolicies` in
16560/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16561/// already uses an `Arc` internally.
16562#[cfg(feature = "resource-policies")]
16563#[cfg_attr(docsrs, doc(cfg(feature = "resource-policies")))]
16564#[derive(Clone, Debug)]
16565pub struct ResourcePolicies {
16566 inner: std::sync::Arc<dyn super::stub::dynamic::ResourcePolicies>,
16567}
16568
16569#[cfg(feature = "resource-policies")]
16570impl ResourcePolicies {
16571 /// Returns a builder for [ResourcePolicies].
16572 ///
16573 /// ```
16574 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16575 /// # use google_cloud_compute_v1::client::ResourcePolicies;
16576 /// let client = ResourcePolicies::builder().build().await?;
16577 /// # Ok(()) }
16578 /// ```
16579 pub fn builder() -> super::builder::resource_policies::ClientBuilder {
16580 crate::new_client_builder(super::builder::resource_policies::client::Factory)
16581 }
16582
16583 /// Creates a new client from the provided stub.
16584 ///
16585 /// The most common case for calling this function is in tests mocking the
16586 /// client's behavior.
16587 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
16588 where
16589 T: super::stub::ResourcePolicies + 'static,
16590 {
16591 Self { inner: stub.into() }
16592 }
16593
16594 pub(crate) async fn new(
16595 config: gaxi::options::ClientConfig,
16596 ) -> crate::ClientBuilderResult<Self> {
16597 let inner = Self::build_inner(config).await?;
16598 Ok(Self { inner })
16599 }
16600
16601 async fn build_inner(
16602 conf: gaxi::options::ClientConfig,
16603 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ResourcePolicies>>
16604 {
16605 if gaxi::options::tracing_enabled(&conf) {
16606 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16607 }
16608 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16609 }
16610
16611 async fn build_transport(
16612 conf: gaxi::options::ClientConfig,
16613 ) -> crate::ClientBuilderResult<impl super::stub::ResourcePolicies> {
16614 super::transport::ResourcePolicies::new(conf).await
16615 }
16616
16617 async fn build_with_tracing(
16618 conf: gaxi::options::ClientConfig,
16619 ) -> crate::ClientBuilderResult<impl super::stub::ResourcePolicies> {
16620 Self::build_transport(conf)
16621 .await
16622 .map(super::tracing::ResourcePolicies::new)
16623 }
16624
16625 /// Retrieves an aggregated list of resource policies.
16626 ///
16627 /// To prevent failure, Google recommends that you set the
16628 /// `returnPartialSuccess` parameter to `true`.
16629 pub fn aggregated_list(&self) -> super::builder::resource_policies::AggregatedList {
16630 super::builder::resource_policies::AggregatedList::new(self.inner.clone())
16631 }
16632
16633 /// Deletes the specified resource policy.
16634 pub fn delete(&self) -> super::builder::resource_policies::Delete {
16635 super::builder::resource_policies::Delete::new(self.inner.clone())
16636 }
16637
16638 /// Retrieves all information of the specified resource policy.
16639 pub fn get(&self) -> super::builder::resource_policies::Get {
16640 super::builder::resource_policies::Get::new(self.inner.clone())
16641 }
16642
16643 /// Gets the access control policy for a resource. May be empty if no such
16644 /// policy or resource exists.
16645 pub fn get_iam_policy(&self) -> super::builder::resource_policies::GetIamPolicy {
16646 super::builder::resource_policies::GetIamPolicy::new(self.inner.clone())
16647 }
16648
16649 /// Creates a new resource policy.
16650 pub fn insert(&self) -> super::builder::resource_policies::Insert {
16651 super::builder::resource_policies::Insert::new(self.inner.clone())
16652 }
16653
16654 /// A list all the resource policies that have been configured for the
16655 /// specified project in specified region.
16656 pub fn list(&self) -> super::builder::resource_policies::List {
16657 super::builder::resource_policies::List::new(self.inner.clone())
16658 }
16659
16660 /// Modify the specified resource policy.
16661 pub fn patch(&self) -> super::builder::resource_policies::Patch {
16662 super::builder::resource_policies::Patch::new(self.inner.clone())
16663 }
16664
16665 /// Sets the access control policy on the specified resource.
16666 /// Replaces any existing policy.
16667 pub fn set_iam_policy(&self) -> super::builder::resource_policies::SetIamPolicy {
16668 super::builder::resource_policies::SetIamPolicy::new(self.inner.clone())
16669 }
16670
16671 /// Returns permissions that a caller has on the specified resource.
16672 pub fn test_iam_permissions(&self) -> super::builder::resource_policies::TestIamPermissions {
16673 super::builder::resource_policies::TestIamPermissions::new(self.inner.clone())
16674 }
16675
16676 /// Retrieves the specified region-specific Operations resource.
16677 pub fn get_operation(&self) -> super::builder::resource_policies::GetOperation {
16678 super::builder::resource_policies::GetOperation::new(self.inner.clone())
16679 }
16680}
16681
16682/// Implements a client for the Compute Engine API.
16683///
16684/// # Example
16685/// ```
16686/// # use google_cloud_compute_v1::client::RolloutPlans;
16687/// async fn sample(
16688/// ) -> anyhow::Result<()> {
16689/// let client = RolloutPlans::builder().build().await?;
16690/// // use `client` to make requests to the Compute Engine API.
16691/// Ok(())
16692/// }
16693/// ```
16694///
16695/// # Service Description
16696///
16697/// Service for the `rolloutPlans` resource.
16698///
16699/// # Configuration
16700///
16701/// To configure `RolloutPlans` use the `with_*` methods in the type returned
16702/// by [builder()][RolloutPlans::builder]. The default configuration should
16703/// work for most applications. Common configuration changes include
16704///
16705/// * [with_endpoint()]: by default this client uses the global default endpoint
16706/// (`https://compute.googleapis.com`). Applications using regional
16707/// endpoints or running in restricted networks (e.g. a network configured
16708/// with [Private Google Access with VPC Service Controls]) may want to
16709/// override this default.
16710/// * [with_credentials()]: by default this client uses
16711/// [Application Default Credentials]. Applications using custom
16712/// authentication may need to override this default.
16713///
16714/// [with_endpoint()]: super::builder::rollout_plans::ClientBuilder::with_endpoint
16715/// [with_credentials()]: super::builder::rollout_plans::ClientBuilder::with_credentials
16716/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16717/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16718///
16719/// # Pooling and Cloning
16720///
16721/// `RolloutPlans` holds a connection pool internally, it is advised to
16722/// create one and reuse it. You do not need to wrap `RolloutPlans` in
16723/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16724/// already uses an `Arc` internally.
16725#[cfg(feature = "rollout-plans")]
16726#[cfg_attr(docsrs, doc(cfg(feature = "rollout-plans")))]
16727#[derive(Clone, Debug)]
16728pub struct RolloutPlans {
16729 inner: std::sync::Arc<dyn super::stub::dynamic::RolloutPlans>,
16730}
16731
16732#[cfg(feature = "rollout-plans")]
16733impl RolloutPlans {
16734 /// Returns a builder for [RolloutPlans].
16735 ///
16736 /// ```
16737 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16738 /// # use google_cloud_compute_v1::client::RolloutPlans;
16739 /// let client = RolloutPlans::builder().build().await?;
16740 /// # Ok(()) }
16741 /// ```
16742 pub fn builder() -> super::builder::rollout_plans::ClientBuilder {
16743 crate::new_client_builder(super::builder::rollout_plans::client::Factory)
16744 }
16745
16746 /// Creates a new client from the provided stub.
16747 ///
16748 /// The most common case for calling this function is in tests mocking the
16749 /// client's behavior.
16750 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
16751 where
16752 T: super::stub::RolloutPlans + 'static,
16753 {
16754 Self { inner: stub.into() }
16755 }
16756
16757 pub(crate) async fn new(
16758 config: gaxi::options::ClientConfig,
16759 ) -> crate::ClientBuilderResult<Self> {
16760 let inner = Self::build_inner(config).await?;
16761 Ok(Self { inner })
16762 }
16763
16764 async fn build_inner(
16765 conf: gaxi::options::ClientConfig,
16766 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RolloutPlans>> {
16767 if gaxi::options::tracing_enabled(&conf) {
16768 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16769 }
16770 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16771 }
16772
16773 async fn build_transport(
16774 conf: gaxi::options::ClientConfig,
16775 ) -> crate::ClientBuilderResult<impl super::stub::RolloutPlans> {
16776 super::transport::RolloutPlans::new(conf).await
16777 }
16778
16779 async fn build_with_tracing(
16780 conf: gaxi::options::ClientConfig,
16781 ) -> crate::ClientBuilderResult<impl super::stub::RolloutPlans> {
16782 Self::build_transport(conf)
16783 .await
16784 .map(super::tracing::RolloutPlans::new)
16785 }
16786
16787 /// Deletes a RolloutPlan.
16788 pub fn delete(&self) -> super::builder::rollout_plans::Delete {
16789 super::builder::rollout_plans::Delete::new(self.inner.clone())
16790 }
16791
16792 /// Gets details of a single project-scoped RolloutPlan.
16793 pub fn get(&self) -> super::builder::rollout_plans::Get {
16794 super::builder::rollout_plans::Get::new(self.inner.clone())
16795 }
16796
16797 /// Creates a new RolloutPlan in a given project and location.
16798 pub fn insert(&self) -> super::builder::rollout_plans::Insert {
16799 super::builder::rollout_plans::Insert::new(self.inner.clone())
16800 }
16801
16802 /// Lists RolloutPlans in a given project and location.
16803 pub fn list(&self) -> super::builder::rollout_plans::List {
16804 super::builder::rollout_plans::List::new(self.inner.clone())
16805 }
16806
16807 /// Retrieves the specified Operations resource.
16808 pub fn get_operation(&self) -> super::builder::rollout_plans::GetOperation {
16809 super::builder::rollout_plans::GetOperation::new(self.inner.clone())
16810 }
16811}
16812
16813/// Implements a client for the Compute Engine API.
16814///
16815/// # Example
16816/// ```
16817/// # use google_cloud_compute_v1::client::Rollouts;
16818/// async fn sample(
16819/// ) -> anyhow::Result<()> {
16820/// let client = Rollouts::builder().build().await?;
16821/// // use `client` to make requests to the Compute Engine API.
16822/// Ok(())
16823/// }
16824/// ```
16825///
16826/// # Service Description
16827///
16828/// Service for the `rollouts` resource.
16829///
16830/// # Configuration
16831///
16832/// To configure `Rollouts` use the `with_*` methods in the type returned
16833/// by [builder()][Rollouts::builder]. The default configuration should
16834/// work for most applications. Common configuration changes include
16835///
16836/// * [with_endpoint()]: by default this client uses the global default endpoint
16837/// (`https://compute.googleapis.com`). Applications using regional
16838/// endpoints or running in restricted networks (e.g. a network configured
16839/// with [Private Google Access with VPC Service Controls]) may want to
16840/// override this default.
16841/// * [with_credentials()]: by default this client uses
16842/// [Application Default Credentials]. Applications using custom
16843/// authentication may need to override this default.
16844///
16845/// [with_endpoint()]: super::builder::rollouts::ClientBuilder::with_endpoint
16846/// [with_credentials()]: super::builder::rollouts::ClientBuilder::with_credentials
16847/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16848/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16849///
16850/// # Pooling and Cloning
16851///
16852/// `Rollouts` holds a connection pool internally, it is advised to
16853/// create one and reuse it. You do not need to wrap `Rollouts` in
16854/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16855/// already uses an `Arc` internally.
16856#[cfg(feature = "rollouts")]
16857#[cfg_attr(docsrs, doc(cfg(feature = "rollouts")))]
16858#[derive(Clone, Debug)]
16859pub struct Rollouts {
16860 inner: std::sync::Arc<dyn super::stub::dynamic::Rollouts>,
16861}
16862
16863#[cfg(feature = "rollouts")]
16864impl Rollouts {
16865 /// Returns a builder for [Rollouts].
16866 ///
16867 /// ```
16868 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16869 /// # use google_cloud_compute_v1::client::Rollouts;
16870 /// let client = Rollouts::builder().build().await?;
16871 /// # Ok(()) }
16872 /// ```
16873 pub fn builder() -> super::builder::rollouts::ClientBuilder {
16874 crate::new_client_builder(super::builder::rollouts::client::Factory)
16875 }
16876
16877 /// Creates a new client from the provided stub.
16878 ///
16879 /// The most common case for calling this function is in tests mocking the
16880 /// client's behavior.
16881 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
16882 where
16883 T: super::stub::Rollouts + 'static,
16884 {
16885 Self { inner: stub.into() }
16886 }
16887
16888 pub(crate) async fn new(
16889 config: gaxi::options::ClientConfig,
16890 ) -> crate::ClientBuilderResult<Self> {
16891 let inner = Self::build_inner(config).await?;
16892 Ok(Self { inner })
16893 }
16894
16895 async fn build_inner(
16896 conf: gaxi::options::ClientConfig,
16897 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Rollouts>> {
16898 if gaxi::options::tracing_enabled(&conf) {
16899 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16900 }
16901 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16902 }
16903
16904 async fn build_transport(
16905 conf: gaxi::options::ClientConfig,
16906 ) -> crate::ClientBuilderResult<impl super::stub::Rollouts> {
16907 super::transport::Rollouts::new(conf).await
16908 }
16909
16910 async fn build_with_tracing(
16911 conf: gaxi::options::ClientConfig,
16912 ) -> crate::ClientBuilderResult<impl super::stub::Rollouts> {
16913 Self::build_transport(conf)
16914 .await
16915 .map(super::tracing::Rollouts::new)
16916 }
16917
16918 /// Advances a Rollout to the next wave, or completes it if no waves remain.
16919 pub fn advance(&self) -> super::builder::rollouts::Advance {
16920 super::builder::rollouts::Advance::new(self.inner.clone())
16921 }
16922
16923 /// Cancels a Rollout.
16924 pub fn cancel(&self) -> super::builder::rollouts::Cancel {
16925 super::builder::rollouts::Cancel::new(self.inner.clone())
16926 }
16927
16928 /// Deletes a Rollout.
16929 pub fn delete(&self) -> super::builder::rollouts::Delete {
16930 super::builder::rollouts::Delete::new(self.inner.clone())
16931 }
16932
16933 /// Gets details of a single project-scoped Rollout.
16934 pub fn get(&self) -> super::builder::rollouts::Get {
16935 super::builder::rollouts::Get::new(self.inner.clone())
16936 }
16937
16938 /// Lists Rollouts in a given project and location.
16939 pub fn list(&self) -> super::builder::rollouts::List {
16940 super::builder::rollouts::List::new(self.inner.clone())
16941 }
16942
16943 /// Pauses a Rollout.
16944 pub fn pause(&self) -> super::builder::rollouts::Pause {
16945 super::builder::rollouts::Pause::new(self.inner.clone())
16946 }
16947
16948 /// Resumes a Rollout.
16949 pub fn resume(&self) -> super::builder::rollouts::Resume {
16950 super::builder::rollouts::Resume::new(self.inner.clone())
16951 }
16952
16953 /// Retrieves the specified Operations resource.
16954 pub fn get_operation(&self) -> super::builder::rollouts::GetOperation {
16955 super::builder::rollouts::GetOperation::new(self.inner.clone())
16956 }
16957}
16958
16959/// Implements a client for the Compute Engine API.
16960///
16961/// # Example
16962/// ```
16963/// # use google_cloud_compute_v1::client::Routers;
16964/// async fn sample(
16965/// ) -> anyhow::Result<()> {
16966/// let client = Routers::builder().build().await?;
16967/// // use `client` to make requests to the Compute Engine API.
16968/// Ok(())
16969/// }
16970/// ```
16971///
16972/// # Service Description
16973///
16974/// Service for the `routers` resource.
16975///
16976/// # Configuration
16977///
16978/// To configure `Routers` use the `with_*` methods in the type returned
16979/// by [builder()][Routers::builder]. The default configuration should
16980/// work for most applications. Common configuration changes include
16981///
16982/// * [with_endpoint()]: by default this client uses the global default endpoint
16983/// (`https://compute.googleapis.com`). Applications using regional
16984/// endpoints or running in restricted networks (e.g. a network configured
16985/// with [Private Google Access with VPC Service Controls]) may want to
16986/// override this default.
16987/// * [with_credentials()]: by default this client uses
16988/// [Application Default Credentials]. Applications using custom
16989/// authentication may need to override this default.
16990///
16991/// [with_endpoint()]: super::builder::routers::ClientBuilder::with_endpoint
16992/// [with_credentials()]: super::builder::routers::ClientBuilder::with_credentials
16993/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16994/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16995///
16996/// # Pooling and Cloning
16997///
16998/// `Routers` holds a connection pool internally, it is advised to
16999/// create one and reuse it. You do not need to wrap `Routers` in
17000/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17001/// already uses an `Arc` internally.
17002#[cfg(feature = "routers")]
17003#[cfg_attr(docsrs, doc(cfg(feature = "routers")))]
17004#[derive(Clone, Debug)]
17005pub struct Routers {
17006 inner: std::sync::Arc<dyn super::stub::dynamic::Routers>,
17007}
17008
17009#[cfg(feature = "routers")]
17010impl Routers {
17011 /// Returns a builder for [Routers].
17012 ///
17013 /// ```
17014 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17015 /// # use google_cloud_compute_v1::client::Routers;
17016 /// let client = Routers::builder().build().await?;
17017 /// # Ok(()) }
17018 /// ```
17019 pub fn builder() -> super::builder::routers::ClientBuilder {
17020 crate::new_client_builder(super::builder::routers::client::Factory)
17021 }
17022
17023 /// Creates a new client from the provided stub.
17024 ///
17025 /// The most common case for calling this function is in tests mocking the
17026 /// client's behavior.
17027 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
17028 where
17029 T: super::stub::Routers + 'static,
17030 {
17031 Self { inner: stub.into() }
17032 }
17033
17034 pub(crate) async fn new(
17035 config: gaxi::options::ClientConfig,
17036 ) -> crate::ClientBuilderResult<Self> {
17037 let inner = Self::build_inner(config).await?;
17038 Ok(Self { inner })
17039 }
17040
17041 async fn build_inner(
17042 conf: gaxi::options::ClientConfig,
17043 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Routers>> {
17044 if gaxi::options::tracing_enabled(&conf) {
17045 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17046 }
17047 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17048 }
17049
17050 async fn build_transport(
17051 conf: gaxi::options::ClientConfig,
17052 ) -> crate::ClientBuilderResult<impl super::stub::Routers> {
17053 super::transport::Routers::new(conf).await
17054 }
17055
17056 async fn build_with_tracing(
17057 conf: gaxi::options::ClientConfig,
17058 ) -> crate::ClientBuilderResult<impl super::stub::Routers> {
17059 Self::build_transport(conf)
17060 .await
17061 .map(super::tracing::Routers::new)
17062 }
17063
17064 /// Retrieves an aggregated list of routers.
17065 ///
17066 /// To prevent failure, Google recommends that you set the
17067 /// `returnPartialSuccess` parameter to `true`.
17068 pub fn aggregated_list(&self) -> super::builder::routers::AggregatedList {
17069 super::builder::routers::AggregatedList::new(self.inner.clone())
17070 }
17071
17072 /// Deletes the specified Router resource.
17073 pub fn delete(&self) -> super::builder::routers::Delete {
17074 super::builder::routers::Delete::new(self.inner.clone())
17075 }
17076
17077 /// Deletes Named Set
17078 pub fn delete_named_set(&self) -> super::builder::routers::DeleteNamedSet {
17079 super::builder::routers::DeleteNamedSet::new(self.inner.clone())
17080 }
17081
17082 /// Deletes Route Policy
17083 pub fn delete_route_policy(&self) -> super::builder::routers::DeleteRoutePolicy {
17084 super::builder::routers::DeleteRoutePolicy::new(self.inner.clone())
17085 }
17086
17087 /// Returns the specified Router resource.
17088 pub fn get(&self) -> super::builder::routers::Get {
17089 super::builder::routers::Get::new(self.inner.clone())
17090 }
17091
17092 /// Returns specified Named Set
17093 pub fn get_named_set(&self) -> super::builder::routers::GetNamedSet {
17094 super::builder::routers::GetNamedSet::new(self.inner.clone())
17095 }
17096
17097 /// Retrieves runtime NAT IP information.
17098 pub fn get_nat_ip_info(&self) -> super::builder::routers::GetNatIpInfo {
17099 super::builder::routers::GetNatIpInfo::new(self.inner.clone())
17100 }
17101
17102 /// Retrieves runtime Nat mapping information of VM endpoints.
17103 pub fn get_nat_mapping_info(&self) -> super::builder::routers::GetNatMappingInfo {
17104 super::builder::routers::GetNatMappingInfo::new(self.inner.clone())
17105 }
17106
17107 /// Returns specified Route Policy
17108 pub fn get_route_policy(&self) -> super::builder::routers::GetRoutePolicy {
17109 super::builder::routers::GetRoutePolicy::new(self.inner.clone())
17110 }
17111
17112 /// Retrieves runtime information of the specified router.
17113 pub fn get_router_status(&self) -> super::builder::routers::GetRouterStatus {
17114 super::builder::routers::GetRouterStatus::new(self.inner.clone())
17115 }
17116
17117 /// Creates a Router resource in the specified project and region using
17118 /// the data included in the request.
17119 pub fn insert(&self) -> super::builder::routers::Insert {
17120 super::builder::routers::Insert::new(self.inner.clone())
17121 }
17122
17123 /// Retrieves a list of Router resources available to the specified project.
17124 pub fn list(&self) -> super::builder::routers::List {
17125 super::builder::routers::List::new(self.inner.clone())
17126 }
17127
17128 /// Retrieves a list of router bgp routes available to the specified project.
17129 pub fn list_bgp_routes(&self) -> super::builder::routers::ListBgpRoutes {
17130 super::builder::routers::ListBgpRoutes::new(self.inner.clone())
17131 }
17132
17133 /// Retrieves a list of router named set subresources available to the
17134 /// specified project.
17135 pub fn list_named_sets(&self) -> super::builder::routers::ListNamedSets {
17136 super::builder::routers::ListNamedSets::new(self.inner.clone())
17137 }
17138
17139 /// Retrieves a list of router route policy subresources available to the
17140 /// specified project.
17141 pub fn list_route_policies(&self) -> super::builder::routers::ListRoutePolicies {
17142 super::builder::routers::ListRoutePolicies::new(self.inner.clone())
17143 }
17144
17145 /// Patches the specified Router resource with the data included in the
17146 /// request. This method supportsPATCH
17147 /// semantics and usesJSON merge
17148 /// patch format and processing rules.
17149 pub fn patch(&self) -> super::builder::routers::Patch {
17150 super::builder::routers::Patch::new(self.inner.clone())
17151 }
17152
17153 /// Patches Named Set
17154 pub fn patch_named_set(&self) -> super::builder::routers::PatchNamedSet {
17155 super::builder::routers::PatchNamedSet::new(self.inner.clone())
17156 }
17157
17158 /// Patches Route Policy
17159 pub fn patch_route_policy(&self) -> super::builder::routers::PatchRoutePolicy {
17160 super::builder::routers::PatchRoutePolicy::new(self.inner.clone())
17161 }
17162
17163 /// Preview fields auto-generated during router create andupdate operations.
17164 /// Calling this method does NOT create or update the router.
17165 pub fn preview(&self) -> super::builder::routers::Preview {
17166 super::builder::routers::Preview::new(self.inner.clone())
17167 }
17168
17169 /// Updates the specified Router resource with the data included in the
17170 /// request. This method conforms toPUT semantics, which requests that the state of the
17171 /// target resource be created or replaced with the state defined by the
17172 /// representation enclosed in the request message payload.
17173 pub fn update(&self) -> super::builder::routers::Update {
17174 super::builder::routers::Update::new(self.inner.clone())
17175 }
17176
17177 /// Updates or creates new Named Set
17178 pub fn update_named_set(&self) -> super::builder::routers::UpdateNamedSet {
17179 super::builder::routers::UpdateNamedSet::new(self.inner.clone())
17180 }
17181
17182 /// Updates or creates new Route Policy
17183 pub fn update_route_policy(&self) -> super::builder::routers::UpdateRoutePolicy {
17184 super::builder::routers::UpdateRoutePolicy::new(self.inner.clone())
17185 }
17186
17187 /// Retrieves the specified region-specific Operations resource.
17188 pub fn get_operation(&self) -> super::builder::routers::GetOperation {
17189 super::builder::routers::GetOperation::new(self.inner.clone())
17190 }
17191}
17192
17193/// Implements a client for the Compute Engine API.
17194///
17195/// # Example
17196/// ```
17197/// # use google_cloud_compute_v1::client::Routes;
17198/// async fn sample(
17199/// ) -> anyhow::Result<()> {
17200/// let client = Routes::builder().build().await?;
17201/// // use `client` to make requests to the Compute Engine API.
17202/// Ok(())
17203/// }
17204/// ```
17205///
17206/// # Service Description
17207///
17208/// Service for the `routes` resource.
17209///
17210/// # Configuration
17211///
17212/// To configure `Routes` use the `with_*` methods in the type returned
17213/// by [builder()][Routes::builder]. The default configuration should
17214/// work for most applications. Common configuration changes include
17215///
17216/// * [with_endpoint()]: by default this client uses the global default endpoint
17217/// (`https://compute.googleapis.com`). Applications using regional
17218/// endpoints or running in restricted networks (e.g. a network configured
17219/// with [Private Google Access with VPC Service Controls]) may want to
17220/// override this default.
17221/// * [with_credentials()]: by default this client uses
17222/// [Application Default Credentials]. Applications using custom
17223/// authentication may need to override this default.
17224///
17225/// [with_endpoint()]: super::builder::routes::ClientBuilder::with_endpoint
17226/// [with_credentials()]: super::builder::routes::ClientBuilder::with_credentials
17227/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17228/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17229///
17230/// # Pooling and Cloning
17231///
17232/// `Routes` holds a connection pool internally, it is advised to
17233/// create one and reuse it. You do not need to wrap `Routes` in
17234/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17235/// already uses an `Arc` internally.
17236#[cfg(feature = "routes")]
17237#[cfg_attr(docsrs, doc(cfg(feature = "routes")))]
17238#[derive(Clone, Debug)]
17239pub struct Routes {
17240 inner: std::sync::Arc<dyn super::stub::dynamic::Routes>,
17241}
17242
17243#[cfg(feature = "routes")]
17244impl Routes {
17245 /// Returns a builder for [Routes].
17246 ///
17247 /// ```
17248 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17249 /// # use google_cloud_compute_v1::client::Routes;
17250 /// let client = Routes::builder().build().await?;
17251 /// # Ok(()) }
17252 /// ```
17253 pub fn builder() -> super::builder::routes::ClientBuilder {
17254 crate::new_client_builder(super::builder::routes::client::Factory)
17255 }
17256
17257 /// Creates a new client from the provided stub.
17258 ///
17259 /// The most common case for calling this function is in tests mocking the
17260 /// client's behavior.
17261 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
17262 where
17263 T: super::stub::Routes + 'static,
17264 {
17265 Self { inner: stub.into() }
17266 }
17267
17268 pub(crate) async fn new(
17269 config: gaxi::options::ClientConfig,
17270 ) -> crate::ClientBuilderResult<Self> {
17271 let inner = Self::build_inner(config).await?;
17272 Ok(Self { inner })
17273 }
17274
17275 async fn build_inner(
17276 conf: gaxi::options::ClientConfig,
17277 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Routes>> {
17278 if gaxi::options::tracing_enabled(&conf) {
17279 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17280 }
17281 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17282 }
17283
17284 async fn build_transport(
17285 conf: gaxi::options::ClientConfig,
17286 ) -> crate::ClientBuilderResult<impl super::stub::Routes> {
17287 super::transport::Routes::new(conf).await
17288 }
17289
17290 async fn build_with_tracing(
17291 conf: gaxi::options::ClientConfig,
17292 ) -> crate::ClientBuilderResult<impl super::stub::Routes> {
17293 Self::build_transport(conf)
17294 .await
17295 .map(super::tracing::Routes::new)
17296 }
17297
17298 /// Deletes the specified Route resource.
17299 pub fn delete(&self) -> super::builder::routes::Delete {
17300 super::builder::routes::Delete::new(self.inner.clone())
17301 }
17302
17303 /// Returns the specified Route resource.
17304 pub fn get(&self) -> super::builder::routes::Get {
17305 super::builder::routes::Get::new(self.inner.clone())
17306 }
17307
17308 /// Creates a Route resource in the specified project using the data included
17309 /// in the request.
17310 pub fn insert(&self) -> super::builder::routes::Insert {
17311 super::builder::routes::Insert::new(self.inner.clone())
17312 }
17313
17314 /// Retrieves the list of Route resources available to the specified project.
17315 pub fn list(&self) -> super::builder::routes::List {
17316 super::builder::routes::List::new(self.inner.clone())
17317 }
17318
17319 /// Returns permissions that a caller has on the specified resource.
17320 pub fn test_iam_permissions(&self) -> super::builder::routes::TestIamPermissions {
17321 super::builder::routes::TestIamPermissions::new(self.inner.clone())
17322 }
17323
17324 /// Retrieves the specified Operations resource.
17325 pub fn get_operation(&self) -> super::builder::routes::GetOperation {
17326 super::builder::routes::GetOperation::new(self.inner.clone())
17327 }
17328}
17329
17330/// Implements a client for the Compute Engine API.
17331///
17332/// # Example
17333/// ```
17334/// # use google_cloud_compute_v1::client::SecurityPolicies;
17335/// async fn sample(
17336/// ) -> anyhow::Result<()> {
17337/// let client = SecurityPolicies::builder().build().await?;
17338/// // use `client` to make requests to the Compute Engine API.
17339/// Ok(())
17340/// }
17341/// ```
17342///
17343/// # Service Description
17344///
17345/// Service for the `securityPolicies` resource.
17346///
17347/// # Configuration
17348///
17349/// To configure `SecurityPolicies` use the `with_*` methods in the type returned
17350/// by [builder()][SecurityPolicies::builder]. The default configuration should
17351/// work for most applications. Common configuration changes include
17352///
17353/// * [with_endpoint()]: by default this client uses the global default endpoint
17354/// (`https://compute.googleapis.com`). Applications using regional
17355/// endpoints or running in restricted networks (e.g. a network configured
17356/// with [Private Google Access with VPC Service Controls]) may want to
17357/// override this default.
17358/// * [with_credentials()]: by default this client uses
17359/// [Application Default Credentials]. Applications using custom
17360/// authentication may need to override this default.
17361///
17362/// [with_endpoint()]: super::builder::security_policies::ClientBuilder::with_endpoint
17363/// [with_credentials()]: super::builder::security_policies::ClientBuilder::with_credentials
17364/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17365/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17366///
17367/// # Pooling and Cloning
17368///
17369/// `SecurityPolicies` holds a connection pool internally, it is advised to
17370/// create one and reuse it. You do not need to wrap `SecurityPolicies` in
17371/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17372/// already uses an `Arc` internally.
17373#[cfg(feature = "security-policies")]
17374#[cfg_attr(docsrs, doc(cfg(feature = "security-policies")))]
17375#[derive(Clone, Debug)]
17376pub struct SecurityPolicies {
17377 inner: std::sync::Arc<dyn super::stub::dynamic::SecurityPolicies>,
17378}
17379
17380#[cfg(feature = "security-policies")]
17381impl SecurityPolicies {
17382 /// Returns a builder for [SecurityPolicies].
17383 ///
17384 /// ```
17385 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17386 /// # use google_cloud_compute_v1::client::SecurityPolicies;
17387 /// let client = SecurityPolicies::builder().build().await?;
17388 /// # Ok(()) }
17389 /// ```
17390 pub fn builder() -> super::builder::security_policies::ClientBuilder {
17391 crate::new_client_builder(super::builder::security_policies::client::Factory)
17392 }
17393
17394 /// Creates a new client from the provided stub.
17395 ///
17396 /// The most common case for calling this function is in tests mocking the
17397 /// client's behavior.
17398 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
17399 where
17400 T: super::stub::SecurityPolicies + 'static,
17401 {
17402 Self { inner: stub.into() }
17403 }
17404
17405 pub(crate) async fn new(
17406 config: gaxi::options::ClientConfig,
17407 ) -> crate::ClientBuilderResult<Self> {
17408 let inner = Self::build_inner(config).await?;
17409 Ok(Self { inner })
17410 }
17411
17412 async fn build_inner(
17413 conf: gaxi::options::ClientConfig,
17414 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SecurityPolicies>>
17415 {
17416 if gaxi::options::tracing_enabled(&conf) {
17417 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17418 }
17419 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17420 }
17421
17422 async fn build_transport(
17423 conf: gaxi::options::ClientConfig,
17424 ) -> crate::ClientBuilderResult<impl super::stub::SecurityPolicies> {
17425 super::transport::SecurityPolicies::new(conf).await
17426 }
17427
17428 async fn build_with_tracing(
17429 conf: gaxi::options::ClientConfig,
17430 ) -> crate::ClientBuilderResult<impl super::stub::SecurityPolicies> {
17431 Self::build_transport(conf)
17432 .await
17433 .map(super::tracing::SecurityPolicies::new)
17434 }
17435
17436 /// Inserts a rule into a security policy.
17437 pub fn add_rule(&self) -> super::builder::security_policies::AddRule {
17438 super::builder::security_policies::AddRule::new(self.inner.clone())
17439 }
17440
17441 /// Retrieves the list of all SecurityPolicy resources, regional and global,
17442 /// available to the specified project.
17443 ///
17444 /// To prevent failure, Google recommends that you set the
17445 /// `returnPartialSuccess` parameter to `true`.
17446 pub fn aggregated_list(&self) -> super::builder::security_policies::AggregatedList {
17447 super::builder::security_policies::AggregatedList::new(self.inner.clone())
17448 }
17449
17450 /// Deletes the specified policy.
17451 pub fn delete(&self) -> super::builder::security_policies::Delete {
17452 super::builder::security_policies::Delete::new(self.inner.clone())
17453 }
17454
17455 /// List all of the ordered rules present in a single specified policy.
17456 pub fn get(&self) -> super::builder::security_policies::Get {
17457 super::builder::security_policies::Get::new(self.inner.clone())
17458 }
17459
17460 /// Gets a rule at the specified priority.
17461 pub fn get_rule(&self) -> super::builder::security_policies::GetRule {
17462 super::builder::security_policies::GetRule::new(self.inner.clone())
17463 }
17464
17465 /// Creates a new policy in the specified project using the data included in
17466 /// the request.
17467 pub fn insert(&self) -> super::builder::security_policies::Insert {
17468 super::builder::security_policies::Insert::new(self.inner.clone())
17469 }
17470
17471 /// List all the policies that have been configured for the specified project.
17472 pub fn list(&self) -> super::builder::security_policies::List {
17473 super::builder::security_policies::List::new(self.inner.clone())
17474 }
17475
17476 /// Gets the current list of preconfigured Web Application Firewall (WAF)
17477 /// expressions.
17478 pub fn list_preconfigured_expression_sets(
17479 &self,
17480 ) -> super::builder::security_policies::ListPreconfiguredExpressionSets {
17481 super::builder::security_policies::ListPreconfiguredExpressionSets::new(self.inner.clone())
17482 }
17483
17484 /// Patches the specified policy with the data included in the request. To
17485 /// clear fields in the policy, leave the fields empty and specify them in the
17486 /// updateMask. This cannot be used to be update the rules in the policy.
17487 /// Please use the per rule methods like addRule, patchRule, and removeRule
17488 /// instead.
17489 pub fn patch(&self) -> super::builder::security_policies::Patch {
17490 super::builder::security_policies::Patch::new(self.inner.clone())
17491 }
17492
17493 /// Patches a rule at the specified priority. To clear fields in the rule,
17494 /// leave the fields empty and specify them in the updateMask.
17495 pub fn patch_rule(&self) -> super::builder::security_policies::PatchRule {
17496 super::builder::security_policies::PatchRule::new(self.inner.clone())
17497 }
17498
17499 /// Deletes a rule at the specified priority.
17500 pub fn remove_rule(&self) -> super::builder::security_policies::RemoveRule {
17501 super::builder::security_policies::RemoveRule::new(self.inner.clone())
17502 }
17503
17504 /// Sets the labels on a security policy. To learn more about labels,
17505 /// read the Labeling Resources
17506 /// documentation.
17507 pub fn set_labels(&self) -> super::builder::security_policies::SetLabels {
17508 super::builder::security_policies::SetLabels::new(self.inner.clone())
17509 }
17510
17511 /// Retrieves the specified Operations resource.
17512 pub fn get_operation(&self) -> super::builder::security_policies::GetOperation {
17513 super::builder::security_policies::GetOperation::new(self.inner.clone())
17514 }
17515}
17516
17517/// Implements a client for the Compute Engine API.
17518///
17519/// # Example
17520/// ```
17521/// # use google_cloud_compute_v1::client::ServiceAttachments;
17522/// async fn sample(
17523/// ) -> anyhow::Result<()> {
17524/// let client = ServiceAttachments::builder().build().await?;
17525/// // use `client` to make requests to the Compute Engine API.
17526/// Ok(())
17527/// }
17528/// ```
17529///
17530/// # Service Description
17531///
17532/// Service for the `serviceAttachments` resource.
17533///
17534/// # Configuration
17535///
17536/// To configure `ServiceAttachments` use the `with_*` methods in the type returned
17537/// by [builder()][ServiceAttachments::builder]. The default configuration should
17538/// work for most applications. Common configuration changes include
17539///
17540/// * [with_endpoint()]: by default this client uses the global default endpoint
17541/// (`https://compute.googleapis.com`). Applications using regional
17542/// endpoints or running in restricted networks (e.g. a network configured
17543/// with [Private Google Access with VPC Service Controls]) may want to
17544/// override this default.
17545/// * [with_credentials()]: by default this client uses
17546/// [Application Default Credentials]. Applications using custom
17547/// authentication may need to override this default.
17548///
17549/// [with_endpoint()]: super::builder::service_attachments::ClientBuilder::with_endpoint
17550/// [with_credentials()]: super::builder::service_attachments::ClientBuilder::with_credentials
17551/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17552/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17553///
17554/// # Pooling and Cloning
17555///
17556/// `ServiceAttachments` holds a connection pool internally, it is advised to
17557/// create one and reuse it. You do not need to wrap `ServiceAttachments` in
17558/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17559/// already uses an `Arc` internally.
17560#[cfg(feature = "service-attachments")]
17561#[cfg_attr(docsrs, doc(cfg(feature = "service-attachments")))]
17562#[derive(Clone, Debug)]
17563pub struct ServiceAttachments {
17564 inner: std::sync::Arc<dyn super::stub::dynamic::ServiceAttachments>,
17565}
17566
17567#[cfg(feature = "service-attachments")]
17568impl ServiceAttachments {
17569 /// Returns a builder for [ServiceAttachments].
17570 ///
17571 /// ```
17572 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17573 /// # use google_cloud_compute_v1::client::ServiceAttachments;
17574 /// let client = ServiceAttachments::builder().build().await?;
17575 /// # Ok(()) }
17576 /// ```
17577 pub fn builder() -> super::builder::service_attachments::ClientBuilder {
17578 crate::new_client_builder(super::builder::service_attachments::client::Factory)
17579 }
17580
17581 /// Creates a new client from the provided stub.
17582 ///
17583 /// The most common case for calling this function is in tests mocking the
17584 /// client's behavior.
17585 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
17586 where
17587 T: super::stub::ServiceAttachments + 'static,
17588 {
17589 Self { inner: stub.into() }
17590 }
17591
17592 pub(crate) async fn new(
17593 config: gaxi::options::ClientConfig,
17594 ) -> crate::ClientBuilderResult<Self> {
17595 let inner = Self::build_inner(config).await?;
17596 Ok(Self { inner })
17597 }
17598
17599 async fn build_inner(
17600 conf: gaxi::options::ClientConfig,
17601 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ServiceAttachments>>
17602 {
17603 if gaxi::options::tracing_enabled(&conf) {
17604 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17605 }
17606 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17607 }
17608
17609 async fn build_transport(
17610 conf: gaxi::options::ClientConfig,
17611 ) -> crate::ClientBuilderResult<impl super::stub::ServiceAttachments> {
17612 super::transport::ServiceAttachments::new(conf).await
17613 }
17614
17615 async fn build_with_tracing(
17616 conf: gaxi::options::ClientConfig,
17617 ) -> crate::ClientBuilderResult<impl super::stub::ServiceAttachments> {
17618 Self::build_transport(conf)
17619 .await
17620 .map(super::tracing::ServiceAttachments::new)
17621 }
17622
17623 /// Retrieves the list of all ServiceAttachment resources,
17624 /// regional and global, available to the specified project.
17625 ///
17626 /// To prevent failure, Google recommends that you set the
17627 /// `returnPartialSuccess` parameter to `true`.
17628 pub fn aggregated_list(&self) -> super::builder::service_attachments::AggregatedList {
17629 super::builder::service_attachments::AggregatedList::new(self.inner.clone())
17630 }
17631
17632 /// Deletes the specified ServiceAttachment in the given scope
17633 pub fn delete(&self) -> super::builder::service_attachments::Delete {
17634 super::builder::service_attachments::Delete::new(self.inner.clone())
17635 }
17636
17637 /// Returns the specified ServiceAttachment resource in the given scope.
17638 pub fn get(&self) -> super::builder::service_attachments::Get {
17639 super::builder::service_attachments::Get::new(self.inner.clone())
17640 }
17641
17642 /// Gets the access control policy for a resource. May be empty if no such
17643 /// policy or resource exists.
17644 pub fn get_iam_policy(&self) -> super::builder::service_attachments::GetIamPolicy {
17645 super::builder::service_attachments::GetIamPolicy::new(self.inner.clone())
17646 }
17647
17648 /// Creates a ServiceAttachment in the specified project in the given scope
17649 /// using the parameters that are included in the request.
17650 pub fn insert(&self) -> super::builder::service_attachments::Insert {
17651 super::builder::service_attachments::Insert::new(self.inner.clone())
17652 }
17653
17654 /// Lists the ServiceAttachments for a project in the given scope.
17655 pub fn list(&self) -> super::builder::service_attachments::List {
17656 super::builder::service_attachments::List::new(self.inner.clone())
17657 }
17658
17659 /// Patches the specified ServiceAttachment resource with the data included in
17660 /// the request. This method supports PATCH
17661 /// semantics and usesJSON merge
17662 /// patch format and processing rules.
17663 pub fn patch(&self) -> super::builder::service_attachments::Patch {
17664 super::builder::service_attachments::Patch::new(self.inner.clone())
17665 }
17666
17667 /// Sets the access control policy on the specified resource.
17668 /// Replaces any existing policy.
17669 pub fn set_iam_policy(&self) -> super::builder::service_attachments::SetIamPolicy {
17670 super::builder::service_attachments::SetIamPolicy::new(self.inner.clone())
17671 }
17672
17673 /// Returns permissions that a caller has on the specified resource.
17674 pub fn test_iam_permissions(&self) -> super::builder::service_attachments::TestIamPermissions {
17675 super::builder::service_attachments::TestIamPermissions::new(self.inner.clone())
17676 }
17677
17678 /// Retrieves the specified region-specific Operations resource.
17679 pub fn get_operation(&self) -> super::builder::service_attachments::GetOperation {
17680 super::builder::service_attachments::GetOperation::new(self.inner.clone())
17681 }
17682}
17683
17684/// Implements a client for the Compute Engine API.
17685///
17686/// # Example
17687/// ```
17688/// # use google_cloud_compute_v1::client::SnapshotSettings;
17689/// async fn sample(
17690/// ) -> anyhow::Result<()> {
17691/// let client = SnapshotSettings::builder().build().await?;
17692/// // use `client` to make requests to the Compute Engine API.
17693/// Ok(())
17694/// }
17695/// ```
17696///
17697/// # Service Description
17698///
17699/// Service for the `snapshotSettings` resource.
17700///
17701/// # Configuration
17702///
17703/// To configure `SnapshotSettings` use the `with_*` methods in the type returned
17704/// by [builder()][SnapshotSettings::builder]. The default configuration should
17705/// work for most applications. Common configuration changes include
17706///
17707/// * [with_endpoint()]: by default this client uses the global default endpoint
17708/// (`https://compute.googleapis.com`). Applications using regional
17709/// endpoints or running in restricted networks (e.g. a network configured
17710/// with [Private Google Access with VPC Service Controls]) may want to
17711/// override this default.
17712/// * [with_credentials()]: by default this client uses
17713/// [Application Default Credentials]. Applications using custom
17714/// authentication may need to override this default.
17715///
17716/// [with_endpoint()]: super::builder::snapshot_settings::ClientBuilder::with_endpoint
17717/// [with_credentials()]: super::builder::snapshot_settings::ClientBuilder::with_credentials
17718/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17719/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17720///
17721/// # Pooling and Cloning
17722///
17723/// `SnapshotSettings` holds a connection pool internally, it is advised to
17724/// create one and reuse it. You do not need to wrap `SnapshotSettings` in
17725/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17726/// already uses an `Arc` internally.
17727#[cfg(feature = "snapshot-settings")]
17728#[cfg_attr(docsrs, doc(cfg(feature = "snapshot-settings")))]
17729#[derive(Clone, Debug)]
17730pub struct SnapshotSettings {
17731 inner: std::sync::Arc<dyn super::stub::dynamic::SnapshotSettings>,
17732}
17733
17734#[cfg(feature = "snapshot-settings")]
17735impl SnapshotSettings {
17736 /// Returns a builder for [SnapshotSettings].
17737 ///
17738 /// ```
17739 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17740 /// # use google_cloud_compute_v1::client::SnapshotSettings;
17741 /// let client = SnapshotSettings::builder().build().await?;
17742 /// # Ok(()) }
17743 /// ```
17744 pub fn builder() -> super::builder::snapshot_settings::ClientBuilder {
17745 crate::new_client_builder(super::builder::snapshot_settings::client::Factory)
17746 }
17747
17748 /// Creates a new client from the provided stub.
17749 ///
17750 /// The most common case for calling this function is in tests mocking the
17751 /// client's behavior.
17752 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
17753 where
17754 T: super::stub::SnapshotSettings + 'static,
17755 {
17756 Self { inner: stub.into() }
17757 }
17758
17759 pub(crate) async fn new(
17760 config: gaxi::options::ClientConfig,
17761 ) -> crate::ClientBuilderResult<Self> {
17762 let inner = Self::build_inner(config).await?;
17763 Ok(Self { inner })
17764 }
17765
17766 async fn build_inner(
17767 conf: gaxi::options::ClientConfig,
17768 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SnapshotSettings>>
17769 {
17770 if gaxi::options::tracing_enabled(&conf) {
17771 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17772 }
17773 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17774 }
17775
17776 async fn build_transport(
17777 conf: gaxi::options::ClientConfig,
17778 ) -> crate::ClientBuilderResult<impl super::stub::SnapshotSettings> {
17779 super::transport::SnapshotSettings::new(conf).await
17780 }
17781
17782 async fn build_with_tracing(
17783 conf: gaxi::options::ClientConfig,
17784 ) -> crate::ClientBuilderResult<impl super::stub::SnapshotSettings> {
17785 Self::build_transport(conf)
17786 .await
17787 .map(super::tracing::SnapshotSettings::new)
17788 }
17789
17790 /// Get snapshot settings.
17791 pub fn get(&self) -> super::builder::snapshot_settings::Get {
17792 super::builder::snapshot_settings::Get::new(self.inner.clone())
17793 }
17794
17795 /// Patch snapshot settings.
17796 pub fn patch(&self) -> super::builder::snapshot_settings::Patch {
17797 super::builder::snapshot_settings::Patch::new(self.inner.clone())
17798 }
17799
17800 /// Retrieves the specified Operations resource.
17801 pub fn get_operation(&self) -> super::builder::snapshot_settings::GetOperation {
17802 super::builder::snapshot_settings::GetOperation::new(self.inner.clone())
17803 }
17804}
17805
17806/// Implements a client for the Compute Engine API.
17807///
17808/// # Example
17809/// ```
17810/// # use google_cloud_compute_v1::client::Snapshots;
17811/// async fn sample(
17812/// ) -> anyhow::Result<()> {
17813/// let client = Snapshots::builder().build().await?;
17814/// // use `client` to make requests to the Compute Engine API.
17815/// Ok(())
17816/// }
17817/// ```
17818///
17819/// # Service Description
17820///
17821/// Service for the `snapshots` resource.
17822///
17823/// # Configuration
17824///
17825/// To configure `Snapshots` use the `with_*` methods in the type returned
17826/// by [builder()][Snapshots::builder]. The default configuration should
17827/// work for most applications. Common configuration changes include
17828///
17829/// * [with_endpoint()]: by default this client uses the global default endpoint
17830/// (`https://compute.googleapis.com`). Applications using regional
17831/// endpoints or running in restricted networks (e.g. a network configured
17832/// with [Private Google Access with VPC Service Controls]) may want to
17833/// override this default.
17834/// * [with_credentials()]: by default this client uses
17835/// [Application Default Credentials]. Applications using custom
17836/// authentication may need to override this default.
17837///
17838/// [with_endpoint()]: super::builder::snapshots::ClientBuilder::with_endpoint
17839/// [with_credentials()]: super::builder::snapshots::ClientBuilder::with_credentials
17840/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17841/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17842///
17843/// # Pooling and Cloning
17844///
17845/// `Snapshots` holds a connection pool internally, it is advised to
17846/// create one and reuse it. You do not need to wrap `Snapshots` in
17847/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17848/// already uses an `Arc` internally.
17849#[cfg(feature = "snapshots")]
17850#[cfg_attr(docsrs, doc(cfg(feature = "snapshots")))]
17851#[derive(Clone, Debug)]
17852pub struct Snapshots {
17853 inner: std::sync::Arc<dyn super::stub::dynamic::Snapshots>,
17854}
17855
17856#[cfg(feature = "snapshots")]
17857impl Snapshots {
17858 /// Returns a builder for [Snapshots].
17859 ///
17860 /// ```
17861 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17862 /// # use google_cloud_compute_v1::client::Snapshots;
17863 /// let client = Snapshots::builder().build().await?;
17864 /// # Ok(()) }
17865 /// ```
17866 pub fn builder() -> super::builder::snapshots::ClientBuilder {
17867 crate::new_client_builder(super::builder::snapshots::client::Factory)
17868 }
17869
17870 /// Creates a new client from the provided stub.
17871 ///
17872 /// The most common case for calling this function is in tests mocking the
17873 /// client's behavior.
17874 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
17875 where
17876 T: super::stub::Snapshots + 'static,
17877 {
17878 Self { inner: stub.into() }
17879 }
17880
17881 pub(crate) async fn new(
17882 config: gaxi::options::ClientConfig,
17883 ) -> crate::ClientBuilderResult<Self> {
17884 let inner = Self::build_inner(config).await?;
17885 Ok(Self { inner })
17886 }
17887
17888 async fn build_inner(
17889 conf: gaxi::options::ClientConfig,
17890 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Snapshots>> {
17891 if gaxi::options::tracing_enabled(&conf) {
17892 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17893 }
17894 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17895 }
17896
17897 async fn build_transport(
17898 conf: gaxi::options::ClientConfig,
17899 ) -> crate::ClientBuilderResult<impl super::stub::Snapshots> {
17900 super::transport::Snapshots::new(conf).await
17901 }
17902
17903 async fn build_with_tracing(
17904 conf: gaxi::options::ClientConfig,
17905 ) -> crate::ClientBuilderResult<impl super::stub::Snapshots> {
17906 Self::build_transport(conf)
17907 .await
17908 .map(super::tracing::Snapshots::new)
17909 }
17910
17911 /// Deletes the specified Snapshot resource. Keep in mind that deleting
17912 /// a single snapshot might not necessarily delete all the data on that
17913 /// snapshot. If any data on the snapshot that is marked for deletion is
17914 /// needed for subsequent snapshots, the data will be moved to the next
17915 /// corresponding snapshot.
17916 ///
17917 /// For more information, seeDeleting
17918 /// snapshots.
17919 pub fn delete(&self) -> super::builder::snapshots::Delete {
17920 super::builder::snapshots::Delete::new(self.inner.clone())
17921 }
17922
17923 /// Returns the specified Snapshot resource.
17924 pub fn get(&self) -> super::builder::snapshots::Get {
17925 super::builder::snapshots::Get::new(self.inner.clone())
17926 }
17927
17928 /// Gets the access control policy for a resource. May be empty if no such
17929 /// policy or resource exists.
17930 pub fn get_iam_policy(&self) -> super::builder::snapshots::GetIamPolicy {
17931 super::builder::snapshots::GetIamPolicy::new(self.inner.clone())
17932 }
17933
17934 /// Creates a snapshot in the specified project using the data included
17935 /// in the request. For regular snapshot creation, consider using this method
17936 /// instead of disks.createSnapshot,
17937 /// as this method supports more features, such as creating snapshots in a
17938 /// project different from the source disk project.
17939 pub fn insert(&self) -> super::builder::snapshots::Insert {
17940 super::builder::snapshots::Insert::new(self.inner.clone())
17941 }
17942
17943 /// Retrieves the list of Snapshot resources contained within
17944 /// the specified project.
17945 pub fn list(&self) -> super::builder::snapshots::List {
17946 super::builder::snapshots::List::new(self.inner.clone())
17947 }
17948
17949 /// Sets the access control policy on the specified resource.
17950 /// Replaces any existing policy.
17951 pub fn set_iam_policy(&self) -> super::builder::snapshots::SetIamPolicy {
17952 super::builder::snapshots::SetIamPolicy::new(self.inner.clone())
17953 }
17954
17955 /// Sets the labels on a snapshot. To learn more about labels, read theLabeling
17956 /// Resources documentation.
17957 pub fn set_labels(&self) -> super::builder::snapshots::SetLabels {
17958 super::builder::snapshots::SetLabels::new(self.inner.clone())
17959 }
17960
17961 /// Returns permissions that a caller has on the specified resource.
17962 pub fn test_iam_permissions(&self) -> super::builder::snapshots::TestIamPermissions {
17963 super::builder::snapshots::TestIamPermissions::new(self.inner.clone())
17964 }
17965
17966 /// Rotates the customer-managed
17967 /// encryption key to the latest version for the specified snapshot.
17968 pub fn update_kms_key(&self) -> super::builder::snapshots::UpdateKmsKey {
17969 super::builder::snapshots::UpdateKmsKey::new(self.inner.clone())
17970 }
17971
17972 /// Retrieves the specified Operations resource.
17973 pub fn get_operation(&self) -> super::builder::snapshots::GetOperation {
17974 super::builder::snapshots::GetOperation::new(self.inner.clone())
17975 }
17976}
17977
17978/// Implements a client for the Compute Engine API.
17979///
17980/// # Example
17981/// ```
17982/// # use google_cloud_compute_v1::client::SslCertificates;
17983/// async fn sample(
17984/// ) -> anyhow::Result<()> {
17985/// let client = SslCertificates::builder().build().await?;
17986/// // use `client` to make requests to the Compute Engine API.
17987/// Ok(())
17988/// }
17989/// ```
17990///
17991/// # Service Description
17992///
17993/// Service for the `sslCertificates` resource.
17994///
17995/// # Configuration
17996///
17997/// To configure `SslCertificates` use the `with_*` methods in the type returned
17998/// by [builder()][SslCertificates::builder]. The default configuration should
17999/// work for most applications. Common configuration changes include
18000///
18001/// * [with_endpoint()]: by default this client uses the global default endpoint
18002/// (`https://compute.googleapis.com`). Applications using regional
18003/// endpoints or running in restricted networks (e.g. a network configured
18004/// with [Private Google Access with VPC Service Controls]) may want to
18005/// override this default.
18006/// * [with_credentials()]: by default this client uses
18007/// [Application Default Credentials]. Applications using custom
18008/// authentication may need to override this default.
18009///
18010/// [with_endpoint()]: super::builder::ssl_certificates::ClientBuilder::with_endpoint
18011/// [with_credentials()]: super::builder::ssl_certificates::ClientBuilder::with_credentials
18012/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18013/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18014///
18015/// # Pooling and Cloning
18016///
18017/// `SslCertificates` holds a connection pool internally, it is advised to
18018/// create one and reuse it. You do not need to wrap `SslCertificates` in
18019/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18020/// already uses an `Arc` internally.
18021#[cfg(feature = "ssl-certificates")]
18022#[cfg_attr(docsrs, doc(cfg(feature = "ssl-certificates")))]
18023#[derive(Clone, Debug)]
18024pub struct SslCertificates {
18025 inner: std::sync::Arc<dyn super::stub::dynamic::SslCertificates>,
18026}
18027
18028#[cfg(feature = "ssl-certificates")]
18029impl SslCertificates {
18030 /// Returns a builder for [SslCertificates].
18031 ///
18032 /// ```
18033 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18034 /// # use google_cloud_compute_v1::client::SslCertificates;
18035 /// let client = SslCertificates::builder().build().await?;
18036 /// # Ok(()) }
18037 /// ```
18038 pub fn builder() -> super::builder::ssl_certificates::ClientBuilder {
18039 crate::new_client_builder(super::builder::ssl_certificates::client::Factory)
18040 }
18041
18042 /// Creates a new client from the provided stub.
18043 ///
18044 /// The most common case for calling this function is in tests mocking the
18045 /// client's behavior.
18046 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
18047 where
18048 T: super::stub::SslCertificates + 'static,
18049 {
18050 Self { inner: stub.into() }
18051 }
18052
18053 pub(crate) async fn new(
18054 config: gaxi::options::ClientConfig,
18055 ) -> crate::ClientBuilderResult<Self> {
18056 let inner = Self::build_inner(config).await?;
18057 Ok(Self { inner })
18058 }
18059
18060 async fn build_inner(
18061 conf: gaxi::options::ClientConfig,
18062 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SslCertificates>> {
18063 if gaxi::options::tracing_enabled(&conf) {
18064 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18065 }
18066 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18067 }
18068
18069 async fn build_transport(
18070 conf: gaxi::options::ClientConfig,
18071 ) -> crate::ClientBuilderResult<impl super::stub::SslCertificates> {
18072 super::transport::SslCertificates::new(conf).await
18073 }
18074
18075 async fn build_with_tracing(
18076 conf: gaxi::options::ClientConfig,
18077 ) -> crate::ClientBuilderResult<impl super::stub::SslCertificates> {
18078 Self::build_transport(conf)
18079 .await
18080 .map(super::tracing::SslCertificates::new)
18081 }
18082
18083 /// Retrieves the list of all SslCertificate resources, regional and global,
18084 /// available to the specified project.
18085 ///
18086 /// To prevent failure, Google recommends that you set the
18087 /// `returnPartialSuccess` parameter to `true`.
18088 pub fn aggregated_list(&self) -> super::builder::ssl_certificates::AggregatedList {
18089 super::builder::ssl_certificates::AggregatedList::new(self.inner.clone())
18090 }
18091
18092 /// Deletes the specified SslCertificate resource.
18093 pub fn delete(&self) -> super::builder::ssl_certificates::Delete {
18094 super::builder::ssl_certificates::Delete::new(self.inner.clone())
18095 }
18096
18097 /// Returns the specified SslCertificate resource.
18098 pub fn get(&self) -> super::builder::ssl_certificates::Get {
18099 super::builder::ssl_certificates::Get::new(self.inner.clone())
18100 }
18101
18102 /// Creates a SslCertificate resource in the specified project using the data
18103 /// included in the request.
18104 pub fn insert(&self) -> super::builder::ssl_certificates::Insert {
18105 super::builder::ssl_certificates::Insert::new(self.inner.clone())
18106 }
18107
18108 /// Retrieves the list of SslCertificate resources available to the specified
18109 /// project.
18110 pub fn list(&self) -> super::builder::ssl_certificates::List {
18111 super::builder::ssl_certificates::List::new(self.inner.clone())
18112 }
18113
18114 /// Retrieves the specified Operations resource.
18115 pub fn get_operation(&self) -> super::builder::ssl_certificates::GetOperation {
18116 super::builder::ssl_certificates::GetOperation::new(self.inner.clone())
18117 }
18118}
18119
18120/// Implements a client for the Compute Engine API.
18121///
18122/// # Example
18123/// ```
18124/// # use google_cloud_compute_v1::client::SslPolicies;
18125/// async fn sample(
18126/// ) -> anyhow::Result<()> {
18127/// let client = SslPolicies::builder().build().await?;
18128/// // use `client` to make requests to the Compute Engine API.
18129/// Ok(())
18130/// }
18131/// ```
18132///
18133/// # Service Description
18134///
18135/// Service for the `sslPolicies` resource.
18136///
18137/// # Configuration
18138///
18139/// To configure `SslPolicies` use the `with_*` methods in the type returned
18140/// by [builder()][SslPolicies::builder]. The default configuration should
18141/// work for most applications. Common configuration changes include
18142///
18143/// * [with_endpoint()]: by default this client uses the global default endpoint
18144/// (`https://compute.googleapis.com`). Applications using regional
18145/// endpoints or running in restricted networks (e.g. a network configured
18146/// with [Private Google Access with VPC Service Controls]) may want to
18147/// override this default.
18148/// * [with_credentials()]: by default this client uses
18149/// [Application Default Credentials]. Applications using custom
18150/// authentication may need to override this default.
18151///
18152/// [with_endpoint()]: super::builder::ssl_policies::ClientBuilder::with_endpoint
18153/// [with_credentials()]: super::builder::ssl_policies::ClientBuilder::with_credentials
18154/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18155/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18156///
18157/// # Pooling and Cloning
18158///
18159/// `SslPolicies` holds a connection pool internally, it is advised to
18160/// create one and reuse it. You do not need to wrap `SslPolicies` in
18161/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18162/// already uses an `Arc` internally.
18163#[cfg(feature = "ssl-policies")]
18164#[cfg_attr(docsrs, doc(cfg(feature = "ssl-policies")))]
18165#[derive(Clone, Debug)]
18166pub struct SslPolicies {
18167 inner: std::sync::Arc<dyn super::stub::dynamic::SslPolicies>,
18168}
18169
18170#[cfg(feature = "ssl-policies")]
18171impl SslPolicies {
18172 /// Returns a builder for [SslPolicies].
18173 ///
18174 /// ```
18175 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18176 /// # use google_cloud_compute_v1::client::SslPolicies;
18177 /// let client = SslPolicies::builder().build().await?;
18178 /// # Ok(()) }
18179 /// ```
18180 pub fn builder() -> super::builder::ssl_policies::ClientBuilder {
18181 crate::new_client_builder(super::builder::ssl_policies::client::Factory)
18182 }
18183
18184 /// Creates a new client from the provided stub.
18185 ///
18186 /// The most common case for calling this function is in tests mocking the
18187 /// client's behavior.
18188 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
18189 where
18190 T: super::stub::SslPolicies + 'static,
18191 {
18192 Self { inner: stub.into() }
18193 }
18194
18195 pub(crate) async fn new(
18196 config: gaxi::options::ClientConfig,
18197 ) -> crate::ClientBuilderResult<Self> {
18198 let inner = Self::build_inner(config).await?;
18199 Ok(Self { inner })
18200 }
18201
18202 async fn build_inner(
18203 conf: gaxi::options::ClientConfig,
18204 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SslPolicies>> {
18205 if gaxi::options::tracing_enabled(&conf) {
18206 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18207 }
18208 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18209 }
18210
18211 async fn build_transport(
18212 conf: gaxi::options::ClientConfig,
18213 ) -> crate::ClientBuilderResult<impl super::stub::SslPolicies> {
18214 super::transport::SslPolicies::new(conf).await
18215 }
18216
18217 async fn build_with_tracing(
18218 conf: gaxi::options::ClientConfig,
18219 ) -> crate::ClientBuilderResult<impl super::stub::SslPolicies> {
18220 Self::build_transport(conf)
18221 .await
18222 .map(super::tracing::SslPolicies::new)
18223 }
18224
18225 /// Retrieves the list of all SslPolicy resources, regional and global,
18226 /// available to the specified project.
18227 ///
18228 /// To prevent failure, Google recommends that you set the
18229 /// `returnPartialSuccess` parameter to `true`.
18230 pub fn aggregated_list(&self) -> super::builder::ssl_policies::AggregatedList {
18231 super::builder::ssl_policies::AggregatedList::new(self.inner.clone())
18232 }
18233
18234 /// Deletes the specified SSL policy. The SSL policy resource can be deleted
18235 /// only if it is not in use by any TargetHttpsProxy or TargetSslProxy
18236 /// resources.
18237 pub fn delete(&self) -> super::builder::ssl_policies::Delete {
18238 super::builder::ssl_policies::Delete::new(self.inner.clone())
18239 }
18240
18241 /// Lists all of the ordered rules present in a single specified policy.
18242 pub fn get(&self) -> super::builder::ssl_policies::Get {
18243 super::builder::ssl_policies::Get::new(self.inner.clone())
18244 }
18245
18246 /// Returns the specified SSL policy resource.
18247 pub fn insert(&self) -> super::builder::ssl_policies::Insert {
18248 super::builder::ssl_policies::Insert::new(self.inner.clone())
18249 }
18250
18251 /// Lists all the SSL policies that have been configured for the specified
18252 /// project.
18253 pub fn list(&self) -> super::builder::ssl_policies::List {
18254 super::builder::ssl_policies::List::new(self.inner.clone())
18255 }
18256
18257 /// Lists all features that can be specified in the SSL policy when using
18258 /// custom profile.
18259 pub fn list_available_features(&self) -> super::builder::ssl_policies::ListAvailableFeatures {
18260 super::builder::ssl_policies::ListAvailableFeatures::new(self.inner.clone())
18261 }
18262
18263 /// Patches the specified SSL policy with the data included in the request.
18264 pub fn patch(&self) -> super::builder::ssl_policies::Patch {
18265 super::builder::ssl_policies::Patch::new(self.inner.clone())
18266 }
18267
18268 /// Retrieves the specified Operations resource.
18269 pub fn get_operation(&self) -> super::builder::ssl_policies::GetOperation {
18270 super::builder::ssl_policies::GetOperation::new(self.inner.clone())
18271 }
18272}
18273
18274/// Implements a client for the Compute Engine API.
18275///
18276/// # Example
18277/// ```
18278/// # use google_cloud_compute_v1::client::StoragePoolTypes;
18279/// async fn sample(
18280/// ) -> anyhow::Result<()> {
18281/// let client = StoragePoolTypes::builder().build().await?;
18282/// // use `client` to make requests to the Compute Engine API.
18283/// Ok(())
18284/// }
18285/// ```
18286///
18287/// # Service Description
18288///
18289/// Service for the `storagePoolTypes` resource.
18290///
18291/// # Configuration
18292///
18293/// To configure `StoragePoolTypes` use the `with_*` methods in the type returned
18294/// by [builder()][StoragePoolTypes::builder]. The default configuration should
18295/// work for most applications. Common configuration changes include
18296///
18297/// * [with_endpoint()]: by default this client uses the global default endpoint
18298/// (`https://compute.googleapis.com`). Applications using regional
18299/// endpoints or running in restricted networks (e.g. a network configured
18300/// with [Private Google Access with VPC Service Controls]) may want to
18301/// override this default.
18302/// * [with_credentials()]: by default this client uses
18303/// [Application Default Credentials]. Applications using custom
18304/// authentication may need to override this default.
18305///
18306/// [with_endpoint()]: super::builder::storage_pool_types::ClientBuilder::with_endpoint
18307/// [with_credentials()]: super::builder::storage_pool_types::ClientBuilder::with_credentials
18308/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18309/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18310///
18311/// # Pooling and Cloning
18312///
18313/// `StoragePoolTypes` holds a connection pool internally, it is advised to
18314/// create one and reuse it. You do not need to wrap `StoragePoolTypes` in
18315/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18316/// already uses an `Arc` internally.
18317#[cfg(feature = "storage-pool-types")]
18318#[cfg_attr(docsrs, doc(cfg(feature = "storage-pool-types")))]
18319#[derive(Clone, Debug)]
18320pub struct StoragePoolTypes {
18321 inner: std::sync::Arc<dyn super::stub::dynamic::StoragePoolTypes>,
18322}
18323
18324#[cfg(feature = "storage-pool-types")]
18325impl StoragePoolTypes {
18326 /// Returns a builder for [StoragePoolTypes].
18327 ///
18328 /// ```
18329 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18330 /// # use google_cloud_compute_v1::client::StoragePoolTypes;
18331 /// let client = StoragePoolTypes::builder().build().await?;
18332 /// # Ok(()) }
18333 /// ```
18334 pub fn builder() -> super::builder::storage_pool_types::ClientBuilder {
18335 crate::new_client_builder(super::builder::storage_pool_types::client::Factory)
18336 }
18337
18338 /// Creates a new client from the provided stub.
18339 ///
18340 /// The most common case for calling this function is in tests mocking the
18341 /// client's behavior.
18342 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
18343 where
18344 T: super::stub::StoragePoolTypes + 'static,
18345 {
18346 Self { inner: stub.into() }
18347 }
18348
18349 pub(crate) async fn new(
18350 config: gaxi::options::ClientConfig,
18351 ) -> crate::ClientBuilderResult<Self> {
18352 let inner = Self::build_inner(config).await?;
18353 Ok(Self { inner })
18354 }
18355
18356 async fn build_inner(
18357 conf: gaxi::options::ClientConfig,
18358 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::StoragePoolTypes>>
18359 {
18360 if gaxi::options::tracing_enabled(&conf) {
18361 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18362 }
18363 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18364 }
18365
18366 async fn build_transport(
18367 conf: gaxi::options::ClientConfig,
18368 ) -> crate::ClientBuilderResult<impl super::stub::StoragePoolTypes> {
18369 super::transport::StoragePoolTypes::new(conf).await
18370 }
18371
18372 async fn build_with_tracing(
18373 conf: gaxi::options::ClientConfig,
18374 ) -> crate::ClientBuilderResult<impl super::stub::StoragePoolTypes> {
18375 Self::build_transport(conf)
18376 .await
18377 .map(super::tracing::StoragePoolTypes::new)
18378 }
18379
18380 /// Retrieves an aggregated list of storage pool types.
18381 ///
18382 /// To prevent failure, Google recommends that you set the
18383 /// `returnPartialSuccess` parameter to `true`.
18384 pub fn aggregated_list(&self) -> super::builder::storage_pool_types::AggregatedList {
18385 super::builder::storage_pool_types::AggregatedList::new(self.inner.clone())
18386 }
18387
18388 /// Returns the specified storage pool type.
18389 pub fn get(&self) -> super::builder::storage_pool_types::Get {
18390 super::builder::storage_pool_types::Get::new(self.inner.clone())
18391 }
18392
18393 /// Retrieves a list of storage pool types available to the specified
18394 /// project.
18395 pub fn list(&self) -> super::builder::storage_pool_types::List {
18396 super::builder::storage_pool_types::List::new(self.inner.clone())
18397 }
18398}
18399
18400/// Implements a client for the Compute Engine API.
18401///
18402/// # Example
18403/// ```
18404/// # use google_cloud_compute_v1::client::StoragePools;
18405/// async fn sample(
18406/// ) -> anyhow::Result<()> {
18407/// let client = StoragePools::builder().build().await?;
18408/// // use `client` to make requests to the Compute Engine API.
18409/// Ok(())
18410/// }
18411/// ```
18412///
18413/// # Service Description
18414///
18415/// Service for the `storagePools` resource.
18416///
18417/// # Configuration
18418///
18419/// To configure `StoragePools` use the `with_*` methods in the type returned
18420/// by [builder()][StoragePools::builder]. The default configuration should
18421/// work for most applications. Common configuration changes include
18422///
18423/// * [with_endpoint()]: by default this client uses the global default endpoint
18424/// (`https://compute.googleapis.com`). Applications using regional
18425/// endpoints or running in restricted networks (e.g. a network configured
18426/// with [Private Google Access with VPC Service Controls]) may want to
18427/// override this default.
18428/// * [with_credentials()]: by default this client uses
18429/// [Application Default Credentials]. Applications using custom
18430/// authentication may need to override this default.
18431///
18432/// [with_endpoint()]: super::builder::storage_pools::ClientBuilder::with_endpoint
18433/// [with_credentials()]: super::builder::storage_pools::ClientBuilder::with_credentials
18434/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18435/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18436///
18437/// # Pooling and Cloning
18438///
18439/// `StoragePools` holds a connection pool internally, it is advised to
18440/// create one and reuse it. You do not need to wrap `StoragePools` in
18441/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18442/// already uses an `Arc` internally.
18443#[cfg(feature = "storage-pools")]
18444#[cfg_attr(docsrs, doc(cfg(feature = "storage-pools")))]
18445#[derive(Clone, Debug)]
18446pub struct StoragePools {
18447 inner: std::sync::Arc<dyn super::stub::dynamic::StoragePools>,
18448}
18449
18450#[cfg(feature = "storage-pools")]
18451impl StoragePools {
18452 /// Returns a builder for [StoragePools].
18453 ///
18454 /// ```
18455 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18456 /// # use google_cloud_compute_v1::client::StoragePools;
18457 /// let client = StoragePools::builder().build().await?;
18458 /// # Ok(()) }
18459 /// ```
18460 pub fn builder() -> super::builder::storage_pools::ClientBuilder {
18461 crate::new_client_builder(super::builder::storage_pools::client::Factory)
18462 }
18463
18464 /// Creates a new client from the provided stub.
18465 ///
18466 /// The most common case for calling this function is in tests mocking the
18467 /// client's behavior.
18468 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
18469 where
18470 T: super::stub::StoragePools + 'static,
18471 {
18472 Self { inner: stub.into() }
18473 }
18474
18475 pub(crate) async fn new(
18476 config: gaxi::options::ClientConfig,
18477 ) -> crate::ClientBuilderResult<Self> {
18478 let inner = Self::build_inner(config).await?;
18479 Ok(Self { inner })
18480 }
18481
18482 async fn build_inner(
18483 conf: gaxi::options::ClientConfig,
18484 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::StoragePools>> {
18485 if gaxi::options::tracing_enabled(&conf) {
18486 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18487 }
18488 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18489 }
18490
18491 async fn build_transport(
18492 conf: gaxi::options::ClientConfig,
18493 ) -> crate::ClientBuilderResult<impl super::stub::StoragePools> {
18494 super::transport::StoragePools::new(conf).await
18495 }
18496
18497 async fn build_with_tracing(
18498 conf: gaxi::options::ClientConfig,
18499 ) -> crate::ClientBuilderResult<impl super::stub::StoragePools> {
18500 Self::build_transport(conf)
18501 .await
18502 .map(super::tracing::StoragePools::new)
18503 }
18504
18505 /// Retrieves an aggregated list of storage pools.
18506 ///
18507 /// To prevent failure, Google recommends that you set the
18508 /// `returnPartialSuccess` parameter to `true`.
18509 pub fn aggregated_list(&self) -> super::builder::storage_pools::AggregatedList {
18510 super::builder::storage_pools::AggregatedList::new(self.inner.clone())
18511 }
18512
18513 /// Deletes the specified storage pool. Deleting a storagePool
18514 /// removes its data permanently and is irreversible. However, deleting a
18515 /// storagePool does not delete any snapshots previously
18516 /// made from the storagePool. You must separately delete
18517 /// snapshots.
18518 pub fn delete(&self) -> super::builder::storage_pools::Delete {
18519 super::builder::storage_pools::Delete::new(self.inner.clone())
18520 }
18521
18522 /// Returns a specified storage pool. Gets a list of available
18523 /// storage pools by making a list() request.
18524 pub fn get(&self) -> super::builder::storage_pools::Get {
18525 super::builder::storage_pools::Get::new(self.inner.clone())
18526 }
18527
18528 /// Gets the access control policy for a resource. May be empty if no such
18529 /// policy or resource exists.
18530 pub fn get_iam_policy(&self) -> super::builder::storage_pools::GetIamPolicy {
18531 super::builder::storage_pools::GetIamPolicy::new(self.inner.clone())
18532 }
18533
18534 /// Creates a storage pool in the specified project using the data
18535 /// in the request.
18536 pub fn insert(&self) -> super::builder::storage_pools::Insert {
18537 super::builder::storage_pools::Insert::new(self.inner.clone())
18538 }
18539
18540 /// Retrieves a list of storage pools contained within
18541 /// the specified zone.
18542 pub fn list(&self) -> super::builder::storage_pools::List {
18543 super::builder::storage_pools::List::new(self.inner.clone())
18544 }
18545
18546 /// Lists the disks in a specified storage pool.
18547 pub fn list_disks(&self) -> super::builder::storage_pools::ListDisks {
18548 super::builder::storage_pools::ListDisks::new(self.inner.clone())
18549 }
18550
18551 /// Sets the access control policy on the specified resource.
18552 /// Replaces any existing policy.
18553 pub fn set_iam_policy(&self) -> super::builder::storage_pools::SetIamPolicy {
18554 super::builder::storage_pools::SetIamPolicy::new(self.inner.clone())
18555 }
18556
18557 /// Returns permissions that a caller has on the specified resource.
18558 pub fn test_iam_permissions(&self) -> super::builder::storage_pools::TestIamPermissions {
18559 super::builder::storage_pools::TestIamPermissions::new(self.inner.clone())
18560 }
18561
18562 /// Updates the specified storagePool with the data included in the request.
18563 /// The update is performed only on selected fields included as part
18564 /// of update-mask. Only the following fields can be modified:
18565 /// pool_provisioned_capacity_gb, pool_provisioned_iops and
18566 /// pool_provisioned_throughput.
18567 pub fn update(&self) -> super::builder::storage_pools::Update {
18568 super::builder::storage_pools::Update::new(self.inner.clone())
18569 }
18570
18571 /// Retrieves the specified zone-specific Operations resource.
18572 pub fn get_operation(&self) -> super::builder::storage_pools::GetOperation {
18573 super::builder::storage_pools::GetOperation::new(self.inner.clone())
18574 }
18575}
18576
18577/// Implements a client for the Compute Engine API.
18578///
18579/// # Example
18580/// ```
18581/// # use google_cloud_compute_v1::client::Subnetworks;
18582/// async fn sample(
18583/// ) -> anyhow::Result<()> {
18584/// let client = Subnetworks::builder().build().await?;
18585/// // use `client` to make requests to the Compute Engine API.
18586/// Ok(())
18587/// }
18588/// ```
18589///
18590/// # Service Description
18591///
18592/// Service for the `subnetworks` resource.
18593///
18594/// # Configuration
18595///
18596/// To configure `Subnetworks` use the `with_*` methods in the type returned
18597/// by [builder()][Subnetworks::builder]. The default configuration should
18598/// work for most applications. Common configuration changes include
18599///
18600/// * [with_endpoint()]: by default this client uses the global default endpoint
18601/// (`https://compute.googleapis.com`). Applications using regional
18602/// endpoints or running in restricted networks (e.g. a network configured
18603/// with [Private Google Access with VPC Service Controls]) may want to
18604/// override this default.
18605/// * [with_credentials()]: by default this client uses
18606/// [Application Default Credentials]. Applications using custom
18607/// authentication may need to override this default.
18608///
18609/// [with_endpoint()]: super::builder::subnetworks::ClientBuilder::with_endpoint
18610/// [with_credentials()]: super::builder::subnetworks::ClientBuilder::with_credentials
18611/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18612/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18613///
18614/// # Pooling and Cloning
18615///
18616/// `Subnetworks` holds a connection pool internally, it is advised to
18617/// create one and reuse it. You do not need to wrap `Subnetworks` in
18618/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18619/// already uses an `Arc` internally.
18620#[cfg(feature = "subnetworks")]
18621#[cfg_attr(docsrs, doc(cfg(feature = "subnetworks")))]
18622#[derive(Clone, Debug)]
18623pub struct Subnetworks {
18624 inner: std::sync::Arc<dyn super::stub::dynamic::Subnetworks>,
18625}
18626
18627#[cfg(feature = "subnetworks")]
18628impl Subnetworks {
18629 /// Returns a builder for [Subnetworks].
18630 ///
18631 /// ```
18632 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18633 /// # use google_cloud_compute_v1::client::Subnetworks;
18634 /// let client = Subnetworks::builder().build().await?;
18635 /// # Ok(()) }
18636 /// ```
18637 pub fn builder() -> super::builder::subnetworks::ClientBuilder {
18638 crate::new_client_builder(super::builder::subnetworks::client::Factory)
18639 }
18640
18641 /// Creates a new client from the provided stub.
18642 ///
18643 /// The most common case for calling this function is in tests mocking the
18644 /// client's behavior.
18645 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
18646 where
18647 T: super::stub::Subnetworks + 'static,
18648 {
18649 Self { inner: stub.into() }
18650 }
18651
18652 pub(crate) async fn new(
18653 config: gaxi::options::ClientConfig,
18654 ) -> crate::ClientBuilderResult<Self> {
18655 let inner = Self::build_inner(config).await?;
18656 Ok(Self { inner })
18657 }
18658
18659 async fn build_inner(
18660 conf: gaxi::options::ClientConfig,
18661 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Subnetworks>> {
18662 if gaxi::options::tracing_enabled(&conf) {
18663 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18664 }
18665 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18666 }
18667
18668 async fn build_transport(
18669 conf: gaxi::options::ClientConfig,
18670 ) -> crate::ClientBuilderResult<impl super::stub::Subnetworks> {
18671 super::transport::Subnetworks::new(conf).await
18672 }
18673
18674 async fn build_with_tracing(
18675 conf: gaxi::options::ClientConfig,
18676 ) -> crate::ClientBuilderResult<impl super::stub::Subnetworks> {
18677 Self::build_transport(conf)
18678 .await
18679 .map(super::tracing::Subnetworks::new)
18680 }
18681
18682 /// Retrieves an aggregated list of subnetworks.
18683 ///
18684 /// To prevent failure, Google recommends that you set the
18685 /// `returnPartialSuccess` parameter to `true`.
18686 pub fn aggregated_list(&self) -> super::builder::subnetworks::AggregatedList {
18687 super::builder::subnetworks::AggregatedList::new(self.inner.clone())
18688 }
18689
18690 /// Deletes the specified subnetwork.
18691 pub fn delete(&self) -> super::builder::subnetworks::Delete {
18692 super::builder::subnetworks::Delete::new(self.inner.clone())
18693 }
18694
18695 /// Expands the IP CIDR range of the subnetwork to a specified value.
18696 pub fn expand_ip_cidr_range(&self) -> super::builder::subnetworks::ExpandIpCidrRange {
18697 super::builder::subnetworks::ExpandIpCidrRange::new(self.inner.clone())
18698 }
18699
18700 /// Returns the specified subnetwork.
18701 pub fn get(&self) -> super::builder::subnetworks::Get {
18702 super::builder::subnetworks::Get::new(self.inner.clone())
18703 }
18704
18705 /// Gets the access control policy for a resource. May be empty if no such
18706 /// policy or resource exists.
18707 pub fn get_iam_policy(&self) -> super::builder::subnetworks::GetIamPolicy {
18708 super::builder::subnetworks::GetIamPolicy::new(self.inner.clone())
18709 }
18710
18711 /// Creates a subnetwork in the specified project using the data
18712 /// included in the request.
18713 pub fn insert(&self) -> super::builder::subnetworks::Insert {
18714 super::builder::subnetworks::Insert::new(self.inner.clone())
18715 }
18716
18717 /// Retrieves a list of subnetworks available to the specified
18718 /// project.
18719 pub fn list(&self) -> super::builder::subnetworks::List {
18720 super::builder::subnetworks::List::new(self.inner.clone())
18721 }
18722
18723 /// Retrieves an aggregated list of all usable subnetworks in the project.
18724 pub fn list_usable(&self) -> super::builder::subnetworks::ListUsable {
18725 super::builder::subnetworks::ListUsable::new(self.inner.clone())
18726 }
18727
18728 /// Patches the specified subnetwork with the data included in the request.
18729 /// Only certain fields can be updated with a patch request
18730 /// as indicated in the field descriptions.
18731 /// You must specify the current fingerprint of the
18732 /// subnetwork resource being patched.
18733 pub fn patch(&self) -> super::builder::subnetworks::Patch {
18734 super::builder::subnetworks::Patch::new(self.inner.clone())
18735 }
18736
18737 /// Sets the access control policy on the specified resource.
18738 /// Replaces any existing policy.
18739 pub fn set_iam_policy(&self) -> super::builder::subnetworks::SetIamPolicy {
18740 super::builder::subnetworks::SetIamPolicy::new(self.inner.clone())
18741 }
18742
18743 /// Set whether VMs in this subnet can access Google services without assigning
18744 /// external IP addresses through Private Google Access.
18745 pub fn set_private_ip_google_access(
18746 &self,
18747 ) -> super::builder::subnetworks::SetPrivateIpGoogleAccess {
18748 super::builder::subnetworks::SetPrivateIpGoogleAccess::new(self.inner.clone())
18749 }
18750
18751 /// Returns permissions that a caller has on the specified resource.
18752 pub fn test_iam_permissions(&self) -> super::builder::subnetworks::TestIamPermissions {
18753 super::builder::subnetworks::TestIamPermissions::new(self.inner.clone())
18754 }
18755
18756 /// Retrieves the specified region-specific Operations resource.
18757 pub fn get_operation(&self) -> super::builder::subnetworks::GetOperation {
18758 super::builder::subnetworks::GetOperation::new(self.inner.clone())
18759 }
18760}
18761
18762/// Implements a client for the Compute Engine API.
18763///
18764/// # Example
18765/// ```
18766/// # use google_cloud_compute_v1::client::TargetGrpcProxies;
18767/// async fn sample(
18768/// ) -> anyhow::Result<()> {
18769/// let client = TargetGrpcProxies::builder().build().await?;
18770/// // use `client` to make requests to the Compute Engine API.
18771/// Ok(())
18772/// }
18773/// ```
18774///
18775/// # Service Description
18776///
18777/// Service for the `targetGrpcProxies` resource.
18778///
18779/// # Configuration
18780///
18781/// To configure `TargetGrpcProxies` use the `with_*` methods in the type returned
18782/// by [builder()][TargetGrpcProxies::builder]. The default configuration should
18783/// work for most applications. Common configuration changes include
18784///
18785/// * [with_endpoint()]: by default this client uses the global default endpoint
18786/// (`https://compute.googleapis.com`). Applications using regional
18787/// endpoints or running in restricted networks (e.g. a network configured
18788/// with [Private Google Access with VPC Service Controls]) may want to
18789/// override this default.
18790/// * [with_credentials()]: by default this client uses
18791/// [Application Default Credentials]. Applications using custom
18792/// authentication may need to override this default.
18793///
18794/// [with_endpoint()]: super::builder::target_grpc_proxies::ClientBuilder::with_endpoint
18795/// [with_credentials()]: super::builder::target_grpc_proxies::ClientBuilder::with_credentials
18796/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18797/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18798///
18799/// # Pooling and Cloning
18800///
18801/// `TargetGrpcProxies` holds a connection pool internally, it is advised to
18802/// create one and reuse it. You do not need to wrap `TargetGrpcProxies` in
18803/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18804/// already uses an `Arc` internally.
18805#[cfg(feature = "target-grpc-proxies")]
18806#[cfg_attr(docsrs, doc(cfg(feature = "target-grpc-proxies")))]
18807#[derive(Clone, Debug)]
18808pub struct TargetGrpcProxies {
18809 inner: std::sync::Arc<dyn super::stub::dynamic::TargetGrpcProxies>,
18810}
18811
18812#[cfg(feature = "target-grpc-proxies")]
18813impl TargetGrpcProxies {
18814 /// Returns a builder for [TargetGrpcProxies].
18815 ///
18816 /// ```
18817 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18818 /// # use google_cloud_compute_v1::client::TargetGrpcProxies;
18819 /// let client = TargetGrpcProxies::builder().build().await?;
18820 /// # Ok(()) }
18821 /// ```
18822 pub fn builder() -> super::builder::target_grpc_proxies::ClientBuilder {
18823 crate::new_client_builder(super::builder::target_grpc_proxies::client::Factory)
18824 }
18825
18826 /// Creates a new client from the provided stub.
18827 ///
18828 /// The most common case for calling this function is in tests mocking the
18829 /// client's behavior.
18830 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
18831 where
18832 T: super::stub::TargetGrpcProxies + 'static,
18833 {
18834 Self { inner: stub.into() }
18835 }
18836
18837 pub(crate) async fn new(
18838 config: gaxi::options::ClientConfig,
18839 ) -> crate::ClientBuilderResult<Self> {
18840 let inner = Self::build_inner(config).await?;
18841 Ok(Self { inner })
18842 }
18843
18844 async fn build_inner(
18845 conf: gaxi::options::ClientConfig,
18846 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetGrpcProxies>>
18847 {
18848 if gaxi::options::tracing_enabled(&conf) {
18849 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18850 }
18851 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18852 }
18853
18854 async fn build_transport(
18855 conf: gaxi::options::ClientConfig,
18856 ) -> crate::ClientBuilderResult<impl super::stub::TargetGrpcProxies> {
18857 super::transport::TargetGrpcProxies::new(conf).await
18858 }
18859
18860 async fn build_with_tracing(
18861 conf: gaxi::options::ClientConfig,
18862 ) -> crate::ClientBuilderResult<impl super::stub::TargetGrpcProxies> {
18863 Self::build_transport(conf)
18864 .await
18865 .map(super::tracing::TargetGrpcProxies::new)
18866 }
18867
18868 /// Deletes the specified TargetGrpcProxy in the given scope
18869 pub fn delete(&self) -> super::builder::target_grpc_proxies::Delete {
18870 super::builder::target_grpc_proxies::Delete::new(self.inner.clone())
18871 }
18872
18873 /// Returns the specified TargetGrpcProxy resource in the given scope.
18874 pub fn get(&self) -> super::builder::target_grpc_proxies::Get {
18875 super::builder::target_grpc_proxies::Get::new(self.inner.clone())
18876 }
18877
18878 /// Creates a TargetGrpcProxy in the specified project in the given scope
18879 /// using the parameters that are included in the request.
18880 pub fn insert(&self) -> super::builder::target_grpc_proxies::Insert {
18881 super::builder::target_grpc_proxies::Insert::new(self.inner.clone())
18882 }
18883
18884 /// Lists the TargetGrpcProxies for a project in the given scope.
18885 pub fn list(&self) -> super::builder::target_grpc_proxies::List {
18886 super::builder::target_grpc_proxies::List::new(self.inner.clone())
18887 }
18888
18889 /// Patches the specified TargetGrpcProxy resource with the data included in
18890 /// the request. This method supports PATCH
18891 /// semantics and usesJSON merge
18892 /// patch format and processing rules.
18893 pub fn patch(&self) -> super::builder::target_grpc_proxies::Patch {
18894 super::builder::target_grpc_proxies::Patch::new(self.inner.clone())
18895 }
18896
18897 /// Retrieves the specified Operations resource.
18898 pub fn get_operation(&self) -> super::builder::target_grpc_proxies::GetOperation {
18899 super::builder::target_grpc_proxies::GetOperation::new(self.inner.clone())
18900 }
18901}
18902
18903/// Implements a client for the Compute Engine API.
18904///
18905/// # Example
18906/// ```
18907/// # use google_cloud_compute_v1::client::TargetHttpProxies;
18908/// async fn sample(
18909/// ) -> anyhow::Result<()> {
18910/// let client = TargetHttpProxies::builder().build().await?;
18911/// // use `client` to make requests to the Compute Engine API.
18912/// Ok(())
18913/// }
18914/// ```
18915///
18916/// # Service Description
18917///
18918/// Service for the `targetHttpProxies` resource.
18919///
18920/// # Configuration
18921///
18922/// To configure `TargetHttpProxies` use the `with_*` methods in the type returned
18923/// by [builder()][TargetHttpProxies::builder]. The default configuration should
18924/// work for most applications. Common configuration changes include
18925///
18926/// * [with_endpoint()]: by default this client uses the global default endpoint
18927/// (`https://compute.googleapis.com`). Applications using regional
18928/// endpoints or running in restricted networks (e.g. a network configured
18929/// with [Private Google Access with VPC Service Controls]) may want to
18930/// override this default.
18931/// * [with_credentials()]: by default this client uses
18932/// [Application Default Credentials]. Applications using custom
18933/// authentication may need to override this default.
18934///
18935/// [with_endpoint()]: super::builder::target_http_proxies::ClientBuilder::with_endpoint
18936/// [with_credentials()]: super::builder::target_http_proxies::ClientBuilder::with_credentials
18937/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18938/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18939///
18940/// # Pooling and Cloning
18941///
18942/// `TargetHttpProxies` holds a connection pool internally, it is advised to
18943/// create one and reuse it. You do not need to wrap `TargetHttpProxies` in
18944/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18945/// already uses an `Arc` internally.
18946#[cfg(feature = "target-http-proxies")]
18947#[cfg_attr(docsrs, doc(cfg(feature = "target-http-proxies")))]
18948#[derive(Clone, Debug)]
18949pub struct TargetHttpProxies {
18950 inner: std::sync::Arc<dyn super::stub::dynamic::TargetHttpProxies>,
18951}
18952
18953#[cfg(feature = "target-http-proxies")]
18954impl TargetHttpProxies {
18955 /// Returns a builder for [TargetHttpProxies].
18956 ///
18957 /// ```
18958 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18959 /// # use google_cloud_compute_v1::client::TargetHttpProxies;
18960 /// let client = TargetHttpProxies::builder().build().await?;
18961 /// # Ok(()) }
18962 /// ```
18963 pub fn builder() -> super::builder::target_http_proxies::ClientBuilder {
18964 crate::new_client_builder(super::builder::target_http_proxies::client::Factory)
18965 }
18966
18967 /// Creates a new client from the provided stub.
18968 ///
18969 /// The most common case for calling this function is in tests mocking the
18970 /// client's behavior.
18971 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
18972 where
18973 T: super::stub::TargetHttpProxies + 'static,
18974 {
18975 Self { inner: stub.into() }
18976 }
18977
18978 pub(crate) async fn new(
18979 config: gaxi::options::ClientConfig,
18980 ) -> crate::ClientBuilderResult<Self> {
18981 let inner = Self::build_inner(config).await?;
18982 Ok(Self { inner })
18983 }
18984
18985 async fn build_inner(
18986 conf: gaxi::options::ClientConfig,
18987 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetHttpProxies>>
18988 {
18989 if gaxi::options::tracing_enabled(&conf) {
18990 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18991 }
18992 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18993 }
18994
18995 async fn build_transport(
18996 conf: gaxi::options::ClientConfig,
18997 ) -> crate::ClientBuilderResult<impl super::stub::TargetHttpProxies> {
18998 super::transport::TargetHttpProxies::new(conf).await
18999 }
19000
19001 async fn build_with_tracing(
19002 conf: gaxi::options::ClientConfig,
19003 ) -> crate::ClientBuilderResult<impl super::stub::TargetHttpProxies> {
19004 Self::build_transport(conf)
19005 .await
19006 .map(super::tracing::TargetHttpProxies::new)
19007 }
19008
19009 /// Retrieves the list of all TargetHttpProxy resources, regional and global,
19010 /// available to the specified project.
19011 ///
19012 /// To prevent failure, Google recommends that you set the
19013 /// `returnPartialSuccess` parameter to `true`.
19014 pub fn aggregated_list(&self) -> super::builder::target_http_proxies::AggregatedList {
19015 super::builder::target_http_proxies::AggregatedList::new(self.inner.clone())
19016 }
19017
19018 /// Deletes the specified TargetHttpProxy resource.
19019 pub fn delete(&self) -> super::builder::target_http_proxies::Delete {
19020 super::builder::target_http_proxies::Delete::new(self.inner.clone())
19021 }
19022
19023 /// Returns the specified TargetHttpProxy resource.
19024 pub fn get(&self) -> super::builder::target_http_proxies::Get {
19025 super::builder::target_http_proxies::Get::new(self.inner.clone())
19026 }
19027
19028 /// Creates a TargetHttpProxy resource in the specified
19029 /// project using the data included in the request.
19030 pub fn insert(&self) -> super::builder::target_http_proxies::Insert {
19031 super::builder::target_http_proxies::Insert::new(self.inner.clone())
19032 }
19033
19034 /// Retrieves the list of TargetHttpProxy resources available
19035 /// to the specified project.
19036 pub fn list(&self) -> super::builder::target_http_proxies::List {
19037 super::builder::target_http_proxies::List::new(self.inner.clone())
19038 }
19039
19040 /// Patches the specified TargetHttpProxy resource with the data included in
19041 /// the request. This method supports PATCH
19042 /// semantics and usesJSON merge
19043 /// patch format and processing rules.
19044 pub fn patch(&self) -> super::builder::target_http_proxies::Patch {
19045 super::builder::target_http_proxies::Patch::new(self.inner.clone())
19046 }
19047
19048 /// Changes the URL map for TargetHttpProxy.
19049 pub fn set_url_map(&self) -> super::builder::target_http_proxies::SetUrlMap {
19050 super::builder::target_http_proxies::SetUrlMap::new(self.inner.clone())
19051 }
19052
19053 /// Retrieves the specified Operations resource.
19054 pub fn get_operation(&self) -> super::builder::target_http_proxies::GetOperation {
19055 super::builder::target_http_proxies::GetOperation::new(self.inner.clone())
19056 }
19057}
19058
19059/// Implements a client for the Compute Engine API.
19060///
19061/// # Example
19062/// ```
19063/// # use google_cloud_compute_v1::client::TargetHttpsProxies;
19064/// async fn sample(
19065/// ) -> anyhow::Result<()> {
19066/// let client = TargetHttpsProxies::builder().build().await?;
19067/// // use `client` to make requests to the Compute Engine API.
19068/// Ok(())
19069/// }
19070/// ```
19071///
19072/// # Service Description
19073///
19074/// Service for the `targetHttpsProxies` resource.
19075///
19076/// # Configuration
19077///
19078/// To configure `TargetHttpsProxies` use the `with_*` methods in the type returned
19079/// by [builder()][TargetHttpsProxies::builder]. The default configuration should
19080/// work for most applications. Common configuration changes include
19081///
19082/// * [with_endpoint()]: by default this client uses the global default endpoint
19083/// (`https://compute.googleapis.com`). Applications using regional
19084/// endpoints or running in restricted networks (e.g. a network configured
19085/// with [Private Google Access with VPC Service Controls]) may want to
19086/// override this default.
19087/// * [with_credentials()]: by default this client uses
19088/// [Application Default Credentials]. Applications using custom
19089/// authentication may need to override this default.
19090///
19091/// [with_endpoint()]: super::builder::target_https_proxies::ClientBuilder::with_endpoint
19092/// [with_credentials()]: super::builder::target_https_proxies::ClientBuilder::with_credentials
19093/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
19094/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
19095///
19096/// # Pooling and Cloning
19097///
19098/// `TargetHttpsProxies` holds a connection pool internally, it is advised to
19099/// create one and reuse it. You do not need to wrap `TargetHttpsProxies` in
19100/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
19101/// already uses an `Arc` internally.
19102#[cfg(feature = "target-https-proxies")]
19103#[cfg_attr(docsrs, doc(cfg(feature = "target-https-proxies")))]
19104#[derive(Clone, Debug)]
19105pub struct TargetHttpsProxies {
19106 inner: std::sync::Arc<dyn super::stub::dynamic::TargetHttpsProxies>,
19107}
19108
19109#[cfg(feature = "target-https-proxies")]
19110impl TargetHttpsProxies {
19111 /// Returns a builder for [TargetHttpsProxies].
19112 ///
19113 /// ```
19114 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19115 /// # use google_cloud_compute_v1::client::TargetHttpsProxies;
19116 /// let client = TargetHttpsProxies::builder().build().await?;
19117 /// # Ok(()) }
19118 /// ```
19119 pub fn builder() -> super::builder::target_https_proxies::ClientBuilder {
19120 crate::new_client_builder(super::builder::target_https_proxies::client::Factory)
19121 }
19122
19123 /// Creates a new client from the provided stub.
19124 ///
19125 /// The most common case for calling this function is in tests mocking the
19126 /// client's behavior.
19127 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
19128 where
19129 T: super::stub::TargetHttpsProxies + 'static,
19130 {
19131 Self { inner: stub.into() }
19132 }
19133
19134 pub(crate) async fn new(
19135 config: gaxi::options::ClientConfig,
19136 ) -> crate::ClientBuilderResult<Self> {
19137 let inner = Self::build_inner(config).await?;
19138 Ok(Self { inner })
19139 }
19140
19141 async fn build_inner(
19142 conf: gaxi::options::ClientConfig,
19143 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetHttpsProxies>>
19144 {
19145 if gaxi::options::tracing_enabled(&conf) {
19146 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
19147 }
19148 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
19149 }
19150
19151 async fn build_transport(
19152 conf: gaxi::options::ClientConfig,
19153 ) -> crate::ClientBuilderResult<impl super::stub::TargetHttpsProxies> {
19154 super::transport::TargetHttpsProxies::new(conf).await
19155 }
19156
19157 async fn build_with_tracing(
19158 conf: gaxi::options::ClientConfig,
19159 ) -> crate::ClientBuilderResult<impl super::stub::TargetHttpsProxies> {
19160 Self::build_transport(conf)
19161 .await
19162 .map(super::tracing::TargetHttpsProxies::new)
19163 }
19164
19165 /// Retrieves the list of all TargetHttpsProxy resources, regional and global,
19166 /// available to the specified project.
19167 ///
19168 /// To prevent failure, Google recommends that you set the
19169 /// `returnPartialSuccess` parameter to `true`.
19170 pub fn aggregated_list(&self) -> super::builder::target_https_proxies::AggregatedList {
19171 super::builder::target_https_proxies::AggregatedList::new(self.inner.clone())
19172 }
19173
19174 /// Deletes the specified TargetHttpsProxy resource.
19175 pub fn delete(&self) -> super::builder::target_https_proxies::Delete {
19176 super::builder::target_https_proxies::Delete::new(self.inner.clone())
19177 }
19178
19179 /// Returns the specified TargetHttpsProxy resource.
19180 pub fn get(&self) -> super::builder::target_https_proxies::Get {
19181 super::builder::target_https_proxies::Get::new(self.inner.clone())
19182 }
19183
19184 /// Creates a TargetHttpsProxy resource in the specified
19185 /// project using the data included in the request.
19186 pub fn insert(&self) -> super::builder::target_https_proxies::Insert {
19187 super::builder::target_https_proxies::Insert::new(self.inner.clone())
19188 }
19189
19190 /// Retrieves the list of TargetHttpsProxy resources
19191 /// available to the specified project.
19192 pub fn list(&self) -> super::builder::target_https_proxies::List {
19193 super::builder::target_https_proxies::List::new(self.inner.clone())
19194 }
19195
19196 /// Patches the specified TargetHttpsProxy resource with the data included in
19197 /// the request. This method supports PATCH
19198 /// semantics and usesJSON merge
19199 /// patch format and processing rules.
19200 pub fn patch(&self) -> super::builder::target_https_proxies::Patch {
19201 super::builder::target_https_proxies::Patch::new(self.inner.clone())
19202 }
19203
19204 /// Changes the Certificate Map for TargetHttpsProxy.
19205 pub fn set_certificate_map(&self) -> super::builder::target_https_proxies::SetCertificateMap {
19206 super::builder::target_https_proxies::SetCertificateMap::new(self.inner.clone())
19207 }
19208
19209 /// Sets the QUIC override policy for TargetHttpsProxy.
19210 pub fn set_quic_override(&self) -> super::builder::target_https_proxies::SetQuicOverride {
19211 super::builder::target_https_proxies::SetQuicOverride::new(self.inner.clone())
19212 }
19213
19214 /// Replaces SslCertificates for TargetHttpsProxy.
19215 pub fn set_ssl_certificates(&self) -> super::builder::target_https_proxies::SetSslCertificates {
19216 super::builder::target_https_proxies::SetSslCertificates::new(self.inner.clone())
19217 }
19218
19219 /// Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies the
19220 /// server-side support for SSL features. This affects connections between
19221 /// clients and the HTTPS proxy load balancer. They do not affect the
19222 /// connection between the load balancer and the backends.
19223 pub fn set_ssl_policy(&self) -> super::builder::target_https_proxies::SetSslPolicy {
19224 super::builder::target_https_proxies::SetSslPolicy::new(self.inner.clone())
19225 }
19226
19227 /// Changes the URL map for TargetHttpsProxy.
19228 pub fn set_url_map(&self) -> super::builder::target_https_proxies::SetUrlMap {
19229 super::builder::target_https_proxies::SetUrlMap::new(self.inner.clone())
19230 }
19231
19232 /// Retrieves the specified Operations resource.
19233 pub fn get_operation(&self) -> super::builder::target_https_proxies::GetOperation {
19234 super::builder::target_https_proxies::GetOperation::new(self.inner.clone())
19235 }
19236}
19237
19238/// Implements a client for the Compute Engine API.
19239///
19240/// # Example
19241/// ```
19242/// # use google_cloud_compute_v1::client::TargetInstances;
19243/// async fn sample(
19244/// ) -> anyhow::Result<()> {
19245/// let client = TargetInstances::builder().build().await?;
19246/// // use `client` to make requests to the Compute Engine API.
19247/// Ok(())
19248/// }
19249/// ```
19250///
19251/// # Service Description
19252///
19253/// Service for the `targetInstances` resource.
19254///
19255/// # Configuration
19256///
19257/// To configure `TargetInstances` use the `with_*` methods in the type returned
19258/// by [builder()][TargetInstances::builder]. The default configuration should
19259/// work for most applications. Common configuration changes include
19260///
19261/// * [with_endpoint()]: by default this client uses the global default endpoint
19262/// (`https://compute.googleapis.com`). Applications using regional
19263/// endpoints or running in restricted networks (e.g. a network configured
19264/// with [Private Google Access with VPC Service Controls]) may want to
19265/// override this default.
19266/// * [with_credentials()]: by default this client uses
19267/// [Application Default Credentials]. Applications using custom
19268/// authentication may need to override this default.
19269///
19270/// [with_endpoint()]: super::builder::target_instances::ClientBuilder::with_endpoint
19271/// [with_credentials()]: super::builder::target_instances::ClientBuilder::with_credentials
19272/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
19273/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
19274///
19275/// # Pooling and Cloning
19276///
19277/// `TargetInstances` holds a connection pool internally, it is advised to
19278/// create one and reuse it. You do not need to wrap `TargetInstances` in
19279/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
19280/// already uses an `Arc` internally.
19281#[cfg(feature = "target-instances")]
19282#[cfg_attr(docsrs, doc(cfg(feature = "target-instances")))]
19283#[derive(Clone, Debug)]
19284pub struct TargetInstances {
19285 inner: std::sync::Arc<dyn super::stub::dynamic::TargetInstances>,
19286}
19287
19288#[cfg(feature = "target-instances")]
19289impl TargetInstances {
19290 /// Returns a builder for [TargetInstances].
19291 ///
19292 /// ```
19293 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19294 /// # use google_cloud_compute_v1::client::TargetInstances;
19295 /// let client = TargetInstances::builder().build().await?;
19296 /// # Ok(()) }
19297 /// ```
19298 pub fn builder() -> super::builder::target_instances::ClientBuilder {
19299 crate::new_client_builder(super::builder::target_instances::client::Factory)
19300 }
19301
19302 /// Creates a new client from the provided stub.
19303 ///
19304 /// The most common case for calling this function is in tests mocking the
19305 /// client's behavior.
19306 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
19307 where
19308 T: super::stub::TargetInstances + 'static,
19309 {
19310 Self { inner: stub.into() }
19311 }
19312
19313 pub(crate) async fn new(
19314 config: gaxi::options::ClientConfig,
19315 ) -> crate::ClientBuilderResult<Self> {
19316 let inner = Self::build_inner(config).await?;
19317 Ok(Self { inner })
19318 }
19319
19320 async fn build_inner(
19321 conf: gaxi::options::ClientConfig,
19322 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetInstances>> {
19323 if gaxi::options::tracing_enabled(&conf) {
19324 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
19325 }
19326 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
19327 }
19328
19329 async fn build_transport(
19330 conf: gaxi::options::ClientConfig,
19331 ) -> crate::ClientBuilderResult<impl super::stub::TargetInstances> {
19332 super::transport::TargetInstances::new(conf).await
19333 }
19334
19335 async fn build_with_tracing(
19336 conf: gaxi::options::ClientConfig,
19337 ) -> crate::ClientBuilderResult<impl super::stub::TargetInstances> {
19338 Self::build_transport(conf)
19339 .await
19340 .map(super::tracing::TargetInstances::new)
19341 }
19342
19343 /// Retrieves an aggregated list of target instances.
19344 ///
19345 /// To prevent failure, Google recommends that you set the
19346 /// `returnPartialSuccess` parameter to `true`.
19347 pub fn aggregated_list(&self) -> super::builder::target_instances::AggregatedList {
19348 super::builder::target_instances::AggregatedList::new(self.inner.clone())
19349 }
19350
19351 /// Deletes the specified TargetInstance resource.
19352 pub fn delete(&self) -> super::builder::target_instances::Delete {
19353 super::builder::target_instances::Delete::new(self.inner.clone())
19354 }
19355
19356 /// Returns the specified TargetInstance resource.
19357 pub fn get(&self) -> super::builder::target_instances::Get {
19358 super::builder::target_instances::Get::new(self.inner.clone())
19359 }
19360
19361 /// Creates a TargetInstance resource in the specified project and zone using
19362 /// the data included in the request.
19363 pub fn insert(&self) -> super::builder::target_instances::Insert {
19364 super::builder::target_instances::Insert::new(self.inner.clone())
19365 }
19366
19367 /// Retrieves a list of TargetInstance resources available to the specified
19368 /// project and zone.
19369 pub fn list(&self) -> super::builder::target_instances::List {
19370 super::builder::target_instances::List::new(self.inner.clone())
19371 }
19372
19373 /// Sets the Google Cloud Armor security policy for the specified target
19374 /// instance. For more information, seeGoogle
19375 /// Cloud Armor Overview
19376 pub fn set_security_policy(&self) -> super::builder::target_instances::SetSecurityPolicy {
19377 super::builder::target_instances::SetSecurityPolicy::new(self.inner.clone())
19378 }
19379
19380 /// Returns permissions that a caller has on the specified resource.
19381 pub fn test_iam_permissions(&self) -> super::builder::target_instances::TestIamPermissions {
19382 super::builder::target_instances::TestIamPermissions::new(self.inner.clone())
19383 }
19384
19385 /// Retrieves the specified zone-specific Operations resource.
19386 pub fn get_operation(&self) -> super::builder::target_instances::GetOperation {
19387 super::builder::target_instances::GetOperation::new(self.inner.clone())
19388 }
19389}
19390
19391/// Implements a client for the Compute Engine API.
19392///
19393/// # Example
19394/// ```
19395/// # use google_cloud_compute_v1::client::TargetPools;
19396/// async fn sample(
19397/// ) -> anyhow::Result<()> {
19398/// let client = TargetPools::builder().build().await?;
19399/// // use `client` to make requests to the Compute Engine API.
19400/// Ok(())
19401/// }
19402/// ```
19403///
19404/// # Service Description
19405///
19406/// Service for the `targetPools` resource.
19407///
19408/// # Configuration
19409///
19410/// To configure `TargetPools` use the `with_*` methods in the type returned
19411/// by [builder()][TargetPools::builder]. The default configuration should
19412/// work for most applications. Common configuration changes include
19413///
19414/// * [with_endpoint()]: by default this client uses the global default endpoint
19415/// (`https://compute.googleapis.com`). Applications using regional
19416/// endpoints or running in restricted networks (e.g. a network configured
19417/// with [Private Google Access with VPC Service Controls]) may want to
19418/// override this default.
19419/// * [with_credentials()]: by default this client uses
19420/// [Application Default Credentials]. Applications using custom
19421/// authentication may need to override this default.
19422///
19423/// [with_endpoint()]: super::builder::target_pools::ClientBuilder::with_endpoint
19424/// [with_credentials()]: super::builder::target_pools::ClientBuilder::with_credentials
19425/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
19426/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
19427///
19428/// # Pooling and Cloning
19429///
19430/// `TargetPools` holds a connection pool internally, it is advised to
19431/// create one and reuse it. You do not need to wrap `TargetPools` in
19432/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
19433/// already uses an `Arc` internally.
19434#[cfg(feature = "target-pools")]
19435#[cfg_attr(docsrs, doc(cfg(feature = "target-pools")))]
19436#[derive(Clone, Debug)]
19437pub struct TargetPools {
19438 inner: std::sync::Arc<dyn super::stub::dynamic::TargetPools>,
19439}
19440
19441#[cfg(feature = "target-pools")]
19442impl TargetPools {
19443 /// Returns a builder for [TargetPools].
19444 ///
19445 /// ```
19446 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19447 /// # use google_cloud_compute_v1::client::TargetPools;
19448 /// let client = TargetPools::builder().build().await?;
19449 /// # Ok(()) }
19450 /// ```
19451 pub fn builder() -> super::builder::target_pools::ClientBuilder {
19452 crate::new_client_builder(super::builder::target_pools::client::Factory)
19453 }
19454
19455 /// Creates a new client from the provided stub.
19456 ///
19457 /// The most common case for calling this function is in tests mocking the
19458 /// client's behavior.
19459 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
19460 where
19461 T: super::stub::TargetPools + 'static,
19462 {
19463 Self { inner: stub.into() }
19464 }
19465
19466 pub(crate) async fn new(
19467 config: gaxi::options::ClientConfig,
19468 ) -> crate::ClientBuilderResult<Self> {
19469 let inner = Self::build_inner(config).await?;
19470 Ok(Self { inner })
19471 }
19472
19473 async fn build_inner(
19474 conf: gaxi::options::ClientConfig,
19475 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetPools>> {
19476 if gaxi::options::tracing_enabled(&conf) {
19477 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
19478 }
19479 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
19480 }
19481
19482 async fn build_transport(
19483 conf: gaxi::options::ClientConfig,
19484 ) -> crate::ClientBuilderResult<impl super::stub::TargetPools> {
19485 super::transport::TargetPools::new(conf).await
19486 }
19487
19488 async fn build_with_tracing(
19489 conf: gaxi::options::ClientConfig,
19490 ) -> crate::ClientBuilderResult<impl super::stub::TargetPools> {
19491 Self::build_transport(conf)
19492 .await
19493 .map(super::tracing::TargetPools::new)
19494 }
19495
19496 /// Adds health check URLs to a target pool.
19497 pub fn add_health_check(&self) -> super::builder::target_pools::AddHealthCheck {
19498 super::builder::target_pools::AddHealthCheck::new(self.inner.clone())
19499 }
19500
19501 /// Adds an instance to a target pool.
19502 pub fn add_instance(&self) -> super::builder::target_pools::AddInstance {
19503 super::builder::target_pools::AddInstance::new(self.inner.clone())
19504 }
19505
19506 /// Retrieves an aggregated list of target pools.
19507 ///
19508 /// To prevent failure, Google recommends that you set the
19509 /// `returnPartialSuccess` parameter to `true`.
19510 pub fn aggregated_list(&self) -> super::builder::target_pools::AggregatedList {
19511 super::builder::target_pools::AggregatedList::new(self.inner.clone())
19512 }
19513
19514 /// Deletes the specified target pool.
19515 pub fn delete(&self) -> super::builder::target_pools::Delete {
19516 super::builder::target_pools::Delete::new(self.inner.clone())
19517 }
19518
19519 /// Returns the specified target pool.
19520 pub fn get(&self) -> super::builder::target_pools::Get {
19521 super::builder::target_pools::Get::new(self.inner.clone())
19522 }
19523
19524 /// Gets the most recent health check results for each IP for the
19525 /// instance that is referenced by the given target pool.
19526 pub fn get_health(&self) -> super::builder::target_pools::GetHealth {
19527 super::builder::target_pools::GetHealth::new(self.inner.clone())
19528 }
19529
19530 /// Creates a target pool in the specified project and region using
19531 /// the data included in the request.
19532 pub fn insert(&self) -> super::builder::target_pools::Insert {
19533 super::builder::target_pools::Insert::new(self.inner.clone())
19534 }
19535
19536 /// Retrieves a list of target pools available to the specified
19537 /// project and region.
19538 pub fn list(&self) -> super::builder::target_pools::List {
19539 super::builder::target_pools::List::new(self.inner.clone())
19540 }
19541
19542 /// Removes health check URL from a target pool.
19543 pub fn remove_health_check(&self) -> super::builder::target_pools::RemoveHealthCheck {
19544 super::builder::target_pools::RemoveHealthCheck::new(self.inner.clone())
19545 }
19546
19547 /// Removes instance URL from a target pool.
19548 pub fn remove_instance(&self) -> super::builder::target_pools::RemoveInstance {
19549 super::builder::target_pools::RemoveInstance::new(self.inner.clone())
19550 }
19551
19552 /// Changes a backup target pool's configurations.
19553 pub fn set_backup(&self) -> super::builder::target_pools::SetBackup {
19554 super::builder::target_pools::SetBackup::new(self.inner.clone())
19555 }
19556
19557 /// Sets the Google Cloud Armor security policy for the specified target pool.
19558 /// For more information, seeGoogle
19559 /// Cloud Armor Overview
19560 pub fn set_security_policy(&self) -> super::builder::target_pools::SetSecurityPolicy {
19561 super::builder::target_pools::SetSecurityPolicy::new(self.inner.clone())
19562 }
19563
19564 /// Returns permissions that a caller has on the specified resource.
19565 pub fn test_iam_permissions(&self) -> super::builder::target_pools::TestIamPermissions {
19566 super::builder::target_pools::TestIamPermissions::new(self.inner.clone())
19567 }
19568
19569 /// Retrieves the specified region-specific Operations resource.
19570 pub fn get_operation(&self) -> super::builder::target_pools::GetOperation {
19571 super::builder::target_pools::GetOperation::new(self.inner.clone())
19572 }
19573}
19574
19575/// Implements a client for the Compute Engine API.
19576///
19577/// # Example
19578/// ```
19579/// # use google_cloud_compute_v1::client::TargetSslProxies;
19580/// async fn sample(
19581/// ) -> anyhow::Result<()> {
19582/// let client = TargetSslProxies::builder().build().await?;
19583/// // use `client` to make requests to the Compute Engine API.
19584/// Ok(())
19585/// }
19586/// ```
19587///
19588/// # Service Description
19589///
19590/// Service for the `targetSslProxies` resource.
19591///
19592/// # Configuration
19593///
19594/// To configure `TargetSslProxies` use the `with_*` methods in the type returned
19595/// by [builder()][TargetSslProxies::builder]. The default configuration should
19596/// work for most applications. Common configuration changes include
19597///
19598/// * [with_endpoint()]: by default this client uses the global default endpoint
19599/// (`https://compute.googleapis.com`). Applications using regional
19600/// endpoints or running in restricted networks (e.g. a network configured
19601/// with [Private Google Access with VPC Service Controls]) may want to
19602/// override this default.
19603/// * [with_credentials()]: by default this client uses
19604/// [Application Default Credentials]. Applications using custom
19605/// authentication may need to override this default.
19606///
19607/// [with_endpoint()]: super::builder::target_ssl_proxies::ClientBuilder::with_endpoint
19608/// [with_credentials()]: super::builder::target_ssl_proxies::ClientBuilder::with_credentials
19609/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
19610/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
19611///
19612/// # Pooling and Cloning
19613///
19614/// `TargetSslProxies` holds a connection pool internally, it is advised to
19615/// create one and reuse it. You do not need to wrap `TargetSslProxies` in
19616/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
19617/// already uses an `Arc` internally.
19618#[cfg(feature = "target-ssl-proxies")]
19619#[cfg_attr(docsrs, doc(cfg(feature = "target-ssl-proxies")))]
19620#[derive(Clone, Debug)]
19621pub struct TargetSslProxies {
19622 inner: std::sync::Arc<dyn super::stub::dynamic::TargetSslProxies>,
19623}
19624
19625#[cfg(feature = "target-ssl-proxies")]
19626impl TargetSslProxies {
19627 /// Returns a builder for [TargetSslProxies].
19628 ///
19629 /// ```
19630 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19631 /// # use google_cloud_compute_v1::client::TargetSslProxies;
19632 /// let client = TargetSslProxies::builder().build().await?;
19633 /// # Ok(()) }
19634 /// ```
19635 pub fn builder() -> super::builder::target_ssl_proxies::ClientBuilder {
19636 crate::new_client_builder(super::builder::target_ssl_proxies::client::Factory)
19637 }
19638
19639 /// Creates a new client from the provided stub.
19640 ///
19641 /// The most common case for calling this function is in tests mocking the
19642 /// client's behavior.
19643 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
19644 where
19645 T: super::stub::TargetSslProxies + 'static,
19646 {
19647 Self { inner: stub.into() }
19648 }
19649
19650 pub(crate) async fn new(
19651 config: gaxi::options::ClientConfig,
19652 ) -> crate::ClientBuilderResult<Self> {
19653 let inner = Self::build_inner(config).await?;
19654 Ok(Self { inner })
19655 }
19656
19657 async fn build_inner(
19658 conf: gaxi::options::ClientConfig,
19659 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetSslProxies>>
19660 {
19661 if gaxi::options::tracing_enabled(&conf) {
19662 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
19663 }
19664 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
19665 }
19666
19667 async fn build_transport(
19668 conf: gaxi::options::ClientConfig,
19669 ) -> crate::ClientBuilderResult<impl super::stub::TargetSslProxies> {
19670 super::transport::TargetSslProxies::new(conf).await
19671 }
19672
19673 async fn build_with_tracing(
19674 conf: gaxi::options::ClientConfig,
19675 ) -> crate::ClientBuilderResult<impl super::stub::TargetSslProxies> {
19676 Self::build_transport(conf)
19677 .await
19678 .map(super::tracing::TargetSslProxies::new)
19679 }
19680
19681 /// Deletes the specified TargetSslProxy resource.
19682 pub fn delete(&self) -> super::builder::target_ssl_proxies::Delete {
19683 super::builder::target_ssl_proxies::Delete::new(self.inner.clone())
19684 }
19685
19686 /// Returns the specified TargetSslProxy resource.
19687 pub fn get(&self) -> super::builder::target_ssl_proxies::Get {
19688 super::builder::target_ssl_proxies::Get::new(self.inner.clone())
19689 }
19690
19691 /// Creates a TargetSslProxy resource in the specified project using
19692 /// the data included in the request.
19693 pub fn insert(&self) -> super::builder::target_ssl_proxies::Insert {
19694 super::builder::target_ssl_proxies::Insert::new(self.inner.clone())
19695 }
19696
19697 /// Retrieves the list of TargetSslProxy resources
19698 /// available to the specified project.
19699 pub fn list(&self) -> super::builder::target_ssl_proxies::List {
19700 super::builder::target_ssl_proxies::List::new(self.inner.clone())
19701 }
19702
19703 /// Changes the BackendService for TargetSslProxy.
19704 pub fn set_backend_service(&self) -> super::builder::target_ssl_proxies::SetBackendService {
19705 super::builder::target_ssl_proxies::SetBackendService::new(self.inner.clone())
19706 }
19707
19708 /// Changes the Certificate Map for TargetSslProxy.
19709 pub fn set_certificate_map(&self) -> super::builder::target_ssl_proxies::SetCertificateMap {
19710 super::builder::target_ssl_proxies::SetCertificateMap::new(self.inner.clone())
19711 }
19712
19713 /// Changes the ProxyHeaderType for TargetSslProxy.
19714 pub fn set_proxy_header(&self) -> super::builder::target_ssl_proxies::SetProxyHeader {
19715 super::builder::target_ssl_proxies::SetProxyHeader::new(self.inner.clone())
19716 }
19717
19718 /// Changes SslCertificates for TargetSslProxy.
19719 pub fn set_ssl_certificates(&self) -> super::builder::target_ssl_proxies::SetSslCertificates {
19720 super::builder::target_ssl_proxies::SetSslCertificates::new(self.inner.clone())
19721 }
19722
19723 /// Sets the SSL policy for TargetSslProxy. The SSL policy specifies the
19724 /// server-side support for SSL features. This affects connections between
19725 /// clients and the load balancer. They do not affect the
19726 /// connection between the load balancer and the backends.
19727 pub fn set_ssl_policy(&self) -> super::builder::target_ssl_proxies::SetSslPolicy {
19728 super::builder::target_ssl_proxies::SetSslPolicy::new(self.inner.clone())
19729 }
19730
19731 /// Returns permissions that a caller has on the specified resource.
19732 pub fn test_iam_permissions(&self) -> super::builder::target_ssl_proxies::TestIamPermissions {
19733 super::builder::target_ssl_proxies::TestIamPermissions::new(self.inner.clone())
19734 }
19735
19736 /// Retrieves the specified Operations resource.
19737 pub fn get_operation(&self) -> super::builder::target_ssl_proxies::GetOperation {
19738 super::builder::target_ssl_proxies::GetOperation::new(self.inner.clone())
19739 }
19740}
19741
19742/// Implements a client for the Compute Engine API.
19743///
19744/// # Example
19745/// ```
19746/// # use google_cloud_compute_v1::client::TargetTcpProxies;
19747/// async fn sample(
19748/// ) -> anyhow::Result<()> {
19749/// let client = TargetTcpProxies::builder().build().await?;
19750/// // use `client` to make requests to the Compute Engine API.
19751/// Ok(())
19752/// }
19753/// ```
19754///
19755/// # Service Description
19756///
19757/// Service for the `targetTcpProxies` resource.
19758///
19759/// # Configuration
19760///
19761/// To configure `TargetTcpProxies` use the `with_*` methods in the type returned
19762/// by [builder()][TargetTcpProxies::builder]. The default configuration should
19763/// work for most applications. Common configuration changes include
19764///
19765/// * [with_endpoint()]: by default this client uses the global default endpoint
19766/// (`https://compute.googleapis.com`). Applications using regional
19767/// endpoints or running in restricted networks (e.g. a network configured
19768/// with [Private Google Access with VPC Service Controls]) may want to
19769/// override this default.
19770/// * [with_credentials()]: by default this client uses
19771/// [Application Default Credentials]. Applications using custom
19772/// authentication may need to override this default.
19773///
19774/// [with_endpoint()]: super::builder::target_tcp_proxies::ClientBuilder::with_endpoint
19775/// [with_credentials()]: super::builder::target_tcp_proxies::ClientBuilder::with_credentials
19776/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
19777/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
19778///
19779/// # Pooling and Cloning
19780///
19781/// `TargetTcpProxies` holds a connection pool internally, it is advised to
19782/// create one and reuse it. You do not need to wrap `TargetTcpProxies` in
19783/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
19784/// already uses an `Arc` internally.
19785#[cfg(feature = "target-tcp-proxies")]
19786#[cfg_attr(docsrs, doc(cfg(feature = "target-tcp-proxies")))]
19787#[derive(Clone, Debug)]
19788pub struct TargetTcpProxies {
19789 inner: std::sync::Arc<dyn super::stub::dynamic::TargetTcpProxies>,
19790}
19791
19792#[cfg(feature = "target-tcp-proxies")]
19793impl TargetTcpProxies {
19794 /// Returns a builder for [TargetTcpProxies].
19795 ///
19796 /// ```
19797 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19798 /// # use google_cloud_compute_v1::client::TargetTcpProxies;
19799 /// let client = TargetTcpProxies::builder().build().await?;
19800 /// # Ok(()) }
19801 /// ```
19802 pub fn builder() -> super::builder::target_tcp_proxies::ClientBuilder {
19803 crate::new_client_builder(super::builder::target_tcp_proxies::client::Factory)
19804 }
19805
19806 /// Creates a new client from the provided stub.
19807 ///
19808 /// The most common case for calling this function is in tests mocking the
19809 /// client's behavior.
19810 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
19811 where
19812 T: super::stub::TargetTcpProxies + 'static,
19813 {
19814 Self { inner: stub.into() }
19815 }
19816
19817 pub(crate) async fn new(
19818 config: gaxi::options::ClientConfig,
19819 ) -> crate::ClientBuilderResult<Self> {
19820 let inner = Self::build_inner(config).await?;
19821 Ok(Self { inner })
19822 }
19823
19824 async fn build_inner(
19825 conf: gaxi::options::ClientConfig,
19826 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetTcpProxies>>
19827 {
19828 if gaxi::options::tracing_enabled(&conf) {
19829 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
19830 }
19831 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
19832 }
19833
19834 async fn build_transport(
19835 conf: gaxi::options::ClientConfig,
19836 ) -> crate::ClientBuilderResult<impl super::stub::TargetTcpProxies> {
19837 super::transport::TargetTcpProxies::new(conf).await
19838 }
19839
19840 async fn build_with_tracing(
19841 conf: gaxi::options::ClientConfig,
19842 ) -> crate::ClientBuilderResult<impl super::stub::TargetTcpProxies> {
19843 Self::build_transport(conf)
19844 .await
19845 .map(super::tracing::TargetTcpProxies::new)
19846 }
19847
19848 /// Retrieves the list of all TargetTcpProxy resources, regional and global,
19849 /// available to the specified project.
19850 ///
19851 /// To prevent failure, Google recommends that you set the
19852 /// `returnPartialSuccess` parameter to `true`.
19853 pub fn aggregated_list(&self) -> super::builder::target_tcp_proxies::AggregatedList {
19854 super::builder::target_tcp_proxies::AggregatedList::new(self.inner.clone())
19855 }
19856
19857 /// Deletes the specified TargetTcpProxy resource.
19858 pub fn delete(&self) -> super::builder::target_tcp_proxies::Delete {
19859 super::builder::target_tcp_proxies::Delete::new(self.inner.clone())
19860 }
19861
19862 /// Returns the specified TargetTcpProxy resource.
19863 pub fn get(&self) -> super::builder::target_tcp_proxies::Get {
19864 super::builder::target_tcp_proxies::Get::new(self.inner.clone())
19865 }
19866
19867 /// Creates a TargetTcpProxy resource in the specified project using
19868 /// the data included in the request.
19869 pub fn insert(&self) -> super::builder::target_tcp_proxies::Insert {
19870 super::builder::target_tcp_proxies::Insert::new(self.inner.clone())
19871 }
19872
19873 /// Retrieves the list of TargetTcpProxy resources
19874 /// available to the specified project.
19875 pub fn list(&self) -> super::builder::target_tcp_proxies::List {
19876 super::builder::target_tcp_proxies::List::new(self.inner.clone())
19877 }
19878
19879 /// Changes the BackendService for TargetTcpProxy.
19880 pub fn set_backend_service(&self) -> super::builder::target_tcp_proxies::SetBackendService {
19881 super::builder::target_tcp_proxies::SetBackendService::new(self.inner.clone())
19882 }
19883
19884 /// Changes the ProxyHeaderType for TargetTcpProxy.
19885 pub fn set_proxy_header(&self) -> super::builder::target_tcp_proxies::SetProxyHeader {
19886 super::builder::target_tcp_proxies::SetProxyHeader::new(self.inner.clone())
19887 }
19888
19889 /// Returns permissions that a caller has on the specified resource.
19890 pub fn test_iam_permissions(&self) -> super::builder::target_tcp_proxies::TestIamPermissions {
19891 super::builder::target_tcp_proxies::TestIamPermissions::new(self.inner.clone())
19892 }
19893
19894 /// Retrieves the specified Operations resource.
19895 pub fn get_operation(&self) -> super::builder::target_tcp_proxies::GetOperation {
19896 super::builder::target_tcp_proxies::GetOperation::new(self.inner.clone())
19897 }
19898}
19899
19900/// Implements a client for the Compute Engine API.
19901///
19902/// # Example
19903/// ```
19904/// # use google_cloud_compute_v1::client::TargetVpnGateways;
19905/// async fn sample(
19906/// ) -> anyhow::Result<()> {
19907/// let client = TargetVpnGateways::builder().build().await?;
19908/// // use `client` to make requests to the Compute Engine API.
19909/// Ok(())
19910/// }
19911/// ```
19912///
19913/// # Service Description
19914///
19915/// Service for the `targetVpnGateways` resource.
19916///
19917/// # Configuration
19918///
19919/// To configure `TargetVpnGateways` use the `with_*` methods in the type returned
19920/// by [builder()][TargetVpnGateways::builder]. The default configuration should
19921/// work for most applications. Common configuration changes include
19922///
19923/// * [with_endpoint()]: by default this client uses the global default endpoint
19924/// (`https://compute.googleapis.com`). Applications using regional
19925/// endpoints or running in restricted networks (e.g. a network configured
19926/// with [Private Google Access with VPC Service Controls]) may want to
19927/// override this default.
19928/// * [with_credentials()]: by default this client uses
19929/// [Application Default Credentials]. Applications using custom
19930/// authentication may need to override this default.
19931///
19932/// [with_endpoint()]: super::builder::target_vpn_gateways::ClientBuilder::with_endpoint
19933/// [with_credentials()]: super::builder::target_vpn_gateways::ClientBuilder::with_credentials
19934/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
19935/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
19936///
19937/// # Pooling and Cloning
19938///
19939/// `TargetVpnGateways` holds a connection pool internally, it is advised to
19940/// create one and reuse it. You do not need to wrap `TargetVpnGateways` in
19941/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
19942/// already uses an `Arc` internally.
19943#[cfg(feature = "target-vpn-gateways")]
19944#[cfg_attr(docsrs, doc(cfg(feature = "target-vpn-gateways")))]
19945#[derive(Clone, Debug)]
19946pub struct TargetVpnGateways {
19947 inner: std::sync::Arc<dyn super::stub::dynamic::TargetVpnGateways>,
19948}
19949
19950#[cfg(feature = "target-vpn-gateways")]
19951impl TargetVpnGateways {
19952 /// Returns a builder for [TargetVpnGateways].
19953 ///
19954 /// ```
19955 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19956 /// # use google_cloud_compute_v1::client::TargetVpnGateways;
19957 /// let client = TargetVpnGateways::builder().build().await?;
19958 /// # Ok(()) }
19959 /// ```
19960 pub fn builder() -> super::builder::target_vpn_gateways::ClientBuilder {
19961 crate::new_client_builder(super::builder::target_vpn_gateways::client::Factory)
19962 }
19963
19964 /// Creates a new client from the provided stub.
19965 ///
19966 /// The most common case for calling this function is in tests mocking the
19967 /// client's behavior.
19968 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
19969 where
19970 T: super::stub::TargetVpnGateways + 'static,
19971 {
19972 Self { inner: stub.into() }
19973 }
19974
19975 pub(crate) async fn new(
19976 config: gaxi::options::ClientConfig,
19977 ) -> crate::ClientBuilderResult<Self> {
19978 let inner = Self::build_inner(config).await?;
19979 Ok(Self { inner })
19980 }
19981
19982 async fn build_inner(
19983 conf: gaxi::options::ClientConfig,
19984 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetVpnGateways>>
19985 {
19986 if gaxi::options::tracing_enabled(&conf) {
19987 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
19988 }
19989 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
19990 }
19991
19992 async fn build_transport(
19993 conf: gaxi::options::ClientConfig,
19994 ) -> crate::ClientBuilderResult<impl super::stub::TargetVpnGateways> {
19995 super::transport::TargetVpnGateways::new(conf).await
19996 }
19997
19998 async fn build_with_tracing(
19999 conf: gaxi::options::ClientConfig,
20000 ) -> crate::ClientBuilderResult<impl super::stub::TargetVpnGateways> {
20001 Self::build_transport(conf)
20002 .await
20003 .map(super::tracing::TargetVpnGateways::new)
20004 }
20005
20006 /// Retrieves an aggregated list of target VPN gateways.
20007 ///
20008 /// To prevent failure, Google recommends that you set the
20009 /// `returnPartialSuccess` parameter to `true`.
20010 pub fn aggregated_list(&self) -> super::builder::target_vpn_gateways::AggregatedList {
20011 super::builder::target_vpn_gateways::AggregatedList::new(self.inner.clone())
20012 }
20013
20014 /// Deletes the specified target VPN gateway.
20015 pub fn delete(&self) -> super::builder::target_vpn_gateways::Delete {
20016 super::builder::target_vpn_gateways::Delete::new(self.inner.clone())
20017 }
20018
20019 /// Returns the specified target VPN gateway.
20020 pub fn get(&self) -> super::builder::target_vpn_gateways::Get {
20021 super::builder::target_vpn_gateways::Get::new(self.inner.clone())
20022 }
20023
20024 /// Creates a target VPN gateway in the specified project and region using
20025 /// the data included in the request.
20026 pub fn insert(&self) -> super::builder::target_vpn_gateways::Insert {
20027 super::builder::target_vpn_gateways::Insert::new(self.inner.clone())
20028 }
20029
20030 /// Retrieves a list of target VPN gateways available to the specified
20031 /// project and region.
20032 pub fn list(&self) -> super::builder::target_vpn_gateways::List {
20033 super::builder::target_vpn_gateways::List::new(self.inner.clone())
20034 }
20035
20036 /// Sets the labels on a TargetVpnGateway. To learn more about labels, read theLabeling
20037 /// Resources documentation.
20038 pub fn set_labels(&self) -> super::builder::target_vpn_gateways::SetLabels {
20039 super::builder::target_vpn_gateways::SetLabels::new(self.inner.clone())
20040 }
20041
20042 /// Retrieves the specified region-specific Operations resource.
20043 pub fn get_operation(&self) -> super::builder::target_vpn_gateways::GetOperation {
20044 super::builder::target_vpn_gateways::GetOperation::new(self.inner.clone())
20045 }
20046}
20047
20048/// Implements a client for the Compute Engine API.
20049///
20050/// # Example
20051/// ```
20052/// # use google_cloud_compute_v1::client::UrlMaps;
20053/// async fn sample(
20054/// ) -> anyhow::Result<()> {
20055/// let client = UrlMaps::builder().build().await?;
20056/// // use `client` to make requests to the Compute Engine API.
20057/// Ok(())
20058/// }
20059/// ```
20060///
20061/// # Service Description
20062///
20063/// Service for the `urlMaps` resource.
20064///
20065/// # Configuration
20066///
20067/// To configure `UrlMaps` use the `with_*` methods in the type returned
20068/// by [builder()][UrlMaps::builder]. The default configuration should
20069/// work for most applications. Common configuration changes include
20070///
20071/// * [with_endpoint()]: by default this client uses the global default endpoint
20072/// (`https://compute.googleapis.com`). Applications using regional
20073/// endpoints or running in restricted networks (e.g. a network configured
20074/// with [Private Google Access with VPC Service Controls]) may want to
20075/// override this default.
20076/// * [with_credentials()]: by default this client uses
20077/// [Application Default Credentials]. Applications using custom
20078/// authentication may need to override this default.
20079///
20080/// [with_endpoint()]: super::builder::url_maps::ClientBuilder::with_endpoint
20081/// [with_credentials()]: super::builder::url_maps::ClientBuilder::with_credentials
20082/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
20083/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
20084///
20085/// # Pooling and Cloning
20086///
20087/// `UrlMaps` holds a connection pool internally, it is advised to
20088/// create one and reuse it. You do not need to wrap `UrlMaps` in
20089/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
20090/// already uses an `Arc` internally.
20091#[cfg(feature = "url-maps")]
20092#[cfg_attr(docsrs, doc(cfg(feature = "url-maps")))]
20093#[derive(Clone, Debug)]
20094pub struct UrlMaps {
20095 inner: std::sync::Arc<dyn super::stub::dynamic::UrlMaps>,
20096}
20097
20098#[cfg(feature = "url-maps")]
20099impl UrlMaps {
20100 /// Returns a builder for [UrlMaps].
20101 ///
20102 /// ```
20103 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
20104 /// # use google_cloud_compute_v1::client::UrlMaps;
20105 /// let client = UrlMaps::builder().build().await?;
20106 /// # Ok(()) }
20107 /// ```
20108 pub fn builder() -> super::builder::url_maps::ClientBuilder {
20109 crate::new_client_builder(super::builder::url_maps::client::Factory)
20110 }
20111
20112 /// Creates a new client from the provided stub.
20113 ///
20114 /// The most common case for calling this function is in tests mocking the
20115 /// client's behavior.
20116 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
20117 where
20118 T: super::stub::UrlMaps + 'static,
20119 {
20120 Self { inner: stub.into() }
20121 }
20122
20123 pub(crate) async fn new(
20124 config: gaxi::options::ClientConfig,
20125 ) -> crate::ClientBuilderResult<Self> {
20126 let inner = Self::build_inner(config).await?;
20127 Ok(Self { inner })
20128 }
20129
20130 async fn build_inner(
20131 conf: gaxi::options::ClientConfig,
20132 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::UrlMaps>> {
20133 if gaxi::options::tracing_enabled(&conf) {
20134 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
20135 }
20136 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
20137 }
20138
20139 async fn build_transport(
20140 conf: gaxi::options::ClientConfig,
20141 ) -> crate::ClientBuilderResult<impl super::stub::UrlMaps> {
20142 super::transport::UrlMaps::new(conf).await
20143 }
20144
20145 async fn build_with_tracing(
20146 conf: gaxi::options::ClientConfig,
20147 ) -> crate::ClientBuilderResult<impl super::stub::UrlMaps> {
20148 Self::build_transport(conf)
20149 .await
20150 .map(super::tracing::UrlMaps::new)
20151 }
20152
20153 /// Retrieves the list of all UrlMap resources, regional and global,
20154 /// available to the specified project.
20155 ///
20156 /// To prevent failure, Google recommends that you set the
20157 /// `returnPartialSuccess` parameter to `true`.
20158 pub fn aggregated_list(&self) -> super::builder::url_maps::AggregatedList {
20159 super::builder::url_maps::AggregatedList::new(self.inner.clone())
20160 }
20161
20162 /// Deletes the specified UrlMap resource.
20163 pub fn delete(&self) -> super::builder::url_maps::Delete {
20164 super::builder::url_maps::Delete::new(self.inner.clone())
20165 }
20166
20167 /// Returns the specified UrlMap resource.
20168 pub fn get(&self) -> super::builder::url_maps::Get {
20169 super::builder::url_maps::Get::new(self.inner.clone())
20170 }
20171
20172 /// Creates a UrlMap resource in the specified project using
20173 /// the data included in the request.
20174 pub fn insert(&self) -> super::builder::url_maps::Insert {
20175 super::builder::url_maps::Insert::new(self.inner.clone())
20176 }
20177
20178 /// Initiates a cache invalidation operation, invalidating the specified path,
20179 /// scoped to the specified UrlMap.
20180 ///
20181 /// For more information, see [Invalidating cached
20182 /// content](/cdn/docs/invalidating-cached-content).
20183 pub fn invalidate_cache(&self) -> super::builder::url_maps::InvalidateCache {
20184 super::builder::url_maps::InvalidateCache::new(self.inner.clone())
20185 }
20186
20187 /// Retrieves the list of UrlMap resources available to the specified
20188 /// project.
20189 pub fn list(&self) -> super::builder::url_maps::List {
20190 super::builder::url_maps::List::new(self.inner.clone())
20191 }
20192
20193 /// Patches the specified UrlMap resource with the data included in the
20194 /// request. This method supportsPATCH
20195 /// semantics and uses theJSON merge
20196 /// patch format and processing rules.
20197 pub fn patch(&self) -> super::builder::url_maps::Patch {
20198 super::builder::url_maps::Patch::new(self.inner.clone())
20199 }
20200
20201 /// Returns permissions that a caller has on the specified resource.
20202 pub fn test_iam_permissions(&self) -> super::builder::url_maps::TestIamPermissions {
20203 super::builder::url_maps::TestIamPermissions::new(self.inner.clone())
20204 }
20205
20206 /// Updates the specified UrlMap resource with the data included in the
20207 /// request.
20208 pub fn update(&self) -> super::builder::url_maps::Update {
20209 super::builder::url_maps::Update::new(self.inner.clone())
20210 }
20211
20212 /// Runs static validation for the UrlMap. In particular, the tests of the
20213 /// provided UrlMap will be run. Calling this method does NOT create the
20214 /// UrlMap.
20215 pub fn validate(&self) -> super::builder::url_maps::Validate {
20216 super::builder::url_maps::Validate::new(self.inner.clone())
20217 }
20218
20219 /// Retrieves the specified Operations resource.
20220 pub fn get_operation(&self) -> super::builder::url_maps::GetOperation {
20221 super::builder::url_maps::GetOperation::new(self.inner.clone())
20222 }
20223}
20224
20225/// Implements a client for the Compute Engine API.
20226///
20227/// # Example
20228/// ```
20229/// # use google_cloud_compute_v1::client::VpnGateways;
20230/// async fn sample(
20231/// ) -> anyhow::Result<()> {
20232/// let client = VpnGateways::builder().build().await?;
20233/// // use `client` to make requests to the Compute Engine API.
20234/// Ok(())
20235/// }
20236/// ```
20237///
20238/// # Service Description
20239///
20240/// Service for the `vpnGateways` resource.
20241///
20242/// # Configuration
20243///
20244/// To configure `VpnGateways` use the `with_*` methods in the type returned
20245/// by [builder()][VpnGateways::builder]. The default configuration should
20246/// work for most applications. Common configuration changes include
20247///
20248/// * [with_endpoint()]: by default this client uses the global default endpoint
20249/// (`https://compute.googleapis.com`). Applications using regional
20250/// endpoints or running in restricted networks (e.g. a network configured
20251/// with [Private Google Access with VPC Service Controls]) may want to
20252/// override this default.
20253/// * [with_credentials()]: by default this client uses
20254/// [Application Default Credentials]. Applications using custom
20255/// authentication may need to override this default.
20256///
20257/// [with_endpoint()]: super::builder::vpn_gateways::ClientBuilder::with_endpoint
20258/// [with_credentials()]: super::builder::vpn_gateways::ClientBuilder::with_credentials
20259/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
20260/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
20261///
20262/// # Pooling and Cloning
20263///
20264/// `VpnGateways` holds a connection pool internally, it is advised to
20265/// create one and reuse it. You do not need to wrap `VpnGateways` in
20266/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
20267/// already uses an `Arc` internally.
20268#[cfg(feature = "vpn-gateways")]
20269#[cfg_attr(docsrs, doc(cfg(feature = "vpn-gateways")))]
20270#[derive(Clone, Debug)]
20271pub struct VpnGateways {
20272 inner: std::sync::Arc<dyn super::stub::dynamic::VpnGateways>,
20273}
20274
20275#[cfg(feature = "vpn-gateways")]
20276impl VpnGateways {
20277 /// Returns a builder for [VpnGateways].
20278 ///
20279 /// ```
20280 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
20281 /// # use google_cloud_compute_v1::client::VpnGateways;
20282 /// let client = VpnGateways::builder().build().await?;
20283 /// # Ok(()) }
20284 /// ```
20285 pub fn builder() -> super::builder::vpn_gateways::ClientBuilder {
20286 crate::new_client_builder(super::builder::vpn_gateways::client::Factory)
20287 }
20288
20289 /// Creates a new client from the provided stub.
20290 ///
20291 /// The most common case for calling this function is in tests mocking the
20292 /// client's behavior.
20293 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
20294 where
20295 T: super::stub::VpnGateways + 'static,
20296 {
20297 Self { inner: stub.into() }
20298 }
20299
20300 pub(crate) async fn new(
20301 config: gaxi::options::ClientConfig,
20302 ) -> crate::ClientBuilderResult<Self> {
20303 let inner = Self::build_inner(config).await?;
20304 Ok(Self { inner })
20305 }
20306
20307 async fn build_inner(
20308 conf: gaxi::options::ClientConfig,
20309 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::VpnGateways>> {
20310 if gaxi::options::tracing_enabled(&conf) {
20311 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
20312 }
20313 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
20314 }
20315
20316 async fn build_transport(
20317 conf: gaxi::options::ClientConfig,
20318 ) -> crate::ClientBuilderResult<impl super::stub::VpnGateways> {
20319 super::transport::VpnGateways::new(conf).await
20320 }
20321
20322 async fn build_with_tracing(
20323 conf: gaxi::options::ClientConfig,
20324 ) -> crate::ClientBuilderResult<impl super::stub::VpnGateways> {
20325 Self::build_transport(conf)
20326 .await
20327 .map(super::tracing::VpnGateways::new)
20328 }
20329
20330 /// Retrieves an aggregated list of VPN gateways.
20331 ///
20332 /// To prevent failure, Google recommends that you set the
20333 /// `returnPartialSuccess` parameter to `true`.
20334 pub fn aggregated_list(&self) -> super::builder::vpn_gateways::AggregatedList {
20335 super::builder::vpn_gateways::AggregatedList::new(self.inner.clone())
20336 }
20337
20338 /// Deletes the specified VPN gateway.
20339 pub fn delete(&self) -> super::builder::vpn_gateways::Delete {
20340 super::builder::vpn_gateways::Delete::new(self.inner.clone())
20341 }
20342
20343 /// Returns the specified VPN gateway.
20344 pub fn get(&self) -> super::builder::vpn_gateways::Get {
20345 super::builder::vpn_gateways::Get::new(self.inner.clone())
20346 }
20347
20348 /// Returns the status for the specified VPN gateway.
20349 pub fn get_status(&self) -> super::builder::vpn_gateways::GetStatus {
20350 super::builder::vpn_gateways::GetStatus::new(self.inner.clone())
20351 }
20352
20353 /// Creates a VPN gateway in the specified project and region using
20354 /// the data included in the request.
20355 pub fn insert(&self) -> super::builder::vpn_gateways::Insert {
20356 super::builder::vpn_gateways::Insert::new(self.inner.clone())
20357 }
20358
20359 /// Retrieves a list of VPN gateways available to the specified
20360 /// project and region.
20361 pub fn list(&self) -> super::builder::vpn_gateways::List {
20362 super::builder::vpn_gateways::List::new(self.inner.clone())
20363 }
20364
20365 /// Sets the labels on a VpnGateway. To learn more about labels, read theLabeling
20366 /// Resources documentation.
20367 pub fn set_labels(&self) -> super::builder::vpn_gateways::SetLabels {
20368 super::builder::vpn_gateways::SetLabels::new(self.inner.clone())
20369 }
20370
20371 /// Returns permissions that a caller has on the specified resource.
20372 pub fn test_iam_permissions(&self) -> super::builder::vpn_gateways::TestIamPermissions {
20373 super::builder::vpn_gateways::TestIamPermissions::new(self.inner.clone())
20374 }
20375
20376 /// Retrieves the specified region-specific Operations resource.
20377 pub fn get_operation(&self) -> super::builder::vpn_gateways::GetOperation {
20378 super::builder::vpn_gateways::GetOperation::new(self.inner.clone())
20379 }
20380}
20381
20382/// Implements a client for the Compute Engine API.
20383///
20384/// # Example
20385/// ```
20386/// # use google_cloud_compute_v1::client::VpnTunnels;
20387/// async fn sample(
20388/// ) -> anyhow::Result<()> {
20389/// let client = VpnTunnels::builder().build().await?;
20390/// // use `client` to make requests to the Compute Engine API.
20391/// Ok(())
20392/// }
20393/// ```
20394///
20395/// # Service Description
20396///
20397/// Service for the `vpnTunnels` resource.
20398///
20399/// # Configuration
20400///
20401/// To configure `VpnTunnels` use the `with_*` methods in the type returned
20402/// by [builder()][VpnTunnels::builder]. The default configuration should
20403/// work for most applications. Common configuration changes include
20404///
20405/// * [with_endpoint()]: by default this client uses the global default endpoint
20406/// (`https://compute.googleapis.com`). Applications using regional
20407/// endpoints or running in restricted networks (e.g. a network configured
20408/// with [Private Google Access with VPC Service Controls]) may want to
20409/// override this default.
20410/// * [with_credentials()]: by default this client uses
20411/// [Application Default Credentials]. Applications using custom
20412/// authentication may need to override this default.
20413///
20414/// [with_endpoint()]: super::builder::vpn_tunnels::ClientBuilder::with_endpoint
20415/// [with_credentials()]: super::builder::vpn_tunnels::ClientBuilder::with_credentials
20416/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
20417/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
20418///
20419/// # Pooling and Cloning
20420///
20421/// `VpnTunnels` holds a connection pool internally, it is advised to
20422/// create one and reuse it. You do not need to wrap `VpnTunnels` in
20423/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
20424/// already uses an `Arc` internally.
20425#[cfg(feature = "vpn-tunnels")]
20426#[cfg_attr(docsrs, doc(cfg(feature = "vpn-tunnels")))]
20427#[derive(Clone, Debug)]
20428pub struct VpnTunnels {
20429 inner: std::sync::Arc<dyn super::stub::dynamic::VpnTunnels>,
20430}
20431
20432#[cfg(feature = "vpn-tunnels")]
20433impl VpnTunnels {
20434 /// Returns a builder for [VpnTunnels].
20435 ///
20436 /// ```
20437 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
20438 /// # use google_cloud_compute_v1::client::VpnTunnels;
20439 /// let client = VpnTunnels::builder().build().await?;
20440 /// # Ok(()) }
20441 /// ```
20442 pub fn builder() -> super::builder::vpn_tunnels::ClientBuilder {
20443 crate::new_client_builder(super::builder::vpn_tunnels::client::Factory)
20444 }
20445
20446 /// Creates a new client from the provided stub.
20447 ///
20448 /// The most common case for calling this function is in tests mocking the
20449 /// client's behavior.
20450 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
20451 where
20452 T: super::stub::VpnTunnels + 'static,
20453 {
20454 Self { inner: stub.into() }
20455 }
20456
20457 pub(crate) async fn new(
20458 config: gaxi::options::ClientConfig,
20459 ) -> crate::ClientBuilderResult<Self> {
20460 let inner = Self::build_inner(config).await?;
20461 Ok(Self { inner })
20462 }
20463
20464 async fn build_inner(
20465 conf: gaxi::options::ClientConfig,
20466 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::VpnTunnels>> {
20467 if gaxi::options::tracing_enabled(&conf) {
20468 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
20469 }
20470 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
20471 }
20472
20473 async fn build_transport(
20474 conf: gaxi::options::ClientConfig,
20475 ) -> crate::ClientBuilderResult<impl super::stub::VpnTunnels> {
20476 super::transport::VpnTunnels::new(conf).await
20477 }
20478
20479 async fn build_with_tracing(
20480 conf: gaxi::options::ClientConfig,
20481 ) -> crate::ClientBuilderResult<impl super::stub::VpnTunnels> {
20482 Self::build_transport(conf)
20483 .await
20484 .map(super::tracing::VpnTunnels::new)
20485 }
20486
20487 /// Retrieves an aggregated list of VPN tunnels.
20488 ///
20489 /// To prevent failure, Google recommends that you set the
20490 /// `returnPartialSuccess` parameter to `true`.
20491 pub fn aggregated_list(&self) -> super::builder::vpn_tunnels::AggregatedList {
20492 super::builder::vpn_tunnels::AggregatedList::new(self.inner.clone())
20493 }
20494
20495 /// Deletes the specified VpnTunnel resource.
20496 pub fn delete(&self) -> super::builder::vpn_tunnels::Delete {
20497 super::builder::vpn_tunnels::Delete::new(self.inner.clone())
20498 }
20499
20500 /// Returns the specified VpnTunnel resource.
20501 pub fn get(&self) -> super::builder::vpn_tunnels::Get {
20502 super::builder::vpn_tunnels::Get::new(self.inner.clone())
20503 }
20504
20505 /// Creates a VpnTunnel resource in the specified project and region using
20506 /// the data included in the request.
20507 pub fn insert(&self) -> super::builder::vpn_tunnels::Insert {
20508 super::builder::vpn_tunnels::Insert::new(self.inner.clone())
20509 }
20510
20511 /// Retrieves a list of VpnTunnel resources contained in the specified
20512 /// project and region.
20513 pub fn list(&self) -> super::builder::vpn_tunnels::List {
20514 super::builder::vpn_tunnels::List::new(self.inner.clone())
20515 }
20516
20517 /// Sets the labels on a VpnTunnel. To learn more about labels, read theLabeling
20518 /// Resources documentation.
20519 pub fn set_labels(&self) -> super::builder::vpn_tunnels::SetLabels {
20520 super::builder::vpn_tunnels::SetLabels::new(self.inner.clone())
20521 }
20522
20523 /// Retrieves the specified region-specific Operations resource.
20524 pub fn get_operation(&self) -> super::builder::vpn_tunnels::GetOperation {
20525 super::builder::vpn_tunnels::GetOperation::new(self.inner.clone())
20526 }
20527}
20528
20529/// Implements a client for the Compute Engine API.
20530///
20531/// # Example
20532/// ```
20533/// # use google_cloud_compute_v1::client::WireGroups;
20534/// async fn sample(
20535/// ) -> anyhow::Result<()> {
20536/// let client = WireGroups::builder().build().await?;
20537/// // use `client` to make requests to the Compute Engine API.
20538/// Ok(())
20539/// }
20540/// ```
20541///
20542/// # Service Description
20543///
20544/// Service for the `wireGroups` resource.
20545///
20546/// # Configuration
20547///
20548/// To configure `WireGroups` use the `with_*` methods in the type returned
20549/// by [builder()][WireGroups::builder]. The default configuration should
20550/// work for most applications. Common configuration changes include
20551///
20552/// * [with_endpoint()]: by default this client uses the global default endpoint
20553/// (`https://compute.googleapis.com`). Applications using regional
20554/// endpoints or running in restricted networks (e.g. a network configured
20555/// with [Private Google Access with VPC Service Controls]) may want to
20556/// override this default.
20557/// * [with_credentials()]: by default this client uses
20558/// [Application Default Credentials]. Applications using custom
20559/// authentication may need to override this default.
20560///
20561/// [with_endpoint()]: super::builder::wire_groups::ClientBuilder::with_endpoint
20562/// [with_credentials()]: super::builder::wire_groups::ClientBuilder::with_credentials
20563/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
20564/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
20565///
20566/// # Pooling and Cloning
20567///
20568/// `WireGroups` holds a connection pool internally, it is advised to
20569/// create one and reuse it. You do not need to wrap `WireGroups` in
20570/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
20571/// already uses an `Arc` internally.
20572#[cfg(feature = "wire-groups")]
20573#[cfg_attr(docsrs, doc(cfg(feature = "wire-groups")))]
20574#[derive(Clone, Debug)]
20575pub struct WireGroups {
20576 inner: std::sync::Arc<dyn super::stub::dynamic::WireGroups>,
20577}
20578
20579#[cfg(feature = "wire-groups")]
20580impl WireGroups {
20581 /// Returns a builder for [WireGroups].
20582 ///
20583 /// ```
20584 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
20585 /// # use google_cloud_compute_v1::client::WireGroups;
20586 /// let client = WireGroups::builder().build().await?;
20587 /// # Ok(()) }
20588 /// ```
20589 pub fn builder() -> super::builder::wire_groups::ClientBuilder {
20590 crate::new_client_builder(super::builder::wire_groups::client::Factory)
20591 }
20592
20593 /// Creates a new client from the provided stub.
20594 ///
20595 /// The most common case for calling this function is in tests mocking the
20596 /// client's behavior.
20597 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
20598 where
20599 T: super::stub::WireGroups + 'static,
20600 {
20601 Self { inner: stub.into() }
20602 }
20603
20604 pub(crate) async fn new(
20605 config: gaxi::options::ClientConfig,
20606 ) -> crate::ClientBuilderResult<Self> {
20607 let inner = Self::build_inner(config).await?;
20608 Ok(Self { inner })
20609 }
20610
20611 async fn build_inner(
20612 conf: gaxi::options::ClientConfig,
20613 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::WireGroups>> {
20614 if gaxi::options::tracing_enabled(&conf) {
20615 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
20616 }
20617 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
20618 }
20619
20620 async fn build_transport(
20621 conf: gaxi::options::ClientConfig,
20622 ) -> crate::ClientBuilderResult<impl super::stub::WireGroups> {
20623 super::transport::WireGroups::new(conf).await
20624 }
20625
20626 async fn build_with_tracing(
20627 conf: gaxi::options::ClientConfig,
20628 ) -> crate::ClientBuilderResult<impl super::stub::WireGroups> {
20629 Self::build_transport(conf)
20630 .await
20631 .map(super::tracing::WireGroups::new)
20632 }
20633
20634 /// Deletes the specified wire group in the given scope.
20635 pub fn delete(&self) -> super::builder::wire_groups::Delete {
20636 super::builder::wire_groups::Delete::new(self.inner.clone())
20637 }
20638
20639 /// Gets the specified wire group resource in the given scope.
20640 pub fn get(&self) -> super::builder::wire_groups::Get {
20641 super::builder::wire_groups::Get::new(self.inner.clone())
20642 }
20643
20644 /// Creates a wire group in the specified project in the given scope
20645 /// using the parameters that are included in the request.
20646 pub fn insert(&self) -> super::builder::wire_groups::Insert {
20647 super::builder::wire_groups::Insert::new(self.inner.clone())
20648 }
20649
20650 /// Lists the wire groups for a project in the given scope.
20651 pub fn list(&self) -> super::builder::wire_groups::List {
20652 super::builder::wire_groups::List::new(self.inner.clone())
20653 }
20654
20655 /// Updates the specified wire group resource with the data included in the
20656 /// request. This method supportsPATCH
20657 /// semantics and usesJSON merge
20658 /// patch format and processing rules.
20659 pub fn patch(&self) -> super::builder::wire_groups::Patch {
20660 super::builder::wire_groups::Patch::new(self.inner.clone())
20661 }
20662
20663 /// Retrieves the specified Operations resource.
20664 pub fn get_operation(&self) -> super::builder::wire_groups::GetOperation {
20665 super::builder::wire_groups::GetOperation::new(self.inner.clone())
20666 }
20667}
20668
20669/// Implements a client for the Compute Engine API.
20670///
20671/// # Example
20672/// ```
20673/// # use google_cloud_compute_v1::client::ZoneOperations;
20674/// async fn sample(
20675/// ) -> anyhow::Result<()> {
20676/// let client = ZoneOperations::builder().build().await?;
20677/// // use `client` to make requests to the Compute Engine API.
20678/// Ok(())
20679/// }
20680/// ```
20681///
20682/// # Service Description
20683///
20684/// Service for the `zoneOperations` resource.
20685///
20686/// # Configuration
20687///
20688/// To configure `ZoneOperations` use the `with_*` methods in the type returned
20689/// by [builder()][ZoneOperations::builder]. The default configuration should
20690/// work for most applications. Common configuration changes include
20691///
20692/// * [with_endpoint()]: by default this client uses the global default endpoint
20693/// (`https://compute.googleapis.com`). Applications using regional
20694/// endpoints or running in restricted networks (e.g. a network configured
20695/// with [Private Google Access with VPC Service Controls]) may want to
20696/// override this default.
20697/// * [with_credentials()]: by default this client uses
20698/// [Application Default Credentials]. Applications using custom
20699/// authentication may need to override this default.
20700///
20701/// [with_endpoint()]: super::builder::zone_operations::ClientBuilder::with_endpoint
20702/// [with_credentials()]: super::builder::zone_operations::ClientBuilder::with_credentials
20703/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
20704/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
20705///
20706/// # Pooling and Cloning
20707///
20708/// `ZoneOperations` holds a connection pool internally, it is advised to
20709/// create one and reuse it. You do not need to wrap `ZoneOperations` in
20710/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
20711/// already uses an `Arc` internally.
20712#[cfg(feature = "zone-operations")]
20713#[cfg_attr(docsrs, doc(cfg(feature = "zone-operations")))]
20714#[derive(Clone, Debug)]
20715pub struct ZoneOperations {
20716 inner: std::sync::Arc<dyn super::stub::dynamic::ZoneOperations>,
20717}
20718
20719#[cfg(feature = "zone-operations")]
20720impl ZoneOperations {
20721 /// Returns a builder for [ZoneOperations].
20722 ///
20723 /// ```
20724 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
20725 /// # use google_cloud_compute_v1::client::ZoneOperations;
20726 /// let client = ZoneOperations::builder().build().await?;
20727 /// # Ok(()) }
20728 /// ```
20729 pub fn builder() -> super::builder::zone_operations::ClientBuilder {
20730 crate::new_client_builder(super::builder::zone_operations::client::Factory)
20731 }
20732
20733 /// Creates a new client from the provided stub.
20734 ///
20735 /// The most common case for calling this function is in tests mocking the
20736 /// client's behavior.
20737 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
20738 where
20739 T: super::stub::ZoneOperations + 'static,
20740 {
20741 Self { inner: stub.into() }
20742 }
20743
20744 pub(crate) async fn new(
20745 config: gaxi::options::ClientConfig,
20746 ) -> crate::ClientBuilderResult<Self> {
20747 let inner = Self::build_inner(config).await?;
20748 Ok(Self { inner })
20749 }
20750
20751 async fn build_inner(
20752 conf: gaxi::options::ClientConfig,
20753 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ZoneOperations>> {
20754 if gaxi::options::tracing_enabled(&conf) {
20755 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
20756 }
20757 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
20758 }
20759
20760 async fn build_transport(
20761 conf: gaxi::options::ClientConfig,
20762 ) -> crate::ClientBuilderResult<impl super::stub::ZoneOperations> {
20763 super::transport::ZoneOperations::new(conf).await
20764 }
20765
20766 async fn build_with_tracing(
20767 conf: gaxi::options::ClientConfig,
20768 ) -> crate::ClientBuilderResult<impl super::stub::ZoneOperations> {
20769 Self::build_transport(conf)
20770 .await
20771 .map(super::tracing::ZoneOperations::new)
20772 }
20773
20774 /// Deletes the specified zone-specific Operations resource.
20775 pub fn delete(&self) -> super::builder::zone_operations::Delete {
20776 super::builder::zone_operations::Delete::new(self.inner.clone())
20777 }
20778
20779 /// Retrieves the specified zone-specific Operations resource.
20780 pub fn get(&self) -> super::builder::zone_operations::Get {
20781 super::builder::zone_operations::Get::new(self.inner.clone())
20782 }
20783
20784 /// Retrieves a list of Operation resources contained within
20785 /// the specified zone.
20786 pub fn list(&self) -> super::builder::zone_operations::List {
20787 super::builder::zone_operations::List::new(self.inner.clone())
20788 }
20789
20790 /// Waits for the specified Operation resource to return as `DONE`
20791 /// or for the request to approach the 2 minute deadline, and retrieves the
20792 /// specified Operation resource. This method waits for no more than the
20793 /// 2 minutes and then returns the current state of the
20794 /// operation, which might be `DONE` or still in progress.
20795 ///
20796 /// This method is called on a best-effort basis. Specifically:
20797 ///
20798 /// ```norust
20799 /// - In uncommon cases, when the server is overloaded, the request might
20800 /// return before the default deadline is reached, or might return after zero
20801 /// seconds.
20802 /// ```
20803 ///
20804 /// - If the default deadline is reached, there is no guarantee that the
20805 /// operation is actually done when the method returns. Be prepared to retry
20806 /// if the operation is not `DONE`.
20807 pub fn wait(&self) -> super::builder::zone_operations::Wait {
20808 super::builder::zone_operations::Wait::new(self.inner.clone())
20809 }
20810}
20811
20812/// Implements a client for the Compute Engine API.
20813///
20814/// # Example
20815/// ```
20816/// # use google_cloud_compute_v1::client::ZoneVmExtensionPolicies;
20817/// async fn sample(
20818/// ) -> anyhow::Result<()> {
20819/// let client = ZoneVmExtensionPolicies::builder().build().await?;
20820/// // use `client` to make requests to the Compute Engine API.
20821/// Ok(())
20822/// }
20823/// ```
20824///
20825/// # Service Description
20826///
20827/// Service for the `zoneVmExtensionPolicies` resource.
20828///
20829/// # Configuration
20830///
20831/// To configure `ZoneVmExtensionPolicies` use the `with_*` methods in the type returned
20832/// by [builder()][ZoneVmExtensionPolicies::builder]. The default configuration should
20833/// work for most applications. Common configuration changes include
20834///
20835/// * [with_endpoint()]: by default this client uses the global default endpoint
20836/// (`https://compute.googleapis.com`). Applications using regional
20837/// endpoints or running in restricted networks (e.g. a network configured
20838/// with [Private Google Access with VPC Service Controls]) may want to
20839/// override this default.
20840/// * [with_credentials()]: by default this client uses
20841/// [Application Default Credentials]. Applications using custom
20842/// authentication may need to override this default.
20843///
20844/// [with_endpoint()]: super::builder::zone_vm_extension_policies::ClientBuilder::with_endpoint
20845/// [with_credentials()]: super::builder::zone_vm_extension_policies::ClientBuilder::with_credentials
20846/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
20847/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
20848///
20849/// # Pooling and Cloning
20850///
20851/// `ZoneVmExtensionPolicies` holds a connection pool internally, it is advised to
20852/// create one and reuse it. You do not need to wrap `ZoneVmExtensionPolicies` in
20853/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
20854/// already uses an `Arc` internally.
20855#[cfg(feature = "zone-vm-extension-policies")]
20856#[cfg_attr(docsrs, doc(cfg(feature = "zone-vm-extension-policies")))]
20857#[derive(Clone, Debug)]
20858pub struct ZoneVmExtensionPolicies {
20859 inner: std::sync::Arc<dyn super::stub::dynamic::ZoneVmExtensionPolicies>,
20860}
20861
20862#[cfg(feature = "zone-vm-extension-policies")]
20863impl ZoneVmExtensionPolicies {
20864 /// Returns a builder for [ZoneVmExtensionPolicies].
20865 ///
20866 /// ```
20867 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
20868 /// # use google_cloud_compute_v1::client::ZoneVmExtensionPolicies;
20869 /// let client = ZoneVmExtensionPolicies::builder().build().await?;
20870 /// # Ok(()) }
20871 /// ```
20872 pub fn builder() -> super::builder::zone_vm_extension_policies::ClientBuilder {
20873 crate::new_client_builder(super::builder::zone_vm_extension_policies::client::Factory)
20874 }
20875
20876 /// Creates a new client from the provided stub.
20877 ///
20878 /// The most common case for calling this function is in tests mocking the
20879 /// client's behavior.
20880 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
20881 where
20882 T: super::stub::ZoneVmExtensionPolicies + 'static,
20883 {
20884 Self { inner: stub.into() }
20885 }
20886
20887 pub(crate) async fn new(
20888 config: gaxi::options::ClientConfig,
20889 ) -> crate::ClientBuilderResult<Self> {
20890 let inner = Self::build_inner(config).await?;
20891 Ok(Self { inner })
20892 }
20893
20894 async fn build_inner(
20895 conf: gaxi::options::ClientConfig,
20896 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ZoneVmExtensionPolicies>>
20897 {
20898 if gaxi::options::tracing_enabled(&conf) {
20899 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
20900 }
20901 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
20902 }
20903
20904 async fn build_transport(
20905 conf: gaxi::options::ClientConfig,
20906 ) -> crate::ClientBuilderResult<impl super::stub::ZoneVmExtensionPolicies> {
20907 super::transport::ZoneVmExtensionPolicies::new(conf).await
20908 }
20909
20910 async fn build_with_tracing(
20911 conf: gaxi::options::ClientConfig,
20912 ) -> crate::ClientBuilderResult<impl super::stub::ZoneVmExtensionPolicies> {
20913 Self::build_transport(conf)
20914 .await
20915 .map(super::tracing::ZoneVmExtensionPolicies::new)
20916 }
20917
20918 /// Deletes a specified zone VM extension policy within a project.
20919 pub fn delete(&self) -> super::builder::zone_vm_extension_policies::Delete {
20920 super::builder::zone_vm_extension_policies::Delete::new(self.inner.clone())
20921 }
20922
20923 /// Retrieves details of a specific zone VM extension policy within a project.
20924 pub fn get(&self) -> super::builder::zone_vm_extension_policies::Get {
20925 super::builder::zone_vm_extension_policies::Get::new(self.inner.clone())
20926 }
20927
20928 /// Creates a new zone-level VM extension policy within a project.
20929 pub fn insert(&self) -> super::builder::zone_vm_extension_policies::Insert {
20930 super::builder::zone_vm_extension_policies::Insert::new(self.inner.clone())
20931 }
20932
20933 /// Lists all VM extension policies within a specific zone for a project.
20934 pub fn list(&self) -> super::builder::zone_vm_extension_policies::List {
20935 super::builder::zone_vm_extension_policies::List::new(self.inner.clone())
20936 }
20937
20938 /// Modifies an existing zone VM extension policy within a project.
20939 pub fn update(&self) -> super::builder::zone_vm_extension_policies::Update {
20940 super::builder::zone_vm_extension_policies::Update::new(self.inner.clone())
20941 }
20942
20943 /// Retrieves the specified zone-specific Operations resource.
20944 pub fn get_operation(&self) -> super::builder::zone_vm_extension_policies::GetOperation {
20945 super::builder::zone_vm_extension_policies::GetOperation::new(self.inner.clone())
20946 }
20947}
20948
20949/// Implements a client for the Compute Engine API.
20950///
20951/// # Example
20952/// ```
20953/// # use google_cloud_compute_v1::client::Zones;
20954/// async fn sample(
20955/// ) -> anyhow::Result<()> {
20956/// let client = Zones::builder().build().await?;
20957/// // use `client` to make requests to the Compute Engine API.
20958/// Ok(())
20959/// }
20960/// ```
20961///
20962/// # Service Description
20963///
20964/// Service for the `zones` resource.
20965///
20966/// # Configuration
20967///
20968/// To configure `Zones` use the `with_*` methods in the type returned
20969/// by [builder()][Zones::builder]. The default configuration should
20970/// work for most applications. Common configuration changes include
20971///
20972/// * [with_endpoint()]: by default this client uses the global default endpoint
20973/// (`https://compute.googleapis.com`). Applications using regional
20974/// endpoints or running in restricted networks (e.g. a network configured
20975/// with [Private Google Access with VPC Service Controls]) may want to
20976/// override this default.
20977/// * [with_credentials()]: by default this client uses
20978/// [Application Default Credentials]. Applications using custom
20979/// authentication may need to override this default.
20980///
20981/// [with_endpoint()]: super::builder::zones::ClientBuilder::with_endpoint
20982/// [with_credentials()]: super::builder::zones::ClientBuilder::with_credentials
20983/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
20984/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
20985///
20986/// # Pooling and Cloning
20987///
20988/// `Zones` holds a connection pool internally, it is advised to
20989/// create one and reuse it. You do not need to wrap `Zones` in
20990/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
20991/// already uses an `Arc` internally.
20992#[cfg(feature = "zones")]
20993#[cfg_attr(docsrs, doc(cfg(feature = "zones")))]
20994#[derive(Clone, Debug)]
20995pub struct Zones {
20996 inner: std::sync::Arc<dyn super::stub::dynamic::Zones>,
20997}
20998
20999#[cfg(feature = "zones")]
21000impl Zones {
21001 /// Returns a builder for [Zones].
21002 ///
21003 /// ```
21004 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
21005 /// # use google_cloud_compute_v1::client::Zones;
21006 /// let client = Zones::builder().build().await?;
21007 /// # Ok(()) }
21008 /// ```
21009 pub fn builder() -> super::builder::zones::ClientBuilder {
21010 crate::new_client_builder(super::builder::zones::client::Factory)
21011 }
21012
21013 /// Creates a new client from the provided stub.
21014 ///
21015 /// The most common case for calling this function is in tests mocking the
21016 /// client's behavior.
21017 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
21018 where
21019 T: super::stub::Zones + 'static,
21020 {
21021 Self { inner: stub.into() }
21022 }
21023
21024 pub(crate) async fn new(
21025 config: gaxi::options::ClientConfig,
21026 ) -> crate::ClientBuilderResult<Self> {
21027 let inner = Self::build_inner(config).await?;
21028 Ok(Self { inner })
21029 }
21030
21031 async fn build_inner(
21032 conf: gaxi::options::ClientConfig,
21033 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Zones>> {
21034 if gaxi::options::tracing_enabled(&conf) {
21035 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
21036 }
21037 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
21038 }
21039
21040 async fn build_transport(
21041 conf: gaxi::options::ClientConfig,
21042 ) -> crate::ClientBuilderResult<impl super::stub::Zones> {
21043 super::transport::Zones::new(conf).await
21044 }
21045
21046 async fn build_with_tracing(
21047 conf: gaxi::options::ClientConfig,
21048 ) -> crate::ClientBuilderResult<impl super::stub::Zones> {
21049 Self::build_transport(conf)
21050 .await
21051 .map(super::tracing::Zones::new)
21052 }
21053
21054 /// Returns the specified Zone resource.
21055 pub fn get(&self) -> super::builder::zones::Get {
21056 super::builder::zones::Get::new(self.inner.clone())
21057 }
21058
21059 /// Retrieves the list of Zone resources available to the specified project.
21060 pub fn list(&self) -> super::builder::zones::List {
21061 super::builder::zones::List::new(self.inner.clone())
21062 }
21063}