google_cloud_compute_v1/client.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16#![allow(rustdoc::bare_urls)]
17#![allow(rustdoc::broken_intra_doc_links)]
18#![allow(rustdoc::redundant_explicit_links)]
19
20/// Implements a client for the Google Compute Engine API.
21///
22/// # Example
23/// ```
24/// # tokio_test::block_on(async {
25/// # use google_cloud_compute_v1::client::AcceleratorTypes;
26/// let client = AcceleratorTypes::builder().build().await?;
27/// // use `client` to make requests to the Google Compute Engine API.
28/// # gax::client_builder::Result::<()>::Ok(()) });
29/// ```
30///
31/// # Service Description
32///
33/// Service for the `acceleratorTypes` resource.
34///
35/// # Configuration
36///
37/// To configure `AcceleratorTypes` use the `with_*` methods in the type returned
38/// by [builder()][AcceleratorTypes::builder]. The default configuration should
39/// work for most applications. Common configuration changes include
40///
41/// * [with_endpoint()]: by default this client uses the global default endpoint
42/// (`https://compute.googleapis.com`). Applications using regional
43/// endpoints or running in restricted networks (e.g. a network configured
44// with [Private Google Access with VPC Service Controls]) may want to
45/// override this default.
46/// * [with_credentials()]: by default this client uses
47/// [Application Default Credentials]. Applications using custom
48/// authentication may need to override this default.
49///
50/// [with_endpoint()]: super::builder::accelerator_types::ClientBuilder::with_endpoint
51/// [with_credentials()]: super::builder::accelerator_types::ClientBuilder::credentials
52/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
53/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
54///
55/// # Pooling and Cloning
56///
57/// `AcceleratorTypes` holds a connection pool internally, it is advised to
58/// create one and the reuse it. You do not need to wrap `AcceleratorTypes` in
59/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
60/// already uses an `Arc` internally.
61#[cfg(feature = "accelerator-types")]
62#[cfg_attr(docsrs, doc(cfg(feature = "accelerator-types")))]
63#[derive(Clone, Debug)]
64pub struct AcceleratorTypes {
65 inner: std::sync::Arc<dyn super::stub::dynamic::AcceleratorTypes>,
66}
67
68#[cfg(feature = "accelerator-types")]
69impl AcceleratorTypes {
70 /// Returns a builder for [AcceleratorTypes].
71 ///
72 /// ```
73 /// # tokio_test::block_on(async {
74 /// # use google_cloud_compute_v1::client::AcceleratorTypes;
75 /// let client = AcceleratorTypes::builder().build().await?;
76 /// # gax::client_builder::Result::<()>::Ok(()) });
77 /// ```
78 pub fn builder() -> super::builder::accelerator_types::ClientBuilder {
79 gax::client_builder::internal::new_builder(
80 super::builder::accelerator_types::client::Factory,
81 )
82 }
83
84 /// Creates a new client from the provided stub.
85 ///
86 /// The most common case for calling this function is in tests mocking the
87 /// client's behavior.
88 pub fn from_stub<T>(stub: T) -> Self
89 where
90 T: super::stub::AcceleratorTypes + 'static,
91 {
92 Self {
93 inner: std::sync::Arc::new(stub),
94 }
95 }
96
97 pub(crate) async fn new(
98 config: gaxi::options::ClientConfig,
99 ) -> gax::client_builder::Result<Self> {
100 let inner = Self::build_inner(config).await?;
101 Ok(Self { inner })
102 }
103
104 async fn build_inner(
105 conf: gaxi::options::ClientConfig,
106 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::AcceleratorTypes>>
107 {
108 if gaxi::options::tracing_enabled(&conf) {
109 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
110 }
111 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
112 }
113
114 async fn build_transport(
115 conf: gaxi::options::ClientConfig,
116 ) -> gax::client_builder::Result<impl super::stub::AcceleratorTypes> {
117 super::transport::AcceleratorTypes::new(conf).await
118 }
119
120 async fn build_with_tracing(
121 conf: gaxi::options::ClientConfig,
122 ) -> gax::client_builder::Result<impl super::stub::AcceleratorTypes> {
123 Self::build_transport(conf)
124 .await
125 .map(super::tracing::AcceleratorTypes::new)
126 }
127
128 /// Retrieves an aggregated list of accelerator types.
129 ///
130 /// To prevent failure, it is recommended that you set the
131 /// `returnPartialSuccess` parameter to `true`.
132 pub fn aggregated_list(&self) -> super::builder::accelerator_types::AggregatedList {
133 super::builder::accelerator_types::AggregatedList::new(self.inner.clone())
134 }
135
136 /// Returns the specified accelerator type.
137 pub fn get(&self) -> super::builder::accelerator_types::Get {
138 super::builder::accelerator_types::Get::new(self.inner.clone())
139 }
140
141 /// Retrieves a list of accelerator types that are available to the specified
142 /// project.
143 pub fn list(&self) -> super::builder::accelerator_types::List {
144 super::builder::accelerator_types::List::new(self.inner.clone())
145 }
146}
147
148/// Implements a client for the Google Compute Engine API.
149///
150/// # Example
151/// ```
152/// # tokio_test::block_on(async {
153/// # use google_cloud_compute_v1::client::Addresses;
154/// let client = Addresses::builder().build().await?;
155/// // use `client` to make requests to the Google Compute Engine API.
156/// # gax::client_builder::Result::<()>::Ok(()) });
157/// ```
158///
159/// # Service Description
160///
161/// Service for the `addresses` resource.
162///
163/// # Configuration
164///
165/// To configure `Addresses` use the `with_*` methods in the type returned
166/// by [builder()][Addresses::builder]. The default configuration should
167/// work for most applications. Common configuration changes include
168///
169/// * [with_endpoint()]: by default this client uses the global default endpoint
170/// (`https://compute.googleapis.com`). Applications using regional
171/// endpoints or running in restricted networks (e.g. a network configured
172// with [Private Google Access with VPC Service Controls]) may want to
173/// override this default.
174/// * [with_credentials()]: by default this client uses
175/// [Application Default Credentials]. Applications using custom
176/// authentication may need to override this default.
177///
178/// [with_endpoint()]: super::builder::addresses::ClientBuilder::with_endpoint
179/// [with_credentials()]: super::builder::addresses::ClientBuilder::credentials
180/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
181/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
182///
183/// # Pooling and Cloning
184///
185/// `Addresses` holds a connection pool internally, it is advised to
186/// create one and the reuse it. You do not need to wrap `Addresses` in
187/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
188/// already uses an `Arc` internally.
189#[cfg(feature = "addresses")]
190#[cfg_attr(docsrs, doc(cfg(feature = "addresses")))]
191#[derive(Clone, Debug)]
192pub struct Addresses {
193 inner: std::sync::Arc<dyn super::stub::dynamic::Addresses>,
194}
195
196#[cfg(feature = "addresses")]
197impl Addresses {
198 /// Returns a builder for [Addresses].
199 ///
200 /// ```
201 /// # tokio_test::block_on(async {
202 /// # use google_cloud_compute_v1::client::Addresses;
203 /// let client = Addresses::builder().build().await?;
204 /// # gax::client_builder::Result::<()>::Ok(()) });
205 /// ```
206 pub fn builder() -> super::builder::addresses::ClientBuilder {
207 gax::client_builder::internal::new_builder(super::builder::addresses::client::Factory)
208 }
209
210 /// Creates a new client from the provided stub.
211 ///
212 /// The most common case for calling this function is in tests mocking the
213 /// client's behavior.
214 pub fn from_stub<T>(stub: T) -> Self
215 where
216 T: super::stub::Addresses + 'static,
217 {
218 Self {
219 inner: std::sync::Arc::new(stub),
220 }
221 }
222
223 pub(crate) async fn new(
224 config: gaxi::options::ClientConfig,
225 ) -> gax::client_builder::Result<Self> {
226 let inner = Self::build_inner(config).await?;
227 Ok(Self { inner })
228 }
229
230 async fn build_inner(
231 conf: gaxi::options::ClientConfig,
232 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Addresses>> {
233 if gaxi::options::tracing_enabled(&conf) {
234 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
235 }
236 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
237 }
238
239 async fn build_transport(
240 conf: gaxi::options::ClientConfig,
241 ) -> gax::client_builder::Result<impl super::stub::Addresses> {
242 super::transport::Addresses::new(conf).await
243 }
244
245 async fn build_with_tracing(
246 conf: gaxi::options::ClientConfig,
247 ) -> gax::client_builder::Result<impl super::stub::Addresses> {
248 Self::build_transport(conf)
249 .await
250 .map(super::tracing::Addresses::new)
251 }
252
253 /// Retrieves an aggregated list of addresses.
254 ///
255 /// To prevent failure, it is recommended that you set the
256 /// `returnPartialSuccess` parameter to `true`.
257 pub fn aggregated_list(&self) -> super::builder::addresses::AggregatedList {
258 super::builder::addresses::AggregatedList::new(self.inner.clone())
259 }
260
261 /// Deletes the specified address resource.
262 pub fn delete(&self) -> super::builder::addresses::Delete {
263 super::builder::addresses::Delete::new(self.inner.clone())
264 }
265
266 /// Returns the specified address resource.
267 pub fn get(&self) -> super::builder::addresses::Get {
268 super::builder::addresses::Get::new(self.inner.clone())
269 }
270
271 /// Creates an address resource in the specified project by using the data
272 /// included in the request.
273 pub fn insert(&self) -> super::builder::addresses::Insert {
274 super::builder::addresses::Insert::new(self.inner.clone())
275 }
276
277 /// Retrieves a list of addresses contained within
278 /// the specified region.
279 pub fn list(&self) -> super::builder::addresses::List {
280 super::builder::addresses::List::new(self.inner.clone())
281 }
282
283 /// Moves the specified address resource.
284 pub fn r#move(&self) -> super::builder::addresses::Move {
285 super::builder::addresses::Move::new(self.inner.clone())
286 }
287
288 /// Sets the labels on an Address. To learn more about labels, read theLabeling
289 /// Resources documentation.
290 pub fn set_labels(&self) -> super::builder::addresses::SetLabels {
291 super::builder::addresses::SetLabels::new(self.inner.clone())
292 }
293
294 /// Returns permissions that a caller has on the specified resource.
295 pub fn test_iam_permissions(&self) -> super::builder::addresses::TestIamPermissions {
296 super::builder::addresses::TestIamPermissions::new(self.inner.clone())
297 }
298
299 /// Retrieves the specified region-specific Operations resource.
300 pub fn get_operation(&self) -> super::builder::addresses::GetOperation {
301 super::builder::addresses::GetOperation::new(self.inner.clone())
302 }
303}
304
305/// Implements a client for the Google Compute Engine API.
306///
307/// # Example
308/// ```
309/// # tokio_test::block_on(async {
310/// # use google_cloud_compute_v1::client::Advice;
311/// let client = Advice::builder().build().await?;
312/// // use `client` to make requests to the Google Compute Engine API.
313/// # gax::client_builder::Result::<()>::Ok(()) });
314/// ```
315///
316/// # Service Description
317///
318/// Service for the `advice` resource.
319///
320/// # Configuration
321///
322/// To configure `Advice` use the `with_*` methods in the type returned
323/// by [builder()][Advice::builder]. The default configuration should
324/// work for most applications. Common configuration changes include
325///
326/// * [with_endpoint()]: by default this client uses the global default endpoint
327/// (`https://compute.googleapis.com`). Applications using regional
328/// endpoints or running in restricted networks (e.g. a network configured
329// with [Private Google Access with VPC Service Controls]) may want to
330/// override this default.
331/// * [with_credentials()]: by default this client uses
332/// [Application Default Credentials]. Applications using custom
333/// authentication may need to override this default.
334///
335/// [with_endpoint()]: super::builder::advice::ClientBuilder::with_endpoint
336/// [with_credentials()]: super::builder::advice::ClientBuilder::credentials
337/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
338/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
339///
340/// # Pooling and Cloning
341///
342/// `Advice` holds a connection pool internally, it is advised to
343/// create one and the reuse it. You do not need to wrap `Advice` in
344/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
345/// already uses an `Arc` internally.
346#[cfg(feature = "advice")]
347#[cfg_attr(docsrs, doc(cfg(feature = "advice")))]
348#[derive(Clone, Debug)]
349pub struct Advice {
350 inner: std::sync::Arc<dyn super::stub::dynamic::Advice>,
351}
352
353#[cfg(feature = "advice")]
354impl Advice {
355 /// Returns a builder for [Advice].
356 ///
357 /// ```
358 /// # tokio_test::block_on(async {
359 /// # use google_cloud_compute_v1::client::Advice;
360 /// let client = Advice::builder().build().await?;
361 /// # gax::client_builder::Result::<()>::Ok(()) });
362 /// ```
363 pub fn builder() -> super::builder::advice::ClientBuilder {
364 gax::client_builder::internal::new_builder(super::builder::advice::client::Factory)
365 }
366
367 /// Creates a new client from the provided stub.
368 ///
369 /// The most common case for calling this function is in tests mocking the
370 /// client's behavior.
371 pub fn from_stub<T>(stub: T) -> Self
372 where
373 T: super::stub::Advice + 'static,
374 {
375 Self {
376 inner: std::sync::Arc::new(stub),
377 }
378 }
379
380 pub(crate) async fn new(
381 config: gaxi::options::ClientConfig,
382 ) -> gax::client_builder::Result<Self> {
383 let inner = Self::build_inner(config).await?;
384 Ok(Self { inner })
385 }
386
387 async fn build_inner(
388 conf: gaxi::options::ClientConfig,
389 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Advice>> {
390 if gaxi::options::tracing_enabled(&conf) {
391 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
392 }
393 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
394 }
395
396 async fn build_transport(
397 conf: gaxi::options::ClientConfig,
398 ) -> gax::client_builder::Result<impl super::stub::Advice> {
399 super::transport::Advice::new(conf).await
400 }
401
402 async fn build_with_tracing(
403 conf: gaxi::options::ClientConfig,
404 ) -> gax::client_builder::Result<impl super::stub::Advice> {
405 Self::build_transport(conf)
406 .await
407 .map(super::tracing::Advice::new)
408 }
409
410 /// Advise how, where and when to create the requested amount of instances
411 /// with specified accelerators, within the specified time and location limits.
412 /// The method recommends creating future reservations for the requested
413 /// resources.
414 pub fn calendar_mode(&self) -> super::builder::advice::CalendarMode {
415 super::builder::advice::CalendarMode::new(self.inner.clone())
416 }
417}
418
419/// Implements a client for the Google Compute Engine API.
420///
421/// # Example
422/// ```
423/// # tokio_test::block_on(async {
424/// # use google_cloud_compute_v1::client::Autoscalers;
425/// let client = Autoscalers::builder().build().await?;
426/// // use `client` to make requests to the Google Compute Engine API.
427/// # gax::client_builder::Result::<()>::Ok(()) });
428/// ```
429///
430/// # Service Description
431///
432/// Service for the `autoscalers` resource.
433///
434/// # Configuration
435///
436/// To configure `Autoscalers` use the `with_*` methods in the type returned
437/// by [builder()][Autoscalers::builder]. The default configuration should
438/// work for most applications. Common configuration changes include
439///
440/// * [with_endpoint()]: by default this client uses the global default endpoint
441/// (`https://compute.googleapis.com`). Applications using regional
442/// endpoints or running in restricted networks (e.g. a network configured
443// with [Private Google Access with VPC Service Controls]) may want to
444/// override this default.
445/// * [with_credentials()]: by default this client uses
446/// [Application Default Credentials]. Applications using custom
447/// authentication may need to override this default.
448///
449/// [with_endpoint()]: super::builder::autoscalers::ClientBuilder::with_endpoint
450/// [with_credentials()]: super::builder::autoscalers::ClientBuilder::credentials
451/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
452/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
453///
454/// # Pooling and Cloning
455///
456/// `Autoscalers` holds a connection pool internally, it is advised to
457/// create one and the reuse it. You do not need to wrap `Autoscalers` in
458/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
459/// already uses an `Arc` internally.
460#[cfg(feature = "autoscalers")]
461#[cfg_attr(docsrs, doc(cfg(feature = "autoscalers")))]
462#[derive(Clone, Debug)]
463pub struct Autoscalers {
464 inner: std::sync::Arc<dyn super::stub::dynamic::Autoscalers>,
465}
466
467#[cfg(feature = "autoscalers")]
468impl Autoscalers {
469 /// Returns a builder for [Autoscalers].
470 ///
471 /// ```
472 /// # tokio_test::block_on(async {
473 /// # use google_cloud_compute_v1::client::Autoscalers;
474 /// let client = Autoscalers::builder().build().await?;
475 /// # gax::client_builder::Result::<()>::Ok(()) });
476 /// ```
477 pub fn builder() -> super::builder::autoscalers::ClientBuilder {
478 gax::client_builder::internal::new_builder(super::builder::autoscalers::client::Factory)
479 }
480
481 /// Creates a new client from the provided stub.
482 ///
483 /// The most common case for calling this function is in tests mocking the
484 /// client's behavior.
485 pub fn from_stub<T>(stub: T) -> Self
486 where
487 T: super::stub::Autoscalers + 'static,
488 {
489 Self {
490 inner: std::sync::Arc::new(stub),
491 }
492 }
493
494 pub(crate) async fn new(
495 config: gaxi::options::ClientConfig,
496 ) -> gax::client_builder::Result<Self> {
497 let inner = Self::build_inner(config).await?;
498 Ok(Self { inner })
499 }
500
501 async fn build_inner(
502 conf: gaxi::options::ClientConfig,
503 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Autoscalers>> {
504 if gaxi::options::tracing_enabled(&conf) {
505 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
506 }
507 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
508 }
509
510 async fn build_transport(
511 conf: gaxi::options::ClientConfig,
512 ) -> gax::client_builder::Result<impl super::stub::Autoscalers> {
513 super::transport::Autoscalers::new(conf).await
514 }
515
516 async fn build_with_tracing(
517 conf: gaxi::options::ClientConfig,
518 ) -> gax::client_builder::Result<impl super::stub::Autoscalers> {
519 Self::build_transport(conf)
520 .await
521 .map(super::tracing::Autoscalers::new)
522 }
523
524 /// Retrieves an aggregated list of autoscalers.
525 ///
526 /// To prevent failure, it is recommended that you set the
527 /// `returnPartialSuccess` parameter to `true`.
528 pub fn aggregated_list(&self) -> super::builder::autoscalers::AggregatedList {
529 super::builder::autoscalers::AggregatedList::new(self.inner.clone())
530 }
531
532 /// Deletes the specified autoscaler.
533 pub fn delete(&self) -> super::builder::autoscalers::Delete {
534 super::builder::autoscalers::Delete::new(self.inner.clone())
535 }
536
537 /// Returns the specified autoscaler resource.
538 pub fn get(&self) -> super::builder::autoscalers::Get {
539 super::builder::autoscalers::Get::new(self.inner.clone())
540 }
541
542 /// Creates an autoscaler in the specified project using the data
543 /// included in the request.
544 pub fn insert(&self) -> super::builder::autoscalers::Insert {
545 super::builder::autoscalers::Insert::new(self.inner.clone())
546 }
547
548 /// Retrieves a list of autoscalers contained within
549 /// the specified zone.
550 pub fn list(&self) -> super::builder::autoscalers::List {
551 super::builder::autoscalers::List::new(self.inner.clone())
552 }
553
554 /// Updates an autoscaler in the specified project using the data
555 /// included in the request. This method supportsPATCH
556 /// semantics and uses theJSON merge
557 /// patch format and processing rules.
558 pub fn patch(&self) -> super::builder::autoscalers::Patch {
559 super::builder::autoscalers::Patch::new(self.inner.clone())
560 }
561
562 /// Updates an autoscaler in the specified project using the data
563 /// included in the request.
564 pub fn update(&self) -> super::builder::autoscalers::Update {
565 super::builder::autoscalers::Update::new(self.inner.clone())
566 }
567
568 /// Retrieves the specified zone-specific Operations resource.
569 pub fn get_operation(&self) -> super::builder::autoscalers::GetOperation {
570 super::builder::autoscalers::GetOperation::new(self.inner.clone())
571 }
572}
573
574/// Implements a client for the Google Compute Engine API.
575///
576/// # Example
577/// ```
578/// # tokio_test::block_on(async {
579/// # use google_cloud_compute_v1::client::BackendBuckets;
580/// let client = BackendBuckets::builder().build().await?;
581/// // use `client` to make requests to the Google Compute Engine API.
582/// # gax::client_builder::Result::<()>::Ok(()) });
583/// ```
584///
585/// # Service Description
586///
587/// Service for the `backendBuckets` resource.
588///
589/// # Configuration
590///
591/// To configure `BackendBuckets` use the `with_*` methods in the type returned
592/// by [builder()][BackendBuckets::builder]. The default configuration should
593/// work for most applications. Common configuration changes include
594///
595/// * [with_endpoint()]: by default this client uses the global default endpoint
596/// (`https://compute.googleapis.com`). Applications using regional
597/// endpoints or running in restricted networks (e.g. a network configured
598// with [Private Google Access with VPC Service Controls]) may want to
599/// override this default.
600/// * [with_credentials()]: by default this client uses
601/// [Application Default Credentials]. Applications using custom
602/// authentication may need to override this default.
603///
604/// [with_endpoint()]: super::builder::backend_buckets::ClientBuilder::with_endpoint
605/// [with_credentials()]: super::builder::backend_buckets::ClientBuilder::credentials
606/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
607/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
608///
609/// # Pooling and Cloning
610///
611/// `BackendBuckets` holds a connection pool internally, it is advised to
612/// create one and the reuse it. You do not need to wrap `BackendBuckets` in
613/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
614/// already uses an `Arc` internally.
615#[cfg(feature = "backend-buckets")]
616#[cfg_attr(docsrs, doc(cfg(feature = "backend-buckets")))]
617#[derive(Clone, Debug)]
618pub struct BackendBuckets {
619 inner: std::sync::Arc<dyn super::stub::dynamic::BackendBuckets>,
620}
621
622#[cfg(feature = "backend-buckets")]
623impl BackendBuckets {
624 /// Returns a builder for [BackendBuckets].
625 ///
626 /// ```
627 /// # tokio_test::block_on(async {
628 /// # use google_cloud_compute_v1::client::BackendBuckets;
629 /// let client = BackendBuckets::builder().build().await?;
630 /// # gax::client_builder::Result::<()>::Ok(()) });
631 /// ```
632 pub fn builder() -> super::builder::backend_buckets::ClientBuilder {
633 gax::client_builder::internal::new_builder(super::builder::backend_buckets::client::Factory)
634 }
635
636 /// Creates a new client from the provided stub.
637 ///
638 /// The most common case for calling this function is in tests mocking the
639 /// client's behavior.
640 pub fn from_stub<T>(stub: T) -> Self
641 where
642 T: super::stub::BackendBuckets + 'static,
643 {
644 Self {
645 inner: std::sync::Arc::new(stub),
646 }
647 }
648
649 pub(crate) async fn new(
650 config: gaxi::options::ClientConfig,
651 ) -> gax::client_builder::Result<Self> {
652 let inner = Self::build_inner(config).await?;
653 Ok(Self { inner })
654 }
655
656 async fn build_inner(
657 conf: gaxi::options::ClientConfig,
658 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::BackendBuckets>> {
659 if gaxi::options::tracing_enabled(&conf) {
660 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
661 }
662 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
663 }
664
665 async fn build_transport(
666 conf: gaxi::options::ClientConfig,
667 ) -> gax::client_builder::Result<impl super::stub::BackendBuckets> {
668 super::transport::BackendBuckets::new(conf).await
669 }
670
671 async fn build_with_tracing(
672 conf: gaxi::options::ClientConfig,
673 ) -> gax::client_builder::Result<impl super::stub::BackendBuckets> {
674 Self::build_transport(conf)
675 .await
676 .map(super::tracing::BackendBuckets::new)
677 }
678
679 /// Adds a key for validating requests with signed URLs for this backend
680 /// bucket.
681 pub fn add_signed_url_key(&self) -> super::builder::backend_buckets::AddSignedUrlKey {
682 super::builder::backend_buckets::AddSignedUrlKey::new(self.inner.clone())
683 }
684
685 /// Deletes the specified BackendBucket resource.
686 pub fn delete(&self) -> super::builder::backend_buckets::Delete {
687 super::builder::backend_buckets::Delete::new(self.inner.clone())
688 }
689
690 /// Deletes a key for validating requests with signed URLs for this backend
691 /// bucket.
692 pub fn delete_signed_url_key(&self) -> super::builder::backend_buckets::DeleteSignedUrlKey {
693 super::builder::backend_buckets::DeleteSignedUrlKey::new(self.inner.clone())
694 }
695
696 /// Returns the specified BackendBucket resource.
697 pub fn get(&self) -> super::builder::backend_buckets::Get {
698 super::builder::backend_buckets::Get::new(self.inner.clone())
699 }
700
701 /// Gets the access control policy for a resource. May be empty if no such
702 /// policy or resource exists.
703 pub fn get_iam_policy(&self) -> super::builder::backend_buckets::GetIamPolicy {
704 super::builder::backend_buckets::GetIamPolicy::new(self.inner.clone())
705 }
706
707 /// Creates a BackendBucket resource in the specified project using
708 /// the data included in the request.
709 pub fn insert(&self) -> super::builder::backend_buckets::Insert {
710 super::builder::backend_buckets::Insert::new(self.inner.clone())
711 }
712
713 /// Retrieves the list of BackendBucket resources available to the specified
714 /// project.
715 pub fn list(&self) -> super::builder::backend_buckets::List {
716 super::builder::backend_buckets::List::new(self.inner.clone())
717 }
718
719 /// Updates the specified BackendBucket resource with the data included in the
720 /// request. This method supportsPATCH
721 /// semantics and uses theJSON merge
722 /// patch format and processing rules.
723 pub fn patch(&self) -> super::builder::backend_buckets::Patch {
724 super::builder::backend_buckets::Patch::new(self.inner.clone())
725 }
726
727 /// Sets the edge security policy for the specified backend bucket.
728 pub fn set_edge_security_policy(
729 &self,
730 ) -> super::builder::backend_buckets::SetEdgeSecurityPolicy {
731 super::builder::backend_buckets::SetEdgeSecurityPolicy::new(self.inner.clone())
732 }
733
734 /// Sets the access control policy on the specified resource.
735 /// Replaces any existing policy.
736 pub fn set_iam_policy(&self) -> super::builder::backend_buckets::SetIamPolicy {
737 super::builder::backend_buckets::SetIamPolicy::new(self.inner.clone())
738 }
739
740 /// Returns permissions that a caller has on the specified resource.
741 pub fn test_iam_permissions(&self) -> super::builder::backend_buckets::TestIamPermissions {
742 super::builder::backend_buckets::TestIamPermissions::new(self.inner.clone())
743 }
744
745 /// Updates the specified BackendBucket resource with the data included in the
746 /// request.
747 pub fn update(&self) -> super::builder::backend_buckets::Update {
748 super::builder::backend_buckets::Update::new(self.inner.clone())
749 }
750
751 /// Retrieves the specified Operations resource.
752 pub fn get_operation(&self) -> super::builder::backend_buckets::GetOperation {
753 super::builder::backend_buckets::GetOperation::new(self.inner.clone())
754 }
755}
756
757/// Implements a client for the Google Compute Engine API.
758///
759/// # Example
760/// ```
761/// # tokio_test::block_on(async {
762/// # use google_cloud_compute_v1::client::BackendServices;
763/// let client = BackendServices::builder().build().await?;
764/// // use `client` to make requests to the Google Compute Engine API.
765/// # gax::client_builder::Result::<()>::Ok(()) });
766/// ```
767///
768/// # Service Description
769///
770/// Service for the `backendServices` resource.
771///
772/// # Configuration
773///
774/// To configure `BackendServices` use the `with_*` methods in the type returned
775/// by [builder()][BackendServices::builder]. The default configuration should
776/// work for most applications. Common configuration changes include
777///
778/// * [with_endpoint()]: by default this client uses the global default endpoint
779/// (`https://compute.googleapis.com`). Applications using regional
780/// endpoints or running in restricted networks (e.g. a network configured
781// with [Private Google Access with VPC Service Controls]) may want to
782/// override this default.
783/// * [with_credentials()]: by default this client uses
784/// [Application Default Credentials]. Applications using custom
785/// authentication may need to override this default.
786///
787/// [with_endpoint()]: super::builder::backend_services::ClientBuilder::with_endpoint
788/// [with_credentials()]: super::builder::backend_services::ClientBuilder::credentials
789/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
790/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
791///
792/// # Pooling and Cloning
793///
794/// `BackendServices` holds a connection pool internally, it is advised to
795/// create one and the reuse it. You do not need to wrap `BackendServices` in
796/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
797/// already uses an `Arc` internally.
798#[cfg(feature = "backend-services")]
799#[cfg_attr(docsrs, doc(cfg(feature = "backend-services")))]
800#[derive(Clone, Debug)]
801pub struct BackendServices {
802 inner: std::sync::Arc<dyn super::stub::dynamic::BackendServices>,
803}
804
805#[cfg(feature = "backend-services")]
806impl BackendServices {
807 /// Returns a builder for [BackendServices].
808 ///
809 /// ```
810 /// # tokio_test::block_on(async {
811 /// # use google_cloud_compute_v1::client::BackendServices;
812 /// let client = BackendServices::builder().build().await?;
813 /// # gax::client_builder::Result::<()>::Ok(()) });
814 /// ```
815 pub fn builder() -> super::builder::backend_services::ClientBuilder {
816 gax::client_builder::internal::new_builder(
817 super::builder::backend_services::client::Factory,
818 )
819 }
820
821 /// Creates a new client from the provided stub.
822 ///
823 /// The most common case for calling this function is in tests mocking the
824 /// client's behavior.
825 pub fn from_stub<T>(stub: T) -> Self
826 where
827 T: super::stub::BackendServices + 'static,
828 {
829 Self {
830 inner: std::sync::Arc::new(stub),
831 }
832 }
833
834 pub(crate) async fn new(
835 config: gaxi::options::ClientConfig,
836 ) -> gax::client_builder::Result<Self> {
837 let inner = Self::build_inner(config).await?;
838 Ok(Self { inner })
839 }
840
841 async fn build_inner(
842 conf: gaxi::options::ClientConfig,
843 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::BackendServices>>
844 {
845 if gaxi::options::tracing_enabled(&conf) {
846 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
847 }
848 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
849 }
850
851 async fn build_transport(
852 conf: gaxi::options::ClientConfig,
853 ) -> gax::client_builder::Result<impl super::stub::BackendServices> {
854 super::transport::BackendServices::new(conf).await
855 }
856
857 async fn build_with_tracing(
858 conf: gaxi::options::ClientConfig,
859 ) -> gax::client_builder::Result<impl super::stub::BackendServices> {
860 Self::build_transport(conf)
861 .await
862 .map(super::tracing::BackendServices::new)
863 }
864
865 /// Adds a key for validating requests with signed URLs for this backend
866 /// service.
867 pub fn add_signed_url_key(&self) -> super::builder::backend_services::AddSignedUrlKey {
868 super::builder::backend_services::AddSignedUrlKey::new(self.inner.clone())
869 }
870
871 /// Retrieves the list of all BackendService resources, regional and global,
872 /// available to the specified project.
873 ///
874 /// To prevent failure, it is recommended that you set the
875 /// `returnPartialSuccess` parameter to `true`.
876 pub fn aggregated_list(&self) -> super::builder::backend_services::AggregatedList {
877 super::builder::backend_services::AggregatedList::new(self.inner.clone())
878 }
879
880 /// Deletes the specified BackendService resource.
881 pub fn delete(&self) -> super::builder::backend_services::Delete {
882 super::builder::backend_services::Delete::new(self.inner.clone())
883 }
884
885 /// Deletes a key for validating requests with signed URLs for this backend
886 /// service.
887 pub fn delete_signed_url_key(&self) -> super::builder::backend_services::DeleteSignedUrlKey {
888 super::builder::backend_services::DeleteSignedUrlKey::new(self.inner.clone())
889 }
890
891 /// Returns the specified BackendService resource.
892 pub fn get(&self) -> super::builder::backend_services::Get {
893 super::builder::backend_services::Get::new(self.inner.clone())
894 }
895
896 /// Returns effective security policies applied to this backend service.
897 pub fn get_effective_security_policies(
898 &self,
899 ) -> super::builder::backend_services::GetEffectiveSecurityPolicies {
900 super::builder::backend_services::GetEffectiveSecurityPolicies::new(self.inner.clone())
901 }
902
903 /// Gets the most recent health check results for this
904 /// BackendService.
905 ///
906 /// Example request body:
907 ///
908 /// {
909 /// "group": "/zones/us-east1-b/instanceGroups/lb-backend-example"
910 /// }
911 pub fn get_health(&self) -> super::builder::backend_services::GetHealth {
912 super::builder::backend_services::GetHealth::new(self.inner.clone())
913 }
914
915 /// Gets the access control policy for a resource. May be empty if no such
916 /// policy or resource exists.
917 pub fn get_iam_policy(&self) -> super::builder::backend_services::GetIamPolicy {
918 super::builder::backend_services::GetIamPolicy::new(self.inner.clone())
919 }
920
921 /// Creates a BackendService resource in the specified project using
922 /// the data included in the request. For more information, see
923 /// Backend services overview.
924 pub fn insert(&self) -> super::builder::backend_services::Insert {
925 super::builder::backend_services::Insert::new(self.inner.clone())
926 }
927
928 /// Retrieves the list of BackendService resources available to the specified
929 /// project.
930 pub fn list(&self) -> super::builder::backend_services::List {
931 super::builder::backend_services::List::new(self.inner.clone())
932 }
933
934 /// Retrieves a list of all usable backend services in the specified project.
935 pub fn list_usable(&self) -> super::builder::backend_services::ListUsable {
936 super::builder::backend_services::ListUsable::new(self.inner.clone())
937 }
938
939 /// Patches the specified BackendService resource with the data included in the
940 /// request. For more information, see
941 /// Backend services overview. This method
942 /// supports PATCH semantics and uses the JSON merge
943 /// patch format and processing rules.
944 pub fn patch(&self) -> super::builder::backend_services::Patch {
945 super::builder::backend_services::Patch::new(self.inner.clone())
946 }
947
948 /// Sets the edge security policy for the specified backend service.
949 pub fn set_edge_security_policy(
950 &self,
951 ) -> super::builder::backend_services::SetEdgeSecurityPolicy {
952 super::builder::backend_services::SetEdgeSecurityPolicy::new(self.inner.clone())
953 }
954
955 /// Sets the access control policy on the specified resource.
956 /// Replaces any existing policy.
957 pub fn set_iam_policy(&self) -> super::builder::backend_services::SetIamPolicy {
958 super::builder::backend_services::SetIamPolicy::new(self.inner.clone())
959 }
960
961 /// Sets the Google Cloud Armor security policy for the specified backend
962 /// service. For more information, seeGoogle
963 /// Cloud Armor Overview
964 pub fn set_security_policy(&self) -> super::builder::backend_services::SetSecurityPolicy {
965 super::builder::backend_services::SetSecurityPolicy::new(self.inner.clone())
966 }
967
968 /// Returns permissions that a caller has on the specified resource.
969 pub fn test_iam_permissions(&self) -> super::builder::backend_services::TestIamPermissions {
970 super::builder::backend_services::TestIamPermissions::new(self.inner.clone())
971 }
972
973 /// Updates the specified BackendService resource with the data included in the
974 /// request. For more information, seeBackend
975 /// services overview.
976 pub fn update(&self) -> super::builder::backend_services::Update {
977 super::builder::backend_services::Update::new(self.inner.clone())
978 }
979
980 /// Retrieves the specified Operations resource.
981 pub fn get_operation(&self) -> super::builder::backend_services::GetOperation {
982 super::builder::backend_services::GetOperation::new(self.inner.clone())
983 }
984}
985
986/// Implements a client for the Google Compute Engine API.
987///
988/// # Example
989/// ```
990/// # tokio_test::block_on(async {
991/// # use google_cloud_compute_v1::client::CrossSiteNetworks;
992/// let client = CrossSiteNetworks::builder().build().await?;
993/// // use `client` to make requests to the Google Compute Engine API.
994/// # gax::client_builder::Result::<()>::Ok(()) });
995/// ```
996///
997/// # Service Description
998///
999/// Service for the `crossSiteNetworks` resource.
1000///
1001/// # Configuration
1002///
1003/// To configure `CrossSiteNetworks` use the `with_*` methods in the type returned
1004/// by [builder()][CrossSiteNetworks::builder]. The default configuration should
1005/// work for most applications. Common configuration changes include
1006///
1007/// * [with_endpoint()]: by default this client uses the global default endpoint
1008/// (`https://compute.googleapis.com`). Applications using regional
1009/// endpoints or running in restricted networks (e.g. a network configured
1010// with [Private Google Access with VPC Service Controls]) may want to
1011/// override this default.
1012/// * [with_credentials()]: by default this client uses
1013/// [Application Default Credentials]. Applications using custom
1014/// authentication may need to override this default.
1015///
1016/// [with_endpoint()]: super::builder::cross_site_networks::ClientBuilder::with_endpoint
1017/// [with_credentials()]: super::builder::cross_site_networks::ClientBuilder::credentials
1018/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1019/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1020///
1021/// # Pooling and Cloning
1022///
1023/// `CrossSiteNetworks` holds a connection pool internally, it is advised to
1024/// create one and the reuse it. You do not need to wrap `CrossSiteNetworks` in
1025/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1026/// already uses an `Arc` internally.
1027#[cfg(feature = "cross-site-networks")]
1028#[cfg_attr(docsrs, doc(cfg(feature = "cross-site-networks")))]
1029#[derive(Clone, Debug)]
1030pub struct CrossSiteNetworks {
1031 inner: std::sync::Arc<dyn super::stub::dynamic::CrossSiteNetworks>,
1032}
1033
1034#[cfg(feature = "cross-site-networks")]
1035impl CrossSiteNetworks {
1036 /// Returns a builder for [CrossSiteNetworks].
1037 ///
1038 /// ```
1039 /// # tokio_test::block_on(async {
1040 /// # use google_cloud_compute_v1::client::CrossSiteNetworks;
1041 /// let client = CrossSiteNetworks::builder().build().await?;
1042 /// # gax::client_builder::Result::<()>::Ok(()) });
1043 /// ```
1044 pub fn builder() -> super::builder::cross_site_networks::ClientBuilder {
1045 gax::client_builder::internal::new_builder(
1046 super::builder::cross_site_networks::client::Factory,
1047 )
1048 }
1049
1050 /// Creates a new client from the provided stub.
1051 ///
1052 /// The most common case for calling this function is in tests mocking the
1053 /// client's behavior.
1054 pub fn from_stub<T>(stub: T) -> Self
1055 where
1056 T: super::stub::CrossSiteNetworks + 'static,
1057 {
1058 Self {
1059 inner: std::sync::Arc::new(stub),
1060 }
1061 }
1062
1063 pub(crate) async fn new(
1064 config: gaxi::options::ClientConfig,
1065 ) -> gax::client_builder::Result<Self> {
1066 let inner = Self::build_inner(config).await?;
1067 Ok(Self { inner })
1068 }
1069
1070 async fn build_inner(
1071 conf: gaxi::options::ClientConfig,
1072 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::CrossSiteNetworks>>
1073 {
1074 if gaxi::options::tracing_enabled(&conf) {
1075 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1076 }
1077 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1078 }
1079
1080 async fn build_transport(
1081 conf: gaxi::options::ClientConfig,
1082 ) -> gax::client_builder::Result<impl super::stub::CrossSiteNetworks> {
1083 super::transport::CrossSiteNetworks::new(conf).await
1084 }
1085
1086 async fn build_with_tracing(
1087 conf: gaxi::options::ClientConfig,
1088 ) -> gax::client_builder::Result<impl super::stub::CrossSiteNetworks> {
1089 Self::build_transport(conf)
1090 .await
1091 .map(super::tracing::CrossSiteNetworks::new)
1092 }
1093
1094 /// Deletes the specified cross-site network in the given scope.
1095 pub fn delete(&self) -> super::builder::cross_site_networks::Delete {
1096 super::builder::cross_site_networks::Delete::new(self.inner.clone())
1097 }
1098
1099 /// Returns the specified cross-site network in the given scope.
1100 pub fn get(&self) -> super::builder::cross_site_networks::Get {
1101 super::builder::cross_site_networks::Get::new(self.inner.clone())
1102 }
1103
1104 /// Creates a cross-site network in the specified project in the given scope
1105 /// using the parameters that are included in the request.
1106 pub fn insert(&self) -> super::builder::cross_site_networks::Insert {
1107 super::builder::cross_site_networks::Insert::new(self.inner.clone())
1108 }
1109
1110 /// Lists the cross-site networks for a project in the given scope.
1111 pub fn list(&self) -> super::builder::cross_site_networks::List {
1112 super::builder::cross_site_networks::List::new(self.inner.clone())
1113 }
1114
1115 /// Updates the specified cross-site network with the data included in
1116 /// the request. This method supportsPATCH
1117 /// semantics and uses theJSON merge
1118 /// patch format and processing rules.
1119 pub fn patch(&self) -> super::builder::cross_site_networks::Patch {
1120 super::builder::cross_site_networks::Patch::new(self.inner.clone())
1121 }
1122
1123 /// Retrieves the specified Operations resource.
1124 pub fn get_operation(&self) -> super::builder::cross_site_networks::GetOperation {
1125 super::builder::cross_site_networks::GetOperation::new(self.inner.clone())
1126 }
1127}
1128
1129/// Implements a client for the Google Compute Engine API.
1130///
1131/// # Example
1132/// ```
1133/// # tokio_test::block_on(async {
1134/// # use google_cloud_compute_v1::client::DiskTypes;
1135/// let client = DiskTypes::builder().build().await?;
1136/// // use `client` to make requests to the Google Compute Engine API.
1137/// # gax::client_builder::Result::<()>::Ok(()) });
1138/// ```
1139///
1140/// # Service Description
1141///
1142/// Service for the `diskTypes` resource.
1143///
1144/// # Configuration
1145///
1146/// To configure `DiskTypes` use the `with_*` methods in the type returned
1147/// by [builder()][DiskTypes::builder]. The default configuration should
1148/// work for most applications. Common configuration changes include
1149///
1150/// * [with_endpoint()]: by default this client uses the global default endpoint
1151/// (`https://compute.googleapis.com`). Applications using regional
1152/// endpoints or running in restricted networks (e.g. a network configured
1153// with [Private Google Access with VPC Service Controls]) may want to
1154/// override this default.
1155/// * [with_credentials()]: by default this client uses
1156/// [Application Default Credentials]. Applications using custom
1157/// authentication may need to override this default.
1158///
1159/// [with_endpoint()]: super::builder::disk_types::ClientBuilder::with_endpoint
1160/// [with_credentials()]: super::builder::disk_types::ClientBuilder::credentials
1161/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1162/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1163///
1164/// # Pooling and Cloning
1165///
1166/// `DiskTypes` holds a connection pool internally, it is advised to
1167/// create one and the reuse it. You do not need to wrap `DiskTypes` in
1168/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1169/// already uses an `Arc` internally.
1170#[cfg(feature = "disk-types")]
1171#[cfg_attr(docsrs, doc(cfg(feature = "disk-types")))]
1172#[derive(Clone, Debug)]
1173pub struct DiskTypes {
1174 inner: std::sync::Arc<dyn super::stub::dynamic::DiskTypes>,
1175}
1176
1177#[cfg(feature = "disk-types")]
1178impl DiskTypes {
1179 /// Returns a builder for [DiskTypes].
1180 ///
1181 /// ```
1182 /// # tokio_test::block_on(async {
1183 /// # use google_cloud_compute_v1::client::DiskTypes;
1184 /// let client = DiskTypes::builder().build().await?;
1185 /// # gax::client_builder::Result::<()>::Ok(()) });
1186 /// ```
1187 pub fn builder() -> super::builder::disk_types::ClientBuilder {
1188 gax::client_builder::internal::new_builder(super::builder::disk_types::client::Factory)
1189 }
1190
1191 /// Creates a new client from the provided stub.
1192 ///
1193 /// The most common case for calling this function is in tests mocking the
1194 /// client's behavior.
1195 pub fn from_stub<T>(stub: T) -> Self
1196 where
1197 T: super::stub::DiskTypes + 'static,
1198 {
1199 Self {
1200 inner: std::sync::Arc::new(stub),
1201 }
1202 }
1203
1204 pub(crate) async fn new(
1205 config: gaxi::options::ClientConfig,
1206 ) -> gax::client_builder::Result<Self> {
1207 let inner = Self::build_inner(config).await?;
1208 Ok(Self { inner })
1209 }
1210
1211 async fn build_inner(
1212 conf: gaxi::options::ClientConfig,
1213 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::DiskTypes>> {
1214 if gaxi::options::tracing_enabled(&conf) {
1215 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1216 }
1217 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1218 }
1219
1220 async fn build_transport(
1221 conf: gaxi::options::ClientConfig,
1222 ) -> gax::client_builder::Result<impl super::stub::DiskTypes> {
1223 super::transport::DiskTypes::new(conf).await
1224 }
1225
1226 async fn build_with_tracing(
1227 conf: gaxi::options::ClientConfig,
1228 ) -> gax::client_builder::Result<impl super::stub::DiskTypes> {
1229 Self::build_transport(conf)
1230 .await
1231 .map(super::tracing::DiskTypes::new)
1232 }
1233
1234 /// Retrieves an aggregated list of disk types.
1235 ///
1236 /// To prevent failure, it is recommended that you set the
1237 /// `returnPartialSuccess` parameter to `true`.
1238 pub fn aggregated_list(&self) -> super::builder::disk_types::AggregatedList {
1239 super::builder::disk_types::AggregatedList::new(self.inner.clone())
1240 }
1241
1242 /// Returns the specified disk type.
1243 pub fn get(&self) -> super::builder::disk_types::Get {
1244 super::builder::disk_types::Get::new(self.inner.clone())
1245 }
1246
1247 /// Retrieves a list of disk types available to the specified
1248 /// project.
1249 pub fn list(&self) -> super::builder::disk_types::List {
1250 super::builder::disk_types::List::new(self.inner.clone())
1251 }
1252}
1253
1254/// Implements a client for the Google Compute Engine API.
1255///
1256/// # Example
1257/// ```
1258/// # tokio_test::block_on(async {
1259/// # use google_cloud_compute_v1::client::Disks;
1260/// let client = Disks::builder().build().await?;
1261/// // use `client` to make requests to the Google Compute Engine API.
1262/// # gax::client_builder::Result::<()>::Ok(()) });
1263/// ```
1264///
1265/// # Service Description
1266///
1267/// Service for the `disks` resource.
1268///
1269/// # Configuration
1270///
1271/// To configure `Disks` use the `with_*` methods in the type returned
1272/// by [builder()][Disks::builder]. The default configuration should
1273/// work for most applications. Common configuration changes include
1274///
1275/// * [with_endpoint()]: by default this client uses the global default endpoint
1276/// (`https://compute.googleapis.com`). Applications using regional
1277/// endpoints or running in restricted networks (e.g. a network configured
1278// with [Private Google Access with VPC Service Controls]) may want to
1279/// override this default.
1280/// * [with_credentials()]: by default this client uses
1281/// [Application Default Credentials]. Applications using custom
1282/// authentication may need to override this default.
1283///
1284/// [with_endpoint()]: super::builder::disks::ClientBuilder::with_endpoint
1285/// [with_credentials()]: super::builder::disks::ClientBuilder::credentials
1286/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1287/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1288///
1289/// # Pooling and Cloning
1290///
1291/// `Disks` holds a connection pool internally, it is advised to
1292/// create one and the reuse it. You do not need to wrap `Disks` in
1293/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1294/// already uses an `Arc` internally.
1295#[cfg(feature = "disks")]
1296#[cfg_attr(docsrs, doc(cfg(feature = "disks")))]
1297#[derive(Clone, Debug)]
1298pub struct Disks {
1299 inner: std::sync::Arc<dyn super::stub::dynamic::Disks>,
1300}
1301
1302#[cfg(feature = "disks")]
1303impl Disks {
1304 /// Returns a builder for [Disks].
1305 ///
1306 /// ```
1307 /// # tokio_test::block_on(async {
1308 /// # use google_cloud_compute_v1::client::Disks;
1309 /// let client = Disks::builder().build().await?;
1310 /// # gax::client_builder::Result::<()>::Ok(()) });
1311 /// ```
1312 pub fn builder() -> super::builder::disks::ClientBuilder {
1313 gax::client_builder::internal::new_builder(super::builder::disks::client::Factory)
1314 }
1315
1316 /// Creates a new client from the provided stub.
1317 ///
1318 /// The most common case for calling this function is in tests mocking the
1319 /// client's behavior.
1320 pub fn from_stub<T>(stub: T) -> Self
1321 where
1322 T: super::stub::Disks + 'static,
1323 {
1324 Self {
1325 inner: std::sync::Arc::new(stub),
1326 }
1327 }
1328
1329 pub(crate) async fn new(
1330 config: gaxi::options::ClientConfig,
1331 ) -> gax::client_builder::Result<Self> {
1332 let inner = Self::build_inner(config).await?;
1333 Ok(Self { inner })
1334 }
1335
1336 async fn build_inner(
1337 conf: gaxi::options::ClientConfig,
1338 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Disks>> {
1339 if gaxi::options::tracing_enabled(&conf) {
1340 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1341 }
1342 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1343 }
1344
1345 async fn build_transport(
1346 conf: gaxi::options::ClientConfig,
1347 ) -> gax::client_builder::Result<impl super::stub::Disks> {
1348 super::transport::Disks::new(conf).await
1349 }
1350
1351 async fn build_with_tracing(
1352 conf: gaxi::options::ClientConfig,
1353 ) -> gax::client_builder::Result<impl super::stub::Disks> {
1354 Self::build_transport(conf)
1355 .await
1356 .map(super::tracing::Disks::new)
1357 }
1358
1359 /// Adds existing resource policies to a disk. You can only add one
1360 /// policy which will be applied to this disk for scheduling snapshot
1361 /// creation.
1362 pub fn add_resource_policies(&self) -> super::builder::disks::AddResourcePolicies {
1363 super::builder::disks::AddResourcePolicies::new(self.inner.clone())
1364 }
1365
1366 /// Retrieves an aggregated list of persistent disks.
1367 ///
1368 /// To prevent failure, it is recommended that you set the
1369 /// `returnPartialSuccess` parameter to `true`.
1370 pub fn aggregated_list(&self) -> super::builder::disks::AggregatedList {
1371 super::builder::disks::AggregatedList::new(self.inner.clone())
1372 }
1373
1374 /// Bulk create a set of disks.
1375 pub fn bulk_insert(&self) -> super::builder::disks::BulkInsert {
1376 super::builder::disks::BulkInsert::new(self.inner.clone())
1377 }
1378
1379 /// Sets the labels on many disks at once. To learn more about labels, read theLabeling
1380 /// Resources documentation.
1381 pub fn bulk_set_labels(&self) -> super::builder::disks::BulkSetLabels {
1382 super::builder::disks::BulkSetLabels::new(self.inner.clone())
1383 }
1384
1385 /// Creates a snapshot of a specified persistent disk. For regular snapshot
1386 /// creation, consider using snapshots.insert
1387 /// instead, as that method supports more features, such as creating snapshots
1388 /// in a project different from the source disk project.
1389 pub fn create_snapshot(&self) -> super::builder::disks::CreateSnapshot {
1390 super::builder::disks::CreateSnapshot::new(self.inner.clone())
1391 }
1392
1393 /// Deletes the specified persistent disk. Deleting a disk removes its data
1394 /// permanently and is irreversible. However, deleting a disk does not
1395 /// delete any snapshots
1396 /// previously made from the disk. You must separatelydelete
1397 /// snapshots.
1398 pub fn delete(&self) -> super::builder::disks::Delete {
1399 super::builder::disks::Delete::new(self.inner.clone())
1400 }
1401
1402 /// Returns the specified persistent disk.
1403 pub fn get(&self) -> super::builder::disks::Get {
1404 super::builder::disks::Get::new(self.inner.clone())
1405 }
1406
1407 /// Gets the access control policy for a resource. May be empty if no such
1408 /// policy or resource exists.
1409 pub fn get_iam_policy(&self) -> super::builder::disks::GetIamPolicy {
1410 super::builder::disks::GetIamPolicy::new(self.inner.clone())
1411 }
1412
1413 /// Creates a persistent disk in the specified project using the data
1414 /// in the request. You can create a disk from a source
1415 /// (sourceImage, sourceSnapshot, orsourceDisk) or create an empty 500 GB data disk by
1416 /// omitting all properties. You can also create a disk that is larger than
1417 /// the default size by specifying the sizeGb property.
1418 pub fn insert(&self) -> super::builder::disks::Insert {
1419 super::builder::disks::Insert::new(self.inner.clone())
1420 }
1421
1422 /// Retrieves a list of persistent disks contained within
1423 /// the specified zone.
1424 pub fn list(&self) -> super::builder::disks::List {
1425 super::builder::disks::List::new(self.inner.clone())
1426 }
1427
1428 /// Removes resource policies from a disk.
1429 pub fn remove_resource_policies(&self) -> super::builder::disks::RemoveResourcePolicies {
1430 super::builder::disks::RemoveResourcePolicies::new(self.inner.clone())
1431 }
1432
1433 /// Resizes the specified persistent disk.
1434 /// You can only increase the size of the disk.
1435 pub fn resize(&self) -> super::builder::disks::Resize {
1436 super::builder::disks::Resize::new(self.inner.clone())
1437 }
1438
1439 /// Sets the access control policy on the specified resource.
1440 /// Replaces any existing policy.
1441 pub fn set_iam_policy(&self) -> super::builder::disks::SetIamPolicy {
1442 super::builder::disks::SetIamPolicy::new(self.inner.clone())
1443 }
1444
1445 /// Sets the labels on a disk. To learn more about labels, read theLabeling
1446 /// Resources documentation.
1447 pub fn set_labels(&self) -> super::builder::disks::SetLabels {
1448 super::builder::disks::SetLabels::new(self.inner.clone())
1449 }
1450
1451 /// Starts asynchronous replication.
1452 /// Must be invoked on the primary disk.
1453 pub fn start_async_replication(&self) -> super::builder::disks::StartAsyncReplication {
1454 super::builder::disks::StartAsyncReplication::new(self.inner.clone())
1455 }
1456
1457 /// Stops asynchronous replication.
1458 /// Can be invoked either on the primary or on the secondary disk.
1459 pub fn stop_async_replication(&self) -> super::builder::disks::StopAsyncReplication {
1460 super::builder::disks::StopAsyncReplication::new(self.inner.clone())
1461 }
1462
1463 /// Stops asynchronous replication for a consistency group of disks.
1464 /// Can be invoked either in the primary or secondary scope.
1465 pub fn stop_group_async_replication(&self) -> super::builder::disks::StopGroupAsyncReplication {
1466 super::builder::disks::StopGroupAsyncReplication::new(self.inner.clone())
1467 }
1468
1469 /// Returns permissions that a caller has on the specified resource.
1470 pub fn test_iam_permissions(&self) -> super::builder::disks::TestIamPermissions {
1471 super::builder::disks::TestIamPermissions::new(self.inner.clone())
1472 }
1473
1474 /// Updates the specified disk with the data included in the request.
1475 /// The update is performed only on selected fields included as part
1476 /// of update-mask. Only the following fields can be modified: user_license.
1477 pub fn update(&self) -> super::builder::disks::Update {
1478 super::builder::disks::Update::new(self.inner.clone())
1479 }
1480
1481 /// Retrieves the specified zone-specific Operations resource.
1482 pub fn get_operation(&self) -> super::builder::disks::GetOperation {
1483 super::builder::disks::GetOperation::new(self.inner.clone())
1484 }
1485}
1486
1487/// Implements a client for the Google Compute Engine API.
1488///
1489/// # Example
1490/// ```
1491/// # tokio_test::block_on(async {
1492/// # use google_cloud_compute_v1::client::ExternalVpnGateways;
1493/// let client = ExternalVpnGateways::builder().build().await?;
1494/// // use `client` to make requests to the Google Compute Engine API.
1495/// # gax::client_builder::Result::<()>::Ok(()) });
1496/// ```
1497///
1498/// # Service Description
1499///
1500/// Service for the `externalVpnGateways` resource.
1501///
1502/// # Configuration
1503///
1504/// To configure `ExternalVpnGateways` use the `with_*` methods in the type returned
1505/// by [builder()][ExternalVpnGateways::builder]. The default configuration should
1506/// work for most applications. Common configuration changes include
1507///
1508/// * [with_endpoint()]: by default this client uses the global default endpoint
1509/// (`https://compute.googleapis.com`). Applications using regional
1510/// endpoints or running in restricted networks (e.g. a network configured
1511// with [Private Google Access with VPC Service Controls]) may want to
1512/// override this default.
1513/// * [with_credentials()]: by default this client uses
1514/// [Application Default Credentials]. Applications using custom
1515/// authentication may need to override this default.
1516///
1517/// [with_endpoint()]: super::builder::external_vpn_gateways::ClientBuilder::with_endpoint
1518/// [with_credentials()]: super::builder::external_vpn_gateways::ClientBuilder::credentials
1519/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1520/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1521///
1522/// # Pooling and Cloning
1523///
1524/// `ExternalVpnGateways` holds a connection pool internally, it is advised to
1525/// create one and the reuse it. You do not need to wrap `ExternalVpnGateways` in
1526/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1527/// already uses an `Arc` internally.
1528#[cfg(feature = "external-vpn-gateways")]
1529#[cfg_attr(docsrs, doc(cfg(feature = "external-vpn-gateways")))]
1530#[derive(Clone, Debug)]
1531pub struct ExternalVpnGateways {
1532 inner: std::sync::Arc<dyn super::stub::dynamic::ExternalVpnGateways>,
1533}
1534
1535#[cfg(feature = "external-vpn-gateways")]
1536impl ExternalVpnGateways {
1537 /// Returns a builder for [ExternalVpnGateways].
1538 ///
1539 /// ```
1540 /// # tokio_test::block_on(async {
1541 /// # use google_cloud_compute_v1::client::ExternalVpnGateways;
1542 /// let client = ExternalVpnGateways::builder().build().await?;
1543 /// # gax::client_builder::Result::<()>::Ok(()) });
1544 /// ```
1545 pub fn builder() -> super::builder::external_vpn_gateways::ClientBuilder {
1546 gax::client_builder::internal::new_builder(
1547 super::builder::external_vpn_gateways::client::Factory,
1548 )
1549 }
1550
1551 /// Creates a new client from the provided stub.
1552 ///
1553 /// The most common case for calling this function is in tests mocking the
1554 /// client's behavior.
1555 pub fn from_stub<T>(stub: T) -> Self
1556 where
1557 T: super::stub::ExternalVpnGateways + 'static,
1558 {
1559 Self {
1560 inner: std::sync::Arc::new(stub),
1561 }
1562 }
1563
1564 pub(crate) async fn new(
1565 config: gaxi::options::ClientConfig,
1566 ) -> gax::client_builder::Result<Self> {
1567 let inner = Self::build_inner(config).await?;
1568 Ok(Self { inner })
1569 }
1570
1571 async fn build_inner(
1572 conf: gaxi::options::ClientConfig,
1573 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::ExternalVpnGateways>>
1574 {
1575 if gaxi::options::tracing_enabled(&conf) {
1576 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1577 }
1578 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1579 }
1580
1581 async fn build_transport(
1582 conf: gaxi::options::ClientConfig,
1583 ) -> gax::client_builder::Result<impl super::stub::ExternalVpnGateways> {
1584 super::transport::ExternalVpnGateways::new(conf).await
1585 }
1586
1587 async fn build_with_tracing(
1588 conf: gaxi::options::ClientConfig,
1589 ) -> gax::client_builder::Result<impl super::stub::ExternalVpnGateways> {
1590 Self::build_transport(conf)
1591 .await
1592 .map(super::tracing::ExternalVpnGateways::new)
1593 }
1594
1595 /// Deletes the specified externalVpnGateway.
1596 pub fn delete(&self) -> super::builder::external_vpn_gateways::Delete {
1597 super::builder::external_vpn_gateways::Delete::new(self.inner.clone())
1598 }
1599
1600 /// Returns the specified externalVpnGateway. Get a list of available
1601 /// externalVpnGateways by making a list() request.
1602 pub fn get(&self) -> super::builder::external_vpn_gateways::Get {
1603 super::builder::external_vpn_gateways::Get::new(self.inner.clone())
1604 }
1605
1606 /// Creates a ExternalVpnGateway in the specified project using
1607 /// the data included in the request.
1608 pub fn insert(&self) -> super::builder::external_vpn_gateways::Insert {
1609 super::builder::external_vpn_gateways::Insert::new(self.inner.clone())
1610 }
1611
1612 /// Retrieves the list of ExternalVpnGateway available to the specified
1613 /// project.
1614 pub fn list(&self) -> super::builder::external_vpn_gateways::List {
1615 super::builder::external_vpn_gateways::List::new(self.inner.clone())
1616 }
1617
1618 /// Sets the labels on an ExternalVpnGateway. To learn more about labels,
1619 /// read the Labeling
1620 /// Resources documentation.
1621 pub fn set_labels(&self) -> super::builder::external_vpn_gateways::SetLabels {
1622 super::builder::external_vpn_gateways::SetLabels::new(self.inner.clone())
1623 }
1624
1625 /// Returns permissions that a caller has on the specified resource.
1626 pub fn test_iam_permissions(
1627 &self,
1628 ) -> super::builder::external_vpn_gateways::TestIamPermissions {
1629 super::builder::external_vpn_gateways::TestIamPermissions::new(self.inner.clone())
1630 }
1631
1632 /// Retrieves the specified Operations resource.
1633 pub fn get_operation(&self) -> super::builder::external_vpn_gateways::GetOperation {
1634 super::builder::external_vpn_gateways::GetOperation::new(self.inner.clone())
1635 }
1636}
1637
1638/// Implements a client for the Google Compute Engine API.
1639///
1640/// # Example
1641/// ```
1642/// # tokio_test::block_on(async {
1643/// # use google_cloud_compute_v1::client::FirewallPolicies;
1644/// let client = FirewallPolicies::builder().build().await?;
1645/// // use `client` to make requests to the Google Compute Engine API.
1646/// # gax::client_builder::Result::<()>::Ok(()) });
1647/// ```
1648///
1649/// # Service Description
1650///
1651/// Service for the `firewallPolicies` resource.
1652///
1653/// # Configuration
1654///
1655/// To configure `FirewallPolicies` use the `with_*` methods in the type returned
1656/// by [builder()][FirewallPolicies::builder]. The default configuration should
1657/// work for most applications. Common configuration changes include
1658///
1659/// * [with_endpoint()]: by default this client uses the global default endpoint
1660/// (`https://compute.googleapis.com`). Applications using regional
1661/// endpoints or running in restricted networks (e.g. a network configured
1662// with [Private Google Access with VPC Service Controls]) may want to
1663/// override this default.
1664/// * [with_credentials()]: by default this client uses
1665/// [Application Default Credentials]. Applications using custom
1666/// authentication may need to override this default.
1667///
1668/// [with_endpoint()]: super::builder::firewall_policies::ClientBuilder::with_endpoint
1669/// [with_credentials()]: super::builder::firewall_policies::ClientBuilder::credentials
1670/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1671/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1672///
1673/// # Pooling and Cloning
1674///
1675/// `FirewallPolicies` holds a connection pool internally, it is advised to
1676/// create one and the reuse it. You do not need to wrap `FirewallPolicies` in
1677/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1678/// already uses an `Arc` internally.
1679#[cfg(feature = "firewall-policies")]
1680#[cfg_attr(docsrs, doc(cfg(feature = "firewall-policies")))]
1681#[derive(Clone, Debug)]
1682pub struct FirewallPolicies {
1683 inner: std::sync::Arc<dyn super::stub::dynamic::FirewallPolicies>,
1684}
1685
1686#[cfg(feature = "firewall-policies")]
1687impl FirewallPolicies {
1688 /// Returns a builder for [FirewallPolicies].
1689 ///
1690 /// ```
1691 /// # tokio_test::block_on(async {
1692 /// # use google_cloud_compute_v1::client::FirewallPolicies;
1693 /// let client = FirewallPolicies::builder().build().await?;
1694 /// # gax::client_builder::Result::<()>::Ok(()) });
1695 /// ```
1696 pub fn builder() -> super::builder::firewall_policies::ClientBuilder {
1697 gax::client_builder::internal::new_builder(
1698 super::builder::firewall_policies::client::Factory,
1699 )
1700 }
1701
1702 /// Creates a new client from the provided stub.
1703 ///
1704 /// The most common case for calling this function is in tests mocking the
1705 /// client's behavior.
1706 pub fn from_stub<T>(stub: T) -> Self
1707 where
1708 T: super::stub::FirewallPolicies + 'static,
1709 {
1710 Self {
1711 inner: std::sync::Arc::new(stub),
1712 }
1713 }
1714
1715 pub(crate) async fn new(
1716 config: gaxi::options::ClientConfig,
1717 ) -> gax::client_builder::Result<Self> {
1718 let inner = Self::build_inner(config).await?;
1719 Ok(Self { inner })
1720 }
1721
1722 async fn build_inner(
1723 conf: gaxi::options::ClientConfig,
1724 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::FirewallPolicies>>
1725 {
1726 if gaxi::options::tracing_enabled(&conf) {
1727 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1728 }
1729 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1730 }
1731
1732 async fn build_transport(
1733 conf: gaxi::options::ClientConfig,
1734 ) -> gax::client_builder::Result<impl super::stub::FirewallPolicies> {
1735 super::transport::FirewallPolicies::new(conf).await
1736 }
1737
1738 async fn build_with_tracing(
1739 conf: gaxi::options::ClientConfig,
1740 ) -> gax::client_builder::Result<impl super::stub::FirewallPolicies> {
1741 Self::build_transport(conf)
1742 .await
1743 .map(super::tracing::FirewallPolicies::new)
1744 }
1745
1746 /// Inserts an association for the specified firewall policy.
1747 pub fn add_association(&self) -> super::builder::firewall_policies::AddAssociation {
1748 super::builder::firewall_policies::AddAssociation::new(self.inner.clone())
1749 }
1750
1751 /// Inserts a rule into a firewall policy.
1752 pub fn add_rule(&self) -> super::builder::firewall_policies::AddRule {
1753 super::builder::firewall_policies::AddRule::new(self.inner.clone())
1754 }
1755
1756 /// Copies rules to the specified firewall policy.
1757 pub fn clone_rules(&self) -> super::builder::firewall_policies::CloneRules {
1758 super::builder::firewall_policies::CloneRules::new(self.inner.clone())
1759 }
1760
1761 /// Deletes the specified policy.
1762 pub fn delete(&self) -> super::builder::firewall_policies::Delete {
1763 super::builder::firewall_policies::Delete::new(self.inner.clone())
1764 }
1765
1766 /// Returns the specified firewall policy.
1767 pub fn get(&self) -> super::builder::firewall_policies::Get {
1768 super::builder::firewall_policies::Get::new(self.inner.clone())
1769 }
1770
1771 /// Gets an association with the specified name.
1772 pub fn get_association(&self) -> super::builder::firewall_policies::GetAssociation {
1773 super::builder::firewall_policies::GetAssociation::new(self.inner.clone())
1774 }
1775
1776 /// Gets the access control policy for a resource. May be empty if no such
1777 /// policy or resource exists.
1778 pub fn get_iam_policy(&self) -> super::builder::firewall_policies::GetIamPolicy {
1779 super::builder::firewall_policies::GetIamPolicy::new(self.inner.clone())
1780 }
1781
1782 /// Gets a rule of the specified priority.
1783 pub fn get_rule(&self) -> super::builder::firewall_policies::GetRule {
1784 super::builder::firewall_policies::GetRule::new(self.inner.clone())
1785 }
1786
1787 /// Creates a new policy in the specified project using the data included in
1788 /// the request.
1789 pub fn insert(&self) -> super::builder::firewall_policies::Insert {
1790 super::builder::firewall_policies::Insert::new(self.inner.clone())
1791 }
1792
1793 /// Lists all the policies that have been configured for the specified
1794 /// folder or organization.
1795 pub fn list(&self) -> super::builder::firewall_policies::List {
1796 super::builder::firewall_policies::List::new(self.inner.clone())
1797 }
1798
1799 /// Lists associations of a specified target, i.e., organization or folder.
1800 pub fn list_associations(&self) -> super::builder::firewall_policies::ListAssociations {
1801 super::builder::firewall_policies::ListAssociations::new(self.inner.clone())
1802 }
1803
1804 /// Moves the specified firewall policy.
1805 pub fn r#move(&self) -> super::builder::firewall_policies::Move {
1806 super::builder::firewall_policies::Move::new(self.inner.clone())
1807 }
1808
1809 /// Patches the specified policy with the data included in the request.
1810 pub fn patch(&self) -> super::builder::firewall_policies::Patch {
1811 super::builder::firewall_policies::Patch::new(self.inner.clone())
1812 }
1813
1814 /// Patches a rule of the specified priority.
1815 pub fn patch_rule(&self) -> super::builder::firewall_policies::PatchRule {
1816 super::builder::firewall_policies::PatchRule::new(self.inner.clone())
1817 }
1818
1819 /// Removes an association for the specified firewall policy.
1820 pub fn remove_association(&self) -> super::builder::firewall_policies::RemoveAssociation {
1821 super::builder::firewall_policies::RemoveAssociation::new(self.inner.clone())
1822 }
1823
1824 /// Deletes a rule of the specified priority.
1825 pub fn remove_rule(&self) -> super::builder::firewall_policies::RemoveRule {
1826 super::builder::firewall_policies::RemoveRule::new(self.inner.clone())
1827 }
1828
1829 /// Sets the access control policy on the specified resource.
1830 /// Replaces any existing policy.
1831 pub fn set_iam_policy(&self) -> super::builder::firewall_policies::SetIamPolicy {
1832 super::builder::firewall_policies::SetIamPolicy::new(self.inner.clone())
1833 }
1834
1835 /// Returns permissions that a caller has on the specified resource.
1836 pub fn test_iam_permissions(&self) -> super::builder::firewall_policies::TestIamPermissions {
1837 super::builder::firewall_policies::TestIamPermissions::new(self.inner.clone())
1838 }
1839
1840 /// Retrieves the specified Operations resource. Gets a list of operations
1841 /// by making a `list()` request.
1842 pub fn get_operation(&self) -> super::builder::firewall_policies::GetOperation {
1843 super::builder::firewall_policies::GetOperation::new(self.inner.clone())
1844 }
1845}
1846
1847/// Implements a client for the Google Compute Engine API.
1848///
1849/// # Example
1850/// ```
1851/// # tokio_test::block_on(async {
1852/// # use google_cloud_compute_v1::client::Firewalls;
1853/// let client = Firewalls::builder().build().await?;
1854/// // use `client` to make requests to the Google Compute Engine API.
1855/// # gax::client_builder::Result::<()>::Ok(()) });
1856/// ```
1857///
1858/// # Service Description
1859///
1860/// Service for the `firewalls` resource.
1861///
1862/// # Configuration
1863///
1864/// To configure `Firewalls` use the `with_*` methods in the type returned
1865/// by [builder()][Firewalls::builder]. The default configuration should
1866/// work for most applications. Common configuration changes include
1867///
1868/// * [with_endpoint()]: by default this client uses the global default endpoint
1869/// (`https://compute.googleapis.com`). Applications using regional
1870/// endpoints or running in restricted networks (e.g. a network configured
1871// with [Private Google Access with VPC Service Controls]) may want to
1872/// override this default.
1873/// * [with_credentials()]: by default this client uses
1874/// [Application Default Credentials]. Applications using custom
1875/// authentication may need to override this default.
1876///
1877/// [with_endpoint()]: super::builder::firewalls::ClientBuilder::with_endpoint
1878/// [with_credentials()]: super::builder::firewalls::ClientBuilder::credentials
1879/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1880/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1881///
1882/// # Pooling and Cloning
1883///
1884/// `Firewalls` holds a connection pool internally, it is advised to
1885/// create one and the reuse it. You do not need to wrap `Firewalls` in
1886/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1887/// already uses an `Arc` internally.
1888#[cfg(feature = "firewalls")]
1889#[cfg_attr(docsrs, doc(cfg(feature = "firewalls")))]
1890#[derive(Clone, Debug)]
1891pub struct Firewalls {
1892 inner: std::sync::Arc<dyn super::stub::dynamic::Firewalls>,
1893}
1894
1895#[cfg(feature = "firewalls")]
1896impl Firewalls {
1897 /// Returns a builder for [Firewalls].
1898 ///
1899 /// ```
1900 /// # tokio_test::block_on(async {
1901 /// # use google_cloud_compute_v1::client::Firewalls;
1902 /// let client = Firewalls::builder().build().await?;
1903 /// # gax::client_builder::Result::<()>::Ok(()) });
1904 /// ```
1905 pub fn builder() -> super::builder::firewalls::ClientBuilder {
1906 gax::client_builder::internal::new_builder(super::builder::firewalls::client::Factory)
1907 }
1908
1909 /// Creates a new client from the provided stub.
1910 ///
1911 /// The most common case for calling this function is in tests mocking the
1912 /// client's behavior.
1913 pub fn from_stub<T>(stub: T) -> Self
1914 where
1915 T: super::stub::Firewalls + 'static,
1916 {
1917 Self {
1918 inner: std::sync::Arc::new(stub),
1919 }
1920 }
1921
1922 pub(crate) async fn new(
1923 config: gaxi::options::ClientConfig,
1924 ) -> gax::client_builder::Result<Self> {
1925 let inner = Self::build_inner(config).await?;
1926 Ok(Self { inner })
1927 }
1928
1929 async fn build_inner(
1930 conf: gaxi::options::ClientConfig,
1931 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Firewalls>> {
1932 if gaxi::options::tracing_enabled(&conf) {
1933 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1934 }
1935 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1936 }
1937
1938 async fn build_transport(
1939 conf: gaxi::options::ClientConfig,
1940 ) -> gax::client_builder::Result<impl super::stub::Firewalls> {
1941 super::transport::Firewalls::new(conf).await
1942 }
1943
1944 async fn build_with_tracing(
1945 conf: gaxi::options::ClientConfig,
1946 ) -> gax::client_builder::Result<impl super::stub::Firewalls> {
1947 Self::build_transport(conf)
1948 .await
1949 .map(super::tracing::Firewalls::new)
1950 }
1951
1952 /// Deletes the specified firewall.
1953 pub fn delete(&self) -> super::builder::firewalls::Delete {
1954 super::builder::firewalls::Delete::new(self.inner.clone())
1955 }
1956
1957 /// Returns the specified firewall.
1958 pub fn get(&self) -> super::builder::firewalls::Get {
1959 super::builder::firewalls::Get::new(self.inner.clone())
1960 }
1961
1962 /// Creates a firewall rule in the specified project using the data
1963 /// included in the request.
1964 pub fn insert(&self) -> super::builder::firewalls::Insert {
1965 super::builder::firewalls::Insert::new(self.inner.clone())
1966 }
1967
1968 /// Retrieves the list of firewall rules available to the specified
1969 /// project.
1970 pub fn list(&self) -> super::builder::firewalls::List {
1971 super::builder::firewalls::List::new(self.inner.clone())
1972 }
1973
1974 /// Updates the specified firewall rule with the data included in the
1975 /// request. This method supportsPATCH
1976 /// semantics and uses theJSON merge
1977 /// patch format and processing rules.
1978 pub fn patch(&self) -> super::builder::firewalls::Patch {
1979 super::builder::firewalls::Patch::new(self.inner.clone())
1980 }
1981
1982 /// Returns permissions that a caller has on the specified resource.
1983 pub fn test_iam_permissions(&self) -> super::builder::firewalls::TestIamPermissions {
1984 super::builder::firewalls::TestIamPermissions::new(self.inner.clone())
1985 }
1986
1987 /// Updates the specified firewall rule with the data included in the
1988 /// request.
1989 /// Note that all fields will be updated if using PUT, even fields that are not
1990 /// specified. To update individual fields, please use PATCH instead.
1991 pub fn update(&self) -> super::builder::firewalls::Update {
1992 super::builder::firewalls::Update::new(self.inner.clone())
1993 }
1994
1995 /// Retrieves the specified Operations resource.
1996 pub fn get_operation(&self) -> super::builder::firewalls::GetOperation {
1997 super::builder::firewalls::GetOperation::new(self.inner.clone())
1998 }
1999}
2000
2001/// Implements a client for the Google Compute Engine API.
2002///
2003/// # Example
2004/// ```
2005/// # tokio_test::block_on(async {
2006/// # use google_cloud_compute_v1::client::ForwardingRules;
2007/// let client = ForwardingRules::builder().build().await?;
2008/// // use `client` to make requests to the Google Compute Engine API.
2009/// # gax::client_builder::Result::<()>::Ok(()) });
2010/// ```
2011///
2012/// # Service Description
2013///
2014/// Service for the `forwardingRules` resource.
2015///
2016/// # Configuration
2017///
2018/// To configure `ForwardingRules` use the `with_*` methods in the type returned
2019/// by [builder()][ForwardingRules::builder]. The default configuration should
2020/// work for most applications. Common configuration changes include
2021///
2022/// * [with_endpoint()]: by default this client uses the global default endpoint
2023/// (`https://compute.googleapis.com`). Applications using regional
2024/// endpoints or running in restricted networks (e.g. a network configured
2025// with [Private Google Access with VPC Service Controls]) may want to
2026/// override this default.
2027/// * [with_credentials()]: by default this client uses
2028/// [Application Default Credentials]. Applications using custom
2029/// authentication may need to override this default.
2030///
2031/// [with_endpoint()]: super::builder::forwarding_rules::ClientBuilder::with_endpoint
2032/// [with_credentials()]: super::builder::forwarding_rules::ClientBuilder::credentials
2033/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2034/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2035///
2036/// # Pooling and Cloning
2037///
2038/// `ForwardingRules` holds a connection pool internally, it is advised to
2039/// create one and the reuse it. You do not need to wrap `ForwardingRules` in
2040/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2041/// already uses an `Arc` internally.
2042#[cfg(feature = "forwarding-rules")]
2043#[cfg_attr(docsrs, doc(cfg(feature = "forwarding-rules")))]
2044#[derive(Clone, Debug)]
2045pub struct ForwardingRules {
2046 inner: std::sync::Arc<dyn super::stub::dynamic::ForwardingRules>,
2047}
2048
2049#[cfg(feature = "forwarding-rules")]
2050impl ForwardingRules {
2051 /// Returns a builder for [ForwardingRules].
2052 ///
2053 /// ```
2054 /// # tokio_test::block_on(async {
2055 /// # use google_cloud_compute_v1::client::ForwardingRules;
2056 /// let client = ForwardingRules::builder().build().await?;
2057 /// # gax::client_builder::Result::<()>::Ok(()) });
2058 /// ```
2059 pub fn builder() -> super::builder::forwarding_rules::ClientBuilder {
2060 gax::client_builder::internal::new_builder(
2061 super::builder::forwarding_rules::client::Factory,
2062 )
2063 }
2064
2065 /// Creates a new client from the provided stub.
2066 ///
2067 /// The most common case for calling this function is in tests mocking the
2068 /// client's behavior.
2069 pub fn from_stub<T>(stub: T) -> Self
2070 where
2071 T: super::stub::ForwardingRules + 'static,
2072 {
2073 Self {
2074 inner: std::sync::Arc::new(stub),
2075 }
2076 }
2077
2078 pub(crate) async fn new(
2079 config: gaxi::options::ClientConfig,
2080 ) -> gax::client_builder::Result<Self> {
2081 let inner = Self::build_inner(config).await?;
2082 Ok(Self { inner })
2083 }
2084
2085 async fn build_inner(
2086 conf: gaxi::options::ClientConfig,
2087 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::ForwardingRules>>
2088 {
2089 if gaxi::options::tracing_enabled(&conf) {
2090 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2091 }
2092 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2093 }
2094
2095 async fn build_transport(
2096 conf: gaxi::options::ClientConfig,
2097 ) -> gax::client_builder::Result<impl super::stub::ForwardingRules> {
2098 super::transport::ForwardingRules::new(conf).await
2099 }
2100
2101 async fn build_with_tracing(
2102 conf: gaxi::options::ClientConfig,
2103 ) -> gax::client_builder::Result<impl super::stub::ForwardingRules> {
2104 Self::build_transport(conf)
2105 .await
2106 .map(super::tracing::ForwardingRules::new)
2107 }
2108
2109 /// Retrieves an aggregated list of forwarding rules.
2110 ///
2111 /// To prevent failure, it is recommended that you set the
2112 /// `returnPartialSuccess` parameter to `true`.
2113 pub fn aggregated_list(&self) -> super::builder::forwarding_rules::AggregatedList {
2114 super::builder::forwarding_rules::AggregatedList::new(self.inner.clone())
2115 }
2116
2117 /// Deletes the specified ForwardingRule resource.
2118 pub fn delete(&self) -> super::builder::forwarding_rules::Delete {
2119 super::builder::forwarding_rules::Delete::new(self.inner.clone())
2120 }
2121
2122 /// Returns the specified ForwardingRule resource.
2123 pub fn get(&self) -> super::builder::forwarding_rules::Get {
2124 super::builder::forwarding_rules::Get::new(self.inner.clone())
2125 }
2126
2127 /// Creates a ForwardingRule resource in the specified project and region using
2128 /// the data included in the request.
2129 pub fn insert(&self) -> super::builder::forwarding_rules::Insert {
2130 super::builder::forwarding_rules::Insert::new(self.inner.clone())
2131 }
2132
2133 /// Retrieves a list of ForwardingRule resources available to the specified
2134 /// project and region.
2135 pub fn list(&self) -> super::builder::forwarding_rules::List {
2136 super::builder::forwarding_rules::List::new(self.inner.clone())
2137 }
2138
2139 /// Updates the specified forwarding rule with the data included in the
2140 /// request. This method supportsPATCH
2141 /// semantics and uses theJSON merge
2142 /// patch format and processing rules. Currently, you can only
2143 /// patch the network_tier field.
2144 pub fn patch(&self) -> super::builder::forwarding_rules::Patch {
2145 super::builder::forwarding_rules::Patch::new(self.inner.clone())
2146 }
2147
2148 /// Sets the labels on the specified resource. To learn more about labels,
2149 /// read the
2150 /// Labeling Resources documentation.
2151 pub fn set_labels(&self) -> super::builder::forwarding_rules::SetLabels {
2152 super::builder::forwarding_rules::SetLabels::new(self.inner.clone())
2153 }
2154
2155 /// Changes target URL for forwarding rule. The new target should be of the
2156 /// same type as the old target.
2157 pub fn set_target(&self) -> super::builder::forwarding_rules::SetTarget {
2158 super::builder::forwarding_rules::SetTarget::new(self.inner.clone())
2159 }
2160
2161 /// Retrieves the specified region-specific Operations resource.
2162 pub fn get_operation(&self) -> super::builder::forwarding_rules::GetOperation {
2163 super::builder::forwarding_rules::GetOperation::new(self.inner.clone())
2164 }
2165}
2166
2167/// Implements a client for the Google Compute Engine API.
2168///
2169/// # Example
2170/// ```
2171/// # tokio_test::block_on(async {
2172/// # use google_cloud_compute_v1::client::FutureReservations;
2173/// let client = FutureReservations::builder().build().await?;
2174/// // use `client` to make requests to the Google Compute Engine API.
2175/// # gax::client_builder::Result::<()>::Ok(()) });
2176/// ```
2177///
2178/// # Service Description
2179///
2180/// Service for the `futureReservations` resource.
2181///
2182/// # Configuration
2183///
2184/// To configure `FutureReservations` use the `with_*` methods in the type returned
2185/// by [builder()][FutureReservations::builder]. The default configuration should
2186/// work for most applications. Common configuration changes include
2187///
2188/// * [with_endpoint()]: by default this client uses the global default endpoint
2189/// (`https://compute.googleapis.com`). Applications using regional
2190/// endpoints or running in restricted networks (e.g. a network configured
2191// with [Private Google Access with VPC Service Controls]) may want to
2192/// override this default.
2193/// * [with_credentials()]: by default this client uses
2194/// [Application Default Credentials]. Applications using custom
2195/// authentication may need to override this default.
2196///
2197/// [with_endpoint()]: super::builder::future_reservations::ClientBuilder::with_endpoint
2198/// [with_credentials()]: super::builder::future_reservations::ClientBuilder::credentials
2199/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2200/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2201///
2202/// # Pooling and Cloning
2203///
2204/// `FutureReservations` holds a connection pool internally, it is advised to
2205/// create one and the reuse it. You do not need to wrap `FutureReservations` in
2206/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2207/// already uses an `Arc` internally.
2208#[cfg(feature = "future-reservations")]
2209#[cfg_attr(docsrs, doc(cfg(feature = "future-reservations")))]
2210#[derive(Clone, Debug)]
2211pub struct FutureReservations {
2212 inner: std::sync::Arc<dyn super::stub::dynamic::FutureReservations>,
2213}
2214
2215#[cfg(feature = "future-reservations")]
2216impl FutureReservations {
2217 /// Returns a builder for [FutureReservations].
2218 ///
2219 /// ```
2220 /// # tokio_test::block_on(async {
2221 /// # use google_cloud_compute_v1::client::FutureReservations;
2222 /// let client = FutureReservations::builder().build().await?;
2223 /// # gax::client_builder::Result::<()>::Ok(()) });
2224 /// ```
2225 pub fn builder() -> super::builder::future_reservations::ClientBuilder {
2226 gax::client_builder::internal::new_builder(
2227 super::builder::future_reservations::client::Factory,
2228 )
2229 }
2230
2231 /// Creates a new client from the provided stub.
2232 ///
2233 /// The most common case for calling this function is in tests mocking the
2234 /// client's behavior.
2235 pub fn from_stub<T>(stub: T) -> Self
2236 where
2237 T: super::stub::FutureReservations + 'static,
2238 {
2239 Self {
2240 inner: std::sync::Arc::new(stub),
2241 }
2242 }
2243
2244 pub(crate) async fn new(
2245 config: gaxi::options::ClientConfig,
2246 ) -> gax::client_builder::Result<Self> {
2247 let inner = Self::build_inner(config).await?;
2248 Ok(Self { inner })
2249 }
2250
2251 async fn build_inner(
2252 conf: gaxi::options::ClientConfig,
2253 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::FutureReservations>>
2254 {
2255 if gaxi::options::tracing_enabled(&conf) {
2256 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2257 }
2258 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2259 }
2260
2261 async fn build_transport(
2262 conf: gaxi::options::ClientConfig,
2263 ) -> gax::client_builder::Result<impl super::stub::FutureReservations> {
2264 super::transport::FutureReservations::new(conf).await
2265 }
2266
2267 async fn build_with_tracing(
2268 conf: gaxi::options::ClientConfig,
2269 ) -> gax::client_builder::Result<impl super::stub::FutureReservations> {
2270 Self::build_transport(conf)
2271 .await
2272 .map(super::tracing::FutureReservations::new)
2273 }
2274
2275 /// Retrieves an aggregated list of future reservations.
2276 ///
2277 /// To prevent failure, it is recommended that you set the
2278 /// `returnPartialSuccess` parameter to `true`.
2279 pub fn aggregated_list(&self) -> super::builder::future_reservations::AggregatedList {
2280 super::builder::future_reservations::AggregatedList::new(self.inner.clone())
2281 }
2282
2283 /// Cancel the specified future reservation.
2284 pub fn cancel(&self) -> super::builder::future_reservations::Cancel {
2285 super::builder::future_reservations::Cancel::new(self.inner.clone())
2286 }
2287
2288 /// Deletes the specified future reservation.
2289 pub fn delete(&self) -> super::builder::future_reservations::Delete {
2290 super::builder::future_reservations::Delete::new(self.inner.clone())
2291 }
2292
2293 /// Retrieves information about the specified future reservation.
2294 pub fn get(&self) -> super::builder::future_reservations::Get {
2295 super::builder::future_reservations::Get::new(self.inner.clone())
2296 }
2297
2298 /// Creates a new Future Reservation.
2299 pub fn insert(&self) -> super::builder::future_reservations::Insert {
2300 super::builder::future_reservations::Insert::new(self.inner.clone())
2301 }
2302
2303 /// A list of all the future reservations that have been configured for the
2304 /// specified project in specified zone.
2305 pub fn list(&self) -> super::builder::future_reservations::List {
2306 super::builder::future_reservations::List::new(self.inner.clone())
2307 }
2308
2309 /// Updates the specified future reservation.
2310 pub fn update(&self) -> super::builder::future_reservations::Update {
2311 super::builder::future_reservations::Update::new(self.inner.clone())
2312 }
2313
2314 /// Retrieves the specified zone-specific Operations resource.
2315 pub fn get_operation(&self) -> super::builder::future_reservations::GetOperation {
2316 super::builder::future_reservations::GetOperation::new(self.inner.clone())
2317 }
2318}
2319
2320/// Implements a client for the Google Compute Engine API.
2321///
2322/// # Example
2323/// ```
2324/// # tokio_test::block_on(async {
2325/// # use google_cloud_compute_v1::client::GlobalAddresses;
2326/// let client = GlobalAddresses::builder().build().await?;
2327/// // use `client` to make requests to the Google Compute Engine API.
2328/// # gax::client_builder::Result::<()>::Ok(()) });
2329/// ```
2330///
2331/// # Service Description
2332///
2333/// Service for the `globalAddresses` resource.
2334///
2335/// # Configuration
2336///
2337/// To configure `GlobalAddresses` use the `with_*` methods in the type returned
2338/// by [builder()][GlobalAddresses::builder]. The default configuration should
2339/// work for most applications. Common configuration changes include
2340///
2341/// * [with_endpoint()]: by default this client uses the global default endpoint
2342/// (`https://compute.googleapis.com`). Applications using regional
2343/// endpoints or running in restricted networks (e.g. a network configured
2344// with [Private Google Access with VPC Service Controls]) may want to
2345/// override this default.
2346/// * [with_credentials()]: by default this client uses
2347/// [Application Default Credentials]. Applications using custom
2348/// authentication may need to override this default.
2349///
2350/// [with_endpoint()]: super::builder::global_addresses::ClientBuilder::with_endpoint
2351/// [with_credentials()]: super::builder::global_addresses::ClientBuilder::credentials
2352/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2353/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2354///
2355/// # Pooling and Cloning
2356///
2357/// `GlobalAddresses` holds a connection pool internally, it is advised to
2358/// create one and the reuse it. You do not need to wrap `GlobalAddresses` in
2359/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2360/// already uses an `Arc` internally.
2361#[cfg(feature = "global-addresses")]
2362#[cfg_attr(docsrs, doc(cfg(feature = "global-addresses")))]
2363#[derive(Clone, Debug)]
2364pub struct GlobalAddresses {
2365 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalAddresses>,
2366}
2367
2368#[cfg(feature = "global-addresses")]
2369impl GlobalAddresses {
2370 /// Returns a builder for [GlobalAddresses].
2371 ///
2372 /// ```
2373 /// # tokio_test::block_on(async {
2374 /// # use google_cloud_compute_v1::client::GlobalAddresses;
2375 /// let client = GlobalAddresses::builder().build().await?;
2376 /// # gax::client_builder::Result::<()>::Ok(()) });
2377 /// ```
2378 pub fn builder() -> super::builder::global_addresses::ClientBuilder {
2379 gax::client_builder::internal::new_builder(
2380 super::builder::global_addresses::client::Factory,
2381 )
2382 }
2383
2384 /// Creates a new client from the provided stub.
2385 ///
2386 /// The most common case for calling this function is in tests mocking the
2387 /// client's behavior.
2388 pub fn from_stub<T>(stub: T) -> Self
2389 where
2390 T: super::stub::GlobalAddresses + 'static,
2391 {
2392 Self {
2393 inner: std::sync::Arc::new(stub),
2394 }
2395 }
2396
2397 pub(crate) async fn new(
2398 config: gaxi::options::ClientConfig,
2399 ) -> gax::client_builder::Result<Self> {
2400 let inner = Self::build_inner(config).await?;
2401 Ok(Self { inner })
2402 }
2403
2404 async fn build_inner(
2405 conf: gaxi::options::ClientConfig,
2406 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::GlobalAddresses>>
2407 {
2408 if gaxi::options::tracing_enabled(&conf) {
2409 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2410 }
2411 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2412 }
2413
2414 async fn build_transport(
2415 conf: gaxi::options::ClientConfig,
2416 ) -> gax::client_builder::Result<impl super::stub::GlobalAddresses> {
2417 super::transport::GlobalAddresses::new(conf).await
2418 }
2419
2420 async fn build_with_tracing(
2421 conf: gaxi::options::ClientConfig,
2422 ) -> gax::client_builder::Result<impl super::stub::GlobalAddresses> {
2423 Self::build_transport(conf)
2424 .await
2425 .map(super::tracing::GlobalAddresses::new)
2426 }
2427
2428 /// Deletes the specified address resource.
2429 pub fn delete(&self) -> super::builder::global_addresses::Delete {
2430 super::builder::global_addresses::Delete::new(self.inner.clone())
2431 }
2432
2433 /// Returns the specified address resource.
2434 pub fn get(&self) -> super::builder::global_addresses::Get {
2435 super::builder::global_addresses::Get::new(self.inner.clone())
2436 }
2437
2438 /// Creates an address resource in the specified project by using the data
2439 /// included in the request.
2440 pub fn insert(&self) -> super::builder::global_addresses::Insert {
2441 super::builder::global_addresses::Insert::new(self.inner.clone())
2442 }
2443
2444 /// Retrieves a list of global addresses.
2445 pub fn list(&self) -> super::builder::global_addresses::List {
2446 super::builder::global_addresses::List::new(self.inner.clone())
2447 }
2448
2449 /// Moves the specified address resource from one project to another project.
2450 pub fn r#move(&self) -> super::builder::global_addresses::Move {
2451 super::builder::global_addresses::Move::new(self.inner.clone())
2452 }
2453
2454 /// Sets the labels on a GlobalAddress. To learn more about labels, read theLabeling
2455 /// Resources documentation.
2456 pub fn set_labels(&self) -> super::builder::global_addresses::SetLabels {
2457 super::builder::global_addresses::SetLabels::new(self.inner.clone())
2458 }
2459
2460 /// Returns permissions that a caller has on the specified resource.
2461 pub fn test_iam_permissions(&self) -> super::builder::global_addresses::TestIamPermissions {
2462 super::builder::global_addresses::TestIamPermissions::new(self.inner.clone())
2463 }
2464
2465 /// Retrieves the specified Operations resource.
2466 pub fn get_operation(&self) -> super::builder::global_addresses::GetOperation {
2467 super::builder::global_addresses::GetOperation::new(self.inner.clone())
2468 }
2469}
2470
2471/// Implements a client for the Google Compute Engine API.
2472///
2473/// # Example
2474/// ```
2475/// # tokio_test::block_on(async {
2476/// # use google_cloud_compute_v1::client::GlobalForwardingRules;
2477/// let client = GlobalForwardingRules::builder().build().await?;
2478/// // use `client` to make requests to the Google Compute Engine API.
2479/// # gax::client_builder::Result::<()>::Ok(()) });
2480/// ```
2481///
2482/// # Service Description
2483///
2484/// Service for the `globalForwardingRules` resource.
2485///
2486/// # Configuration
2487///
2488/// To configure `GlobalForwardingRules` use the `with_*` methods in the type returned
2489/// by [builder()][GlobalForwardingRules::builder]. The default configuration should
2490/// work for most applications. Common configuration changes include
2491///
2492/// * [with_endpoint()]: by default this client uses the global default endpoint
2493/// (`https://compute.googleapis.com`). Applications using regional
2494/// endpoints or running in restricted networks (e.g. a network configured
2495// with [Private Google Access with VPC Service Controls]) may want to
2496/// override this default.
2497/// * [with_credentials()]: by default this client uses
2498/// [Application Default Credentials]. Applications using custom
2499/// authentication may need to override this default.
2500///
2501/// [with_endpoint()]: super::builder::global_forwarding_rules::ClientBuilder::with_endpoint
2502/// [with_credentials()]: super::builder::global_forwarding_rules::ClientBuilder::credentials
2503/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2504/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2505///
2506/// # Pooling and Cloning
2507///
2508/// `GlobalForwardingRules` holds a connection pool internally, it is advised to
2509/// create one and the reuse it. You do not need to wrap `GlobalForwardingRules` in
2510/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2511/// already uses an `Arc` internally.
2512#[cfg(feature = "global-forwarding-rules")]
2513#[cfg_attr(docsrs, doc(cfg(feature = "global-forwarding-rules")))]
2514#[derive(Clone, Debug)]
2515pub struct GlobalForwardingRules {
2516 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalForwardingRules>,
2517}
2518
2519#[cfg(feature = "global-forwarding-rules")]
2520impl GlobalForwardingRules {
2521 /// Returns a builder for [GlobalForwardingRules].
2522 ///
2523 /// ```
2524 /// # tokio_test::block_on(async {
2525 /// # use google_cloud_compute_v1::client::GlobalForwardingRules;
2526 /// let client = GlobalForwardingRules::builder().build().await?;
2527 /// # gax::client_builder::Result::<()>::Ok(()) });
2528 /// ```
2529 pub fn builder() -> super::builder::global_forwarding_rules::ClientBuilder {
2530 gax::client_builder::internal::new_builder(
2531 super::builder::global_forwarding_rules::client::Factory,
2532 )
2533 }
2534
2535 /// Creates a new client from the provided stub.
2536 ///
2537 /// The most common case for calling this function is in tests mocking the
2538 /// client's behavior.
2539 pub fn from_stub<T>(stub: T) -> Self
2540 where
2541 T: super::stub::GlobalForwardingRules + 'static,
2542 {
2543 Self {
2544 inner: std::sync::Arc::new(stub),
2545 }
2546 }
2547
2548 pub(crate) async fn new(
2549 config: gaxi::options::ClientConfig,
2550 ) -> gax::client_builder::Result<Self> {
2551 let inner = Self::build_inner(config).await?;
2552 Ok(Self { inner })
2553 }
2554
2555 async fn build_inner(
2556 conf: gaxi::options::ClientConfig,
2557 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::GlobalForwardingRules>>
2558 {
2559 if gaxi::options::tracing_enabled(&conf) {
2560 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2561 }
2562 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2563 }
2564
2565 async fn build_transport(
2566 conf: gaxi::options::ClientConfig,
2567 ) -> gax::client_builder::Result<impl super::stub::GlobalForwardingRules> {
2568 super::transport::GlobalForwardingRules::new(conf).await
2569 }
2570
2571 async fn build_with_tracing(
2572 conf: gaxi::options::ClientConfig,
2573 ) -> gax::client_builder::Result<impl super::stub::GlobalForwardingRules> {
2574 Self::build_transport(conf)
2575 .await
2576 .map(super::tracing::GlobalForwardingRules::new)
2577 }
2578
2579 /// Deletes the specified GlobalForwardingRule resource.
2580 pub fn delete(&self) -> super::builder::global_forwarding_rules::Delete {
2581 super::builder::global_forwarding_rules::Delete::new(self.inner.clone())
2582 }
2583
2584 /// Returns the specified GlobalForwardingRule resource. Gets a list of
2585 /// available forwarding rules by making a list() request.
2586 pub fn get(&self) -> super::builder::global_forwarding_rules::Get {
2587 super::builder::global_forwarding_rules::Get::new(self.inner.clone())
2588 }
2589
2590 /// Creates a GlobalForwardingRule resource in the specified project using
2591 /// the data included in the request.
2592 pub fn insert(&self) -> super::builder::global_forwarding_rules::Insert {
2593 super::builder::global_forwarding_rules::Insert::new(self.inner.clone())
2594 }
2595
2596 /// Retrieves a list of GlobalForwardingRule resources available to the
2597 /// specified project.
2598 pub fn list(&self) -> super::builder::global_forwarding_rules::List {
2599 super::builder::global_forwarding_rules::List::new(self.inner.clone())
2600 }
2601
2602 /// Updates the specified forwarding rule with the data included in the
2603 /// request. This method supportsPATCH
2604 /// semantics and uses theJSON merge
2605 /// patch format and processing rules. Currently, you can only
2606 /// patch the network_tier field.
2607 pub fn patch(&self) -> super::builder::global_forwarding_rules::Patch {
2608 super::builder::global_forwarding_rules::Patch::new(self.inner.clone())
2609 }
2610
2611 /// Sets the labels on the specified resource. To learn more about labels,
2612 /// read the
2613 /// Labeling resources documentation.
2614 pub fn set_labels(&self) -> super::builder::global_forwarding_rules::SetLabels {
2615 super::builder::global_forwarding_rules::SetLabels::new(self.inner.clone())
2616 }
2617
2618 /// Changes target URL for the GlobalForwardingRule resource. The new target
2619 /// should be of the same type as the old target.
2620 pub fn set_target(&self) -> super::builder::global_forwarding_rules::SetTarget {
2621 super::builder::global_forwarding_rules::SetTarget::new(self.inner.clone())
2622 }
2623
2624 /// Retrieves the specified Operations resource.
2625 pub fn get_operation(&self) -> super::builder::global_forwarding_rules::GetOperation {
2626 super::builder::global_forwarding_rules::GetOperation::new(self.inner.clone())
2627 }
2628}
2629
2630/// Implements a client for the Google Compute Engine API.
2631///
2632/// # Example
2633/// ```
2634/// # tokio_test::block_on(async {
2635/// # use google_cloud_compute_v1::client::GlobalNetworkEndpointGroups;
2636/// let client = GlobalNetworkEndpointGroups::builder().build().await?;
2637/// // use `client` to make requests to the Google Compute Engine API.
2638/// # gax::client_builder::Result::<()>::Ok(()) });
2639/// ```
2640///
2641/// # Service Description
2642///
2643/// Service for the `globalNetworkEndpointGroups` resource.
2644///
2645/// # Configuration
2646///
2647/// To configure `GlobalNetworkEndpointGroups` use the `with_*` methods in the type returned
2648/// by [builder()][GlobalNetworkEndpointGroups::builder]. The default configuration should
2649/// work for most applications. Common configuration changes include
2650///
2651/// * [with_endpoint()]: by default this client uses the global default endpoint
2652/// (`https://compute.googleapis.com`). Applications using regional
2653/// endpoints or running in restricted networks (e.g. a network configured
2654// with [Private Google Access with VPC Service Controls]) may want to
2655/// override this default.
2656/// * [with_credentials()]: by default this client uses
2657/// [Application Default Credentials]. Applications using custom
2658/// authentication may need to override this default.
2659///
2660/// [with_endpoint()]: super::builder::global_network_endpoint_groups::ClientBuilder::with_endpoint
2661/// [with_credentials()]: super::builder::global_network_endpoint_groups::ClientBuilder::credentials
2662/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2663/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2664///
2665/// # Pooling and Cloning
2666///
2667/// `GlobalNetworkEndpointGroups` holds a connection pool internally, it is advised to
2668/// create one and the reuse it. You do not need to wrap `GlobalNetworkEndpointGroups` in
2669/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2670/// already uses an `Arc` internally.
2671#[cfg(feature = "global-network-endpoint-groups")]
2672#[cfg_attr(docsrs, doc(cfg(feature = "global-network-endpoint-groups")))]
2673#[derive(Clone, Debug)]
2674pub struct GlobalNetworkEndpointGroups {
2675 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalNetworkEndpointGroups>,
2676}
2677
2678#[cfg(feature = "global-network-endpoint-groups")]
2679impl GlobalNetworkEndpointGroups {
2680 /// Returns a builder for [GlobalNetworkEndpointGroups].
2681 ///
2682 /// ```
2683 /// # tokio_test::block_on(async {
2684 /// # use google_cloud_compute_v1::client::GlobalNetworkEndpointGroups;
2685 /// let client = GlobalNetworkEndpointGroups::builder().build().await?;
2686 /// # gax::client_builder::Result::<()>::Ok(()) });
2687 /// ```
2688 pub fn builder() -> super::builder::global_network_endpoint_groups::ClientBuilder {
2689 gax::client_builder::internal::new_builder(
2690 super::builder::global_network_endpoint_groups::client::Factory,
2691 )
2692 }
2693
2694 /// Creates a new client from the provided stub.
2695 ///
2696 /// The most common case for calling this function is in tests mocking the
2697 /// client's behavior.
2698 pub fn from_stub<T>(stub: T) -> Self
2699 where
2700 T: super::stub::GlobalNetworkEndpointGroups + 'static,
2701 {
2702 Self {
2703 inner: std::sync::Arc::new(stub),
2704 }
2705 }
2706
2707 pub(crate) async fn new(
2708 config: gaxi::options::ClientConfig,
2709 ) -> gax::client_builder::Result<Self> {
2710 let inner = Self::build_inner(config).await?;
2711 Ok(Self { inner })
2712 }
2713
2714 async fn build_inner(
2715 conf: gaxi::options::ClientConfig,
2716 ) -> gax::client_builder::Result<
2717 std::sync::Arc<dyn super::stub::dynamic::GlobalNetworkEndpointGroups>,
2718 > {
2719 if gaxi::options::tracing_enabled(&conf) {
2720 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2721 }
2722 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2723 }
2724
2725 async fn build_transport(
2726 conf: gaxi::options::ClientConfig,
2727 ) -> gax::client_builder::Result<impl super::stub::GlobalNetworkEndpointGroups> {
2728 super::transport::GlobalNetworkEndpointGroups::new(conf).await
2729 }
2730
2731 async fn build_with_tracing(
2732 conf: gaxi::options::ClientConfig,
2733 ) -> gax::client_builder::Result<impl super::stub::GlobalNetworkEndpointGroups> {
2734 Self::build_transport(conf)
2735 .await
2736 .map(super::tracing::GlobalNetworkEndpointGroups::new)
2737 }
2738
2739 /// Attach a network endpoint to the specified network endpoint group.
2740 pub fn attach_network_endpoints(
2741 &self,
2742 ) -> super::builder::global_network_endpoint_groups::AttachNetworkEndpoints {
2743 super::builder::global_network_endpoint_groups::AttachNetworkEndpoints::new(
2744 self.inner.clone(),
2745 )
2746 }
2747
2748 /// Deletes the specified network endpoint group.Note that the NEG cannot be
2749 /// deleted if there are backend services referencing it.
2750 pub fn delete(&self) -> super::builder::global_network_endpoint_groups::Delete {
2751 super::builder::global_network_endpoint_groups::Delete::new(self.inner.clone())
2752 }
2753
2754 /// Detach the network endpoint from the specified network endpoint group.
2755 pub fn detach_network_endpoints(
2756 &self,
2757 ) -> super::builder::global_network_endpoint_groups::DetachNetworkEndpoints {
2758 super::builder::global_network_endpoint_groups::DetachNetworkEndpoints::new(
2759 self.inner.clone(),
2760 )
2761 }
2762
2763 /// Returns the specified network endpoint group.
2764 pub fn get(&self) -> super::builder::global_network_endpoint_groups::Get {
2765 super::builder::global_network_endpoint_groups::Get::new(self.inner.clone())
2766 }
2767
2768 /// Creates a network endpoint group in the specified project using the
2769 /// parameters that are included in the request.
2770 pub fn insert(&self) -> super::builder::global_network_endpoint_groups::Insert {
2771 super::builder::global_network_endpoint_groups::Insert::new(self.inner.clone())
2772 }
2773
2774 /// Retrieves the list of network endpoint groups that are located in the
2775 /// specified project.
2776 pub fn list(&self) -> super::builder::global_network_endpoint_groups::List {
2777 super::builder::global_network_endpoint_groups::List::new(self.inner.clone())
2778 }
2779
2780 /// Lists the network endpoints in the specified network endpoint group.
2781 pub fn list_network_endpoints(
2782 &self,
2783 ) -> super::builder::global_network_endpoint_groups::ListNetworkEndpoints {
2784 super::builder::global_network_endpoint_groups::ListNetworkEndpoints::new(
2785 self.inner.clone(),
2786 )
2787 }
2788
2789 /// Retrieves the specified Operations resource.
2790 pub fn get_operation(&self) -> super::builder::global_network_endpoint_groups::GetOperation {
2791 super::builder::global_network_endpoint_groups::GetOperation::new(self.inner.clone())
2792 }
2793}
2794
2795/// Implements a client for the Google Compute Engine API.
2796///
2797/// # Example
2798/// ```
2799/// # tokio_test::block_on(async {
2800/// # use google_cloud_compute_v1::client::GlobalOperations;
2801/// let client = GlobalOperations::builder().build().await?;
2802/// // use `client` to make requests to the Google Compute Engine API.
2803/// # gax::client_builder::Result::<()>::Ok(()) });
2804/// ```
2805///
2806/// # Service Description
2807///
2808/// Service for the `globalOperations` resource.
2809///
2810/// # Configuration
2811///
2812/// To configure `GlobalOperations` use the `with_*` methods in the type returned
2813/// by [builder()][GlobalOperations::builder]. The default configuration should
2814/// work for most applications. Common configuration changes include
2815///
2816/// * [with_endpoint()]: by default this client uses the global default endpoint
2817/// (`https://compute.googleapis.com`). Applications using regional
2818/// endpoints or running in restricted networks (e.g. a network configured
2819// with [Private Google Access with VPC Service Controls]) may want to
2820/// override this default.
2821/// * [with_credentials()]: by default this client uses
2822/// [Application Default Credentials]. Applications using custom
2823/// authentication may need to override this default.
2824///
2825/// [with_endpoint()]: super::builder::global_operations::ClientBuilder::with_endpoint
2826/// [with_credentials()]: super::builder::global_operations::ClientBuilder::credentials
2827/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2828/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2829///
2830/// # Pooling and Cloning
2831///
2832/// `GlobalOperations` holds a connection pool internally, it is advised to
2833/// create one and the reuse it. You do not need to wrap `GlobalOperations` in
2834/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2835/// already uses an `Arc` internally.
2836#[cfg(feature = "global-operations")]
2837#[cfg_attr(docsrs, doc(cfg(feature = "global-operations")))]
2838#[derive(Clone, Debug)]
2839pub struct GlobalOperations {
2840 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalOperations>,
2841}
2842
2843#[cfg(feature = "global-operations")]
2844impl GlobalOperations {
2845 /// Returns a builder for [GlobalOperations].
2846 ///
2847 /// ```
2848 /// # tokio_test::block_on(async {
2849 /// # use google_cloud_compute_v1::client::GlobalOperations;
2850 /// let client = GlobalOperations::builder().build().await?;
2851 /// # gax::client_builder::Result::<()>::Ok(()) });
2852 /// ```
2853 pub fn builder() -> super::builder::global_operations::ClientBuilder {
2854 gax::client_builder::internal::new_builder(
2855 super::builder::global_operations::client::Factory,
2856 )
2857 }
2858
2859 /// Creates a new client from the provided stub.
2860 ///
2861 /// The most common case for calling this function is in tests mocking the
2862 /// client's behavior.
2863 pub fn from_stub<T>(stub: T) -> Self
2864 where
2865 T: super::stub::GlobalOperations + 'static,
2866 {
2867 Self {
2868 inner: std::sync::Arc::new(stub),
2869 }
2870 }
2871
2872 pub(crate) async fn new(
2873 config: gaxi::options::ClientConfig,
2874 ) -> gax::client_builder::Result<Self> {
2875 let inner = Self::build_inner(config).await?;
2876 Ok(Self { inner })
2877 }
2878
2879 async fn build_inner(
2880 conf: gaxi::options::ClientConfig,
2881 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::GlobalOperations>>
2882 {
2883 if gaxi::options::tracing_enabled(&conf) {
2884 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2885 }
2886 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2887 }
2888
2889 async fn build_transport(
2890 conf: gaxi::options::ClientConfig,
2891 ) -> gax::client_builder::Result<impl super::stub::GlobalOperations> {
2892 super::transport::GlobalOperations::new(conf).await
2893 }
2894
2895 async fn build_with_tracing(
2896 conf: gaxi::options::ClientConfig,
2897 ) -> gax::client_builder::Result<impl super::stub::GlobalOperations> {
2898 Self::build_transport(conf)
2899 .await
2900 .map(super::tracing::GlobalOperations::new)
2901 }
2902
2903 /// Retrieves an aggregated list of all operations.
2904 ///
2905 /// To prevent failure, Google recommends that you set the
2906 /// `returnPartialSuccess` parameter to `true`.
2907 pub fn aggregated_list(&self) -> super::builder::global_operations::AggregatedList {
2908 super::builder::global_operations::AggregatedList::new(self.inner.clone())
2909 }
2910
2911 /// Deletes the specified Operations resource.
2912 pub fn delete(&self) -> super::builder::global_operations::Delete {
2913 super::builder::global_operations::Delete::new(self.inner.clone())
2914 }
2915
2916 /// Retrieves the specified Operations resource.
2917 pub fn get(&self) -> super::builder::global_operations::Get {
2918 super::builder::global_operations::Get::new(self.inner.clone())
2919 }
2920
2921 /// Retrieves a list of Operation resources contained within the specified
2922 /// project.
2923 pub fn list(&self) -> super::builder::global_operations::List {
2924 super::builder::global_operations::List::new(self.inner.clone())
2925 }
2926
2927 /// Waits for the specified Operation resource to return as `DONE`
2928 /// or for the request to approach the 2 minute deadline, and retrieves the
2929 /// specified Operation resource. This method differs from the
2930 /// `GET` method in that it waits for no more than the default
2931 /// deadline (2 minutes) and then returns the current state of the operation,
2932 /// which might be `DONE` or still in progress.
2933 ///
2934 /// This method is called on a best-effort basis. Specifically:
2935 ///
2936 /// ```norust
2937 /// - In uncommon cases, when the server is overloaded, the request might
2938 /// return before the default deadline is reached, or might return after zero
2939 /// seconds.
2940 /// ```
2941 ///
2942 /// - If the default deadline is reached, there is no guarantee that the
2943 /// operation is actually done when the method returns. Be prepared to retry
2944 /// if the operation is not `DONE`.
2945 pub fn wait(&self) -> super::builder::global_operations::Wait {
2946 super::builder::global_operations::Wait::new(self.inner.clone())
2947 }
2948}
2949
2950/// Implements a client for the Google Compute Engine API.
2951///
2952/// # Example
2953/// ```
2954/// # tokio_test::block_on(async {
2955/// # use google_cloud_compute_v1::client::GlobalOrganizationOperations;
2956/// let client = GlobalOrganizationOperations::builder().build().await?;
2957/// // use `client` to make requests to the Google Compute Engine API.
2958/// # gax::client_builder::Result::<()>::Ok(()) });
2959/// ```
2960///
2961/// # Service Description
2962///
2963/// Service for the `globalOrganizationOperations` resource.
2964///
2965/// # Configuration
2966///
2967/// To configure `GlobalOrganizationOperations` use the `with_*` methods in the type returned
2968/// by [builder()][GlobalOrganizationOperations::builder]. The default configuration should
2969/// work for most applications. Common configuration changes include
2970///
2971/// * [with_endpoint()]: by default this client uses the global default endpoint
2972/// (`https://compute.googleapis.com`). Applications using regional
2973/// endpoints or running in restricted networks (e.g. a network configured
2974// with [Private Google Access with VPC Service Controls]) may want to
2975/// override this default.
2976/// * [with_credentials()]: by default this client uses
2977/// [Application Default Credentials]. Applications using custom
2978/// authentication may need to override this default.
2979///
2980/// [with_endpoint()]: super::builder::global_organization_operations::ClientBuilder::with_endpoint
2981/// [with_credentials()]: super::builder::global_organization_operations::ClientBuilder::credentials
2982/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2983/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2984///
2985/// # Pooling and Cloning
2986///
2987/// `GlobalOrganizationOperations` holds a connection pool internally, it is advised to
2988/// create one and the reuse it. You do not need to wrap `GlobalOrganizationOperations` in
2989/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2990/// already uses an `Arc` internally.
2991#[cfg(feature = "global-organization-operations")]
2992#[cfg_attr(docsrs, doc(cfg(feature = "global-organization-operations")))]
2993#[derive(Clone, Debug)]
2994pub struct GlobalOrganizationOperations {
2995 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalOrganizationOperations>,
2996}
2997
2998#[cfg(feature = "global-organization-operations")]
2999impl GlobalOrganizationOperations {
3000 /// Returns a builder for [GlobalOrganizationOperations].
3001 ///
3002 /// ```
3003 /// # tokio_test::block_on(async {
3004 /// # use google_cloud_compute_v1::client::GlobalOrganizationOperations;
3005 /// let client = GlobalOrganizationOperations::builder().build().await?;
3006 /// # gax::client_builder::Result::<()>::Ok(()) });
3007 /// ```
3008 pub fn builder() -> super::builder::global_organization_operations::ClientBuilder {
3009 gax::client_builder::internal::new_builder(
3010 super::builder::global_organization_operations::client::Factory,
3011 )
3012 }
3013
3014 /// Creates a new client from the provided stub.
3015 ///
3016 /// The most common case for calling this function is in tests mocking the
3017 /// client's behavior.
3018 pub fn from_stub<T>(stub: T) -> Self
3019 where
3020 T: super::stub::GlobalOrganizationOperations + 'static,
3021 {
3022 Self {
3023 inner: std::sync::Arc::new(stub),
3024 }
3025 }
3026
3027 pub(crate) async fn new(
3028 config: gaxi::options::ClientConfig,
3029 ) -> gax::client_builder::Result<Self> {
3030 let inner = Self::build_inner(config).await?;
3031 Ok(Self { inner })
3032 }
3033
3034 async fn build_inner(
3035 conf: gaxi::options::ClientConfig,
3036 ) -> gax::client_builder::Result<
3037 std::sync::Arc<dyn super::stub::dynamic::GlobalOrganizationOperations>,
3038 > {
3039 if gaxi::options::tracing_enabled(&conf) {
3040 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3041 }
3042 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3043 }
3044
3045 async fn build_transport(
3046 conf: gaxi::options::ClientConfig,
3047 ) -> gax::client_builder::Result<impl super::stub::GlobalOrganizationOperations> {
3048 super::transport::GlobalOrganizationOperations::new(conf).await
3049 }
3050
3051 async fn build_with_tracing(
3052 conf: gaxi::options::ClientConfig,
3053 ) -> gax::client_builder::Result<impl super::stub::GlobalOrganizationOperations> {
3054 Self::build_transport(conf)
3055 .await
3056 .map(super::tracing::GlobalOrganizationOperations::new)
3057 }
3058
3059 /// Deletes the specified Operations resource.
3060 pub fn delete(&self) -> super::builder::global_organization_operations::Delete {
3061 super::builder::global_organization_operations::Delete::new(self.inner.clone())
3062 }
3063
3064 /// Retrieves the specified Operations resource. Gets a list of operations
3065 /// by making a `list()` request.
3066 pub fn get(&self) -> super::builder::global_organization_operations::Get {
3067 super::builder::global_organization_operations::Get::new(self.inner.clone())
3068 }
3069
3070 /// Retrieves a list of Operation resources contained within the specified
3071 /// organization.
3072 pub fn list(&self) -> super::builder::global_organization_operations::List {
3073 super::builder::global_organization_operations::List::new(self.inner.clone())
3074 }
3075}
3076
3077/// Implements a client for the Google Compute Engine API.
3078///
3079/// # Example
3080/// ```
3081/// # tokio_test::block_on(async {
3082/// # use google_cloud_compute_v1::client::GlobalPublicDelegatedPrefixes;
3083/// let client = GlobalPublicDelegatedPrefixes::builder().build().await?;
3084/// // use `client` to make requests to the Google Compute Engine API.
3085/// # gax::client_builder::Result::<()>::Ok(()) });
3086/// ```
3087///
3088/// # Service Description
3089///
3090/// Service for the `globalPublicDelegatedPrefixes` resource.
3091///
3092/// # Configuration
3093///
3094/// To configure `GlobalPublicDelegatedPrefixes` use the `with_*` methods in the type returned
3095/// by [builder()][GlobalPublicDelegatedPrefixes::builder]. The default configuration should
3096/// work for most applications. Common configuration changes include
3097///
3098/// * [with_endpoint()]: by default this client uses the global default endpoint
3099/// (`https://compute.googleapis.com`). Applications using regional
3100/// endpoints or running in restricted networks (e.g. a network configured
3101// with [Private Google Access with VPC Service Controls]) may want to
3102/// override this default.
3103/// * [with_credentials()]: by default this client uses
3104/// [Application Default Credentials]. Applications using custom
3105/// authentication may need to override this default.
3106///
3107/// [with_endpoint()]: super::builder::global_public_delegated_prefixes::ClientBuilder::with_endpoint
3108/// [with_credentials()]: super::builder::global_public_delegated_prefixes::ClientBuilder::credentials
3109/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3110/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3111///
3112/// # Pooling and Cloning
3113///
3114/// `GlobalPublicDelegatedPrefixes` holds a connection pool internally, it is advised to
3115/// create one and the reuse it. You do not need to wrap `GlobalPublicDelegatedPrefixes` in
3116/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3117/// already uses an `Arc` internally.
3118#[cfg(feature = "global-public-delegated-prefixes")]
3119#[cfg_attr(docsrs, doc(cfg(feature = "global-public-delegated-prefixes")))]
3120#[derive(Clone, Debug)]
3121pub struct GlobalPublicDelegatedPrefixes {
3122 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalPublicDelegatedPrefixes>,
3123}
3124
3125#[cfg(feature = "global-public-delegated-prefixes")]
3126impl GlobalPublicDelegatedPrefixes {
3127 /// Returns a builder for [GlobalPublicDelegatedPrefixes].
3128 ///
3129 /// ```
3130 /// # tokio_test::block_on(async {
3131 /// # use google_cloud_compute_v1::client::GlobalPublicDelegatedPrefixes;
3132 /// let client = GlobalPublicDelegatedPrefixes::builder().build().await?;
3133 /// # gax::client_builder::Result::<()>::Ok(()) });
3134 /// ```
3135 pub fn builder() -> super::builder::global_public_delegated_prefixes::ClientBuilder {
3136 gax::client_builder::internal::new_builder(
3137 super::builder::global_public_delegated_prefixes::client::Factory,
3138 )
3139 }
3140
3141 /// Creates a new client from the provided stub.
3142 ///
3143 /// The most common case for calling this function is in tests mocking the
3144 /// client's behavior.
3145 pub fn from_stub<T>(stub: T) -> Self
3146 where
3147 T: super::stub::GlobalPublicDelegatedPrefixes + 'static,
3148 {
3149 Self {
3150 inner: std::sync::Arc::new(stub),
3151 }
3152 }
3153
3154 pub(crate) async fn new(
3155 config: gaxi::options::ClientConfig,
3156 ) -> gax::client_builder::Result<Self> {
3157 let inner = Self::build_inner(config).await?;
3158 Ok(Self { inner })
3159 }
3160
3161 async fn build_inner(
3162 conf: gaxi::options::ClientConfig,
3163 ) -> gax::client_builder::Result<
3164 std::sync::Arc<dyn super::stub::dynamic::GlobalPublicDelegatedPrefixes>,
3165 > {
3166 if gaxi::options::tracing_enabled(&conf) {
3167 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3168 }
3169 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3170 }
3171
3172 async fn build_transport(
3173 conf: gaxi::options::ClientConfig,
3174 ) -> gax::client_builder::Result<impl super::stub::GlobalPublicDelegatedPrefixes> {
3175 super::transport::GlobalPublicDelegatedPrefixes::new(conf).await
3176 }
3177
3178 async fn build_with_tracing(
3179 conf: gaxi::options::ClientConfig,
3180 ) -> gax::client_builder::Result<impl super::stub::GlobalPublicDelegatedPrefixes> {
3181 Self::build_transport(conf)
3182 .await
3183 .map(super::tracing::GlobalPublicDelegatedPrefixes::new)
3184 }
3185
3186 /// Deletes the specified global PublicDelegatedPrefix.
3187 pub fn delete(&self) -> super::builder::global_public_delegated_prefixes::Delete {
3188 super::builder::global_public_delegated_prefixes::Delete::new(self.inner.clone())
3189 }
3190
3191 /// Returns the specified global PublicDelegatedPrefix resource.
3192 pub fn get(&self) -> super::builder::global_public_delegated_prefixes::Get {
3193 super::builder::global_public_delegated_prefixes::Get::new(self.inner.clone())
3194 }
3195
3196 /// Creates a global PublicDelegatedPrefix in the specified project using the
3197 /// parameters that are included in the request.
3198 pub fn insert(&self) -> super::builder::global_public_delegated_prefixes::Insert {
3199 super::builder::global_public_delegated_prefixes::Insert::new(self.inner.clone())
3200 }
3201
3202 /// Lists the global PublicDelegatedPrefixes for a project.
3203 pub fn list(&self) -> super::builder::global_public_delegated_prefixes::List {
3204 super::builder::global_public_delegated_prefixes::List::new(self.inner.clone())
3205 }
3206
3207 /// Patches the specified global PublicDelegatedPrefix resource with the data
3208 /// included in the request. This method supportsPATCH
3209 /// semantics and usesJSON merge
3210 /// patch format and processing rules.
3211 pub fn patch(&self) -> super::builder::global_public_delegated_prefixes::Patch {
3212 super::builder::global_public_delegated_prefixes::Patch::new(self.inner.clone())
3213 }
3214
3215 /// Retrieves the specified Operations resource.
3216 pub fn get_operation(&self) -> super::builder::global_public_delegated_prefixes::GetOperation {
3217 super::builder::global_public_delegated_prefixes::GetOperation::new(self.inner.clone())
3218 }
3219}
3220
3221/// Implements a client for the Google Compute Engine API.
3222///
3223/// # Example
3224/// ```
3225/// # tokio_test::block_on(async {
3226/// # use google_cloud_compute_v1::client::HealthChecks;
3227/// let client = HealthChecks::builder().build().await?;
3228/// // use `client` to make requests to the Google Compute Engine API.
3229/// # gax::client_builder::Result::<()>::Ok(()) });
3230/// ```
3231///
3232/// # Service Description
3233///
3234/// Service for the `healthChecks` resource.
3235///
3236/// # Configuration
3237///
3238/// To configure `HealthChecks` use the `with_*` methods in the type returned
3239/// by [builder()][HealthChecks::builder]. The default configuration should
3240/// work for most applications. Common configuration changes include
3241///
3242/// * [with_endpoint()]: by default this client uses the global default endpoint
3243/// (`https://compute.googleapis.com`). Applications using regional
3244/// endpoints or running in restricted networks (e.g. a network configured
3245// with [Private Google Access with VPC Service Controls]) may want to
3246/// override this default.
3247/// * [with_credentials()]: by default this client uses
3248/// [Application Default Credentials]. Applications using custom
3249/// authentication may need to override this default.
3250///
3251/// [with_endpoint()]: super::builder::health_checks::ClientBuilder::with_endpoint
3252/// [with_credentials()]: super::builder::health_checks::ClientBuilder::credentials
3253/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3254/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3255///
3256/// # Pooling and Cloning
3257///
3258/// `HealthChecks` holds a connection pool internally, it is advised to
3259/// create one and the reuse it. You do not need to wrap `HealthChecks` in
3260/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3261/// already uses an `Arc` internally.
3262#[cfg(feature = "health-checks")]
3263#[cfg_attr(docsrs, doc(cfg(feature = "health-checks")))]
3264#[derive(Clone, Debug)]
3265pub struct HealthChecks {
3266 inner: std::sync::Arc<dyn super::stub::dynamic::HealthChecks>,
3267}
3268
3269#[cfg(feature = "health-checks")]
3270impl HealthChecks {
3271 /// Returns a builder for [HealthChecks].
3272 ///
3273 /// ```
3274 /// # tokio_test::block_on(async {
3275 /// # use google_cloud_compute_v1::client::HealthChecks;
3276 /// let client = HealthChecks::builder().build().await?;
3277 /// # gax::client_builder::Result::<()>::Ok(()) });
3278 /// ```
3279 pub fn builder() -> super::builder::health_checks::ClientBuilder {
3280 gax::client_builder::internal::new_builder(super::builder::health_checks::client::Factory)
3281 }
3282
3283 /// Creates a new client from the provided stub.
3284 ///
3285 /// The most common case for calling this function is in tests mocking the
3286 /// client's behavior.
3287 pub fn from_stub<T>(stub: T) -> Self
3288 where
3289 T: super::stub::HealthChecks + 'static,
3290 {
3291 Self {
3292 inner: std::sync::Arc::new(stub),
3293 }
3294 }
3295
3296 pub(crate) async fn new(
3297 config: gaxi::options::ClientConfig,
3298 ) -> gax::client_builder::Result<Self> {
3299 let inner = Self::build_inner(config).await?;
3300 Ok(Self { inner })
3301 }
3302
3303 async fn build_inner(
3304 conf: gaxi::options::ClientConfig,
3305 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::HealthChecks>> {
3306 if gaxi::options::tracing_enabled(&conf) {
3307 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3308 }
3309 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3310 }
3311
3312 async fn build_transport(
3313 conf: gaxi::options::ClientConfig,
3314 ) -> gax::client_builder::Result<impl super::stub::HealthChecks> {
3315 super::transport::HealthChecks::new(conf).await
3316 }
3317
3318 async fn build_with_tracing(
3319 conf: gaxi::options::ClientConfig,
3320 ) -> gax::client_builder::Result<impl super::stub::HealthChecks> {
3321 Self::build_transport(conf)
3322 .await
3323 .map(super::tracing::HealthChecks::new)
3324 }
3325
3326 /// Retrieves the list of all HealthCheck resources, regional and global,
3327 /// available to the specified project.
3328 ///
3329 /// To prevent failure, Google recommends that you set the
3330 /// `returnPartialSuccess` parameter to `true`.
3331 pub fn aggregated_list(&self) -> super::builder::health_checks::AggregatedList {
3332 super::builder::health_checks::AggregatedList::new(self.inner.clone())
3333 }
3334
3335 /// Deletes the specified HealthCheck resource.
3336 pub fn delete(&self) -> super::builder::health_checks::Delete {
3337 super::builder::health_checks::Delete::new(self.inner.clone())
3338 }
3339
3340 /// Returns the specified HealthCheck resource.
3341 pub fn get(&self) -> super::builder::health_checks::Get {
3342 super::builder::health_checks::Get::new(self.inner.clone())
3343 }
3344
3345 /// Creates a HealthCheck resource in the specified project using the data
3346 /// included in the request.
3347 pub fn insert(&self) -> super::builder::health_checks::Insert {
3348 super::builder::health_checks::Insert::new(self.inner.clone())
3349 }
3350
3351 /// Retrieves the list of HealthCheck resources available to the specified
3352 /// project.
3353 pub fn list(&self) -> super::builder::health_checks::List {
3354 super::builder::health_checks::List::new(self.inner.clone())
3355 }
3356
3357 /// Updates a HealthCheck resource in the specified project using the data
3358 /// included in the request. This method supportsPATCH
3359 /// semantics and uses theJSON merge
3360 /// patch format and processing rules.
3361 pub fn patch(&self) -> super::builder::health_checks::Patch {
3362 super::builder::health_checks::Patch::new(self.inner.clone())
3363 }
3364
3365 /// Updates a HealthCheck resource in the specified project using the data
3366 /// included in the request.
3367 pub fn update(&self) -> super::builder::health_checks::Update {
3368 super::builder::health_checks::Update::new(self.inner.clone())
3369 }
3370
3371 /// Retrieves the specified Operations resource.
3372 pub fn get_operation(&self) -> super::builder::health_checks::GetOperation {
3373 super::builder::health_checks::GetOperation::new(self.inner.clone())
3374 }
3375}
3376
3377/// Implements a client for the Google Compute Engine API.
3378///
3379/// # Example
3380/// ```
3381/// # tokio_test::block_on(async {
3382/// # use google_cloud_compute_v1::client::HttpHealthChecks;
3383/// let client = HttpHealthChecks::builder().build().await?;
3384/// // use `client` to make requests to the Google Compute Engine API.
3385/// # gax::client_builder::Result::<()>::Ok(()) });
3386/// ```
3387///
3388/// # Service Description
3389///
3390/// Service for the `httpHealthChecks` resource.
3391///
3392/// # Configuration
3393///
3394/// To configure `HttpHealthChecks` use the `with_*` methods in the type returned
3395/// by [builder()][HttpHealthChecks::builder]. The default configuration should
3396/// work for most applications. Common configuration changes include
3397///
3398/// * [with_endpoint()]: by default this client uses the global default endpoint
3399/// (`https://compute.googleapis.com`). Applications using regional
3400/// endpoints or running in restricted networks (e.g. a network configured
3401// with [Private Google Access with VPC Service Controls]) may want to
3402/// override this default.
3403/// * [with_credentials()]: by default this client uses
3404/// [Application Default Credentials]. Applications using custom
3405/// authentication may need to override this default.
3406///
3407/// [with_endpoint()]: super::builder::http_health_checks::ClientBuilder::with_endpoint
3408/// [with_credentials()]: super::builder::http_health_checks::ClientBuilder::credentials
3409/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3410/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3411///
3412/// # Pooling and Cloning
3413///
3414/// `HttpHealthChecks` holds a connection pool internally, it is advised to
3415/// create one and the reuse it. You do not need to wrap `HttpHealthChecks` in
3416/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3417/// already uses an `Arc` internally.
3418#[cfg(feature = "http-health-checks")]
3419#[cfg_attr(docsrs, doc(cfg(feature = "http-health-checks")))]
3420#[derive(Clone, Debug)]
3421pub struct HttpHealthChecks {
3422 inner: std::sync::Arc<dyn super::stub::dynamic::HttpHealthChecks>,
3423}
3424
3425#[cfg(feature = "http-health-checks")]
3426impl HttpHealthChecks {
3427 /// Returns a builder for [HttpHealthChecks].
3428 ///
3429 /// ```
3430 /// # tokio_test::block_on(async {
3431 /// # use google_cloud_compute_v1::client::HttpHealthChecks;
3432 /// let client = HttpHealthChecks::builder().build().await?;
3433 /// # gax::client_builder::Result::<()>::Ok(()) });
3434 /// ```
3435 pub fn builder() -> super::builder::http_health_checks::ClientBuilder {
3436 gax::client_builder::internal::new_builder(
3437 super::builder::http_health_checks::client::Factory,
3438 )
3439 }
3440
3441 /// Creates a new client from the provided stub.
3442 ///
3443 /// The most common case for calling this function is in tests mocking the
3444 /// client's behavior.
3445 pub fn from_stub<T>(stub: T) -> Self
3446 where
3447 T: super::stub::HttpHealthChecks + 'static,
3448 {
3449 Self {
3450 inner: std::sync::Arc::new(stub),
3451 }
3452 }
3453
3454 pub(crate) async fn new(
3455 config: gaxi::options::ClientConfig,
3456 ) -> gax::client_builder::Result<Self> {
3457 let inner = Self::build_inner(config).await?;
3458 Ok(Self { inner })
3459 }
3460
3461 async fn build_inner(
3462 conf: gaxi::options::ClientConfig,
3463 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::HttpHealthChecks>>
3464 {
3465 if gaxi::options::tracing_enabled(&conf) {
3466 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3467 }
3468 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3469 }
3470
3471 async fn build_transport(
3472 conf: gaxi::options::ClientConfig,
3473 ) -> gax::client_builder::Result<impl super::stub::HttpHealthChecks> {
3474 super::transport::HttpHealthChecks::new(conf).await
3475 }
3476
3477 async fn build_with_tracing(
3478 conf: gaxi::options::ClientConfig,
3479 ) -> gax::client_builder::Result<impl super::stub::HttpHealthChecks> {
3480 Self::build_transport(conf)
3481 .await
3482 .map(super::tracing::HttpHealthChecks::new)
3483 }
3484
3485 /// Deletes the specified HttpHealthCheck resource.
3486 pub fn delete(&self) -> super::builder::http_health_checks::Delete {
3487 super::builder::http_health_checks::Delete::new(self.inner.clone())
3488 }
3489
3490 /// Returns the specified HttpHealthCheck resource.
3491 pub fn get(&self) -> super::builder::http_health_checks::Get {
3492 super::builder::http_health_checks::Get::new(self.inner.clone())
3493 }
3494
3495 /// Creates a HttpHealthCheck resource in the specified project using the data
3496 /// included in the request.
3497 pub fn insert(&self) -> super::builder::http_health_checks::Insert {
3498 super::builder::http_health_checks::Insert::new(self.inner.clone())
3499 }
3500
3501 /// Retrieves the list of HttpHealthCheck resources available to the specified
3502 /// project.
3503 pub fn list(&self) -> super::builder::http_health_checks::List {
3504 super::builder::http_health_checks::List::new(self.inner.clone())
3505 }
3506
3507 /// Updates a HttpHealthCheck resource in the specified project using the data
3508 /// included in the request. This method supportsPATCH
3509 /// semantics and uses theJSON merge
3510 /// patch format and processing rules.
3511 pub fn patch(&self) -> super::builder::http_health_checks::Patch {
3512 super::builder::http_health_checks::Patch::new(self.inner.clone())
3513 }
3514
3515 /// Updates a HttpHealthCheck resource in the specified project using the data
3516 /// included in the request.
3517 pub fn update(&self) -> super::builder::http_health_checks::Update {
3518 super::builder::http_health_checks::Update::new(self.inner.clone())
3519 }
3520
3521 /// Retrieves the specified Operations resource.
3522 pub fn get_operation(&self) -> super::builder::http_health_checks::GetOperation {
3523 super::builder::http_health_checks::GetOperation::new(self.inner.clone())
3524 }
3525}
3526
3527/// Implements a client for the Google Compute Engine API.
3528///
3529/// # Example
3530/// ```
3531/// # tokio_test::block_on(async {
3532/// # use google_cloud_compute_v1::client::HttpsHealthChecks;
3533/// let client = HttpsHealthChecks::builder().build().await?;
3534/// // use `client` to make requests to the Google Compute Engine API.
3535/// # gax::client_builder::Result::<()>::Ok(()) });
3536/// ```
3537///
3538/// # Service Description
3539///
3540/// Service for the `httpsHealthChecks` resource.
3541///
3542/// # Configuration
3543///
3544/// To configure `HttpsHealthChecks` use the `with_*` methods in the type returned
3545/// by [builder()][HttpsHealthChecks::builder]. The default configuration should
3546/// work for most applications. Common configuration changes include
3547///
3548/// * [with_endpoint()]: by default this client uses the global default endpoint
3549/// (`https://compute.googleapis.com`). Applications using regional
3550/// endpoints or running in restricted networks (e.g. a network configured
3551// with [Private Google Access with VPC Service Controls]) may want to
3552/// override this default.
3553/// * [with_credentials()]: by default this client uses
3554/// [Application Default Credentials]. Applications using custom
3555/// authentication may need to override this default.
3556///
3557/// [with_endpoint()]: super::builder::https_health_checks::ClientBuilder::with_endpoint
3558/// [with_credentials()]: super::builder::https_health_checks::ClientBuilder::credentials
3559/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3560/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3561///
3562/// # Pooling and Cloning
3563///
3564/// `HttpsHealthChecks` holds a connection pool internally, it is advised to
3565/// create one and the reuse it. You do not need to wrap `HttpsHealthChecks` in
3566/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3567/// already uses an `Arc` internally.
3568#[cfg(feature = "https-health-checks")]
3569#[cfg_attr(docsrs, doc(cfg(feature = "https-health-checks")))]
3570#[derive(Clone, Debug)]
3571pub struct HttpsHealthChecks {
3572 inner: std::sync::Arc<dyn super::stub::dynamic::HttpsHealthChecks>,
3573}
3574
3575#[cfg(feature = "https-health-checks")]
3576impl HttpsHealthChecks {
3577 /// Returns a builder for [HttpsHealthChecks].
3578 ///
3579 /// ```
3580 /// # tokio_test::block_on(async {
3581 /// # use google_cloud_compute_v1::client::HttpsHealthChecks;
3582 /// let client = HttpsHealthChecks::builder().build().await?;
3583 /// # gax::client_builder::Result::<()>::Ok(()) });
3584 /// ```
3585 pub fn builder() -> super::builder::https_health_checks::ClientBuilder {
3586 gax::client_builder::internal::new_builder(
3587 super::builder::https_health_checks::client::Factory,
3588 )
3589 }
3590
3591 /// Creates a new client from the provided stub.
3592 ///
3593 /// The most common case for calling this function is in tests mocking the
3594 /// client's behavior.
3595 pub fn from_stub<T>(stub: T) -> Self
3596 where
3597 T: super::stub::HttpsHealthChecks + 'static,
3598 {
3599 Self {
3600 inner: std::sync::Arc::new(stub),
3601 }
3602 }
3603
3604 pub(crate) async fn new(
3605 config: gaxi::options::ClientConfig,
3606 ) -> gax::client_builder::Result<Self> {
3607 let inner = Self::build_inner(config).await?;
3608 Ok(Self { inner })
3609 }
3610
3611 async fn build_inner(
3612 conf: gaxi::options::ClientConfig,
3613 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::HttpsHealthChecks>>
3614 {
3615 if gaxi::options::tracing_enabled(&conf) {
3616 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3617 }
3618 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3619 }
3620
3621 async fn build_transport(
3622 conf: gaxi::options::ClientConfig,
3623 ) -> gax::client_builder::Result<impl super::stub::HttpsHealthChecks> {
3624 super::transport::HttpsHealthChecks::new(conf).await
3625 }
3626
3627 async fn build_with_tracing(
3628 conf: gaxi::options::ClientConfig,
3629 ) -> gax::client_builder::Result<impl super::stub::HttpsHealthChecks> {
3630 Self::build_transport(conf)
3631 .await
3632 .map(super::tracing::HttpsHealthChecks::new)
3633 }
3634
3635 /// Deletes the specified HttpsHealthCheck resource.
3636 pub fn delete(&self) -> super::builder::https_health_checks::Delete {
3637 super::builder::https_health_checks::Delete::new(self.inner.clone())
3638 }
3639
3640 /// Returns the specified HttpsHealthCheck resource.
3641 pub fn get(&self) -> super::builder::https_health_checks::Get {
3642 super::builder::https_health_checks::Get::new(self.inner.clone())
3643 }
3644
3645 /// Creates a HttpsHealthCheck resource in the specified project using the data
3646 /// included in the request.
3647 pub fn insert(&self) -> super::builder::https_health_checks::Insert {
3648 super::builder::https_health_checks::Insert::new(self.inner.clone())
3649 }
3650
3651 /// Retrieves the list of HttpsHealthCheck resources available to the specified
3652 /// project.
3653 pub fn list(&self) -> super::builder::https_health_checks::List {
3654 super::builder::https_health_checks::List::new(self.inner.clone())
3655 }
3656
3657 /// Updates a HttpsHealthCheck resource in the specified project using the data
3658 /// included in the request. This method supportsPATCH
3659 /// semantics and uses theJSON merge
3660 /// patch format and processing rules.
3661 pub fn patch(&self) -> super::builder::https_health_checks::Patch {
3662 super::builder::https_health_checks::Patch::new(self.inner.clone())
3663 }
3664
3665 /// Updates a HttpsHealthCheck resource in the specified project using the data
3666 /// included in the request.
3667 pub fn update(&self) -> super::builder::https_health_checks::Update {
3668 super::builder::https_health_checks::Update::new(self.inner.clone())
3669 }
3670
3671 /// Retrieves the specified Operations resource.
3672 pub fn get_operation(&self) -> super::builder::https_health_checks::GetOperation {
3673 super::builder::https_health_checks::GetOperation::new(self.inner.clone())
3674 }
3675}
3676
3677/// Implements a client for the Google Compute Engine API.
3678///
3679/// # Example
3680/// ```
3681/// # tokio_test::block_on(async {
3682/// # use google_cloud_compute_v1::client::ImageFamilyViews;
3683/// let client = ImageFamilyViews::builder().build().await?;
3684/// // use `client` to make requests to the Google Compute Engine API.
3685/// # gax::client_builder::Result::<()>::Ok(()) });
3686/// ```
3687///
3688/// # Service Description
3689///
3690/// Service for the `imageFamilyViews` resource.
3691///
3692/// # Configuration
3693///
3694/// To configure `ImageFamilyViews` use the `with_*` methods in the type returned
3695/// by [builder()][ImageFamilyViews::builder]. The default configuration should
3696/// work for most applications. Common configuration changes include
3697///
3698/// * [with_endpoint()]: by default this client uses the global default endpoint
3699/// (`https://compute.googleapis.com`). Applications using regional
3700/// endpoints or running in restricted networks (e.g. a network configured
3701// with [Private Google Access with VPC Service Controls]) may want to
3702/// override this default.
3703/// * [with_credentials()]: by default this client uses
3704/// [Application Default Credentials]. Applications using custom
3705/// authentication may need to override this default.
3706///
3707/// [with_endpoint()]: super::builder::image_family_views::ClientBuilder::with_endpoint
3708/// [with_credentials()]: super::builder::image_family_views::ClientBuilder::credentials
3709/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3710/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3711///
3712/// # Pooling and Cloning
3713///
3714/// `ImageFamilyViews` holds a connection pool internally, it is advised to
3715/// create one and the reuse it. You do not need to wrap `ImageFamilyViews` in
3716/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3717/// already uses an `Arc` internally.
3718#[cfg(feature = "image-family-views")]
3719#[cfg_attr(docsrs, doc(cfg(feature = "image-family-views")))]
3720#[derive(Clone, Debug)]
3721pub struct ImageFamilyViews {
3722 inner: std::sync::Arc<dyn super::stub::dynamic::ImageFamilyViews>,
3723}
3724
3725#[cfg(feature = "image-family-views")]
3726impl ImageFamilyViews {
3727 /// Returns a builder for [ImageFamilyViews].
3728 ///
3729 /// ```
3730 /// # tokio_test::block_on(async {
3731 /// # use google_cloud_compute_v1::client::ImageFamilyViews;
3732 /// let client = ImageFamilyViews::builder().build().await?;
3733 /// # gax::client_builder::Result::<()>::Ok(()) });
3734 /// ```
3735 pub fn builder() -> super::builder::image_family_views::ClientBuilder {
3736 gax::client_builder::internal::new_builder(
3737 super::builder::image_family_views::client::Factory,
3738 )
3739 }
3740
3741 /// Creates a new client from the provided stub.
3742 ///
3743 /// The most common case for calling this function is in tests mocking the
3744 /// client's behavior.
3745 pub fn from_stub<T>(stub: T) -> Self
3746 where
3747 T: super::stub::ImageFamilyViews + 'static,
3748 {
3749 Self {
3750 inner: std::sync::Arc::new(stub),
3751 }
3752 }
3753
3754 pub(crate) async fn new(
3755 config: gaxi::options::ClientConfig,
3756 ) -> gax::client_builder::Result<Self> {
3757 let inner = Self::build_inner(config).await?;
3758 Ok(Self { inner })
3759 }
3760
3761 async fn build_inner(
3762 conf: gaxi::options::ClientConfig,
3763 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::ImageFamilyViews>>
3764 {
3765 if gaxi::options::tracing_enabled(&conf) {
3766 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3767 }
3768 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3769 }
3770
3771 async fn build_transport(
3772 conf: gaxi::options::ClientConfig,
3773 ) -> gax::client_builder::Result<impl super::stub::ImageFamilyViews> {
3774 super::transport::ImageFamilyViews::new(conf).await
3775 }
3776
3777 async fn build_with_tracing(
3778 conf: gaxi::options::ClientConfig,
3779 ) -> gax::client_builder::Result<impl super::stub::ImageFamilyViews> {
3780 Self::build_transport(conf)
3781 .await
3782 .map(super::tracing::ImageFamilyViews::new)
3783 }
3784
3785 /// Returns the latest image that is part of an image family, is not
3786 /// deprecated and is rolled out in the specified zone.
3787 pub fn get(&self) -> super::builder::image_family_views::Get {
3788 super::builder::image_family_views::Get::new(self.inner.clone())
3789 }
3790}
3791
3792/// Implements a client for the Google Compute Engine API.
3793///
3794/// # Example
3795/// ```
3796/// # tokio_test::block_on(async {
3797/// # use google_cloud_compute_v1::client::Images;
3798/// let client = Images::builder().build().await?;
3799/// // use `client` to make requests to the Google Compute Engine API.
3800/// # gax::client_builder::Result::<()>::Ok(()) });
3801/// ```
3802///
3803/// # Service Description
3804///
3805/// Service for the `images` resource.
3806///
3807/// # Configuration
3808///
3809/// To configure `Images` use the `with_*` methods in the type returned
3810/// by [builder()][Images::builder]. The default configuration should
3811/// work for most applications. Common configuration changes include
3812///
3813/// * [with_endpoint()]: by default this client uses the global default endpoint
3814/// (`https://compute.googleapis.com`). Applications using regional
3815/// endpoints or running in restricted networks (e.g. a network configured
3816// with [Private Google Access with VPC Service Controls]) may want to
3817/// override this default.
3818/// * [with_credentials()]: by default this client uses
3819/// [Application Default Credentials]. Applications using custom
3820/// authentication may need to override this default.
3821///
3822/// [with_endpoint()]: super::builder::images::ClientBuilder::with_endpoint
3823/// [with_credentials()]: super::builder::images::ClientBuilder::credentials
3824/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3825/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3826///
3827/// # Pooling and Cloning
3828///
3829/// `Images` holds a connection pool internally, it is advised to
3830/// create one and the reuse it. You do not need to wrap `Images` in
3831/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3832/// already uses an `Arc` internally.
3833#[cfg(feature = "images")]
3834#[cfg_attr(docsrs, doc(cfg(feature = "images")))]
3835#[derive(Clone, Debug)]
3836pub struct Images {
3837 inner: std::sync::Arc<dyn super::stub::dynamic::Images>,
3838}
3839
3840#[cfg(feature = "images")]
3841impl Images {
3842 /// Returns a builder for [Images].
3843 ///
3844 /// ```
3845 /// # tokio_test::block_on(async {
3846 /// # use google_cloud_compute_v1::client::Images;
3847 /// let client = Images::builder().build().await?;
3848 /// # gax::client_builder::Result::<()>::Ok(()) });
3849 /// ```
3850 pub fn builder() -> super::builder::images::ClientBuilder {
3851 gax::client_builder::internal::new_builder(super::builder::images::client::Factory)
3852 }
3853
3854 /// Creates a new client from the provided stub.
3855 ///
3856 /// The most common case for calling this function is in tests mocking the
3857 /// client's behavior.
3858 pub fn from_stub<T>(stub: T) -> Self
3859 where
3860 T: super::stub::Images + 'static,
3861 {
3862 Self {
3863 inner: std::sync::Arc::new(stub),
3864 }
3865 }
3866
3867 pub(crate) async fn new(
3868 config: gaxi::options::ClientConfig,
3869 ) -> gax::client_builder::Result<Self> {
3870 let inner = Self::build_inner(config).await?;
3871 Ok(Self { inner })
3872 }
3873
3874 async fn build_inner(
3875 conf: gaxi::options::ClientConfig,
3876 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Images>> {
3877 if gaxi::options::tracing_enabled(&conf) {
3878 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3879 }
3880 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3881 }
3882
3883 async fn build_transport(
3884 conf: gaxi::options::ClientConfig,
3885 ) -> gax::client_builder::Result<impl super::stub::Images> {
3886 super::transport::Images::new(conf).await
3887 }
3888
3889 async fn build_with_tracing(
3890 conf: gaxi::options::ClientConfig,
3891 ) -> gax::client_builder::Result<impl super::stub::Images> {
3892 Self::build_transport(conf)
3893 .await
3894 .map(super::tracing::Images::new)
3895 }
3896
3897 /// Deletes the specified image.
3898 pub fn delete(&self) -> super::builder::images::Delete {
3899 super::builder::images::Delete::new(self.inner.clone())
3900 }
3901
3902 /// Sets the deprecation status of an image.
3903 ///
3904 /// If an empty request body is given, clears the deprecation status instead.
3905 pub fn deprecate(&self) -> super::builder::images::Deprecate {
3906 super::builder::images::Deprecate::new(self.inner.clone())
3907 }
3908
3909 /// Returns the specified image.
3910 pub fn get(&self) -> super::builder::images::Get {
3911 super::builder::images::Get::new(self.inner.clone())
3912 }
3913
3914 /// Returns the latest image that is part of an image family and is not
3915 /// deprecated. For more information on image families, seePublic
3916 /// image families documentation.
3917 pub fn get_from_family(&self) -> super::builder::images::GetFromFamily {
3918 super::builder::images::GetFromFamily::new(self.inner.clone())
3919 }
3920
3921 /// Gets the access control policy for a resource. May be empty if no such
3922 /// policy or resource exists.
3923 pub fn get_iam_policy(&self) -> super::builder::images::GetIamPolicy {
3924 super::builder::images::GetIamPolicy::new(self.inner.clone())
3925 }
3926
3927 /// Creates an image in the specified project using the data included
3928 /// in the request.
3929 pub fn insert(&self) -> super::builder::images::Insert {
3930 super::builder::images::Insert::new(self.inner.clone())
3931 }
3932
3933 /// Retrieves the list of custom images
3934 /// available to the specified project. Custom images are images you
3935 /// create that belong to your project. This method does not
3936 /// get any images that belong to other projects, including publicly-available
3937 /// images, like Debian 8. If you want to get a list of publicly-available
3938 /// images, use this method to make a request to the respective image project,
3939 /// such as debian-cloud or windows-cloud.
3940 pub fn list(&self) -> super::builder::images::List {
3941 super::builder::images::List::new(self.inner.clone())
3942 }
3943
3944 /// Patches the specified image with the data included in the request.
3945 /// Only the following fields can be modified: family, description,
3946 /// deprecation status.
3947 pub fn patch(&self) -> super::builder::images::Patch {
3948 super::builder::images::Patch::new(self.inner.clone())
3949 }
3950
3951 /// Sets the access control policy on the specified resource.
3952 /// Replaces any existing policy.
3953 pub fn set_iam_policy(&self) -> super::builder::images::SetIamPolicy {
3954 super::builder::images::SetIamPolicy::new(self.inner.clone())
3955 }
3956
3957 /// Sets the labels on an image. To learn more about labels, read theLabeling
3958 /// Resources documentation.
3959 pub fn set_labels(&self) -> super::builder::images::SetLabels {
3960 super::builder::images::SetLabels::new(self.inner.clone())
3961 }
3962
3963 /// Returns permissions that a caller has on the specified resource.
3964 pub fn test_iam_permissions(&self) -> super::builder::images::TestIamPermissions {
3965 super::builder::images::TestIamPermissions::new(self.inner.clone())
3966 }
3967
3968 /// Retrieves the specified Operations resource.
3969 pub fn get_operation(&self) -> super::builder::images::GetOperation {
3970 super::builder::images::GetOperation::new(self.inner.clone())
3971 }
3972}
3973
3974/// Implements a client for the Google Compute Engine API.
3975///
3976/// # Example
3977/// ```
3978/// # tokio_test::block_on(async {
3979/// # use google_cloud_compute_v1::client::InstanceGroupManagerResizeRequests;
3980/// let client = InstanceGroupManagerResizeRequests::builder().build().await?;
3981/// // use `client` to make requests to the Google Compute Engine API.
3982/// # gax::client_builder::Result::<()>::Ok(()) });
3983/// ```
3984///
3985/// # Service Description
3986///
3987/// Service for the `instanceGroupManagerResizeRequests` resource.
3988///
3989/// # Configuration
3990///
3991/// To configure `InstanceGroupManagerResizeRequests` use the `with_*` methods in the type returned
3992/// by [builder()][InstanceGroupManagerResizeRequests::builder]. The default configuration should
3993/// work for most applications. Common configuration changes include
3994///
3995/// * [with_endpoint()]: by default this client uses the global default endpoint
3996/// (`https://compute.googleapis.com`). Applications using regional
3997/// endpoints or running in restricted networks (e.g. a network configured
3998// with [Private Google Access with VPC Service Controls]) may want to
3999/// override this default.
4000/// * [with_credentials()]: by default this client uses
4001/// [Application Default Credentials]. Applications using custom
4002/// authentication may need to override this default.
4003///
4004/// [with_endpoint()]: super::builder::instance_group_manager_resize_requests::ClientBuilder::with_endpoint
4005/// [with_credentials()]: super::builder::instance_group_manager_resize_requests::ClientBuilder::credentials
4006/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4007/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4008///
4009/// # Pooling and Cloning
4010///
4011/// `InstanceGroupManagerResizeRequests` holds a connection pool internally, it is advised to
4012/// create one and the reuse it. You do not need to wrap `InstanceGroupManagerResizeRequests` in
4013/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4014/// already uses an `Arc` internally.
4015#[cfg(feature = "instance-group-manager-resize-requests")]
4016#[cfg_attr(docsrs, doc(cfg(feature = "instance-group-manager-resize-requests")))]
4017#[derive(Clone, Debug)]
4018pub struct InstanceGroupManagerResizeRequests {
4019 inner: std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagerResizeRequests>,
4020}
4021
4022#[cfg(feature = "instance-group-manager-resize-requests")]
4023impl InstanceGroupManagerResizeRequests {
4024 /// Returns a builder for [InstanceGroupManagerResizeRequests].
4025 ///
4026 /// ```
4027 /// # tokio_test::block_on(async {
4028 /// # use google_cloud_compute_v1::client::InstanceGroupManagerResizeRequests;
4029 /// let client = InstanceGroupManagerResizeRequests::builder().build().await?;
4030 /// # gax::client_builder::Result::<()>::Ok(()) });
4031 /// ```
4032 pub fn builder() -> super::builder::instance_group_manager_resize_requests::ClientBuilder {
4033 gax::client_builder::internal::new_builder(
4034 super::builder::instance_group_manager_resize_requests::client::Factory,
4035 )
4036 }
4037
4038 /// Creates a new client from the provided stub.
4039 ///
4040 /// The most common case for calling this function is in tests mocking the
4041 /// client's behavior.
4042 pub fn from_stub<T>(stub: T) -> Self
4043 where
4044 T: super::stub::InstanceGroupManagerResizeRequests + 'static,
4045 {
4046 Self {
4047 inner: std::sync::Arc::new(stub),
4048 }
4049 }
4050
4051 pub(crate) async fn new(
4052 config: gaxi::options::ClientConfig,
4053 ) -> gax::client_builder::Result<Self> {
4054 let inner = Self::build_inner(config).await?;
4055 Ok(Self { inner })
4056 }
4057
4058 async fn build_inner(
4059 conf: gaxi::options::ClientConfig,
4060 ) -> gax::client_builder::Result<
4061 std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagerResizeRequests>,
4062 > {
4063 if gaxi::options::tracing_enabled(&conf) {
4064 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4065 }
4066 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4067 }
4068
4069 async fn build_transport(
4070 conf: gaxi::options::ClientConfig,
4071 ) -> gax::client_builder::Result<impl super::stub::InstanceGroupManagerResizeRequests> {
4072 super::transport::InstanceGroupManagerResizeRequests::new(conf).await
4073 }
4074
4075 async fn build_with_tracing(
4076 conf: gaxi::options::ClientConfig,
4077 ) -> gax::client_builder::Result<impl super::stub::InstanceGroupManagerResizeRequests> {
4078 Self::build_transport(conf)
4079 .await
4080 .map(super::tracing::InstanceGroupManagerResizeRequests::new)
4081 }
4082
4083 /// Cancels the specified resize request and removes it from the queue.
4084 /// Cancelled resize request does no longer wait for the resources to be
4085 /// provisioned. Cancel is only possible for requests that are accepted in the
4086 /// queue.
4087 pub fn cancel(&self) -> super::builder::instance_group_manager_resize_requests::Cancel {
4088 super::builder::instance_group_manager_resize_requests::Cancel::new(self.inner.clone())
4089 }
4090
4091 /// Deletes the specified, inactive resize request. Requests that are still
4092 /// active cannot be deleted. Deleting request does not delete instances that
4093 /// were provisioned previously.
4094 pub fn delete(&self) -> super::builder::instance_group_manager_resize_requests::Delete {
4095 super::builder::instance_group_manager_resize_requests::Delete::new(self.inner.clone())
4096 }
4097
4098 /// Returns all of the details about the specified resize request.
4099 pub fn get(&self) -> super::builder::instance_group_manager_resize_requests::Get {
4100 super::builder::instance_group_manager_resize_requests::Get::new(self.inner.clone())
4101 }
4102
4103 /// Creates a new resize request that starts provisioning VMs immediately
4104 /// or queues VM creation.
4105 pub fn insert(&self) -> super::builder::instance_group_manager_resize_requests::Insert {
4106 super::builder::instance_group_manager_resize_requests::Insert::new(self.inner.clone())
4107 }
4108
4109 /// Retrieves a list of resize requests that are contained in the
4110 /// managed instance group.
4111 pub fn list(&self) -> super::builder::instance_group_manager_resize_requests::List {
4112 super::builder::instance_group_manager_resize_requests::List::new(self.inner.clone())
4113 }
4114
4115 /// Retrieves the specified zone-specific Operations resource.
4116 pub fn get_operation(
4117 &self,
4118 ) -> super::builder::instance_group_manager_resize_requests::GetOperation {
4119 super::builder::instance_group_manager_resize_requests::GetOperation::new(
4120 self.inner.clone(),
4121 )
4122 }
4123}
4124
4125/// Implements a client for the Google Compute Engine API.
4126///
4127/// # Example
4128/// ```
4129/// # tokio_test::block_on(async {
4130/// # use google_cloud_compute_v1::client::InstanceGroupManagers;
4131/// let client = InstanceGroupManagers::builder().build().await?;
4132/// // use `client` to make requests to the Google Compute Engine API.
4133/// # gax::client_builder::Result::<()>::Ok(()) });
4134/// ```
4135///
4136/// # Service Description
4137///
4138/// Service for the `instanceGroupManagers` resource.
4139///
4140/// # Configuration
4141///
4142/// To configure `InstanceGroupManagers` use the `with_*` methods in the type returned
4143/// by [builder()][InstanceGroupManagers::builder]. The default configuration should
4144/// work for most applications. Common configuration changes include
4145///
4146/// * [with_endpoint()]: by default this client uses the global default endpoint
4147/// (`https://compute.googleapis.com`). Applications using regional
4148/// endpoints or running in restricted networks (e.g. a network configured
4149// with [Private Google Access with VPC Service Controls]) may want to
4150/// override this default.
4151/// * [with_credentials()]: by default this client uses
4152/// [Application Default Credentials]. Applications using custom
4153/// authentication may need to override this default.
4154///
4155/// [with_endpoint()]: super::builder::instance_group_managers::ClientBuilder::with_endpoint
4156/// [with_credentials()]: super::builder::instance_group_managers::ClientBuilder::credentials
4157/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4158/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4159///
4160/// # Pooling and Cloning
4161///
4162/// `InstanceGroupManagers` holds a connection pool internally, it is advised to
4163/// create one and the reuse it. You do not need to wrap `InstanceGroupManagers` in
4164/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4165/// already uses an `Arc` internally.
4166#[cfg(feature = "instance-group-managers")]
4167#[cfg_attr(docsrs, doc(cfg(feature = "instance-group-managers")))]
4168#[derive(Clone, Debug)]
4169pub struct InstanceGroupManagers {
4170 inner: std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagers>,
4171}
4172
4173#[cfg(feature = "instance-group-managers")]
4174impl InstanceGroupManagers {
4175 /// Returns a builder for [InstanceGroupManagers].
4176 ///
4177 /// ```
4178 /// # tokio_test::block_on(async {
4179 /// # use google_cloud_compute_v1::client::InstanceGroupManagers;
4180 /// let client = InstanceGroupManagers::builder().build().await?;
4181 /// # gax::client_builder::Result::<()>::Ok(()) });
4182 /// ```
4183 pub fn builder() -> super::builder::instance_group_managers::ClientBuilder {
4184 gax::client_builder::internal::new_builder(
4185 super::builder::instance_group_managers::client::Factory,
4186 )
4187 }
4188
4189 /// Creates a new client from the provided stub.
4190 ///
4191 /// The most common case for calling this function is in tests mocking the
4192 /// client's behavior.
4193 pub fn from_stub<T>(stub: T) -> Self
4194 where
4195 T: super::stub::InstanceGroupManagers + 'static,
4196 {
4197 Self {
4198 inner: std::sync::Arc::new(stub),
4199 }
4200 }
4201
4202 pub(crate) async fn new(
4203 config: gaxi::options::ClientConfig,
4204 ) -> gax::client_builder::Result<Self> {
4205 let inner = Self::build_inner(config).await?;
4206 Ok(Self { inner })
4207 }
4208
4209 async fn build_inner(
4210 conf: gaxi::options::ClientConfig,
4211 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagers>>
4212 {
4213 if gaxi::options::tracing_enabled(&conf) {
4214 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4215 }
4216 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4217 }
4218
4219 async fn build_transport(
4220 conf: gaxi::options::ClientConfig,
4221 ) -> gax::client_builder::Result<impl super::stub::InstanceGroupManagers> {
4222 super::transport::InstanceGroupManagers::new(conf).await
4223 }
4224
4225 async fn build_with_tracing(
4226 conf: gaxi::options::ClientConfig,
4227 ) -> gax::client_builder::Result<impl super::stub::InstanceGroupManagers> {
4228 Self::build_transport(conf)
4229 .await
4230 .map(super::tracing::InstanceGroupManagers::new)
4231 }
4232
4233 /// Flags the specified instances to be removed from the
4234 /// managed instance group. Abandoning an instance does not delete the
4235 /// instance, but it does remove the instance from any target pools that are
4236 /// applied by the managed instance group. This method reduces thetargetSize of the managed instance group by the
4237 /// number of instances that you abandon. This operation is marked asDONE when the action is scheduled even if the instances have
4238 /// not yet been removed from the group. You must separately verify the
4239 /// status of the abandoning action with thelistmanagedinstances
4240 /// method.
4241 ///
4242 /// If the group is part of a backend
4243 /// service that has enabled
4244 /// connection draining, it can take up to 60 seconds after the connection
4245 /// draining duration has elapsed before the VM instance is removed or deleted.
4246 ///
4247 /// You can specify a maximum of 1000 instances with this method per request.
4248 pub fn abandon_instances(&self) -> super::builder::instance_group_managers::AbandonInstances {
4249 super::builder::instance_group_managers::AbandonInstances::new(self.inner.clone())
4250 }
4251
4252 /// Retrieves the list of managed instance groups and groups them by zone.
4253 ///
4254 /// To prevent failure, Google recommends that you set the
4255 /// `returnPartialSuccess` parameter to `true`.
4256 pub fn aggregated_list(&self) -> super::builder::instance_group_managers::AggregatedList {
4257 super::builder::instance_group_managers::AggregatedList::new(self.inner.clone())
4258 }
4259
4260 /// Applies changes to selected instances on the managed instance group.
4261 /// This method can be used to apply new overrides and/or new versions.
4262 pub fn apply_updates_to_instances(
4263 &self,
4264 ) -> super::builder::instance_group_managers::ApplyUpdatesToInstances {
4265 super::builder::instance_group_managers::ApplyUpdatesToInstances::new(self.inner.clone())
4266 }
4267
4268 /// Creates instances with per-instance configurations in this managed instance
4269 /// group. Instances are created using the current instance template. Thecreate instances operation is marked DONE if thecreateInstances request is successful. The underlying actions
4270 /// take additional time. You must separately verify the status of thecreating or actions with the listmanagedinstances
4271 /// method.
4272 pub fn create_instances(&self) -> super::builder::instance_group_managers::CreateInstances {
4273 super::builder::instance_group_managers::CreateInstances::new(self.inner.clone())
4274 }
4275
4276 /// Deletes the specified managed instance group and all of the instances
4277 /// in that group. Note that the instance group must not belong to a
4278 /// backend service. Read
4279 /// Deleting an instance group for more information.
4280 pub fn delete(&self) -> super::builder::instance_group_managers::Delete {
4281 super::builder::instance_group_managers::Delete::new(self.inner.clone())
4282 }
4283
4284 /// Flags the specified instances in the managed instance group for immediate
4285 /// deletion. The instances are also removed from any target
4286 /// pools of which they were a member. This method reduces thetargetSize of the managed instance group by the number of
4287 /// instances that you delete. This operation is marked as DONE
4288 /// when the action is scheduled even if the instances are still being deleted.
4289 /// You must separately verify the status of the deleting action
4290 /// with thelistmanagedinstances
4291 /// method.
4292 ///
4293 /// If the group is part of a backend
4294 /// service that has enabled
4295 /// connection draining, it can take up to 60 seconds after the connection
4296 /// draining duration has elapsed before the VM instance is removed or deleted.
4297 ///
4298 /// You can specify a maximum of 1000 instances with this method per request.
4299 pub fn delete_instances(&self) -> super::builder::instance_group_managers::DeleteInstances {
4300 super::builder::instance_group_managers::DeleteInstances::new(self.inner.clone())
4301 }
4302
4303 /// Deletes selected per-instance configurations for the managed instance
4304 /// group.
4305 pub fn delete_per_instance_configs(
4306 &self,
4307 ) -> super::builder::instance_group_managers::DeletePerInstanceConfigs {
4308 super::builder::instance_group_managers::DeletePerInstanceConfigs::new(self.inner.clone())
4309 }
4310
4311 /// Returns all of the details about the specified managed instance group.
4312 pub fn get(&self) -> super::builder::instance_group_managers::Get {
4313 super::builder::instance_group_managers::Get::new(self.inner.clone())
4314 }
4315
4316 /// Creates a managed instance group using the information that you specify
4317 /// in the request. After the group is created, instances in the group are
4318 /// created using the specified instance template.
4319 /// This operation is marked as DONE when the group is created
4320 /// even if the instances in the group have not yet been created. You
4321 /// must separately verify the status of the individual instances with thelistmanagedinstances
4322 /// method.
4323 ///
4324 /// A managed instance group can have up to 1000 VM instances per group. Please
4325 /// contact Cloud Support if you need an increase in
4326 /// this limit.
4327 pub fn insert(&self) -> super::builder::instance_group_managers::Insert {
4328 super::builder::instance_group_managers::Insert::new(self.inner.clone())
4329 }
4330
4331 /// Retrieves a list of managed instance groups that are contained within the
4332 /// specified project and zone.
4333 pub fn list(&self) -> super::builder::instance_group_managers::List {
4334 super::builder::instance_group_managers::List::new(self.inner.clone())
4335 }
4336
4337 /// Lists all errors thrown by actions on instances for a given managed
4338 /// instance group. The filter and orderBy query
4339 /// parameters are not supported.
4340 pub fn list_errors(&self) -> super::builder::instance_group_managers::ListErrors {
4341 super::builder::instance_group_managers::ListErrors::new(self.inner.clone())
4342 }
4343
4344 /// Lists all of the instances in the managed instance group. Each instance
4345 /// in the list has a currentAction, which indicates the action
4346 /// that the managed instance group is performing on the instance. For example,
4347 /// if the group is still creating an instance, the currentAction
4348 /// is CREATING. If a previous action failed, the
4349 /// list displays the errors for that failed action. The orderBy
4350 /// query parameter is not supported. The `pageToken` query parameter is
4351 /// supported only if the group's `listManagedInstancesResults` field is set
4352 /// to `PAGINATED`.
4353 pub fn list_managed_instances(
4354 &self,
4355 ) -> super::builder::instance_group_managers::ListManagedInstances {
4356 super::builder::instance_group_managers::ListManagedInstances::new(self.inner.clone())
4357 }
4358
4359 /// Lists all of the per-instance configurations defined for the managed
4360 /// instance group. The orderBy query parameter is not supported.
4361 pub fn list_per_instance_configs(
4362 &self,
4363 ) -> super::builder::instance_group_managers::ListPerInstanceConfigs {
4364 super::builder::instance_group_managers::ListPerInstanceConfigs::new(self.inner.clone())
4365 }
4366
4367 /// Updates a managed instance group using the information that you specify
4368 /// in the request.
4369 /// This operation is marked as DONE when the group is patched
4370 /// even if the instances in the group are still in the process of being
4371 /// patched. You must separately verify the status of the individual instances
4372 /// with thelistManagedInstances
4373 /// method. This method supportsPATCH
4374 /// semantics and uses theJSON merge
4375 /// patch format and processing rules.
4376 ///
4377 /// If you update your group to specify a new template or instance
4378 /// configuration, it's possible that your intended specification for each VM
4379 /// in the group is different from the current state of that VM. To learn how
4380 /// to apply an updated configuration to the VMs in a MIG, seeUpdating instances in
4381 /// a MIG.
4382 pub fn patch(&self) -> super::builder::instance_group_managers::Patch {
4383 super::builder::instance_group_managers::Patch::new(self.inner.clone())
4384 }
4385
4386 /// Inserts or patches per-instance configurations for the managed instance
4387 /// group. perInstanceConfig.name serves as a key used to
4388 /// distinguish whether to perform insert or patch.
4389 pub fn patch_per_instance_configs(
4390 &self,
4391 ) -> super::builder::instance_group_managers::PatchPerInstanceConfigs {
4392 super::builder::instance_group_managers::PatchPerInstanceConfigs::new(self.inner.clone())
4393 }
4394
4395 /// Flags the specified VM instances in the managed instance group to be
4396 /// immediately recreated. Each instance is recreated using the group's current
4397 /// configuration. This operation is marked as DONE when the flag
4398 /// is set even if the instances have not yet been recreated. You must
4399 /// separately verify the status of each instance by checking itscurrentAction field; for more information, see Checking
4400 /// the status of managed instances.
4401 ///
4402 /// If the group is part of a backend
4403 /// service that has enabled
4404 /// connection draining, it can take up to 60 seconds after the connection
4405 /// draining duration has elapsed before the VM instance is removed or deleted.
4406 ///
4407 /// You can specify a maximum of 1000 instances with this method per request.
4408 pub fn recreate_instances(&self) -> super::builder::instance_group_managers::RecreateInstances {
4409 super::builder::instance_group_managers::RecreateInstances::new(self.inner.clone())
4410 }
4411
4412 /// Resizes the managed instance group. If you increase the size, the group
4413 /// creates new instances using the current instance template. If you decrease
4414 /// the size, the group deletes instances. The resize operation is markedDONE when the resize actions are scheduled even if the group
4415 /// has not yet added or deleted any instances. You must separately
4416 /// verify the status of the creating or deleting
4417 /// actions with thelistmanagedinstances
4418 /// method.
4419 ///
4420 /// When resizing down, the instance group arbitrarily chooses the order in
4421 /// which VMs are deleted. The group takes into account some VM attributes when
4422 /// making the selection including:
4423 ///
4424 /// + The status of the VM instance.
4425 /// + The health of the VM instance.
4426 /// + The instance template version the VM is based on.
4427 /// + For regional managed instance groups, the location of the VM instance.
4428 ///
4429 /// This list is subject to change.
4430 ///
4431 /// If the group is part of a backend
4432 /// service that has enabled
4433 /// connection draining, it can take up to 60 seconds after the connection
4434 /// draining duration has elapsed before the VM instance is removed or deleted.
4435 pub fn resize(&self) -> super::builder::instance_group_managers::Resize {
4436 super::builder::instance_group_managers::Resize::new(self.inner.clone())
4437 }
4438
4439 /// Flags the specified instances in the managed instance group to be
4440 /// resumed. This method increases thetargetSize and decreases the targetSuspendedSize
4441 /// of the managed instance group by the number of instances that you resume.
4442 /// The resumeInstances operation is marked DONE if
4443 /// the resumeInstances request is successful. The underlying
4444 /// actions take additional time. You must separately verify the status of theRESUMING action with thelistmanagedinstances
4445 /// method.
4446 ///
4447 /// In this request, you can only specify instances that are suspended. For
4448 /// example, if an instance was previously suspended using the suspendInstances
4449 /// method, it can be resumed using the resumeInstances method.
4450 ///
4451 /// If a health check is attached to the managed instance group, the specified
4452 /// instances will be verified as healthy after they are resumed.
4453 ///
4454 /// You can specify a maximum of 1000 instances with this method per request.
4455 pub fn resume_instances(&self) -> super::builder::instance_group_managers::ResumeInstances {
4456 super::builder::instance_group_managers::ResumeInstances::new(self.inner.clone())
4457 }
4458
4459 /// Specifies the instance template to use when creating new instances in this
4460 /// group. The templates for existing instances in the group do not change
4461 /// unless you run recreateInstances, runapplyUpdatesToInstances, or set the group'supdatePolicy.type to PROACTIVE.
4462 pub fn set_instance_template(
4463 &self,
4464 ) -> super::builder::instance_group_managers::SetInstanceTemplate {
4465 super::builder::instance_group_managers::SetInstanceTemplate::new(self.inner.clone())
4466 }
4467
4468 /// Modifies the target pools to which all instances in this managed instance
4469 /// group are assigned. The target pools automatically apply to all of the
4470 /// instances in the managed instance group. This operation is markedDONE when you make the request even if the instances have not
4471 /// yet been added to their target pools. The change might take some time to
4472 /// apply to all of the instances in the group depending on the size of the
4473 /// group.
4474 pub fn set_target_pools(&self) -> super::builder::instance_group_managers::SetTargetPools {
4475 super::builder::instance_group_managers::SetTargetPools::new(self.inner.clone())
4476 }
4477
4478 /// Flags the specified instances in the managed instance group to be
4479 /// started. This method increases thetargetSize and decreases the targetStoppedSize
4480 /// of the managed instance group by the number of instances that you start.
4481 /// The startInstances operation is marked DONE if
4482 /// the startInstances request is successful. The underlying
4483 /// actions take additional time. You must separately verify the status of theSTARTING action with thelistmanagedinstances
4484 /// method.
4485 ///
4486 /// In this request, you can only specify instances that are stopped. For
4487 /// example, if an instance was previously stopped using the stopInstances
4488 /// method, it can be started using the startInstances method.
4489 ///
4490 /// If a health check is attached to the managed instance group, the specified
4491 /// instances will be verified as healthy after they are started.
4492 ///
4493 /// You can specify a maximum of 1000 instances with this method per request.
4494 pub fn start_instances(&self) -> super::builder::instance_group_managers::StartInstances {
4495 super::builder::instance_group_managers::StartInstances::new(self.inner.clone())
4496 }
4497
4498 /// Flags the specified instances in the managed instance group to be
4499 /// immediately stopped. You can only specify instances that are running in
4500 /// this request. This method reduces thetargetSize and increases the targetStoppedSize
4501 /// of the managed instance group by the number of instances that you stop.
4502 /// The stopInstances operation is marked DONE if
4503 /// the stopInstances request is successful. The underlying
4504 /// actions take additional time. You must separately verify the status of theSTOPPING action with thelistmanagedinstances
4505 /// method.
4506 ///
4507 /// If the standbyPolicy.initialDelaySec field is set, the group
4508 /// delays stopping the instances until initialDelaySec have
4509 /// passed from instance.creationTimestamp (that is, when the
4510 /// instance was created). This delay gives your application time to
4511 /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
4512 /// will be zero delay.
4513 ///
4514 /// If the group is part of a backend
4515 /// service that has enabled
4516 /// connection draining, it can take up to 60 seconds after the connection
4517 /// draining duration has elapsed before the VM instance is stopped.
4518 ///
4519 /// Stopped instances can be started using the startInstances
4520 /// method.
4521 ///
4522 /// You can specify a maximum of 1000 instances with this method per request.
4523 pub fn stop_instances(&self) -> super::builder::instance_group_managers::StopInstances {
4524 super::builder::instance_group_managers::StopInstances::new(self.inner.clone())
4525 }
4526
4527 /// Flags the specified instances in the managed instance group to be
4528 /// immediately suspended. You can only specify instances that are running in
4529 /// this request. This method reduces thetargetSize and increases the targetSuspendedSize
4530 /// of the managed instance group by the number of instances that you suspend.
4531 /// The suspendInstances operation is marked DONE if
4532 /// the suspendInstances request is successful. The underlying
4533 /// actions take additional time. You must separately verify the status of theSUSPENDING action with thelistmanagedinstances
4534 /// method.
4535 ///
4536 /// If the standbyPolicy.initialDelaySec field is set, the group
4537 /// delays suspension of the instances until initialDelaySec have
4538 /// passed from instance.creationTimestamp (that is, when the
4539 /// instance was created). This delay gives your application time to
4540 /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
4541 /// will be zero delay.
4542 ///
4543 /// If the group is part of a backend
4544 /// service that has enabled
4545 /// connection draining, it can take up to 60 seconds after the connection
4546 /// draining duration has elapsed before the VM instance is suspended.
4547 ///
4548 /// Suspended instances can be resumed using the resumeInstances
4549 /// method.
4550 ///
4551 /// You can specify a maximum of 1000 instances with this method per request.
4552 pub fn suspend_instances(&self) -> super::builder::instance_group_managers::SuspendInstances {
4553 super::builder::instance_group_managers::SuspendInstances::new(self.inner.clone())
4554 }
4555
4556 /// Inserts or updates per-instance configurations for the managed instance
4557 /// group. perInstanceConfig.name serves as a key used to
4558 /// distinguish whether to perform insert or patch.
4559 pub fn update_per_instance_configs(
4560 &self,
4561 ) -> super::builder::instance_group_managers::UpdatePerInstanceConfigs {
4562 super::builder::instance_group_managers::UpdatePerInstanceConfigs::new(self.inner.clone())
4563 }
4564
4565 /// Retrieves the specified zone-specific Operations resource.
4566 pub fn get_operation(&self) -> super::builder::instance_group_managers::GetOperation {
4567 super::builder::instance_group_managers::GetOperation::new(self.inner.clone())
4568 }
4569}
4570
4571/// Implements a client for the Google Compute Engine API.
4572///
4573/// # Example
4574/// ```
4575/// # tokio_test::block_on(async {
4576/// # use google_cloud_compute_v1::client::InstanceGroups;
4577/// let client = InstanceGroups::builder().build().await?;
4578/// // use `client` to make requests to the Google Compute Engine API.
4579/// # gax::client_builder::Result::<()>::Ok(()) });
4580/// ```
4581///
4582/// # Service Description
4583///
4584/// Service for the `instanceGroups` resource.
4585///
4586/// # Configuration
4587///
4588/// To configure `InstanceGroups` use the `with_*` methods in the type returned
4589/// by [builder()][InstanceGroups::builder]. The default configuration should
4590/// work for most applications. Common configuration changes include
4591///
4592/// * [with_endpoint()]: by default this client uses the global default endpoint
4593/// (`https://compute.googleapis.com`). Applications using regional
4594/// endpoints or running in restricted networks (e.g. a network configured
4595// with [Private Google Access with VPC Service Controls]) may want to
4596/// override this default.
4597/// * [with_credentials()]: by default this client uses
4598/// [Application Default Credentials]. Applications using custom
4599/// authentication may need to override this default.
4600///
4601/// [with_endpoint()]: super::builder::instance_groups::ClientBuilder::with_endpoint
4602/// [with_credentials()]: super::builder::instance_groups::ClientBuilder::credentials
4603/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4604/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4605///
4606/// # Pooling and Cloning
4607///
4608/// `InstanceGroups` holds a connection pool internally, it is advised to
4609/// create one and the reuse it. You do not need to wrap `InstanceGroups` in
4610/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4611/// already uses an `Arc` internally.
4612#[cfg(feature = "instance-groups")]
4613#[cfg_attr(docsrs, doc(cfg(feature = "instance-groups")))]
4614#[derive(Clone, Debug)]
4615pub struct InstanceGroups {
4616 inner: std::sync::Arc<dyn super::stub::dynamic::InstanceGroups>,
4617}
4618
4619#[cfg(feature = "instance-groups")]
4620impl InstanceGroups {
4621 /// Returns a builder for [InstanceGroups].
4622 ///
4623 /// ```
4624 /// # tokio_test::block_on(async {
4625 /// # use google_cloud_compute_v1::client::InstanceGroups;
4626 /// let client = InstanceGroups::builder().build().await?;
4627 /// # gax::client_builder::Result::<()>::Ok(()) });
4628 /// ```
4629 pub fn builder() -> super::builder::instance_groups::ClientBuilder {
4630 gax::client_builder::internal::new_builder(super::builder::instance_groups::client::Factory)
4631 }
4632
4633 /// Creates a new client from the provided stub.
4634 ///
4635 /// The most common case for calling this function is in tests mocking the
4636 /// client's behavior.
4637 pub fn from_stub<T>(stub: T) -> Self
4638 where
4639 T: super::stub::InstanceGroups + 'static,
4640 {
4641 Self {
4642 inner: std::sync::Arc::new(stub),
4643 }
4644 }
4645
4646 pub(crate) async fn new(
4647 config: gaxi::options::ClientConfig,
4648 ) -> gax::client_builder::Result<Self> {
4649 let inner = Self::build_inner(config).await?;
4650 Ok(Self { inner })
4651 }
4652
4653 async fn build_inner(
4654 conf: gaxi::options::ClientConfig,
4655 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::InstanceGroups>> {
4656 if gaxi::options::tracing_enabled(&conf) {
4657 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4658 }
4659 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4660 }
4661
4662 async fn build_transport(
4663 conf: gaxi::options::ClientConfig,
4664 ) -> gax::client_builder::Result<impl super::stub::InstanceGroups> {
4665 super::transport::InstanceGroups::new(conf).await
4666 }
4667
4668 async fn build_with_tracing(
4669 conf: gaxi::options::ClientConfig,
4670 ) -> gax::client_builder::Result<impl super::stub::InstanceGroups> {
4671 Self::build_transport(conf)
4672 .await
4673 .map(super::tracing::InstanceGroups::new)
4674 }
4675
4676 /// Adds a list of instances to the specified instance group. All of the
4677 /// instances in the instance group must be in the same network/subnetwork.
4678 /// Read
4679 /// Adding instances for more information.
4680 pub fn add_instances(&self) -> super::builder::instance_groups::AddInstances {
4681 super::builder::instance_groups::AddInstances::new(self.inner.clone())
4682 }
4683
4684 /// Retrieves the list of instance groups and sorts them by zone.
4685 ///
4686 /// To prevent failure, Google recommends that you set the
4687 /// `returnPartialSuccess` parameter to `true`.
4688 pub fn aggregated_list(&self) -> super::builder::instance_groups::AggregatedList {
4689 super::builder::instance_groups::AggregatedList::new(self.inner.clone())
4690 }
4691
4692 /// Deletes the specified instance group. The instances in the group are not
4693 /// deleted. Note that instance group must not belong to a backend service.
4694 /// Read
4695 /// Deleting an instance group for more information.
4696 pub fn delete(&self) -> super::builder::instance_groups::Delete {
4697 super::builder::instance_groups::Delete::new(self.inner.clone())
4698 }
4699
4700 /// Returns the specified zonal instance group. Get a list of available zonal
4701 /// instance groups by making a list() request.
4702 ///
4703 /// For managed instance groups, use theinstanceGroupManagers
4704 /// or regionInstanceGroupManagers
4705 /// methods instead.
4706 pub fn get(&self) -> super::builder::instance_groups::Get {
4707 super::builder::instance_groups::Get::new(self.inner.clone())
4708 }
4709
4710 /// Creates an instance group in the specified project using the
4711 /// parameters that are included in the request.
4712 pub fn insert(&self) -> super::builder::instance_groups::Insert {
4713 super::builder::instance_groups::Insert::new(self.inner.clone())
4714 }
4715
4716 /// Retrieves the list of zonal instance group resources contained within the
4717 /// specified zone.
4718 ///
4719 /// For managed instance groups, use theinstanceGroupManagers
4720 /// or regionInstanceGroupManagers
4721 /// methods instead.
4722 pub fn list(&self) -> super::builder::instance_groups::List {
4723 super::builder::instance_groups::List::new(self.inner.clone())
4724 }
4725
4726 /// Lists the instances in the specified instance group.
4727 /// The orderBy query parameter is not supported.
4728 /// The filter query parameter is supported, but only for
4729 /// expressions that use `eq` (equal) or `ne` (not equal) operators.
4730 pub fn list_instances(&self) -> super::builder::instance_groups::ListInstances {
4731 super::builder::instance_groups::ListInstances::new(self.inner.clone())
4732 }
4733
4734 /// Removes one or more instances from the specified instance group, but does
4735 /// not delete those instances.
4736 ///
4737 /// If the group is part of a backend
4738 /// service that has enabled
4739 /// connection draining, it can take up to 60 seconds after the connection
4740 /// draining duration before the VM instance is removed or deleted.
4741 pub fn remove_instances(&self) -> super::builder::instance_groups::RemoveInstances {
4742 super::builder::instance_groups::RemoveInstances::new(self.inner.clone())
4743 }
4744
4745 /// Sets the named ports for the specified instance group.
4746 pub fn set_named_ports(&self) -> super::builder::instance_groups::SetNamedPorts {
4747 super::builder::instance_groups::SetNamedPorts::new(self.inner.clone())
4748 }
4749
4750 /// Returns permissions that a caller has on the specified resource.
4751 pub fn test_iam_permissions(&self) -> super::builder::instance_groups::TestIamPermissions {
4752 super::builder::instance_groups::TestIamPermissions::new(self.inner.clone())
4753 }
4754
4755 /// Retrieves the specified zone-specific Operations resource.
4756 pub fn get_operation(&self) -> super::builder::instance_groups::GetOperation {
4757 super::builder::instance_groups::GetOperation::new(self.inner.clone())
4758 }
4759}
4760
4761/// Implements a client for the Google Compute Engine API.
4762///
4763/// # Example
4764/// ```
4765/// # tokio_test::block_on(async {
4766/// # use google_cloud_compute_v1::client::InstanceSettings;
4767/// let client = InstanceSettings::builder().build().await?;
4768/// // use `client` to make requests to the Google Compute Engine API.
4769/// # gax::client_builder::Result::<()>::Ok(()) });
4770/// ```
4771///
4772/// # Service Description
4773///
4774/// Service for the `instanceSettings` resource.
4775///
4776/// # Configuration
4777///
4778/// To configure `InstanceSettings` use the `with_*` methods in the type returned
4779/// by [builder()][InstanceSettings::builder]. The default configuration should
4780/// work for most applications. Common configuration changes include
4781///
4782/// * [with_endpoint()]: by default this client uses the global default endpoint
4783/// (`https://compute.googleapis.com`). Applications using regional
4784/// endpoints or running in restricted networks (e.g. a network configured
4785// with [Private Google Access with VPC Service Controls]) may want to
4786/// override this default.
4787/// * [with_credentials()]: by default this client uses
4788/// [Application Default Credentials]. Applications using custom
4789/// authentication may need to override this default.
4790///
4791/// [with_endpoint()]: super::builder::instance_settings::ClientBuilder::with_endpoint
4792/// [with_credentials()]: super::builder::instance_settings::ClientBuilder::credentials
4793/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4794/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4795///
4796/// # Pooling and Cloning
4797///
4798/// `InstanceSettings` holds a connection pool internally, it is advised to
4799/// create one and the reuse it. You do not need to wrap `InstanceSettings` in
4800/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4801/// already uses an `Arc` internally.
4802#[cfg(feature = "instance-settings")]
4803#[cfg_attr(docsrs, doc(cfg(feature = "instance-settings")))]
4804#[derive(Clone, Debug)]
4805pub struct InstanceSettings {
4806 inner: std::sync::Arc<dyn super::stub::dynamic::InstanceSettings>,
4807}
4808
4809#[cfg(feature = "instance-settings")]
4810impl InstanceSettings {
4811 /// Returns a builder for [InstanceSettings].
4812 ///
4813 /// ```
4814 /// # tokio_test::block_on(async {
4815 /// # use google_cloud_compute_v1::client::InstanceSettings;
4816 /// let client = InstanceSettings::builder().build().await?;
4817 /// # gax::client_builder::Result::<()>::Ok(()) });
4818 /// ```
4819 pub fn builder() -> super::builder::instance_settings::ClientBuilder {
4820 gax::client_builder::internal::new_builder(
4821 super::builder::instance_settings::client::Factory,
4822 )
4823 }
4824
4825 /// Creates a new client from the provided stub.
4826 ///
4827 /// The most common case for calling this function is in tests mocking the
4828 /// client's behavior.
4829 pub fn from_stub<T>(stub: T) -> Self
4830 where
4831 T: super::stub::InstanceSettings + 'static,
4832 {
4833 Self {
4834 inner: std::sync::Arc::new(stub),
4835 }
4836 }
4837
4838 pub(crate) async fn new(
4839 config: gaxi::options::ClientConfig,
4840 ) -> gax::client_builder::Result<Self> {
4841 let inner = Self::build_inner(config).await?;
4842 Ok(Self { inner })
4843 }
4844
4845 async fn build_inner(
4846 conf: gaxi::options::ClientConfig,
4847 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::InstanceSettings>>
4848 {
4849 if gaxi::options::tracing_enabled(&conf) {
4850 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4851 }
4852 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4853 }
4854
4855 async fn build_transport(
4856 conf: gaxi::options::ClientConfig,
4857 ) -> gax::client_builder::Result<impl super::stub::InstanceSettings> {
4858 super::transport::InstanceSettings::new(conf).await
4859 }
4860
4861 async fn build_with_tracing(
4862 conf: gaxi::options::ClientConfig,
4863 ) -> gax::client_builder::Result<impl super::stub::InstanceSettings> {
4864 Self::build_transport(conf)
4865 .await
4866 .map(super::tracing::InstanceSettings::new)
4867 }
4868
4869 /// Get Instance settings.
4870 pub fn get(&self) -> super::builder::instance_settings::Get {
4871 super::builder::instance_settings::Get::new(self.inner.clone())
4872 }
4873
4874 /// Patch Instance settings
4875 pub fn patch(&self) -> super::builder::instance_settings::Patch {
4876 super::builder::instance_settings::Patch::new(self.inner.clone())
4877 }
4878
4879 /// Retrieves the specified zone-specific Operations resource.
4880 pub fn get_operation(&self) -> super::builder::instance_settings::GetOperation {
4881 super::builder::instance_settings::GetOperation::new(self.inner.clone())
4882 }
4883}
4884
4885/// Implements a client for the Google Compute Engine API.
4886///
4887/// # Example
4888/// ```
4889/// # tokio_test::block_on(async {
4890/// # use google_cloud_compute_v1::client::InstanceTemplates;
4891/// let client = InstanceTemplates::builder().build().await?;
4892/// // use `client` to make requests to the Google Compute Engine API.
4893/// # gax::client_builder::Result::<()>::Ok(()) });
4894/// ```
4895///
4896/// # Service Description
4897///
4898/// Service for the `instanceTemplates` resource.
4899///
4900/// # Configuration
4901///
4902/// To configure `InstanceTemplates` use the `with_*` methods in the type returned
4903/// by [builder()][InstanceTemplates::builder]. The default configuration should
4904/// work for most applications. Common configuration changes include
4905///
4906/// * [with_endpoint()]: by default this client uses the global default endpoint
4907/// (`https://compute.googleapis.com`). Applications using regional
4908/// endpoints or running in restricted networks (e.g. a network configured
4909// with [Private Google Access with VPC Service Controls]) may want to
4910/// override this default.
4911/// * [with_credentials()]: by default this client uses
4912/// [Application Default Credentials]. Applications using custom
4913/// authentication may need to override this default.
4914///
4915/// [with_endpoint()]: super::builder::instance_templates::ClientBuilder::with_endpoint
4916/// [with_credentials()]: super::builder::instance_templates::ClientBuilder::credentials
4917/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4918/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4919///
4920/// # Pooling and Cloning
4921///
4922/// `InstanceTemplates` holds a connection pool internally, it is advised to
4923/// create one and the reuse it. You do not need to wrap `InstanceTemplates` in
4924/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4925/// already uses an `Arc` internally.
4926#[cfg(feature = "instance-templates")]
4927#[cfg_attr(docsrs, doc(cfg(feature = "instance-templates")))]
4928#[derive(Clone, Debug)]
4929pub struct InstanceTemplates {
4930 inner: std::sync::Arc<dyn super::stub::dynamic::InstanceTemplates>,
4931}
4932
4933#[cfg(feature = "instance-templates")]
4934impl InstanceTemplates {
4935 /// Returns a builder for [InstanceTemplates].
4936 ///
4937 /// ```
4938 /// # tokio_test::block_on(async {
4939 /// # use google_cloud_compute_v1::client::InstanceTemplates;
4940 /// let client = InstanceTemplates::builder().build().await?;
4941 /// # gax::client_builder::Result::<()>::Ok(()) });
4942 /// ```
4943 pub fn builder() -> super::builder::instance_templates::ClientBuilder {
4944 gax::client_builder::internal::new_builder(
4945 super::builder::instance_templates::client::Factory,
4946 )
4947 }
4948
4949 /// Creates a new client from the provided stub.
4950 ///
4951 /// The most common case for calling this function is in tests mocking the
4952 /// client's behavior.
4953 pub fn from_stub<T>(stub: T) -> Self
4954 where
4955 T: super::stub::InstanceTemplates + 'static,
4956 {
4957 Self {
4958 inner: std::sync::Arc::new(stub),
4959 }
4960 }
4961
4962 pub(crate) async fn new(
4963 config: gaxi::options::ClientConfig,
4964 ) -> gax::client_builder::Result<Self> {
4965 let inner = Self::build_inner(config).await?;
4966 Ok(Self { inner })
4967 }
4968
4969 async fn build_inner(
4970 conf: gaxi::options::ClientConfig,
4971 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::InstanceTemplates>>
4972 {
4973 if gaxi::options::tracing_enabled(&conf) {
4974 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4975 }
4976 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4977 }
4978
4979 async fn build_transport(
4980 conf: gaxi::options::ClientConfig,
4981 ) -> gax::client_builder::Result<impl super::stub::InstanceTemplates> {
4982 super::transport::InstanceTemplates::new(conf).await
4983 }
4984
4985 async fn build_with_tracing(
4986 conf: gaxi::options::ClientConfig,
4987 ) -> gax::client_builder::Result<impl super::stub::InstanceTemplates> {
4988 Self::build_transport(conf)
4989 .await
4990 .map(super::tracing::InstanceTemplates::new)
4991 }
4992
4993 /// Retrieves the list of all InstanceTemplates resources, regional and global,
4994 /// available to the specified project.
4995 ///
4996 /// To prevent failure, Google recommends that you set the
4997 /// `returnPartialSuccess` parameter to `true`.
4998 pub fn aggregated_list(&self) -> super::builder::instance_templates::AggregatedList {
4999 super::builder::instance_templates::AggregatedList::new(self.inner.clone())
5000 }
5001
5002 /// Deletes the specified instance template. Deleting an instance template is
5003 /// permanent and cannot be undone. It is not possible to delete templates
5004 /// that are already in use by a managed instance group.
5005 pub fn delete(&self) -> super::builder::instance_templates::Delete {
5006 super::builder::instance_templates::Delete::new(self.inner.clone())
5007 }
5008
5009 /// Returns the specified instance template.
5010 pub fn get(&self) -> super::builder::instance_templates::Get {
5011 super::builder::instance_templates::Get::new(self.inner.clone())
5012 }
5013
5014 /// Gets the access control policy for a resource. May be empty if no such
5015 /// policy or resource exists.
5016 pub fn get_iam_policy(&self) -> super::builder::instance_templates::GetIamPolicy {
5017 super::builder::instance_templates::GetIamPolicy::new(self.inner.clone())
5018 }
5019
5020 /// Creates an instance template in the specified project using the
5021 /// data that is included in the request. If you are creating a new template to
5022 /// update an existing instance group, your new instance template must use the
5023 /// same network or, if applicable, the same subnetwork as the original
5024 /// template.
5025 pub fn insert(&self) -> super::builder::instance_templates::Insert {
5026 super::builder::instance_templates::Insert::new(self.inner.clone())
5027 }
5028
5029 /// Retrieves a list of instance templates that are contained within
5030 /// the specified project.
5031 pub fn list(&self) -> super::builder::instance_templates::List {
5032 super::builder::instance_templates::List::new(self.inner.clone())
5033 }
5034
5035 /// Sets the access control policy on the specified resource.
5036 /// Replaces any existing policy.
5037 pub fn set_iam_policy(&self) -> super::builder::instance_templates::SetIamPolicy {
5038 super::builder::instance_templates::SetIamPolicy::new(self.inner.clone())
5039 }
5040
5041 /// Returns permissions that a caller has on the specified resource.
5042 pub fn test_iam_permissions(&self) -> super::builder::instance_templates::TestIamPermissions {
5043 super::builder::instance_templates::TestIamPermissions::new(self.inner.clone())
5044 }
5045
5046 /// Retrieves the specified Operations resource.
5047 pub fn get_operation(&self) -> super::builder::instance_templates::GetOperation {
5048 super::builder::instance_templates::GetOperation::new(self.inner.clone())
5049 }
5050}
5051
5052/// Implements a client for the Google Compute Engine API.
5053///
5054/// # Example
5055/// ```
5056/// # tokio_test::block_on(async {
5057/// # use google_cloud_compute_v1::client::Instances;
5058/// let client = Instances::builder().build().await?;
5059/// // use `client` to make requests to the Google Compute Engine API.
5060/// # gax::client_builder::Result::<()>::Ok(()) });
5061/// ```
5062///
5063/// # Service Description
5064///
5065/// Service for the `instances` resource.
5066///
5067/// # Configuration
5068///
5069/// To configure `Instances` use the `with_*` methods in the type returned
5070/// by [builder()][Instances::builder]. The default configuration should
5071/// work for most applications. Common configuration changes include
5072///
5073/// * [with_endpoint()]: by default this client uses the global default endpoint
5074/// (`https://compute.googleapis.com`). Applications using regional
5075/// endpoints or running in restricted networks (e.g. a network configured
5076// with [Private Google Access with VPC Service Controls]) may want to
5077/// override this default.
5078/// * [with_credentials()]: by default this client uses
5079/// [Application Default Credentials]. Applications using custom
5080/// authentication may need to override this default.
5081///
5082/// [with_endpoint()]: super::builder::instances::ClientBuilder::with_endpoint
5083/// [with_credentials()]: super::builder::instances::ClientBuilder::credentials
5084/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5085/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5086///
5087/// # Pooling and Cloning
5088///
5089/// `Instances` holds a connection pool internally, it is advised to
5090/// create one and the reuse it. You do not need to wrap `Instances` in
5091/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5092/// already uses an `Arc` internally.
5093#[cfg(feature = "instances")]
5094#[cfg_attr(docsrs, doc(cfg(feature = "instances")))]
5095#[derive(Clone, Debug)]
5096pub struct Instances {
5097 inner: std::sync::Arc<dyn super::stub::dynamic::Instances>,
5098}
5099
5100#[cfg(feature = "instances")]
5101impl Instances {
5102 /// Returns a builder for [Instances].
5103 ///
5104 /// ```
5105 /// # tokio_test::block_on(async {
5106 /// # use google_cloud_compute_v1::client::Instances;
5107 /// let client = Instances::builder().build().await?;
5108 /// # gax::client_builder::Result::<()>::Ok(()) });
5109 /// ```
5110 pub fn builder() -> super::builder::instances::ClientBuilder {
5111 gax::client_builder::internal::new_builder(super::builder::instances::client::Factory)
5112 }
5113
5114 /// Creates a new client from the provided stub.
5115 ///
5116 /// The most common case for calling this function is in tests mocking the
5117 /// client's behavior.
5118 pub fn from_stub<T>(stub: T) -> Self
5119 where
5120 T: super::stub::Instances + 'static,
5121 {
5122 Self {
5123 inner: std::sync::Arc::new(stub),
5124 }
5125 }
5126
5127 pub(crate) async fn new(
5128 config: gaxi::options::ClientConfig,
5129 ) -> gax::client_builder::Result<Self> {
5130 let inner = Self::build_inner(config).await?;
5131 Ok(Self { inner })
5132 }
5133
5134 async fn build_inner(
5135 conf: gaxi::options::ClientConfig,
5136 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Instances>> {
5137 if gaxi::options::tracing_enabled(&conf) {
5138 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5139 }
5140 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5141 }
5142
5143 async fn build_transport(
5144 conf: gaxi::options::ClientConfig,
5145 ) -> gax::client_builder::Result<impl super::stub::Instances> {
5146 super::transport::Instances::new(conf).await
5147 }
5148
5149 async fn build_with_tracing(
5150 conf: gaxi::options::ClientConfig,
5151 ) -> gax::client_builder::Result<impl super::stub::Instances> {
5152 Self::build_transport(conf)
5153 .await
5154 .map(super::tracing::Instances::new)
5155 }
5156
5157 /// Adds an access config to an instance's network interface.
5158 pub fn add_access_config(&self) -> super::builder::instances::AddAccessConfig {
5159 super::builder::instances::AddAccessConfig::new(self.inner.clone())
5160 }
5161
5162 /// Adds one dynamic network interface to an active instance.
5163 pub fn add_network_interface(&self) -> super::builder::instances::AddNetworkInterface {
5164 super::builder::instances::AddNetworkInterface::new(self.inner.clone())
5165 }
5166
5167 /// Adds existing resource policies to an instance. You can only add one
5168 /// policy right now which will be applied to this instance for scheduling live
5169 /// migrations.
5170 pub fn add_resource_policies(&self) -> super::builder::instances::AddResourcePolicies {
5171 super::builder::instances::AddResourcePolicies::new(self.inner.clone())
5172 }
5173
5174 /// Retrieves an aggregated list of all of the instances in your project
5175 /// across all regions and zones.
5176 ///
5177 /// The performance of this method degrades when a filter is specified on a
5178 /// project that has a very large number of instances.
5179 ///
5180 /// To prevent failure, Google recommends that you set the
5181 /// `returnPartialSuccess` parameter to `true`.
5182 pub fn aggregated_list(&self) -> super::builder::instances::AggregatedList {
5183 super::builder::instances::AggregatedList::new(self.inner.clone())
5184 }
5185
5186 /// Attaches an existing Disk resource to an instance. You must first
5187 /// create the disk before you can attach it. It is not possible to create
5188 /// and attach a disk at the same time. For more information, readAdding a
5189 /// persistent disk to your instance.
5190 pub fn attach_disk(&self) -> super::builder::instances::AttachDisk {
5191 super::builder::instances::AttachDisk::new(self.inner.clone())
5192 }
5193
5194 /// Creates multiple instances. Count specifies the number of instances to
5195 /// create. For more information, seeAbout bulk
5196 /// creation of VMs.
5197 pub fn bulk_insert(&self) -> super::builder::instances::BulkInsert {
5198 super::builder::instances::BulkInsert::new(self.inner.clone())
5199 }
5200
5201 /// Deletes the specified Instance resource. For more information, seeDeleting
5202 /// an instance.
5203 pub fn delete(&self) -> super::builder::instances::Delete {
5204 super::builder::instances::Delete::new(self.inner.clone())
5205 }
5206
5207 /// Deletes an access config from an instance's network interface.
5208 pub fn delete_access_config(&self) -> super::builder::instances::DeleteAccessConfig {
5209 super::builder::instances::DeleteAccessConfig::new(self.inner.clone())
5210 }
5211
5212 /// Deletes one dynamic network interface from an active instance.
5213 /// InstancesDeleteNetworkInterfaceRequest indicates:
5214 ///
5215 /// - instance from which to delete, using project+zone+resource_id fields;
5216 /// - dynamic network interface to be deleted, using network_interface_name
5217 /// field;
5218 pub fn delete_network_interface(&self) -> super::builder::instances::DeleteNetworkInterface {
5219 super::builder::instances::DeleteNetworkInterface::new(self.inner.clone())
5220 }
5221
5222 /// Detaches a disk from an instance.
5223 pub fn detach_disk(&self) -> super::builder::instances::DetachDisk {
5224 super::builder::instances::DetachDisk::new(self.inner.clone())
5225 }
5226
5227 /// Returns the specified Instance resource.
5228 pub fn get(&self) -> super::builder::instances::Get {
5229 super::builder::instances::Get::new(self.inner.clone())
5230 }
5231
5232 /// Returns effective firewalls applied to an interface of the instance.
5233 pub fn get_effective_firewalls(&self) -> super::builder::instances::GetEffectiveFirewalls {
5234 super::builder::instances::GetEffectiveFirewalls::new(self.inner.clone())
5235 }
5236
5237 /// Returns the specified guest attributes entry.
5238 pub fn get_guest_attributes(&self) -> super::builder::instances::GetGuestAttributes {
5239 super::builder::instances::GetGuestAttributes::new(self.inner.clone())
5240 }
5241
5242 /// Gets the access control policy for a resource. May be empty if no such
5243 /// policy or resource exists.
5244 pub fn get_iam_policy(&self) -> super::builder::instances::GetIamPolicy {
5245 super::builder::instances::GetIamPolicy::new(self.inner.clone())
5246 }
5247
5248 /// Returns the screenshot from the specified instance.
5249 pub fn get_screenshot(&self) -> super::builder::instances::GetScreenshot {
5250 super::builder::instances::GetScreenshot::new(self.inner.clone())
5251 }
5252
5253 /// Returns the last 1 MB of serial port output from the specified instance.
5254 pub fn get_serial_port_output(&self) -> super::builder::instances::GetSerialPortOutput {
5255 super::builder::instances::GetSerialPortOutput::new(self.inner.clone())
5256 }
5257
5258 /// Returns the Shielded Instance Identity of an instance
5259 pub fn get_shielded_instance_identity(
5260 &self,
5261 ) -> super::builder::instances::GetShieldedInstanceIdentity {
5262 super::builder::instances::GetShieldedInstanceIdentity::new(self.inner.clone())
5263 }
5264
5265 /// Creates an instance resource in the specified project using the data
5266 /// included in the request.
5267 pub fn insert(&self) -> super::builder::instances::Insert {
5268 super::builder::instances::Insert::new(self.inner.clone())
5269 }
5270
5271 /// Retrieves the list of instances contained within
5272 /// the specified zone.
5273 pub fn list(&self) -> super::builder::instances::List {
5274 super::builder::instances::List::new(self.inner.clone())
5275 }
5276
5277 /// Retrieves a list of resources that refer to the VM instance specified in
5278 /// the request. For example, if the VM instance is part of a managed or
5279 /// unmanaged instance group, the referrers list includes the instance group.
5280 /// For more information, readViewing
5281 /// referrers to VM instances.
5282 pub fn list_referrers(&self) -> super::builder::instances::ListReferrers {
5283 super::builder::instances::ListReferrers::new(self.inner.clone())
5284 }
5285
5286 /// Perform a manual maintenance on the instance.
5287 pub fn perform_maintenance(&self) -> super::builder::instances::PerformMaintenance {
5288 super::builder::instances::PerformMaintenance::new(self.inner.clone())
5289 }
5290
5291 /// Removes resource policies from an instance.
5292 pub fn remove_resource_policies(&self) -> super::builder::instances::RemoveResourcePolicies {
5293 super::builder::instances::RemoveResourcePolicies::new(self.inner.clone())
5294 }
5295
5296 /// Mark the host as faulty and try to restart the instance on a new host.
5297 pub fn report_host_as_faulty(&self) -> super::builder::instances::ReportHostAsFaulty {
5298 super::builder::instances::ReportHostAsFaulty::new(self.inner.clone())
5299 }
5300
5301 /// Performs a reset on the instance. This is a hard reset. The VM
5302 /// does not do a graceful shutdown. For more information, seeResetting
5303 /// an instance.
5304 pub fn reset(&self) -> super::builder::instances::Reset {
5305 super::builder::instances::Reset::new(self.inner.clone())
5306 }
5307
5308 /// Resumes an instance that was suspended using theinstances().suspend
5309 /// method.
5310 pub fn resume(&self) -> super::builder::instances::Resume {
5311 super::builder::instances::Resume::new(self.inner.clone())
5312 }
5313
5314 /// Sends diagnostic interrupt to the instance.
5315 pub fn send_diagnostic_interrupt(&self) -> super::builder::instances::SendDiagnosticInterrupt {
5316 super::builder::instances::SendDiagnosticInterrupt::new(self.inner.clone())
5317 }
5318
5319 /// Sets deletion protection on the instance.
5320 pub fn set_deletion_protection(&self) -> super::builder::instances::SetDeletionProtection {
5321 super::builder::instances::SetDeletionProtection::new(self.inner.clone())
5322 }
5323
5324 /// Sets the auto-delete flag for a disk attached to an instance.
5325 pub fn set_disk_auto_delete(&self) -> super::builder::instances::SetDiskAutoDelete {
5326 super::builder::instances::SetDiskAutoDelete::new(self.inner.clone())
5327 }
5328
5329 /// Sets the access control policy on the specified resource.
5330 /// Replaces any existing policy.
5331 pub fn set_iam_policy(&self) -> super::builder::instances::SetIamPolicy {
5332 super::builder::instances::SetIamPolicy::new(self.inner.clone())
5333 }
5334
5335 /// Sets labels on an instance. To learn more about labels, read theLabeling
5336 /// Resources documentation.
5337 pub fn set_labels(&self) -> super::builder::instances::SetLabels {
5338 super::builder::instances::SetLabels::new(self.inner.clone())
5339 }
5340
5341 /// Changes the number and/or type of accelerator for a stopped instance to the
5342 /// values specified in the request.
5343 pub fn set_machine_resources(&self) -> super::builder::instances::SetMachineResources {
5344 super::builder::instances::SetMachineResources::new(self.inner.clone())
5345 }
5346
5347 /// Changes the machine type for a stopped instance to the machine
5348 /// type specified in the request.
5349 pub fn set_machine_type(&self) -> super::builder::instances::SetMachineType {
5350 super::builder::instances::SetMachineType::new(self.inner.clone())
5351 }
5352
5353 /// Sets metadata for the specified instance to the data included
5354 /// in the request.
5355 pub fn set_metadata(&self) -> super::builder::instances::SetMetadata {
5356 super::builder::instances::SetMetadata::new(self.inner.clone())
5357 }
5358
5359 /// Changes the minimum CPU platform that this instance should use.
5360 /// This method can only
5361 /// be called on a stopped instance. For more information, readSpecifying a
5362 /// Minimum CPU Platform.
5363 pub fn set_min_cpu_platform(&self) -> super::builder::instances::SetMinCpuPlatform {
5364 super::builder::instances::SetMinCpuPlatform::new(self.inner.clone())
5365 }
5366
5367 /// Sets name of an instance.
5368 pub fn set_name(&self) -> super::builder::instances::SetName {
5369 super::builder::instances::SetName::new(self.inner.clone())
5370 }
5371
5372 /// Sets an instance's scheduling options. You can only call this method on astopped instance,
5373 /// that is, a VM instance that is in a `TERMINATED` state. SeeInstance Life
5374 /// Cycle for more information on the possible instance states.
5375 /// For more information about setting scheduling options for a VM, seeSet
5376 /// VM host maintenance policy.
5377 pub fn set_scheduling(&self) -> super::builder::instances::SetScheduling {
5378 super::builder::instances::SetScheduling::new(self.inner.clone())
5379 }
5380
5381 /// Sets the Google Cloud Armor security policy for the specified instance.
5382 /// For more information, seeGoogle
5383 /// Cloud Armor Overview
5384 pub fn set_security_policy(&self) -> super::builder::instances::SetSecurityPolicy {
5385 super::builder::instances::SetSecurityPolicy::new(self.inner.clone())
5386 }
5387
5388 /// Sets the service account on the instance. For more information,
5389 /// readChanging
5390 /// the service account and access scopes for an instance.
5391 pub fn set_service_account(&self) -> super::builder::instances::SetServiceAccount {
5392 super::builder::instances::SetServiceAccount::new(self.inner.clone())
5393 }
5394
5395 /// Sets the Shielded Instance integrity policy for an instance. You can
5396 /// only use this method on a running instance. This method
5397 /// supports PATCH semantics and uses the JSON merge
5398 /// patch format and processing rules.
5399 pub fn set_shielded_instance_integrity_policy(
5400 &self,
5401 ) -> super::builder::instances::SetShieldedInstanceIntegrityPolicy {
5402 super::builder::instances::SetShieldedInstanceIntegrityPolicy::new(self.inner.clone())
5403 }
5404
5405 /// Sets network tags
5406 /// for the specified instance to the data included in the request.
5407 pub fn set_tags(&self) -> super::builder::instances::SetTags {
5408 super::builder::instances::SetTags::new(self.inner.clone())
5409 }
5410
5411 /// Simulates a host maintenance event on a VM. For more information, see
5412 /// Simulate a host maintenance event.
5413 pub fn simulate_maintenance_event(
5414 &self,
5415 ) -> super::builder::instances::SimulateMaintenanceEvent {
5416 super::builder::instances::SimulateMaintenanceEvent::new(self.inner.clone())
5417 }
5418
5419 /// Starts an instance that was stopped using theinstances().stop
5420 /// method. For more information, seeRestart an
5421 /// instance.
5422 pub fn start(&self) -> super::builder::instances::Start {
5423 super::builder::instances::Start::new(self.inner.clone())
5424 }
5425
5426 /// Starts an instance that was stopped using theinstances().stop
5427 /// method. For more information, seeRestart an
5428 /// instance.
5429 pub fn start_with_encryption_key(&self) -> super::builder::instances::StartWithEncryptionKey {
5430 super::builder::instances::StartWithEncryptionKey::new(self.inner.clone())
5431 }
5432
5433 /// Stops a running instance, shutting it down cleanly, and allows
5434 /// you to restart the instance at a later time. Stopped instances do not incur
5435 /// VM usage charges while they are stopped. However, resources that the VM is
5436 /// using, such as persistent disks and static IP addresses, will continue to
5437 /// be charged until they are deleted. For more information, seeStopping
5438 /// an instance.
5439 pub fn stop(&self) -> super::builder::instances::Stop {
5440 super::builder::instances::Stop::new(self.inner.clone())
5441 }
5442
5443 /// This method suspends a running instance, saving its state to persistent
5444 /// storage, and allows you to resume the instance at a later time. Suspended
5445 /// instances have no compute costs (cores or RAM), and incur only storage
5446 /// charges for the saved VM memory and localSSD data. Any charged resources
5447 /// the virtual machine was using, such as persistent disks and static IP
5448 /// addresses, will continue to be charged while the instance is suspended.
5449 /// For more information, see
5450 /// Suspending and resuming an instance.
5451 pub fn suspend(&self) -> super::builder::instances::Suspend {
5452 super::builder::instances::Suspend::new(self.inner.clone())
5453 }
5454
5455 /// Returns permissions that a caller has on the specified resource.
5456 pub fn test_iam_permissions(&self) -> super::builder::instances::TestIamPermissions {
5457 super::builder::instances::TestIamPermissions::new(self.inner.clone())
5458 }
5459
5460 /// Updates an instance only if the necessary resources are available. This
5461 /// method can update only a specific set of instance properties. See
5462 /// Updating a running instance for a list of updatable instance
5463 /// properties.
5464 pub fn update(&self) -> super::builder::instances::Update {
5465 super::builder::instances::Update::new(self.inner.clone())
5466 }
5467
5468 /// Updates the specified access config from an instance's network interface
5469 /// with the data included in the request. This method supportsPATCH
5470 /// semantics and uses theJSON merge
5471 /// patch format and processing rules.
5472 pub fn update_access_config(&self) -> super::builder::instances::UpdateAccessConfig {
5473 super::builder::instances::UpdateAccessConfig::new(self.inner.clone())
5474 }
5475
5476 /// Updates the Display config for a VM instance. You can
5477 /// only use this method on a stopped VM instance. This method supportsPATCH
5478 /// semantics and uses theJSON merge
5479 /// patch format and processing rules.
5480 pub fn update_display_device(&self) -> super::builder::instances::UpdateDisplayDevice {
5481 super::builder::instances::UpdateDisplayDevice::new(self.inner.clone())
5482 }
5483
5484 /// Updates an instance's network interface. This method can only update an
5485 /// interface's alias IP range and attached network. See Modifying
5486 /// alias IP ranges for an existing instance for instructions on
5487 /// changing alias IP ranges. See Migrating
5488 /// a VM between networks for instructions on migrating an interface.
5489 /// This method follows PATCH semantics.
5490 pub fn update_network_interface(&self) -> super::builder::instances::UpdateNetworkInterface {
5491 super::builder::instances::UpdateNetworkInterface::new(self.inner.clone())
5492 }
5493
5494 /// Updates the Shielded Instance config for an instance. You can
5495 /// only use this method on a stopped instance. This method supportsPATCH
5496 /// semantics and uses theJSON merge
5497 /// patch format and processing rules.
5498 pub fn update_shielded_instance_config(
5499 &self,
5500 ) -> super::builder::instances::UpdateShieldedInstanceConfig {
5501 super::builder::instances::UpdateShieldedInstanceConfig::new(self.inner.clone())
5502 }
5503
5504 /// Retrieves the specified zone-specific Operations resource.
5505 pub fn get_operation(&self) -> super::builder::instances::GetOperation {
5506 super::builder::instances::GetOperation::new(self.inner.clone())
5507 }
5508}
5509
5510/// Implements a client for the Google Compute Engine API.
5511///
5512/// # Example
5513/// ```
5514/// # tokio_test::block_on(async {
5515/// # use google_cloud_compute_v1::client::InstantSnapshots;
5516/// let client = InstantSnapshots::builder().build().await?;
5517/// // use `client` to make requests to the Google Compute Engine API.
5518/// # gax::client_builder::Result::<()>::Ok(()) });
5519/// ```
5520///
5521/// # Service Description
5522///
5523/// Service for the `instantSnapshots` resource.
5524///
5525/// # Configuration
5526///
5527/// To configure `InstantSnapshots` use the `with_*` methods in the type returned
5528/// by [builder()][InstantSnapshots::builder]. The default configuration should
5529/// work for most applications. Common configuration changes include
5530///
5531/// * [with_endpoint()]: by default this client uses the global default endpoint
5532/// (`https://compute.googleapis.com`). Applications using regional
5533/// endpoints or running in restricted networks (e.g. a network configured
5534// with [Private Google Access with VPC Service Controls]) may want to
5535/// override this default.
5536/// * [with_credentials()]: by default this client uses
5537/// [Application Default Credentials]. Applications using custom
5538/// authentication may need to override this default.
5539///
5540/// [with_endpoint()]: super::builder::instant_snapshots::ClientBuilder::with_endpoint
5541/// [with_credentials()]: super::builder::instant_snapshots::ClientBuilder::credentials
5542/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5543/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5544///
5545/// # Pooling and Cloning
5546///
5547/// `InstantSnapshots` holds a connection pool internally, it is advised to
5548/// create one and the reuse it. You do not need to wrap `InstantSnapshots` in
5549/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5550/// already uses an `Arc` internally.
5551#[cfg(feature = "instant-snapshots")]
5552#[cfg_attr(docsrs, doc(cfg(feature = "instant-snapshots")))]
5553#[derive(Clone, Debug)]
5554pub struct InstantSnapshots {
5555 inner: std::sync::Arc<dyn super::stub::dynamic::InstantSnapshots>,
5556}
5557
5558#[cfg(feature = "instant-snapshots")]
5559impl InstantSnapshots {
5560 /// Returns a builder for [InstantSnapshots].
5561 ///
5562 /// ```
5563 /// # tokio_test::block_on(async {
5564 /// # use google_cloud_compute_v1::client::InstantSnapshots;
5565 /// let client = InstantSnapshots::builder().build().await?;
5566 /// # gax::client_builder::Result::<()>::Ok(()) });
5567 /// ```
5568 pub fn builder() -> super::builder::instant_snapshots::ClientBuilder {
5569 gax::client_builder::internal::new_builder(
5570 super::builder::instant_snapshots::client::Factory,
5571 )
5572 }
5573
5574 /// Creates a new client from the provided stub.
5575 ///
5576 /// The most common case for calling this function is in tests mocking the
5577 /// client's behavior.
5578 pub fn from_stub<T>(stub: T) -> Self
5579 where
5580 T: super::stub::InstantSnapshots + 'static,
5581 {
5582 Self {
5583 inner: std::sync::Arc::new(stub),
5584 }
5585 }
5586
5587 pub(crate) async fn new(
5588 config: gaxi::options::ClientConfig,
5589 ) -> gax::client_builder::Result<Self> {
5590 let inner = Self::build_inner(config).await?;
5591 Ok(Self { inner })
5592 }
5593
5594 async fn build_inner(
5595 conf: gaxi::options::ClientConfig,
5596 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::InstantSnapshots>>
5597 {
5598 if gaxi::options::tracing_enabled(&conf) {
5599 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5600 }
5601 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5602 }
5603
5604 async fn build_transport(
5605 conf: gaxi::options::ClientConfig,
5606 ) -> gax::client_builder::Result<impl super::stub::InstantSnapshots> {
5607 super::transport::InstantSnapshots::new(conf).await
5608 }
5609
5610 async fn build_with_tracing(
5611 conf: gaxi::options::ClientConfig,
5612 ) -> gax::client_builder::Result<impl super::stub::InstantSnapshots> {
5613 Self::build_transport(conf)
5614 .await
5615 .map(super::tracing::InstantSnapshots::new)
5616 }
5617
5618 /// Retrieves an aggregated list of instantSnapshots.
5619 ///
5620 /// To prevent failure, Google recommends that you set the
5621 /// `returnPartialSuccess` parameter to `true`.
5622 pub fn aggregated_list(&self) -> super::builder::instant_snapshots::AggregatedList {
5623 super::builder::instant_snapshots::AggregatedList::new(self.inner.clone())
5624 }
5625
5626 /// Deletes the specified InstantSnapshot resource. Keep in mind that deleting
5627 /// a single instantSnapshot might not necessarily delete all the data on that
5628 /// instantSnapshot. If any data on the instantSnapshot that is marked for
5629 /// deletion is needed for subsequent instantSnapshots, the data will be moved
5630 /// to the next corresponding instantSnapshot.
5631 ///
5632 /// For more information, seeDeleting
5633 /// instantSnapshots.
5634 pub fn delete(&self) -> super::builder::instant_snapshots::Delete {
5635 super::builder::instant_snapshots::Delete::new(self.inner.clone())
5636 }
5637
5638 /// Returns the specified InstantSnapshot resource in the specified zone.
5639 pub fn get(&self) -> super::builder::instant_snapshots::Get {
5640 super::builder::instant_snapshots::Get::new(self.inner.clone())
5641 }
5642
5643 /// Gets the access control policy for a resource. May be empty if no such
5644 /// policy or resource exists.
5645 pub fn get_iam_policy(&self) -> super::builder::instant_snapshots::GetIamPolicy {
5646 super::builder::instant_snapshots::GetIamPolicy::new(self.inner.clone())
5647 }
5648
5649 /// Creates an instant snapshot in the specified zone.
5650 pub fn insert(&self) -> super::builder::instant_snapshots::Insert {
5651 super::builder::instant_snapshots::Insert::new(self.inner.clone())
5652 }
5653
5654 /// Retrieves the list of InstantSnapshot resources contained within
5655 /// the specified zone.
5656 pub fn list(&self) -> super::builder::instant_snapshots::List {
5657 super::builder::instant_snapshots::List::new(self.inner.clone())
5658 }
5659
5660 /// Sets the access control policy on the specified resource.
5661 /// Replaces any existing policy.
5662 pub fn set_iam_policy(&self) -> super::builder::instant_snapshots::SetIamPolicy {
5663 super::builder::instant_snapshots::SetIamPolicy::new(self.inner.clone())
5664 }
5665
5666 /// Sets the labels on a instantSnapshot in the given zone. To learn more about
5667 /// labels, read the Labeling
5668 /// Resources documentation.
5669 pub fn set_labels(&self) -> super::builder::instant_snapshots::SetLabels {
5670 super::builder::instant_snapshots::SetLabels::new(self.inner.clone())
5671 }
5672
5673 /// Returns permissions that a caller has on the specified resource.
5674 pub fn test_iam_permissions(&self) -> super::builder::instant_snapshots::TestIamPermissions {
5675 super::builder::instant_snapshots::TestIamPermissions::new(self.inner.clone())
5676 }
5677
5678 /// Retrieves the specified zone-specific Operations resource.
5679 pub fn get_operation(&self) -> super::builder::instant_snapshots::GetOperation {
5680 super::builder::instant_snapshots::GetOperation::new(self.inner.clone())
5681 }
5682}
5683
5684/// Implements a client for the Google Compute Engine API.
5685///
5686/// # Example
5687/// ```
5688/// # tokio_test::block_on(async {
5689/// # use google_cloud_compute_v1::client::InterconnectAttachmentGroups;
5690/// let client = InterconnectAttachmentGroups::builder().build().await?;
5691/// // use `client` to make requests to the Google Compute Engine API.
5692/// # gax::client_builder::Result::<()>::Ok(()) });
5693/// ```
5694///
5695/// # Service Description
5696///
5697/// Service for the `interconnectAttachmentGroups` resource.
5698///
5699/// # Configuration
5700///
5701/// To configure `InterconnectAttachmentGroups` use the `with_*` methods in the type returned
5702/// by [builder()][InterconnectAttachmentGroups::builder]. The default configuration should
5703/// work for most applications. Common configuration changes include
5704///
5705/// * [with_endpoint()]: by default this client uses the global default endpoint
5706/// (`https://compute.googleapis.com`). Applications using regional
5707/// endpoints or running in restricted networks (e.g. a network configured
5708// with [Private Google Access with VPC Service Controls]) may want to
5709/// override this default.
5710/// * [with_credentials()]: by default this client uses
5711/// [Application Default Credentials]. Applications using custom
5712/// authentication may need to override this default.
5713///
5714/// [with_endpoint()]: super::builder::interconnect_attachment_groups::ClientBuilder::with_endpoint
5715/// [with_credentials()]: super::builder::interconnect_attachment_groups::ClientBuilder::credentials
5716/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5717/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5718///
5719/// # Pooling and Cloning
5720///
5721/// `InterconnectAttachmentGroups` holds a connection pool internally, it is advised to
5722/// create one and the reuse it. You do not need to wrap `InterconnectAttachmentGroups` in
5723/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5724/// already uses an `Arc` internally.
5725#[cfg(feature = "interconnect-attachment-groups")]
5726#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-attachment-groups")))]
5727#[derive(Clone, Debug)]
5728pub struct InterconnectAttachmentGroups {
5729 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachmentGroups>,
5730}
5731
5732#[cfg(feature = "interconnect-attachment-groups")]
5733impl InterconnectAttachmentGroups {
5734 /// Returns a builder for [InterconnectAttachmentGroups].
5735 ///
5736 /// ```
5737 /// # tokio_test::block_on(async {
5738 /// # use google_cloud_compute_v1::client::InterconnectAttachmentGroups;
5739 /// let client = InterconnectAttachmentGroups::builder().build().await?;
5740 /// # gax::client_builder::Result::<()>::Ok(()) });
5741 /// ```
5742 pub fn builder() -> super::builder::interconnect_attachment_groups::ClientBuilder {
5743 gax::client_builder::internal::new_builder(
5744 super::builder::interconnect_attachment_groups::client::Factory,
5745 )
5746 }
5747
5748 /// Creates a new client from the provided stub.
5749 ///
5750 /// The most common case for calling this function is in tests mocking the
5751 /// client's behavior.
5752 pub fn from_stub<T>(stub: T) -> Self
5753 where
5754 T: super::stub::InterconnectAttachmentGroups + 'static,
5755 {
5756 Self {
5757 inner: std::sync::Arc::new(stub),
5758 }
5759 }
5760
5761 pub(crate) async fn new(
5762 config: gaxi::options::ClientConfig,
5763 ) -> gax::client_builder::Result<Self> {
5764 let inner = Self::build_inner(config).await?;
5765 Ok(Self { inner })
5766 }
5767
5768 async fn build_inner(
5769 conf: gaxi::options::ClientConfig,
5770 ) -> gax::client_builder::Result<
5771 std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachmentGroups>,
5772 > {
5773 if gaxi::options::tracing_enabled(&conf) {
5774 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5775 }
5776 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5777 }
5778
5779 async fn build_transport(
5780 conf: gaxi::options::ClientConfig,
5781 ) -> gax::client_builder::Result<impl super::stub::InterconnectAttachmentGroups> {
5782 super::transport::InterconnectAttachmentGroups::new(conf).await
5783 }
5784
5785 async fn build_with_tracing(
5786 conf: gaxi::options::ClientConfig,
5787 ) -> gax::client_builder::Result<impl super::stub::InterconnectAttachmentGroups> {
5788 Self::build_transport(conf)
5789 .await
5790 .map(super::tracing::InterconnectAttachmentGroups::new)
5791 }
5792
5793 /// Deletes the specified InterconnectAttachmentGroup in the given scope
5794 pub fn delete(&self) -> super::builder::interconnect_attachment_groups::Delete {
5795 super::builder::interconnect_attachment_groups::Delete::new(self.inner.clone())
5796 }
5797
5798 /// Returns the specified InterconnectAttachmentGroup resource in the given
5799 /// scope.
5800 pub fn get(&self) -> super::builder::interconnect_attachment_groups::Get {
5801 super::builder::interconnect_attachment_groups::Get::new(self.inner.clone())
5802 }
5803
5804 /// Gets the access control policy for a resource. May be empty if no such
5805 /// policy or resource exists.
5806 pub fn get_iam_policy(&self) -> super::builder::interconnect_attachment_groups::GetIamPolicy {
5807 super::builder::interconnect_attachment_groups::GetIamPolicy::new(self.inner.clone())
5808 }
5809
5810 /// Returns the InterconnectAttachmentStatuses for the specified
5811 /// InterconnectAttachmentGroup resource.
5812 pub fn get_operational_status(
5813 &self,
5814 ) -> super::builder::interconnect_attachment_groups::GetOperationalStatus {
5815 super::builder::interconnect_attachment_groups::GetOperationalStatus::new(
5816 self.inner.clone(),
5817 )
5818 }
5819
5820 /// Creates a InterconnectAttachmentGroup in the specified project in the given
5821 /// scope using the parameters that are included in the request.
5822 pub fn insert(&self) -> super::builder::interconnect_attachment_groups::Insert {
5823 super::builder::interconnect_attachment_groups::Insert::new(self.inner.clone())
5824 }
5825
5826 /// Lists the InterconnectAttachmentGroups for a project in the given scope.
5827 pub fn list(&self) -> super::builder::interconnect_attachment_groups::List {
5828 super::builder::interconnect_attachment_groups::List::new(self.inner.clone())
5829 }
5830
5831 /// Patches the specified InterconnectAttachmentGroup resource with the data
5832 /// included in the request. This method supports PATCH
5833 /// semantics and usesJSON merge
5834 /// patch format and processing rules.
5835 pub fn patch(&self) -> super::builder::interconnect_attachment_groups::Patch {
5836 super::builder::interconnect_attachment_groups::Patch::new(self.inner.clone())
5837 }
5838
5839 /// Sets the access control policy on the specified resource.
5840 /// Replaces any existing policy.
5841 pub fn set_iam_policy(&self) -> super::builder::interconnect_attachment_groups::SetIamPolicy {
5842 super::builder::interconnect_attachment_groups::SetIamPolicy::new(self.inner.clone())
5843 }
5844
5845 /// Returns permissions that a caller has on the specified resource.
5846 pub fn test_iam_permissions(
5847 &self,
5848 ) -> super::builder::interconnect_attachment_groups::TestIamPermissions {
5849 super::builder::interconnect_attachment_groups::TestIamPermissions::new(self.inner.clone())
5850 }
5851
5852 /// Retrieves the specified Operations resource.
5853 pub fn get_operation(&self) -> super::builder::interconnect_attachment_groups::GetOperation {
5854 super::builder::interconnect_attachment_groups::GetOperation::new(self.inner.clone())
5855 }
5856}
5857
5858/// Implements a client for the Google Compute Engine API.
5859///
5860/// # Example
5861/// ```
5862/// # tokio_test::block_on(async {
5863/// # use google_cloud_compute_v1::client::InterconnectAttachments;
5864/// let client = InterconnectAttachments::builder().build().await?;
5865/// // use `client` to make requests to the Google Compute Engine API.
5866/// # gax::client_builder::Result::<()>::Ok(()) });
5867/// ```
5868///
5869/// # Service Description
5870///
5871/// Service for the `interconnectAttachments` resource.
5872///
5873/// # Configuration
5874///
5875/// To configure `InterconnectAttachments` use the `with_*` methods in the type returned
5876/// by [builder()][InterconnectAttachments::builder]. The default configuration should
5877/// work for most applications. Common configuration changes include
5878///
5879/// * [with_endpoint()]: by default this client uses the global default endpoint
5880/// (`https://compute.googleapis.com`). Applications using regional
5881/// endpoints or running in restricted networks (e.g. a network configured
5882// with [Private Google Access with VPC Service Controls]) may want to
5883/// override this default.
5884/// * [with_credentials()]: by default this client uses
5885/// [Application Default Credentials]. Applications using custom
5886/// authentication may need to override this default.
5887///
5888/// [with_endpoint()]: super::builder::interconnect_attachments::ClientBuilder::with_endpoint
5889/// [with_credentials()]: super::builder::interconnect_attachments::ClientBuilder::credentials
5890/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5891/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5892///
5893/// # Pooling and Cloning
5894///
5895/// `InterconnectAttachments` holds a connection pool internally, it is advised to
5896/// create one and the reuse it. You do not need to wrap `InterconnectAttachments` in
5897/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5898/// already uses an `Arc` internally.
5899#[cfg(feature = "interconnect-attachments")]
5900#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-attachments")))]
5901#[derive(Clone, Debug)]
5902pub struct InterconnectAttachments {
5903 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachments>,
5904}
5905
5906#[cfg(feature = "interconnect-attachments")]
5907impl InterconnectAttachments {
5908 /// Returns a builder for [InterconnectAttachments].
5909 ///
5910 /// ```
5911 /// # tokio_test::block_on(async {
5912 /// # use google_cloud_compute_v1::client::InterconnectAttachments;
5913 /// let client = InterconnectAttachments::builder().build().await?;
5914 /// # gax::client_builder::Result::<()>::Ok(()) });
5915 /// ```
5916 pub fn builder() -> super::builder::interconnect_attachments::ClientBuilder {
5917 gax::client_builder::internal::new_builder(
5918 super::builder::interconnect_attachments::client::Factory,
5919 )
5920 }
5921
5922 /// Creates a new client from the provided stub.
5923 ///
5924 /// The most common case for calling this function is in tests mocking the
5925 /// client's behavior.
5926 pub fn from_stub<T>(stub: T) -> Self
5927 where
5928 T: super::stub::InterconnectAttachments + 'static,
5929 {
5930 Self {
5931 inner: std::sync::Arc::new(stub),
5932 }
5933 }
5934
5935 pub(crate) async fn new(
5936 config: gaxi::options::ClientConfig,
5937 ) -> gax::client_builder::Result<Self> {
5938 let inner = Self::build_inner(config).await?;
5939 Ok(Self { inner })
5940 }
5941
5942 async fn build_inner(
5943 conf: gaxi::options::ClientConfig,
5944 ) -> gax::client_builder::Result<
5945 std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachments>,
5946 > {
5947 if gaxi::options::tracing_enabled(&conf) {
5948 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5949 }
5950 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5951 }
5952
5953 async fn build_transport(
5954 conf: gaxi::options::ClientConfig,
5955 ) -> gax::client_builder::Result<impl super::stub::InterconnectAttachments> {
5956 super::transport::InterconnectAttachments::new(conf).await
5957 }
5958
5959 async fn build_with_tracing(
5960 conf: gaxi::options::ClientConfig,
5961 ) -> gax::client_builder::Result<impl super::stub::InterconnectAttachments> {
5962 Self::build_transport(conf)
5963 .await
5964 .map(super::tracing::InterconnectAttachments::new)
5965 }
5966
5967 /// Retrieves an aggregated list of interconnect attachments.
5968 ///
5969 /// To prevent failure, Google recommends that you set the
5970 /// `returnPartialSuccess` parameter to `true`.
5971 pub fn aggregated_list(&self) -> super::builder::interconnect_attachments::AggregatedList {
5972 super::builder::interconnect_attachments::AggregatedList::new(self.inner.clone())
5973 }
5974
5975 /// Deletes the specified interconnect attachment.
5976 pub fn delete(&self) -> super::builder::interconnect_attachments::Delete {
5977 super::builder::interconnect_attachments::Delete::new(self.inner.clone())
5978 }
5979
5980 /// Returns the specified interconnect attachment.
5981 pub fn get(&self) -> super::builder::interconnect_attachments::Get {
5982 super::builder::interconnect_attachments::Get::new(self.inner.clone())
5983 }
5984
5985 /// Creates an InterconnectAttachment in the specified project using the data
5986 /// included in the request.
5987 pub fn insert(&self) -> super::builder::interconnect_attachments::Insert {
5988 super::builder::interconnect_attachments::Insert::new(self.inner.clone())
5989 }
5990
5991 /// Retrieves the list of interconnect attachments contained within
5992 /// the specified region.
5993 pub fn list(&self) -> super::builder::interconnect_attachments::List {
5994 super::builder::interconnect_attachments::List::new(self.inner.clone())
5995 }
5996
5997 /// Updates the specified interconnect attachment with the data included in the
5998 /// request. This method supportsPATCH
5999 /// semantics and uses theJSON merge
6000 /// patch format and processing rules.
6001 pub fn patch(&self) -> super::builder::interconnect_attachments::Patch {
6002 super::builder::interconnect_attachments::Patch::new(self.inner.clone())
6003 }
6004
6005 /// Sets the labels on an InterconnectAttachment. To learn more about labels,
6006 /// read the Labeling
6007 /// Resources documentation.
6008 pub fn set_labels(&self) -> super::builder::interconnect_attachments::SetLabels {
6009 super::builder::interconnect_attachments::SetLabels::new(self.inner.clone())
6010 }
6011
6012 /// Retrieves the specified region-specific Operations resource.
6013 pub fn get_operation(&self) -> super::builder::interconnect_attachments::GetOperation {
6014 super::builder::interconnect_attachments::GetOperation::new(self.inner.clone())
6015 }
6016}
6017
6018/// Implements a client for the Google Compute Engine API.
6019///
6020/// # Example
6021/// ```
6022/// # tokio_test::block_on(async {
6023/// # use google_cloud_compute_v1::client::InterconnectGroups;
6024/// let client = InterconnectGroups::builder().build().await?;
6025/// // use `client` to make requests to the Google Compute Engine API.
6026/// # gax::client_builder::Result::<()>::Ok(()) });
6027/// ```
6028///
6029/// # Service Description
6030///
6031/// Service for the `interconnectGroups` resource.
6032///
6033/// # Configuration
6034///
6035/// To configure `InterconnectGroups` use the `with_*` methods in the type returned
6036/// by [builder()][InterconnectGroups::builder]. The default configuration should
6037/// work for most applications. Common configuration changes include
6038///
6039/// * [with_endpoint()]: by default this client uses the global default endpoint
6040/// (`https://compute.googleapis.com`). Applications using regional
6041/// endpoints or running in restricted networks (e.g. a network configured
6042// with [Private Google Access with VPC Service Controls]) may want to
6043/// override this default.
6044/// * [with_credentials()]: by default this client uses
6045/// [Application Default Credentials]. Applications using custom
6046/// authentication may need to override this default.
6047///
6048/// [with_endpoint()]: super::builder::interconnect_groups::ClientBuilder::with_endpoint
6049/// [with_credentials()]: super::builder::interconnect_groups::ClientBuilder::credentials
6050/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6051/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6052///
6053/// # Pooling and Cloning
6054///
6055/// `InterconnectGroups` holds a connection pool internally, it is advised to
6056/// create one and the reuse it. You do not need to wrap `InterconnectGroups` in
6057/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6058/// already uses an `Arc` internally.
6059#[cfg(feature = "interconnect-groups")]
6060#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-groups")))]
6061#[derive(Clone, Debug)]
6062pub struct InterconnectGroups {
6063 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectGroups>,
6064}
6065
6066#[cfg(feature = "interconnect-groups")]
6067impl InterconnectGroups {
6068 /// Returns a builder for [InterconnectGroups].
6069 ///
6070 /// ```
6071 /// # tokio_test::block_on(async {
6072 /// # use google_cloud_compute_v1::client::InterconnectGroups;
6073 /// let client = InterconnectGroups::builder().build().await?;
6074 /// # gax::client_builder::Result::<()>::Ok(()) });
6075 /// ```
6076 pub fn builder() -> super::builder::interconnect_groups::ClientBuilder {
6077 gax::client_builder::internal::new_builder(
6078 super::builder::interconnect_groups::client::Factory,
6079 )
6080 }
6081
6082 /// Creates a new client from the provided stub.
6083 ///
6084 /// The most common case for calling this function is in tests mocking the
6085 /// client's behavior.
6086 pub fn from_stub<T>(stub: T) -> Self
6087 where
6088 T: super::stub::InterconnectGroups + 'static,
6089 {
6090 Self {
6091 inner: std::sync::Arc::new(stub),
6092 }
6093 }
6094
6095 pub(crate) async fn new(
6096 config: gaxi::options::ClientConfig,
6097 ) -> gax::client_builder::Result<Self> {
6098 let inner = Self::build_inner(config).await?;
6099 Ok(Self { inner })
6100 }
6101
6102 async fn build_inner(
6103 conf: gaxi::options::ClientConfig,
6104 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::InterconnectGroups>>
6105 {
6106 if gaxi::options::tracing_enabled(&conf) {
6107 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6108 }
6109 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6110 }
6111
6112 async fn build_transport(
6113 conf: gaxi::options::ClientConfig,
6114 ) -> gax::client_builder::Result<impl super::stub::InterconnectGroups> {
6115 super::transport::InterconnectGroups::new(conf).await
6116 }
6117
6118 async fn build_with_tracing(
6119 conf: gaxi::options::ClientConfig,
6120 ) -> gax::client_builder::Result<impl super::stub::InterconnectGroups> {
6121 Self::build_transport(conf)
6122 .await
6123 .map(super::tracing::InterconnectGroups::new)
6124 }
6125
6126 /// Create Interconnects with redundancy by creating them in a specified
6127 /// interconnect group.
6128 pub fn create_members(&self) -> super::builder::interconnect_groups::CreateMembers {
6129 super::builder::interconnect_groups::CreateMembers::new(self.inner.clone())
6130 }
6131
6132 /// Deletes the specified InterconnectGroup in the given scope
6133 pub fn delete(&self) -> super::builder::interconnect_groups::Delete {
6134 super::builder::interconnect_groups::Delete::new(self.inner.clone())
6135 }
6136
6137 /// Returns the specified InterconnectGroup resource in the given scope.
6138 pub fn get(&self) -> super::builder::interconnect_groups::Get {
6139 super::builder::interconnect_groups::Get::new(self.inner.clone())
6140 }
6141
6142 /// Gets the access control policy for a resource. May be empty if no such
6143 /// policy or resource exists.
6144 pub fn get_iam_policy(&self) -> super::builder::interconnect_groups::GetIamPolicy {
6145 super::builder::interconnect_groups::GetIamPolicy::new(self.inner.clone())
6146 }
6147
6148 /// Returns the interconnectStatuses for the specified
6149 /// InterconnectGroup.
6150 pub fn get_operational_status(
6151 &self,
6152 ) -> super::builder::interconnect_groups::GetOperationalStatus {
6153 super::builder::interconnect_groups::GetOperationalStatus::new(self.inner.clone())
6154 }
6155
6156 /// Creates a InterconnectGroup in the specified project in the given scope
6157 /// using the parameters that are included in the request.
6158 pub fn insert(&self) -> super::builder::interconnect_groups::Insert {
6159 super::builder::interconnect_groups::Insert::new(self.inner.clone())
6160 }
6161
6162 /// Lists the InterconnectGroups for a project in the given scope.
6163 pub fn list(&self) -> super::builder::interconnect_groups::List {
6164 super::builder::interconnect_groups::List::new(self.inner.clone())
6165 }
6166
6167 /// Patches the specified InterconnectGroup resource with the data included in
6168 /// the request. This method supports PATCH
6169 /// semantics and usesJSON merge
6170 /// patch format and processing rules.
6171 pub fn patch(&self) -> super::builder::interconnect_groups::Patch {
6172 super::builder::interconnect_groups::Patch::new(self.inner.clone())
6173 }
6174
6175 /// Sets the access control policy on the specified resource.
6176 /// Replaces any existing policy.
6177 pub fn set_iam_policy(&self) -> super::builder::interconnect_groups::SetIamPolicy {
6178 super::builder::interconnect_groups::SetIamPolicy::new(self.inner.clone())
6179 }
6180
6181 /// Returns permissions that a caller has on the specified resource.
6182 pub fn test_iam_permissions(&self) -> super::builder::interconnect_groups::TestIamPermissions {
6183 super::builder::interconnect_groups::TestIamPermissions::new(self.inner.clone())
6184 }
6185
6186 /// Retrieves the specified Operations resource.
6187 pub fn get_operation(&self) -> super::builder::interconnect_groups::GetOperation {
6188 super::builder::interconnect_groups::GetOperation::new(self.inner.clone())
6189 }
6190}
6191
6192/// Implements a client for the Google Compute Engine API.
6193///
6194/// # Example
6195/// ```
6196/// # tokio_test::block_on(async {
6197/// # use google_cloud_compute_v1::client::InterconnectLocations;
6198/// let client = InterconnectLocations::builder().build().await?;
6199/// // use `client` to make requests to the Google Compute Engine API.
6200/// # gax::client_builder::Result::<()>::Ok(()) });
6201/// ```
6202///
6203/// # Service Description
6204///
6205/// Service for the `interconnectLocations` resource.
6206///
6207/// # Configuration
6208///
6209/// To configure `InterconnectLocations` use the `with_*` methods in the type returned
6210/// by [builder()][InterconnectLocations::builder]. The default configuration should
6211/// work for most applications. Common configuration changes include
6212///
6213/// * [with_endpoint()]: by default this client uses the global default endpoint
6214/// (`https://compute.googleapis.com`). Applications using regional
6215/// endpoints or running in restricted networks (e.g. a network configured
6216// with [Private Google Access with VPC Service Controls]) may want to
6217/// override this default.
6218/// * [with_credentials()]: by default this client uses
6219/// [Application Default Credentials]. Applications using custom
6220/// authentication may need to override this default.
6221///
6222/// [with_endpoint()]: super::builder::interconnect_locations::ClientBuilder::with_endpoint
6223/// [with_credentials()]: super::builder::interconnect_locations::ClientBuilder::credentials
6224/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6225/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6226///
6227/// # Pooling and Cloning
6228///
6229/// `InterconnectLocations` holds a connection pool internally, it is advised to
6230/// create one and the reuse it. You do not need to wrap `InterconnectLocations` in
6231/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6232/// already uses an `Arc` internally.
6233#[cfg(feature = "interconnect-locations")]
6234#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-locations")))]
6235#[derive(Clone, Debug)]
6236pub struct InterconnectLocations {
6237 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectLocations>,
6238}
6239
6240#[cfg(feature = "interconnect-locations")]
6241impl InterconnectLocations {
6242 /// Returns a builder for [InterconnectLocations].
6243 ///
6244 /// ```
6245 /// # tokio_test::block_on(async {
6246 /// # use google_cloud_compute_v1::client::InterconnectLocations;
6247 /// let client = InterconnectLocations::builder().build().await?;
6248 /// # gax::client_builder::Result::<()>::Ok(()) });
6249 /// ```
6250 pub fn builder() -> super::builder::interconnect_locations::ClientBuilder {
6251 gax::client_builder::internal::new_builder(
6252 super::builder::interconnect_locations::client::Factory,
6253 )
6254 }
6255
6256 /// Creates a new client from the provided stub.
6257 ///
6258 /// The most common case for calling this function is in tests mocking the
6259 /// client's behavior.
6260 pub fn from_stub<T>(stub: T) -> Self
6261 where
6262 T: super::stub::InterconnectLocations + 'static,
6263 {
6264 Self {
6265 inner: std::sync::Arc::new(stub),
6266 }
6267 }
6268
6269 pub(crate) async fn new(
6270 config: gaxi::options::ClientConfig,
6271 ) -> gax::client_builder::Result<Self> {
6272 let inner = Self::build_inner(config).await?;
6273 Ok(Self { inner })
6274 }
6275
6276 async fn build_inner(
6277 conf: gaxi::options::ClientConfig,
6278 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::InterconnectLocations>>
6279 {
6280 if gaxi::options::tracing_enabled(&conf) {
6281 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6282 }
6283 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6284 }
6285
6286 async fn build_transport(
6287 conf: gaxi::options::ClientConfig,
6288 ) -> gax::client_builder::Result<impl super::stub::InterconnectLocations> {
6289 super::transport::InterconnectLocations::new(conf).await
6290 }
6291
6292 async fn build_with_tracing(
6293 conf: gaxi::options::ClientConfig,
6294 ) -> gax::client_builder::Result<impl super::stub::InterconnectLocations> {
6295 Self::build_transport(conf)
6296 .await
6297 .map(super::tracing::InterconnectLocations::new)
6298 }
6299
6300 /// Returns the details for the specified interconnect location. Gets a list of
6301 /// available interconnect locations by making a list() request.
6302 pub fn get(&self) -> super::builder::interconnect_locations::Get {
6303 super::builder::interconnect_locations::Get::new(self.inner.clone())
6304 }
6305
6306 /// Retrieves the list of interconnect locations available to the specified
6307 /// project.
6308 pub fn list(&self) -> super::builder::interconnect_locations::List {
6309 super::builder::interconnect_locations::List::new(self.inner.clone())
6310 }
6311}
6312
6313/// Implements a client for the Google Compute Engine API.
6314///
6315/// # Example
6316/// ```
6317/// # tokio_test::block_on(async {
6318/// # use google_cloud_compute_v1::client::InterconnectRemoteLocations;
6319/// let client = InterconnectRemoteLocations::builder().build().await?;
6320/// // use `client` to make requests to the Google Compute Engine API.
6321/// # gax::client_builder::Result::<()>::Ok(()) });
6322/// ```
6323///
6324/// # Service Description
6325///
6326/// Service for the `interconnectRemoteLocations` resource.
6327///
6328/// # Configuration
6329///
6330/// To configure `InterconnectRemoteLocations` use the `with_*` methods in the type returned
6331/// by [builder()][InterconnectRemoteLocations::builder]. The default configuration should
6332/// work for most applications. Common configuration changes include
6333///
6334/// * [with_endpoint()]: by default this client uses the global default endpoint
6335/// (`https://compute.googleapis.com`). Applications using regional
6336/// endpoints or running in restricted networks (e.g. a network configured
6337// with [Private Google Access with VPC Service Controls]) may want to
6338/// override this default.
6339/// * [with_credentials()]: by default this client uses
6340/// [Application Default Credentials]. Applications using custom
6341/// authentication may need to override this default.
6342///
6343/// [with_endpoint()]: super::builder::interconnect_remote_locations::ClientBuilder::with_endpoint
6344/// [with_credentials()]: super::builder::interconnect_remote_locations::ClientBuilder::credentials
6345/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6346/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6347///
6348/// # Pooling and Cloning
6349///
6350/// `InterconnectRemoteLocations` holds a connection pool internally, it is advised to
6351/// create one and the reuse it. You do not need to wrap `InterconnectRemoteLocations` in
6352/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6353/// already uses an `Arc` internally.
6354#[cfg(feature = "interconnect-remote-locations")]
6355#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-remote-locations")))]
6356#[derive(Clone, Debug)]
6357pub struct InterconnectRemoteLocations {
6358 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectRemoteLocations>,
6359}
6360
6361#[cfg(feature = "interconnect-remote-locations")]
6362impl InterconnectRemoteLocations {
6363 /// Returns a builder for [InterconnectRemoteLocations].
6364 ///
6365 /// ```
6366 /// # tokio_test::block_on(async {
6367 /// # use google_cloud_compute_v1::client::InterconnectRemoteLocations;
6368 /// let client = InterconnectRemoteLocations::builder().build().await?;
6369 /// # gax::client_builder::Result::<()>::Ok(()) });
6370 /// ```
6371 pub fn builder() -> super::builder::interconnect_remote_locations::ClientBuilder {
6372 gax::client_builder::internal::new_builder(
6373 super::builder::interconnect_remote_locations::client::Factory,
6374 )
6375 }
6376
6377 /// Creates a new client from the provided stub.
6378 ///
6379 /// The most common case for calling this function is in tests mocking the
6380 /// client's behavior.
6381 pub fn from_stub<T>(stub: T) -> Self
6382 where
6383 T: super::stub::InterconnectRemoteLocations + 'static,
6384 {
6385 Self {
6386 inner: std::sync::Arc::new(stub),
6387 }
6388 }
6389
6390 pub(crate) async fn new(
6391 config: gaxi::options::ClientConfig,
6392 ) -> gax::client_builder::Result<Self> {
6393 let inner = Self::build_inner(config).await?;
6394 Ok(Self { inner })
6395 }
6396
6397 async fn build_inner(
6398 conf: gaxi::options::ClientConfig,
6399 ) -> gax::client_builder::Result<
6400 std::sync::Arc<dyn super::stub::dynamic::InterconnectRemoteLocations>,
6401 > {
6402 if gaxi::options::tracing_enabled(&conf) {
6403 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6404 }
6405 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6406 }
6407
6408 async fn build_transport(
6409 conf: gaxi::options::ClientConfig,
6410 ) -> gax::client_builder::Result<impl super::stub::InterconnectRemoteLocations> {
6411 super::transport::InterconnectRemoteLocations::new(conf).await
6412 }
6413
6414 async fn build_with_tracing(
6415 conf: gaxi::options::ClientConfig,
6416 ) -> gax::client_builder::Result<impl super::stub::InterconnectRemoteLocations> {
6417 Self::build_transport(conf)
6418 .await
6419 .map(super::tracing::InterconnectRemoteLocations::new)
6420 }
6421
6422 /// Returns the details for the specified interconnect remote location. Gets a
6423 /// list of available interconnect remote locations by making alist() request.
6424 pub fn get(&self) -> super::builder::interconnect_remote_locations::Get {
6425 super::builder::interconnect_remote_locations::Get::new(self.inner.clone())
6426 }
6427
6428 /// Retrieves the list of interconnect remote locations available to the
6429 /// specified project.
6430 pub fn list(&self) -> super::builder::interconnect_remote_locations::List {
6431 super::builder::interconnect_remote_locations::List::new(self.inner.clone())
6432 }
6433}
6434
6435/// Implements a client for the Google Compute Engine API.
6436///
6437/// # Example
6438/// ```
6439/// # tokio_test::block_on(async {
6440/// # use google_cloud_compute_v1::client::Interconnects;
6441/// let client = Interconnects::builder().build().await?;
6442/// // use `client` to make requests to the Google Compute Engine API.
6443/// # gax::client_builder::Result::<()>::Ok(()) });
6444/// ```
6445///
6446/// # Service Description
6447///
6448/// Service for the `interconnects` resource.
6449///
6450/// # Configuration
6451///
6452/// To configure `Interconnects` use the `with_*` methods in the type returned
6453/// by [builder()][Interconnects::builder]. The default configuration should
6454/// work for most applications. Common configuration changes include
6455///
6456/// * [with_endpoint()]: by default this client uses the global default endpoint
6457/// (`https://compute.googleapis.com`). Applications using regional
6458/// endpoints or running in restricted networks (e.g. a network configured
6459// with [Private Google Access with VPC Service Controls]) may want to
6460/// override this default.
6461/// * [with_credentials()]: by default this client uses
6462/// [Application Default Credentials]. Applications using custom
6463/// authentication may need to override this default.
6464///
6465/// [with_endpoint()]: super::builder::interconnects::ClientBuilder::with_endpoint
6466/// [with_credentials()]: super::builder::interconnects::ClientBuilder::credentials
6467/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6468/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6469///
6470/// # Pooling and Cloning
6471///
6472/// `Interconnects` holds a connection pool internally, it is advised to
6473/// create one and the reuse it. You do not need to wrap `Interconnects` in
6474/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6475/// already uses an `Arc` internally.
6476#[cfg(feature = "interconnects")]
6477#[cfg_attr(docsrs, doc(cfg(feature = "interconnects")))]
6478#[derive(Clone, Debug)]
6479pub struct Interconnects {
6480 inner: std::sync::Arc<dyn super::stub::dynamic::Interconnects>,
6481}
6482
6483#[cfg(feature = "interconnects")]
6484impl Interconnects {
6485 /// Returns a builder for [Interconnects].
6486 ///
6487 /// ```
6488 /// # tokio_test::block_on(async {
6489 /// # use google_cloud_compute_v1::client::Interconnects;
6490 /// let client = Interconnects::builder().build().await?;
6491 /// # gax::client_builder::Result::<()>::Ok(()) });
6492 /// ```
6493 pub fn builder() -> super::builder::interconnects::ClientBuilder {
6494 gax::client_builder::internal::new_builder(super::builder::interconnects::client::Factory)
6495 }
6496
6497 /// Creates a new client from the provided stub.
6498 ///
6499 /// The most common case for calling this function is in tests mocking the
6500 /// client's behavior.
6501 pub fn from_stub<T>(stub: T) -> Self
6502 where
6503 T: super::stub::Interconnects + 'static,
6504 {
6505 Self {
6506 inner: std::sync::Arc::new(stub),
6507 }
6508 }
6509
6510 pub(crate) async fn new(
6511 config: gaxi::options::ClientConfig,
6512 ) -> gax::client_builder::Result<Self> {
6513 let inner = Self::build_inner(config).await?;
6514 Ok(Self { inner })
6515 }
6516
6517 async fn build_inner(
6518 conf: gaxi::options::ClientConfig,
6519 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Interconnects>> {
6520 if gaxi::options::tracing_enabled(&conf) {
6521 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6522 }
6523 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6524 }
6525
6526 async fn build_transport(
6527 conf: gaxi::options::ClientConfig,
6528 ) -> gax::client_builder::Result<impl super::stub::Interconnects> {
6529 super::transport::Interconnects::new(conf).await
6530 }
6531
6532 async fn build_with_tracing(
6533 conf: gaxi::options::ClientConfig,
6534 ) -> gax::client_builder::Result<impl super::stub::Interconnects> {
6535 Self::build_transport(conf)
6536 .await
6537 .map(super::tracing::Interconnects::new)
6538 }
6539
6540 /// Deletes the specified Interconnect.
6541 pub fn delete(&self) -> super::builder::interconnects::Delete {
6542 super::builder::interconnects::Delete::new(self.inner.clone())
6543 }
6544
6545 /// Returns the specified Interconnect. Get a list of available Interconnects
6546 /// by making a list() request.
6547 pub fn get(&self) -> super::builder::interconnects::Get {
6548 super::builder::interconnects::Get::new(self.inner.clone())
6549 }
6550
6551 /// Returns the interconnectDiagnostics for the specified
6552 /// Interconnect.
6553 ///
6554 /// In the event of a
6555 /// global outage, do not use this API to make decisions about where to
6556 /// redirect your network traffic.
6557 ///
6558 /// Unlike a VLAN attachment, which is regional, a Cloud Interconnect
6559 /// connection is a global resource. A global outage can prevent this
6560 /// API from functioning properly.
6561 pub fn get_diagnostics(&self) -> super::builder::interconnects::GetDiagnostics {
6562 super::builder::interconnects::GetDiagnostics::new(self.inner.clone())
6563 }
6564
6565 /// Returns the interconnectMacsecConfig for the specified
6566 /// Interconnect.
6567 pub fn get_macsec_config(&self) -> super::builder::interconnects::GetMacsecConfig {
6568 super::builder::interconnects::GetMacsecConfig::new(self.inner.clone())
6569 }
6570
6571 /// Creates an Interconnect in the specified project using
6572 /// the data included in the request.
6573 pub fn insert(&self) -> super::builder::interconnects::Insert {
6574 super::builder::interconnects::Insert::new(self.inner.clone())
6575 }
6576
6577 /// Retrieves the list of Interconnects available to the specified project.
6578 pub fn list(&self) -> super::builder::interconnects::List {
6579 super::builder::interconnects::List::new(self.inner.clone())
6580 }
6581
6582 /// Updates the specified Interconnect with the data included in the request.
6583 /// This method supportsPATCH
6584 /// semantics and uses theJSON merge
6585 /// patch format and processing rules.
6586 pub fn patch(&self) -> super::builder::interconnects::Patch {
6587 super::builder::interconnects::Patch::new(self.inner.clone())
6588 }
6589
6590 /// Sets the labels on an Interconnect. To learn more about labels,
6591 /// read the Labeling
6592 /// Resources documentation.
6593 pub fn set_labels(&self) -> super::builder::interconnects::SetLabels {
6594 super::builder::interconnects::SetLabels::new(self.inner.clone())
6595 }
6596
6597 /// Retrieves the specified Operations resource.
6598 pub fn get_operation(&self) -> super::builder::interconnects::GetOperation {
6599 super::builder::interconnects::GetOperation::new(self.inner.clone())
6600 }
6601}
6602
6603/// Implements a client for the Google Compute Engine API.
6604///
6605/// # Example
6606/// ```
6607/// # tokio_test::block_on(async {
6608/// # use google_cloud_compute_v1::client::LicenseCodes;
6609/// let client = LicenseCodes::builder().build().await?;
6610/// // use `client` to make requests to the Google Compute Engine API.
6611/// # gax::client_builder::Result::<()>::Ok(()) });
6612/// ```
6613///
6614/// # Service Description
6615///
6616/// Service for the `licenseCodes` resource.
6617///
6618/// # Configuration
6619///
6620/// To configure `LicenseCodes` use the `with_*` methods in the type returned
6621/// by [builder()][LicenseCodes::builder]. The default configuration should
6622/// work for most applications. Common configuration changes include
6623///
6624/// * [with_endpoint()]: by default this client uses the global default endpoint
6625/// (`https://compute.googleapis.com`). Applications using regional
6626/// endpoints or running in restricted networks (e.g. a network configured
6627// with [Private Google Access with VPC Service Controls]) may want to
6628/// override this default.
6629/// * [with_credentials()]: by default this client uses
6630/// [Application Default Credentials]. Applications using custom
6631/// authentication may need to override this default.
6632///
6633/// [with_endpoint()]: super::builder::license_codes::ClientBuilder::with_endpoint
6634/// [with_credentials()]: super::builder::license_codes::ClientBuilder::credentials
6635/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6636/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6637///
6638/// # Pooling and Cloning
6639///
6640/// `LicenseCodes` holds a connection pool internally, it is advised to
6641/// create one and the reuse it. You do not need to wrap `LicenseCodes` in
6642/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6643/// already uses an `Arc` internally.
6644#[cfg(feature = "license-codes")]
6645#[cfg_attr(docsrs, doc(cfg(feature = "license-codes")))]
6646#[derive(Clone, Debug)]
6647pub struct LicenseCodes {
6648 inner: std::sync::Arc<dyn super::stub::dynamic::LicenseCodes>,
6649}
6650
6651#[cfg(feature = "license-codes")]
6652impl LicenseCodes {
6653 /// Returns a builder for [LicenseCodes].
6654 ///
6655 /// ```
6656 /// # tokio_test::block_on(async {
6657 /// # use google_cloud_compute_v1::client::LicenseCodes;
6658 /// let client = LicenseCodes::builder().build().await?;
6659 /// # gax::client_builder::Result::<()>::Ok(()) });
6660 /// ```
6661 pub fn builder() -> super::builder::license_codes::ClientBuilder {
6662 gax::client_builder::internal::new_builder(super::builder::license_codes::client::Factory)
6663 }
6664
6665 /// Creates a new client from the provided stub.
6666 ///
6667 /// The most common case for calling this function is in tests mocking the
6668 /// client's behavior.
6669 pub fn from_stub<T>(stub: T) -> Self
6670 where
6671 T: super::stub::LicenseCodes + 'static,
6672 {
6673 Self {
6674 inner: std::sync::Arc::new(stub),
6675 }
6676 }
6677
6678 pub(crate) async fn new(
6679 config: gaxi::options::ClientConfig,
6680 ) -> gax::client_builder::Result<Self> {
6681 let inner = Self::build_inner(config).await?;
6682 Ok(Self { inner })
6683 }
6684
6685 async fn build_inner(
6686 conf: gaxi::options::ClientConfig,
6687 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::LicenseCodes>> {
6688 if gaxi::options::tracing_enabled(&conf) {
6689 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6690 }
6691 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6692 }
6693
6694 async fn build_transport(
6695 conf: gaxi::options::ClientConfig,
6696 ) -> gax::client_builder::Result<impl super::stub::LicenseCodes> {
6697 super::transport::LicenseCodes::new(conf).await
6698 }
6699
6700 async fn build_with_tracing(
6701 conf: gaxi::options::ClientConfig,
6702 ) -> gax::client_builder::Result<impl super::stub::LicenseCodes> {
6703 Self::build_transport(conf)
6704 .await
6705 .map(super::tracing::LicenseCodes::new)
6706 }
6707
6708 /// Return a specified license code. License codes are mirrored across
6709 /// all projects that have permissions to read the License Code.
6710 /// *Caution* This resource is intended
6711 /// for use only by third-party partners who are creatingCloud Marketplace
6712 /// images.
6713 pub fn get(&self) -> super::builder::license_codes::Get {
6714 super::builder::license_codes::Get::new(self.inner.clone())
6715 }
6716
6717 /// Returns permissions that a caller has on the specified resource.
6718 /// *Caution* This resource is intended
6719 /// for use only by third-party partners who are creatingCloud Marketplace
6720 /// images.
6721 pub fn test_iam_permissions(&self) -> super::builder::license_codes::TestIamPermissions {
6722 super::builder::license_codes::TestIamPermissions::new(self.inner.clone())
6723 }
6724}
6725
6726/// Implements a client for the Google Compute Engine API.
6727///
6728/// # Example
6729/// ```
6730/// # tokio_test::block_on(async {
6731/// # use google_cloud_compute_v1::client::Licenses;
6732/// let client = Licenses::builder().build().await?;
6733/// // use `client` to make requests to the Google Compute Engine API.
6734/// # gax::client_builder::Result::<()>::Ok(()) });
6735/// ```
6736///
6737/// # Service Description
6738///
6739/// Service for the `licenses` resource.
6740///
6741/// # Configuration
6742///
6743/// To configure `Licenses` use the `with_*` methods in the type returned
6744/// by [builder()][Licenses::builder]. The default configuration should
6745/// work for most applications. Common configuration changes include
6746///
6747/// * [with_endpoint()]: by default this client uses the global default endpoint
6748/// (`https://compute.googleapis.com`). Applications using regional
6749/// endpoints or running in restricted networks (e.g. a network configured
6750// with [Private Google Access with VPC Service Controls]) may want to
6751/// override this default.
6752/// * [with_credentials()]: by default this client uses
6753/// [Application Default Credentials]. Applications using custom
6754/// authentication may need to override this default.
6755///
6756/// [with_endpoint()]: super::builder::licenses::ClientBuilder::with_endpoint
6757/// [with_credentials()]: super::builder::licenses::ClientBuilder::credentials
6758/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6759/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6760///
6761/// # Pooling and Cloning
6762///
6763/// `Licenses` holds a connection pool internally, it is advised to
6764/// create one and the reuse it. You do not need to wrap `Licenses` in
6765/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6766/// already uses an `Arc` internally.
6767#[cfg(feature = "licenses")]
6768#[cfg_attr(docsrs, doc(cfg(feature = "licenses")))]
6769#[derive(Clone, Debug)]
6770pub struct Licenses {
6771 inner: std::sync::Arc<dyn super::stub::dynamic::Licenses>,
6772}
6773
6774#[cfg(feature = "licenses")]
6775impl Licenses {
6776 /// Returns a builder for [Licenses].
6777 ///
6778 /// ```
6779 /// # tokio_test::block_on(async {
6780 /// # use google_cloud_compute_v1::client::Licenses;
6781 /// let client = Licenses::builder().build().await?;
6782 /// # gax::client_builder::Result::<()>::Ok(()) });
6783 /// ```
6784 pub fn builder() -> super::builder::licenses::ClientBuilder {
6785 gax::client_builder::internal::new_builder(super::builder::licenses::client::Factory)
6786 }
6787
6788 /// Creates a new client from the provided stub.
6789 ///
6790 /// The most common case for calling this function is in tests mocking the
6791 /// client's behavior.
6792 pub fn from_stub<T>(stub: T) -> Self
6793 where
6794 T: super::stub::Licenses + 'static,
6795 {
6796 Self {
6797 inner: std::sync::Arc::new(stub),
6798 }
6799 }
6800
6801 pub(crate) async fn new(
6802 config: gaxi::options::ClientConfig,
6803 ) -> gax::client_builder::Result<Self> {
6804 let inner = Self::build_inner(config).await?;
6805 Ok(Self { inner })
6806 }
6807
6808 async fn build_inner(
6809 conf: gaxi::options::ClientConfig,
6810 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Licenses>> {
6811 if gaxi::options::tracing_enabled(&conf) {
6812 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6813 }
6814 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6815 }
6816
6817 async fn build_transport(
6818 conf: gaxi::options::ClientConfig,
6819 ) -> gax::client_builder::Result<impl super::stub::Licenses> {
6820 super::transport::Licenses::new(conf).await
6821 }
6822
6823 async fn build_with_tracing(
6824 conf: gaxi::options::ClientConfig,
6825 ) -> gax::client_builder::Result<impl super::stub::Licenses> {
6826 Self::build_transport(conf)
6827 .await
6828 .map(super::tracing::Licenses::new)
6829 }
6830
6831 /// Deletes the specified license.
6832 /// *Caution* This resource is intended
6833 /// for use only by third-party partners who are creatingCloud Marketplace
6834 /// images.
6835 pub fn delete(&self) -> super::builder::licenses::Delete {
6836 super::builder::licenses::Delete::new(self.inner.clone())
6837 }
6838
6839 /// Returns the specified License resource.
6840 /// *Caution* This resource is intended
6841 /// for use only by third-party partners who are creatingCloud Marketplace
6842 /// images.
6843 pub fn get(&self) -> super::builder::licenses::Get {
6844 super::builder::licenses::Get::new(self.inner.clone())
6845 }
6846
6847 /// Gets the access control policy for a resource. May be empty if no such
6848 /// policy or resource exists.
6849 /// *Caution* This resource is intended
6850 /// for use only by third-party partners who are creatingCloud Marketplace
6851 /// images.
6852 pub fn get_iam_policy(&self) -> super::builder::licenses::GetIamPolicy {
6853 super::builder::licenses::GetIamPolicy::new(self.inner.clone())
6854 }
6855
6856 /// Create a License resource in the specified project.
6857 /// *Caution* This resource is intended
6858 /// for use only by third-party partners who are creatingCloud Marketplace
6859 /// images.
6860 pub fn insert(&self) -> super::builder::licenses::Insert {
6861 super::builder::licenses::Insert::new(self.inner.clone())
6862 }
6863
6864 /// Retrieves the list of licenses
6865 /// available in the specified project. This method does not
6866 /// get any licenses that belong to other projects, including licenses attached
6867 /// to publicly-available images, like Debian 9. If you want to get a list of
6868 /// publicly-available licenses, use this method to make a request to the
6869 /// respective image project, such as debian-cloud orwindows-cloud.
6870 /// *Caution* This resource is intended
6871 /// for use only by third-party partners who are creatingCloud Marketplace
6872 /// images.
6873 pub fn list(&self) -> super::builder::licenses::List {
6874 super::builder::licenses::List::new(self.inner.clone())
6875 }
6876
6877 /// Sets the access control policy on the specified resource.
6878 /// Replaces any existing policy.
6879 /// *Caution* This resource is intended
6880 /// for use only by third-party partners who are creatingCloud Marketplace
6881 /// images.
6882 pub fn set_iam_policy(&self) -> super::builder::licenses::SetIamPolicy {
6883 super::builder::licenses::SetIamPolicy::new(self.inner.clone())
6884 }
6885
6886 /// Returns permissions that a caller has on the specified resource.
6887 /// *Caution* This resource is intended
6888 /// for use only by third-party partners who are creatingCloud Marketplace
6889 /// images.
6890 pub fn test_iam_permissions(&self) -> super::builder::licenses::TestIamPermissions {
6891 super::builder::licenses::TestIamPermissions::new(self.inner.clone())
6892 }
6893
6894 /// Updates a License resource in the specified project.
6895 /// *Caution* This resource is intended
6896 /// for use only by third-party partners who are creatingCloud Marketplace
6897 /// images.
6898 pub fn update(&self) -> super::builder::licenses::Update {
6899 super::builder::licenses::Update::new(self.inner.clone())
6900 }
6901
6902 /// Retrieves the specified Operations resource.
6903 pub fn get_operation(&self) -> super::builder::licenses::GetOperation {
6904 super::builder::licenses::GetOperation::new(self.inner.clone())
6905 }
6906}
6907
6908/// Implements a client for the Google Compute Engine API.
6909///
6910/// # Example
6911/// ```
6912/// # tokio_test::block_on(async {
6913/// # use google_cloud_compute_v1::client::MachineImages;
6914/// let client = MachineImages::builder().build().await?;
6915/// // use `client` to make requests to the Google Compute Engine API.
6916/// # gax::client_builder::Result::<()>::Ok(()) });
6917/// ```
6918///
6919/// # Service Description
6920///
6921/// Service for the `machineImages` resource.
6922///
6923/// # Configuration
6924///
6925/// To configure `MachineImages` use the `with_*` methods in the type returned
6926/// by [builder()][MachineImages::builder]. The default configuration should
6927/// work for most applications. Common configuration changes include
6928///
6929/// * [with_endpoint()]: by default this client uses the global default endpoint
6930/// (`https://compute.googleapis.com`). Applications using regional
6931/// endpoints or running in restricted networks (e.g. a network configured
6932// with [Private Google Access with VPC Service Controls]) may want to
6933/// override this default.
6934/// * [with_credentials()]: by default this client uses
6935/// [Application Default Credentials]. Applications using custom
6936/// authentication may need to override this default.
6937///
6938/// [with_endpoint()]: super::builder::machine_images::ClientBuilder::with_endpoint
6939/// [with_credentials()]: super::builder::machine_images::ClientBuilder::credentials
6940/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6941/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6942///
6943/// # Pooling and Cloning
6944///
6945/// `MachineImages` holds a connection pool internally, it is advised to
6946/// create one and the reuse it. You do not need to wrap `MachineImages` in
6947/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6948/// already uses an `Arc` internally.
6949#[cfg(feature = "machine-images")]
6950#[cfg_attr(docsrs, doc(cfg(feature = "machine-images")))]
6951#[derive(Clone, Debug)]
6952pub struct MachineImages {
6953 inner: std::sync::Arc<dyn super::stub::dynamic::MachineImages>,
6954}
6955
6956#[cfg(feature = "machine-images")]
6957impl MachineImages {
6958 /// Returns a builder for [MachineImages].
6959 ///
6960 /// ```
6961 /// # tokio_test::block_on(async {
6962 /// # use google_cloud_compute_v1::client::MachineImages;
6963 /// let client = MachineImages::builder().build().await?;
6964 /// # gax::client_builder::Result::<()>::Ok(()) });
6965 /// ```
6966 pub fn builder() -> super::builder::machine_images::ClientBuilder {
6967 gax::client_builder::internal::new_builder(super::builder::machine_images::client::Factory)
6968 }
6969
6970 /// Creates a new client from the provided stub.
6971 ///
6972 /// The most common case for calling this function is in tests mocking the
6973 /// client's behavior.
6974 pub fn from_stub<T>(stub: T) -> Self
6975 where
6976 T: super::stub::MachineImages + 'static,
6977 {
6978 Self {
6979 inner: std::sync::Arc::new(stub),
6980 }
6981 }
6982
6983 pub(crate) async fn new(
6984 config: gaxi::options::ClientConfig,
6985 ) -> gax::client_builder::Result<Self> {
6986 let inner = Self::build_inner(config).await?;
6987 Ok(Self { inner })
6988 }
6989
6990 async fn build_inner(
6991 conf: gaxi::options::ClientConfig,
6992 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::MachineImages>> {
6993 if gaxi::options::tracing_enabled(&conf) {
6994 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6995 }
6996 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6997 }
6998
6999 async fn build_transport(
7000 conf: gaxi::options::ClientConfig,
7001 ) -> gax::client_builder::Result<impl super::stub::MachineImages> {
7002 super::transport::MachineImages::new(conf).await
7003 }
7004
7005 async fn build_with_tracing(
7006 conf: gaxi::options::ClientConfig,
7007 ) -> gax::client_builder::Result<impl super::stub::MachineImages> {
7008 Self::build_transport(conf)
7009 .await
7010 .map(super::tracing::MachineImages::new)
7011 }
7012
7013 /// Deletes the specified machine image. Deleting a machine image is permanent
7014 /// and cannot be undone.
7015 pub fn delete(&self) -> super::builder::machine_images::Delete {
7016 super::builder::machine_images::Delete::new(self.inner.clone())
7017 }
7018
7019 /// Returns the specified machine image.
7020 pub fn get(&self) -> super::builder::machine_images::Get {
7021 super::builder::machine_images::Get::new(self.inner.clone())
7022 }
7023
7024 /// Gets the access control policy for a resource. May be empty if no such
7025 /// policy or resource exists.
7026 pub fn get_iam_policy(&self) -> super::builder::machine_images::GetIamPolicy {
7027 super::builder::machine_images::GetIamPolicy::new(self.inner.clone())
7028 }
7029
7030 /// Creates a machine image in the specified project using the
7031 /// data that is included in the request. If you are creating a new machine
7032 /// image to update an existing instance, your new machine image should use the
7033 /// same network or, if applicable, the same subnetwork as the original
7034 /// instance.
7035 pub fn insert(&self) -> super::builder::machine_images::Insert {
7036 super::builder::machine_images::Insert::new(self.inner.clone())
7037 }
7038
7039 /// Retrieves a list of machine images that are contained within
7040 /// the specified project.
7041 pub fn list(&self) -> super::builder::machine_images::List {
7042 super::builder::machine_images::List::new(self.inner.clone())
7043 }
7044
7045 /// Sets the access control policy on the specified resource.
7046 /// Replaces any existing policy.
7047 pub fn set_iam_policy(&self) -> super::builder::machine_images::SetIamPolicy {
7048 super::builder::machine_images::SetIamPolicy::new(self.inner.clone())
7049 }
7050
7051 /// Sets the labels on a machine image. To learn more about labels, read theLabeling
7052 /// Resources documentation.
7053 pub fn set_labels(&self) -> super::builder::machine_images::SetLabels {
7054 super::builder::machine_images::SetLabels::new(self.inner.clone())
7055 }
7056
7057 /// Returns permissions that a caller has on the specified resource.
7058 pub fn test_iam_permissions(&self) -> super::builder::machine_images::TestIamPermissions {
7059 super::builder::machine_images::TestIamPermissions::new(self.inner.clone())
7060 }
7061
7062 /// Retrieves the specified Operations resource.
7063 pub fn get_operation(&self) -> super::builder::machine_images::GetOperation {
7064 super::builder::machine_images::GetOperation::new(self.inner.clone())
7065 }
7066}
7067
7068/// Implements a client for the Google Compute Engine API.
7069///
7070/// # Example
7071/// ```
7072/// # tokio_test::block_on(async {
7073/// # use google_cloud_compute_v1::client::MachineTypes;
7074/// let client = MachineTypes::builder().build().await?;
7075/// // use `client` to make requests to the Google Compute Engine API.
7076/// # gax::client_builder::Result::<()>::Ok(()) });
7077/// ```
7078///
7079/// # Service Description
7080///
7081/// Service for the `machineTypes` resource.
7082///
7083/// # Configuration
7084///
7085/// To configure `MachineTypes` use the `with_*` methods in the type returned
7086/// by [builder()][MachineTypes::builder]. The default configuration should
7087/// work for most applications. Common configuration changes include
7088///
7089/// * [with_endpoint()]: by default this client uses the global default endpoint
7090/// (`https://compute.googleapis.com`). Applications using regional
7091/// endpoints or running in restricted networks (e.g. a network configured
7092// with [Private Google Access with VPC Service Controls]) may want to
7093/// override this default.
7094/// * [with_credentials()]: by default this client uses
7095/// [Application Default Credentials]. Applications using custom
7096/// authentication may need to override this default.
7097///
7098/// [with_endpoint()]: super::builder::machine_types::ClientBuilder::with_endpoint
7099/// [with_credentials()]: super::builder::machine_types::ClientBuilder::credentials
7100/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7101/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7102///
7103/// # Pooling and Cloning
7104///
7105/// `MachineTypes` holds a connection pool internally, it is advised to
7106/// create one and the reuse it. You do not need to wrap `MachineTypes` in
7107/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7108/// already uses an `Arc` internally.
7109#[cfg(feature = "machine-types")]
7110#[cfg_attr(docsrs, doc(cfg(feature = "machine-types")))]
7111#[derive(Clone, Debug)]
7112pub struct MachineTypes {
7113 inner: std::sync::Arc<dyn super::stub::dynamic::MachineTypes>,
7114}
7115
7116#[cfg(feature = "machine-types")]
7117impl MachineTypes {
7118 /// Returns a builder for [MachineTypes].
7119 ///
7120 /// ```
7121 /// # tokio_test::block_on(async {
7122 /// # use google_cloud_compute_v1::client::MachineTypes;
7123 /// let client = MachineTypes::builder().build().await?;
7124 /// # gax::client_builder::Result::<()>::Ok(()) });
7125 /// ```
7126 pub fn builder() -> super::builder::machine_types::ClientBuilder {
7127 gax::client_builder::internal::new_builder(super::builder::machine_types::client::Factory)
7128 }
7129
7130 /// Creates a new client from the provided stub.
7131 ///
7132 /// The most common case for calling this function is in tests mocking the
7133 /// client's behavior.
7134 pub fn from_stub<T>(stub: T) -> Self
7135 where
7136 T: super::stub::MachineTypes + 'static,
7137 {
7138 Self {
7139 inner: std::sync::Arc::new(stub),
7140 }
7141 }
7142
7143 pub(crate) async fn new(
7144 config: gaxi::options::ClientConfig,
7145 ) -> gax::client_builder::Result<Self> {
7146 let inner = Self::build_inner(config).await?;
7147 Ok(Self { inner })
7148 }
7149
7150 async fn build_inner(
7151 conf: gaxi::options::ClientConfig,
7152 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::MachineTypes>> {
7153 if gaxi::options::tracing_enabled(&conf) {
7154 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7155 }
7156 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7157 }
7158
7159 async fn build_transport(
7160 conf: gaxi::options::ClientConfig,
7161 ) -> gax::client_builder::Result<impl super::stub::MachineTypes> {
7162 super::transport::MachineTypes::new(conf).await
7163 }
7164
7165 async fn build_with_tracing(
7166 conf: gaxi::options::ClientConfig,
7167 ) -> gax::client_builder::Result<impl super::stub::MachineTypes> {
7168 Self::build_transport(conf)
7169 .await
7170 .map(super::tracing::MachineTypes::new)
7171 }
7172
7173 /// Retrieves an aggregated list of machine types.
7174 ///
7175 /// To prevent failure, Google recommends that you set the
7176 /// `returnPartialSuccess` parameter to `true`.
7177 pub fn aggregated_list(&self) -> super::builder::machine_types::AggregatedList {
7178 super::builder::machine_types::AggregatedList::new(self.inner.clone())
7179 }
7180
7181 /// Returns the specified machine type.
7182 pub fn get(&self) -> super::builder::machine_types::Get {
7183 super::builder::machine_types::Get::new(self.inner.clone())
7184 }
7185
7186 /// Retrieves a list of machine types available to the specified
7187 /// project.
7188 pub fn list(&self) -> super::builder::machine_types::List {
7189 super::builder::machine_types::List::new(self.inner.clone())
7190 }
7191}
7192
7193/// Implements a client for the Google Compute Engine API.
7194///
7195/// # Example
7196/// ```
7197/// # tokio_test::block_on(async {
7198/// # use google_cloud_compute_v1::client::NetworkAttachments;
7199/// let client = NetworkAttachments::builder().build().await?;
7200/// // use `client` to make requests to the Google Compute Engine API.
7201/// # gax::client_builder::Result::<()>::Ok(()) });
7202/// ```
7203///
7204/// # Service Description
7205///
7206/// Service for the `networkAttachments` resource.
7207///
7208/// # Configuration
7209///
7210/// To configure `NetworkAttachments` use the `with_*` methods in the type returned
7211/// by [builder()][NetworkAttachments::builder]. The default configuration should
7212/// work for most applications. Common configuration changes include
7213///
7214/// * [with_endpoint()]: by default this client uses the global default endpoint
7215/// (`https://compute.googleapis.com`). Applications using regional
7216/// endpoints or running in restricted networks (e.g. a network configured
7217// with [Private Google Access with VPC Service Controls]) may want to
7218/// override this default.
7219/// * [with_credentials()]: by default this client uses
7220/// [Application Default Credentials]. Applications using custom
7221/// authentication may need to override this default.
7222///
7223/// [with_endpoint()]: super::builder::network_attachments::ClientBuilder::with_endpoint
7224/// [with_credentials()]: super::builder::network_attachments::ClientBuilder::credentials
7225/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7226/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7227///
7228/// # Pooling and Cloning
7229///
7230/// `NetworkAttachments` holds a connection pool internally, it is advised to
7231/// create one and the reuse it. You do not need to wrap `NetworkAttachments` in
7232/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7233/// already uses an `Arc` internally.
7234#[cfg(feature = "network-attachments")]
7235#[cfg_attr(docsrs, doc(cfg(feature = "network-attachments")))]
7236#[derive(Clone, Debug)]
7237pub struct NetworkAttachments {
7238 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkAttachments>,
7239}
7240
7241#[cfg(feature = "network-attachments")]
7242impl NetworkAttachments {
7243 /// Returns a builder for [NetworkAttachments].
7244 ///
7245 /// ```
7246 /// # tokio_test::block_on(async {
7247 /// # use google_cloud_compute_v1::client::NetworkAttachments;
7248 /// let client = NetworkAttachments::builder().build().await?;
7249 /// # gax::client_builder::Result::<()>::Ok(()) });
7250 /// ```
7251 pub fn builder() -> super::builder::network_attachments::ClientBuilder {
7252 gax::client_builder::internal::new_builder(
7253 super::builder::network_attachments::client::Factory,
7254 )
7255 }
7256
7257 /// Creates a new client from the provided stub.
7258 ///
7259 /// The most common case for calling this function is in tests mocking the
7260 /// client's behavior.
7261 pub fn from_stub<T>(stub: T) -> Self
7262 where
7263 T: super::stub::NetworkAttachments + 'static,
7264 {
7265 Self {
7266 inner: std::sync::Arc::new(stub),
7267 }
7268 }
7269
7270 pub(crate) async fn new(
7271 config: gaxi::options::ClientConfig,
7272 ) -> gax::client_builder::Result<Self> {
7273 let inner = Self::build_inner(config).await?;
7274 Ok(Self { inner })
7275 }
7276
7277 async fn build_inner(
7278 conf: gaxi::options::ClientConfig,
7279 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::NetworkAttachments>>
7280 {
7281 if gaxi::options::tracing_enabled(&conf) {
7282 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7283 }
7284 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7285 }
7286
7287 async fn build_transport(
7288 conf: gaxi::options::ClientConfig,
7289 ) -> gax::client_builder::Result<impl super::stub::NetworkAttachments> {
7290 super::transport::NetworkAttachments::new(conf).await
7291 }
7292
7293 async fn build_with_tracing(
7294 conf: gaxi::options::ClientConfig,
7295 ) -> gax::client_builder::Result<impl super::stub::NetworkAttachments> {
7296 Self::build_transport(conf)
7297 .await
7298 .map(super::tracing::NetworkAttachments::new)
7299 }
7300
7301 /// Retrieves the list of all NetworkAttachment resources,
7302 /// regional and global, available to the specified project.
7303 ///
7304 /// To prevent failure, Google recommends that you set the
7305 /// `returnPartialSuccess` parameter to `true`.
7306 pub fn aggregated_list(&self) -> super::builder::network_attachments::AggregatedList {
7307 super::builder::network_attachments::AggregatedList::new(self.inner.clone())
7308 }
7309
7310 /// Deletes the specified NetworkAttachment in the given scope
7311 pub fn delete(&self) -> super::builder::network_attachments::Delete {
7312 super::builder::network_attachments::Delete::new(self.inner.clone())
7313 }
7314
7315 /// Returns the specified NetworkAttachment resource in the given scope.
7316 pub fn get(&self) -> super::builder::network_attachments::Get {
7317 super::builder::network_attachments::Get::new(self.inner.clone())
7318 }
7319
7320 /// Gets the access control policy for a resource. May be empty if no such
7321 /// policy or resource exists.
7322 pub fn get_iam_policy(&self) -> super::builder::network_attachments::GetIamPolicy {
7323 super::builder::network_attachments::GetIamPolicy::new(self.inner.clone())
7324 }
7325
7326 /// Creates a NetworkAttachment in the specified project in the given scope
7327 /// using the parameters that are included in the request.
7328 pub fn insert(&self) -> super::builder::network_attachments::Insert {
7329 super::builder::network_attachments::Insert::new(self.inner.clone())
7330 }
7331
7332 /// Lists the NetworkAttachments for a project in the given scope.
7333 pub fn list(&self) -> super::builder::network_attachments::List {
7334 super::builder::network_attachments::List::new(self.inner.clone())
7335 }
7336
7337 /// Patches the specified NetworkAttachment resource with the data included in
7338 /// the request. This method supports PATCH
7339 /// semantics and usesJSON merge
7340 /// patch format and processing rules.
7341 pub fn patch(&self) -> super::builder::network_attachments::Patch {
7342 super::builder::network_attachments::Patch::new(self.inner.clone())
7343 }
7344
7345 /// Sets the access control policy on the specified resource.
7346 /// Replaces any existing policy.
7347 pub fn set_iam_policy(&self) -> super::builder::network_attachments::SetIamPolicy {
7348 super::builder::network_attachments::SetIamPolicy::new(self.inner.clone())
7349 }
7350
7351 /// Returns permissions that a caller has on the specified resource.
7352 pub fn test_iam_permissions(&self) -> super::builder::network_attachments::TestIamPermissions {
7353 super::builder::network_attachments::TestIamPermissions::new(self.inner.clone())
7354 }
7355
7356 /// Retrieves the specified region-specific Operations resource.
7357 pub fn get_operation(&self) -> super::builder::network_attachments::GetOperation {
7358 super::builder::network_attachments::GetOperation::new(self.inner.clone())
7359 }
7360}
7361
7362/// Implements a client for the Google Compute Engine API.
7363///
7364/// # Example
7365/// ```
7366/// # tokio_test::block_on(async {
7367/// # use google_cloud_compute_v1::client::NetworkEdgeSecurityServices;
7368/// let client = NetworkEdgeSecurityServices::builder().build().await?;
7369/// // use `client` to make requests to the Google Compute Engine API.
7370/// # gax::client_builder::Result::<()>::Ok(()) });
7371/// ```
7372///
7373/// # Service Description
7374///
7375/// Service for the `networkEdgeSecurityServices` resource.
7376///
7377/// # Configuration
7378///
7379/// To configure `NetworkEdgeSecurityServices` use the `with_*` methods in the type returned
7380/// by [builder()][NetworkEdgeSecurityServices::builder]. The default configuration should
7381/// work for most applications. Common configuration changes include
7382///
7383/// * [with_endpoint()]: by default this client uses the global default endpoint
7384/// (`https://compute.googleapis.com`). Applications using regional
7385/// endpoints or running in restricted networks (e.g. a network configured
7386// with [Private Google Access with VPC Service Controls]) may want to
7387/// override this default.
7388/// * [with_credentials()]: by default this client uses
7389/// [Application Default Credentials]. Applications using custom
7390/// authentication may need to override this default.
7391///
7392/// [with_endpoint()]: super::builder::network_edge_security_services::ClientBuilder::with_endpoint
7393/// [with_credentials()]: super::builder::network_edge_security_services::ClientBuilder::credentials
7394/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7395/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7396///
7397/// # Pooling and Cloning
7398///
7399/// `NetworkEdgeSecurityServices` holds a connection pool internally, it is advised to
7400/// create one and the reuse it. You do not need to wrap `NetworkEdgeSecurityServices` in
7401/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7402/// already uses an `Arc` internally.
7403#[cfg(feature = "network-edge-security-services")]
7404#[cfg_attr(docsrs, doc(cfg(feature = "network-edge-security-services")))]
7405#[derive(Clone, Debug)]
7406pub struct NetworkEdgeSecurityServices {
7407 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkEdgeSecurityServices>,
7408}
7409
7410#[cfg(feature = "network-edge-security-services")]
7411impl NetworkEdgeSecurityServices {
7412 /// Returns a builder for [NetworkEdgeSecurityServices].
7413 ///
7414 /// ```
7415 /// # tokio_test::block_on(async {
7416 /// # use google_cloud_compute_v1::client::NetworkEdgeSecurityServices;
7417 /// let client = NetworkEdgeSecurityServices::builder().build().await?;
7418 /// # gax::client_builder::Result::<()>::Ok(()) });
7419 /// ```
7420 pub fn builder() -> super::builder::network_edge_security_services::ClientBuilder {
7421 gax::client_builder::internal::new_builder(
7422 super::builder::network_edge_security_services::client::Factory,
7423 )
7424 }
7425
7426 /// Creates a new client from the provided stub.
7427 ///
7428 /// The most common case for calling this function is in tests mocking the
7429 /// client's behavior.
7430 pub fn from_stub<T>(stub: T) -> Self
7431 where
7432 T: super::stub::NetworkEdgeSecurityServices + 'static,
7433 {
7434 Self {
7435 inner: std::sync::Arc::new(stub),
7436 }
7437 }
7438
7439 pub(crate) async fn new(
7440 config: gaxi::options::ClientConfig,
7441 ) -> gax::client_builder::Result<Self> {
7442 let inner = Self::build_inner(config).await?;
7443 Ok(Self { inner })
7444 }
7445
7446 async fn build_inner(
7447 conf: gaxi::options::ClientConfig,
7448 ) -> gax::client_builder::Result<
7449 std::sync::Arc<dyn super::stub::dynamic::NetworkEdgeSecurityServices>,
7450 > {
7451 if gaxi::options::tracing_enabled(&conf) {
7452 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7453 }
7454 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7455 }
7456
7457 async fn build_transport(
7458 conf: gaxi::options::ClientConfig,
7459 ) -> gax::client_builder::Result<impl super::stub::NetworkEdgeSecurityServices> {
7460 super::transport::NetworkEdgeSecurityServices::new(conf).await
7461 }
7462
7463 async fn build_with_tracing(
7464 conf: gaxi::options::ClientConfig,
7465 ) -> gax::client_builder::Result<impl super::stub::NetworkEdgeSecurityServices> {
7466 Self::build_transport(conf)
7467 .await
7468 .map(super::tracing::NetworkEdgeSecurityServices::new)
7469 }
7470
7471 /// Retrieves the list of all NetworkEdgeSecurityService resources available to
7472 /// the specified project.
7473 ///
7474 /// To prevent failure, Google recommends that you set the
7475 /// `returnPartialSuccess` parameter to `true`.
7476 pub fn aggregated_list(
7477 &self,
7478 ) -> super::builder::network_edge_security_services::AggregatedList {
7479 super::builder::network_edge_security_services::AggregatedList::new(self.inner.clone())
7480 }
7481
7482 /// Deletes the specified service.
7483 pub fn delete(&self) -> super::builder::network_edge_security_services::Delete {
7484 super::builder::network_edge_security_services::Delete::new(self.inner.clone())
7485 }
7486
7487 /// Gets a specified NetworkEdgeSecurityService.
7488 pub fn get(&self) -> super::builder::network_edge_security_services::Get {
7489 super::builder::network_edge_security_services::Get::new(self.inner.clone())
7490 }
7491
7492 /// Creates a new service in the specified project using the data included in
7493 /// the request.
7494 pub fn insert(&self) -> super::builder::network_edge_security_services::Insert {
7495 super::builder::network_edge_security_services::Insert::new(self.inner.clone())
7496 }
7497
7498 /// Patches the specified policy with the data included in the request.
7499 pub fn patch(&self) -> super::builder::network_edge_security_services::Patch {
7500 super::builder::network_edge_security_services::Patch::new(self.inner.clone())
7501 }
7502
7503 /// Retrieves the specified region-specific Operations resource.
7504 pub fn get_operation(&self) -> super::builder::network_edge_security_services::GetOperation {
7505 super::builder::network_edge_security_services::GetOperation::new(self.inner.clone())
7506 }
7507}
7508
7509/// Implements a client for the Google Compute Engine API.
7510///
7511/// # Example
7512/// ```
7513/// # tokio_test::block_on(async {
7514/// # use google_cloud_compute_v1::client::NetworkEndpointGroups;
7515/// let client = NetworkEndpointGroups::builder().build().await?;
7516/// // use `client` to make requests to the Google Compute Engine API.
7517/// # gax::client_builder::Result::<()>::Ok(()) });
7518/// ```
7519///
7520/// # Service Description
7521///
7522/// Service for the `networkEndpointGroups` resource.
7523///
7524/// # Configuration
7525///
7526/// To configure `NetworkEndpointGroups` use the `with_*` methods in the type returned
7527/// by [builder()][NetworkEndpointGroups::builder]. The default configuration should
7528/// work for most applications. Common configuration changes include
7529///
7530/// * [with_endpoint()]: by default this client uses the global default endpoint
7531/// (`https://compute.googleapis.com`). Applications using regional
7532/// endpoints or running in restricted networks (e.g. a network configured
7533// with [Private Google Access with VPC Service Controls]) may want to
7534/// override this default.
7535/// * [with_credentials()]: by default this client uses
7536/// [Application Default Credentials]. Applications using custom
7537/// authentication may need to override this default.
7538///
7539/// [with_endpoint()]: super::builder::network_endpoint_groups::ClientBuilder::with_endpoint
7540/// [with_credentials()]: super::builder::network_endpoint_groups::ClientBuilder::credentials
7541/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7542/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7543///
7544/// # Pooling and Cloning
7545///
7546/// `NetworkEndpointGroups` holds a connection pool internally, it is advised to
7547/// create one and the reuse it. You do not need to wrap `NetworkEndpointGroups` in
7548/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7549/// already uses an `Arc` internally.
7550#[cfg(feature = "network-endpoint-groups")]
7551#[cfg_attr(docsrs, doc(cfg(feature = "network-endpoint-groups")))]
7552#[derive(Clone, Debug)]
7553pub struct NetworkEndpointGroups {
7554 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkEndpointGroups>,
7555}
7556
7557#[cfg(feature = "network-endpoint-groups")]
7558impl NetworkEndpointGroups {
7559 /// Returns a builder for [NetworkEndpointGroups].
7560 ///
7561 /// ```
7562 /// # tokio_test::block_on(async {
7563 /// # use google_cloud_compute_v1::client::NetworkEndpointGroups;
7564 /// let client = NetworkEndpointGroups::builder().build().await?;
7565 /// # gax::client_builder::Result::<()>::Ok(()) });
7566 /// ```
7567 pub fn builder() -> super::builder::network_endpoint_groups::ClientBuilder {
7568 gax::client_builder::internal::new_builder(
7569 super::builder::network_endpoint_groups::client::Factory,
7570 )
7571 }
7572
7573 /// Creates a new client from the provided stub.
7574 ///
7575 /// The most common case for calling this function is in tests mocking the
7576 /// client's behavior.
7577 pub fn from_stub<T>(stub: T) -> Self
7578 where
7579 T: super::stub::NetworkEndpointGroups + 'static,
7580 {
7581 Self {
7582 inner: std::sync::Arc::new(stub),
7583 }
7584 }
7585
7586 pub(crate) async fn new(
7587 config: gaxi::options::ClientConfig,
7588 ) -> gax::client_builder::Result<Self> {
7589 let inner = Self::build_inner(config).await?;
7590 Ok(Self { inner })
7591 }
7592
7593 async fn build_inner(
7594 conf: gaxi::options::ClientConfig,
7595 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::NetworkEndpointGroups>>
7596 {
7597 if gaxi::options::tracing_enabled(&conf) {
7598 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7599 }
7600 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7601 }
7602
7603 async fn build_transport(
7604 conf: gaxi::options::ClientConfig,
7605 ) -> gax::client_builder::Result<impl super::stub::NetworkEndpointGroups> {
7606 super::transport::NetworkEndpointGroups::new(conf).await
7607 }
7608
7609 async fn build_with_tracing(
7610 conf: gaxi::options::ClientConfig,
7611 ) -> gax::client_builder::Result<impl super::stub::NetworkEndpointGroups> {
7612 Self::build_transport(conf)
7613 .await
7614 .map(super::tracing::NetworkEndpointGroups::new)
7615 }
7616
7617 /// Retrieves the list of network endpoint groups and sorts them by zone.
7618 ///
7619 /// To prevent failure, Google recommends that you set the
7620 /// `returnPartialSuccess` parameter to `true`.
7621 pub fn aggregated_list(&self) -> super::builder::network_endpoint_groups::AggregatedList {
7622 super::builder::network_endpoint_groups::AggregatedList::new(self.inner.clone())
7623 }
7624
7625 /// Attach a list of network endpoints to the specified network endpoint group.
7626 pub fn attach_network_endpoints(
7627 &self,
7628 ) -> super::builder::network_endpoint_groups::AttachNetworkEndpoints {
7629 super::builder::network_endpoint_groups::AttachNetworkEndpoints::new(self.inner.clone())
7630 }
7631
7632 /// Deletes the specified network endpoint group. The network endpoints in the
7633 /// NEG and the VM instances they belong to are not terminated when the NEG is
7634 /// deleted. Note that the NEG cannot be deleted if there are backend services
7635 /// referencing it.
7636 pub fn delete(&self) -> super::builder::network_endpoint_groups::Delete {
7637 super::builder::network_endpoint_groups::Delete::new(self.inner.clone())
7638 }
7639
7640 /// Detach a list of network endpoints from the specified network endpoint
7641 /// group.
7642 pub fn detach_network_endpoints(
7643 &self,
7644 ) -> super::builder::network_endpoint_groups::DetachNetworkEndpoints {
7645 super::builder::network_endpoint_groups::DetachNetworkEndpoints::new(self.inner.clone())
7646 }
7647
7648 /// Returns the specified network endpoint group.
7649 pub fn get(&self) -> super::builder::network_endpoint_groups::Get {
7650 super::builder::network_endpoint_groups::Get::new(self.inner.clone())
7651 }
7652
7653 /// Creates a network endpoint group in the specified project using the
7654 /// parameters that are included in the request.
7655 pub fn insert(&self) -> super::builder::network_endpoint_groups::Insert {
7656 super::builder::network_endpoint_groups::Insert::new(self.inner.clone())
7657 }
7658
7659 /// Retrieves the list of network endpoint groups that are located in the
7660 /// specified project and zone.
7661 pub fn list(&self) -> super::builder::network_endpoint_groups::List {
7662 super::builder::network_endpoint_groups::List::new(self.inner.clone())
7663 }
7664
7665 /// Lists the network endpoints in the specified network endpoint group.
7666 pub fn list_network_endpoints(
7667 &self,
7668 ) -> super::builder::network_endpoint_groups::ListNetworkEndpoints {
7669 super::builder::network_endpoint_groups::ListNetworkEndpoints::new(self.inner.clone())
7670 }
7671
7672 /// Returns permissions that a caller has on the specified resource.
7673 pub fn test_iam_permissions(
7674 &self,
7675 ) -> super::builder::network_endpoint_groups::TestIamPermissions {
7676 super::builder::network_endpoint_groups::TestIamPermissions::new(self.inner.clone())
7677 }
7678
7679 /// Retrieves the specified zone-specific Operations resource.
7680 pub fn get_operation(&self) -> super::builder::network_endpoint_groups::GetOperation {
7681 super::builder::network_endpoint_groups::GetOperation::new(self.inner.clone())
7682 }
7683}
7684
7685/// Implements a client for the Google Compute Engine API.
7686///
7687/// # Example
7688/// ```
7689/// # tokio_test::block_on(async {
7690/// # use google_cloud_compute_v1::client::NetworkFirewallPolicies;
7691/// let client = NetworkFirewallPolicies::builder().build().await?;
7692/// // use `client` to make requests to the Google Compute Engine API.
7693/// # gax::client_builder::Result::<()>::Ok(()) });
7694/// ```
7695///
7696/// # Service Description
7697///
7698/// Service for the `networkFirewallPolicies` resource.
7699///
7700/// # Configuration
7701///
7702/// To configure `NetworkFirewallPolicies` use the `with_*` methods in the type returned
7703/// by [builder()][NetworkFirewallPolicies::builder]. The default configuration should
7704/// work for most applications. Common configuration changes include
7705///
7706/// * [with_endpoint()]: by default this client uses the global default endpoint
7707/// (`https://compute.googleapis.com`). Applications using regional
7708/// endpoints or running in restricted networks (e.g. a network configured
7709// with [Private Google Access with VPC Service Controls]) may want to
7710/// override this default.
7711/// * [with_credentials()]: by default this client uses
7712/// [Application Default Credentials]. Applications using custom
7713/// authentication may need to override this default.
7714///
7715/// [with_endpoint()]: super::builder::network_firewall_policies::ClientBuilder::with_endpoint
7716/// [with_credentials()]: super::builder::network_firewall_policies::ClientBuilder::credentials
7717/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7718/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7719///
7720/// # Pooling and Cloning
7721///
7722/// `NetworkFirewallPolicies` holds a connection pool internally, it is advised to
7723/// create one and the reuse it. You do not need to wrap `NetworkFirewallPolicies` in
7724/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7725/// already uses an `Arc` internally.
7726#[cfg(feature = "network-firewall-policies")]
7727#[cfg_attr(docsrs, doc(cfg(feature = "network-firewall-policies")))]
7728#[derive(Clone, Debug)]
7729pub struct NetworkFirewallPolicies {
7730 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkFirewallPolicies>,
7731}
7732
7733#[cfg(feature = "network-firewall-policies")]
7734impl NetworkFirewallPolicies {
7735 /// Returns a builder for [NetworkFirewallPolicies].
7736 ///
7737 /// ```
7738 /// # tokio_test::block_on(async {
7739 /// # use google_cloud_compute_v1::client::NetworkFirewallPolicies;
7740 /// let client = NetworkFirewallPolicies::builder().build().await?;
7741 /// # gax::client_builder::Result::<()>::Ok(()) });
7742 /// ```
7743 pub fn builder() -> super::builder::network_firewall_policies::ClientBuilder {
7744 gax::client_builder::internal::new_builder(
7745 super::builder::network_firewall_policies::client::Factory,
7746 )
7747 }
7748
7749 /// Creates a new client from the provided stub.
7750 ///
7751 /// The most common case for calling this function is in tests mocking the
7752 /// client's behavior.
7753 pub fn from_stub<T>(stub: T) -> Self
7754 where
7755 T: super::stub::NetworkFirewallPolicies + 'static,
7756 {
7757 Self {
7758 inner: std::sync::Arc::new(stub),
7759 }
7760 }
7761
7762 pub(crate) async fn new(
7763 config: gaxi::options::ClientConfig,
7764 ) -> gax::client_builder::Result<Self> {
7765 let inner = Self::build_inner(config).await?;
7766 Ok(Self { inner })
7767 }
7768
7769 async fn build_inner(
7770 conf: gaxi::options::ClientConfig,
7771 ) -> gax::client_builder::Result<
7772 std::sync::Arc<dyn super::stub::dynamic::NetworkFirewallPolicies>,
7773 > {
7774 if gaxi::options::tracing_enabled(&conf) {
7775 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7776 }
7777 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7778 }
7779
7780 async fn build_transport(
7781 conf: gaxi::options::ClientConfig,
7782 ) -> gax::client_builder::Result<impl super::stub::NetworkFirewallPolicies> {
7783 super::transport::NetworkFirewallPolicies::new(conf).await
7784 }
7785
7786 async fn build_with_tracing(
7787 conf: gaxi::options::ClientConfig,
7788 ) -> gax::client_builder::Result<impl super::stub::NetworkFirewallPolicies> {
7789 Self::build_transport(conf)
7790 .await
7791 .map(super::tracing::NetworkFirewallPolicies::new)
7792 }
7793
7794 /// Inserts an association for the specified firewall policy.
7795 pub fn add_association(&self) -> super::builder::network_firewall_policies::AddAssociation {
7796 super::builder::network_firewall_policies::AddAssociation::new(self.inner.clone())
7797 }
7798
7799 /// Inserts a packet mirroring rule into a firewall policy.
7800 pub fn add_packet_mirroring_rule(
7801 &self,
7802 ) -> super::builder::network_firewall_policies::AddPacketMirroringRule {
7803 super::builder::network_firewall_policies::AddPacketMirroringRule::new(self.inner.clone())
7804 }
7805
7806 /// Inserts a rule into a firewall policy.
7807 pub fn add_rule(&self) -> super::builder::network_firewall_policies::AddRule {
7808 super::builder::network_firewall_policies::AddRule::new(self.inner.clone())
7809 }
7810
7811 /// Retrieves an aggregated list of network firewall policies, listing network
7812 /// firewall policies from all applicable scopes (global and regional) and
7813 /// grouping the results per scope.
7814 ///
7815 /// To prevent failure, it is recommended that you set the
7816 /// `returnPartialSuccess` parameter to `true`.
7817 pub fn aggregated_list(&self) -> super::builder::network_firewall_policies::AggregatedList {
7818 super::builder::network_firewall_policies::AggregatedList::new(self.inner.clone())
7819 }
7820
7821 /// Copies rules to the specified firewall policy.
7822 pub fn clone_rules(&self) -> super::builder::network_firewall_policies::CloneRules {
7823 super::builder::network_firewall_policies::CloneRules::new(self.inner.clone())
7824 }
7825
7826 /// Deletes the specified policy.
7827 pub fn delete(&self) -> super::builder::network_firewall_policies::Delete {
7828 super::builder::network_firewall_policies::Delete::new(self.inner.clone())
7829 }
7830
7831 /// Returns the specified network firewall policy.
7832 pub fn get(&self) -> super::builder::network_firewall_policies::Get {
7833 super::builder::network_firewall_policies::Get::new(self.inner.clone())
7834 }
7835
7836 /// Gets an association with the specified name.
7837 pub fn get_association(&self) -> super::builder::network_firewall_policies::GetAssociation {
7838 super::builder::network_firewall_policies::GetAssociation::new(self.inner.clone())
7839 }
7840
7841 /// Gets the access control policy for a resource. May be empty if no such
7842 /// policy or resource exists.
7843 pub fn get_iam_policy(&self) -> super::builder::network_firewall_policies::GetIamPolicy {
7844 super::builder::network_firewall_policies::GetIamPolicy::new(self.inner.clone())
7845 }
7846
7847 /// Gets a packet mirroring rule of the specified priority.
7848 pub fn get_packet_mirroring_rule(
7849 &self,
7850 ) -> super::builder::network_firewall_policies::GetPacketMirroringRule {
7851 super::builder::network_firewall_policies::GetPacketMirroringRule::new(self.inner.clone())
7852 }
7853
7854 /// Gets a rule of the specified priority.
7855 pub fn get_rule(&self) -> super::builder::network_firewall_policies::GetRule {
7856 super::builder::network_firewall_policies::GetRule::new(self.inner.clone())
7857 }
7858
7859 /// Creates a new policy in the specified project using the data included in
7860 /// the request.
7861 pub fn insert(&self) -> super::builder::network_firewall_policies::Insert {
7862 super::builder::network_firewall_policies::Insert::new(self.inner.clone())
7863 }
7864
7865 /// Lists all the policies that have been configured for the specified project.
7866 pub fn list(&self) -> super::builder::network_firewall_policies::List {
7867 super::builder::network_firewall_policies::List::new(self.inner.clone())
7868 }
7869
7870 /// Patches the specified policy with the data included in the request.
7871 pub fn patch(&self) -> super::builder::network_firewall_policies::Patch {
7872 super::builder::network_firewall_policies::Patch::new(self.inner.clone())
7873 }
7874
7875 /// Patches a packet mirroring rule of the specified priority.
7876 pub fn patch_packet_mirroring_rule(
7877 &self,
7878 ) -> super::builder::network_firewall_policies::PatchPacketMirroringRule {
7879 super::builder::network_firewall_policies::PatchPacketMirroringRule::new(self.inner.clone())
7880 }
7881
7882 /// Patches a rule of the specified priority.
7883 pub fn patch_rule(&self) -> super::builder::network_firewall_policies::PatchRule {
7884 super::builder::network_firewall_policies::PatchRule::new(self.inner.clone())
7885 }
7886
7887 /// Removes an association for the specified firewall policy.
7888 pub fn remove_association(
7889 &self,
7890 ) -> super::builder::network_firewall_policies::RemoveAssociation {
7891 super::builder::network_firewall_policies::RemoveAssociation::new(self.inner.clone())
7892 }
7893
7894 /// Deletes a packet mirroring rule of the specified priority.
7895 pub fn remove_packet_mirroring_rule(
7896 &self,
7897 ) -> super::builder::network_firewall_policies::RemovePacketMirroringRule {
7898 super::builder::network_firewall_policies::RemovePacketMirroringRule::new(
7899 self.inner.clone(),
7900 )
7901 }
7902
7903 /// Deletes a rule of the specified priority.
7904 pub fn remove_rule(&self) -> super::builder::network_firewall_policies::RemoveRule {
7905 super::builder::network_firewall_policies::RemoveRule::new(self.inner.clone())
7906 }
7907
7908 /// Sets the access control policy on the specified resource.
7909 /// Replaces any existing policy.
7910 pub fn set_iam_policy(&self) -> super::builder::network_firewall_policies::SetIamPolicy {
7911 super::builder::network_firewall_policies::SetIamPolicy::new(self.inner.clone())
7912 }
7913
7914 /// Returns permissions that a caller has on the specified resource.
7915 pub fn test_iam_permissions(
7916 &self,
7917 ) -> super::builder::network_firewall_policies::TestIamPermissions {
7918 super::builder::network_firewall_policies::TestIamPermissions::new(self.inner.clone())
7919 }
7920
7921 /// Retrieves the specified Operations resource.
7922 pub fn get_operation(&self) -> super::builder::network_firewall_policies::GetOperation {
7923 super::builder::network_firewall_policies::GetOperation::new(self.inner.clone())
7924 }
7925}
7926
7927/// Implements a client for the Google Compute Engine API.
7928///
7929/// # Example
7930/// ```
7931/// # tokio_test::block_on(async {
7932/// # use google_cloud_compute_v1::client::NetworkProfiles;
7933/// let client = NetworkProfiles::builder().build().await?;
7934/// // use `client` to make requests to the Google Compute Engine API.
7935/// # gax::client_builder::Result::<()>::Ok(()) });
7936/// ```
7937///
7938/// # Service Description
7939///
7940/// Service for the `networkProfiles` resource.
7941///
7942/// # Configuration
7943///
7944/// To configure `NetworkProfiles` use the `with_*` methods in the type returned
7945/// by [builder()][NetworkProfiles::builder]. The default configuration should
7946/// work for most applications. Common configuration changes include
7947///
7948/// * [with_endpoint()]: by default this client uses the global default endpoint
7949/// (`https://compute.googleapis.com`). Applications using regional
7950/// endpoints or running in restricted networks (e.g. a network configured
7951// with [Private Google Access with VPC Service Controls]) may want to
7952/// override this default.
7953/// * [with_credentials()]: by default this client uses
7954/// [Application Default Credentials]. Applications using custom
7955/// authentication may need to override this default.
7956///
7957/// [with_endpoint()]: super::builder::network_profiles::ClientBuilder::with_endpoint
7958/// [with_credentials()]: super::builder::network_profiles::ClientBuilder::credentials
7959/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7960/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7961///
7962/// # Pooling and Cloning
7963///
7964/// `NetworkProfiles` holds a connection pool internally, it is advised to
7965/// create one and the reuse it. You do not need to wrap `NetworkProfiles` in
7966/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7967/// already uses an `Arc` internally.
7968#[cfg(feature = "network-profiles")]
7969#[cfg_attr(docsrs, doc(cfg(feature = "network-profiles")))]
7970#[derive(Clone, Debug)]
7971pub struct NetworkProfiles {
7972 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkProfiles>,
7973}
7974
7975#[cfg(feature = "network-profiles")]
7976impl NetworkProfiles {
7977 /// Returns a builder for [NetworkProfiles].
7978 ///
7979 /// ```
7980 /// # tokio_test::block_on(async {
7981 /// # use google_cloud_compute_v1::client::NetworkProfiles;
7982 /// let client = NetworkProfiles::builder().build().await?;
7983 /// # gax::client_builder::Result::<()>::Ok(()) });
7984 /// ```
7985 pub fn builder() -> super::builder::network_profiles::ClientBuilder {
7986 gax::client_builder::internal::new_builder(
7987 super::builder::network_profiles::client::Factory,
7988 )
7989 }
7990
7991 /// Creates a new client from the provided stub.
7992 ///
7993 /// The most common case for calling this function is in tests mocking the
7994 /// client's behavior.
7995 pub fn from_stub<T>(stub: T) -> Self
7996 where
7997 T: super::stub::NetworkProfiles + 'static,
7998 {
7999 Self {
8000 inner: std::sync::Arc::new(stub),
8001 }
8002 }
8003
8004 pub(crate) async fn new(
8005 config: gaxi::options::ClientConfig,
8006 ) -> gax::client_builder::Result<Self> {
8007 let inner = Self::build_inner(config).await?;
8008 Ok(Self { inner })
8009 }
8010
8011 async fn build_inner(
8012 conf: gaxi::options::ClientConfig,
8013 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::NetworkProfiles>>
8014 {
8015 if gaxi::options::tracing_enabled(&conf) {
8016 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8017 }
8018 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8019 }
8020
8021 async fn build_transport(
8022 conf: gaxi::options::ClientConfig,
8023 ) -> gax::client_builder::Result<impl super::stub::NetworkProfiles> {
8024 super::transport::NetworkProfiles::new(conf).await
8025 }
8026
8027 async fn build_with_tracing(
8028 conf: gaxi::options::ClientConfig,
8029 ) -> gax::client_builder::Result<impl super::stub::NetworkProfiles> {
8030 Self::build_transport(conf)
8031 .await
8032 .map(super::tracing::NetworkProfiles::new)
8033 }
8034
8035 /// Returns the specified network profile.
8036 pub fn get(&self) -> super::builder::network_profiles::Get {
8037 super::builder::network_profiles::Get::new(self.inner.clone())
8038 }
8039
8040 /// Retrieves a list of network profiles available to the specified
8041 /// project.
8042 pub fn list(&self) -> super::builder::network_profiles::List {
8043 super::builder::network_profiles::List::new(self.inner.clone())
8044 }
8045}
8046
8047/// Implements a client for the Google Compute Engine API.
8048///
8049/// # Example
8050/// ```
8051/// # tokio_test::block_on(async {
8052/// # use google_cloud_compute_v1::client::Networks;
8053/// let client = Networks::builder().build().await?;
8054/// // use `client` to make requests to the Google Compute Engine API.
8055/// # gax::client_builder::Result::<()>::Ok(()) });
8056/// ```
8057///
8058/// # Service Description
8059///
8060/// Service for the `networks` resource.
8061///
8062/// # Configuration
8063///
8064/// To configure `Networks` use the `with_*` methods in the type returned
8065/// by [builder()][Networks::builder]. The default configuration should
8066/// work for most applications. Common configuration changes include
8067///
8068/// * [with_endpoint()]: by default this client uses the global default endpoint
8069/// (`https://compute.googleapis.com`). Applications using regional
8070/// endpoints or running in restricted networks (e.g. a network configured
8071// with [Private Google Access with VPC Service Controls]) may want to
8072/// override this default.
8073/// * [with_credentials()]: by default this client uses
8074/// [Application Default Credentials]. Applications using custom
8075/// authentication may need to override this default.
8076///
8077/// [with_endpoint()]: super::builder::networks::ClientBuilder::with_endpoint
8078/// [with_credentials()]: super::builder::networks::ClientBuilder::credentials
8079/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8080/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8081///
8082/// # Pooling and Cloning
8083///
8084/// `Networks` holds a connection pool internally, it is advised to
8085/// create one and the reuse it. You do not need to wrap `Networks` in
8086/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8087/// already uses an `Arc` internally.
8088#[cfg(feature = "networks")]
8089#[cfg_attr(docsrs, doc(cfg(feature = "networks")))]
8090#[derive(Clone, Debug)]
8091pub struct Networks {
8092 inner: std::sync::Arc<dyn super::stub::dynamic::Networks>,
8093}
8094
8095#[cfg(feature = "networks")]
8096impl Networks {
8097 /// Returns a builder for [Networks].
8098 ///
8099 /// ```
8100 /// # tokio_test::block_on(async {
8101 /// # use google_cloud_compute_v1::client::Networks;
8102 /// let client = Networks::builder().build().await?;
8103 /// # gax::client_builder::Result::<()>::Ok(()) });
8104 /// ```
8105 pub fn builder() -> super::builder::networks::ClientBuilder {
8106 gax::client_builder::internal::new_builder(super::builder::networks::client::Factory)
8107 }
8108
8109 /// Creates a new client from the provided stub.
8110 ///
8111 /// The most common case for calling this function is in tests mocking the
8112 /// client's behavior.
8113 pub fn from_stub<T>(stub: T) -> Self
8114 where
8115 T: super::stub::Networks + 'static,
8116 {
8117 Self {
8118 inner: std::sync::Arc::new(stub),
8119 }
8120 }
8121
8122 pub(crate) async fn new(
8123 config: gaxi::options::ClientConfig,
8124 ) -> gax::client_builder::Result<Self> {
8125 let inner = Self::build_inner(config).await?;
8126 Ok(Self { inner })
8127 }
8128
8129 async fn build_inner(
8130 conf: gaxi::options::ClientConfig,
8131 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Networks>> {
8132 if gaxi::options::tracing_enabled(&conf) {
8133 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8134 }
8135 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8136 }
8137
8138 async fn build_transport(
8139 conf: gaxi::options::ClientConfig,
8140 ) -> gax::client_builder::Result<impl super::stub::Networks> {
8141 super::transport::Networks::new(conf).await
8142 }
8143
8144 async fn build_with_tracing(
8145 conf: gaxi::options::ClientConfig,
8146 ) -> gax::client_builder::Result<impl super::stub::Networks> {
8147 Self::build_transport(conf)
8148 .await
8149 .map(super::tracing::Networks::new)
8150 }
8151
8152 /// Adds a peering to the specified network.
8153 pub fn add_peering(&self) -> super::builder::networks::AddPeering {
8154 super::builder::networks::AddPeering::new(self.inner.clone())
8155 }
8156
8157 /// Deletes the specified network.
8158 pub fn delete(&self) -> super::builder::networks::Delete {
8159 super::builder::networks::Delete::new(self.inner.clone())
8160 }
8161
8162 /// Returns the specified network.
8163 pub fn get(&self) -> super::builder::networks::Get {
8164 super::builder::networks::Get::new(self.inner.clone())
8165 }
8166
8167 /// Returns the effective firewalls on a given network.
8168 pub fn get_effective_firewalls(&self) -> super::builder::networks::GetEffectiveFirewalls {
8169 super::builder::networks::GetEffectiveFirewalls::new(self.inner.clone())
8170 }
8171
8172 /// Creates a network in the specified project using the data included
8173 /// in the request.
8174 pub fn insert(&self) -> super::builder::networks::Insert {
8175 super::builder::networks::Insert::new(self.inner.clone())
8176 }
8177
8178 /// Retrieves the list of networks available to the specified project.
8179 pub fn list(&self) -> super::builder::networks::List {
8180 super::builder::networks::List::new(self.inner.clone())
8181 }
8182
8183 /// Lists the peering routes exchanged over peering connection.
8184 pub fn list_peering_routes(&self) -> super::builder::networks::ListPeeringRoutes {
8185 super::builder::networks::ListPeeringRoutes::new(self.inner.clone())
8186 }
8187
8188 /// Patches the specified network with the data included in the request.
8189 /// Only routingConfig can be modified.
8190 pub fn patch(&self) -> super::builder::networks::Patch {
8191 super::builder::networks::Patch::new(self.inner.clone())
8192 }
8193
8194 /// Removes a peering from the specified network.
8195 pub fn remove_peering(&self) -> super::builder::networks::RemovePeering {
8196 super::builder::networks::RemovePeering::new(self.inner.clone())
8197 }
8198
8199 /// Requests to remove a peering from the specified network. Applicable only
8200 /// for PeeringConnection with update_strategy=CONSENSUS.
8201 pub fn request_remove_peering(&self) -> super::builder::networks::RequestRemovePeering {
8202 super::builder::networks::RequestRemovePeering::new(self.inner.clone())
8203 }
8204
8205 /// Switches the network mode from auto subnet mode to custom subnet mode.
8206 pub fn switch_to_custom_mode(&self) -> super::builder::networks::SwitchToCustomMode {
8207 super::builder::networks::SwitchToCustomMode::new(self.inner.clone())
8208 }
8209
8210 /// Updates the specified network peering with the data included in the
8211 /// request. You can only modify the NetworkPeering.export_custom_routes field
8212 /// and the NetworkPeering.import_custom_routes field.
8213 pub fn update_peering(&self) -> super::builder::networks::UpdatePeering {
8214 super::builder::networks::UpdatePeering::new(self.inner.clone())
8215 }
8216
8217 /// Retrieves the specified Operations resource.
8218 pub fn get_operation(&self) -> super::builder::networks::GetOperation {
8219 super::builder::networks::GetOperation::new(self.inner.clone())
8220 }
8221}
8222
8223/// Implements a client for the Google Compute Engine API.
8224///
8225/// # Example
8226/// ```
8227/// # tokio_test::block_on(async {
8228/// # use google_cloud_compute_v1::client::NodeGroups;
8229/// let client = NodeGroups::builder().build().await?;
8230/// // use `client` to make requests to the Google Compute Engine API.
8231/// # gax::client_builder::Result::<()>::Ok(()) });
8232/// ```
8233///
8234/// # Service Description
8235///
8236/// Service for the `nodeGroups` resource.
8237///
8238/// # Configuration
8239///
8240/// To configure `NodeGroups` use the `with_*` methods in the type returned
8241/// by [builder()][NodeGroups::builder]. The default configuration should
8242/// work for most applications. Common configuration changes include
8243///
8244/// * [with_endpoint()]: by default this client uses the global default endpoint
8245/// (`https://compute.googleapis.com`). Applications using regional
8246/// endpoints or running in restricted networks (e.g. a network configured
8247// with [Private Google Access with VPC Service Controls]) may want to
8248/// override this default.
8249/// * [with_credentials()]: by default this client uses
8250/// [Application Default Credentials]. Applications using custom
8251/// authentication may need to override this default.
8252///
8253/// [with_endpoint()]: super::builder::node_groups::ClientBuilder::with_endpoint
8254/// [with_credentials()]: super::builder::node_groups::ClientBuilder::credentials
8255/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8256/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8257///
8258/// # Pooling and Cloning
8259///
8260/// `NodeGroups` holds a connection pool internally, it is advised to
8261/// create one and the reuse it. You do not need to wrap `NodeGroups` in
8262/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8263/// already uses an `Arc` internally.
8264#[cfg(feature = "node-groups")]
8265#[cfg_attr(docsrs, doc(cfg(feature = "node-groups")))]
8266#[derive(Clone, Debug)]
8267pub struct NodeGroups {
8268 inner: std::sync::Arc<dyn super::stub::dynamic::NodeGroups>,
8269}
8270
8271#[cfg(feature = "node-groups")]
8272impl NodeGroups {
8273 /// Returns a builder for [NodeGroups].
8274 ///
8275 /// ```
8276 /// # tokio_test::block_on(async {
8277 /// # use google_cloud_compute_v1::client::NodeGroups;
8278 /// let client = NodeGroups::builder().build().await?;
8279 /// # gax::client_builder::Result::<()>::Ok(()) });
8280 /// ```
8281 pub fn builder() -> super::builder::node_groups::ClientBuilder {
8282 gax::client_builder::internal::new_builder(super::builder::node_groups::client::Factory)
8283 }
8284
8285 /// Creates a new client from the provided stub.
8286 ///
8287 /// The most common case for calling this function is in tests mocking the
8288 /// client's behavior.
8289 pub fn from_stub<T>(stub: T) -> Self
8290 where
8291 T: super::stub::NodeGroups + 'static,
8292 {
8293 Self {
8294 inner: std::sync::Arc::new(stub),
8295 }
8296 }
8297
8298 pub(crate) async fn new(
8299 config: gaxi::options::ClientConfig,
8300 ) -> gax::client_builder::Result<Self> {
8301 let inner = Self::build_inner(config).await?;
8302 Ok(Self { inner })
8303 }
8304
8305 async fn build_inner(
8306 conf: gaxi::options::ClientConfig,
8307 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::NodeGroups>> {
8308 if gaxi::options::tracing_enabled(&conf) {
8309 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8310 }
8311 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8312 }
8313
8314 async fn build_transport(
8315 conf: gaxi::options::ClientConfig,
8316 ) -> gax::client_builder::Result<impl super::stub::NodeGroups> {
8317 super::transport::NodeGroups::new(conf).await
8318 }
8319
8320 async fn build_with_tracing(
8321 conf: gaxi::options::ClientConfig,
8322 ) -> gax::client_builder::Result<impl super::stub::NodeGroups> {
8323 Self::build_transport(conf)
8324 .await
8325 .map(super::tracing::NodeGroups::new)
8326 }
8327
8328 /// Adds specified number of nodes to the node group.
8329 pub fn add_nodes(&self) -> super::builder::node_groups::AddNodes {
8330 super::builder::node_groups::AddNodes::new(self.inner.clone())
8331 }
8332
8333 /// Retrieves an aggregated list of node groups.
8334 /// Note: use nodeGroups.listNodes for more details about each group.
8335 ///
8336 /// To prevent failure, Google recommends that you set the
8337 /// `returnPartialSuccess` parameter to `true`.
8338 pub fn aggregated_list(&self) -> super::builder::node_groups::AggregatedList {
8339 super::builder::node_groups::AggregatedList::new(self.inner.clone())
8340 }
8341
8342 /// Deletes the specified NodeGroup resource.
8343 pub fn delete(&self) -> super::builder::node_groups::Delete {
8344 super::builder::node_groups::Delete::new(self.inner.clone())
8345 }
8346
8347 /// Deletes specified nodes from the node group.
8348 pub fn delete_nodes(&self) -> super::builder::node_groups::DeleteNodes {
8349 super::builder::node_groups::DeleteNodes::new(self.inner.clone())
8350 }
8351
8352 /// Returns the specified NodeGroup. Get a list of available NodeGroups
8353 /// by making a list() request.
8354 /// Note: the "nodes" field should not be used. Use nodeGroups.listNodes
8355 /// instead.
8356 pub fn get(&self) -> super::builder::node_groups::Get {
8357 super::builder::node_groups::Get::new(self.inner.clone())
8358 }
8359
8360 /// Gets the access control policy for a resource. May be empty if no such
8361 /// policy or resource exists.
8362 pub fn get_iam_policy(&self) -> super::builder::node_groups::GetIamPolicy {
8363 super::builder::node_groups::GetIamPolicy::new(self.inner.clone())
8364 }
8365
8366 /// Creates a NodeGroup resource in the specified project using the data
8367 /// included in the request.
8368 pub fn insert(&self) -> super::builder::node_groups::Insert {
8369 super::builder::node_groups::Insert::new(self.inner.clone())
8370 }
8371
8372 /// Retrieves a list of node groups available to the specified project.
8373 /// Note: use nodeGroups.listNodes for more details about each group.
8374 pub fn list(&self) -> super::builder::node_groups::List {
8375 super::builder::node_groups::List::new(self.inner.clone())
8376 }
8377
8378 /// Lists nodes in the node group.
8379 pub fn list_nodes(&self) -> super::builder::node_groups::ListNodes {
8380 super::builder::node_groups::ListNodes::new(self.inner.clone())
8381 }
8382
8383 /// Updates the specified node group.
8384 pub fn patch(&self) -> super::builder::node_groups::Patch {
8385 super::builder::node_groups::Patch::new(self.inner.clone())
8386 }
8387
8388 /// Perform maintenance on a subset of nodes in the node group.
8389 pub fn perform_maintenance(&self) -> super::builder::node_groups::PerformMaintenance {
8390 super::builder::node_groups::PerformMaintenance::new(self.inner.clone())
8391 }
8392
8393 /// Sets the access control policy on the specified resource.
8394 /// Replaces any existing policy.
8395 pub fn set_iam_policy(&self) -> super::builder::node_groups::SetIamPolicy {
8396 super::builder::node_groups::SetIamPolicy::new(self.inner.clone())
8397 }
8398
8399 /// Updates the node template of the node group.
8400 pub fn set_node_template(&self) -> super::builder::node_groups::SetNodeTemplate {
8401 super::builder::node_groups::SetNodeTemplate::new(self.inner.clone())
8402 }
8403
8404 /// Simulates maintenance event on specified nodes from the node group.
8405 pub fn simulate_maintenance_event(
8406 &self,
8407 ) -> super::builder::node_groups::SimulateMaintenanceEvent {
8408 super::builder::node_groups::SimulateMaintenanceEvent::new(self.inner.clone())
8409 }
8410
8411 /// Returns permissions that a caller has on the specified resource.
8412 pub fn test_iam_permissions(&self) -> super::builder::node_groups::TestIamPermissions {
8413 super::builder::node_groups::TestIamPermissions::new(self.inner.clone())
8414 }
8415
8416 /// Retrieves the specified zone-specific Operations resource.
8417 pub fn get_operation(&self) -> super::builder::node_groups::GetOperation {
8418 super::builder::node_groups::GetOperation::new(self.inner.clone())
8419 }
8420}
8421
8422/// Implements a client for the Google Compute Engine API.
8423///
8424/// # Example
8425/// ```
8426/// # tokio_test::block_on(async {
8427/// # use google_cloud_compute_v1::client::NodeTemplates;
8428/// let client = NodeTemplates::builder().build().await?;
8429/// // use `client` to make requests to the Google Compute Engine API.
8430/// # gax::client_builder::Result::<()>::Ok(()) });
8431/// ```
8432///
8433/// # Service Description
8434///
8435/// Service for the `nodeTemplates` resource.
8436///
8437/// # Configuration
8438///
8439/// To configure `NodeTemplates` use the `with_*` methods in the type returned
8440/// by [builder()][NodeTemplates::builder]. The default configuration should
8441/// work for most applications. Common configuration changes include
8442///
8443/// * [with_endpoint()]: by default this client uses the global default endpoint
8444/// (`https://compute.googleapis.com`). Applications using regional
8445/// endpoints or running in restricted networks (e.g. a network configured
8446// with [Private Google Access with VPC Service Controls]) may want to
8447/// override this default.
8448/// * [with_credentials()]: by default this client uses
8449/// [Application Default Credentials]. Applications using custom
8450/// authentication may need to override this default.
8451///
8452/// [with_endpoint()]: super::builder::node_templates::ClientBuilder::with_endpoint
8453/// [with_credentials()]: super::builder::node_templates::ClientBuilder::credentials
8454/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8455/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8456///
8457/// # Pooling and Cloning
8458///
8459/// `NodeTemplates` holds a connection pool internally, it is advised to
8460/// create one and the reuse it. You do not need to wrap `NodeTemplates` in
8461/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8462/// already uses an `Arc` internally.
8463#[cfg(feature = "node-templates")]
8464#[cfg_attr(docsrs, doc(cfg(feature = "node-templates")))]
8465#[derive(Clone, Debug)]
8466pub struct NodeTemplates {
8467 inner: std::sync::Arc<dyn super::stub::dynamic::NodeTemplates>,
8468}
8469
8470#[cfg(feature = "node-templates")]
8471impl NodeTemplates {
8472 /// Returns a builder for [NodeTemplates].
8473 ///
8474 /// ```
8475 /// # tokio_test::block_on(async {
8476 /// # use google_cloud_compute_v1::client::NodeTemplates;
8477 /// let client = NodeTemplates::builder().build().await?;
8478 /// # gax::client_builder::Result::<()>::Ok(()) });
8479 /// ```
8480 pub fn builder() -> super::builder::node_templates::ClientBuilder {
8481 gax::client_builder::internal::new_builder(super::builder::node_templates::client::Factory)
8482 }
8483
8484 /// Creates a new client from the provided stub.
8485 ///
8486 /// The most common case for calling this function is in tests mocking the
8487 /// client's behavior.
8488 pub fn from_stub<T>(stub: T) -> Self
8489 where
8490 T: super::stub::NodeTemplates + 'static,
8491 {
8492 Self {
8493 inner: std::sync::Arc::new(stub),
8494 }
8495 }
8496
8497 pub(crate) async fn new(
8498 config: gaxi::options::ClientConfig,
8499 ) -> gax::client_builder::Result<Self> {
8500 let inner = Self::build_inner(config).await?;
8501 Ok(Self { inner })
8502 }
8503
8504 async fn build_inner(
8505 conf: gaxi::options::ClientConfig,
8506 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::NodeTemplates>> {
8507 if gaxi::options::tracing_enabled(&conf) {
8508 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8509 }
8510 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8511 }
8512
8513 async fn build_transport(
8514 conf: gaxi::options::ClientConfig,
8515 ) -> gax::client_builder::Result<impl super::stub::NodeTemplates> {
8516 super::transport::NodeTemplates::new(conf).await
8517 }
8518
8519 async fn build_with_tracing(
8520 conf: gaxi::options::ClientConfig,
8521 ) -> gax::client_builder::Result<impl super::stub::NodeTemplates> {
8522 Self::build_transport(conf)
8523 .await
8524 .map(super::tracing::NodeTemplates::new)
8525 }
8526
8527 /// Retrieves an aggregated list of node templates.
8528 ///
8529 /// To prevent failure, Google recommends that you set the
8530 /// `returnPartialSuccess` parameter to `true`.
8531 pub fn aggregated_list(&self) -> super::builder::node_templates::AggregatedList {
8532 super::builder::node_templates::AggregatedList::new(self.inner.clone())
8533 }
8534
8535 /// Deletes the specified NodeTemplate resource.
8536 pub fn delete(&self) -> super::builder::node_templates::Delete {
8537 super::builder::node_templates::Delete::new(self.inner.clone())
8538 }
8539
8540 /// Returns the specified node template.
8541 pub fn get(&self) -> super::builder::node_templates::Get {
8542 super::builder::node_templates::Get::new(self.inner.clone())
8543 }
8544
8545 /// Gets the access control policy for a resource. May be empty if no such
8546 /// policy or resource exists.
8547 pub fn get_iam_policy(&self) -> super::builder::node_templates::GetIamPolicy {
8548 super::builder::node_templates::GetIamPolicy::new(self.inner.clone())
8549 }
8550
8551 /// Creates a NodeTemplate resource in the specified project using the data
8552 /// included in the request.
8553 pub fn insert(&self) -> super::builder::node_templates::Insert {
8554 super::builder::node_templates::Insert::new(self.inner.clone())
8555 }
8556
8557 /// Retrieves a list of node templates available to the specified
8558 /// project.
8559 pub fn list(&self) -> super::builder::node_templates::List {
8560 super::builder::node_templates::List::new(self.inner.clone())
8561 }
8562
8563 /// Sets the access control policy on the specified resource.
8564 /// Replaces any existing policy.
8565 pub fn set_iam_policy(&self) -> super::builder::node_templates::SetIamPolicy {
8566 super::builder::node_templates::SetIamPolicy::new(self.inner.clone())
8567 }
8568
8569 /// Returns permissions that a caller has on the specified resource.
8570 pub fn test_iam_permissions(&self) -> super::builder::node_templates::TestIamPermissions {
8571 super::builder::node_templates::TestIamPermissions::new(self.inner.clone())
8572 }
8573
8574 /// Retrieves the specified region-specific Operations resource.
8575 pub fn get_operation(&self) -> super::builder::node_templates::GetOperation {
8576 super::builder::node_templates::GetOperation::new(self.inner.clone())
8577 }
8578}
8579
8580/// Implements a client for the Google Compute Engine API.
8581///
8582/// # Example
8583/// ```
8584/// # tokio_test::block_on(async {
8585/// # use google_cloud_compute_v1::client::NodeTypes;
8586/// let client = NodeTypes::builder().build().await?;
8587/// // use `client` to make requests to the Google Compute Engine API.
8588/// # gax::client_builder::Result::<()>::Ok(()) });
8589/// ```
8590///
8591/// # Service Description
8592///
8593/// Service for the `nodeTypes` resource.
8594///
8595/// # Configuration
8596///
8597/// To configure `NodeTypes` use the `with_*` methods in the type returned
8598/// by [builder()][NodeTypes::builder]. The default configuration should
8599/// work for most applications. Common configuration changes include
8600///
8601/// * [with_endpoint()]: by default this client uses the global default endpoint
8602/// (`https://compute.googleapis.com`). Applications using regional
8603/// endpoints or running in restricted networks (e.g. a network configured
8604// with [Private Google Access with VPC Service Controls]) may want to
8605/// override this default.
8606/// * [with_credentials()]: by default this client uses
8607/// [Application Default Credentials]. Applications using custom
8608/// authentication may need to override this default.
8609///
8610/// [with_endpoint()]: super::builder::node_types::ClientBuilder::with_endpoint
8611/// [with_credentials()]: super::builder::node_types::ClientBuilder::credentials
8612/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8613/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8614///
8615/// # Pooling and Cloning
8616///
8617/// `NodeTypes` holds a connection pool internally, it is advised to
8618/// create one and the reuse it. You do not need to wrap `NodeTypes` in
8619/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8620/// already uses an `Arc` internally.
8621#[cfg(feature = "node-types")]
8622#[cfg_attr(docsrs, doc(cfg(feature = "node-types")))]
8623#[derive(Clone, Debug)]
8624pub struct NodeTypes {
8625 inner: std::sync::Arc<dyn super::stub::dynamic::NodeTypes>,
8626}
8627
8628#[cfg(feature = "node-types")]
8629impl NodeTypes {
8630 /// Returns a builder for [NodeTypes].
8631 ///
8632 /// ```
8633 /// # tokio_test::block_on(async {
8634 /// # use google_cloud_compute_v1::client::NodeTypes;
8635 /// let client = NodeTypes::builder().build().await?;
8636 /// # gax::client_builder::Result::<()>::Ok(()) });
8637 /// ```
8638 pub fn builder() -> super::builder::node_types::ClientBuilder {
8639 gax::client_builder::internal::new_builder(super::builder::node_types::client::Factory)
8640 }
8641
8642 /// Creates a new client from the provided stub.
8643 ///
8644 /// The most common case for calling this function is in tests mocking the
8645 /// client's behavior.
8646 pub fn from_stub<T>(stub: T) -> Self
8647 where
8648 T: super::stub::NodeTypes + 'static,
8649 {
8650 Self {
8651 inner: std::sync::Arc::new(stub),
8652 }
8653 }
8654
8655 pub(crate) async fn new(
8656 config: gaxi::options::ClientConfig,
8657 ) -> gax::client_builder::Result<Self> {
8658 let inner = Self::build_inner(config).await?;
8659 Ok(Self { inner })
8660 }
8661
8662 async fn build_inner(
8663 conf: gaxi::options::ClientConfig,
8664 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::NodeTypes>> {
8665 if gaxi::options::tracing_enabled(&conf) {
8666 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8667 }
8668 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8669 }
8670
8671 async fn build_transport(
8672 conf: gaxi::options::ClientConfig,
8673 ) -> gax::client_builder::Result<impl super::stub::NodeTypes> {
8674 super::transport::NodeTypes::new(conf).await
8675 }
8676
8677 async fn build_with_tracing(
8678 conf: gaxi::options::ClientConfig,
8679 ) -> gax::client_builder::Result<impl super::stub::NodeTypes> {
8680 Self::build_transport(conf)
8681 .await
8682 .map(super::tracing::NodeTypes::new)
8683 }
8684
8685 /// Retrieves an aggregated list of node types.
8686 ///
8687 /// To prevent failure, Google recommends that you set the
8688 /// `returnPartialSuccess` parameter to `true`.
8689 pub fn aggregated_list(&self) -> super::builder::node_types::AggregatedList {
8690 super::builder::node_types::AggregatedList::new(self.inner.clone())
8691 }
8692
8693 /// Returns the specified node type.
8694 pub fn get(&self) -> super::builder::node_types::Get {
8695 super::builder::node_types::Get::new(self.inner.clone())
8696 }
8697
8698 /// Retrieves a list of node types available to the specified
8699 /// project.
8700 pub fn list(&self) -> super::builder::node_types::List {
8701 super::builder::node_types::List::new(self.inner.clone())
8702 }
8703}
8704
8705/// Implements a client for the Google Compute Engine API.
8706///
8707/// # Example
8708/// ```
8709/// # tokio_test::block_on(async {
8710/// # use google_cloud_compute_v1::client::OrganizationSecurityPolicies;
8711/// let client = OrganizationSecurityPolicies::builder().build().await?;
8712/// // use `client` to make requests to the Google Compute Engine API.
8713/// # gax::client_builder::Result::<()>::Ok(()) });
8714/// ```
8715///
8716/// # Service Description
8717///
8718/// Service for the `organizationSecurityPolicies` resource.
8719///
8720/// # Configuration
8721///
8722/// To configure `OrganizationSecurityPolicies` use the `with_*` methods in the type returned
8723/// by [builder()][OrganizationSecurityPolicies::builder]. The default configuration should
8724/// work for most applications. Common configuration changes include
8725///
8726/// * [with_endpoint()]: by default this client uses the global default endpoint
8727/// (`https://compute.googleapis.com`). Applications using regional
8728/// endpoints or running in restricted networks (e.g. a network configured
8729// with [Private Google Access with VPC Service Controls]) may want to
8730/// override this default.
8731/// * [with_credentials()]: by default this client uses
8732/// [Application Default Credentials]. Applications using custom
8733/// authentication may need to override this default.
8734///
8735/// [with_endpoint()]: super::builder::organization_security_policies::ClientBuilder::with_endpoint
8736/// [with_credentials()]: super::builder::organization_security_policies::ClientBuilder::credentials
8737/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8738/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8739///
8740/// # Pooling and Cloning
8741///
8742/// `OrganizationSecurityPolicies` holds a connection pool internally, it is advised to
8743/// create one and the reuse it. You do not need to wrap `OrganizationSecurityPolicies` in
8744/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8745/// already uses an `Arc` internally.
8746#[cfg(feature = "organization-security-policies")]
8747#[cfg_attr(docsrs, doc(cfg(feature = "organization-security-policies")))]
8748#[derive(Clone, Debug)]
8749pub struct OrganizationSecurityPolicies {
8750 inner: std::sync::Arc<dyn super::stub::dynamic::OrganizationSecurityPolicies>,
8751}
8752
8753#[cfg(feature = "organization-security-policies")]
8754impl OrganizationSecurityPolicies {
8755 /// Returns a builder for [OrganizationSecurityPolicies].
8756 ///
8757 /// ```
8758 /// # tokio_test::block_on(async {
8759 /// # use google_cloud_compute_v1::client::OrganizationSecurityPolicies;
8760 /// let client = OrganizationSecurityPolicies::builder().build().await?;
8761 /// # gax::client_builder::Result::<()>::Ok(()) });
8762 /// ```
8763 pub fn builder() -> super::builder::organization_security_policies::ClientBuilder {
8764 gax::client_builder::internal::new_builder(
8765 super::builder::organization_security_policies::client::Factory,
8766 )
8767 }
8768
8769 /// Creates a new client from the provided stub.
8770 ///
8771 /// The most common case for calling this function is in tests mocking the
8772 /// client's behavior.
8773 pub fn from_stub<T>(stub: T) -> Self
8774 where
8775 T: super::stub::OrganizationSecurityPolicies + 'static,
8776 {
8777 Self {
8778 inner: std::sync::Arc::new(stub),
8779 }
8780 }
8781
8782 pub(crate) async fn new(
8783 config: gaxi::options::ClientConfig,
8784 ) -> gax::client_builder::Result<Self> {
8785 let inner = Self::build_inner(config).await?;
8786 Ok(Self { inner })
8787 }
8788
8789 async fn build_inner(
8790 conf: gaxi::options::ClientConfig,
8791 ) -> gax::client_builder::Result<
8792 std::sync::Arc<dyn super::stub::dynamic::OrganizationSecurityPolicies>,
8793 > {
8794 if gaxi::options::tracing_enabled(&conf) {
8795 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8796 }
8797 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8798 }
8799
8800 async fn build_transport(
8801 conf: gaxi::options::ClientConfig,
8802 ) -> gax::client_builder::Result<impl super::stub::OrganizationSecurityPolicies> {
8803 super::transport::OrganizationSecurityPolicies::new(conf).await
8804 }
8805
8806 async fn build_with_tracing(
8807 conf: gaxi::options::ClientConfig,
8808 ) -> gax::client_builder::Result<impl super::stub::OrganizationSecurityPolicies> {
8809 Self::build_transport(conf)
8810 .await
8811 .map(super::tracing::OrganizationSecurityPolicies::new)
8812 }
8813
8814 /// Inserts an association for the specified security policy.
8815 ///
8816 /// This has billing implications. Projects in the hierarchy with effective
8817 /// hierarchical security policies will be automatically enrolled into Cloud
8818 /// Armor Enterprise if not already enrolled.
8819 ///
8820 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8821 /// versions of this API were used to modify firewall policies. This usage is
8822 /// now disabled for most organizations. Use firewallPolicies.addAssociation
8823 /// instead.
8824 pub fn add_association(
8825 &self,
8826 ) -> super::builder::organization_security_policies::AddAssociation {
8827 super::builder::organization_security_policies::AddAssociation::new(self.inner.clone())
8828 }
8829
8830 /// Inserts a rule into a security policy.
8831 ///
8832 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8833 /// versions of this API were used to modify firewall policies. This usage is
8834 /// now disabled for most organizations. Use firewallPolicies.addRule instead.
8835 pub fn add_rule(&self) -> super::builder::organization_security_policies::AddRule {
8836 super::builder::organization_security_policies::AddRule::new(self.inner.clone())
8837 }
8838
8839 /// Copies rules to the specified security policy.
8840 ///
8841 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8842 /// versions of this API were used to modify firewall policies. This usage is
8843 /// now disabled for most organizations. Use firewallPolicies.cloneRules
8844 /// instead.
8845 pub fn copy_rules(&self) -> super::builder::organization_security_policies::CopyRules {
8846 super::builder::organization_security_policies::CopyRules::new(self.inner.clone())
8847 }
8848
8849 /// Deletes the specified policy.
8850 ///
8851 /// Use this API to remove Cloud Armor policies. Previously, alpha and beta
8852 /// versions of this API were used to remove firewall policies. This usage is
8853 /// now disabled for most organizations. Use firewallPolicies.delete instead.
8854 pub fn delete(&self) -> super::builder::organization_security_policies::Delete {
8855 super::builder::organization_security_policies::Delete::new(self.inner.clone())
8856 }
8857
8858 /// List all of the ordered rules present in a single specified policy.
8859 ///
8860 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
8861 /// versions of this API were used to read firewall policies. This usage is now
8862 /// disabled for most organizations. Use firewallPolicies.get instead.
8863 pub fn get(&self) -> super::builder::organization_security_policies::Get {
8864 super::builder::organization_security_policies::Get::new(self.inner.clone())
8865 }
8866
8867 /// Gets an association with the specified name.
8868 ///
8869 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
8870 /// versions of this API were used to read firewall policies. This usage is
8871 /// now disabled for most organizations. Use firewallPolicies.getAssociation
8872 /// instead.
8873 pub fn get_association(
8874 &self,
8875 ) -> super::builder::organization_security_policies::GetAssociation {
8876 super::builder::organization_security_policies::GetAssociation::new(self.inner.clone())
8877 }
8878
8879 /// Gets a rule at the specified priority.
8880 ///
8881 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
8882 /// versions of this API were used to read firewall policies. This usage is now
8883 /// disabled for most organizations. Use firewallPolicies.getRule instead.
8884 pub fn get_rule(&self) -> super::builder::organization_security_policies::GetRule {
8885 super::builder::organization_security_policies::GetRule::new(self.inner.clone())
8886 }
8887
8888 /// Creates a new policy in the specified organization using the data included
8889 /// in the request.
8890 ///
8891 /// Use this API to add Cloud Armor policies. Previously, alpha and beta
8892 /// versions of this API were used to add firewall policies. This usage is now
8893 /// disabled for most organizations. Use firewallPolicies.insert instead.
8894 pub fn insert(&self) -> super::builder::organization_security_policies::Insert {
8895 super::builder::organization_security_policies::Insert::new(self.inner.clone())
8896 }
8897
8898 /// List all the policies that have been configured for the specified
8899 /// organization.
8900 ///
8901 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
8902 /// versions of this API were used to read firewall policies. This usage is now
8903 /// disabled for most organizations. Use firewallPolicies.list instead.
8904 pub fn list(&self) -> super::builder::organization_security_policies::List {
8905 super::builder::organization_security_policies::List::new(self.inner.clone())
8906 }
8907
8908 /// Lists associations of a specified target, i.e., organization or folder.
8909 ///
8910 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
8911 /// versions of this API were used to read firewall policies. This usage is
8912 /// now disabled for most organizations. Use firewallPolicies.listAssociations
8913 /// instead.
8914 pub fn list_associations(
8915 &self,
8916 ) -> super::builder::organization_security_policies::ListAssociations {
8917 super::builder::organization_security_policies::ListAssociations::new(self.inner.clone())
8918 }
8919
8920 /// Gets the current list of preconfigured Web Application Firewall (WAF)
8921 /// expressions.
8922 pub fn list_preconfigured_expression_sets(
8923 &self,
8924 ) -> super::builder::organization_security_policies::ListPreconfiguredExpressionSets {
8925 super::builder::organization_security_policies::ListPreconfiguredExpressionSets::new(
8926 self.inner.clone(),
8927 )
8928 }
8929
8930 /// Moves the specified security policy.
8931 ///
8932 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8933 /// versions of this API were used to modify firewall policies. This usage is
8934 /// now disabled for most organizations. Use firewallPolicies.move instead.
8935 pub fn r#move(&self) -> super::builder::organization_security_policies::Move {
8936 super::builder::organization_security_policies::Move::new(self.inner.clone())
8937 }
8938
8939 /// Patches the specified policy with the data included in the request.
8940 ///
8941 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8942 /// versions of this API were used to modify firewall policies. This usage is
8943 /// now disabled for most organizations. Use firewallPolicies.patch instead.
8944 pub fn patch(&self) -> super::builder::organization_security_policies::Patch {
8945 super::builder::organization_security_policies::Patch::new(self.inner.clone())
8946 }
8947
8948 /// Patches a rule at the specified priority.
8949 ///
8950 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8951 /// versions of this API were used to modify firewall policies. This usage is
8952 /// now disabled for most organizations. Use firewallPolicies.patchRule
8953 /// instead.
8954 pub fn patch_rule(&self) -> super::builder::organization_security_policies::PatchRule {
8955 super::builder::organization_security_policies::PatchRule::new(self.inner.clone())
8956 }
8957
8958 /// Removes an association for the specified security policy.
8959 ///
8960 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8961 /// versions of this API were used to modify firewall policies. This usage is
8962 /// now disabled for most organizations. Use firewallPolicies.removeAssociation
8963 /// instead.
8964 pub fn remove_association(
8965 &self,
8966 ) -> super::builder::organization_security_policies::RemoveAssociation {
8967 super::builder::organization_security_policies::RemoveAssociation::new(self.inner.clone())
8968 }
8969
8970 /// Deletes a rule at the specified priority.
8971 ///
8972 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8973 /// versions of this API were used to modify firewall policies. This usage is
8974 /// now disabled for most organizations. Use firewallPolicies.removeRule
8975 /// instead.
8976 pub fn remove_rule(&self) -> super::builder::organization_security_policies::RemoveRule {
8977 super::builder::organization_security_policies::RemoveRule::new(self.inner.clone())
8978 }
8979
8980 /// Retrieves the specified Operations resource. Gets a list of operations
8981 /// by making a `list()` request.
8982 pub fn get_operation(&self) -> super::builder::organization_security_policies::GetOperation {
8983 super::builder::organization_security_policies::GetOperation::new(self.inner.clone())
8984 }
8985}
8986
8987/// Implements a client for the Google Compute Engine API.
8988///
8989/// # Example
8990/// ```
8991/// # tokio_test::block_on(async {
8992/// # use google_cloud_compute_v1::client::PacketMirrorings;
8993/// let client = PacketMirrorings::builder().build().await?;
8994/// // use `client` to make requests to the Google Compute Engine API.
8995/// # gax::client_builder::Result::<()>::Ok(()) });
8996/// ```
8997///
8998/// # Service Description
8999///
9000/// Service for the `packetMirrorings` resource.
9001///
9002/// # Configuration
9003///
9004/// To configure `PacketMirrorings` use the `with_*` methods in the type returned
9005/// by [builder()][PacketMirrorings::builder]. The default configuration should
9006/// work for most applications. Common configuration changes include
9007///
9008/// * [with_endpoint()]: by default this client uses the global default endpoint
9009/// (`https://compute.googleapis.com`). Applications using regional
9010/// endpoints or running in restricted networks (e.g. a network configured
9011// with [Private Google Access with VPC Service Controls]) may want to
9012/// override this default.
9013/// * [with_credentials()]: by default this client uses
9014/// [Application Default Credentials]. Applications using custom
9015/// authentication may need to override this default.
9016///
9017/// [with_endpoint()]: super::builder::packet_mirrorings::ClientBuilder::with_endpoint
9018/// [with_credentials()]: super::builder::packet_mirrorings::ClientBuilder::credentials
9019/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9020/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9021///
9022/// # Pooling and Cloning
9023///
9024/// `PacketMirrorings` holds a connection pool internally, it is advised to
9025/// create one and the reuse it. You do not need to wrap `PacketMirrorings` in
9026/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9027/// already uses an `Arc` internally.
9028#[cfg(feature = "packet-mirrorings")]
9029#[cfg_attr(docsrs, doc(cfg(feature = "packet-mirrorings")))]
9030#[derive(Clone, Debug)]
9031pub struct PacketMirrorings {
9032 inner: std::sync::Arc<dyn super::stub::dynamic::PacketMirrorings>,
9033}
9034
9035#[cfg(feature = "packet-mirrorings")]
9036impl PacketMirrorings {
9037 /// Returns a builder for [PacketMirrorings].
9038 ///
9039 /// ```
9040 /// # tokio_test::block_on(async {
9041 /// # use google_cloud_compute_v1::client::PacketMirrorings;
9042 /// let client = PacketMirrorings::builder().build().await?;
9043 /// # gax::client_builder::Result::<()>::Ok(()) });
9044 /// ```
9045 pub fn builder() -> super::builder::packet_mirrorings::ClientBuilder {
9046 gax::client_builder::internal::new_builder(
9047 super::builder::packet_mirrorings::client::Factory,
9048 )
9049 }
9050
9051 /// Creates a new client from the provided stub.
9052 ///
9053 /// The most common case for calling this function is in tests mocking the
9054 /// client's behavior.
9055 pub fn from_stub<T>(stub: T) -> Self
9056 where
9057 T: super::stub::PacketMirrorings + 'static,
9058 {
9059 Self {
9060 inner: std::sync::Arc::new(stub),
9061 }
9062 }
9063
9064 pub(crate) async fn new(
9065 config: gaxi::options::ClientConfig,
9066 ) -> gax::client_builder::Result<Self> {
9067 let inner = Self::build_inner(config).await?;
9068 Ok(Self { inner })
9069 }
9070
9071 async fn build_inner(
9072 conf: gaxi::options::ClientConfig,
9073 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::PacketMirrorings>>
9074 {
9075 if gaxi::options::tracing_enabled(&conf) {
9076 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9077 }
9078 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9079 }
9080
9081 async fn build_transport(
9082 conf: gaxi::options::ClientConfig,
9083 ) -> gax::client_builder::Result<impl super::stub::PacketMirrorings> {
9084 super::transport::PacketMirrorings::new(conf).await
9085 }
9086
9087 async fn build_with_tracing(
9088 conf: gaxi::options::ClientConfig,
9089 ) -> gax::client_builder::Result<impl super::stub::PacketMirrorings> {
9090 Self::build_transport(conf)
9091 .await
9092 .map(super::tracing::PacketMirrorings::new)
9093 }
9094
9095 /// Retrieves an aggregated list of packetMirrorings.
9096 ///
9097 /// To prevent failure, Google recommends that you set the
9098 /// `returnPartialSuccess` parameter to `true`.
9099 pub fn aggregated_list(&self) -> super::builder::packet_mirrorings::AggregatedList {
9100 super::builder::packet_mirrorings::AggregatedList::new(self.inner.clone())
9101 }
9102
9103 /// Deletes the specified PacketMirroring resource.
9104 pub fn delete(&self) -> super::builder::packet_mirrorings::Delete {
9105 super::builder::packet_mirrorings::Delete::new(self.inner.clone())
9106 }
9107
9108 /// Returns the specified PacketMirroring resource.
9109 pub fn get(&self) -> super::builder::packet_mirrorings::Get {
9110 super::builder::packet_mirrorings::Get::new(self.inner.clone())
9111 }
9112
9113 /// Creates a PacketMirroring resource in the specified project and region
9114 /// using the data included in the request.
9115 pub fn insert(&self) -> super::builder::packet_mirrorings::Insert {
9116 super::builder::packet_mirrorings::Insert::new(self.inner.clone())
9117 }
9118
9119 /// Retrieves a list of PacketMirroring resources available to the specified
9120 /// project and region.
9121 pub fn list(&self) -> super::builder::packet_mirrorings::List {
9122 super::builder::packet_mirrorings::List::new(self.inner.clone())
9123 }
9124
9125 /// Patches the specified PacketMirroring resource with the data included in
9126 /// the request. This method supportsPATCH
9127 /// semantics and usesJSON merge
9128 /// patch format and processing rules.
9129 pub fn patch(&self) -> super::builder::packet_mirrorings::Patch {
9130 super::builder::packet_mirrorings::Patch::new(self.inner.clone())
9131 }
9132
9133 /// Returns permissions that a caller has on the specified resource.
9134 pub fn test_iam_permissions(&self) -> super::builder::packet_mirrorings::TestIamPermissions {
9135 super::builder::packet_mirrorings::TestIamPermissions::new(self.inner.clone())
9136 }
9137
9138 /// Retrieves the specified region-specific Operations resource.
9139 pub fn get_operation(&self) -> super::builder::packet_mirrorings::GetOperation {
9140 super::builder::packet_mirrorings::GetOperation::new(self.inner.clone())
9141 }
9142}
9143
9144/// Implements a client for the Google Compute Engine API.
9145///
9146/// # Example
9147/// ```
9148/// # tokio_test::block_on(async {
9149/// # use google_cloud_compute_v1::client::PreviewFeatures;
9150/// let client = PreviewFeatures::builder().build().await?;
9151/// // use `client` to make requests to the Google Compute Engine API.
9152/// # gax::client_builder::Result::<()>::Ok(()) });
9153/// ```
9154///
9155/// # Service Description
9156///
9157/// Service for the `previewFeatures` resource.
9158///
9159/// # Configuration
9160///
9161/// To configure `PreviewFeatures` use the `with_*` methods in the type returned
9162/// by [builder()][PreviewFeatures::builder]. The default configuration should
9163/// work for most applications. Common configuration changes include
9164///
9165/// * [with_endpoint()]: by default this client uses the global default endpoint
9166/// (`https://compute.googleapis.com`). Applications using regional
9167/// endpoints or running in restricted networks (e.g. a network configured
9168// with [Private Google Access with VPC Service Controls]) may want to
9169/// override this default.
9170/// * [with_credentials()]: by default this client uses
9171/// [Application Default Credentials]. Applications using custom
9172/// authentication may need to override this default.
9173///
9174/// [with_endpoint()]: super::builder::preview_features::ClientBuilder::with_endpoint
9175/// [with_credentials()]: super::builder::preview_features::ClientBuilder::credentials
9176/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9177/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9178///
9179/// # Pooling and Cloning
9180///
9181/// `PreviewFeatures` holds a connection pool internally, it is advised to
9182/// create one and the reuse it. You do not need to wrap `PreviewFeatures` in
9183/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9184/// already uses an `Arc` internally.
9185#[cfg(feature = "preview-features")]
9186#[cfg_attr(docsrs, doc(cfg(feature = "preview-features")))]
9187#[derive(Clone, Debug)]
9188pub struct PreviewFeatures {
9189 inner: std::sync::Arc<dyn super::stub::dynamic::PreviewFeatures>,
9190}
9191
9192#[cfg(feature = "preview-features")]
9193impl PreviewFeatures {
9194 /// Returns a builder for [PreviewFeatures].
9195 ///
9196 /// ```
9197 /// # tokio_test::block_on(async {
9198 /// # use google_cloud_compute_v1::client::PreviewFeatures;
9199 /// let client = PreviewFeatures::builder().build().await?;
9200 /// # gax::client_builder::Result::<()>::Ok(()) });
9201 /// ```
9202 pub fn builder() -> super::builder::preview_features::ClientBuilder {
9203 gax::client_builder::internal::new_builder(
9204 super::builder::preview_features::client::Factory,
9205 )
9206 }
9207
9208 /// Creates a new client from the provided stub.
9209 ///
9210 /// The most common case for calling this function is in tests mocking the
9211 /// client's behavior.
9212 pub fn from_stub<T>(stub: T) -> Self
9213 where
9214 T: super::stub::PreviewFeatures + 'static,
9215 {
9216 Self {
9217 inner: std::sync::Arc::new(stub),
9218 }
9219 }
9220
9221 pub(crate) async fn new(
9222 config: gaxi::options::ClientConfig,
9223 ) -> gax::client_builder::Result<Self> {
9224 let inner = Self::build_inner(config).await?;
9225 Ok(Self { inner })
9226 }
9227
9228 async fn build_inner(
9229 conf: gaxi::options::ClientConfig,
9230 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::PreviewFeatures>>
9231 {
9232 if gaxi::options::tracing_enabled(&conf) {
9233 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9234 }
9235 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9236 }
9237
9238 async fn build_transport(
9239 conf: gaxi::options::ClientConfig,
9240 ) -> gax::client_builder::Result<impl super::stub::PreviewFeatures> {
9241 super::transport::PreviewFeatures::new(conf).await
9242 }
9243
9244 async fn build_with_tracing(
9245 conf: gaxi::options::ClientConfig,
9246 ) -> gax::client_builder::Result<impl super::stub::PreviewFeatures> {
9247 Self::build_transport(conf)
9248 .await
9249 .map(super::tracing::PreviewFeatures::new)
9250 }
9251
9252 /// Returns the details of the given PreviewFeature.
9253 pub fn get(&self) -> super::builder::preview_features::Get {
9254 super::builder::preview_features::Get::new(self.inner.clone())
9255 }
9256
9257 /// Returns the details of the given PreviewFeature.
9258 pub fn list(&self) -> super::builder::preview_features::List {
9259 super::builder::preview_features::List::new(self.inner.clone())
9260 }
9261
9262 /// Patches the given PreviewFeature. This method is used to enable or disable
9263 /// a PreviewFeature.
9264 pub fn update(&self) -> super::builder::preview_features::Update {
9265 super::builder::preview_features::Update::new(self.inner.clone())
9266 }
9267
9268 /// Retrieves the specified Operations resource.
9269 pub fn get_operation(&self) -> super::builder::preview_features::GetOperation {
9270 super::builder::preview_features::GetOperation::new(self.inner.clone())
9271 }
9272}
9273
9274/// Implements a client for the Google Compute Engine API.
9275///
9276/// # Example
9277/// ```
9278/// # tokio_test::block_on(async {
9279/// # use google_cloud_compute_v1::client::Projects;
9280/// let client = Projects::builder().build().await?;
9281/// // use `client` to make requests to the Google Compute Engine API.
9282/// # gax::client_builder::Result::<()>::Ok(()) });
9283/// ```
9284///
9285/// # Service Description
9286///
9287/// Service for the `projects` resource.
9288///
9289/// # Configuration
9290///
9291/// To configure `Projects` use the `with_*` methods in the type returned
9292/// by [builder()][Projects::builder]. The default configuration should
9293/// work for most applications. Common configuration changes include
9294///
9295/// * [with_endpoint()]: by default this client uses the global default endpoint
9296/// (`https://compute.googleapis.com`). Applications using regional
9297/// endpoints or running in restricted networks (e.g. a network configured
9298// with [Private Google Access with VPC Service Controls]) may want to
9299/// override this default.
9300/// * [with_credentials()]: by default this client uses
9301/// [Application Default Credentials]. Applications using custom
9302/// authentication may need to override this default.
9303///
9304/// [with_endpoint()]: super::builder::projects::ClientBuilder::with_endpoint
9305/// [with_credentials()]: super::builder::projects::ClientBuilder::credentials
9306/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9307/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9308///
9309/// # Pooling and Cloning
9310///
9311/// `Projects` holds a connection pool internally, it is advised to
9312/// create one and the reuse it. You do not need to wrap `Projects` in
9313/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9314/// already uses an `Arc` internally.
9315#[cfg(feature = "projects")]
9316#[cfg_attr(docsrs, doc(cfg(feature = "projects")))]
9317#[derive(Clone, Debug)]
9318pub struct Projects {
9319 inner: std::sync::Arc<dyn super::stub::dynamic::Projects>,
9320}
9321
9322#[cfg(feature = "projects")]
9323impl Projects {
9324 /// Returns a builder for [Projects].
9325 ///
9326 /// ```
9327 /// # tokio_test::block_on(async {
9328 /// # use google_cloud_compute_v1::client::Projects;
9329 /// let client = Projects::builder().build().await?;
9330 /// # gax::client_builder::Result::<()>::Ok(()) });
9331 /// ```
9332 pub fn builder() -> super::builder::projects::ClientBuilder {
9333 gax::client_builder::internal::new_builder(super::builder::projects::client::Factory)
9334 }
9335
9336 /// Creates a new client from the provided stub.
9337 ///
9338 /// The most common case for calling this function is in tests mocking the
9339 /// client's behavior.
9340 pub fn from_stub<T>(stub: T) -> Self
9341 where
9342 T: super::stub::Projects + 'static,
9343 {
9344 Self {
9345 inner: std::sync::Arc::new(stub),
9346 }
9347 }
9348
9349 pub(crate) async fn new(
9350 config: gaxi::options::ClientConfig,
9351 ) -> gax::client_builder::Result<Self> {
9352 let inner = Self::build_inner(config).await?;
9353 Ok(Self { inner })
9354 }
9355
9356 async fn build_inner(
9357 conf: gaxi::options::ClientConfig,
9358 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Projects>> {
9359 if gaxi::options::tracing_enabled(&conf) {
9360 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9361 }
9362 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9363 }
9364
9365 async fn build_transport(
9366 conf: gaxi::options::ClientConfig,
9367 ) -> gax::client_builder::Result<impl super::stub::Projects> {
9368 super::transport::Projects::new(conf).await
9369 }
9370
9371 async fn build_with_tracing(
9372 conf: gaxi::options::ClientConfig,
9373 ) -> gax::client_builder::Result<impl super::stub::Projects> {
9374 Self::build_transport(conf)
9375 .await
9376 .map(super::tracing::Projects::new)
9377 }
9378
9379 /// Disable this project as a shared VPC host project.
9380 pub fn disable_xpn_host(&self) -> super::builder::projects::DisableXpnHost {
9381 super::builder::projects::DisableXpnHost::new(self.inner.clone())
9382 }
9383
9384 /// Disable a service resource (also known as service project) associated with
9385 /// this host project.
9386 pub fn disable_xpn_resource(&self) -> super::builder::projects::DisableXpnResource {
9387 super::builder::projects::DisableXpnResource::new(self.inner.clone())
9388 }
9389
9390 /// Enable this project as a shared VPC host project.
9391 pub fn enable_xpn_host(&self) -> super::builder::projects::EnableXpnHost {
9392 super::builder::projects::EnableXpnHost::new(self.inner.clone())
9393 }
9394
9395 /// Enable service resource (a.k.a service project) for a host project, so that
9396 /// subnets in the host project can be used by instances in the service
9397 /// project.
9398 pub fn enable_xpn_resource(&self) -> super::builder::projects::EnableXpnResource {
9399 super::builder::projects::EnableXpnResource::new(self.inner.clone())
9400 }
9401
9402 /// Returns the specified Project resource.
9403 ///
9404 /// To decrease latency for this method, you can optionally omit any unneeded
9405 /// information from the response by using a field mask. This practice is
9406 /// especially recommended for unused quota information (the `quotas` field).
9407 /// To exclude one or more fields, set your request's `fields` query parameter
9408 /// to only include the fields you need. For example, to only include the `id`
9409 /// and `selfLink` fields, add the query parameter `?fields=id,selfLink` to
9410 /// your request.
9411 pub fn get(&self) -> super::builder::projects::Get {
9412 super::builder::projects::Get::new(self.inner.clone())
9413 }
9414
9415 /// Gets the shared VPC host project that this project links to. May be empty
9416 /// if no link exists.
9417 pub fn get_xpn_host(&self) -> super::builder::projects::GetXpnHost {
9418 super::builder::projects::GetXpnHost::new(self.inner.clone())
9419 }
9420
9421 /// Gets service resources (a.k.a service project) associated with this host
9422 /// project.
9423 pub fn get_xpn_resources(&self) -> super::builder::projects::GetXpnResources {
9424 super::builder::projects::GetXpnResources::new(self.inner.clone())
9425 }
9426
9427 /// Lists all shared VPC host projects visible to the user in an organization.
9428 pub fn list_xpn_hosts(&self) -> super::builder::projects::ListXpnHosts {
9429 super::builder::projects::ListXpnHosts::new(self.inner.clone())
9430 }
9431
9432 /// Moves a persistent disk from one zone to another.
9433 /// *Note*: The moveDisk API will be deprecated on September 29, 2026.
9434 ///
9435 /// Starting September 29, 2025, you can't use the moveDisk API on new
9436 /// projects. To move a disk to a different region or zone, follow the steps in
9437 /// [Change the location of a
9438 /// disk](https://cloud.google.com/compute/docs/disks/migrate-to-hyperdisk#migrate-to-hd).
9439 ///
9440 /// Projects that already use the moveDisk API can continue usage until
9441 /// September 29, 2026.
9442 ///
9443 /// Starting November 1, 2025, API responses will include a warning message in
9444 /// the response body about the upcoming deprecation. You can skip the message
9445 /// to continue using the service without interruption.
9446 #[deprecated]
9447 pub fn move_disk(&self) -> super::builder::projects::MoveDisk {
9448 super::builder::projects::MoveDisk::new(self.inner.clone())
9449 }
9450
9451 /// Moves an instance and its attached persistent disks from one zone to
9452 /// another.
9453 /// *Note*: Moving VMs or disks by using this method might
9454 /// cause unexpected behavior. For more information, see the [known
9455 /// issue](/compute/docs/troubleshooting/known-issues#moving_vms_or_disks_using_the_moveinstance_api_or_the_causes_unexpected_behavior).
9456 /// [Deprecated] This method is deprecated. See [moving instance across
9457 /// zones](/compute/docs/instances/moving-instance-across-zones) instead.
9458 #[deprecated]
9459 pub fn move_instance(&self) -> super::builder::projects::MoveInstance {
9460 super::builder::projects::MoveInstance::new(self.inner.clone())
9461 }
9462
9463 /// Sets the Cloud Armor tier of the project. To set ENTERPRISE or above the
9464 /// billing account of the project must be subscribed to Cloud Armor
9465 /// Enterprise. See Subscribing
9466 /// to Cloud Armor Enterprise for more information.
9467 pub fn set_cloud_armor_tier(&self) -> super::builder::projects::SetCloudArmorTier {
9468 super::builder::projects::SetCloudArmorTier::new(self.inner.clone())
9469 }
9470
9471 /// Sets metadata common to all instances within the specified project using
9472 /// the data included in the request.
9473 pub fn set_common_instance_metadata(
9474 &self,
9475 ) -> super::builder::projects::SetCommonInstanceMetadata {
9476 super::builder::projects::SetCommonInstanceMetadata::new(self.inner.clone())
9477 }
9478
9479 /// Sets the default network tier of the project. The default network tier is
9480 /// used when an address/forwardingRule/instance is created without specifying
9481 /// the network tier field.
9482 pub fn set_default_network_tier(&self) -> super::builder::projects::SetDefaultNetworkTier {
9483 super::builder::projects::SetDefaultNetworkTier::new(self.inner.clone())
9484 }
9485
9486 /// Enables the usage export feature and sets theusage export bucket
9487 /// where reports are stored. If you provide an empty request body using this
9488 /// method, the usage export feature will be disabled.
9489 pub fn set_usage_export_bucket(&self) -> super::builder::projects::SetUsageExportBucket {
9490 super::builder::projects::SetUsageExportBucket::new(self.inner.clone())
9491 }
9492
9493 /// Retrieves the specified Operations resource.
9494 pub fn get_operation(&self) -> super::builder::projects::GetOperation {
9495 super::builder::projects::GetOperation::new(self.inner.clone())
9496 }
9497}
9498
9499/// Implements a client for the Google Compute Engine API.
9500///
9501/// # Example
9502/// ```
9503/// # tokio_test::block_on(async {
9504/// # use google_cloud_compute_v1::client::PublicAdvertisedPrefixes;
9505/// let client = PublicAdvertisedPrefixes::builder().build().await?;
9506/// // use `client` to make requests to the Google Compute Engine API.
9507/// # gax::client_builder::Result::<()>::Ok(()) });
9508/// ```
9509///
9510/// # Service Description
9511///
9512/// Service for the `publicAdvertisedPrefixes` resource.
9513///
9514/// # Configuration
9515///
9516/// To configure `PublicAdvertisedPrefixes` use the `with_*` methods in the type returned
9517/// by [builder()][PublicAdvertisedPrefixes::builder]. The default configuration should
9518/// work for most applications. Common configuration changes include
9519///
9520/// * [with_endpoint()]: by default this client uses the global default endpoint
9521/// (`https://compute.googleapis.com`). Applications using regional
9522/// endpoints or running in restricted networks (e.g. a network configured
9523// with [Private Google Access with VPC Service Controls]) may want to
9524/// override this default.
9525/// * [with_credentials()]: by default this client uses
9526/// [Application Default Credentials]. Applications using custom
9527/// authentication may need to override this default.
9528///
9529/// [with_endpoint()]: super::builder::public_advertised_prefixes::ClientBuilder::with_endpoint
9530/// [with_credentials()]: super::builder::public_advertised_prefixes::ClientBuilder::credentials
9531/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9532/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9533///
9534/// # Pooling and Cloning
9535///
9536/// `PublicAdvertisedPrefixes` holds a connection pool internally, it is advised to
9537/// create one and the reuse it. You do not need to wrap `PublicAdvertisedPrefixes` in
9538/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9539/// already uses an `Arc` internally.
9540#[cfg(feature = "public-advertised-prefixes")]
9541#[cfg_attr(docsrs, doc(cfg(feature = "public-advertised-prefixes")))]
9542#[derive(Clone, Debug)]
9543pub struct PublicAdvertisedPrefixes {
9544 inner: std::sync::Arc<dyn super::stub::dynamic::PublicAdvertisedPrefixes>,
9545}
9546
9547#[cfg(feature = "public-advertised-prefixes")]
9548impl PublicAdvertisedPrefixes {
9549 /// Returns a builder for [PublicAdvertisedPrefixes].
9550 ///
9551 /// ```
9552 /// # tokio_test::block_on(async {
9553 /// # use google_cloud_compute_v1::client::PublicAdvertisedPrefixes;
9554 /// let client = PublicAdvertisedPrefixes::builder().build().await?;
9555 /// # gax::client_builder::Result::<()>::Ok(()) });
9556 /// ```
9557 pub fn builder() -> super::builder::public_advertised_prefixes::ClientBuilder {
9558 gax::client_builder::internal::new_builder(
9559 super::builder::public_advertised_prefixes::client::Factory,
9560 )
9561 }
9562
9563 /// Creates a new client from the provided stub.
9564 ///
9565 /// The most common case for calling this function is in tests mocking the
9566 /// client's behavior.
9567 pub fn from_stub<T>(stub: T) -> Self
9568 where
9569 T: super::stub::PublicAdvertisedPrefixes + 'static,
9570 {
9571 Self {
9572 inner: std::sync::Arc::new(stub),
9573 }
9574 }
9575
9576 pub(crate) async fn new(
9577 config: gaxi::options::ClientConfig,
9578 ) -> gax::client_builder::Result<Self> {
9579 let inner = Self::build_inner(config).await?;
9580 Ok(Self { inner })
9581 }
9582
9583 async fn build_inner(
9584 conf: gaxi::options::ClientConfig,
9585 ) -> gax::client_builder::Result<
9586 std::sync::Arc<dyn super::stub::dynamic::PublicAdvertisedPrefixes>,
9587 > {
9588 if gaxi::options::tracing_enabled(&conf) {
9589 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9590 }
9591 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9592 }
9593
9594 async fn build_transport(
9595 conf: gaxi::options::ClientConfig,
9596 ) -> gax::client_builder::Result<impl super::stub::PublicAdvertisedPrefixes> {
9597 super::transport::PublicAdvertisedPrefixes::new(conf).await
9598 }
9599
9600 async fn build_with_tracing(
9601 conf: gaxi::options::ClientConfig,
9602 ) -> gax::client_builder::Result<impl super::stub::PublicAdvertisedPrefixes> {
9603 Self::build_transport(conf)
9604 .await
9605 .map(super::tracing::PublicAdvertisedPrefixes::new)
9606 }
9607
9608 /// Announces the specified PublicAdvertisedPrefix
9609 pub fn announce(&self) -> super::builder::public_advertised_prefixes::Announce {
9610 super::builder::public_advertised_prefixes::Announce::new(self.inner.clone())
9611 }
9612
9613 /// Deletes the specified PublicAdvertisedPrefix
9614 pub fn delete(&self) -> super::builder::public_advertised_prefixes::Delete {
9615 super::builder::public_advertised_prefixes::Delete::new(self.inner.clone())
9616 }
9617
9618 /// Returns the specified PublicAdvertisedPrefix resource.
9619 pub fn get(&self) -> super::builder::public_advertised_prefixes::Get {
9620 super::builder::public_advertised_prefixes::Get::new(self.inner.clone())
9621 }
9622
9623 /// Creates a PublicAdvertisedPrefix in the specified project
9624 /// using the parameters that are included in the request.
9625 pub fn insert(&self) -> super::builder::public_advertised_prefixes::Insert {
9626 super::builder::public_advertised_prefixes::Insert::new(self.inner.clone())
9627 }
9628
9629 /// Lists the PublicAdvertisedPrefixes for a project.
9630 pub fn list(&self) -> super::builder::public_advertised_prefixes::List {
9631 super::builder::public_advertised_prefixes::List::new(self.inner.clone())
9632 }
9633
9634 /// Patches the specified Router resource with the data included in the
9635 /// request. This method supportsPATCH
9636 /// semantics and usesJSON merge
9637 /// patch format and processing rules.
9638 pub fn patch(&self) -> super::builder::public_advertised_prefixes::Patch {
9639 super::builder::public_advertised_prefixes::Patch::new(self.inner.clone())
9640 }
9641
9642 /// Withdraws the specified PublicAdvertisedPrefix
9643 pub fn withdraw(&self) -> super::builder::public_advertised_prefixes::Withdraw {
9644 super::builder::public_advertised_prefixes::Withdraw::new(self.inner.clone())
9645 }
9646
9647 /// Retrieves the specified Operations resource.
9648 pub fn get_operation(&self) -> super::builder::public_advertised_prefixes::GetOperation {
9649 super::builder::public_advertised_prefixes::GetOperation::new(self.inner.clone())
9650 }
9651}
9652
9653/// Implements a client for the Google Compute Engine API.
9654///
9655/// # Example
9656/// ```
9657/// # tokio_test::block_on(async {
9658/// # use google_cloud_compute_v1::client::PublicDelegatedPrefixes;
9659/// let client = PublicDelegatedPrefixes::builder().build().await?;
9660/// // use `client` to make requests to the Google Compute Engine API.
9661/// # gax::client_builder::Result::<()>::Ok(()) });
9662/// ```
9663///
9664/// # Service Description
9665///
9666/// Service for the `publicDelegatedPrefixes` resource.
9667///
9668/// # Configuration
9669///
9670/// To configure `PublicDelegatedPrefixes` use the `with_*` methods in the type returned
9671/// by [builder()][PublicDelegatedPrefixes::builder]. The default configuration should
9672/// work for most applications. Common configuration changes include
9673///
9674/// * [with_endpoint()]: by default this client uses the global default endpoint
9675/// (`https://compute.googleapis.com`). Applications using regional
9676/// endpoints or running in restricted networks (e.g. a network configured
9677// with [Private Google Access with VPC Service Controls]) may want to
9678/// override this default.
9679/// * [with_credentials()]: by default this client uses
9680/// [Application Default Credentials]. Applications using custom
9681/// authentication may need to override this default.
9682///
9683/// [with_endpoint()]: super::builder::public_delegated_prefixes::ClientBuilder::with_endpoint
9684/// [with_credentials()]: super::builder::public_delegated_prefixes::ClientBuilder::credentials
9685/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9686/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9687///
9688/// # Pooling and Cloning
9689///
9690/// `PublicDelegatedPrefixes` holds a connection pool internally, it is advised to
9691/// create one and the reuse it. You do not need to wrap `PublicDelegatedPrefixes` in
9692/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9693/// already uses an `Arc` internally.
9694#[cfg(feature = "public-delegated-prefixes")]
9695#[cfg_attr(docsrs, doc(cfg(feature = "public-delegated-prefixes")))]
9696#[derive(Clone, Debug)]
9697pub struct PublicDelegatedPrefixes {
9698 inner: std::sync::Arc<dyn super::stub::dynamic::PublicDelegatedPrefixes>,
9699}
9700
9701#[cfg(feature = "public-delegated-prefixes")]
9702impl PublicDelegatedPrefixes {
9703 /// Returns a builder for [PublicDelegatedPrefixes].
9704 ///
9705 /// ```
9706 /// # tokio_test::block_on(async {
9707 /// # use google_cloud_compute_v1::client::PublicDelegatedPrefixes;
9708 /// let client = PublicDelegatedPrefixes::builder().build().await?;
9709 /// # gax::client_builder::Result::<()>::Ok(()) });
9710 /// ```
9711 pub fn builder() -> super::builder::public_delegated_prefixes::ClientBuilder {
9712 gax::client_builder::internal::new_builder(
9713 super::builder::public_delegated_prefixes::client::Factory,
9714 )
9715 }
9716
9717 /// Creates a new client from the provided stub.
9718 ///
9719 /// The most common case for calling this function is in tests mocking the
9720 /// client's behavior.
9721 pub fn from_stub<T>(stub: T) -> Self
9722 where
9723 T: super::stub::PublicDelegatedPrefixes + 'static,
9724 {
9725 Self {
9726 inner: std::sync::Arc::new(stub),
9727 }
9728 }
9729
9730 pub(crate) async fn new(
9731 config: gaxi::options::ClientConfig,
9732 ) -> gax::client_builder::Result<Self> {
9733 let inner = Self::build_inner(config).await?;
9734 Ok(Self { inner })
9735 }
9736
9737 async fn build_inner(
9738 conf: gaxi::options::ClientConfig,
9739 ) -> gax::client_builder::Result<
9740 std::sync::Arc<dyn super::stub::dynamic::PublicDelegatedPrefixes>,
9741 > {
9742 if gaxi::options::tracing_enabled(&conf) {
9743 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9744 }
9745 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9746 }
9747
9748 async fn build_transport(
9749 conf: gaxi::options::ClientConfig,
9750 ) -> gax::client_builder::Result<impl super::stub::PublicDelegatedPrefixes> {
9751 super::transport::PublicDelegatedPrefixes::new(conf).await
9752 }
9753
9754 async fn build_with_tracing(
9755 conf: gaxi::options::ClientConfig,
9756 ) -> gax::client_builder::Result<impl super::stub::PublicDelegatedPrefixes> {
9757 Self::build_transport(conf)
9758 .await
9759 .map(super::tracing::PublicDelegatedPrefixes::new)
9760 }
9761
9762 /// Lists all PublicDelegatedPrefix resources owned by the specific project
9763 /// across all scopes.
9764 ///
9765 /// To prevent failure, Google recommends that you set the
9766 /// `returnPartialSuccess` parameter to `true`.
9767 pub fn aggregated_list(&self) -> super::builder::public_delegated_prefixes::AggregatedList {
9768 super::builder::public_delegated_prefixes::AggregatedList::new(self.inner.clone())
9769 }
9770
9771 /// Announces the specified PublicDelegatedPrefix in the given region.
9772 pub fn announce(&self) -> super::builder::public_delegated_prefixes::Announce {
9773 super::builder::public_delegated_prefixes::Announce::new(self.inner.clone())
9774 }
9775
9776 /// Deletes the specified PublicDelegatedPrefix in the given region.
9777 pub fn delete(&self) -> super::builder::public_delegated_prefixes::Delete {
9778 super::builder::public_delegated_prefixes::Delete::new(self.inner.clone())
9779 }
9780
9781 /// Returns the specified PublicDelegatedPrefix resource in the given region.
9782 pub fn get(&self) -> super::builder::public_delegated_prefixes::Get {
9783 super::builder::public_delegated_prefixes::Get::new(self.inner.clone())
9784 }
9785
9786 /// Creates a PublicDelegatedPrefix in the specified project in the given
9787 /// region using the parameters that are included in the request.
9788 pub fn insert(&self) -> super::builder::public_delegated_prefixes::Insert {
9789 super::builder::public_delegated_prefixes::Insert::new(self.inner.clone())
9790 }
9791
9792 /// Lists the PublicDelegatedPrefixes for a project in the given region.
9793 pub fn list(&self) -> super::builder::public_delegated_prefixes::List {
9794 super::builder::public_delegated_prefixes::List::new(self.inner.clone())
9795 }
9796
9797 /// Patches the specified PublicDelegatedPrefix resource with the data included
9798 /// in the request. This method supportsPATCH
9799 /// semantics and usesJSON merge
9800 /// patch format and processing rules.
9801 pub fn patch(&self) -> super::builder::public_delegated_prefixes::Patch {
9802 super::builder::public_delegated_prefixes::Patch::new(self.inner.clone())
9803 }
9804
9805 /// Withdraws the specified PublicDelegatedPrefix in the given region.
9806 pub fn withdraw(&self) -> super::builder::public_delegated_prefixes::Withdraw {
9807 super::builder::public_delegated_prefixes::Withdraw::new(self.inner.clone())
9808 }
9809
9810 /// Retrieves the specified region-specific Operations resource.
9811 pub fn get_operation(&self) -> super::builder::public_delegated_prefixes::GetOperation {
9812 super::builder::public_delegated_prefixes::GetOperation::new(self.inner.clone())
9813 }
9814}
9815
9816/// Implements a client for the Google Compute Engine API.
9817///
9818/// # Example
9819/// ```
9820/// # tokio_test::block_on(async {
9821/// # use google_cloud_compute_v1::client::RegionAutoscalers;
9822/// let client = RegionAutoscalers::builder().build().await?;
9823/// // use `client` to make requests to the Google Compute Engine API.
9824/// # gax::client_builder::Result::<()>::Ok(()) });
9825/// ```
9826///
9827/// # Service Description
9828///
9829/// Service for the `regionAutoscalers` resource.
9830///
9831/// # Configuration
9832///
9833/// To configure `RegionAutoscalers` use the `with_*` methods in the type returned
9834/// by [builder()][RegionAutoscalers::builder]. The default configuration should
9835/// work for most applications. Common configuration changes include
9836///
9837/// * [with_endpoint()]: by default this client uses the global default endpoint
9838/// (`https://compute.googleapis.com`). Applications using regional
9839/// endpoints or running in restricted networks (e.g. a network configured
9840// with [Private Google Access with VPC Service Controls]) may want to
9841/// override this default.
9842/// * [with_credentials()]: by default this client uses
9843/// [Application Default Credentials]. Applications using custom
9844/// authentication may need to override this default.
9845///
9846/// [with_endpoint()]: super::builder::region_autoscalers::ClientBuilder::with_endpoint
9847/// [with_credentials()]: super::builder::region_autoscalers::ClientBuilder::credentials
9848/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9849/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9850///
9851/// # Pooling and Cloning
9852///
9853/// `RegionAutoscalers` holds a connection pool internally, it is advised to
9854/// create one and the reuse it. You do not need to wrap `RegionAutoscalers` in
9855/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9856/// already uses an `Arc` internally.
9857#[cfg(feature = "region-autoscalers")]
9858#[cfg_attr(docsrs, doc(cfg(feature = "region-autoscalers")))]
9859#[derive(Clone, Debug)]
9860pub struct RegionAutoscalers {
9861 inner: std::sync::Arc<dyn super::stub::dynamic::RegionAutoscalers>,
9862}
9863
9864#[cfg(feature = "region-autoscalers")]
9865impl RegionAutoscalers {
9866 /// Returns a builder for [RegionAutoscalers].
9867 ///
9868 /// ```
9869 /// # tokio_test::block_on(async {
9870 /// # use google_cloud_compute_v1::client::RegionAutoscalers;
9871 /// let client = RegionAutoscalers::builder().build().await?;
9872 /// # gax::client_builder::Result::<()>::Ok(()) });
9873 /// ```
9874 pub fn builder() -> super::builder::region_autoscalers::ClientBuilder {
9875 gax::client_builder::internal::new_builder(
9876 super::builder::region_autoscalers::client::Factory,
9877 )
9878 }
9879
9880 /// Creates a new client from the provided stub.
9881 ///
9882 /// The most common case for calling this function is in tests mocking the
9883 /// client's behavior.
9884 pub fn from_stub<T>(stub: T) -> Self
9885 where
9886 T: super::stub::RegionAutoscalers + 'static,
9887 {
9888 Self {
9889 inner: std::sync::Arc::new(stub),
9890 }
9891 }
9892
9893 pub(crate) async fn new(
9894 config: gaxi::options::ClientConfig,
9895 ) -> gax::client_builder::Result<Self> {
9896 let inner = Self::build_inner(config).await?;
9897 Ok(Self { inner })
9898 }
9899
9900 async fn build_inner(
9901 conf: gaxi::options::ClientConfig,
9902 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionAutoscalers>>
9903 {
9904 if gaxi::options::tracing_enabled(&conf) {
9905 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9906 }
9907 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9908 }
9909
9910 async fn build_transport(
9911 conf: gaxi::options::ClientConfig,
9912 ) -> gax::client_builder::Result<impl super::stub::RegionAutoscalers> {
9913 super::transport::RegionAutoscalers::new(conf).await
9914 }
9915
9916 async fn build_with_tracing(
9917 conf: gaxi::options::ClientConfig,
9918 ) -> gax::client_builder::Result<impl super::stub::RegionAutoscalers> {
9919 Self::build_transport(conf)
9920 .await
9921 .map(super::tracing::RegionAutoscalers::new)
9922 }
9923
9924 /// Deletes the specified autoscaler.
9925 pub fn delete(&self) -> super::builder::region_autoscalers::Delete {
9926 super::builder::region_autoscalers::Delete::new(self.inner.clone())
9927 }
9928
9929 /// Returns the specified autoscaler.
9930 pub fn get(&self) -> super::builder::region_autoscalers::Get {
9931 super::builder::region_autoscalers::Get::new(self.inner.clone())
9932 }
9933
9934 /// Creates an autoscaler in the specified project using
9935 /// the data included in the request.
9936 pub fn insert(&self) -> super::builder::region_autoscalers::Insert {
9937 super::builder::region_autoscalers::Insert::new(self.inner.clone())
9938 }
9939
9940 /// Retrieves a list of autoscalers contained within
9941 /// the specified region.
9942 pub fn list(&self) -> super::builder::region_autoscalers::List {
9943 super::builder::region_autoscalers::List::new(self.inner.clone())
9944 }
9945
9946 /// Updates an autoscaler in the specified project using
9947 /// the data included in the request. This method supportsPATCH
9948 /// semantics and uses theJSON merge
9949 /// patch format and processing rules.
9950 pub fn patch(&self) -> super::builder::region_autoscalers::Patch {
9951 super::builder::region_autoscalers::Patch::new(self.inner.clone())
9952 }
9953
9954 /// Updates an autoscaler in the specified project using
9955 /// the data included in the request.
9956 pub fn update(&self) -> super::builder::region_autoscalers::Update {
9957 super::builder::region_autoscalers::Update::new(self.inner.clone())
9958 }
9959
9960 /// Retrieves the specified region-specific Operations resource.
9961 pub fn get_operation(&self) -> super::builder::region_autoscalers::GetOperation {
9962 super::builder::region_autoscalers::GetOperation::new(self.inner.clone())
9963 }
9964}
9965
9966/// Implements a client for the Google Compute Engine API.
9967///
9968/// # Example
9969/// ```
9970/// # tokio_test::block_on(async {
9971/// # use google_cloud_compute_v1::client::RegionBackendServices;
9972/// let client = RegionBackendServices::builder().build().await?;
9973/// // use `client` to make requests to the Google Compute Engine API.
9974/// # gax::client_builder::Result::<()>::Ok(()) });
9975/// ```
9976///
9977/// # Service Description
9978///
9979/// Service for the `regionBackendServices` resource.
9980///
9981/// # Configuration
9982///
9983/// To configure `RegionBackendServices` use the `with_*` methods in the type returned
9984/// by [builder()][RegionBackendServices::builder]. The default configuration should
9985/// work for most applications. Common configuration changes include
9986///
9987/// * [with_endpoint()]: by default this client uses the global default endpoint
9988/// (`https://compute.googleapis.com`). Applications using regional
9989/// endpoints or running in restricted networks (e.g. a network configured
9990// with [Private Google Access with VPC Service Controls]) may want to
9991/// override this default.
9992/// * [with_credentials()]: by default this client uses
9993/// [Application Default Credentials]. Applications using custom
9994/// authentication may need to override this default.
9995///
9996/// [with_endpoint()]: super::builder::region_backend_services::ClientBuilder::with_endpoint
9997/// [with_credentials()]: super::builder::region_backend_services::ClientBuilder::credentials
9998/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9999/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10000///
10001/// # Pooling and Cloning
10002///
10003/// `RegionBackendServices` holds a connection pool internally, it is advised to
10004/// create one and the reuse it. You do not need to wrap `RegionBackendServices` in
10005/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10006/// already uses an `Arc` internally.
10007#[cfg(feature = "region-backend-services")]
10008#[cfg_attr(docsrs, doc(cfg(feature = "region-backend-services")))]
10009#[derive(Clone, Debug)]
10010pub struct RegionBackendServices {
10011 inner: std::sync::Arc<dyn super::stub::dynamic::RegionBackendServices>,
10012}
10013
10014#[cfg(feature = "region-backend-services")]
10015impl RegionBackendServices {
10016 /// Returns a builder for [RegionBackendServices].
10017 ///
10018 /// ```
10019 /// # tokio_test::block_on(async {
10020 /// # use google_cloud_compute_v1::client::RegionBackendServices;
10021 /// let client = RegionBackendServices::builder().build().await?;
10022 /// # gax::client_builder::Result::<()>::Ok(()) });
10023 /// ```
10024 pub fn builder() -> super::builder::region_backend_services::ClientBuilder {
10025 gax::client_builder::internal::new_builder(
10026 super::builder::region_backend_services::client::Factory,
10027 )
10028 }
10029
10030 /// Creates a new client from the provided stub.
10031 ///
10032 /// The most common case for calling this function is in tests mocking the
10033 /// client's behavior.
10034 pub fn from_stub<T>(stub: T) -> Self
10035 where
10036 T: super::stub::RegionBackendServices + 'static,
10037 {
10038 Self {
10039 inner: std::sync::Arc::new(stub),
10040 }
10041 }
10042
10043 pub(crate) async fn new(
10044 config: gaxi::options::ClientConfig,
10045 ) -> gax::client_builder::Result<Self> {
10046 let inner = Self::build_inner(config).await?;
10047 Ok(Self { inner })
10048 }
10049
10050 async fn build_inner(
10051 conf: gaxi::options::ClientConfig,
10052 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionBackendServices>>
10053 {
10054 if gaxi::options::tracing_enabled(&conf) {
10055 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10056 }
10057 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10058 }
10059
10060 async fn build_transport(
10061 conf: gaxi::options::ClientConfig,
10062 ) -> gax::client_builder::Result<impl super::stub::RegionBackendServices> {
10063 super::transport::RegionBackendServices::new(conf).await
10064 }
10065
10066 async fn build_with_tracing(
10067 conf: gaxi::options::ClientConfig,
10068 ) -> gax::client_builder::Result<impl super::stub::RegionBackendServices> {
10069 Self::build_transport(conf)
10070 .await
10071 .map(super::tracing::RegionBackendServices::new)
10072 }
10073
10074 /// Deletes the specified regional BackendService resource.
10075 pub fn delete(&self) -> super::builder::region_backend_services::Delete {
10076 super::builder::region_backend_services::Delete::new(self.inner.clone())
10077 }
10078
10079 /// Returns the specified regional BackendService resource.
10080 pub fn get(&self) -> super::builder::region_backend_services::Get {
10081 super::builder::region_backend_services::Get::new(self.inner.clone())
10082 }
10083
10084 /// Gets the most recent health check results for this
10085 /// regional BackendService.
10086 pub fn get_health(&self) -> super::builder::region_backend_services::GetHealth {
10087 super::builder::region_backend_services::GetHealth::new(self.inner.clone())
10088 }
10089
10090 /// Gets the access control policy for a resource. May be empty if no such
10091 /// policy or resource exists.
10092 pub fn get_iam_policy(&self) -> super::builder::region_backend_services::GetIamPolicy {
10093 super::builder::region_backend_services::GetIamPolicy::new(self.inner.clone())
10094 }
10095
10096 /// Creates a regional BackendService resource in the specified project using
10097 /// the data included in the request. For more information, see
10098 /// Backend services overview.
10099 pub fn insert(&self) -> super::builder::region_backend_services::Insert {
10100 super::builder::region_backend_services::Insert::new(self.inner.clone())
10101 }
10102
10103 /// Retrieves the list of regional BackendService resources available to the
10104 /// specified project in the given region.
10105 pub fn list(&self) -> super::builder::region_backend_services::List {
10106 super::builder::region_backend_services::List::new(self.inner.clone())
10107 }
10108
10109 /// Retrieves a list of all usable backend services in the specified project in
10110 /// the given region.
10111 pub fn list_usable(&self) -> super::builder::region_backend_services::ListUsable {
10112 super::builder::region_backend_services::ListUsable::new(self.inner.clone())
10113 }
10114
10115 /// Updates the specified regional BackendService resource with the data
10116 /// included in the request. For more information, see
10117 /// Understanding backend services This method
10118 /// supports PATCH semantics and uses the JSON merge
10119 /// patch format and processing rules.
10120 pub fn patch(&self) -> super::builder::region_backend_services::Patch {
10121 super::builder::region_backend_services::Patch::new(self.inner.clone())
10122 }
10123
10124 /// Sets the access control policy on the specified resource.
10125 /// Replaces any existing policy.
10126 pub fn set_iam_policy(&self) -> super::builder::region_backend_services::SetIamPolicy {
10127 super::builder::region_backend_services::SetIamPolicy::new(self.inner.clone())
10128 }
10129
10130 /// Sets the Google Cloud Armor security policy for the specified backend
10131 /// service. For more information, seeGoogle
10132 /// Cloud Armor Overview
10133 pub fn set_security_policy(
10134 &self,
10135 ) -> super::builder::region_backend_services::SetSecurityPolicy {
10136 super::builder::region_backend_services::SetSecurityPolicy::new(self.inner.clone())
10137 }
10138
10139 /// Returns permissions that a caller has on the specified resource.
10140 pub fn test_iam_permissions(
10141 &self,
10142 ) -> super::builder::region_backend_services::TestIamPermissions {
10143 super::builder::region_backend_services::TestIamPermissions::new(self.inner.clone())
10144 }
10145
10146 /// Updates the specified regional BackendService resource with the data
10147 /// included in the request. For more information,
10148 /// see
10149 /// Backend services overview.
10150 pub fn update(&self) -> super::builder::region_backend_services::Update {
10151 super::builder::region_backend_services::Update::new(self.inner.clone())
10152 }
10153
10154 /// Retrieves the specified region-specific Operations resource.
10155 pub fn get_operation(&self) -> super::builder::region_backend_services::GetOperation {
10156 super::builder::region_backend_services::GetOperation::new(self.inner.clone())
10157 }
10158}
10159
10160/// Implements a client for the Google Compute Engine API.
10161///
10162/// # Example
10163/// ```
10164/// # tokio_test::block_on(async {
10165/// # use google_cloud_compute_v1::client::RegionCommitments;
10166/// let client = RegionCommitments::builder().build().await?;
10167/// // use `client` to make requests to the Google Compute Engine API.
10168/// # gax::client_builder::Result::<()>::Ok(()) });
10169/// ```
10170///
10171/// # Service Description
10172///
10173/// Service for the `regionCommitments` resource.
10174///
10175/// # Configuration
10176///
10177/// To configure `RegionCommitments` use the `with_*` methods in the type returned
10178/// by [builder()][RegionCommitments::builder]. The default configuration should
10179/// work for most applications. Common configuration changes include
10180///
10181/// * [with_endpoint()]: by default this client uses the global default endpoint
10182/// (`https://compute.googleapis.com`). Applications using regional
10183/// endpoints or running in restricted networks (e.g. a network configured
10184// with [Private Google Access with VPC Service Controls]) may want to
10185/// override this default.
10186/// * [with_credentials()]: by default this client uses
10187/// [Application Default Credentials]. Applications using custom
10188/// authentication may need to override this default.
10189///
10190/// [with_endpoint()]: super::builder::region_commitments::ClientBuilder::with_endpoint
10191/// [with_credentials()]: super::builder::region_commitments::ClientBuilder::credentials
10192/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10193/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10194///
10195/// # Pooling and Cloning
10196///
10197/// `RegionCommitments` holds a connection pool internally, it is advised to
10198/// create one and the reuse it. You do not need to wrap `RegionCommitments` in
10199/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10200/// already uses an `Arc` internally.
10201#[cfg(feature = "region-commitments")]
10202#[cfg_attr(docsrs, doc(cfg(feature = "region-commitments")))]
10203#[derive(Clone, Debug)]
10204pub struct RegionCommitments {
10205 inner: std::sync::Arc<dyn super::stub::dynamic::RegionCommitments>,
10206}
10207
10208#[cfg(feature = "region-commitments")]
10209impl RegionCommitments {
10210 /// Returns a builder for [RegionCommitments].
10211 ///
10212 /// ```
10213 /// # tokio_test::block_on(async {
10214 /// # use google_cloud_compute_v1::client::RegionCommitments;
10215 /// let client = RegionCommitments::builder().build().await?;
10216 /// # gax::client_builder::Result::<()>::Ok(()) });
10217 /// ```
10218 pub fn builder() -> super::builder::region_commitments::ClientBuilder {
10219 gax::client_builder::internal::new_builder(
10220 super::builder::region_commitments::client::Factory,
10221 )
10222 }
10223
10224 /// Creates a new client from the provided stub.
10225 ///
10226 /// The most common case for calling this function is in tests mocking the
10227 /// client's behavior.
10228 pub fn from_stub<T>(stub: T) -> Self
10229 where
10230 T: super::stub::RegionCommitments + 'static,
10231 {
10232 Self {
10233 inner: std::sync::Arc::new(stub),
10234 }
10235 }
10236
10237 pub(crate) async fn new(
10238 config: gaxi::options::ClientConfig,
10239 ) -> gax::client_builder::Result<Self> {
10240 let inner = Self::build_inner(config).await?;
10241 Ok(Self { inner })
10242 }
10243
10244 async fn build_inner(
10245 conf: gaxi::options::ClientConfig,
10246 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionCommitments>>
10247 {
10248 if gaxi::options::tracing_enabled(&conf) {
10249 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10250 }
10251 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10252 }
10253
10254 async fn build_transport(
10255 conf: gaxi::options::ClientConfig,
10256 ) -> gax::client_builder::Result<impl super::stub::RegionCommitments> {
10257 super::transport::RegionCommitments::new(conf).await
10258 }
10259
10260 async fn build_with_tracing(
10261 conf: gaxi::options::ClientConfig,
10262 ) -> gax::client_builder::Result<impl super::stub::RegionCommitments> {
10263 Self::build_transport(conf)
10264 .await
10265 .map(super::tracing::RegionCommitments::new)
10266 }
10267
10268 /// Retrieves an aggregated list of commitments by region.
10269 ///
10270 /// To prevent failure, it is recommended that you set the
10271 /// `returnPartialSuccess` parameter to `true`.
10272 pub fn aggregated_list(&self) -> super::builder::region_commitments::AggregatedList {
10273 super::builder::region_commitments::AggregatedList::new(self.inner.clone())
10274 }
10275
10276 /// Returns the specified commitment resource.
10277 pub fn get(&self) -> super::builder::region_commitments::Get {
10278 super::builder::region_commitments::Get::new(self.inner.clone())
10279 }
10280
10281 /// Creates a commitment in the specified project using the data
10282 /// included in the request.
10283 pub fn insert(&self) -> super::builder::region_commitments::Insert {
10284 super::builder::region_commitments::Insert::new(self.inner.clone())
10285 }
10286
10287 /// Retrieves a list of commitments contained within
10288 /// the specified region.
10289 pub fn list(&self) -> super::builder::region_commitments::List {
10290 super::builder::region_commitments::List::new(self.inner.clone())
10291 }
10292
10293 /// Updates the specified commitment with the data included in the request.
10294 /// Update is performed only on selected fields included as part of
10295 /// update-mask. Only the following fields can be updated: auto_renew and plan.
10296 pub fn update(&self) -> super::builder::region_commitments::Update {
10297 super::builder::region_commitments::Update::new(self.inner.clone())
10298 }
10299
10300 /// Retrieves the specified region-specific Operations resource.
10301 pub fn get_operation(&self) -> super::builder::region_commitments::GetOperation {
10302 super::builder::region_commitments::GetOperation::new(self.inner.clone())
10303 }
10304}
10305
10306/// Implements a client for the Google Compute Engine API.
10307///
10308/// # Example
10309/// ```
10310/// # tokio_test::block_on(async {
10311/// # use google_cloud_compute_v1::client::RegionDiskTypes;
10312/// let client = RegionDiskTypes::builder().build().await?;
10313/// // use `client` to make requests to the Google Compute Engine API.
10314/// # gax::client_builder::Result::<()>::Ok(()) });
10315/// ```
10316///
10317/// # Service Description
10318///
10319/// Service for the `regionDiskTypes` resource.
10320///
10321/// # Configuration
10322///
10323/// To configure `RegionDiskTypes` use the `with_*` methods in the type returned
10324/// by [builder()][RegionDiskTypes::builder]. The default configuration should
10325/// work for most applications. Common configuration changes include
10326///
10327/// * [with_endpoint()]: by default this client uses the global default endpoint
10328/// (`https://compute.googleapis.com`). Applications using regional
10329/// endpoints or running in restricted networks (e.g. a network configured
10330// with [Private Google Access with VPC Service Controls]) may want to
10331/// override this default.
10332/// * [with_credentials()]: by default this client uses
10333/// [Application Default Credentials]. Applications using custom
10334/// authentication may need to override this default.
10335///
10336/// [with_endpoint()]: super::builder::region_disk_types::ClientBuilder::with_endpoint
10337/// [with_credentials()]: super::builder::region_disk_types::ClientBuilder::credentials
10338/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10339/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10340///
10341/// # Pooling and Cloning
10342///
10343/// `RegionDiskTypes` holds a connection pool internally, it is advised to
10344/// create one and the reuse it. You do not need to wrap `RegionDiskTypes` in
10345/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10346/// already uses an `Arc` internally.
10347#[cfg(feature = "region-disk-types")]
10348#[cfg_attr(docsrs, doc(cfg(feature = "region-disk-types")))]
10349#[derive(Clone, Debug)]
10350pub struct RegionDiskTypes {
10351 inner: std::sync::Arc<dyn super::stub::dynamic::RegionDiskTypes>,
10352}
10353
10354#[cfg(feature = "region-disk-types")]
10355impl RegionDiskTypes {
10356 /// Returns a builder for [RegionDiskTypes].
10357 ///
10358 /// ```
10359 /// # tokio_test::block_on(async {
10360 /// # use google_cloud_compute_v1::client::RegionDiskTypes;
10361 /// let client = RegionDiskTypes::builder().build().await?;
10362 /// # gax::client_builder::Result::<()>::Ok(()) });
10363 /// ```
10364 pub fn builder() -> super::builder::region_disk_types::ClientBuilder {
10365 gax::client_builder::internal::new_builder(
10366 super::builder::region_disk_types::client::Factory,
10367 )
10368 }
10369
10370 /// Creates a new client from the provided stub.
10371 ///
10372 /// The most common case for calling this function is in tests mocking the
10373 /// client's behavior.
10374 pub fn from_stub<T>(stub: T) -> Self
10375 where
10376 T: super::stub::RegionDiskTypes + 'static,
10377 {
10378 Self {
10379 inner: std::sync::Arc::new(stub),
10380 }
10381 }
10382
10383 pub(crate) async fn new(
10384 config: gaxi::options::ClientConfig,
10385 ) -> gax::client_builder::Result<Self> {
10386 let inner = Self::build_inner(config).await?;
10387 Ok(Self { inner })
10388 }
10389
10390 async fn build_inner(
10391 conf: gaxi::options::ClientConfig,
10392 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionDiskTypes>>
10393 {
10394 if gaxi::options::tracing_enabled(&conf) {
10395 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10396 }
10397 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10398 }
10399
10400 async fn build_transport(
10401 conf: gaxi::options::ClientConfig,
10402 ) -> gax::client_builder::Result<impl super::stub::RegionDiskTypes> {
10403 super::transport::RegionDiskTypes::new(conf).await
10404 }
10405
10406 async fn build_with_tracing(
10407 conf: gaxi::options::ClientConfig,
10408 ) -> gax::client_builder::Result<impl super::stub::RegionDiskTypes> {
10409 Self::build_transport(conf)
10410 .await
10411 .map(super::tracing::RegionDiskTypes::new)
10412 }
10413
10414 /// Returns the specified regional disk type.
10415 pub fn get(&self) -> super::builder::region_disk_types::Get {
10416 super::builder::region_disk_types::Get::new(self.inner.clone())
10417 }
10418
10419 /// Retrieves a list of regional disk types available to the specified project.
10420 pub fn list(&self) -> super::builder::region_disk_types::List {
10421 super::builder::region_disk_types::List::new(self.inner.clone())
10422 }
10423}
10424
10425/// Implements a client for the Google Compute Engine API.
10426///
10427/// # Example
10428/// ```
10429/// # tokio_test::block_on(async {
10430/// # use google_cloud_compute_v1::client::RegionDisks;
10431/// let client = RegionDisks::builder().build().await?;
10432/// // use `client` to make requests to the Google Compute Engine API.
10433/// # gax::client_builder::Result::<()>::Ok(()) });
10434/// ```
10435///
10436/// # Service Description
10437///
10438/// Service for the `regionDisks` resource.
10439///
10440/// # Configuration
10441///
10442/// To configure `RegionDisks` use the `with_*` methods in the type returned
10443/// by [builder()][RegionDisks::builder]. The default configuration should
10444/// work for most applications. Common configuration changes include
10445///
10446/// * [with_endpoint()]: by default this client uses the global default endpoint
10447/// (`https://compute.googleapis.com`). Applications using regional
10448/// endpoints or running in restricted networks (e.g. a network configured
10449// with [Private Google Access with VPC Service Controls]) may want to
10450/// override this default.
10451/// * [with_credentials()]: by default this client uses
10452/// [Application Default Credentials]. Applications using custom
10453/// authentication may need to override this default.
10454///
10455/// [with_endpoint()]: super::builder::region_disks::ClientBuilder::with_endpoint
10456/// [with_credentials()]: super::builder::region_disks::ClientBuilder::credentials
10457/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10458/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10459///
10460/// # Pooling and Cloning
10461///
10462/// `RegionDisks` holds a connection pool internally, it is advised to
10463/// create one and the reuse it. You do not need to wrap `RegionDisks` in
10464/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10465/// already uses an `Arc` internally.
10466#[cfg(feature = "region-disks")]
10467#[cfg_attr(docsrs, doc(cfg(feature = "region-disks")))]
10468#[derive(Clone, Debug)]
10469pub struct RegionDisks {
10470 inner: std::sync::Arc<dyn super::stub::dynamic::RegionDisks>,
10471}
10472
10473#[cfg(feature = "region-disks")]
10474impl RegionDisks {
10475 /// Returns a builder for [RegionDisks].
10476 ///
10477 /// ```
10478 /// # tokio_test::block_on(async {
10479 /// # use google_cloud_compute_v1::client::RegionDisks;
10480 /// let client = RegionDisks::builder().build().await?;
10481 /// # gax::client_builder::Result::<()>::Ok(()) });
10482 /// ```
10483 pub fn builder() -> super::builder::region_disks::ClientBuilder {
10484 gax::client_builder::internal::new_builder(super::builder::region_disks::client::Factory)
10485 }
10486
10487 /// Creates a new client from the provided stub.
10488 ///
10489 /// The most common case for calling this function is in tests mocking the
10490 /// client's behavior.
10491 pub fn from_stub<T>(stub: T) -> Self
10492 where
10493 T: super::stub::RegionDisks + 'static,
10494 {
10495 Self {
10496 inner: std::sync::Arc::new(stub),
10497 }
10498 }
10499
10500 pub(crate) async fn new(
10501 config: gaxi::options::ClientConfig,
10502 ) -> gax::client_builder::Result<Self> {
10503 let inner = Self::build_inner(config).await?;
10504 Ok(Self { inner })
10505 }
10506
10507 async fn build_inner(
10508 conf: gaxi::options::ClientConfig,
10509 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionDisks>> {
10510 if gaxi::options::tracing_enabled(&conf) {
10511 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10512 }
10513 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10514 }
10515
10516 async fn build_transport(
10517 conf: gaxi::options::ClientConfig,
10518 ) -> gax::client_builder::Result<impl super::stub::RegionDisks> {
10519 super::transport::RegionDisks::new(conf).await
10520 }
10521
10522 async fn build_with_tracing(
10523 conf: gaxi::options::ClientConfig,
10524 ) -> gax::client_builder::Result<impl super::stub::RegionDisks> {
10525 Self::build_transport(conf)
10526 .await
10527 .map(super::tracing::RegionDisks::new)
10528 }
10529
10530 /// Adds existing resource policies to a regional disk. You can only add one
10531 /// policy which will be applied to this disk for scheduling snapshot
10532 /// creation.
10533 pub fn add_resource_policies(&self) -> super::builder::region_disks::AddResourcePolicies {
10534 super::builder::region_disks::AddResourcePolicies::new(self.inner.clone())
10535 }
10536
10537 /// Bulk create a set of disks.
10538 pub fn bulk_insert(&self) -> super::builder::region_disks::BulkInsert {
10539 super::builder::region_disks::BulkInsert::new(self.inner.clone())
10540 }
10541
10542 /// Creates a snapshot of a specified persistent disk. For regular snapshot
10543 /// creation, consider using snapshots.insert
10544 /// instead, as that method supports more features, such as creating snapshots
10545 /// in a project different from the source disk project.
10546 pub fn create_snapshot(&self) -> super::builder::region_disks::CreateSnapshot {
10547 super::builder::region_disks::CreateSnapshot::new(self.inner.clone())
10548 }
10549
10550 /// Deletes the specified regional persistent disk. Deleting a regional disk
10551 /// removes all the replicas of its data permanently and is irreversible.
10552 /// However, deleting a disk does not delete anysnapshots
10553 /// previously made from the disk. You must separatelydelete
10554 /// snapshots.
10555 pub fn delete(&self) -> super::builder::region_disks::Delete {
10556 super::builder::region_disks::Delete::new(self.inner.clone())
10557 }
10558
10559 /// Returns a specified regional persistent disk.
10560 pub fn get(&self) -> super::builder::region_disks::Get {
10561 super::builder::region_disks::Get::new(self.inner.clone())
10562 }
10563
10564 /// Gets the access control policy for a resource. May be empty if no such
10565 /// policy or resource exists.
10566 pub fn get_iam_policy(&self) -> super::builder::region_disks::GetIamPolicy {
10567 super::builder::region_disks::GetIamPolicy::new(self.inner.clone())
10568 }
10569
10570 /// Creates a persistent regional disk in the specified project using the data
10571 /// included in the request.
10572 pub fn insert(&self) -> super::builder::region_disks::Insert {
10573 super::builder::region_disks::Insert::new(self.inner.clone())
10574 }
10575
10576 /// Retrieves the list of persistent disks contained within
10577 /// the specified region.
10578 pub fn list(&self) -> super::builder::region_disks::List {
10579 super::builder::region_disks::List::new(self.inner.clone())
10580 }
10581
10582 /// Removes resource policies from a regional disk.
10583 pub fn remove_resource_policies(&self) -> super::builder::region_disks::RemoveResourcePolicies {
10584 super::builder::region_disks::RemoveResourcePolicies::new(self.inner.clone())
10585 }
10586
10587 /// Resizes the specified regional persistent disk.
10588 pub fn resize(&self) -> super::builder::region_disks::Resize {
10589 super::builder::region_disks::Resize::new(self.inner.clone())
10590 }
10591
10592 /// Sets the access control policy on the specified resource.
10593 /// Replaces any existing policy.
10594 pub fn set_iam_policy(&self) -> super::builder::region_disks::SetIamPolicy {
10595 super::builder::region_disks::SetIamPolicy::new(self.inner.clone())
10596 }
10597
10598 /// Sets the labels on the target regional disk.
10599 pub fn set_labels(&self) -> super::builder::region_disks::SetLabels {
10600 super::builder::region_disks::SetLabels::new(self.inner.clone())
10601 }
10602
10603 /// Starts asynchronous replication.
10604 /// Must be invoked on the primary disk.
10605 pub fn start_async_replication(&self) -> super::builder::region_disks::StartAsyncReplication {
10606 super::builder::region_disks::StartAsyncReplication::new(self.inner.clone())
10607 }
10608
10609 /// Stops asynchronous replication.
10610 /// Can be invoked either on the primary or on the secondary disk.
10611 pub fn stop_async_replication(&self) -> super::builder::region_disks::StopAsyncReplication {
10612 super::builder::region_disks::StopAsyncReplication::new(self.inner.clone())
10613 }
10614
10615 /// Stops asynchronous replication for a consistency group of disks.
10616 /// Can be invoked either in the primary or secondary scope.
10617 pub fn stop_group_async_replication(
10618 &self,
10619 ) -> super::builder::region_disks::StopGroupAsyncReplication {
10620 super::builder::region_disks::StopGroupAsyncReplication::new(self.inner.clone())
10621 }
10622
10623 /// Returns permissions that a caller has on the specified resource.
10624 pub fn test_iam_permissions(&self) -> super::builder::region_disks::TestIamPermissions {
10625 super::builder::region_disks::TestIamPermissions::new(self.inner.clone())
10626 }
10627
10628 /// Update the specified disk with the data included in the request. Update is
10629 /// performed only on selected fields included as part of update-mask. Only the
10630 /// following fields can be modified: user_license.
10631 pub fn update(&self) -> super::builder::region_disks::Update {
10632 super::builder::region_disks::Update::new(self.inner.clone())
10633 }
10634
10635 /// Retrieves the specified region-specific Operations resource.
10636 pub fn get_operation(&self) -> super::builder::region_disks::GetOperation {
10637 super::builder::region_disks::GetOperation::new(self.inner.clone())
10638 }
10639}
10640
10641/// Implements a client for the Google Compute Engine API.
10642///
10643/// # Example
10644/// ```
10645/// # tokio_test::block_on(async {
10646/// # use google_cloud_compute_v1::client::RegionHealthCheckServices;
10647/// let client = RegionHealthCheckServices::builder().build().await?;
10648/// // use `client` to make requests to the Google Compute Engine API.
10649/// # gax::client_builder::Result::<()>::Ok(()) });
10650/// ```
10651///
10652/// # Service Description
10653///
10654/// Service for the `regionHealthCheckServices` resource.
10655///
10656/// # Configuration
10657///
10658/// To configure `RegionHealthCheckServices` use the `with_*` methods in the type returned
10659/// by [builder()][RegionHealthCheckServices::builder]. The default configuration should
10660/// work for most applications. Common configuration changes include
10661///
10662/// * [with_endpoint()]: by default this client uses the global default endpoint
10663/// (`https://compute.googleapis.com`). Applications using regional
10664/// endpoints or running in restricted networks (e.g. a network configured
10665// with [Private Google Access with VPC Service Controls]) may want to
10666/// override this default.
10667/// * [with_credentials()]: by default this client uses
10668/// [Application Default Credentials]. Applications using custom
10669/// authentication may need to override this default.
10670///
10671/// [with_endpoint()]: super::builder::region_health_check_services::ClientBuilder::with_endpoint
10672/// [with_credentials()]: super::builder::region_health_check_services::ClientBuilder::credentials
10673/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10674/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10675///
10676/// # Pooling and Cloning
10677///
10678/// `RegionHealthCheckServices` holds a connection pool internally, it is advised to
10679/// create one and the reuse it. You do not need to wrap `RegionHealthCheckServices` in
10680/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10681/// already uses an `Arc` internally.
10682#[cfg(feature = "region-health-check-services")]
10683#[cfg_attr(docsrs, doc(cfg(feature = "region-health-check-services")))]
10684#[derive(Clone, Debug)]
10685pub struct RegionHealthCheckServices {
10686 inner: std::sync::Arc<dyn super::stub::dynamic::RegionHealthCheckServices>,
10687}
10688
10689#[cfg(feature = "region-health-check-services")]
10690impl RegionHealthCheckServices {
10691 /// Returns a builder for [RegionHealthCheckServices].
10692 ///
10693 /// ```
10694 /// # tokio_test::block_on(async {
10695 /// # use google_cloud_compute_v1::client::RegionHealthCheckServices;
10696 /// let client = RegionHealthCheckServices::builder().build().await?;
10697 /// # gax::client_builder::Result::<()>::Ok(()) });
10698 /// ```
10699 pub fn builder() -> super::builder::region_health_check_services::ClientBuilder {
10700 gax::client_builder::internal::new_builder(
10701 super::builder::region_health_check_services::client::Factory,
10702 )
10703 }
10704
10705 /// Creates a new client from the provided stub.
10706 ///
10707 /// The most common case for calling this function is in tests mocking the
10708 /// client's behavior.
10709 pub fn from_stub<T>(stub: T) -> Self
10710 where
10711 T: super::stub::RegionHealthCheckServices + 'static,
10712 {
10713 Self {
10714 inner: std::sync::Arc::new(stub),
10715 }
10716 }
10717
10718 pub(crate) async fn new(
10719 config: gaxi::options::ClientConfig,
10720 ) -> gax::client_builder::Result<Self> {
10721 let inner = Self::build_inner(config).await?;
10722 Ok(Self { inner })
10723 }
10724
10725 async fn build_inner(
10726 conf: gaxi::options::ClientConfig,
10727 ) -> gax::client_builder::Result<
10728 std::sync::Arc<dyn super::stub::dynamic::RegionHealthCheckServices>,
10729 > {
10730 if gaxi::options::tracing_enabled(&conf) {
10731 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10732 }
10733 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10734 }
10735
10736 async fn build_transport(
10737 conf: gaxi::options::ClientConfig,
10738 ) -> gax::client_builder::Result<impl super::stub::RegionHealthCheckServices> {
10739 super::transport::RegionHealthCheckServices::new(conf).await
10740 }
10741
10742 async fn build_with_tracing(
10743 conf: gaxi::options::ClientConfig,
10744 ) -> gax::client_builder::Result<impl super::stub::RegionHealthCheckServices> {
10745 Self::build_transport(conf)
10746 .await
10747 .map(super::tracing::RegionHealthCheckServices::new)
10748 }
10749
10750 /// Deletes the specified regional HealthCheckService.
10751 pub fn delete(&self) -> super::builder::region_health_check_services::Delete {
10752 super::builder::region_health_check_services::Delete::new(self.inner.clone())
10753 }
10754
10755 /// Returns the specified regional HealthCheckService resource.
10756 pub fn get(&self) -> super::builder::region_health_check_services::Get {
10757 super::builder::region_health_check_services::Get::new(self.inner.clone())
10758 }
10759
10760 /// Creates a regional HealthCheckService resource in the
10761 /// specified project and region using the data included in the request.
10762 pub fn insert(&self) -> super::builder::region_health_check_services::Insert {
10763 super::builder::region_health_check_services::Insert::new(self.inner.clone())
10764 }
10765
10766 /// Lists all the HealthCheckService resources that have been
10767 /// configured for the specified project in the given region.
10768 pub fn list(&self) -> super::builder::region_health_check_services::List {
10769 super::builder::region_health_check_services::List::new(self.inner.clone())
10770 }
10771
10772 /// Updates the specified regional HealthCheckService resource
10773 /// with the data included in the request. This method supportsPATCH
10774 /// semantics and uses theJSON merge
10775 /// patch format and processing rules.
10776 pub fn patch(&self) -> super::builder::region_health_check_services::Patch {
10777 super::builder::region_health_check_services::Patch::new(self.inner.clone())
10778 }
10779
10780 /// Retrieves the specified region-specific Operations resource.
10781 pub fn get_operation(&self) -> super::builder::region_health_check_services::GetOperation {
10782 super::builder::region_health_check_services::GetOperation::new(self.inner.clone())
10783 }
10784}
10785
10786/// Implements a client for the Google Compute Engine API.
10787///
10788/// # Example
10789/// ```
10790/// # tokio_test::block_on(async {
10791/// # use google_cloud_compute_v1::client::RegionHealthChecks;
10792/// let client = RegionHealthChecks::builder().build().await?;
10793/// // use `client` to make requests to the Google Compute Engine API.
10794/// # gax::client_builder::Result::<()>::Ok(()) });
10795/// ```
10796///
10797/// # Service Description
10798///
10799/// Service for the `regionHealthChecks` resource.
10800///
10801/// # Configuration
10802///
10803/// To configure `RegionHealthChecks` use the `with_*` methods in the type returned
10804/// by [builder()][RegionHealthChecks::builder]. The default configuration should
10805/// work for most applications. Common configuration changes include
10806///
10807/// * [with_endpoint()]: by default this client uses the global default endpoint
10808/// (`https://compute.googleapis.com`). Applications using regional
10809/// endpoints or running in restricted networks (e.g. a network configured
10810// with [Private Google Access with VPC Service Controls]) may want to
10811/// override this default.
10812/// * [with_credentials()]: by default this client uses
10813/// [Application Default Credentials]. Applications using custom
10814/// authentication may need to override this default.
10815///
10816/// [with_endpoint()]: super::builder::region_health_checks::ClientBuilder::with_endpoint
10817/// [with_credentials()]: super::builder::region_health_checks::ClientBuilder::credentials
10818/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10819/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10820///
10821/// # Pooling and Cloning
10822///
10823/// `RegionHealthChecks` holds a connection pool internally, it is advised to
10824/// create one and the reuse it. You do not need to wrap `RegionHealthChecks` in
10825/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10826/// already uses an `Arc` internally.
10827#[cfg(feature = "region-health-checks")]
10828#[cfg_attr(docsrs, doc(cfg(feature = "region-health-checks")))]
10829#[derive(Clone, Debug)]
10830pub struct RegionHealthChecks {
10831 inner: std::sync::Arc<dyn super::stub::dynamic::RegionHealthChecks>,
10832}
10833
10834#[cfg(feature = "region-health-checks")]
10835impl RegionHealthChecks {
10836 /// Returns a builder for [RegionHealthChecks].
10837 ///
10838 /// ```
10839 /// # tokio_test::block_on(async {
10840 /// # use google_cloud_compute_v1::client::RegionHealthChecks;
10841 /// let client = RegionHealthChecks::builder().build().await?;
10842 /// # gax::client_builder::Result::<()>::Ok(()) });
10843 /// ```
10844 pub fn builder() -> super::builder::region_health_checks::ClientBuilder {
10845 gax::client_builder::internal::new_builder(
10846 super::builder::region_health_checks::client::Factory,
10847 )
10848 }
10849
10850 /// Creates a new client from the provided stub.
10851 ///
10852 /// The most common case for calling this function is in tests mocking the
10853 /// client's behavior.
10854 pub fn from_stub<T>(stub: T) -> Self
10855 where
10856 T: super::stub::RegionHealthChecks + 'static,
10857 {
10858 Self {
10859 inner: std::sync::Arc::new(stub),
10860 }
10861 }
10862
10863 pub(crate) async fn new(
10864 config: gaxi::options::ClientConfig,
10865 ) -> gax::client_builder::Result<Self> {
10866 let inner = Self::build_inner(config).await?;
10867 Ok(Self { inner })
10868 }
10869
10870 async fn build_inner(
10871 conf: gaxi::options::ClientConfig,
10872 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionHealthChecks>>
10873 {
10874 if gaxi::options::tracing_enabled(&conf) {
10875 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10876 }
10877 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10878 }
10879
10880 async fn build_transport(
10881 conf: gaxi::options::ClientConfig,
10882 ) -> gax::client_builder::Result<impl super::stub::RegionHealthChecks> {
10883 super::transport::RegionHealthChecks::new(conf).await
10884 }
10885
10886 async fn build_with_tracing(
10887 conf: gaxi::options::ClientConfig,
10888 ) -> gax::client_builder::Result<impl super::stub::RegionHealthChecks> {
10889 Self::build_transport(conf)
10890 .await
10891 .map(super::tracing::RegionHealthChecks::new)
10892 }
10893
10894 /// Deletes the specified HealthCheck resource.
10895 pub fn delete(&self) -> super::builder::region_health_checks::Delete {
10896 super::builder::region_health_checks::Delete::new(self.inner.clone())
10897 }
10898
10899 /// Returns the specified HealthCheck resource.
10900 pub fn get(&self) -> super::builder::region_health_checks::Get {
10901 super::builder::region_health_checks::Get::new(self.inner.clone())
10902 }
10903
10904 /// Creates a HealthCheck resource in the specified project using the data
10905 /// included in the request.
10906 pub fn insert(&self) -> super::builder::region_health_checks::Insert {
10907 super::builder::region_health_checks::Insert::new(self.inner.clone())
10908 }
10909
10910 /// Retrieves the list of HealthCheck resources available to the specified
10911 /// project.
10912 pub fn list(&self) -> super::builder::region_health_checks::List {
10913 super::builder::region_health_checks::List::new(self.inner.clone())
10914 }
10915
10916 /// Updates a HealthCheck resource in the specified project using the data
10917 /// included in the request. This method supportsPATCH
10918 /// semantics and uses theJSON merge
10919 /// patch format and processing rules.
10920 pub fn patch(&self) -> super::builder::region_health_checks::Patch {
10921 super::builder::region_health_checks::Patch::new(self.inner.clone())
10922 }
10923
10924 /// Updates a HealthCheck resource in the specified project using the data
10925 /// included in the request.
10926 pub fn update(&self) -> super::builder::region_health_checks::Update {
10927 super::builder::region_health_checks::Update::new(self.inner.clone())
10928 }
10929
10930 /// Retrieves the specified region-specific Operations resource.
10931 pub fn get_operation(&self) -> super::builder::region_health_checks::GetOperation {
10932 super::builder::region_health_checks::GetOperation::new(self.inner.clone())
10933 }
10934}
10935
10936/// Implements a client for the Google Compute Engine API.
10937///
10938/// # Example
10939/// ```
10940/// # tokio_test::block_on(async {
10941/// # use google_cloud_compute_v1::client::RegionInstanceGroupManagers;
10942/// let client = RegionInstanceGroupManagers::builder().build().await?;
10943/// // use `client` to make requests to the Google Compute Engine API.
10944/// # gax::client_builder::Result::<()>::Ok(()) });
10945/// ```
10946///
10947/// # Service Description
10948///
10949/// Service for the `regionInstanceGroupManagers` resource.
10950///
10951/// # Configuration
10952///
10953/// To configure `RegionInstanceGroupManagers` use the `with_*` methods in the type returned
10954/// by [builder()][RegionInstanceGroupManagers::builder]. The default configuration should
10955/// work for most applications. Common configuration changes include
10956///
10957/// * [with_endpoint()]: by default this client uses the global default endpoint
10958/// (`https://compute.googleapis.com`). Applications using regional
10959/// endpoints or running in restricted networks (e.g. a network configured
10960// with [Private Google Access with VPC Service Controls]) may want to
10961/// override this default.
10962/// * [with_credentials()]: by default this client uses
10963/// [Application Default Credentials]. Applications using custom
10964/// authentication may need to override this default.
10965///
10966/// [with_endpoint()]: super::builder::region_instance_group_managers::ClientBuilder::with_endpoint
10967/// [with_credentials()]: super::builder::region_instance_group_managers::ClientBuilder::credentials
10968/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10969/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10970///
10971/// # Pooling and Cloning
10972///
10973/// `RegionInstanceGroupManagers` holds a connection pool internally, it is advised to
10974/// create one and the reuse it. You do not need to wrap `RegionInstanceGroupManagers` in
10975/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10976/// already uses an `Arc` internally.
10977#[cfg(feature = "region-instance-group-managers")]
10978#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-group-managers")))]
10979#[derive(Clone, Debug)]
10980pub struct RegionInstanceGroupManagers {
10981 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroupManagers>,
10982}
10983
10984#[cfg(feature = "region-instance-group-managers")]
10985impl RegionInstanceGroupManagers {
10986 /// Returns a builder for [RegionInstanceGroupManagers].
10987 ///
10988 /// ```
10989 /// # tokio_test::block_on(async {
10990 /// # use google_cloud_compute_v1::client::RegionInstanceGroupManagers;
10991 /// let client = RegionInstanceGroupManagers::builder().build().await?;
10992 /// # gax::client_builder::Result::<()>::Ok(()) });
10993 /// ```
10994 pub fn builder() -> super::builder::region_instance_group_managers::ClientBuilder {
10995 gax::client_builder::internal::new_builder(
10996 super::builder::region_instance_group_managers::client::Factory,
10997 )
10998 }
10999
11000 /// Creates a new client from the provided stub.
11001 ///
11002 /// The most common case for calling this function is in tests mocking the
11003 /// client's behavior.
11004 pub fn from_stub<T>(stub: T) -> Self
11005 where
11006 T: super::stub::RegionInstanceGroupManagers + 'static,
11007 {
11008 Self {
11009 inner: std::sync::Arc::new(stub),
11010 }
11011 }
11012
11013 pub(crate) async fn new(
11014 config: gaxi::options::ClientConfig,
11015 ) -> gax::client_builder::Result<Self> {
11016 let inner = Self::build_inner(config).await?;
11017 Ok(Self { inner })
11018 }
11019
11020 async fn build_inner(
11021 conf: gaxi::options::ClientConfig,
11022 ) -> gax::client_builder::Result<
11023 std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroupManagers>,
11024 > {
11025 if gaxi::options::tracing_enabled(&conf) {
11026 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11027 }
11028 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11029 }
11030
11031 async fn build_transport(
11032 conf: gaxi::options::ClientConfig,
11033 ) -> gax::client_builder::Result<impl super::stub::RegionInstanceGroupManagers> {
11034 super::transport::RegionInstanceGroupManagers::new(conf).await
11035 }
11036
11037 async fn build_with_tracing(
11038 conf: gaxi::options::ClientConfig,
11039 ) -> gax::client_builder::Result<impl super::stub::RegionInstanceGroupManagers> {
11040 Self::build_transport(conf)
11041 .await
11042 .map(super::tracing::RegionInstanceGroupManagers::new)
11043 }
11044
11045 /// Flags the specified instances to be immediately removed from the managed
11046 /// instance group. Abandoning an instance does not delete the
11047 /// instance, but it does remove the instance from any target pools that are
11048 /// applied by the managed instance group. This method reduces thetargetSize of the managed instance group by the
11049 /// number of instances that you abandon. This operation is marked asDONE when the action is scheduled even if the instances have
11050 /// not yet been removed from the group. You must separately verify the
11051 /// status of the abandoning action with thelistmanagedinstances
11052 /// method.
11053 ///
11054 /// If the group is part of a backend
11055 /// service that has enabled
11056 /// connection draining, it can take up to 60 seconds after the connection
11057 /// draining duration has elapsed before the VM instance is removed or deleted.
11058 ///
11059 /// You can specify a maximum of 1000 instances with this method per request.
11060 pub fn abandon_instances(
11061 &self,
11062 ) -> super::builder::region_instance_group_managers::AbandonInstances {
11063 super::builder::region_instance_group_managers::AbandonInstances::new(self.inner.clone())
11064 }
11065
11066 /// Apply updates to selected instances the managed instance group.
11067 pub fn apply_updates_to_instances(
11068 &self,
11069 ) -> super::builder::region_instance_group_managers::ApplyUpdatesToInstances {
11070 super::builder::region_instance_group_managers::ApplyUpdatesToInstances::new(
11071 self.inner.clone(),
11072 )
11073 }
11074
11075 /// Creates instances with per-instance configurations in this regional managed
11076 /// instance group. Instances are created using the current instance template.
11077 /// The create instances operation is marked DONE if
11078 /// the createInstances request is successful. The underlying
11079 /// actions take additional time. You must separately verify the status of thecreating or actions with the listmanagedinstances
11080 /// method.
11081 pub fn create_instances(
11082 &self,
11083 ) -> super::builder::region_instance_group_managers::CreateInstances {
11084 super::builder::region_instance_group_managers::CreateInstances::new(self.inner.clone())
11085 }
11086
11087 /// Deletes the specified managed instance group and all of the instances
11088 /// in that group.
11089 pub fn delete(&self) -> super::builder::region_instance_group_managers::Delete {
11090 super::builder::region_instance_group_managers::Delete::new(self.inner.clone())
11091 }
11092
11093 /// Flags the specified instances in the managed instance group to be
11094 /// immediately deleted. The instances are also removed from any target
11095 /// pools of which they were a member. This method reduces thetargetSize of the managed instance group by the number of
11096 /// instances that you delete.
11097 /// The deleteInstances operation is marked DONE if
11098 /// the deleteInstances request is successful. The underlying
11099 /// actions take additional time. You must separately verify the status of thedeleting action with thelistmanagedinstances
11100 /// method.
11101 ///
11102 /// If the group is part of a backend
11103 /// service that has enabled
11104 /// connection draining, it can take up to 60 seconds after the connection
11105 /// draining duration has elapsed before the VM instance is removed or deleted.
11106 ///
11107 /// You can specify a maximum of 1000 instances with this method per request.
11108 pub fn delete_instances(
11109 &self,
11110 ) -> super::builder::region_instance_group_managers::DeleteInstances {
11111 super::builder::region_instance_group_managers::DeleteInstances::new(self.inner.clone())
11112 }
11113
11114 /// Deletes selected per-instance configurations for the managed instance
11115 /// group.
11116 pub fn delete_per_instance_configs(
11117 &self,
11118 ) -> super::builder::region_instance_group_managers::DeletePerInstanceConfigs {
11119 super::builder::region_instance_group_managers::DeletePerInstanceConfigs::new(
11120 self.inner.clone(),
11121 )
11122 }
11123
11124 /// Returns all of the details about the specified managed instance group.
11125 pub fn get(&self) -> super::builder::region_instance_group_managers::Get {
11126 super::builder::region_instance_group_managers::Get::new(self.inner.clone())
11127 }
11128
11129 /// Creates a managed instance group using the information that you specify
11130 /// in the request. After the group is created, instances in the group are
11131 /// created using the specified instance template.
11132 /// This operation is marked as DONE when the group is created
11133 /// even if the instances in the group have not yet been created. You must
11134 /// separately verify the status of the individual instances with thelistmanagedinstances
11135 /// method.
11136 ///
11137 /// A regional managed instance group can contain up to 2000 instances.
11138 pub fn insert(&self) -> super::builder::region_instance_group_managers::Insert {
11139 super::builder::region_instance_group_managers::Insert::new(self.inner.clone())
11140 }
11141
11142 /// Retrieves the list of managed instance groups that are contained
11143 /// within the specified region.
11144 pub fn list(&self) -> super::builder::region_instance_group_managers::List {
11145 super::builder::region_instance_group_managers::List::new(self.inner.clone())
11146 }
11147
11148 /// Lists all errors thrown by actions on instances for a given regional
11149 /// managed instance group. The filter andorderBy query parameters are not supported.
11150 pub fn list_errors(&self) -> super::builder::region_instance_group_managers::ListErrors {
11151 super::builder::region_instance_group_managers::ListErrors::new(self.inner.clone())
11152 }
11153
11154 /// Lists the instances in the managed instance group and instances that are
11155 /// scheduled to be created. The list includes any current actions
11156 /// that the group has scheduled for its instances. The orderBy
11157 /// query parameter is not supported. The `pageToken` query parameter is
11158 /// supported only if the group's `listManagedInstancesResults` field is set
11159 /// to `PAGINATED`.
11160 pub fn list_managed_instances(
11161 &self,
11162 ) -> super::builder::region_instance_group_managers::ListManagedInstances {
11163 super::builder::region_instance_group_managers::ListManagedInstances::new(
11164 self.inner.clone(),
11165 )
11166 }
11167
11168 /// Lists all of the per-instance configurations defined for the managed
11169 /// instance group. The orderBy query parameter is not supported.
11170 pub fn list_per_instance_configs(
11171 &self,
11172 ) -> super::builder::region_instance_group_managers::ListPerInstanceConfigs {
11173 super::builder::region_instance_group_managers::ListPerInstanceConfigs::new(
11174 self.inner.clone(),
11175 )
11176 }
11177
11178 /// Updates a managed instance group using the information that you specify
11179 /// in the request.
11180 /// This operation is marked as DONE when the group is patched
11181 /// even if the instances in the group are still in the process of being
11182 /// patched. You must separately verify the status of the individual instances
11183 /// with the listmanagedinstances
11184 /// method. This method supportsPATCH
11185 /// semantics and uses theJSON merge
11186 /// patch format and processing rules.
11187 ///
11188 /// If you update your group to specify a new template or instance
11189 /// configuration, it's possible that your intended specification for each VM
11190 /// in the group is different from the current state of that VM. To learn how
11191 /// to apply an updated configuration to the VMs in a MIG, seeUpdating instances in
11192 /// a MIG.
11193 pub fn patch(&self) -> super::builder::region_instance_group_managers::Patch {
11194 super::builder::region_instance_group_managers::Patch::new(self.inner.clone())
11195 }
11196
11197 /// Inserts or patches per-instance configurations for the managed instance
11198 /// group. perInstanceConfig.name serves as a key used to
11199 /// distinguish whether to perform insert or patch.
11200 pub fn patch_per_instance_configs(
11201 &self,
11202 ) -> super::builder::region_instance_group_managers::PatchPerInstanceConfigs {
11203 super::builder::region_instance_group_managers::PatchPerInstanceConfigs::new(
11204 self.inner.clone(),
11205 )
11206 }
11207
11208 /// Flags the specified VM instances in the managed instance group to be
11209 /// immediately recreated. Each instance is recreated using the group's current
11210 /// configuration. This operation is marked as DONE when the flag
11211 /// is set even if the instances have not yet been recreated. You must
11212 /// separately verify the status of each instance by checking itscurrentAction field; for more information, see Checking
11213 /// the status of managed instances.
11214 ///
11215 /// If the group is part of a backend
11216 /// service that has enabled
11217 /// connection draining, it can take up to 60 seconds after the connection
11218 /// draining duration has elapsed before the VM instance is removed or deleted.
11219 ///
11220 /// You can specify a maximum of 1000 instances with this method per request.
11221 pub fn recreate_instances(
11222 &self,
11223 ) -> super::builder::region_instance_group_managers::RecreateInstances {
11224 super::builder::region_instance_group_managers::RecreateInstances::new(self.inner.clone())
11225 }
11226
11227 /// Changes the intended size of the managed instance group. If you increase
11228 /// the size, the group creates new instances using the current instance
11229 /// template. If you decrease the size, the group deletes one or more
11230 /// instances.
11231 ///
11232 /// The resize operation is marked DONE if theresize request is successful. The underlying actions take
11233 /// additional time. You must separately verify the status of thecreating or deleting actions with thelistmanagedinstances
11234 /// method.
11235 ///
11236 /// If the group is part of a backend
11237 /// service that has enabled
11238 /// connection draining, it can take up to 60 seconds after the connection
11239 /// draining duration has elapsed before the VM instance is removed or deleted.
11240 pub fn resize(&self) -> super::builder::region_instance_group_managers::Resize {
11241 super::builder::region_instance_group_managers::Resize::new(self.inner.clone())
11242 }
11243
11244 /// Flags the specified instances in the managed instance group to be
11245 /// resumed. This method increases thetargetSize and decreases the targetSuspendedSize
11246 /// of the managed instance group by the number of instances that you resume.
11247 /// The resumeInstances operation is marked DONE if
11248 /// the resumeInstances request is successful. The underlying
11249 /// actions take additional time. You must separately verify the status of theRESUMING action with thelistmanagedinstances
11250 /// method.
11251 ///
11252 /// In this request, you can only specify instances that are suspended. For
11253 /// example, if an instance was previously suspended using the suspendInstances
11254 /// method, it can be resumed using the resumeInstances method.
11255 ///
11256 /// If a health check is attached to the managed instance group, the specified
11257 /// instances will be verified as healthy after they are resumed.
11258 ///
11259 /// You can specify a maximum of 1000 instances with this method per request.
11260 pub fn resume_instances(
11261 &self,
11262 ) -> super::builder::region_instance_group_managers::ResumeInstances {
11263 super::builder::region_instance_group_managers::ResumeInstances::new(self.inner.clone())
11264 }
11265
11266 /// Sets the instance template to use when creating new instances or recreating
11267 /// instances in this group. Existing instances are not affected.
11268 pub fn set_instance_template(
11269 &self,
11270 ) -> super::builder::region_instance_group_managers::SetInstanceTemplate {
11271 super::builder::region_instance_group_managers::SetInstanceTemplate::new(self.inner.clone())
11272 }
11273
11274 /// Modifies the target pools to which all new instances in this group are
11275 /// assigned. Existing instances in the group are not affected.
11276 pub fn set_target_pools(
11277 &self,
11278 ) -> super::builder::region_instance_group_managers::SetTargetPools {
11279 super::builder::region_instance_group_managers::SetTargetPools::new(self.inner.clone())
11280 }
11281
11282 /// Flags the specified instances in the managed instance group to be
11283 /// started. This method increases thetargetSize and decreases the targetStoppedSize
11284 /// of the managed instance group by the number of instances that you start.
11285 /// The startInstances operation is marked DONE if
11286 /// the startInstances request is successful. The underlying
11287 /// actions take additional time. You must separately verify the status of theSTARTING action with thelistmanagedinstances
11288 /// method.
11289 ///
11290 /// In this request, you can only specify instances that are stopped. For
11291 /// example, if an instance was previously stopped using the stopInstances
11292 /// method, it can be started using the startInstances method.
11293 ///
11294 /// If a health check is attached to the managed instance group, the specified
11295 /// instances will be verified as healthy after they are started.
11296 ///
11297 /// You can specify a maximum of 1000 instances with this method per request.
11298 pub fn start_instances(
11299 &self,
11300 ) -> super::builder::region_instance_group_managers::StartInstances {
11301 super::builder::region_instance_group_managers::StartInstances::new(self.inner.clone())
11302 }
11303
11304 /// Flags the specified instances in the managed instance group to be
11305 /// immediately stopped. You can only specify instances that are running in
11306 /// this request. This method reduces thetargetSize and increases the targetStoppedSize
11307 /// of the managed instance group by the number of instances that you stop.
11308 /// The stopInstances operation is marked DONE if
11309 /// the stopInstances request is successful. The underlying
11310 /// actions take additional time. You must separately verify the status of theSTOPPING action with thelistmanagedinstances
11311 /// method.
11312 ///
11313 /// If the standbyPolicy.initialDelaySec field is set, the group
11314 /// delays stopping the instances until initialDelaySec have
11315 /// passed from instance.creationTimestamp (that is, when the
11316 /// instance was created). This delay gives your application time to
11317 /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
11318 /// will be zero delay.
11319 ///
11320 /// If the group is part of a backend
11321 /// service that has enabled
11322 /// connection draining, it can take up to 60 seconds after the connection
11323 /// draining duration has elapsed before the VM instance is stopped.
11324 ///
11325 /// Stopped instances can be started using the startInstances
11326 /// method.
11327 ///
11328 /// You can specify a maximum of 1000 instances with this method per request.
11329 pub fn stop_instances(&self) -> super::builder::region_instance_group_managers::StopInstances {
11330 super::builder::region_instance_group_managers::StopInstances::new(self.inner.clone())
11331 }
11332
11333 /// Flags the specified instances in the managed instance group to be
11334 /// immediately suspended. You can only specify instances that are running in
11335 /// this request. This method reduces thetargetSize and increases the targetSuspendedSize
11336 /// of the managed instance group by the number of instances that you suspend.
11337 /// The suspendInstances operation is marked DONE if
11338 /// the suspendInstances request is successful. The underlying
11339 /// actions take additional time. You must separately verify the status of theSUSPENDING action with thelistmanagedinstances
11340 /// method.
11341 ///
11342 /// If the standbyPolicy.initialDelaySec field is set, the group
11343 /// delays suspension of the instances until initialDelaySec have
11344 /// passed from instance.creationTimestamp (that is, when the
11345 /// instance was created). This delay gives your application time to
11346 /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
11347 /// will be zero delay.
11348 ///
11349 /// If the group is part of a backend
11350 /// service that has enabled
11351 /// connection draining, it can take up to 60 seconds after the connection
11352 /// draining duration has elapsed before the VM instance is suspended.
11353 ///
11354 /// Suspended instances can be resumed using the resumeInstances
11355 /// method.
11356 ///
11357 /// You can specify a maximum of 1000 instances with this method per request.
11358 pub fn suspend_instances(
11359 &self,
11360 ) -> super::builder::region_instance_group_managers::SuspendInstances {
11361 super::builder::region_instance_group_managers::SuspendInstances::new(self.inner.clone())
11362 }
11363
11364 /// Inserts or updates per-instance configurations for the managed instance
11365 /// group. perInstanceConfig.name serves as a key used to
11366 /// distinguish whether to perform insert or patch.
11367 pub fn update_per_instance_configs(
11368 &self,
11369 ) -> super::builder::region_instance_group_managers::UpdatePerInstanceConfigs {
11370 super::builder::region_instance_group_managers::UpdatePerInstanceConfigs::new(
11371 self.inner.clone(),
11372 )
11373 }
11374
11375 /// Retrieves the specified region-specific Operations resource.
11376 pub fn get_operation(&self) -> super::builder::region_instance_group_managers::GetOperation {
11377 super::builder::region_instance_group_managers::GetOperation::new(self.inner.clone())
11378 }
11379}
11380
11381/// Implements a client for the Google Compute Engine API.
11382///
11383/// # Example
11384/// ```
11385/// # tokio_test::block_on(async {
11386/// # use google_cloud_compute_v1::client::RegionInstanceGroups;
11387/// let client = RegionInstanceGroups::builder().build().await?;
11388/// // use `client` to make requests to the Google Compute Engine API.
11389/// # gax::client_builder::Result::<()>::Ok(()) });
11390/// ```
11391///
11392/// # Service Description
11393///
11394/// Service for the `regionInstanceGroups` resource.
11395///
11396/// # Configuration
11397///
11398/// To configure `RegionInstanceGroups` use the `with_*` methods in the type returned
11399/// by [builder()][RegionInstanceGroups::builder]. The default configuration should
11400/// work for most applications. Common configuration changes include
11401///
11402/// * [with_endpoint()]: by default this client uses the global default endpoint
11403/// (`https://compute.googleapis.com`). Applications using regional
11404/// endpoints or running in restricted networks (e.g. a network configured
11405// with [Private Google Access with VPC Service Controls]) may want to
11406/// override this default.
11407/// * [with_credentials()]: by default this client uses
11408/// [Application Default Credentials]. Applications using custom
11409/// authentication may need to override this default.
11410///
11411/// [with_endpoint()]: super::builder::region_instance_groups::ClientBuilder::with_endpoint
11412/// [with_credentials()]: super::builder::region_instance_groups::ClientBuilder::credentials
11413/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11414/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11415///
11416/// # Pooling and Cloning
11417///
11418/// `RegionInstanceGroups` holds a connection pool internally, it is advised to
11419/// create one and the reuse it. You do not need to wrap `RegionInstanceGroups` in
11420/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11421/// already uses an `Arc` internally.
11422#[cfg(feature = "region-instance-groups")]
11423#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-groups")))]
11424#[derive(Clone, Debug)]
11425pub struct RegionInstanceGroups {
11426 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroups>,
11427}
11428
11429#[cfg(feature = "region-instance-groups")]
11430impl RegionInstanceGroups {
11431 /// Returns a builder for [RegionInstanceGroups].
11432 ///
11433 /// ```
11434 /// # tokio_test::block_on(async {
11435 /// # use google_cloud_compute_v1::client::RegionInstanceGroups;
11436 /// let client = RegionInstanceGroups::builder().build().await?;
11437 /// # gax::client_builder::Result::<()>::Ok(()) });
11438 /// ```
11439 pub fn builder() -> super::builder::region_instance_groups::ClientBuilder {
11440 gax::client_builder::internal::new_builder(
11441 super::builder::region_instance_groups::client::Factory,
11442 )
11443 }
11444
11445 /// Creates a new client from the provided stub.
11446 ///
11447 /// The most common case for calling this function is in tests mocking the
11448 /// client's behavior.
11449 pub fn from_stub<T>(stub: T) -> Self
11450 where
11451 T: super::stub::RegionInstanceGroups + 'static,
11452 {
11453 Self {
11454 inner: std::sync::Arc::new(stub),
11455 }
11456 }
11457
11458 pub(crate) async fn new(
11459 config: gaxi::options::ClientConfig,
11460 ) -> gax::client_builder::Result<Self> {
11461 let inner = Self::build_inner(config).await?;
11462 Ok(Self { inner })
11463 }
11464
11465 async fn build_inner(
11466 conf: gaxi::options::ClientConfig,
11467 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroups>>
11468 {
11469 if gaxi::options::tracing_enabled(&conf) {
11470 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11471 }
11472 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11473 }
11474
11475 async fn build_transport(
11476 conf: gaxi::options::ClientConfig,
11477 ) -> gax::client_builder::Result<impl super::stub::RegionInstanceGroups> {
11478 super::transport::RegionInstanceGroups::new(conf).await
11479 }
11480
11481 async fn build_with_tracing(
11482 conf: gaxi::options::ClientConfig,
11483 ) -> gax::client_builder::Result<impl super::stub::RegionInstanceGroups> {
11484 Self::build_transport(conf)
11485 .await
11486 .map(super::tracing::RegionInstanceGroups::new)
11487 }
11488
11489 /// Returns the specified instance group resource.
11490 pub fn get(&self) -> super::builder::region_instance_groups::Get {
11491 super::builder::region_instance_groups::Get::new(self.inner.clone())
11492 }
11493
11494 /// Retrieves the list of instance group resources contained within
11495 /// the specified region.
11496 pub fn list(&self) -> super::builder::region_instance_groups::List {
11497 super::builder::region_instance_groups::List::new(self.inner.clone())
11498 }
11499
11500 /// Lists the instances in the specified instance group and displays
11501 /// information about the named ports. Depending on the specified options, this
11502 /// method can list all instances or only the instances that are running.
11503 /// The orderBy query parameter is not supported.
11504 pub fn list_instances(&self) -> super::builder::region_instance_groups::ListInstances {
11505 super::builder::region_instance_groups::ListInstances::new(self.inner.clone())
11506 }
11507
11508 /// Sets the named ports for the specified regional instance group.
11509 pub fn set_named_ports(&self) -> super::builder::region_instance_groups::SetNamedPorts {
11510 super::builder::region_instance_groups::SetNamedPorts::new(self.inner.clone())
11511 }
11512
11513 /// Returns permissions that a caller has on the specified resource.
11514 pub fn test_iam_permissions(
11515 &self,
11516 ) -> super::builder::region_instance_groups::TestIamPermissions {
11517 super::builder::region_instance_groups::TestIamPermissions::new(self.inner.clone())
11518 }
11519
11520 /// Retrieves the specified region-specific Operations resource.
11521 pub fn get_operation(&self) -> super::builder::region_instance_groups::GetOperation {
11522 super::builder::region_instance_groups::GetOperation::new(self.inner.clone())
11523 }
11524}
11525
11526/// Implements a client for the Google Compute Engine API.
11527///
11528/// # Example
11529/// ```
11530/// # tokio_test::block_on(async {
11531/// # use google_cloud_compute_v1::client::RegionInstanceTemplates;
11532/// let client = RegionInstanceTemplates::builder().build().await?;
11533/// // use `client` to make requests to the Google Compute Engine API.
11534/// # gax::client_builder::Result::<()>::Ok(()) });
11535/// ```
11536///
11537/// # Service Description
11538///
11539/// Service for the `regionInstanceTemplates` resource.
11540///
11541/// # Configuration
11542///
11543/// To configure `RegionInstanceTemplates` use the `with_*` methods in the type returned
11544/// by [builder()][RegionInstanceTemplates::builder]. The default configuration should
11545/// work for most applications. Common configuration changes include
11546///
11547/// * [with_endpoint()]: by default this client uses the global default endpoint
11548/// (`https://compute.googleapis.com`). Applications using regional
11549/// endpoints or running in restricted networks (e.g. a network configured
11550// with [Private Google Access with VPC Service Controls]) may want to
11551/// override this default.
11552/// * [with_credentials()]: by default this client uses
11553/// [Application Default Credentials]. Applications using custom
11554/// authentication may need to override this default.
11555///
11556/// [with_endpoint()]: super::builder::region_instance_templates::ClientBuilder::with_endpoint
11557/// [with_credentials()]: super::builder::region_instance_templates::ClientBuilder::credentials
11558/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11559/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11560///
11561/// # Pooling and Cloning
11562///
11563/// `RegionInstanceTemplates` holds a connection pool internally, it is advised to
11564/// create one and the reuse it. You do not need to wrap `RegionInstanceTemplates` in
11565/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11566/// already uses an `Arc` internally.
11567#[cfg(feature = "region-instance-templates")]
11568#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-templates")))]
11569#[derive(Clone, Debug)]
11570pub struct RegionInstanceTemplates {
11571 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceTemplates>,
11572}
11573
11574#[cfg(feature = "region-instance-templates")]
11575impl RegionInstanceTemplates {
11576 /// Returns a builder for [RegionInstanceTemplates].
11577 ///
11578 /// ```
11579 /// # tokio_test::block_on(async {
11580 /// # use google_cloud_compute_v1::client::RegionInstanceTemplates;
11581 /// let client = RegionInstanceTemplates::builder().build().await?;
11582 /// # gax::client_builder::Result::<()>::Ok(()) });
11583 /// ```
11584 pub fn builder() -> super::builder::region_instance_templates::ClientBuilder {
11585 gax::client_builder::internal::new_builder(
11586 super::builder::region_instance_templates::client::Factory,
11587 )
11588 }
11589
11590 /// Creates a new client from the provided stub.
11591 ///
11592 /// The most common case for calling this function is in tests mocking the
11593 /// client's behavior.
11594 pub fn from_stub<T>(stub: T) -> Self
11595 where
11596 T: super::stub::RegionInstanceTemplates + 'static,
11597 {
11598 Self {
11599 inner: std::sync::Arc::new(stub),
11600 }
11601 }
11602
11603 pub(crate) async fn new(
11604 config: gaxi::options::ClientConfig,
11605 ) -> gax::client_builder::Result<Self> {
11606 let inner = Self::build_inner(config).await?;
11607 Ok(Self { inner })
11608 }
11609
11610 async fn build_inner(
11611 conf: gaxi::options::ClientConfig,
11612 ) -> gax::client_builder::Result<
11613 std::sync::Arc<dyn super::stub::dynamic::RegionInstanceTemplates>,
11614 > {
11615 if gaxi::options::tracing_enabled(&conf) {
11616 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11617 }
11618 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11619 }
11620
11621 async fn build_transport(
11622 conf: gaxi::options::ClientConfig,
11623 ) -> gax::client_builder::Result<impl super::stub::RegionInstanceTemplates> {
11624 super::transport::RegionInstanceTemplates::new(conf).await
11625 }
11626
11627 async fn build_with_tracing(
11628 conf: gaxi::options::ClientConfig,
11629 ) -> gax::client_builder::Result<impl super::stub::RegionInstanceTemplates> {
11630 Self::build_transport(conf)
11631 .await
11632 .map(super::tracing::RegionInstanceTemplates::new)
11633 }
11634
11635 /// Deletes the specified instance template. Deleting an instance template is
11636 /// permanent and cannot be undone.
11637 pub fn delete(&self) -> super::builder::region_instance_templates::Delete {
11638 super::builder::region_instance_templates::Delete::new(self.inner.clone())
11639 }
11640
11641 /// Returns the specified instance template.
11642 pub fn get(&self) -> super::builder::region_instance_templates::Get {
11643 super::builder::region_instance_templates::Get::new(self.inner.clone())
11644 }
11645
11646 /// Creates an instance template in the specified project and region using the
11647 /// global instance template whose URL is included in the request.
11648 pub fn insert(&self) -> super::builder::region_instance_templates::Insert {
11649 super::builder::region_instance_templates::Insert::new(self.inner.clone())
11650 }
11651
11652 /// Retrieves a list of instance templates that are contained within the
11653 /// specified project and region.
11654 pub fn list(&self) -> super::builder::region_instance_templates::List {
11655 super::builder::region_instance_templates::List::new(self.inner.clone())
11656 }
11657
11658 /// Retrieves the specified region-specific Operations resource.
11659 pub fn get_operation(&self) -> super::builder::region_instance_templates::GetOperation {
11660 super::builder::region_instance_templates::GetOperation::new(self.inner.clone())
11661 }
11662}
11663
11664/// Implements a client for the Google Compute Engine API.
11665///
11666/// # Example
11667/// ```
11668/// # tokio_test::block_on(async {
11669/// # use google_cloud_compute_v1::client::RegionInstances;
11670/// let client = RegionInstances::builder().build().await?;
11671/// // use `client` to make requests to the Google Compute Engine API.
11672/// # gax::client_builder::Result::<()>::Ok(()) });
11673/// ```
11674///
11675/// # Service Description
11676///
11677/// Service for the `regionInstances` resource.
11678///
11679/// # Configuration
11680///
11681/// To configure `RegionInstances` use the `with_*` methods in the type returned
11682/// by [builder()][RegionInstances::builder]. The default configuration should
11683/// work for most applications. Common configuration changes include
11684///
11685/// * [with_endpoint()]: by default this client uses the global default endpoint
11686/// (`https://compute.googleapis.com`). Applications using regional
11687/// endpoints or running in restricted networks (e.g. a network configured
11688// with [Private Google Access with VPC Service Controls]) may want to
11689/// override this default.
11690/// * [with_credentials()]: by default this client uses
11691/// [Application Default Credentials]. Applications using custom
11692/// authentication may need to override this default.
11693///
11694/// [with_endpoint()]: super::builder::region_instances::ClientBuilder::with_endpoint
11695/// [with_credentials()]: super::builder::region_instances::ClientBuilder::credentials
11696/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11697/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11698///
11699/// # Pooling and Cloning
11700///
11701/// `RegionInstances` holds a connection pool internally, it is advised to
11702/// create one and the reuse it. You do not need to wrap `RegionInstances` in
11703/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11704/// already uses an `Arc` internally.
11705#[cfg(feature = "region-instances")]
11706#[cfg_attr(docsrs, doc(cfg(feature = "region-instances")))]
11707#[derive(Clone, Debug)]
11708pub struct RegionInstances {
11709 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstances>,
11710}
11711
11712#[cfg(feature = "region-instances")]
11713impl RegionInstances {
11714 /// Returns a builder for [RegionInstances].
11715 ///
11716 /// ```
11717 /// # tokio_test::block_on(async {
11718 /// # use google_cloud_compute_v1::client::RegionInstances;
11719 /// let client = RegionInstances::builder().build().await?;
11720 /// # gax::client_builder::Result::<()>::Ok(()) });
11721 /// ```
11722 pub fn builder() -> super::builder::region_instances::ClientBuilder {
11723 gax::client_builder::internal::new_builder(
11724 super::builder::region_instances::client::Factory,
11725 )
11726 }
11727
11728 /// Creates a new client from the provided stub.
11729 ///
11730 /// The most common case for calling this function is in tests mocking the
11731 /// client's behavior.
11732 pub fn from_stub<T>(stub: T) -> Self
11733 where
11734 T: super::stub::RegionInstances + 'static,
11735 {
11736 Self {
11737 inner: std::sync::Arc::new(stub),
11738 }
11739 }
11740
11741 pub(crate) async fn new(
11742 config: gaxi::options::ClientConfig,
11743 ) -> gax::client_builder::Result<Self> {
11744 let inner = Self::build_inner(config).await?;
11745 Ok(Self { inner })
11746 }
11747
11748 async fn build_inner(
11749 conf: gaxi::options::ClientConfig,
11750 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionInstances>>
11751 {
11752 if gaxi::options::tracing_enabled(&conf) {
11753 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11754 }
11755 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11756 }
11757
11758 async fn build_transport(
11759 conf: gaxi::options::ClientConfig,
11760 ) -> gax::client_builder::Result<impl super::stub::RegionInstances> {
11761 super::transport::RegionInstances::new(conf).await
11762 }
11763
11764 async fn build_with_tracing(
11765 conf: gaxi::options::ClientConfig,
11766 ) -> gax::client_builder::Result<impl super::stub::RegionInstances> {
11767 Self::build_transport(conf)
11768 .await
11769 .map(super::tracing::RegionInstances::new)
11770 }
11771
11772 /// Creates multiple instances in a given region. Count specifies the number of
11773 /// instances to create.
11774 pub fn bulk_insert(&self) -> super::builder::region_instances::BulkInsert {
11775 super::builder::region_instances::BulkInsert::new(self.inner.clone())
11776 }
11777
11778 /// Retrieves the specified region-specific Operations resource.
11779 pub fn get_operation(&self) -> super::builder::region_instances::GetOperation {
11780 super::builder::region_instances::GetOperation::new(self.inner.clone())
11781 }
11782}
11783
11784/// Implements a client for the Google Compute Engine API.
11785///
11786/// # Example
11787/// ```
11788/// # tokio_test::block_on(async {
11789/// # use google_cloud_compute_v1::client::RegionInstantSnapshots;
11790/// let client = RegionInstantSnapshots::builder().build().await?;
11791/// // use `client` to make requests to the Google Compute Engine API.
11792/// # gax::client_builder::Result::<()>::Ok(()) });
11793/// ```
11794///
11795/// # Service Description
11796///
11797/// Service for the `regionInstantSnapshots` resource.
11798///
11799/// # Configuration
11800///
11801/// To configure `RegionInstantSnapshots` use the `with_*` methods in the type returned
11802/// by [builder()][RegionInstantSnapshots::builder]. The default configuration should
11803/// work for most applications. Common configuration changes include
11804///
11805/// * [with_endpoint()]: by default this client uses the global default endpoint
11806/// (`https://compute.googleapis.com`). Applications using regional
11807/// endpoints or running in restricted networks (e.g. a network configured
11808// with [Private Google Access with VPC Service Controls]) may want to
11809/// override this default.
11810/// * [with_credentials()]: by default this client uses
11811/// [Application Default Credentials]. Applications using custom
11812/// authentication may need to override this default.
11813///
11814/// [with_endpoint()]: super::builder::region_instant_snapshots::ClientBuilder::with_endpoint
11815/// [with_credentials()]: super::builder::region_instant_snapshots::ClientBuilder::credentials
11816/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11817/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11818///
11819/// # Pooling and Cloning
11820///
11821/// `RegionInstantSnapshots` holds a connection pool internally, it is advised to
11822/// create one and the reuse it. You do not need to wrap `RegionInstantSnapshots` in
11823/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11824/// already uses an `Arc` internally.
11825#[cfg(feature = "region-instant-snapshots")]
11826#[cfg_attr(docsrs, doc(cfg(feature = "region-instant-snapshots")))]
11827#[derive(Clone, Debug)]
11828pub struct RegionInstantSnapshots {
11829 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstantSnapshots>,
11830}
11831
11832#[cfg(feature = "region-instant-snapshots")]
11833impl RegionInstantSnapshots {
11834 /// Returns a builder for [RegionInstantSnapshots].
11835 ///
11836 /// ```
11837 /// # tokio_test::block_on(async {
11838 /// # use google_cloud_compute_v1::client::RegionInstantSnapshots;
11839 /// let client = RegionInstantSnapshots::builder().build().await?;
11840 /// # gax::client_builder::Result::<()>::Ok(()) });
11841 /// ```
11842 pub fn builder() -> super::builder::region_instant_snapshots::ClientBuilder {
11843 gax::client_builder::internal::new_builder(
11844 super::builder::region_instant_snapshots::client::Factory,
11845 )
11846 }
11847
11848 /// Creates a new client from the provided stub.
11849 ///
11850 /// The most common case for calling this function is in tests mocking the
11851 /// client's behavior.
11852 pub fn from_stub<T>(stub: T) -> Self
11853 where
11854 T: super::stub::RegionInstantSnapshots + 'static,
11855 {
11856 Self {
11857 inner: std::sync::Arc::new(stub),
11858 }
11859 }
11860
11861 pub(crate) async fn new(
11862 config: gaxi::options::ClientConfig,
11863 ) -> gax::client_builder::Result<Self> {
11864 let inner = Self::build_inner(config).await?;
11865 Ok(Self { inner })
11866 }
11867
11868 async fn build_inner(
11869 conf: gaxi::options::ClientConfig,
11870 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionInstantSnapshots>>
11871 {
11872 if gaxi::options::tracing_enabled(&conf) {
11873 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11874 }
11875 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11876 }
11877
11878 async fn build_transport(
11879 conf: gaxi::options::ClientConfig,
11880 ) -> gax::client_builder::Result<impl super::stub::RegionInstantSnapshots> {
11881 super::transport::RegionInstantSnapshots::new(conf).await
11882 }
11883
11884 async fn build_with_tracing(
11885 conf: gaxi::options::ClientConfig,
11886 ) -> gax::client_builder::Result<impl super::stub::RegionInstantSnapshots> {
11887 Self::build_transport(conf)
11888 .await
11889 .map(super::tracing::RegionInstantSnapshots::new)
11890 }
11891
11892 /// Deletes the specified InstantSnapshot resource. Keep in mind that deleting
11893 /// a single instantSnapshot might not necessarily delete all the data on that
11894 /// instantSnapshot. If any data on the instantSnapshot that is marked for
11895 /// deletion is needed for subsequent instantSnapshots, the data will be moved
11896 /// to the next corresponding instantSnapshot.
11897 ///
11898 /// For more information, seeDeleting
11899 /// instantSnapshots.
11900 pub fn delete(&self) -> super::builder::region_instant_snapshots::Delete {
11901 super::builder::region_instant_snapshots::Delete::new(self.inner.clone())
11902 }
11903
11904 /// Returns the specified InstantSnapshot resource in the specified region.
11905 pub fn get(&self) -> super::builder::region_instant_snapshots::Get {
11906 super::builder::region_instant_snapshots::Get::new(self.inner.clone())
11907 }
11908
11909 /// Gets the access control policy for a resource. May be empty if no such
11910 /// policy or resource exists.
11911 pub fn get_iam_policy(&self) -> super::builder::region_instant_snapshots::GetIamPolicy {
11912 super::builder::region_instant_snapshots::GetIamPolicy::new(self.inner.clone())
11913 }
11914
11915 /// Creates an instant snapshot in the specified region.
11916 pub fn insert(&self) -> super::builder::region_instant_snapshots::Insert {
11917 super::builder::region_instant_snapshots::Insert::new(self.inner.clone())
11918 }
11919
11920 /// Retrieves the list of InstantSnapshot resources contained within
11921 /// the specified region.
11922 pub fn list(&self) -> super::builder::region_instant_snapshots::List {
11923 super::builder::region_instant_snapshots::List::new(self.inner.clone())
11924 }
11925
11926 /// Sets the access control policy on the specified resource.
11927 /// Replaces any existing policy.
11928 pub fn set_iam_policy(&self) -> super::builder::region_instant_snapshots::SetIamPolicy {
11929 super::builder::region_instant_snapshots::SetIamPolicy::new(self.inner.clone())
11930 }
11931
11932 /// Sets the labels on a instantSnapshot in the given region. To learn more
11933 /// about labels, read the Labeling
11934 /// Resources documentation.
11935 pub fn set_labels(&self) -> super::builder::region_instant_snapshots::SetLabels {
11936 super::builder::region_instant_snapshots::SetLabels::new(self.inner.clone())
11937 }
11938
11939 /// Returns permissions that a caller has on the specified resource.
11940 pub fn test_iam_permissions(
11941 &self,
11942 ) -> super::builder::region_instant_snapshots::TestIamPermissions {
11943 super::builder::region_instant_snapshots::TestIamPermissions::new(self.inner.clone())
11944 }
11945
11946 /// Retrieves the specified region-specific Operations resource.
11947 pub fn get_operation(&self) -> super::builder::region_instant_snapshots::GetOperation {
11948 super::builder::region_instant_snapshots::GetOperation::new(self.inner.clone())
11949 }
11950}
11951
11952/// Implements a client for the Google Compute Engine API.
11953///
11954/// # Example
11955/// ```
11956/// # tokio_test::block_on(async {
11957/// # use google_cloud_compute_v1::client::RegionNetworkEndpointGroups;
11958/// let client = RegionNetworkEndpointGroups::builder().build().await?;
11959/// // use `client` to make requests to the Google Compute Engine API.
11960/// # gax::client_builder::Result::<()>::Ok(()) });
11961/// ```
11962///
11963/// # Service Description
11964///
11965/// Service for the `regionNetworkEndpointGroups` resource.
11966///
11967/// # Configuration
11968///
11969/// To configure `RegionNetworkEndpointGroups` use the `with_*` methods in the type returned
11970/// by [builder()][RegionNetworkEndpointGroups::builder]. The default configuration should
11971/// work for most applications. Common configuration changes include
11972///
11973/// * [with_endpoint()]: by default this client uses the global default endpoint
11974/// (`https://compute.googleapis.com`). Applications using regional
11975/// endpoints or running in restricted networks (e.g. a network configured
11976// with [Private Google Access with VPC Service Controls]) may want to
11977/// override this default.
11978/// * [with_credentials()]: by default this client uses
11979/// [Application Default Credentials]. Applications using custom
11980/// authentication may need to override this default.
11981///
11982/// [with_endpoint()]: super::builder::region_network_endpoint_groups::ClientBuilder::with_endpoint
11983/// [with_credentials()]: super::builder::region_network_endpoint_groups::ClientBuilder::credentials
11984/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11985/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11986///
11987/// # Pooling and Cloning
11988///
11989/// `RegionNetworkEndpointGroups` holds a connection pool internally, it is advised to
11990/// create one and the reuse it. You do not need to wrap `RegionNetworkEndpointGroups` in
11991/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11992/// already uses an `Arc` internally.
11993#[cfg(feature = "region-network-endpoint-groups")]
11994#[cfg_attr(docsrs, doc(cfg(feature = "region-network-endpoint-groups")))]
11995#[derive(Clone, Debug)]
11996pub struct RegionNetworkEndpointGroups {
11997 inner: std::sync::Arc<dyn super::stub::dynamic::RegionNetworkEndpointGroups>,
11998}
11999
12000#[cfg(feature = "region-network-endpoint-groups")]
12001impl RegionNetworkEndpointGroups {
12002 /// Returns a builder for [RegionNetworkEndpointGroups].
12003 ///
12004 /// ```
12005 /// # tokio_test::block_on(async {
12006 /// # use google_cloud_compute_v1::client::RegionNetworkEndpointGroups;
12007 /// let client = RegionNetworkEndpointGroups::builder().build().await?;
12008 /// # gax::client_builder::Result::<()>::Ok(()) });
12009 /// ```
12010 pub fn builder() -> super::builder::region_network_endpoint_groups::ClientBuilder {
12011 gax::client_builder::internal::new_builder(
12012 super::builder::region_network_endpoint_groups::client::Factory,
12013 )
12014 }
12015
12016 /// Creates a new client from the provided stub.
12017 ///
12018 /// The most common case for calling this function is in tests mocking the
12019 /// client's behavior.
12020 pub fn from_stub<T>(stub: T) -> Self
12021 where
12022 T: super::stub::RegionNetworkEndpointGroups + 'static,
12023 {
12024 Self {
12025 inner: std::sync::Arc::new(stub),
12026 }
12027 }
12028
12029 pub(crate) async fn new(
12030 config: gaxi::options::ClientConfig,
12031 ) -> gax::client_builder::Result<Self> {
12032 let inner = Self::build_inner(config).await?;
12033 Ok(Self { inner })
12034 }
12035
12036 async fn build_inner(
12037 conf: gaxi::options::ClientConfig,
12038 ) -> gax::client_builder::Result<
12039 std::sync::Arc<dyn super::stub::dynamic::RegionNetworkEndpointGroups>,
12040 > {
12041 if gaxi::options::tracing_enabled(&conf) {
12042 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12043 }
12044 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12045 }
12046
12047 async fn build_transport(
12048 conf: gaxi::options::ClientConfig,
12049 ) -> gax::client_builder::Result<impl super::stub::RegionNetworkEndpointGroups> {
12050 super::transport::RegionNetworkEndpointGroups::new(conf).await
12051 }
12052
12053 async fn build_with_tracing(
12054 conf: gaxi::options::ClientConfig,
12055 ) -> gax::client_builder::Result<impl super::stub::RegionNetworkEndpointGroups> {
12056 Self::build_transport(conf)
12057 .await
12058 .map(super::tracing::RegionNetworkEndpointGroups::new)
12059 }
12060
12061 /// Attach a list of network endpoints to the specified network endpoint group.
12062 pub fn attach_network_endpoints(
12063 &self,
12064 ) -> super::builder::region_network_endpoint_groups::AttachNetworkEndpoints {
12065 super::builder::region_network_endpoint_groups::AttachNetworkEndpoints::new(
12066 self.inner.clone(),
12067 )
12068 }
12069
12070 /// Deletes the specified network endpoint group. Note that the NEG cannot be
12071 /// deleted if it is configured as a backend of a backend service.
12072 pub fn delete(&self) -> super::builder::region_network_endpoint_groups::Delete {
12073 super::builder::region_network_endpoint_groups::Delete::new(self.inner.clone())
12074 }
12075
12076 /// Detach the network endpoint from the specified network endpoint group.
12077 pub fn detach_network_endpoints(
12078 &self,
12079 ) -> super::builder::region_network_endpoint_groups::DetachNetworkEndpoints {
12080 super::builder::region_network_endpoint_groups::DetachNetworkEndpoints::new(
12081 self.inner.clone(),
12082 )
12083 }
12084
12085 /// Returns the specified network endpoint group.
12086 pub fn get(&self) -> super::builder::region_network_endpoint_groups::Get {
12087 super::builder::region_network_endpoint_groups::Get::new(self.inner.clone())
12088 }
12089
12090 /// Creates a network endpoint group in the specified project using the
12091 /// parameters that are included in the request.
12092 pub fn insert(&self) -> super::builder::region_network_endpoint_groups::Insert {
12093 super::builder::region_network_endpoint_groups::Insert::new(self.inner.clone())
12094 }
12095
12096 /// Retrieves the list of regional network endpoint groups available to the
12097 /// specified project in the given region.
12098 pub fn list(&self) -> super::builder::region_network_endpoint_groups::List {
12099 super::builder::region_network_endpoint_groups::List::new(self.inner.clone())
12100 }
12101
12102 /// Lists the network endpoints in the specified network endpoint group.
12103 pub fn list_network_endpoints(
12104 &self,
12105 ) -> super::builder::region_network_endpoint_groups::ListNetworkEndpoints {
12106 super::builder::region_network_endpoint_groups::ListNetworkEndpoints::new(
12107 self.inner.clone(),
12108 )
12109 }
12110
12111 /// Retrieves the specified region-specific Operations resource.
12112 pub fn get_operation(&self) -> super::builder::region_network_endpoint_groups::GetOperation {
12113 super::builder::region_network_endpoint_groups::GetOperation::new(self.inner.clone())
12114 }
12115}
12116
12117/// Implements a client for the Google Compute Engine API.
12118///
12119/// # Example
12120/// ```
12121/// # tokio_test::block_on(async {
12122/// # use google_cloud_compute_v1::client::RegionNetworkFirewallPolicies;
12123/// let client = RegionNetworkFirewallPolicies::builder().build().await?;
12124/// // use `client` to make requests to the Google Compute Engine API.
12125/// # gax::client_builder::Result::<()>::Ok(()) });
12126/// ```
12127///
12128/// # Service Description
12129///
12130/// Service for the `regionNetworkFirewallPolicies` resource.
12131///
12132/// # Configuration
12133///
12134/// To configure `RegionNetworkFirewallPolicies` use the `with_*` methods in the type returned
12135/// by [builder()][RegionNetworkFirewallPolicies::builder]. The default configuration should
12136/// work for most applications. Common configuration changes include
12137///
12138/// * [with_endpoint()]: by default this client uses the global default endpoint
12139/// (`https://compute.googleapis.com`). Applications using regional
12140/// endpoints or running in restricted networks (e.g. a network configured
12141// with [Private Google Access with VPC Service Controls]) may want to
12142/// override this default.
12143/// * [with_credentials()]: by default this client uses
12144/// [Application Default Credentials]. Applications using custom
12145/// authentication may need to override this default.
12146///
12147/// [with_endpoint()]: super::builder::region_network_firewall_policies::ClientBuilder::with_endpoint
12148/// [with_credentials()]: super::builder::region_network_firewall_policies::ClientBuilder::credentials
12149/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12150/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12151///
12152/// # Pooling and Cloning
12153///
12154/// `RegionNetworkFirewallPolicies` holds a connection pool internally, it is advised to
12155/// create one and the reuse it. You do not need to wrap `RegionNetworkFirewallPolicies` in
12156/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12157/// already uses an `Arc` internally.
12158#[cfg(feature = "region-network-firewall-policies")]
12159#[cfg_attr(docsrs, doc(cfg(feature = "region-network-firewall-policies")))]
12160#[derive(Clone, Debug)]
12161pub struct RegionNetworkFirewallPolicies {
12162 inner: std::sync::Arc<dyn super::stub::dynamic::RegionNetworkFirewallPolicies>,
12163}
12164
12165#[cfg(feature = "region-network-firewall-policies")]
12166impl RegionNetworkFirewallPolicies {
12167 /// Returns a builder for [RegionNetworkFirewallPolicies].
12168 ///
12169 /// ```
12170 /// # tokio_test::block_on(async {
12171 /// # use google_cloud_compute_v1::client::RegionNetworkFirewallPolicies;
12172 /// let client = RegionNetworkFirewallPolicies::builder().build().await?;
12173 /// # gax::client_builder::Result::<()>::Ok(()) });
12174 /// ```
12175 pub fn builder() -> super::builder::region_network_firewall_policies::ClientBuilder {
12176 gax::client_builder::internal::new_builder(
12177 super::builder::region_network_firewall_policies::client::Factory,
12178 )
12179 }
12180
12181 /// Creates a new client from the provided stub.
12182 ///
12183 /// The most common case for calling this function is in tests mocking the
12184 /// client's behavior.
12185 pub fn from_stub<T>(stub: T) -> Self
12186 where
12187 T: super::stub::RegionNetworkFirewallPolicies + 'static,
12188 {
12189 Self {
12190 inner: std::sync::Arc::new(stub),
12191 }
12192 }
12193
12194 pub(crate) async fn new(
12195 config: gaxi::options::ClientConfig,
12196 ) -> gax::client_builder::Result<Self> {
12197 let inner = Self::build_inner(config).await?;
12198 Ok(Self { inner })
12199 }
12200
12201 async fn build_inner(
12202 conf: gaxi::options::ClientConfig,
12203 ) -> gax::client_builder::Result<
12204 std::sync::Arc<dyn super::stub::dynamic::RegionNetworkFirewallPolicies>,
12205 > {
12206 if gaxi::options::tracing_enabled(&conf) {
12207 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12208 }
12209 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12210 }
12211
12212 async fn build_transport(
12213 conf: gaxi::options::ClientConfig,
12214 ) -> gax::client_builder::Result<impl super::stub::RegionNetworkFirewallPolicies> {
12215 super::transport::RegionNetworkFirewallPolicies::new(conf).await
12216 }
12217
12218 async fn build_with_tracing(
12219 conf: gaxi::options::ClientConfig,
12220 ) -> gax::client_builder::Result<impl super::stub::RegionNetworkFirewallPolicies> {
12221 Self::build_transport(conf)
12222 .await
12223 .map(super::tracing::RegionNetworkFirewallPolicies::new)
12224 }
12225
12226 /// Inserts an association for the specified network firewall policy.
12227 pub fn add_association(
12228 &self,
12229 ) -> super::builder::region_network_firewall_policies::AddAssociation {
12230 super::builder::region_network_firewall_policies::AddAssociation::new(self.inner.clone())
12231 }
12232
12233 /// Inserts a rule into a network firewall policy.
12234 pub fn add_rule(&self) -> super::builder::region_network_firewall_policies::AddRule {
12235 super::builder::region_network_firewall_policies::AddRule::new(self.inner.clone())
12236 }
12237
12238 /// Copies rules to the specified network firewall policy.
12239 pub fn clone_rules(&self) -> super::builder::region_network_firewall_policies::CloneRules {
12240 super::builder::region_network_firewall_policies::CloneRules::new(self.inner.clone())
12241 }
12242
12243 /// Deletes the specified network firewall policy.
12244 pub fn delete(&self) -> super::builder::region_network_firewall_policies::Delete {
12245 super::builder::region_network_firewall_policies::Delete::new(self.inner.clone())
12246 }
12247
12248 /// Returns the specified network firewall policy.
12249 pub fn get(&self) -> super::builder::region_network_firewall_policies::Get {
12250 super::builder::region_network_firewall_policies::Get::new(self.inner.clone())
12251 }
12252
12253 /// Gets an association with the specified name.
12254 pub fn get_association(
12255 &self,
12256 ) -> super::builder::region_network_firewall_policies::GetAssociation {
12257 super::builder::region_network_firewall_policies::GetAssociation::new(self.inner.clone())
12258 }
12259
12260 /// Returns the effective firewalls on a given network.
12261 pub fn get_effective_firewalls(
12262 &self,
12263 ) -> super::builder::region_network_firewall_policies::GetEffectiveFirewalls {
12264 super::builder::region_network_firewall_policies::GetEffectiveFirewalls::new(
12265 self.inner.clone(),
12266 )
12267 }
12268
12269 /// Gets the access control policy for a resource. May be empty if no such
12270 /// policy or resource exists.
12271 pub fn get_iam_policy(&self) -> super::builder::region_network_firewall_policies::GetIamPolicy {
12272 super::builder::region_network_firewall_policies::GetIamPolicy::new(self.inner.clone())
12273 }
12274
12275 /// Gets a rule of the specified priority.
12276 pub fn get_rule(&self) -> super::builder::region_network_firewall_policies::GetRule {
12277 super::builder::region_network_firewall_policies::GetRule::new(self.inner.clone())
12278 }
12279
12280 /// Creates a new network firewall policy in the specified project and region.
12281 pub fn insert(&self) -> super::builder::region_network_firewall_policies::Insert {
12282 super::builder::region_network_firewall_policies::Insert::new(self.inner.clone())
12283 }
12284
12285 /// Lists all the network firewall policies that have been configured
12286 /// for the specified project in the given region.
12287 pub fn list(&self) -> super::builder::region_network_firewall_policies::List {
12288 super::builder::region_network_firewall_policies::List::new(self.inner.clone())
12289 }
12290
12291 /// Patches the specified network firewall policy.
12292 pub fn patch(&self) -> super::builder::region_network_firewall_policies::Patch {
12293 super::builder::region_network_firewall_policies::Patch::new(self.inner.clone())
12294 }
12295
12296 /// Patches a rule of the specified priority.
12297 pub fn patch_rule(&self) -> super::builder::region_network_firewall_policies::PatchRule {
12298 super::builder::region_network_firewall_policies::PatchRule::new(self.inner.clone())
12299 }
12300
12301 /// Removes an association for the specified network firewall policy.
12302 pub fn remove_association(
12303 &self,
12304 ) -> super::builder::region_network_firewall_policies::RemoveAssociation {
12305 super::builder::region_network_firewall_policies::RemoveAssociation::new(self.inner.clone())
12306 }
12307
12308 /// Deletes a rule of the specified priority.
12309 pub fn remove_rule(&self) -> super::builder::region_network_firewall_policies::RemoveRule {
12310 super::builder::region_network_firewall_policies::RemoveRule::new(self.inner.clone())
12311 }
12312
12313 /// Sets the access control policy on the specified resource.
12314 /// Replaces any existing policy.
12315 pub fn set_iam_policy(&self) -> super::builder::region_network_firewall_policies::SetIamPolicy {
12316 super::builder::region_network_firewall_policies::SetIamPolicy::new(self.inner.clone())
12317 }
12318
12319 /// Returns permissions that a caller has on the specified resource.
12320 pub fn test_iam_permissions(
12321 &self,
12322 ) -> super::builder::region_network_firewall_policies::TestIamPermissions {
12323 super::builder::region_network_firewall_policies::TestIamPermissions::new(
12324 self.inner.clone(),
12325 )
12326 }
12327
12328 /// Retrieves the specified region-specific Operations resource.
12329 pub fn get_operation(&self) -> super::builder::region_network_firewall_policies::GetOperation {
12330 super::builder::region_network_firewall_policies::GetOperation::new(self.inner.clone())
12331 }
12332}
12333
12334/// Implements a client for the Google Compute Engine API.
12335///
12336/// # Example
12337/// ```
12338/// # tokio_test::block_on(async {
12339/// # use google_cloud_compute_v1::client::RegionNotificationEndpoints;
12340/// let client = RegionNotificationEndpoints::builder().build().await?;
12341/// // use `client` to make requests to the Google Compute Engine API.
12342/// # gax::client_builder::Result::<()>::Ok(()) });
12343/// ```
12344///
12345/// # Service Description
12346///
12347/// Service for the `regionNotificationEndpoints` resource.
12348///
12349/// # Configuration
12350///
12351/// To configure `RegionNotificationEndpoints` use the `with_*` methods in the type returned
12352/// by [builder()][RegionNotificationEndpoints::builder]. The default configuration should
12353/// work for most applications. Common configuration changes include
12354///
12355/// * [with_endpoint()]: by default this client uses the global default endpoint
12356/// (`https://compute.googleapis.com`). Applications using regional
12357/// endpoints or running in restricted networks (e.g. a network configured
12358// with [Private Google Access with VPC Service Controls]) may want to
12359/// override this default.
12360/// * [with_credentials()]: by default this client uses
12361/// [Application Default Credentials]. Applications using custom
12362/// authentication may need to override this default.
12363///
12364/// [with_endpoint()]: super::builder::region_notification_endpoints::ClientBuilder::with_endpoint
12365/// [with_credentials()]: super::builder::region_notification_endpoints::ClientBuilder::credentials
12366/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12367/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12368///
12369/// # Pooling and Cloning
12370///
12371/// `RegionNotificationEndpoints` holds a connection pool internally, it is advised to
12372/// create one and the reuse it. You do not need to wrap `RegionNotificationEndpoints` in
12373/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12374/// already uses an `Arc` internally.
12375#[cfg(feature = "region-notification-endpoints")]
12376#[cfg_attr(docsrs, doc(cfg(feature = "region-notification-endpoints")))]
12377#[derive(Clone, Debug)]
12378pub struct RegionNotificationEndpoints {
12379 inner: std::sync::Arc<dyn super::stub::dynamic::RegionNotificationEndpoints>,
12380}
12381
12382#[cfg(feature = "region-notification-endpoints")]
12383impl RegionNotificationEndpoints {
12384 /// Returns a builder for [RegionNotificationEndpoints].
12385 ///
12386 /// ```
12387 /// # tokio_test::block_on(async {
12388 /// # use google_cloud_compute_v1::client::RegionNotificationEndpoints;
12389 /// let client = RegionNotificationEndpoints::builder().build().await?;
12390 /// # gax::client_builder::Result::<()>::Ok(()) });
12391 /// ```
12392 pub fn builder() -> super::builder::region_notification_endpoints::ClientBuilder {
12393 gax::client_builder::internal::new_builder(
12394 super::builder::region_notification_endpoints::client::Factory,
12395 )
12396 }
12397
12398 /// Creates a new client from the provided stub.
12399 ///
12400 /// The most common case for calling this function is in tests mocking the
12401 /// client's behavior.
12402 pub fn from_stub<T>(stub: T) -> Self
12403 where
12404 T: super::stub::RegionNotificationEndpoints + 'static,
12405 {
12406 Self {
12407 inner: std::sync::Arc::new(stub),
12408 }
12409 }
12410
12411 pub(crate) async fn new(
12412 config: gaxi::options::ClientConfig,
12413 ) -> gax::client_builder::Result<Self> {
12414 let inner = Self::build_inner(config).await?;
12415 Ok(Self { inner })
12416 }
12417
12418 async fn build_inner(
12419 conf: gaxi::options::ClientConfig,
12420 ) -> gax::client_builder::Result<
12421 std::sync::Arc<dyn super::stub::dynamic::RegionNotificationEndpoints>,
12422 > {
12423 if gaxi::options::tracing_enabled(&conf) {
12424 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12425 }
12426 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12427 }
12428
12429 async fn build_transport(
12430 conf: gaxi::options::ClientConfig,
12431 ) -> gax::client_builder::Result<impl super::stub::RegionNotificationEndpoints> {
12432 super::transport::RegionNotificationEndpoints::new(conf).await
12433 }
12434
12435 async fn build_with_tracing(
12436 conf: gaxi::options::ClientConfig,
12437 ) -> gax::client_builder::Result<impl super::stub::RegionNotificationEndpoints> {
12438 Self::build_transport(conf)
12439 .await
12440 .map(super::tracing::RegionNotificationEndpoints::new)
12441 }
12442
12443 /// Deletes the specified NotificationEndpoint in the given region
12444 pub fn delete(&self) -> super::builder::region_notification_endpoints::Delete {
12445 super::builder::region_notification_endpoints::Delete::new(self.inner.clone())
12446 }
12447
12448 /// Returns the specified NotificationEndpoint resource in the given region.
12449 pub fn get(&self) -> super::builder::region_notification_endpoints::Get {
12450 super::builder::region_notification_endpoints::Get::new(self.inner.clone())
12451 }
12452
12453 /// Create a NotificationEndpoint in the specified project in the given region
12454 /// using the parameters that are included in the request.
12455 pub fn insert(&self) -> super::builder::region_notification_endpoints::Insert {
12456 super::builder::region_notification_endpoints::Insert::new(self.inner.clone())
12457 }
12458
12459 /// Lists the NotificationEndpoints for a project in the given region.
12460 pub fn list(&self) -> super::builder::region_notification_endpoints::List {
12461 super::builder::region_notification_endpoints::List::new(self.inner.clone())
12462 }
12463
12464 /// Retrieves the specified region-specific Operations resource.
12465 pub fn get_operation(&self) -> super::builder::region_notification_endpoints::GetOperation {
12466 super::builder::region_notification_endpoints::GetOperation::new(self.inner.clone())
12467 }
12468}
12469
12470/// Implements a client for the Google Compute Engine API.
12471///
12472/// # Example
12473/// ```
12474/// # tokio_test::block_on(async {
12475/// # use google_cloud_compute_v1::client::RegionOperations;
12476/// let client = RegionOperations::builder().build().await?;
12477/// // use `client` to make requests to the Google Compute Engine API.
12478/// # gax::client_builder::Result::<()>::Ok(()) });
12479/// ```
12480///
12481/// # Service Description
12482///
12483/// Service for the `regionOperations` resource.
12484///
12485/// # Configuration
12486///
12487/// To configure `RegionOperations` use the `with_*` methods in the type returned
12488/// by [builder()][RegionOperations::builder]. The default configuration should
12489/// work for most applications. Common configuration changes include
12490///
12491/// * [with_endpoint()]: by default this client uses the global default endpoint
12492/// (`https://compute.googleapis.com`). Applications using regional
12493/// endpoints or running in restricted networks (e.g. a network configured
12494// with [Private Google Access with VPC Service Controls]) may want to
12495/// override this default.
12496/// * [with_credentials()]: by default this client uses
12497/// [Application Default Credentials]. Applications using custom
12498/// authentication may need to override this default.
12499///
12500/// [with_endpoint()]: super::builder::region_operations::ClientBuilder::with_endpoint
12501/// [with_credentials()]: super::builder::region_operations::ClientBuilder::credentials
12502/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12503/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12504///
12505/// # Pooling and Cloning
12506///
12507/// `RegionOperations` holds a connection pool internally, it is advised to
12508/// create one and the reuse it. You do not need to wrap `RegionOperations` in
12509/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12510/// already uses an `Arc` internally.
12511#[cfg(feature = "region-operations")]
12512#[cfg_attr(docsrs, doc(cfg(feature = "region-operations")))]
12513#[derive(Clone, Debug)]
12514pub struct RegionOperations {
12515 inner: std::sync::Arc<dyn super::stub::dynamic::RegionOperations>,
12516}
12517
12518#[cfg(feature = "region-operations")]
12519impl RegionOperations {
12520 /// Returns a builder for [RegionOperations].
12521 ///
12522 /// ```
12523 /// # tokio_test::block_on(async {
12524 /// # use google_cloud_compute_v1::client::RegionOperations;
12525 /// let client = RegionOperations::builder().build().await?;
12526 /// # gax::client_builder::Result::<()>::Ok(()) });
12527 /// ```
12528 pub fn builder() -> super::builder::region_operations::ClientBuilder {
12529 gax::client_builder::internal::new_builder(
12530 super::builder::region_operations::client::Factory,
12531 )
12532 }
12533
12534 /// Creates a new client from the provided stub.
12535 ///
12536 /// The most common case for calling this function is in tests mocking the
12537 /// client's behavior.
12538 pub fn from_stub<T>(stub: T) -> Self
12539 where
12540 T: super::stub::RegionOperations + 'static,
12541 {
12542 Self {
12543 inner: std::sync::Arc::new(stub),
12544 }
12545 }
12546
12547 pub(crate) async fn new(
12548 config: gaxi::options::ClientConfig,
12549 ) -> gax::client_builder::Result<Self> {
12550 let inner = Self::build_inner(config).await?;
12551 Ok(Self { inner })
12552 }
12553
12554 async fn build_inner(
12555 conf: gaxi::options::ClientConfig,
12556 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionOperations>>
12557 {
12558 if gaxi::options::tracing_enabled(&conf) {
12559 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12560 }
12561 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12562 }
12563
12564 async fn build_transport(
12565 conf: gaxi::options::ClientConfig,
12566 ) -> gax::client_builder::Result<impl super::stub::RegionOperations> {
12567 super::transport::RegionOperations::new(conf).await
12568 }
12569
12570 async fn build_with_tracing(
12571 conf: gaxi::options::ClientConfig,
12572 ) -> gax::client_builder::Result<impl super::stub::RegionOperations> {
12573 Self::build_transport(conf)
12574 .await
12575 .map(super::tracing::RegionOperations::new)
12576 }
12577
12578 /// Deletes the specified region-specific Operations resource.
12579 pub fn delete(&self) -> super::builder::region_operations::Delete {
12580 super::builder::region_operations::Delete::new(self.inner.clone())
12581 }
12582
12583 /// Retrieves the specified region-specific Operations resource.
12584 pub fn get(&self) -> super::builder::region_operations::Get {
12585 super::builder::region_operations::Get::new(self.inner.clone())
12586 }
12587
12588 /// Retrieves a list of Operation resources contained within
12589 /// the specified region.
12590 pub fn list(&self) -> super::builder::region_operations::List {
12591 super::builder::region_operations::List::new(self.inner.clone())
12592 }
12593
12594 /// Waits for the specified Operation resource to return as `DONE`
12595 /// or for the request to approach the 2 minute deadline, and retrieves the
12596 /// specified Operation resource. This method differs from the
12597 /// `GET` method in that it waits for no more than the default
12598 /// deadline (2 minutes) and then returns the current state of the operation,
12599 /// which might be `DONE` or still in progress.
12600 ///
12601 /// This method is called on a best-effort basis. Specifically:
12602 ///
12603 /// ```norust
12604 /// - In uncommon cases, when the server is overloaded, the request might
12605 /// return before the default deadline is reached, or might return after zero
12606 /// seconds.
12607 /// ```
12608 ///
12609 /// - If the default deadline is reached, there is no guarantee that the
12610 /// operation is actually done when the method returns. Be prepared to retry
12611 /// if the operation is not `DONE`.
12612 pub fn wait(&self) -> super::builder::region_operations::Wait {
12613 super::builder::region_operations::Wait::new(self.inner.clone())
12614 }
12615}
12616
12617/// Implements a client for the Google Compute Engine API.
12618///
12619/// # Example
12620/// ```
12621/// # tokio_test::block_on(async {
12622/// # use google_cloud_compute_v1::client::RegionSecurityPolicies;
12623/// let client = RegionSecurityPolicies::builder().build().await?;
12624/// // use `client` to make requests to the Google Compute Engine API.
12625/// # gax::client_builder::Result::<()>::Ok(()) });
12626/// ```
12627///
12628/// # Service Description
12629///
12630/// Service for the `regionSecurityPolicies` resource.
12631///
12632/// # Configuration
12633///
12634/// To configure `RegionSecurityPolicies` use the `with_*` methods in the type returned
12635/// by [builder()][RegionSecurityPolicies::builder]. The default configuration should
12636/// work for most applications. Common configuration changes include
12637///
12638/// * [with_endpoint()]: by default this client uses the global default endpoint
12639/// (`https://compute.googleapis.com`). Applications using regional
12640/// endpoints or running in restricted networks (e.g. a network configured
12641// with [Private Google Access with VPC Service Controls]) may want to
12642/// override this default.
12643/// * [with_credentials()]: by default this client uses
12644/// [Application Default Credentials]. Applications using custom
12645/// authentication may need to override this default.
12646///
12647/// [with_endpoint()]: super::builder::region_security_policies::ClientBuilder::with_endpoint
12648/// [with_credentials()]: super::builder::region_security_policies::ClientBuilder::credentials
12649/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12650/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12651///
12652/// # Pooling and Cloning
12653///
12654/// `RegionSecurityPolicies` holds a connection pool internally, it is advised to
12655/// create one and the reuse it. You do not need to wrap `RegionSecurityPolicies` in
12656/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12657/// already uses an `Arc` internally.
12658#[cfg(feature = "region-security-policies")]
12659#[cfg_attr(docsrs, doc(cfg(feature = "region-security-policies")))]
12660#[derive(Clone, Debug)]
12661pub struct RegionSecurityPolicies {
12662 inner: std::sync::Arc<dyn super::stub::dynamic::RegionSecurityPolicies>,
12663}
12664
12665#[cfg(feature = "region-security-policies")]
12666impl RegionSecurityPolicies {
12667 /// Returns a builder for [RegionSecurityPolicies].
12668 ///
12669 /// ```
12670 /// # tokio_test::block_on(async {
12671 /// # use google_cloud_compute_v1::client::RegionSecurityPolicies;
12672 /// let client = RegionSecurityPolicies::builder().build().await?;
12673 /// # gax::client_builder::Result::<()>::Ok(()) });
12674 /// ```
12675 pub fn builder() -> super::builder::region_security_policies::ClientBuilder {
12676 gax::client_builder::internal::new_builder(
12677 super::builder::region_security_policies::client::Factory,
12678 )
12679 }
12680
12681 /// Creates a new client from the provided stub.
12682 ///
12683 /// The most common case for calling this function is in tests mocking the
12684 /// client's behavior.
12685 pub fn from_stub<T>(stub: T) -> Self
12686 where
12687 T: super::stub::RegionSecurityPolicies + 'static,
12688 {
12689 Self {
12690 inner: std::sync::Arc::new(stub),
12691 }
12692 }
12693
12694 pub(crate) async fn new(
12695 config: gaxi::options::ClientConfig,
12696 ) -> gax::client_builder::Result<Self> {
12697 let inner = Self::build_inner(config).await?;
12698 Ok(Self { inner })
12699 }
12700
12701 async fn build_inner(
12702 conf: gaxi::options::ClientConfig,
12703 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionSecurityPolicies>>
12704 {
12705 if gaxi::options::tracing_enabled(&conf) {
12706 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12707 }
12708 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12709 }
12710
12711 async fn build_transport(
12712 conf: gaxi::options::ClientConfig,
12713 ) -> gax::client_builder::Result<impl super::stub::RegionSecurityPolicies> {
12714 super::transport::RegionSecurityPolicies::new(conf).await
12715 }
12716
12717 async fn build_with_tracing(
12718 conf: gaxi::options::ClientConfig,
12719 ) -> gax::client_builder::Result<impl super::stub::RegionSecurityPolicies> {
12720 Self::build_transport(conf)
12721 .await
12722 .map(super::tracing::RegionSecurityPolicies::new)
12723 }
12724
12725 /// Inserts a rule into a security policy.
12726 pub fn add_rule(&self) -> super::builder::region_security_policies::AddRule {
12727 super::builder::region_security_policies::AddRule::new(self.inner.clone())
12728 }
12729
12730 /// Deletes the specified policy.
12731 pub fn delete(&self) -> super::builder::region_security_policies::Delete {
12732 super::builder::region_security_policies::Delete::new(self.inner.clone())
12733 }
12734
12735 /// List all of the ordered rules present in a single specified policy.
12736 pub fn get(&self) -> super::builder::region_security_policies::Get {
12737 super::builder::region_security_policies::Get::new(self.inner.clone())
12738 }
12739
12740 /// Gets a rule at the specified priority.
12741 pub fn get_rule(&self) -> super::builder::region_security_policies::GetRule {
12742 super::builder::region_security_policies::GetRule::new(self.inner.clone())
12743 }
12744
12745 /// Creates a new policy in the specified project using the data included in
12746 /// the request.
12747 pub fn insert(&self) -> super::builder::region_security_policies::Insert {
12748 super::builder::region_security_policies::Insert::new(self.inner.clone())
12749 }
12750
12751 /// List all the policies that have been configured for the specified project
12752 /// and region.
12753 pub fn list(&self) -> super::builder::region_security_policies::List {
12754 super::builder::region_security_policies::List::new(self.inner.clone())
12755 }
12756
12757 /// Patches the specified policy with the data included in the request. To
12758 /// clear fields in the policy, leave the fields empty and specify them in the
12759 /// updateMask. This cannot be used to be update the rules in the policy.
12760 /// Please use the per rule methods like addRule, patchRule, and removeRule
12761 /// instead.
12762 pub fn patch(&self) -> super::builder::region_security_policies::Patch {
12763 super::builder::region_security_policies::Patch::new(self.inner.clone())
12764 }
12765
12766 /// Patches a rule at the specified priority. To clear fields in the rule,
12767 /// leave the fields empty and specify them in the updateMask.
12768 pub fn patch_rule(&self) -> super::builder::region_security_policies::PatchRule {
12769 super::builder::region_security_policies::PatchRule::new(self.inner.clone())
12770 }
12771
12772 /// Deletes a rule at the specified priority.
12773 pub fn remove_rule(&self) -> super::builder::region_security_policies::RemoveRule {
12774 super::builder::region_security_policies::RemoveRule::new(self.inner.clone())
12775 }
12776
12777 /// Sets the labels on a security policy. To learn more about labels,
12778 /// read the Labeling Resources
12779 /// documentation.
12780 pub fn set_labels(&self) -> super::builder::region_security_policies::SetLabels {
12781 super::builder::region_security_policies::SetLabels::new(self.inner.clone())
12782 }
12783
12784 /// Retrieves the specified region-specific Operations resource.
12785 pub fn get_operation(&self) -> super::builder::region_security_policies::GetOperation {
12786 super::builder::region_security_policies::GetOperation::new(self.inner.clone())
12787 }
12788}
12789
12790/// Implements a client for the Google Compute Engine API.
12791///
12792/// # Example
12793/// ```
12794/// # tokio_test::block_on(async {
12795/// # use google_cloud_compute_v1::client::RegionSslCertificates;
12796/// let client = RegionSslCertificates::builder().build().await?;
12797/// // use `client` to make requests to the Google Compute Engine API.
12798/// # gax::client_builder::Result::<()>::Ok(()) });
12799/// ```
12800///
12801/// # Service Description
12802///
12803/// Service for the `regionSslCertificates` resource.
12804///
12805/// # Configuration
12806///
12807/// To configure `RegionSslCertificates` use the `with_*` methods in the type returned
12808/// by [builder()][RegionSslCertificates::builder]. The default configuration should
12809/// work for most applications. Common configuration changes include
12810///
12811/// * [with_endpoint()]: by default this client uses the global default endpoint
12812/// (`https://compute.googleapis.com`). Applications using regional
12813/// endpoints or running in restricted networks (e.g. a network configured
12814// with [Private Google Access with VPC Service Controls]) may want to
12815/// override this default.
12816/// * [with_credentials()]: by default this client uses
12817/// [Application Default Credentials]. Applications using custom
12818/// authentication may need to override this default.
12819///
12820/// [with_endpoint()]: super::builder::region_ssl_certificates::ClientBuilder::with_endpoint
12821/// [with_credentials()]: super::builder::region_ssl_certificates::ClientBuilder::credentials
12822/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12823/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12824///
12825/// # Pooling and Cloning
12826///
12827/// `RegionSslCertificates` holds a connection pool internally, it is advised to
12828/// create one and the reuse it. You do not need to wrap `RegionSslCertificates` in
12829/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12830/// already uses an `Arc` internally.
12831#[cfg(feature = "region-ssl-certificates")]
12832#[cfg_attr(docsrs, doc(cfg(feature = "region-ssl-certificates")))]
12833#[derive(Clone, Debug)]
12834pub struct RegionSslCertificates {
12835 inner: std::sync::Arc<dyn super::stub::dynamic::RegionSslCertificates>,
12836}
12837
12838#[cfg(feature = "region-ssl-certificates")]
12839impl RegionSslCertificates {
12840 /// Returns a builder for [RegionSslCertificates].
12841 ///
12842 /// ```
12843 /// # tokio_test::block_on(async {
12844 /// # use google_cloud_compute_v1::client::RegionSslCertificates;
12845 /// let client = RegionSslCertificates::builder().build().await?;
12846 /// # gax::client_builder::Result::<()>::Ok(()) });
12847 /// ```
12848 pub fn builder() -> super::builder::region_ssl_certificates::ClientBuilder {
12849 gax::client_builder::internal::new_builder(
12850 super::builder::region_ssl_certificates::client::Factory,
12851 )
12852 }
12853
12854 /// Creates a new client from the provided stub.
12855 ///
12856 /// The most common case for calling this function is in tests mocking the
12857 /// client's behavior.
12858 pub fn from_stub<T>(stub: T) -> Self
12859 where
12860 T: super::stub::RegionSslCertificates + 'static,
12861 {
12862 Self {
12863 inner: std::sync::Arc::new(stub),
12864 }
12865 }
12866
12867 pub(crate) async fn new(
12868 config: gaxi::options::ClientConfig,
12869 ) -> gax::client_builder::Result<Self> {
12870 let inner = Self::build_inner(config).await?;
12871 Ok(Self { inner })
12872 }
12873
12874 async fn build_inner(
12875 conf: gaxi::options::ClientConfig,
12876 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionSslCertificates>>
12877 {
12878 if gaxi::options::tracing_enabled(&conf) {
12879 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12880 }
12881 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12882 }
12883
12884 async fn build_transport(
12885 conf: gaxi::options::ClientConfig,
12886 ) -> gax::client_builder::Result<impl super::stub::RegionSslCertificates> {
12887 super::transport::RegionSslCertificates::new(conf).await
12888 }
12889
12890 async fn build_with_tracing(
12891 conf: gaxi::options::ClientConfig,
12892 ) -> gax::client_builder::Result<impl super::stub::RegionSslCertificates> {
12893 Self::build_transport(conf)
12894 .await
12895 .map(super::tracing::RegionSslCertificates::new)
12896 }
12897
12898 /// Deletes the specified SslCertificate resource in the region.
12899 pub fn delete(&self) -> super::builder::region_ssl_certificates::Delete {
12900 super::builder::region_ssl_certificates::Delete::new(self.inner.clone())
12901 }
12902
12903 /// Returns the specified SslCertificate resource in the specified region. Get
12904 /// a list of available SSL certificates by making a list()
12905 /// request.
12906 pub fn get(&self) -> super::builder::region_ssl_certificates::Get {
12907 super::builder::region_ssl_certificates::Get::new(self.inner.clone())
12908 }
12909
12910 /// Creates a SslCertificate resource in the specified project and region using
12911 /// the data included in the request
12912 pub fn insert(&self) -> super::builder::region_ssl_certificates::Insert {
12913 super::builder::region_ssl_certificates::Insert::new(self.inner.clone())
12914 }
12915
12916 /// Retrieves the list of SslCertificate resources available to the specified
12917 /// project in the specified region.
12918 pub fn list(&self) -> super::builder::region_ssl_certificates::List {
12919 super::builder::region_ssl_certificates::List::new(self.inner.clone())
12920 }
12921
12922 /// Retrieves the specified region-specific Operations resource.
12923 pub fn get_operation(&self) -> super::builder::region_ssl_certificates::GetOperation {
12924 super::builder::region_ssl_certificates::GetOperation::new(self.inner.clone())
12925 }
12926}
12927
12928/// Implements a client for the Google Compute Engine API.
12929///
12930/// # Example
12931/// ```
12932/// # tokio_test::block_on(async {
12933/// # use google_cloud_compute_v1::client::RegionSslPolicies;
12934/// let client = RegionSslPolicies::builder().build().await?;
12935/// // use `client` to make requests to the Google Compute Engine API.
12936/// # gax::client_builder::Result::<()>::Ok(()) });
12937/// ```
12938///
12939/// # Service Description
12940///
12941/// Service for the `regionSslPolicies` resource.
12942///
12943/// # Configuration
12944///
12945/// To configure `RegionSslPolicies` use the `with_*` methods in the type returned
12946/// by [builder()][RegionSslPolicies::builder]. The default configuration should
12947/// work for most applications. Common configuration changes include
12948///
12949/// * [with_endpoint()]: by default this client uses the global default endpoint
12950/// (`https://compute.googleapis.com`). Applications using regional
12951/// endpoints or running in restricted networks (e.g. a network configured
12952// with [Private Google Access with VPC Service Controls]) may want to
12953/// override this default.
12954/// * [with_credentials()]: by default this client uses
12955/// [Application Default Credentials]. Applications using custom
12956/// authentication may need to override this default.
12957///
12958/// [with_endpoint()]: super::builder::region_ssl_policies::ClientBuilder::with_endpoint
12959/// [with_credentials()]: super::builder::region_ssl_policies::ClientBuilder::credentials
12960/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12961/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12962///
12963/// # Pooling and Cloning
12964///
12965/// `RegionSslPolicies` holds a connection pool internally, it is advised to
12966/// create one and the reuse it. You do not need to wrap `RegionSslPolicies` in
12967/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12968/// already uses an `Arc` internally.
12969#[cfg(feature = "region-ssl-policies")]
12970#[cfg_attr(docsrs, doc(cfg(feature = "region-ssl-policies")))]
12971#[derive(Clone, Debug)]
12972pub struct RegionSslPolicies {
12973 inner: std::sync::Arc<dyn super::stub::dynamic::RegionSslPolicies>,
12974}
12975
12976#[cfg(feature = "region-ssl-policies")]
12977impl RegionSslPolicies {
12978 /// Returns a builder for [RegionSslPolicies].
12979 ///
12980 /// ```
12981 /// # tokio_test::block_on(async {
12982 /// # use google_cloud_compute_v1::client::RegionSslPolicies;
12983 /// let client = RegionSslPolicies::builder().build().await?;
12984 /// # gax::client_builder::Result::<()>::Ok(()) });
12985 /// ```
12986 pub fn builder() -> super::builder::region_ssl_policies::ClientBuilder {
12987 gax::client_builder::internal::new_builder(
12988 super::builder::region_ssl_policies::client::Factory,
12989 )
12990 }
12991
12992 /// Creates a new client from the provided stub.
12993 ///
12994 /// The most common case for calling this function is in tests mocking the
12995 /// client's behavior.
12996 pub fn from_stub<T>(stub: T) -> Self
12997 where
12998 T: super::stub::RegionSslPolicies + 'static,
12999 {
13000 Self {
13001 inner: std::sync::Arc::new(stub),
13002 }
13003 }
13004
13005 pub(crate) async fn new(
13006 config: gaxi::options::ClientConfig,
13007 ) -> gax::client_builder::Result<Self> {
13008 let inner = Self::build_inner(config).await?;
13009 Ok(Self { inner })
13010 }
13011
13012 async fn build_inner(
13013 conf: gaxi::options::ClientConfig,
13014 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionSslPolicies>>
13015 {
13016 if gaxi::options::tracing_enabled(&conf) {
13017 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13018 }
13019 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13020 }
13021
13022 async fn build_transport(
13023 conf: gaxi::options::ClientConfig,
13024 ) -> gax::client_builder::Result<impl super::stub::RegionSslPolicies> {
13025 super::transport::RegionSslPolicies::new(conf).await
13026 }
13027
13028 async fn build_with_tracing(
13029 conf: gaxi::options::ClientConfig,
13030 ) -> gax::client_builder::Result<impl super::stub::RegionSslPolicies> {
13031 Self::build_transport(conf)
13032 .await
13033 .map(super::tracing::RegionSslPolicies::new)
13034 }
13035
13036 /// Deletes the specified SSL policy. The SSL policy resource can be deleted
13037 /// only if it is not in use by any TargetHttpsProxy or TargetSslProxy
13038 /// resources.
13039 pub fn delete(&self) -> super::builder::region_ssl_policies::Delete {
13040 super::builder::region_ssl_policies::Delete::new(self.inner.clone())
13041 }
13042
13043 /// Lists all of the ordered rules present in a single specified policy.
13044 pub fn get(&self) -> super::builder::region_ssl_policies::Get {
13045 super::builder::region_ssl_policies::Get::new(self.inner.clone())
13046 }
13047
13048 /// Creates a new policy in the specified project and region using the data
13049 /// included in the request.
13050 pub fn insert(&self) -> super::builder::region_ssl_policies::Insert {
13051 super::builder::region_ssl_policies::Insert::new(self.inner.clone())
13052 }
13053
13054 /// Lists all the SSL policies that have been configured for the specified
13055 /// project and region.
13056 pub fn list(&self) -> super::builder::region_ssl_policies::List {
13057 super::builder::region_ssl_policies::List::new(self.inner.clone())
13058 }
13059
13060 /// Lists all features that can be specified in the SSL policy when using
13061 /// custom profile.
13062 pub fn list_available_features(
13063 &self,
13064 ) -> super::builder::region_ssl_policies::ListAvailableFeatures {
13065 super::builder::region_ssl_policies::ListAvailableFeatures::new(self.inner.clone())
13066 }
13067
13068 /// Patches the specified SSL policy with the data included in the request.
13069 pub fn patch(&self) -> super::builder::region_ssl_policies::Patch {
13070 super::builder::region_ssl_policies::Patch::new(self.inner.clone())
13071 }
13072
13073 /// Retrieves the specified region-specific Operations resource.
13074 pub fn get_operation(&self) -> super::builder::region_ssl_policies::GetOperation {
13075 super::builder::region_ssl_policies::GetOperation::new(self.inner.clone())
13076 }
13077}
13078
13079/// Implements a client for the Google Compute Engine API.
13080///
13081/// # Example
13082/// ```
13083/// # tokio_test::block_on(async {
13084/// # use google_cloud_compute_v1::client::RegionTargetHttpProxies;
13085/// let client = RegionTargetHttpProxies::builder().build().await?;
13086/// // use `client` to make requests to the Google Compute Engine API.
13087/// # gax::client_builder::Result::<()>::Ok(()) });
13088/// ```
13089///
13090/// # Service Description
13091///
13092/// Service for the `regionTargetHttpProxies` resource.
13093///
13094/// # Configuration
13095///
13096/// To configure `RegionTargetHttpProxies` use the `with_*` methods in the type returned
13097/// by [builder()][RegionTargetHttpProxies::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_target_http_proxies::ClientBuilder::with_endpoint
13110/// [with_credentials()]: super::builder::region_target_http_proxies::ClientBuilder::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/// `RegionTargetHttpProxies` holds a connection pool internally, it is advised to
13117/// create one and the reuse it. You do not need to wrap `RegionTargetHttpProxies` 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-target-http-proxies")]
13121#[cfg_attr(docsrs, doc(cfg(feature = "region-target-http-proxies")))]
13122#[derive(Clone, Debug)]
13123pub struct RegionTargetHttpProxies {
13124 inner: std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpProxies>,
13125}
13126
13127#[cfg(feature = "region-target-http-proxies")]
13128impl RegionTargetHttpProxies {
13129 /// Returns a builder for [RegionTargetHttpProxies].
13130 ///
13131 /// ```
13132 /// # tokio_test::block_on(async {
13133 /// # use google_cloud_compute_v1::client::RegionTargetHttpProxies;
13134 /// let client = RegionTargetHttpProxies::builder().build().await?;
13135 /// # gax::client_builder::Result::<()>::Ok(()) });
13136 /// ```
13137 pub fn builder() -> super::builder::region_target_http_proxies::ClientBuilder {
13138 gax::client_builder::internal::new_builder(
13139 super::builder::region_target_http_proxies::client::Factory,
13140 )
13141 }
13142
13143 /// Creates a new client from the provided stub.
13144 ///
13145 /// The most common case for calling this function is in tests mocking the
13146 /// client's behavior.
13147 pub fn from_stub<T>(stub: T) -> Self
13148 where
13149 T: super::stub::RegionTargetHttpProxies + 'static,
13150 {
13151 Self {
13152 inner: std::sync::Arc::new(stub),
13153 }
13154 }
13155
13156 pub(crate) async fn new(
13157 config: gaxi::options::ClientConfig,
13158 ) -> gax::client_builder::Result<Self> {
13159 let inner = Self::build_inner(config).await?;
13160 Ok(Self { inner })
13161 }
13162
13163 async fn build_inner(
13164 conf: gaxi::options::ClientConfig,
13165 ) -> gax::client_builder::Result<
13166 std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpProxies>,
13167 > {
13168 if gaxi::options::tracing_enabled(&conf) {
13169 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13170 }
13171 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13172 }
13173
13174 async fn build_transport(
13175 conf: gaxi::options::ClientConfig,
13176 ) -> gax::client_builder::Result<impl super::stub::RegionTargetHttpProxies> {
13177 super::transport::RegionTargetHttpProxies::new(conf).await
13178 }
13179
13180 async fn build_with_tracing(
13181 conf: gaxi::options::ClientConfig,
13182 ) -> gax::client_builder::Result<impl super::stub::RegionTargetHttpProxies> {
13183 Self::build_transport(conf)
13184 .await
13185 .map(super::tracing::RegionTargetHttpProxies::new)
13186 }
13187
13188 /// Deletes the specified TargetHttpProxy resource.
13189 pub fn delete(&self) -> super::builder::region_target_http_proxies::Delete {
13190 super::builder::region_target_http_proxies::Delete::new(self.inner.clone())
13191 }
13192
13193 /// Returns the specified TargetHttpProxy resource in the specified region.
13194 pub fn get(&self) -> super::builder::region_target_http_proxies::Get {
13195 super::builder::region_target_http_proxies::Get::new(self.inner.clone())
13196 }
13197
13198 /// Creates a TargetHttpProxy resource in the specified project and region
13199 /// using the data included in the request.
13200 pub fn insert(&self) -> super::builder::region_target_http_proxies::Insert {
13201 super::builder::region_target_http_proxies::Insert::new(self.inner.clone())
13202 }
13203
13204 /// Retrieves the list of TargetHttpProxy resources available
13205 /// to the specified project in the specified region.
13206 pub fn list(&self) -> super::builder::region_target_http_proxies::List {
13207 super::builder::region_target_http_proxies::List::new(self.inner.clone())
13208 }
13209
13210 /// Changes the URL map for TargetHttpProxy.
13211 pub fn set_url_map(&self) -> super::builder::region_target_http_proxies::SetUrlMap {
13212 super::builder::region_target_http_proxies::SetUrlMap::new(self.inner.clone())
13213 }
13214
13215 /// Retrieves the specified region-specific Operations resource.
13216 pub fn get_operation(&self) -> super::builder::region_target_http_proxies::GetOperation {
13217 super::builder::region_target_http_proxies::GetOperation::new(self.inner.clone())
13218 }
13219}
13220
13221/// Implements a client for the Google Compute Engine API.
13222///
13223/// # Example
13224/// ```
13225/// # tokio_test::block_on(async {
13226/// # use google_cloud_compute_v1::client::RegionTargetHttpsProxies;
13227/// let client = RegionTargetHttpsProxies::builder().build().await?;
13228/// // use `client` to make requests to the Google Compute Engine API.
13229/// # gax::client_builder::Result::<()>::Ok(()) });
13230/// ```
13231///
13232/// # Service Description
13233///
13234/// Service for the `regionTargetHttpsProxies` resource.
13235///
13236/// # Configuration
13237///
13238/// To configure `RegionTargetHttpsProxies` use the `with_*` methods in the type returned
13239/// by [builder()][RegionTargetHttpsProxies::builder]. The default configuration should
13240/// work for most applications. Common configuration changes include
13241///
13242/// * [with_endpoint()]: by default this client uses the global default endpoint
13243/// (`https://compute.googleapis.com`). Applications using regional
13244/// endpoints or running in restricted networks (e.g. a network configured
13245// with [Private Google Access with VPC Service Controls]) may want to
13246/// override this default.
13247/// * [with_credentials()]: by default this client uses
13248/// [Application Default Credentials]. Applications using custom
13249/// authentication may need to override this default.
13250///
13251/// [with_endpoint()]: super::builder::region_target_https_proxies::ClientBuilder::with_endpoint
13252/// [with_credentials()]: super::builder::region_target_https_proxies::ClientBuilder::credentials
13253/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13254/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13255///
13256/// # Pooling and Cloning
13257///
13258/// `RegionTargetHttpsProxies` holds a connection pool internally, it is advised to
13259/// create one and the reuse it. You do not need to wrap `RegionTargetHttpsProxies` in
13260/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13261/// already uses an `Arc` internally.
13262#[cfg(feature = "region-target-https-proxies")]
13263#[cfg_attr(docsrs, doc(cfg(feature = "region-target-https-proxies")))]
13264#[derive(Clone, Debug)]
13265pub struct RegionTargetHttpsProxies {
13266 inner: std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpsProxies>,
13267}
13268
13269#[cfg(feature = "region-target-https-proxies")]
13270impl RegionTargetHttpsProxies {
13271 /// Returns a builder for [RegionTargetHttpsProxies].
13272 ///
13273 /// ```
13274 /// # tokio_test::block_on(async {
13275 /// # use google_cloud_compute_v1::client::RegionTargetHttpsProxies;
13276 /// let client = RegionTargetHttpsProxies::builder().build().await?;
13277 /// # gax::client_builder::Result::<()>::Ok(()) });
13278 /// ```
13279 pub fn builder() -> super::builder::region_target_https_proxies::ClientBuilder {
13280 gax::client_builder::internal::new_builder(
13281 super::builder::region_target_https_proxies::client::Factory,
13282 )
13283 }
13284
13285 /// Creates a new client from the provided stub.
13286 ///
13287 /// The most common case for calling this function is in tests mocking the
13288 /// client's behavior.
13289 pub fn from_stub<T>(stub: T) -> Self
13290 where
13291 T: super::stub::RegionTargetHttpsProxies + 'static,
13292 {
13293 Self {
13294 inner: std::sync::Arc::new(stub),
13295 }
13296 }
13297
13298 pub(crate) async fn new(
13299 config: gaxi::options::ClientConfig,
13300 ) -> gax::client_builder::Result<Self> {
13301 let inner = Self::build_inner(config).await?;
13302 Ok(Self { inner })
13303 }
13304
13305 async fn build_inner(
13306 conf: gaxi::options::ClientConfig,
13307 ) -> gax::client_builder::Result<
13308 std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpsProxies>,
13309 > {
13310 if gaxi::options::tracing_enabled(&conf) {
13311 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13312 }
13313 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13314 }
13315
13316 async fn build_transport(
13317 conf: gaxi::options::ClientConfig,
13318 ) -> gax::client_builder::Result<impl super::stub::RegionTargetHttpsProxies> {
13319 super::transport::RegionTargetHttpsProxies::new(conf).await
13320 }
13321
13322 async fn build_with_tracing(
13323 conf: gaxi::options::ClientConfig,
13324 ) -> gax::client_builder::Result<impl super::stub::RegionTargetHttpsProxies> {
13325 Self::build_transport(conf)
13326 .await
13327 .map(super::tracing::RegionTargetHttpsProxies::new)
13328 }
13329
13330 /// Deletes the specified TargetHttpsProxy resource.
13331 pub fn delete(&self) -> super::builder::region_target_https_proxies::Delete {
13332 super::builder::region_target_https_proxies::Delete::new(self.inner.clone())
13333 }
13334
13335 /// Returns the specified TargetHttpsProxy resource in the specified region.
13336 pub fn get(&self) -> super::builder::region_target_https_proxies::Get {
13337 super::builder::region_target_https_proxies::Get::new(self.inner.clone())
13338 }
13339
13340 /// Creates a TargetHttpsProxy resource in the specified project and region
13341 /// using the data included in the request.
13342 pub fn insert(&self) -> super::builder::region_target_https_proxies::Insert {
13343 super::builder::region_target_https_proxies::Insert::new(self.inner.clone())
13344 }
13345
13346 /// Retrieves the list of TargetHttpsProxy resources available
13347 /// to the specified project in the specified region.
13348 pub fn list(&self) -> super::builder::region_target_https_proxies::List {
13349 super::builder::region_target_https_proxies::List::new(self.inner.clone())
13350 }
13351
13352 /// Patches the specified regional TargetHttpsProxy resource with the data
13353 /// included in the request. This method supports PATCH
13354 /// semantics and usesJSON merge
13355 /// patch format and processing rules.
13356 pub fn patch(&self) -> super::builder::region_target_https_proxies::Patch {
13357 super::builder::region_target_https_proxies::Patch::new(self.inner.clone())
13358 }
13359
13360 /// Replaces SslCertificates for TargetHttpsProxy.
13361 pub fn set_ssl_certificates(
13362 &self,
13363 ) -> super::builder::region_target_https_proxies::SetSslCertificates {
13364 super::builder::region_target_https_proxies::SetSslCertificates::new(self.inner.clone())
13365 }
13366
13367 /// Changes the URL map for TargetHttpsProxy.
13368 pub fn set_url_map(&self) -> super::builder::region_target_https_proxies::SetUrlMap {
13369 super::builder::region_target_https_proxies::SetUrlMap::new(self.inner.clone())
13370 }
13371
13372 /// Retrieves the specified region-specific Operations resource.
13373 pub fn get_operation(&self) -> super::builder::region_target_https_proxies::GetOperation {
13374 super::builder::region_target_https_proxies::GetOperation::new(self.inner.clone())
13375 }
13376}
13377
13378/// Implements a client for the Google Compute Engine API.
13379///
13380/// # Example
13381/// ```
13382/// # tokio_test::block_on(async {
13383/// # use google_cloud_compute_v1::client::RegionTargetTcpProxies;
13384/// let client = RegionTargetTcpProxies::builder().build().await?;
13385/// // use `client` to make requests to the Google Compute Engine API.
13386/// # gax::client_builder::Result::<()>::Ok(()) });
13387/// ```
13388///
13389/// # Service Description
13390///
13391/// Service for the `regionTargetTcpProxies` resource.
13392///
13393/// # Configuration
13394///
13395/// To configure `RegionTargetTcpProxies` use the `with_*` methods in the type returned
13396/// by [builder()][RegionTargetTcpProxies::builder]. The default configuration should
13397/// work for most applications. Common configuration changes include
13398///
13399/// * [with_endpoint()]: by default this client uses the global default endpoint
13400/// (`https://compute.googleapis.com`). Applications using regional
13401/// endpoints or running in restricted networks (e.g. a network configured
13402// with [Private Google Access with VPC Service Controls]) may want to
13403/// override this default.
13404/// * [with_credentials()]: by default this client uses
13405/// [Application Default Credentials]. Applications using custom
13406/// authentication may need to override this default.
13407///
13408/// [with_endpoint()]: super::builder::region_target_tcp_proxies::ClientBuilder::with_endpoint
13409/// [with_credentials()]: super::builder::region_target_tcp_proxies::ClientBuilder::credentials
13410/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13411/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13412///
13413/// # Pooling and Cloning
13414///
13415/// `RegionTargetTcpProxies` holds a connection pool internally, it is advised to
13416/// create one and the reuse it. You do not need to wrap `RegionTargetTcpProxies` in
13417/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13418/// already uses an `Arc` internally.
13419#[cfg(feature = "region-target-tcp-proxies")]
13420#[cfg_attr(docsrs, doc(cfg(feature = "region-target-tcp-proxies")))]
13421#[derive(Clone, Debug)]
13422pub struct RegionTargetTcpProxies {
13423 inner: std::sync::Arc<dyn super::stub::dynamic::RegionTargetTcpProxies>,
13424}
13425
13426#[cfg(feature = "region-target-tcp-proxies")]
13427impl RegionTargetTcpProxies {
13428 /// Returns a builder for [RegionTargetTcpProxies].
13429 ///
13430 /// ```
13431 /// # tokio_test::block_on(async {
13432 /// # use google_cloud_compute_v1::client::RegionTargetTcpProxies;
13433 /// let client = RegionTargetTcpProxies::builder().build().await?;
13434 /// # gax::client_builder::Result::<()>::Ok(()) });
13435 /// ```
13436 pub fn builder() -> super::builder::region_target_tcp_proxies::ClientBuilder {
13437 gax::client_builder::internal::new_builder(
13438 super::builder::region_target_tcp_proxies::client::Factory,
13439 )
13440 }
13441
13442 /// Creates a new client from the provided stub.
13443 ///
13444 /// The most common case for calling this function is in tests mocking the
13445 /// client's behavior.
13446 pub fn from_stub<T>(stub: T) -> Self
13447 where
13448 T: super::stub::RegionTargetTcpProxies + 'static,
13449 {
13450 Self {
13451 inner: std::sync::Arc::new(stub),
13452 }
13453 }
13454
13455 pub(crate) async fn new(
13456 config: gaxi::options::ClientConfig,
13457 ) -> gax::client_builder::Result<Self> {
13458 let inner = Self::build_inner(config).await?;
13459 Ok(Self { inner })
13460 }
13461
13462 async fn build_inner(
13463 conf: gaxi::options::ClientConfig,
13464 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionTargetTcpProxies>>
13465 {
13466 if gaxi::options::tracing_enabled(&conf) {
13467 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13468 }
13469 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13470 }
13471
13472 async fn build_transport(
13473 conf: gaxi::options::ClientConfig,
13474 ) -> gax::client_builder::Result<impl super::stub::RegionTargetTcpProxies> {
13475 super::transport::RegionTargetTcpProxies::new(conf).await
13476 }
13477
13478 async fn build_with_tracing(
13479 conf: gaxi::options::ClientConfig,
13480 ) -> gax::client_builder::Result<impl super::stub::RegionTargetTcpProxies> {
13481 Self::build_transport(conf)
13482 .await
13483 .map(super::tracing::RegionTargetTcpProxies::new)
13484 }
13485
13486 /// Deletes the specified TargetTcpProxy resource.
13487 pub fn delete(&self) -> super::builder::region_target_tcp_proxies::Delete {
13488 super::builder::region_target_tcp_proxies::Delete::new(self.inner.clone())
13489 }
13490
13491 /// Returns the specified TargetTcpProxy resource.
13492 pub fn get(&self) -> super::builder::region_target_tcp_proxies::Get {
13493 super::builder::region_target_tcp_proxies::Get::new(self.inner.clone())
13494 }
13495
13496 /// Creates a TargetTcpProxy resource in the specified project and region using
13497 /// the data included in the request.
13498 pub fn insert(&self) -> super::builder::region_target_tcp_proxies::Insert {
13499 super::builder::region_target_tcp_proxies::Insert::new(self.inner.clone())
13500 }
13501
13502 /// Retrieves a list of TargetTcpProxy resources
13503 /// available to the specified project in a given region.
13504 pub fn list(&self) -> super::builder::region_target_tcp_proxies::List {
13505 super::builder::region_target_tcp_proxies::List::new(self.inner.clone())
13506 }
13507
13508 /// Retrieves the specified region-specific Operations resource.
13509 pub fn get_operation(&self) -> super::builder::region_target_tcp_proxies::GetOperation {
13510 super::builder::region_target_tcp_proxies::GetOperation::new(self.inner.clone())
13511 }
13512}
13513
13514/// Implements a client for the Google Compute Engine API.
13515///
13516/// # Example
13517/// ```
13518/// # tokio_test::block_on(async {
13519/// # use google_cloud_compute_v1::client::RegionUrlMaps;
13520/// let client = RegionUrlMaps::builder().build().await?;
13521/// // use `client` to make requests to the Google Compute Engine API.
13522/// # gax::client_builder::Result::<()>::Ok(()) });
13523/// ```
13524///
13525/// # Service Description
13526///
13527/// Service for the `regionUrlMaps` resource.
13528///
13529/// # Configuration
13530///
13531/// To configure `RegionUrlMaps` use the `with_*` methods in the type returned
13532/// by [builder()][RegionUrlMaps::builder]. The default configuration should
13533/// work for most applications. Common configuration changes include
13534///
13535/// * [with_endpoint()]: by default this client uses the global default endpoint
13536/// (`https://compute.googleapis.com`). Applications using regional
13537/// endpoints or running in restricted networks (e.g. a network configured
13538// with [Private Google Access with VPC Service Controls]) may want to
13539/// override this default.
13540/// * [with_credentials()]: by default this client uses
13541/// [Application Default Credentials]. Applications using custom
13542/// authentication may need to override this default.
13543///
13544/// [with_endpoint()]: super::builder::region_url_maps::ClientBuilder::with_endpoint
13545/// [with_credentials()]: super::builder::region_url_maps::ClientBuilder::credentials
13546/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13547/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13548///
13549/// # Pooling and Cloning
13550///
13551/// `RegionUrlMaps` holds a connection pool internally, it is advised to
13552/// create one and the reuse it. You do not need to wrap `RegionUrlMaps` in
13553/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13554/// already uses an `Arc` internally.
13555#[cfg(feature = "region-url-maps")]
13556#[cfg_attr(docsrs, doc(cfg(feature = "region-url-maps")))]
13557#[derive(Clone, Debug)]
13558pub struct RegionUrlMaps {
13559 inner: std::sync::Arc<dyn super::stub::dynamic::RegionUrlMaps>,
13560}
13561
13562#[cfg(feature = "region-url-maps")]
13563impl RegionUrlMaps {
13564 /// Returns a builder for [RegionUrlMaps].
13565 ///
13566 /// ```
13567 /// # tokio_test::block_on(async {
13568 /// # use google_cloud_compute_v1::client::RegionUrlMaps;
13569 /// let client = RegionUrlMaps::builder().build().await?;
13570 /// # gax::client_builder::Result::<()>::Ok(()) });
13571 /// ```
13572 pub fn builder() -> super::builder::region_url_maps::ClientBuilder {
13573 gax::client_builder::internal::new_builder(super::builder::region_url_maps::client::Factory)
13574 }
13575
13576 /// Creates a new client from the provided stub.
13577 ///
13578 /// The most common case for calling this function is in tests mocking the
13579 /// client's behavior.
13580 pub fn from_stub<T>(stub: T) -> Self
13581 where
13582 T: super::stub::RegionUrlMaps + 'static,
13583 {
13584 Self {
13585 inner: std::sync::Arc::new(stub),
13586 }
13587 }
13588
13589 pub(crate) async fn new(
13590 config: gaxi::options::ClientConfig,
13591 ) -> gax::client_builder::Result<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 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionUrlMaps>> {
13599 if gaxi::options::tracing_enabled(&conf) {
13600 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13601 }
13602 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13603 }
13604
13605 async fn build_transport(
13606 conf: gaxi::options::ClientConfig,
13607 ) -> gax::client_builder::Result<impl super::stub::RegionUrlMaps> {
13608 super::transport::RegionUrlMaps::new(conf).await
13609 }
13610
13611 async fn build_with_tracing(
13612 conf: gaxi::options::ClientConfig,
13613 ) -> gax::client_builder::Result<impl super::stub::RegionUrlMaps> {
13614 Self::build_transport(conf)
13615 .await
13616 .map(super::tracing::RegionUrlMaps::new)
13617 }
13618
13619 /// Deletes the specified UrlMap resource.
13620 pub fn delete(&self) -> super::builder::region_url_maps::Delete {
13621 super::builder::region_url_maps::Delete::new(self.inner.clone())
13622 }
13623
13624 /// Returns the specified UrlMap resource.
13625 pub fn get(&self) -> super::builder::region_url_maps::Get {
13626 super::builder::region_url_maps::Get::new(self.inner.clone())
13627 }
13628
13629 /// Creates a UrlMap resource in the specified project using
13630 /// the data included in the request.
13631 pub fn insert(&self) -> super::builder::region_url_maps::Insert {
13632 super::builder::region_url_maps::Insert::new(self.inner.clone())
13633 }
13634
13635 /// Retrieves the list of UrlMap resources available to the specified
13636 /// project in the specified region.
13637 pub fn list(&self) -> super::builder::region_url_maps::List {
13638 super::builder::region_url_maps::List::new(self.inner.clone())
13639 }
13640
13641 /// Patches the specified UrlMap resource with the data included in the
13642 /// request. This method supportsPATCH
13643 /// semantics and usesJSON merge
13644 /// patch format and processing rules.
13645 pub fn patch(&self) -> super::builder::region_url_maps::Patch {
13646 super::builder::region_url_maps::Patch::new(self.inner.clone())
13647 }
13648
13649 /// Updates the specified UrlMap resource with the data included in the
13650 /// request.
13651 pub fn update(&self) -> super::builder::region_url_maps::Update {
13652 super::builder::region_url_maps::Update::new(self.inner.clone())
13653 }
13654
13655 /// Runs static validation for the UrlMap. In particular, the tests of the
13656 /// provided UrlMap will be run. Calling this method does NOT create the
13657 /// UrlMap.
13658 pub fn validate(&self) -> super::builder::region_url_maps::Validate {
13659 super::builder::region_url_maps::Validate::new(self.inner.clone())
13660 }
13661
13662 /// Retrieves the specified region-specific Operations resource.
13663 pub fn get_operation(&self) -> super::builder::region_url_maps::GetOperation {
13664 super::builder::region_url_maps::GetOperation::new(self.inner.clone())
13665 }
13666}
13667
13668/// Implements a client for the Google Compute Engine API.
13669///
13670/// # Example
13671/// ```
13672/// # tokio_test::block_on(async {
13673/// # use google_cloud_compute_v1::client::RegionZones;
13674/// let client = RegionZones::builder().build().await?;
13675/// // use `client` to make requests to the Google Compute Engine API.
13676/// # gax::client_builder::Result::<()>::Ok(()) });
13677/// ```
13678///
13679/// # Service Description
13680///
13681/// Service for the `regionZones` resource.
13682///
13683/// # Configuration
13684///
13685/// To configure `RegionZones` use the `with_*` methods in the type returned
13686/// by [builder()][RegionZones::builder]. The default configuration should
13687/// work for most applications. Common configuration changes include
13688///
13689/// * [with_endpoint()]: by default this client uses the global default endpoint
13690/// (`https://compute.googleapis.com`). Applications using regional
13691/// endpoints or running in restricted networks (e.g. a network configured
13692// with [Private Google Access with VPC Service Controls]) may want to
13693/// override this default.
13694/// * [with_credentials()]: by default this client uses
13695/// [Application Default Credentials]. Applications using custom
13696/// authentication may need to override this default.
13697///
13698/// [with_endpoint()]: super::builder::region_zones::ClientBuilder::with_endpoint
13699/// [with_credentials()]: super::builder::region_zones::ClientBuilder::credentials
13700/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13701/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13702///
13703/// # Pooling and Cloning
13704///
13705/// `RegionZones` holds a connection pool internally, it is advised to
13706/// create one and the reuse it. You do not need to wrap `RegionZones` in
13707/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13708/// already uses an `Arc` internally.
13709#[cfg(feature = "region-zones")]
13710#[cfg_attr(docsrs, doc(cfg(feature = "region-zones")))]
13711#[derive(Clone, Debug)]
13712pub struct RegionZones {
13713 inner: std::sync::Arc<dyn super::stub::dynamic::RegionZones>,
13714}
13715
13716#[cfg(feature = "region-zones")]
13717impl RegionZones {
13718 /// Returns a builder for [RegionZones].
13719 ///
13720 /// ```
13721 /// # tokio_test::block_on(async {
13722 /// # use google_cloud_compute_v1::client::RegionZones;
13723 /// let client = RegionZones::builder().build().await?;
13724 /// # gax::client_builder::Result::<()>::Ok(()) });
13725 /// ```
13726 pub fn builder() -> super::builder::region_zones::ClientBuilder {
13727 gax::client_builder::internal::new_builder(super::builder::region_zones::client::Factory)
13728 }
13729
13730 /// Creates a new client from the provided stub.
13731 ///
13732 /// The most common case for calling this function is in tests mocking the
13733 /// client's behavior.
13734 pub fn from_stub<T>(stub: T) -> Self
13735 where
13736 T: super::stub::RegionZones + 'static,
13737 {
13738 Self {
13739 inner: std::sync::Arc::new(stub),
13740 }
13741 }
13742
13743 pub(crate) async fn new(
13744 config: gaxi::options::ClientConfig,
13745 ) -> gax::client_builder::Result<Self> {
13746 let inner = Self::build_inner(config).await?;
13747 Ok(Self { inner })
13748 }
13749
13750 async fn build_inner(
13751 conf: gaxi::options::ClientConfig,
13752 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionZones>> {
13753 if gaxi::options::tracing_enabled(&conf) {
13754 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13755 }
13756 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13757 }
13758
13759 async fn build_transport(
13760 conf: gaxi::options::ClientConfig,
13761 ) -> gax::client_builder::Result<impl super::stub::RegionZones> {
13762 super::transport::RegionZones::new(conf).await
13763 }
13764
13765 async fn build_with_tracing(
13766 conf: gaxi::options::ClientConfig,
13767 ) -> gax::client_builder::Result<impl super::stub::RegionZones> {
13768 Self::build_transport(conf)
13769 .await
13770 .map(super::tracing::RegionZones::new)
13771 }
13772
13773 /// Retrieves the list of Zone resources under the specific region available to
13774 /// the specified project.
13775 pub fn list(&self) -> super::builder::region_zones::List {
13776 super::builder::region_zones::List::new(self.inner.clone())
13777 }
13778}
13779
13780/// Implements a client for the Google Compute Engine API.
13781///
13782/// # Example
13783/// ```
13784/// # tokio_test::block_on(async {
13785/// # use google_cloud_compute_v1::client::Regions;
13786/// let client = Regions::builder().build().await?;
13787/// // use `client` to make requests to the Google Compute Engine API.
13788/// # gax::client_builder::Result::<()>::Ok(()) });
13789/// ```
13790///
13791/// # Service Description
13792///
13793/// Service for the `regions` resource.
13794///
13795/// # Configuration
13796///
13797/// To configure `Regions` use the `with_*` methods in the type returned
13798/// by [builder()][Regions::builder]. The default configuration should
13799/// work for most applications. Common configuration changes include
13800///
13801/// * [with_endpoint()]: by default this client uses the global default endpoint
13802/// (`https://compute.googleapis.com`). Applications using regional
13803/// endpoints or running in restricted networks (e.g. a network configured
13804// with [Private Google Access with VPC Service Controls]) may want to
13805/// override this default.
13806/// * [with_credentials()]: by default this client uses
13807/// [Application Default Credentials]. Applications using custom
13808/// authentication may need to override this default.
13809///
13810/// [with_endpoint()]: super::builder::regions::ClientBuilder::with_endpoint
13811/// [with_credentials()]: super::builder::regions::ClientBuilder::credentials
13812/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13813/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13814///
13815/// # Pooling and Cloning
13816///
13817/// `Regions` holds a connection pool internally, it is advised to
13818/// create one and the reuse it. You do not need to wrap `Regions` in
13819/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13820/// already uses an `Arc` internally.
13821#[cfg(feature = "regions")]
13822#[cfg_attr(docsrs, doc(cfg(feature = "regions")))]
13823#[derive(Clone, Debug)]
13824pub struct Regions {
13825 inner: std::sync::Arc<dyn super::stub::dynamic::Regions>,
13826}
13827
13828#[cfg(feature = "regions")]
13829impl Regions {
13830 /// Returns a builder for [Regions].
13831 ///
13832 /// ```
13833 /// # tokio_test::block_on(async {
13834 /// # use google_cloud_compute_v1::client::Regions;
13835 /// let client = Regions::builder().build().await?;
13836 /// # gax::client_builder::Result::<()>::Ok(()) });
13837 /// ```
13838 pub fn builder() -> super::builder::regions::ClientBuilder {
13839 gax::client_builder::internal::new_builder(super::builder::regions::client::Factory)
13840 }
13841
13842 /// Creates a new client from the provided stub.
13843 ///
13844 /// The most common case for calling this function is in tests mocking the
13845 /// client's behavior.
13846 pub fn from_stub<T>(stub: T) -> Self
13847 where
13848 T: super::stub::Regions + 'static,
13849 {
13850 Self {
13851 inner: std::sync::Arc::new(stub),
13852 }
13853 }
13854
13855 pub(crate) async fn new(
13856 config: gaxi::options::ClientConfig,
13857 ) -> gax::client_builder::Result<Self> {
13858 let inner = Self::build_inner(config).await?;
13859 Ok(Self { inner })
13860 }
13861
13862 async fn build_inner(
13863 conf: gaxi::options::ClientConfig,
13864 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Regions>> {
13865 if gaxi::options::tracing_enabled(&conf) {
13866 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13867 }
13868 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13869 }
13870
13871 async fn build_transport(
13872 conf: gaxi::options::ClientConfig,
13873 ) -> gax::client_builder::Result<impl super::stub::Regions> {
13874 super::transport::Regions::new(conf).await
13875 }
13876
13877 async fn build_with_tracing(
13878 conf: gaxi::options::ClientConfig,
13879 ) -> gax::client_builder::Result<impl super::stub::Regions> {
13880 Self::build_transport(conf)
13881 .await
13882 .map(super::tracing::Regions::new)
13883 }
13884
13885 /// Returns the specified Region resource.
13886 ///
13887 /// To decrease latency for this method, you can optionally omit any unneeded
13888 /// information from the response by using a field mask. This practice is
13889 /// especially recommended for unused quota information (the `quotas` field).
13890 /// To exclude one or more fields, set your request's `fields` query parameter
13891 /// to only include the fields you need. For example, to only include the `id`
13892 /// and `selfLink` fields, add the query parameter `?fields=id,selfLink` to
13893 /// your request.
13894 ///
13895 /// This method fails if the quota information is unavailable for the region
13896 /// and if the organization policy constraint
13897 /// compute.requireBasicQuotaInResponse is enforced. This
13898 /// constraint, when enforced, disables the fail-open behaviour when quota
13899 /// information (the `items.quotas` field) is unavailable for the region.
13900 /// It is recommended to use the default setting
13901 /// for the constraint unless your application requires the fail-closed
13902 /// behaviour for this method.
13903 pub fn get(&self) -> super::builder::regions::Get {
13904 super::builder::regions::Get::new(self.inner.clone())
13905 }
13906
13907 /// Retrieves the list of region resources available to the specified project.
13908 ///
13909 /// To decrease latency for this method, you can optionally omit any unneeded
13910 /// information from the response by using a field mask. This practice is
13911 /// especially recommended for unused quota information
13912 /// (the `items.quotas` field).
13913 /// To exclude one or more fields, set your request's `fields` query parameter
13914 /// to only include the fields you need. For example, to only include the `id`
13915 /// and `selfLink` fields, add the query parameter `?fields=id,selfLink` to
13916 /// your request.
13917 ///
13918 /// This method fails if the quota information is unavailable for the region
13919 /// and if the organization policy constraint
13920 /// compute.requireBasicQuotaInResponse is enforced. This
13921 /// constraint, when enforced, disables the fail-open behaviour when quota
13922 /// information (the `items.quotas` field) is unavailable for the region.
13923 /// It is recommended to use the default setting
13924 /// for the constraint unless your application requires the fail-closed
13925 /// behaviour for this method.
13926 pub fn list(&self) -> super::builder::regions::List {
13927 super::builder::regions::List::new(self.inner.clone())
13928 }
13929}
13930
13931/// Implements a client for the Google Compute Engine API.
13932///
13933/// # Example
13934/// ```
13935/// # tokio_test::block_on(async {
13936/// # use google_cloud_compute_v1::client::ReservationBlocks;
13937/// let client = ReservationBlocks::builder().build().await?;
13938/// // use `client` to make requests to the Google Compute Engine API.
13939/// # gax::client_builder::Result::<()>::Ok(()) });
13940/// ```
13941///
13942/// # Service Description
13943///
13944/// Service for the `reservationBlocks` resource.
13945///
13946/// # Configuration
13947///
13948/// To configure `ReservationBlocks` use the `with_*` methods in the type returned
13949/// by [builder()][ReservationBlocks::builder]. The default configuration should
13950/// work for most applications. Common configuration changes include
13951///
13952/// * [with_endpoint()]: by default this client uses the global default endpoint
13953/// (`https://compute.googleapis.com`). Applications using regional
13954/// endpoints or running in restricted networks (e.g. a network configured
13955// with [Private Google Access with VPC Service Controls]) may want to
13956/// override this default.
13957/// * [with_credentials()]: by default this client uses
13958/// [Application Default Credentials]. Applications using custom
13959/// authentication may need to override this default.
13960///
13961/// [with_endpoint()]: super::builder::reservation_blocks::ClientBuilder::with_endpoint
13962/// [with_credentials()]: super::builder::reservation_blocks::ClientBuilder::credentials
13963/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13964/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13965///
13966/// # Pooling and Cloning
13967///
13968/// `ReservationBlocks` holds a connection pool internally, it is advised to
13969/// create one and the reuse it. You do not need to wrap `ReservationBlocks` in
13970/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13971/// already uses an `Arc` internally.
13972#[cfg(feature = "reservation-blocks")]
13973#[cfg_attr(docsrs, doc(cfg(feature = "reservation-blocks")))]
13974#[derive(Clone, Debug)]
13975pub struct ReservationBlocks {
13976 inner: std::sync::Arc<dyn super::stub::dynamic::ReservationBlocks>,
13977}
13978
13979#[cfg(feature = "reservation-blocks")]
13980impl ReservationBlocks {
13981 /// Returns a builder for [ReservationBlocks].
13982 ///
13983 /// ```
13984 /// # tokio_test::block_on(async {
13985 /// # use google_cloud_compute_v1::client::ReservationBlocks;
13986 /// let client = ReservationBlocks::builder().build().await?;
13987 /// # gax::client_builder::Result::<()>::Ok(()) });
13988 /// ```
13989 pub fn builder() -> super::builder::reservation_blocks::ClientBuilder {
13990 gax::client_builder::internal::new_builder(
13991 super::builder::reservation_blocks::client::Factory,
13992 )
13993 }
13994
13995 /// Creates a new client from the provided stub.
13996 ///
13997 /// The most common case for calling this function is in tests mocking the
13998 /// client's behavior.
13999 pub fn from_stub<T>(stub: T) -> Self
14000 where
14001 T: super::stub::ReservationBlocks + 'static,
14002 {
14003 Self {
14004 inner: std::sync::Arc::new(stub),
14005 }
14006 }
14007
14008 pub(crate) async fn new(
14009 config: gaxi::options::ClientConfig,
14010 ) -> gax::client_builder::Result<Self> {
14011 let inner = Self::build_inner(config).await?;
14012 Ok(Self { inner })
14013 }
14014
14015 async fn build_inner(
14016 conf: gaxi::options::ClientConfig,
14017 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::ReservationBlocks>>
14018 {
14019 if gaxi::options::tracing_enabled(&conf) {
14020 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14021 }
14022 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14023 }
14024
14025 async fn build_transport(
14026 conf: gaxi::options::ClientConfig,
14027 ) -> gax::client_builder::Result<impl super::stub::ReservationBlocks> {
14028 super::transport::ReservationBlocks::new(conf).await
14029 }
14030
14031 async fn build_with_tracing(
14032 conf: gaxi::options::ClientConfig,
14033 ) -> gax::client_builder::Result<impl super::stub::ReservationBlocks> {
14034 Self::build_transport(conf)
14035 .await
14036 .map(super::tracing::ReservationBlocks::new)
14037 }
14038
14039 /// Retrieves information about the specified reservation block.
14040 pub fn get(&self) -> super::builder::reservation_blocks::Get {
14041 super::builder::reservation_blocks::Get::new(self.inner.clone())
14042 }
14043
14044 /// Gets the access control policy for a resource. May be empty if no such
14045 /// policy or resource exists.
14046 pub fn get_iam_policy(&self) -> super::builder::reservation_blocks::GetIamPolicy {
14047 super::builder::reservation_blocks::GetIamPolicy::new(self.inner.clone())
14048 }
14049
14050 /// Retrieves a list of reservation blocks under a single reservation.
14051 pub fn list(&self) -> super::builder::reservation_blocks::List {
14052 super::builder::reservation_blocks::List::new(self.inner.clone())
14053 }
14054
14055 /// Allows customers to perform maintenance on a reservation block
14056 pub fn perform_maintenance(&self) -> super::builder::reservation_blocks::PerformMaintenance {
14057 super::builder::reservation_blocks::PerformMaintenance::new(self.inner.clone())
14058 }
14059
14060 /// Sets the access control policy on the specified resource.
14061 /// Replaces any existing policy.
14062 pub fn set_iam_policy(&self) -> super::builder::reservation_blocks::SetIamPolicy {
14063 super::builder::reservation_blocks::SetIamPolicy::new(self.inner.clone())
14064 }
14065
14066 /// Returns permissions that a caller has on the specified resource.
14067 pub fn test_iam_permissions(&self) -> super::builder::reservation_blocks::TestIamPermissions {
14068 super::builder::reservation_blocks::TestIamPermissions::new(self.inner.clone())
14069 }
14070
14071 /// Retrieves the specified zone-specific Operations resource.
14072 pub fn get_operation(&self) -> super::builder::reservation_blocks::GetOperation {
14073 super::builder::reservation_blocks::GetOperation::new(self.inner.clone())
14074 }
14075}
14076
14077/// Implements a client for the Google Compute Engine API.
14078///
14079/// # Example
14080/// ```
14081/// # tokio_test::block_on(async {
14082/// # use google_cloud_compute_v1::client::ReservationSubBlocks;
14083/// let client = ReservationSubBlocks::builder().build().await?;
14084/// // use `client` to make requests to the Google Compute Engine API.
14085/// # gax::client_builder::Result::<()>::Ok(()) });
14086/// ```
14087///
14088/// # Service Description
14089///
14090/// Service for the `reservationSubBlocks` resource.
14091///
14092/// # Configuration
14093///
14094/// To configure `ReservationSubBlocks` use the `with_*` methods in the type returned
14095/// by [builder()][ReservationSubBlocks::builder]. The default configuration should
14096/// work for most applications. Common configuration changes include
14097///
14098/// * [with_endpoint()]: by default this client uses the global default endpoint
14099/// (`https://compute.googleapis.com`). Applications using regional
14100/// endpoints or running in restricted networks (e.g. a network configured
14101// with [Private Google Access with VPC Service Controls]) may want to
14102/// override this default.
14103/// * [with_credentials()]: by default this client uses
14104/// [Application Default Credentials]. Applications using custom
14105/// authentication may need to override this default.
14106///
14107/// [with_endpoint()]: super::builder::reservation_sub_blocks::ClientBuilder::with_endpoint
14108/// [with_credentials()]: super::builder::reservation_sub_blocks::ClientBuilder::credentials
14109/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14110/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14111///
14112/// # Pooling and Cloning
14113///
14114/// `ReservationSubBlocks` holds a connection pool internally, it is advised to
14115/// create one and the reuse it. You do not need to wrap `ReservationSubBlocks` in
14116/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14117/// already uses an `Arc` internally.
14118#[cfg(feature = "reservation-sub-blocks")]
14119#[cfg_attr(docsrs, doc(cfg(feature = "reservation-sub-blocks")))]
14120#[derive(Clone, Debug)]
14121pub struct ReservationSubBlocks {
14122 inner: std::sync::Arc<dyn super::stub::dynamic::ReservationSubBlocks>,
14123}
14124
14125#[cfg(feature = "reservation-sub-blocks")]
14126impl ReservationSubBlocks {
14127 /// Returns a builder for [ReservationSubBlocks].
14128 ///
14129 /// ```
14130 /// # tokio_test::block_on(async {
14131 /// # use google_cloud_compute_v1::client::ReservationSubBlocks;
14132 /// let client = ReservationSubBlocks::builder().build().await?;
14133 /// # gax::client_builder::Result::<()>::Ok(()) });
14134 /// ```
14135 pub fn builder() -> super::builder::reservation_sub_blocks::ClientBuilder {
14136 gax::client_builder::internal::new_builder(
14137 super::builder::reservation_sub_blocks::client::Factory,
14138 )
14139 }
14140
14141 /// Creates a new client from the provided stub.
14142 ///
14143 /// The most common case for calling this function is in tests mocking the
14144 /// client's behavior.
14145 pub fn from_stub<T>(stub: T) -> Self
14146 where
14147 T: super::stub::ReservationSubBlocks + 'static,
14148 {
14149 Self {
14150 inner: std::sync::Arc::new(stub),
14151 }
14152 }
14153
14154 pub(crate) async fn new(
14155 config: gaxi::options::ClientConfig,
14156 ) -> gax::client_builder::Result<Self> {
14157 let inner = Self::build_inner(config).await?;
14158 Ok(Self { inner })
14159 }
14160
14161 async fn build_inner(
14162 conf: gaxi::options::ClientConfig,
14163 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::ReservationSubBlocks>>
14164 {
14165 if gaxi::options::tracing_enabled(&conf) {
14166 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14167 }
14168 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14169 }
14170
14171 async fn build_transport(
14172 conf: gaxi::options::ClientConfig,
14173 ) -> gax::client_builder::Result<impl super::stub::ReservationSubBlocks> {
14174 super::transport::ReservationSubBlocks::new(conf).await
14175 }
14176
14177 async fn build_with_tracing(
14178 conf: gaxi::options::ClientConfig,
14179 ) -> gax::client_builder::Result<impl super::stub::ReservationSubBlocks> {
14180 Self::build_transport(conf)
14181 .await
14182 .map(super::tracing::ReservationSubBlocks::new)
14183 }
14184
14185 /// Retrieves information about the specified reservation subBlock.
14186 pub fn get(&self) -> super::builder::reservation_sub_blocks::Get {
14187 super::builder::reservation_sub_blocks::Get::new(self.inner.clone())
14188 }
14189
14190 /// Gets the access control policy for a resource. May be empty if no such
14191 /// policy or resource exists.
14192 pub fn get_iam_policy(&self) -> super::builder::reservation_sub_blocks::GetIamPolicy {
14193 super::builder::reservation_sub_blocks::GetIamPolicy::new(self.inner.clone())
14194 }
14195
14196 /// Retrieves a list of reservation subBlocks under a single reservation.
14197 pub fn list(&self) -> super::builder::reservation_sub_blocks::List {
14198 super::builder::reservation_sub_blocks::List::new(self.inner.clone())
14199 }
14200
14201 /// Allows customers to perform maintenance on a reservation subBlock
14202 pub fn perform_maintenance(
14203 &self,
14204 ) -> super::builder::reservation_sub_blocks::PerformMaintenance {
14205 super::builder::reservation_sub_blocks::PerformMaintenance::new(self.inner.clone())
14206 }
14207
14208 /// Allows customers to report a faulty subBlock.
14209 pub fn report_faulty(&self) -> super::builder::reservation_sub_blocks::ReportFaulty {
14210 super::builder::reservation_sub_blocks::ReportFaulty::new(self.inner.clone())
14211 }
14212
14213 /// Sets the access control policy on the specified resource.
14214 /// Replaces any existing policy.
14215 pub fn set_iam_policy(&self) -> super::builder::reservation_sub_blocks::SetIamPolicy {
14216 super::builder::reservation_sub_blocks::SetIamPolicy::new(self.inner.clone())
14217 }
14218
14219 /// Returns permissions that a caller has on the specified resource.
14220 pub fn test_iam_permissions(
14221 &self,
14222 ) -> super::builder::reservation_sub_blocks::TestIamPermissions {
14223 super::builder::reservation_sub_blocks::TestIamPermissions::new(self.inner.clone())
14224 }
14225
14226 /// Retrieves the specified zone-specific Operations resource.
14227 pub fn get_operation(&self) -> super::builder::reservation_sub_blocks::GetOperation {
14228 super::builder::reservation_sub_blocks::GetOperation::new(self.inner.clone())
14229 }
14230}
14231
14232/// Implements a client for the Google Compute Engine API.
14233///
14234/// # Example
14235/// ```
14236/// # tokio_test::block_on(async {
14237/// # use google_cloud_compute_v1::client::Reservations;
14238/// let client = Reservations::builder().build().await?;
14239/// // use `client` to make requests to the Google Compute Engine API.
14240/// # gax::client_builder::Result::<()>::Ok(()) });
14241/// ```
14242///
14243/// # Service Description
14244///
14245/// Service for the `reservations` resource.
14246///
14247/// # Configuration
14248///
14249/// To configure `Reservations` use the `with_*` methods in the type returned
14250/// by [builder()][Reservations::builder]. The default configuration should
14251/// work for most applications. Common configuration changes include
14252///
14253/// * [with_endpoint()]: by default this client uses the global default endpoint
14254/// (`https://compute.googleapis.com`). Applications using regional
14255/// endpoints or running in restricted networks (e.g. a network configured
14256// with [Private Google Access with VPC Service Controls]) may want to
14257/// override this default.
14258/// * [with_credentials()]: by default this client uses
14259/// [Application Default Credentials]. Applications using custom
14260/// authentication may need to override this default.
14261///
14262/// [with_endpoint()]: super::builder::reservations::ClientBuilder::with_endpoint
14263/// [with_credentials()]: super::builder::reservations::ClientBuilder::credentials
14264/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14265/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14266///
14267/// # Pooling and Cloning
14268///
14269/// `Reservations` holds a connection pool internally, it is advised to
14270/// create one and the reuse it. You do not need to wrap `Reservations` in
14271/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14272/// already uses an `Arc` internally.
14273#[cfg(feature = "reservations")]
14274#[cfg_attr(docsrs, doc(cfg(feature = "reservations")))]
14275#[derive(Clone, Debug)]
14276pub struct Reservations {
14277 inner: std::sync::Arc<dyn super::stub::dynamic::Reservations>,
14278}
14279
14280#[cfg(feature = "reservations")]
14281impl Reservations {
14282 /// Returns a builder for [Reservations].
14283 ///
14284 /// ```
14285 /// # tokio_test::block_on(async {
14286 /// # use google_cloud_compute_v1::client::Reservations;
14287 /// let client = Reservations::builder().build().await?;
14288 /// # gax::client_builder::Result::<()>::Ok(()) });
14289 /// ```
14290 pub fn builder() -> super::builder::reservations::ClientBuilder {
14291 gax::client_builder::internal::new_builder(super::builder::reservations::client::Factory)
14292 }
14293
14294 /// Creates a new client from the provided stub.
14295 ///
14296 /// The most common case for calling this function is in tests mocking the
14297 /// client's behavior.
14298 pub fn from_stub<T>(stub: T) -> Self
14299 where
14300 T: super::stub::Reservations + 'static,
14301 {
14302 Self {
14303 inner: std::sync::Arc::new(stub),
14304 }
14305 }
14306
14307 pub(crate) async fn new(
14308 config: gaxi::options::ClientConfig,
14309 ) -> gax::client_builder::Result<Self> {
14310 let inner = Self::build_inner(config).await?;
14311 Ok(Self { inner })
14312 }
14313
14314 async fn build_inner(
14315 conf: gaxi::options::ClientConfig,
14316 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Reservations>> {
14317 if gaxi::options::tracing_enabled(&conf) {
14318 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14319 }
14320 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14321 }
14322
14323 async fn build_transport(
14324 conf: gaxi::options::ClientConfig,
14325 ) -> gax::client_builder::Result<impl super::stub::Reservations> {
14326 super::transport::Reservations::new(conf).await
14327 }
14328
14329 async fn build_with_tracing(
14330 conf: gaxi::options::ClientConfig,
14331 ) -> gax::client_builder::Result<impl super::stub::Reservations> {
14332 Self::build_transport(conf)
14333 .await
14334 .map(super::tracing::Reservations::new)
14335 }
14336
14337 /// Retrieves an aggregated list of reservations.
14338 ///
14339 /// To prevent failure, it is recommended that you set the
14340 /// `returnPartialSuccess` parameter to `true`.
14341 pub fn aggregated_list(&self) -> super::builder::reservations::AggregatedList {
14342 super::builder::reservations::AggregatedList::new(self.inner.clone())
14343 }
14344
14345 /// Deletes the specified reservation.
14346 pub fn delete(&self) -> super::builder::reservations::Delete {
14347 super::builder::reservations::Delete::new(self.inner.clone())
14348 }
14349
14350 /// Retrieves information about the specified reservation.
14351 pub fn get(&self) -> super::builder::reservations::Get {
14352 super::builder::reservations::Get::new(self.inner.clone())
14353 }
14354
14355 /// Gets the access control policy for a resource. May be empty if no such
14356 /// policy or resource exists.
14357 pub fn get_iam_policy(&self) -> super::builder::reservations::GetIamPolicy {
14358 super::builder::reservations::GetIamPolicy::new(self.inner.clone())
14359 }
14360
14361 /// Creates a new reservation. For more information, readReserving zonal
14362 /// resources.
14363 pub fn insert(&self) -> super::builder::reservations::Insert {
14364 super::builder::reservations::Insert::new(self.inner.clone())
14365 }
14366
14367 /// A list of all the reservations that have been configured for the
14368 /// specified project in specified zone.
14369 pub fn list(&self) -> super::builder::reservations::List {
14370 super::builder::reservations::List::new(self.inner.clone())
14371 }
14372
14373 /// Perform maintenance on an extended reservation
14374 pub fn perform_maintenance(&self) -> super::builder::reservations::PerformMaintenance {
14375 super::builder::reservations::PerformMaintenance::new(self.inner.clone())
14376 }
14377
14378 /// Resizes the reservation (applicable to standalone reservations only). For
14379 /// more information, readModifying
14380 /// reservations.
14381 pub fn resize(&self) -> super::builder::reservations::Resize {
14382 super::builder::reservations::Resize::new(self.inner.clone())
14383 }
14384
14385 /// Sets the access control policy on the specified resource.
14386 /// Replaces any existing policy.
14387 pub fn set_iam_policy(&self) -> super::builder::reservations::SetIamPolicy {
14388 super::builder::reservations::SetIamPolicy::new(self.inner.clone())
14389 }
14390
14391 /// Returns permissions that a caller has on the specified resource.
14392 pub fn test_iam_permissions(&self) -> super::builder::reservations::TestIamPermissions {
14393 super::builder::reservations::TestIamPermissions::new(self.inner.clone())
14394 }
14395
14396 /// Update share settings of the reservation.
14397 pub fn update(&self) -> super::builder::reservations::Update {
14398 super::builder::reservations::Update::new(self.inner.clone())
14399 }
14400
14401 /// Retrieves the specified zone-specific Operations resource.
14402 pub fn get_operation(&self) -> super::builder::reservations::GetOperation {
14403 super::builder::reservations::GetOperation::new(self.inner.clone())
14404 }
14405}
14406
14407/// Implements a client for the Google Compute Engine API.
14408///
14409/// # Example
14410/// ```
14411/// # tokio_test::block_on(async {
14412/// # use google_cloud_compute_v1::client::ResourcePolicies;
14413/// let client = ResourcePolicies::builder().build().await?;
14414/// // use `client` to make requests to the Google Compute Engine API.
14415/// # gax::client_builder::Result::<()>::Ok(()) });
14416/// ```
14417///
14418/// # Service Description
14419///
14420/// Service for the `resourcePolicies` resource.
14421///
14422/// # Configuration
14423///
14424/// To configure `ResourcePolicies` use the `with_*` methods in the type returned
14425/// by [builder()][ResourcePolicies::builder]. The default configuration should
14426/// work for most applications. Common configuration changes include
14427///
14428/// * [with_endpoint()]: by default this client uses the global default endpoint
14429/// (`https://compute.googleapis.com`). Applications using regional
14430/// endpoints or running in restricted networks (e.g. a network configured
14431// with [Private Google Access with VPC Service Controls]) may want to
14432/// override this default.
14433/// * [with_credentials()]: by default this client uses
14434/// [Application Default Credentials]. Applications using custom
14435/// authentication may need to override this default.
14436///
14437/// [with_endpoint()]: super::builder::resource_policies::ClientBuilder::with_endpoint
14438/// [with_credentials()]: super::builder::resource_policies::ClientBuilder::credentials
14439/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14440/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14441///
14442/// # Pooling and Cloning
14443///
14444/// `ResourcePolicies` holds a connection pool internally, it is advised to
14445/// create one and the reuse it. You do not need to wrap `ResourcePolicies` in
14446/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14447/// already uses an `Arc` internally.
14448#[cfg(feature = "resource-policies")]
14449#[cfg_attr(docsrs, doc(cfg(feature = "resource-policies")))]
14450#[derive(Clone, Debug)]
14451pub struct ResourcePolicies {
14452 inner: std::sync::Arc<dyn super::stub::dynamic::ResourcePolicies>,
14453}
14454
14455#[cfg(feature = "resource-policies")]
14456impl ResourcePolicies {
14457 /// Returns a builder for [ResourcePolicies].
14458 ///
14459 /// ```
14460 /// # tokio_test::block_on(async {
14461 /// # use google_cloud_compute_v1::client::ResourcePolicies;
14462 /// let client = ResourcePolicies::builder().build().await?;
14463 /// # gax::client_builder::Result::<()>::Ok(()) });
14464 /// ```
14465 pub fn builder() -> super::builder::resource_policies::ClientBuilder {
14466 gax::client_builder::internal::new_builder(
14467 super::builder::resource_policies::client::Factory,
14468 )
14469 }
14470
14471 /// Creates a new client from the provided stub.
14472 ///
14473 /// The most common case for calling this function is in tests mocking the
14474 /// client's behavior.
14475 pub fn from_stub<T>(stub: T) -> Self
14476 where
14477 T: super::stub::ResourcePolicies + 'static,
14478 {
14479 Self {
14480 inner: std::sync::Arc::new(stub),
14481 }
14482 }
14483
14484 pub(crate) async fn new(
14485 config: gaxi::options::ClientConfig,
14486 ) -> gax::client_builder::Result<Self> {
14487 let inner = Self::build_inner(config).await?;
14488 Ok(Self { inner })
14489 }
14490
14491 async fn build_inner(
14492 conf: gaxi::options::ClientConfig,
14493 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::ResourcePolicies>>
14494 {
14495 if gaxi::options::tracing_enabled(&conf) {
14496 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14497 }
14498 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14499 }
14500
14501 async fn build_transport(
14502 conf: gaxi::options::ClientConfig,
14503 ) -> gax::client_builder::Result<impl super::stub::ResourcePolicies> {
14504 super::transport::ResourcePolicies::new(conf).await
14505 }
14506
14507 async fn build_with_tracing(
14508 conf: gaxi::options::ClientConfig,
14509 ) -> gax::client_builder::Result<impl super::stub::ResourcePolicies> {
14510 Self::build_transport(conf)
14511 .await
14512 .map(super::tracing::ResourcePolicies::new)
14513 }
14514
14515 /// Retrieves an aggregated list of resource policies.
14516 ///
14517 /// To prevent failure, Google recommends that you set the
14518 /// `returnPartialSuccess` parameter to `true`.
14519 pub fn aggregated_list(&self) -> super::builder::resource_policies::AggregatedList {
14520 super::builder::resource_policies::AggregatedList::new(self.inner.clone())
14521 }
14522
14523 /// Deletes the specified resource policy.
14524 pub fn delete(&self) -> super::builder::resource_policies::Delete {
14525 super::builder::resource_policies::Delete::new(self.inner.clone())
14526 }
14527
14528 /// Retrieves all information of the specified resource policy.
14529 pub fn get(&self) -> super::builder::resource_policies::Get {
14530 super::builder::resource_policies::Get::new(self.inner.clone())
14531 }
14532
14533 /// Gets the access control policy for a resource. May be empty if no such
14534 /// policy or resource exists.
14535 pub fn get_iam_policy(&self) -> super::builder::resource_policies::GetIamPolicy {
14536 super::builder::resource_policies::GetIamPolicy::new(self.inner.clone())
14537 }
14538
14539 /// Creates a new resource policy.
14540 pub fn insert(&self) -> super::builder::resource_policies::Insert {
14541 super::builder::resource_policies::Insert::new(self.inner.clone())
14542 }
14543
14544 /// A list all the resource policies that have been configured for the
14545 /// specified project in specified region.
14546 pub fn list(&self) -> super::builder::resource_policies::List {
14547 super::builder::resource_policies::List::new(self.inner.clone())
14548 }
14549
14550 /// Modify the specified resource policy.
14551 pub fn patch(&self) -> super::builder::resource_policies::Patch {
14552 super::builder::resource_policies::Patch::new(self.inner.clone())
14553 }
14554
14555 /// Sets the access control policy on the specified resource.
14556 /// Replaces any existing policy.
14557 pub fn set_iam_policy(&self) -> super::builder::resource_policies::SetIamPolicy {
14558 super::builder::resource_policies::SetIamPolicy::new(self.inner.clone())
14559 }
14560
14561 /// Returns permissions that a caller has on the specified resource.
14562 pub fn test_iam_permissions(&self) -> super::builder::resource_policies::TestIamPermissions {
14563 super::builder::resource_policies::TestIamPermissions::new(self.inner.clone())
14564 }
14565
14566 /// Retrieves the specified region-specific Operations resource.
14567 pub fn get_operation(&self) -> super::builder::resource_policies::GetOperation {
14568 super::builder::resource_policies::GetOperation::new(self.inner.clone())
14569 }
14570}
14571
14572/// Implements a client for the Google Compute Engine API.
14573///
14574/// # Example
14575/// ```
14576/// # tokio_test::block_on(async {
14577/// # use google_cloud_compute_v1::client::Routers;
14578/// let client = Routers::builder().build().await?;
14579/// // use `client` to make requests to the Google Compute Engine API.
14580/// # gax::client_builder::Result::<()>::Ok(()) });
14581/// ```
14582///
14583/// # Service Description
14584///
14585/// Service for the `routers` resource.
14586///
14587/// # Configuration
14588///
14589/// To configure `Routers` use the `with_*` methods in the type returned
14590/// by [builder()][Routers::builder]. The default configuration should
14591/// work for most applications. Common configuration changes include
14592///
14593/// * [with_endpoint()]: by default this client uses the global default endpoint
14594/// (`https://compute.googleapis.com`). Applications using regional
14595/// endpoints or running in restricted networks (e.g. a network configured
14596// with [Private Google Access with VPC Service Controls]) may want to
14597/// override this default.
14598/// * [with_credentials()]: by default this client uses
14599/// [Application Default Credentials]. Applications using custom
14600/// authentication may need to override this default.
14601///
14602/// [with_endpoint()]: super::builder::routers::ClientBuilder::with_endpoint
14603/// [with_credentials()]: super::builder::routers::ClientBuilder::credentials
14604/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14605/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14606///
14607/// # Pooling and Cloning
14608///
14609/// `Routers` holds a connection pool internally, it is advised to
14610/// create one and the reuse it. You do not need to wrap `Routers` in
14611/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14612/// already uses an `Arc` internally.
14613#[cfg(feature = "routers")]
14614#[cfg_attr(docsrs, doc(cfg(feature = "routers")))]
14615#[derive(Clone, Debug)]
14616pub struct Routers {
14617 inner: std::sync::Arc<dyn super::stub::dynamic::Routers>,
14618}
14619
14620#[cfg(feature = "routers")]
14621impl Routers {
14622 /// Returns a builder for [Routers].
14623 ///
14624 /// ```
14625 /// # tokio_test::block_on(async {
14626 /// # use google_cloud_compute_v1::client::Routers;
14627 /// let client = Routers::builder().build().await?;
14628 /// # gax::client_builder::Result::<()>::Ok(()) });
14629 /// ```
14630 pub fn builder() -> super::builder::routers::ClientBuilder {
14631 gax::client_builder::internal::new_builder(super::builder::routers::client::Factory)
14632 }
14633
14634 /// Creates a new client from the provided stub.
14635 ///
14636 /// The most common case for calling this function is in tests mocking the
14637 /// client's behavior.
14638 pub fn from_stub<T>(stub: T) -> Self
14639 where
14640 T: super::stub::Routers + 'static,
14641 {
14642 Self {
14643 inner: std::sync::Arc::new(stub),
14644 }
14645 }
14646
14647 pub(crate) async fn new(
14648 config: gaxi::options::ClientConfig,
14649 ) -> gax::client_builder::Result<Self> {
14650 let inner = Self::build_inner(config).await?;
14651 Ok(Self { inner })
14652 }
14653
14654 async fn build_inner(
14655 conf: gaxi::options::ClientConfig,
14656 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Routers>> {
14657 if gaxi::options::tracing_enabled(&conf) {
14658 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14659 }
14660 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14661 }
14662
14663 async fn build_transport(
14664 conf: gaxi::options::ClientConfig,
14665 ) -> gax::client_builder::Result<impl super::stub::Routers> {
14666 super::transport::Routers::new(conf).await
14667 }
14668
14669 async fn build_with_tracing(
14670 conf: gaxi::options::ClientConfig,
14671 ) -> gax::client_builder::Result<impl super::stub::Routers> {
14672 Self::build_transport(conf)
14673 .await
14674 .map(super::tracing::Routers::new)
14675 }
14676
14677 /// Retrieves an aggregated list of routers.
14678 ///
14679 /// To prevent failure, Google recommends that you set the
14680 /// `returnPartialSuccess` parameter to `true`.
14681 pub fn aggregated_list(&self) -> super::builder::routers::AggregatedList {
14682 super::builder::routers::AggregatedList::new(self.inner.clone())
14683 }
14684
14685 /// Deletes the specified Router resource.
14686 pub fn delete(&self) -> super::builder::routers::Delete {
14687 super::builder::routers::Delete::new(self.inner.clone())
14688 }
14689
14690 /// Deletes Route Policy
14691 pub fn delete_route_policy(&self) -> super::builder::routers::DeleteRoutePolicy {
14692 super::builder::routers::DeleteRoutePolicy::new(self.inner.clone())
14693 }
14694
14695 /// Returns the specified Router resource.
14696 pub fn get(&self) -> super::builder::routers::Get {
14697 super::builder::routers::Get::new(self.inner.clone())
14698 }
14699
14700 /// Retrieves runtime NAT IP information.
14701 pub fn get_nat_ip_info(&self) -> super::builder::routers::GetNatIpInfo {
14702 super::builder::routers::GetNatIpInfo::new(self.inner.clone())
14703 }
14704
14705 /// Retrieves runtime Nat mapping information of VM endpoints.
14706 pub fn get_nat_mapping_info(&self) -> super::builder::routers::GetNatMappingInfo {
14707 super::builder::routers::GetNatMappingInfo::new(self.inner.clone())
14708 }
14709
14710 /// Returns specified Route Policy
14711 pub fn get_route_policy(&self) -> super::builder::routers::GetRoutePolicy {
14712 super::builder::routers::GetRoutePolicy::new(self.inner.clone())
14713 }
14714
14715 /// Retrieves runtime information of the specified router.
14716 pub fn get_router_status(&self) -> super::builder::routers::GetRouterStatus {
14717 super::builder::routers::GetRouterStatus::new(self.inner.clone())
14718 }
14719
14720 /// Creates a Router resource in the specified project and region using
14721 /// the data included in the request.
14722 pub fn insert(&self) -> super::builder::routers::Insert {
14723 super::builder::routers::Insert::new(self.inner.clone())
14724 }
14725
14726 /// Retrieves a list of Router resources available to the specified project.
14727 pub fn list(&self) -> super::builder::routers::List {
14728 super::builder::routers::List::new(self.inner.clone())
14729 }
14730
14731 /// Retrieves a list of router bgp routes available to the specified project.
14732 pub fn list_bgp_routes(&self) -> super::builder::routers::ListBgpRoutes {
14733 super::builder::routers::ListBgpRoutes::new(self.inner.clone())
14734 }
14735
14736 /// Retrieves a list of router route policy subresources available to the
14737 /// specified project.
14738 pub fn list_route_policies(&self) -> super::builder::routers::ListRoutePolicies {
14739 super::builder::routers::ListRoutePolicies::new(self.inner.clone())
14740 }
14741
14742 /// Patches the specified Router resource with the data included in the
14743 /// request. This method supportsPATCH
14744 /// semantics and usesJSON merge
14745 /// patch format and processing rules.
14746 pub fn patch(&self) -> super::builder::routers::Patch {
14747 super::builder::routers::Patch::new(self.inner.clone())
14748 }
14749
14750 /// Patches Route Policy
14751 pub fn patch_route_policy(&self) -> super::builder::routers::PatchRoutePolicy {
14752 super::builder::routers::PatchRoutePolicy::new(self.inner.clone())
14753 }
14754
14755 /// Preview fields auto-generated during router create andupdate operations.
14756 /// Calling this method does NOT create or update the router.
14757 pub fn preview(&self) -> super::builder::routers::Preview {
14758 super::builder::routers::Preview::new(self.inner.clone())
14759 }
14760
14761 /// Updates the specified Router resource with the data included in the
14762 /// request. This method conforms toPUT semantics, which requests that the state of the
14763 /// target resource be created or replaced with the state defined by the
14764 /// representation enclosed in the request message payload.
14765 pub fn update(&self) -> super::builder::routers::Update {
14766 super::builder::routers::Update::new(self.inner.clone())
14767 }
14768
14769 /// Updates or creates new Route Policy
14770 pub fn update_route_policy(&self) -> super::builder::routers::UpdateRoutePolicy {
14771 super::builder::routers::UpdateRoutePolicy::new(self.inner.clone())
14772 }
14773
14774 /// Retrieves the specified region-specific Operations resource.
14775 pub fn get_operation(&self) -> super::builder::routers::GetOperation {
14776 super::builder::routers::GetOperation::new(self.inner.clone())
14777 }
14778}
14779
14780/// Implements a client for the Google Compute Engine API.
14781///
14782/// # Example
14783/// ```
14784/// # tokio_test::block_on(async {
14785/// # use google_cloud_compute_v1::client::Routes;
14786/// let client = Routes::builder().build().await?;
14787/// // use `client` to make requests to the Google Compute Engine API.
14788/// # gax::client_builder::Result::<()>::Ok(()) });
14789/// ```
14790///
14791/// # Service Description
14792///
14793/// Service for the `routes` resource.
14794///
14795/// # Configuration
14796///
14797/// To configure `Routes` use the `with_*` methods in the type returned
14798/// by [builder()][Routes::builder]. The default configuration should
14799/// work for most applications. Common configuration changes include
14800///
14801/// * [with_endpoint()]: by default this client uses the global default endpoint
14802/// (`https://compute.googleapis.com`). Applications using regional
14803/// endpoints or running in restricted networks (e.g. a network configured
14804// with [Private Google Access with VPC Service Controls]) may want to
14805/// override this default.
14806/// * [with_credentials()]: by default this client uses
14807/// [Application Default Credentials]. Applications using custom
14808/// authentication may need to override this default.
14809///
14810/// [with_endpoint()]: super::builder::routes::ClientBuilder::with_endpoint
14811/// [with_credentials()]: super::builder::routes::ClientBuilder::credentials
14812/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14813/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14814///
14815/// # Pooling and Cloning
14816///
14817/// `Routes` holds a connection pool internally, it is advised to
14818/// create one and the reuse it. You do not need to wrap `Routes` in
14819/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14820/// already uses an `Arc` internally.
14821#[cfg(feature = "routes")]
14822#[cfg_attr(docsrs, doc(cfg(feature = "routes")))]
14823#[derive(Clone, Debug)]
14824pub struct Routes {
14825 inner: std::sync::Arc<dyn super::stub::dynamic::Routes>,
14826}
14827
14828#[cfg(feature = "routes")]
14829impl Routes {
14830 /// Returns a builder for [Routes].
14831 ///
14832 /// ```
14833 /// # tokio_test::block_on(async {
14834 /// # use google_cloud_compute_v1::client::Routes;
14835 /// let client = Routes::builder().build().await?;
14836 /// # gax::client_builder::Result::<()>::Ok(()) });
14837 /// ```
14838 pub fn builder() -> super::builder::routes::ClientBuilder {
14839 gax::client_builder::internal::new_builder(super::builder::routes::client::Factory)
14840 }
14841
14842 /// Creates a new client from the provided stub.
14843 ///
14844 /// The most common case for calling this function is in tests mocking the
14845 /// client's behavior.
14846 pub fn from_stub<T>(stub: T) -> Self
14847 where
14848 T: super::stub::Routes + 'static,
14849 {
14850 Self {
14851 inner: std::sync::Arc::new(stub),
14852 }
14853 }
14854
14855 pub(crate) async fn new(
14856 config: gaxi::options::ClientConfig,
14857 ) -> gax::client_builder::Result<Self> {
14858 let inner = Self::build_inner(config).await?;
14859 Ok(Self { inner })
14860 }
14861
14862 async fn build_inner(
14863 conf: gaxi::options::ClientConfig,
14864 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Routes>> {
14865 if gaxi::options::tracing_enabled(&conf) {
14866 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14867 }
14868 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14869 }
14870
14871 async fn build_transport(
14872 conf: gaxi::options::ClientConfig,
14873 ) -> gax::client_builder::Result<impl super::stub::Routes> {
14874 super::transport::Routes::new(conf).await
14875 }
14876
14877 async fn build_with_tracing(
14878 conf: gaxi::options::ClientConfig,
14879 ) -> gax::client_builder::Result<impl super::stub::Routes> {
14880 Self::build_transport(conf)
14881 .await
14882 .map(super::tracing::Routes::new)
14883 }
14884
14885 /// Deletes the specified Route resource.
14886 pub fn delete(&self) -> super::builder::routes::Delete {
14887 super::builder::routes::Delete::new(self.inner.clone())
14888 }
14889
14890 /// Returns the specified Route resource.
14891 pub fn get(&self) -> super::builder::routes::Get {
14892 super::builder::routes::Get::new(self.inner.clone())
14893 }
14894
14895 /// Creates a Route resource in the specified project using the data included
14896 /// in the request.
14897 pub fn insert(&self) -> super::builder::routes::Insert {
14898 super::builder::routes::Insert::new(self.inner.clone())
14899 }
14900
14901 /// Retrieves the list of Route resources available to the specified project.
14902 pub fn list(&self) -> super::builder::routes::List {
14903 super::builder::routes::List::new(self.inner.clone())
14904 }
14905
14906 /// Retrieves the specified Operations resource.
14907 pub fn get_operation(&self) -> super::builder::routes::GetOperation {
14908 super::builder::routes::GetOperation::new(self.inner.clone())
14909 }
14910}
14911
14912/// Implements a client for the Google Compute Engine API.
14913///
14914/// # Example
14915/// ```
14916/// # tokio_test::block_on(async {
14917/// # use google_cloud_compute_v1::client::SecurityPolicies;
14918/// let client = SecurityPolicies::builder().build().await?;
14919/// // use `client` to make requests to the Google Compute Engine API.
14920/// # gax::client_builder::Result::<()>::Ok(()) });
14921/// ```
14922///
14923/// # Service Description
14924///
14925/// Service for the `securityPolicies` resource.
14926///
14927/// # Configuration
14928///
14929/// To configure `SecurityPolicies` use the `with_*` methods in the type returned
14930/// by [builder()][SecurityPolicies::builder]. The default configuration should
14931/// work for most applications. Common configuration changes include
14932///
14933/// * [with_endpoint()]: by default this client uses the global default endpoint
14934/// (`https://compute.googleapis.com`). Applications using regional
14935/// endpoints or running in restricted networks (e.g. a network configured
14936// with [Private Google Access with VPC Service Controls]) may want to
14937/// override this default.
14938/// * [with_credentials()]: by default this client uses
14939/// [Application Default Credentials]. Applications using custom
14940/// authentication may need to override this default.
14941///
14942/// [with_endpoint()]: super::builder::security_policies::ClientBuilder::with_endpoint
14943/// [with_credentials()]: super::builder::security_policies::ClientBuilder::credentials
14944/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14945/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14946///
14947/// # Pooling and Cloning
14948///
14949/// `SecurityPolicies` holds a connection pool internally, it is advised to
14950/// create one and the reuse it. You do not need to wrap `SecurityPolicies` in
14951/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14952/// already uses an `Arc` internally.
14953#[cfg(feature = "security-policies")]
14954#[cfg_attr(docsrs, doc(cfg(feature = "security-policies")))]
14955#[derive(Clone, Debug)]
14956pub struct SecurityPolicies {
14957 inner: std::sync::Arc<dyn super::stub::dynamic::SecurityPolicies>,
14958}
14959
14960#[cfg(feature = "security-policies")]
14961impl SecurityPolicies {
14962 /// Returns a builder for [SecurityPolicies].
14963 ///
14964 /// ```
14965 /// # tokio_test::block_on(async {
14966 /// # use google_cloud_compute_v1::client::SecurityPolicies;
14967 /// let client = SecurityPolicies::builder().build().await?;
14968 /// # gax::client_builder::Result::<()>::Ok(()) });
14969 /// ```
14970 pub fn builder() -> super::builder::security_policies::ClientBuilder {
14971 gax::client_builder::internal::new_builder(
14972 super::builder::security_policies::client::Factory,
14973 )
14974 }
14975
14976 /// Creates a new client from the provided stub.
14977 ///
14978 /// The most common case for calling this function is in tests mocking the
14979 /// client's behavior.
14980 pub fn from_stub<T>(stub: T) -> Self
14981 where
14982 T: super::stub::SecurityPolicies + 'static,
14983 {
14984 Self {
14985 inner: std::sync::Arc::new(stub),
14986 }
14987 }
14988
14989 pub(crate) async fn new(
14990 config: gaxi::options::ClientConfig,
14991 ) -> gax::client_builder::Result<Self> {
14992 let inner = Self::build_inner(config).await?;
14993 Ok(Self { inner })
14994 }
14995
14996 async fn build_inner(
14997 conf: gaxi::options::ClientConfig,
14998 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::SecurityPolicies>>
14999 {
15000 if gaxi::options::tracing_enabled(&conf) {
15001 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15002 }
15003 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15004 }
15005
15006 async fn build_transport(
15007 conf: gaxi::options::ClientConfig,
15008 ) -> gax::client_builder::Result<impl super::stub::SecurityPolicies> {
15009 super::transport::SecurityPolicies::new(conf).await
15010 }
15011
15012 async fn build_with_tracing(
15013 conf: gaxi::options::ClientConfig,
15014 ) -> gax::client_builder::Result<impl super::stub::SecurityPolicies> {
15015 Self::build_transport(conf)
15016 .await
15017 .map(super::tracing::SecurityPolicies::new)
15018 }
15019
15020 /// Inserts a rule into a security policy.
15021 pub fn add_rule(&self) -> super::builder::security_policies::AddRule {
15022 super::builder::security_policies::AddRule::new(self.inner.clone())
15023 }
15024
15025 /// Retrieves the list of all SecurityPolicy resources, regional and global,
15026 /// available to the specified project.
15027 ///
15028 /// To prevent failure, Google recommends that you set the
15029 /// `returnPartialSuccess` parameter to `true`.
15030 pub fn aggregated_list(&self) -> super::builder::security_policies::AggregatedList {
15031 super::builder::security_policies::AggregatedList::new(self.inner.clone())
15032 }
15033
15034 /// Deletes the specified policy.
15035 pub fn delete(&self) -> super::builder::security_policies::Delete {
15036 super::builder::security_policies::Delete::new(self.inner.clone())
15037 }
15038
15039 /// List all of the ordered rules present in a single specified policy.
15040 pub fn get(&self) -> super::builder::security_policies::Get {
15041 super::builder::security_policies::Get::new(self.inner.clone())
15042 }
15043
15044 /// Gets a rule at the specified priority.
15045 pub fn get_rule(&self) -> super::builder::security_policies::GetRule {
15046 super::builder::security_policies::GetRule::new(self.inner.clone())
15047 }
15048
15049 /// Creates a new policy in the specified project using the data included in
15050 /// the request.
15051 pub fn insert(&self) -> super::builder::security_policies::Insert {
15052 super::builder::security_policies::Insert::new(self.inner.clone())
15053 }
15054
15055 /// List all the policies that have been configured for the specified project.
15056 pub fn list(&self) -> super::builder::security_policies::List {
15057 super::builder::security_policies::List::new(self.inner.clone())
15058 }
15059
15060 /// Gets the current list of preconfigured Web Application Firewall (WAF)
15061 /// expressions.
15062 pub fn list_preconfigured_expression_sets(
15063 &self,
15064 ) -> super::builder::security_policies::ListPreconfiguredExpressionSets {
15065 super::builder::security_policies::ListPreconfiguredExpressionSets::new(self.inner.clone())
15066 }
15067
15068 /// Patches the specified policy with the data included in the request. To
15069 /// clear fields in the policy, leave the fields empty and specify them in the
15070 /// updateMask. This cannot be used to be update the rules in the policy.
15071 /// Please use the per rule methods like addRule, patchRule, and removeRule
15072 /// instead.
15073 pub fn patch(&self) -> super::builder::security_policies::Patch {
15074 super::builder::security_policies::Patch::new(self.inner.clone())
15075 }
15076
15077 /// Patches a rule at the specified priority. To clear fields in the rule,
15078 /// leave the fields empty and specify them in the updateMask.
15079 pub fn patch_rule(&self) -> super::builder::security_policies::PatchRule {
15080 super::builder::security_policies::PatchRule::new(self.inner.clone())
15081 }
15082
15083 /// Deletes a rule at the specified priority.
15084 pub fn remove_rule(&self) -> super::builder::security_policies::RemoveRule {
15085 super::builder::security_policies::RemoveRule::new(self.inner.clone())
15086 }
15087
15088 /// Sets the labels on a security policy. To learn more about labels,
15089 /// read the Labeling Resources
15090 /// documentation.
15091 pub fn set_labels(&self) -> super::builder::security_policies::SetLabels {
15092 super::builder::security_policies::SetLabels::new(self.inner.clone())
15093 }
15094
15095 /// Retrieves the specified Operations resource.
15096 pub fn get_operation(&self) -> super::builder::security_policies::GetOperation {
15097 super::builder::security_policies::GetOperation::new(self.inner.clone())
15098 }
15099}
15100
15101/// Implements a client for the Google Compute Engine API.
15102///
15103/// # Example
15104/// ```
15105/// # tokio_test::block_on(async {
15106/// # use google_cloud_compute_v1::client::ServiceAttachments;
15107/// let client = ServiceAttachments::builder().build().await?;
15108/// // use `client` to make requests to the Google Compute Engine API.
15109/// # gax::client_builder::Result::<()>::Ok(()) });
15110/// ```
15111///
15112/// # Service Description
15113///
15114/// Service for the `serviceAttachments` resource.
15115///
15116/// # Configuration
15117///
15118/// To configure `ServiceAttachments` use the `with_*` methods in the type returned
15119/// by [builder()][ServiceAttachments::builder]. The default configuration should
15120/// work for most applications. Common configuration changes include
15121///
15122/// * [with_endpoint()]: by default this client uses the global default endpoint
15123/// (`https://compute.googleapis.com`). Applications using regional
15124/// endpoints or running in restricted networks (e.g. a network configured
15125// with [Private Google Access with VPC Service Controls]) may want to
15126/// override this default.
15127/// * [with_credentials()]: by default this client uses
15128/// [Application Default Credentials]. Applications using custom
15129/// authentication may need to override this default.
15130///
15131/// [with_endpoint()]: super::builder::service_attachments::ClientBuilder::with_endpoint
15132/// [with_credentials()]: super::builder::service_attachments::ClientBuilder::credentials
15133/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15134/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15135///
15136/// # Pooling and Cloning
15137///
15138/// `ServiceAttachments` holds a connection pool internally, it is advised to
15139/// create one and the reuse it. You do not need to wrap `ServiceAttachments` in
15140/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15141/// already uses an `Arc` internally.
15142#[cfg(feature = "service-attachments")]
15143#[cfg_attr(docsrs, doc(cfg(feature = "service-attachments")))]
15144#[derive(Clone, Debug)]
15145pub struct ServiceAttachments {
15146 inner: std::sync::Arc<dyn super::stub::dynamic::ServiceAttachments>,
15147}
15148
15149#[cfg(feature = "service-attachments")]
15150impl ServiceAttachments {
15151 /// Returns a builder for [ServiceAttachments].
15152 ///
15153 /// ```
15154 /// # tokio_test::block_on(async {
15155 /// # use google_cloud_compute_v1::client::ServiceAttachments;
15156 /// let client = ServiceAttachments::builder().build().await?;
15157 /// # gax::client_builder::Result::<()>::Ok(()) });
15158 /// ```
15159 pub fn builder() -> super::builder::service_attachments::ClientBuilder {
15160 gax::client_builder::internal::new_builder(
15161 super::builder::service_attachments::client::Factory,
15162 )
15163 }
15164
15165 /// Creates a new client from the provided stub.
15166 ///
15167 /// The most common case for calling this function is in tests mocking the
15168 /// client's behavior.
15169 pub fn from_stub<T>(stub: T) -> Self
15170 where
15171 T: super::stub::ServiceAttachments + 'static,
15172 {
15173 Self {
15174 inner: std::sync::Arc::new(stub),
15175 }
15176 }
15177
15178 pub(crate) async fn new(
15179 config: gaxi::options::ClientConfig,
15180 ) -> gax::client_builder::Result<Self> {
15181 let inner = Self::build_inner(config).await?;
15182 Ok(Self { inner })
15183 }
15184
15185 async fn build_inner(
15186 conf: gaxi::options::ClientConfig,
15187 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::ServiceAttachments>>
15188 {
15189 if gaxi::options::tracing_enabled(&conf) {
15190 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15191 }
15192 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15193 }
15194
15195 async fn build_transport(
15196 conf: gaxi::options::ClientConfig,
15197 ) -> gax::client_builder::Result<impl super::stub::ServiceAttachments> {
15198 super::transport::ServiceAttachments::new(conf).await
15199 }
15200
15201 async fn build_with_tracing(
15202 conf: gaxi::options::ClientConfig,
15203 ) -> gax::client_builder::Result<impl super::stub::ServiceAttachments> {
15204 Self::build_transport(conf)
15205 .await
15206 .map(super::tracing::ServiceAttachments::new)
15207 }
15208
15209 /// Retrieves the list of all ServiceAttachment resources,
15210 /// regional and global, available to the specified project.
15211 ///
15212 /// To prevent failure, Google recommends that you set the
15213 /// `returnPartialSuccess` parameter to `true`.
15214 pub fn aggregated_list(&self) -> super::builder::service_attachments::AggregatedList {
15215 super::builder::service_attachments::AggregatedList::new(self.inner.clone())
15216 }
15217
15218 /// Deletes the specified ServiceAttachment in the given scope
15219 pub fn delete(&self) -> super::builder::service_attachments::Delete {
15220 super::builder::service_attachments::Delete::new(self.inner.clone())
15221 }
15222
15223 /// Returns the specified ServiceAttachment resource in the given scope.
15224 pub fn get(&self) -> super::builder::service_attachments::Get {
15225 super::builder::service_attachments::Get::new(self.inner.clone())
15226 }
15227
15228 /// Gets the access control policy for a resource. May be empty if no such
15229 /// policy or resource exists.
15230 pub fn get_iam_policy(&self) -> super::builder::service_attachments::GetIamPolicy {
15231 super::builder::service_attachments::GetIamPolicy::new(self.inner.clone())
15232 }
15233
15234 /// Creates a ServiceAttachment in the specified project in the given scope
15235 /// using the parameters that are included in the request.
15236 pub fn insert(&self) -> super::builder::service_attachments::Insert {
15237 super::builder::service_attachments::Insert::new(self.inner.clone())
15238 }
15239
15240 /// Lists the ServiceAttachments for a project in the given scope.
15241 pub fn list(&self) -> super::builder::service_attachments::List {
15242 super::builder::service_attachments::List::new(self.inner.clone())
15243 }
15244
15245 /// Patches the specified ServiceAttachment resource with the data included in
15246 /// the request. This method supports PATCH
15247 /// semantics and usesJSON merge
15248 /// patch format and processing rules.
15249 pub fn patch(&self) -> super::builder::service_attachments::Patch {
15250 super::builder::service_attachments::Patch::new(self.inner.clone())
15251 }
15252
15253 /// Sets the access control policy on the specified resource.
15254 /// Replaces any existing policy.
15255 pub fn set_iam_policy(&self) -> super::builder::service_attachments::SetIamPolicy {
15256 super::builder::service_attachments::SetIamPolicy::new(self.inner.clone())
15257 }
15258
15259 /// Returns permissions that a caller has on the specified resource.
15260 pub fn test_iam_permissions(&self) -> super::builder::service_attachments::TestIamPermissions {
15261 super::builder::service_attachments::TestIamPermissions::new(self.inner.clone())
15262 }
15263
15264 /// Retrieves the specified region-specific Operations resource.
15265 pub fn get_operation(&self) -> super::builder::service_attachments::GetOperation {
15266 super::builder::service_attachments::GetOperation::new(self.inner.clone())
15267 }
15268}
15269
15270/// Implements a client for the Google Compute Engine API.
15271///
15272/// # Example
15273/// ```
15274/// # tokio_test::block_on(async {
15275/// # use google_cloud_compute_v1::client::SnapshotSettings;
15276/// let client = SnapshotSettings::builder().build().await?;
15277/// // use `client` to make requests to the Google Compute Engine API.
15278/// # gax::client_builder::Result::<()>::Ok(()) });
15279/// ```
15280///
15281/// # Service Description
15282///
15283/// Service for the `snapshotSettings` resource.
15284///
15285/// # Configuration
15286///
15287/// To configure `SnapshotSettings` use the `with_*` methods in the type returned
15288/// by [builder()][SnapshotSettings::builder]. The default configuration should
15289/// work for most applications. Common configuration changes include
15290///
15291/// * [with_endpoint()]: by default this client uses the global default endpoint
15292/// (`https://compute.googleapis.com`). Applications using regional
15293/// endpoints or running in restricted networks (e.g. a network configured
15294// with [Private Google Access with VPC Service Controls]) may want to
15295/// override this default.
15296/// * [with_credentials()]: by default this client uses
15297/// [Application Default Credentials]. Applications using custom
15298/// authentication may need to override this default.
15299///
15300/// [with_endpoint()]: super::builder::snapshot_settings::ClientBuilder::with_endpoint
15301/// [with_credentials()]: super::builder::snapshot_settings::ClientBuilder::credentials
15302/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15303/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15304///
15305/// # Pooling and Cloning
15306///
15307/// `SnapshotSettings` holds a connection pool internally, it is advised to
15308/// create one and the reuse it. You do not need to wrap `SnapshotSettings` in
15309/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15310/// already uses an `Arc` internally.
15311#[cfg(feature = "snapshot-settings")]
15312#[cfg_attr(docsrs, doc(cfg(feature = "snapshot-settings")))]
15313#[derive(Clone, Debug)]
15314pub struct SnapshotSettings {
15315 inner: std::sync::Arc<dyn super::stub::dynamic::SnapshotSettings>,
15316}
15317
15318#[cfg(feature = "snapshot-settings")]
15319impl SnapshotSettings {
15320 /// Returns a builder for [SnapshotSettings].
15321 ///
15322 /// ```
15323 /// # tokio_test::block_on(async {
15324 /// # use google_cloud_compute_v1::client::SnapshotSettings;
15325 /// let client = SnapshotSettings::builder().build().await?;
15326 /// # gax::client_builder::Result::<()>::Ok(()) });
15327 /// ```
15328 pub fn builder() -> super::builder::snapshot_settings::ClientBuilder {
15329 gax::client_builder::internal::new_builder(
15330 super::builder::snapshot_settings::client::Factory,
15331 )
15332 }
15333
15334 /// Creates a new client from the provided stub.
15335 ///
15336 /// The most common case for calling this function is in tests mocking the
15337 /// client's behavior.
15338 pub fn from_stub<T>(stub: T) -> Self
15339 where
15340 T: super::stub::SnapshotSettings + 'static,
15341 {
15342 Self {
15343 inner: std::sync::Arc::new(stub),
15344 }
15345 }
15346
15347 pub(crate) async fn new(
15348 config: gaxi::options::ClientConfig,
15349 ) -> gax::client_builder::Result<Self> {
15350 let inner = Self::build_inner(config).await?;
15351 Ok(Self { inner })
15352 }
15353
15354 async fn build_inner(
15355 conf: gaxi::options::ClientConfig,
15356 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::SnapshotSettings>>
15357 {
15358 if gaxi::options::tracing_enabled(&conf) {
15359 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15360 }
15361 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15362 }
15363
15364 async fn build_transport(
15365 conf: gaxi::options::ClientConfig,
15366 ) -> gax::client_builder::Result<impl super::stub::SnapshotSettings> {
15367 super::transport::SnapshotSettings::new(conf).await
15368 }
15369
15370 async fn build_with_tracing(
15371 conf: gaxi::options::ClientConfig,
15372 ) -> gax::client_builder::Result<impl super::stub::SnapshotSettings> {
15373 Self::build_transport(conf)
15374 .await
15375 .map(super::tracing::SnapshotSettings::new)
15376 }
15377
15378 /// Get snapshot settings.
15379 pub fn get(&self) -> super::builder::snapshot_settings::Get {
15380 super::builder::snapshot_settings::Get::new(self.inner.clone())
15381 }
15382
15383 /// Patch snapshot settings.
15384 pub fn patch(&self) -> super::builder::snapshot_settings::Patch {
15385 super::builder::snapshot_settings::Patch::new(self.inner.clone())
15386 }
15387
15388 /// Retrieves the specified Operations resource.
15389 pub fn get_operation(&self) -> super::builder::snapshot_settings::GetOperation {
15390 super::builder::snapshot_settings::GetOperation::new(self.inner.clone())
15391 }
15392}
15393
15394/// Implements a client for the Google Compute Engine API.
15395///
15396/// # Example
15397/// ```
15398/// # tokio_test::block_on(async {
15399/// # use google_cloud_compute_v1::client::Snapshots;
15400/// let client = Snapshots::builder().build().await?;
15401/// // use `client` to make requests to the Google Compute Engine API.
15402/// # gax::client_builder::Result::<()>::Ok(()) });
15403/// ```
15404///
15405/// # Service Description
15406///
15407/// Service for the `snapshots` resource.
15408///
15409/// # Configuration
15410///
15411/// To configure `Snapshots` use the `with_*` methods in the type returned
15412/// by [builder()][Snapshots::builder]. The default configuration should
15413/// work for most applications. Common configuration changes include
15414///
15415/// * [with_endpoint()]: by default this client uses the global default endpoint
15416/// (`https://compute.googleapis.com`). Applications using regional
15417/// endpoints or running in restricted networks (e.g. a network configured
15418// with [Private Google Access with VPC Service Controls]) may want to
15419/// override this default.
15420/// * [with_credentials()]: by default this client uses
15421/// [Application Default Credentials]. Applications using custom
15422/// authentication may need to override this default.
15423///
15424/// [with_endpoint()]: super::builder::snapshots::ClientBuilder::with_endpoint
15425/// [with_credentials()]: super::builder::snapshots::ClientBuilder::credentials
15426/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15427/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15428///
15429/// # Pooling and Cloning
15430///
15431/// `Snapshots` holds a connection pool internally, it is advised to
15432/// create one and the reuse it. You do not need to wrap `Snapshots` in
15433/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15434/// already uses an `Arc` internally.
15435#[cfg(feature = "snapshots")]
15436#[cfg_attr(docsrs, doc(cfg(feature = "snapshots")))]
15437#[derive(Clone, Debug)]
15438pub struct Snapshots {
15439 inner: std::sync::Arc<dyn super::stub::dynamic::Snapshots>,
15440}
15441
15442#[cfg(feature = "snapshots")]
15443impl Snapshots {
15444 /// Returns a builder for [Snapshots].
15445 ///
15446 /// ```
15447 /// # tokio_test::block_on(async {
15448 /// # use google_cloud_compute_v1::client::Snapshots;
15449 /// let client = Snapshots::builder().build().await?;
15450 /// # gax::client_builder::Result::<()>::Ok(()) });
15451 /// ```
15452 pub fn builder() -> super::builder::snapshots::ClientBuilder {
15453 gax::client_builder::internal::new_builder(super::builder::snapshots::client::Factory)
15454 }
15455
15456 /// Creates a new client from the provided stub.
15457 ///
15458 /// The most common case for calling this function is in tests mocking the
15459 /// client's behavior.
15460 pub fn from_stub<T>(stub: T) -> Self
15461 where
15462 T: super::stub::Snapshots + 'static,
15463 {
15464 Self {
15465 inner: std::sync::Arc::new(stub),
15466 }
15467 }
15468
15469 pub(crate) async fn new(
15470 config: gaxi::options::ClientConfig,
15471 ) -> gax::client_builder::Result<Self> {
15472 let inner = Self::build_inner(config).await?;
15473 Ok(Self { inner })
15474 }
15475
15476 async fn build_inner(
15477 conf: gaxi::options::ClientConfig,
15478 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Snapshots>> {
15479 if gaxi::options::tracing_enabled(&conf) {
15480 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15481 }
15482 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15483 }
15484
15485 async fn build_transport(
15486 conf: gaxi::options::ClientConfig,
15487 ) -> gax::client_builder::Result<impl super::stub::Snapshots> {
15488 super::transport::Snapshots::new(conf).await
15489 }
15490
15491 async fn build_with_tracing(
15492 conf: gaxi::options::ClientConfig,
15493 ) -> gax::client_builder::Result<impl super::stub::Snapshots> {
15494 Self::build_transport(conf)
15495 .await
15496 .map(super::tracing::Snapshots::new)
15497 }
15498
15499 /// Deletes the specified Snapshot resource. Keep in mind that deleting
15500 /// a single snapshot might not necessarily delete all the data on that
15501 /// snapshot. If any data on the snapshot that is marked for deletion is
15502 /// needed for subsequent snapshots, the data will be moved to the next
15503 /// corresponding snapshot.
15504 ///
15505 /// For more information, seeDeleting
15506 /// snapshots.
15507 pub fn delete(&self) -> super::builder::snapshots::Delete {
15508 super::builder::snapshots::Delete::new(self.inner.clone())
15509 }
15510
15511 /// Returns the specified Snapshot resource.
15512 pub fn get(&self) -> super::builder::snapshots::Get {
15513 super::builder::snapshots::Get::new(self.inner.clone())
15514 }
15515
15516 /// Gets the access control policy for a resource. May be empty if no such
15517 /// policy or resource exists.
15518 pub fn get_iam_policy(&self) -> super::builder::snapshots::GetIamPolicy {
15519 super::builder::snapshots::GetIamPolicy::new(self.inner.clone())
15520 }
15521
15522 /// Creates a snapshot in the specified project using the data included
15523 /// in the request. For regular snapshot creation, consider using this method
15524 /// instead of disks.createSnapshot,
15525 /// as this method supports more features, such as creating snapshots in a
15526 /// project different from the source disk project.
15527 pub fn insert(&self) -> super::builder::snapshots::Insert {
15528 super::builder::snapshots::Insert::new(self.inner.clone())
15529 }
15530
15531 /// Retrieves the list of Snapshot resources contained within
15532 /// the specified project.
15533 pub fn list(&self) -> super::builder::snapshots::List {
15534 super::builder::snapshots::List::new(self.inner.clone())
15535 }
15536
15537 /// Sets the access control policy on the specified resource.
15538 /// Replaces any existing policy.
15539 pub fn set_iam_policy(&self) -> super::builder::snapshots::SetIamPolicy {
15540 super::builder::snapshots::SetIamPolicy::new(self.inner.clone())
15541 }
15542
15543 /// Sets the labels on a snapshot. To learn more about labels, read theLabeling
15544 /// Resources documentation.
15545 pub fn set_labels(&self) -> super::builder::snapshots::SetLabels {
15546 super::builder::snapshots::SetLabels::new(self.inner.clone())
15547 }
15548
15549 /// Returns permissions that a caller has on the specified resource.
15550 pub fn test_iam_permissions(&self) -> super::builder::snapshots::TestIamPermissions {
15551 super::builder::snapshots::TestIamPermissions::new(self.inner.clone())
15552 }
15553
15554 /// Retrieves the specified Operations resource.
15555 pub fn get_operation(&self) -> super::builder::snapshots::GetOperation {
15556 super::builder::snapshots::GetOperation::new(self.inner.clone())
15557 }
15558}
15559
15560/// Implements a client for the Google Compute Engine API.
15561///
15562/// # Example
15563/// ```
15564/// # tokio_test::block_on(async {
15565/// # use google_cloud_compute_v1::client::SslCertificates;
15566/// let client = SslCertificates::builder().build().await?;
15567/// // use `client` to make requests to the Google Compute Engine API.
15568/// # gax::client_builder::Result::<()>::Ok(()) });
15569/// ```
15570///
15571/// # Service Description
15572///
15573/// Service for the `sslCertificates` resource.
15574///
15575/// # Configuration
15576///
15577/// To configure `SslCertificates` use the `with_*` methods in the type returned
15578/// by [builder()][SslCertificates::builder]. The default configuration should
15579/// work for most applications. Common configuration changes include
15580///
15581/// * [with_endpoint()]: by default this client uses the global default endpoint
15582/// (`https://compute.googleapis.com`). Applications using regional
15583/// endpoints or running in restricted networks (e.g. a network configured
15584// with [Private Google Access with VPC Service Controls]) may want to
15585/// override this default.
15586/// * [with_credentials()]: by default this client uses
15587/// [Application Default Credentials]. Applications using custom
15588/// authentication may need to override this default.
15589///
15590/// [with_endpoint()]: super::builder::ssl_certificates::ClientBuilder::with_endpoint
15591/// [with_credentials()]: super::builder::ssl_certificates::ClientBuilder::credentials
15592/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15593/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15594///
15595/// # Pooling and Cloning
15596///
15597/// `SslCertificates` holds a connection pool internally, it is advised to
15598/// create one and the reuse it. You do not need to wrap `SslCertificates` in
15599/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15600/// already uses an `Arc` internally.
15601#[cfg(feature = "ssl-certificates")]
15602#[cfg_attr(docsrs, doc(cfg(feature = "ssl-certificates")))]
15603#[derive(Clone, Debug)]
15604pub struct SslCertificates {
15605 inner: std::sync::Arc<dyn super::stub::dynamic::SslCertificates>,
15606}
15607
15608#[cfg(feature = "ssl-certificates")]
15609impl SslCertificates {
15610 /// Returns a builder for [SslCertificates].
15611 ///
15612 /// ```
15613 /// # tokio_test::block_on(async {
15614 /// # use google_cloud_compute_v1::client::SslCertificates;
15615 /// let client = SslCertificates::builder().build().await?;
15616 /// # gax::client_builder::Result::<()>::Ok(()) });
15617 /// ```
15618 pub fn builder() -> super::builder::ssl_certificates::ClientBuilder {
15619 gax::client_builder::internal::new_builder(
15620 super::builder::ssl_certificates::client::Factory,
15621 )
15622 }
15623
15624 /// Creates a new client from the provided stub.
15625 ///
15626 /// The most common case for calling this function is in tests mocking the
15627 /// client's behavior.
15628 pub fn from_stub<T>(stub: T) -> Self
15629 where
15630 T: super::stub::SslCertificates + 'static,
15631 {
15632 Self {
15633 inner: std::sync::Arc::new(stub),
15634 }
15635 }
15636
15637 pub(crate) async fn new(
15638 config: gaxi::options::ClientConfig,
15639 ) -> gax::client_builder::Result<Self> {
15640 let inner = Self::build_inner(config).await?;
15641 Ok(Self { inner })
15642 }
15643
15644 async fn build_inner(
15645 conf: gaxi::options::ClientConfig,
15646 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::SslCertificates>>
15647 {
15648 if gaxi::options::tracing_enabled(&conf) {
15649 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15650 }
15651 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15652 }
15653
15654 async fn build_transport(
15655 conf: gaxi::options::ClientConfig,
15656 ) -> gax::client_builder::Result<impl super::stub::SslCertificates> {
15657 super::transport::SslCertificates::new(conf).await
15658 }
15659
15660 async fn build_with_tracing(
15661 conf: gaxi::options::ClientConfig,
15662 ) -> gax::client_builder::Result<impl super::stub::SslCertificates> {
15663 Self::build_transport(conf)
15664 .await
15665 .map(super::tracing::SslCertificates::new)
15666 }
15667
15668 /// Retrieves the list of all SslCertificate resources, regional and global,
15669 /// available to the specified project.
15670 ///
15671 /// To prevent failure, Google recommends that you set the
15672 /// `returnPartialSuccess` parameter to `true`.
15673 pub fn aggregated_list(&self) -> super::builder::ssl_certificates::AggregatedList {
15674 super::builder::ssl_certificates::AggregatedList::new(self.inner.clone())
15675 }
15676
15677 /// Deletes the specified SslCertificate resource.
15678 pub fn delete(&self) -> super::builder::ssl_certificates::Delete {
15679 super::builder::ssl_certificates::Delete::new(self.inner.clone())
15680 }
15681
15682 /// Returns the specified SslCertificate resource.
15683 pub fn get(&self) -> super::builder::ssl_certificates::Get {
15684 super::builder::ssl_certificates::Get::new(self.inner.clone())
15685 }
15686
15687 /// Creates a SslCertificate resource in the specified project using the data
15688 /// included in the request.
15689 pub fn insert(&self) -> super::builder::ssl_certificates::Insert {
15690 super::builder::ssl_certificates::Insert::new(self.inner.clone())
15691 }
15692
15693 /// Retrieves the list of SslCertificate resources available to the specified
15694 /// project.
15695 pub fn list(&self) -> super::builder::ssl_certificates::List {
15696 super::builder::ssl_certificates::List::new(self.inner.clone())
15697 }
15698
15699 /// Retrieves the specified Operations resource.
15700 pub fn get_operation(&self) -> super::builder::ssl_certificates::GetOperation {
15701 super::builder::ssl_certificates::GetOperation::new(self.inner.clone())
15702 }
15703}
15704
15705/// Implements a client for the Google Compute Engine API.
15706///
15707/// # Example
15708/// ```
15709/// # tokio_test::block_on(async {
15710/// # use google_cloud_compute_v1::client::SslPolicies;
15711/// let client = SslPolicies::builder().build().await?;
15712/// // use `client` to make requests to the Google Compute Engine API.
15713/// # gax::client_builder::Result::<()>::Ok(()) });
15714/// ```
15715///
15716/// # Service Description
15717///
15718/// Service for the `sslPolicies` resource.
15719///
15720/// # Configuration
15721///
15722/// To configure `SslPolicies` use the `with_*` methods in the type returned
15723/// by [builder()][SslPolicies::builder]. The default configuration should
15724/// work for most applications. Common configuration changes include
15725///
15726/// * [with_endpoint()]: by default this client uses the global default endpoint
15727/// (`https://compute.googleapis.com`). Applications using regional
15728/// endpoints or running in restricted networks (e.g. a network configured
15729// with [Private Google Access with VPC Service Controls]) may want to
15730/// override this default.
15731/// * [with_credentials()]: by default this client uses
15732/// [Application Default Credentials]. Applications using custom
15733/// authentication may need to override this default.
15734///
15735/// [with_endpoint()]: super::builder::ssl_policies::ClientBuilder::with_endpoint
15736/// [with_credentials()]: super::builder::ssl_policies::ClientBuilder::credentials
15737/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15738/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15739///
15740/// # Pooling and Cloning
15741///
15742/// `SslPolicies` holds a connection pool internally, it is advised to
15743/// create one and the reuse it. You do not need to wrap `SslPolicies` in
15744/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15745/// already uses an `Arc` internally.
15746#[cfg(feature = "ssl-policies")]
15747#[cfg_attr(docsrs, doc(cfg(feature = "ssl-policies")))]
15748#[derive(Clone, Debug)]
15749pub struct SslPolicies {
15750 inner: std::sync::Arc<dyn super::stub::dynamic::SslPolicies>,
15751}
15752
15753#[cfg(feature = "ssl-policies")]
15754impl SslPolicies {
15755 /// Returns a builder for [SslPolicies].
15756 ///
15757 /// ```
15758 /// # tokio_test::block_on(async {
15759 /// # use google_cloud_compute_v1::client::SslPolicies;
15760 /// let client = SslPolicies::builder().build().await?;
15761 /// # gax::client_builder::Result::<()>::Ok(()) });
15762 /// ```
15763 pub fn builder() -> super::builder::ssl_policies::ClientBuilder {
15764 gax::client_builder::internal::new_builder(super::builder::ssl_policies::client::Factory)
15765 }
15766
15767 /// Creates a new client from the provided stub.
15768 ///
15769 /// The most common case for calling this function is in tests mocking the
15770 /// client's behavior.
15771 pub fn from_stub<T>(stub: T) -> Self
15772 where
15773 T: super::stub::SslPolicies + 'static,
15774 {
15775 Self {
15776 inner: std::sync::Arc::new(stub),
15777 }
15778 }
15779
15780 pub(crate) async fn new(
15781 config: gaxi::options::ClientConfig,
15782 ) -> gax::client_builder::Result<Self> {
15783 let inner = Self::build_inner(config).await?;
15784 Ok(Self { inner })
15785 }
15786
15787 async fn build_inner(
15788 conf: gaxi::options::ClientConfig,
15789 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::SslPolicies>> {
15790 if gaxi::options::tracing_enabled(&conf) {
15791 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15792 }
15793 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15794 }
15795
15796 async fn build_transport(
15797 conf: gaxi::options::ClientConfig,
15798 ) -> gax::client_builder::Result<impl super::stub::SslPolicies> {
15799 super::transport::SslPolicies::new(conf).await
15800 }
15801
15802 async fn build_with_tracing(
15803 conf: gaxi::options::ClientConfig,
15804 ) -> gax::client_builder::Result<impl super::stub::SslPolicies> {
15805 Self::build_transport(conf)
15806 .await
15807 .map(super::tracing::SslPolicies::new)
15808 }
15809
15810 /// Retrieves the list of all SslPolicy resources, regional and global,
15811 /// available to the specified project.
15812 ///
15813 /// To prevent failure, Google recommends that you set the
15814 /// `returnPartialSuccess` parameter to `true`.
15815 pub fn aggregated_list(&self) -> super::builder::ssl_policies::AggregatedList {
15816 super::builder::ssl_policies::AggregatedList::new(self.inner.clone())
15817 }
15818
15819 /// Deletes the specified SSL policy. The SSL policy resource can be deleted
15820 /// only if it is not in use by any TargetHttpsProxy or TargetSslProxy
15821 /// resources.
15822 pub fn delete(&self) -> super::builder::ssl_policies::Delete {
15823 super::builder::ssl_policies::Delete::new(self.inner.clone())
15824 }
15825
15826 /// Lists all of the ordered rules present in a single specified policy.
15827 pub fn get(&self) -> super::builder::ssl_policies::Get {
15828 super::builder::ssl_policies::Get::new(self.inner.clone())
15829 }
15830
15831 /// Returns the specified SSL policy resource.
15832 pub fn insert(&self) -> super::builder::ssl_policies::Insert {
15833 super::builder::ssl_policies::Insert::new(self.inner.clone())
15834 }
15835
15836 /// Lists all the SSL policies that have been configured for the specified
15837 /// project.
15838 pub fn list(&self) -> super::builder::ssl_policies::List {
15839 super::builder::ssl_policies::List::new(self.inner.clone())
15840 }
15841
15842 /// Lists all features that can be specified in the SSL policy when using
15843 /// custom profile.
15844 pub fn list_available_features(&self) -> super::builder::ssl_policies::ListAvailableFeatures {
15845 super::builder::ssl_policies::ListAvailableFeatures::new(self.inner.clone())
15846 }
15847
15848 /// Patches the specified SSL policy with the data included in the request.
15849 pub fn patch(&self) -> super::builder::ssl_policies::Patch {
15850 super::builder::ssl_policies::Patch::new(self.inner.clone())
15851 }
15852
15853 /// Retrieves the specified Operations resource.
15854 pub fn get_operation(&self) -> super::builder::ssl_policies::GetOperation {
15855 super::builder::ssl_policies::GetOperation::new(self.inner.clone())
15856 }
15857}
15858
15859/// Implements a client for the Google Compute Engine API.
15860///
15861/// # Example
15862/// ```
15863/// # tokio_test::block_on(async {
15864/// # use google_cloud_compute_v1::client::StoragePoolTypes;
15865/// let client = StoragePoolTypes::builder().build().await?;
15866/// // use `client` to make requests to the Google Compute Engine API.
15867/// # gax::client_builder::Result::<()>::Ok(()) });
15868/// ```
15869///
15870/// # Service Description
15871///
15872/// Service for the `storagePoolTypes` resource.
15873///
15874/// # Configuration
15875///
15876/// To configure `StoragePoolTypes` use the `with_*` methods in the type returned
15877/// by [builder()][StoragePoolTypes::builder]. The default configuration should
15878/// work for most applications. Common configuration changes include
15879///
15880/// * [with_endpoint()]: by default this client uses the global default endpoint
15881/// (`https://compute.googleapis.com`). Applications using regional
15882/// endpoints or running in restricted networks (e.g. a network configured
15883// with [Private Google Access with VPC Service Controls]) may want to
15884/// override this default.
15885/// * [with_credentials()]: by default this client uses
15886/// [Application Default Credentials]. Applications using custom
15887/// authentication may need to override this default.
15888///
15889/// [with_endpoint()]: super::builder::storage_pool_types::ClientBuilder::with_endpoint
15890/// [with_credentials()]: super::builder::storage_pool_types::ClientBuilder::credentials
15891/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15892/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15893///
15894/// # Pooling and Cloning
15895///
15896/// `StoragePoolTypes` holds a connection pool internally, it is advised to
15897/// create one and the reuse it. You do not need to wrap `StoragePoolTypes` in
15898/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15899/// already uses an `Arc` internally.
15900#[cfg(feature = "storage-pool-types")]
15901#[cfg_attr(docsrs, doc(cfg(feature = "storage-pool-types")))]
15902#[derive(Clone, Debug)]
15903pub struct StoragePoolTypes {
15904 inner: std::sync::Arc<dyn super::stub::dynamic::StoragePoolTypes>,
15905}
15906
15907#[cfg(feature = "storage-pool-types")]
15908impl StoragePoolTypes {
15909 /// Returns a builder for [StoragePoolTypes].
15910 ///
15911 /// ```
15912 /// # tokio_test::block_on(async {
15913 /// # use google_cloud_compute_v1::client::StoragePoolTypes;
15914 /// let client = StoragePoolTypes::builder().build().await?;
15915 /// # gax::client_builder::Result::<()>::Ok(()) });
15916 /// ```
15917 pub fn builder() -> super::builder::storage_pool_types::ClientBuilder {
15918 gax::client_builder::internal::new_builder(
15919 super::builder::storage_pool_types::client::Factory,
15920 )
15921 }
15922
15923 /// Creates a new client from the provided stub.
15924 ///
15925 /// The most common case for calling this function is in tests mocking the
15926 /// client's behavior.
15927 pub fn from_stub<T>(stub: T) -> Self
15928 where
15929 T: super::stub::StoragePoolTypes + 'static,
15930 {
15931 Self {
15932 inner: std::sync::Arc::new(stub),
15933 }
15934 }
15935
15936 pub(crate) async fn new(
15937 config: gaxi::options::ClientConfig,
15938 ) -> gax::client_builder::Result<Self> {
15939 let inner = Self::build_inner(config).await?;
15940 Ok(Self { inner })
15941 }
15942
15943 async fn build_inner(
15944 conf: gaxi::options::ClientConfig,
15945 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::StoragePoolTypes>>
15946 {
15947 if gaxi::options::tracing_enabled(&conf) {
15948 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15949 }
15950 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15951 }
15952
15953 async fn build_transport(
15954 conf: gaxi::options::ClientConfig,
15955 ) -> gax::client_builder::Result<impl super::stub::StoragePoolTypes> {
15956 super::transport::StoragePoolTypes::new(conf).await
15957 }
15958
15959 async fn build_with_tracing(
15960 conf: gaxi::options::ClientConfig,
15961 ) -> gax::client_builder::Result<impl super::stub::StoragePoolTypes> {
15962 Self::build_transport(conf)
15963 .await
15964 .map(super::tracing::StoragePoolTypes::new)
15965 }
15966
15967 /// Retrieves an aggregated list of storage pool types.
15968 ///
15969 /// To prevent failure, Google recommends that you set the
15970 /// `returnPartialSuccess` parameter to `true`.
15971 pub fn aggregated_list(&self) -> super::builder::storage_pool_types::AggregatedList {
15972 super::builder::storage_pool_types::AggregatedList::new(self.inner.clone())
15973 }
15974
15975 /// Returns the specified storage pool type.
15976 pub fn get(&self) -> super::builder::storage_pool_types::Get {
15977 super::builder::storage_pool_types::Get::new(self.inner.clone())
15978 }
15979
15980 /// Retrieves a list of storage pool types available to the specified
15981 /// project.
15982 pub fn list(&self) -> super::builder::storage_pool_types::List {
15983 super::builder::storage_pool_types::List::new(self.inner.clone())
15984 }
15985}
15986
15987/// Implements a client for the Google Compute Engine API.
15988///
15989/// # Example
15990/// ```
15991/// # tokio_test::block_on(async {
15992/// # use google_cloud_compute_v1::client::StoragePools;
15993/// let client = StoragePools::builder().build().await?;
15994/// // use `client` to make requests to the Google Compute Engine API.
15995/// # gax::client_builder::Result::<()>::Ok(()) });
15996/// ```
15997///
15998/// # Service Description
15999///
16000/// Service for the `storagePools` resource.
16001///
16002/// # Configuration
16003///
16004/// To configure `StoragePools` use the `with_*` methods in the type returned
16005/// by [builder()][StoragePools::builder]. The default configuration should
16006/// work for most applications. Common configuration changes include
16007///
16008/// * [with_endpoint()]: by default this client uses the global default endpoint
16009/// (`https://compute.googleapis.com`). Applications using regional
16010/// endpoints or running in restricted networks (e.g. a network configured
16011// with [Private Google Access with VPC Service Controls]) may want to
16012/// override this default.
16013/// * [with_credentials()]: by default this client uses
16014/// [Application Default Credentials]. Applications using custom
16015/// authentication may need to override this default.
16016///
16017/// [with_endpoint()]: super::builder::storage_pools::ClientBuilder::with_endpoint
16018/// [with_credentials()]: super::builder::storage_pools::ClientBuilder::credentials
16019/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16020/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16021///
16022/// # Pooling and Cloning
16023///
16024/// `StoragePools` holds a connection pool internally, it is advised to
16025/// create one and the reuse it. You do not need to wrap `StoragePools` in
16026/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16027/// already uses an `Arc` internally.
16028#[cfg(feature = "storage-pools")]
16029#[cfg_attr(docsrs, doc(cfg(feature = "storage-pools")))]
16030#[derive(Clone, Debug)]
16031pub struct StoragePools {
16032 inner: std::sync::Arc<dyn super::stub::dynamic::StoragePools>,
16033}
16034
16035#[cfg(feature = "storage-pools")]
16036impl StoragePools {
16037 /// Returns a builder for [StoragePools].
16038 ///
16039 /// ```
16040 /// # tokio_test::block_on(async {
16041 /// # use google_cloud_compute_v1::client::StoragePools;
16042 /// let client = StoragePools::builder().build().await?;
16043 /// # gax::client_builder::Result::<()>::Ok(()) });
16044 /// ```
16045 pub fn builder() -> super::builder::storage_pools::ClientBuilder {
16046 gax::client_builder::internal::new_builder(super::builder::storage_pools::client::Factory)
16047 }
16048
16049 /// Creates a new client from the provided stub.
16050 ///
16051 /// The most common case for calling this function is in tests mocking the
16052 /// client's behavior.
16053 pub fn from_stub<T>(stub: T) -> Self
16054 where
16055 T: super::stub::StoragePools + 'static,
16056 {
16057 Self {
16058 inner: std::sync::Arc::new(stub),
16059 }
16060 }
16061
16062 pub(crate) async fn new(
16063 config: gaxi::options::ClientConfig,
16064 ) -> gax::client_builder::Result<Self> {
16065 let inner = Self::build_inner(config).await?;
16066 Ok(Self { inner })
16067 }
16068
16069 async fn build_inner(
16070 conf: gaxi::options::ClientConfig,
16071 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::StoragePools>> {
16072 if gaxi::options::tracing_enabled(&conf) {
16073 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16074 }
16075 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16076 }
16077
16078 async fn build_transport(
16079 conf: gaxi::options::ClientConfig,
16080 ) -> gax::client_builder::Result<impl super::stub::StoragePools> {
16081 super::transport::StoragePools::new(conf).await
16082 }
16083
16084 async fn build_with_tracing(
16085 conf: gaxi::options::ClientConfig,
16086 ) -> gax::client_builder::Result<impl super::stub::StoragePools> {
16087 Self::build_transport(conf)
16088 .await
16089 .map(super::tracing::StoragePools::new)
16090 }
16091
16092 /// Retrieves an aggregated list of storage pools.
16093 ///
16094 /// To prevent failure, Google recommends that you set the
16095 /// `returnPartialSuccess` parameter to `true`.
16096 pub fn aggregated_list(&self) -> super::builder::storage_pools::AggregatedList {
16097 super::builder::storage_pools::AggregatedList::new(self.inner.clone())
16098 }
16099
16100 /// Deletes the specified storage pool. Deleting a storagePool
16101 /// removes its data permanently and is irreversible. However, deleting a
16102 /// storagePool does not delete any snapshots previously
16103 /// made from the storagePool. You must separately delete
16104 /// snapshots.
16105 pub fn delete(&self) -> super::builder::storage_pools::Delete {
16106 super::builder::storage_pools::Delete::new(self.inner.clone())
16107 }
16108
16109 /// Returns a specified storage pool. Gets a list of available
16110 /// storage pools by making a list() request.
16111 pub fn get(&self) -> super::builder::storage_pools::Get {
16112 super::builder::storage_pools::Get::new(self.inner.clone())
16113 }
16114
16115 /// Gets the access control policy for a resource. May be empty if no such
16116 /// policy or resource exists.
16117 pub fn get_iam_policy(&self) -> super::builder::storage_pools::GetIamPolicy {
16118 super::builder::storage_pools::GetIamPolicy::new(self.inner.clone())
16119 }
16120
16121 /// Creates a storage pool in the specified project using the data
16122 /// in the request.
16123 pub fn insert(&self) -> super::builder::storage_pools::Insert {
16124 super::builder::storage_pools::Insert::new(self.inner.clone())
16125 }
16126
16127 /// Retrieves a list of storage pools contained within
16128 /// the specified zone.
16129 pub fn list(&self) -> super::builder::storage_pools::List {
16130 super::builder::storage_pools::List::new(self.inner.clone())
16131 }
16132
16133 /// Lists the disks in a specified storage pool.
16134 pub fn list_disks(&self) -> super::builder::storage_pools::ListDisks {
16135 super::builder::storage_pools::ListDisks::new(self.inner.clone())
16136 }
16137
16138 /// Sets the access control policy on the specified resource.
16139 /// Replaces any existing policy.
16140 pub fn set_iam_policy(&self) -> super::builder::storage_pools::SetIamPolicy {
16141 super::builder::storage_pools::SetIamPolicy::new(self.inner.clone())
16142 }
16143
16144 /// Returns permissions that a caller has on the specified resource.
16145 pub fn test_iam_permissions(&self) -> super::builder::storage_pools::TestIamPermissions {
16146 super::builder::storage_pools::TestIamPermissions::new(self.inner.clone())
16147 }
16148
16149 /// Updates the specified storagePool with the data included in the request.
16150 /// The update is performed only on selected fields included as part
16151 /// of update-mask. Only the following fields can be modified:
16152 /// pool_provisioned_capacity_gb, pool_provisioned_iops and
16153 /// pool_provisioned_throughput.
16154 pub fn update(&self) -> super::builder::storage_pools::Update {
16155 super::builder::storage_pools::Update::new(self.inner.clone())
16156 }
16157
16158 /// Retrieves the specified zone-specific Operations resource.
16159 pub fn get_operation(&self) -> super::builder::storage_pools::GetOperation {
16160 super::builder::storage_pools::GetOperation::new(self.inner.clone())
16161 }
16162}
16163
16164/// Implements a client for the Google Compute Engine API.
16165///
16166/// # Example
16167/// ```
16168/// # tokio_test::block_on(async {
16169/// # use google_cloud_compute_v1::client::Subnetworks;
16170/// let client = Subnetworks::builder().build().await?;
16171/// // use `client` to make requests to the Google Compute Engine API.
16172/// # gax::client_builder::Result::<()>::Ok(()) });
16173/// ```
16174///
16175/// # Service Description
16176///
16177/// Service for the `subnetworks` resource.
16178///
16179/// # Configuration
16180///
16181/// To configure `Subnetworks` use the `with_*` methods in the type returned
16182/// by [builder()][Subnetworks::builder]. The default configuration should
16183/// work for most applications. Common configuration changes include
16184///
16185/// * [with_endpoint()]: by default this client uses the global default endpoint
16186/// (`https://compute.googleapis.com`). Applications using regional
16187/// endpoints or running in restricted networks (e.g. a network configured
16188// with [Private Google Access with VPC Service Controls]) may want to
16189/// override this default.
16190/// * [with_credentials()]: by default this client uses
16191/// [Application Default Credentials]. Applications using custom
16192/// authentication may need to override this default.
16193///
16194/// [with_endpoint()]: super::builder::subnetworks::ClientBuilder::with_endpoint
16195/// [with_credentials()]: super::builder::subnetworks::ClientBuilder::credentials
16196/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16197/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16198///
16199/// # Pooling and Cloning
16200///
16201/// `Subnetworks` holds a connection pool internally, it is advised to
16202/// create one and the reuse it. You do not need to wrap `Subnetworks` in
16203/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16204/// already uses an `Arc` internally.
16205#[cfg(feature = "subnetworks")]
16206#[cfg_attr(docsrs, doc(cfg(feature = "subnetworks")))]
16207#[derive(Clone, Debug)]
16208pub struct Subnetworks {
16209 inner: std::sync::Arc<dyn super::stub::dynamic::Subnetworks>,
16210}
16211
16212#[cfg(feature = "subnetworks")]
16213impl Subnetworks {
16214 /// Returns a builder for [Subnetworks].
16215 ///
16216 /// ```
16217 /// # tokio_test::block_on(async {
16218 /// # use google_cloud_compute_v1::client::Subnetworks;
16219 /// let client = Subnetworks::builder().build().await?;
16220 /// # gax::client_builder::Result::<()>::Ok(()) });
16221 /// ```
16222 pub fn builder() -> super::builder::subnetworks::ClientBuilder {
16223 gax::client_builder::internal::new_builder(super::builder::subnetworks::client::Factory)
16224 }
16225
16226 /// Creates a new client from the provided stub.
16227 ///
16228 /// The most common case for calling this function is in tests mocking the
16229 /// client's behavior.
16230 pub fn from_stub<T>(stub: T) -> Self
16231 where
16232 T: super::stub::Subnetworks + 'static,
16233 {
16234 Self {
16235 inner: std::sync::Arc::new(stub),
16236 }
16237 }
16238
16239 pub(crate) async fn new(
16240 config: gaxi::options::ClientConfig,
16241 ) -> gax::client_builder::Result<Self> {
16242 let inner = Self::build_inner(config).await?;
16243 Ok(Self { inner })
16244 }
16245
16246 async fn build_inner(
16247 conf: gaxi::options::ClientConfig,
16248 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Subnetworks>> {
16249 if gaxi::options::tracing_enabled(&conf) {
16250 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16251 }
16252 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16253 }
16254
16255 async fn build_transport(
16256 conf: gaxi::options::ClientConfig,
16257 ) -> gax::client_builder::Result<impl super::stub::Subnetworks> {
16258 super::transport::Subnetworks::new(conf).await
16259 }
16260
16261 async fn build_with_tracing(
16262 conf: gaxi::options::ClientConfig,
16263 ) -> gax::client_builder::Result<impl super::stub::Subnetworks> {
16264 Self::build_transport(conf)
16265 .await
16266 .map(super::tracing::Subnetworks::new)
16267 }
16268
16269 /// Retrieves an aggregated list of subnetworks.
16270 ///
16271 /// To prevent failure, Google recommends that you set the
16272 /// `returnPartialSuccess` parameter to `true`.
16273 pub fn aggregated_list(&self) -> super::builder::subnetworks::AggregatedList {
16274 super::builder::subnetworks::AggregatedList::new(self.inner.clone())
16275 }
16276
16277 /// Deletes the specified subnetwork.
16278 pub fn delete(&self) -> super::builder::subnetworks::Delete {
16279 super::builder::subnetworks::Delete::new(self.inner.clone())
16280 }
16281
16282 /// Expands the IP CIDR range of the subnetwork to a specified value.
16283 pub fn expand_ip_cidr_range(&self) -> super::builder::subnetworks::ExpandIpCidrRange {
16284 super::builder::subnetworks::ExpandIpCidrRange::new(self.inner.clone())
16285 }
16286
16287 /// Returns the specified subnetwork.
16288 pub fn get(&self) -> super::builder::subnetworks::Get {
16289 super::builder::subnetworks::Get::new(self.inner.clone())
16290 }
16291
16292 /// Gets the access control policy for a resource. May be empty if no such
16293 /// policy or resource exists.
16294 pub fn get_iam_policy(&self) -> super::builder::subnetworks::GetIamPolicy {
16295 super::builder::subnetworks::GetIamPolicy::new(self.inner.clone())
16296 }
16297
16298 /// Creates a subnetwork in the specified project using the data
16299 /// included in the request.
16300 pub fn insert(&self) -> super::builder::subnetworks::Insert {
16301 super::builder::subnetworks::Insert::new(self.inner.clone())
16302 }
16303
16304 /// Retrieves a list of subnetworks available to the specified
16305 /// project.
16306 pub fn list(&self) -> super::builder::subnetworks::List {
16307 super::builder::subnetworks::List::new(self.inner.clone())
16308 }
16309
16310 /// Retrieves an aggregated list of all usable subnetworks in the project.
16311 pub fn list_usable(&self) -> super::builder::subnetworks::ListUsable {
16312 super::builder::subnetworks::ListUsable::new(self.inner.clone())
16313 }
16314
16315 /// Patches the specified subnetwork with the data included in the request.
16316 /// Only certain fields can be updated with a patch request
16317 /// as indicated in the field descriptions.
16318 /// You must specify the current fingerprint of the
16319 /// subnetwork resource being patched.
16320 pub fn patch(&self) -> super::builder::subnetworks::Patch {
16321 super::builder::subnetworks::Patch::new(self.inner.clone())
16322 }
16323
16324 /// Sets the access control policy on the specified resource.
16325 /// Replaces any existing policy.
16326 pub fn set_iam_policy(&self) -> super::builder::subnetworks::SetIamPolicy {
16327 super::builder::subnetworks::SetIamPolicy::new(self.inner.clone())
16328 }
16329
16330 /// Set whether VMs in this subnet can access Google services without assigning
16331 /// external IP addresses through Private Google Access.
16332 pub fn set_private_ip_google_access(
16333 &self,
16334 ) -> super::builder::subnetworks::SetPrivateIpGoogleAccess {
16335 super::builder::subnetworks::SetPrivateIpGoogleAccess::new(self.inner.clone())
16336 }
16337
16338 /// Returns permissions that a caller has on the specified resource.
16339 pub fn test_iam_permissions(&self) -> super::builder::subnetworks::TestIamPermissions {
16340 super::builder::subnetworks::TestIamPermissions::new(self.inner.clone())
16341 }
16342
16343 /// Retrieves the specified region-specific Operations resource.
16344 pub fn get_operation(&self) -> super::builder::subnetworks::GetOperation {
16345 super::builder::subnetworks::GetOperation::new(self.inner.clone())
16346 }
16347}
16348
16349/// Implements a client for the Google Compute Engine API.
16350///
16351/// # Example
16352/// ```
16353/// # tokio_test::block_on(async {
16354/// # use google_cloud_compute_v1::client::TargetGrpcProxies;
16355/// let client = TargetGrpcProxies::builder().build().await?;
16356/// // use `client` to make requests to the Google Compute Engine API.
16357/// # gax::client_builder::Result::<()>::Ok(()) });
16358/// ```
16359///
16360/// # Service Description
16361///
16362/// Service for the `targetGrpcProxies` resource.
16363///
16364/// # Configuration
16365///
16366/// To configure `TargetGrpcProxies` use the `with_*` methods in the type returned
16367/// by [builder()][TargetGrpcProxies::builder]. The default configuration should
16368/// work for most applications. Common configuration changes include
16369///
16370/// * [with_endpoint()]: by default this client uses the global default endpoint
16371/// (`https://compute.googleapis.com`). Applications using regional
16372/// endpoints or running in restricted networks (e.g. a network configured
16373// with [Private Google Access with VPC Service Controls]) may want to
16374/// override this default.
16375/// * [with_credentials()]: by default this client uses
16376/// [Application Default Credentials]. Applications using custom
16377/// authentication may need to override this default.
16378///
16379/// [with_endpoint()]: super::builder::target_grpc_proxies::ClientBuilder::with_endpoint
16380/// [with_credentials()]: super::builder::target_grpc_proxies::ClientBuilder::credentials
16381/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16382/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16383///
16384/// # Pooling and Cloning
16385///
16386/// `TargetGrpcProxies` holds a connection pool internally, it is advised to
16387/// create one and the reuse it. You do not need to wrap `TargetGrpcProxies` in
16388/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16389/// already uses an `Arc` internally.
16390#[cfg(feature = "target-grpc-proxies")]
16391#[cfg_attr(docsrs, doc(cfg(feature = "target-grpc-proxies")))]
16392#[derive(Clone, Debug)]
16393pub struct TargetGrpcProxies {
16394 inner: std::sync::Arc<dyn super::stub::dynamic::TargetGrpcProxies>,
16395}
16396
16397#[cfg(feature = "target-grpc-proxies")]
16398impl TargetGrpcProxies {
16399 /// Returns a builder for [TargetGrpcProxies].
16400 ///
16401 /// ```
16402 /// # tokio_test::block_on(async {
16403 /// # use google_cloud_compute_v1::client::TargetGrpcProxies;
16404 /// let client = TargetGrpcProxies::builder().build().await?;
16405 /// # gax::client_builder::Result::<()>::Ok(()) });
16406 /// ```
16407 pub fn builder() -> super::builder::target_grpc_proxies::ClientBuilder {
16408 gax::client_builder::internal::new_builder(
16409 super::builder::target_grpc_proxies::client::Factory,
16410 )
16411 }
16412
16413 /// Creates a new client from the provided stub.
16414 ///
16415 /// The most common case for calling this function is in tests mocking the
16416 /// client's behavior.
16417 pub fn from_stub<T>(stub: T) -> Self
16418 where
16419 T: super::stub::TargetGrpcProxies + 'static,
16420 {
16421 Self {
16422 inner: std::sync::Arc::new(stub),
16423 }
16424 }
16425
16426 pub(crate) async fn new(
16427 config: gaxi::options::ClientConfig,
16428 ) -> gax::client_builder::Result<Self> {
16429 let inner = Self::build_inner(config).await?;
16430 Ok(Self { inner })
16431 }
16432
16433 async fn build_inner(
16434 conf: gaxi::options::ClientConfig,
16435 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::TargetGrpcProxies>>
16436 {
16437 if gaxi::options::tracing_enabled(&conf) {
16438 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16439 }
16440 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16441 }
16442
16443 async fn build_transport(
16444 conf: gaxi::options::ClientConfig,
16445 ) -> gax::client_builder::Result<impl super::stub::TargetGrpcProxies> {
16446 super::transport::TargetGrpcProxies::new(conf).await
16447 }
16448
16449 async fn build_with_tracing(
16450 conf: gaxi::options::ClientConfig,
16451 ) -> gax::client_builder::Result<impl super::stub::TargetGrpcProxies> {
16452 Self::build_transport(conf)
16453 .await
16454 .map(super::tracing::TargetGrpcProxies::new)
16455 }
16456
16457 /// Deletes the specified TargetGrpcProxy in the given scope
16458 pub fn delete(&self) -> super::builder::target_grpc_proxies::Delete {
16459 super::builder::target_grpc_proxies::Delete::new(self.inner.clone())
16460 }
16461
16462 /// Returns the specified TargetGrpcProxy resource in the given scope.
16463 pub fn get(&self) -> super::builder::target_grpc_proxies::Get {
16464 super::builder::target_grpc_proxies::Get::new(self.inner.clone())
16465 }
16466
16467 /// Creates a TargetGrpcProxy in the specified project in the given scope
16468 /// using the parameters that are included in the request.
16469 pub fn insert(&self) -> super::builder::target_grpc_proxies::Insert {
16470 super::builder::target_grpc_proxies::Insert::new(self.inner.clone())
16471 }
16472
16473 /// Lists the TargetGrpcProxies for a project in the given scope.
16474 pub fn list(&self) -> super::builder::target_grpc_proxies::List {
16475 super::builder::target_grpc_proxies::List::new(self.inner.clone())
16476 }
16477
16478 /// Patches the specified TargetGrpcProxy resource with the data included in
16479 /// the request. This method supports PATCH
16480 /// semantics and usesJSON merge
16481 /// patch format and processing rules.
16482 pub fn patch(&self) -> super::builder::target_grpc_proxies::Patch {
16483 super::builder::target_grpc_proxies::Patch::new(self.inner.clone())
16484 }
16485
16486 /// Retrieves the specified Operations resource.
16487 pub fn get_operation(&self) -> super::builder::target_grpc_proxies::GetOperation {
16488 super::builder::target_grpc_proxies::GetOperation::new(self.inner.clone())
16489 }
16490}
16491
16492/// Implements a client for the Google Compute Engine API.
16493///
16494/// # Example
16495/// ```
16496/// # tokio_test::block_on(async {
16497/// # use google_cloud_compute_v1::client::TargetHttpProxies;
16498/// let client = TargetHttpProxies::builder().build().await?;
16499/// // use `client` to make requests to the Google Compute Engine API.
16500/// # gax::client_builder::Result::<()>::Ok(()) });
16501/// ```
16502///
16503/// # Service Description
16504///
16505/// Service for the `targetHttpProxies` resource.
16506///
16507/// # Configuration
16508///
16509/// To configure `TargetHttpProxies` use the `with_*` methods in the type returned
16510/// by [builder()][TargetHttpProxies::builder]. The default configuration should
16511/// work for most applications. Common configuration changes include
16512///
16513/// * [with_endpoint()]: by default this client uses the global default endpoint
16514/// (`https://compute.googleapis.com`). Applications using regional
16515/// endpoints or running in restricted networks (e.g. a network configured
16516// with [Private Google Access with VPC Service Controls]) may want to
16517/// override this default.
16518/// * [with_credentials()]: by default this client uses
16519/// [Application Default Credentials]. Applications using custom
16520/// authentication may need to override this default.
16521///
16522/// [with_endpoint()]: super::builder::target_http_proxies::ClientBuilder::with_endpoint
16523/// [with_credentials()]: super::builder::target_http_proxies::ClientBuilder::credentials
16524/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16525/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16526///
16527/// # Pooling and Cloning
16528///
16529/// `TargetHttpProxies` holds a connection pool internally, it is advised to
16530/// create one and the reuse it. You do not need to wrap `TargetHttpProxies` in
16531/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16532/// already uses an `Arc` internally.
16533#[cfg(feature = "target-http-proxies")]
16534#[cfg_attr(docsrs, doc(cfg(feature = "target-http-proxies")))]
16535#[derive(Clone, Debug)]
16536pub struct TargetHttpProxies {
16537 inner: std::sync::Arc<dyn super::stub::dynamic::TargetHttpProxies>,
16538}
16539
16540#[cfg(feature = "target-http-proxies")]
16541impl TargetHttpProxies {
16542 /// Returns a builder for [TargetHttpProxies].
16543 ///
16544 /// ```
16545 /// # tokio_test::block_on(async {
16546 /// # use google_cloud_compute_v1::client::TargetHttpProxies;
16547 /// let client = TargetHttpProxies::builder().build().await?;
16548 /// # gax::client_builder::Result::<()>::Ok(()) });
16549 /// ```
16550 pub fn builder() -> super::builder::target_http_proxies::ClientBuilder {
16551 gax::client_builder::internal::new_builder(
16552 super::builder::target_http_proxies::client::Factory,
16553 )
16554 }
16555
16556 /// Creates a new client from the provided stub.
16557 ///
16558 /// The most common case for calling this function is in tests mocking the
16559 /// client's behavior.
16560 pub fn from_stub<T>(stub: T) -> Self
16561 where
16562 T: super::stub::TargetHttpProxies + 'static,
16563 {
16564 Self {
16565 inner: std::sync::Arc::new(stub),
16566 }
16567 }
16568
16569 pub(crate) async fn new(
16570 config: gaxi::options::ClientConfig,
16571 ) -> gax::client_builder::Result<Self> {
16572 let inner = Self::build_inner(config).await?;
16573 Ok(Self { inner })
16574 }
16575
16576 async fn build_inner(
16577 conf: gaxi::options::ClientConfig,
16578 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::TargetHttpProxies>>
16579 {
16580 if gaxi::options::tracing_enabled(&conf) {
16581 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16582 }
16583 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16584 }
16585
16586 async fn build_transport(
16587 conf: gaxi::options::ClientConfig,
16588 ) -> gax::client_builder::Result<impl super::stub::TargetHttpProxies> {
16589 super::transport::TargetHttpProxies::new(conf).await
16590 }
16591
16592 async fn build_with_tracing(
16593 conf: gaxi::options::ClientConfig,
16594 ) -> gax::client_builder::Result<impl super::stub::TargetHttpProxies> {
16595 Self::build_transport(conf)
16596 .await
16597 .map(super::tracing::TargetHttpProxies::new)
16598 }
16599
16600 /// Retrieves the list of all TargetHttpProxy resources, regional and global,
16601 /// available to the specified project.
16602 ///
16603 /// To prevent failure, Google recommends that you set the
16604 /// `returnPartialSuccess` parameter to `true`.
16605 pub fn aggregated_list(&self) -> super::builder::target_http_proxies::AggregatedList {
16606 super::builder::target_http_proxies::AggregatedList::new(self.inner.clone())
16607 }
16608
16609 /// Deletes the specified TargetHttpProxy resource.
16610 pub fn delete(&self) -> super::builder::target_http_proxies::Delete {
16611 super::builder::target_http_proxies::Delete::new(self.inner.clone())
16612 }
16613
16614 /// Returns the specified TargetHttpProxy resource.
16615 pub fn get(&self) -> super::builder::target_http_proxies::Get {
16616 super::builder::target_http_proxies::Get::new(self.inner.clone())
16617 }
16618
16619 /// Creates a TargetHttpProxy resource in the specified
16620 /// project using the data included in the request.
16621 pub fn insert(&self) -> super::builder::target_http_proxies::Insert {
16622 super::builder::target_http_proxies::Insert::new(self.inner.clone())
16623 }
16624
16625 /// Retrieves the list of TargetHttpProxy resources available
16626 /// to the specified project.
16627 pub fn list(&self) -> super::builder::target_http_proxies::List {
16628 super::builder::target_http_proxies::List::new(self.inner.clone())
16629 }
16630
16631 /// Patches the specified TargetHttpProxy resource with the data included in
16632 /// the request. This method supports PATCH
16633 /// semantics and usesJSON merge
16634 /// patch format and processing rules.
16635 pub fn patch(&self) -> super::builder::target_http_proxies::Patch {
16636 super::builder::target_http_proxies::Patch::new(self.inner.clone())
16637 }
16638
16639 /// Changes the URL map for TargetHttpProxy.
16640 pub fn set_url_map(&self) -> super::builder::target_http_proxies::SetUrlMap {
16641 super::builder::target_http_proxies::SetUrlMap::new(self.inner.clone())
16642 }
16643
16644 /// Retrieves the specified Operations resource.
16645 pub fn get_operation(&self) -> super::builder::target_http_proxies::GetOperation {
16646 super::builder::target_http_proxies::GetOperation::new(self.inner.clone())
16647 }
16648}
16649
16650/// Implements a client for the Google Compute Engine API.
16651///
16652/// # Example
16653/// ```
16654/// # tokio_test::block_on(async {
16655/// # use google_cloud_compute_v1::client::TargetHttpsProxies;
16656/// let client = TargetHttpsProxies::builder().build().await?;
16657/// // use `client` to make requests to the Google Compute Engine API.
16658/// # gax::client_builder::Result::<()>::Ok(()) });
16659/// ```
16660///
16661/// # Service Description
16662///
16663/// Service for the `targetHttpsProxies` resource.
16664///
16665/// # Configuration
16666///
16667/// To configure `TargetHttpsProxies` use the `with_*` methods in the type returned
16668/// by [builder()][TargetHttpsProxies::builder]. The default configuration should
16669/// work for most applications. Common configuration changes include
16670///
16671/// * [with_endpoint()]: by default this client uses the global default endpoint
16672/// (`https://compute.googleapis.com`). Applications using regional
16673/// endpoints or running in restricted networks (e.g. a network configured
16674// with [Private Google Access with VPC Service Controls]) may want to
16675/// override this default.
16676/// * [with_credentials()]: by default this client uses
16677/// [Application Default Credentials]. Applications using custom
16678/// authentication may need to override this default.
16679///
16680/// [with_endpoint()]: super::builder::target_https_proxies::ClientBuilder::with_endpoint
16681/// [with_credentials()]: super::builder::target_https_proxies::ClientBuilder::credentials
16682/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16683/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16684///
16685/// # Pooling and Cloning
16686///
16687/// `TargetHttpsProxies` holds a connection pool internally, it is advised to
16688/// create one and the reuse it. You do not need to wrap `TargetHttpsProxies` in
16689/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16690/// already uses an `Arc` internally.
16691#[cfg(feature = "target-https-proxies")]
16692#[cfg_attr(docsrs, doc(cfg(feature = "target-https-proxies")))]
16693#[derive(Clone, Debug)]
16694pub struct TargetHttpsProxies {
16695 inner: std::sync::Arc<dyn super::stub::dynamic::TargetHttpsProxies>,
16696}
16697
16698#[cfg(feature = "target-https-proxies")]
16699impl TargetHttpsProxies {
16700 /// Returns a builder for [TargetHttpsProxies].
16701 ///
16702 /// ```
16703 /// # tokio_test::block_on(async {
16704 /// # use google_cloud_compute_v1::client::TargetHttpsProxies;
16705 /// let client = TargetHttpsProxies::builder().build().await?;
16706 /// # gax::client_builder::Result::<()>::Ok(()) });
16707 /// ```
16708 pub fn builder() -> super::builder::target_https_proxies::ClientBuilder {
16709 gax::client_builder::internal::new_builder(
16710 super::builder::target_https_proxies::client::Factory,
16711 )
16712 }
16713
16714 /// Creates a new client from the provided stub.
16715 ///
16716 /// The most common case for calling this function is in tests mocking the
16717 /// client's behavior.
16718 pub fn from_stub<T>(stub: T) -> Self
16719 where
16720 T: super::stub::TargetHttpsProxies + 'static,
16721 {
16722 Self {
16723 inner: std::sync::Arc::new(stub),
16724 }
16725 }
16726
16727 pub(crate) async fn new(
16728 config: gaxi::options::ClientConfig,
16729 ) -> gax::client_builder::Result<Self> {
16730 let inner = Self::build_inner(config).await?;
16731 Ok(Self { inner })
16732 }
16733
16734 async fn build_inner(
16735 conf: gaxi::options::ClientConfig,
16736 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::TargetHttpsProxies>>
16737 {
16738 if gaxi::options::tracing_enabled(&conf) {
16739 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16740 }
16741 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16742 }
16743
16744 async fn build_transport(
16745 conf: gaxi::options::ClientConfig,
16746 ) -> gax::client_builder::Result<impl super::stub::TargetHttpsProxies> {
16747 super::transport::TargetHttpsProxies::new(conf).await
16748 }
16749
16750 async fn build_with_tracing(
16751 conf: gaxi::options::ClientConfig,
16752 ) -> gax::client_builder::Result<impl super::stub::TargetHttpsProxies> {
16753 Self::build_transport(conf)
16754 .await
16755 .map(super::tracing::TargetHttpsProxies::new)
16756 }
16757
16758 /// Retrieves the list of all TargetHttpsProxy resources, regional and global,
16759 /// available to the specified project.
16760 ///
16761 /// To prevent failure, Google recommends that you set the
16762 /// `returnPartialSuccess` parameter to `true`.
16763 pub fn aggregated_list(&self) -> super::builder::target_https_proxies::AggregatedList {
16764 super::builder::target_https_proxies::AggregatedList::new(self.inner.clone())
16765 }
16766
16767 /// Deletes the specified TargetHttpsProxy resource.
16768 pub fn delete(&self) -> super::builder::target_https_proxies::Delete {
16769 super::builder::target_https_proxies::Delete::new(self.inner.clone())
16770 }
16771
16772 /// Returns the specified TargetHttpsProxy resource.
16773 pub fn get(&self) -> super::builder::target_https_proxies::Get {
16774 super::builder::target_https_proxies::Get::new(self.inner.clone())
16775 }
16776
16777 /// Creates a TargetHttpsProxy resource in the specified
16778 /// project using the data included in the request.
16779 pub fn insert(&self) -> super::builder::target_https_proxies::Insert {
16780 super::builder::target_https_proxies::Insert::new(self.inner.clone())
16781 }
16782
16783 /// Retrieves the list of TargetHttpsProxy resources
16784 /// available to the specified project.
16785 pub fn list(&self) -> super::builder::target_https_proxies::List {
16786 super::builder::target_https_proxies::List::new(self.inner.clone())
16787 }
16788
16789 /// Patches the specified TargetHttpsProxy resource with the data included in
16790 /// the request. This method supports PATCH
16791 /// semantics and usesJSON merge
16792 /// patch format and processing rules.
16793 pub fn patch(&self) -> super::builder::target_https_proxies::Patch {
16794 super::builder::target_https_proxies::Patch::new(self.inner.clone())
16795 }
16796
16797 /// Changes the Certificate Map for TargetHttpsProxy.
16798 pub fn set_certificate_map(&self) -> super::builder::target_https_proxies::SetCertificateMap {
16799 super::builder::target_https_proxies::SetCertificateMap::new(self.inner.clone())
16800 }
16801
16802 /// Sets the QUIC override policy for TargetHttpsProxy.
16803 pub fn set_quic_override(&self) -> super::builder::target_https_proxies::SetQuicOverride {
16804 super::builder::target_https_proxies::SetQuicOverride::new(self.inner.clone())
16805 }
16806
16807 /// Replaces SslCertificates for TargetHttpsProxy.
16808 pub fn set_ssl_certificates(&self) -> super::builder::target_https_proxies::SetSslCertificates {
16809 super::builder::target_https_proxies::SetSslCertificates::new(self.inner.clone())
16810 }
16811
16812 /// Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies the
16813 /// server-side support for SSL features. This affects connections between
16814 /// clients and the HTTPS proxy load balancer. They do not affect the
16815 /// connection between the load balancer and the backends.
16816 pub fn set_ssl_policy(&self) -> super::builder::target_https_proxies::SetSslPolicy {
16817 super::builder::target_https_proxies::SetSslPolicy::new(self.inner.clone())
16818 }
16819
16820 /// Changes the URL map for TargetHttpsProxy.
16821 pub fn set_url_map(&self) -> super::builder::target_https_proxies::SetUrlMap {
16822 super::builder::target_https_proxies::SetUrlMap::new(self.inner.clone())
16823 }
16824
16825 /// Retrieves the specified Operations resource.
16826 pub fn get_operation(&self) -> super::builder::target_https_proxies::GetOperation {
16827 super::builder::target_https_proxies::GetOperation::new(self.inner.clone())
16828 }
16829}
16830
16831/// Implements a client for the Google Compute Engine API.
16832///
16833/// # Example
16834/// ```
16835/// # tokio_test::block_on(async {
16836/// # use google_cloud_compute_v1::client::TargetInstances;
16837/// let client = TargetInstances::builder().build().await?;
16838/// // use `client` to make requests to the Google Compute Engine API.
16839/// # gax::client_builder::Result::<()>::Ok(()) });
16840/// ```
16841///
16842/// # Service Description
16843///
16844/// Service for the `targetInstances` resource.
16845///
16846/// # Configuration
16847///
16848/// To configure `TargetInstances` use the `with_*` methods in the type returned
16849/// by [builder()][TargetInstances::builder]. The default configuration should
16850/// work for most applications. Common configuration changes include
16851///
16852/// * [with_endpoint()]: by default this client uses the global default endpoint
16853/// (`https://compute.googleapis.com`). Applications using regional
16854/// endpoints or running in restricted networks (e.g. a network configured
16855// with [Private Google Access with VPC Service Controls]) may want to
16856/// override this default.
16857/// * [with_credentials()]: by default this client uses
16858/// [Application Default Credentials]. Applications using custom
16859/// authentication may need to override this default.
16860///
16861/// [with_endpoint()]: super::builder::target_instances::ClientBuilder::with_endpoint
16862/// [with_credentials()]: super::builder::target_instances::ClientBuilder::credentials
16863/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16864/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16865///
16866/// # Pooling and Cloning
16867///
16868/// `TargetInstances` holds a connection pool internally, it is advised to
16869/// create one and the reuse it. You do not need to wrap `TargetInstances` in
16870/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16871/// already uses an `Arc` internally.
16872#[cfg(feature = "target-instances")]
16873#[cfg_attr(docsrs, doc(cfg(feature = "target-instances")))]
16874#[derive(Clone, Debug)]
16875pub struct TargetInstances {
16876 inner: std::sync::Arc<dyn super::stub::dynamic::TargetInstances>,
16877}
16878
16879#[cfg(feature = "target-instances")]
16880impl TargetInstances {
16881 /// Returns a builder for [TargetInstances].
16882 ///
16883 /// ```
16884 /// # tokio_test::block_on(async {
16885 /// # use google_cloud_compute_v1::client::TargetInstances;
16886 /// let client = TargetInstances::builder().build().await?;
16887 /// # gax::client_builder::Result::<()>::Ok(()) });
16888 /// ```
16889 pub fn builder() -> super::builder::target_instances::ClientBuilder {
16890 gax::client_builder::internal::new_builder(
16891 super::builder::target_instances::client::Factory,
16892 )
16893 }
16894
16895 /// Creates a new client from the provided stub.
16896 ///
16897 /// The most common case for calling this function is in tests mocking the
16898 /// client's behavior.
16899 pub fn from_stub<T>(stub: T) -> Self
16900 where
16901 T: super::stub::TargetInstances + 'static,
16902 {
16903 Self {
16904 inner: std::sync::Arc::new(stub),
16905 }
16906 }
16907
16908 pub(crate) async fn new(
16909 config: gaxi::options::ClientConfig,
16910 ) -> gax::client_builder::Result<Self> {
16911 let inner = Self::build_inner(config).await?;
16912 Ok(Self { inner })
16913 }
16914
16915 async fn build_inner(
16916 conf: gaxi::options::ClientConfig,
16917 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::TargetInstances>>
16918 {
16919 if gaxi::options::tracing_enabled(&conf) {
16920 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16921 }
16922 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16923 }
16924
16925 async fn build_transport(
16926 conf: gaxi::options::ClientConfig,
16927 ) -> gax::client_builder::Result<impl super::stub::TargetInstances> {
16928 super::transport::TargetInstances::new(conf).await
16929 }
16930
16931 async fn build_with_tracing(
16932 conf: gaxi::options::ClientConfig,
16933 ) -> gax::client_builder::Result<impl super::stub::TargetInstances> {
16934 Self::build_transport(conf)
16935 .await
16936 .map(super::tracing::TargetInstances::new)
16937 }
16938
16939 /// Retrieves an aggregated list of target instances.
16940 ///
16941 /// To prevent failure, Google recommends that you set the
16942 /// `returnPartialSuccess` parameter to `true`.
16943 pub fn aggregated_list(&self) -> super::builder::target_instances::AggregatedList {
16944 super::builder::target_instances::AggregatedList::new(self.inner.clone())
16945 }
16946
16947 /// Deletes the specified TargetInstance resource.
16948 pub fn delete(&self) -> super::builder::target_instances::Delete {
16949 super::builder::target_instances::Delete::new(self.inner.clone())
16950 }
16951
16952 /// Returns the specified TargetInstance resource.
16953 pub fn get(&self) -> super::builder::target_instances::Get {
16954 super::builder::target_instances::Get::new(self.inner.clone())
16955 }
16956
16957 /// Creates a TargetInstance resource in the specified project and zone using
16958 /// the data included in the request.
16959 pub fn insert(&self) -> super::builder::target_instances::Insert {
16960 super::builder::target_instances::Insert::new(self.inner.clone())
16961 }
16962
16963 /// Retrieves a list of TargetInstance resources available to the specified
16964 /// project and zone.
16965 pub fn list(&self) -> super::builder::target_instances::List {
16966 super::builder::target_instances::List::new(self.inner.clone())
16967 }
16968
16969 /// Sets the Google Cloud Armor security policy for the specified target
16970 /// instance. For more information, seeGoogle
16971 /// Cloud Armor Overview
16972 pub fn set_security_policy(&self) -> super::builder::target_instances::SetSecurityPolicy {
16973 super::builder::target_instances::SetSecurityPolicy::new(self.inner.clone())
16974 }
16975
16976 /// Returns permissions that a caller has on the specified resource.
16977 pub fn test_iam_permissions(&self) -> super::builder::target_instances::TestIamPermissions {
16978 super::builder::target_instances::TestIamPermissions::new(self.inner.clone())
16979 }
16980
16981 /// Retrieves the specified zone-specific Operations resource.
16982 pub fn get_operation(&self) -> super::builder::target_instances::GetOperation {
16983 super::builder::target_instances::GetOperation::new(self.inner.clone())
16984 }
16985}
16986
16987/// Implements a client for the Google Compute Engine API.
16988///
16989/// # Example
16990/// ```
16991/// # tokio_test::block_on(async {
16992/// # use google_cloud_compute_v1::client::TargetPools;
16993/// let client = TargetPools::builder().build().await?;
16994/// // use `client` to make requests to the Google Compute Engine API.
16995/// # gax::client_builder::Result::<()>::Ok(()) });
16996/// ```
16997///
16998/// # Service Description
16999///
17000/// Service for the `targetPools` resource.
17001///
17002/// # Configuration
17003///
17004/// To configure `TargetPools` use the `with_*` methods in the type returned
17005/// by [builder()][TargetPools::builder]. The default configuration should
17006/// work for most applications. Common configuration changes include
17007///
17008/// * [with_endpoint()]: by default this client uses the global default endpoint
17009/// (`https://compute.googleapis.com`). Applications using regional
17010/// endpoints or running in restricted networks (e.g. a network configured
17011// with [Private Google Access with VPC Service Controls]) may want to
17012/// override this default.
17013/// * [with_credentials()]: by default this client uses
17014/// [Application Default Credentials]. Applications using custom
17015/// authentication may need to override this default.
17016///
17017/// [with_endpoint()]: super::builder::target_pools::ClientBuilder::with_endpoint
17018/// [with_credentials()]: super::builder::target_pools::ClientBuilder::credentials
17019/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17020/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17021///
17022/// # Pooling and Cloning
17023///
17024/// `TargetPools` holds a connection pool internally, it is advised to
17025/// create one and the reuse it. You do not need to wrap `TargetPools` in
17026/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17027/// already uses an `Arc` internally.
17028#[cfg(feature = "target-pools")]
17029#[cfg_attr(docsrs, doc(cfg(feature = "target-pools")))]
17030#[derive(Clone, Debug)]
17031pub struct TargetPools {
17032 inner: std::sync::Arc<dyn super::stub::dynamic::TargetPools>,
17033}
17034
17035#[cfg(feature = "target-pools")]
17036impl TargetPools {
17037 /// Returns a builder for [TargetPools].
17038 ///
17039 /// ```
17040 /// # tokio_test::block_on(async {
17041 /// # use google_cloud_compute_v1::client::TargetPools;
17042 /// let client = TargetPools::builder().build().await?;
17043 /// # gax::client_builder::Result::<()>::Ok(()) });
17044 /// ```
17045 pub fn builder() -> super::builder::target_pools::ClientBuilder {
17046 gax::client_builder::internal::new_builder(super::builder::target_pools::client::Factory)
17047 }
17048
17049 /// Creates a new client from the provided stub.
17050 ///
17051 /// The most common case for calling this function is in tests mocking the
17052 /// client's behavior.
17053 pub fn from_stub<T>(stub: T) -> Self
17054 where
17055 T: super::stub::TargetPools + 'static,
17056 {
17057 Self {
17058 inner: std::sync::Arc::new(stub),
17059 }
17060 }
17061
17062 pub(crate) async fn new(
17063 config: gaxi::options::ClientConfig,
17064 ) -> gax::client_builder::Result<Self> {
17065 let inner = Self::build_inner(config).await?;
17066 Ok(Self { inner })
17067 }
17068
17069 async fn build_inner(
17070 conf: gaxi::options::ClientConfig,
17071 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::TargetPools>> {
17072 if gaxi::options::tracing_enabled(&conf) {
17073 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17074 }
17075 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17076 }
17077
17078 async fn build_transport(
17079 conf: gaxi::options::ClientConfig,
17080 ) -> gax::client_builder::Result<impl super::stub::TargetPools> {
17081 super::transport::TargetPools::new(conf).await
17082 }
17083
17084 async fn build_with_tracing(
17085 conf: gaxi::options::ClientConfig,
17086 ) -> gax::client_builder::Result<impl super::stub::TargetPools> {
17087 Self::build_transport(conf)
17088 .await
17089 .map(super::tracing::TargetPools::new)
17090 }
17091
17092 /// Adds health check URLs to a target pool.
17093 pub fn add_health_check(&self) -> super::builder::target_pools::AddHealthCheck {
17094 super::builder::target_pools::AddHealthCheck::new(self.inner.clone())
17095 }
17096
17097 /// Adds an instance to a target pool.
17098 pub fn add_instance(&self) -> super::builder::target_pools::AddInstance {
17099 super::builder::target_pools::AddInstance::new(self.inner.clone())
17100 }
17101
17102 /// Retrieves an aggregated list of target pools.
17103 ///
17104 /// To prevent failure, Google recommends that you set the
17105 /// `returnPartialSuccess` parameter to `true`.
17106 pub fn aggregated_list(&self) -> super::builder::target_pools::AggregatedList {
17107 super::builder::target_pools::AggregatedList::new(self.inner.clone())
17108 }
17109
17110 /// Deletes the specified target pool.
17111 pub fn delete(&self) -> super::builder::target_pools::Delete {
17112 super::builder::target_pools::Delete::new(self.inner.clone())
17113 }
17114
17115 /// Returns the specified target pool.
17116 pub fn get(&self) -> super::builder::target_pools::Get {
17117 super::builder::target_pools::Get::new(self.inner.clone())
17118 }
17119
17120 /// Gets the most recent health check results for each IP for the
17121 /// instance that is referenced by the given target pool.
17122 pub fn get_health(&self) -> super::builder::target_pools::GetHealth {
17123 super::builder::target_pools::GetHealth::new(self.inner.clone())
17124 }
17125
17126 /// Creates a target pool in the specified project and region using
17127 /// the data included in the request.
17128 pub fn insert(&self) -> super::builder::target_pools::Insert {
17129 super::builder::target_pools::Insert::new(self.inner.clone())
17130 }
17131
17132 /// Retrieves a list of target pools available to the specified
17133 /// project and region.
17134 pub fn list(&self) -> super::builder::target_pools::List {
17135 super::builder::target_pools::List::new(self.inner.clone())
17136 }
17137
17138 /// Removes health check URL from a target pool.
17139 pub fn remove_health_check(&self) -> super::builder::target_pools::RemoveHealthCheck {
17140 super::builder::target_pools::RemoveHealthCheck::new(self.inner.clone())
17141 }
17142
17143 /// Removes instance URL from a target pool.
17144 pub fn remove_instance(&self) -> super::builder::target_pools::RemoveInstance {
17145 super::builder::target_pools::RemoveInstance::new(self.inner.clone())
17146 }
17147
17148 /// Changes a backup target pool's configurations.
17149 pub fn set_backup(&self) -> super::builder::target_pools::SetBackup {
17150 super::builder::target_pools::SetBackup::new(self.inner.clone())
17151 }
17152
17153 /// Sets the Google Cloud Armor security policy for the specified target pool.
17154 /// For more information, seeGoogle
17155 /// Cloud Armor Overview
17156 pub fn set_security_policy(&self) -> super::builder::target_pools::SetSecurityPolicy {
17157 super::builder::target_pools::SetSecurityPolicy::new(self.inner.clone())
17158 }
17159
17160 /// Returns permissions that a caller has on the specified resource.
17161 pub fn test_iam_permissions(&self) -> super::builder::target_pools::TestIamPermissions {
17162 super::builder::target_pools::TestIamPermissions::new(self.inner.clone())
17163 }
17164
17165 /// Retrieves the specified region-specific Operations resource.
17166 pub fn get_operation(&self) -> super::builder::target_pools::GetOperation {
17167 super::builder::target_pools::GetOperation::new(self.inner.clone())
17168 }
17169}
17170
17171/// Implements a client for the Google Compute Engine API.
17172///
17173/// # Example
17174/// ```
17175/// # tokio_test::block_on(async {
17176/// # use google_cloud_compute_v1::client::TargetSslProxies;
17177/// let client = TargetSslProxies::builder().build().await?;
17178/// // use `client` to make requests to the Google Compute Engine API.
17179/// # gax::client_builder::Result::<()>::Ok(()) });
17180/// ```
17181///
17182/// # Service Description
17183///
17184/// Service for the `targetSslProxies` resource.
17185///
17186/// # Configuration
17187///
17188/// To configure `TargetSslProxies` use the `with_*` methods in the type returned
17189/// by [builder()][TargetSslProxies::builder]. The default configuration should
17190/// work for most applications. Common configuration changes include
17191///
17192/// * [with_endpoint()]: by default this client uses the global default endpoint
17193/// (`https://compute.googleapis.com`). Applications using regional
17194/// endpoints or running in restricted networks (e.g. a network configured
17195// with [Private Google Access with VPC Service Controls]) may want to
17196/// override this default.
17197/// * [with_credentials()]: by default this client uses
17198/// [Application Default Credentials]. Applications using custom
17199/// authentication may need to override this default.
17200///
17201/// [with_endpoint()]: super::builder::target_ssl_proxies::ClientBuilder::with_endpoint
17202/// [with_credentials()]: super::builder::target_ssl_proxies::ClientBuilder::credentials
17203/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17204/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17205///
17206/// # Pooling and Cloning
17207///
17208/// `TargetSslProxies` holds a connection pool internally, it is advised to
17209/// create one and the reuse it. You do not need to wrap `TargetSslProxies` in
17210/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17211/// already uses an `Arc` internally.
17212#[cfg(feature = "target-ssl-proxies")]
17213#[cfg_attr(docsrs, doc(cfg(feature = "target-ssl-proxies")))]
17214#[derive(Clone, Debug)]
17215pub struct TargetSslProxies {
17216 inner: std::sync::Arc<dyn super::stub::dynamic::TargetSslProxies>,
17217}
17218
17219#[cfg(feature = "target-ssl-proxies")]
17220impl TargetSslProxies {
17221 /// Returns a builder for [TargetSslProxies].
17222 ///
17223 /// ```
17224 /// # tokio_test::block_on(async {
17225 /// # use google_cloud_compute_v1::client::TargetSslProxies;
17226 /// let client = TargetSslProxies::builder().build().await?;
17227 /// # gax::client_builder::Result::<()>::Ok(()) });
17228 /// ```
17229 pub fn builder() -> super::builder::target_ssl_proxies::ClientBuilder {
17230 gax::client_builder::internal::new_builder(
17231 super::builder::target_ssl_proxies::client::Factory,
17232 )
17233 }
17234
17235 /// Creates a new client from the provided stub.
17236 ///
17237 /// The most common case for calling this function is in tests mocking the
17238 /// client's behavior.
17239 pub fn from_stub<T>(stub: T) -> Self
17240 where
17241 T: super::stub::TargetSslProxies + 'static,
17242 {
17243 Self {
17244 inner: std::sync::Arc::new(stub),
17245 }
17246 }
17247
17248 pub(crate) async fn new(
17249 config: gaxi::options::ClientConfig,
17250 ) -> gax::client_builder::Result<Self> {
17251 let inner = Self::build_inner(config).await?;
17252 Ok(Self { inner })
17253 }
17254
17255 async fn build_inner(
17256 conf: gaxi::options::ClientConfig,
17257 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::TargetSslProxies>>
17258 {
17259 if gaxi::options::tracing_enabled(&conf) {
17260 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17261 }
17262 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17263 }
17264
17265 async fn build_transport(
17266 conf: gaxi::options::ClientConfig,
17267 ) -> gax::client_builder::Result<impl super::stub::TargetSslProxies> {
17268 super::transport::TargetSslProxies::new(conf).await
17269 }
17270
17271 async fn build_with_tracing(
17272 conf: gaxi::options::ClientConfig,
17273 ) -> gax::client_builder::Result<impl super::stub::TargetSslProxies> {
17274 Self::build_transport(conf)
17275 .await
17276 .map(super::tracing::TargetSslProxies::new)
17277 }
17278
17279 /// Deletes the specified TargetSslProxy resource.
17280 pub fn delete(&self) -> super::builder::target_ssl_proxies::Delete {
17281 super::builder::target_ssl_proxies::Delete::new(self.inner.clone())
17282 }
17283
17284 /// Returns the specified TargetSslProxy resource.
17285 pub fn get(&self) -> super::builder::target_ssl_proxies::Get {
17286 super::builder::target_ssl_proxies::Get::new(self.inner.clone())
17287 }
17288
17289 /// Creates a TargetSslProxy resource in the specified project using
17290 /// the data included in the request.
17291 pub fn insert(&self) -> super::builder::target_ssl_proxies::Insert {
17292 super::builder::target_ssl_proxies::Insert::new(self.inner.clone())
17293 }
17294
17295 /// Retrieves the list of TargetSslProxy resources
17296 /// available to the specified project.
17297 pub fn list(&self) -> super::builder::target_ssl_proxies::List {
17298 super::builder::target_ssl_proxies::List::new(self.inner.clone())
17299 }
17300
17301 /// Changes the BackendService for TargetSslProxy.
17302 pub fn set_backend_service(&self) -> super::builder::target_ssl_proxies::SetBackendService {
17303 super::builder::target_ssl_proxies::SetBackendService::new(self.inner.clone())
17304 }
17305
17306 /// Changes the Certificate Map for TargetSslProxy.
17307 pub fn set_certificate_map(&self) -> super::builder::target_ssl_proxies::SetCertificateMap {
17308 super::builder::target_ssl_proxies::SetCertificateMap::new(self.inner.clone())
17309 }
17310
17311 /// Changes the ProxyHeaderType for TargetSslProxy.
17312 pub fn set_proxy_header(&self) -> super::builder::target_ssl_proxies::SetProxyHeader {
17313 super::builder::target_ssl_proxies::SetProxyHeader::new(self.inner.clone())
17314 }
17315
17316 /// Changes SslCertificates for TargetSslProxy.
17317 pub fn set_ssl_certificates(&self) -> super::builder::target_ssl_proxies::SetSslCertificates {
17318 super::builder::target_ssl_proxies::SetSslCertificates::new(self.inner.clone())
17319 }
17320
17321 /// Sets the SSL policy for TargetSslProxy. The SSL policy specifies the
17322 /// server-side support for SSL features. This affects connections between
17323 /// clients and the load balancer. They do not affect the
17324 /// connection between the load balancer and the backends.
17325 pub fn set_ssl_policy(&self) -> super::builder::target_ssl_proxies::SetSslPolicy {
17326 super::builder::target_ssl_proxies::SetSslPolicy::new(self.inner.clone())
17327 }
17328
17329 /// Retrieves the specified Operations resource.
17330 pub fn get_operation(&self) -> super::builder::target_ssl_proxies::GetOperation {
17331 super::builder::target_ssl_proxies::GetOperation::new(self.inner.clone())
17332 }
17333}
17334
17335/// Implements a client for the Google Compute Engine API.
17336///
17337/// # Example
17338/// ```
17339/// # tokio_test::block_on(async {
17340/// # use google_cloud_compute_v1::client::TargetTcpProxies;
17341/// let client = TargetTcpProxies::builder().build().await?;
17342/// // use `client` to make requests to the Google Compute Engine API.
17343/// # gax::client_builder::Result::<()>::Ok(()) });
17344/// ```
17345///
17346/// # Service Description
17347///
17348/// Service for the `targetTcpProxies` resource.
17349///
17350/// # Configuration
17351///
17352/// To configure `TargetTcpProxies` use the `with_*` methods in the type returned
17353/// by [builder()][TargetTcpProxies::builder]. The default configuration should
17354/// work for most applications. Common configuration changes include
17355///
17356/// * [with_endpoint()]: by default this client uses the global default endpoint
17357/// (`https://compute.googleapis.com`). Applications using regional
17358/// endpoints or running in restricted networks (e.g. a network configured
17359// with [Private Google Access with VPC Service Controls]) may want to
17360/// override this default.
17361/// * [with_credentials()]: by default this client uses
17362/// [Application Default Credentials]. Applications using custom
17363/// authentication may need to override this default.
17364///
17365/// [with_endpoint()]: super::builder::target_tcp_proxies::ClientBuilder::with_endpoint
17366/// [with_credentials()]: super::builder::target_tcp_proxies::ClientBuilder::credentials
17367/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17368/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17369///
17370/// # Pooling and Cloning
17371///
17372/// `TargetTcpProxies` holds a connection pool internally, it is advised to
17373/// create one and the reuse it. You do not need to wrap `TargetTcpProxies` in
17374/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17375/// already uses an `Arc` internally.
17376#[cfg(feature = "target-tcp-proxies")]
17377#[cfg_attr(docsrs, doc(cfg(feature = "target-tcp-proxies")))]
17378#[derive(Clone, Debug)]
17379pub struct TargetTcpProxies {
17380 inner: std::sync::Arc<dyn super::stub::dynamic::TargetTcpProxies>,
17381}
17382
17383#[cfg(feature = "target-tcp-proxies")]
17384impl TargetTcpProxies {
17385 /// Returns a builder for [TargetTcpProxies].
17386 ///
17387 /// ```
17388 /// # tokio_test::block_on(async {
17389 /// # use google_cloud_compute_v1::client::TargetTcpProxies;
17390 /// let client = TargetTcpProxies::builder().build().await?;
17391 /// # gax::client_builder::Result::<()>::Ok(()) });
17392 /// ```
17393 pub fn builder() -> super::builder::target_tcp_proxies::ClientBuilder {
17394 gax::client_builder::internal::new_builder(
17395 super::builder::target_tcp_proxies::client::Factory,
17396 )
17397 }
17398
17399 /// Creates a new client from the provided stub.
17400 ///
17401 /// The most common case for calling this function is in tests mocking the
17402 /// client's behavior.
17403 pub fn from_stub<T>(stub: T) -> Self
17404 where
17405 T: super::stub::TargetTcpProxies + 'static,
17406 {
17407 Self {
17408 inner: std::sync::Arc::new(stub),
17409 }
17410 }
17411
17412 pub(crate) async fn new(
17413 config: gaxi::options::ClientConfig,
17414 ) -> gax::client_builder::Result<Self> {
17415 let inner = Self::build_inner(config).await?;
17416 Ok(Self { inner })
17417 }
17418
17419 async fn build_inner(
17420 conf: gaxi::options::ClientConfig,
17421 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::TargetTcpProxies>>
17422 {
17423 if gaxi::options::tracing_enabled(&conf) {
17424 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17425 }
17426 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17427 }
17428
17429 async fn build_transport(
17430 conf: gaxi::options::ClientConfig,
17431 ) -> gax::client_builder::Result<impl super::stub::TargetTcpProxies> {
17432 super::transport::TargetTcpProxies::new(conf).await
17433 }
17434
17435 async fn build_with_tracing(
17436 conf: gaxi::options::ClientConfig,
17437 ) -> gax::client_builder::Result<impl super::stub::TargetTcpProxies> {
17438 Self::build_transport(conf)
17439 .await
17440 .map(super::tracing::TargetTcpProxies::new)
17441 }
17442
17443 /// Retrieves the list of all TargetTcpProxy resources, regional and global,
17444 /// available to the specified project.
17445 ///
17446 /// To prevent failure, Google recommends that you set the
17447 /// `returnPartialSuccess` parameter to `true`.
17448 pub fn aggregated_list(&self) -> super::builder::target_tcp_proxies::AggregatedList {
17449 super::builder::target_tcp_proxies::AggregatedList::new(self.inner.clone())
17450 }
17451
17452 /// Deletes the specified TargetTcpProxy resource.
17453 pub fn delete(&self) -> super::builder::target_tcp_proxies::Delete {
17454 super::builder::target_tcp_proxies::Delete::new(self.inner.clone())
17455 }
17456
17457 /// Returns the specified TargetTcpProxy resource.
17458 pub fn get(&self) -> super::builder::target_tcp_proxies::Get {
17459 super::builder::target_tcp_proxies::Get::new(self.inner.clone())
17460 }
17461
17462 /// Creates a TargetTcpProxy resource in the specified project using
17463 /// the data included in the request.
17464 pub fn insert(&self) -> super::builder::target_tcp_proxies::Insert {
17465 super::builder::target_tcp_proxies::Insert::new(self.inner.clone())
17466 }
17467
17468 /// Retrieves the list of TargetTcpProxy resources
17469 /// available to the specified project.
17470 pub fn list(&self) -> super::builder::target_tcp_proxies::List {
17471 super::builder::target_tcp_proxies::List::new(self.inner.clone())
17472 }
17473
17474 /// Changes the BackendService for TargetTcpProxy.
17475 pub fn set_backend_service(&self) -> super::builder::target_tcp_proxies::SetBackendService {
17476 super::builder::target_tcp_proxies::SetBackendService::new(self.inner.clone())
17477 }
17478
17479 /// Changes the ProxyHeaderType for TargetTcpProxy.
17480 pub fn set_proxy_header(&self) -> super::builder::target_tcp_proxies::SetProxyHeader {
17481 super::builder::target_tcp_proxies::SetProxyHeader::new(self.inner.clone())
17482 }
17483
17484 /// Retrieves the specified Operations resource.
17485 pub fn get_operation(&self) -> super::builder::target_tcp_proxies::GetOperation {
17486 super::builder::target_tcp_proxies::GetOperation::new(self.inner.clone())
17487 }
17488}
17489
17490/// Implements a client for the Google Compute Engine API.
17491///
17492/// # Example
17493/// ```
17494/// # tokio_test::block_on(async {
17495/// # use google_cloud_compute_v1::client::TargetVpnGateways;
17496/// let client = TargetVpnGateways::builder().build().await?;
17497/// // use `client` to make requests to the Google Compute Engine API.
17498/// # gax::client_builder::Result::<()>::Ok(()) });
17499/// ```
17500///
17501/// # Service Description
17502///
17503/// Service for the `targetVpnGateways` resource.
17504///
17505/// # Configuration
17506///
17507/// To configure `TargetVpnGateways` use the `with_*` methods in the type returned
17508/// by [builder()][TargetVpnGateways::builder]. The default configuration should
17509/// work for most applications. Common configuration changes include
17510///
17511/// * [with_endpoint()]: by default this client uses the global default endpoint
17512/// (`https://compute.googleapis.com`). Applications using regional
17513/// endpoints or running in restricted networks (e.g. a network configured
17514// with [Private Google Access with VPC Service Controls]) may want to
17515/// override this default.
17516/// * [with_credentials()]: by default this client uses
17517/// [Application Default Credentials]. Applications using custom
17518/// authentication may need to override this default.
17519///
17520/// [with_endpoint()]: super::builder::target_vpn_gateways::ClientBuilder::with_endpoint
17521/// [with_credentials()]: super::builder::target_vpn_gateways::ClientBuilder::credentials
17522/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17523/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17524///
17525/// # Pooling and Cloning
17526///
17527/// `TargetVpnGateways` holds a connection pool internally, it is advised to
17528/// create one and the reuse it. You do not need to wrap `TargetVpnGateways` in
17529/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17530/// already uses an `Arc` internally.
17531#[cfg(feature = "target-vpn-gateways")]
17532#[cfg_attr(docsrs, doc(cfg(feature = "target-vpn-gateways")))]
17533#[derive(Clone, Debug)]
17534pub struct TargetVpnGateways {
17535 inner: std::sync::Arc<dyn super::stub::dynamic::TargetVpnGateways>,
17536}
17537
17538#[cfg(feature = "target-vpn-gateways")]
17539impl TargetVpnGateways {
17540 /// Returns a builder for [TargetVpnGateways].
17541 ///
17542 /// ```
17543 /// # tokio_test::block_on(async {
17544 /// # use google_cloud_compute_v1::client::TargetVpnGateways;
17545 /// let client = TargetVpnGateways::builder().build().await?;
17546 /// # gax::client_builder::Result::<()>::Ok(()) });
17547 /// ```
17548 pub fn builder() -> super::builder::target_vpn_gateways::ClientBuilder {
17549 gax::client_builder::internal::new_builder(
17550 super::builder::target_vpn_gateways::client::Factory,
17551 )
17552 }
17553
17554 /// Creates a new client from the provided stub.
17555 ///
17556 /// The most common case for calling this function is in tests mocking the
17557 /// client's behavior.
17558 pub fn from_stub<T>(stub: T) -> Self
17559 where
17560 T: super::stub::TargetVpnGateways + 'static,
17561 {
17562 Self {
17563 inner: std::sync::Arc::new(stub),
17564 }
17565 }
17566
17567 pub(crate) async fn new(
17568 config: gaxi::options::ClientConfig,
17569 ) -> gax::client_builder::Result<Self> {
17570 let inner = Self::build_inner(config).await?;
17571 Ok(Self { inner })
17572 }
17573
17574 async fn build_inner(
17575 conf: gaxi::options::ClientConfig,
17576 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::TargetVpnGateways>>
17577 {
17578 if gaxi::options::tracing_enabled(&conf) {
17579 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17580 }
17581 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17582 }
17583
17584 async fn build_transport(
17585 conf: gaxi::options::ClientConfig,
17586 ) -> gax::client_builder::Result<impl super::stub::TargetVpnGateways> {
17587 super::transport::TargetVpnGateways::new(conf).await
17588 }
17589
17590 async fn build_with_tracing(
17591 conf: gaxi::options::ClientConfig,
17592 ) -> gax::client_builder::Result<impl super::stub::TargetVpnGateways> {
17593 Self::build_transport(conf)
17594 .await
17595 .map(super::tracing::TargetVpnGateways::new)
17596 }
17597
17598 /// Retrieves an aggregated list of target VPN gateways.
17599 ///
17600 /// To prevent failure, Google recommends that you set the
17601 /// `returnPartialSuccess` parameter to `true`.
17602 pub fn aggregated_list(&self) -> super::builder::target_vpn_gateways::AggregatedList {
17603 super::builder::target_vpn_gateways::AggregatedList::new(self.inner.clone())
17604 }
17605
17606 /// Deletes the specified target VPN gateway.
17607 pub fn delete(&self) -> super::builder::target_vpn_gateways::Delete {
17608 super::builder::target_vpn_gateways::Delete::new(self.inner.clone())
17609 }
17610
17611 /// Returns the specified target VPN gateway.
17612 pub fn get(&self) -> super::builder::target_vpn_gateways::Get {
17613 super::builder::target_vpn_gateways::Get::new(self.inner.clone())
17614 }
17615
17616 /// Creates a target VPN gateway in the specified project and region using
17617 /// the data included in the request.
17618 pub fn insert(&self) -> super::builder::target_vpn_gateways::Insert {
17619 super::builder::target_vpn_gateways::Insert::new(self.inner.clone())
17620 }
17621
17622 /// Retrieves a list of target VPN gateways available to the specified
17623 /// project and region.
17624 pub fn list(&self) -> super::builder::target_vpn_gateways::List {
17625 super::builder::target_vpn_gateways::List::new(self.inner.clone())
17626 }
17627
17628 /// Sets the labels on a TargetVpnGateway. To learn more about labels, read theLabeling
17629 /// Resources documentation.
17630 pub fn set_labels(&self) -> super::builder::target_vpn_gateways::SetLabels {
17631 super::builder::target_vpn_gateways::SetLabels::new(self.inner.clone())
17632 }
17633
17634 /// Retrieves the specified region-specific Operations resource.
17635 pub fn get_operation(&self) -> super::builder::target_vpn_gateways::GetOperation {
17636 super::builder::target_vpn_gateways::GetOperation::new(self.inner.clone())
17637 }
17638}
17639
17640/// Implements a client for the Google Compute Engine API.
17641///
17642/// # Example
17643/// ```
17644/// # tokio_test::block_on(async {
17645/// # use google_cloud_compute_v1::client::UrlMaps;
17646/// let client = UrlMaps::builder().build().await?;
17647/// // use `client` to make requests to the Google Compute Engine API.
17648/// # gax::client_builder::Result::<()>::Ok(()) });
17649/// ```
17650///
17651/// # Service Description
17652///
17653/// Service for the `urlMaps` resource.
17654///
17655/// # Configuration
17656///
17657/// To configure `UrlMaps` use the `with_*` methods in the type returned
17658/// by [builder()][UrlMaps::builder]. The default configuration should
17659/// work for most applications. Common configuration changes include
17660///
17661/// * [with_endpoint()]: by default this client uses the global default endpoint
17662/// (`https://compute.googleapis.com`). Applications using regional
17663/// endpoints or running in restricted networks (e.g. a network configured
17664// with [Private Google Access with VPC Service Controls]) may want to
17665/// override this default.
17666/// * [with_credentials()]: by default this client uses
17667/// [Application Default Credentials]. Applications using custom
17668/// authentication may need to override this default.
17669///
17670/// [with_endpoint()]: super::builder::url_maps::ClientBuilder::with_endpoint
17671/// [with_credentials()]: super::builder::url_maps::ClientBuilder::credentials
17672/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17673/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17674///
17675/// # Pooling and Cloning
17676///
17677/// `UrlMaps` holds a connection pool internally, it is advised to
17678/// create one and the reuse it. You do not need to wrap `UrlMaps` in
17679/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17680/// already uses an `Arc` internally.
17681#[cfg(feature = "url-maps")]
17682#[cfg_attr(docsrs, doc(cfg(feature = "url-maps")))]
17683#[derive(Clone, Debug)]
17684pub struct UrlMaps {
17685 inner: std::sync::Arc<dyn super::stub::dynamic::UrlMaps>,
17686}
17687
17688#[cfg(feature = "url-maps")]
17689impl UrlMaps {
17690 /// Returns a builder for [UrlMaps].
17691 ///
17692 /// ```
17693 /// # tokio_test::block_on(async {
17694 /// # use google_cloud_compute_v1::client::UrlMaps;
17695 /// let client = UrlMaps::builder().build().await?;
17696 /// # gax::client_builder::Result::<()>::Ok(()) });
17697 /// ```
17698 pub fn builder() -> super::builder::url_maps::ClientBuilder {
17699 gax::client_builder::internal::new_builder(super::builder::url_maps::client::Factory)
17700 }
17701
17702 /// Creates a new client from the provided stub.
17703 ///
17704 /// The most common case for calling this function is in tests mocking the
17705 /// client's behavior.
17706 pub fn from_stub<T>(stub: T) -> Self
17707 where
17708 T: super::stub::UrlMaps + 'static,
17709 {
17710 Self {
17711 inner: std::sync::Arc::new(stub),
17712 }
17713 }
17714
17715 pub(crate) async fn new(
17716 config: gaxi::options::ClientConfig,
17717 ) -> gax::client_builder::Result<Self> {
17718 let inner = Self::build_inner(config).await?;
17719 Ok(Self { inner })
17720 }
17721
17722 async fn build_inner(
17723 conf: gaxi::options::ClientConfig,
17724 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::UrlMaps>> {
17725 if gaxi::options::tracing_enabled(&conf) {
17726 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17727 }
17728 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17729 }
17730
17731 async fn build_transport(
17732 conf: gaxi::options::ClientConfig,
17733 ) -> gax::client_builder::Result<impl super::stub::UrlMaps> {
17734 super::transport::UrlMaps::new(conf).await
17735 }
17736
17737 async fn build_with_tracing(
17738 conf: gaxi::options::ClientConfig,
17739 ) -> gax::client_builder::Result<impl super::stub::UrlMaps> {
17740 Self::build_transport(conf)
17741 .await
17742 .map(super::tracing::UrlMaps::new)
17743 }
17744
17745 /// Retrieves the list of all UrlMap resources, regional and global,
17746 /// available to the specified project.
17747 ///
17748 /// To prevent failure, Google recommends that you set the
17749 /// `returnPartialSuccess` parameter to `true`.
17750 pub fn aggregated_list(&self) -> super::builder::url_maps::AggregatedList {
17751 super::builder::url_maps::AggregatedList::new(self.inner.clone())
17752 }
17753
17754 /// Deletes the specified UrlMap resource.
17755 pub fn delete(&self) -> super::builder::url_maps::Delete {
17756 super::builder::url_maps::Delete::new(self.inner.clone())
17757 }
17758
17759 /// Returns the specified UrlMap resource.
17760 pub fn get(&self) -> super::builder::url_maps::Get {
17761 super::builder::url_maps::Get::new(self.inner.clone())
17762 }
17763
17764 /// Creates a UrlMap resource in the specified project using
17765 /// the data included in the request.
17766 pub fn insert(&self) -> super::builder::url_maps::Insert {
17767 super::builder::url_maps::Insert::new(self.inner.clone())
17768 }
17769
17770 /// Initiates a cache invalidation operation, invalidating the specified path,
17771 /// scoped to the specified UrlMap.
17772 ///
17773 /// For more information, see [Invalidating cached
17774 /// content](/cdn/docs/invalidating-cached-content).
17775 pub fn invalidate_cache(&self) -> super::builder::url_maps::InvalidateCache {
17776 super::builder::url_maps::InvalidateCache::new(self.inner.clone())
17777 }
17778
17779 /// Retrieves the list of UrlMap resources available to the specified
17780 /// project.
17781 pub fn list(&self) -> super::builder::url_maps::List {
17782 super::builder::url_maps::List::new(self.inner.clone())
17783 }
17784
17785 /// Patches the specified UrlMap resource with the data included in the
17786 /// request. This method supportsPATCH
17787 /// semantics and uses theJSON merge
17788 /// patch format and processing rules.
17789 pub fn patch(&self) -> super::builder::url_maps::Patch {
17790 super::builder::url_maps::Patch::new(self.inner.clone())
17791 }
17792
17793 /// Updates the specified UrlMap resource with the data included in the
17794 /// request.
17795 pub fn update(&self) -> super::builder::url_maps::Update {
17796 super::builder::url_maps::Update::new(self.inner.clone())
17797 }
17798
17799 /// Runs static validation for the UrlMap. In particular, the tests of the
17800 /// provided UrlMap will be run. Calling this method does NOT create the
17801 /// UrlMap.
17802 pub fn validate(&self) -> super::builder::url_maps::Validate {
17803 super::builder::url_maps::Validate::new(self.inner.clone())
17804 }
17805
17806 /// Retrieves the specified Operations resource.
17807 pub fn get_operation(&self) -> super::builder::url_maps::GetOperation {
17808 super::builder::url_maps::GetOperation::new(self.inner.clone())
17809 }
17810}
17811
17812/// Implements a client for the Google Compute Engine API.
17813///
17814/// # Example
17815/// ```
17816/// # tokio_test::block_on(async {
17817/// # use google_cloud_compute_v1::client::VpnGateways;
17818/// let client = VpnGateways::builder().build().await?;
17819/// // use `client` to make requests to the Google Compute Engine API.
17820/// # gax::client_builder::Result::<()>::Ok(()) });
17821/// ```
17822///
17823/// # Service Description
17824///
17825/// Service for the `vpnGateways` resource.
17826///
17827/// # Configuration
17828///
17829/// To configure `VpnGateways` use the `with_*` methods in the type returned
17830/// by [builder()][VpnGateways::builder]. The default configuration should
17831/// work for most applications. Common configuration changes include
17832///
17833/// * [with_endpoint()]: by default this client uses the global default endpoint
17834/// (`https://compute.googleapis.com`). Applications using regional
17835/// endpoints or running in restricted networks (e.g. a network configured
17836// with [Private Google Access with VPC Service Controls]) may want to
17837/// override this default.
17838/// * [with_credentials()]: by default this client uses
17839/// [Application Default Credentials]. Applications using custom
17840/// authentication may need to override this default.
17841///
17842/// [with_endpoint()]: super::builder::vpn_gateways::ClientBuilder::with_endpoint
17843/// [with_credentials()]: super::builder::vpn_gateways::ClientBuilder::credentials
17844/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17845/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17846///
17847/// # Pooling and Cloning
17848///
17849/// `VpnGateways` holds a connection pool internally, it is advised to
17850/// create one and the reuse it. You do not need to wrap `VpnGateways` in
17851/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17852/// already uses an `Arc` internally.
17853#[cfg(feature = "vpn-gateways")]
17854#[cfg_attr(docsrs, doc(cfg(feature = "vpn-gateways")))]
17855#[derive(Clone, Debug)]
17856pub struct VpnGateways {
17857 inner: std::sync::Arc<dyn super::stub::dynamic::VpnGateways>,
17858}
17859
17860#[cfg(feature = "vpn-gateways")]
17861impl VpnGateways {
17862 /// Returns a builder for [VpnGateways].
17863 ///
17864 /// ```
17865 /// # tokio_test::block_on(async {
17866 /// # use google_cloud_compute_v1::client::VpnGateways;
17867 /// let client = VpnGateways::builder().build().await?;
17868 /// # gax::client_builder::Result::<()>::Ok(()) });
17869 /// ```
17870 pub fn builder() -> super::builder::vpn_gateways::ClientBuilder {
17871 gax::client_builder::internal::new_builder(super::builder::vpn_gateways::client::Factory)
17872 }
17873
17874 /// Creates a new client from the provided stub.
17875 ///
17876 /// The most common case for calling this function is in tests mocking the
17877 /// client's behavior.
17878 pub fn from_stub<T>(stub: T) -> Self
17879 where
17880 T: super::stub::VpnGateways + 'static,
17881 {
17882 Self {
17883 inner: std::sync::Arc::new(stub),
17884 }
17885 }
17886
17887 pub(crate) async fn new(
17888 config: gaxi::options::ClientConfig,
17889 ) -> gax::client_builder::Result<Self> {
17890 let inner = Self::build_inner(config).await?;
17891 Ok(Self { inner })
17892 }
17893
17894 async fn build_inner(
17895 conf: gaxi::options::ClientConfig,
17896 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::VpnGateways>> {
17897 if gaxi::options::tracing_enabled(&conf) {
17898 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17899 }
17900 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17901 }
17902
17903 async fn build_transport(
17904 conf: gaxi::options::ClientConfig,
17905 ) -> gax::client_builder::Result<impl super::stub::VpnGateways> {
17906 super::transport::VpnGateways::new(conf).await
17907 }
17908
17909 async fn build_with_tracing(
17910 conf: gaxi::options::ClientConfig,
17911 ) -> gax::client_builder::Result<impl super::stub::VpnGateways> {
17912 Self::build_transport(conf)
17913 .await
17914 .map(super::tracing::VpnGateways::new)
17915 }
17916
17917 /// Retrieves an aggregated list of VPN gateways.
17918 ///
17919 /// To prevent failure, Google recommends that you set the
17920 /// `returnPartialSuccess` parameter to `true`.
17921 pub fn aggregated_list(&self) -> super::builder::vpn_gateways::AggregatedList {
17922 super::builder::vpn_gateways::AggregatedList::new(self.inner.clone())
17923 }
17924
17925 /// Deletes the specified VPN gateway.
17926 pub fn delete(&self) -> super::builder::vpn_gateways::Delete {
17927 super::builder::vpn_gateways::Delete::new(self.inner.clone())
17928 }
17929
17930 /// Returns the specified VPN gateway.
17931 pub fn get(&self) -> super::builder::vpn_gateways::Get {
17932 super::builder::vpn_gateways::Get::new(self.inner.clone())
17933 }
17934
17935 /// Returns the status for the specified VPN gateway.
17936 pub fn get_status(&self) -> super::builder::vpn_gateways::GetStatus {
17937 super::builder::vpn_gateways::GetStatus::new(self.inner.clone())
17938 }
17939
17940 /// Creates a VPN gateway in the specified project and region using
17941 /// the data included in the request.
17942 pub fn insert(&self) -> super::builder::vpn_gateways::Insert {
17943 super::builder::vpn_gateways::Insert::new(self.inner.clone())
17944 }
17945
17946 /// Retrieves a list of VPN gateways available to the specified
17947 /// project and region.
17948 pub fn list(&self) -> super::builder::vpn_gateways::List {
17949 super::builder::vpn_gateways::List::new(self.inner.clone())
17950 }
17951
17952 /// Sets the labels on a VpnGateway. To learn more about labels, read theLabeling
17953 /// Resources documentation.
17954 pub fn set_labels(&self) -> super::builder::vpn_gateways::SetLabels {
17955 super::builder::vpn_gateways::SetLabels::new(self.inner.clone())
17956 }
17957
17958 /// Returns permissions that a caller has on the specified resource.
17959 pub fn test_iam_permissions(&self) -> super::builder::vpn_gateways::TestIamPermissions {
17960 super::builder::vpn_gateways::TestIamPermissions::new(self.inner.clone())
17961 }
17962
17963 /// Retrieves the specified region-specific Operations resource.
17964 pub fn get_operation(&self) -> super::builder::vpn_gateways::GetOperation {
17965 super::builder::vpn_gateways::GetOperation::new(self.inner.clone())
17966 }
17967}
17968
17969/// Implements a client for the Google Compute Engine API.
17970///
17971/// # Example
17972/// ```
17973/// # tokio_test::block_on(async {
17974/// # use google_cloud_compute_v1::client::VpnTunnels;
17975/// let client = VpnTunnels::builder().build().await?;
17976/// // use `client` to make requests to the Google Compute Engine API.
17977/// # gax::client_builder::Result::<()>::Ok(()) });
17978/// ```
17979///
17980/// # Service Description
17981///
17982/// Service for the `vpnTunnels` resource.
17983///
17984/// # Configuration
17985///
17986/// To configure `VpnTunnels` use the `with_*` methods in the type returned
17987/// by [builder()][VpnTunnels::builder]. The default configuration should
17988/// work for most applications. Common configuration changes include
17989///
17990/// * [with_endpoint()]: by default this client uses the global default endpoint
17991/// (`https://compute.googleapis.com`). Applications using regional
17992/// endpoints or running in restricted networks (e.g. a network configured
17993// with [Private Google Access with VPC Service Controls]) may want to
17994/// override this default.
17995/// * [with_credentials()]: by default this client uses
17996/// [Application Default Credentials]. Applications using custom
17997/// authentication may need to override this default.
17998///
17999/// [with_endpoint()]: super::builder::vpn_tunnels::ClientBuilder::with_endpoint
18000/// [with_credentials()]: super::builder::vpn_tunnels::ClientBuilder::credentials
18001/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18002/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18003///
18004/// # Pooling and Cloning
18005///
18006/// `VpnTunnels` holds a connection pool internally, it is advised to
18007/// create one and the reuse it. You do not need to wrap `VpnTunnels` in
18008/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18009/// already uses an `Arc` internally.
18010#[cfg(feature = "vpn-tunnels")]
18011#[cfg_attr(docsrs, doc(cfg(feature = "vpn-tunnels")))]
18012#[derive(Clone, Debug)]
18013pub struct VpnTunnels {
18014 inner: std::sync::Arc<dyn super::stub::dynamic::VpnTunnels>,
18015}
18016
18017#[cfg(feature = "vpn-tunnels")]
18018impl VpnTunnels {
18019 /// Returns a builder for [VpnTunnels].
18020 ///
18021 /// ```
18022 /// # tokio_test::block_on(async {
18023 /// # use google_cloud_compute_v1::client::VpnTunnels;
18024 /// let client = VpnTunnels::builder().build().await?;
18025 /// # gax::client_builder::Result::<()>::Ok(()) });
18026 /// ```
18027 pub fn builder() -> super::builder::vpn_tunnels::ClientBuilder {
18028 gax::client_builder::internal::new_builder(super::builder::vpn_tunnels::client::Factory)
18029 }
18030
18031 /// Creates a new client from the provided stub.
18032 ///
18033 /// The most common case for calling this function is in tests mocking the
18034 /// client's behavior.
18035 pub fn from_stub<T>(stub: T) -> Self
18036 where
18037 T: super::stub::VpnTunnels + 'static,
18038 {
18039 Self {
18040 inner: std::sync::Arc::new(stub),
18041 }
18042 }
18043
18044 pub(crate) async fn new(
18045 config: gaxi::options::ClientConfig,
18046 ) -> gax::client_builder::Result<Self> {
18047 let inner = Self::build_inner(config).await?;
18048 Ok(Self { inner })
18049 }
18050
18051 async fn build_inner(
18052 conf: gaxi::options::ClientConfig,
18053 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::VpnTunnels>> {
18054 if gaxi::options::tracing_enabled(&conf) {
18055 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18056 }
18057 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18058 }
18059
18060 async fn build_transport(
18061 conf: gaxi::options::ClientConfig,
18062 ) -> gax::client_builder::Result<impl super::stub::VpnTunnels> {
18063 super::transport::VpnTunnels::new(conf).await
18064 }
18065
18066 async fn build_with_tracing(
18067 conf: gaxi::options::ClientConfig,
18068 ) -> gax::client_builder::Result<impl super::stub::VpnTunnels> {
18069 Self::build_transport(conf)
18070 .await
18071 .map(super::tracing::VpnTunnels::new)
18072 }
18073
18074 /// Retrieves an aggregated list of VPN tunnels.
18075 ///
18076 /// To prevent failure, Google recommends that you set the
18077 /// `returnPartialSuccess` parameter to `true`.
18078 pub fn aggregated_list(&self) -> super::builder::vpn_tunnels::AggregatedList {
18079 super::builder::vpn_tunnels::AggregatedList::new(self.inner.clone())
18080 }
18081
18082 /// Deletes the specified VpnTunnel resource.
18083 pub fn delete(&self) -> super::builder::vpn_tunnels::Delete {
18084 super::builder::vpn_tunnels::Delete::new(self.inner.clone())
18085 }
18086
18087 /// Returns the specified VpnTunnel resource.
18088 pub fn get(&self) -> super::builder::vpn_tunnels::Get {
18089 super::builder::vpn_tunnels::Get::new(self.inner.clone())
18090 }
18091
18092 /// Creates a VpnTunnel resource in the specified project and region using
18093 /// the data included in the request.
18094 pub fn insert(&self) -> super::builder::vpn_tunnels::Insert {
18095 super::builder::vpn_tunnels::Insert::new(self.inner.clone())
18096 }
18097
18098 /// Retrieves a list of VpnTunnel resources contained in the specified
18099 /// project and region.
18100 pub fn list(&self) -> super::builder::vpn_tunnels::List {
18101 super::builder::vpn_tunnels::List::new(self.inner.clone())
18102 }
18103
18104 /// Sets the labels on a VpnTunnel. To learn more about labels, read theLabeling
18105 /// Resources documentation.
18106 pub fn set_labels(&self) -> super::builder::vpn_tunnels::SetLabels {
18107 super::builder::vpn_tunnels::SetLabels::new(self.inner.clone())
18108 }
18109
18110 /// Retrieves the specified region-specific Operations resource.
18111 pub fn get_operation(&self) -> super::builder::vpn_tunnels::GetOperation {
18112 super::builder::vpn_tunnels::GetOperation::new(self.inner.clone())
18113 }
18114}
18115
18116/// Implements a client for the Google Compute Engine API.
18117///
18118/// # Example
18119/// ```
18120/// # tokio_test::block_on(async {
18121/// # use google_cloud_compute_v1::client::WireGroups;
18122/// let client = WireGroups::builder().build().await?;
18123/// // use `client` to make requests to the Google Compute Engine API.
18124/// # gax::client_builder::Result::<()>::Ok(()) });
18125/// ```
18126///
18127/// # Service Description
18128///
18129/// Service for the `wireGroups` resource.
18130///
18131/// # Configuration
18132///
18133/// To configure `WireGroups` use the `with_*` methods in the type returned
18134/// by [builder()][WireGroups::builder]. The default configuration should
18135/// work for most applications. Common configuration changes include
18136///
18137/// * [with_endpoint()]: by default this client uses the global default endpoint
18138/// (`https://compute.googleapis.com`). Applications using regional
18139/// endpoints or running in restricted networks (e.g. a network configured
18140// with [Private Google Access with VPC Service Controls]) may want to
18141/// override this default.
18142/// * [with_credentials()]: by default this client uses
18143/// [Application Default Credentials]. Applications using custom
18144/// authentication may need to override this default.
18145///
18146/// [with_endpoint()]: super::builder::wire_groups::ClientBuilder::with_endpoint
18147/// [with_credentials()]: super::builder::wire_groups::ClientBuilder::credentials
18148/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18149/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18150///
18151/// # Pooling and Cloning
18152///
18153/// `WireGroups` holds a connection pool internally, it is advised to
18154/// create one and the reuse it. You do not need to wrap `WireGroups` in
18155/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18156/// already uses an `Arc` internally.
18157#[cfg(feature = "wire-groups")]
18158#[cfg_attr(docsrs, doc(cfg(feature = "wire-groups")))]
18159#[derive(Clone, Debug)]
18160pub struct WireGroups {
18161 inner: std::sync::Arc<dyn super::stub::dynamic::WireGroups>,
18162}
18163
18164#[cfg(feature = "wire-groups")]
18165impl WireGroups {
18166 /// Returns a builder for [WireGroups].
18167 ///
18168 /// ```
18169 /// # tokio_test::block_on(async {
18170 /// # use google_cloud_compute_v1::client::WireGroups;
18171 /// let client = WireGroups::builder().build().await?;
18172 /// # gax::client_builder::Result::<()>::Ok(()) });
18173 /// ```
18174 pub fn builder() -> super::builder::wire_groups::ClientBuilder {
18175 gax::client_builder::internal::new_builder(super::builder::wire_groups::client::Factory)
18176 }
18177
18178 /// Creates a new client from the provided stub.
18179 ///
18180 /// The most common case for calling this function is in tests mocking the
18181 /// client's behavior.
18182 pub fn from_stub<T>(stub: T) -> Self
18183 where
18184 T: super::stub::WireGroups + 'static,
18185 {
18186 Self {
18187 inner: std::sync::Arc::new(stub),
18188 }
18189 }
18190
18191 pub(crate) async fn new(
18192 config: gaxi::options::ClientConfig,
18193 ) -> gax::client_builder::Result<Self> {
18194 let inner = Self::build_inner(config).await?;
18195 Ok(Self { inner })
18196 }
18197
18198 async fn build_inner(
18199 conf: gaxi::options::ClientConfig,
18200 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::WireGroups>> {
18201 if gaxi::options::tracing_enabled(&conf) {
18202 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18203 }
18204 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18205 }
18206
18207 async fn build_transport(
18208 conf: gaxi::options::ClientConfig,
18209 ) -> gax::client_builder::Result<impl super::stub::WireGroups> {
18210 super::transport::WireGroups::new(conf).await
18211 }
18212
18213 async fn build_with_tracing(
18214 conf: gaxi::options::ClientConfig,
18215 ) -> gax::client_builder::Result<impl super::stub::WireGroups> {
18216 Self::build_transport(conf)
18217 .await
18218 .map(super::tracing::WireGroups::new)
18219 }
18220
18221 /// Deletes the specified wire group in the given scope.
18222 pub fn delete(&self) -> super::builder::wire_groups::Delete {
18223 super::builder::wire_groups::Delete::new(self.inner.clone())
18224 }
18225
18226 /// Gets the specified wire group resource in the given scope.
18227 pub fn get(&self) -> super::builder::wire_groups::Get {
18228 super::builder::wire_groups::Get::new(self.inner.clone())
18229 }
18230
18231 /// Creates a wire group in the specified project in the given scope
18232 /// using the parameters that are included in the request.
18233 pub fn insert(&self) -> super::builder::wire_groups::Insert {
18234 super::builder::wire_groups::Insert::new(self.inner.clone())
18235 }
18236
18237 /// Lists the wire groups for a project in the given scope.
18238 pub fn list(&self) -> super::builder::wire_groups::List {
18239 super::builder::wire_groups::List::new(self.inner.clone())
18240 }
18241
18242 /// Updates the specified wire group resource with the data included in the
18243 /// request. This method supportsPATCH
18244 /// semantics and usesJSON merge
18245 /// patch format and processing rules.
18246 pub fn patch(&self) -> super::builder::wire_groups::Patch {
18247 super::builder::wire_groups::Patch::new(self.inner.clone())
18248 }
18249
18250 /// Retrieves the specified Operations resource.
18251 pub fn get_operation(&self) -> super::builder::wire_groups::GetOperation {
18252 super::builder::wire_groups::GetOperation::new(self.inner.clone())
18253 }
18254}
18255
18256/// Implements a client for the Google Compute Engine API.
18257///
18258/// # Example
18259/// ```
18260/// # tokio_test::block_on(async {
18261/// # use google_cloud_compute_v1::client::ZoneOperations;
18262/// let client = ZoneOperations::builder().build().await?;
18263/// // use `client` to make requests to the Google Compute Engine API.
18264/// # gax::client_builder::Result::<()>::Ok(()) });
18265/// ```
18266///
18267/// # Service Description
18268///
18269/// Service for the `zoneOperations` resource.
18270///
18271/// # Configuration
18272///
18273/// To configure `ZoneOperations` use the `with_*` methods in the type returned
18274/// by [builder()][ZoneOperations::builder]. The default configuration should
18275/// work for most applications. Common configuration changes include
18276///
18277/// * [with_endpoint()]: by default this client uses the global default endpoint
18278/// (`https://compute.googleapis.com`). Applications using regional
18279/// endpoints or running in restricted networks (e.g. a network configured
18280// with [Private Google Access with VPC Service Controls]) may want to
18281/// override this default.
18282/// * [with_credentials()]: by default this client uses
18283/// [Application Default Credentials]. Applications using custom
18284/// authentication may need to override this default.
18285///
18286/// [with_endpoint()]: super::builder::zone_operations::ClientBuilder::with_endpoint
18287/// [with_credentials()]: super::builder::zone_operations::ClientBuilder::credentials
18288/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18289/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18290///
18291/// # Pooling and Cloning
18292///
18293/// `ZoneOperations` holds a connection pool internally, it is advised to
18294/// create one and the reuse it. You do not need to wrap `ZoneOperations` in
18295/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18296/// already uses an `Arc` internally.
18297#[cfg(feature = "zone-operations")]
18298#[cfg_attr(docsrs, doc(cfg(feature = "zone-operations")))]
18299#[derive(Clone, Debug)]
18300pub struct ZoneOperations {
18301 inner: std::sync::Arc<dyn super::stub::dynamic::ZoneOperations>,
18302}
18303
18304#[cfg(feature = "zone-operations")]
18305impl ZoneOperations {
18306 /// Returns a builder for [ZoneOperations].
18307 ///
18308 /// ```
18309 /// # tokio_test::block_on(async {
18310 /// # use google_cloud_compute_v1::client::ZoneOperations;
18311 /// let client = ZoneOperations::builder().build().await?;
18312 /// # gax::client_builder::Result::<()>::Ok(()) });
18313 /// ```
18314 pub fn builder() -> super::builder::zone_operations::ClientBuilder {
18315 gax::client_builder::internal::new_builder(super::builder::zone_operations::client::Factory)
18316 }
18317
18318 /// Creates a new client from the provided stub.
18319 ///
18320 /// The most common case for calling this function is in tests mocking the
18321 /// client's behavior.
18322 pub fn from_stub<T>(stub: T) -> Self
18323 where
18324 T: super::stub::ZoneOperations + 'static,
18325 {
18326 Self {
18327 inner: std::sync::Arc::new(stub),
18328 }
18329 }
18330
18331 pub(crate) async fn new(
18332 config: gaxi::options::ClientConfig,
18333 ) -> gax::client_builder::Result<Self> {
18334 let inner = Self::build_inner(config).await?;
18335 Ok(Self { inner })
18336 }
18337
18338 async fn build_inner(
18339 conf: gaxi::options::ClientConfig,
18340 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::ZoneOperations>> {
18341 if gaxi::options::tracing_enabled(&conf) {
18342 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18343 }
18344 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18345 }
18346
18347 async fn build_transport(
18348 conf: gaxi::options::ClientConfig,
18349 ) -> gax::client_builder::Result<impl super::stub::ZoneOperations> {
18350 super::transport::ZoneOperations::new(conf).await
18351 }
18352
18353 async fn build_with_tracing(
18354 conf: gaxi::options::ClientConfig,
18355 ) -> gax::client_builder::Result<impl super::stub::ZoneOperations> {
18356 Self::build_transport(conf)
18357 .await
18358 .map(super::tracing::ZoneOperations::new)
18359 }
18360
18361 /// Deletes the specified zone-specific Operations resource.
18362 pub fn delete(&self) -> super::builder::zone_operations::Delete {
18363 super::builder::zone_operations::Delete::new(self.inner.clone())
18364 }
18365
18366 /// Retrieves the specified zone-specific Operations resource.
18367 pub fn get(&self) -> super::builder::zone_operations::Get {
18368 super::builder::zone_operations::Get::new(self.inner.clone())
18369 }
18370
18371 /// Retrieves a list of Operation resources contained within
18372 /// the specified zone.
18373 pub fn list(&self) -> super::builder::zone_operations::List {
18374 super::builder::zone_operations::List::new(self.inner.clone())
18375 }
18376
18377 /// Waits for the specified Operation resource to return as `DONE`
18378 /// or for the request to approach the 2 minute deadline, and retrieves the
18379 /// specified Operation resource. This method waits for no more than the
18380 /// 2 minutes and then returns the current state of the
18381 /// operation, which might be `DONE` or still in progress.
18382 ///
18383 /// This method is called on a best-effort basis. Specifically:
18384 ///
18385 /// ```norust
18386 /// - In uncommon cases, when the server is overloaded, the request might
18387 /// return before the default deadline is reached, or might return after zero
18388 /// seconds.
18389 /// ```
18390 ///
18391 /// - If the default deadline is reached, there is no guarantee that the
18392 /// operation is actually done when the method returns. Be prepared to retry
18393 /// if the operation is not `DONE`.
18394 pub fn wait(&self) -> super::builder::zone_operations::Wait {
18395 super::builder::zone_operations::Wait::new(self.inner.clone())
18396 }
18397}
18398
18399/// Implements a client for the Google Compute Engine API.
18400///
18401/// # Example
18402/// ```
18403/// # tokio_test::block_on(async {
18404/// # use google_cloud_compute_v1::client::Zones;
18405/// let client = Zones::builder().build().await?;
18406/// // use `client` to make requests to the Google Compute Engine API.
18407/// # gax::client_builder::Result::<()>::Ok(()) });
18408/// ```
18409///
18410/// # Service Description
18411///
18412/// Service for the `zones` resource.
18413///
18414/// # Configuration
18415///
18416/// To configure `Zones` use the `with_*` methods in the type returned
18417/// by [builder()][Zones::builder]. The default configuration should
18418/// work for most applications. Common configuration changes include
18419///
18420/// * [with_endpoint()]: by default this client uses the global default endpoint
18421/// (`https://compute.googleapis.com`). Applications using regional
18422/// endpoints or running in restricted networks (e.g. a network configured
18423// with [Private Google Access with VPC Service Controls]) may want to
18424/// override this default.
18425/// * [with_credentials()]: by default this client uses
18426/// [Application Default Credentials]. Applications using custom
18427/// authentication may need to override this default.
18428///
18429/// [with_endpoint()]: super::builder::zones::ClientBuilder::with_endpoint
18430/// [with_credentials()]: super::builder::zones::ClientBuilder::credentials
18431/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18432/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18433///
18434/// # Pooling and Cloning
18435///
18436/// `Zones` holds a connection pool internally, it is advised to
18437/// create one and the reuse it. You do not need to wrap `Zones` in
18438/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18439/// already uses an `Arc` internally.
18440#[cfg(feature = "zones")]
18441#[cfg_attr(docsrs, doc(cfg(feature = "zones")))]
18442#[derive(Clone, Debug)]
18443pub struct Zones {
18444 inner: std::sync::Arc<dyn super::stub::dynamic::Zones>,
18445}
18446
18447#[cfg(feature = "zones")]
18448impl Zones {
18449 /// Returns a builder for [Zones].
18450 ///
18451 /// ```
18452 /// # tokio_test::block_on(async {
18453 /// # use google_cloud_compute_v1::client::Zones;
18454 /// let client = Zones::builder().build().await?;
18455 /// # gax::client_builder::Result::<()>::Ok(()) });
18456 /// ```
18457 pub fn builder() -> super::builder::zones::ClientBuilder {
18458 gax::client_builder::internal::new_builder(super::builder::zones::client::Factory)
18459 }
18460
18461 /// Creates a new client from the provided stub.
18462 ///
18463 /// The most common case for calling this function is in tests mocking the
18464 /// client's behavior.
18465 pub fn from_stub<T>(stub: T) -> Self
18466 where
18467 T: super::stub::Zones + 'static,
18468 {
18469 Self {
18470 inner: std::sync::Arc::new(stub),
18471 }
18472 }
18473
18474 pub(crate) async fn new(
18475 config: gaxi::options::ClientConfig,
18476 ) -> gax::client_builder::Result<Self> {
18477 let inner = Self::build_inner(config).await?;
18478 Ok(Self { inner })
18479 }
18480
18481 async fn build_inner(
18482 conf: gaxi::options::ClientConfig,
18483 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Zones>> {
18484 if gaxi::options::tracing_enabled(&conf) {
18485 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18486 }
18487 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18488 }
18489
18490 async fn build_transport(
18491 conf: gaxi::options::ClientConfig,
18492 ) -> gax::client_builder::Result<impl super::stub::Zones> {
18493 super::transport::Zones::new(conf).await
18494 }
18495
18496 async fn build_with_tracing(
18497 conf: gaxi::options::ClientConfig,
18498 ) -> gax::client_builder::Result<impl super::stub::Zones> {
18499 Self::build_transport(conf)
18500 .await
18501 .map(super::tracing::Zones::new)
18502 }
18503
18504 /// Returns the specified Zone resource.
18505 pub fn get(&self) -> super::builder::zones::Get {
18506 super::builder::zones::Get::new(self.inner.clone())
18507 }
18508
18509 /// Retrieves the list of Zone resources available to the specified project.
18510 pub fn list(&self) -> super::builder::zones::List {
18511 super::builder::zones::List::new(self.inner.clone())
18512 }
18513}