google_cloud_compute_v1/client.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16#![allow(rustdoc::bare_urls)]
17#![allow(rustdoc::broken_intra_doc_links)]
18#![allow(rustdoc::redundant_explicit_links)]
19
20/// Implements a client for the Google Compute Engine API.
21///
22/// # Example
23/// ```
24/// # async fn sample() -> gax::client_builder::Result<()> {
25/// # use google_cloud_compute_v1::client::AcceleratorTypes;
26/// let client = AcceleratorTypes::builder().build().await?;
27/// // use `client` to make requests to the Google Compute Engine API.
28/// # Ok(()) }
29/// ```
30///
31/// # Service Description
32///
33/// Service for the `acceleratorTypes` resource.
34///
35/// # Configuration
36///
37/// To configure `AcceleratorTypes` use the `with_*` methods in the type returned
38/// by [builder()][AcceleratorTypes::builder]. The default configuration should
39/// work for most applications. Common configuration changes include
40///
41/// * [with_endpoint()]: by default this client uses the global default endpoint
42/// (`https://compute.googleapis.com`). Applications using regional
43/// endpoints or running in restricted networks (e.g. a network configured
44// with [Private Google Access with VPC Service Controls]) may want to
45/// override this default.
46/// * [with_credentials()]: by default this client uses
47/// [Application Default Credentials]. Applications using custom
48/// authentication may need to override this default.
49///
50/// [with_endpoint()]: super::builder::accelerator_types::ClientBuilder::with_endpoint
51/// [with_credentials()]: super::builder::accelerator_types::ClientBuilder::credentials
52/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
53/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
54///
55/// # Pooling and Cloning
56///
57/// `AcceleratorTypes` holds a connection pool internally, it is advised to
58/// create one and the reuse it. You do not need to wrap `AcceleratorTypes` in
59/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
60/// already uses an `Arc` internally.
61#[cfg(feature = "accelerator-types")]
62#[cfg_attr(docsrs, doc(cfg(feature = "accelerator-types")))]
63#[derive(Clone, Debug)]
64pub struct AcceleratorTypes {
65 inner: std::sync::Arc<dyn super::stub::dynamic::AcceleratorTypes>,
66}
67
68#[cfg(feature = "accelerator-types")]
69impl AcceleratorTypes {
70 /// Returns a builder for [AcceleratorTypes].
71 ///
72 /// ```
73 /// # async fn sample() -> gax::client_builder::Result<()> {
74 /// # use google_cloud_compute_v1::client::AcceleratorTypes;
75 /// let client = AcceleratorTypes::builder().build().await?;
76 /// # Ok(()) }
77 /// ```
78 pub fn builder() -> super::builder::accelerator_types::ClientBuilder {
79 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/// # async fn sample() -> gax::client_builder::Result<()> {
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/// # 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 /// # async fn sample() -> gax::client_builder::Result<()> {
202 /// # use google_cloud_compute_v1::client::Addresses;
203 /// let client = Addresses::builder().build().await?;
204 /// # Ok(()) }
205 /// ```
206 pub fn builder() -> super::builder::addresses::ClientBuilder {
207 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/// # async fn sample() -> gax::client_builder::Result<()> {
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/// # 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 /// # async fn sample() -> gax::client_builder::Result<()> {
359 /// # use google_cloud_compute_v1::client::Advice;
360 /// let client = Advice::builder().build().await?;
361 /// # Ok(()) }
362 /// ```
363 pub fn builder() -> super::builder::advice::ClientBuilder {
364 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/// # async fn sample() -> gax::client_builder::Result<()> {
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/// # 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 /// # async fn sample() -> gax::client_builder::Result<()> {
473 /// # use google_cloud_compute_v1::client::Autoscalers;
474 /// let client = Autoscalers::builder().build().await?;
475 /// # Ok(()) }
476 /// ```
477 pub fn builder() -> super::builder::autoscalers::ClientBuilder {
478 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 /// Returns permissions that a caller has on the specified resource.
563 pub fn test_iam_permissions(&self) -> super::builder::autoscalers::TestIamPermissions {
564 super::builder::autoscalers::TestIamPermissions::new(self.inner.clone())
565 }
566
567 /// Updates an autoscaler in the specified project using the data
568 /// included in the request.
569 pub fn update(&self) -> super::builder::autoscalers::Update {
570 super::builder::autoscalers::Update::new(self.inner.clone())
571 }
572
573 /// Retrieves the specified zone-specific Operations resource.
574 pub fn get_operation(&self) -> super::builder::autoscalers::GetOperation {
575 super::builder::autoscalers::GetOperation::new(self.inner.clone())
576 }
577}
578
579/// Implements a client for the Google Compute Engine API.
580///
581/// # Example
582/// ```
583/// # async fn sample() -> gax::client_builder::Result<()> {
584/// # use google_cloud_compute_v1::client::BackendBuckets;
585/// let client = BackendBuckets::builder().build().await?;
586/// // use `client` to make requests to the Google Compute Engine API.
587/// # Ok(()) }
588/// ```
589///
590/// # Service Description
591///
592/// Service for the `backendBuckets` resource.
593///
594/// # Configuration
595///
596/// To configure `BackendBuckets` use the `with_*` methods in the type returned
597/// by [builder()][BackendBuckets::builder]. The default configuration should
598/// work for most applications. Common configuration changes include
599///
600/// * [with_endpoint()]: by default this client uses the global default endpoint
601/// (`https://compute.googleapis.com`). Applications using regional
602/// endpoints or running in restricted networks (e.g. a network configured
603// with [Private Google Access with VPC Service Controls]) may want to
604/// override this default.
605/// * [with_credentials()]: by default this client uses
606/// [Application Default Credentials]. Applications using custom
607/// authentication may need to override this default.
608///
609/// [with_endpoint()]: super::builder::backend_buckets::ClientBuilder::with_endpoint
610/// [with_credentials()]: super::builder::backend_buckets::ClientBuilder::credentials
611/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
612/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
613///
614/// # Pooling and Cloning
615///
616/// `BackendBuckets` holds a connection pool internally, it is advised to
617/// create one and the reuse it. You do not need to wrap `BackendBuckets` in
618/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
619/// already uses an `Arc` internally.
620#[cfg(feature = "backend-buckets")]
621#[cfg_attr(docsrs, doc(cfg(feature = "backend-buckets")))]
622#[derive(Clone, Debug)]
623pub struct BackendBuckets {
624 inner: std::sync::Arc<dyn super::stub::dynamic::BackendBuckets>,
625}
626
627#[cfg(feature = "backend-buckets")]
628impl BackendBuckets {
629 /// Returns a builder for [BackendBuckets].
630 ///
631 /// ```
632 /// # async fn sample() -> gax::client_builder::Result<()> {
633 /// # use google_cloud_compute_v1::client::BackendBuckets;
634 /// let client = BackendBuckets::builder().build().await?;
635 /// # Ok(()) }
636 /// ```
637 pub fn builder() -> super::builder::backend_buckets::ClientBuilder {
638 gax::client_builder::internal::new_builder(super::builder::backend_buckets::client::Factory)
639 }
640
641 /// Creates a new client from the provided stub.
642 ///
643 /// The most common case for calling this function is in tests mocking the
644 /// client's behavior.
645 pub fn from_stub<T>(stub: T) -> Self
646 where
647 T: super::stub::BackendBuckets + 'static,
648 {
649 Self {
650 inner: std::sync::Arc::new(stub),
651 }
652 }
653
654 pub(crate) async fn new(
655 config: gaxi::options::ClientConfig,
656 ) -> gax::client_builder::Result<Self> {
657 let inner = Self::build_inner(config).await?;
658 Ok(Self { inner })
659 }
660
661 async fn build_inner(
662 conf: gaxi::options::ClientConfig,
663 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::BackendBuckets>> {
664 if gaxi::options::tracing_enabled(&conf) {
665 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
666 }
667 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
668 }
669
670 async fn build_transport(
671 conf: gaxi::options::ClientConfig,
672 ) -> gax::client_builder::Result<impl super::stub::BackendBuckets> {
673 super::transport::BackendBuckets::new(conf).await
674 }
675
676 async fn build_with_tracing(
677 conf: gaxi::options::ClientConfig,
678 ) -> gax::client_builder::Result<impl super::stub::BackendBuckets> {
679 Self::build_transport(conf)
680 .await
681 .map(super::tracing::BackendBuckets::new)
682 }
683
684 /// Adds a key for validating requests with signed URLs for this backend
685 /// bucket.
686 pub fn add_signed_url_key(&self) -> super::builder::backend_buckets::AddSignedUrlKey {
687 super::builder::backend_buckets::AddSignedUrlKey::new(self.inner.clone())
688 }
689
690 /// Deletes the specified BackendBucket resource.
691 pub fn delete(&self) -> super::builder::backend_buckets::Delete {
692 super::builder::backend_buckets::Delete::new(self.inner.clone())
693 }
694
695 /// Deletes a key for validating requests with signed URLs for this backend
696 /// bucket.
697 pub fn delete_signed_url_key(&self) -> super::builder::backend_buckets::DeleteSignedUrlKey {
698 super::builder::backend_buckets::DeleteSignedUrlKey::new(self.inner.clone())
699 }
700
701 /// Returns the specified BackendBucket resource.
702 pub fn get(&self) -> super::builder::backend_buckets::Get {
703 super::builder::backend_buckets::Get::new(self.inner.clone())
704 }
705
706 /// Gets the access control policy for a resource. May be empty if no such
707 /// policy or resource exists.
708 pub fn get_iam_policy(&self) -> super::builder::backend_buckets::GetIamPolicy {
709 super::builder::backend_buckets::GetIamPolicy::new(self.inner.clone())
710 }
711
712 /// Creates a BackendBucket resource in the specified project using
713 /// the data included in the request.
714 pub fn insert(&self) -> super::builder::backend_buckets::Insert {
715 super::builder::backend_buckets::Insert::new(self.inner.clone())
716 }
717
718 /// Retrieves the list of BackendBucket resources available to the specified
719 /// project.
720 pub fn list(&self) -> super::builder::backend_buckets::List {
721 super::builder::backend_buckets::List::new(self.inner.clone())
722 }
723
724 /// Updates the specified BackendBucket resource with the data included in the
725 /// request. This method supportsPATCH
726 /// semantics and uses theJSON merge
727 /// patch format and processing rules.
728 pub fn patch(&self) -> super::builder::backend_buckets::Patch {
729 super::builder::backend_buckets::Patch::new(self.inner.clone())
730 }
731
732 /// Sets the edge security policy for the specified backend bucket.
733 pub fn set_edge_security_policy(
734 &self,
735 ) -> super::builder::backend_buckets::SetEdgeSecurityPolicy {
736 super::builder::backend_buckets::SetEdgeSecurityPolicy::new(self.inner.clone())
737 }
738
739 /// Sets the access control policy on the specified resource.
740 /// Replaces any existing policy.
741 pub fn set_iam_policy(&self) -> super::builder::backend_buckets::SetIamPolicy {
742 super::builder::backend_buckets::SetIamPolicy::new(self.inner.clone())
743 }
744
745 /// Returns permissions that a caller has on the specified resource.
746 pub fn test_iam_permissions(&self) -> super::builder::backend_buckets::TestIamPermissions {
747 super::builder::backend_buckets::TestIamPermissions::new(self.inner.clone())
748 }
749
750 /// Updates the specified BackendBucket resource with the data included in the
751 /// request.
752 pub fn update(&self) -> super::builder::backend_buckets::Update {
753 super::builder::backend_buckets::Update::new(self.inner.clone())
754 }
755
756 /// Retrieves the specified Operations resource.
757 pub fn get_operation(&self) -> super::builder::backend_buckets::GetOperation {
758 super::builder::backend_buckets::GetOperation::new(self.inner.clone())
759 }
760}
761
762/// Implements a client for the Google Compute Engine API.
763///
764/// # Example
765/// ```
766/// # async fn sample() -> gax::client_builder::Result<()> {
767/// # use google_cloud_compute_v1::client::BackendServices;
768/// let client = BackendServices::builder().build().await?;
769/// // use `client` to make requests to the Google Compute Engine API.
770/// # Ok(()) }
771/// ```
772///
773/// # Service Description
774///
775/// Service for the `backendServices` resource.
776///
777/// # Configuration
778///
779/// To configure `BackendServices` use the `with_*` methods in the type returned
780/// by [builder()][BackendServices::builder]. The default configuration should
781/// work for most applications. Common configuration changes include
782///
783/// * [with_endpoint()]: by default this client uses the global default endpoint
784/// (`https://compute.googleapis.com`). Applications using regional
785/// endpoints or running in restricted networks (e.g. a network configured
786// with [Private Google Access with VPC Service Controls]) may want to
787/// override this default.
788/// * [with_credentials()]: by default this client uses
789/// [Application Default Credentials]. Applications using custom
790/// authentication may need to override this default.
791///
792/// [with_endpoint()]: super::builder::backend_services::ClientBuilder::with_endpoint
793/// [with_credentials()]: super::builder::backend_services::ClientBuilder::credentials
794/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
795/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
796///
797/// # Pooling and Cloning
798///
799/// `BackendServices` holds a connection pool internally, it is advised to
800/// create one and the reuse it. You do not need to wrap `BackendServices` in
801/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
802/// already uses an `Arc` internally.
803#[cfg(feature = "backend-services")]
804#[cfg_attr(docsrs, doc(cfg(feature = "backend-services")))]
805#[derive(Clone, Debug)]
806pub struct BackendServices {
807 inner: std::sync::Arc<dyn super::stub::dynamic::BackendServices>,
808}
809
810#[cfg(feature = "backend-services")]
811impl BackendServices {
812 /// Returns a builder for [BackendServices].
813 ///
814 /// ```
815 /// # async fn sample() -> gax::client_builder::Result<()> {
816 /// # use google_cloud_compute_v1::client::BackendServices;
817 /// let client = BackendServices::builder().build().await?;
818 /// # Ok(()) }
819 /// ```
820 pub fn builder() -> super::builder::backend_services::ClientBuilder {
821 gax::client_builder::internal::new_builder(
822 super::builder::backend_services::client::Factory,
823 )
824 }
825
826 /// Creates a new client from the provided stub.
827 ///
828 /// The most common case for calling this function is in tests mocking the
829 /// client's behavior.
830 pub fn from_stub<T>(stub: T) -> Self
831 where
832 T: super::stub::BackendServices + 'static,
833 {
834 Self {
835 inner: std::sync::Arc::new(stub),
836 }
837 }
838
839 pub(crate) async fn new(
840 config: gaxi::options::ClientConfig,
841 ) -> gax::client_builder::Result<Self> {
842 let inner = Self::build_inner(config).await?;
843 Ok(Self { inner })
844 }
845
846 async fn build_inner(
847 conf: gaxi::options::ClientConfig,
848 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::BackendServices>>
849 {
850 if gaxi::options::tracing_enabled(&conf) {
851 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
852 }
853 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
854 }
855
856 async fn build_transport(
857 conf: gaxi::options::ClientConfig,
858 ) -> gax::client_builder::Result<impl super::stub::BackendServices> {
859 super::transport::BackendServices::new(conf).await
860 }
861
862 async fn build_with_tracing(
863 conf: gaxi::options::ClientConfig,
864 ) -> gax::client_builder::Result<impl super::stub::BackendServices> {
865 Self::build_transport(conf)
866 .await
867 .map(super::tracing::BackendServices::new)
868 }
869
870 /// Adds a key for validating requests with signed URLs for this backend
871 /// service.
872 pub fn add_signed_url_key(&self) -> super::builder::backend_services::AddSignedUrlKey {
873 super::builder::backend_services::AddSignedUrlKey::new(self.inner.clone())
874 }
875
876 /// Retrieves the list of all BackendService resources, regional and global,
877 /// available to the specified project.
878 ///
879 /// To prevent failure, it is recommended that you set the
880 /// `returnPartialSuccess` parameter to `true`.
881 pub fn aggregated_list(&self) -> super::builder::backend_services::AggregatedList {
882 super::builder::backend_services::AggregatedList::new(self.inner.clone())
883 }
884
885 /// Deletes the specified BackendService resource.
886 pub fn delete(&self) -> super::builder::backend_services::Delete {
887 super::builder::backend_services::Delete::new(self.inner.clone())
888 }
889
890 /// Deletes a key for validating requests with signed URLs for this backend
891 /// service.
892 pub fn delete_signed_url_key(&self) -> super::builder::backend_services::DeleteSignedUrlKey {
893 super::builder::backend_services::DeleteSignedUrlKey::new(self.inner.clone())
894 }
895
896 /// Returns the specified BackendService resource.
897 pub fn get(&self) -> super::builder::backend_services::Get {
898 super::builder::backend_services::Get::new(self.inner.clone())
899 }
900
901 /// Returns effective security policies applied to this backend service.
902 pub fn get_effective_security_policies(
903 &self,
904 ) -> super::builder::backend_services::GetEffectiveSecurityPolicies {
905 super::builder::backend_services::GetEffectiveSecurityPolicies::new(self.inner.clone())
906 }
907
908 /// Gets the most recent health check results for this
909 /// BackendService.
910 ///
911 /// Example request body:
912 ///
913 /// {
914 /// "group": "/zones/us-east1-b/instanceGroups/lb-backend-example"
915 /// }
916 pub fn get_health(&self) -> super::builder::backend_services::GetHealth {
917 super::builder::backend_services::GetHealth::new(self.inner.clone())
918 }
919
920 /// Gets the access control policy for a resource. May be empty if no such
921 /// policy or resource exists.
922 pub fn get_iam_policy(&self) -> super::builder::backend_services::GetIamPolicy {
923 super::builder::backend_services::GetIamPolicy::new(self.inner.clone())
924 }
925
926 /// Creates a BackendService resource in the specified project using
927 /// the data included in the request. For more information, see
928 /// Backend services overview.
929 pub fn insert(&self) -> super::builder::backend_services::Insert {
930 super::builder::backend_services::Insert::new(self.inner.clone())
931 }
932
933 /// Retrieves the list of BackendService resources available to the specified
934 /// project.
935 pub fn list(&self) -> super::builder::backend_services::List {
936 super::builder::backend_services::List::new(self.inner.clone())
937 }
938
939 /// Retrieves a list of all usable backend services in the specified project.
940 pub fn list_usable(&self) -> super::builder::backend_services::ListUsable {
941 super::builder::backend_services::ListUsable::new(self.inner.clone())
942 }
943
944 /// Patches the specified BackendService resource with the data included in the
945 /// request. For more information, see
946 /// Backend services overview. This method
947 /// supports PATCH semantics and uses the JSON merge
948 /// patch format and processing rules.
949 pub fn patch(&self) -> super::builder::backend_services::Patch {
950 super::builder::backend_services::Patch::new(self.inner.clone())
951 }
952
953 /// Sets the edge security policy for the specified backend service.
954 pub fn set_edge_security_policy(
955 &self,
956 ) -> super::builder::backend_services::SetEdgeSecurityPolicy {
957 super::builder::backend_services::SetEdgeSecurityPolicy::new(self.inner.clone())
958 }
959
960 /// Sets the access control policy on the specified resource.
961 /// Replaces any existing policy.
962 pub fn set_iam_policy(&self) -> super::builder::backend_services::SetIamPolicy {
963 super::builder::backend_services::SetIamPolicy::new(self.inner.clone())
964 }
965
966 /// Sets the Google Cloud Armor security policy for the specified backend
967 /// service. For more information, seeGoogle
968 /// Cloud Armor Overview
969 pub fn set_security_policy(&self) -> super::builder::backend_services::SetSecurityPolicy {
970 super::builder::backend_services::SetSecurityPolicy::new(self.inner.clone())
971 }
972
973 /// Returns permissions that a caller has on the specified resource.
974 pub fn test_iam_permissions(&self) -> super::builder::backend_services::TestIamPermissions {
975 super::builder::backend_services::TestIamPermissions::new(self.inner.clone())
976 }
977
978 /// Updates the specified BackendService resource with the data included in the
979 /// request. For more information, seeBackend
980 /// services overview.
981 pub fn update(&self) -> super::builder::backend_services::Update {
982 super::builder::backend_services::Update::new(self.inner.clone())
983 }
984
985 /// Retrieves the specified Operations resource.
986 pub fn get_operation(&self) -> super::builder::backend_services::GetOperation {
987 super::builder::backend_services::GetOperation::new(self.inner.clone())
988 }
989}
990
991/// Implements a client for the Google Compute Engine API.
992///
993/// # Example
994/// ```
995/// # async fn sample() -> gax::client_builder::Result<()> {
996/// # use google_cloud_compute_v1::client::CrossSiteNetworks;
997/// let client = CrossSiteNetworks::builder().build().await?;
998/// // use `client` to make requests to the Google Compute Engine API.
999/// # Ok(()) }
1000/// ```
1001///
1002/// # Service Description
1003///
1004/// Service for the `crossSiteNetworks` resource.
1005///
1006/// # Configuration
1007///
1008/// To configure `CrossSiteNetworks` use the `with_*` methods in the type returned
1009/// by [builder()][CrossSiteNetworks::builder]. The default configuration should
1010/// work for most applications. Common configuration changes include
1011///
1012/// * [with_endpoint()]: by default this client uses the global default endpoint
1013/// (`https://compute.googleapis.com`). Applications using regional
1014/// endpoints or running in restricted networks (e.g. a network configured
1015// with [Private Google Access with VPC Service Controls]) may want to
1016/// override this default.
1017/// * [with_credentials()]: by default this client uses
1018/// [Application Default Credentials]. Applications using custom
1019/// authentication may need to override this default.
1020///
1021/// [with_endpoint()]: super::builder::cross_site_networks::ClientBuilder::with_endpoint
1022/// [with_credentials()]: super::builder::cross_site_networks::ClientBuilder::credentials
1023/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1024/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1025///
1026/// # Pooling and Cloning
1027///
1028/// `CrossSiteNetworks` holds a connection pool internally, it is advised to
1029/// create one and the reuse it. You do not need to wrap `CrossSiteNetworks` in
1030/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1031/// already uses an `Arc` internally.
1032#[cfg(feature = "cross-site-networks")]
1033#[cfg_attr(docsrs, doc(cfg(feature = "cross-site-networks")))]
1034#[derive(Clone, Debug)]
1035pub struct CrossSiteNetworks {
1036 inner: std::sync::Arc<dyn super::stub::dynamic::CrossSiteNetworks>,
1037}
1038
1039#[cfg(feature = "cross-site-networks")]
1040impl CrossSiteNetworks {
1041 /// Returns a builder for [CrossSiteNetworks].
1042 ///
1043 /// ```
1044 /// # async fn sample() -> gax::client_builder::Result<()> {
1045 /// # use google_cloud_compute_v1::client::CrossSiteNetworks;
1046 /// let client = CrossSiteNetworks::builder().build().await?;
1047 /// # Ok(()) }
1048 /// ```
1049 pub fn builder() -> super::builder::cross_site_networks::ClientBuilder {
1050 gax::client_builder::internal::new_builder(
1051 super::builder::cross_site_networks::client::Factory,
1052 )
1053 }
1054
1055 /// Creates a new client from the provided stub.
1056 ///
1057 /// The most common case for calling this function is in tests mocking the
1058 /// client's behavior.
1059 pub fn from_stub<T>(stub: T) -> Self
1060 where
1061 T: super::stub::CrossSiteNetworks + 'static,
1062 {
1063 Self {
1064 inner: std::sync::Arc::new(stub),
1065 }
1066 }
1067
1068 pub(crate) async fn new(
1069 config: gaxi::options::ClientConfig,
1070 ) -> gax::client_builder::Result<Self> {
1071 let inner = Self::build_inner(config).await?;
1072 Ok(Self { inner })
1073 }
1074
1075 async fn build_inner(
1076 conf: gaxi::options::ClientConfig,
1077 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::CrossSiteNetworks>>
1078 {
1079 if gaxi::options::tracing_enabled(&conf) {
1080 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1081 }
1082 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1083 }
1084
1085 async fn build_transport(
1086 conf: gaxi::options::ClientConfig,
1087 ) -> gax::client_builder::Result<impl super::stub::CrossSiteNetworks> {
1088 super::transport::CrossSiteNetworks::new(conf).await
1089 }
1090
1091 async fn build_with_tracing(
1092 conf: gaxi::options::ClientConfig,
1093 ) -> gax::client_builder::Result<impl super::stub::CrossSiteNetworks> {
1094 Self::build_transport(conf)
1095 .await
1096 .map(super::tracing::CrossSiteNetworks::new)
1097 }
1098
1099 /// Deletes the specified cross-site network in the given scope.
1100 pub fn delete(&self) -> super::builder::cross_site_networks::Delete {
1101 super::builder::cross_site_networks::Delete::new(self.inner.clone())
1102 }
1103
1104 /// Returns the specified cross-site network in the given scope.
1105 pub fn get(&self) -> super::builder::cross_site_networks::Get {
1106 super::builder::cross_site_networks::Get::new(self.inner.clone())
1107 }
1108
1109 /// Creates a cross-site network in the specified project in the given scope
1110 /// using the parameters that are included in the request.
1111 pub fn insert(&self) -> super::builder::cross_site_networks::Insert {
1112 super::builder::cross_site_networks::Insert::new(self.inner.clone())
1113 }
1114
1115 /// Lists the cross-site networks for a project in the given scope.
1116 pub fn list(&self) -> super::builder::cross_site_networks::List {
1117 super::builder::cross_site_networks::List::new(self.inner.clone())
1118 }
1119
1120 /// Updates the specified cross-site network with the data included in
1121 /// the request. This method supportsPATCH
1122 /// semantics and uses theJSON merge
1123 /// patch format and processing rules.
1124 pub fn patch(&self) -> super::builder::cross_site_networks::Patch {
1125 super::builder::cross_site_networks::Patch::new(self.inner.clone())
1126 }
1127
1128 /// Retrieves the specified Operations resource.
1129 pub fn get_operation(&self) -> super::builder::cross_site_networks::GetOperation {
1130 super::builder::cross_site_networks::GetOperation::new(self.inner.clone())
1131 }
1132}
1133
1134/// Implements a client for the Google Compute Engine API.
1135///
1136/// # Example
1137/// ```
1138/// # async fn sample() -> gax::client_builder::Result<()> {
1139/// # use google_cloud_compute_v1::client::DiskTypes;
1140/// let client = DiskTypes::builder().build().await?;
1141/// // use `client` to make requests to the Google Compute Engine API.
1142/// # Ok(()) }
1143/// ```
1144///
1145/// # Service Description
1146///
1147/// Service for the `diskTypes` resource.
1148///
1149/// # Configuration
1150///
1151/// To configure `DiskTypes` use the `with_*` methods in the type returned
1152/// by [builder()][DiskTypes::builder]. The default configuration should
1153/// work for most applications. Common configuration changes include
1154///
1155/// * [with_endpoint()]: by default this client uses the global default endpoint
1156/// (`https://compute.googleapis.com`). Applications using regional
1157/// endpoints or running in restricted networks (e.g. a network configured
1158// with [Private Google Access with VPC Service Controls]) may want to
1159/// override this default.
1160/// * [with_credentials()]: by default this client uses
1161/// [Application Default Credentials]. Applications using custom
1162/// authentication may need to override this default.
1163///
1164/// [with_endpoint()]: super::builder::disk_types::ClientBuilder::with_endpoint
1165/// [with_credentials()]: super::builder::disk_types::ClientBuilder::credentials
1166/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1167/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1168///
1169/// # Pooling and Cloning
1170///
1171/// `DiskTypes` holds a connection pool internally, it is advised to
1172/// create one and the reuse it. You do not need to wrap `DiskTypes` in
1173/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1174/// already uses an `Arc` internally.
1175#[cfg(feature = "disk-types")]
1176#[cfg_attr(docsrs, doc(cfg(feature = "disk-types")))]
1177#[derive(Clone, Debug)]
1178pub struct DiskTypes {
1179 inner: std::sync::Arc<dyn super::stub::dynamic::DiskTypes>,
1180}
1181
1182#[cfg(feature = "disk-types")]
1183impl DiskTypes {
1184 /// Returns a builder for [DiskTypes].
1185 ///
1186 /// ```
1187 /// # async fn sample() -> gax::client_builder::Result<()> {
1188 /// # use google_cloud_compute_v1::client::DiskTypes;
1189 /// let client = DiskTypes::builder().build().await?;
1190 /// # Ok(()) }
1191 /// ```
1192 pub fn builder() -> super::builder::disk_types::ClientBuilder {
1193 gax::client_builder::internal::new_builder(super::builder::disk_types::client::Factory)
1194 }
1195
1196 /// Creates a new client from the provided stub.
1197 ///
1198 /// The most common case for calling this function is in tests mocking the
1199 /// client's behavior.
1200 pub fn from_stub<T>(stub: T) -> Self
1201 where
1202 T: super::stub::DiskTypes + 'static,
1203 {
1204 Self {
1205 inner: std::sync::Arc::new(stub),
1206 }
1207 }
1208
1209 pub(crate) async fn new(
1210 config: gaxi::options::ClientConfig,
1211 ) -> gax::client_builder::Result<Self> {
1212 let inner = Self::build_inner(config).await?;
1213 Ok(Self { inner })
1214 }
1215
1216 async fn build_inner(
1217 conf: gaxi::options::ClientConfig,
1218 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::DiskTypes>> {
1219 if gaxi::options::tracing_enabled(&conf) {
1220 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1221 }
1222 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1223 }
1224
1225 async fn build_transport(
1226 conf: gaxi::options::ClientConfig,
1227 ) -> gax::client_builder::Result<impl super::stub::DiskTypes> {
1228 super::transport::DiskTypes::new(conf).await
1229 }
1230
1231 async fn build_with_tracing(
1232 conf: gaxi::options::ClientConfig,
1233 ) -> gax::client_builder::Result<impl super::stub::DiskTypes> {
1234 Self::build_transport(conf)
1235 .await
1236 .map(super::tracing::DiskTypes::new)
1237 }
1238
1239 /// Retrieves an aggregated list of disk types.
1240 ///
1241 /// To prevent failure, it is recommended that you set the
1242 /// `returnPartialSuccess` parameter to `true`.
1243 pub fn aggregated_list(&self) -> super::builder::disk_types::AggregatedList {
1244 super::builder::disk_types::AggregatedList::new(self.inner.clone())
1245 }
1246
1247 /// Returns the specified disk type.
1248 pub fn get(&self) -> super::builder::disk_types::Get {
1249 super::builder::disk_types::Get::new(self.inner.clone())
1250 }
1251
1252 /// Retrieves a list of disk types available to the specified
1253 /// project.
1254 pub fn list(&self) -> super::builder::disk_types::List {
1255 super::builder::disk_types::List::new(self.inner.clone())
1256 }
1257}
1258
1259/// Implements a client for the Google Compute Engine API.
1260///
1261/// # Example
1262/// ```
1263/// # async fn sample() -> gax::client_builder::Result<()> {
1264/// # use google_cloud_compute_v1::client::Disks;
1265/// let client = Disks::builder().build().await?;
1266/// // use `client` to make requests to the Google Compute Engine API.
1267/// # Ok(()) }
1268/// ```
1269///
1270/// # Service Description
1271///
1272/// Service for the `disks` resource.
1273///
1274/// # Configuration
1275///
1276/// To configure `Disks` use the `with_*` methods in the type returned
1277/// by [builder()][Disks::builder]. The default configuration should
1278/// work for most applications. Common configuration changes include
1279///
1280/// * [with_endpoint()]: by default this client uses the global default endpoint
1281/// (`https://compute.googleapis.com`). Applications using regional
1282/// endpoints or running in restricted networks (e.g. a network configured
1283// with [Private Google Access with VPC Service Controls]) may want to
1284/// override this default.
1285/// * [with_credentials()]: by default this client uses
1286/// [Application Default Credentials]. Applications using custom
1287/// authentication may need to override this default.
1288///
1289/// [with_endpoint()]: super::builder::disks::ClientBuilder::with_endpoint
1290/// [with_credentials()]: super::builder::disks::ClientBuilder::credentials
1291/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1292/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1293///
1294/// # Pooling and Cloning
1295///
1296/// `Disks` holds a connection pool internally, it is advised to
1297/// create one and the reuse it. You do not need to wrap `Disks` in
1298/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1299/// already uses an `Arc` internally.
1300#[cfg(feature = "disks")]
1301#[cfg_attr(docsrs, doc(cfg(feature = "disks")))]
1302#[derive(Clone, Debug)]
1303pub struct Disks {
1304 inner: std::sync::Arc<dyn super::stub::dynamic::Disks>,
1305}
1306
1307#[cfg(feature = "disks")]
1308impl Disks {
1309 /// Returns a builder for [Disks].
1310 ///
1311 /// ```
1312 /// # async fn sample() -> gax::client_builder::Result<()> {
1313 /// # use google_cloud_compute_v1::client::Disks;
1314 /// let client = Disks::builder().build().await?;
1315 /// # Ok(()) }
1316 /// ```
1317 pub fn builder() -> super::builder::disks::ClientBuilder {
1318 gax::client_builder::internal::new_builder(super::builder::disks::client::Factory)
1319 }
1320
1321 /// Creates a new client from the provided stub.
1322 ///
1323 /// The most common case for calling this function is in tests mocking the
1324 /// client's behavior.
1325 pub fn from_stub<T>(stub: T) -> Self
1326 where
1327 T: super::stub::Disks + 'static,
1328 {
1329 Self {
1330 inner: std::sync::Arc::new(stub),
1331 }
1332 }
1333
1334 pub(crate) async fn new(
1335 config: gaxi::options::ClientConfig,
1336 ) -> gax::client_builder::Result<Self> {
1337 let inner = Self::build_inner(config).await?;
1338 Ok(Self { inner })
1339 }
1340
1341 async fn build_inner(
1342 conf: gaxi::options::ClientConfig,
1343 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Disks>> {
1344 if gaxi::options::tracing_enabled(&conf) {
1345 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1346 }
1347 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1348 }
1349
1350 async fn build_transport(
1351 conf: gaxi::options::ClientConfig,
1352 ) -> gax::client_builder::Result<impl super::stub::Disks> {
1353 super::transport::Disks::new(conf).await
1354 }
1355
1356 async fn build_with_tracing(
1357 conf: gaxi::options::ClientConfig,
1358 ) -> gax::client_builder::Result<impl super::stub::Disks> {
1359 Self::build_transport(conf)
1360 .await
1361 .map(super::tracing::Disks::new)
1362 }
1363
1364 /// Adds existing resource policies to a disk. You can only add one
1365 /// policy which will be applied to this disk for scheduling snapshot
1366 /// creation.
1367 pub fn add_resource_policies(&self) -> super::builder::disks::AddResourcePolicies {
1368 super::builder::disks::AddResourcePolicies::new(self.inner.clone())
1369 }
1370
1371 /// Retrieves an aggregated list of persistent disks.
1372 ///
1373 /// To prevent failure, it is recommended that you set the
1374 /// `returnPartialSuccess` parameter to `true`.
1375 pub fn aggregated_list(&self) -> super::builder::disks::AggregatedList {
1376 super::builder::disks::AggregatedList::new(self.inner.clone())
1377 }
1378
1379 /// Bulk create a set of disks.
1380 pub fn bulk_insert(&self) -> super::builder::disks::BulkInsert {
1381 super::builder::disks::BulkInsert::new(self.inner.clone())
1382 }
1383
1384 /// Sets the labels on many disks at once. To learn more about labels, read theLabeling
1385 /// Resources documentation.
1386 pub fn bulk_set_labels(&self) -> super::builder::disks::BulkSetLabels {
1387 super::builder::disks::BulkSetLabels::new(self.inner.clone())
1388 }
1389
1390 /// Creates a snapshot of a specified persistent disk. For regular snapshot
1391 /// creation, consider using snapshots.insert
1392 /// instead, as that method supports more features, such as creating snapshots
1393 /// in a project different from the source disk project.
1394 pub fn create_snapshot(&self) -> super::builder::disks::CreateSnapshot {
1395 super::builder::disks::CreateSnapshot::new(self.inner.clone())
1396 }
1397
1398 /// Deletes the specified persistent disk. Deleting a disk removes its data
1399 /// permanently and is irreversible. However, deleting a disk does not
1400 /// delete any snapshots
1401 /// previously made from the disk. You must separatelydelete
1402 /// snapshots.
1403 pub fn delete(&self) -> super::builder::disks::Delete {
1404 super::builder::disks::Delete::new(self.inner.clone())
1405 }
1406
1407 /// Returns the specified persistent disk.
1408 pub fn get(&self) -> super::builder::disks::Get {
1409 super::builder::disks::Get::new(self.inner.clone())
1410 }
1411
1412 /// Gets the access control policy for a resource. May be empty if no such
1413 /// policy or resource exists.
1414 pub fn get_iam_policy(&self) -> super::builder::disks::GetIamPolicy {
1415 super::builder::disks::GetIamPolicy::new(self.inner.clone())
1416 }
1417
1418 /// Creates a persistent disk in the specified project using the data
1419 /// in the request. You can create a disk from a source
1420 /// (sourceImage, sourceSnapshot, orsourceDisk) or create an empty 500 GB data disk by
1421 /// omitting all properties. You can also create a disk that is larger than
1422 /// the default size by specifying the sizeGb property.
1423 pub fn insert(&self) -> super::builder::disks::Insert {
1424 super::builder::disks::Insert::new(self.inner.clone())
1425 }
1426
1427 /// Retrieves a list of persistent disks contained within
1428 /// the specified zone.
1429 pub fn list(&self) -> super::builder::disks::List {
1430 super::builder::disks::List::new(self.inner.clone())
1431 }
1432
1433 /// Removes resource policies from a disk.
1434 pub fn remove_resource_policies(&self) -> super::builder::disks::RemoveResourcePolicies {
1435 super::builder::disks::RemoveResourcePolicies::new(self.inner.clone())
1436 }
1437
1438 /// Resizes the specified persistent disk.
1439 /// You can only increase the size of the disk.
1440 pub fn resize(&self) -> super::builder::disks::Resize {
1441 super::builder::disks::Resize::new(self.inner.clone())
1442 }
1443
1444 /// Sets the access control policy on the specified resource.
1445 /// Replaces any existing policy.
1446 pub fn set_iam_policy(&self) -> super::builder::disks::SetIamPolicy {
1447 super::builder::disks::SetIamPolicy::new(self.inner.clone())
1448 }
1449
1450 /// Sets the labels on a disk. To learn more about labels, read theLabeling
1451 /// Resources documentation.
1452 pub fn set_labels(&self) -> super::builder::disks::SetLabels {
1453 super::builder::disks::SetLabels::new(self.inner.clone())
1454 }
1455
1456 /// Starts asynchronous replication.
1457 /// Must be invoked on the primary disk.
1458 pub fn start_async_replication(&self) -> super::builder::disks::StartAsyncReplication {
1459 super::builder::disks::StartAsyncReplication::new(self.inner.clone())
1460 }
1461
1462 /// Stops asynchronous replication.
1463 /// Can be invoked either on the primary or on the secondary disk.
1464 pub fn stop_async_replication(&self) -> super::builder::disks::StopAsyncReplication {
1465 super::builder::disks::StopAsyncReplication::new(self.inner.clone())
1466 }
1467
1468 /// Stops asynchronous replication for a consistency group of disks.
1469 /// Can be invoked either in the primary or secondary scope.
1470 pub fn stop_group_async_replication(&self) -> super::builder::disks::StopGroupAsyncReplication {
1471 super::builder::disks::StopGroupAsyncReplication::new(self.inner.clone())
1472 }
1473
1474 /// Returns permissions that a caller has on the specified resource.
1475 pub fn test_iam_permissions(&self) -> super::builder::disks::TestIamPermissions {
1476 super::builder::disks::TestIamPermissions::new(self.inner.clone())
1477 }
1478
1479 /// Updates the specified disk with the data included in the request.
1480 /// The update is performed only on selected fields included as part
1481 /// of update-mask. Only the following fields can be modified: user_license.
1482 pub fn update(&self) -> super::builder::disks::Update {
1483 super::builder::disks::Update::new(self.inner.clone())
1484 }
1485
1486 /// Retrieves the specified zone-specific Operations resource.
1487 pub fn get_operation(&self) -> super::builder::disks::GetOperation {
1488 super::builder::disks::GetOperation::new(self.inner.clone())
1489 }
1490}
1491
1492/// Implements a client for the Google Compute Engine API.
1493///
1494/// # Example
1495/// ```
1496/// # async fn sample() -> gax::client_builder::Result<()> {
1497/// # use google_cloud_compute_v1::client::ExternalVpnGateways;
1498/// let client = ExternalVpnGateways::builder().build().await?;
1499/// // use `client` to make requests to the Google Compute Engine API.
1500/// # Ok(()) }
1501/// ```
1502///
1503/// # Service Description
1504///
1505/// Service for the `externalVpnGateways` resource.
1506///
1507/// # Configuration
1508///
1509/// To configure `ExternalVpnGateways` use the `with_*` methods in the type returned
1510/// by [builder()][ExternalVpnGateways::builder]. The default configuration should
1511/// work for most applications. Common configuration changes include
1512///
1513/// * [with_endpoint()]: by default this client uses the global default endpoint
1514/// (`https://compute.googleapis.com`). Applications using regional
1515/// endpoints or running in restricted networks (e.g. a network configured
1516// with [Private Google Access with VPC Service Controls]) may want to
1517/// override this default.
1518/// * [with_credentials()]: by default this client uses
1519/// [Application Default Credentials]. Applications using custom
1520/// authentication may need to override this default.
1521///
1522/// [with_endpoint()]: super::builder::external_vpn_gateways::ClientBuilder::with_endpoint
1523/// [with_credentials()]: super::builder::external_vpn_gateways::ClientBuilder::credentials
1524/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1525/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1526///
1527/// # Pooling and Cloning
1528///
1529/// `ExternalVpnGateways` holds a connection pool internally, it is advised to
1530/// create one and the reuse it. You do not need to wrap `ExternalVpnGateways` in
1531/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1532/// already uses an `Arc` internally.
1533#[cfg(feature = "external-vpn-gateways")]
1534#[cfg_attr(docsrs, doc(cfg(feature = "external-vpn-gateways")))]
1535#[derive(Clone, Debug)]
1536pub struct ExternalVpnGateways {
1537 inner: std::sync::Arc<dyn super::stub::dynamic::ExternalVpnGateways>,
1538}
1539
1540#[cfg(feature = "external-vpn-gateways")]
1541impl ExternalVpnGateways {
1542 /// Returns a builder for [ExternalVpnGateways].
1543 ///
1544 /// ```
1545 /// # async fn sample() -> gax::client_builder::Result<()> {
1546 /// # use google_cloud_compute_v1::client::ExternalVpnGateways;
1547 /// let client = ExternalVpnGateways::builder().build().await?;
1548 /// # Ok(()) }
1549 /// ```
1550 pub fn builder() -> super::builder::external_vpn_gateways::ClientBuilder {
1551 gax::client_builder::internal::new_builder(
1552 super::builder::external_vpn_gateways::client::Factory,
1553 )
1554 }
1555
1556 /// Creates a new client from the provided stub.
1557 ///
1558 /// The most common case for calling this function is in tests mocking the
1559 /// client's behavior.
1560 pub fn from_stub<T>(stub: T) -> Self
1561 where
1562 T: super::stub::ExternalVpnGateways + 'static,
1563 {
1564 Self {
1565 inner: std::sync::Arc::new(stub),
1566 }
1567 }
1568
1569 pub(crate) async fn new(
1570 config: gaxi::options::ClientConfig,
1571 ) -> gax::client_builder::Result<Self> {
1572 let inner = Self::build_inner(config).await?;
1573 Ok(Self { inner })
1574 }
1575
1576 async fn build_inner(
1577 conf: gaxi::options::ClientConfig,
1578 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::ExternalVpnGateways>>
1579 {
1580 if gaxi::options::tracing_enabled(&conf) {
1581 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1582 }
1583 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1584 }
1585
1586 async fn build_transport(
1587 conf: gaxi::options::ClientConfig,
1588 ) -> gax::client_builder::Result<impl super::stub::ExternalVpnGateways> {
1589 super::transport::ExternalVpnGateways::new(conf).await
1590 }
1591
1592 async fn build_with_tracing(
1593 conf: gaxi::options::ClientConfig,
1594 ) -> gax::client_builder::Result<impl super::stub::ExternalVpnGateways> {
1595 Self::build_transport(conf)
1596 .await
1597 .map(super::tracing::ExternalVpnGateways::new)
1598 }
1599
1600 /// Deletes the specified externalVpnGateway.
1601 pub fn delete(&self) -> super::builder::external_vpn_gateways::Delete {
1602 super::builder::external_vpn_gateways::Delete::new(self.inner.clone())
1603 }
1604
1605 /// Returns the specified externalVpnGateway. Get a list of available
1606 /// externalVpnGateways by making a list() request.
1607 pub fn get(&self) -> super::builder::external_vpn_gateways::Get {
1608 super::builder::external_vpn_gateways::Get::new(self.inner.clone())
1609 }
1610
1611 /// Creates a ExternalVpnGateway in the specified project using
1612 /// the data included in the request.
1613 pub fn insert(&self) -> super::builder::external_vpn_gateways::Insert {
1614 super::builder::external_vpn_gateways::Insert::new(self.inner.clone())
1615 }
1616
1617 /// Retrieves the list of ExternalVpnGateway available to the specified
1618 /// project.
1619 pub fn list(&self) -> super::builder::external_vpn_gateways::List {
1620 super::builder::external_vpn_gateways::List::new(self.inner.clone())
1621 }
1622
1623 /// Sets the labels on an ExternalVpnGateway. To learn more about labels,
1624 /// read the Labeling
1625 /// Resources documentation.
1626 pub fn set_labels(&self) -> super::builder::external_vpn_gateways::SetLabels {
1627 super::builder::external_vpn_gateways::SetLabels::new(self.inner.clone())
1628 }
1629
1630 /// Returns permissions that a caller has on the specified resource.
1631 pub fn test_iam_permissions(
1632 &self,
1633 ) -> super::builder::external_vpn_gateways::TestIamPermissions {
1634 super::builder::external_vpn_gateways::TestIamPermissions::new(self.inner.clone())
1635 }
1636
1637 /// Retrieves the specified Operations resource.
1638 pub fn get_operation(&self) -> super::builder::external_vpn_gateways::GetOperation {
1639 super::builder::external_vpn_gateways::GetOperation::new(self.inner.clone())
1640 }
1641}
1642
1643/// Implements a client for the Google Compute Engine API.
1644///
1645/// # Example
1646/// ```
1647/// # async fn sample() -> gax::client_builder::Result<()> {
1648/// # use google_cloud_compute_v1::client::FirewallPolicies;
1649/// let client = FirewallPolicies::builder().build().await?;
1650/// // use `client` to make requests to the Google Compute Engine API.
1651/// # Ok(()) }
1652/// ```
1653///
1654/// # Service Description
1655///
1656/// Service for the `firewallPolicies` resource.
1657///
1658/// # Configuration
1659///
1660/// To configure `FirewallPolicies` use the `with_*` methods in the type returned
1661/// by [builder()][FirewallPolicies::builder]. The default configuration should
1662/// work for most applications. Common configuration changes include
1663///
1664/// * [with_endpoint()]: by default this client uses the global default endpoint
1665/// (`https://compute.googleapis.com`). Applications using regional
1666/// endpoints or running in restricted networks (e.g. a network configured
1667// with [Private Google Access with VPC Service Controls]) may want to
1668/// override this default.
1669/// * [with_credentials()]: by default this client uses
1670/// [Application Default Credentials]. Applications using custom
1671/// authentication may need to override this default.
1672///
1673/// [with_endpoint()]: super::builder::firewall_policies::ClientBuilder::with_endpoint
1674/// [with_credentials()]: super::builder::firewall_policies::ClientBuilder::credentials
1675/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1676/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1677///
1678/// # Pooling and Cloning
1679///
1680/// `FirewallPolicies` holds a connection pool internally, it is advised to
1681/// create one and the reuse it. You do not need to wrap `FirewallPolicies` in
1682/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1683/// already uses an `Arc` internally.
1684#[cfg(feature = "firewall-policies")]
1685#[cfg_attr(docsrs, doc(cfg(feature = "firewall-policies")))]
1686#[derive(Clone, Debug)]
1687pub struct FirewallPolicies {
1688 inner: std::sync::Arc<dyn super::stub::dynamic::FirewallPolicies>,
1689}
1690
1691#[cfg(feature = "firewall-policies")]
1692impl FirewallPolicies {
1693 /// Returns a builder for [FirewallPolicies].
1694 ///
1695 /// ```
1696 /// # async fn sample() -> gax::client_builder::Result<()> {
1697 /// # use google_cloud_compute_v1::client::FirewallPolicies;
1698 /// let client = FirewallPolicies::builder().build().await?;
1699 /// # Ok(()) }
1700 /// ```
1701 pub fn builder() -> super::builder::firewall_policies::ClientBuilder {
1702 gax::client_builder::internal::new_builder(
1703 super::builder::firewall_policies::client::Factory,
1704 )
1705 }
1706
1707 /// Creates a new client from the provided stub.
1708 ///
1709 /// The most common case for calling this function is in tests mocking the
1710 /// client's behavior.
1711 pub fn from_stub<T>(stub: T) -> Self
1712 where
1713 T: super::stub::FirewallPolicies + 'static,
1714 {
1715 Self {
1716 inner: std::sync::Arc::new(stub),
1717 }
1718 }
1719
1720 pub(crate) async fn new(
1721 config: gaxi::options::ClientConfig,
1722 ) -> gax::client_builder::Result<Self> {
1723 let inner = Self::build_inner(config).await?;
1724 Ok(Self { inner })
1725 }
1726
1727 async fn build_inner(
1728 conf: gaxi::options::ClientConfig,
1729 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::FirewallPolicies>>
1730 {
1731 if gaxi::options::tracing_enabled(&conf) {
1732 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1733 }
1734 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1735 }
1736
1737 async fn build_transport(
1738 conf: gaxi::options::ClientConfig,
1739 ) -> gax::client_builder::Result<impl super::stub::FirewallPolicies> {
1740 super::transport::FirewallPolicies::new(conf).await
1741 }
1742
1743 async fn build_with_tracing(
1744 conf: gaxi::options::ClientConfig,
1745 ) -> gax::client_builder::Result<impl super::stub::FirewallPolicies> {
1746 Self::build_transport(conf)
1747 .await
1748 .map(super::tracing::FirewallPolicies::new)
1749 }
1750
1751 /// Inserts an association for the specified firewall policy.
1752 pub fn add_association(&self) -> super::builder::firewall_policies::AddAssociation {
1753 super::builder::firewall_policies::AddAssociation::new(self.inner.clone())
1754 }
1755
1756 /// Inserts a rule into a firewall policy.
1757 pub fn add_rule(&self) -> super::builder::firewall_policies::AddRule {
1758 super::builder::firewall_policies::AddRule::new(self.inner.clone())
1759 }
1760
1761 /// Copies rules to the specified firewall policy.
1762 pub fn clone_rules(&self) -> super::builder::firewall_policies::CloneRules {
1763 super::builder::firewall_policies::CloneRules::new(self.inner.clone())
1764 }
1765
1766 /// Deletes the specified policy.
1767 pub fn delete(&self) -> super::builder::firewall_policies::Delete {
1768 super::builder::firewall_policies::Delete::new(self.inner.clone())
1769 }
1770
1771 /// Returns the specified firewall policy.
1772 pub fn get(&self) -> super::builder::firewall_policies::Get {
1773 super::builder::firewall_policies::Get::new(self.inner.clone())
1774 }
1775
1776 /// Gets an association with the specified name.
1777 pub fn get_association(&self) -> super::builder::firewall_policies::GetAssociation {
1778 super::builder::firewall_policies::GetAssociation::new(self.inner.clone())
1779 }
1780
1781 /// Gets the access control policy for a resource. May be empty if no such
1782 /// policy or resource exists.
1783 pub fn get_iam_policy(&self) -> super::builder::firewall_policies::GetIamPolicy {
1784 super::builder::firewall_policies::GetIamPolicy::new(self.inner.clone())
1785 }
1786
1787 /// Gets a rule of the specified priority.
1788 pub fn get_rule(&self) -> super::builder::firewall_policies::GetRule {
1789 super::builder::firewall_policies::GetRule::new(self.inner.clone())
1790 }
1791
1792 /// Creates a new policy in the specified project using the data included in
1793 /// the request.
1794 pub fn insert(&self) -> super::builder::firewall_policies::Insert {
1795 super::builder::firewall_policies::Insert::new(self.inner.clone())
1796 }
1797
1798 /// Lists all the policies that have been configured for the specified
1799 /// folder or organization.
1800 pub fn list(&self) -> super::builder::firewall_policies::List {
1801 super::builder::firewall_policies::List::new(self.inner.clone())
1802 }
1803
1804 /// Lists associations of a specified target, i.e., organization or folder.
1805 pub fn list_associations(&self) -> super::builder::firewall_policies::ListAssociations {
1806 super::builder::firewall_policies::ListAssociations::new(self.inner.clone())
1807 }
1808
1809 /// Moves the specified firewall policy.
1810 pub fn r#move(&self) -> super::builder::firewall_policies::Move {
1811 super::builder::firewall_policies::Move::new(self.inner.clone())
1812 }
1813
1814 /// Patches the specified policy with the data included in the request.
1815 pub fn patch(&self) -> super::builder::firewall_policies::Patch {
1816 super::builder::firewall_policies::Patch::new(self.inner.clone())
1817 }
1818
1819 /// Patches a rule of the specified priority.
1820 pub fn patch_rule(&self) -> super::builder::firewall_policies::PatchRule {
1821 super::builder::firewall_policies::PatchRule::new(self.inner.clone())
1822 }
1823
1824 /// Removes an association for the specified firewall policy.
1825 pub fn remove_association(&self) -> super::builder::firewall_policies::RemoveAssociation {
1826 super::builder::firewall_policies::RemoveAssociation::new(self.inner.clone())
1827 }
1828
1829 /// Deletes a rule of the specified priority.
1830 pub fn remove_rule(&self) -> super::builder::firewall_policies::RemoveRule {
1831 super::builder::firewall_policies::RemoveRule::new(self.inner.clone())
1832 }
1833
1834 /// Sets the access control policy on the specified resource.
1835 /// Replaces any existing policy.
1836 pub fn set_iam_policy(&self) -> super::builder::firewall_policies::SetIamPolicy {
1837 super::builder::firewall_policies::SetIamPolicy::new(self.inner.clone())
1838 }
1839
1840 /// Returns permissions that a caller has on the specified resource.
1841 pub fn test_iam_permissions(&self) -> super::builder::firewall_policies::TestIamPermissions {
1842 super::builder::firewall_policies::TestIamPermissions::new(self.inner.clone())
1843 }
1844
1845 /// Retrieves the specified Operations resource. Gets a list of operations
1846 /// by making a `list()` request.
1847 pub fn get_operation(&self) -> super::builder::firewall_policies::GetOperation {
1848 super::builder::firewall_policies::GetOperation::new(self.inner.clone())
1849 }
1850}
1851
1852/// Implements a client for the Google Compute Engine API.
1853///
1854/// # Example
1855/// ```
1856/// # async fn sample() -> gax::client_builder::Result<()> {
1857/// # use google_cloud_compute_v1::client::Firewalls;
1858/// let client = Firewalls::builder().build().await?;
1859/// // use `client` to make requests to the Google Compute Engine API.
1860/// # Ok(()) }
1861/// ```
1862///
1863/// # Service Description
1864///
1865/// Service for the `firewalls` resource.
1866///
1867/// # Configuration
1868///
1869/// To configure `Firewalls` use the `with_*` methods in the type returned
1870/// by [builder()][Firewalls::builder]. The default configuration should
1871/// work for most applications. Common configuration changes include
1872///
1873/// * [with_endpoint()]: by default this client uses the global default endpoint
1874/// (`https://compute.googleapis.com`). Applications using regional
1875/// endpoints or running in restricted networks (e.g. a network configured
1876// with [Private Google Access with VPC Service Controls]) may want to
1877/// override this default.
1878/// * [with_credentials()]: by default this client uses
1879/// [Application Default Credentials]. Applications using custom
1880/// authentication may need to override this default.
1881///
1882/// [with_endpoint()]: super::builder::firewalls::ClientBuilder::with_endpoint
1883/// [with_credentials()]: super::builder::firewalls::ClientBuilder::credentials
1884/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1885/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1886///
1887/// # Pooling and Cloning
1888///
1889/// `Firewalls` holds a connection pool internally, it is advised to
1890/// create one and the reuse it. You do not need to wrap `Firewalls` in
1891/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1892/// already uses an `Arc` internally.
1893#[cfg(feature = "firewalls")]
1894#[cfg_attr(docsrs, doc(cfg(feature = "firewalls")))]
1895#[derive(Clone, Debug)]
1896pub struct Firewalls {
1897 inner: std::sync::Arc<dyn super::stub::dynamic::Firewalls>,
1898}
1899
1900#[cfg(feature = "firewalls")]
1901impl Firewalls {
1902 /// Returns a builder for [Firewalls].
1903 ///
1904 /// ```
1905 /// # async fn sample() -> gax::client_builder::Result<()> {
1906 /// # use google_cloud_compute_v1::client::Firewalls;
1907 /// let client = Firewalls::builder().build().await?;
1908 /// # Ok(()) }
1909 /// ```
1910 pub fn builder() -> super::builder::firewalls::ClientBuilder {
1911 gax::client_builder::internal::new_builder(super::builder::firewalls::client::Factory)
1912 }
1913
1914 /// Creates a new client from the provided stub.
1915 ///
1916 /// The most common case for calling this function is in tests mocking the
1917 /// client's behavior.
1918 pub fn from_stub<T>(stub: T) -> Self
1919 where
1920 T: super::stub::Firewalls + 'static,
1921 {
1922 Self {
1923 inner: std::sync::Arc::new(stub),
1924 }
1925 }
1926
1927 pub(crate) async fn new(
1928 config: gaxi::options::ClientConfig,
1929 ) -> gax::client_builder::Result<Self> {
1930 let inner = Self::build_inner(config).await?;
1931 Ok(Self { inner })
1932 }
1933
1934 async fn build_inner(
1935 conf: gaxi::options::ClientConfig,
1936 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Firewalls>> {
1937 if gaxi::options::tracing_enabled(&conf) {
1938 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1939 }
1940 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1941 }
1942
1943 async fn build_transport(
1944 conf: gaxi::options::ClientConfig,
1945 ) -> gax::client_builder::Result<impl super::stub::Firewalls> {
1946 super::transport::Firewalls::new(conf).await
1947 }
1948
1949 async fn build_with_tracing(
1950 conf: gaxi::options::ClientConfig,
1951 ) -> gax::client_builder::Result<impl super::stub::Firewalls> {
1952 Self::build_transport(conf)
1953 .await
1954 .map(super::tracing::Firewalls::new)
1955 }
1956
1957 /// Deletes the specified firewall.
1958 pub fn delete(&self) -> super::builder::firewalls::Delete {
1959 super::builder::firewalls::Delete::new(self.inner.clone())
1960 }
1961
1962 /// Returns the specified firewall.
1963 pub fn get(&self) -> super::builder::firewalls::Get {
1964 super::builder::firewalls::Get::new(self.inner.clone())
1965 }
1966
1967 /// Creates a firewall rule in the specified project using the data
1968 /// included in the request.
1969 pub fn insert(&self) -> super::builder::firewalls::Insert {
1970 super::builder::firewalls::Insert::new(self.inner.clone())
1971 }
1972
1973 /// Retrieves the list of firewall rules available to the specified
1974 /// project.
1975 pub fn list(&self) -> super::builder::firewalls::List {
1976 super::builder::firewalls::List::new(self.inner.clone())
1977 }
1978
1979 /// Updates the specified firewall rule with the data included in the
1980 /// request. This method supportsPATCH
1981 /// semantics and uses theJSON merge
1982 /// patch format and processing rules.
1983 pub fn patch(&self) -> super::builder::firewalls::Patch {
1984 super::builder::firewalls::Patch::new(self.inner.clone())
1985 }
1986
1987 /// Returns permissions that a caller has on the specified resource.
1988 pub fn test_iam_permissions(&self) -> super::builder::firewalls::TestIamPermissions {
1989 super::builder::firewalls::TestIamPermissions::new(self.inner.clone())
1990 }
1991
1992 /// Updates the specified firewall rule with the data included in the
1993 /// request.
1994 /// Note that all fields will be updated if using PUT, even fields that are not
1995 /// specified. To update individual fields, please use PATCH instead.
1996 pub fn update(&self) -> super::builder::firewalls::Update {
1997 super::builder::firewalls::Update::new(self.inner.clone())
1998 }
1999
2000 /// Retrieves the specified Operations resource.
2001 pub fn get_operation(&self) -> super::builder::firewalls::GetOperation {
2002 super::builder::firewalls::GetOperation::new(self.inner.clone())
2003 }
2004}
2005
2006/// Implements a client for the Google Compute Engine API.
2007///
2008/// # Example
2009/// ```
2010/// # async fn sample() -> gax::client_builder::Result<()> {
2011/// # use google_cloud_compute_v1::client::ForwardingRules;
2012/// let client = ForwardingRules::builder().build().await?;
2013/// // use `client` to make requests to the Google Compute Engine API.
2014/// # Ok(()) }
2015/// ```
2016///
2017/// # Service Description
2018///
2019/// Service for the `forwardingRules` resource.
2020///
2021/// # Configuration
2022///
2023/// To configure `ForwardingRules` use the `with_*` methods in the type returned
2024/// by [builder()][ForwardingRules::builder]. The default configuration should
2025/// work for most applications. Common configuration changes include
2026///
2027/// * [with_endpoint()]: by default this client uses the global default endpoint
2028/// (`https://compute.googleapis.com`). Applications using regional
2029/// endpoints or running in restricted networks (e.g. a network configured
2030// with [Private Google Access with VPC Service Controls]) may want to
2031/// override this default.
2032/// * [with_credentials()]: by default this client uses
2033/// [Application Default Credentials]. Applications using custom
2034/// authentication may need to override this default.
2035///
2036/// [with_endpoint()]: super::builder::forwarding_rules::ClientBuilder::with_endpoint
2037/// [with_credentials()]: super::builder::forwarding_rules::ClientBuilder::credentials
2038/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2039/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2040///
2041/// # Pooling and Cloning
2042///
2043/// `ForwardingRules` holds a connection pool internally, it is advised to
2044/// create one and the reuse it. You do not need to wrap `ForwardingRules` in
2045/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2046/// already uses an `Arc` internally.
2047#[cfg(feature = "forwarding-rules")]
2048#[cfg_attr(docsrs, doc(cfg(feature = "forwarding-rules")))]
2049#[derive(Clone, Debug)]
2050pub struct ForwardingRules {
2051 inner: std::sync::Arc<dyn super::stub::dynamic::ForwardingRules>,
2052}
2053
2054#[cfg(feature = "forwarding-rules")]
2055impl ForwardingRules {
2056 /// Returns a builder for [ForwardingRules].
2057 ///
2058 /// ```
2059 /// # async fn sample() -> gax::client_builder::Result<()> {
2060 /// # use google_cloud_compute_v1::client::ForwardingRules;
2061 /// let client = ForwardingRules::builder().build().await?;
2062 /// # Ok(()) }
2063 /// ```
2064 pub fn builder() -> super::builder::forwarding_rules::ClientBuilder {
2065 gax::client_builder::internal::new_builder(
2066 super::builder::forwarding_rules::client::Factory,
2067 )
2068 }
2069
2070 /// Creates a new client from the provided stub.
2071 ///
2072 /// The most common case for calling this function is in tests mocking the
2073 /// client's behavior.
2074 pub fn from_stub<T>(stub: T) -> Self
2075 where
2076 T: super::stub::ForwardingRules + 'static,
2077 {
2078 Self {
2079 inner: std::sync::Arc::new(stub),
2080 }
2081 }
2082
2083 pub(crate) async fn new(
2084 config: gaxi::options::ClientConfig,
2085 ) -> gax::client_builder::Result<Self> {
2086 let inner = Self::build_inner(config).await?;
2087 Ok(Self { inner })
2088 }
2089
2090 async fn build_inner(
2091 conf: gaxi::options::ClientConfig,
2092 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::ForwardingRules>>
2093 {
2094 if gaxi::options::tracing_enabled(&conf) {
2095 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2096 }
2097 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2098 }
2099
2100 async fn build_transport(
2101 conf: gaxi::options::ClientConfig,
2102 ) -> gax::client_builder::Result<impl super::stub::ForwardingRules> {
2103 super::transport::ForwardingRules::new(conf).await
2104 }
2105
2106 async fn build_with_tracing(
2107 conf: gaxi::options::ClientConfig,
2108 ) -> gax::client_builder::Result<impl super::stub::ForwardingRules> {
2109 Self::build_transport(conf)
2110 .await
2111 .map(super::tracing::ForwardingRules::new)
2112 }
2113
2114 /// Retrieves an aggregated list of forwarding rules.
2115 ///
2116 /// To prevent failure, it is recommended that you set the
2117 /// `returnPartialSuccess` parameter to `true`.
2118 pub fn aggregated_list(&self) -> super::builder::forwarding_rules::AggregatedList {
2119 super::builder::forwarding_rules::AggregatedList::new(self.inner.clone())
2120 }
2121
2122 /// Deletes the specified ForwardingRule resource.
2123 pub fn delete(&self) -> super::builder::forwarding_rules::Delete {
2124 super::builder::forwarding_rules::Delete::new(self.inner.clone())
2125 }
2126
2127 /// Returns the specified ForwardingRule resource.
2128 pub fn get(&self) -> super::builder::forwarding_rules::Get {
2129 super::builder::forwarding_rules::Get::new(self.inner.clone())
2130 }
2131
2132 /// Creates a ForwardingRule resource in the specified project and region using
2133 /// the data included in the request.
2134 pub fn insert(&self) -> super::builder::forwarding_rules::Insert {
2135 super::builder::forwarding_rules::Insert::new(self.inner.clone())
2136 }
2137
2138 /// Retrieves a list of ForwardingRule resources available to the specified
2139 /// project and region.
2140 pub fn list(&self) -> super::builder::forwarding_rules::List {
2141 super::builder::forwarding_rules::List::new(self.inner.clone())
2142 }
2143
2144 /// Updates the specified forwarding rule with the data included in the
2145 /// request. This method supportsPATCH
2146 /// semantics and uses theJSON merge
2147 /// patch format and processing rules. Currently, you can only
2148 /// patch the network_tier field.
2149 pub fn patch(&self) -> super::builder::forwarding_rules::Patch {
2150 super::builder::forwarding_rules::Patch::new(self.inner.clone())
2151 }
2152
2153 /// Sets the labels on the specified resource. To learn more about labels,
2154 /// read the
2155 /// Labeling Resources documentation.
2156 pub fn set_labels(&self) -> super::builder::forwarding_rules::SetLabels {
2157 super::builder::forwarding_rules::SetLabels::new(self.inner.clone())
2158 }
2159
2160 /// Changes target URL for forwarding rule. The new target should be of the
2161 /// same type as the old target.
2162 pub fn set_target(&self) -> super::builder::forwarding_rules::SetTarget {
2163 super::builder::forwarding_rules::SetTarget::new(self.inner.clone())
2164 }
2165
2166 /// Retrieves the specified region-specific Operations resource.
2167 pub fn get_operation(&self) -> super::builder::forwarding_rules::GetOperation {
2168 super::builder::forwarding_rules::GetOperation::new(self.inner.clone())
2169 }
2170}
2171
2172/// Implements a client for the Google Compute Engine API.
2173///
2174/// # Example
2175/// ```
2176/// # async fn sample() -> gax::client_builder::Result<()> {
2177/// # use google_cloud_compute_v1::client::FutureReservations;
2178/// let client = FutureReservations::builder().build().await?;
2179/// // use `client` to make requests to the Google Compute Engine API.
2180/// # Ok(()) }
2181/// ```
2182///
2183/// # Service Description
2184///
2185/// Service for the `futureReservations` resource.
2186///
2187/// # Configuration
2188///
2189/// To configure `FutureReservations` use the `with_*` methods in the type returned
2190/// by [builder()][FutureReservations::builder]. The default configuration should
2191/// work for most applications. Common configuration changes include
2192///
2193/// * [with_endpoint()]: by default this client uses the global default endpoint
2194/// (`https://compute.googleapis.com`). Applications using regional
2195/// endpoints or running in restricted networks (e.g. a network configured
2196// with [Private Google Access with VPC Service Controls]) may want to
2197/// override this default.
2198/// * [with_credentials()]: by default this client uses
2199/// [Application Default Credentials]. Applications using custom
2200/// authentication may need to override this default.
2201///
2202/// [with_endpoint()]: super::builder::future_reservations::ClientBuilder::with_endpoint
2203/// [with_credentials()]: super::builder::future_reservations::ClientBuilder::credentials
2204/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2205/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2206///
2207/// # Pooling and Cloning
2208///
2209/// `FutureReservations` holds a connection pool internally, it is advised to
2210/// create one and the reuse it. You do not need to wrap `FutureReservations` in
2211/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2212/// already uses an `Arc` internally.
2213#[cfg(feature = "future-reservations")]
2214#[cfg_attr(docsrs, doc(cfg(feature = "future-reservations")))]
2215#[derive(Clone, Debug)]
2216pub struct FutureReservations {
2217 inner: std::sync::Arc<dyn super::stub::dynamic::FutureReservations>,
2218}
2219
2220#[cfg(feature = "future-reservations")]
2221impl FutureReservations {
2222 /// Returns a builder for [FutureReservations].
2223 ///
2224 /// ```
2225 /// # async fn sample() -> gax::client_builder::Result<()> {
2226 /// # use google_cloud_compute_v1::client::FutureReservations;
2227 /// let client = FutureReservations::builder().build().await?;
2228 /// # Ok(()) }
2229 /// ```
2230 pub fn builder() -> super::builder::future_reservations::ClientBuilder {
2231 gax::client_builder::internal::new_builder(
2232 super::builder::future_reservations::client::Factory,
2233 )
2234 }
2235
2236 /// Creates a new client from the provided stub.
2237 ///
2238 /// The most common case for calling this function is in tests mocking the
2239 /// client's behavior.
2240 pub fn from_stub<T>(stub: T) -> Self
2241 where
2242 T: super::stub::FutureReservations + 'static,
2243 {
2244 Self {
2245 inner: std::sync::Arc::new(stub),
2246 }
2247 }
2248
2249 pub(crate) async fn new(
2250 config: gaxi::options::ClientConfig,
2251 ) -> gax::client_builder::Result<Self> {
2252 let inner = Self::build_inner(config).await?;
2253 Ok(Self { inner })
2254 }
2255
2256 async fn build_inner(
2257 conf: gaxi::options::ClientConfig,
2258 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::FutureReservations>>
2259 {
2260 if gaxi::options::tracing_enabled(&conf) {
2261 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2262 }
2263 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2264 }
2265
2266 async fn build_transport(
2267 conf: gaxi::options::ClientConfig,
2268 ) -> gax::client_builder::Result<impl super::stub::FutureReservations> {
2269 super::transport::FutureReservations::new(conf).await
2270 }
2271
2272 async fn build_with_tracing(
2273 conf: gaxi::options::ClientConfig,
2274 ) -> gax::client_builder::Result<impl super::stub::FutureReservations> {
2275 Self::build_transport(conf)
2276 .await
2277 .map(super::tracing::FutureReservations::new)
2278 }
2279
2280 /// Retrieves an aggregated list of future reservations.
2281 ///
2282 /// To prevent failure, it is recommended that you set the
2283 /// `returnPartialSuccess` parameter to `true`.
2284 pub fn aggregated_list(&self) -> super::builder::future_reservations::AggregatedList {
2285 super::builder::future_reservations::AggregatedList::new(self.inner.clone())
2286 }
2287
2288 /// Cancel the specified future reservation.
2289 pub fn cancel(&self) -> super::builder::future_reservations::Cancel {
2290 super::builder::future_reservations::Cancel::new(self.inner.clone())
2291 }
2292
2293 /// Deletes the specified future reservation.
2294 pub fn delete(&self) -> super::builder::future_reservations::Delete {
2295 super::builder::future_reservations::Delete::new(self.inner.clone())
2296 }
2297
2298 /// Retrieves information about the specified future reservation.
2299 pub fn get(&self) -> super::builder::future_reservations::Get {
2300 super::builder::future_reservations::Get::new(self.inner.clone())
2301 }
2302
2303 /// Creates a new Future Reservation.
2304 pub fn insert(&self) -> super::builder::future_reservations::Insert {
2305 super::builder::future_reservations::Insert::new(self.inner.clone())
2306 }
2307
2308 /// A list of all the future reservations that have been configured for the
2309 /// specified project in specified zone.
2310 pub fn list(&self) -> super::builder::future_reservations::List {
2311 super::builder::future_reservations::List::new(self.inner.clone())
2312 }
2313
2314 /// Updates the specified future reservation.
2315 pub fn update(&self) -> super::builder::future_reservations::Update {
2316 super::builder::future_reservations::Update::new(self.inner.clone())
2317 }
2318
2319 /// Retrieves the specified zone-specific Operations resource.
2320 pub fn get_operation(&self) -> super::builder::future_reservations::GetOperation {
2321 super::builder::future_reservations::GetOperation::new(self.inner.clone())
2322 }
2323}
2324
2325/// Implements a client for the Google Compute Engine API.
2326///
2327/// # Example
2328/// ```
2329/// # async fn sample() -> gax::client_builder::Result<()> {
2330/// # use google_cloud_compute_v1::client::GlobalAddresses;
2331/// let client = GlobalAddresses::builder().build().await?;
2332/// // use `client` to make requests to the Google Compute Engine API.
2333/// # Ok(()) }
2334/// ```
2335///
2336/// # Service Description
2337///
2338/// Service for the `globalAddresses` resource.
2339///
2340/// # Configuration
2341///
2342/// To configure `GlobalAddresses` use the `with_*` methods in the type returned
2343/// by [builder()][GlobalAddresses::builder]. The default configuration should
2344/// work for most applications. Common configuration changes include
2345///
2346/// * [with_endpoint()]: by default this client uses the global default endpoint
2347/// (`https://compute.googleapis.com`). Applications using regional
2348/// endpoints or running in restricted networks (e.g. a network configured
2349// with [Private Google Access with VPC Service Controls]) may want to
2350/// override this default.
2351/// * [with_credentials()]: by default this client uses
2352/// [Application Default Credentials]. Applications using custom
2353/// authentication may need to override this default.
2354///
2355/// [with_endpoint()]: super::builder::global_addresses::ClientBuilder::with_endpoint
2356/// [with_credentials()]: super::builder::global_addresses::ClientBuilder::credentials
2357/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2358/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2359///
2360/// # Pooling and Cloning
2361///
2362/// `GlobalAddresses` holds a connection pool internally, it is advised to
2363/// create one and the reuse it. You do not need to wrap `GlobalAddresses` in
2364/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2365/// already uses an `Arc` internally.
2366#[cfg(feature = "global-addresses")]
2367#[cfg_attr(docsrs, doc(cfg(feature = "global-addresses")))]
2368#[derive(Clone, Debug)]
2369pub struct GlobalAddresses {
2370 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalAddresses>,
2371}
2372
2373#[cfg(feature = "global-addresses")]
2374impl GlobalAddresses {
2375 /// Returns a builder for [GlobalAddresses].
2376 ///
2377 /// ```
2378 /// # async fn sample() -> gax::client_builder::Result<()> {
2379 /// # use google_cloud_compute_v1::client::GlobalAddresses;
2380 /// let client = GlobalAddresses::builder().build().await?;
2381 /// # Ok(()) }
2382 /// ```
2383 pub fn builder() -> super::builder::global_addresses::ClientBuilder {
2384 gax::client_builder::internal::new_builder(
2385 super::builder::global_addresses::client::Factory,
2386 )
2387 }
2388
2389 /// Creates a new client from the provided stub.
2390 ///
2391 /// The most common case for calling this function is in tests mocking the
2392 /// client's behavior.
2393 pub fn from_stub<T>(stub: T) -> Self
2394 where
2395 T: super::stub::GlobalAddresses + 'static,
2396 {
2397 Self {
2398 inner: std::sync::Arc::new(stub),
2399 }
2400 }
2401
2402 pub(crate) async fn new(
2403 config: gaxi::options::ClientConfig,
2404 ) -> gax::client_builder::Result<Self> {
2405 let inner = Self::build_inner(config).await?;
2406 Ok(Self { inner })
2407 }
2408
2409 async fn build_inner(
2410 conf: gaxi::options::ClientConfig,
2411 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::GlobalAddresses>>
2412 {
2413 if gaxi::options::tracing_enabled(&conf) {
2414 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2415 }
2416 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2417 }
2418
2419 async fn build_transport(
2420 conf: gaxi::options::ClientConfig,
2421 ) -> gax::client_builder::Result<impl super::stub::GlobalAddresses> {
2422 super::transport::GlobalAddresses::new(conf).await
2423 }
2424
2425 async fn build_with_tracing(
2426 conf: gaxi::options::ClientConfig,
2427 ) -> gax::client_builder::Result<impl super::stub::GlobalAddresses> {
2428 Self::build_transport(conf)
2429 .await
2430 .map(super::tracing::GlobalAddresses::new)
2431 }
2432
2433 /// Deletes the specified address resource.
2434 pub fn delete(&self) -> super::builder::global_addresses::Delete {
2435 super::builder::global_addresses::Delete::new(self.inner.clone())
2436 }
2437
2438 /// Returns the specified address resource.
2439 pub fn get(&self) -> super::builder::global_addresses::Get {
2440 super::builder::global_addresses::Get::new(self.inner.clone())
2441 }
2442
2443 /// Creates an address resource in the specified project by using the data
2444 /// included in the request.
2445 pub fn insert(&self) -> super::builder::global_addresses::Insert {
2446 super::builder::global_addresses::Insert::new(self.inner.clone())
2447 }
2448
2449 /// Retrieves a list of global addresses.
2450 pub fn list(&self) -> super::builder::global_addresses::List {
2451 super::builder::global_addresses::List::new(self.inner.clone())
2452 }
2453
2454 /// Moves the specified address resource from one project to another project.
2455 pub fn r#move(&self) -> super::builder::global_addresses::Move {
2456 super::builder::global_addresses::Move::new(self.inner.clone())
2457 }
2458
2459 /// Sets the labels on a GlobalAddress. To learn more about labels, read theLabeling
2460 /// Resources documentation.
2461 pub fn set_labels(&self) -> super::builder::global_addresses::SetLabels {
2462 super::builder::global_addresses::SetLabels::new(self.inner.clone())
2463 }
2464
2465 /// Returns permissions that a caller has on the specified resource.
2466 pub fn test_iam_permissions(&self) -> super::builder::global_addresses::TestIamPermissions {
2467 super::builder::global_addresses::TestIamPermissions::new(self.inner.clone())
2468 }
2469
2470 /// Retrieves the specified Operations resource.
2471 pub fn get_operation(&self) -> super::builder::global_addresses::GetOperation {
2472 super::builder::global_addresses::GetOperation::new(self.inner.clone())
2473 }
2474}
2475
2476/// Implements a client for the Google Compute Engine API.
2477///
2478/// # Example
2479/// ```
2480/// # async fn sample() -> gax::client_builder::Result<()> {
2481/// # use google_cloud_compute_v1::client::GlobalForwardingRules;
2482/// let client = GlobalForwardingRules::builder().build().await?;
2483/// // use `client` to make requests to the Google Compute Engine API.
2484/// # Ok(()) }
2485/// ```
2486///
2487/// # Service Description
2488///
2489/// Service for the `globalForwardingRules` resource.
2490///
2491/// # Configuration
2492///
2493/// To configure `GlobalForwardingRules` use the `with_*` methods in the type returned
2494/// by [builder()][GlobalForwardingRules::builder]. The default configuration should
2495/// work for most applications. Common configuration changes include
2496///
2497/// * [with_endpoint()]: by default this client uses the global default endpoint
2498/// (`https://compute.googleapis.com`). Applications using regional
2499/// endpoints or running in restricted networks (e.g. a network configured
2500// with [Private Google Access with VPC Service Controls]) may want to
2501/// override this default.
2502/// * [with_credentials()]: by default this client uses
2503/// [Application Default Credentials]. Applications using custom
2504/// authentication may need to override this default.
2505///
2506/// [with_endpoint()]: super::builder::global_forwarding_rules::ClientBuilder::with_endpoint
2507/// [with_credentials()]: super::builder::global_forwarding_rules::ClientBuilder::credentials
2508/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2509/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2510///
2511/// # Pooling and Cloning
2512///
2513/// `GlobalForwardingRules` holds a connection pool internally, it is advised to
2514/// create one and the reuse it. You do not need to wrap `GlobalForwardingRules` in
2515/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2516/// already uses an `Arc` internally.
2517#[cfg(feature = "global-forwarding-rules")]
2518#[cfg_attr(docsrs, doc(cfg(feature = "global-forwarding-rules")))]
2519#[derive(Clone, Debug)]
2520pub struct GlobalForwardingRules {
2521 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalForwardingRules>,
2522}
2523
2524#[cfg(feature = "global-forwarding-rules")]
2525impl GlobalForwardingRules {
2526 /// Returns a builder for [GlobalForwardingRules].
2527 ///
2528 /// ```
2529 /// # async fn sample() -> gax::client_builder::Result<()> {
2530 /// # use google_cloud_compute_v1::client::GlobalForwardingRules;
2531 /// let client = GlobalForwardingRules::builder().build().await?;
2532 /// # Ok(()) }
2533 /// ```
2534 pub fn builder() -> super::builder::global_forwarding_rules::ClientBuilder {
2535 gax::client_builder::internal::new_builder(
2536 super::builder::global_forwarding_rules::client::Factory,
2537 )
2538 }
2539
2540 /// Creates a new client from the provided stub.
2541 ///
2542 /// The most common case for calling this function is in tests mocking the
2543 /// client's behavior.
2544 pub fn from_stub<T>(stub: T) -> Self
2545 where
2546 T: super::stub::GlobalForwardingRules + 'static,
2547 {
2548 Self {
2549 inner: std::sync::Arc::new(stub),
2550 }
2551 }
2552
2553 pub(crate) async fn new(
2554 config: gaxi::options::ClientConfig,
2555 ) -> gax::client_builder::Result<Self> {
2556 let inner = Self::build_inner(config).await?;
2557 Ok(Self { inner })
2558 }
2559
2560 async fn build_inner(
2561 conf: gaxi::options::ClientConfig,
2562 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::GlobalForwardingRules>>
2563 {
2564 if gaxi::options::tracing_enabled(&conf) {
2565 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2566 }
2567 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2568 }
2569
2570 async fn build_transport(
2571 conf: gaxi::options::ClientConfig,
2572 ) -> gax::client_builder::Result<impl super::stub::GlobalForwardingRules> {
2573 super::transport::GlobalForwardingRules::new(conf).await
2574 }
2575
2576 async fn build_with_tracing(
2577 conf: gaxi::options::ClientConfig,
2578 ) -> gax::client_builder::Result<impl super::stub::GlobalForwardingRules> {
2579 Self::build_transport(conf)
2580 .await
2581 .map(super::tracing::GlobalForwardingRules::new)
2582 }
2583
2584 /// Deletes the specified GlobalForwardingRule resource.
2585 pub fn delete(&self) -> super::builder::global_forwarding_rules::Delete {
2586 super::builder::global_forwarding_rules::Delete::new(self.inner.clone())
2587 }
2588
2589 /// Returns the specified GlobalForwardingRule resource. Gets a list of
2590 /// available forwarding rules by making a list() request.
2591 pub fn get(&self) -> super::builder::global_forwarding_rules::Get {
2592 super::builder::global_forwarding_rules::Get::new(self.inner.clone())
2593 }
2594
2595 /// Creates a GlobalForwardingRule resource in the specified project using
2596 /// the data included in the request.
2597 pub fn insert(&self) -> super::builder::global_forwarding_rules::Insert {
2598 super::builder::global_forwarding_rules::Insert::new(self.inner.clone())
2599 }
2600
2601 /// Retrieves a list of GlobalForwardingRule resources available to the
2602 /// specified project.
2603 pub fn list(&self) -> super::builder::global_forwarding_rules::List {
2604 super::builder::global_forwarding_rules::List::new(self.inner.clone())
2605 }
2606
2607 /// Updates the specified forwarding rule with the data included in the
2608 /// request. This method supportsPATCH
2609 /// semantics and uses theJSON merge
2610 /// patch format and processing rules. Currently, you can only
2611 /// patch the network_tier field.
2612 pub fn patch(&self) -> super::builder::global_forwarding_rules::Patch {
2613 super::builder::global_forwarding_rules::Patch::new(self.inner.clone())
2614 }
2615
2616 /// Sets the labels on the specified resource. To learn more about labels,
2617 /// read the
2618 /// Labeling resources documentation.
2619 pub fn set_labels(&self) -> super::builder::global_forwarding_rules::SetLabels {
2620 super::builder::global_forwarding_rules::SetLabels::new(self.inner.clone())
2621 }
2622
2623 /// Changes target URL for the GlobalForwardingRule resource. The new target
2624 /// should be of the same type as the old target.
2625 pub fn set_target(&self) -> super::builder::global_forwarding_rules::SetTarget {
2626 super::builder::global_forwarding_rules::SetTarget::new(self.inner.clone())
2627 }
2628
2629 /// Retrieves the specified Operations resource.
2630 pub fn get_operation(&self) -> super::builder::global_forwarding_rules::GetOperation {
2631 super::builder::global_forwarding_rules::GetOperation::new(self.inner.clone())
2632 }
2633}
2634
2635/// Implements a client for the Google Compute Engine API.
2636///
2637/// # Example
2638/// ```
2639/// # async fn sample() -> gax::client_builder::Result<()> {
2640/// # use google_cloud_compute_v1::client::GlobalNetworkEndpointGroups;
2641/// let client = GlobalNetworkEndpointGroups::builder().build().await?;
2642/// // use `client` to make requests to the Google Compute Engine API.
2643/// # Ok(()) }
2644/// ```
2645///
2646/// # Service Description
2647///
2648/// Service for the `globalNetworkEndpointGroups` resource.
2649///
2650/// # Configuration
2651///
2652/// To configure `GlobalNetworkEndpointGroups` use the `with_*` methods in the type returned
2653/// by [builder()][GlobalNetworkEndpointGroups::builder]. The default configuration should
2654/// work for most applications. Common configuration changes include
2655///
2656/// * [with_endpoint()]: by default this client uses the global default endpoint
2657/// (`https://compute.googleapis.com`). Applications using regional
2658/// endpoints or running in restricted networks (e.g. a network configured
2659// with [Private Google Access with VPC Service Controls]) may want to
2660/// override this default.
2661/// * [with_credentials()]: by default this client uses
2662/// [Application Default Credentials]. Applications using custom
2663/// authentication may need to override this default.
2664///
2665/// [with_endpoint()]: super::builder::global_network_endpoint_groups::ClientBuilder::with_endpoint
2666/// [with_credentials()]: super::builder::global_network_endpoint_groups::ClientBuilder::credentials
2667/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2668/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2669///
2670/// # Pooling and Cloning
2671///
2672/// `GlobalNetworkEndpointGroups` holds a connection pool internally, it is advised to
2673/// create one and the reuse it. You do not need to wrap `GlobalNetworkEndpointGroups` in
2674/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2675/// already uses an `Arc` internally.
2676#[cfg(feature = "global-network-endpoint-groups")]
2677#[cfg_attr(docsrs, doc(cfg(feature = "global-network-endpoint-groups")))]
2678#[derive(Clone, Debug)]
2679pub struct GlobalNetworkEndpointGroups {
2680 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalNetworkEndpointGroups>,
2681}
2682
2683#[cfg(feature = "global-network-endpoint-groups")]
2684impl GlobalNetworkEndpointGroups {
2685 /// Returns a builder for [GlobalNetworkEndpointGroups].
2686 ///
2687 /// ```
2688 /// # async fn sample() -> gax::client_builder::Result<()> {
2689 /// # use google_cloud_compute_v1::client::GlobalNetworkEndpointGroups;
2690 /// let client = GlobalNetworkEndpointGroups::builder().build().await?;
2691 /// # Ok(()) }
2692 /// ```
2693 pub fn builder() -> super::builder::global_network_endpoint_groups::ClientBuilder {
2694 gax::client_builder::internal::new_builder(
2695 super::builder::global_network_endpoint_groups::client::Factory,
2696 )
2697 }
2698
2699 /// Creates a new client from the provided stub.
2700 ///
2701 /// The most common case for calling this function is in tests mocking the
2702 /// client's behavior.
2703 pub fn from_stub<T>(stub: T) -> Self
2704 where
2705 T: super::stub::GlobalNetworkEndpointGroups + 'static,
2706 {
2707 Self {
2708 inner: std::sync::Arc::new(stub),
2709 }
2710 }
2711
2712 pub(crate) async fn new(
2713 config: gaxi::options::ClientConfig,
2714 ) -> gax::client_builder::Result<Self> {
2715 let inner = Self::build_inner(config).await?;
2716 Ok(Self { inner })
2717 }
2718
2719 async fn build_inner(
2720 conf: gaxi::options::ClientConfig,
2721 ) -> gax::client_builder::Result<
2722 std::sync::Arc<dyn super::stub::dynamic::GlobalNetworkEndpointGroups>,
2723 > {
2724 if gaxi::options::tracing_enabled(&conf) {
2725 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2726 }
2727 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2728 }
2729
2730 async fn build_transport(
2731 conf: gaxi::options::ClientConfig,
2732 ) -> gax::client_builder::Result<impl super::stub::GlobalNetworkEndpointGroups> {
2733 super::transport::GlobalNetworkEndpointGroups::new(conf).await
2734 }
2735
2736 async fn build_with_tracing(
2737 conf: gaxi::options::ClientConfig,
2738 ) -> gax::client_builder::Result<impl super::stub::GlobalNetworkEndpointGroups> {
2739 Self::build_transport(conf)
2740 .await
2741 .map(super::tracing::GlobalNetworkEndpointGroups::new)
2742 }
2743
2744 /// Attach a network endpoint to the specified network endpoint group.
2745 pub fn attach_network_endpoints(
2746 &self,
2747 ) -> super::builder::global_network_endpoint_groups::AttachNetworkEndpoints {
2748 super::builder::global_network_endpoint_groups::AttachNetworkEndpoints::new(
2749 self.inner.clone(),
2750 )
2751 }
2752
2753 /// Deletes the specified network endpoint group.Note that the NEG cannot be
2754 /// deleted if there are backend services referencing it.
2755 pub fn delete(&self) -> super::builder::global_network_endpoint_groups::Delete {
2756 super::builder::global_network_endpoint_groups::Delete::new(self.inner.clone())
2757 }
2758
2759 /// Detach the network endpoint from the specified network endpoint group.
2760 pub fn detach_network_endpoints(
2761 &self,
2762 ) -> super::builder::global_network_endpoint_groups::DetachNetworkEndpoints {
2763 super::builder::global_network_endpoint_groups::DetachNetworkEndpoints::new(
2764 self.inner.clone(),
2765 )
2766 }
2767
2768 /// Returns the specified network endpoint group.
2769 pub fn get(&self) -> super::builder::global_network_endpoint_groups::Get {
2770 super::builder::global_network_endpoint_groups::Get::new(self.inner.clone())
2771 }
2772
2773 /// Creates a network endpoint group in the specified project using the
2774 /// parameters that are included in the request.
2775 pub fn insert(&self) -> super::builder::global_network_endpoint_groups::Insert {
2776 super::builder::global_network_endpoint_groups::Insert::new(self.inner.clone())
2777 }
2778
2779 /// Retrieves the list of network endpoint groups that are located in the
2780 /// specified project.
2781 pub fn list(&self) -> super::builder::global_network_endpoint_groups::List {
2782 super::builder::global_network_endpoint_groups::List::new(self.inner.clone())
2783 }
2784
2785 /// Lists the network endpoints in the specified network endpoint group.
2786 pub fn list_network_endpoints(
2787 &self,
2788 ) -> super::builder::global_network_endpoint_groups::ListNetworkEndpoints {
2789 super::builder::global_network_endpoint_groups::ListNetworkEndpoints::new(
2790 self.inner.clone(),
2791 )
2792 }
2793
2794 /// Retrieves the specified Operations resource.
2795 pub fn get_operation(&self) -> super::builder::global_network_endpoint_groups::GetOperation {
2796 super::builder::global_network_endpoint_groups::GetOperation::new(self.inner.clone())
2797 }
2798}
2799
2800/// Implements a client for the Google Compute Engine API.
2801///
2802/// # Example
2803/// ```
2804/// # async fn sample() -> gax::client_builder::Result<()> {
2805/// # use google_cloud_compute_v1::client::GlobalOperations;
2806/// let client = GlobalOperations::builder().build().await?;
2807/// // use `client` to make requests to the Google Compute Engine API.
2808/// # Ok(()) }
2809/// ```
2810///
2811/// # Service Description
2812///
2813/// Service for the `globalOperations` resource.
2814///
2815/// # Configuration
2816///
2817/// To configure `GlobalOperations` use the `with_*` methods in the type returned
2818/// by [builder()][GlobalOperations::builder]. The default configuration should
2819/// work for most applications. Common configuration changes include
2820///
2821/// * [with_endpoint()]: by default this client uses the global default endpoint
2822/// (`https://compute.googleapis.com`). Applications using regional
2823/// endpoints or running in restricted networks (e.g. a network configured
2824// with [Private Google Access with VPC Service Controls]) may want to
2825/// override this default.
2826/// * [with_credentials()]: by default this client uses
2827/// [Application Default Credentials]. Applications using custom
2828/// authentication may need to override this default.
2829///
2830/// [with_endpoint()]: super::builder::global_operations::ClientBuilder::with_endpoint
2831/// [with_credentials()]: super::builder::global_operations::ClientBuilder::credentials
2832/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2833/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2834///
2835/// # Pooling and Cloning
2836///
2837/// `GlobalOperations` holds a connection pool internally, it is advised to
2838/// create one and the reuse it. You do not need to wrap `GlobalOperations` in
2839/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2840/// already uses an `Arc` internally.
2841#[cfg(feature = "global-operations")]
2842#[cfg_attr(docsrs, doc(cfg(feature = "global-operations")))]
2843#[derive(Clone, Debug)]
2844pub struct GlobalOperations {
2845 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalOperations>,
2846}
2847
2848#[cfg(feature = "global-operations")]
2849impl GlobalOperations {
2850 /// Returns a builder for [GlobalOperations].
2851 ///
2852 /// ```
2853 /// # async fn sample() -> gax::client_builder::Result<()> {
2854 /// # use google_cloud_compute_v1::client::GlobalOperations;
2855 /// let client = GlobalOperations::builder().build().await?;
2856 /// # Ok(()) }
2857 /// ```
2858 pub fn builder() -> super::builder::global_operations::ClientBuilder {
2859 gax::client_builder::internal::new_builder(
2860 super::builder::global_operations::client::Factory,
2861 )
2862 }
2863
2864 /// Creates a new client from the provided stub.
2865 ///
2866 /// The most common case for calling this function is in tests mocking the
2867 /// client's behavior.
2868 pub fn from_stub<T>(stub: T) -> Self
2869 where
2870 T: super::stub::GlobalOperations + 'static,
2871 {
2872 Self {
2873 inner: std::sync::Arc::new(stub),
2874 }
2875 }
2876
2877 pub(crate) async fn new(
2878 config: gaxi::options::ClientConfig,
2879 ) -> gax::client_builder::Result<Self> {
2880 let inner = Self::build_inner(config).await?;
2881 Ok(Self { inner })
2882 }
2883
2884 async fn build_inner(
2885 conf: gaxi::options::ClientConfig,
2886 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::GlobalOperations>>
2887 {
2888 if gaxi::options::tracing_enabled(&conf) {
2889 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2890 }
2891 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2892 }
2893
2894 async fn build_transport(
2895 conf: gaxi::options::ClientConfig,
2896 ) -> gax::client_builder::Result<impl super::stub::GlobalOperations> {
2897 super::transport::GlobalOperations::new(conf).await
2898 }
2899
2900 async fn build_with_tracing(
2901 conf: gaxi::options::ClientConfig,
2902 ) -> gax::client_builder::Result<impl super::stub::GlobalOperations> {
2903 Self::build_transport(conf)
2904 .await
2905 .map(super::tracing::GlobalOperations::new)
2906 }
2907
2908 /// Retrieves an aggregated list of all operations.
2909 ///
2910 /// To prevent failure, Google recommends that you set the
2911 /// `returnPartialSuccess` parameter to `true`.
2912 pub fn aggregated_list(&self) -> super::builder::global_operations::AggregatedList {
2913 super::builder::global_operations::AggregatedList::new(self.inner.clone())
2914 }
2915
2916 /// Deletes the specified Operations resource.
2917 pub fn delete(&self) -> super::builder::global_operations::Delete {
2918 super::builder::global_operations::Delete::new(self.inner.clone())
2919 }
2920
2921 /// Retrieves the specified Operations resource.
2922 pub fn get(&self) -> super::builder::global_operations::Get {
2923 super::builder::global_operations::Get::new(self.inner.clone())
2924 }
2925
2926 /// Retrieves a list of Operation resources contained within the specified
2927 /// project.
2928 pub fn list(&self) -> super::builder::global_operations::List {
2929 super::builder::global_operations::List::new(self.inner.clone())
2930 }
2931
2932 /// Waits for the specified Operation resource to return as `DONE`
2933 /// or for the request to approach the 2 minute deadline, and retrieves the
2934 /// specified Operation resource. This method differs from the
2935 /// `GET` method in that it waits for no more than the default
2936 /// deadline (2 minutes) and then returns the current state of the operation,
2937 /// which might be `DONE` or still in progress.
2938 ///
2939 /// This method is called on a best-effort basis. Specifically:
2940 ///
2941 /// ```norust
2942 /// - In uncommon cases, when the server is overloaded, the request might
2943 /// return before the default deadline is reached, or might return after zero
2944 /// seconds.
2945 /// ```
2946 ///
2947 /// - If the default deadline is reached, there is no guarantee that the
2948 /// operation is actually done when the method returns. Be prepared to retry
2949 /// if the operation is not `DONE`.
2950 pub fn wait(&self) -> super::builder::global_operations::Wait {
2951 super::builder::global_operations::Wait::new(self.inner.clone())
2952 }
2953}
2954
2955/// Implements a client for the Google Compute Engine API.
2956///
2957/// # Example
2958/// ```
2959/// # async fn sample() -> gax::client_builder::Result<()> {
2960/// # use google_cloud_compute_v1::client::GlobalOrganizationOperations;
2961/// let client = GlobalOrganizationOperations::builder().build().await?;
2962/// // use `client` to make requests to the Google Compute Engine API.
2963/// # Ok(()) }
2964/// ```
2965///
2966/// # Service Description
2967///
2968/// Service for the `globalOrganizationOperations` resource.
2969///
2970/// # Configuration
2971///
2972/// To configure `GlobalOrganizationOperations` use the `with_*` methods in the type returned
2973/// by [builder()][GlobalOrganizationOperations::builder]. The default configuration should
2974/// work for most applications. Common configuration changes include
2975///
2976/// * [with_endpoint()]: by default this client uses the global default endpoint
2977/// (`https://compute.googleapis.com`). Applications using regional
2978/// endpoints or running in restricted networks (e.g. a network configured
2979// with [Private Google Access with VPC Service Controls]) may want to
2980/// override this default.
2981/// * [with_credentials()]: by default this client uses
2982/// [Application Default Credentials]. Applications using custom
2983/// authentication may need to override this default.
2984///
2985/// [with_endpoint()]: super::builder::global_organization_operations::ClientBuilder::with_endpoint
2986/// [with_credentials()]: super::builder::global_organization_operations::ClientBuilder::credentials
2987/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2988/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2989///
2990/// # Pooling and Cloning
2991///
2992/// `GlobalOrganizationOperations` holds a connection pool internally, it is advised to
2993/// create one and the reuse it. You do not need to wrap `GlobalOrganizationOperations` in
2994/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2995/// already uses an `Arc` internally.
2996#[cfg(feature = "global-organization-operations")]
2997#[cfg_attr(docsrs, doc(cfg(feature = "global-organization-operations")))]
2998#[derive(Clone, Debug)]
2999pub struct GlobalOrganizationOperations {
3000 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalOrganizationOperations>,
3001}
3002
3003#[cfg(feature = "global-organization-operations")]
3004impl GlobalOrganizationOperations {
3005 /// Returns a builder for [GlobalOrganizationOperations].
3006 ///
3007 /// ```
3008 /// # async fn sample() -> gax::client_builder::Result<()> {
3009 /// # use google_cloud_compute_v1::client::GlobalOrganizationOperations;
3010 /// let client = GlobalOrganizationOperations::builder().build().await?;
3011 /// # Ok(()) }
3012 /// ```
3013 pub fn builder() -> super::builder::global_organization_operations::ClientBuilder {
3014 gax::client_builder::internal::new_builder(
3015 super::builder::global_organization_operations::client::Factory,
3016 )
3017 }
3018
3019 /// Creates a new client from the provided stub.
3020 ///
3021 /// The most common case for calling this function is in tests mocking the
3022 /// client's behavior.
3023 pub fn from_stub<T>(stub: T) -> Self
3024 where
3025 T: super::stub::GlobalOrganizationOperations + 'static,
3026 {
3027 Self {
3028 inner: std::sync::Arc::new(stub),
3029 }
3030 }
3031
3032 pub(crate) async fn new(
3033 config: gaxi::options::ClientConfig,
3034 ) -> gax::client_builder::Result<Self> {
3035 let inner = Self::build_inner(config).await?;
3036 Ok(Self { inner })
3037 }
3038
3039 async fn build_inner(
3040 conf: gaxi::options::ClientConfig,
3041 ) -> gax::client_builder::Result<
3042 std::sync::Arc<dyn super::stub::dynamic::GlobalOrganizationOperations>,
3043 > {
3044 if gaxi::options::tracing_enabled(&conf) {
3045 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3046 }
3047 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3048 }
3049
3050 async fn build_transport(
3051 conf: gaxi::options::ClientConfig,
3052 ) -> gax::client_builder::Result<impl super::stub::GlobalOrganizationOperations> {
3053 super::transport::GlobalOrganizationOperations::new(conf).await
3054 }
3055
3056 async fn build_with_tracing(
3057 conf: gaxi::options::ClientConfig,
3058 ) -> gax::client_builder::Result<impl super::stub::GlobalOrganizationOperations> {
3059 Self::build_transport(conf)
3060 .await
3061 .map(super::tracing::GlobalOrganizationOperations::new)
3062 }
3063
3064 /// Deletes the specified Operations resource.
3065 pub fn delete(&self) -> super::builder::global_organization_operations::Delete {
3066 super::builder::global_organization_operations::Delete::new(self.inner.clone())
3067 }
3068
3069 /// Retrieves the specified Operations resource. Gets a list of operations
3070 /// by making a `list()` request.
3071 pub fn get(&self) -> super::builder::global_organization_operations::Get {
3072 super::builder::global_organization_operations::Get::new(self.inner.clone())
3073 }
3074
3075 /// Retrieves a list of Operation resources contained within the specified
3076 /// organization.
3077 pub fn list(&self) -> super::builder::global_organization_operations::List {
3078 super::builder::global_organization_operations::List::new(self.inner.clone())
3079 }
3080}
3081
3082/// Implements a client for the Google Compute Engine API.
3083///
3084/// # Example
3085/// ```
3086/// # async fn sample() -> gax::client_builder::Result<()> {
3087/// # use google_cloud_compute_v1::client::GlobalPublicDelegatedPrefixes;
3088/// let client = GlobalPublicDelegatedPrefixes::builder().build().await?;
3089/// // use `client` to make requests to the Google Compute Engine API.
3090/// # Ok(()) }
3091/// ```
3092///
3093/// # Service Description
3094///
3095/// Service for the `globalPublicDelegatedPrefixes` resource.
3096///
3097/// # Configuration
3098///
3099/// To configure `GlobalPublicDelegatedPrefixes` use the `with_*` methods in the type returned
3100/// by [builder()][GlobalPublicDelegatedPrefixes::builder]. The default configuration should
3101/// work for most applications. Common configuration changes include
3102///
3103/// * [with_endpoint()]: by default this client uses the global default endpoint
3104/// (`https://compute.googleapis.com`). Applications using regional
3105/// endpoints or running in restricted networks (e.g. a network configured
3106// with [Private Google Access with VPC Service Controls]) may want to
3107/// override this default.
3108/// * [with_credentials()]: by default this client uses
3109/// [Application Default Credentials]. Applications using custom
3110/// authentication may need to override this default.
3111///
3112/// [with_endpoint()]: super::builder::global_public_delegated_prefixes::ClientBuilder::with_endpoint
3113/// [with_credentials()]: super::builder::global_public_delegated_prefixes::ClientBuilder::credentials
3114/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3115/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3116///
3117/// # Pooling and Cloning
3118///
3119/// `GlobalPublicDelegatedPrefixes` holds a connection pool internally, it is advised to
3120/// create one and the reuse it. You do not need to wrap `GlobalPublicDelegatedPrefixes` in
3121/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3122/// already uses an `Arc` internally.
3123#[cfg(feature = "global-public-delegated-prefixes")]
3124#[cfg_attr(docsrs, doc(cfg(feature = "global-public-delegated-prefixes")))]
3125#[derive(Clone, Debug)]
3126pub struct GlobalPublicDelegatedPrefixes {
3127 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalPublicDelegatedPrefixes>,
3128}
3129
3130#[cfg(feature = "global-public-delegated-prefixes")]
3131impl GlobalPublicDelegatedPrefixes {
3132 /// Returns a builder for [GlobalPublicDelegatedPrefixes].
3133 ///
3134 /// ```
3135 /// # async fn sample() -> gax::client_builder::Result<()> {
3136 /// # use google_cloud_compute_v1::client::GlobalPublicDelegatedPrefixes;
3137 /// let client = GlobalPublicDelegatedPrefixes::builder().build().await?;
3138 /// # Ok(()) }
3139 /// ```
3140 pub fn builder() -> super::builder::global_public_delegated_prefixes::ClientBuilder {
3141 gax::client_builder::internal::new_builder(
3142 super::builder::global_public_delegated_prefixes::client::Factory,
3143 )
3144 }
3145
3146 /// Creates a new client from the provided stub.
3147 ///
3148 /// The most common case for calling this function is in tests mocking the
3149 /// client's behavior.
3150 pub fn from_stub<T>(stub: T) -> Self
3151 where
3152 T: super::stub::GlobalPublicDelegatedPrefixes + 'static,
3153 {
3154 Self {
3155 inner: std::sync::Arc::new(stub),
3156 }
3157 }
3158
3159 pub(crate) async fn new(
3160 config: gaxi::options::ClientConfig,
3161 ) -> gax::client_builder::Result<Self> {
3162 let inner = Self::build_inner(config).await?;
3163 Ok(Self { inner })
3164 }
3165
3166 async fn build_inner(
3167 conf: gaxi::options::ClientConfig,
3168 ) -> gax::client_builder::Result<
3169 std::sync::Arc<dyn super::stub::dynamic::GlobalPublicDelegatedPrefixes>,
3170 > {
3171 if gaxi::options::tracing_enabled(&conf) {
3172 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3173 }
3174 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3175 }
3176
3177 async fn build_transport(
3178 conf: gaxi::options::ClientConfig,
3179 ) -> gax::client_builder::Result<impl super::stub::GlobalPublicDelegatedPrefixes> {
3180 super::transport::GlobalPublicDelegatedPrefixes::new(conf).await
3181 }
3182
3183 async fn build_with_tracing(
3184 conf: gaxi::options::ClientConfig,
3185 ) -> gax::client_builder::Result<impl super::stub::GlobalPublicDelegatedPrefixes> {
3186 Self::build_transport(conf)
3187 .await
3188 .map(super::tracing::GlobalPublicDelegatedPrefixes::new)
3189 }
3190
3191 /// Deletes the specified global PublicDelegatedPrefix.
3192 pub fn delete(&self) -> super::builder::global_public_delegated_prefixes::Delete {
3193 super::builder::global_public_delegated_prefixes::Delete::new(self.inner.clone())
3194 }
3195
3196 /// Returns the specified global PublicDelegatedPrefix resource.
3197 pub fn get(&self) -> super::builder::global_public_delegated_prefixes::Get {
3198 super::builder::global_public_delegated_prefixes::Get::new(self.inner.clone())
3199 }
3200
3201 /// Creates a global PublicDelegatedPrefix in the specified project using the
3202 /// parameters that are included in the request.
3203 pub fn insert(&self) -> super::builder::global_public_delegated_prefixes::Insert {
3204 super::builder::global_public_delegated_prefixes::Insert::new(self.inner.clone())
3205 }
3206
3207 /// Lists the global PublicDelegatedPrefixes for a project.
3208 pub fn list(&self) -> super::builder::global_public_delegated_prefixes::List {
3209 super::builder::global_public_delegated_prefixes::List::new(self.inner.clone())
3210 }
3211
3212 /// Patches the specified global PublicDelegatedPrefix resource with the data
3213 /// included in the request. This method supportsPATCH
3214 /// semantics and usesJSON merge
3215 /// patch format and processing rules.
3216 pub fn patch(&self) -> super::builder::global_public_delegated_prefixes::Patch {
3217 super::builder::global_public_delegated_prefixes::Patch::new(self.inner.clone())
3218 }
3219
3220 /// Retrieves the specified Operations resource.
3221 pub fn get_operation(&self) -> super::builder::global_public_delegated_prefixes::GetOperation {
3222 super::builder::global_public_delegated_prefixes::GetOperation::new(self.inner.clone())
3223 }
3224}
3225
3226/// Implements a client for the Google Compute Engine API.
3227///
3228/// # Example
3229/// ```
3230/// # async fn sample() -> gax::client_builder::Result<()> {
3231/// # use google_cloud_compute_v1::client::HealthChecks;
3232/// let client = HealthChecks::builder().build().await?;
3233/// // use `client` to make requests to the Google Compute Engine API.
3234/// # Ok(()) }
3235/// ```
3236///
3237/// # Service Description
3238///
3239/// Service for the `healthChecks` resource.
3240///
3241/// # Configuration
3242///
3243/// To configure `HealthChecks` use the `with_*` methods in the type returned
3244/// by [builder()][HealthChecks::builder]. The default configuration should
3245/// work for most applications. Common configuration changes include
3246///
3247/// * [with_endpoint()]: by default this client uses the global default endpoint
3248/// (`https://compute.googleapis.com`). Applications using regional
3249/// endpoints or running in restricted networks (e.g. a network configured
3250// with [Private Google Access with VPC Service Controls]) may want to
3251/// override this default.
3252/// * [with_credentials()]: by default this client uses
3253/// [Application Default Credentials]. Applications using custom
3254/// authentication may need to override this default.
3255///
3256/// [with_endpoint()]: super::builder::health_checks::ClientBuilder::with_endpoint
3257/// [with_credentials()]: super::builder::health_checks::ClientBuilder::credentials
3258/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3259/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3260///
3261/// # Pooling and Cloning
3262///
3263/// `HealthChecks` holds a connection pool internally, it is advised to
3264/// create one and the reuse it. You do not need to wrap `HealthChecks` in
3265/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3266/// already uses an `Arc` internally.
3267#[cfg(feature = "health-checks")]
3268#[cfg_attr(docsrs, doc(cfg(feature = "health-checks")))]
3269#[derive(Clone, Debug)]
3270pub struct HealthChecks {
3271 inner: std::sync::Arc<dyn super::stub::dynamic::HealthChecks>,
3272}
3273
3274#[cfg(feature = "health-checks")]
3275impl HealthChecks {
3276 /// Returns a builder for [HealthChecks].
3277 ///
3278 /// ```
3279 /// # async fn sample() -> gax::client_builder::Result<()> {
3280 /// # use google_cloud_compute_v1::client::HealthChecks;
3281 /// let client = HealthChecks::builder().build().await?;
3282 /// # Ok(()) }
3283 /// ```
3284 pub fn builder() -> super::builder::health_checks::ClientBuilder {
3285 gax::client_builder::internal::new_builder(super::builder::health_checks::client::Factory)
3286 }
3287
3288 /// Creates a new client from the provided stub.
3289 ///
3290 /// The most common case for calling this function is in tests mocking the
3291 /// client's behavior.
3292 pub fn from_stub<T>(stub: T) -> Self
3293 where
3294 T: super::stub::HealthChecks + 'static,
3295 {
3296 Self {
3297 inner: std::sync::Arc::new(stub),
3298 }
3299 }
3300
3301 pub(crate) async fn new(
3302 config: gaxi::options::ClientConfig,
3303 ) -> gax::client_builder::Result<Self> {
3304 let inner = Self::build_inner(config).await?;
3305 Ok(Self { inner })
3306 }
3307
3308 async fn build_inner(
3309 conf: gaxi::options::ClientConfig,
3310 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::HealthChecks>> {
3311 if gaxi::options::tracing_enabled(&conf) {
3312 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3313 }
3314 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3315 }
3316
3317 async fn build_transport(
3318 conf: gaxi::options::ClientConfig,
3319 ) -> gax::client_builder::Result<impl super::stub::HealthChecks> {
3320 super::transport::HealthChecks::new(conf).await
3321 }
3322
3323 async fn build_with_tracing(
3324 conf: gaxi::options::ClientConfig,
3325 ) -> gax::client_builder::Result<impl super::stub::HealthChecks> {
3326 Self::build_transport(conf)
3327 .await
3328 .map(super::tracing::HealthChecks::new)
3329 }
3330
3331 /// Retrieves the list of all HealthCheck resources, regional and global,
3332 /// available to the specified project.
3333 ///
3334 /// To prevent failure, Google recommends that you set the
3335 /// `returnPartialSuccess` parameter to `true`.
3336 pub fn aggregated_list(&self) -> super::builder::health_checks::AggregatedList {
3337 super::builder::health_checks::AggregatedList::new(self.inner.clone())
3338 }
3339
3340 /// Deletes the specified HealthCheck resource.
3341 pub fn delete(&self) -> super::builder::health_checks::Delete {
3342 super::builder::health_checks::Delete::new(self.inner.clone())
3343 }
3344
3345 /// Returns the specified HealthCheck resource.
3346 pub fn get(&self) -> super::builder::health_checks::Get {
3347 super::builder::health_checks::Get::new(self.inner.clone())
3348 }
3349
3350 /// Creates a HealthCheck resource in the specified project using the data
3351 /// included in the request.
3352 pub fn insert(&self) -> super::builder::health_checks::Insert {
3353 super::builder::health_checks::Insert::new(self.inner.clone())
3354 }
3355
3356 /// Retrieves the list of HealthCheck resources available to the specified
3357 /// project.
3358 pub fn list(&self) -> super::builder::health_checks::List {
3359 super::builder::health_checks::List::new(self.inner.clone())
3360 }
3361
3362 /// Updates a HealthCheck resource in the specified project using the data
3363 /// included in the request. This method supportsPATCH
3364 /// semantics and uses theJSON merge
3365 /// patch format and processing rules.
3366 pub fn patch(&self) -> super::builder::health_checks::Patch {
3367 super::builder::health_checks::Patch::new(self.inner.clone())
3368 }
3369
3370 /// Returns permissions that a caller has on the specified resource.
3371 pub fn test_iam_permissions(&self) -> super::builder::health_checks::TestIamPermissions {
3372 super::builder::health_checks::TestIamPermissions::new(self.inner.clone())
3373 }
3374
3375 /// Updates a HealthCheck resource in the specified project using the data
3376 /// included in the request.
3377 pub fn update(&self) -> super::builder::health_checks::Update {
3378 super::builder::health_checks::Update::new(self.inner.clone())
3379 }
3380
3381 /// Retrieves the specified Operations resource.
3382 pub fn get_operation(&self) -> super::builder::health_checks::GetOperation {
3383 super::builder::health_checks::GetOperation::new(self.inner.clone())
3384 }
3385}
3386
3387/// Implements a client for the Google Compute Engine API.
3388///
3389/// # Example
3390/// ```
3391/// # async fn sample() -> gax::client_builder::Result<()> {
3392/// # use google_cloud_compute_v1::client::HttpHealthChecks;
3393/// let client = HttpHealthChecks::builder().build().await?;
3394/// // use `client` to make requests to the Google Compute Engine API.
3395/// # Ok(()) }
3396/// ```
3397///
3398/// # Service Description
3399///
3400/// Service for the `httpHealthChecks` resource.
3401///
3402/// # Configuration
3403///
3404/// To configure `HttpHealthChecks` use the `with_*` methods in the type returned
3405/// by [builder()][HttpHealthChecks::builder]. The default configuration should
3406/// work for most applications. Common configuration changes include
3407///
3408/// * [with_endpoint()]: by default this client uses the global default endpoint
3409/// (`https://compute.googleapis.com`). Applications using regional
3410/// endpoints or running in restricted networks (e.g. a network configured
3411// with [Private Google Access with VPC Service Controls]) may want to
3412/// override this default.
3413/// * [with_credentials()]: by default this client uses
3414/// [Application Default Credentials]. Applications using custom
3415/// authentication may need to override this default.
3416///
3417/// [with_endpoint()]: super::builder::http_health_checks::ClientBuilder::with_endpoint
3418/// [with_credentials()]: super::builder::http_health_checks::ClientBuilder::credentials
3419/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3420/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3421///
3422/// # Pooling and Cloning
3423///
3424/// `HttpHealthChecks` holds a connection pool internally, it is advised to
3425/// create one and the reuse it. You do not need to wrap `HttpHealthChecks` in
3426/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3427/// already uses an `Arc` internally.
3428#[cfg(feature = "http-health-checks")]
3429#[cfg_attr(docsrs, doc(cfg(feature = "http-health-checks")))]
3430#[derive(Clone, Debug)]
3431pub struct HttpHealthChecks {
3432 inner: std::sync::Arc<dyn super::stub::dynamic::HttpHealthChecks>,
3433}
3434
3435#[cfg(feature = "http-health-checks")]
3436impl HttpHealthChecks {
3437 /// Returns a builder for [HttpHealthChecks].
3438 ///
3439 /// ```
3440 /// # async fn sample() -> gax::client_builder::Result<()> {
3441 /// # use google_cloud_compute_v1::client::HttpHealthChecks;
3442 /// let client = HttpHealthChecks::builder().build().await?;
3443 /// # Ok(()) }
3444 /// ```
3445 pub fn builder() -> super::builder::http_health_checks::ClientBuilder {
3446 gax::client_builder::internal::new_builder(
3447 super::builder::http_health_checks::client::Factory,
3448 )
3449 }
3450
3451 /// Creates a new client from the provided stub.
3452 ///
3453 /// The most common case for calling this function is in tests mocking the
3454 /// client's behavior.
3455 pub fn from_stub<T>(stub: T) -> Self
3456 where
3457 T: super::stub::HttpHealthChecks + 'static,
3458 {
3459 Self {
3460 inner: std::sync::Arc::new(stub),
3461 }
3462 }
3463
3464 pub(crate) async fn new(
3465 config: gaxi::options::ClientConfig,
3466 ) -> gax::client_builder::Result<Self> {
3467 let inner = Self::build_inner(config).await?;
3468 Ok(Self { inner })
3469 }
3470
3471 async fn build_inner(
3472 conf: gaxi::options::ClientConfig,
3473 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::HttpHealthChecks>>
3474 {
3475 if gaxi::options::tracing_enabled(&conf) {
3476 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3477 }
3478 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3479 }
3480
3481 async fn build_transport(
3482 conf: gaxi::options::ClientConfig,
3483 ) -> gax::client_builder::Result<impl super::stub::HttpHealthChecks> {
3484 super::transport::HttpHealthChecks::new(conf).await
3485 }
3486
3487 async fn build_with_tracing(
3488 conf: gaxi::options::ClientConfig,
3489 ) -> gax::client_builder::Result<impl super::stub::HttpHealthChecks> {
3490 Self::build_transport(conf)
3491 .await
3492 .map(super::tracing::HttpHealthChecks::new)
3493 }
3494
3495 /// Deletes the specified HttpHealthCheck resource.
3496 pub fn delete(&self) -> super::builder::http_health_checks::Delete {
3497 super::builder::http_health_checks::Delete::new(self.inner.clone())
3498 }
3499
3500 /// Returns the specified HttpHealthCheck resource.
3501 pub fn get(&self) -> super::builder::http_health_checks::Get {
3502 super::builder::http_health_checks::Get::new(self.inner.clone())
3503 }
3504
3505 /// Creates a HttpHealthCheck resource in the specified project using the data
3506 /// included in the request.
3507 pub fn insert(&self) -> super::builder::http_health_checks::Insert {
3508 super::builder::http_health_checks::Insert::new(self.inner.clone())
3509 }
3510
3511 /// Retrieves the list of HttpHealthCheck resources available to the specified
3512 /// project.
3513 pub fn list(&self) -> super::builder::http_health_checks::List {
3514 super::builder::http_health_checks::List::new(self.inner.clone())
3515 }
3516
3517 /// Updates a HttpHealthCheck resource in the specified project using the data
3518 /// included in the request. This method supportsPATCH
3519 /// semantics and uses theJSON merge
3520 /// patch format and processing rules.
3521 pub fn patch(&self) -> super::builder::http_health_checks::Patch {
3522 super::builder::http_health_checks::Patch::new(self.inner.clone())
3523 }
3524
3525 /// Returns permissions that a caller has on the specified resource.
3526 pub fn test_iam_permissions(&self) -> super::builder::http_health_checks::TestIamPermissions {
3527 super::builder::http_health_checks::TestIamPermissions::new(self.inner.clone())
3528 }
3529
3530 /// Updates a HttpHealthCheck resource in the specified project using the data
3531 /// included in the request.
3532 pub fn update(&self) -> super::builder::http_health_checks::Update {
3533 super::builder::http_health_checks::Update::new(self.inner.clone())
3534 }
3535
3536 /// Retrieves the specified Operations resource.
3537 pub fn get_operation(&self) -> super::builder::http_health_checks::GetOperation {
3538 super::builder::http_health_checks::GetOperation::new(self.inner.clone())
3539 }
3540}
3541
3542/// Implements a client for the Google Compute Engine API.
3543///
3544/// # Example
3545/// ```
3546/// # async fn sample() -> gax::client_builder::Result<()> {
3547/// # use google_cloud_compute_v1::client::HttpsHealthChecks;
3548/// let client = HttpsHealthChecks::builder().build().await?;
3549/// // use `client` to make requests to the Google Compute Engine API.
3550/// # Ok(()) }
3551/// ```
3552///
3553/// # Service Description
3554///
3555/// Service for the `httpsHealthChecks` resource.
3556///
3557/// # Configuration
3558///
3559/// To configure `HttpsHealthChecks` use the `with_*` methods in the type returned
3560/// by [builder()][HttpsHealthChecks::builder]. The default configuration should
3561/// work for most applications. Common configuration changes include
3562///
3563/// * [with_endpoint()]: by default this client uses the global default endpoint
3564/// (`https://compute.googleapis.com`). Applications using regional
3565/// endpoints or running in restricted networks (e.g. a network configured
3566// with [Private Google Access with VPC Service Controls]) may want to
3567/// override this default.
3568/// * [with_credentials()]: by default this client uses
3569/// [Application Default Credentials]. Applications using custom
3570/// authentication may need to override this default.
3571///
3572/// [with_endpoint()]: super::builder::https_health_checks::ClientBuilder::with_endpoint
3573/// [with_credentials()]: super::builder::https_health_checks::ClientBuilder::credentials
3574/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3575/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3576///
3577/// # Pooling and Cloning
3578///
3579/// `HttpsHealthChecks` holds a connection pool internally, it is advised to
3580/// create one and the reuse it. You do not need to wrap `HttpsHealthChecks` in
3581/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3582/// already uses an `Arc` internally.
3583#[cfg(feature = "https-health-checks")]
3584#[cfg_attr(docsrs, doc(cfg(feature = "https-health-checks")))]
3585#[derive(Clone, Debug)]
3586pub struct HttpsHealthChecks {
3587 inner: std::sync::Arc<dyn super::stub::dynamic::HttpsHealthChecks>,
3588}
3589
3590#[cfg(feature = "https-health-checks")]
3591impl HttpsHealthChecks {
3592 /// Returns a builder for [HttpsHealthChecks].
3593 ///
3594 /// ```
3595 /// # async fn sample() -> gax::client_builder::Result<()> {
3596 /// # use google_cloud_compute_v1::client::HttpsHealthChecks;
3597 /// let client = HttpsHealthChecks::builder().build().await?;
3598 /// # Ok(()) }
3599 /// ```
3600 pub fn builder() -> super::builder::https_health_checks::ClientBuilder {
3601 gax::client_builder::internal::new_builder(
3602 super::builder::https_health_checks::client::Factory,
3603 )
3604 }
3605
3606 /// Creates a new client from the provided stub.
3607 ///
3608 /// The most common case for calling this function is in tests mocking the
3609 /// client's behavior.
3610 pub fn from_stub<T>(stub: T) -> Self
3611 where
3612 T: super::stub::HttpsHealthChecks + 'static,
3613 {
3614 Self {
3615 inner: std::sync::Arc::new(stub),
3616 }
3617 }
3618
3619 pub(crate) async fn new(
3620 config: gaxi::options::ClientConfig,
3621 ) -> gax::client_builder::Result<Self> {
3622 let inner = Self::build_inner(config).await?;
3623 Ok(Self { inner })
3624 }
3625
3626 async fn build_inner(
3627 conf: gaxi::options::ClientConfig,
3628 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::HttpsHealthChecks>>
3629 {
3630 if gaxi::options::tracing_enabled(&conf) {
3631 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3632 }
3633 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3634 }
3635
3636 async fn build_transport(
3637 conf: gaxi::options::ClientConfig,
3638 ) -> gax::client_builder::Result<impl super::stub::HttpsHealthChecks> {
3639 super::transport::HttpsHealthChecks::new(conf).await
3640 }
3641
3642 async fn build_with_tracing(
3643 conf: gaxi::options::ClientConfig,
3644 ) -> gax::client_builder::Result<impl super::stub::HttpsHealthChecks> {
3645 Self::build_transport(conf)
3646 .await
3647 .map(super::tracing::HttpsHealthChecks::new)
3648 }
3649
3650 /// Deletes the specified HttpsHealthCheck resource.
3651 pub fn delete(&self) -> super::builder::https_health_checks::Delete {
3652 super::builder::https_health_checks::Delete::new(self.inner.clone())
3653 }
3654
3655 /// Returns the specified HttpsHealthCheck resource.
3656 pub fn get(&self) -> super::builder::https_health_checks::Get {
3657 super::builder::https_health_checks::Get::new(self.inner.clone())
3658 }
3659
3660 /// Creates a HttpsHealthCheck resource in the specified project using the data
3661 /// included in the request.
3662 pub fn insert(&self) -> super::builder::https_health_checks::Insert {
3663 super::builder::https_health_checks::Insert::new(self.inner.clone())
3664 }
3665
3666 /// Retrieves the list of HttpsHealthCheck resources available to the specified
3667 /// project.
3668 pub fn list(&self) -> super::builder::https_health_checks::List {
3669 super::builder::https_health_checks::List::new(self.inner.clone())
3670 }
3671
3672 /// Updates a HttpsHealthCheck resource in the specified project using the data
3673 /// included in the request. This method supportsPATCH
3674 /// semantics and uses theJSON merge
3675 /// patch format and processing rules.
3676 pub fn patch(&self) -> super::builder::https_health_checks::Patch {
3677 super::builder::https_health_checks::Patch::new(self.inner.clone())
3678 }
3679
3680 /// Returns permissions that a caller has on the specified resource.
3681 pub fn test_iam_permissions(&self) -> super::builder::https_health_checks::TestIamPermissions {
3682 super::builder::https_health_checks::TestIamPermissions::new(self.inner.clone())
3683 }
3684
3685 /// Updates a HttpsHealthCheck resource in the specified project using the data
3686 /// included in the request.
3687 pub fn update(&self) -> super::builder::https_health_checks::Update {
3688 super::builder::https_health_checks::Update::new(self.inner.clone())
3689 }
3690
3691 /// Retrieves the specified Operations resource.
3692 pub fn get_operation(&self) -> super::builder::https_health_checks::GetOperation {
3693 super::builder::https_health_checks::GetOperation::new(self.inner.clone())
3694 }
3695}
3696
3697/// Implements a client for the Google Compute Engine API.
3698///
3699/// # Example
3700/// ```
3701/// # async fn sample() -> gax::client_builder::Result<()> {
3702/// # use google_cloud_compute_v1::client::ImageFamilyViews;
3703/// let client = ImageFamilyViews::builder().build().await?;
3704/// // use `client` to make requests to the Google Compute Engine API.
3705/// # Ok(()) }
3706/// ```
3707///
3708/// # Service Description
3709///
3710/// Service for the `imageFamilyViews` resource.
3711///
3712/// # Configuration
3713///
3714/// To configure `ImageFamilyViews` use the `with_*` methods in the type returned
3715/// by [builder()][ImageFamilyViews::builder]. The default configuration should
3716/// work for most applications. Common configuration changes include
3717///
3718/// * [with_endpoint()]: by default this client uses the global default endpoint
3719/// (`https://compute.googleapis.com`). Applications using regional
3720/// endpoints or running in restricted networks (e.g. a network configured
3721// with [Private Google Access with VPC Service Controls]) may want to
3722/// override this default.
3723/// * [with_credentials()]: by default this client uses
3724/// [Application Default Credentials]. Applications using custom
3725/// authentication may need to override this default.
3726///
3727/// [with_endpoint()]: super::builder::image_family_views::ClientBuilder::with_endpoint
3728/// [with_credentials()]: super::builder::image_family_views::ClientBuilder::credentials
3729/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3730/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3731///
3732/// # Pooling and Cloning
3733///
3734/// `ImageFamilyViews` holds a connection pool internally, it is advised to
3735/// create one and the reuse it. You do not need to wrap `ImageFamilyViews` in
3736/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3737/// already uses an `Arc` internally.
3738#[cfg(feature = "image-family-views")]
3739#[cfg_attr(docsrs, doc(cfg(feature = "image-family-views")))]
3740#[derive(Clone, Debug)]
3741pub struct ImageFamilyViews {
3742 inner: std::sync::Arc<dyn super::stub::dynamic::ImageFamilyViews>,
3743}
3744
3745#[cfg(feature = "image-family-views")]
3746impl ImageFamilyViews {
3747 /// Returns a builder for [ImageFamilyViews].
3748 ///
3749 /// ```
3750 /// # async fn sample() -> gax::client_builder::Result<()> {
3751 /// # use google_cloud_compute_v1::client::ImageFamilyViews;
3752 /// let client = ImageFamilyViews::builder().build().await?;
3753 /// # Ok(()) }
3754 /// ```
3755 pub fn builder() -> super::builder::image_family_views::ClientBuilder {
3756 gax::client_builder::internal::new_builder(
3757 super::builder::image_family_views::client::Factory,
3758 )
3759 }
3760
3761 /// Creates a new client from the provided stub.
3762 ///
3763 /// The most common case for calling this function is in tests mocking the
3764 /// client's behavior.
3765 pub fn from_stub<T>(stub: T) -> Self
3766 where
3767 T: super::stub::ImageFamilyViews + 'static,
3768 {
3769 Self {
3770 inner: std::sync::Arc::new(stub),
3771 }
3772 }
3773
3774 pub(crate) async fn new(
3775 config: gaxi::options::ClientConfig,
3776 ) -> gax::client_builder::Result<Self> {
3777 let inner = Self::build_inner(config).await?;
3778 Ok(Self { inner })
3779 }
3780
3781 async fn build_inner(
3782 conf: gaxi::options::ClientConfig,
3783 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::ImageFamilyViews>>
3784 {
3785 if gaxi::options::tracing_enabled(&conf) {
3786 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3787 }
3788 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3789 }
3790
3791 async fn build_transport(
3792 conf: gaxi::options::ClientConfig,
3793 ) -> gax::client_builder::Result<impl super::stub::ImageFamilyViews> {
3794 super::transport::ImageFamilyViews::new(conf).await
3795 }
3796
3797 async fn build_with_tracing(
3798 conf: gaxi::options::ClientConfig,
3799 ) -> gax::client_builder::Result<impl super::stub::ImageFamilyViews> {
3800 Self::build_transport(conf)
3801 .await
3802 .map(super::tracing::ImageFamilyViews::new)
3803 }
3804
3805 /// Returns the latest image that is part of an image family, is not
3806 /// deprecated and is rolled out in the specified zone.
3807 pub fn get(&self) -> super::builder::image_family_views::Get {
3808 super::builder::image_family_views::Get::new(self.inner.clone())
3809 }
3810}
3811
3812/// Implements a client for the Google Compute Engine API.
3813///
3814/// # Example
3815/// ```
3816/// # async fn sample() -> gax::client_builder::Result<()> {
3817/// # use google_cloud_compute_v1::client::Images;
3818/// let client = Images::builder().build().await?;
3819/// // use `client` to make requests to the Google Compute Engine API.
3820/// # Ok(()) }
3821/// ```
3822///
3823/// # Service Description
3824///
3825/// Service for the `images` resource.
3826///
3827/// # Configuration
3828///
3829/// To configure `Images` use the `with_*` methods in the type returned
3830/// by [builder()][Images::builder]. The default configuration should
3831/// work for most applications. Common configuration changes include
3832///
3833/// * [with_endpoint()]: by default this client uses the global default endpoint
3834/// (`https://compute.googleapis.com`). Applications using regional
3835/// endpoints or running in restricted networks (e.g. a network configured
3836// with [Private Google Access with VPC Service Controls]) may want to
3837/// override this default.
3838/// * [with_credentials()]: by default this client uses
3839/// [Application Default Credentials]. Applications using custom
3840/// authentication may need to override this default.
3841///
3842/// [with_endpoint()]: super::builder::images::ClientBuilder::with_endpoint
3843/// [with_credentials()]: super::builder::images::ClientBuilder::credentials
3844/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3845/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3846///
3847/// # Pooling and Cloning
3848///
3849/// `Images` holds a connection pool internally, it is advised to
3850/// create one and the reuse it. You do not need to wrap `Images` in
3851/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3852/// already uses an `Arc` internally.
3853#[cfg(feature = "images")]
3854#[cfg_attr(docsrs, doc(cfg(feature = "images")))]
3855#[derive(Clone, Debug)]
3856pub struct Images {
3857 inner: std::sync::Arc<dyn super::stub::dynamic::Images>,
3858}
3859
3860#[cfg(feature = "images")]
3861impl Images {
3862 /// Returns a builder for [Images].
3863 ///
3864 /// ```
3865 /// # async fn sample() -> gax::client_builder::Result<()> {
3866 /// # use google_cloud_compute_v1::client::Images;
3867 /// let client = Images::builder().build().await?;
3868 /// # Ok(()) }
3869 /// ```
3870 pub fn builder() -> super::builder::images::ClientBuilder {
3871 gax::client_builder::internal::new_builder(super::builder::images::client::Factory)
3872 }
3873
3874 /// Creates a new client from the provided stub.
3875 ///
3876 /// The most common case for calling this function is in tests mocking the
3877 /// client's behavior.
3878 pub fn from_stub<T>(stub: T) -> Self
3879 where
3880 T: super::stub::Images + 'static,
3881 {
3882 Self {
3883 inner: std::sync::Arc::new(stub),
3884 }
3885 }
3886
3887 pub(crate) async fn new(
3888 config: gaxi::options::ClientConfig,
3889 ) -> gax::client_builder::Result<Self> {
3890 let inner = Self::build_inner(config).await?;
3891 Ok(Self { inner })
3892 }
3893
3894 async fn build_inner(
3895 conf: gaxi::options::ClientConfig,
3896 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Images>> {
3897 if gaxi::options::tracing_enabled(&conf) {
3898 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3899 }
3900 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3901 }
3902
3903 async fn build_transport(
3904 conf: gaxi::options::ClientConfig,
3905 ) -> gax::client_builder::Result<impl super::stub::Images> {
3906 super::transport::Images::new(conf).await
3907 }
3908
3909 async fn build_with_tracing(
3910 conf: gaxi::options::ClientConfig,
3911 ) -> gax::client_builder::Result<impl super::stub::Images> {
3912 Self::build_transport(conf)
3913 .await
3914 .map(super::tracing::Images::new)
3915 }
3916
3917 /// Deletes the specified image.
3918 pub fn delete(&self) -> super::builder::images::Delete {
3919 super::builder::images::Delete::new(self.inner.clone())
3920 }
3921
3922 /// Sets the deprecation status of an image.
3923 ///
3924 /// If an empty request body is given, clears the deprecation status instead.
3925 pub fn deprecate(&self) -> super::builder::images::Deprecate {
3926 super::builder::images::Deprecate::new(self.inner.clone())
3927 }
3928
3929 /// Returns the specified image.
3930 pub fn get(&self) -> super::builder::images::Get {
3931 super::builder::images::Get::new(self.inner.clone())
3932 }
3933
3934 /// Returns the latest image that is part of an image family and is not
3935 /// deprecated. For more information on image families, seePublic
3936 /// image families documentation.
3937 pub fn get_from_family(&self) -> super::builder::images::GetFromFamily {
3938 super::builder::images::GetFromFamily::new(self.inner.clone())
3939 }
3940
3941 /// Gets the access control policy for a resource. May be empty if no such
3942 /// policy or resource exists.
3943 pub fn get_iam_policy(&self) -> super::builder::images::GetIamPolicy {
3944 super::builder::images::GetIamPolicy::new(self.inner.clone())
3945 }
3946
3947 /// Creates an image in the specified project using the data included
3948 /// in the request.
3949 pub fn insert(&self) -> super::builder::images::Insert {
3950 super::builder::images::Insert::new(self.inner.clone())
3951 }
3952
3953 /// Retrieves the list of custom images
3954 /// available to the specified project. Custom images are images you
3955 /// create that belong to your project. This method does not
3956 /// get any images that belong to other projects, including publicly-available
3957 /// images, like Debian 8. If you want to get a list of publicly-available
3958 /// images, use this method to make a request to the respective image project,
3959 /// such as debian-cloud or windows-cloud.
3960 pub fn list(&self) -> super::builder::images::List {
3961 super::builder::images::List::new(self.inner.clone())
3962 }
3963
3964 /// Patches the specified image with the data included in the request.
3965 /// Only the following fields can be modified: family, description,
3966 /// deprecation status.
3967 pub fn patch(&self) -> super::builder::images::Patch {
3968 super::builder::images::Patch::new(self.inner.clone())
3969 }
3970
3971 /// Sets the access control policy on the specified resource.
3972 /// Replaces any existing policy.
3973 pub fn set_iam_policy(&self) -> super::builder::images::SetIamPolicy {
3974 super::builder::images::SetIamPolicy::new(self.inner.clone())
3975 }
3976
3977 /// Sets the labels on an image. To learn more about labels, read theLabeling
3978 /// Resources documentation.
3979 pub fn set_labels(&self) -> super::builder::images::SetLabels {
3980 super::builder::images::SetLabels::new(self.inner.clone())
3981 }
3982
3983 /// Returns permissions that a caller has on the specified resource.
3984 pub fn test_iam_permissions(&self) -> super::builder::images::TestIamPermissions {
3985 super::builder::images::TestIamPermissions::new(self.inner.clone())
3986 }
3987
3988 /// Retrieves the specified Operations resource.
3989 pub fn get_operation(&self) -> super::builder::images::GetOperation {
3990 super::builder::images::GetOperation::new(self.inner.clone())
3991 }
3992}
3993
3994/// Implements a client for the Google Compute Engine API.
3995///
3996/// # Example
3997/// ```
3998/// # async fn sample() -> gax::client_builder::Result<()> {
3999/// # use google_cloud_compute_v1::client::InstanceGroupManagerResizeRequests;
4000/// let client = InstanceGroupManagerResizeRequests::builder().build().await?;
4001/// // use `client` to make requests to the Google Compute Engine API.
4002/// # Ok(()) }
4003/// ```
4004///
4005/// # Service Description
4006///
4007/// Service for the `instanceGroupManagerResizeRequests` resource.
4008///
4009/// # Configuration
4010///
4011/// To configure `InstanceGroupManagerResizeRequests` use the `with_*` methods in the type returned
4012/// by [builder()][InstanceGroupManagerResizeRequests::builder]. The default configuration should
4013/// work for most applications. Common configuration changes include
4014///
4015/// * [with_endpoint()]: by default this client uses the global default endpoint
4016/// (`https://compute.googleapis.com`). Applications using regional
4017/// endpoints or running in restricted networks (e.g. a network configured
4018// with [Private Google Access with VPC Service Controls]) may want to
4019/// override this default.
4020/// * [with_credentials()]: by default this client uses
4021/// [Application Default Credentials]. Applications using custom
4022/// authentication may need to override this default.
4023///
4024/// [with_endpoint()]: super::builder::instance_group_manager_resize_requests::ClientBuilder::with_endpoint
4025/// [with_credentials()]: super::builder::instance_group_manager_resize_requests::ClientBuilder::credentials
4026/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4027/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4028///
4029/// # Pooling and Cloning
4030///
4031/// `InstanceGroupManagerResizeRequests` holds a connection pool internally, it is advised to
4032/// create one and the reuse it. You do not need to wrap `InstanceGroupManagerResizeRequests` in
4033/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4034/// already uses an `Arc` internally.
4035#[cfg(feature = "instance-group-manager-resize-requests")]
4036#[cfg_attr(docsrs, doc(cfg(feature = "instance-group-manager-resize-requests")))]
4037#[derive(Clone, Debug)]
4038pub struct InstanceGroupManagerResizeRequests {
4039 inner: std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagerResizeRequests>,
4040}
4041
4042#[cfg(feature = "instance-group-manager-resize-requests")]
4043impl InstanceGroupManagerResizeRequests {
4044 /// Returns a builder for [InstanceGroupManagerResizeRequests].
4045 ///
4046 /// ```
4047 /// # async fn sample() -> gax::client_builder::Result<()> {
4048 /// # use google_cloud_compute_v1::client::InstanceGroupManagerResizeRequests;
4049 /// let client = InstanceGroupManagerResizeRequests::builder().build().await?;
4050 /// # Ok(()) }
4051 /// ```
4052 pub fn builder() -> super::builder::instance_group_manager_resize_requests::ClientBuilder {
4053 gax::client_builder::internal::new_builder(
4054 super::builder::instance_group_manager_resize_requests::client::Factory,
4055 )
4056 }
4057
4058 /// Creates a new client from the provided stub.
4059 ///
4060 /// The most common case for calling this function is in tests mocking the
4061 /// client's behavior.
4062 pub fn from_stub<T>(stub: T) -> Self
4063 where
4064 T: super::stub::InstanceGroupManagerResizeRequests + 'static,
4065 {
4066 Self {
4067 inner: std::sync::Arc::new(stub),
4068 }
4069 }
4070
4071 pub(crate) async fn new(
4072 config: gaxi::options::ClientConfig,
4073 ) -> gax::client_builder::Result<Self> {
4074 let inner = Self::build_inner(config).await?;
4075 Ok(Self { inner })
4076 }
4077
4078 async fn build_inner(
4079 conf: gaxi::options::ClientConfig,
4080 ) -> gax::client_builder::Result<
4081 std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagerResizeRequests>,
4082 > {
4083 if gaxi::options::tracing_enabled(&conf) {
4084 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4085 }
4086 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4087 }
4088
4089 async fn build_transport(
4090 conf: gaxi::options::ClientConfig,
4091 ) -> gax::client_builder::Result<impl super::stub::InstanceGroupManagerResizeRequests> {
4092 super::transport::InstanceGroupManagerResizeRequests::new(conf).await
4093 }
4094
4095 async fn build_with_tracing(
4096 conf: gaxi::options::ClientConfig,
4097 ) -> gax::client_builder::Result<impl super::stub::InstanceGroupManagerResizeRequests> {
4098 Self::build_transport(conf)
4099 .await
4100 .map(super::tracing::InstanceGroupManagerResizeRequests::new)
4101 }
4102
4103 /// Cancels the specified resize request and removes it from the queue.
4104 /// Cancelled resize request does no longer wait for the resources to be
4105 /// provisioned. Cancel is only possible for requests that are accepted in the
4106 /// queue.
4107 pub fn cancel(&self) -> super::builder::instance_group_manager_resize_requests::Cancel {
4108 super::builder::instance_group_manager_resize_requests::Cancel::new(self.inner.clone())
4109 }
4110
4111 /// Deletes the specified, inactive resize request. Requests that are still
4112 /// active cannot be deleted. Deleting request does not delete instances that
4113 /// were provisioned previously.
4114 pub fn delete(&self) -> super::builder::instance_group_manager_resize_requests::Delete {
4115 super::builder::instance_group_manager_resize_requests::Delete::new(self.inner.clone())
4116 }
4117
4118 /// Returns all of the details about the specified resize request.
4119 pub fn get(&self) -> super::builder::instance_group_manager_resize_requests::Get {
4120 super::builder::instance_group_manager_resize_requests::Get::new(self.inner.clone())
4121 }
4122
4123 /// Creates a new resize request that starts provisioning VMs immediately
4124 /// or queues VM creation.
4125 pub fn insert(&self) -> super::builder::instance_group_manager_resize_requests::Insert {
4126 super::builder::instance_group_manager_resize_requests::Insert::new(self.inner.clone())
4127 }
4128
4129 /// Retrieves a list of resize requests that are contained in the
4130 /// managed instance group.
4131 pub fn list(&self) -> super::builder::instance_group_manager_resize_requests::List {
4132 super::builder::instance_group_manager_resize_requests::List::new(self.inner.clone())
4133 }
4134
4135 /// Retrieves the specified zone-specific Operations resource.
4136 pub fn get_operation(
4137 &self,
4138 ) -> super::builder::instance_group_manager_resize_requests::GetOperation {
4139 super::builder::instance_group_manager_resize_requests::GetOperation::new(
4140 self.inner.clone(),
4141 )
4142 }
4143}
4144
4145/// Implements a client for the Google Compute Engine API.
4146///
4147/// # Example
4148/// ```
4149/// # async fn sample() -> gax::client_builder::Result<()> {
4150/// # use google_cloud_compute_v1::client::InstanceGroupManagers;
4151/// let client = InstanceGroupManagers::builder().build().await?;
4152/// // use `client` to make requests to the Google Compute Engine API.
4153/// # Ok(()) }
4154/// ```
4155///
4156/// # Service Description
4157///
4158/// Service for the `instanceGroupManagers` resource.
4159///
4160/// # Configuration
4161///
4162/// To configure `InstanceGroupManagers` use the `with_*` methods in the type returned
4163/// by [builder()][InstanceGroupManagers::builder]. The default configuration should
4164/// work for most applications. Common configuration changes include
4165///
4166/// * [with_endpoint()]: by default this client uses the global default endpoint
4167/// (`https://compute.googleapis.com`). Applications using regional
4168/// endpoints or running in restricted networks (e.g. a network configured
4169// with [Private Google Access with VPC Service Controls]) may want to
4170/// override this default.
4171/// * [with_credentials()]: by default this client uses
4172/// [Application Default Credentials]. Applications using custom
4173/// authentication may need to override this default.
4174///
4175/// [with_endpoint()]: super::builder::instance_group_managers::ClientBuilder::with_endpoint
4176/// [with_credentials()]: super::builder::instance_group_managers::ClientBuilder::credentials
4177/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4178/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4179///
4180/// # Pooling and Cloning
4181///
4182/// `InstanceGroupManagers` holds a connection pool internally, it is advised to
4183/// create one and the reuse it. You do not need to wrap `InstanceGroupManagers` in
4184/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4185/// already uses an `Arc` internally.
4186#[cfg(feature = "instance-group-managers")]
4187#[cfg_attr(docsrs, doc(cfg(feature = "instance-group-managers")))]
4188#[derive(Clone, Debug)]
4189pub struct InstanceGroupManagers {
4190 inner: std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagers>,
4191}
4192
4193#[cfg(feature = "instance-group-managers")]
4194impl InstanceGroupManagers {
4195 /// Returns a builder for [InstanceGroupManagers].
4196 ///
4197 /// ```
4198 /// # async fn sample() -> gax::client_builder::Result<()> {
4199 /// # use google_cloud_compute_v1::client::InstanceGroupManagers;
4200 /// let client = InstanceGroupManagers::builder().build().await?;
4201 /// # Ok(()) }
4202 /// ```
4203 pub fn builder() -> super::builder::instance_group_managers::ClientBuilder {
4204 gax::client_builder::internal::new_builder(
4205 super::builder::instance_group_managers::client::Factory,
4206 )
4207 }
4208
4209 /// Creates a new client from the provided stub.
4210 ///
4211 /// The most common case for calling this function is in tests mocking the
4212 /// client's behavior.
4213 pub fn from_stub<T>(stub: T) -> Self
4214 where
4215 T: super::stub::InstanceGroupManagers + 'static,
4216 {
4217 Self {
4218 inner: std::sync::Arc::new(stub),
4219 }
4220 }
4221
4222 pub(crate) async fn new(
4223 config: gaxi::options::ClientConfig,
4224 ) -> gax::client_builder::Result<Self> {
4225 let inner = Self::build_inner(config).await?;
4226 Ok(Self { inner })
4227 }
4228
4229 async fn build_inner(
4230 conf: gaxi::options::ClientConfig,
4231 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagers>>
4232 {
4233 if gaxi::options::tracing_enabled(&conf) {
4234 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4235 }
4236 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4237 }
4238
4239 async fn build_transport(
4240 conf: gaxi::options::ClientConfig,
4241 ) -> gax::client_builder::Result<impl super::stub::InstanceGroupManagers> {
4242 super::transport::InstanceGroupManagers::new(conf).await
4243 }
4244
4245 async fn build_with_tracing(
4246 conf: gaxi::options::ClientConfig,
4247 ) -> gax::client_builder::Result<impl super::stub::InstanceGroupManagers> {
4248 Self::build_transport(conf)
4249 .await
4250 .map(super::tracing::InstanceGroupManagers::new)
4251 }
4252
4253 /// Flags the specified instances to be removed from the
4254 /// managed instance group. Abandoning an instance does not delete the
4255 /// instance, but it does remove the instance from any target pools that are
4256 /// applied by the managed instance group. This method reduces thetargetSize of the managed instance group by the
4257 /// number of instances that you abandon. This operation is marked asDONE when the action is scheduled even if the instances have
4258 /// not yet been removed from the group. You must separately verify the
4259 /// status of the abandoning action with thelistmanagedinstances
4260 /// method.
4261 ///
4262 /// If the group is part of a backend
4263 /// service that has enabled
4264 /// connection draining, it can take up to 60 seconds after the connection
4265 /// draining duration has elapsed before the VM instance is removed or deleted.
4266 ///
4267 /// You can specify a maximum of 1000 instances with this method per request.
4268 pub fn abandon_instances(&self) -> super::builder::instance_group_managers::AbandonInstances {
4269 super::builder::instance_group_managers::AbandonInstances::new(self.inner.clone())
4270 }
4271
4272 /// Retrieves the list of managed instance groups and groups them by zone.
4273 ///
4274 /// To prevent failure, Google recommends that you set the
4275 /// `returnPartialSuccess` parameter to `true`.
4276 pub fn aggregated_list(&self) -> super::builder::instance_group_managers::AggregatedList {
4277 super::builder::instance_group_managers::AggregatedList::new(self.inner.clone())
4278 }
4279
4280 /// Applies changes to selected instances on the managed instance group.
4281 /// This method can be used to apply new overrides and/or new versions.
4282 pub fn apply_updates_to_instances(
4283 &self,
4284 ) -> super::builder::instance_group_managers::ApplyUpdatesToInstances {
4285 super::builder::instance_group_managers::ApplyUpdatesToInstances::new(self.inner.clone())
4286 }
4287
4288 /// Creates instances with per-instance configurations in this managed instance
4289 /// group. Instances are created using the current instance template. Thecreate instances operation is marked DONE if thecreateInstances request is successful. The underlying actions
4290 /// take additional time. You must separately verify the status of thecreating or actions with the listmanagedinstances
4291 /// method.
4292 pub fn create_instances(&self) -> super::builder::instance_group_managers::CreateInstances {
4293 super::builder::instance_group_managers::CreateInstances::new(self.inner.clone())
4294 }
4295
4296 /// Deletes the specified managed instance group and all of the instances
4297 /// in that group. Note that the instance group must not belong to a
4298 /// backend service. Read
4299 /// Deleting an instance group for more information.
4300 pub fn delete(&self) -> super::builder::instance_group_managers::Delete {
4301 super::builder::instance_group_managers::Delete::new(self.inner.clone())
4302 }
4303
4304 /// Flags the specified instances in the managed instance group for immediate
4305 /// deletion. The instances are also removed from any target
4306 /// pools of which they were a member. This method reduces thetargetSize of the managed instance group by the number of
4307 /// instances that you delete. This operation is marked as DONE
4308 /// when the action is scheduled even if the instances are still being deleted.
4309 /// You must separately verify the status of the deleting action
4310 /// with thelistmanagedinstances
4311 /// method.
4312 ///
4313 /// If the group is part of a backend
4314 /// service that has enabled
4315 /// connection draining, it can take up to 60 seconds after the connection
4316 /// draining duration has elapsed before the VM instance is removed or deleted.
4317 ///
4318 /// You can specify a maximum of 1000 instances with this method per request.
4319 pub fn delete_instances(&self) -> super::builder::instance_group_managers::DeleteInstances {
4320 super::builder::instance_group_managers::DeleteInstances::new(self.inner.clone())
4321 }
4322
4323 /// Deletes selected per-instance configurations for the managed instance
4324 /// group.
4325 pub fn delete_per_instance_configs(
4326 &self,
4327 ) -> super::builder::instance_group_managers::DeletePerInstanceConfigs {
4328 super::builder::instance_group_managers::DeletePerInstanceConfigs::new(self.inner.clone())
4329 }
4330
4331 /// Returns all of the details about the specified managed instance group.
4332 pub fn get(&self) -> super::builder::instance_group_managers::Get {
4333 super::builder::instance_group_managers::Get::new(self.inner.clone())
4334 }
4335
4336 /// Creates a managed instance group using the information that you specify
4337 /// in the request. After the group is created, instances in the group are
4338 /// created using the specified instance template.
4339 /// This operation is marked as DONE when the group is created
4340 /// even if the instances in the group have not yet been created. You
4341 /// must separately verify the status of the individual instances with thelistmanagedinstances
4342 /// method.
4343 ///
4344 /// A managed instance group can have up to 1000 VM instances per group. Please
4345 /// contact Cloud Support if you need an increase in
4346 /// this limit.
4347 pub fn insert(&self) -> super::builder::instance_group_managers::Insert {
4348 super::builder::instance_group_managers::Insert::new(self.inner.clone())
4349 }
4350
4351 /// Retrieves a list of managed instance groups that are contained within the
4352 /// specified project and zone.
4353 pub fn list(&self) -> super::builder::instance_group_managers::List {
4354 super::builder::instance_group_managers::List::new(self.inner.clone())
4355 }
4356
4357 /// Lists all errors thrown by actions on instances for a given managed
4358 /// instance group. The filter and orderBy query
4359 /// parameters are not supported.
4360 pub fn list_errors(&self) -> super::builder::instance_group_managers::ListErrors {
4361 super::builder::instance_group_managers::ListErrors::new(self.inner.clone())
4362 }
4363
4364 /// Lists all of the instances in the managed instance group. Each instance
4365 /// in the list has a currentAction, which indicates the action
4366 /// that the managed instance group is performing on the instance. For example,
4367 /// if the group is still creating an instance, the currentAction
4368 /// is CREATING. If a previous action failed, the
4369 /// list displays the errors for that failed action. The orderBy
4370 /// query parameter is not supported. The `pageToken` query parameter is
4371 /// supported only if the group's `listManagedInstancesResults` field is set
4372 /// to `PAGINATED`.
4373 pub fn list_managed_instances(
4374 &self,
4375 ) -> super::builder::instance_group_managers::ListManagedInstances {
4376 super::builder::instance_group_managers::ListManagedInstances::new(self.inner.clone())
4377 }
4378
4379 /// Lists all of the per-instance configurations defined for the managed
4380 /// instance group. The orderBy query parameter is not supported.
4381 pub fn list_per_instance_configs(
4382 &self,
4383 ) -> super::builder::instance_group_managers::ListPerInstanceConfigs {
4384 super::builder::instance_group_managers::ListPerInstanceConfigs::new(self.inner.clone())
4385 }
4386
4387 /// Updates a managed instance group using the information that you specify
4388 /// in the request.
4389 /// This operation is marked as DONE when the group is patched
4390 /// even if the instances in the group are still in the process of being
4391 /// patched. You must separately verify the status of the individual instances
4392 /// with thelistManagedInstances
4393 /// method. This method supportsPATCH
4394 /// semantics and uses theJSON merge
4395 /// patch format and processing rules.
4396 ///
4397 /// If you update your group to specify a new template or instance
4398 /// configuration, it's possible that your intended specification for each VM
4399 /// in the group is different from the current state of that VM. To learn how
4400 /// to apply an updated configuration to the VMs in a MIG, seeUpdating instances in
4401 /// a MIG.
4402 pub fn patch(&self) -> super::builder::instance_group_managers::Patch {
4403 super::builder::instance_group_managers::Patch::new(self.inner.clone())
4404 }
4405
4406 /// Inserts or patches per-instance configurations for the managed instance
4407 /// group. perInstanceConfig.name serves as a key used to
4408 /// distinguish whether to perform insert or patch.
4409 pub fn patch_per_instance_configs(
4410 &self,
4411 ) -> super::builder::instance_group_managers::PatchPerInstanceConfigs {
4412 super::builder::instance_group_managers::PatchPerInstanceConfigs::new(self.inner.clone())
4413 }
4414
4415 /// Flags the specified VM instances in the managed instance group to be
4416 /// immediately recreated. Each instance is recreated using the group's current
4417 /// configuration. This operation is marked as DONE when the flag
4418 /// is set even if the instances have not yet been recreated. You must
4419 /// separately verify the status of each instance by checking itscurrentAction field; for more information, see Checking
4420 /// the status of managed instances.
4421 ///
4422 /// If the group is part of a backend
4423 /// service that has enabled
4424 /// connection draining, it can take up to 60 seconds after the connection
4425 /// draining duration has elapsed before the VM instance is removed or deleted.
4426 ///
4427 /// You can specify a maximum of 1000 instances with this method per request.
4428 pub fn recreate_instances(&self) -> super::builder::instance_group_managers::RecreateInstances {
4429 super::builder::instance_group_managers::RecreateInstances::new(self.inner.clone())
4430 }
4431
4432 /// Resizes the managed instance group. If you increase the size, the group
4433 /// creates new instances using the current instance template. If you decrease
4434 /// the size, the group deletes instances. The resize operation is markedDONE when the resize actions are scheduled even if the group
4435 /// has not yet added or deleted any instances. You must separately
4436 /// verify the status of the creating or deleting
4437 /// actions with thelistmanagedinstances
4438 /// method.
4439 ///
4440 /// When resizing down, the instance group arbitrarily chooses the order in
4441 /// which VMs are deleted. The group takes into account some VM attributes when
4442 /// making the selection including:
4443 ///
4444 /// + The status of the VM instance.
4445 /// + The health of the VM instance.
4446 /// + The instance template version the VM is based on.
4447 /// + For regional managed instance groups, the location of the VM instance.
4448 ///
4449 /// This list is subject to change.
4450 ///
4451 /// If the group is part of a backend
4452 /// service that has enabled
4453 /// connection draining, it can take up to 60 seconds after the connection
4454 /// draining duration has elapsed before the VM instance is removed or deleted.
4455 pub fn resize(&self) -> super::builder::instance_group_managers::Resize {
4456 super::builder::instance_group_managers::Resize::new(self.inner.clone())
4457 }
4458
4459 /// Flags the specified instances in the managed instance group to be
4460 /// resumed. This method increases thetargetSize and decreases the targetSuspendedSize
4461 /// of the managed instance group by the number of instances that you resume.
4462 /// The resumeInstances operation is marked DONE if
4463 /// the resumeInstances request is successful. The underlying
4464 /// actions take additional time. You must separately verify the status of theRESUMING action with thelistmanagedinstances
4465 /// method.
4466 ///
4467 /// In this request, you can only specify instances that are suspended. For
4468 /// example, if an instance was previously suspended using the suspendInstances
4469 /// method, it can be resumed using the resumeInstances method.
4470 ///
4471 /// If a health check is attached to the managed instance group, the specified
4472 /// instances will be verified as healthy after they are resumed.
4473 ///
4474 /// You can specify a maximum of 1000 instances with this method per request.
4475 pub fn resume_instances(&self) -> super::builder::instance_group_managers::ResumeInstances {
4476 super::builder::instance_group_managers::ResumeInstances::new(self.inner.clone())
4477 }
4478
4479 /// Specifies the instance template to use when creating new instances in this
4480 /// group. The templates for existing instances in the group do not change
4481 /// unless you run recreateInstances, runapplyUpdatesToInstances, or set the group'supdatePolicy.type to PROACTIVE.
4482 pub fn set_instance_template(
4483 &self,
4484 ) -> super::builder::instance_group_managers::SetInstanceTemplate {
4485 super::builder::instance_group_managers::SetInstanceTemplate::new(self.inner.clone())
4486 }
4487
4488 /// Modifies the target pools to which all instances in this managed instance
4489 /// group are assigned. The target pools automatically apply to all of the
4490 /// instances in the managed instance group. This operation is markedDONE when you make the request even if the instances have not
4491 /// yet been added to their target pools. The change might take some time to
4492 /// apply to all of the instances in the group depending on the size of the
4493 /// group.
4494 pub fn set_target_pools(&self) -> super::builder::instance_group_managers::SetTargetPools {
4495 super::builder::instance_group_managers::SetTargetPools::new(self.inner.clone())
4496 }
4497
4498 /// Flags the specified instances in the managed instance group to be
4499 /// started. This method increases thetargetSize and decreases the targetStoppedSize
4500 /// of the managed instance group by the number of instances that you start.
4501 /// The startInstances operation is marked DONE if
4502 /// the startInstances request is successful. The underlying
4503 /// actions take additional time. You must separately verify the status of theSTARTING action with thelistmanagedinstances
4504 /// method.
4505 ///
4506 /// In this request, you can only specify instances that are stopped. For
4507 /// example, if an instance was previously stopped using the stopInstances
4508 /// method, it can be started using the startInstances method.
4509 ///
4510 /// If a health check is attached to the managed instance group, the specified
4511 /// instances will be verified as healthy after they are started.
4512 ///
4513 /// You can specify a maximum of 1000 instances with this method per request.
4514 pub fn start_instances(&self) -> super::builder::instance_group_managers::StartInstances {
4515 super::builder::instance_group_managers::StartInstances::new(self.inner.clone())
4516 }
4517
4518 /// Flags the specified instances in the managed instance group to be
4519 /// immediately stopped. You can only specify instances that are running in
4520 /// this request. This method reduces thetargetSize and increases the targetStoppedSize
4521 /// of the managed instance group by the number of instances that you stop.
4522 /// The stopInstances operation is marked DONE if
4523 /// the stopInstances request is successful. The underlying
4524 /// actions take additional time. You must separately verify the status of theSTOPPING action with thelistmanagedinstances
4525 /// method.
4526 ///
4527 /// If the standbyPolicy.initialDelaySec field is set, the group
4528 /// delays stopping the instances until initialDelaySec have
4529 /// passed from instance.creationTimestamp (that is, when the
4530 /// instance was created). This delay gives your application time to
4531 /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
4532 /// will be zero delay.
4533 ///
4534 /// If the group is part of a backend
4535 /// service that has enabled
4536 /// connection draining, it can take up to 60 seconds after the connection
4537 /// draining duration has elapsed before the VM instance is stopped.
4538 ///
4539 /// Stopped instances can be started using the startInstances
4540 /// method.
4541 ///
4542 /// You can specify a maximum of 1000 instances with this method per request.
4543 pub fn stop_instances(&self) -> super::builder::instance_group_managers::StopInstances {
4544 super::builder::instance_group_managers::StopInstances::new(self.inner.clone())
4545 }
4546
4547 /// Flags the specified instances in the managed instance group to be
4548 /// immediately suspended. You can only specify instances that are running in
4549 /// this request. This method reduces thetargetSize and increases the targetSuspendedSize
4550 /// of the managed instance group by the number of instances that you suspend.
4551 /// The suspendInstances operation is marked DONE if
4552 /// the suspendInstances request is successful. The underlying
4553 /// actions take additional time. You must separately verify the status of theSUSPENDING action with thelistmanagedinstances
4554 /// method.
4555 ///
4556 /// If the standbyPolicy.initialDelaySec field is set, the group
4557 /// delays suspension of the instances until initialDelaySec have
4558 /// passed from instance.creationTimestamp (that is, when the
4559 /// instance was created). This delay gives your application time to
4560 /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
4561 /// will be zero delay.
4562 ///
4563 /// If the group is part of a backend
4564 /// service that has enabled
4565 /// connection draining, it can take up to 60 seconds after the connection
4566 /// draining duration has elapsed before the VM instance is suspended.
4567 ///
4568 /// Suspended instances can be resumed using the resumeInstances
4569 /// method.
4570 ///
4571 /// You can specify a maximum of 1000 instances with this method per request.
4572 pub fn suspend_instances(&self) -> super::builder::instance_group_managers::SuspendInstances {
4573 super::builder::instance_group_managers::SuspendInstances::new(self.inner.clone())
4574 }
4575
4576 /// Inserts or updates per-instance configurations for the managed instance
4577 /// group. perInstanceConfig.name serves as a key used to
4578 /// distinguish whether to perform insert or patch.
4579 pub fn update_per_instance_configs(
4580 &self,
4581 ) -> super::builder::instance_group_managers::UpdatePerInstanceConfigs {
4582 super::builder::instance_group_managers::UpdatePerInstanceConfigs::new(self.inner.clone())
4583 }
4584
4585 /// Retrieves the specified zone-specific Operations resource.
4586 pub fn get_operation(&self) -> super::builder::instance_group_managers::GetOperation {
4587 super::builder::instance_group_managers::GetOperation::new(self.inner.clone())
4588 }
4589}
4590
4591/// Implements a client for the Google Compute Engine API.
4592///
4593/// # Example
4594/// ```
4595/// # async fn sample() -> gax::client_builder::Result<()> {
4596/// # use google_cloud_compute_v1::client::InstanceGroups;
4597/// let client = InstanceGroups::builder().build().await?;
4598/// // use `client` to make requests to the Google Compute Engine API.
4599/// # Ok(()) }
4600/// ```
4601///
4602/// # Service Description
4603///
4604/// Service for the `instanceGroups` resource.
4605///
4606/// # Configuration
4607///
4608/// To configure `InstanceGroups` use the `with_*` methods in the type returned
4609/// by [builder()][InstanceGroups::builder]. The default configuration should
4610/// work for most applications. Common configuration changes include
4611///
4612/// * [with_endpoint()]: by default this client uses the global default endpoint
4613/// (`https://compute.googleapis.com`). Applications using regional
4614/// endpoints or running in restricted networks (e.g. a network configured
4615// with [Private Google Access with VPC Service Controls]) may want to
4616/// override this default.
4617/// * [with_credentials()]: by default this client uses
4618/// [Application Default Credentials]. Applications using custom
4619/// authentication may need to override this default.
4620///
4621/// [with_endpoint()]: super::builder::instance_groups::ClientBuilder::with_endpoint
4622/// [with_credentials()]: super::builder::instance_groups::ClientBuilder::credentials
4623/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4624/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4625///
4626/// # Pooling and Cloning
4627///
4628/// `InstanceGroups` holds a connection pool internally, it is advised to
4629/// create one and the reuse it. You do not need to wrap `InstanceGroups` in
4630/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4631/// already uses an `Arc` internally.
4632#[cfg(feature = "instance-groups")]
4633#[cfg_attr(docsrs, doc(cfg(feature = "instance-groups")))]
4634#[derive(Clone, Debug)]
4635pub struct InstanceGroups {
4636 inner: std::sync::Arc<dyn super::stub::dynamic::InstanceGroups>,
4637}
4638
4639#[cfg(feature = "instance-groups")]
4640impl InstanceGroups {
4641 /// Returns a builder for [InstanceGroups].
4642 ///
4643 /// ```
4644 /// # async fn sample() -> gax::client_builder::Result<()> {
4645 /// # use google_cloud_compute_v1::client::InstanceGroups;
4646 /// let client = InstanceGroups::builder().build().await?;
4647 /// # Ok(()) }
4648 /// ```
4649 pub fn builder() -> super::builder::instance_groups::ClientBuilder {
4650 gax::client_builder::internal::new_builder(super::builder::instance_groups::client::Factory)
4651 }
4652
4653 /// Creates a new client from the provided stub.
4654 ///
4655 /// The most common case for calling this function is in tests mocking the
4656 /// client's behavior.
4657 pub fn from_stub<T>(stub: T) -> Self
4658 where
4659 T: super::stub::InstanceGroups + 'static,
4660 {
4661 Self {
4662 inner: std::sync::Arc::new(stub),
4663 }
4664 }
4665
4666 pub(crate) async fn new(
4667 config: gaxi::options::ClientConfig,
4668 ) -> gax::client_builder::Result<Self> {
4669 let inner = Self::build_inner(config).await?;
4670 Ok(Self { inner })
4671 }
4672
4673 async fn build_inner(
4674 conf: gaxi::options::ClientConfig,
4675 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::InstanceGroups>> {
4676 if gaxi::options::tracing_enabled(&conf) {
4677 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4678 }
4679 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4680 }
4681
4682 async fn build_transport(
4683 conf: gaxi::options::ClientConfig,
4684 ) -> gax::client_builder::Result<impl super::stub::InstanceGroups> {
4685 super::transport::InstanceGroups::new(conf).await
4686 }
4687
4688 async fn build_with_tracing(
4689 conf: gaxi::options::ClientConfig,
4690 ) -> gax::client_builder::Result<impl super::stub::InstanceGroups> {
4691 Self::build_transport(conf)
4692 .await
4693 .map(super::tracing::InstanceGroups::new)
4694 }
4695
4696 /// Adds a list of instances to the specified instance group. All of the
4697 /// instances in the instance group must be in the same network/subnetwork.
4698 /// Read
4699 /// Adding instances for more information.
4700 pub fn add_instances(&self) -> super::builder::instance_groups::AddInstances {
4701 super::builder::instance_groups::AddInstances::new(self.inner.clone())
4702 }
4703
4704 /// Retrieves the list of instance groups and sorts them by zone.
4705 ///
4706 /// To prevent failure, Google recommends that you set the
4707 /// `returnPartialSuccess` parameter to `true`.
4708 pub fn aggregated_list(&self) -> super::builder::instance_groups::AggregatedList {
4709 super::builder::instance_groups::AggregatedList::new(self.inner.clone())
4710 }
4711
4712 /// Deletes the specified instance group. The instances in the group are not
4713 /// deleted. Note that instance group must not belong to a backend service.
4714 /// Read
4715 /// Deleting an instance group for more information.
4716 pub fn delete(&self) -> super::builder::instance_groups::Delete {
4717 super::builder::instance_groups::Delete::new(self.inner.clone())
4718 }
4719
4720 /// Returns the specified zonal instance group. Get a list of available zonal
4721 /// instance groups by making a list() request.
4722 ///
4723 /// For managed instance groups, use theinstanceGroupManagers
4724 /// or regionInstanceGroupManagers
4725 /// methods instead.
4726 pub fn get(&self) -> super::builder::instance_groups::Get {
4727 super::builder::instance_groups::Get::new(self.inner.clone())
4728 }
4729
4730 /// Creates an instance group in the specified project using the
4731 /// parameters that are included in the request.
4732 pub fn insert(&self) -> super::builder::instance_groups::Insert {
4733 super::builder::instance_groups::Insert::new(self.inner.clone())
4734 }
4735
4736 /// Retrieves the list of zonal instance group resources contained within the
4737 /// specified zone.
4738 ///
4739 /// For managed instance groups, use theinstanceGroupManagers
4740 /// or regionInstanceGroupManagers
4741 /// methods instead.
4742 pub fn list(&self) -> super::builder::instance_groups::List {
4743 super::builder::instance_groups::List::new(self.inner.clone())
4744 }
4745
4746 /// Lists the instances in the specified instance group.
4747 /// The orderBy query parameter is not supported.
4748 /// The filter query parameter is supported, but only for
4749 /// expressions that use `eq` (equal) or `ne` (not equal) operators.
4750 pub fn list_instances(&self) -> super::builder::instance_groups::ListInstances {
4751 super::builder::instance_groups::ListInstances::new(self.inner.clone())
4752 }
4753
4754 /// Removes one or more instances from the specified instance group, but does
4755 /// not delete those instances.
4756 ///
4757 /// If the group is part of a backend
4758 /// service that has enabled
4759 /// connection draining, it can take up to 60 seconds after the connection
4760 /// draining duration before the VM instance is removed or deleted.
4761 pub fn remove_instances(&self) -> super::builder::instance_groups::RemoveInstances {
4762 super::builder::instance_groups::RemoveInstances::new(self.inner.clone())
4763 }
4764
4765 /// Sets the named ports for the specified instance group.
4766 pub fn set_named_ports(&self) -> super::builder::instance_groups::SetNamedPorts {
4767 super::builder::instance_groups::SetNamedPorts::new(self.inner.clone())
4768 }
4769
4770 /// Returns permissions that a caller has on the specified resource.
4771 pub fn test_iam_permissions(&self) -> super::builder::instance_groups::TestIamPermissions {
4772 super::builder::instance_groups::TestIamPermissions::new(self.inner.clone())
4773 }
4774
4775 /// Retrieves the specified zone-specific Operations resource.
4776 pub fn get_operation(&self) -> super::builder::instance_groups::GetOperation {
4777 super::builder::instance_groups::GetOperation::new(self.inner.clone())
4778 }
4779}
4780
4781/// Implements a client for the Google Compute Engine API.
4782///
4783/// # Example
4784/// ```
4785/// # async fn sample() -> gax::client_builder::Result<()> {
4786/// # use google_cloud_compute_v1::client::InstanceSettings;
4787/// let client = InstanceSettings::builder().build().await?;
4788/// // use `client` to make requests to the Google Compute Engine API.
4789/// # Ok(()) }
4790/// ```
4791///
4792/// # Service Description
4793///
4794/// Service for the `instanceSettings` resource.
4795///
4796/// # Configuration
4797///
4798/// To configure `InstanceSettings` use the `with_*` methods in the type returned
4799/// by [builder()][InstanceSettings::builder]. The default configuration should
4800/// work for most applications. Common configuration changes include
4801///
4802/// * [with_endpoint()]: by default this client uses the global default endpoint
4803/// (`https://compute.googleapis.com`). Applications using regional
4804/// endpoints or running in restricted networks (e.g. a network configured
4805// with [Private Google Access with VPC Service Controls]) may want to
4806/// override this default.
4807/// * [with_credentials()]: by default this client uses
4808/// [Application Default Credentials]. Applications using custom
4809/// authentication may need to override this default.
4810///
4811/// [with_endpoint()]: super::builder::instance_settings::ClientBuilder::with_endpoint
4812/// [with_credentials()]: super::builder::instance_settings::ClientBuilder::credentials
4813/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4814/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4815///
4816/// # Pooling and Cloning
4817///
4818/// `InstanceSettings` holds a connection pool internally, it is advised to
4819/// create one and the reuse it. You do not need to wrap `InstanceSettings` in
4820/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4821/// already uses an `Arc` internally.
4822#[cfg(feature = "instance-settings")]
4823#[cfg_attr(docsrs, doc(cfg(feature = "instance-settings")))]
4824#[derive(Clone, Debug)]
4825pub struct InstanceSettings {
4826 inner: std::sync::Arc<dyn super::stub::dynamic::InstanceSettings>,
4827}
4828
4829#[cfg(feature = "instance-settings")]
4830impl InstanceSettings {
4831 /// Returns a builder for [InstanceSettings].
4832 ///
4833 /// ```
4834 /// # async fn sample() -> gax::client_builder::Result<()> {
4835 /// # use google_cloud_compute_v1::client::InstanceSettings;
4836 /// let client = InstanceSettings::builder().build().await?;
4837 /// # Ok(()) }
4838 /// ```
4839 pub fn builder() -> super::builder::instance_settings::ClientBuilder {
4840 gax::client_builder::internal::new_builder(
4841 super::builder::instance_settings::client::Factory,
4842 )
4843 }
4844
4845 /// Creates a new client from the provided stub.
4846 ///
4847 /// The most common case for calling this function is in tests mocking the
4848 /// client's behavior.
4849 pub fn from_stub<T>(stub: T) -> Self
4850 where
4851 T: super::stub::InstanceSettings + 'static,
4852 {
4853 Self {
4854 inner: std::sync::Arc::new(stub),
4855 }
4856 }
4857
4858 pub(crate) async fn new(
4859 config: gaxi::options::ClientConfig,
4860 ) -> gax::client_builder::Result<Self> {
4861 let inner = Self::build_inner(config).await?;
4862 Ok(Self { inner })
4863 }
4864
4865 async fn build_inner(
4866 conf: gaxi::options::ClientConfig,
4867 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::InstanceSettings>>
4868 {
4869 if gaxi::options::tracing_enabled(&conf) {
4870 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4871 }
4872 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4873 }
4874
4875 async fn build_transport(
4876 conf: gaxi::options::ClientConfig,
4877 ) -> gax::client_builder::Result<impl super::stub::InstanceSettings> {
4878 super::transport::InstanceSettings::new(conf).await
4879 }
4880
4881 async fn build_with_tracing(
4882 conf: gaxi::options::ClientConfig,
4883 ) -> gax::client_builder::Result<impl super::stub::InstanceSettings> {
4884 Self::build_transport(conf)
4885 .await
4886 .map(super::tracing::InstanceSettings::new)
4887 }
4888
4889 /// Get Instance settings.
4890 pub fn get(&self) -> super::builder::instance_settings::Get {
4891 super::builder::instance_settings::Get::new(self.inner.clone())
4892 }
4893
4894 /// Patch Instance settings
4895 pub fn patch(&self) -> super::builder::instance_settings::Patch {
4896 super::builder::instance_settings::Patch::new(self.inner.clone())
4897 }
4898
4899 /// Retrieves the specified zone-specific Operations resource.
4900 pub fn get_operation(&self) -> super::builder::instance_settings::GetOperation {
4901 super::builder::instance_settings::GetOperation::new(self.inner.clone())
4902 }
4903}
4904
4905/// Implements a client for the Google Compute Engine API.
4906///
4907/// # Example
4908/// ```
4909/// # async fn sample() -> gax::client_builder::Result<()> {
4910/// # use google_cloud_compute_v1::client::InstanceTemplates;
4911/// let client = InstanceTemplates::builder().build().await?;
4912/// // use `client` to make requests to the Google Compute Engine API.
4913/// # Ok(()) }
4914/// ```
4915///
4916/// # Service Description
4917///
4918/// Service for the `instanceTemplates` resource.
4919///
4920/// # Configuration
4921///
4922/// To configure `InstanceTemplates` use the `with_*` methods in the type returned
4923/// by [builder()][InstanceTemplates::builder]. The default configuration should
4924/// work for most applications. Common configuration changes include
4925///
4926/// * [with_endpoint()]: by default this client uses the global default endpoint
4927/// (`https://compute.googleapis.com`). Applications using regional
4928/// endpoints or running in restricted networks (e.g. a network configured
4929// with [Private Google Access with VPC Service Controls]) may want to
4930/// override this default.
4931/// * [with_credentials()]: by default this client uses
4932/// [Application Default Credentials]. Applications using custom
4933/// authentication may need to override this default.
4934///
4935/// [with_endpoint()]: super::builder::instance_templates::ClientBuilder::with_endpoint
4936/// [with_credentials()]: super::builder::instance_templates::ClientBuilder::credentials
4937/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4938/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4939///
4940/// # Pooling and Cloning
4941///
4942/// `InstanceTemplates` holds a connection pool internally, it is advised to
4943/// create one and the reuse it. You do not need to wrap `InstanceTemplates` in
4944/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4945/// already uses an `Arc` internally.
4946#[cfg(feature = "instance-templates")]
4947#[cfg_attr(docsrs, doc(cfg(feature = "instance-templates")))]
4948#[derive(Clone, Debug)]
4949pub struct InstanceTemplates {
4950 inner: std::sync::Arc<dyn super::stub::dynamic::InstanceTemplates>,
4951}
4952
4953#[cfg(feature = "instance-templates")]
4954impl InstanceTemplates {
4955 /// Returns a builder for [InstanceTemplates].
4956 ///
4957 /// ```
4958 /// # async fn sample() -> gax::client_builder::Result<()> {
4959 /// # use google_cloud_compute_v1::client::InstanceTemplates;
4960 /// let client = InstanceTemplates::builder().build().await?;
4961 /// # Ok(()) }
4962 /// ```
4963 pub fn builder() -> super::builder::instance_templates::ClientBuilder {
4964 gax::client_builder::internal::new_builder(
4965 super::builder::instance_templates::client::Factory,
4966 )
4967 }
4968
4969 /// Creates a new client from the provided stub.
4970 ///
4971 /// The most common case for calling this function is in tests mocking the
4972 /// client's behavior.
4973 pub fn from_stub<T>(stub: T) -> Self
4974 where
4975 T: super::stub::InstanceTemplates + 'static,
4976 {
4977 Self {
4978 inner: std::sync::Arc::new(stub),
4979 }
4980 }
4981
4982 pub(crate) async fn new(
4983 config: gaxi::options::ClientConfig,
4984 ) -> gax::client_builder::Result<Self> {
4985 let inner = Self::build_inner(config).await?;
4986 Ok(Self { inner })
4987 }
4988
4989 async fn build_inner(
4990 conf: gaxi::options::ClientConfig,
4991 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::InstanceTemplates>>
4992 {
4993 if gaxi::options::tracing_enabled(&conf) {
4994 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4995 }
4996 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4997 }
4998
4999 async fn build_transport(
5000 conf: gaxi::options::ClientConfig,
5001 ) -> gax::client_builder::Result<impl super::stub::InstanceTemplates> {
5002 super::transport::InstanceTemplates::new(conf).await
5003 }
5004
5005 async fn build_with_tracing(
5006 conf: gaxi::options::ClientConfig,
5007 ) -> gax::client_builder::Result<impl super::stub::InstanceTemplates> {
5008 Self::build_transport(conf)
5009 .await
5010 .map(super::tracing::InstanceTemplates::new)
5011 }
5012
5013 /// Retrieves the list of all InstanceTemplates resources, regional and global,
5014 /// available to the specified project.
5015 ///
5016 /// To prevent failure, Google recommends that you set the
5017 /// `returnPartialSuccess` parameter to `true`.
5018 pub fn aggregated_list(&self) -> super::builder::instance_templates::AggregatedList {
5019 super::builder::instance_templates::AggregatedList::new(self.inner.clone())
5020 }
5021
5022 /// Deletes the specified instance template. Deleting an instance template is
5023 /// permanent and cannot be undone. It is not possible to delete templates
5024 /// that are already in use by a managed instance group.
5025 pub fn delete(&self) -> super::builder::instance_templates::Delete {
5026 super::builder::instance_templates::Delete::new(self.inner.clone())
5027 }
5028
5029 /// Returns the specified instance template.
5030 pub fn get(&self) -> super::builder::instance_templates::Get {
5031 super::builder::instance_templates::Get::new(self.inner.clone())
5032 }
5033
5034 /// Gets the access control policy for a resource. May be empty if no such
5035 /// policy or resource exists.
5036 pub fn get_iam_policy(&self) -> super::builder::instance_templates::GetIamPolicy {
5037 super::builder::instance_templates::GetIamPolicy::new(self.inner.clone())
5038 }
5039
5040 /// Creates an instance template in the specified project using the
5041 /// data that is included in the request. If you are creating a new template to
5042 /// update an existing instance group, your new instance template must use the
5043 /// same network or, if applicable, the same subnetwork as the original
5044 /// template.
5045 pub fn insert(&self) -> super::builder::instance_templates::Insert {
5046 super::builder::instance_templates::Insert::new(self.inner.clone())
5047 }
5048
5049 /// Retrieves a list of instance templates that are contained within
5050 /// the specified project.
5051 pub fn list(&self) -> super::builder::instance_templates::List {
5052 super::builder::instance_templates::List::new(self.inner.clone())
5053 }
5054
5055 /// Sets the access control policy on the specified resource.
5056 /// Replaces any existing policy.
5057 pub fn set_iam_policy(&self) -> super::builder::instance_templates::SetIamPolicy {
5058 super::builder::instance_templates::SetIamPolicy::new(self.inner.clone())
5059 }
5060
5061 /// Returns permissions that a caller has on the specified resource.
5062 pub fn test_iam_permissions(&self) -> super::builder::instance_templates::TestIamPermissions {
5063 super::builder::instance_templates::TestIamPermissions::new(self.inner.clone())
5064 }
5065
5066 /// Retrieves the specified Operations resource.
5067 pub fn get_operation(&self) -> super::builder::instance_templates::GetOperation {
5068 super::builder::instance_templates::GetOperation::new(self.inner.clone())
5069 }
5070}
5071
5072/// Implements a client for the Google Compute Engine API.
5073///
5074/// # Example
5075/// ```
5076/// # async fn sample() -> gax::client_builder::Result<()> {
5077/// # use google_cloud_compute_v1::client::Instances;
5078/// let client = Instances::builder().build().await?;
5079/// // use `client` to make requests to the Google Compute Engine API.
5080/// # Ok(()) }
5081/// ```
5082///
5083/// # Service Description
5084///
5085/// Service for the `instances` resource.
5086///
5087/// # Configuration
5088///
5089/// To configure `Instances` use the `with_*` methods in the type returned
5090/// by [builder()][Instances::builder]. The default configuration should
5091/// work for most applications. Common configuration changes include
5092///
5093/// * [with_endpoint()]: by default this client uses the global default endpoint
5094/// (`https://compute.googleapis.com`). Applications using regional
5095/// endpoints or running in restricted networks (e.g. a network configured
5096// with [Private Google Access with VPC Service Controls]) may want to
5097/// override this default.
5098/// * [with_credentials()]: by default this client uses
5099/// [Application Default Credentials]. Applications using custom
5100/// authentication may need to override this default.
5101///
5102/// [with_endpoint()]: super::builder::instances::ClientBuilder::with_endpoint
5103/// [with_credentials()]: super::builder::instances::ClientBuilder::credentials
5104/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5105/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5106///
5107/// # Pooling and Cloning
5108///
5109/// `Instances` holds a connection pool internally, it is advised to
5110/// create one and the reuse it. You do not need to wrap `Instances` in
5111/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5112/// already uses an `Arc` internally.
5113#[cfg(feature = "instances")]
5114#[cfg_attr(docsrs, doc(cfg(feature = "instances")))]
5115#[derive(Clone, Debug)]
5116pub struct Instances {
5117 inner: std::sync::Arc<dyn super::stub::dynamic::Instances>,
5118}
5119
5120#[cfg(feature = "instances")]
5121impl Instances {
5122 /// Returns a builder for [Instances].
5123 ///
5124 /// ```
5125 /// # async fn sample() -> gax::client_builder::Result<()> {
5126 /// # use google_cloud_compute_v1::client::Instances;
5127 /// let client = Instances::builder().build().await?;
5128 /// # Ok(()) }
5129 /// ```
5130 pub fn builder() -> super::builder::instances::ClientBuilder {
5131 gax::client_builder::internal::new_builder(super::builder::instances::client::Factory)
5132 }
5133
5134 /// Creates a new client from the provided stub.
5135 ///
5136 /// The most common case for calling this function is in tests mocking the
5137 /// client's behavior.
5138 pub fn from_stub<T>(stub: T) -> Self
5139 where
5140 T: super::stub::Instances + 'static,
5141 {
5142 Self {
5143 inner: std::sync::Arc::new(stub),
5144 }
5145 }
5146
5147 pub(crate) async fn new(
5148 config: gaxi::options::ClientConfig,
5149 ) -> gax::client_builder::Result<Self> {
5150 let inner = Self::build_inner(config).await?;
5151 Ok(Self { inner })
5152 }
5153
5154 async fn build_inner(
5155 conf: gaxi::options::ClientConfig,
5156 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Instances>> {
5157 if gaxi::options::tracing_enabled(&conf) {
5158 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5159 }
5160 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5161 }
5162
5163 async fn build_transport(
5164 conf: gaxi::options::ClientConfig,
5165 ) -> gax::client_builder::Result<impl super::stub::Instances> {
5166 super::transport::Instances::new(conf).await
5167 }
5168
5169 async fn build_with_tracing(
5170 conf: gaxi::options::ClientConfig,
5171 ) -> gax::client_builder::Result<impl super::stub::Instances> {
5172 Self::build_transport(conf)
5173 .await
5174 .map(super::tracing::Instances::new)
5175 }
5176
5177 /// Adds an access config to an instance's network interface.
5178 pub fn add_access_config(&self) -> super::builder::instances::AddAccessConfig {
5179 super::builder::instances::AddAccessConfig::new(self.inner.clone())
5180 }
5181
5182 /// Adds one dynamic network interface to an active instance.
5183 pub fn add_network_interface(&self) -> super::builder::instances::AddNetworkInterface {
5184 super::builder::instances::AddNetworkInterface::new(self.inner.clone())
5185 }
5186
5187 /// Adds existing resource policies to an instance. You can only add one
5188 /// policy right now which will be applied to this instance for scheduling live
5189 /// migrations.
5190 pub fn add_resource_policies(&self) -> super::builder::instances::AddResourcePolicies {
5191 super::builder::instances::AddResourcePolicies::new(self.inner.clone())
5192 }
5193
5194 /// Retrieves an aggregated list of all of the instances in your project
5195 /// across all regions and zones.
5196 ///
5197 /// The performance of this method degrades when a filter is specified on a
5198 /// project that has a very large number of instances.
5199 ///
5200 /// To prevent failure, Google recommends that you set the
5201 /// `returnPartialSuccess` parameter to `true`.
5202 pub fn aggregated_list(&self) -> super::builder::instances::AggregatedList {
5203 super::builder::instances::AggregatedList::new(self.inner.clone())
5204 }
5205
5206 /// Attaches an existing Disk resource to an instance. You must first
5207 /// create the disk before you can attach it. It is not possible to create
5208 /// and attach a disk at the same time. For more information, readAdding a
5209 /// persistent disk to your instance.
5210 pub fn attach_disk(&self) -> super::builder::instances::AttachDisk {
5211 super::builder::instances::AttachDisk::new(self.inner.clone())
5212 }
5213
5214 /// Creates multiple instances. Count specifies the number of instances to
5215 /// create. For more information, seeAbout bulk
5216 /// creation of VMs.
5217 pub fn bulk_insert(&self) -> super::builder::instances::BulkInsert {
5218 super::builder::instances::BulkInsert::new(self.inner.clone())
5219 }
5220
5221 /// Deletes the specified Instance resource. For more information, seeDeleting
5222 /// an instance.
5223 pub fn delete(&self) -> super::builder::instances::Delete {
5224 super::builder::instances::Delete::new(self.inner.clone())
5225 }
5226
5227 /// Deletes an access config from an instance's network interface.
5228 pub fn delete_access_config(&self) -> super::builder::instances::DeleteAccessConfig {
5229 super::builder::instances::DeleteAccessConfig::new(self.inner.clone())
5230 }
5231
5232 /// Deletes one dynamic network interface from an active instance.
5233 /// InstancesDeleteNetworkInterfaceRequest indicates:
5234 ///
5235 /// - instance from which to delete, using project+zone+resource_id fields;
5236 /// - dynamic network interface to be deleted, using network_interface_name
5237 /// field;
5238 pub fn delete_network_interface(&self) -> super::builder::instances::DeleteNetworkInterface {
5239 super::builder::instances::DeleteNetworkInterface::new(self.inner.clone())
5240 }
5241
5242 /// Detaches a disk from an instance.
5243 pub fn detach_disk(&self) -> super::builder::instances::DetachDisk {
5244 super::builder::instances::DetachDisk::new(self.inner.clone())
5245 }
5246
5247 /// Returns the specified Instance resource.
5248 pub fn get(&self) -> super::builder::instances::Get {
5249 super::builder::instances::Get::new(self.inner.clone())
5250 }
5251
5252 /// Returns effective firewalls applied to an interface of the instance.
5253 pub fn get_effective_firewalls(&self) -> super::builder::instances::GetEffectiveFirewalls {
5254 super::builder::instances::GetEffectiveFirewalls::new(self.inner.clone())
5255 }
5256
5257 /// Returns the specified guest attributes entry.
5258 pub fn get_guest_attributes(&self) -> super::builder::instances::GetGuestAttributes {
5259 super::builder::instances::GetGuestAttributes::new(self.inner.clone())
5260 }
5261
5262 /// Gets the access control policy for a resource. May be empty if no such
5263 /// policy or resource exists.
5264 pub fn get_iam_policy(&self) -> super::builder::instances::GetIamPolicy {
5265 super::builder::instances::GetIamPolicy::new(self.inner.clone())
5266 }
5267
5268 /// Returns the screenshot from the specified instance.
5269 pub fn get_screenshot(&self) -> super::builder::instances::GetScreenshot {
5270 super::builder::instances::GetScreenshot::new(self.inner.clone())
5271 }
5272
5273 /// Returns the last 1 MB of serial port output from the specified instance.
5274 pub fn get_serial_port_output(&self) -> super::builder::instances::GetSerialPortOutput {
5275 super::builder::instances::GetSerialPortOutput::new(self.inner.clone())
5276 }
5277
5278 /// Returns the Shielded Instance Identity of an instance
5279 pub fn get_shielded_instance_identity(
5280 &self,
5281 ) -> super::builder::instances::GetShieldedInstanceIdentity {
5282 super::builder::instances::GetShieldedInstanceIdentity::new(self.inner.clone())
5283 }
5284
5285 /// Creates an instance resource in the specified project using the data
5286 /// included in the request.
5287 pub fn insert(&self) -> super::builder::instances::Insert {
5288 super::builder::instances::Insert::new(self.inner.clone())
5289 }
5290
5291 /// Retrieves the list of instances contained within
5292 /// the specified zone.
5293 pub fn list(&self) -> super::builder::instances::List {
5294 super::builder::instances::List::new(self.inner.clone())
5295 }
5296
5297 /// Retrieves a list of resources that refer to the VM instance specified in
5298 /// the request. For example, if the VM instance is part of a managed or
5299 /// unmanaged instance group, the referrers list includes the instance group.
5300 /// For more information, readViewing
5301 /// referrers to VM instances.
5302 pub fn list_referrers(&self) -> super::builder::instances::ListReferrers {
5303 super::builder::instances::ListReferrers::new(self.inner.clone())
5304 }
5305
5306 /// Perform a manual maintenance on the instance.
5307 pub fn perform_maintenance(&self) -> super::builder::instances::PerformMaintenance {
5308 super::builder::instances::PerformMaintenance::new(self.inner.clone())
5309 }
5310
5311 /// Removes resource policies from an instance.
5312 pub fn remove_resource_policies(&self) -> super::builder::instances::RemoveResourcePolicies {
5313 super::builder::instances::RemoveResourcePolicies::new(self.inner.clone())
5314 }
5315
5316 /// Mark the host as faulty and try to restart the instance on a new host.
5317 pub fn report_host_as_faulty(&self) -> super::builder::instances::ReportHostAsFaulty {
5318 super::builder::instances::ReportHostAsFaulty::new(self.inner.clone())
5319 }
5320
5321 /// Performs a reset on the instance. This is a hard reset. The VM
5322 /// does not do a graceful shutdown. For more information, seeResetting
5323 /// an instance.
5324 pub fn reset(&self) -> super::builder::instances::Reset {
5325 super::builder::instances::Reset::new(self.inner.clone())
5326 }
5327
5328 /// Resumes an instance that was suspended using theinstances().suspend
5329 /// method.
5330 pub fn resume(&self) -> super::builder::instances::Resume {
5331 super::builder::instances::Resume::new(self.inner.clone())
5332 }
5333
5334 /// Sends diagnostic interrupt to the instance.
5335 pub fn send_diagnostic_interrupt(&self) -> super::builder::instances::SendDiagnosticInterrupt {
5336 super::builder::instances::SendDiagnosticInterrupt::new(self.inner.clone())
5337 }
5338
5339 /// Sets deletion protection on the instance.
5340 pub fn set_deletion_protection(&self) -> super::builder::instances::SetDeletionProtection {
5341 super::builder::instances::SetDeletionProtection::new(self.inner.clone())
5342 }
5343
5344 /// Sets the auto-delete flag for a disk attached to an instance.
5345 pub fn set_disk_auto_delete(&self) -> super::builder::instances::SetDiskAutoDelete {
5346 super::builder::instances::SetDiskAutoDelete::new(self.inner.clone())
5347 }
5348
5349 /// Sets the access control policy on the specified resource.
5350 /// Replaces any existing policy.
5351 pub fn set_iam_policy(&self) -> super::builder::instances::SetIamPolicy {
5352 super::builder::instances::SetIamPolicy::new(self.inner.clone())
5353 }
5354
5355 /// Sets labels on an instance. To learn more about labels, read theLabeling
5356 /// Resources documentation.
5357 pub fn set_labels(&self) -> super::builder::instances::SetLabels {
5358 super::builder::instances::SetLabels::new(self.inner.clone())
5359 }
5360
5361 /// Changes the number and/or type of accelerator for a stopped instance to the
5362 /// values specified in the request.
5363 pub fn set_machine_resources(&self) -> super::builder::instances::SetMachineResources {
5364 super::builder::instances::SetMachineResources::new(self.inner.clone())
5365 }
5366
5367 /// Changes the machine type for a stopped instance to the machine
5368 /// type specified in the request.
5369 pub fn set_machine_type(&self) -> super::builder::instances::SetMachineType {
5370 super::builder::instances::SetMachineType::new(self.inner.clone())
5371 }
5372
5373 /// Sets metadata for the specified instance to the data included
5374 /// in the request.
5375 pub fn set_metadata(&self) -> super::builder::instances::SetMetadata {
5376 super::builder::instances::SetMetadata::new(self.inner.clone())
5377 }
5378
5379 /// Changes the minimum CPU platform that this instance should use.
5380 /// This method can only
5381 /// be called on a stopped instance. For more information, readSpecifying a
5382 /// Minimum CPU Platform.
5383 pub fn set_min_cpu_platform(&self) -> super::builder::instances::SetMinCpuPlatform {
5384 super::builder::instances::SetMinCpuPlatform::new(self.inner.clone())
5385 }
5386
5387 /// Sets name of an instance.
5388 pub fn set_name(&self) -> super::builder::instances::SetName {
5389 super::builder::instances::SetName::new(self.inner.clone())
5390 }
5391
5392 /// Sets an instance's scheduling options. You can only call this method on astopped instance,
5393 /// that is, a VM instance that is in a `TERMINATED` state. SeeInstance Life
5394 /// Cycle for more information on the possible instance states.
5395 /// For more information about setting scheduling options for a VM, seeSet
5396 /// VM host maintenance policy.
5397 pub fn set_scheduling(&self) -> super::builder::instances::SetScheduling {
5398 super::builder::instances::SetScheduling::new(self.inner.clone())
5399 }
5400
5401 /// Sets the Google Cloud Armor security policy for the specified instance.
5402 /// For more information, seeGoogle
5403 /// Cloud Armor Overview
5404 pub fn set_security_policy(&self) -> super::builder::instances::SetSecurityPolicy {
5405 super::builder::instances::SetSecurityPolicy::new(self.inner.clone())
5406 }
5407
5408 /// Sets the service account on the instance. For more information,
5409 /// readChanging
5410 /// the service account and access scopes for an instance.
5411 pub fn set_service_account(&self) -> super::builder::instances::SetServiceAccount {
5412 super::builder::instances::SetServiceAccount::new(self.inner.clone())
5413 }
5414
5415 /// Sets the Shielded Instance integrity policy for an instance. You can
5416 /// only use this method on a running instance. This method
5417 /// supports PATCH semantics and uses the JSON merge
5418 /// patch format and processing rules.
5419 pub fn set_shielded_instance_integrity_policy(
5420 &self,
5421 ) -> super::builder::instances::SetShieldedInstanceIntegrityPolicy {
5422 super::builder::instances::SetShieldedInstanceIntegrityPolicy::new(self.inner.clone())
5423 }
5424
5425 /// Sets network tags
5426 /// for the specified instance to the data included in the request.
5427 pub fn set_tags(&self) -> super::builder::instances::SetTags {
5428 super::builder::instances::SetTags::new(self.inner.clone())
5429 }
5430
5431 /// Simulates a host maintenance event on a VM. For more information, see
5432 /// Simulate a host maintenance event.
5433 pub fn simulate_maintenance_event(
5434 &self,
5435 ) -> super::builder::instances::SimulateMaintenanceEvent {
5436 super::builder::instances::SimulateMaintenanceEvent::new(self.inner.clone())
5437 }
5438
5439 /// Starts an instance that was stopped using theinstances().stop
5440 /// method. For more information, seeRestart an
5441 /// instance.
5442 pub fn start(&self) -> super::builder::instances::Start {
5443 super::builder::instances::Start::new(self.inner.clone())
5444 }
5445
5446 /// Starts an instance that was stopped using theinstances().stop
5447 /// method. For more information, seeRestart an
5448 /// instance.
5449 pub fn start_with_encryption_key(&self) -> super::builder::instances::StartWithEncryptionKey {
5450 super::builder::instances::StartWithEncryptionKey::new(self.inner.clone())
5451 }
5452
5453 /// Stops a running instance, shutting it down cleanly, and allows
5454 /// you to restart the instance at a later time. Stopped instances do not incur
5455 /// VM usage charges while they are stopped. However, resources that the VM is
5456 /// using, such as persistent disks and static IP addresses, will continue to
5457 /// be charged until they are deleted. For more information, seeStopping
5458 /// an instance.
5459 pub fn stop(&self) -> super::builder::instances::Stop {
5460 super::builder::instances::Stop::new(self.inner.clone())
5461 }
5462
5463 /// This method suspends a running instance, saving its state to persistent
5464 /// storage, and allows you to resume the instance at a later time. Suspended
5465 /// instances have no compute costs (cores or RAM), and incur only storage
5466 /// charges for the saved VM memory and localSSD data. Any charged resources
5467 /// the virtual machine was using, such as persistent disks and static IP
5468 /// addresses, will continue to be charged while the instance is suspended.
5469 /// For more information, see
5470 /// Suspending and resuming an instance.
5471 pub fn suspend(&self) -> super::builder::instances::Suspend {
5472 super::builder::instances::Suspend::new(self.inner.clone())
5473 }
5474
5475 /// Returns permissions that a caller has on the specified resource.
5476 pub fn test_iam_permissions(&self) -> super::builder::instances::TestIamPermissions {
5477 super::builder::instances::TestIamPermissions::new(self.inner.clone())
5478 }
5479
5480 /// Updates an instance only if the necessary resources are available. This
5481 /// method can update only a specific set of instance properties. See
5482 /// Updating a running instance for a list of updatable instance
5483 /// properties.
5484 pub fn update(&self) -> super::builder::instances::Update {
5485 super::builder::instances::Update::new(self.inner.clone())
5486 }
5487
5488 /// Updates the specified access config from an instance's network interface
5489 /// with the data included in the request. This method supportsPATCH
5490 /// semantics and uses theJSON merge
5491 /// patch format and processing rules.
5492 pub fn update_access_config(&self) -> super::builder::instances::UpdateAccessConfig {
5493 super::builder::instances::UpdateAccessConfig::new(self.inner.clone())
5494 }
5495
5496 /// Updates the Display config for a VM instance. You can
5497 /// only use this method on a stopped VM instance. This method supportsPATCH
5498 /// semantics and uses theJSON merge
5499 /// patch format and processing rules.
5500 pub fn update_display_device(&self) -> super::builder::instances::UpdateDisplayDevice {
5501 super::builder::instances::UpdateDisplayDevice::new(self.inner.clone())
5502 }
5503
5504 /// Updates an instance's network interface. This method can only update an
5505 /// interface's alias IP range and attached network. See Modifying
5506 /// alias IP ranges for an existing instance for instructions on
5507 /// changing alias IP ranges. See Migrating
5508 /// a VM between networks for instructions on migrating an interface.
5509 /// This method follows PATCH semantics.
5510 pub fn update_network_interface(&self) -> super::builder::instances::UpdateNetworkInterface {
5511 super::builder::instances::UpdateNetworkInterface::new(self.inner.clone())
5512 }
5513
5514 /// Updates the Shielded Instance config for an instance. You can
5515 /// only use this method on a stopped instance. This method supportsPATCH
5516 /// semantics and uses theJSON merge
5517 /// patch format and processing rules.
5518 pub fn update_shielded_instance_config(
5519 &self,
5520 ) -> super::builder::instances::UpdateShieldedInstanceConfig {
5521 super::builder::instances::UpdateShieldedInstanceConfig::new(self.inner.clone())
5522 }
5523
5524 /// Retrieves the specified zone-specific Operations resource.
5525 pub fn get_operation(&self) -> super::builder::instances::GetOperation {
5526 super::builder::instances::GetOperation::new(self.inner.clone())
5527 }
5528}
5529
5530/// Implements a client for the Google Compute Engine API.
5531///
5532/// # Example
5533/// ```
5534/// # async fn sample() -> gax::client_builder::Result<()> {
5535/// # use google_cloud_compute_v1::client::InstantSnapshots;
5536/// let client = InstantSnapshots::builder().build().await?;
5537/// // use `client` to make requests to the Google Compute Engine API.
5538/// # Ok(()) }
5539/// ```
5540///
5541/// # Service Description
5542///
5543/// Service for the `instantSnapshots` resource.
5544///
5545/// # Configuration
5546///
5547/// To configure `InstantSnapshots` use the `with_*` methods in the type returned
5548/// by [builder()][InstantSnapshots::builder]. The default configuration should
5549/// work for most applications. Common configuration changes include
5550///
5551/// * [with_endpoint()]: by default this client uses the global default endpoint
5552/// (`https://compute.googleapis.com`). Applications using regional
5553/// endpoints or running in restricted networks (e.g. a network configured
5554// with [Private Google Access with VPC Service Controls]) may want to
5555/// override this default.
5556/// * [with_credentials()]: by default this client uses
5557/// [Application Default Credentials]. Applications using custom
5558/// authentication may need to override this default.
5559///
5560/// [with_endpoint()]: super::builder::instant_snapshots::ClientBuilder::with_endpoint
5561/// [with_credentials()]: super::builder::instant_snapshots::ClientBuilder::credentials
5562/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5563/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5564///
5565/// # Pooling and Cloning
5566///
5567/// `InstantSnapshots` holds a connection pool internally, it is advised to
5568/// create one and the reuse it. You do not need to wrap `InstantSnapshots` in
5569/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5570/// already uses an `Arc` internally.
5571#[cfg(feature = "instant-snapshots")]
5572#[cfg_attr(docsrs, doc(cfg(feature = "instant-snapshots")))]
5573#[derive(Clone, Debug)]
5574pub struct InstantSnapshots {
5575 inner: std::sync::Arc<dyn super::stub::dynamic::InstantSnapshots>,
5576}
5577
5578#[cfg(feature = "instant-snapshots")]
5579impl InstantSnapshots {
5580 /// Returns a builder for [InstantSnapshots].
5581 ///
5582 /// ```
5583 /// # async fn sample() -> gax::client_builder::Result<()> {
5584 /// # use google_cloud_compute_v1::client::InstantSnapshots;
5585 /// let client = InstantSnapshots::builder().build().await?;
5586 /// # Ok(()) }
5587 /// ```
5588 pub fn builder() -> super::builder::instant_snapshots::ClientBuilder {
5589 gax::client_builder::internal::new_builder(
5590 super::builder::instant_snapshots::client::Factory,
5591 )
5592 }
5593
5594 /// Creates a new client from the provided stub.
5595 ///
5596 /// The most common case for calling this function is in tests mocking the
5597 /// client's behavior.
5598 pub fn from_stub<T>(stub: T) -> Self
5599 where
5600 T: super::stub::InstantSnapshots + 'static,
5601 {
5602 Self {
5603 inner: std::sync::Arc::new(stub),
5604 }
5605 }
5606
5607 pub(crate) async fn new(
5608 config: gaxi::options::ClientConfig,
5609 ) -> gax::client_builder::Result<Self> {
5610 let inner = Self::build_inner(config).await?;
5611 Ok(Self { inner })
5612 }
5613
5614 async fn build_inner(
5615 conf: gaxi::options::ClientConfig,
5616 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::InstantSnapshots>>
5617 {
5618 if gaxi::options::tracing_enabled(&conf) {
5619 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5620 }
5621 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5622 }
5623
5624 async fn build_transport(
5625 conf: gaxi::options::ClientConfig,
5626 ) -> gax::client_builder::Result<impl super::stub::InstantSnapshots> {
5627 super::transport::InstantSnapshots::new(conf).await
5628 }
5629
5630 async fn build_with_tracing(
5631 conf: gaxi::options::ClientConfig,
5632 ) -> gax::client_builder::Result<impl super::stub::InstantSnapshots> {
5633 Self::build_transport(conf)
5634 .await
5635 .map(super::tracing::InstantSnapshots::new)
5636 }
5637
5638 /// Retrieves an aggregated list of instantSnapshots.
5639 ///
5640 /// To prevent failure, Google recommends that you set the
5641 /// `returnPartialSuccess` parameter to `true`.
5642 pub fn aggregated_list(&self) -> super::builder::instant_snapshots::AggregatedList {
5643 super::builder::instant_snapshots::AggregatedList::new(self.inner.clone())
5644 }
5645
5646 /// Deletes the specified InstantSnapshot resource. Keep in mind that deleting
5647 /// a single instantSnapshot might not necessarily delete all the data on that
5648 /// instantSnapshot. If any data on the instantSnapshot that is marked for
5649 /// deletion is needed for subsequent instantSnapshots, the data will be moved
5650 /// to the next corresponding instantSnapshot.
5651 ///
5652 /// For more information, seeDeleting
5653 /// instantSnapshots.
5654 pub fn delete(&self) -> super::builder::instant_snapshots::Delete {
5655 super::builder::instant_snapshots::Delete::new(self.inner.clone())
5656 }
5657
5658 /// Returns the specified InstantSnapshot resource in the specified zone.
5659 pub fn get(&self) -> super::builder::instant_snapshots::Get {
5660 super::builder::instant_snapshots::Get::new(self.inner.clone())
5661 }
5662
5663 /// Gets the access control policy for a resource. May be empty if no such
5664 /// policy or resource exists.
5665 pub fn get_iam_policy(&self) -> super::builder::instant_snapshots::GetIamPolicy {
5666 super::builder::instant_snapshots::GetIamPolicy::new(self.inner.clone())
5667 }
5668
5669 /// Creates an instant snapshot in the specified zone.
5670 pub fn insert(&self) -> super::builder::instant_snapshots::Insert {
5671 super::builder::instant_snapshots::Insert::new(self.inner.clone())
5672 }
5673
5674 /// Retrieves the list of InstantSnapshot resources contained within
5675 /// the specified zone.
5676 pub fn list(&self) -> super::builder::instant_snapshots::List {
5677 super::builder::instant_snapshots::List::new(self.inner.clone())
5678 }
5679
5680 /// Sets the access control policy on the specified resource.
5681 /// Replaces any existing policy.
5682 pub fn set_iam_policy(&self) -> super::builder::instant_snapshots::SetIamPolicy {
5683 super::builder::instant_snapshots::SetIamPolicy::new(self.inner.clone())
5684 }
5685
5686 /// Sets the labels on a instantSnapshot in the given zone. To learn more about
5687 /// labels, read the Labeling
5688 /// Resources documentation.
5689 pub fn set_labels(&self) -> super::builder::instant_snapshots::SetLabels {
5690 super::builder::instant_snapshots::SetLabels::new(self.inner.clone())
5691 }
5692
5693 /// Returns permissions that a caller has on the specified resource.
5694 pub fn test_iam_permissions(&self) -> super::builder::instant_snapshots::TestIamPermissions {
5695 super::builder::instant_snapshots::TestIamPermissions::new(self.inner.clone())
5696 }
5697
5698 /// Retrieves the specified zone-specific Operations resource.
5699 pub fn get_operation(&self) -> super::builder::instant_snapshots::GetOperation {
5700 super::builder::instant_snapshots::GetOperation::new(self.inner.clone())
5701 }
5702}
5703
5704/// Implements a client for the Google Compute Engine API.
5705///
5706/// # Example
5707/// ```
5708/// # async fn sample() -> gax::client_builder::Result<()> {
5709/// # use google_cloud_compute_v1::client::InterconnectAttachmentGroups;
5710/// let client = InterconnectAttachmentGroups::builder().build().await?;
5711/// // use `client` to make requests to the Google Compute Engine API.
5712/// # Ok(()) }
5713/// ```
5714///
5715/// # Service Description
5716///
5717/// Service for the `interconnectAttachmentGroups` resource.
5718///
5719/// # Configuration
5720///
5721/// To configure `InterconnectAttachmentGroups` use the `with_*` methods in the type returned
5722/// by [builder()][InterconnectAttachmentGroups::builder]. The default configuration should
5723/// work for most applications. Common configuration changes include
5724///
5725/// * [with_endpoint()]: by default this client uses the global default endpoint
5726/// (`https://compute.googleapis.com`). Applications using regional
5727/// endpoints or running in restricted networks (e.g. a network configured
5728// with [Private Google Access with VPC Service Controls]) may want to
5729/// override this default.
5730/// * [with_credentials()]: by default this client uses
5731/// [Application Default Credentials]. Applications using custom
5732/// authentication may need to override this default.
5733///
5734/// [with_endpoint()]: super::builder::interconnect_attachment_groups::ClientBuilder::with_endpoint
5735/// [with_credentials()]: super::builder::interconnect_attachment_groups::ClientBuilder::credentials
5736/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5737/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5738///
5739/// # Pooling and Cloning
5740///
5741/// `InterconnectAttachmentGroups` holds a connection pool internally, it is advised to
5742/// create one and the reuse it. You do not need to wrap `InterconnectAttachmentGroups` in
5743/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5744/// already uses an `Arc` internally.
5745#[cfg(feature = "interconnect-attachment-groups")]
5746#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-attachment-groups")))]
5747#[derive(Clone, Debug)]
5748pub struct InterconnectAttachmentGroups {
5749 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachmentGroups>,
5750}
5751
5752#[cfg(feature = "interconnect-attachment-groups")]
5753impl InterconnectAttachmentGroups {
5754 /// Returns a builder for [InterconnectAttachmentGroups].
5755 ///
5756 /// ```
5757 /// # async fn sample() -> gax::client_builder::Result<()> {
5758 /// # use google_cloud_compute_v1::client::InterconnectAttachmentGroups;
5759 /// let client = InterconnectAttachmentGroups::builder().build().await?;
5760 /// # Ok(()) }
5761 /// ```
5762 pub fn builder() -> super::builder::interconnect_attachment_groups::ClientBuilder {
5763 gax::client_builder::internal::new_builder(
5764 super::builder::interconnect_attachment_groups::client::Factory,
5765 )
5766 }
5767
5768 /// Creates a new client from the provided stub.
5769 ///
5770 /// The most common case for calling this function is in tests mocking the
5771 /// client's behavior.
5772 pub fn from_stub<T>(stub: T) -> Self
5773 where
5774 T: super::stub::InterconnectAttachmentGroups + 'static,
5775 {
5776 Self {
5777 inner: std::sync::Arc::new(stub),
5778 }
5779 }
5780
5781 pub(crate) async fn new(
5782 config: gaxi::options::ClientConfig,
5783 ) -> gax::client_builder::Result<Self> {
5784 let inner = Self::build_inner(config).await?;
5785 Ok(Self { inner })
5786 }
5787
5788 async fn build_inner(
5789 conf: gaxi::options::ClientConfig,
5790 ) -> gax::client_builder::Result<
5791 std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachmentGroups>,
5792 > {
5793 if gaxi::options::tracing_enabled(&conf) {
5794 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5795 }
5796 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5797 }
5798
5799 async fn build_transport(
5800 conf: gaxi::options::ClientConfig,
5801 ) -> gax::client_builder::Result<impl super::stub::InterconnectAttachmentGroups> {
5802 super::transport::InterconnectAttachmentGroups::new(conf).await
5803 }
5804
5805 async fn build_with_tracing(
5806 conf: gaxi::options::ClientConfig,
5807 ) -> gax::client_builder::Result<impl super::stub::InterconnectAttachmentGroups> {
5808 Self::build_transport(conf)
5809 .await
5810 .map(super::tracing::InterconnectAttachmentGroups::new)
5811 }
5812
5813 /// Deletes the specified InterconnectAttachmentGroup in the given scope
5814 pub fn delete(&self) -> super::builder::interconnect_attachment_groups::Delete {
5815 super::builder::interconnect_attachment_groups::Delete::new(self.inner.clone())
5816 }
5817
5818 /// Returns the specified InterconnectAttachmentGroup resource in the given
5819 /// scope.
5820 pub fn get(&self) -> super::builder::interconnect_attachment_groups::Get {
5821 super::builder::interconnect_attachment_groups::Get::new(self.inner.clone())
5822 }
5823
5824 /// Gets the access control policy for a resource. May be empty if no such
5825 /// policy or resource exists.
5826 pub fn get_iam_policy(&self) -> super::builder::interconnect_attachment_groups::GetIamPolicy {
5827 super::builder::interconnect_attachment_groups::GetIamPolicy::new(self.inner.clone())
5828 }
5829
5830 /// Returns the InterconnectAttachmentStatuses for the specified
5831 /// InterconnectAttachmentGroup resource.
5832 pub fn get_operational_status(
5833 &self,
5834 ) -> super::builder::interconnect_attachment_groups::GetOperationalStatus {
5835 super::builder::interconnect_attachment_groups::GetOperationalStatus::new(
5836 self.inner.clone(),
5837 )
5838 }
5839
5840 /// Creates a InterconnectAttachmentGroup in the specified project in the given
5841 /// scope using the parameters that are included in the request.
5842 pub fn insert(&self) -> super::builder::interconnect_attachment_groups::Insert {
5843 super::builder::interconnect_attachment_groups::Insert::new(self.inner.clone())
5844 }
5845
5846 /// Lists the InterconnectAttachmentGroups for a project in the given scope.
5847 pub fn list(&self) -> super::builder::interconnect_attachment_groups::List {
5848 super::builder::interconnect_attachment_groups::List::new(self.inner.clone())
5849 }
5850
5851 /// Patches the specified InterconnectAttachmentGroup resource with the data
5852 /// included in the request. This method supports PATCH
5853 /// semantics and usesJSON merge
5854 /// patch format and processing rules.
5855 pub fn patch(&self) -> super::builder::interconnect_attachment_groups::Patch {
5856 super::builder::interconnect_attachment_groups::Patch::new(self.inner.clone())
5857 }
5858
5859 /// Sets the access control policy on the specified resource.
5860 /// Replaces any existing policy.
5861 pub fn set_iam_policy(&self) -> super::builder::interconnect_attachment_groups::SetIamPolicy {
5862 super::builder::interconnect_attachment_groups::SetIamPolicy::new(self.inner.clone())
5863 }
5864
5865 /// Returns permissions that a caller has on the specified resource.
5866 pub fn test_iam_permissions(
5867 &self,
5868 ) -> super::builder::interconnect_attachment_groups::TestIamPermissions {
5869 super::builder::interconnect_attachment_groups::TestIamPermissions::new(self.inner.clone())
5870 }
5871
5872 /// Retrieves the specified Operations resource.
5873 pub fn get_operation(&self) -> super::builder::interconnect_attachment_groups::GetOperation {
5874 super::builder::interconnect_attachment_groups::GetOperation::new(self.inner.clone())
5875 }
5876}
5877
5878/// Implements a client for the Google Compute Engine API.
5879///
5880/// # Example
5881/// ```
5882/// # async fn sample() -> gax::client_builder::Result<()> {
5883/// # use google_cloud_compute_v1::client::InterconnectAttachments;
5884/// let client = InterconnectAttachments::builder().build().await?;
5885/// // use `client` to make requests to the Google Compute Engine API.
5886/// # Ok(()) }
5887/// ```
5888///
5889/// # Service Description
5890///
5891/// Service for the `interconnectAttachments` resource.
5892///
5893/// # Configuration
5894///
5895/// To configure `InterconnectAttachments` use the `with_*` methods in the type returned
5896/// by [builder()][InterconnectAttachments::builder]. The default configuration should
5897/// work for most applications. Common configuration changes include
5898///
5899/// * [with_endpoint()]: by default this client uses the global default endpoint
5900/// (`https://compute.googleapis.com`). Applications using regional
5901/// endpoints or running in restricted networks (e.g. a network configured
5902// with [Private Google Access with VPC Service Controls]) may want to
5903/// override this default.
5904/// * [with_credentials()]: by default this client uses
5905/// [Application Default Credentials]. Applications using custom
5906/// authentication may need to override this default.
5907///
5908/// [with_endpoint()]: super::builder::interconnect_attachments::ClientBuilder::with_endpoint
5909/// [with_credentials()]: super::builder::interconnect_attachments::ClientBuilder::credentials
5910/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5911/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5912///
5913/// # Pooling and Cloning
5914///
5915/// `InterconnectAttachments` holds a connection pool internally, it is advised to
5916/// create one and the reuse it. You do not need to wrap `InterconnectAttachments` in
5917/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5918/// already uses an `Arc` internally.
5919#[cfg(feature = "interconnect-attachments")]
5920#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-attachments")))]
5921#[derive(Clone, Debug)]
5922pub struct InterconnectAttachments {
5923 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachments>,
5924}
5925
5926#[cfg(feature = "interconnect-attachments")]
5927impl InterconnectAttachments {
5928 /// Returns a builder for [InterconnectAttachments].
5929 ///
5930 /// ```
5931 /// # async fn sample() -> gax::client_builder::Result<()> {
5932 /// # use google_cloud_compute_v1::client::InterconnectAttachments;
5933 /// let client = InterconnectAttachments::builder().build().await?;
5934 /// # Ok(()) }
5935 /// ```
5936 pub fn builder() -> super::builder::interconnect_attachments::ClientBuilder {
5937 gax::client_builder::internal::new_builder(
5938 super::builder::interconnect_attachments::client::Factory,
5939 )
5940 }
5941
5942 /// Creates a new client from the provided stub.
5943 ///
5944 /// The most common case for calling this function is in tests mocking the
5945 /// client's behavior.
5946 pub fn from_stub<T>(stub: T) -> Self
5947 where
5948 T: super::stub::InterconnectAttachments + 'static,
5949 {
5950 Self {
5951 inner: std::sync::Arc::new(stub),
5952 }
5953 }
5954
5955 pub(crate) async fn new(
5956 config: gaxi::options::ClientConfig,
5957 ) -> gax::client_builder::Result<Self> {
5958 let inner = Self::build_inner(config).await?;
5959 Ok(Self { inner })
5960 }
5961
5962 async fn build_inner(
5963 conf: gaxi::options::ClientConfig,
5964 ) -> gax::client_builder::Result<
5965 std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachments>,
5966 > {
5967 if gaxi::options::tracing_enabled(&conf) {
5968 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5969 }
5970 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5971 }
5972
5973 async fn build_transport(
5974 conf: gaxi::options::ClientConfig,
5975 ) -> gax::client_builder::Result<impl super::stub::InterconnectAttachments> {
5976 super::transport::InterconnectAttachments::new(conf).await
5977 }
5978
5979 async fn build_with_tracing(
5980 conf: gaxi::options::ClientConfig,
5981 ) -> gax::client_builder::Result<impl super::stub::InterconnectAttachments> {
5982 Self::build_transport(conf)
5983 .await
5984 .map(super::tracing::InterconnectAttachments::new)
5985 }
5986
5987 /// Retrieves an aggregated list of interconnect attachments.
5988 ///
5989 /// To prevent failure, Google recommends that you set the
5990 /// `returnPartialSuccess` parameter to `true`.
5991 pub fn aggregated_list(&self) -> super::builder::interconnect_attachments::AggregatedList {
5992 super::builder::interconnect_attachments::AggregatedList::new(self.inner.clone())
5993 }
5994
5995 /// Deletes the specified interconnect attachment.
5996 pub fn delete(&self) -> super::builder::interconnect_attachments::Delete {
5997 super::builder::interconnect_attachments::Delete::new(self.inner.clone())
5998 }
5999
6000 /// Returns the specified interconnect attachment.
6001 pub fn get(&self) -> super::builder::interconnect_attachments::Get {
6002 super::builder::interconnect_attachments::Get::new(self.inner.clone())
6003 }
6004
6005 /// Creates an InterconnectAttachment in the specified project using the data
6006 /// included in the request.
6007 pub fn insert(&self) -> super::builder::interconnect_attachments::Insert {
6008 super::builder::interconnect_attachments::Insert::new(self.inner.clone())
6009 }
6010
6011 /// Retrieves the list of interconnect attachments contained within
6012 /// the specified region.
6013 pub fn list(&self) -> super::builder::interconnect_attachments::List {
6014 super::builder::interconnect_attachments::List::new(self.inner.clone())
6015 }
6016
6017 /// Updates the specified interconnect attachment with the data included in the
6018 /// request. This method supportsPATCH
6019 /// semantics and uses theJSON merge
6020 /// patch format and processing rules.
6021 pub fn patch(&self) -> super::builder::interconnect_attachments::Patch {
6022 super::builder::interconnect_attachments::Patch::new(self.inner.clone())
6023 }
6024
6025 /// Sets the labels on an InterconnectAttachment. To learn more about labels,
6026 /// read the Labeling
6027 /// Resources documentation.
6028 pub fn set_labels(&self) -> super::builder::interconnect_attachments::SetLabels {
6029 super::builder::interconnect_attachments::SetLabels::new(self.inner.clone())
6030 }
6031
6032 /// Retrieves the specified region-specific Operations resource.
6033 pub fn get_operation(&self) -> super::builder::interconnect_attachments::GetOperation {
6034 super::builder::interconnect_attachments::GetOperation::new(self.inner.clone())
6035 }
6036}
6037
6038/// Implements a client for the Google Compute Engine API.
6039///
6040/// # Example
6041/// ```
6042/// # async fn sample() -> gax::client_builder::Result<()> {
6043/// # use google_cloud_compute_v1::client::InterconnectGroups;
6044/// let client = InterconnectGroups::builder().build().await?;
6045/// // use `client` to make requests to the Google Compute Engine API.
6046/// # Ok(()) }
6047/// ```
6048///
6049/// # Service Description
6050///
6051/// Service for the `interconnectGroups` resource.
6052///
6053/// # Configuration
6054///
6055/// To configure `InterconnectGroups` use the `with_*` methods in the type returned
6056/// by [builder()][InterconnectGroups::builder]. The default configuration should
6057/// work for most applications. Common configuration changes include
6058///
6059/// * [with_endpoint()]: by default this client uses the global default endpoint
6060/// (`https://compute.googleapis.com`). Applications using regional
6061/// endpoints or running in restricted networks (e.g. a network configured
6062// with [Private Google Access with VPC Service Controls]) may want to
6063/// override this default.
6064/// * [with_credentials()]: by default this client uses
6065/// [Application Default Credentials]. Applications using custom
6066/// authentication may need to override this default.
6067///
6068/// [with_endpoint()]: super::builder::interconnect_groups::ClientBuilder::with_endpoint
6069/// [with_credentials()]: super::builder::interconnect_groups::ClientBuilder::credentials
6070/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6071/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6072///
6073/// # Pooling and Cloning
6074///
6075/// `InterconnectGroups` holds a connection pool internally, it is advised to
6076/// create one and the reuse it. You do not need to wrap `InterconnectGroups` in
6077/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6078/// already uses an `Arc` internally.
6079#[cfg(feature = "interconnect-groups")]
6080#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-groups")))]
6081#[derive(Clone, Debug)]
6082pub struct InterconnectGroups {
6083 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectGroups>,
6084}
6085
6086#[cfg(feature = "interconnect-groups")]
6087impl InterconnectGroups {
6088 /// Returns a builder for [InterconnectGroups].
6089 ///
6090 /// ```
6091 /// # async fn sample() -> gax::client_builder::Result<()> {
6092 /// # use google_cloud_compute_v1::client::InterconnectGroups;
6093 /// let client = InterconnectGroups::builder().build().await?;
6094 /// # Ok(()) }
6095 /// ```
6096 pub fn builder() -> super::builder::interconnect_groups::ClientBuilder {
6097 gax::client_builder::internal::new_builder(
6098 super::builder::interconnect_groups::client::Factory,
6099 )
6100 }
6101
6102 /// Creates a new client from the provided stub.
6103 ///
6104 /// The most common case for calling this function is in tests mocking the
6105 /// client's behavior.
6106 pub fn from_stub<T>(stub: T) -> Self
6107 where
6108 T: super::stub::InterconnectGroups + 'static,
6109 {
6110 Self {
6111 inner: std::sync::Arc::new(stub),
6112 }
6113 }
6114
6115 pub(crate) async fn new(
6116 config: gaxi::options::ClientConfig,
6117 ) -> gax::client_builder::Result<Self> {
6118 let inner = Self::build_inner(config).await?;
6119 Ok(Self { inner })
6120 }
6121
6122 async fn build_inner(
6123 conf: gaxi::options::ClientConfig,
6124 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::InterconnectGroups>>
6125 {
6126 if gaxi::options::tracing_enabled(&conf) {
6127 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6128 }
6129 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6130 }
6131
6132 async fn build_transport(
6133 conf: gaxi::options::ClientConfig,
6134 ) -> gax::client_builder::Result<impl super::stub::InterconnectGroups> {
6135 super::transport::InterconnectGroups::new(conf).await
6136 }
6137
6138 async fn build_with_tracing(
6139 conf: gaxi::options::ClientConfig,
6140 ) -> gax::client_builder::Result<impl super::stub::InterconnectGroups> {
6141 Self::build_transport(conf)
6142 .await
6143 .map(super::tracing::InterconnectGroups::new)
6144 }
6145
6146 /// Create Interconnects with redundancy by creating them in a specified
6147 /// interconnect group.
6148 pub fn create_members(&self) -> super::builder::interconnect_groups::CreateMembers {
6149 super::builder::interconnect_groups::CreateMembers::new(self.inner.clone())
6150 }
6151
6152 /// Deletes the specified InterconnectGroup in the given scope
6153 pub fn delete(&self) -> super::builder::interconnect_groups::Delete {
6154 super::builder::interconnect_groups::Delete::new(self.inner.clone())
6155 }
6156
6157 /// Returns the specified InterconnectGroup resource in the given scope.
6158 pub fn get(&self) -> super::builder::interconnect_groups::Get {
6159 super::builder::interconnect_groups::Get::new(self.inner.clone())
6160 }
6161
6162 /// Gets the access control policy for a resource. May be empty if no such
6163 /// policy or resource exists.
6164 pub fn get_iam_policy(&self) -> super::builder::interconnect_groups::GetIamPolicy {
6165 super::builder::interconnect_groups::GetIamPolicy::new(self.inner.clone())
6166 }
6167
6168 /// Returns the interconnectStatuses for the specified
6169 /// InterconnectGroup.
6170 pub fn get_operational_status(
6171 &self,
6172 ) -> super::builder::interconnect_groups::GetOperationalStatus {
6173 super::builder::interconnect_groups::GetOperationalStatus::new(self.inner.clone())
6174 }
6175
6176 /// Creates a InterconnectGroup in the specified project in the given scope
6177 /// using the parameters that are included in the request.
6178 pub fn insert(&self) -> super::builder::interconnect_groups::Insert {
6179 super::builder::interconnect_groups::Insert::new(self.inner.clone())
6180 }
6181
6182 /// Lists the InterconnectGroups for a project in the given scope.
6183 pub fn list(&self) -> super::builder::interconnect_groups::List {
6184 super::builder::interconnect_groups::List::new(self.inner.clone())
6185 }
6186
6187 /// Patches the specified InterconnectGroup resource with the data included in
6188 /// the request. This method supports PATCH
6189 /// semantics and usesJSON merge
6190 /// patch format and processing rules.
6191 pub fn patch(&self) -> super::builder::interconnect_groups::Patch {
6192 super::builder::interconnect_groups::Patch::new(self.inner.clone())
6193 }
6194
6195 /// Sets the access control policy on the specified resource.
6196 /// Replaces any existing policy.
6197 pub fn set_iam_policy(&self) -> super::builder::interconnect_groups::SetIamPolicy {
6198 super::builder::interconnect_groups::SetIamPolicy::new(self.inner.clone())
6199 }
6200
6201 /// Returns permissions that a caller has on the specified resource.
6202 pub fn test_iam_permissions(&self) -> super::builder::interconnect_groups::TestIamPermissions {
6203 super::builder::interconnect_groups::TestIamPermissions::new(self.inner.clone())
6204 }
6205
6206 /// Retrieves the specified Operations resource.
6207 pub fn get_operation(&self) -> super::builder::interconnect_groups::GetOperation {
6208 super::builder::interconnect_groups::GetOperation::new(self.inner.clone())
6209 }
6210}
6211
6212/// Implements a client for the Google Compute Engine API.
6213///
6214/// # Example
6215/// ```
6216/// # async fn sample() -> gax::client_builder::Result<()> {
6217/// # use google_cloud_compute_v1::client::InterconnectLocations;
6218/// let client = InterconnectLocations::builder().build().await?;
6219/// // use `client` to make requests to the Google Compute Engine API.
6220/// # Ok(()) }
6221/// ```
6222///
6223/// # Service Description
6224///
6225/// Service for the `interconnectLocations` resource.
6226///
6227/// # Configuration
6228///
6229/// To configure `InterconnectLocations` use the `with_*` methods in the type returned
6230/// by [builder()][InterconnectLocations::builder]. The default configuration should
6231/// work for most applications. Common configuration changes include
6232///
6233/// * [with_endpoint()]: by default this client uses the global default endpoint
6234/// (`https://compute.googleapis.com`). Applications using regional
6235/// endpoints or running in restricted networks (e.g. a network configured
6236// with [Private Google Access with VPC Service Controls]) may want to
6237/// override this default.
6238/// * [with_credentials()]: by default this client uses
6239/// [Application Default Credentials]. Applications using custom
6240/// authentication may need to override this default.
6241///
6242/// [with_endpoint()]: super::builder::interconnect_locations::ClientBuilder::with_endpoint
6243/// [with_credentials()]: super::builder::interconnect_locations::ClientBuilder::credentials
6244/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6245/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6246///
6247/// # Pooling and Cloning
6248///
6249/// `InterconnectLocations` holds a connection pool internally, it is advised to
6250/// create one and the reuse it. You do not need to wrap `InterconnectLocations` in
6251/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6252/// already uses an `Arc` internally.
6253#[cfg(feature = "interconnect-locations")]
6254#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-locations")))]
6255#[derive(Clone, Debug)]
6256pub struct InterconnectLocations {
6257 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectLocations>,
6258}
6259
6260#[cfg(feature = "interconnect-locations")]
6261impl InterconnectLocations {
6262 /// Returns a builder for [InterconnectLocations].
6263 ///
6264 /// ```
6265 /// # async fn sample() -> gax::client_builder::Result<()> {
6266 /// # use google_cloud_compute_v1::client::InterconnectLocations;
6267 /// let client = InterconnectLocations::builder().build().await?;
6268 /// # Ok(()) }
6269 /// ```
6270 pub fn builder() -> super::builder::interconnect_locations::ClientBuilder {
6271 gax::client_builder::internal::new_builder(
6272 super::builder::interconnect_locations::client::Factory,
6273 )
6274 }
6275
6276 /// Creates a new client from the provided stub.
6277 ///
6278 /// The most common case for calling this function is in tests mocking the
6279 /// client's behavior.
6280 pub fn from_stub<T>(stub: T) -> Self
6281 where
6282 T: super::stub::InterconnectLocations + 'static,
6283 {
6284 Self {
6285 inner: std::sync::Arc::new(stub),
6286 }
6287 }
6288
6289 pub(crate) async fn new(
6290 config: gaxi::options::ClientConfig,
6291 ) -> gax::client_builder::Result<Self> {
6292 let inner = Self::build_inner(config).await?;
6293 Ok(Self { inner })
6294 }
6295
6296 async fn build_inner(
6297 conf: gaxi::options::ClientConfig,
6298 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::InterconnectLocations>>
6299 {
6300 if gaxi::options::tracing_enabled(&conf) {
6301 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6302 }
6303 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6304 }
6305
6306 async fn build_transport(
6307 conf: gaxi::options::ClientConfig,
6308 ) -> gax::client_builder::Result<impl super::stub::InterconnectLocations> {
6309 super::transport::InterconnectLocations::new(conf).await
6310 }
6311
6312 async fn build_with_tracing(
6313 conf: gaxi::options::ClientConfig,
6314 ) -> gax::client_builder::Result<impl super::stub::InterconnectLocations> {
6315 Self::build_transport(conf)
6316 .await
6317 .map(super::tracing::InterconnectLocations::new)
6318 }
6319
6320 /// Returns the details for the specified interconnect location. Gets a list of
6321 /// available interconnect locations by making a list() request.
6322 pub fn get(&self) -> super::builder::interconnect_locations::Get {
6323 super::builder::interconnect_locations::Get::new(self.inner.clone())
6324 }
6325
6326 /// Retrieves the list of interconnect locations available to the specified
6327 /// project.
6328 pub fn list(&self) -> super::builder::interconnect_locations::List {
6329 super::builder::interconnect_locations::List::new(self.inner.clone())
6330 }
6331}
6332
6333/// Implements a client for the Google Compute Engine API.
6334///
6335/// # Example
6336/// ```
6337/// # async fn sample() -> gax::client_builder::Result<()> {
6338/// # use google_cloud_compute_v1::client::InterconnectRemoteLocations;
6339/// let client = InterconnectRemoteLocations::builder().build().await?;
6340/// // use `client` to make requests to the Google Compute Engine API.
6341/// # Ok(()) }
6342/// ```
6343///
6344/// # Service Description
6345///
6346/// Service for the `interconnectRemoteLocations` resource.
6347///
6348/// # Configuration
6349///
6350/// To configure `InterconnectRemoteLocations` use the `with_*` methods in the type returned
6351/// by [builder()][InterconnectRemoteLocations::builder]. The default configuration should
6352/// work for most applications. Common configuration changes include
6353///
6354/// * [with_endpoint()]: by default this client uses the global default endpoint
6355/// (`https://compute.googleapis.com`). Applications using regional
6356/// endpoints or running in restricted networks (e.g. a network configured
6357// with [Private Google Access with VPC Service Controls]) may want to
6358/// override this default.
6359/// * [with_credentials()]: by default this client uses
6360/// [Application Default Credentials]. Applications using custom
6361/// authentication may need to override this default.
6362///
6363/// [with_endpoint()]: super::builder::interconnect_remote_locations::ClientBuilder::with_endpoint
6364/// [with_credentials()]: super::builder::interconnect_remote_locations::ClientBuilder::credentials
6365/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6366/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6367///
6368/// # Pooling and Cloning
6369///
6370/// `InterconnectRemoteLocations` holds a connection pool internally, it is advised to
6371/// create one and the reuse it. You do not need to wrap `InterconnectRemoteLocations` in
6372/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6373/// already uses an `Arc` internally.
6374#[cfg(feature = "interconnect-remote-locations")]
6375#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-remote-locations")))]
6376#[derive(Clone, Debug)]
6377pub struct InterconnectRemoteLocations {
6378 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectRemoteLocations>,
6379}
6380
6381#[cfg(feature = "interconnect-remote-locations")]
6382impl InterconnectRemoteLocations {
6383 /// Returns a builder for [InterconnectRemoteLocations].
6384 ///
6385 /// ```
6386 /// # async fn sample() -> gax::client_builder::Result<()> {
6387 /// # use google_cloud_compute_v1::client::InterconnectRemoteLocations;
6388 /// let client = InterconnectRemoteLocations::builder().build().await?;
6389 /// # Ok(()) }
6390 /// ```
6391 pub fn builder() -> super::builder::interconnect_remote_locations::ClientBuilder {
6392 gax::client_builder::internal::new_builder(
6393 super::builder::interconnect_remote_locations::client::Factory,
6394 )
6395 }
6396
6397 /// Creates a new client from the provided stub.
6398 ///
6399 /// The most common case for calling this function is in tests mocking the
6400 /// client's behavior.
6401 pub fn from_stub<T>(stub: T) -> Self
6402 where
6403 T: super::stub::InterconnectRemoteLocations + 'static,
6404 {
6405 Self {
6406 inner: std::sync::Arc::new(stub),
6407 }
6408 }
6409
6410 pub(crate) async fn new(
6411 config: gaxi::options::ClientConfig,
6412 ) -> gax::client_builder::Result<Self> {
6413 let inner = Self::build_inner(config).await?;
6414 Ok(Self { inner })
6415 }
6416
6417 async fn build_inner(
6418 conf: gaxi::options::ClientConfig,
6419 ) -> gax::client_builder::Result<
6420 std::sync::Arc<dyn super::stub::dynamic::InterconnectRemoteLocations>,
6421 > {
6422 if gaxi::options::tracing_enabled(&conf) {
6423 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6424 }
6425 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6426 }
6427
6428 async fn build_transport(
6429 conf: gaxi::options::ClientConfig,
6430 ) -> gax::client_builder::Result<impl super::stub::InterconnectRemoteLocations> {
6431 super::transport::InterconnectRemoteLocations::new(conf).await
6432 }
6433
6434 async fn build_with_tracing(
6435 conf: gaxi::options::ClientConfig,
6436 ) -> gax::client_builder::Result<impl super::stub::InterconnectRemoteLocations> {
6437 Self::build_transport(conf)
6438 .await
6439 .map(super::tracing::InterconnectRemoteLocations::new)
6440 }
6441
6442 /// Returns the details for the specified interconnect remote location. Gets a
6443 /// list of available interconnect remote locations by making alist() request.
6444 pub fn get(&self) -> super::builder::interconnect_remote_locations::Get {
6445 super::builder::interconnect_remote_locations::Get::new(self.inner.clone())
6446 }
6447
6448 /// Retrieves the list of interconnect remote locations available to the
6449 /// specified project.
6450 pub fn list(&self) -> super::builder::interconnect_remote_locations::List {
6451 super::builder::interconnect_remote_locations::List::new(self.inner.clone())
6452 }
6453}
6454
6455/// Implements a client for the Google Compute Engine API.
6456///
6457/// # Example
6458/// ```
6459/// # async fn sample() -> gax::client_builder::Result<()> {
6460/// # use google_cloud_compute_v1::client::Interconnects;
6461/// let client = Interconnects::builder().build().await?;
6462/// // use `client` to make requests to the Google Compute Engine API.
6463/// # Ok(()) }
6464/// ```
6465///
6466/// # Service Description
6467///
6468/// Service for the `interconnects` resource.
6469///
6470/// # Configuration
6471///
6472/// To configure `Interconnects` use the `with_*` methods in the type returned
6473/// by [builder()][Interconnects::builder]. The default configuration should
6474/// work for most applications. Common configuration changes include
6475///
6476/// * [with_endpoint()]: by default this client uses the global default endpoint
6477/// (`https://compute.googleapis.com`). Applications using regional
6478/// endpoints or running in restricted networks (e.g. a network configured
6479// with [Private Google Access with VPC Service Controls]) may want to
6480/// override this default.
6481/// * [with_credentials()]: by default this client uses
6482/// [Application Default Credentials]. Applications using custom
6483/// authentication may need to override this default.
6484///
6485/// [with_endpoint()]: super::builder::interconnects::ClientBuilder::with_endpoint
6486/// [with_credentials()]: super::builder::interconnects::ClientBuilder::credentials
6487/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6488/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6489///
6490/// # Pooling and Cloning
6491///
6492/// `Interconnects` holds a connection pool internally, it is advised to
6493/// create one and the reuse it. You do not need to wrap `Interconnects` in
6494/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6495/// already uses an `Arc` internally.
6496#[cfg(feature = "interconnects")]
6497#[cfg_attr(docsrs, doc(cfg(feature = "interconnects")))]
6498#[derive(Clone, Debug)]
6499pub struct Interconnects {
6500 inner: std::sync::Arc<dyn super::stub::dynamic::Interconnects>,
6501}
6502
6503#[cfg(feature = "interconnects")]
6504impl Interconnects {
6505 /// Returns a builder for [Interconnects].
6506 ///
6507 /// ```
6508 /// # async fn sample() -> gax::client_builder::Result<()> {
6509 /// # use google_cloud_compute_v1::client::Interconnects;
6510 /// let client = Interconnects::builder().build().await?;
6511 /// # Ok(()) }
6512 /// ```
6513 pub fn builder() -> super::builder::interconnects::ClientBuilder {
6514 gax::client_builder::internal::new_builder(super::builder::interconnects::client::Factory)
6515 }
6516
6517 /// Creates a new client from the provided stub.
6518 ///
6519 /// The most common case for calling this function is in tests mocking the
6520 /// client's behavior.
6521 pub fn from_stub<T>(stub: T) -> Self
6522 where
6523 T: super::stub::Interconnects + 'static,
6524 {
6525 Self {
6526 inner: std::sync::Arc::new(stub),
6527 }
6528 }
6529
6530 pub(crate) async fn new(
6531 config: gaxi::options::ClientConfig,
6532 ) -> gax::client_builder::Result<Self> {
6533 let inner = Self::build_inner(config).await?;
6534 Ok(Self { inner })
6535 }
6536
6537 async fn build_inner(
6538 conf: gaxi::options::ClientConfig,
6539 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Interconnects>> {
6540 if gaxi::options::tracing_enabled(&conf) {
6541 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6542 }
6543 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6544 }
6545
6546 async fn build_transport(
6547 conf: gaxi::options::ClientConfig,
6548 ) -> gax::client_builder::Result<impl super::stub::Interconnects> {
6549 super::transport::Interconnects::new(conf).await
6550 }
6551
6552 async fn build_with_tracing(
6553 conf: gaxi::options::ClientConfig,
6554 ) -> gax::client_builder::Result<impl super::stub::Interconnects> {
6555 Self::build_transport(conf)
6556 .await
6557 .map(super::tracing::Interconnects::new)
6558 }
6559
6560 /// Deletes the specified Interconnect.
6561 pub fn delete(&self) -> super::builder::interconnects::Delete {
6562 super::builder::interconnects::Delete::new(self.inner.clone())
6563 }
6564
6565 /// Returns the specified Interconnect. Get a list of available Interconnects
6566 /// by making a list() request.
6567 pub fn get(&self) -> super::builder::interconnects::Get {
6568 super::builder::interconnects::Get::new(self.inner.clone())
6569 }
6570
6571 /// Returns the interconnectDiagnostics for the specified
6572 /// Interconnect.
6573 ///
6574 /// In the event of a
6575 /// global outage, do not use this API to make decisions about where to
6576 /// redirect your network traffic.
6577 ///
6578 /// Unlike a VLAN attachment, which is regional, a Cloud Interconnect
6579 /// connection is a global resource. A global outage can prevent this
6580 /// API from functioning properly.
6581 pub fn get_diagnostics(&self) -> super::builder::interconnects::GetDiagnostics {
6582 super::builder::interconnects::GetDiagnostics::new(self.inner.clone())
6583 }
6584
6585 /// Returns the interconnectMacsecConfig for the specified
6586 /// Interconnect.
6587 pub fn get_macsec_config(&self) -> super::builder::interconnects::GetMacsecConfig {
6588 super::builder::interconnects::GetMacsecConfig::new(self.inner.clone())
6589 }
6590
6591 /// Creates an Interconnect in the specified project using
6592 /// the data included in the request.
6593 pub fn insert(&self) -> super::builder::interconnects::Insert {
6594 super::builder::interconnects::Insert::new(self.inner.clone())
6595 }
6596
6597 /// Retrieves the list of Interconnects available to the specified project.
6598 pub fn list(&self) -> super::builder::interconnects::List {
6599 super::builder::interconnects::List::new(self.inner.clone())
6600 }
6601
6602 /// Updates the specified Interconnect with the data included in the request.
6603 /// This method supportsPATCH
6604 /// semantics and uses theJSON merge
6605 /// patch format and processing rules.
6606 pub fn patch(&self) -> super::builder::interconnects::Patch {
6607 super::builder::interconnects::Patch::new(self.inner.clone())
6608 }
6609
6610 /// Sets the labels on an Interconnect. To learn more about labels,
6611 /// read the Labeling
6612 /// Resources documentation.
6613 pub fn set_labels(&self) -> super::builder::interconnects::SetLabels {
6614 super::builder::interconnects::SetLabels::new(self.inner.clone())
6615 }
6616
6617 /// Retrieves the specified Operations resource.
6618 pub fn get_operation(&self) -> super::builder::interconnects::GetOperation {
6619 super::builder::interconnects::GetOperation::new(self.inner.clone())
6620 }
6621}
6622
6623/// Implements a client for the Google Compute Engine API.
6624///
6625/// # Example
6626/// ```
6627/// # async fn sample() -> gax::client_builder::Result<()> {
6628/// # use google_cloud_compute_v1::client::LicenseCodes;
6629/// let client = LicenseCodes::builder().build().await?;
6630/// // use `client` to make requests to the Google Compute Engine API.
6631/// # Ok(()) }
6632/// ```
6633///
6634/// # Service Description
6635///
6636/// Service for the `licenseCodes` resource.
6637///
6638/// # Configuration
6639///
6640/// To configure `LicenseCodes` use the `with_*` methods in the type returned
6641/// by [builder()][LicenseCodes::builder]. The default configuration should
6642/// work for most applications. Common configuration changes include
6643///
6644/// * [with_endpoint()]: by default this client uses the global default endpoint
6645/// (`https://compute.googleapis.com`). Applications using regional
6646/// endpoints or running in restricted networks (e.g. a network configured
6647// with [Private Google Access with VPC Service Controls]) may want to
6648/// override this default.
6649/// * [with_credentials()]: by default this client uses
6650/// [Application Default Credentials]. Applications using custom
6651/// authentication may need to override this default.
6652///
6653/// [with_endpoint()]: super::builder::license_codes::ClientBuilder::with_endpoint
6654/// [with_credentials()]: super::builder::license_codes::ClientBuilder::credentials
6655/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6656/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6657///
6658/// # Pooling and Cloning
6659///
6660/// `LicenseCodes` holds a connection pool internally, it is advised to
6661/// create one and the reuse it. You do not need to wrap `LicenseCodes` in
6662/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6663/// already uses an `Arc` internally.
6664#[cfg(feature = "license-codes")]
6665#[cfg_attr(docsrs, doc(cfg(feature = "license-codes")))]
6666#[derive(Clone, Debug)]
6667pub struct LicenseCodes {
6668 inner: std::sync::Arc<dyn super::stub::dynamic::LicenseCodes>,
6669}
6670
6671#[cfg(feature = "license-codes")]
6672impl LicenseCodes {
6673 /// Returns a builder for [LicenseCodes].
6674 ///
6675 /// ```
6676 /// # async fn sample() -> gax::client_builder::Result<()> {
6677 /// # use google_cloud_compute_v1::client::LicenseCodes;
6678 /// let client = LicenseCodes::builder().build().await?;
6679 /// # Ok(()) }
6680 /// ```
6681 pub fn builder() -> super::builder::license_codes::ClientBuilder {
6682 gax::client_builder::internal::new_builder(super::builder::license_codes::client::Factory)
6683 }
6684
6685 /// Creates a new client from the provided stub.
6686 ///
6687 /// The most common case for calling this function is in tests mocking the
6688 /// client's behavior.
6689 pub fn from_stub<T>(stub: T) -> Self
6690 where
6691 T: super::stub::LicenseCodes + 'static,
6692 {
6693 Self {
6694 inner: std::sync::Arc::new(stub),
6695 }
6696 }
6697
6698 pub(crate) async fn new(
6699 config: gaxi::options::ClientConfig,
6700 ) -> gax::client_builder::Result<Self> {
6701 let inner = Self::build_inner(config).await?;
6702 Ok(Self { inner })
6703 }
6704
6705 async fn build_inner(
6706 conf: gaxi::options::ClientConfig,
6707 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::LicenseCodes>> {
6708 if gaxi::options::tracing_enabled(&conf) {
6709 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6710 }
6711 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6712 }
6713
6714 async fn build_transport(
6715 conf: gaxi::options::ClientConfig,
6716 ) -> gax::client_builder::Result<impl super::stub::LicenseCodes> {
6717 super::transport::LicenseCodes::new(conf).await
6718 }
6719
6720 async fn build_with_tracing(
6721 conf: gaxi::options::ClientConfig,
6722 ) -> gax::client_builder::Result<impl super::stub::LicenseCodes> {
6723 Self::build_transport(conf)
6724 .await
6725 .map(super::tracing::LicenseCodes::new)
6726 }
6727
6728 /// Return a specified license code. License codes are mirrored across
6729 /// all projects that have permissions to read the License Code.
6730 /// *Caution* This resource is intended
6731 /// for use only by third-party partners who are creatingCloud Marketplace
6732 /// images.
6733 pub fn get(&self) -> super::builder::license_codes::Get {
6734 super::builder::license_codes::Get::new(self.inner.clone())
6735 }
6736
6737 /// Returns permissions that a caller has on the specified resource.
6738 /// *Caution* This resource is intended
6739 /// for use only by third-party partners who are creatingCloud Marketplace
6740 /// images.
6741 pub fn test_iam_permissions(&self) -> super::builder::license_codes::TestIamPermissions {
6742 super::builder::license_codes::TestIamPermissions::new(self.inner.clone())
6743 }
6744}
6745
6746/// Implements a client for the Google Compute Engine API.
6747///
6748/// # Example
6749/// ```
6750/// # async fn sample() -> gax::client_builder::Result<()> {
6751/// # use google_cloud_compute_v1::client::Licenses;
6752/// let client = Licenses::builder().build().await?;
6753/// // use `client` to make requests to the Google Compute Engine API.
6754/// # Ok(()) }
6755/// ```
6756///
6757/// # Service Description
6758///
6759/// Service for the `licenses` resource.
6760///
6761/// # Configuration
6762///
6763/// To configure `Licenses` use the `with_*` methods in the type returned
6764/// by [builder()][Licenses::builder]. The default configuration should
6765/// work for most applications. Common configuration changes include
6766///
6767/// * [with_endpoint()]: by default this client uses the global default endpoint
6768/// (`https://compute.googleapis.com`). Applications using regional
6769/// endpoints or running in restricted networks (e.g. a network configured
6770// with [Private Google Access with VPC Service Controls]) may want to
6771/// override this default.
6772/// * [with_credentials()]: by default this client uses
6773/// [Application Default Credentials]. Applications using custom
6774/// authentication may need to override this default.
6775///
6776/// [with_endpoint()]: super::builder::licenses::ClientBuilder::with_endpoint
6777/// [with_credentials()]: super::builder::licenses::ClientBuilder::credentials
6778/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6779/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6780///
6781/// # Pooling and Cloning
6782///
6783/// `Licenses` holds a connection pool internally, it is advised to
6784/// create one and the reuse it. You do not need to wrap `Licenses` in
6785/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6786/// already uses an `Arc` internally.
6787#[cfg(feature = "licenses")]
6788#[cfg_attr(docsrs, doc(cfg(feature = "licenses")))]
6789#[derive(Clone, Debug)]
6790pub struct Licenses {
6791 inner: std::sync::Arc<dyn super::stub::dynamic::Licenses>,
6792}
6793
6794#[cfg(feature = "licenses")]
6795impl Licenses {
6796 /// Returns a builder for [Licenses].
6797 ///
6798 /// ```
6799 /// # async fn sample() -> gax::client_builder::Result<()> {
6800 /// # use google_cloud_compute_v1::client::Licenses;
6801 /// let client = Licenses::builder().build().await?;
6802 /// # Ok(()) }
6803 /// ```
6804 pub fn builder() -> super::builder::licenses::ClientBuilder {
6805 gax::client_builder::internal::new_builder(super::builder::licenses::client::Factory)
6806 }
6807
6808 /// Creates a new client from the provided stub.
6809 ///
6810 /// The most common case for calling this function is in tests mocking the
6811 /// client's behavior.
6812 pub fn from_stub<T>(stub: T) -> Self
6813 where
6814 T: super::stub::Licenses + 'static,
6815 {
6816 Self {
6817 inner: std::sync::Arc::new(stub),
6818 }
6819 }
6820
6821 pub(crate) async fn new(
6822 config: gaxi::options::ClientConfig,
6823 ) -> gax::client_builder::Result<Self> {
6824 let inner = Self::build_inner(config).await?;
6825 Ok(Self { inner })
6826 }
6827
6828 async fn build_inner(
6829 conf: gaxi::options::ClientConfig,
6830 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Licenses>> {
6831 if gaxi::options::tracing_enabled(&conf) {
6832 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6833 }
6834 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6835 }
6836
6837 async fn build_transport(
6838 conf: gaxi::options::ClientConfig,
6839 ) -> gax::client_builder::Result<impl super::stub::Licenses> {
6840 super::transport::Licenses::new(conf).await
6841 }
6842
6843 async fn build_with_tracing(
6844 conf: gaxi::options::ClientConfig,
6845 ) -> gax::client_builder::Result<impl super::stub::Licenses> {
6846 Self::build_transport(conf)
6847 .await
6848 .map(super::tracing::Licenses::new)
6849 }
6850
6851 /// Deletes the specified license.
6852 /// *Caution* This resource is intended
6853 /// for use only by third-party partners who are creatingCloud Marketplace
6854 /// images.
6855 pub fn delete(&self) -> super::builder::licenses::Delete {
6856 super::builder::licenses::Delete::new(self.inner.clone())
6857 }
6858
6859 /// Returns the specified License resource.
6860 /// *Caution* This resource is intended
6861 /// for use only by third-party partners who are creatingCloud Marketplace
6862 /// images.
6863 pub fn get(&self) -> super::builder::licenses::Get {
6864 super::builder::licenses::Get::new(self.inner.clone())
6865 }
6866
6867 /// Gets the access control policy for a resource. May be empty if no such
6868 /// policy or resource exists.
6869 /// *Caution* This resource is intended
6870 /// for use only by third-party partners who are creatingCloud Marketplace
6871 /// images.
6872 pub fn get_iam_policy(&self) -> super::builder::licenses::GetIamPolicy {
6873 super::builder::licenses::GetIamPolicy::new(self.inner.clone())
6874 }
6875
6876 /// Create a License resource in the specified project.
6877 /// *Caution* This resource is intended
6878 /// for use only by third-party partners who are creatingCloud Marketplace
6879 /// images.
6880 pub fn insert(&self) -> super::builder::licenses::Insert {
6881 super::builder::licenses::Insert::new(self.inner.clone())
6882 }
6883
6884 /// Retrieves the list of licenses
6885 /// available in the specified project. This method does not
6886 /// get any licenses that belong to other projects, including licenses attached
6887 /// to publicly-available images, like Debian 9. If you want to get a list of
6888 /// publicly-available licenses, use this method to make a request to the
6889 /// respective image project, such as debian-cloud orwindows-cloud.
6890 /// *Caution* This resource is intended
6891 /// for use only by third-party partners who are creatingCloud Marketplace
6892 /// images.
6893 pub fn list(&self) -> super::builder::licenses::List {
6894 super::builder::licenses::List::new(self.inner.clone())
6895 }
6896
6897 /// Sets the access control policy on the specified resource.
6898 /// Replaces any existing policy.
6899 /// *Caution* This resource is intended
6900 /// for use only by third-party partners who are creatingCloud Marketplace
6901 /// images.
6902 pub fn set_iam_policy(&self) -> super::builder::licenses::SetIamPolicy {
6903 super::builder::licenses::SetIamPolicy::new(self.inner.clone())
6904 }
6905
6906 /// Returns permissions that a caller has on the specified resource.
6907 /// *Caution* This resource is intended
6908 /// for use only by third-party partners who are creatingCloud Marketplace
6909 /// images.
6910 pub fn test_iam_permissions(&self) -> super::builder::licenses::TestIamPermissions {
6911 super::builder::licenses::TestIamPermissions::new(self.inner.clone())
6912 }
6913
6914 /// Updates a License resource in the specified project.
6915 /// *Caution* This resource is intended
6916 /// for use only by third-party partners who are creatingCloud Marketplace
6917 /// images.
6918 pub fn update(&self) -> super::builder::licenses::Update {
6919 super::builder::licenses::Update::new(self.inner.clone())
6920 }
6921
6922 /// Retrieves the specified Operations resource.
6923 pub fn get_operation(&self) -> super::builder::licenses::GetOperation {
6924 super::builder::licenses::GetOperation::new(self.inner.clone())
6925 }
6926}
6927
6928/// Implements a client for the Google Compute Engine API.
6929///
6930/// # Example
6931/// ```
6932/// # async fn sample() -> gax::client_builder::Result<()> {
6933/// # use google_cloud_compute_v1::client::MachineImages;
6934/// let client = MachineImages::builder().build().await?;
6935/// // use `client` to make requests to the Google Compute Engine API.
6936/// # Ok(()) }
6937/// ```
6938///
6939/// # Service Description
6940///
6941/// Service for the `machineImages` resource.
6942///
6943/// # Configuration
6944///
6945/// To configure `MachineImages` use the `with_*` methods in the type returned
6946/// by [builder()][MachineImages::builder]. The default configuration should
6947/// work for most applications. Common configuration changes include
6948///
6949/// * [with_endpoint()]: by default this client uses the global default endpoint
6950/// (`https://compute.googleapis.com`). Applications using regional
6951/// endpoints or running in restricted networks (e.g. a network configured
6952// with [Private Google Access with VPC Service Controls]) may want to
6953/// override this default.
6954/// * [with_credentials()]: by default this client uses
6955/// [Application Default Credentials]. Applications using custom
6956/// authentication may need to override this default.
6957///
6958/// [with_endpoint()]: super::builder::machine_images::ClientBuilder::with_endpoint
6959/// [with_credentials()]: super::builder::machine_images::ClientBuilder::credentials
6960/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6961/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6962///
6963/// # Pooling and Cloning
6964///
6965/// `MachineImages` holds a connection pool internally, it is advised to
6966/// create one and the reuse it. You do not need to wrap `MachineImages` in
6967/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6968/// already uses an `Arc` internally.
6969#[cfg(feature = "machine-images")]
6970#[cfg_attr(docsrs, doc(cfg(feature = "machine-images")))]
6971#[derive(Clone, Debug)]
6972pub struct MachineImages {
6973 inner: std::sync::Arc<dyn super::stub::dynamic::MachineImages>,
6974}
6975
6976#[cfg(feature = "machine-images")]
6977impl MachineImages {
6978 /// Returns a builder for [MachineImages].
6979 ///
6980 /// ```
6981 /// # async fn sample() -> gax::client_builder::Result<()> {
6982 /// # use google_cloud_compute_v1::client::MachineImages;
6983 /// let client = MachineImages::builder().build().await?;
6984 /// # Ok(()) }
6985 /// ```
6986 pub fn builder() -> super::builder::machine_images::ClientBuilder {
6987 gax::client_builder::internal::new_builder(super::builder::machine_images::client::Factory)
6988 }
6989
6990 /// Creates a new client from the provided stub.
6991 ///
6992 /// The most common case for calling this function is in tests mocking the
6993 /// client's behavior.
6994 pub fn from_stub<T>(stub: T) -> Self
6995 where
6996 T: super::stub::MachineImages + 'static,
6997 {
6998 Self {
6999 inner: std::sync::Arc::new(stub),
7000 }
7001 }
7002
7003 pub(crate) async fn new(
7004 config: gaxi::options::ClientConfig,
7005 ) -> gax::client_builder::Result<Self> {
7006 let inner = Self::build_inner(config).await?;
7007 Ok(Self { inner })
7008 }
7009
7010 async fn build_inner(
7011 conf: gaxi::options::ClientConfig,
7012 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::MachineImages>> {
7013 if gaxi::options::tracing_enabled(&conf) {
7014 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7015 }
7016 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7017 }
7018
7019 async fn build_transport(
7020 conf: gaxi::options::ClientConfig,
7021 ) -> gax::client_builder::Result<impl super::stub::MachineImages> {
7022 super::transport::MachineImages::new(conf).await
7023 }
7024
7025 async fn build_with_tracing(
7026 conf: gaxi::options::ClientConfig,
7027 ) -> gax::client_builder::Result<impl super::stub::MachineImages> {
7028 Self::build_transport(conf)
7029 .await
7030 .map(super::tracing::MachineImages::new)
7031 }
7032
7033 /// Deletes the specified machine image. Deleting a machine image is permanent
7034 /// and cannot be undone.
7035 pub fn delete(&self) -> super::builder::machine_images::Delete {
7036 super::builder::machine_images::Delete::new(self.inner.clone())
7037 }
7038
7039 /// Returns the specified machine image.
7040 pub fn get(&self) -> super::builder::machine_images::Get {
7041 super::builder::machine_images::Get::new(self.inner.clone())
7042 }
7043
7044 /// Gets the access control policy for a resource. May be empty if no such
7045 /// policy or resource exists.
7046 pub fn get_iam_policy(&self) -> super::builder::machine_images::GetIamPolicy {
7047 super::builder::machine_images::GetIamPolicy::new(self.inner.clone())
7048 }
7049
7050 /// Creates a machine image in the specified project using the
7051 /// data that is included in the request. If you are creating a new machine
7052 /// image to update an existing instance, your new machine image should use the
7053 /// same network or, if applicable, the same subnetwork as the original
7054 /// instance.
7055 pub fn insert(&self) -> super::builder::machine_images::Insert {
7056 super::builder::machine_images::Insert::new(self.inner.clone())
7057 }
7058
7059 /// Retrieves a list of machine images that are contained within
7060 /// the specified project.
7061 pub fn list(&self) -> super::builder::machine_images::List {
7062 super::builder::machine_images::List::new(self.inner.clone())
7063 }
7064
7065 /// Sets the access control policy on the specified resource.
7066 /// Replaces any existing policy.
7067 pub fn set_iam_policy(&self) -> super::builder::machine_images::SetIamPolicy {
7068 super::builder::machine_images::SetIamPolicy::new(self.inner.clone())
7069 }
7070
7071 /// Sets the labels on a machine image. To learn more about labels, read theLabeling
7072 /// Resources documentation.
7073 pub fn set_labels(&self) -> super::builder::machine_images::SetLabels {
7074 super::builder::machine_images::SetLabels::new(self.inner.clone())
7075 }
7076
7077 /// Returns permissions that a caller has on the specified resource.
7078 pub fn test_iam_permissions(&self) -> super::builder::machine_images::TestIamPermissions {
7079 super::builder::machine_images::TestIamPermissions::new(self.inner.clone())
7080 }
7081
7082 /// Retrieves the specified Operations resource.
7083 pub fn get_operation(&self) -> super::builder::machine_images::GetOperation {
7084 super::builder::machine_images::GetOperation::new(self.inner.clone())
7085 }
7086}
7087
7088/// Implements a client for the Google Compute Engine API.
7089///
7090/// # Example
7091/// ```
7092/// # async fn sample() -> gax::client_builder::Result<()> {
7093/// # use google_cloud_compute_v1::client::MachineTypes;
7094/// let client = MachineTypes::builder().build().await?;
7095/// // use `client` to make requests to the Google Compute Engine API.
7096/// # Ok(()) }
7097/// ```
7098///
7099/// # Service Description
7100///
7101/// Service for the `machineTypes` resource.
7102///
7103/// # Configuration
7104///
7105/// To configure `MachineTypes` use the `with_*` methods in the type returned
7106/// by [builder()][MachineTypes::builder]. The default configuration should
7107/// work for most applications. Common configuration changes include
7108///
7109/// * [with_endpoint()]: by default this client uses the global default endpoint
7110/// (`https://compute.googleapis.com`). Applications using regional
7111/// endpoints or running in restricted networks (e.g. a network configured
7112// with [Private Google Access with VPC Service Controls]) may want to
7113/// override this default.
7114/// * [with_credentials()]: by default this client uses
7115/// [Application Default Credentials]. Applications using custom
7116/// authentication may need to override this default.
7117///
7118/// [with_endpoint()]: super::builder::machine_types::ClientBuilder::with_endpoint
7119/// [with_credentials()]: super::builder::machine_types::ClientBuilder::credentials
7120/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7121/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7122///
7123/// # Pooling and Cloning
7124///
7125/// `MachineTypes` holds a connection pool internally, it is advised to
7126/// create one and the reuse it. You do not need to wrap `MachineTypes` in
7127/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7128/// already uses an `Arc` internally.
7129#[cfg(feature = "machine-types")]
7130#[cfg_attr(docsrs, doc(cfg(feature = "machine-types")))]
7131#[derive(Clone, Debug)]
7132pub struct MachineTypes {
7133 inner: std::sync::Arc<dyn super::stub::dynamic::MachineTypes>,
7134}
7135
7136#[cfg(feature = "machine-types")]
7137impl MachineTypes {
7138 /// Returns a builder for [MachineTypes].
7139 ///
7140 /// ```
7141 /// # async fn sample() -> gax::client_builder::Result<()> {
7142 /// # use google_cloud_compute_v1::client::MachineTypes;
7143 /// let client = MachineTypes::builder().build().await?;
7144 /// # Ok(()) }
7145 /// ```
7146 pub fn builder() -> super::builder::machine_types::ClientBuilder {
7147 gax::client_builder::internal::new_builder(super::builder::machine_types::client::Factory)
7148 }
7149
7150 /// Creates a new client from the provided stub.
7151 ///
7152 /// The most common case for calling this function is in tests mocking the
7153 /// client's behavior.
7154 pub fn from_stub<T>(stub: T) -> Self
7155 where
7156 T: super::stub::MachineTypes + 'static,
7157 {
7158 Self {
7159 inner: std::sync::Arc::new(stub),
7160 }
7161 }
7162
7163 pub(crate) async fn new(
7164 config: gaxi::options::ClientConfig,
7165 ) -> gax::client_builder::Result<Self> {
7166 let inner = Self::build_inner(config).await?;
7167 Ok(Self { inner })
7168 }
7169
7170 async fn build_inner(
7171 conf: gaxi::options::ClientConfig,
7172 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::MachineTypes>> {
7173 if gaxi::options::tracing_enabled(&conf) {
7174 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7175 }
7176 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7177 }
7178
7179 async fn build_transport(
7180 conf: gaxi::options::ClientConfig,
7181 ) -> gax::client_builder::Result<impl super::stub::MachineTypes> {
7182 super::transport::MachineTypes::new(conf).await
7183 }
7184
7185 async fn build_with_tracing(
7186 conf: gaxi::options::ClientConfig,
7187 ) -> gax::client_builder::Result<impl super::stub::MachineTypes> {
7188 Self::build_transport(conf)
7189 .await
7190 .map(super::tracing::MachineTypes::new)
7191 }
7192
7193 /// Retrieves an aggregated list of machine types.
7194 ///
7195 /// To prevent failure, Google recommends that you set the
7196 /// `returnPartialSuccess` parameter to `true`.
7197 pub fn aggregated_list(&self) -> super::builder::machine_types::AggregatedList {
7198 super::builder::machine_types::AggregatedList::new(self.inner.clone())
7199 }
7200
7201 /// Returns the specified machine type.
7202 pub fn get(&self) -> super::builder::machine_types::Get {
7203 super::builder::machine_types::Get::new(self.inner.clone())
7204 }
7205
7206 /// Retrieves a list of machine types available to the specified
7207 /// project.
7208 pub fn list(&self) -> super::builder::machine_types::List {
7209 super::builder::machine_types::List::new(self.inner.clone())
7210 }
7211}
7212
7213/// Implements a client for the Google Compute Engine API.
7214///
7215/// # Example
7216/// ```
7217/// # async fn sample() -> gax::client_builder::Result<()> {
7218/// # use google_cloud_compute_v1::client::NetworkAttachments;
7219/// let client = NetworkAttachments::builder().build().await?;
7220/// // use `client` to make requests to the Google Compute Engine API.
7221/// # Ok(()) }
7222/// ```
7223///
7224/// # Service Description
7225///
7226/// Service for the `networkAttachments` resource.
7227///
7228/// # Configuration
7229///
7230/// To configure `NetworkAttachments` use the `with_*` methods in the type returned
7231/// by [builder()][NetworkAttachments::builder]. The default configuration should
7232/// work for most applications. Common configuration changes include
7233///
7234/// * [with_endpoint()]: by default this client uses the global default endpoint
7235/// (`https://compute.googleapis.com`). Applications using regional
7236/// endpoints or running in restricted networks (e.g. a network configured
7237// with [Private Google Access with VPC Service Controls]) may want to
7238/// override this default.
7239/// * [with_credentials()]: by default this client uses
7240/// [Application Default Credentials]. Applications using custom
7241/// authentication may need to override this default.
7242///
7243/// [with_endpoint()]: super::builder::network_attachments::ClientBuilder::with_endpoint
7244/// [with_credentials()]: super::builder::network_attachments::ClientBuilder::credentials
7245/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7246/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7247///
7248/// # Pooling and Cloning
7249///
7250/// `NetworkAttachments` holds a connection pool internally, it is advised to
7251/// create one and the reuse it. You do not need to wrap `NetworkAttachments` in
7252/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7253/// already uses an `Arc` internally.
7254#[cfg(feature = "network-attachments")]
7255#[cfg_attr(docsrs, doc(cfg(feature = "network-attachments")))]
7256#[derive(Clone, Debug)]
7257pub struct NetworkAttachments {
7258 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkAttachments>,
7259}
7260
7261#[cfg(feature = "network-attachments")]
7262impl NetworkAttachments {
7263 /// Returns a builder for [NetworkAttachments].
7264 ///
7265 /// ```
7266 /// # async fn sample() -> gax::client_builder::Result<()> {
7267 /// # use google_cloud_compute_v1::client::NetworkAttachments;
7268 /// let client = NetworkAttachments::builder().build().await?;
7269 /// # Ok(()) }
7270 /// ```
7271 pub fn builder() -> super::builder::network_attachments::ClientBuilder {
7272 gax::client_builder::internal::new_builder(
7273 super::builder::network_attachments::client::Factory,
7274 )
7275 }
7276
7277 /// Creates a new client from the provided stub.
7278 ///
7279 /// The most common case for calling this function is in tests mocking the
7280 /// client's behavior.
7281 pub fn from_stub<T>(stub: T) -> Self
7282 where
7283 T: super::stub::NetworkAttachments + 'static,
7284 {
7285 Self {
7286 inner: std::sync::Arc::new(stub),
7287 }
7288 }
7289
7290 pub(crate) async fn new(
7291 config: gaxi::options::ClientConfig,
7292 ) -> gax::client_builder::Result<Self> {
7293 let inner = Self::build_inner(config).await?;
7294 Ok(Self { inner })
7295 }
7296
7297 async fn build_inner(
7298 conf: gaxi::options::ClientConfig,
7299 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::NetworkAttachments>>
7300 {
7301 if gaxi::options::tracing_enabled(&conf) {
7302 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7303 }
7304 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7305 }
7306
7307 async fn build_transport(
7308 conf: gaxi::options::ClientConfig,
7309 ) -> gax::client_builder::Result<impl super::stub::NetworkAttachments> {
7310 super::transport::NetworkAttachments::new(conf).await
7311 }
7312
7313 async fn build_with_tracing(
7314 conf: gaxi::options::ClientConfig,
7315 ) -> gax::client_builder::Result<impl super::stub::NetworkAttachments> {
7316 Self::build_transport(conf)
7317 .await
7318 .map(super::tracing::NetworkAttachments::new)
7319 }
7320
7321 /// Retrieves the list of all NetworkAttachment resources,
7322 /// regional and global, available to the specified project.
7323 ///
7324 /// To prevent failure, Google recommends that you set the
7325 /// `returnPartialSuccess` parameter to `true`.
7326 pub fn aggregated_list(&self) -> super::builder::network_attachments::AggregatedList {
7327 super::builder::network_attachments::AggregatedList::new(self.inner.clone())
7328 }
7329
7330 /// Deletes the specified NetworkAttachment in the given scope
7331 pub fn delete(&self) -> super::builder::network_attachments::Delete {
7332 super::builder::network_attachments::Delete::new(self.inner.clone())
7333 }
7334
7335 /// Returns the specified NetworkAttachment resource in the given scope.
7336 pub fn get(&self) -> super::builder::network_attachments::Get {
7337 super::builder::network_attachments::Get::new(self.inner.clone())
7338 }
7339
7340 /// Gets the access control policy for a resource. May be empty if no such
7341 /// policy or resource exists.
7342 pub fn get_iam_policy(&self) -> super::builder::network_attachments::GetIamPolicy {
7343 super::builder::network_attachments::GetIamPolicy::new(self.inner.clone())
7344 }
7345
7346 /// Creates a NetworkAttachment in the specified project in the given scope
7347 /// using the parameters that are included in the request.
7348 pub fn insert(&self) -> super::builder::network_attachments::Insert {
7349 super::builder::network_attachments::Insert::new(self.inner.clone())
7350 }
7351
7352 /// Lists the NetworkAttachments for a project in the given scope.
7353 pub fn list(&self) -> super::builder::network_attachments::List {
7354 super::builder::network_attachments::List::new(self.inner.clone())
7355 }
7356
7357 /// Patches the specified NetworkAttachment resource with the data included in
7358 /// the request. This method supports PATCH
7359 /// semantics and usesJSON merge
7360 /// patch format and processing rules.
7361 pub fn patch(&self) -> super::builder::network_attachments::Patch {
7362 super::builder::network_attachments::Patch::new(self.inner.clone())
7363 }
7364
7365 /// Sets the access control policy on the specified resource.
7366 /// Replaces any existing policy.
7367 pub fn set_iam_policy(&self) -> super::builder::network_attachments::SetIamPolicy {
7368 super::builder::network_attachments::SetIamPolicy::new(self.inner.clone())
7369 }
7370
7371 /// Returns permissions that a caller has on the specified resource.
7372 pub fn test_iam_permissions(&self) -> super::builder::network_attachments::TestIamPermissions {
7373 super::builder::network_attachments::TestIamPermissions::new(self.inner.clone())
7374 }
7375
7376 /// Retrieves the specified region-specific Operations resource.
7377 pub fn get_operation(&self) -> super::builder::network_attachments::GetOperation {
7378 super::builder::network_attachments::GetOperation::new(self.inner.clone())
7379 }
7380}
7381
7382/// Implements a client for the Google Compute Engine API.
7383///
7384/// # Example
7385/// ```
7386/// # async fn sample() -> gax::client_builder::Result<()> {
7387/// # use google_cloud_compute_v1::client::NetworkEdgeSecurityServices;
7388/// let client = NetworkEdgeSecurityServices::builder().build().await?;
7389/// // use `client` to make requests to the Google Compute Engine API.
7390/// # Ok(()) }
7391/// ```
7392///
7393/// # Service Description
7394///
7395/// Service for the `networkEdgeSecurityServices` resource.
7396///
7397/// # Configuration
7398///
7399/// To configure `NetworkEdgeSecurityServices` use the `with_*` methods in the type returned
7400/// by [builder()][NetworkEdgeSecurityServices::builder]. The default configuration should
7401/// work for most applications. Common configuration changes include
7402///
7403/// * [with_endpoint()]: by default this client uses the global default endpoint
7404/// (`https://compute.googleapis.com`). Applications using regional
7405/// endpoints or running in restricted networks (e.g. a network configured
7406// with [Private Google Access with VPC Service Controls]) may want to
7407/// override this default.
7408/// * [with_credentials()]: by default this client uses
7409/// [Application Default Credentials]. Applications using custom
7410/// authentication may need to override this default.
7411///
7412/// [with_endpoint()]: super::builder::network_edge_security_services::ClientBuilder::with_endpoint
7413/// [with_credentials()]: super::builder::network_edge_security_services::ClientBuilder::credentials
7414/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7415/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7416///
7417/// # Pooling and Cloning
7418///
7419/// `NetworkEdgeSecurityServices` holds a connection pool internally, it is advised to
7420/// create one and the reuse it. You do not need to wrap `NetworkEdgeSecurityServices` in
7421/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7422/// already uses an `Arc` internally.
7423#[cfg(feature = "network-edge-security-services")]
7424#[cfg_attr(docsrs, doc(cfg(feature = "network-edge-security-services")))]
7425#[derive(Clone, Debug)]
7426pub struct NetworkEdgeSecurityServices {
7427 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkEdgeSecurityServices>,
7428}
7429
7430#[cfg(feature = "network-edge-security-services")]
7431impl NetworkEdgeSecurityServices {
7432 /// Returns a builder for [NetworkEdgeSecurityServices].
7433 ///
7434 /// ```
7435 /// # async fn sample() -> gax::client_builder::Result<()> {
7436 /// # use google_cloud_compute_v1::client::NetworkEdgeSecurityServices;
7437 /// let client = NetworkEdgeSecurityServices::builder().build().await?;
7438 /// # Ok(()) }
7439 /// ```
7440 pub fn builder() -> super::builder::network_edge_security_services::ClientBuilder {
7441 gax::client_builder::internal::new_builder(
7442 super::builder::network_edge_security_services::client::Factory,
7443 )
7444 }
7445
7446 /// Creates a new client from the provided stub.
7447 ///
7448 /// The most common case for calling this function is in tests mocking the
7449 /// client's behavior.
7450 pub fn from_stub<T>(stub: T) -> Self
7451 where
7452 T: super::stub::NetworkEdgeSecurityServices + 'static,
7453 {
7454 Self {
7455 inner: std::sync::Arc::new(stub),
7456 }
7457 }
7458
7459 pub(crate) async fn new(
7460 config: gaxi::options::ClientConfig,
7461 ) -> gax::client_builder::Result<Self> {
7462 let inner = Self::build_inner(config).await?;
7463 Ok(Self { inner })
7464 }
7465
7466 async fn build_inner(
7467 conf: gaxi::options::ClientConfig,
7468 ) -> gax::client_builder::Result<
7469 std::sync::Arc<dyn super::stub::dynamic::NetworkEdgeSecurityServices>,
7470 > {
7471 if gaxi::options::tracing_enabled(&conf) {
7472 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7473 }
7474 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7475 }
7476
7477 async fn build_transport(
7478 conf: gaxi::options::ClientConfig,
7479 ) -> gax::client_builder::Result<impl super::stub::NetworkEdgeSecurityServices> {
7480 super::transport::NetworkEdgeSecurityServices::new(conf).await
7481 }
7482
7483 async fn build_with_tracing(
7484 conf: gaxi::options::ClientConfig,
7485 ) -> gax::client_builder::Result<impl super::stub::NetworkEdgeSecurityServices> {
7486 Self::build_transport(conf)
7487 .await
7488 .map(super::tracing::NetworkEdgeSecurityServices::new)
7489 }
7490
7491 /// Retrieves the list of all NetworkEdgeSecurityService resources available to
7492 /// the specified project.
7493 ///
7494 /// To prevent failure, Google recommends that you set the
7495 /// `returnPartialSuccess` parameter to `true`.
7496 pub fn aggregated_list(
7497 &self,
7498 ) -> super::builder::network_edge_security_services::AggregatedList {
7499 super::builder::network_edge_security_services::AggregatedList::new(self.inner.clone())
7500 }
7501
7502 /// Deletes the specified service.
7503 pub fn delete(&self) -> super::builder::network_edge_security_services::Delete {
7504 super::builder::network_edge_security_services::Delete::new(self.inner.clone())
7505 }
7506
7507 /// Gets a specified NetworkEdgeSecurityService.
7508 pub fn get(&self) -> super::builder::network_edge_security_services::Get {
7509 super::builder::network_edge_security_services::Get::new(self.inner.clone())
7510 }
7511
7512 /// Creates a new service in the specified project using the data included in
7513 /// the request.
7514 pub fn insert(&self) -> super::builder::network_edge_security_services::Insert {
7515 super::builder::network_edge_security_services::Insert::new(self.inner.clone())
7516 }
7517
7518 /// Patches the specified policy with the data included in the request.
7519 pub fn patch(&self) -> super::builder::network_edge_security_services::Patch {
7520 super::builder::network_edge_security_services::Patch::new(self.inner.clone())
7521 }
7522
7523 /// Retrieves the specified region-specific Operations resource.
7524 pub fn get_operation(&self) -> super::builder::network_edge_security_services::GetOperation {
7525 super::builder::network_edge_security_services::GetOperation::new(self.inner.clone())
7526 }
7527}
7528
7529/// Implements a client for the Google Compute Engine API.
7530///
7531/// # Example
7532/// ```
7533/// # async fn sample() -> gax::client_builder::Result<()> {
7534/// # use google_cloud_compute_v1::client::NetworkEndpointGroups;
7535/// let client = NetworkEndpointGroups::builder().build().await?;
7536/// // use `client` to make requests to the Google Compute Engine API.
7537/// # Ok(()) }
7538/// ```
7539///
7540/// # Service Description
7541///
7542/// Service for the `networkEndpointGroups` resource.
7543///
7544/// # Configuration
7545///
7546/// To configure `NetworkEndpointGroups` use the `with_*` methods in the type returned
7547/// by [builder()][NetworkEndpointGroups::builder]. The default configuration should
7548/// work for most applications. Common configuration changes include
7549///
7550/// * [with_endpoint()]: by default this client uses the global default endpoint
7551/// (`https://compute.googleapis.com`). Applications using regional
7552/// endpoints or running in restricted networks (e.g. a network configured
7553// with [Private Google Access with VPC Service Controls]) may want to
7554/// override this default.
7555/// * [with_credentials()]: by default this client uses
7556/// [Application Default Credentials]. Applications using custom
7557/// authentication may need to override this default.
7558///
7559/// [with_endpoint()]: super::builder::network_endpoint_groups::ClientBuilder::with_endpoint
7560/// [with_credentials()]: super::builder::network_endpoint_groups::ClientBuilder::credentials
7561/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7562/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7563///
7564/// # Pooling and Cloning
7565///
7566/// `NetworkEndpointGroups` holds a connection pool internally, it is advised to
7567/// create one and the reuse it. You do not need to wrap `NetworkEndpointGroups` in
7568/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7569/// already uses an `Arc` internally.
7570#[cfg(feature = "network-endpoint-groups")]
7571#[cfg_attr(docsrs, doc(cfg(feature = "network-endpoint-groups")))]
7572#[derive(Clone, Debug)]
7573pub struct NetworkEndpointGroups {
7574 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkEndpointGroups>,
7575}
7576
7577#[cfg(feature = "network-endpoint-groups")]
7578impl NetworkEndpointGroups {
7579 /// Returns a builder for [NetworkEndpointGroups].
7580 ///
7581 /// ```
7582 /// # async fn sample() -> gax::client_builder::Result<()> {
7583 /// # use google_cloud_compute_v1::client::NetworkEndpointGroups;
7584 /// let client = NetworkEndpointGroups::builder().build().await?;
7585 /// # Ok(()) }
7586 /// ```
7587 pub fn builder() -> super::builder::network_endpoint_groups::ClientBuilder {
7588 gax::client_builder::internal::new_builder(
7589 super::builder::network_endpoint_groups::client::Factory,
7590 )
7591 }
7592
7593 /// Creates a new client from the provided stub.
7594 ///
7595 /// The most common case for calling this function is in tests mocking the
7596 /// client's behavior.
7597 pub fn from_stub<T>(stub: T) -> Self
7598 where
7599 T: super::stub::NetworkEndpointGroups + 'static,
7600 {
7601 Self {
7602 inner: std::sync::Arc::new(stub),
7603 }
7604 }
7605
7606 pub(crate) async fn new(
7607 config: gaxi::options::ClientConfig,
7608 ) -> gax::client_builder::Result<Self> {
7609 let inner = Self::build_inner(config).await?;
7610 Ok(Self { inner })
7611 }
7612
7613 async fn build_inner(
7614 conf: gaxi::options::ClientConfig,
7615 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::NetworkEndpointGroups>>
7616 {
7617 if gaxi::options::tracing_enabled(&conf) {
7618 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7619 }
7620 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7621 }
7622
7623 async fn build_transport(
7624 conf: gaxi::options::ClientConfig,
7625 ) -> gax::client_builder::Result<impl super::stub::NetworkEndpointGroups> {
7626 super::transport::NetworkEndpointGroups::new(conf).await
7627 }
7628
7629 async fn build_with_tracing(
7630 conf: gaxi::options::ClientConfig,
7631 ) -> gax::client_builder::Result<impl super::stub::NetworkEndpointGroups> {
7632 Self::build_transport(conf)
7633 .await
7634 .map(super::tracing::NetworkEndpointGroups::new)
7635 }
7636
7637 /// Retrieves the list of network endpoint groups and sorts them by zone.
7638 ///
7639 /// To prevent failure, Google recommends that you set the
7640 /// `returnPartialSuccess` parameter to `true`.
7641 pub fn aggregated_list(&self) -> super::builder::network_endpoint_groups::AggregatedList {
7642 super::builder::network_endpoint_groups::AggregatedList::new(self.inner.clone())
7643 }
7644
7645 /// Attach a list of network endpoints to the specified network endpoint group.
7646 pub fn attach_network_endpoints(
7647 &self,
7648 ) -> super::builder::network_endpoint_groups::AttachNetworkEndpoints {
7649 super::builder::network_endpoint_groups::AttachNetworkEndpoints::new(self.inner.clone())
7650 }
7651
7652 /// Deletes the specified network endpoint group. The network endpoints in the
7653 /// NEG and the VM instances they belong to are not terminated when the NEG is
7654 /// deleted. Note that the NEG cannot be deleted if there are backend services
7655 /// referencing it.
7656 pub fn delete(&self) -> super::builder::network_endpoint_groups::Delete {
7657 super::builder::network_endpoint_groups::Delete::new(self.inner.clone())
7658 }
7659
7660 /// Detach a list of network endpoints from the specified network endpoint
7661 /// group.
7662 pub fn detach_network_endpoints(
7663 &self,
7664 ) -> super::builder::network_endpoint_groups::DetachNetworkEndpoints {
7665 super::builder::network_endpoint_groups::DetachNetworkEndpoints::new(self.inner.clone())
7666 }
7667
7668 /// Returns the specified network endpoint group.
7669 pub fn get(&self) -> super::builder::network_endpoint_groups::Get {
7670 super::builder::network_endpoint_groups::Get::new(self.inner.clone())
7671 }
7672
7673 /// Creates a network endpoint group in the specified project using the
7674 /// parameters that are included in the request.
7675 pub fn insert(&self) -> super::builder::network_endpoint_groups::Insert {
7676 super::builder::network_endpoint_groups::Insert::new(self.inner.clone())
7677 }
7678
7679 /// Retrieves the list of network endpoint groups that are located in the
7680 /// specified project and zone.
7681 pub fn list(&self) -> super::builder::network_endpoint_groups::List {
7682 super::builder::network_endpoint_groups::List::new(self.inner.clone())
7683 }
7684
7685 /// Lists the network endpoints in the specified network endpoint group.
7686 pub fn list_network_endpoints(
7687 &self,
7688 ) -> super::builder::network_endpoint_groups::ListNetworkEndpoints {
7689 super::builder::network_endpoint_groups::ListNetworkEndpoints::new(self.inner.clone())
7690 }
7691
7692 /// Returns permissions that a caller has on the specified resource.
7693 pub fn test_iam_permissions(
7694 &self,
7695 ) -> super::builder::network_endpoint_groups::TestIamPermissions {
7696 super::builder::network_endpoint_groups::TestIamPermissions::new(self.inner.clone())
7697 }
7698
7699 /// Retrieves the specified zone-specific Operations resource.
7700 pub fn get_operation(&self) -> super::builder::network_endpoint_groups::GetOperation {
7701 super::builder::network_endpoint_groups::GetOperation::new(self.inner.clone())
7702 }
7703}
7704
7705/// Implements a client for the Google Compute Engine API.
7706///
7707/// # Example
7708/// ```
7709/// # async fn sample() -> gax::client_builder::Result<()> {
7710/// # use google_cloud_compute_v1::client::NetworkFirewallPolicies;
7711/// let client = NetworkFirewallPolicies::builder().build().await?;
7712/// // use `client` to make requests to the Google Compute Engine API.
7713/// # Ok(()) }
7714/// ```
7715///
7716/// # Service Description
7717///
7718/// Service for the `networkFirewallPolicies` resource.
7719///
7720/// # Configuration
7721///
7722/// To configure `NetworkFirewallPolicies` use the `with_*` methods in the type returned
7723/// by [builder()][NetworkFirewallPolicies::builder]. The default configuration should
7724/// work for most applications. Common configuration changes include
7725///
7726/// * [with_endpoint()]: by default this client uses the global default endpoint
7727/// (`https://compute.googleapis.com`). Applications using regional
7728/// endpoints or running in restricted networks (e.g. a network configured
7729// with [Private Google Access with VPC Service Controls]) may want to
7730/// override this default.
7731/// * [with_credentials()]: by default this client uses
7732/// [Application Default Credentials]. Applications using custom
7733/// authentication may need to override this default.
7734///
7735/// [with_endpoint()]: super::builder::network_firewall_policies::ClientBuilder::with_endpoint
7736/// [with_credentials()]: super::builder::network_firewall_policies::ClientBuilder::credentials
7737/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7738/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7739///
7740/// # Pooling and Cloning
7741///
7742/// `NetworkFirewallPolicies` holds a connection pool internally, it is advised to
7743/// create one and the reuse it. You do not need to wrap `NetworkFirewallPolicies` in
7744/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7745/// already uses an `Arc` internally.
7746#[cfg(feature = "network-firewall-policies")]
7747#[cfg_attr(docsrs, doc(cfg(feature = "network-firewall-policies")))]
7748#[derive(Clone, Debug)]
7749pub struct NetworkFirewallPolicies {
7750 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkFirewallPolicies>,
7751}
7752
7753#[cfg(feature = "network-firewall-policies")]
7754impl NetworkFirewallPolicies {
7755 /// Returns a builder for [NetworkFirewallPolicies].
7756 ///
7757 /// ```
7758 /// # async fn sample() -> gax::client_builder::Result<()> {
7759 /// # use google_cloud_compute_v1::client::NetworkFirewallPolicies;
7760 /// let client = NetworkFirewallPolicies::builder().build().await?;
7761 /// # Ok(()) }
7762 /// ```
7763 pub fn builder() -> super::builder::network_firewall_policies::ClientBuilder {
7764 gax::client_builder::internal::new_builder(
7765 super::builder::network_firewall_policies::client::Factory,
7766 )
7767 }
7768
7769 /// Creates a new client from the provided stub.
7770 ///
7771 /// The most common case for calling this function is in tests mocking the
7772 /// client's behavior.
7773 pub fn from_stub<T>(stub: T) -> Self
7774 where
7775 T: super::stub::NetworkFirewallPolicies + 'static,
7776 {
7777 Self {
7778 inner: std::sync::Arc::new(stub),
7779 }
7780 }
7781
7782 pub(crate) async fn new(
7783 config: gaxi::options::ClientConfig,
7784 ) -> gax::client_builder::Result<Self> {
7785 let inner = Self::build_inner(config).await?;
7786 Ok(Self { inner })
7787 }
7788
7789 async fn build_inner(
7790 conf: gaxi::options::ClientConfig,
7791 ) -> gax::client_builder::Result<
7792 std::sync::Arc<dyn super::stub::dynamic::NetworkFirewallPolicies>,
7793 > {
7794 if gaxi::options::tracing_enabled(&conf) {
7795 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7796 }
7797 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7798 }
7799
7800 async fn build_transport(
7801 conf: gaxi::options::ClientConfig,
7802 ) -> gax::client_builder::Result<impl super::stub::NetworkFirewallPolicies> {
7803 super::transport::NetworkFirewallPolicies::new(conf).await
7804 }
7805
7806 async fn build_with_tracing(
7807 conf: gaxi::options::ClientConfig,
7808 ) -> gax::client_builder::Result<impl super::stub::NetworkFirewallPolicies> {
7809 Self::build_transport(conf)
7810 .await
7811 .map(super::tracing::NetworkFirewallPolicies::new)
7812 }
7813
7814 /// Inserts an association for the specified firewall policy.
7815 pub fn add_association(&self) -> super::builder::network_firewall_policies::AddAssociation {
7816 super::builder::network_firewall_policies::AddAssociation::new(self.inner.clone())
7817 }
7818
7819 /// Inserts a packet mirroring rule into a firewall policy.
7820 pub fn add_packet_mirroring_rule(
7821 &self,
7822 ) -> super::builder::network_firewall_policies::AddPacketMirroringRule {
7823 super::builder::network_firewall_policies::AddPacketMirroringRule::new(self.inner.clone())
7824 }
7825
7826 /// Inserts a rule into a firewall policy.
7827 pub fn add_rule(&self) -> super::builder::network_firewall_policies::AddRule {
7828 super::builder::network_firewall_policies::AddRule::new(self.inner.clone())
7829 }
7830
7831 /// Retrieves an aggregated list of network firewall policies, listing network
7832 /// firewall policies from all applicable scopes (global and regional) and
7833 /// grouping the results per scope.
7834 ///
7835 /// To prevent failure, it is recommended that you set the
7836 /// `returnPartialSuccess` parameter to `true`.
7837 pub fn aggregated_list(&self) -> super::builder::network_firewall_policies::AggregatedList {
7838 super::builder::network_firewall_policies::AggregatedList::new(self.inner.clone())
7839 }
7840
7841 /// Copies rules to the specified firewall policy.
7842 pub fn clone_rules(&self) -> super::builder::network_firewall_policies::CloneRules {
7843 super::builder::network_firewall_policies::CloneRules::new(self.inner.clone())
7844 }
7845
7846 /// Deletes the specified policy.
7847 pub fn delete(&self) -> super::builder::network_firewall_policies::Delete {
7848 super::builder::network_firewall_policies::Delete::new(self.inner.clone())
7849 }
7850
7851 /// Returns the specified network firewall policy.
7852 pub fn get(&self) -> super::builder::network_firewall_policies::Get {
7853 super::builder::network_firewall_policies::Get::new(self.inner.clone())
7854 }
7855
7856 /// Gets an association with the specified name.
7857 pub fn get_association(&self) -> super::builder::network_firewall_policies::GetAssociation {
7858 super::builder::network_firewall_policies::GetAssociation::new(self.inner.clone())
7859 }
7860
7861 /// Gets the access control policy for a resource. May be empty if no such
7862 /// policy or resource exists.
7863 pub fn get_iam_policy(&self) -> super::builder::network_firewall_policies::GetIamPolicy {
7864 super::builder::network_firewall_policies::GetIamPolicy::new(self.inner.clone())
7865 }
7866
7867 /// Gets a packet mirroring rule of the specified priority.
7868 pub fn get_packet_mirroring_rule(
7869 &self,
7870 ) -> super::builder::network_firewall_policies::GetPacketMirroringRule {
7871 super::builder::network_firewall_policies::GetPacketMirroringRule::new(self.inner.clone())
7872 }
7873
7874 /// Gets a rule of the specified priority.
7875 pub fn get_rule(&self) -> super::builder::network_firewall_policies::GetRule {
7876 super::builder::network_firewall_policies::GetRule::new(self.inner.clone())
7877 }
7878
7879 /// Creates a new policy in the specified project using the data included in
7880 /// the request.
7881 pub fn insert(&self) -> super::builder::network_firewall_policies::Insert {
7882 super::builder::network_firewall_policies::Insert::new(self.inner.clone())
7883 }
7884
7885 /// Lists all the policies that have been configured for the specified project.
7886 pub fn list(&self) -> super::builder::network_firewall_policies::List {
7887 super::builder::network_firewall_policies::List::new(self.inner.clone())
7888 }
7889
7890 /// Patches the specified policy with the data included in the request.
7891 pub fn patch(&self) -> super::builder::network_firewall_policies::Patch {
7892 super::builder::network_firewall_policies::Patch::new(self.inner.clone())
7893 }
7894
7895 /// Patches a packet mirroring rule of the specified priority.
7896 pub fn patch_packet_mirroring_rule(
7897 &self,
7898 ) -> super::builder::network_firewall_policies::PatchPacketMirroringRule {
7899 super::builder::network_firewall_policies::PatchPacketMirroringRule::new(self.inner.clone())
7900 }
7901
7902 /// Patches a rule of the specified priority.
7903 pub fn patch_rule(&self) -> super::builder::network_firewall_policies::PatchRule {
7904 super::builder::network_firewall_policies::PatchRule::new(self.inner.clone())
7905 }
7906
7907 /// Removes an association for the specified firewall policy.
7908 pub fn remove_association(
7909 &self,
7910 ) -> super::builder::network_firewall_policies::RemoveAssociation {
7911 super::builder::network_firewall_policies::RemoveAssociation::new(self.inner.clone())
7912 }
7913
7914 /// Deletes a packet mirroring rule of the specified priority.
7915 pub fn remove_packet_mirroring_rule(
7916 &self,
7917 ) -> super::builder::network_firewall_policies::RemovePacketMirroringRule {
7918 super::builder::network_firewall_policies::RemovePacketMirroringRule::new(
7919 self.inner.clone(),
7920 )
7921 }
7922
7923 /// Deletes a rule of the specified priority.
7924 pub fn remove_rule(&self) -> super::builder::network_firewall_policies::RemoveRule {
7925 super::builder::network_firewall_policies::RemoveRule::new(self.inner.clone())
7926 }
7927
7928 /// Sets the access control policy on the specified resource.
7929 /// Replaces any existing policy.
7930 pub fn set_iam_policy(&self) -> super::builder::network_firewall_policies::SetIamPolicy {
7931 super::builder::network_firewall_policies::SetIamPolicy::new(self.inner.clone())
7932 }
7933
7934 /// Returns permissions that a caller has on the specified resource.
7935 pub fn test_iam_permissions(
7936 &self,
7937 ) -> super::builder::network_firewall_policies::TestIamPermissions {
7938 super::builder::network_firewall_policies::TestIamPermissions::new(self.inner.clone())
7939 }
7940
7941 /// Retrieves the specified Operations resource.
7942 pub fn get_operation(&self) -> super::builder::network_firewall_policies::GetOperation {
7943 super::builder::network_firewall_policies::GetOperation::new(self.inner.clone())
7944 }
7945}
7946
7947/// Implements a client for the Google Compute Engine API.
7948///
7949/// # Example
7950/// ```
7951/// # async fn sample() -> gax::client_builder::Result<()> {
7952/// # use google_cloud_compute_v1::client::NetworkProfiles;
7953/// let client = NetworkProfiles::builder().build().await?;
7954/// // use `client` to make requests to the Google Compute Engine API.
7955/// # Ok(()) }
7956/// ```
7957///
7958/// # Service Description
7959///
7960/// Service for the `networkProfiles` resource.
7961///
7962/// # Configuration
7963///
7964/// To configure `NetworkProfiles` use the `with_*` methods in the type returned
7965/// by [builder()][NetworkProfiles::builder]. The default configuration should
7966/// work for most applications. Common configuration changes include
7967///
7968/// * [with_endpoint()]: by default this client uses the global default endpoint
7969/// (`https://compute.googleapis.com`). Applications using regional
7970/// endpoints or running in restricted networks (e.g. a network configured
7971// with [Private Google Access with VPC Service Controls]) may want to
7972/// override this default.
7973/// * [with_credentials()]: by default this client uses
7974/// [Application Default Credentials]. Applications using custom
7975/// authentication may need to override this default.
7976///
7977/// [with_endpoint()]: super::builder::network_profiles::ClientBuilder::with_endpoint
7978/// [with_credentials()]: super::builder::network_profiles::ClientBuilder::credentials
7979/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7980/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7981///
7982/// # Pooling and Cloning
7983///
7984/// `NetworkProfiles` holds a connection pool internally, it is advised to
7985/// create one and the reuse it. You do not need to wrap `NetworkProfiles` in
7986/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7987/// already uses an `Arc` internally.
7988#[cfg(feature = "network-profiles")]
7989#[cfg_attr(docsrs, doc(cfg(feature = "network-profiles")))]
7990#[derive(Clone, Debug)]
7991pub struct NetworkProfiles {
7992 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkProfiles>,
7993}
7994
7995#[cfg(feature = "network-profiles")]
7996impl NetworkProfiles {
7997 /// Returns a builder for [NetworkProfiles].
7998 ///
7999 /// ```
8000 /// # async fn sample() -> gax::client_builder::Result<()> {
8001 /// # use google_cloud_compute_v1::client::NetworkProfiles;
8002 /// let client = NetworkProfiles::builder().build().await?;
8003 /// # Ok(()) }
8004 /// ```
8005 pub fn builder() -> super::builder::network_profiles::ClientBuilder {
8006 gax::client_builder::internal::new_builder(
8007 super::builder::network_profiles::client::Factory,
8008 )
8009 }
8010
8011 /// Creates a new client from the provided stub.
8012 ///
8013 /// The most common case for calling this function is in tests mocking the
8014 /// client's behavior.
8015 pub fn from_stub<T>(stub: T) -> Self
8016 where
8017 T: super::stub::NetworkProfiles + 'static,
8018 {
8019 Self {
8020 inner: std::sync::Arc::new(stub),
8021 }
8022 }
8023
8024 pub(crate) async fn new(
8025 config: gaxi::options::ClientConfig,
8026 ) -> gax::client_builder::Result<Self> {
8027 let inner = Self::build_inner(config).await?;
8028 Ok(Self { inner })
8029 }
8030
8031 async fn build_inner(
8032 conf: gaxi::options::ClientConfig,
8033 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::NetworkProfiles>>
8034 {
8035 if gaxi::options::tracing_enabled(&conf) {
8036 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8037 }
8038 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8039 }
8040
8041 async fn build_transport(
8042 conf: gaxi::options::ClientConfig,
8043 ) -> gax::client_builder::Result<impl super::stub::NetworkProfiles> {
8044 super::transport::NetworkProfiles::new(conf).await
8045 }
8046
8047 async fn build_with_tracing(
8048 conf: gaxi::options::ClientConfig,
8049 ) -> gax::client_builder::Result<impl super::stub::NetworkProfiles> {
8050 Self::build_transport(conf)
8051 .await
8052 .map(super::tracing::NetworkProfiles::new)
8053 }
8054
8055 /// Returns the specified network profile.
8056 pub fn get(&self) -> super::builder::network_profiles::Get {
8057 super::builder::network_profiles::Get::new(self.inner.clone())
8058 }
8059
8060 /// Retrieves a list of network profiles available to the specified
8061 /// project.
8062 pub fn list(&self) -> super::builder::network_profiles::List {
8063 super::builder::network_profiles::List::new(self.inner.clone())
8064 }
8065}
8066
8067/// Implements a client for the Google Compute Engine API.
8068///
8069/// # Example
8070/// ```
8071/// # async fn sample() -> gax::client_builder::Result<()> {
8072/// # use google_cloud_compute_v1::client::Networks;
8073/// let client = Networks::builder().build().await?;
8074/// // use `client` to make requests to the Google Compute Engine API.
8075/// # Ok(()) }
8076/// ```
8077///
8078/// # Service Description
8079///
8080/// Service for the `networks` resource.
8081///
8082/// # Configuration
8083///
8084/// To configure `Networks` use the `with_*` methods in the type returned
8085/// by [builder()][Networks::builder]. The default configuration should
8086/// work for most applications. Common configuration changes include
8087///
8088/// * [with_endpoint()]: by default this client uses the global default endpoint
8089/// (`https://compute.googleapis.com`). Applications using regional
8090/// endpoints or running in restricted networks (e.g. a network configured
8091// with [Private Google Access with VPC Service Controls]) may want to
8092/// override this default.
8093/// * [with_credentials()]: by default this client uses
8094/// [Application Default Credentials]. Applications using custom
8095/// authentication may need to override this default.
8096///
8097/// [with_endpoint()]: super::builder::networks::ClientBuilder::with_endpoint
8098/// [with_credentials()]: super::builder::networks::ClientBuilder::credentials
8099/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8100/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8101///
8102/// # Pooling and Cloning
8103///
8104/// `Networks` holds a connection pool internally, it is advised to
8105/// create one and the reuse it. You do not need to wrap `Networks` in
8106/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8107/// already uses an `Arc` internally.
8108#[cfg(feature = "networks")]
8109#[cfg_attr(docsrs, doc(cfg(feature = "networks")))]
8110#[derive(Clone, Debug)]
8111pub struct Networks {
8112 inner: std::sync::Arc<dyn super::stub::dynamic::Networks>,
8113}
8114
8115#[cfg(feature = "networks")]
8116impl Networks {
8117 /// Returns a builder for [Networks].
8118 ///
8119 /// ```
8120 /// # async fn sample() -> gax::client_builder::Result<()> {
8121 /// # use google_cloud_compute_v1::client::Networks;
8122 /// let client = Networks::builder().build().await?;
8123 /// # Ok(()) }
8124 /// ```
8125 pub fn builder() -> super::builder::networks::ClientBuilder {
8126 gax::client_builder::internal::new_builder(super::builder::networks::client::Factory)
8127 }
8128
8129 /// Creates a new client from the provided stub.
8130 ///
8131 /// The most common case for calling this function is in tests mocking the
8132 /// client's behavior.
8133 pub fn from_stub<T>(stub: T) -> Self
8134 where
8135 T: super::stub::Networks + 'static,
8136 {
8137 Self {
8138 inner: std::sync::Arc::new(stub),
8139 }
8140 }
8141
8142 pub(crate) async fn new(
8143 config: gaxi::options::ClientConfig,
8144 ) -> gax::client_builder::Result<Self> {
8145 let inner = Self::build_inner(config).await?;
8146 Ok(Self { inner })
8147 }
8148
8149 async fn build_inner(
8150 conf: gaxi::options::ClientConfig,
8151 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Networks>> {
8152 if gaxi::options::tracing_enabled(&conf) {
8153 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8154 }
8155 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8156 }
8157
8158 async fn build_transport(
8159 conf: gaxi::options::ClientConfig,
8160 ) -> gax::client_builder::Result<impl super::stub::Networks> {
8161 super::transport::Networks::new(conf).await
8162 }
8163
8164 async fn build_with_tracing(
8165 conf: gaxi::options::ClientConfig,
8166 ) -> gax::client_builder::Result<impl super::stub::Networks> {
8167 Self::build_transport(conf)
8168 .await
8169 .map(super::tracing::Networks::new)
8170 }
8171
8172 /// Adds a peering to the specified network.
8173 pub fn add_peering(&self) -> super::builder::networks::AddPeering {
8174 super::builder::networks::AddPeering::new(self.inner.clone())
8175 }
8176
8177 /// Deletes the specified network.
8178 pub fn delete(&self) -> super::builder::networks::Delete {
8179 super::builder::networks::Delete::new(self.inner.clone())
8180 }
8181
8182 /// Returns the specified network.
8183 pub fn get(&self) -> super::builder::networks::Get {
8184 super::builder::networks::Get::new(self.inner.clone())
8185 }
8186
8187 /// Returns the effective firewalls on a given network.
8188 pub fn get_effective_firewalls(&self) -> super::builder::networks::GetEffectiveFirewalls {
8189 super::builder::networks::GetEffectiveFirewalls::new(self.inner.clone())
8190 }
8191
8192 /// Creates a network in the specified project using the data included
8193 /// in the request.
8194 pub fn insert(&self) -> super::builder::networks::Insert {
8195 super::builder::networks::Insert::new(self.inner.clone())
8196 }
8197
8198 /// Retrieves the list of networks available to the specified project.
8199 pub fn list(&self) -> super::builder::networks::List {
8200 super::builder::networks::List::new(self.inner.clone())
8201 }
8202
8203 /// Lists the peering routes exchanged over peering connection.
8204 pub fn list_peering_routes(&self) -> super::builder::networks::ListPeeringRoutes {
8205 super::builder::networks::ListPeeringRoutes::new(self.inner.clone())
8206 }
8207
8208 /// Patches the specified network with the data included in the request.
8209 /// Only routingConfig can be modified.
8210 pub fn patch(&self) -> super::builder::networks::Patch {
8211 super::builder::networks::Patch::new(self.inner.clone())
8212 }
8213
8214 /// Removes a peering from the specified network.
8215 pub fn remove_peering(&self) -> super::builder::networks::RemovePeering {
8216 super::builder::networks::RemovePeering::new(self.inner.clone())
8217 }
8218
8219 /// Requests to remove a peering from the specified network. Applicable only
8220 /// for PeeringConnection with update_strategy=CONSENSUS.
8221 pub fn request_remove_peering(&self) -> super::builder::networks::RequestRemovePeering {
8222 super::builder::networks::RequestRemovePeering::new(self.inner.clone())
8223 }
8224
8225 /// Switches the network mode from auto subnet mode to custom subnet mode.
8226 pub fn switch_to_custom_mode(&self) -> super::builder::networks::SwitchToCustomMode {
8227 super::builder::networks::SwitchToCustomMode::new(self.inner.clone())
8228 }
8229
8230 /// Updates the specified network peering with the data included in the
8231 /// request. You can only modify the NetworkPeering.export_custom_routes field
8232 /// and the NetworkPeering.import_custom_routes field.
8233 pub fn update_peering(&self) -> super::builder::networks::UpdatePeering {
8234 super::builder::networks::UpdatePeering::new(self.inner.clone())
8235 }
8236
8237 /// Retrieves the specified Operations resource.
8238 pub fn get_operation(&self) -> super::builder::networks::GetOperation {
8239 super::builder::networks::GetOperation::new(self.inner.clone())
8240 }
8241}
8242
8243/// Implements a client for the Google Compute Engine API.
8244///
8245/// # Example
8246/// ```
8247/// # async fn sample() -> gax::client_builder::Result<()> {
8248/// # use google_cloud_compute_v1::client::NodeGroups;
8249/// let client = NodeGroups::builder().build().await?;
8250/// // use `client` to make requests to the Google Compute Engine API.
8251/// # Ok(()) }
8252/// ```
8253///
8254/// # Service Description
8255///
8256/// Service for the `nodeGroups` resource.
8257///
8258/// # Configuration
8259///
8260/// To configure `NodeGroups` use the `with_*` methods in the type returned
8261/// by [builder()][NodeGroups::builder]. The default configuration should
8262/// work for most applications. Common configuration changes include
8263///
8264/// * [with_endpoint()]: by default this client uses the global default endpoint
8265/// (`https://compute.googleapis.com`). Applications using regional
8266/// endpoints or running in restricted networks (e.g. a network configured
8267// with [Private Google Access with VPC Service Controls]) may want to
8268/// override this default.
8269/// * [with_credentials()]: by default this client uses
8270/// [Application Default Credentials]. Applications using custom
8271/// authentication may need to override this default.
8272///
8273/// [with_endpoint()]: super::builder::node_groups::ClientBuilder::with_endpoint
8274/// [with_credentials()]: super::builder::node_groups::ClientBuilder::credentials
8275/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8276/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8277///
8278/// # Pooling and Cloning
8279///
8280/// `NodeGroups` holds a connection pool internally, it is advised to
8281/// create one and the reuse it. You do not need to wrap `NodeGroups` in
8282/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8283/// already uses an `Arc` internally.
8284#[cfg(feature = "node-groups")]
8285#[cfg_attr(docsrs, doc(cfg(feature = "node-groups")))]
8286#[derive(Clone, Debug)]
8287pub struct NodeGroups {
8288 inner: std::sync::Arc<dyn super::stub::dynamic::NodeGroups>,
8289}
8290
8291#[cfg(feature = "node-groups")]
8292impl NodeGroups {
8293 /// Returns a builder for [NodeGroups].
8294 ///
8295 /// ```
8296 /// # async fn sample() -> gax::client_builder::Result<()> {
8297 /// # use google_cloud_compute_v1::client::NodeGroups;
8298 /// let client = NodeGroups::builder().build().await?;
8299 /// # Ok(()) }
8300 /// ```
8301 pub fn builder() -> super::builder::node_groups::ClientBuilder {
8302 gax::client_builder::internal::new_builder(super::builder::node_groups::client::Factory)
8303 }
8304
8305 /// Creates a new client from the provided stub.
8306 ///
8307 /// The most common case for calling this function is in tests mocking the
8308 /// client's behavior.
8309 pub fn from_stub<T>(stub: T) -> Self
8310 where
8311 T: super::stub::NodeGroups + 'static,
8312 {
8313 Self {
8314 inner: std::sync::Arc::new(stub),
8315 }
8316 }
8317
8318 pub(crate) async fn new(
8319 config: gaxi::options::ClientConfig,
8320 ) -> gax::client_builder::Result<Self> {
8321 let inner = Self::build_inner(config).await?;
8322 Ok(Self { inner })
8323 }
8324
8325 async fn build_inner(
8326 conf: gaxi::options::ClientConfig,
8327 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::NodeGroups>> {
8328 if gaxi::options::tracing_enabled(&conf) {
8329 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8330 }
8331 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8332 }
8333
8334 async fn build_transport(
8335 conf: gaxi::options::ClientConfig,
8336 ) -> gax::client_builder::Result<impl super::stub::NodeGroups> {
8337 super::transport::NodeGroups::new(conf).await
8338 }
8339
8340 async fn build_with_tracing(
8341 conf: gaxi::options::ClientConfig,
8342 ) -> gax::client_builder::Result<impl super::stub::NodeGroups> {
8343 Self::build_transport(conf)
8344 .await
8345 .map(super::tracing::NodeGroups::new)
8346 }
8347
8348 /// Adds specified number of nodes to the node group.
8349 pub fn add_nodes(&self) -> super::builder::node_groups::AddNodes {
8350 super::builder::node_groups::AddNodes::new(self.inner.clone())
8351 }
8352
8353 /// Retrieves an aggregated list of node groups.
8354 /// Note: use nodeGroups.listNodes for more details about each group.
8355 ///
8356 /// To prevent failure, Google recommends that you set the
8357 /// `returnPartialSuccess` parameter to `true`.
8358 pub fn aggregated_list(&self) -> super::builder::node_groups::AggregatedList {
8359 super::builder::node_groups::AggregatedList::new(self.inner.clone())
8360 }
8361
8362 /// Deletes the specified NodeGroup resource.
8363 pub fn delete(&self) -> super::builder::node_groups::Delete {
8364 super::builder::node_groups::Delete::new(self.inner.clone())
8365 }
8366
8367 /// Deletes specified nodes from the node group.
8368 pub fn delete_nodes(&self) -> super::builder::node_groups::DeleteNodes {
8369 super::builder::node_groups::DeleteNodes::new(self.inner.clone())
8370 }
8371
8372 /// Returns the specified NodeGroup. Get a list of available NodeGroups
8373 /// by making a list() request.
8374 /// Note: the "nodes" field should not be used. Use nodeGroups.listNodes
8375 /// instead.
8376 pub fn get(&self) -> super::builder::node_groups::Get {
8377 super::builder::node_groups::Get::new(self.inner.clone())
8378 }
8379
8380 /// Gets the access control policy for a resource. May be empty if no such
8381 /// policy or resource exists.
8382 pub fn get_iam_policy(&self) -> super::builder::node_groups::GetIamPolicy {
8383 super::builder::node_groups::GetIamPolicy::new(self.inner.clone())
8384 }
8385
8386 /// Creates a NodeGroup resource in the specified project using the data
8387 /// included in the request.
8388 pub fn insert(&self) -> super::builder::node_groups::Insert {
8389 super::builder::node_groups::Insert::new(self.inner.clone())
8390 }
8391
8392 /// Retrieves a list of node groups available to the specified project.
8393 /// Note: use nodeGroups.listNodes for more details about each group.
8394 pub fn list(&self) -> super::builder::node_groups::List {
8395 super::builder::node_groups::List::new(self.inner.clone())
8396 }
8397
8398 /// Lists nodes in the node group.
8399 pub fn list_nodes(&self) -> super::builder::node_groups::ListNodes {
8400 super::builder::node_groups::ListNodes::new(self.inner.clone())
8401 }
8402
8403 /// Updates the specified node group.
8404 pub fn patch(&self) -> super::builder::node_groups::Patch {
8405 super::builder::node_groups::Patch::new(self.inner.clone())
8406 }
8407
8408 /// Perform maintenance on a subset of nodes in the node group.
8409 pub fn perform_maintenance(&self) -> super::builder::node_groups::PerformMaintenance {
8410 super::builder::node_groups::PerformMaintenance::new(self.inner.clone())
8411 }
8412
8413 /// Sets the access control policy on the specified resource.
8414 /// Replaces any existing policy.
8415 pub fn set_iam_policy(&self) -> super::builder::node_groups::SetIamPolicy {
8416 super::builder::node_groups::SetIamPolicy::new(self.inner.clone())
8417 }
8418
8419 /// Updates the node template of the node group.
8420 pub fn set_node_template(&self) -> super::builder::node_groups::SetNodeTemplate {
8421 super::builder::node_groups::SetNodeTemplate::new(self.inner.clone())
8422 }
8423
8424 /// Simulates maintenance event on specified nodes from the node group.
8425 pub fn simulate_maintenance_event(
8426 &self,
8427 ) -> super::builder::node_groups::SimulateMaintenanceEvent {
8428 super::builder::node_groups::SimulateMaintenanceEvent::new(self.inner.clone())
8429 }
8430
8431 /// Returns permissions that a caller has on the specified resource.
8432 pub fn test_iam_permissions(&self) -> super::builder::node_groups::TestIamPermissions {
8433 super::builder::node_groups::TestIamPermissions::new(self.inner.clone())
8434 }
8435
8436 /// Retrieves the specified zone-specific Operations resource.
8437 pub fn get_operation(&self) -> super::builder::node_groups::GetOperation {
8438 super::builder::node_groups::GetOperation::new(self.inner.clone())
8439 }
8440}
8441
8442/// Implements a client for the Google Compute Engine API.
8443///
8444/// # Example
8445/// ```
8446/// # async fn sample() -> gax::client_builder::Result<()> {
8447/// # use google_cloud_compute_v1::client::NodeTemplates;
8448/// let client = NodeTemplates::builder().build().await?;
8449/// // use `client` to make requests to the Google Compute Engine API.
8450/// # Ok(()) }
8451/// ```
8452///
8453/// # Service Description
8454///
8455/// Service for the `nodeTemplates` resource.
8456///
8457/// # Configuration
8458///
8459/// To configure `NodeTemplates` use the `with_*` methods in the type returned
8460/// by [builder()][NodeTemplates::builder]. The default configuration should
8461/// work for most applications. Common configuration changes include
8462///
8463/// * [with_endpoint()]: by default this client uses the global default endpoint
8464/// (`https://compute.googleapis.com`). Applications using regional
8465/// endpoints or running in restricted networks (e.g. a network configured
8466// with [Private Google Access with VPC Service Controls]) may want to
8467/// override this default.
8468/// * [with_credentials()]: by default this client uses
8469/// [Application Default Credentials]. Applications using custom
8470/// authentication may need to override this default.
8471///
8472/// [with_endpoint()]: super::builder::node_templates::ClientBuilder::with_endpoint
8473/// [with_credentials()]: super::builder::node_templates::ClientBuilder::credentials
8474/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8475/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8476///
8477/// # Pooling and Cloning
8478///
8479/// `NodeTemplates` holds a connection pool internally, it is advised to
8480/// create one and the reuse it. You do not need to wrap `NodeTemplates` in
8481/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8482/// already uses an `Arc` internally.
8483#[cfg(feature = "node-templates")]
8484#[cfg_attr(docsrs, doc(cfg(feature = "node-templates")))]
8485#[derive(Clone, Debug)]
8486pub struct NodeTemplates {
8487 inner: std::sync::Arc<dyn super::stub::dynamic::NodeTemplates>,
8488}
8489
8490#[cfg(feature = "node-templates")]
8491impl NodeTemplates {
8492 /// Returns a builder for [NodeTemplates].
8493 ///
8494 /// ```
8495 /// # async fn sample() -> gax::client_builder::Result<()> {
8496 /// # use google_cloud_compute_v1::client::NodeTemplates;
8497 /// let client = NodeTemplates::builder().build().await?;
8498 /// # Ok(()) }
8499 /// ```
8500 pub fn builder() -> super::builder::node_templates::ClientBuilder {
8501 gax::client_builder::internal::new_builder(super::builder::node_templates::client::Factory)
8502 }
8503
8504 /// Creates a new client from the provided stub.
8505 ///
8506 /// The most common case for calling this function is in tests mocking the
8507 /// client's behavior.
8508 pub fn from_stub<T>(stub: T) -> Self
8509 where
8510 T: super::stub::NodeTemplates + 'static,
8511 {
8512 Self {
8513 inner: std::sync::Arc::new(stub),
8514 }
8515 }
8516
8517 pub(crate) async fn new(
8518 config: gaxi::options::ClientConfig,
8519 ) -> gax::client_builder::Result<Self> {
8520 let inner = Self::build_inner(config).await?;
8521 Ok(Self { inner })
8522 }
8523
8524 async fn build_inner(
8525 conf: gaxi::options::ClientConfig,
8526 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::NodeTemplates>> {
8527 if gaxi::options::tracing_enabled(&conf) {
8528 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8529 }
8530 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8531 }
8532
8533 async fn build_transport(
8534 conf: gaxi::options::ClientConfig,
8535 ) -> gax::client_builder::Result<impl super::stub::NodeTemplates> {
8536 super::transport::NodeTemplates::new(conf).await
8537 }
8538
8539 async fn build_with_tracing(
8540 conf: gaxi::options::ClientConfig,
8541 ) -> gax::client_builder::Result<impl super::stub::NodeTemplates> {
8542 Self::build_transport(conf)
8543 .await
8544 .map(super::tracing::NodeTemplates::new)
8545 }
8546
8547 /// Retrieves an aggregated list of node templates.
8548 ///
8549 /// To prevent failure, Google recommends that you set the
8550 /// `returnPartialSuccess` parameter to `true`.
8551 pub fn aggregated_list(&self) -> super::builder::node_templates::AggregatedList {
8552 super::builder::node_templates::AggregatedList::new(self.inner.clone())
8553 }
8554
8555 /// Deletes the specified NodeTemplate resource.
8556 pub fn delete(&self) -> super::builder::node_templates::Delete {
8557 super::builder::node_templates::Delete::new(self.inner.clone())
8558 }
8559
8560 /// Returns the specified node template.
8561 pub fn get(&self) -> super::builder::node_templates::Get {
8562 super::builder::node_templates::Get::new(self.inner.clone())
8563 }
8564
8565 /// Gets the access control policy for a resource. May be empty if no such
8566 /// policy or resource exists.
8567 pub fn get_iam_policy(&self) -> super::builder::node_templates::GetIamPolicy {
8568 super::builder::node_templates::GetIamPolicy::new(self.inner.clone())
8569 }
8570
8571 /// Creates a NodeTemplate resource in the specified project using the data
8572 /// included in the request.
8573 pub fn insert(&self) -> super::builder::node_templates::Insert {
8574 super::builder::node_templates::Insert::new(self.inner.clone())
8575 }
8576
8577 /// Retrieves a list of node templates available to the specified
8578 /// project.
8579 pub fn list(&self) -> super::builder::node_templates::List {
8580 super::builder::node_templates::List::new(self.inner.clone())
8581 }
8582
8583 /// Sets the access control policy on the specified resource.
8584 /// Replaces any existing policy.
8585 pub fn set_iam_policy(&self) -> super::builder::node_templates::SetIamPolicy {
8586 super::builder::node_templates::SetIamPolicy::new(self.inner.clone())
8587 }
8588
8589 /// Returns permissions that a caller has on the specified resource.
8590 pub fn test_iam_permissions(&self) -> super::builder::node_templates::TestIamPermissions {
8591 super::builder::node_templates::TestIamPermissions::new(self.inner.clone())
8592 }
8593
8594 /// Retrieves the specified region-specific Operations resource.
8595 pub fn get_operation(&self) -> super::builder::node_templates::GetOperation {
8596 super::builder::node_templates::GetOperation::new(self.inner.clone())
8597 }
8598}
8599
8600/// Implements a client for the Google Compute Engine API.
8601///
8602/// # Example
8603/// ```
8604/// # async fn sample() -> gax::client_builder::Result<()> {
8605/// # use google_cloud_compute_v1::client::NodeTypes;
8606/// let client = NodeTypes::builder().build().await?;
8607/// // use `client` to make requests to the Google Compute Engine API.
8608/// # Ok(()) }
8609/// ```
8610///
8611/// # Service Description
8612///
8613/// Service for the `nodeTypes` resource.
8614///
8615/// # Configuration
8616///
8617/// To configure `NodeTypes` use the `with_*` methods in the type returned
8618/// by [builder()][NodeTypes::builder]. The default configuration should
8619/// work for most applications. Common configuration changes include
8620///
8621/// * [with_endpoint()]: by default this client uses the global default endpoint
8622/// (`https://compute.googleapis.com`). Applications using regional
8623/// endpoints or running in restricted networks (e.g. a network configured
8624// with [Private Google Access with VPC Service Controls]) may want to
8625/// override this default.
8626/// * [with_credentials()]: by default this client uses
8627/// [Application Default Credentials]. Applications using custom
8628/// authentication may need to override this default.
8629///
8630/// [with_endpoint()]: super::builder::node_types::ClientBuilder::with_endpoint
8631/// [with_credentials()]: super::builder::node_types::ClientBuilder::credentials
8632/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8633/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8634///
8635/// # Pooling and Cloning
8636///
8637/// `NodeTypes` holds a connection pool internally, it is advised to
8638/// create one and the reuse it. You do not need to wrap `NodeTypes` in
8639/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8640/// already uses an `Arc` internally.
8641#[cfg(feature = "node-types")]
8642#[cfg_attr(docsrs, doc(cfg(feature = "node-types")))]
8643#[derive(Clone, Debug)]
8644pub struct NodeTypes {
8645 inner: std::sync::Arc<dyn super::stub::dynamic::NodeTypes>,
8646}
8647
8648#[cfg(feature = "node-types")]
8649impl NodeTypes {
8650 /// Returns a builder for [NodeTypes].
8651 ///
8652 /// ```
8653 /// # async fn sample() -> gax::client_builder::Result<()> {
8654 /// # use google_cloud_compute_v1::client::NodeTypes;
8655 /// let client = NodeTypes::builder().build().await?;
8656 /// # Ok(()) }
8657 /// ```
8658 pub fn builder() -> super::builder::node_types::ClientBuilder {
8659 gax::client_builder::internal::new_builder(super::builder::node_types::client::Factory)
8660 }
8661
8662 /// Creates a new client from the provided stub.
8663 ///
8664 /// The most common case for calling this function is in tests mocking the
8665 /// client's behavior.
8666 pub fn from_stub<T>(stub: T) -> Self
8667 where
8668 T: super::stub::NodeTypes + 'static,
8669 {
8670 Self {
8671 inner: std::sync::Arc::new(stub),
8672 }
8673 }
8674
8675 pub(crate) async fn new(
8676 config: gaxi::options::ClientConfig,
8677 ) -> gax::client_builder::Result<Self> {
8678 let inner = Self::build_inner(config).await?;
8679 Ok(Self { inner })
8680 }
8681
8682 async fn build_inner(
8683 conf: gaxi::options::ClientConfig,
8684 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::NodeTypes>> {
8685 if gaxi::options::tracing_enabled(&conf) {
8686 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8687 }
8688 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8689 }
8690
8691 async fn build_transport(
8692 conf: gaxi::options::ClientConfig,
8693 ) -> gax::client_builder::Result<impl super::stub::NodeTypes> {
8694 super::transport::NodeTypes::new(conf).await
8695 }
8696
8697 async fn build_with_tracing(
8698 conf: gaxi::options::ClientConfig,
8699 ) -> gax::client_builder::Result<impl super::stub::NodeTypes> {
8700 Self::build_transport(conf)
8701 .await
8702 .map(super::tracing::NodeTypes::new)
8703 }
8704
8705 /// Retrieves an aggregated list of node types.
8706 ///
8707 /// To prevent failure, Google recommends that you set the
8708 /// `returnPartialSuccess` parameter to `true`.
8709 pub fn aggregated_list(&self) -> super::builder::node_types::AggregatedList {
8710 super::builder::node_types::AggregatedList::new(self.inner.clone())
8711 }
8712
8713 /// Returns the specified node type.
8714 pub fn get(&self) -> super::builder::node_types::Get {
8715 super::builder::node_types::Get::new(self.inner.clone())
8716 }
8717
8718 /// Retrieves a list of node types available to the specified
8719 /// project.
8720 pub fn list(&self) -> super::builder::node_types::List {
8721 super::builder::node_types::List::new(self.inner.clone())
8722 }
8723}
8724
8725/// Implements a client for the Google Compute Engine API.
8726///
8727/// # Example
8728/// ```
8729/// # async fn sample() -> gax::client_builder::Result<()> {
8730/// # use google_cloud_compute_v1::client::OrganizationSecurityPolicies;
8731/// let client = OrganizationSecurityPolicies::builder().build().await?;
8732/// // use `client` to make requests to the Google Compute Engine API.
8733/// # Ok(()) }
8734/// ```
8735///
8736/// # Service Description
8737///
8738/// Service for the `organizationSecurityPolicies` resource.
8739///
8740/// # Configuration
8741///
8742/// To configure `OrganizationSecurityPolicies` use the `with_*` methods in the type returned
8743/// by [builder()][OrganizationSecurityPolicies::builder]. The default configuration should
8744/// work for most applications. Common configuration changes include
8745///
8746/// * [with_endpoint()]: by default this client uses the global default endpoint
8747/// (`https://compute.googleapis.com`). Applications using regional
8748/// endpoints or running in restricted networks (e.g. a network configured
8749// with [Private Google Access with VPC Service Controls]) may want to
8750/// override this default.
8751/// * [with_credentials()]: by default this client uses
8752/// [Application Default Credentials]. Applications using custom
8753/// authentication may need to override this default.
8754///
8755/// [with_endpoint()]: super::builder::organization_security_policies::ClientBuilder::with_endpoint
8756/// [with_credentials()]: super::builder::organization_security_policies::ClientBuilder::credentials
8757/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8758/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8759///
8760/// # Pooling and Cloning
8761///
8762/// `OrganizationSecurityPolicies` holds a connection pool internally, it is advised to
8763/// create one and the reuse it. You do not need to wrap `OrganizationSecurityPolicies` in
8764/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8765/// already uses an `Arc` internally.
8766#[cfg(feature = "organization-security-policies")]
8767#[cfg_attr(docsrs, doc(cfg(feature = "organization-security-policies")))]
8768#[derive(Clone, Debug)]
8769pub struct OrganizationSecurityPolicies {
8770 inner: std::sync::Arc<dyn super::stub::dynamic::OrganizationSecurityPolicies>,
8771}
8772
8773#[cfg(feature = "organization-security-policies")]
8774impl OrganizationSecurityPolicies {
8775 /// Returns a builder for [OrganizationSecurityPolicies].
8776 ///
8777 /// ```
8778 /// # async fn sample() -> gax::client_builder::Result<()> {
8779 /// # use google_cloud_compute_v1::client::OrganizationSecurityPolicies;
8780 /// let client = OrganizationSecurityPolicies::builder().build().await?;
8781 /// # Ok(()) }
8782 /// ```
8783 pub fn builder() -> super::builder::organization_security_policies::ClientBuilder {
8784 gax::client_builder::internal::new_builder(
8785 super::builder::organization_security_policies::client::Factory,
8786 )
8787 }
8788
8789 /// Creates a new client from the provided stub.
8790 ///
8791 /// The most common case for calling this function is in tests mocking the
8792 /// client's behavior.
8793 pub fn from_stub<T>(stub: T) -> Self
8794 where
8795 T: super::stub::OrganizationSecurityPolicies + 'static,
8796 {
8797 Self {
8798 inner: std::sync::Arc::new(stub),
8799 }
8800 }
8801
8802 pub(crate) async fn new(
8803 config: gaxi::options::ClientConfig,
8804 ) -> gax::client_builder::Result<Self> {
8805 let inner = Self::build_inner(config).await?;
8806 Ok(Self { inner })
8807 }
8808
8809 async fn build_inner(
8810 conf: gaxi::options::ClientConfig,
8811 ) -> gax::client_builder::Result<
8812 std::sync::Arc<dyn super::stub::dynamic::OrganizationSecurityPolicies>,
8813 > {
8814 if gaxi::options::tracing_enabled(&conf) {
8815 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8816 }
8817 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8818 }
8819
8820 async fn build_transport(
8821 conf: gaxi::options::ClientConfig,
8822 ) -> gax::client_builder::Result<impl super::stub::OrganizationSecurityPolicies> {
8823 super::transport::OrganizationSecurityPolicies::new(conf).await
8824 }
8825
8826 async fn build_with_tracing(
8827 conf: gaxi::options::ClientConfig,
8828 ) -> gax::client_builder::Result<impl super::stub::OrganizationSecurityPolicies> {
8829 Self::build_transport(conf)
8830 .await
8831 .map(super::tracing::OrganizationSecurityPolicies::new)
8832 }
8833
8834 /// Inserts an association for the specified security policy.
8835 ///
8836 /// This has billing implications. Projects in the hierarchy with effective
8837 /// hierarchical security policies will be automatically enrolled into Cloud
8838 /// Armor Enterprise if not already enrolled.
8839 ///
8840 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8841 /// versions of this API were used to modify firewall policies. This usage is
8842 /// now disabled for most organizations. Use firewallPolicies.addAssociation
8843 /// instead.
8844 pub fn add_association(
8845 &self,
8846 ) -> super::builder::organization_security_policies::AddAssociation {
8847 super::builder::organization_security_policies::AddAssociation::new(self.inner.clone())
8848 }
8849
8850 /// Inserts a rule into a security policy.
8851 ///
8852 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8853 /// versions of this API were used to modify firewall policies. This usage is
8854 /// now disabled for most organizations. Use firewallPolicies.addRule instead.
8855 pub fn add_rule(&self) -> super::builder::organization_security_policies::AddRule {
8856 super::builder::organization_security_policies::AddRule::new(self.inner.clone())
8857 }
8858
8859 /// Copies rules to the specified security policy.
8860 ///
8861 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8862 /// versions of this API were used to modify firewall policies. This usage is
8863 /// now disabled for most organizations. Use firewallPolicies.cloneRules
8864 /// instead.
8865 pub fn copy_rules(&self) -> super::builder::organization_security_policies::CopyRules {
8866 super::builder::organization_security_policies::CopyRules::new(self.inner.clone())
8867 }
8868
8869 /// Deletes the specified policy.
8870 ///
8871 /// Use this API to remove Cloud Armor policies. Previously, alpha and beta
8872 /// versions of this API were used to remove firewall policies. This usage is
8873 /// now disabled for most organizations. Use firewallPolicies.delete instead.
8874 pub fn delete(&self) -> super::builder::organization_security_policies::Delete {
8875 super::builder::organization_security_policies::Delete::new(self.inner.clone())
8876 }
8877
8878 /// List all of the ordered rules present in a single specified policy.
8879 ///
8880 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
8881 /// versions of this API were used to read firewall policies. This usage is now
8882 /// disabled for most organizations. Use firewallPolicies.get instead.
8883 pub fn get(&self) -> super::builder::organization_security_policies::Get {
8884 super::builder::organization_security_policies::Get::new(self.inner.clone())
8885 }
8886
8887 /// Gets an association with the specified name.
8888 ///
8889 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
8890 /// versions of this API were used to read firewall policies. This usage is
8891 /// now disabled for most organizations. Use firewallPolicies.getAssociation
8892 /// instead.
8893 pub fn get_association(
8894 &self,
8895 ) -> super::builder::organization_security_policies::GetAssociation {
8896 super::builder::organization_security_policies::GetAssociation::new(self.inner.clone())
8897 }
8898
8899 /// Gets a rule at the specified priority.
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.getRule instead.
8904 pub fn get_rule(&self) -> super::builder::organization_security_policies::GetRule {
8905 super::builder::organization_security_policies::GetRule::new(self.inner.clone())
8906 }
8907
8908 /// Creates a new policy in the specified organization using the data included
8909 /// in the request.
8910 ///
8911 /// Use this API to add Cloud Armor policies. Previously, alpha and beta
8912 /// versions of this API were used to add firewall policies. This usage is now
8913 /// disabled for most organizations. Use firewallPolicies.insert instead.
8914 pub fn insert(&self) -> super::builder::organization_security_policies::Insert {
8915 super::builder::organization_security_policies::Insert::new(self.inner.clone())
8916 }
8917
8918 /// List all the policies that have been configured for the specified
8919 /// organization.
8920 ///
8921 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
8922 /// versions of this API were used to read firewall policies. This usage is now
8923 /// disabled for most organizations. Use firewallPolicies.list instead.
8924 pub fn list(&self) -> super::builder::organization_security_policies::List {
8925 super::builder::organization_security_policies::List::new(self.inner.clone())
8926 }
8927
8928 /// Lists associations of a specified target, i.e., organization or folder.
8929 ///
8930 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
8931 /// versions of this API were used to read firewall policies. This usage is
8932 /// now disabled for most organizations. Use firewallPolicies.listAssociations
8933 /// instead.
8934 pub fn list_associations(
8935 &self,
8936 ) -> super::builder::organization_security_policies::ListAssociations {
8937 super::builder::organization_security_policies::ListAssociations::new(self.inner.clone())
8938 }
8939
8940 /// Gets the current list of preconfigured Web Application Firewall (WAF)
8941 /// expressions.
8942 pub fn list_preconfigured_expression_sets(
8943 &self,
8944 ) -> super::builder::organization_security_policies::ListPreconfiguredExpressionSets {
8945 super::builder::organization_security_policies::ListPreconfiguredExpressionSets::new(
8946 self.inner.clone(),
8947 )
8948 }
8949
8950 /// Moves the specified security policy.
8951 ///
8952 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8953 /// versions of this API were used to modify firewall policies. This usage is
8954 /// now disabled for most organizations. Use firewallPolicies.move instead.
8955 pub fn r#move(&self) -> super::builder::organization_security_policies::Move {
8956 super::builder::organization_security_policies::Move::new(self.inner.clone())
8957 }
8958
8959 /// Patches the specified policy with the data included in the request.
8960 ///
8961 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8962 /// versions of this API were used to modify firewall policies. This usage is
8963 /// now disabled for most organizations. Use firewallPolicies.patch instead.
8964 pub fn patch(&self) -> super::builder::organization_security_policies::Patch {
8965 super::builder::organization_security_policies::Patch::new(self.inner.clone())
8966 }
8967
8968 /// Patches a rule at the specified priority.
8969 ///
8970 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8971 /// versions of this API were used to modify firewall policies. This usage is
8972 /// now disabled for most organizations. Use firewallPolicies.patchRule
8973 /// instead.
8974 pub fn patch_rule(&self) -> super::builder::organization_security_policies::PatchRule {
8975 super::builder::organization_security_policies::PatchRule::new(self.inner.clone())
8976 }
8977
8978 /// Removes an association for the specified security policy.
8979 ///
8980 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8981 /// versions of this API were used to modify firewall policies. This usage is
8982 /// now disabled for most organizations. Use firewallPolicies.removeAssociation
8983 /// instead.
8984 pub fn remove_association(
8985 &self,
8986 ) -> super::builder::organization_security_policies::RemoveAssociation {
8987 super::builder::organization_security_policies::RemoveAssociation::new(self.inner.clone())
8988 }
8989
8990 /// Deletes a rule at the specified priority.
8991 ///
8992 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8993 /// versions of this API were used to modify firewall policies. This usage is
8994 /// now disabled for most organizations. Use firewallPolicies.removeRule
8995 /// instead.
8996 pub fn remove_rule(&self) -> super::builder::organization_security_policies::RemoveRule {
8997 super::builder::organization_security_policies::RemoveRule::new(self.inner.clone())
8998 }
8999
9000 /// Retrieves the specified Operations resource. Gets a list of operations
9001 /// by making a `list()` request.
9002 pub fn get_operation(&self) -> super::builder::organization_security_policies::GetOperation {
9003 super::builder::organization_security_policies::GetOperation::new(self.inner.clone())
9004 }
9005}
9006
9007/// Implements a client for the Google Compute Engine API.
9008///
9009/// # Example
9010/// ```
9011/// # async fn sample() -> gax::client_builder::Result<()> {
9012/// # use google_cloud_compute_v1::client::PacketMirrorings;
9013/// let client = PacketMirrorings::builder().build().await?;
9014/// // use `client` to make requests to the Google Compute Engine API.
9015/// # Ok(()) }
9016/// ```
9017///
9018/// # Service Description
9019///
9020/// Service for the `packetMirrorings` resource.
9021///
9022/// # Configuration
9023///
9024/// To configure `PacketMirrorings` use the `with_*` methods in the type returned
9025/// by [builder()][PacketMirrorings::builder]. The default configuration should
9026/// work for most applications. Common configuration changes include
9027///
9028/// * [with_endpoint()]: by default this client uses the global default endpoint
9029/// (`https://compute.googleapis.com`). Applications using regional
9030/// endpoints or running in restricted networks (e.g. a network configured
9031// with [Private Google Access with VPC Service Controls]) may want to
9032/// override this default.
9033/// * [with_credentials()]: by default this client uses
9034/// [Application Default Credentials]. Applications using custom
9035/// authentication may need to override this default.
9036///
9037/// [with_endpoint()]: super::builder::packet_mirrorings::ClientBuilder::with_endpoint
9038/// [with_credentials()]: super::builder::packet_mirrorings::ClientBuilder::credentials
9039/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9040/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9041///
9042/// # Pooling and Cloning
9043///
9044/// `PacketMirrorings` holds a connection pool internally, it is advised to
9045/// create one and the reuse it. You do not need to wrap `PacketMirrorings` in
9046/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9047/// already uses an `Arc` internally.
9048#[cfg(feature = "packet-mirrorings")]
9049#[cfg_attr(docsrs, doc(cfg(feature = "packet-mirrorings")))]
9050#[derive(Clone, Debug)]
9051pub struct PacketMirrorings {
9052 inner: std::sync::Arc<dyn super::stub::dynamic::PacketMirrorings>,
9053}
9054
9055#[cfg(feature = "packet-mirrorings")]
9056impl PacketMirrorings {
9057 /// Returns a builder for [PacketMirrorings].
9058 ///
9059 /// ```
9060 /// # async fn sample() -> gax::client_builder::Result<()> {
9061 /// # use google_cloud_compute_v1::client::PacketMirrorings;
9062 /// let client = PacketMirrorings::builder().build().await?;
9063 /// # Ok(()) }
9064 /// ```
9065 pub fn builder() -> super::builder::packet_mirrorings::ClientBuilder {
9066 gax::client_builder::internal::new_builder(
9067 super::builder::packet_mirrorings::client::Factory,
9068 )
9069 }
9070
9071 /// Creates a new client from the provided stub.
9072 ///
9073 /// The most common case for calling this function is in tests mocking the
9074 /// client's behavior.
9075 pub fn from_stub<T>(stub: T) -> Self
9076 where
9077 T: super::stub::PacketMirrorings + 'static,
9078 {
9079 Self {
9080 inner: std::sync::Arc::new(stub),
9081 }
9082 }
9083
9084 pub(crate) async fn new(
9085 config: gaxi::options::ClientConfig,
9086 ) -> gax::client_builder::Result<Self> {
9087 let inner = Self::build_inner(config).await?;
9088 Ok(Self { inner })
9089 }
9090
9091 async fn build_inner(
9092 conf: gaxi::options::ClientConfig,
9093 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::PacketMirrorings>>
9094 {
9095 if gaxi::options::tracing_enabled(&conf) {
9096 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9097 }
9098 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9099 }
9100
9101 async fn build_transport(
9102 conf: gaxi::options::ClientConfig,
9103 ) -> gax::client_builder::Result<impl super::stub::PacketMirrorings> {
9104 super::transport::PacketMirrorings::new(conf).await
9105 }
9106
9107 async fn build_with_tracing(
9108 conf: gaxi::options::ClientConfig,
9109 ) -> gax::client_builder::Result<impl super::stub::PacketMirrorings> {
9110 Self::build_transport(conf)
9111 .await
9112 .map(super::tracing::PacketMirrorings::new)
9113 }
9114
9115 /// Retrieves an aggregated list of packetMirrorings.
9116 ///
9117 /// To prevent failure, Google recommends that you set the
9118 /// `returnPartialSuccess` parameter to `true`.
9119 pub fn aggregated_list(&self) -> super::builder::packet_mirrorings::AggregatedList {
9120 super::builder::packet_mirrorings::AggregatedList::new(self.inner.clone())
9121 }
9122
9123 /// Deletes the specified PacketMirroring resource.
9124 pub fn delete(&self) -> super::builder::packet_mirrorings::Delete {
9125 super::builder::packet_mirrorings::Delete::new(self.inner.clone())
9126 }
9127
9128 /// Returns the specified PacketMirroring resource.
9129 pub fn get(&self) -> super::builder::packet_mirrorings::Get {
9130 super::builder::packet_mirrorings::Get::new(self.inner.clone())
9131 }
9132
9133 /// Creates a PacketMirroring resource in the specified project and region
9134 /// using the data included in the request.
9135 pub fn insert(&self) -> super::builder::packet_mirrorings::Insert {
9136 super::builder::packet_mirrorings::Insert::new(self.inner.clone())
9137 }
9138
9139 /// Retrieves a list of PacketMirroring resources available to the specified
9140 /// project and region.
9141 pub fn list(&self) -> super::builder::packet_mirrorings::List {
9142 super::builder::packet_mirrorings::List::new(self.inner.clone())
9143 }
9144
9145 /// Patches the specified PacketMirroring resource with the data included in
9146 /// the request. This method supportsPATCH
9147 /// semantics and usesJSON merge
9148 /// patch format and processing rules.
9149 pub fn patch(&self) -> super::builder::packet_mirrorings::Patch {
9150 super::builder::packet_mirrorings::Patch::new(self.inner.clone())
9151 }
9152
9153 /// Returns permissions that a caller has on the specified resource.
9154 pub fn test_iam_permissions(&self) -> super::builder::packet_mirrorings::TestIamPermissions {
9155 super::builder::packet_mirrorings::TestIamPermissions::new(self.inner.clone())
9156 }
9157
9158 /// Retrieves the specified region-specific Operations resource.
9159 pub fn get_operation(&self) -> super::builder::packet_mirrorings::GetOperation {
9160 super::builder::packet_mirrorings::GetOperation::new(self.inner.clone())
9161 }
9162}
9163
9164/// Implements a client for the Google Compute Engine API.
9165///
9166/// # Example
9167/// ```
9168/// # async fn sample() -> gax::client_builder::Result<()> {
9169/// # use google_cloud_compute_v1::client::PreviewFeatures;
9170/// let client = PreviewFeatures::builder().build().await?;
9171/// // use `client` to make requests to the Google Compute Engine API.
9172/// # Ok(()) }
9173/// ```
9174///
9175/// # Service Description
9176///
9177/// Service for the `previewFeatures` resource.
9178///
9179/// # Configuration
9180///
9181/// To configure `PreviewFeatures` use the `with_*` methods in the type returned
9182/// by [builder()][PreviewFeatures::builder]. The default configuration should
9183/// work for most applications. Common configuration changes include
9184///
9185/// * [with_endpoint()]: by default this client uses the global default endpoint
9186/// (`https://compute.googleapis.com`). Applications using regional
9187/// endpoints or running in restricted networks (e.g. a network configured
9188// with [Private Google Access with VPC Service Controls]) may want to
9189/// override this default.
9190/// * [with_credentials()]: by default this client uses
9191/// [Application Default Credentials]. Applications using custom
9192/// authentication may need to override this default.
9193///
9194/// [with_endpoint()]: super::builder::preview_features::ClientBuilder::with_endpoint
9195/// [with_credentials()]: super::builder::preview_features::ClientBuilder::credentials
9196/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9197/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9198///
9199/// # Pooling and Cloning
9200///
9201/// `PreviewFeatures` holds a connection pool internally, it is advised to
9202/// create one and the reuse it. You do not need to wrap `PreviewFeatures` in
9203/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9204/// already uses an `Arc` internally.
9205#[cfg(feature = "preview-features")]
9206#[cfg_attr(docsrs, doc(cfg(feature = "preview-features")))]
9207#[derive(Clone, Debug)]
9208pub struct PreviewFeatures {
9209 inner: std::sync::Arc<dyn super::stub::dynamic::PreviewFeatures>,
9210}
9211
9212#[cfg(feature = "preview-features")]
9213impl PreviewFeatures {
9214 /// Returns a builder for [PreviewFeatures].
9215 ///
9216 /// ```
9217 /// # async fn sample() -> gax::client_builder::Result<()> {
9218 /// # use google_cloud_compute_v1::client::PreviewFeatures;
9219 /// let client = PreviewFeatures::builder().build().await?;
9220 /// # Ok(()) }
9221 /// ```
9222 pub fn builder() -> super::builder::preview_features::ClientBuilder {
9223 gax::client_builder::internal::new_builder(
9224 super::builder::preview_features::client::Factory,
9225 )
9226 }
9227
9228 /// Creates a new client from the provided stub.
9229 ///
9230 /// The most common case for calling this function is in tests mocking the
9231 /// client's behavior.
9232 pub fn from_stub<T>(stub: T) -> Self
9233 where
9234 T: super::stub::PreviewFeatures + 'static,
9235 {
9236 Self {
9237 inner: std::sync::Arc::new(stub),
9238 }
9239 }
9240
9241 pub(crate) async fn new(
9242 config: gaxi::options::ClientConfig,
9243 ) -> gax::client_builder::Result<Self> {
9244 let inner = Self::build_inner(config).await?;
9245 Ok(Self { inner })
9246 }
9247
9248 async fn build_inner(
9249 conf: gaxi::options::ClientConfig,
9250 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::PreviewFeatures>>
9251 {
9252 if gaxi::options::tracing_enabled(&conf) {
9253 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9254 }
9255 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9256 }
9257
9258 async fn build_transport(
9259 conf: gaxi::options::ClientConfig,
9260 ) -> gax::client_builder::Result<impl super::stub::PreviewFeatures> {
9261 super::transport::PreviewFeatures::new(conf).await
9262 }
9263
9264 async fn build_with_tracing(
9265 conf: gaxi::options::ClientConfig,
9266 ) -> gax::client_builder::Result<impl super::stub::PreviewFeatures> {
9267 Self::build_transport(conf)
9268 .await
9269 .map(super::tracing::PreviewFeatures::new)
9270 }
9271
9272 /// Returns the details of the given PreviewFeature.
9273 pub fn get(&self) -> super::builder::preview_features::Get {
9274 super::builder::preview_features::Get::new(self.inner.clone())
9275 }
9276
9277 /// Returns the details of the given PreviewFeature.
9278 pub fn list(&self) -> super::builder::preview_features::List {
9279 super::builder::preview_features::List::new(self.inner.clone())
9280 }
9281
9282 /// Patches the given PreviewFeature. This method is used to enable or disable
9283 /// a PreviewFeature.
9284 pub fn update(&self) -> super::builder::preview_features::Update {
9285 super::builder::preview_features::Update::new(self.inner.clone())
9286 }
9287
9288 /// Retrieves the specified Operations resource.
9289 pub fn get_operation(&self) -> super::builder::preview_features::GetOperation {
9290 super::builder::preview_features::GetOperation::new(self.inner.clone())
9291 }
9292}
9293
9294/// Implements a client for the Google Compute Engine API.
9295///
9296/// # Example
9297/// ```
9298/// # async fn sample() -> gax::client_builder::Result<()> {
9299/// # use google_cloud_compute_v1::client::Projects;
9300/// let client = Projects::builder().build().await?;
9301/// // use `client` to make requests to the Google Compute Engine API.
9302/// # Ok(()) }
9303/// ```
9304///
9305/// # Service Description
9306///
9307/// Service for the `projects` resource.
9308///
9309/// # Configuration
9310///
9311/// To configure `Projects` use the `with_*` methods in the type returned
9312/// by [builder()][Projects::builder]. The default configuration should
9313/// work for most applications. Common configuration changes include
9314///
9315/// * [with_endpoint()]: by default this client uses the global default endpoint
9316/// (`https://compute.googleapis.com`). Applications using regional
9317/// endpoints or running in restricted networks (e.g. a network configured
9318// with [Private Google Access with VPC Service Controls]) may want to
9319/// override this default.
9320/// * [with_credentials()]: by default this client uses
9321/// [Application Default Credentials]. Applications using custom
9322/// authentication may need to override this default.
9323///
9324/// [with_endpoint()]: super::builder::projects::ClientBuilder::with_endpoint
9325/// [with_credentials()]: super::builder::projects::ClientBuilder::credentials
9326/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9327/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9328///
9329/// # Pooling and Cloning
9330///
9331/// `Projects` holds a connection pool internally, it is advised to
9332/// create one and the reuse it. You do not need to wrap `Projects` in
9333/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9334/// already uses an `Arc` internally.
9335#[cfg(feature = "projects")]
9336#[cfg_attr(docsrs, doc(cfg(feature = "projects")))]
9337#[derive(Clone, Debug)]
9338pub struct Projects {
9339 inner: std::sync::Arc<dyn super::stub::dynamic::Projects>,
9340}
9341
9342#[cfg(feature = "projects")]
9343impl Projects {
9344 /// Returns a builder for [Projects].
9345 ///
9346 /// ```
9347 /// # async fn sample() -> gax::client_builder::Result<()> {
9348 /// # use google_cloud_compute_v1::client::Projects;
9349 /// let client = Projects::builder().build().await?;
9350 /// # Ok(()) }
9351 /// ```
9352 pub fn builder() -> super::builder::projects::ClientBuilder {
9353 gax::client_builder::internal::new_builder(super::builder::projects::client::Factory)
9354 }
9355
9356 /// Creates a new client from the provided stub.
9357 ///
9358 /// The most common case for calling this function is in tests mocking the
9359 /// client's behavior.
9360 pub fn from_stub<T>(stub: T) -> Self
9361 where
9362 T: super::stub::Projects + 'static,
9363 {
9364 Self {
9365 inner: std::sync::Arc::new(stub),
9366 }
9367 }
9368
9369 pub(crate) async fn new(
9370 config: gaxi::options::ClientConfig,
9371 ) -> gax::client_builder::Result<Self> {
9372 let inner = Self::build_inner(config).await?;
9373 Ok(Self { inner })
9374 }
9375
9376 async fn build_inner(
9377 conf: gaxi::options::ClientConfig,
9378 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Projects>> {
9379 if gaxi::options::tracing_enabled(&conf) {
9380 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9381 }
9382 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9383 }
9384
9385 async fn build_transport(
9386 conf: gaxi::options::ClientConfig,
9387 ) -> gax::client_builder::Result<impl super::stub::Projects> {
9388 super::transport::Projects::new(conf).await
9389 }
9390
9391 async fn build_with_tracing(
9392 conf: gaxi::options::ClientConfig,
9393 ) -> gax::client_builder::Result<impl super::stub::Projects> {
9394 Self::build_transport(conf)
9395 .await
9396 .map(super::tracing::Projects::new)
9397 }
9398
9399 /// Disable this project as a shared VPC host project.
9400 pub fn disable_xpn_host(&self) -> super::builder::projects::DisableXpnHost {
9401 super::builder::projects::DisableXpnHost::new(self.inner.clone())
9402 }
9403
9404 /// Disable a service resource (also known as service project) associated with
9405 /// this host project.
9406 pub fn disable_xpn_resource(&self) -> super::builder::projects::DisableXpnResource {
9407 super::builder::projects::DisableXpnResource::new(self.inner.clone())
9408 }
9409
9410 /// Enable this project as a shared VPC host project.
9411 pub fn enable_xpn_host(&self) -> super::builder::projects::EnableXpnHost {
9412 super::builder::projects::EnableXpnHost::new(self.inner.clone())
9413 }
9414
9415 /// Enable service resource (a.k.a service project) for a host project, so that
9416 /// subnets in the host project can be used by instances in the service
9417 /// project.
9418 pub fn enable_xpn_resource(&self) -> super::builder::projects::EnableXpnResource {
9419 super::builder::projects::EnableXpnResource::new(self.inner.clone())
9420 }
9421
9422 /// Returns the specified Project resource.
9423 ///
9424 /// To decrease latency for this method, you can optionally omit any unneeded
9425 /// information from the response by using a field mask. This practice is
9426 /// especially recommended for unused quota information (the `quotas` field).
9427 /// To exclude one or more fields, set your request's `fields` query parameter
9428 /// to only include the fields you need. For example, to only include the `id`
9429 /// and `selfLink` fields, add the query parameter `?fields=id,selfLink` to
9430 /// your request.
9431 pub fn get(&self) -> super::builder::projects::Get {
9432 super::builder::projects::Get::new(self.inner.clone())
9433 }
9434
9435 /// Gets the shared VPC host project that this project links to. May be empty
9436 /// if no link exists.
9437 pub fn get_xpn_host(&self) -> super::builder::projects::GetXpnHost {
9438 super::builder::projects::GetXpnHost::new(self.inner.clone())
9439 }
9440
9441 /// Gets service resources (a.k.a service project) associated with this host
9442 /// project.
9443 pub fn get_xpn_resources(&self) -> super::builder::projects::GetXpnResources {
9444 super::builder::projects::GetXpnResources::new(self.inner.clone())
9445 }
9446
9447 /// Lists all shared VPC host projects visible to the user in an organization.
9448 pub fn list_xpn_hosts(&self) -> super::builder::projects::ListXpnHosts {
9449 super::builder::projects::ListXpnHosts::new(self.inner.clone())
9450 }
9451
9452 /// Moves a persistent disk from one zone to another.
9453 /// *Note*: The moveDisk API will be deprecated on September 29, 2026.
9454 ///
9455 /// Starting September 29, 2025, you can't use the moveDisk API on new
9456 /// projects. To move a disk to a different region or zone, follow the steps in
9457 /// [Change the location of a
9458 /// disk](https://cloud.google.com/compute/docs/disks/migrate-to-hyperdisk#migrate-to-hd).
9459 ///
9460 /// Projects that already use the moveDisk API can continue usage until
9461 /// September 29, 2026.
9462 ///
9463 /// Starting November 1, 2025, API responses will include a warning message in
9464 /// the response body about the upcoming deprecation. You can skip the message
9465 /// to continue using the service without interruption.
9466 #[deprecated]
9467 pub fn move_disk(&self) -> super::builder::projects::MoveDisk {
9468 super::builder::projects::MoveDisk::new(self.inner.clone())
9469 }
9470
9471 /// Moves an instance and its attached persistent disks from one zone to
9472 /// another.
9473 /// *Note*: Moving VMs or disks by using this method might
9474 /// cause unexpected behavior. For more information, see the [known
9475 /// issue](/compute/docs/troubleshooting/known-issues#moving_vms_or_disks_using_the_moveinstance_api_or_the_causes_unexpected_behavior).
9476 /// [Deprecated] This method is deprecated. See [moving instance across
9477 /// zones](/compute/docs/instances/moving-instance-across-zones) instead.
9478 #[deprecated]
9479 pub fn move_instance(&self) -> super::builder::projects::MoveInstance {
9480 super::builder::projects::MoveInstance::new(self.inner.clone())
9481 }
9482
9483 /// Sets the Cloud Armor tier of the project. To set ENTERPRISE or above the
9484 /// billing account of the project must be subscribed to Cloud Armor
9485 /// Enterprise. See Subscribing
9486 /// to Cloud Armor Enterprise for more information.
9487 pub fn set_cloud_armor_tier(&self) -> super::builder::projects::SetCloudArmorTier {
9488 super::builder::projects::SetCloudArmorTier::new(self.inner.clone())
9489 }
9490
9491 /// Sets metadata common to all instances within the specified project using
9492 /// the data included in the request.
9493 pub fn set_common_instance_metadata(
9494 &self,
9495 ) -> super::builder::projects::SetCommonInstanceMetadata {
9496 super::builder::projects::SetCommonInstanceMetadata::new(self.inner.clone())
9497 }
9498
9499 /// Sets the default network tier of the project. The default network tier is
9500 /// used when an address/forwardingRule/instance is created without specifying
9501 /// the network tier field.
9502 pub fn set_default_network_tier(&self) -> super::builder::projects::SetDefaultNetworkTier {
9503 super::builder::projects::SetDefaultNetworkTier::new(self.inner.clone())
9504 }
9505
9506 /// Enables the usage export feature and sets theusage export bucket
9507 /// where reports are stored. If you provide an empty request body using this
9508 /// method, the usage export feature will be disabled.
9509 pub fn set_usage_export_bucket(&self) -> super::builder::projects::SetUsageExportBucket {
9510 super::builder::projects::SetUsageExportBucket::new(self.inner.clone())
9511 }
9512
9513 /// Retrieves the specified Operations resource.
9514 pub fn get_operation(&self) -> super::builder::projects::GetOperation {
9515 super::builder::projects::GetOperation::new(self.inner.clone())
9516 }
9517}
9518
9519/// Implements a client for the Google Compute Engine API.
9520///
9521/// # Example
9522/// ```
9523/// # async fn sample() -> gax::client_builder::Result<()> {
9524/// # use google_cloud_compute_v1::client::PublicAdvertisedPrefixes;
9525/// let client = PublicAdvertisedPrefixes::builder().build().await?;
9526/// // use `client` to make requests to the Google Compute Engine API.
9527/// # Ok(()) }
9528/// ```
9529///
9530/// # Service Description
9531///
9532/// Service for the `publicAdvertisedPrefixes` resource.
9533///
9534/// # Configuration
9535///
9536/// To configure `PublicAdvertisedPrefixes` use the `with_*` methods in the type returned
9537/// by [builder()][PublicAdvertisedPrefixes::builder]. The default configuration should
9538/// work for most applications. Common configuration changes include
9539///
9540/// * [with_endpoint()]: by default this client uses the global default endpoint
9541/// (`https://compute.googleapis.com`). Applications using regional
9542/// endpoints or running in restricted networks (e.g. a network configured
9543// with [Private Google Access with VPC Service Controls]) may want to
9544/// override this default.
9545/// * [with_credentials()]: by default this client uses
9546/// [Application Default Credentials]. Applications using custom
9547/// authentication may need to override this default.
9548///
9549/// [with_endpoint()]: super::builder::public_advertised_prefixes::ClientBuilder::with_endpoint
9550/// [with_credentials()]: super::builder::public_advertised_prefixes::ClientBuilder::credentials
9551/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9552/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9553///
9554/// # Pooling and Cloning
9555///
9556/// `PublicAdvertisedPrefixes` holds a connection pool internally, it is advised to
9557/// create one and the reuse it. You do not need to wrap `PublicAdvertisedPrefixes` in
9558/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9559/// already uses an `Arc` internally.
9560#[cfg(feature = "public-advertised-prefixes")]
9561#[cfg_attr(docsrs, doc(cfg(feature = "public-advertised-prefixes")))]
9562#[derive(Clone, Debug)]
9563pub struct PublicAdvertisedPrefixes {
9564 inner: std::sync::Arc<dyn super::stub::dynamic::PublicAdvertisedPrefixes>,
9565}
9566
9567#[cfg(feature = "public-advertised-prefixes")]
9568impl PublicAdvertisedPrefixes {
9569 /// Returns a builder for [PublicAdvertisedPrefixes].
9570 ///
9571 /// ```
9572 /// # async fn sample() -> gax::client_builder::Result<()> {
9573 /// # use google_cloud_compute_v1::client::PublicAdvertisedPrefixes;
9574 /// let client = PublicAdvertisedPrefixes::builder().build().await?;
9575 /// # Ok(()) }
9576 /// ```
9577 pub fn builder() -> super::builder::public_advertised_prefixes::ClientBuilder {
9578 gax::client_builder::internal::new_builder(
9579 super::builder::public_advertised_prefixes::client::Factory,
9580 )
9581 }
9582
9583 /// Creates a new client from the provided stub.
9584 ///
9585 /// The most common case for calling this function is in tests mocking the
9586 /// client's behavior.
9587 pub fn from_stub<T>(stub: T) -> Self
9588 where
9589 T: super::stub::PublicAdvertisedPrefixes + 'static,
9590 {
9591 Self {
9592 inner: std::sync::Arc::new(stub),
9593 }
9594 }
9595
9596 pub(crate) async fn new(
9597 config: gaxi::options::ClientConfig,
9598 ) -> gax::client_builder::Result<Self> {
9599 let inner = Self::build_inner(config).await?;
9600 Ok(Self { inner })
9601 }
9602
9603 async fn build_inner(
9604 conf: gaxi::options::ClientConfig,
9605 ) -> gax::client_builder::Result<
9606 std::sync::Arc<dyn super::stub::dynamic::PublicAdvertisedPrefixes>,
9607 > {
9608 if gaxi::options::tracing_enabled(&conf) {
9609 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9610 }
9611 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9612 }
9613
9614 async fn build_transport(
9615 conf: gaxi::options::ClientConfig,
9616 ) -> gax::client_builder::Result<impl super::stub::PublicAdvertisedPrefixes> {
9617 super::transport::PublicAdvertisedPrefixes::new(conf).await
9618 }
9619
9620 async fn build_with_tracing(
9621 conf: gaxi::options::ClientConfig,
9622 ) -> gax::client_builder::Result<impl super::stub::PublicAdvertisedPrefixes> {
9623 Self::build_transport(conf)
9624 .await
9625 .map(super::tracing::PublicAdvertisedPrefixes::new)
9626 }
9627
9628 /// Announces the specified PublicAdvertisedPrefix
9629 pub fn announce(&self) -> super::builder::public_advertised_prefixes::Announce {
9630 super::builder::public_advertised_prefixes::Announce::new(self.inner.clone())
9631 }
9632
9633 /// Deletes the specified PublicAdvertisedPrefix
9634 pub fn delete(&self) -> super::builder::public_advertised_prefixes::Delete {
9635 super::builder::public_advertised_prefixes::Delete::new(self.inner.clone())
9636 }
9637
9638 /// Returns the specified PublicAdvertisedPrefix resource.
9639 pub fn get(&self) -> super::builder::public_advertised_prefixes::Get {
9640 super::builder::public_advertised_prefixes::Get::new(self.inner.clone())
9641 }
9642
9643 /// Creates a PublicAdvertisedPrefix in the specified project
9644 /// using the parameters that are included in the request.
9645 pub fn insert(&self) -> super::builder::public_advertised_prefixes::Insert {
9646 super::builder::public_advertised_prefixes::Insert::new(self.inner.clone())
9647 }
9648
9649 /// Lists the PublicAdvertisedPrefixes for a project.
9650 pub fn list(&self) -> super::builder::public_advertised_prefixes::List {
9651 super::builder::public_advertised_prefixes::List::new(self.inner.clone())
9652 }
9653
9654 /// Patches the specified Router resource with the data included in the
9655 /// request. This method supportsPATCH
9656 /// semantics and usesJSON merge
9657 /// patch format and processing rules.
9658 pub fn patch(&self) -> super::builder::public_advertised_prefixes::Patch {
9659 super::builder::public_advertised_prefixes::Patch::new(self.inner.clone())
9660 }
9661
9662 /// Withdraws the specified PublicAdvertisedPrefix
9663 pub fn withdraw(&self) -> super::builder::public_advertised_prefixes::Withdraw {
9664 super::builder::public_advertised_prefixes::Withdraw::new(self.inner.clone())
9665 }
9666
9667 /// Retrieves the specified Operations resource.
9668 pub fn get_operation(&self) -> super::builder::public_advertised_prefixes::GetOperation {
9669 super::builder::public_advertised_prefixes::GetOperation::new(self.inner.clone())
9670 }
9671}
9672
9673/// Implements a client for the Google Compute Engine API.
9674///
9675/// # Example
9676/// ```
9677/// # async fn sample() -> gax::client_builder::Result<()> {
9678/// # use google_cloud_compute_v1::client::PublicDelegatedPrefixes;
9679/// let client = PublicDelegatedPrefixes::builder().build().await?;
9680/// // use `client` to make requests to the Google Compute Engine API.
9681/// # Ok(()) }
9682/// ```
9683///
9684/// # Service Description
9685///
9686/// Service for the `publicDelegatedPrefixes` resource.
9687///
9688/// # Configuration
9689///
9690/// To configure `PublicDelegatedPrefixes` use the `with_*` methods in the type returned
9691/// by [builder()][PublicDelegatedPrefixes::builder]. The default configuration should
9692/// work for most applications. Common configuration changes include
9693///
9694/// * [with_endpoint()]: by default this client uses the global default endpoint
9695/// (`https://compute.googleapis.com`). Applications using regional
9696/// endpoints or running in restricted networks (e.g. a network configured
9697// with [Private Google Access with VPC Service Controls]) may want to
9698/// override this default.
9699/// * [with_credentials()]: by default this client uses
9700/// [Application Default Credentials]. Applications using custom
9701/// authentication may need to override this default.
9702///
9703/// [with_endpoint()]: super::builder::public_delegated_prefixes::ClientBuilder::with_endpoint
9704/// [with_credentials()]: super::builder::public_delegated_prefixes::ClientBuilder::credentials
9705/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9706/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9707///
9708/// # Pooling and Cloning
9709///
9710/// `PublicDelegatedPrefixes` holds a connection pool internally, it is advised to
9711/// create one and the reuse it. You do not need to wrap `PublicDelegatedPrefixes` in
9712/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9713/// already uses an `Arc` internally.
9714#[cfg(feature = "public-delegated-prefixes")]
9715#[cfg_attr(docsrs, doc(cfg(feature = "public-delegated-prefixes")))]
9716#[derive(Clone, Debug)]
9717pub struct PublicDelegatedPrefixes {
9718 inner: std::sync::Arc<dyn super::stub::dynamic::PublicDelegatedPrefixes>,
9719}
9720
9721#[cfg(feature = "public-delegated-prefixes")]
9722impl PublicDelegatedPrefixes {
9723 /// Returns a builder for [PublicDelegatedPrefixes].
9724 ///
9725 /// ```
9726 /// # async fn sample() -> gax::client_builder::Result<()> {
9727 /// # use google_cloud_compute_v1::client::PublicDelegatedPrefixes;
9728 /// let client = PublicDelegatedPrefixes::builder().build().await?;
9729 /// # Ok(()) }
9730 /// ```
9731 pub fn builder() -> super::builder::public_delegated_prefixes::ClientBuilder {
9732 gax::client_builder::internal::new_builder(
9733 super::builder::public_delegated_prefixes::client::Factory,
9734 )
9735 }
9736
9737 /// Creates a new client from the provided stub.
9738 ///
9739 /// The most common case for calling this function is in tests mocking the
9740 /// client's behavior.
9741 pub fn from_stub<T>(stub: T) -> Self
9742 where
9743 T: super::stub::PublicDelegatedPrefixes + 'static,
9744 {
9745 Self {
9746 inner: std::sync::Arc::new(stub),
9747 }
9748 }
9749
9750 pub(crate) async fn new(
9751 config: gaxi::options::ClientConfig,
9752 ) -> gax::client_builder::Result<Self> {
9753 let inner = Self::build_inner(config).await?;
9754 Ok(Self { inner })
9755 }
9756
9757 async fn build_inner(
9758 conf: gaxi::options::ClientConfig,
9759 ) -> gax::client_builder::Result<
9760 std::sync::Arc<dyn super::stub::dynamic::PublicDelegatedPrefixes>,
9761 > {
9762 if gaxi::options::tracing_enabled(&conf) {
9763 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9764 }
9765 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9766 }
9767
9768 async fn build_transport(
9769 conf: gaxi::options::ClientConfig,
9770 ) -> gax::client_builder::Result<impl super::stub::PublicDelegatedPrefixes> {
9771 super::transport::PublicDelegatedPrefixes::new(conf).await
9772 }
9773
9774 async fn build_with_tracing(
9775 conf: gaxi::options::ClientConfig,
9776 ) -> gax::client_builder::Result<impl super::stub::PublicDelegatedPrefixes> {
9777 Self::build_transport(conf)
9778 .await
9779 .map(super::tracing::PublicDelegatedPrefixes::new)
9780 }
9781
9782 /// Lists all PublicDelegatedPrefix resources owned by the specific project
9783 /// across all scopes.
9784 ///
9785 /// To prevent failure, Google recommends that you set the
9786 /// `returnPartialSuccess` parameter to `true`.
9787 pub fn aggregated_list(&self) -> super::builder::public_delegated_prefixes::AggregatedList {
9788 super::builder::public_delegated_prefixes::AggregatedList::new(self.inner.clone())
9789 }
9790
9791 /// Announces the specified PublicDelegatedPrefix in the given region.
9792 pub fn announce(&self) -> super::builder::public_delegated_prefixes::Announce {
9793 super::builder::public_delegated_prefixes::Announce::new(self.inner.clone())
9794 }
9795
9796 /// Deletes the specified PublicDelegatedPrefix in the given region.
9797 pub fn delete(&self) -> super::builder::public_delegated_prefixes::Delete {
9798 super::builder::public_delegated_prefixes::Delete::new(self.inner.clone())
9799 }
9800
9801 /// Returns the specified PublicDelegatedPrefix resource in the given region.
9802 pub fn get(&self) -> super::builder::public_delegated_prefixes::Get {
9803 super::builder::public_delegated_prefixes::Get::new(self.inner.clone())
9804 }
9805
9806 /// Creates a PublicDelegatedPrefix in the specified project in the given
9807 /// region using the parameters that are included in the request.
9808 pub fn insert(&self) -> super::builder::public_delegated_prefixes::Insert {
9809 super::builder::public_delegated_prefixes::Insert::new(self.inner.clone())
9810 }
9811
9812 /// Lists the PublicDelegatedPrefixes for a project in the given region.
9813 pub fn list(&self) -> super::builder::public_delegated_prefixes::List {
9814 super::builder::public_delegated_prefixes::List::new(self.inner.clone())
9815 }
9816
9817 /// Patches the specified PublicDelegatedPrefix resource with the data included
9818 /// in the request. This method supportsPATCH
9819 /// semantics and usesJSON merge
9820 /// patch format and processing rules.
9821 pub fn patch(&self) -> super::builder::public_delegated_prefixes::Patch {
9822 super::builder::public_delegated_prefixes::Patch::new(self.inner.clone())
9823 }
9824
9825 /// Withdraws the specified PublicDelegatedPrefix in the given region.
9826 pub fn withdraw(&self) -> super::builder::public_delegated_prefixes::Withdraw {
9827 super::builder::public_delegated_prefixes::Withdraw::new(self.inner.clone())
9828 }
9829
9830 /// Retrieves the specified region-specific Operations resource.
9831 pub fn get_operation(&self) -> super::builder::public_delegated_prefixes::GetOperation {
9832 super::builder::public_delegated_prefixes::GetOperation::new(self.inner.clone())
9833 }
9834}
9835
9836/// Implements a client for the Google Compute Engine API.
9837///
9838/// # Example
9839/// ```
9840/// # async fn sample() -> gax::client_builder::Result<()> {
9841/// # use google_cloud_compute_v1::client::RegionAutoscalers;
9842/// let client = RegionAutoscalers::builder().build().await?;
9843/// // use `client` to make requests to the Google Compute Engine API.
9844/// # Ok(()) }
9845/// ```
9846///
9847/// # Service Description
9848///
9849/// Service for the `regionAutoscalers` resource.
9850///
9851/// # Configuration
9852///
9853/// To configure `RegionAutoscalers` use the `with_*` methods in the type returned
9854/// by [builder()][RegionAutoscalers::builder]. The default configuration should
9855/// work for most applications. Common configuration changes include
9856///
9857/// * [with_endpoint()]: by default this client uses the global default endpoint
9858/// (`https://compute.googleapis.com`). Applications using regional
9859/// endpoints or running in restricted networks (e.g. a network configured
9860// with [Private Google Access with VPC Service Controls]) may want to
9861/// override this default.
9862/// * [with_credentials()]: by default this client uses
9863/// [Application Default Credentials]. Applications using custom
9864/// authentication may need to override this default.
9865///
9866/// [with_endpoint()]: super::builder::region_autoscalers::ClientBuilder::with_endpoint
9867/// [with_credentials()]: super::builder::region_autoscalers::ClientBuilder::credentials
9868/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9869/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9870///
9871/// # Pooling and Cloning
9872///
9873/// `RegionAutoscalers` holds a connection pool internally, it is advised to
9874/// create one and the reuse it. You do not need to wrap `RegionAutoscalers` in
9875/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9876/// already uses an `Arc` internally.
9877#[cfg(feature = "region-autoscalers")]
9878#[cfg_attr(docsrs, doc(cfg(feature = "region-autoscalers")))]
9879#[derive(Clone, Debug)]
9880pub struct RegionAutoscalers {
9881 inner: std::sync::Arc<dyn super::stub::dynamic::RegionAutoscalers>,
9882}
9883
9884#[cfg(feature = "region-autoscalers")]
9885impl RegionAutoscalers {
9886 /// Returns a builder for [RegionAutoscalers].
9887 ///
9888 /// ```
9889 /// # async fn sample() -> gax::client_builder::Result<()> {
9890 /// # use google_cloud_compute_v1::client::RegionAutoscalers;
9891 /// let client = RegionAutoscalers::builder().build().await?;
9892 /// # Ok(()) }
9893 /// ```
9894 pub fn builder() -> super::builder::region_autoscalers::ClientBuilder {
9895 gax::client_builder::internal::new_builder(
9896 super::builder::region_autoscalers::client::Factory,
9897 )
9898 }
9899
9900 /// Creates a new client from the provided stub.
9901 ///
9902 /// The most common case for calling this function is in tests mocking the
9903 /// client's behavior.
9904 pub fn from_stub<T>(stub: T) -> Self
9905 where
9906 T: super::stub::RegionAutoscalers + 'static,
9907 {
9908 Self {
9909 inner: std::sync::Arc::new(stub),
9910 }
9911 }
9912
9913 pub(crate) async fn new(
9914 config: gaxi::options::ClientConfig,
9915 ) -> gax::client_builder::Result<Self> {
9916 let inner = Self::build_inner(config).await?;
9917 Ok(Self { inner })
9918 }
9919
9920 async fn build_inner(
9921 conf: gaxi::options::ClientConfig,
9922 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionAutoscalers>>
9923 {
9924 if gaxi::options::tracing_enabled(&conf) {
9925 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9926 }
9927 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9928 }
9929
9930 async fn build_transport(
9931 conf: gaxi::options::ClientConfig,
9932 ) -> gax::client_builder::Result<impl super::stub::RegionAutoscalers> {
9933 super::transport::RegionAutoscalers::new(conf).await
9934 }
9935
9936 async fn build_with_tracing(
9937 conf: gaxi::options::ClientConfig,
9938 ) -> gax::client_builder::Result<impl super::stub::RegionAutoscalers> {
9939 Self::build_transport(conf)
9940 .await
9941 .map(super::tracing::RegionAutoscalers::new)
9942 }
9943
9944 /// Deletes the specified autoscaler.
9945 pub fn delete(&self) -> super::builder::region_autoscalers::Delete {
9946 super::builder::region_autoscalers::Delete::new(self.inner.clone())
9947 }
9948
9949 /// Returns the specified autoscaler.
9950 pub fn get(&self) -> super::builder::region_autoscalers::Get {
9951 super::builder::region_autoscalers::Get::new(self.inner.clone())
9952 }
9953
9954 /// Creates an autoscaler in the specified project using
9955 /// the data included in the request.
9956 pub fn insert(&self) -> super::builder::region_autoscalers::Insert {
9957 super::builder::region_autoscalers::Insert::new(self.inner.clone())
9958 }
9959
9960 /// Retrieves a list of autoscalers contained within
9961 /// the specified region.
9962 pub fn list(&self) -> super::builder::region_autoscalers::List {
9963 super::builder::region_autoscalers::List::new(self.inner.clone())
9964 }
9965
9966 /// Updates an autoscaler in the specified project using
9967 /// the data included in the request. This method supportsPATCH
9968 /// semantics and uses theJSON merge
9969 /// patch format and processing rules.
9970 pub fn patch(&self) -> super::builder::region_autoscalers::Patch {
9971 super::builder::region_autoscalers::Patch::new(self.inner.clone())
9972 }
9973
9974 /// Returns permissions that a caller has on the specified resource.
9975 pub fn test_iam_permissions(&self) -> super::builder::region_autoscalers::TestIamPermissions {
9976 super::builder::region_autoscalers::TestIamPermissions::new(self.inner.clone())
9977 }
9978
9979 /// Updates an autoscaler in the specified project using
9980 /// the data included in the request.
9981 pub fn update(&self) -> super::builder::region_autoscalers::Update {
9982 super::builder::region_autoscalers::Update::new(self.inner.clone())
9983 }
9984
9985 /// Retrieves the specified region-specific Operations resource.
9986 pub fn get_operation(&self) -> super::builder::region_autoscalers::GetOperation {
9987 super::builder::region_autoscalers::GetOperation::new(self.inner.clone())
9988 }
9989}
9990
9991/// Implements a client for the Google Compute Engine API.
9992///
9993/// # Example
9994/// ```
9995/// # async fn sample() -> gax::client_builder::Result<()> {
9996/// # use google_cloud_compute_v1::client::RegionBackendServices;
9997/// let client = RegionBackendServices::builder().build().await?;
9998/// // use `client` to make requests to the Google Compute Engine API.
9999/// # Ok(()) }
10000/// ```
10001///
10002/// # Service Description
10003///
10004/// Service for the `regionBackendServices` resource.
10005///
10006/// # Configuration
10007///
10008/// To configure `RegionBackendServices` use the `with_*` methods in the type returned
10009/// by [builder()][RegionBackendServices::builder]. The default configuration should
10010/// work for most applications. Common configuration changes include
10011///
10012/// * [with_endpoint()]: by default this client uses the global default endpoint
10013/// (`https://compute.googleapis.com`). Applications using regional
10014/// endpoints or running in restricted networks (e.g. a network configured
10015// with [Private Google Access with VPC Service Controls]) may want to
10016/// override this default.
10017/// * [with_credentials()]: by default this client uses
10018/// [Application Default Credentials]. Applications using custom
10019/// authentication may need to override this default.
10020///
10021/// [with_endpoint()]: super::builder::region_backend_services::ClientBuilder::with_endpoint
10022/// [with_credentials()]: super::builder::region_backend_services::ClientBuilder::credentials
10023/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10024/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10025///
10026/// # Pooling and Cloning
10027///
10028/// `RegionBackendServices` holds a connection pool internally, it is advised to
10029/// create one and the reuse it. You do not need to wrap `RegionBackendServices` in
10030/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10031/// already uses an `Arc` internally.
10032#[cfg(feature = "region-backend-services")]
10033#[cfg_attr(docsrs, doc(cfg(feature = "region-backend-services")))]
10034#[derive(Clone, Debug)]
10035pub struct RegionBackendServices {
10036 inner: std::sync::Arc<dyn super::stub::dynamic::RegionBackendServices>,
10037}
10038
10039#[cfg(feature = "region-backend-services")]
10040impl RegionBackendServices {
10041 /// Returns a builder for [RegionBackendServices].
10042 ///
10043 /// ```
10044 /// # async fn sample() -> gax::client_builder::Result<()> {
10045 /// # use google_cloud_compute_v1::client::RegionBackendServices;
10046 /// let client = RegionBackendServices::builder().build().await?;
10047 /// # Ok(()) }
10048 /// ```
10049 pub fn builder() -> super::builder::region_backend_services::ClientBuilder {
10050 gax::client_builder::internal::new_builder(
10051 super::builder::region_backend_services::client::Factory,
10052 )
10053 }
10054
10055 /// Creates a new client from the provided stub.
10056 ///
10057 /// The most common case for calling this function is in tests mocking the
10058 /// client's behavior.
10059 pub fn from_stub<T>(stub: T) -> Self
10060 where
10061 T: super::stub::RegionBackendServices + 'static,
10062 {
10063 Self {
10064 inner: std::sync::Arc::new(stub),
10065 }
10066 }
10067
10068 pub(crate) async fn new(
10069 config: gaxi::options::ClientConfig,
10070 ) -> gax::client_builder::Result<Self> {
10071 let inner = Self::build_inner(config).await?;
10072 Ok(Self { inner })
10073 }
10074
10075 async fn build_inner(
10076 conf: gaxi::options::ClientConfig,
10077 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionBackendServices>>
10078 {
10079 if gaxi::options::tracing_enabled(&conf) {
10080 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10081 }
10082 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10083 }
10084
10085 async fn build_transport(
10086 conf: gaxi::options::ClientConfig,
10087 ) -> gax::client_builder::Result<impl super::stub::RegionBackendServices> {
10088 super::transport::RegionBackendServices::new(conf).await
10089 }
10090
10091 async fn build_with_tracing(
10092 conf: gaxi::options::ClientConfig,
10093 ) -> gax::client_builder::Result<impl super::stub::RegionBackendServices> {
10094 Self::build_transport(conf)
10095 .await
10096 .map(super::tracing::RegionBackendServices::new)
10097 }
10098
10099 /// Deletes the specified regional BackendService resource.
10100 pub fn delete(&self) -> super::builder::region_backend_services::Delete {
10101 super::builder::region_backend_services::Delete::new(self.inner.clone())
10102 }
10103
10104 /// Returns the specified regional BackendService resource.
10105 pub fn get(&self) -> super::builder::region_backend_services::Get {
10106 super::builder::region_backend_services::Get::new(self.inner.clone())
10107 }
10108
10109 /// Gets the most recent health check results for this
10110 /// regional BackendService.
10111 pub fn get_health(&self) -> super::builder::region_backend_services::GetHealth {
10112 super::builder::region_backend_services::GetHealth::new(self.inner.clone())
10113 }
10114
10115 /// Gets the access control policy for a resource. May be empty if no such
10116 /// policy or resource exists.
10117 pub fn get_iam_policy(&self) -> super::builder::region_backend_services::GetIamPolicy {
10118 super::builder::region_backend_services::GetIamPolicy::new(self.inner.clone())
10119 }
10120
10121 /// Creates a regional BackendService resource in the specified project using
10122 /// the data included in the request. For more information, see
10123 /// Backend services overview.
10124 pub fn insert(&self) -> super::builder::region_backend_services::Insert {
10125 super::builder::region_backend_services::Insert::new(self.inner.clone())
10126 }
10127
10128 /// Retrieves the list of regional BackendService resources available to the
10129 /// specified project in the given region.
10130 pub fn list(&self) -> super::builder::region_backend_services::List {
10131 super::builder::region_backend_services::List::new(self.inner.clone())
10132 }
10133
10134 /// Retrieves a list of all usable backend services in the specified project in
10135 /// the given region.
10136 pub fn list_usable(&self) -> super::builder::region_backend_services::ListUsable {
10137 super::builder::region_backend_services::ListUsable::new(self.inner.clone())
10138 }
10139
10140 /// Updates the specified regional BackendService resource with the data
10141 /// included in the request. For more information, see
10142 /// Understanding backend services This method
10143 /// supports PATCH semantics and uses the JSON merge
10144 /// patch format and processing rules.
10145 pub fn patch(&self) -> super::builder::region_backend_services::Patch {
10146 super::builder::region_backend_services::Patch::new(self.inner.clone())
10147 }
10148
10149 /// Sets the access control policy on the specified resource.
10150 /// Replaces any existing policy.
10151 pub fn set_iam_policy(&self) -> super::builder::region_backend_services::SetIamPolicy {
10152 super::builder::region_backend_services::SetIamPolicy::new(self.inner.clone())
10153 }
10154
10155 /// Sets the Google Cloud Armor security policy for the specified backend
10156 /// service. For more information, seeGoogle
10157 /// Cloud Armor Overview
10158 pub fn set_security_policy(
10159 &self,
10160 ) -> super::builder::region_backend_services::SetSecurityPolicy {
10161 super::builder::region_backend_services::SetSecurityPolicy::new(self.inner.clone())
10162 }
10163
10164 /// Returns permissions that a caller has on the specified resource.
10165 pub fn test_iam_permissions(
10166 &self,
10167 ) -> super::builder::region_backend_services::TestIamPermissions {
10168 super::builder::region_backend_services::TestIamPermissions::new(self.inner.clone())
10169 }
10170
10171 /// Updates the specified regional BackendService resource with the data
10172 /// included in the request. For more information,
10173 /// see
10174 /// Backend services overview.
10175 pub fn update(&self) -> super::builder::region_backend_services::Update {
10176 super::builder::region_backend_services::Update::new(self.inner.clone())
10177 }
10178
10179 /// Retrieves the specified region-specific Operations resource.
10180 pub fn get_operation(&self) -> super::builder::region_backend_services::GetOperation {
10181 super::builder::region_backend_services::GetOperation::new(self.inner.clone())
10182 }
10183}
10184
10185/// Implements a client for the Google Compute Engine API.
10186///
10187/// # Example
10188/// ```
10189/// # async fn sample() -> gax::client_builder::Result<()> {
10190/// # use google_cloud_compute_v1::client::RegionCommitments;
10191/// let client = RegionCommitments::builder().build().await?;
10192/// // use `client` to make requests to the Google Compute Engine API.
10193/// # Ok(()) }
10194/// ```
10195///
10196/// # Service Description
10197///
10198/// Service for the `regionCommitments` resource.
10199///
10200/// # Configuration
10201///
10202/// To configure `RegionCommitments` use the `with_*` methods in the type returned
10203/// by [builder()][RegionCommitments::builder]. The default configuration should
10204/// work for most applications. Common configuration changes include
10205///
10206/// * [with_endpoint()]: by default this client uses the global default endpoint
10207/// (`https://compute.googleapis.com`). Applications using regional
10208/// endpoints or running in restricted networks (e.g. a network configured
10209// with [Private Google Access with VPC Service Controls]) may want to
10210/// override this default.
10211/// * [with_credentials()]: by default this client uses
10212/// [Application Default Credentials]. Applications using custom
10213/// authentication may need to override this default.
10214///
10215/// [with_endpoint()]: super::builder::region_commitments::ClientBuilder::with_endpoint
10216/// [with_credentials()]: super::builder::region_commitments::ClientBuilder::credentials
10217/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10218/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10219///
10220/// # Pooling and Cloning
10221///
10222/// `RegionCommitments` holds a connection pool internally, it is advised to
10223/// create one and the reuse it. You do not need to wrap `RegionCommitments` in
10224/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10225/// already uses an `Arc` internally.
10226#[cfg(feature = "region-commitments")]
10227#[cfg_attr(docsrs, doc(cfg(feature = "region-commitments")))]
10228#[derive(Clone, Debug)]
10229pub struct RegionCommitments {
10230 inner: std::sync::Arc<dyn super::stub::dynamic::RegionCommitments>,
10231}
10232
10233#[cfg(feature = "region-commitments")]
10234impl RegionCommitments {
10235 /// Returns a builder for [RegionCommitments].
10236 ///
10237 /// ```
10238 /// # async fn sample() -> gax::client_builder::Result<()> {
10239 /// # use google_cloud_compute_v1::client::RegionCommitments;
10240 /// let client = RegionCommitments::builder().build().await?;
10241 /// # Ok(()) }
10242 /// ```
10243 pub fn builder() -> super::builder::region_commitments::ClientBuilder {
10244 gax::client_builder::internal::new_builder(
10245 super::builder::region_commitments::client::Factory,
10246 )
10247 }
10248
10249 /// Creates a new client from the provided stub.
10250 ///
10251 /// The most common case for calling this function is in tests mocking the
10252 /// client's behavior.
10253 pub fn from_stub<T>(stub: T) -> Self
10254 where
10255 T: super::stub::RegionCommitments + 'static,
10256 {
10257 Self {
10258 inner: std::sync::Arc::new(stub),
10259 }
10260 }
10261
10262 pub(crate) async fn new(
10263 config: gaxi::options::ClientConfig,
10264 ) -> gax::client_builder::Result<Self> {
10265 let inner = Self::build_inner(config).await?;
10266 Ok(Self { inner })
10267 }
10268
10269 async fn build_inner(
10270 conf: gaxi::options::ClientConfig,
10271 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionCommitments>>
10272 {
10273 if gaxi::options::tracing_enabled(&conf) {
10274 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10275 }
10276 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10277 }
10278
10279 async fn build_transport(
10280 conf: gaxi::options::ClientConfig,
10281 ) -> gax::client_builder::Result<impl super::stub::RegionCommitments> {
10282 super::transport::RegionCommitments::new(conf).await
10283 }
10284
10285 async fn build_with_tracing(
10286 conf: gaxi::options::ClientConfig,
10287 ) -> gax::client_builder::Result<impl super::stub::RegionCommitments> {
10288 Self::build_transport(conf)
10289 .await
10290 .map(super::tracing::RegionCommitments::new)
10291 }
10292
10293 /// Retrieves an aggregated list of commitments by region.
10294 ///
10295 /// To prevent failure, it is recommended that you set the
10296 /// `returnPartialSuccess` parameter to `true`.
10297 pub fn aggregated_list(&self) -> super::builder::region_commitments::AggregatedList {
10298 super::builder::region_commitments::AggregatedList::new(self.inner.clone())
10299 }
10300
10301 /// Returns the specified commitment resource.
10302 pub fn get(&self) -> super::builder::region_commitments::Get {
10303 super::builder::region_commitments::Get::new(self.inner.clone())
10304 }
10305
10306 /// Creates a commitment in the specified project using the data
10307 /// included in the request.
10308 pub fn insert(&self) -> super::builder::region_commitments::Insert {
10309 super::builder::region_commitments::Insert::new(self.inner.clone())
10310 }
10311
10312 /// Retrieves a list of commitments contained within
10313 /// the specified region.
10314 pub fn list(&self) -> super::builder::region_commitments::List {
10315 super::builder::region_commitments::List::new(self.inner.clone())
10316 }
10317
10318 /// Updates the specified commitment with the data included in the request.
10319 /// Update is performed only on selected fields included as part of
10320 /// update-mask. Only the following fields can be updated: auto_renew and plan.
10321 pub fn update(&self) -> super::builder::region_commitments::Update {
10322 super::builder::region_commitments::Update::new(self.inner.clone())
10323 }
10324
10325 /// Retrieves the specified region-specific Operations resource.
10326 pub fn get_operation(&self) -> super::builder::region_commitments::GetOperation {
10327 super::builder::region_commitments::GetOperation::new(self.inner.clone())
10328 }
10329}
10330
10331/// Implements a client for the Google Compute Engine API.
10332///
10333/// # Example
10334/// ```
10335/// # async fn sample() -> gax::client_builder::Result<()> {
10336/// # use google_cloud_compute_v1::client::RegionDiskTypes;
10337/// let client = RegionDiskTypes::builder().build().await?;
10338/// // use `client` to make requests to the Google Compute Engine API.
10339/// # Ok(()) }
10340/// ```
10341///
10342/// # Service Description
10343///
10344/// Service for the `regionDiskTypes` resource.
10345///
10346/// # Configuration
10347///
10348/// To configure `RegionDiskTypes` use the `with_*` methods in the type returned
10349/// by [builder()][RegionDiskTypes::builder]. The default configuration should
10350/// work for most applications. Common configuration changes include
10351///
10352/// * [with_endpoint()]: by default this client uses the global default endpoint
10353/// (`https://compute.googleapis.com`). Applications using regional
10354/// endpoints or running in restricted networks (e.g. a network configured
10355// with [Private Google Access with VPC Service Controls]) may want to
10356/// override this default.
10357/// * [with_credentials()]: by default this client uses
10358/// [Application Default Credentials]. Applications using custom
10359/// authentication may need to override this default.
10360///
10361/// [with_endpoint()]: super::builder::region_disk_types::ClientBuilder::with_endpoint
10362/// [with_credentials()]: super::builder::region_disk_types::ClientBuilder::credentials
10363/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10364/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10365///
10366/// # Pooling and Cloning
10367///
10368/// `RegionDiskTypes` holds a connection pool internally, it is advised to
10369/// create one and the reuse it. You do not need to wrap `RegionDiskTypes` in
10370/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10371/// already uses an `Arc` internally.
10372#[cfg(feature = "region-disk-types")]
10373#[cfg_attr(docsrs, doc(cfg(feature = "region-disk-types")))]
10374#[derive(Clone, Debug)]
10375pub struct RegionDiskTypes {
10376 inner: std::sync::Arc<dyn super::stub::dynamic::RegionDiskTypes>,
10377}
10378
10379#[cfg(feature = "region-disk-types")]
10380impl RegionDiskTypes {
10381 /// Returns a builder for [RegionDiskTypes].
10382 ///
10383 /// ```
10384 /// # async fn sample() -> gax::client_builder::Result<()> {
10385 /// # use google_cloud_compute_v1::client::RegionDiskTypes;
10386 /// let client = RegionDiskTypes::builder().build().await?;
10387 /// # Ok(()) }
10388 /// ```
10389 pub fn builder() -> super::builder::region_disk_types::ClientBuilder {
10390 gax::client_builder::internal::new_builder(
10391 super::builder::region_disk_types::client::Factory,
10392 )
10393 }
10394
10395 /// Creates a new client from the provided stub.
10396 ///
10397 /// The most common case for calling this function is in tests mocking the
10398 /// client's behavior.
10399 pub fn from_stub<T>(stub: T) -> Self
10400 where
10401 T: super::stub::RegionDiskTypes + 'static,
10402 {
10403 Self {
10404 inner: std::sync::Arc::new(stub),
10405 }
10406 }
10407
10408 pub(crate) async fn new(
10409 config: gaxi::options::ClientConfig,
10410 ) -> gax::client_builder::Result<Self> {
10411 let inner = Self::build_inner(config).await?;
10412 Ok(Self { inner })
10413 }
10414
10415 async fn build_inner(
10416 conf: gaxi::options::ClientConfig,
10417 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionDiskTypes>>
10418 {
10419 if gaxi::options::tracing_enabled(&conf) {
10420 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10421 }
10422 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10423 }
10424
10425 async fn build_transport(
10426 conf: gaxi::options::ClientConfig,
10427 ) -> gax::client_builder::Result<impl super::stub::RegionDiskTypes> {
10428 super::transport::RegionDiskTypes::new(conf).await
10429 }
10430
10431 async fn build_with_tracing(
10432 conf: gaxi::options::ClientConfig,
10433 ) -> gax::client_builder::Result<impl super::stub::RegionDiskTypes> {
10434 Self::build_transport(conf)
10435 .await
10436 .map(super::tracing::RegionDiskTypes::new)
10437 }
10438
10439 /// Returns the specified regional disk type.
10440 pub fn get(&self) -> super::builder::region_disk_types::Get {
10441 super::builder::region_disk_types::Get::new(self.inner.clone())
10442 }
10443
10444 /// Retrieves a list of regional disk types available to the specified project.
10445 pub fn list(&self) -> super::builder::region_disk_types::List {
10446 super::builder::region_disk_types::List::new(self.inner.clone())
10447 }
10448}
10449
10450/// Implements a client for the Google Compute Engine API.
10451///
10452/// # Example
10453/// ```
10454/// # async fn sample() -> gax::client_builder::Result<()> {
10455/// # use google_cloud_compute_v1::client::RegionDisks;
10456/// let client = RegionDisks::builder().build().await?;
10457/// // use `client` to make requests to the Google Compute Engine API.
10458/// # Ok(()) }
10459/// ```
10460///
10461/// # Service Description
10462///
10463/// Service for the `regionDisks` resource.
10464///
10465/// # Configuration
10466///
10467/// To configure `RegionDisks` use the `with_*` methods in the type returned
10468/// by [builder()][RegionDisks::builder]. The default configuration should
10469/// work for most applications. Common configuration changes include
10470///
10471/// * [with_endpoint()]: by default this client uses the global default endpoint
10472/// (`https://compute.googleapis.com`). Applications using regional
10473/// endpoints or running in restricted networks (e.g. a network configured
10474// with [Private Google Access with VPC Service Controls]) may want to
10475/// override this default.
10476/// * [with_credentials()]: by default this client uses
10477/// [Application Default Credentials]. Applications using custom
10478/// authentication may need to override this default.
10479///
10480/// [with_endpoint()]: super::builder::region_disks::ClientBuilder::with_endpoint
10481/// [with_credentials()]: super::builder::region_disks::ClientBuilder::credentials
10482/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10483/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10484///
10485/// # Pooling and Cloning
10486///
10487/// `RegionDisks` holds a connection pool internally, it is advised to
10488/// create one and the reuse it. You do not need to wrap `RegionDisks` in
10489/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10490/// already uses an `Arc` internally.
10491#[cfg(feature = "region-disks")]
10492#[cfg_attr(docsrs, doc(cfg(feature = "region-disks")))]
10493#[derive(Clone, Debug)]
10494pub struct RegionDisks {
10495 inner: std::sync::Arc<dyn super::stub::dynamic::RegionDisks>,
10496}
10497
10498#[cfg(feature = "region-disks")]
10499impl RegionDisks {
10500 /// Returns a builder for [RegionDisks].
10501 ///
10502 /// ```
10503 /// # async fn sample() -> gax::client_builder::Result<()> {
10504 /// # use google_cloud_compute_v1::client::RegionDisks;
10505 /// let client = RegionDisks::builder().build().await?;
10506 /// # Ok(()) }
10507 /// ```
10508 pub fn builder() -> super::builder::region_disks::ClientBuilder {
10509 gax::client_builder::internal::new_builder(super::builder::region_disks::client::Factory)
10510 }
10511
10512 /// Creates a new client from the provided stub.
10513 ///
10514 /// The most common case for calling this function is in tests mocking the
10515 /// client's behavior.
10516 pub fn from_stub<T>(stub: T) -> Self
10517 where
10518 T: super::stub::RegionDisks + 'static,
10519 {
10520 Self {
10521 inner: std::sync::Arc::new(stub),
10522 }
10523 }
10524
10525 pub(crate) async fn new(
10526 config: gaxi::options::ClientConfig,
10527 ) -> gax::client_builder::Result<Self> {
10528 let inner = Self::build_inner(config).await?;
10529 Ok(Self { inner })
10530 }
10531
10532 async fn build_inner(
10533 conf: gaxi::options::ClientConfig,
10534 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionDisks>> {
10535 if gaxi::options::tracing_enabled(&conf) {
10536 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10537 }
10538 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10539 }
10540
10541 async fn build_transport(
10542 conf: gaxi::options::ClientConfig,
10543 ) -> gax::client_builder::Result<impl super::stub::RegionDisks> {
10544 super::transport::RegionDisks::new(conf).await
10545 }
10546
10547 async fn build_with_tracing(
10548 conf: gaxi::options::ClientConfig,
10549 ) -> gax::client_builder::Result<impl super::stub::RegionDisks> {
10550 Self::build_transport(conf)
10551 .await
10552 .map(super::tracing::RegionDisks::new)
10553 }
10554
10555 /// Adds existing resource policies to a regional disk. You can only add one
10556 /// policy which will be applied to this disk for scheduling snapshot
10557 /// creation.
10558 pub fn add_resource_policies(&self) -> super::builder::region_disks::AddResourcePolicies {
10559 super::builder::region_disks::AddResourcePolicies::new(self.inner.clone())
10560 }
10561
10562 /// Bulk create a set of disks.
10563 pub fn bulk_insert(&self) -> super::builder::region_disks::BulkInsert {
10564 super::builder::region_disks::BulkInsert::new(self.inner.clone())
10565 }
10566
10567 /// Creates a snapshot of a specified persistent disk. For regular snapshot
10568 /// creation, consider using snapshots.insert
10569 /// instead, as that method supports more features, such as creating snapshots
10570 /// in a project different from the source disk project.
10571 pub fn create_snapshot(&self) -> super::builder::region_disks::CreateSnapshot {
10572 super::builder::region_disks::CreateSnapshot::new(self.inner.clone())
10573 }
10574
10575 /// Deletes the specified regional persistent disk. Deleting a regional disk
10576 /// removes all the replicas of its data permanently and is irreversible.
10577 /// However, deleting a disk does not delete anysnapshots
10578 /// previously made from the disk. You must separatelydelete
10579 /// snapshots.
10580 pub fn delete(&self) -> super::builder::region_disks::Delete {
10581 super::builder::region_disks::Delete::new(self.inner.clone())
10582 }
10583
10584 /// Returns a specified regional persistent disk.
10585 pub fn get(&self) -> super::builder::region_disks::Get {
10586 super::builder::region_disks::Get::new(self.inner.clone())
10587 }
10588
10589 /// Gets the access control policy for a resource. May be empty if no such
10590 /// policy or resource exists.
10591 pub fn get_iam_policy(&self) -> super::builder::region_disks::GetIamPolicy {
10592 super::builder::region_disks::GetIamPolicy::new(self.inner.clone())
10593 }
10594
10595 /// Creates a persistent regional disk in the specified project using the data
10596 /// included in the request.
10597 pub fn insert(&self) -> super::builder::region_disks::Insert {
10598 super::builder::region_disks::Insert::new(self.inner.clone())
10599 }
10600
10601 /// Retrieves the list of persistent disks contained within
10602 /// the specified region.
10603 pub fn list(&self) -> super::builder::region_disks::List {
10604 super::builder::region_disks::List::new(self.inner.clone())
10605 }
10606
10607 /// Removes resource policies from a regional disk.
10608 pub fn remove_resource_policies(&self) -> super::builder::region_disks::RemoveResourcePolicies {
10609 super::builder::region_disks::RemoveResourcePolicies::new(self.inner.clone())
10610 }
10611
10612 /// Resizes the specified regional persistent disk.
10613 pub fn resize(&self) -> super::builder::region_disks::Resize {
10614 super::builder::region_disks::Resize::new(self.inner.clone())
10615 }
10616
10617 /// Sets the access control policy on the specified resource.
10618 /// Replaces any existing policy.
10619 pub fn set_iam_policy(&self) -> super::builder::region_disks::SetIamPolicy {
10620 super::builder::region_disks::SetIamPolicy::new(self.inner.clone())
10621 }
10622
10623 /// Sets the labels on the target regional disk.
10624 pub fn set_labels(&self) -> super::builder::region_disks::SetLabels {
10625 super::builder::region_disks::SetLabels::new(self.inner.clone())
10626 }
10627
10628 /// Starts asynchronous replication.
10629 /// Must be invoked on the primary disk.
10630 pub fn start_async_replication(&self) -> super::builder::region_disks::StartAsyncReplication {
10631 super::builder::region_disks::StartAsyncReplication::new(self.inner.clone())
10632 }
10633
10634 /// Stops asynchronous replication.
10635 /// Can be invoked either on the primary or on the secondary disk.
10636 pub fn stop_async_replication(&self) -> super::builder::region_disks::StopAsyncReplication {
10637 super::builder::region_disks::StopAsyncReplication::new(self.inner.clone())
10638 }
10639
10640 /// Stops asynchronous replication for a consistency group of disks.
10641 /// Can be invoked either in the primary or secondary scope.
10642 pub fn stop_group_async_replication(
10643 &self,
10644 ) -> super::builder::region_disks::StopGroupAsyncReplication {
10645 super::builder::region_disks::StopGroupAsyncReplication::new(self.inner.clone())
10646 }
10647
10648 /// Returns permissions that a caller has on the specified resource.
10649 pub fn test_iam_permissions(&self) -> super::builder::region_disks::TestIamPermissions {
10650 super::builder::region_disks::TestIamPermissions::new(self.inner.clone())
10651 }
10652
10653 /// Update the specified disk with the data included in the request. Update is
10654 /// performed only on selected fields included as part of update-mask. Only the
10655 /// following fields can be modified: user_license.
10656 pub fn update(&self) -> super::builder::region_disks::Update {
10657 super::builder::region_disks::Update::new(self.inner.clone())
10658 }
10659
10660 /// Retrieves the specified region-specific Operations resource.
10661 pub fn get_operation(&self) -> super::builder::region_disks::GetOperation {
10662 super::builder::region_disks::GetOperation::new(self.inner.clone())
10663 }
10664}
10665
10666/// Implements a client for the Google Compute Engine API.
10667///
10668/// # Example
10669/// ```
10670/// # async fn sample() -> gax::client_builder::Result<()> {
10671/// # use google_cloud_compute_v1::client::RegionHealthCheckServices;
10672/// let client = RegionHealthCheckServices::builder().build().await?;
10673/// // use `client` to make requests to the Google Compute Engine API.
10674/// # Ok(()) }
10675/// ```
10676///
10677/// # Service Description
10678///
10679/// Service for the `regionHealthCheckServices` resource.
10680///
10681/// # Configuration
10682///
10683/// To configure `RegionHealthCheckServices` use the `with_*` methods in the type returned
10684/// by [builder()][RegionHealthCheckServices::builder]. The default configuration should
10685/// work for most applications. Common configuration changes include
10686///
10687/// * [with_endpoint()]: by default this client uses the global default endpoint
10688/// (`https://compute.googleapis.com`). Applications using regional
10689/// endpoints or running in restricted networks (e.g. a network configured
10690// with [Private Google Access with VPC Service Controls]) may want to
10691/// override this default.
10692/// * [with_credentials()]: by default this client uses
10693/// [Application Default Credentials]. Applications using custom
10694/// authentication may need to override this default.
10695///
10696/// [with_endpoint()]: super::builder::region_health_check_services::ClientBuilder::with_endpoint
10697/// [with_credentials()]: super::builder::region_health_check_services::ClientBuilder::credentials
10698/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10699/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10700///
10701/// # Pooling and Cloning
10702///
10703/// `RegionHealthCheckServices` holds a connection pool internally, it is advised to
10704/// create one and the reuse it. You do not need to wrap `RegionHealthCheckServices` in
10705/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10706/// already uses an `Arc` internally.
10707#[cfg(feature = "region-health-check-services")]
10708#[cfg_attr(docsrs, doc(cfg(feature = "region-health-check-services")))]
10709#[derive(Clone, Debug)]
10710pub struct RegionHealthCheckServices {
10711 inner: std::sync::Arc<dyn super::stub::dynamic::RegionHealthCheckServices>,
10712}
10713
10714#[cfg(feature = "region-health-check-services")]
10715impl RegionHealthCheckServices {
10716 /// Returns a builder for [RegionHealthCheckServices].
10717 ///
10718 /// ```
10719 /// # async fn sample() -> gax::client_builder::Result<()> {
10720 /// # use google_cloud_compute_v1::client::RegionHealthCheckServices;
10721 /// let client = RegionHealthCheckServices::builder().build().await?;
10722 /// # Ok(()) }
10723 /// ```
10724 pub fn builder() -> super::builder::region_health_check_services::ClientBuilder {
10725 gax::client_builder::internal::new_builder(
10726 super::builder::region_health_check_services::client::Factory,
10727 )
10728 }
10729
10730 /// Creates a new client from the provided stub.
10731 ///
10732 /// The most common case for calling this function is in tests mocking the
10733 /// client's behavior.
10734 pub fn from_stub<T>(stub: T) -> Self
10735 where
10736 T: super::stub::RegionHealthCheckServices + 'static,
10737 {
10738 Self {
10739 inner: std::sync::Arc::new(stub),
10740 }
10741 }
10742
10743 pub(crate) async fn new(
10744 config: gaxi::options::ClientConfig,
10745 ) -> gax::client_builder::Result<Self> {
10746 let inner = Self::build_inner(config).await?;
10747 Ok(Self { inner })
10748 }
10749
10750 async fn build_inner(
10751 conf: gaxi::options::ClientConfig,
10752 ) -> gax::client_builder::Result<
10753 std::sync::Arc<dyn super::stub::dynamic::RegionHealthCheckServices>,
10754 > {
10755 if gaxi::options::tracing_enabled(&conf) {
10756 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10757 }
10758 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10759 }
10760
10761 async fn build_transport(
10762 conf: gaxi::options::ClientConfig,
10763 ) -> gax::client_builder::Result<impl super::stub::RegionHealthCheckServices> {
10764 super::transport::RegionHealthCheckServices::new(conf).await
10765 }
10766
10767 async fn build_with_tracing(
10768 conf: gaxi::options::ClientConfig,
10769 ) -> gax::client_builder::Result<impl super::stub::RegionHealthCheckServices> {
10770 Self::build_transport(conf)
10771 .await
10772 .map(super::tracing::RegionHealthCheckServices::new)
10773 }
10774
10775 /// Deletes the specified regional HealthCheckService.
10776 pub fn delete(&self) -> super::builder::region_health_check_services::Delete {
10777 super::builder::region_health_check_services::Delete::new(self.inner.clone())
10778 }
10779
10780 /// Returns the specified regional HealthCheckService resource.
10781 pub fn get(&self) -> super::builder::region_health_check_services::Get {
10782 super::builder::region_health_check_services::Get::new(self.inner.clone())
10783 }
10784
10785 /// Creates a regional HealthCheckService resource in the
10786 /// specified project and region using the data included in the request.
10787 pub fn insert(&self) -> super::builder::region_health_check_services::Insert {
10788 super::builder::region_health_check_services::Insert::new(self.inner.clone())
10789 }
10790
10791 /// Lists all the HealthCheckService resources that have been
10792 /// configured for the specified project in the given region.
10793 pub fn list(&self) -> super::builder::region_health_check_services::List {
10794 super::builder::region_health_check_services::List::new(self.inner.clone())
10795 }
10796
10797 /// Updates the specified regional HealthCheckService resource
10798 /// with the data included in the request. This method supportsPATCH
10799 /// semantics and uses theJSON merge
10800 /// patch format and processing rules.
10801 pub fn patch(&self) -> super::builder::region_health_check_services::Patch {
10802 super::builder::region_health_check_services::Patch::new(self.inner.clone())
10803 }
10804
10805 /// Retrieves the specified region-specific Operations resource.
10806 pub fn get_operation(&self) -> super::builder::region_health_check_services::GetOperation {
10807 super::builder::region_health_check_services::GetOperation::new(self.inner.clone())
10808 }
10809}
10810
10811/// Implements a client for the Google Compute Engine API.
10812///
10813/// # Example
10814/// ```
10815/// # async fn sample() -> gax::client_builder::Result<()> {
10816/// # use google_cloud_compute_v1::client::RegionHealthChecks;
10817/// let client = RegionHealthChecks::builder().build().await?;
10818/// // use `client` to make requests to the Google Compute Engine API.
10819/// # Ok(()) }
10820/// ```
10821///
10822/// # Service Description
10823///
10824/// Service for the `regionHealthChecks` resource.
10825///
10826/// # Configuration
10827///
10828/// To configure `RegionHealthChecks` use the `with_*` methods in the type returned
10829/// by [builder()][RegionHealthChecks::builder]. The default configuration should
10830/// work for most applications. Common configuration changes include
10831///
10832/// * [with_endpoint()]: by default this client uses the global default endpoint
10833/// (`https://compute.googleapis.com`). Applications using regional
10834/// endpoints or running in restricted networks (e.g. a network configured
10835// with [Private Google Access with VPC Service Controls]) may want to
10836/// override this default.
10837/// * [with_credentials()]: by default this client uses
10838/// [Application Default Credentials]. Applications using custom
10839/// authentication may need to override this default.
10840///
10841/// [with_endpoint()]: super::builder::region_health_checks::ClientBuilder::with_endpoint
10842/// [with_credentials()]: super::builder::region_health_checks::ClientBuilder::credentials
10843/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10844/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10845///
10846/// # Pooling and Cloning
10847///
10848/// `RegionHealthChecks` holds a connection pool internally, it is advised to
10849/// create one and the reuse it. You do not need to wrap `RegionHealthChecks` in
10850/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10851/// already uses an `Arc` internally.
10852#[cfg(feature = "region-health-checks")]
10853#[cfg_attr(docsrs, doc(cfg(feature = "region-health-checks")))]
10854#[derive(Clone, Debug)]
10855pub struct RegionHealthChecks {
10856 inner: std::sync::Arc<dyn super::stub::dynamic::RegionHealthChecks>,
10857}
10858
10859#[cfg(feature = "region-health-checks")]
10860impl RegionHealthChecks {
10861 /// Returns a builder for [RegionHealthChecks].
10862 ///
10863 /// ```
10864 /// # async fn sample() -> gax::client_builder::Result<()> {
10865 /// # use google_cloud_compute_v1::client::RegionHealthChecks;
10866 /// let client = RegionHealthChecks::builder().build().await?;
10867 /// # Ok(()) }
10868 /// ```
10869 pub fn builder() -> super::builder::region_health_checks::ClientBuilder {
10870 gax::client_builder::internal::new_builder(
10871 super::builder::region_health_checks::client::Factory,
10872 )
10873 }
10874
10875 /// Creates a new client from the provided stub.
10876 ///
10877 /// The most common case for calling this function is in tests mocking the
10878 /// client's behavior.
10879 pub fn from_stub<T>(stub: T) -> Self
10880 where
10881 T: super::stub::RegionHealthChecks + 'static,
10882 {
10883 Self {
10884 inner: std::sync::Arc::new(stub),
10885 }
10886 }
10887
10888 pub(crate) async fn new(
10889 config: gaxi::options::ClientConfig,
10890 ) -> gax::client_builder::Result<Self> {
10891 let inner = Self::build_inner(config).await?;
10892 Ok(Self { inner })
10893 }
10894
10895 async fn build_inner(
10896 conf: gaxi::options::ClientConfig,
10897 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionHealthChecks>>
10898 {
10899 if gaxi::options::tracing_enabled(&conf) {
10900 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10901 }
10902 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10903 }
10904
10905 async fn build_transport(
10906 conf: gaxi::options::ClientConfig,
10907 ) -> gax::client_builder::Result<impl super::stub::RegionHealthChecks> {
10908 super::transport::RegionHealthChecks::new(conf).await
10909 }
10910
10911 async fn build_with_tracing(
10912 conf: gaxi::options::ClientConfig,
10913 ) -> gax::client_builder::Result<impl super::stub::RegionHealthChecks> {
10914 Self::build_transport(conf)
10915 .await
10916 .map(super::tracing::RegionHealthChecks::new)
10917 }
10918
10919 /// Deletes the specified HealthCheck resource.
10920 pub fn delete(&self) -> super::builder::region_health_checks::Delete {
10921 super::builder::region_health_checks::Delete::new(self.inner.clone())
10922 }
10923
10924 /// Returns the specified HealthCheck resource.
10925 pub fn get(&self) -> super::builder::region_health_checks::Get {
10926 super::builder::region_health_checks::Get::new(self.inner.clone())
10927 }
10928
10929 /// Creates a HealthCheck resource in the specified project using the data
10930 /// included in the request.
10931 pub fn insert(&self) -> super::builder::region_health_checks::Insert {
10932 super::builder::region_health_checks::Insert::new(self.inner.clone())
10933 }
10934
10935 /// Retrieves the list of HealthCheck resources available to the specified
10936 /// project.
10937 pub fn list(&self) -> super::builder::region_health_checks::List {
10938 super::builder::region_health_checks::List::new(self.inner.clone())
10939 }
10940
10941 /// Updates a HealthCheck resource in the specified project using the data
10942 /// included in the request. This method supportsPATCH
10943 /// semantics and uses theJSON merge
10944 /// patch format and processing rules.
10945 pub fn patch(&self) -> super::builder::region_health_checks::Patch {
10946 super::builder::region_health_checks::Patch::new(self.inner.clone())
10947 }
10948
10949 /// Returns permissions that a caller has on the specified resource.
10950 pub fn test_iam_permissions(&self) -> super::builder::region_health_checks::TestIamPermissions {
10951 super::builder::region_health_checks::TestIamPermissions::new(self.inner.clone())
10952 }
10953
10954 /// Updates a HealthCheck resource in the specified project using the data
10955 /// included in the request.
10956 pub fn update(&self) -> super::builder::region_health_checks::Update {
10957 super::builder::region_health_checks::Update::new(self.inner.clone())
10958 }
10959
10960 /// Retrieves the specified region-specific Operations resource.
10961 pub fn get_operation(&self) -> super::builder::region_health_checks::GetOperation {
10962 super::builder::region_health_checks::GetOperation::new(self.inner.clone())
10963 }
10964}
10965
10966/// Implements a client for the Google Compute Engine API.
10967///
10968/// # Example
10969/// ```
10970/// # async fn sample() -> gax::client_builder::Result<()> {
10971/// # use google_cloud_compute_v1::client::RegionInstanceGroupManagers;
10972/// let client = RegionInstanceGroupManagers::builder().build().await?;
10973/// // use `client` to make requests to the Google Compute Engine API.
10974/// # Ok(()) }
10975/// ```
10976///
10977/// # Service Description
10978///
10979/// Service for the `regionInstanceGroupManagers` resource.
10980///
10981/// # Configuration
10982///
10983/// To configure `RegionInstanceGroupManagers` use the `with_*` methods in the type returned
10984/// by [builder()][RegionInstanceGroupManagers::builder]. The default configuration should
10985/// work for most applications. Common configuration changes include
10986///
10987/// * [with_endpoint()]: by default this client uses the global default endpoint
10988/// (`https://compute.googleapis.com`). Applications using regional
10989/// endpoints or running in restricted networks (e.g. a network configured
10990// with [Private Google Access with VPC Service Controls]) may want to
10991/// override this default.
10992/// * [with_credentials()]: by default this client uses
10993/// [Application Default Credentials]. Applications using custom
10994/// authentication may need to override this default.
10995///
10996/// [with_endpoint()]: super::builder::region_instance_group_managers::ClientBuilder::with_endpoint
10997/// [with_credentials()]: super::builder::region_instance_group_managers::ClientBuilder::credentials
10998/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10999/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11000///
11001/// # Pooling and Cloning
11002///
11003/// `RegionInstanceGroupManagers` holds a connection pool internally, it is advised to
11004/// create one and the reuse it. You do not need to wrap `RegionInstanceGroupManagers` in
11005/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11006/// already uses an `Arc` internally.
11007#[cfg(feature = "region-instance-group-managers")]
11008#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-group-managers")))]
11009#[derive(Clone, Debug)]
11010pub struct RegionInstanceGroupManagers {
11011 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroupManagers>,
11012}
11013
11014#[cfg(feature = "region-instance-group-managers")]
11015impl RegionInstanceGroupManagers {
11016 /// Returns a builder for [RegionInstanceGroupManagers].
11017 ///
11018 /// ```
11019 /// # async fn sample() -> gax::client_builder::Result<()> {
11020 /// # use google_cloud_compute_v1::client::RegionInstanceGroupManagers;
11021 /// let client = RegionInstanceGroupManagers::builder().build().await?;
11022 /// # Ok(()) }
11023 /// ```
11024 pub fn builder() -> super::builder::region_instance_group_managers::ClientBuilder {
11025 gax::client_builder::internal::new_builder(
11026 super::builder::region_instance_group_managers::client::Factory,
11027 )
11028 }
11029
11030 /// Creates a new client from the provided stub.
11031 ///
11032 /// The most common case for calling this function is in tests mocking the
11033 /// client's behavior.
11034 pub fn from_stub<T>(stub: T) -> Self
11035 where
11036 T: super::stub::RegionInstanceGroupManagers + 'static,
11037 {
11038 Self {
11039 inner: std::sync::Arc::new(stub),
11040 }
11041 }
11042
11043 pub(crate) async fn new(
11044 config: gaxi::options::ClientConfig,
11045 ) -> gax::client_builder::Result<Self> {
11046 let inner = Self::build_inner(config).await?;
11047 Ok(Self { inner })
11048 }
11049
11050 async fn build_inner(
11051 conf: gaxi::options::ClientConfig,
11052 ) -> gax::client_builder::Result<
11053 std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroupManagers>,
11054 > {
11055 if gaxi::options::tracing_enabled(&conf) {
11056 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11057 }
11058 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11059 }
11060
11061 async fn build_transport(
11062 conf: gaxi::options::ClientConfig,
11063 ) -> gax::client_builder::Result<impl super::stub::RegionInstanceGroupManagers> {
11064 super::transport::RegionInstanceGroupManagers::new(conf).await
11065 }
11066
11067 async fn build_with_tracing(
11068 conf: gaxi::options::ClientConfig,
11069 ) -> gax::client_builder::Result<impl super::stub::RegionInstanceGroupManagers> {
11070 Self::build_transport(conf)
11071 .await
11072 .map(super::tracing::RegionInstanceGroupManagers::new)
11073 }
11074
11075 /// Flags the specified instances to be immediately removed from the managed
11076 /// instance group. Abandoning an instance does not delete the
11077 /// instance, but it does remove the instance from any target pools that are
11078 /// applied by the managed instance group. This method reduces thetargetSize of the managed instance group by the
11079 /// number of instances that you abandon. This operation is marked asDONE when the action is scheduled even if the instances have
11080 /// not yet been removed from the group. You must separately verify the
11081 /// status of the abandoning action with thelistmanagedinstances
11082 /// method.
11083 ///
11084 /// If the group is part of a backend
11085 /// service that has enabled
11086 /// connection draining, it can take up to 60 seconds after the connection
11087 /// draining duration has elapsed before the VM instance is removed or deleted.
11088 ///
11089 /// You can specify a maximum of 1000 instances with this method per request.
11090 pub fn abandon_instances(
11091 &self,
11092 ) -> super::builder::region_instance_group_managers::AbandonInstances {
11093 super::builder::region_instance_group_managers::AbandonInstances::new(self.inner.clone())
11094 }
11095
11096 /// Apply updates to selected instances the managed instance group.
11097 pub fn apply_updates_to_instances(
11098 &self,
11099 ) -> super::builder::region_instance_group_managers::ApplyUpdatesToInstances {
11100 super::builder::region_instance_group_managers::ApplyUpdatesToInstances::new(
11101 self.inner.clone(),
11102 )
11103 }
11104
11105 /// Creates instances with per-instance configurations in this regional managed
11106 /// instance group. Instances are created using the current instance template.
11107 /// The create instances operation is marked DONE if
11108 /// the createInstances request is successful. The underlying
11109 /// actions take additional time. You must separately verify the status of thecreating or actions with the listmanagedinstances
11110 /// method.
11111 pub fn create_instances(
11112 &self,
11113 ) -> super::builder::region_instance_group_managers::CreateInstances {
11114 super::builder::region_instance_group_managers::CreateInstances::new(self.inner.clone())
11115 }
11116
11117 /// Deletes the specified managed instance group and all of the instances
11118 /// in that group.
11119 pub fn delete(&self) -> super::builder::region_instance_group_managers::Delete {
11120 super::builder::region_instance_group_managers::Delete::new(self.inner.clone())
11121 }
11122
11123 /// Flags the specified instances in the managed instance group to be
11124 /// immediately deleted. The instances are also removed from any target
11125 /// pools of which they were a member. This method reduces thetargetSize of the managed instance group by the number of
11126 /// instances that you delete.
11127 /// The deleteInstances operation is marked DONE if
11128 /// the deleteInstances request is successful. The underlying
11129 /// actions take additional time. You must separately verify the status of thedeleting action with thelistmanagedinstances
11130 /// method.
11131 ///
11132 /// If the group is part of a backend
11133 /// service that has enabled
11134 /// connection draining, it can take up to 60 seconds after the connection
11135 /// draining duration has elapsed before the VM instance is removed or deleted.
11136 ///
11137 /// You can specify a maximum of 1000 instances with this method per request.
11138 pub fn delete_instances(
11139 &self,
11140 ) -> super::builder::region_instance_group_managers::DeleteInstances {
11141 super::builder::region_instance_group_managers::DeleteInstances::new(self.inner.clone())
11142 }
11143
11144 /// Deletes selected per-instance configurations for the managed instance
11145 /// group.
11146 pub fn delete_per_instance_configs(
11147 &self,
11148 ) -> super::builder::region_instance_group_managers::DeletePerInstanceConfigs {
11149 super::builder::region_instance_group_managers::DeletePerInstanceConfigs::new(
11150 self.inner.clone(),
11151 )
11152 }
11153
11154 /// Returns all of the details about the specified managed instance group.
11155 pub fn get(&self) -> super::builder::region_instance_group_managers::Get {
11156 super::builder::region_instance_group_managers::Get::new(self.inner.clone())
11157 }
11158
11159 /// Creates a managed instance group using the information that you specify
11160 /// in the request. After the group is created, instances in the group are
11161 /// created using the specified instance template.
11162 /// This operation is marked as DONE when the group is created
11163 /// even if the instances in the group have not yet been created. You must
11164 /// separately verify the status of the individual instances with thelistmanagedinstances
11165 /// method.
11166 ///
11167 /// A regional managed instance group can contain up to 2000 instances.
11168 pub fn insert(&self) -> super::builder::region_instance_group_managers::Insert {
11169 super::builder::region_instance_group_managers::Insert::new(self.inner.clone())
11170 }
11171
11172 /// Retrieves the list of managed instance groups that are contained
11173 /// within the specified region.
11174 pub fn list(&self) -> super::builder::region_instance_group_managers::List {
11175 super::builder::region_instance_group_managers::List::new(self.inner.clone())
11176 }
11177
11178 /// Lists all errors thrown by actions on instances for a given regional
11179 /// managed instance group. The filter andorderBy query parameters are not supported.
11180 pub fn list_errors(&self) -> super::builder::region_instance_group_managers::ListErrors {
11181 super::builder::region_instance_group_managers::ListErrors::new(self.inner.clone())
11182 }
11183
11184 /// Lists the instances in the managed instance group and instances that are
11185 /// scheduled to be created. The list includes any current actions
11186 /// that the group has scheduled for its instances. The orderBy
11187 /// query parameter is not supported. The `pageToken` query parameter is
11188 /// supported only if the group's `listManagedInstancesResults` field is set
11189 /// to `PAGINATED`.
11190 pub fn list_managed_instances(
11191 &self,
11192 ) -> super::builder::region_instance_group_managers::ListManagedInstances {
11193 super::builder::region_instance_group_managers::ListManagedInstances::new(
11194 self.inner.clone(),
11195 )
11196 }
11197
11198 /// Lists all of the per-instance configurations defined for the managed
11199 /// instance group. The orderBy query parameter is not supported.
11200 pub fn list_per_instance_configs(
11201 &self,
11202 ) -> super::builder::region_instance_group_managers::ListPerInstanceConfigs {
11203 super::builder::region_instance_group_managers::ListPerInstanceConfigs::new(
11204 self.inner.clone(),
11205 )
11206 }
11207
11208 /// Updates a managed instance group using the information that you specify
11209 /// in the request.
11210 /// This operation is marked as DONE when the group is patched
11211 /// even if the instances in the group are still in the process of being
11212 /// patched. You must separately verify the status of the individual instances
11213 /// with the listmanagedinstances
11214 /// method. This method supportsPATCH
11215 /// semantics and uses theJSON merge
11216 /// patch format and processing rules.
11217 ///
11218 /// If you update your group to specify a new template or instance
11219 /// configuration, it's possible that your intended specification for each VM
11220 /// in the group is different from the current state of that VM. To learn how
11221 /// to apply an updated configuration to the VMs in a MIG, seeUpdating instances in
11222 /// a MIG.
11223 pub fn patch(&self) -> super::builder::region_instance_group_managers::Patch {
11224 super::builder::region_instance_group_managers::Patch::new(self.inner.clone())
11225 }
11226
11227 /// Inserts or patches per-instance configurations for the managed instance
11228 /// group. perInstanceConfig.name serves as a key used to
11229 /// distinguish whether to perform insert or patch.
11230 pub fn patch_per_instance_configs(
11231 &self,
11232 ) -> super::builder::region_instance_group_managers::PatchPerInstanceConfigs {
11233 super::builder::region_instance_group_managers::PatchPerInstanceConfigs::new(
11234 self.inner.clone(),
11235 )
11236 }
11237
11238 /// Flags the specified VM instances in the managed instance group to be
11239 /// immediately recreated. Each instance is recreated using the group's current
11240 /// configuration. This operation is marked as DONE when the flag
11241 /// is set even if the instances have not yet been recreated. You must
11242 /// separately verify the status of each instance by checking itscurrentAction field; for more information, see Checking
11243 /// the status of managed instances.
11244 ///
11245 /// If the group is part of a backend
11246 /// service that has enabled
11247 /// connection draining, it can take up to 60 seconds after the connection
11248 /// draining duration has elapsed before the VM instance is removed or deleted.
11249 ///
11250 /// You can specify a maximum of 1000 instances with this method per request.
11251 pub fn recreate_instances(
11252 &self,
11253 ) -> super::builder::region_instance_group_managers::RecreateInstances {
11254 super::builder::region_instance_group_managers::RecreateInstances::new(self.inner.clone())
11255 }
11256
11257 /// Changes the intended size of the managed instance group. If you increase
11258 /// the size, the group creates new instances using the current instance
11259 /// template. If you decrease the size, the group deletes one or more
11260 /// instances.
11261 ///
11262 /// The resize operation is marked DONE if theresize request is successful. The underlying actions take
11263 /// additional time. You must separately verify the status of thecreating or deleting actions with thelistmanagedinstances
11264 /// method.
11265 ///
11266 /// If the group is part of a backend
11267 /// service that has enabled
11268 /// connection draining, it can take up to 60 seconds after the connection
11269 /// draining duration has elapsed before the VM instance is removed or deleted.
11270 pub fn resize(&self) -> super::builder::region_instance_group_managers::Resize {
11271 super::builder::region_instance_group_managers::Resize::new(self.inner.clone())
11272 }
11273
11274 /// Flags the specified instances in the managed instance group to be
11275 /// resumed. This method increases thetargetSize and decreases the targetSuspendedSize
11276 /// of the managed instance group by the number of instances that you resume.
11277 /// The resumeInstances operation is marked DONE if
11278 /// the resumeInstances request is successful. The underlying
11279 /// actions take additional time. You must separately verify the status of theRESUMING action with thelistmanagedinstances
11280 /// method.
11281 ///
11282 /// In this request, you can only specify instances that are suspended. For
11283 /// example, if an instance was previously suspended using the suspendInstances
11284 /// method, it can be resumed using the resumeInstances method.
11285 ///
11286 /// If a health check is attached to the managed instance group, the specified
11287 /// instances will be verified as healthy after they are resumed.
11288 ///
11289 /// You can specify a maximum of 1000 instances with this method per request.
11290 pub fn resume_instances(
11291 &self,
11292 ) -> super::builder::region_instance_group_managers::ResumeInstances {
11293 super::builder::region_instance_group_managers::ResumeInstances::new(self.inner.clone())
11294 }
11295
11296 /// Sets the instance template to use when creating new instances or recreating
11297 /// instances in this group. Existing instances are not affected.
11298 pub fn set_instance_template(
11299 &self,
11300 ) -> super::builder::region_instance_group_managers::SetInstanceTemplate {
11301 super::builder::region_instance_group_managers::SetInstanceTemplate::new(self.inner.clone())
11302 }
11303
11304 /// Modifies the target pools to which all new instances in this group are
11305 /// assigned. Existing instances in the group are not affected.
11306 pub fn set_target_pools(
11307 &self,
11308 ) -> super::builder::region_instance_group_managers::SetTargetPools {
11309 super::builder::region_instance_group_managers::SetTargetPools::new(self.inner.clone())
11310 }
11311
11312 /// Flags the specified instances in the managed instance group to be
11313 /// started. This method increases thetargetSize and decreases the targetStoppedSize
11314 /// of the managed instance group by the number of instances that you start.
11315 /// The startInstances operation is marked DONE if
11316 /// the startInstances request is successful. The underlying
11317 /// actions take additional time. You must separately verify the status of theSTARTING action with thelistmanagedinstances
11318 /// method.
11319 ///
11320 /// In this request, you can only specify instances that are stopped. For
11321 /// example, if an instance was previously stopped using the stopInstances
11322 /// method, it can be started using the startInstances method.
11323 ///
11324 /// If a health check is attached to the managed instance group, the specified
11325 /// instances will be verified as healthy after they are started.
11326 ///
11327 /// You can specify a maximum of 1000 instances with this method per request.
11328 pub fn start_instances(
11329 &self,
11330 ) -> super::builder::region_instance_group_managers::StartInstances {
11331 super::builder::region_instance_group_managers::StartInstances::new(self.inner.clone())
11332 }
11333
11334 /// Flags the specified instances in the managed instance group to be
11335 /// immediately stopped. You can only specify instances that are running in
11336 /// this request. This method reduces thetargetSize and increases the targetStoppedSize
11337 /// of the managed instance group by the number of instances that you stop.
11338 /// The stopInstances operation is marked DONE if
11339 /// the stopInstances request is successful. The underlying
11340 /// actions take additional time. You must separately verify the status of theSTOPPING action with thelistmanagedinstances
11341 /// method.
11342 ///
11343 /// If the standbyPolicy.initialDelaySec field is set, the group
11344 /// delays stopping the instances until initialDelaySec have
11345 /// passed from instance.creationTimestamp (that is, when the
11346 /// instance was created). This delay gives your application time to
11347 /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
11348 /// will be zero delay.
11349 ///
11350 /// If the group is part of a backend
11351 /// service that has enabled
11352 /// connection draining, it can take up to 60 seconds after the connection
11353 /// draining duration has elapsed before the VM instance is stopped.
11354 ///
11355 /// Stopped instances can be started using the startInstances
11356 /// method.
11357 ///
11358 /// You can specify a maximum of 1000 instances with this method per request.
11359 pub fn stop_instances(&self) -> super::builder::region_instance_group_managers::StopInstances {
11360 super::builder::region_instance_group_managers::StopInstances::new(self.inner.clone())
11361 }
11362
11363 /// Flags the specified instances in the managed instance group to be
11364 /// immediately suspended. You can only specify instances that are running in
11365 /// this request. This method reduces thetargetSize and increases the targetSuspendedSize
11366 /// of the managed instance group by the number of instances that you suspend.
11367 /// The suspendInstances operation is marked DONE if
11368 /// the suspendInstances request is successful. The underlying
11369 /// actions take additional time. You must separately verify the status of theSUSPENDING action with thelistmanagedinstances
11370 /// method.
11371 ///
11372 /// If the standbyPolicy.initialDelaySec field is set, the group
11373 /// delays suspension of the instances until initialDelaySec have
11374 /// passed from instance.creationTimestamp (that is, when the
11375 /// instance was created). This delay gives your application time to
11376 /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
11377 /// will be zero delay.
11378 ///
11379 /// If the group is part of a backend
11380 /// service that has enabled
11381 /// connection draining, it can take up to 60 seconds after the connection
11382 /// draining duration has elapsed before the VM instance is suspended.
11383 ///
11384 /// Suspended instances can be resumed using the resumeInstances
11385 /// method.
11386 ///
11387 /// You can specify a maximum of 1000 instances with this method per request.
11388 pub fn suspend_instances(
11389 &self,
11390 ) -> super::builder::region_instance_group_managers::SuspendInstances {
11391 super::builder::region_instance_group_managers::SuspendInstances::new(self.inner.clone())
11392 }
11393
11394 /// Inserts or updates per-instance configurations for the managed instance
11395 /// group. perInstanceConfig.name serves as a key used to
11396 /// distinguish whether to perform insert or patch.
11397 pub fn update_per_instance_configs(
11398 &self,
11399 ) -> super::builder::region_instance_group_managers::UpdatePerInstanceConfigs {
11400 super::builder::region_instance_group_managers::UpdatePerInstanceConfigs::new(
11401 self.inner.clone(),
11402 )
11403 }
11404
11405 /// Retrieves the specified region-specific Operations resource.
11406 pub fn get_operation(&self) -> super::builder::region_instance_group_managers::GetOperation {
11407 super::builder::region_instance_group_managers::GetOperation::new(self.inner.clone())
11408 }
11409}
11410
11411/// Implements a client for the Google Compute Engine API.
11412///
11413/// # Example
11414/// ```
11415/// # async fn sample() -> gax::client_builder::Result<()> {
11416/// # use google_cloud_compute_v1::client::RegionInstanceGroups;
11417/// let client = RegionInstanceGroups::builder().build().await?;
11418/// // use `client` to make requests to the Google Compute Engine API.
11419/// # Ok(()) }
11420/// ```
11421///
11422/// # Service Description
11423///
11424/// Service for the `regionInstanceGroups` resource.
11425///
11426/// # Configuration
11427///
11428/// To configure `RegionInstanceGroups` use the `with_*` methods in the type returned
11429/// by [builder()][RegionInstanceGroups::builder]. The default configuration should
11430/// work for most applications. Common configuration changes include
11431///
11432/// * [with_endpoint()]: by default this client uses the global default endpoint
11433/// (`https://compute.googleapis.com`). Applications using regional
11434/// endpoints or running in restricted networks (e.g. a network configured
11435// with [Private Google Access with VPC Service Controls]) may want to
11436/// override this default.
11437/// * [with_credentials()]: by default this client uses
11438/// [Application Default Credentials]. Applications using custom
11439/// authentication may need to override this default.
11440///
11441/// [with_endpoint()]: super::builder::region_instance_groups::ClientBuilder::with_endpoint
11442/// [with_credentials()]: super::builder::region_instance_groups::ClientBuilder::credentials
11443/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11444/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11445///
11446/// # Pooling and Cloning
11447///
11448/// `RegionInstanceGroups` holds a connection pool internally, it is advised to
11449/// create one and the reuse it. You do not need to wrap `RegionInstanceGroups` in
11450/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11451/// already uses an `Arc` internally.
11452#[cfg(feature = "region-instance-groups")]
11453#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-groups")))]
11454#[derive(Clone, Debug)]
11455pub struct RegionInstanceGroups {
11456 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroups>,
11457}
11458
11459#[cfg(feature = "region-instance-groups")]
11460impl RegionInstanceGroups {
11461 /// Returns a builder for [RegionInstanceGroups].
11462 ///
11463 /// ```
11464 /// # async fn sample() -> gax::client_builder::Result<()> {
11465 /// # use google_cloud_compute_v1::client::RegionInstanceGroups;
11466 /// let client = RegionInstanceGroups::builder().build().await?;
11467 /// # Ok(()) }
11468 /// ```
11469 pub fn builder() -> super::builder::region_instance_groups::ClientBuilder {
11470 gax::client_builder::internal::new_builder(
11471 super::builder::region_instance_groups::client::Factory,
11472 )
11473 }
11474
11475 /// Creates a new client from the provided stub.
11476 ///
11477 /// The most common case for calling this function is in tests mocking the
11478 /// client's behavior.
11479 pub fn from_stub<T>(stub: T) -> Self
11480 where
11481 T: super::stub::RegionInstanceGroups + 'static,
11482 {
11483 Self {
11484 inner: std::sync::Arc::new(stub),
11485 }
11486 }
11487
11488 pub(crate) async fn new(
11489 config: gaxi::options::ClientConfig,
11490 ) -> gax::client_builder::Result<Self> {
11491 let inner = Self::build_inner(config).await?;
11492 Ok(Self { inner })
11493 }
11494
11495 async fn build_inner(
11496 conf: gaxi::options::ClientConfig,
11497 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroups>>
11498 {
11499 if gaxi::options::tracing_enabled(&conf) {
11500 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11501 }
11502 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11503 }
11504
11505 async fn build_transport(
11506 conf: gaxi::options::ClientConfig,
11507 ) -> gax::client_builder::Result<impl super::stub::RegionInstanceGroups> {
11508 super::transport::RegionInstanceGroups::new(conf).await
11509 }
11510
11511 async fn build_with_tracing(
11512 conf: gaxi::options::ClientConfig,
11513 ) -> gax::client_builder::Result<impl super::stub::RegionInstanceGroups> {
11514 Self::build_transport(conf)
11515 .await
11516 .map(super::tracing::RegionInstanceGroups::new)
11517 }
11518
11519 /// Returns the specified instance group resource.
11520 pub fn get(&self) -> super::builder::region_instance_groups::Get {
11521 super::builder::region_instance_groups::Get::new(self.inner.clone())
11522 }
11523
11524 /// Retrieves the list of instance group resources contained within
11525 /// the specified region.
11526 pub fn list(&self) -> super::builder::region_instance_groups::List {
11527 super::builder::region_instance_groups::List::new(self.inner.clone())
11528 }
11529
11530 /// Lists the instances in the specified instance group and displays
11531 /// information about the named ports. Depending on the specified options, this
11532 /// method can list all instances or only the instances that are running.
11533 /// The orderBy query parameter is not supported.
11534 pub fn list_instances(&self) -> super::builder::region_instance_groups::ListInstances {
11535 super::builder::region_instance_groups::ListInstances::new(self.inner.clone())
11536 }
11537
11538 /// Sets the named ports for the specified regional instance group.
11539 pub fn set_named_ports(&self) -> super::builder::region_instance_groups::SetNamedPorts {
11540 super::builder::region_instance_groups::SetNamedPorts::new(self.inner.clone())
11541 }
11542
11543 /// Returns permissions that a caller has on the specified resource.
11544 pub fn test_iam_permissions(
11545 &self,
11546 ) -> super::builder::region_instance_groups::TestIamPermissions {
11547 super::builder::region_instance_groups::TestIamPermissions::new(self.inner.clone())
11548 }
11549
11550 /// Retrieves the specified region-specific Operations resource.
11551 pub fn get_operation(&self) -> super::builder::region_instance_groups::GetOperation {
11552 super::builder::region_instance_groups::GetOperation::new(self.inner.clone())
11553 }
11554}
11555
11556/// Implements a client for the Google Compute Engine API.
11557///
11558/// # Example
11559/// ```
11560/// # async fn sample() -> gax::client_builder::Result<()> {
11561/// # use google_cloud_compute_v1::client::RegionInstanceTemplates;
11562/// let client = RegionInstanceTemplates::builder().build().await?;
11563/// // use `client` to make requests to the Google Compute Engine API.
11564/// # Ok(()) }
11565/// ```
11566///
11567/// # Service Description
11568///
11569/// Service for the `regionInstanceTemplates` resource.
11570///
11571/// # Configuration
11572///
11573/// To configure `RegionInstanceTemplates` use the `with_*` methods in the type returned
11574/// by [builder()][RegionInstanceTemplates::builder]. The default configuration should
11575/// work for most applications. Common configuration changes include
11576///
11577/// * [with_endpoint()]: by default this client uses the global default endpoint
11578/// (`https://compute.googleapis.com`). Applications using regional
11579/// endpoints or running in restricted networks (e.g. a network configured
11580// with [Private Google Access with VPC Service Controls]) may want to
11581/// override this default.
11582/// * [with_credentials()]: by default this client uses
11583/// [Application Default Credentials]. Applications using custom
11584/// authentication may need to override this default.
11585///
11586/// [with_endpoint()]: super::builder::region_instance_templates::ClientBuilder::with_endpoint
11587/// [with_credentials()]: super::builder::region_instance_templates::ClientBuilder::credentials
11588/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11589/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11590///
11591/// # Pooling and Cloning
11592///
11593/// `RegionInstanceTemplates` holds a connection pool internally, it is advised to
11594/// create one and the reuse it. You do not need to wrap `RegionInstanceTemplates` in
11595/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11596/// already uses an `Arc` internally.
11597#[cfg(feature = "region-instance-templates")]
11598#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-templates")))]
11599#[derive(Clone, Debug)]
11600pub struct RegionInstanceTemplates {
11601 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceTemplates>,
11602}
11603
11604#[cfg(feature = "region-instance-templates")]
11605impl RegionInstanceTemplates {
11606 /// Returns a builder for [RegionInstanceTemplates].
11607 ///
11608 /// ```
11609 /// # async fn sample() -> gax::client_builder::Result<()> {
11610 /// # use google_cloud_compute_v1::client::RegionInstanceTemplates;
11611 /// let client = RegionInstanceTemplates::builder().build().await?;
11612 /// # Ok(()) }
11613 /// ```
11614 pub fn builder() -> super::builder::region_instance_templates::ClientBuilder {
11615 gax::client_builder::internal::new_builder(
11616 super::builder::region_instance_templates::client::Factory,
11617 )
11618 }
11619
11620 /// Creates a new client from the provided stub.
11621 ///
11622 /// The most common case for calling this function is in tests mocking the
11623 /// client's behavior.
11624 pub fn from_stub<T>(stub: T) -> Self
11625 where
11626 T: super::stub::RegionInstanceTemplates + 'static,
11627 {
11628 Self {
11629 inner: std::sync::Arc::new(stub),
11630 }
11631 }
11632
11633 pub(crate) async fn new(
11634 config: gaxi::options::ClientConfig,
11635 ) -> gax::client_builder::Result<Self> {
11636 let inner = Self::build_inner(config).await?;
11637 Ok(Self { inner })
11638 }
11639
11640 async fn build_inner(
11641 conf: gaxi::options::ClientConfig,
11642 ) -> gax::client_builder::Result<
11643 std::sync::Arc<dyn super::stub::dynamic::RegionInstanceTemplates>,
11644 > {
11645 if gaxi::options::tracing_enabled(&conf) {
11646 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11647 }
11648 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11649 }
11650
11651 async fn build_transport(
11652 conf: gaxi::options::ClientConfig,
11653 ) -> gax::client_builder::Result<impl super::stub::RegionInstanceTemplates> {
11654 super::transport::RegionInstanceTemplates::new(conf).await
11655 }
11656
11657 async fn build_with_tracing(
11658 conf: gaxi::options::ClientConfig,
11659 ) -> gax::client_builder::Result<impl super::stub::RegionInstanceTemplates> {
11660 Self::build_transport(conf)
11661 .await
11662 .map(super::tracing::RegionInstanceTemplates::new)
11663 }
11664
11665 /// Deletes the specified instance template. Deleting an instance template is
11666 /// permanent and cannot be undone.
11667 pub fn delete(&self) -> super::builder::region_instance_templates::Delete {
11668 super::builder::region_instance_templates::Delete::new(self.inner.clone())
11669 }
11670
11671 /// Returns the specified instance template.
11672 pub fn get(&self) -> super::builder::region_instance_templates::Get {
11673 super::builder::region_instance_templates::Get::new(self.inner.clone())
11674 }
11675
11676 /// Creates an instance template in the specified project and region using the
11677 /// global instance template whose URL is included in the request.
11678 pub fn insert(&self) -> super::builder::region_instance_templates::Insert {
11679 super::builder::region_instance_templates::Insert::new(self.inner.clone())
11680 }
11681
11682 /// Retrieves a list of instance templates that are contained within the
11683 /// specified project and region.
11684 pub fn list(&self) -> super::builder::region_instance_templates::List {
11685 super::builder::region_instance_templates::List::new(self.inner.clone())
11686 }
11687
11688 /// Retrieves the specified region-specific Operations resource.
11689 pub fn get_operation(&self) -> super::builder::region_instance_templates::GetOperation {
11690 super::builder::region_instance_templates::GetOperation::new(self.inner.clone())
11691 }
11692}
11693
11694/// Implements a client for the Google Compute Engine API.
11695///
11696/// # Example
11697/// ```
11698/// # async fn sample() -> gax::client_builder::Result<()> {
11699/// # use google_cloud_compute_v1::client::RegionInstances;
11700/// let client = RegionInstances::builder().build().await?;
11701/// // use `client` to make requests to the Google Compute Engine API.
11702/// # Ok(()) }
11703/// ```
11704///
11705/// # Service Description
11706///
11707/// Service for the `regionInstances` resource.
11708///
11709/// # Configuration
11710///
11711/// To configure `RegionInstances` use the `with_*` methods in the type returned
11712/// by [builder()][RegionInstances::builder]. The default configuration should
11713/// work for most applications. Common configuration changes include
11714///
11715/// * [with_endpoint()]: by default this client uses the global default endpoint
11716/// (`https://compute.googleapis.com`). Applications using regional
11717/// endpoints or running in restricted networks (e.g. a network configured
11718// with [Private Google Access with VPC Service Controls]) may want to
11719/// override this default.
11720/// * [with_credentials()]: by default this client uses
11721/// [Application Default Credentials]. Applications using custom
11722/// authentication may need to override this default.
11723///
11724/// [with_endpoint()]: super::builder::region_instances::ClientBuilder::with_endpoint
11725/// [with_credentials()]: super::builder::region_instances::ClientBuilder::credentials
11726/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11727/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11728///
11729/// # Pooling and Cloning
11730///
11731/// `RegionInstances` holds a connection pool internally, it is advised to
11732/// create one and the reuse it. You do not need to wrap `RegionInstances` in
11733/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11734/// already uses an `Arc` internally.
11735#[cfg(feature = "region-instances")]
11736#[cfg_attr(docsrs, doc(cfg(feature = "region-instances")))]
11737#[derive(Clone, Debug)]
11738pub struct RegionInstances {
11739 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstances>,
11740}
11741
11742#[cfg(feature = "region-instances")]
11743impl RegionInstances {
11744 /// Returns a builder for [RegionInstances].
11745 ///
11746 /// ```
11747 /// # async fn sample() -> gax::client_builder::Result<()> {
11748 /// # use google_cloud_compute_v1::client::RegionInstances;
11749 /// let client = RegionInstances::builder().build().await?;
11750 /// # Ok(()) }
11751 /// ```
11752 pub fn builder() -> super::builder::region_instances::ClientBuilder {
11753 gax::client_builder::internal::new_builder(
11754 super::builder::region_instances::client::Factory,
11755 )
11756 }
11757
11758 /// Creates a new client from the provided stub.
11759 ///
11760 /// The most common case for calling this function is in tests mocking the
11761 /// client's behavior.
11762 pub fn from_stub<T>(stub: T) -> Self
11763 where
11764 T: super::stub::RegionInstances + 'static,
11765 {
11766 Self {
11767 inner: std::sync::Arc::new(stub),
11768 }
11769 }
11770
11771 pub(crate) async fn new(
11772 config: gaxi::options::ClientConfig,
11773 ) -> gax::client_builder::Result<Self> {
11774 let inner = Self::build_inner(config).await?;
11775 Ok(Self { inner })
11776 }
11777
11778 async fn build_inner(
11779 conf: gaxi::options::ClientConfig,
11780 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionInstances>>
11781 {
11782 if gaxi::options::tracing_enabled(&conf) {
11783 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11784 }
11785 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11786 }
11787
11788 async fn build_transport(
11789 conf: gaxi::options::ClientConfig,
11790 ) -> gax::client_builder::Result<impl super::stub::RegionInstances> {
11791 super::transport::RegionInstances::new(conf).await
11792 }
11793
11794 async fn build_with_tracing(
11795 conf: gaxi::options::ClientConfig,
11796 ) -> gax::client_builder::Result<impl super::stub::RegionInstances> {
11797 Self::build_transport(conf)
11798 .await
11799 .map(super::tracing::RegionInstances::new)
11800 }
11801
11802 /// Creates multiple instances in a given region. Count specifies the number of
11803 /// instances to create.
11804 pub fn bulk_insert(&self) -> super::builder::region_instances::BulkInsert {
11805 super::builder::region_instances::BulkInsert::new(self.inner.clone())
11806 }
11807
11808 /// Retrieves the specified region-specific Operations resource.
11809 pub fn get_operation(&self) -> super::builder::region_instances::GetOperation {
11810 super::builder::region_instances::GetOperation::new(self.inner.clone())
11811 }
11812}
11813
11814/// Implements a client for the Google Compute Engine API.
11815///
11816/// # Example
11817/// ```
11818/// # async fn sample() -> gax::client_builder::Result<()> {
11819/// # use google_cloud_compute_v1::client::RegionInstantSnapshots;
11820/// let client = RegionInstantSnapshots::builder().build().await?;
11821/// // use `client` to make requests to the Google Compute Engine API.
11822/// # Ok(()) }
11823/// ```
11824///
11825/// # Service Description
11826///
11827/// Service for the `regionInstantSnapshots` resource.
11828///
11829/// # Configuration
11830///
11831/// To configure `RegionInstantSnapshots` use the `with_*` methods in the type returned
11832/// by [builder()][RegionInstantSnapshots::builder]. The default configuration should
11833/// work for most applications. Common configuration changes include
11834///
11835/// * [with_endpoint()]: by default this client uses the global default endpoint
11836/// (`https://compute.googleapis.com`). Applications using regional
11837/// endpoints or running in restricted networks (e.g. a network configured
11838// with [Private Google Access with VPC Service Controls]) may want to
11839/// override this default.
11840/// * [with_credentials()]: by default this client uses
11841/// [Application Default Credentials]. Applications using custom
11842/// authentication may need to override this default.
11843///
11844/// [with_endpoint()]: super::builder::region_instant_snapshots::ClientBuilder::with_endpoint
11845/// [with_credentials()]: super::builder::region_instant_snapshots::ClientBuilder::credentials
11846/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11847/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11848///
11849/// # Pooling and Cloning
11850///
11851/// `RegionInstantSnapshots` holds a connection pool internally, it is advised to
11852/// create one and the reuse it. You do not need to wrap `RegionInstantSnapshots` in
11853/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11854/// already uses an `Arc` internally.
11855#[cfg(feature = "region-instant-snapshots")]
11856#[cfg_attr(docsrs, doc(cfg(feature = "region-instant-snapshots")))]
11857#[derive(Clone, Debug)]
11858pub struct RegionInstantSnapshots {
11859 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstantSnapshots>,
11860}
11861
11862#[cfg(feature = "region-instant-snapshots")]
11863impl RegionInstantSnapshots {
11864 /// Returns a builder for [RegionInstantSnapshots].
11865 ///
11866 /// ```
11867 /// # async fn sample() -> gax::client_builder::Result<()> {
11868 /// # use google_cloud_compute_v1::client::RegionInstantSnapshots;
11869 /// let client = RegionInstantSnapshots::builder().build().await?;
11870 /// # Ok(()) }
11871 /// ```
11872 pub fn builder() -> super::builder::region_instant_snapshots::ClientBuilder {
11873 gax::client_builder::internal::new_builder(
11874 super::builder::region_instant_snapshots::client::Factory,
11875 )
11876 }
11877
11878 /// Creates a new client from the provided stub.
11879 ///
11880 /// The most common case for calling this function is in tests mocking the
11881 /// client's behavior.
11882 pub fn from_stub<T>(stub: T) -> Self
11883 where
11884 T: super::stub::RegionInstantSnapshots + 'static,
11885 {
11886 Self {
11887 inner: std::sync::Arc::new(stub),
11888 }
11889 }
11890
11891 pub(crate) async fn new(
11892 config: gaxi::options::ClientConfig,
11893 ) -> gax::client_builder::Result<Self> {
11894 let inner = Self::build_inner(config).await?;
11895 Ok(Self { inner })
11896 }
11897
11898 async fn build_inner(
11899 conf: gaxi::options::ClientConfig,
11900 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionInstantSnapshots>>
11901 {
11902 if gaxi::options::tracing_enabled(&conf) {
11903 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11904 }
11905 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11906 }
11907
11908 async fn build_transport(
11909 conf: gaxi::options::ClientConfig,
11910 ) -> gax::client_builder::Result<impl super::stub::RegionInstantSnapshots> {
11911 super::transport::RegionInstantSnapshots::new(conf).await
11912 }
11913
11914 async fn build_with_tracing(
11915 conf: gaxi::options::ClientConfig,
11916 ) -> gax::client_builder::Result<impl super::stub::RegionInstantSnapshots> {
11917 Self::build_transport(conf)
11918 .await
11919 .map(super::tracing::RegionInstantSnapshots::new)
11920 }
11921
11922 /// Deletes the specified InstantSnapshot resource. Keep in mind that deleting
11923 /// a single instantSnapshot might not necessarily delete all the data on that
11924 /// instantSnapshot. If any data on the instantSnapshot that is marked for
11925 /// deletion is needed for subsequent instantSnapshots, the data will be moved
11926 /// to the next corresponding instantSnapshot.
11927 ///
11928 /// For more information, seeDeleting
11929 /// instantSnapshots.
11930 pub fn delete(&self) -> super::builder::region_instant_snapshots::Delete {
11931 super::builder::region_instant_snapshots::Delete::new(self.inner.clone())
11932 }
11933
11934 /// Returns the specified InstantSnapshot resource in the specified region.
11935 pub fn get(&self) -> super::builder::region_instant_snapshots::Get {
11936 super::builder::region_instant_snapshots::Get::new(self.inner.clone())
11937 }
11938
11939 /// Gets the access control policy for a resource. May be empty if no such
11940 /// policy or resource exists.
11941 pub fn get_iam_policy(&self) -> super::builder::region_instant_snapshots::GetIamPolicy {
11942 super::builder::region_instant_snapshots::GetIamPolicy::new(self.inner.clone())
11943 }
11944
11945 /// Creates an instant snapshot in the specified region.
11946 pub fn insert(&self) -> super::builder::region_instant_snapshots::Insert {
11947 super::builder::region_instant_snapshots::Insert::new(self.inner.clone())
11948 }
11949
11950 /// Retrieves the list of InstantSnapshot resources contained within
11951 /// the specified region.
11952 pub fn list(&self) -> super::builder::region_instant_snapshots::List {
11953 super::builder::region_instant_snapshots::List::new(self.inner.clone())
11954 }
11955
11956 /// Sets the access control policy on the specified resource.
11957 /// Replaces any existing policy.
11958 pub fn set_iam_policy(&self) -> super::builder::region_instant_snapshots::SetIamPolicy {
11959 super::builder::region_instant_snapshots::SetIamPolicy::new(self.inner.clone())
11960 }
11961
11962 /// Sets the labels on a instantSnapshot in the given region. To learn more
11963 /// about labels, read the Labeling
11964 /// Resources documentation.
11965 pub fn set_labels(&self) -> super::builder::region_instant_snapshots::SetLabels {
11966 super::builder::region_instant_snapshots::SetLabels::new(self.inner.clone())
11967 }
11968
11969 /// Returns permissions that a caller has on the specified resource.
11970 pub fn test_iam_permissions(
11971 &self,
11972 ) -> super::builder::region_instant_snapshots::TestIamPermissions {
11973 super::builder::region_instant_snapshots::TestIamPermissions::new(self.inner.clone())
11974 }
11975
11976 /// Retrieves the specified region-specific Operations resource.
11977 pub fn get_operation(&self) -> super::builder::region_instant_snapshots::GetOperation {
11978 super::builder::region_instant_snapshots::GetOperation::new(self.inner.clone())
11979 }
11980}
11981
11982/// Implements a client for the Google Compute Engine API.
11983///
11984/// # Example
11985/// ```
11986/// # async fn sample() -> gax::client_builder::Result<()> {
11987/// # use google_cloud_compute_v1::client::RegionNetworkEndpointGroups;
11988/// let client = RegionNetworkEndpointGroups::builder().build().await?;
11989/// // use `client` to make requests to the Google Compute Engine API.
11990/// # Ok(()) }
11991/// ```
11992///
11993/// # Service Description
11994///
11995/// Service for the `regionNetworkEndpointGroups` resource.
11996///
11997/// # Configuration
11998///
11999/// To configure `RegionNetworkEndpointGroups` use the `with_*` methods in the type returned
12000/// by [builder()][RegionNetworkEndpointGroups::builder]. The default configuration should
12001/// work for most applications. Common configuration changes include
12002///
12003/// * [with_endpoint()]: by default this client uses the global default endpoint
12004/// (`https://compute.googleapis.com`). Applications using regional
12005/// endpoints or running in restricted networks (e.g. a network configured
12006// with [Private Google Access with VPC Service Controls]) may want to
12007/// override this default.
12008/// * [with_credentials()]: by default this client uses
12009/// [Application Default Credentials]. Applications using custom
12010/// authentication may need to override this default.
12011///
12012/// [with_endpoint()]: super::builder::region_network_endpoint_groups::ClientBuilder::with_endpoint
12013/// [with_credentials()]: super::builder::region_network_endpoint_groups::ClientBuilder::credentials
12014/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12015/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12016///
12017/// # Pooling and Cloning
12018///
12019/// `RegionNetworkEndpointGroups` holds a connection pool internally, it is advised to
12020/// create one and the reuse it. You do not need to wrap `RegionNetworkEndpointGroups` in
12021/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12022/// already uses an `Arc` internally.
12023#[cfg(feature = "region-network-endpoint-groups")]
12024#[cfg_attr(docsrs, doc(cfg(feature = "region-network-endpoint-groups")))]
12025#[derive(Clone, Debug)]
12026pub struct RegionNetworkEndpointGroups {
12027 inner: std::sync::Arc<dyn super::stub::dynamic::RegionNetworkEndpointGroups>,
12028}
12029
12030#[cfg(feature = "region-network-endpoint-groups")]
12031impl RegionNetworkEndpointGroups {
12032 /// Returns a builder for [RegionNetworkEndpointGroups].
12033 ///
12034 /// ```
12035 /// # async fn sample() -> gax::client_builder::Result<()> {
12036 /// # use google_cloud_compute_v1::client::RegionNetworkEndpointGroups;
12037 /// let client = RegionNetworkEndpointGroups::builder().build().await?;
12038 /// # Ok(()) }
12039 /// ```
12040 pub fn builder() -> super::builder::region_network_endpoint_groups::ClientBuilder {
12041 gax::client_builder::internal::new_builder(
12042 super::builder::region_network_endpoint_groups::client::Factory,
12043 )
12044 }
12045
12046 /// Creates a new client from the provided stub.
12047 ///
12048 /// The most common case for calling this function is in tests mocking the
12049 /// client's behavior.
12050 pub fn from_stub<T>(stub: T) -> Self
12051 where
12052 T: super::stub::RegionNetworkEndpointGroups + 'static,
12053 {
12054 Self {
12055 inner: std::sync::Arc::new(stub),
12056 }
12057 }
12058
12059 pub(crate) async fn new(
12060 config: gaxi::options::ClientConfig,
12061 ) -> gax::client_builder::Result<Self> {
12062 let inner = Self::build_inner(config).await?;
12063 Ok(Self { inner })
12064 }
12065
12066 async fn build_inner(
12067 conf: gaxi::options::ClientConfig,
12068 ) -> gax::client_builder::Result<
12069 std::sync::Arc<dyn super::stub::dynamic::RegionNetworkEndpointGroups>,
12070 > {
12071 if gaxi::options::tracing_enabled(&conf) {
12072 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12073 }
12074 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12075 }
12076
12077 async fn build_transport(
12078 conf: gaxi::options::ClientConfig,
12079 ) -> gax::client_builder::Result<impl super::stub::RegionNetworkEndpointGroups> {
12080 super::transport::RegionNetworkEndpointGroups::new(conf).await
12081 }
12082
12083 async fn build_with_tracing(
12084 conf: gaxi::options::ClientConfig,
12085 ) -> gax::client_builder::Result<impl super::stub::RegionNetworkEndpointGroups> {
12086 Self::build_transport(conf)
12087 .await
12088 .map(super::tracing::RegionNetworkEndpointGroups::new)
12089 }
12090
12091 /// Attach a list of network endpoints to the specified network endpoint group.
12092 pub fn attach_network_endpoints(
12093 &self,
12094 ) -> super::builder::region_network_endpoint_groups::AttachNetworkEndpoints {
12095 super::builder::region_network_endpoint_groups::AttachNetworkEndpoints::new(
12096 self.inner.clone(),
12097 )
12098 }
12099
12100 /// Deletes the specified network endpoint group. Note that the NEG cannot be
12101 /// deleted if it is configured as a backend of a backend service.
12102 pub fn delete(&self) -> super::builder::region_network_endpoint_groups::Delete {
12103 super::builder::region_network_endpoint_groups::Delete::new(self.inner.clone())
12104 }
12105
12106 /// Detach the network endpoint from the specified network endpoint group.
12107 pub fn detach_network_endpoints(
12108 &self,
12109 ) -> super::builder::region_network_endpoint_groups::DetachNetworkEndpoints {
12110 super::builder::region_network_endpoint_groups::DetachNetworkEndpoints::new(
12111 self.inner.clone(),
12112 )
12113 }
12114
12115 /// Returns the specified network endpoint group.
12116 pub fn get(&self) -> super::builder::region_network_endpoint_groups::Get {
12117 super::builder::region_network_endpoint_groups::Get::new(self.inner.clone())
12118 }
12119
12120 /// Creates a network endpoint group in the specified project using the
12121 /// parameters that are included in the request.
12122 pub fn insert(&self) -> super::builder::region_network_endpoint_groups::Insert {
12123 super::builder::region_network_endpoint_groups::Insert::new(self.inner.clone())
12124 }
12125
12126 /// Retrieves the list of regional network endpoint groups available to the
12127 /// specified project in the given region.
12128 pub fn list(&self) -> super::builder::region_network_endpoint_groups::List {
12129 super::builder::region_network_endpoint_groups::List::new(self.inner.clone())
12130 }
12131
12132 /// Lists the network endpoints in the specified network endpoint group.
12133 pub fn list_network_endpoints(
12134 &self,
12135 ) -> super::builder::region_network_endpoint_groups::ListNetworkEndpoints {
12136 super::builder::region_network_endpoint_groups::ListNetworkEndpoints::new(
12137 self.inner.clone(),
12138 )
12139 }
12140
12141 /// Retrieves the specified region-specific Operations resource.
12142 pub fn get_operation(&self) -> super::builder::region_network_endpoint_groups::GetOperation {
12143 super::builder::region_network_endpoint_groups::GetOperation::new(self.inner.clone())
12144 }
12145}
12146
12147/// Implements a client for the Google Compute Engine API.
12148///
12149/// # Example
12150/// ```
12151/// # async fn sample() -> gax::client_builder::Result<()> {
12152/// # use google_cloud_compute_v1::client::RegionNetworkFirewallPolicies;
12153/// let client = RegionNetworkFirewallPolicies::builder().build().await?;
12154/// // use `client` to make requests to the Google Compute Engine API.
12155/// # Ok(()) }
12156/// ```
12157///
12158/// # Service Description
12159///
12160/// Service for the `regionNetworkFirewallPolicies` resource.
12161///
12162/// # Configuration
12163///
12164/// To configure `RegionNetworkFirewallPolicies` use the `with_*` methods in the type returned
12165/// by [builder()][RegionNetworkFirewallPolicies::builder]. The default configuration should
12166/// work for most applications. Common configuration changes include
12167///
12168/// * [with_endpoint()]: by default this client uses the global default endpoint
12169/// (`https://compute.googleapis.com`). Applications using regional
12170/// endpoints or running in restricted networks (e.g. a network configured
12171// with [Private Google Access with VPC Service Controls]) may want to
12172/// override this default.
12173/// * [with_credentials()]: by default this client uses
12174/// [Application Default Credentials]. Applications using custom
12175/// authentication may need to override this default.
12176///
12177/// [with_endpoint()]: super::builder::region_network_firewall_policies::ClientBuilder::with_endpoint
12178/// [with_credentials()]: super::builder::region_network_firewall_policies::ClientBuilder::credentials
12179/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12180/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12181///
12182/// # Pooling and Cloning
12183///
12184/// `RegionNetworkFirewallPolicies` holds a connection pool internally, it is advised to
12185/// create one and the reuse it. You do not need to wrap `RegionNetworkFirewallPolicies` in
12186/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12187/// already uses an `Arc` internally.
12188#[cfg(feature = "region-network-firewall-policies")]
12189#[cfg_attr(docsrs, doc(cfg(feature = "region-network-firewall-policies")))]
12190#[derive(Clone, Debug)]
12191pub struct RegionNetworkFirewallPolicies {
12192 inner: std::sync::Arc<dyn super::stub::dynamic::RegionNetworkFirewallPolicies>,
12193}
12194
12195#[cfg(feature = "region-network-firewall-policies")]
12196impl RegionNetworkFirewallPolicies {
12197 /// Returns a builder for [RegionNetworkFirewallPolicies].
12198 ///
12199 /// ```
12200 /// # async fn sample() -> gax::client_builder::Result<()> {
12201 /// # use google_cloud_compute_v1::client::RegionNetworkFirewallPolicies;
12202 /// let client = RegionNetworkFirewallPolicies::builder().build().await?;
12203 /// # Ok(()) }
12204 /// ```
12205 pub fn builder() -> super::builder::region_network_firewall_policies::ClientBuilder {
12206 gax::client_builder::internal::new_builder(
12207 super::builder::region_network_firewall_policies::client::Factory,
12208 )
12209 }
12210
12211 /// Creates a new client from the provided stub.
12212 ///
12213 /// The most common case for calling this function is in tests mocking the
12214 /// client's behavior.
12215 pub fn from_stub<T>(stub: T) -> Self
12216 where
12217 T: super::stub::RegionNetworkFirewallPolicies + 'static,
12218 {
12219 Self {
12220 inner: std::sync::Arc::new(stub),
12221 }
12222 }
12223
12224 pub(crate) async fn new(
12225 config: gaxi::options::ClientConfig,
12226 ) -> gax::client_builder::Result<Self> {
12227 let inner = Self::build_inner(config).await?;
12228 Ok(Self { inner })
12229 }
12230
12231 async fn build_inner(
12232 conf: gaxi::options::ClientConfig,
12233 ) -> gax::client_builder::Result<
12234 std::sync::Arc<dyn super::stub::dynamic::RegionNetworkFirewallPolicies>,
12235 > {
12236 if gaxi::options::tracing_enabled(&conf) {
12237 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12238 }
12239 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12240 }
12241
12242 async fn build_transport(
12243 conf: gaxi::options::ClientConfig,
12244 ) -> gax::client_builder::Result<impl super::stub::RegionNetworkFirewallPolicies> {
12245 super::transport::RegionNetworkFirewallPolicies::new(conf).await
12246 }
12247
12248 async fn build_with_tracing(
12249 conf: gaxi::options::ClientConfig,
12250 ) -> gax::client_builder::Result<impl super::stub::RegionNetworkFirewallPolicies> {
12251 Self::build_transport(conf)
12252 .await
12253 .map(super::tracing::RegionNetworkFirewallPolicies::new)
12254 }
12255
12256 /// Inserts an association for the specified network firewall policy.
12257 pub fn add_association(
12258 &self,
12259 ) -> super::builder::region_network_firewall_policies::AddAssociation {
12260 super::builder::region_network_firewall_policies::AddAssociation::new(self.inner.clone())
12261 }
12262
12263 /// Inserts a rule into a network firewall policy.
12264 pub fn add_rule(&self) -> super::builder::region_network_firewall_policies::AddRule {
12265 super::builder::region_network_firewall_policies::AddRule::new(self.inner.clone())
12266 }
12267
12268 /// Copies rules to the specified network firewall policy.
12269 pub fn clone_rules(&self) -> super::builder::region_network_firewall_policies::CloneRules {
12270 super::builder::region_network_firewall_policies::CloneRules::new(self.inner.clone())
12271 }
12272
12273 /// Deletes the specified network firewall policy.
12274 pub fn delete(&self) -> super::builder::region_network_firewall_policies::Delete {
12275 super::builder::region_network_firewall_policies::Delete::new(self.inner.clone())
12276 }
12277
12278 /// Returns the specified network firewall policy.
12279 pub fn get(&self) -> super::builder::region_network_firewall_policies::Get {
12280 super::builder::region_network_firewall_policies::Get::new(self.inner.clone())
12281 }
12282
12283 /// Gets an association with the specified name.
12284 pub fn get_association(
12285 &self,
12286 ) -> super::builder::region_network_firewall_policies::GetAssociation {
12287 super::builder::region_network_firewall_policies::GetAssociation::new(self.inner.clone())
12288 }
12289
12290 /// Returns the effective firewalls on a given network.
12291 pub fn get_effective_firewalls(
12292 &self,
12293 ) -> super::builder::region_network_firewall_policies::GetEffectiveFirewalls {
12294 super::builder::region_network_firewall_policies::GetEffectiveFirewalls::new(
12295 self.inner.clone(),
12296 )
12297 }
12298
12299 /// Gets the access control policy for a resource. May be empty if no such
12300 /// policy or resource exists.
12301 pub fn get_iam_policy(&self) -> super::builder::region_network_firewall_policies::GetIamPolicy {
12302 super::builder::region_network_firewall_policies::GetIamPolicy::new(self.inner.clone())
12303 }
12304
12305 /// Gets a rule of the specified priority.
12306 pub fn get_rule(&self) -> super::builder::region_network_firewall_policies::GetRule {
12307 super::builder::region_network_firewall_policies::GetRule::new(self.inner.clone())
12308 }
12309
12310 /// Creates a new network firewall policy in the specified project and region.
12311 pub fn insert(&self) -> super::builder::region_network_firewall_policies::Insert {
12312 super::builder::region_network_firewall_policies::Insert::new(self.inner.clone())
12313 }
12314
12315 /// Lists all the network firewall policies that have been configured
12316 /// for the specified project in the given region.
12317 pub fn list(&self) -> super::builder::region_network_firewall_policies::List {
12318 super::builder::region_network_firewall_policies::List::new(self.inner.clone())
12319 }
12320
12321 /// Patches the specified network firewall policy.
12322 pub fn patch(&self) -> super::builder::region_network_firewall_policies::Patch {
12323 super::builder::region_network_firewall_policies::Patch::new(self.inner.clone())
12324 }
12325
12326 /// Patches a rule of the specified priority.
12327 pub fn patch_rule(&self) -> super::builder::region_network_firewall_policies::PatchRule {
12328 super::builder::region_network_firewall_policies::PatchRule::new(self.inner.clone())
12329 }
12330
12331 /// Removes an association for the specified network firewall policy.
12332 pub fn remove_association(
12333 &self,
12334 ) -> super::builder::region_network_firewall_policies::RemoveAssociation {
12335 super::builder::region_network_firewall_policies::RemoveAssociation::new(self.inner.clone())
12336 }
12337
12338 /// Deletes a rule of the specified priority.
12339 pub fn remove_rule(&self) -> super::builder::region_network_firewall_policies::RemoveRule {
12340 super::builder::region_network_firewall_policies::RemoveRule::new(self.inner.clone())
12341 }
12342
12343 /// Sets the access control policy on the specified resource.
12344 /// Replaces any existing policy.
12345 pub fn set_iam_policy(&self) -> super::builder::region_network_firewall_policies::SetIamPolicy {
12346 super::builder::region_network_firewall_policies::SetIamPolicy::new(self.inner.clone())
12347 }
12348
12349 /// Returns permissions that a caller has on the specified resource.
12350 pub fn test_iam_permissions(
12351 &self,
12352 ) -> super::builder::region_network_firewall_policies::TestIamPermissions {
12353 super::builder::region_network_firewall_policies::TestIamPermissions::new(
12354 self.inner.clone(),
12355 )
12356 }
12357
12358 /// Retrieves the specified region-specific Operations resource.
12359 pub fn get_operation(&self) -> super::builder::region_network_firewall_policies::GetOperation {
12360 super::builder::region_network_firewall_policies::GetOperation::new(self.inner.clone())
12361 }
12362}
12363
12364/// Implements a client for the Google Compute Engine API.
12365///
12366/// # Example
12367/// ```
12368/// # async fn sample() -> gax::client_builder::Result<()> {
12369/// # use google_cloud_compute_v1::client::RegionNotificationEndpoints;
12370/// let client = RegionNotificationEndpoints::builder().build().await?;
12371/// // use `client` to make requests to the Google Compute Engine API.
12372/// # Ok(()) }
12373/// ```
12374///
12375/// # Service Description
12376///
12377/// Service for the `regionNotificationEndpoints` resource.
12378///
12379/// # Configuration
12380///
12381/// To configure `RegionNotificationEndpoints` use the `with_*` methods in the type returned
12382/// by [builder()][RegionNotificationEndpoints::builder]. The default configuration should
12383/// work for most applications. Common configuration changes include
12384///
12385/// * [with_endpoint()]: by default this client uses the global default endpoint
12386/// (`https://compute.googleapis.com`). Applications using regional
12387/// endpoints or running in restricted networks (e.g. a network configured
12388// with [Private Google Access with VPC Service Controls]) may want to
12389/// override this default.
12390/// * [with_credentials()]: by default this client uses
12391/// [Application Default Credentials]. Applications using custom
12392/// authentication may need to override this default.
12393///
12394/// [with_endpoint()]: super::builder::region_notification_endpoints::ClientBuilder::with_endpoint
12395/// [with_credentials()]: super::builder::region_notification_endpoints::ClientBuilder::credentials
12396/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12397/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12398///
12399/// # Pooling and Cloning
12400///
12401/// `RegionNotificationEndpoints` holds a connection pool internally, it is advised to
12402/// create one and the reuse it. You do not need to wrap `RegionNotificationEndpoints` in
12403/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12404/// already uses an `Arc` internally.
12405#[cfg(feature = "region-notification-endpoints")]
12406#[cfg_attr(docsrs, doc(cfg(feature = "region-notification-endpoints")))]
12407#[derive(Clone, Debug)]
12408pub struct RegionNotificationEndpoints {
12409 inner: std::sync::Arc<dyn super::stub::dynamic::RegionNotificationEndpoints>,
12410}
12411
12412#[cfg(feature = "region-notification-endpoints")]
12413impl RegionNotificationEndpoints {
12414 /// Returns a builder for [RegionNotificationEndpoints].
12415 ///
12416 /// ```
12417 /// # async fn sample() -> gax::client_builder::Result<()> {
12418 /// # use google_cloud_compute_v1::client::RegionNotificationEndpoints;
12419 /// let client = RegionNotificationEndpoints::builder().build().await?;
12420 /// # Ok(()) }
12421 /// ```
12422 pub fn builder() -> super::builder::region_notification_endpoints::ClientBuilder {
12423 gax::client_builder::internal::new_builder(
12424 super::builder::region_notification_endpoints::client::Factory,
12425 )
12426 }
12427
12428 /// Creates a new client from the provided stub.
12429 ///
12430 /// The most common case for calling this function is in tests mocking the
12431 /// client's behavior.
12432 pub fn from_stub<T>(stub: T) -> Self
12433 where
12434 T: super::stub::RegionNotificationEndpoints + 'static,
12435 {
12436 Self {
12437 inner: std::sync::Arc::new(stub),
12438 }
12439 }
12440
12441 pub(crate) async fn new(
12442 config: gaxi::options::ClientConfig,
12443 ) -> gax::client_builder::Result<Self> {
12444 let inner = Self::build_inner(config).await?;
12445 Ok(Self { inner })
12446 }
12447
12448 async fn build_inner(
12449 conf: gaxi::options::ClientConfig,
12450 ) -> gax::client_builder::Result<
12451 std::sync::Arc<dyn super::stub::dynamic::RegionNotificationEndpoints>,
12452 > {
12453 if gaxi::options::tracing_enabled(&conf) {
12454 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12455 }
12456 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12457 }
12458
12459 async fn build_transport(
12460 conf: gaxi::options::ClientConfig,
12461 ) -> gax::client_builder::Result<impl super::stub::RegionNotificationEndpoints> {
12462 super::transport::RegionNotificationEndpoints::new(conf).await
12463 }
12464
12465 async fn build_with_tracing(
12466 conf: gaxi::options::ClientConfig,
12467 ) -> gax::client_builder::Result<impl super::stub::RegionNotificationEndpoints> {
12468 Self::build_transport(conf)
12469 .await
12470 .map(super::tracing::RegionNotificationEndpoints::new)
12471 }
12472
12473 /// Deletes the specified NotificationEndpoint in the given region
12474 pub fn delete(&self) -> super::builder::region_notification_endpoints::Delete {
12475 super::builder::region_notification_endpoints::Delete::new(self.inner.clone())
12476 }
12477
12478 /// Returns the specified NotificationEndpoint resource in the given region.
12479 pub fn get(&self) -> super::builder::region_notification_endpoints::Get {
12480 super::builder::region_notification_endpoints::Get::new(self.inner.clone())
12481 }
12482
12483 /// Create a NotificationEndpoint in the specified project in the given region
12484 /// using the parameters that are included in the request.
12485 pub fn insert(&self) -> super::builder::region_notification_endpoints::Insert {
12486 super::builder::region_notification_endpoints::Insert::new(self.inner.clone())
12487 }
12488
12489 /// Lists the NotificationEndpoints for a project in the given region.
12490 pub fn list(&self) -> super::builder::region_notification_endpoints::List {
12491 super::builder::region_notification_endpoints::List::new(self.inner.clone())
12492 }
12493
12494 /// Returns permissions that a caller has on the specified resource.
12495 pub fn test_iam_permissions(
12496 &self,
12497 ) -> super::builder::region_notification_endpoints::TestIamPermissions {
12498 super::builder::region_notification_endpoints::TestIamPermissions::new(self.inner.clone())
12499 }
12500
12501 /// Retrieves the specified region-specific Operations resource.
12502 pub fn get_operation(&self) -> super::builder::region_notification_endpoints::GetOperation {
12503 super::builder::region_notification_endpoints::GetOperation::new(self.inner.clone())
12504 }
12505}
12506
12507/// Implements a client for the Google Compute Engine API.
12508///
12509/// # Example
12510/// ```
12511/// # async fn sample() -> gax::client_builder::Result<()> {
12512/// # use google_cloud_compute_v1::client::RegionOperations;
12513/// let client = RegionOperations::builder().build().await?;
12514/// // use `client` to make requests to the Google Compute Engine API.
12515/// # Ok(()) }
12516/// ```
12517///
12518/// # Service Description
12519///
12520/// Service for the `regionOperations` resource.
12521///
12522/// # Configuration
12523///
12524/// To configure `RegionOperations` use the `with_*` methods in the type returned
12525/// by [builder()][RegionOperations::builder]. The default configuration should
12526/// work for most applications. Common configuration changes include
12527///
12528/// * [with_endpoint()]: by default this client uses the global default endpoint
12529/// (`https://compute.googleapis.com`). Applications using regional
12530/// endpoints or running in restricted networks (e.g. a network configured
12531// with [Private Google Access with VPC Service Controls]) may want to
12532/// override this default.
12533/// * [with_credentials()]: by default this client uses
12534/// [Application Default Credentials]. Applications using custom
12535/// authentication may need to override this default.
12536///
12537/// [with_endpoint()]: super::builder::region_operations::ClientBuilder::with_endpoint
12538/// [with_credentials()]: super::builder::region_operations::ClientBuilder::credentials
12539/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12540/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12541///
12542/// # Pooling and Cloning
12543///
12544/// `RegionOperations` holds a connection pool internally, it is advised to
12545/// create one and the reuse it. You do not need to wrap `RegionOperations` in
12546/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12547/// already uses an `Arc` internally.
12548#[cfg(feature = "region-operations")]
12549#[cfg_attr(docsrs, doc(cfg(feature = "region-operations")))]
12550#[derive(Clone, Debug)]
12551pub struct RegionOperations {
12552 inner: std::sync::Arc<dyn super::stub::dynamic::RegionOperations>,
12553}
12554
12555#[cfg(feature = "region-operations")]
12556impl RegionOperations {
12557 /// Returns a builder for [RegionOperations].
12558 ///
12559 /// ```
12560 /// # async fn sample() -> gax::client_builder::Result<()> {
12561 /// # use google_cloud_compute_v1::client::RegionOperations;
12562 /// let client = RegionOperations::builder().build().await?;
12563 /// # Ok(()) }
12564 /// ```
12565 pub fn builder() -> super::builder::region_operations::ClientBuilder {
12566 gax::client_builder::internal::new_builder(
12567 super::builder::region_operations::client::Factory,
12568 )
12569 }
12570
12571 /// Creates a new client from the provided stub.
12572 ///
12573 /// The most common case for calling this function is in tests mocking the
12574 /// client's behavior.
12575 pub fn from_stub<T>(stub: T) -> Self
12576 where
12577 T: super::stub::RegionOperations + 'static,
12578 {
12579 Self {
12580 inner: std::sync::Arc::new(stub),
12581 }
12582 }
12583
12584 pub(crate) async fn new(
12585 config: gaxi::options::ClientConfig,
12586 ) -> gax::client_builder::Result<Self> {
12587 let inner = Self::build_inner(config).await?;
12588 Ok(Self { inner })
12589 }
12590
12591 async fn build_inner(
12592 conf: gaxi::options::ClientConfig,
12593 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionOperations>>
12594 {
12595 if gaxi::options::tracing_enabled(&conf) {
12596 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12597 }
12598 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12599 }
12600
12601 async fn build_transport(
12602 conf: gaxi::options::ClientConfig,
12603 ) -> gax::client_builder::Result<impl super::stub::RegionOperations> {
12604 super::transport::RegionOperations::new(conf).await
12605 }
12606
12607 async fn build_with_tracing(
12608 conf: gaxi::options::ClientConfig,
12609 ) -> gax::client_builder::Result<impl super::stub::RegionOperations> {
12610 Self::build_transport(conf)
12611 .await
12612 .map(super::tracing::RegionOperations::new)
12613 }
12614
12615 /// Deletes the specified region-specific Operations resource.
12616 pub fn delete(&self) -> super::builder::region_operations::Delete {
12617 super::builder::region_operations::Delete::new(self.inner.clone())
12618 }
12619
12620 /// Retrieves the specified region-specific Operations resource.
12621 pub fn get(&self) -> super::builder::region_operations::Get {
12622 super::builder::region_operations::Get::new(self.inner.clone())
12623 }
12624
12625 /// Retrieves a list of Operation resources contained within
12626 /// the specified region.
12627 pub fn list(&self) -> super::builder::region_operations::List {
12628 super::builder::region_operations::List::new(self.inner.clone())
12629 }
12630
12631 /// Waits for the specified Operation resource to return as `DONE`
12632 /// or for the request to approach the 2 minute deadline, and retrieves the
12633 /// specified Operation resource. This method differs from the
12634 /// `GET` method in that it waits for no more than the default
12635 /// deadline (2 minutes) and then returns the current state of the operation,
12636 /// which might be `DONE` or still in progress.
12637 ///
12638 /// This method is called on a best-effort basis. Specifically:
12639 ///
12640 /// ```norust
12641 /// - In uncommon cases, when the server is overloaded, the request might
12642 /// return before the default deadline is reached, or might return after zero
12643 /// seconds.
12644 /// ```
12645 ///
12646 /// - If the default deadline is reached, there is no guarantee that the
12647 /// operation is actually done when the method returns. Be prepared to retry
12648 /// if the operation is not `DONE`.
12649 pub fn wait(&self) -> super::builder::region_operations::Wait {
12650 super::builder::region_operations::Wait::new(self.inner.clone())
12651 }
12652}
12653
12654/// Implements a client for the Google Compute Engine API.
12655///
12656/// # Example
12657/// ```
12658/// # async fn sample() -> gax::client_builder::Result<()> {
12659/// # use google_cloud_compute_v1::client::RegionSecurityPolicies;
12660/// let client = RegionSecurityPolicies::builder().build().await?;
12661/// // use `client` to make requests to the Google Compute Engine API.
12662/// # Ok(()) }
12663/// ```
12664///
12665/// # Service Description
12666///
12667/// Service for the `regionSecurityPolicies` resource.
12668///
12669/// # Configuration
12670///
12671/// To configure `RegionSecurityPolicies` use the `with_*` methods in the type returned
12672/// by [builder()][RegionSecurityPolicies::builder]. The default configuration should
12673/// work for most applications. Common configuration changes include
12674///
12675/// * [with_endpoint()]: by default this client uses the global default endpoint
12676/// (`https://compute.googleapis.com`). Applications using regional
12677/// endpoints or running in restricted networks (e.g. a network configured
12678// with [Private Google Access with VPC Service Controls]) may want to
12679/// override this default.
12680/// * [with_credentials()]: by default this client uses
12681/// [Application Default Credentials]. Applications using custom
12682/// authentication may need to override this default.
12683///
12684/// [with_endpoint()]: super::builder::region_security_policies::ClientBuilder::with_endpoint
12685/// [with_credentials()]: super::builder::region_security_policies::ClientBuilder::credentials
12686/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12687/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12688///
12689/// # Pooling and Cloning
12690///
12691/// `RegionSecurityPolicies` holds a connection pool internally, it is advised to
12692/// create one and the reuse it. You do not need to wrap `RegionSecurityPolicies` in
12693/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12694/// already uses an `Arc` internally.
12695#[cfg(feature = "region-security-policies")]
12696#[cfg_attr(docsrs, doc(cfg(feature = "region-security-policies")))]
12697#[derive(Clone, Debug)]
12698pub struct RegionSecurityPolicies {
12699 inner: std::sync::Arc<dyn super::stub::dynamic::RegionSecurityPolicies>,
12700}
12701
12702#[cfg(feature = "region-security-policies")]
12703impl RegionSecurityPolicies {
12704 /// Returns a builder for [RegionSecurityPolicies].
12705 ///
12706 /// ```
12707 /// # async fn sample() -> gax::client_builder::Result<()> {
12708 /// # use google_cloud_compute_v1::client::RegionSecurityPolicies;
12709 /// let client = RegionSecurityPolicies::builder().build().await?;
12710 /// # Ok(()) }
12711 /// ```
12712 pub fn builder() -> super::builder::region_security_policies::ClientBuilder {
12713 gax::client_builder::internal::new_builder(
12714 super::builder::region_security_policies::client::Factory,
12715 )
12716 }
12717
12718 /// Creates a new client from the provided stub.
12719 ///
12720 /// The most common case for calling this function is in tests mocking the
12721 /// client's behavior.
12722 pub fn from_stub<T>(stub: T) -> Self
12723 where
12724 T: super::stub::RegionSecurityPolicies + 'static,
12725 {
12726 Self {
12727 inner: std::sync::Arc::new(stub),
12728 }
12729 }
12730
12731 pub(crate) async fn new(
12732 config: gaxi::options::ClientConfig,
12733 ) -> gax::client_builder::Result<Self> {
12734 let inner = Self::build_inner(config).await?;
12735 Ok(Self { inner })
12736 }
12737
12738 async fn build_inner(
12739 conf: gaxi::options::ClientConfig,
12740 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionSecurityPolicies>>
12741 {
12742 if gaxi::options::tracing_enabled(&conf) {
12743 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12744 }
12745 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12746 }
12747
12748 async fn build_transport(
12749 conf: gaxi::options::ClientConfig,
12750 ) -> gax::client_builder::Result<impl super::stub::RegionSecurityPolicies> {
12751 super::transport::RegionSecurityPolicies::new(conf).await
12752 }
12753
12754 async fn build_with_tracing(
12755 conf: gaxi::options::ClientConfig,
12756 ) -> gax::client_builder::Result<impl super::stub::RegionSecurityPolicies> {
12757 Self::build_transport(conf)
12758 .await
12759 .map(super::tracing::RegionSecurityPolicies::new)
12760 }
12761
12762 /// Inserts a rule into a security policy.
12763 pub fn add_rule(&self) -> super::builder::region_security_policies::AddRule {
12764 super::builder::region_security_policies::AddRule::new(self.inner.clone())
12765 }
12766
12767 /// Deletes the specified policy.
12768 pub fn delete(&self) -> super::builder::region_security_policies::Delete {
12769 super::builder::region_security_policies::Delete::new(self.inner.clone())
12770 }
12771
12772 /// List all of the ordered rules present in a single specified policy.
12773 pub fn get(&self) -> super::builder::region_security_policies::Get {
12774 super::builder::region_security_policies::Get::new(self.inner.clone())
12775 }
12776
12777 /// Gets a rule at the specified priority.
12778 pub fn get_rule(&self) -> super::builder::region_security_policies::GetRule {
12779 super::builder::region_security_policies::GetRule::new(self.inner.clone())
12780 }
12781
12782 /// Creates a new policy in the specified project using the data included in
12783 /// the request.
12784 pub fn insert(&self) -> super::builder::region_security_policies::Insert {
12785 super::builder::region_security_policies::Insert::new(self.inner.clone())
12786 }
12787
12788 /// List all the policies that have been configured for the specified project
12789 /// and region.
12790 pub fn list(&self) -> super::builder::region_security_policies::List {
12791 super::builder::region_security_policies::List::new(self.inner.clone())
12792 }
12793
12794 /// Patches the specified policy with the data included in the request. To
12795 /// clear fields in the policy, leave the fields empty and specify them in the
12796 /// updateMask. This cannot be used to be update the rules in the policy.
12797 /// Please use the per rule methods like addRule, patchRule, and removeRule
12798 /// instead.
12799 pub fn patch(&self) -> super::builder::region_security_policies::Patch {
12800 super::builder::region_security_policies::Patch::new(self.inner.clone())
12801 }
12802
12803 /// Patches a rule at the specified priority. To clear fields in the rule,
12804 /// leave the fields empty and specify them in the updateMask.
12805 pub fn patch_rule(&self) -> super::builder::region_security_policies::PatchRule {
12806 super::builder::region_security_policies::PatchRule::new(self.inner.clone())
12807 }
12808
12809 /// Deletes a rule at the specified priority.
12810 pub fn remove_rule(&self) -> super::builder::region_security_policies::RemoveRule {
12811 super::builder::region_security_policies::RemoveRule::new(self.inner.clone())
12812 }
12813
12814 /// Sets the labels on a security policy. To learn more about labels,
12815 /// read the Labeling Resources
12816 /// documentation.
12817 pub fn set_labels(&self) -> super::builder::region_security_policies::SetLabels {
12818 super::builder::region_security_policies::SetLabels::new(self.inner.clone())
12819 }
12820
12821 /// Retrieves the specified region-specific Operations resource.
12822 pub fn get_operation(&self) -> super::builder::region_security_policies::GetOperation {
12823 super::builder::region_security_policies::GetOperation::new(self.inner.clone())
12824 }
12825}
12826
12827/// Implements a client for the Google Compute Engine API.
12828///
12829/// # Example
12830/// ```
12831/// # async fn sample() -> gax::client_builder::Result<()> {
12832/// # use google_cloud_compute_v1::client::RegionSslCertificates;
12833/// let client = RegionSslCertificates::builder().build().await?;
12834/// // use `client` to make requests to the Google Compute Engine API.
12835/// # Ok(()) }
12836/// ```
12837///
12838/// # Service Description
12839///
12840/// Service for the `regionSslCertificates` resource.
12841///
12842/// # Configuration
12843///
12844/// To configure `RegionSslCertificates` use the `with_*` methods in the type returned
12845/// by [builder()][RegionSslCertificates::builder]. The default configuration should
12846/// work for most applications. Common configuration changes include
12847///
12848/// * [with_endpoint()]: by default this client uses the global default endpoint
12849/// (`https://compute.googleapis.com`). Applications using regional
12850/// endpoints or running in restricted networks (e.g. a network configured
12851// with [Private Google Access with VPC Service Controls]) may want to
12852/// override this default.
12853/// * [with_credentials()]: by default this client uses
12854/// [Application Default Credentials]. Applications using custom
12855/// authentication may need to override this default.
12856///
12857/// [with_endpoint()]: super::builder::region_ssl_certificates::ClientBuilder::with_endpoint
12858/// [with_credentials()]: super::builder::region_ssl_certificates::ClientBuilder::credentials
12859/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12860/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12861///
12862/// # Pooling and Cloning
12863///
12864/// `RegionSslCertificates` holds a connection pool internally, it is advised to
12865/// create one and the reuse it. You do not need to wrap `RegionSslCertificates` in
12866/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12867/// already uses an `Arc` internally.
12868#[cfg(feature = "region-ssl-certificates")]
12869#[cfg_attr(docsrs, doc(cfg(feature = "region-ssl-certificates")))]
12870#[derive(Clone, Debug)]
12871pub struct RegionSslCertificates {
12872 inner: std::sync::Arc<dyn super::stub::dynamic::RegionSslCertificates>,
12873}
12874
12875#[cfg(feature = "region-ssl-certificates")]
12876impl RegionSslCertificates {
12877 /// Returns a builder for [RegionSslCertificates].
12878 ///
12879 /// ```
12880 /// # async fn sample() -> gax::client_builder::Result<()> {
12881 /// # use google_cloud_compute_v1::client::RegionSslCertificates;
12882 /// let client = RegionSslCertificates::builder().build().await?;
12883 /// # Ok(()) }
12884 /// ```
12885 pub fn builder() -> super::builder::region_ssl_certificates::ClientBuilder {
12886 gax::client_builder::internal::new_builder(
12887 super::builder::region_ssl_certificates::client::Factory,
12888 )
12889 }
12890
12891 /// Creates a new client from the provided stub.
12892 ///
12893 /// The most common case for calling this function is in tests mocking the
12894 /// client's behavior.
12895 pub fn from_stub<T>(stub: T) -> Self
12896 where
12897 T: super::stub::RegionSslCertificates + 'static,
12898 {
12899 Self {
12900 inner: std::sync::Arc::new(stub),
12901 }
12902 }
12903
12904 pub(crate) async fn new(
12905 config: gaxi::options::ClientConfig,
12906 ) -> gax::client_builder::Result<Self> {
12907 let inner = Self::build_inner(config).await?;
12908 Ok(Self { inner })
12909 }
12910
12911 async fn build_inner(
12912 conf: gaxi::options::ClientConfig,
12913 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionSslCertificates>>
12914 {
12915 if gaxi::options::tracing_enabled(&conf) {
12916 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12917 }
12918 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12919 }
12920
12921 async fn build_transport(
12922 conf: gaxi::options::ClientConfig,
12923 ) -> gax::client_builder::Result<impl super::stub::RegionSslCertificates> {
12924 super::transport::RegionSslCertificates::new(conf).await
12925 }
12926
12927 async fn build_with_tracing(
12928 conf: gaxi::options::ClientConfig,
12929 ) -> gax::client_builder::Result<impl super::stub::RegionSslCertificates> {
12930 Self::build_transport(conf)
12931 .await
12932 .map(super::tracing::RegionSslCertificates::new)
12933 }
12934
12935 /// Deletes the specified SslCertificate resource in the region.
12936 pub fn delete(&self) -> super::builder::region_ssl_certificates::Delete {
12937 super::builder::region_ssl_certificates::Delete::new(self.inner.clone())
12938 }
12939
12940 /// Returns the specified SslCertificate resource in the specified region. Get
12941 /// a list of available SSL certificates by making a list()
12942 /// request.
12943 pub fn get(&self) -> super::builder::region_ssl_certificates::Get {
12944 super::builder::region_ssl_certificates::Get::new(self.inner.clone())
12945 }
12946
12947 /// Creates a SslCertificate resource in the specified project and region using
12948 /// the data included in the request
12949 pub fn insert(&self) -> super::builder::region_ssl_certificates::Insert {
12950 super::builder::region_ssl_certificates::Insert::new(self.inner.clone())
12951 }
12952
12953 /// Retrieves the list of SslCertificate resources available to the specified
12954 /// project in the specified region.
12955 pub fn list(&self) -> super::builder::region_ssl_certificates::List {
12956 super::builder::region_ssl_certificates::List::new(self.inner.clone())
12957 }
12958
12959 /// Retrieves the specified region-specific Operations resource.
12960 pub fn get_operation(&self) -> super::builder::region_ssl_certificates::GetOperation {
12961 super::builder::region_ssl_certificates::GetOperation::new(self.inner.clone())
12962 }
12963}
12964
12965/// Implements a client for the Google Compute Engine API.
12966///
12967/// # Example
12968/// ```
12969/// # async fn sample() -> gax::client_builder::Result<()> {
12970/// # use google_cloud_compute_v1::client::RegionSslPolicies;
12971/// let client = RegionSslPolicies::builder().build().await?;
12972/// // use `client` to make requests to the Google Compute Engine API.
12973/// # Ok(()) }
12974/// ```
12975///
12976/// # Service Description
12977///
12978/// Service for the `regionSslPolicies` resource.
12979///
12980/// # Configuration
12981///
12982/// To configure `RegionSslPolicies` use the `with_*` methods in the type returned
12983/// by [builder()][RegionSslPolicies::builder]. The default configuration should
12984/// work for most applications. Common configuration changes include
12985///
12986/// * [with_endpoint()]: by default this client uses the global default endpoint
12987/// (`https://compute.googleapis.com`). Applications using regional
12988/// endpoints or running in restricted networks (e.g. a network configured
12989// with [Private Google Access with VPC Service Controls]) may want to
12990/// override this default.
12991/// * [with_credentials()]: by default this client uses
12992/// [Application Default Credentials]. Applications using custom
12993/// authentication may need to override this default.
12994///
12995/// [with_endpoint()]: super::builder::region_ssl_policies::ClientBuilder::with_endpoint
12996/// [with_credentials()]: super::builder::region_ssl_policies::ClientBuilder::credentials
12997/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12998/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12999///
13000/// # Pooling and Cloning
13001///
13002/// `RegionSslPolicies` holds a connection pool internally, it is advised to
13003/// create one and the reuse it. You do not need to wrap `RegionSslPolicies` in
13004/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13005/// already uses an `Arc` internally.
13006#[cfg(feature = "region-ssl-policies")]
13007#[cfg_attr(docsrs, doc(cfg(feature = "region-ssl-policies")))]
13008#[derive(Clone, Debug)]
13009pub struct RegionSslPolicies {
13010 inner: std::sync::Arc<dyn super::stub::dynamic::RegionSslPolicies>,
13011}
13012
13013#[cfg(feature = "region-ssl-policies")]
13014impl RegionSslPolicies {
13015 /// Returns a builder for [RegionSslPolicies].
13016 ///
13017 /// ```
13018 /// # async fn sample() -> gax::client_builder::Result<()> {
13019 /// # use google_cloud_compute_v1::client::RegionSslPolicies;
13020 /// let client = RegionSslPolicies::builder().build().await?;
13021 /// # Ok(()) }
13022 /// ```
13023 pub fn builder() -> super::builder::region_ssl_policies::ClientBuilder {
13024 gax::client_builder::internal::new_builder(
13025 super::builder::region_ssl_policies::client::Factory,
13026 )
13027 }
13028
13029 /// Creates a new client from the provided stub.
13030 ///
13031 /// The most common case for calling this function is in tests mocking the
13032 /// client's behavior.
13033 pub fn from_stub<T>(stub: T) -> Self
13034 where
13035 T: super::stub::RegionSslPolicies + 'static,
13036 {
13037 Self {
13038 inner: std::sync::Arc::new(stub),
13039 }
13040 }
13041
13042 pub(crate) async fn new(
13043 config: gaxi::options::ClientConfig,
13044 ) -> gax::client_builder::Result<Self> {
13045 let inner = Self::build_inner(config).await?;
13046 Ok(Self { inner })
13047 }
13048
13049 async fn build_inner(
13050 conf: gaxi::options::ClientConfig,
13051 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionSslPolicies>>
13052 {
13053 if gaxi::options::tracing_enabled(&conf) {
13054 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13055 }
13056 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13057 }
13058
13059 async fn build_transport(
13060 conf: gaxi::options::ClientConfig,
13061 ) -> gax::client_builder::Result<impl super::stub::RegionSslPolicies> {
13062 super::transport::RegionSslPolicies::new(conf).await
13063 }
13064
13065 async fn build_with_tracing(
13066 conf: gaxi::options::ClientConfig,
13067 ) -> gax::client_builder::Result<impl super::stub::RegionSslPolicies> {
13068 Self::build_transport(conf)
13069 .await
13070 .map(super::tracing::RegionSslPolicies::new)
13071 }
13072
13073 /// Deletes the specified SSL policy. The SSL policy resource can be deleted
13074 /// only if it is not in use by any TargetHttpsProxy or TargetSslProxy
13075 /// resources.
13076 pub fn delete(&self) -> super::builder::region_ssl_policies::Delete {
13077 super::builder::region_ssl_policies::Delete::new(self.inner.clone())
13078 }
13079
13080 /// Lists all of the ordered rules present in a single specified policy.
13081 pub fn get(&self) -> super::builder::region_ssl_policies::Get {
13082 super::builder::region_ssl_policies::Get::new(self.inner.clone())
13083 }
13084
13085 /// Creates a new policy in the specified project and region using the data
13086 /// included in the request.
13087 pub fn insert(&self) -> super::builder::region_ssl_policies::Insert {
13088 super::builder::region_ssl_policies::Insert::new(self.inner.clone())
13089 }
13090
13091 /// Lists all the SSL policies that have been configured for the specified
13092 /// project and region.
13093 pub fn list(&self) -> super::builder::region_ssl_policies::List {
13094 super::builder::region_ssl_policies::List::new(self.inner.clone())
13095 }
13096
13097 /// Lists all features that can be specified in the SSL policy when using
13098 /// custom profile.
13099 pub fn list_available_features(
13100 &self,
13101 ) -> super::builder::region_ssl_policies::ListAvailableFeatures {
13102 super::builder::region_ssl_policies::ListAvailableFeatures::new(self.inner.clone())
13103 }
13104
13105 /// Patches the specified SSL policy with the data included in the request.
13106 pub fn patch(&self) -> super::builder::region_ssl_policies::Patch {
13107 super::builder::region_ssl_policies::Patch::new(self.inner.clone())
13108 }
13109
13110 /// Retrieves the specified region-specific Operations resource.
13111 pub fn get_operation(&self) -> super::builder::region_ssl_policies::GetOperation {
13112 super::builder::region_ssl_policies::GetOperation::new(self.inner.clone())
13113 }
13114}
13115
13116/// Implements a client for the Google Compute Engine API.
13117///
13118/// # Example
13119/// ```
13120/// # async fn sample() -> gax::client_builder::Result<()> {
13121/// # use google_cloud_compute_v1::client::RegionTargetHttpProxies;
13122/// let client = RegionTargetHttpProxies::builder().build().await?;
13123/// // use `client` to make requests to the Google Compute Engine API.
13124/// # Ok(()) }
13125/// ```
13126///
13127/// # Service Description
13128///
13129/// Service for the `regionTargetHttpProxies` resource.
13130///
13131/// # Configuration
13132///
13133/// To configure `RegionTargetHttpProxies` use the `with_*` methods in the type returned
13134/// by [builder()][RegionTargetHttpProxies::builder]. The default configuration should
13135/// work for most applications. Common configuration changes include
13136///
13137/// * [with_endpoint()]: by default this client uses the global default endpoint
13138/// (`https://compute.googleapis.com`). Applications using regional
13139/// endpoints or running in restricted networks (e.g. a network configured
13140// with [Private Google Access with VPC Service Controls]) may want to
13141/// override this default.
13142/// * [with_credentials()]: by default this client uses
13143/// [Application Default Credentials]. Applications using custom
13144/// authentication may need to override this default.
13145///
13146/// [with_endpoint()]: super::builder::region_target_http_proxies::ClientBuilder::with_endpoint
13147/// [with_credentials()]: super::builder::region_target_http_proxies::ClientBuilder::credentials
13148/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13149/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13150///
13151/// # Pooling and Cloning
13152///
13153/// `RegionTargetHttpProxies` holds a connection pool internally, it is advised to
13154/// create one and the reuse it. You do not need to wrap `RegionTargetHttpProxies` in
13155/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13156/// already uses an `Arc` internally.
13157#[cfg(feature = "region-target-http-proxies")]
13158#[cfg_attr(docsrs, doc(cfg(feature = "region-target-http-proxies")))]
13159#[derive(Clone, Debug)]
13160pub struct RegionTargetHttpProxies {
13161 inner: std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpProxies>,
13162}
13163
13164#[cfg(feature = "region-target-http-proxies")]
13165impl RegionTargetHttpProxies {
13166 /// Returns a builder for [RegionTargetHttpProxies].
13167 ///
13168 /// ```
13169 /// # async fn sample() -> gax::client_builder::Result<()> {
13170 /// # use google_cloud_compute_v1::client::RegionTargetHttpProxies;
13171 /// let client = RegionTargetHttpProxies::builder().build().await?;
13172 /// # Ok(()) }
13173 /// ```
13174 pub fn builder() -> super::builder::region_target_http_proxies::ClientBuilder {
13175 gax::client_builder::internal::new_builder(
13176 super::builder::region_target_http_proxies::client::Factory,
13177 )
13178 }
13179
13180 /// Creates a new client from the provided stub.
13181 ///
13182 /// The most common case for calling this function is in tests mocking the
13183 /// client's behavior.
13184 pub fn from_stub<T>(stub: T) -> Self
13185 where
13186 T: super::stub::RegionTargetHttpProxies + 'static,
13187 {
13188 Self {
13189 inner: std::sync::Arc::new(stub),
13190 }
13191 }
13192
13193 pub(crate) async fn new(
13194 config: gaxi::options::ClientConfig,
13195 ) -> gax::client_builder::Result<Self> {
13196 let inner = Self::build_inner(config).await?;
13197 Ok(Self { inner })
13198 }
13199
13200 async fn build_inner(
13201 conf: gaxi::options::ClientConfig,
13202 ) -> gax::client_builder::Result<
13203 std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpProxies>,
13204 > {
13205 if gaxi::options::tracing_enabled(&conf) {
13206 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13207 }
13208 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13209 }
13210
13211 async fn build_transport(
13212 conf: gaxi::options::ClientConfig,
13213 ) -> gax::client_builder::Result<impl super::stub::RegionTargetHttpProxies> {
13214 super::transport::RegionTargetHttpProxies::new(conf).await
13215 }
13216
13217 async fn build_with_tracing(
13218 conf: gaxi::options::ClientConfig,
13219 ) -> gax::client_builder::Result<impl super::stub::RegionTargetHttpProxies> {
13220 Self::build_transport(conf)
13221 .await
13222 .map(super::tracing::RegionTargetHttpProxies::new)
13223 }
13224
13225 /// Deletes the specified TargetHttpProxy resource.
13226 pub fn delete(&self) -> super::builder::region_target_http_proxies::Delete {
13227 super::builder::region_target_http_proxies::Delete::new(self.inner.clone())
13228 }
13229
13230 /// Returns the specified TargetHttpProxy resource in the specified region.
13231 pub fn get(&self) -> super::builder::region_target_http_proxies::Get {
13232 super::builder::region_target_http_proxies::Get::new(self.inner.clone())
13233 }
13234
13235 /// Creates a TargetHttpProxy resource in the specified project and region
13236 /// using the data included in the request.
13237 pub fn insert(&self) -> super::builder::region_target_http_proxies::Insert {
13238 super::builder::region_target_http_proxies::Insert::new(self.inner.clone())
13239 }
13240
13241 /// Retrieves the list of TargetHttpProxy resources available
13242 /// to the specified project in the specified region.
13243 pub fn list(&self) -> super::builder::region_target_http_proxies::List {
13244 super::builder::region_target_http_proxies::List::new(self.inner.clone())
13245 }
13246
13247 /// Changes the URL map for TargetHttpProxy.
13248 pub fn set_url_map(&self) -> super::builder::region_target_http_proxies::SetUrlMap {
13249 super::builder::region_target_http_proxies::SetUrlMap::new(self.inner.clone())
13250 }
13251
13252 /// Retrieves the specified region-specific Operations resource.
13253 pub fn get_operation(&self) -> super::builder::region_target_http_proxies::GetOperation {
13254 super::builder::region_target_http_proxies::GetOperation::new(self.inner.clone())
13255 }
13256}
13257
13258/// Implements a client for the Google Compute Engine API.
13259///
13260/// # Example
13261/// ```
13262/// # async fn sample() -> gax::client_builder::Result<()> {
13263/// # use google_cloud_compute_v1::client::RegionTargetHttpsProxies;
13264/// let client = RegionTargetHttpsProxies::builder().build().await?;
13265/// // use `client` to make requests to the Google Compute Engine API.
13266/// # Ok(()) }
13267/// ```
13268///
13269/// # Service Description
13270///
13271/// Service for the `regionTargetHttpsProxies` resource.
13272///
13273/// # Configuration
13274///
13275/// To configure `RegionTargetHttpsProxies` use the `with_*` methods in the type returned
13276/// by [builder()][RegionTargetHttpsProxies::builder]. The default configuration should
13277/// work for most applications. Common configuration changes include
13278///
13279/// * [with_endpoint()]: by default this client uses the global default endpoint
13280/// (`https://compute.googleapis.com`). Applications using regional
13281/// endpoints or running in restricted networks (e.g. a network configured
13282// with [Private Google Access with VPC Service Controls]) may want to
13283/// override this default.
13284/// * [with_credentials()]: by default this client uses
13285/// [Application Default Credentials]. Applications using custom
13286/// authentication may need to override this default.
13287///
13288/// [with_endpoint()]: super::builder::region_target_https_proxies::ClientBuilder::with_endpoint
13289/// [with_credentials()]: super::builder::region_target_https_proxies::ClientBuilder::credentials
13290/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13291/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13292///
13293/// # Pooling and Cloning
13294///
13295/// `RegionTargetHttpsProxies` holds a connection pool internally, it is advised to
13296/// create one and the reuse it. You do not need to wrap `RegionTargetHttpsProxies` in
13297/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13298/// already uses an `Arc` internally.
13299#[cfg(feature = "region-target-https-proxies")]
13300#[cfg_attr(docsrs, doc(cfg(feature = "region-target-https-proxies")))]
13301#[derive(Clone, Debug)]
13302pub struct RegionTargetHttpsProxies {
13303 inner: std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpsProxies>,
13304}
13305
13306#[cfg(feature = "region-target-https-proxies")]
13307impl RegionTargetHttpsProxies {
13308 /// Returns a builder for [RegionTargetHttpsProxies].
13309 ///
13310 /// ```
13311 /// # async fn sample() -> gax::client_builder::Result<()> {
13312 /// # use google_cloud_compute_v1::client::RegionTargetHttpsProxies;
13313 /// let client = RegionTargetHttpsProxies::builder().build().await?;
13314 /// # Ok(()) }
13315 /// ```
13316 pub fn builder() -> super::builder::region_target_https_proxies::ClientBuilder {
13317 gax::client_builder::internal::new_builder(
13318 super::builder::region_target_https_proxies::client::Factory,
13319 )
13320 }
13321
13322 /// Creates a new client from the provided stub.
13323 ///
13324 /// The most common case for calling this function is in tests mocking the
13325 /// client's behavior.
13326 pub fn from_stub<T>(stub: T) -> Self
13327 where
13328 T: super::stub::RegionTargetHttpsProxies + 'static,
13329 {
13330 Self {
13331 inner: std::sync::Arc::new(stub),
13332 }
13333 }
13334
13335 pub(crate) async fn new(
13336 config: gaxi::options::ClientConfig,
13337 ) -> gax::client_builder::Result<Self> {
13338 let inner = Self::build_inner(config).await?;
13339 Ok(Self { inner })
13340 }
13341
13342 async fn build_inner(
13343 conf: gaxi::options::ClientConfig,
13344 ) -> gax::client_builder::Result<
13345 std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpsProxies>,
13346 > {
13347 if gaxi::options::tracing_enabled(&conf) {
13348 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13349 }
13350 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13351 }
13352
13353 async fn build_transport(
13354 conf: gaxi::options::ClientConfig,
13355 ) -> gax::client_builder::Result<impl super::stub::RegionTargetHttpsProxies> {
13356 super::transport::RegionTargetHttpsProxies::new(conf).await
13357 }
13358
13359 async fn build_with_tracing(
13360 conf: gaxi::options::ClientConfig,
13361 ) -> gax::client_builder::Result<impl super::stub::RegionTargetHttpsProxies> {
13362 Self::build_transport(conf)
13363 .await
13364 .map(super::tracing::RegionTargetHttpsProxies::new)
13365 }
13366
13367 /// Deletes the specified TargetHttpsProxy resource.
13368 pub fn delete(&self) -> super::builder::region_target_https_proxies::Delete {
13369 super::builder::region_target_https_proxies::Delete::new(self.inner.clone())
13370 }
13371
13372 /// Returns the specified TargetHttpsProxy resource in the specified region.
13373 pub fn get(&self) -> super::builder::region_target_https_proxies::Get {
13374 super::builder::region_target_https_proxies::Get::new(self.inner.clone())
13375 }
13376
13377 /// Creates a TargetHttpsProxy resource in the specified project and region
13378 /// using the data included in the request.
13379 pub fn insert(&self) -> super::builder::region_target_https_proxies::Insert {
13380 super::builder::region_target_https_proxies::Insert::new(self.inner.clone())
13381 }
13382
13383 /// Retrieves the list of TargetHttpsProxy resources available
13384 /// to the specified project in the specified region.
13385 pub fn list(&self) -> super::builder::region_target_https_proxies::List {
13386 super::builder::region_target_https_proxies::List::new(self.inner.clone())
13387 }
13388
13389 /// Patches the specified regional TargetHttpsProxy resource with the data
13390 /// included in the request. This method supports PATCH
13391 /// semantics and usesJSON merge
13392 /// patch format and processing rules.
13393 pub fn patch(&self) -> super::builder::region_target_https_proxies::Patch {
13394 super::builder::region_target_https_proxies::Patch::new(self.inner.clone())
13395 }
13396
13397 /// Replaces SslCertificates for TargetHttpsProxy.
13398 pub fn set_ssl_certificates(
13399 &self,
13400 ) -> super::builder::region_target_https_proxies::SetSslCertificates {
13401 super::builder::region_target_https_proxies::SetSslCertificates::new(self.inner.clone())
13402 }
13403
13404 /// Changes the URL map for TargetHttpsProxy.
13405 pub fn set_url_map(&self) -> super::builder::region_target_https_proxies::SetUrlMap {
13406 super::builder::region_target_https_proxies::SetUrlMap::new(self.inner.clone())
13407 }
13408
13409 /// Retrieves the specified region-specific Operations resource.
13410 pub fn get_operation(&self) -> super::builder::region_target_https_proxies::GetOperation {
13411 super::builder::region_target_https_proxies::GetOperation::new(self.inner.clone())
13412 }
13413}
13414
13415/// Implements a client for the Google Compute Engine API.
13416///
13417/// # Example
13418/// ```
13419/// # async fn sample() -> gax::client_builder::Result<()> {
13420/// # use google_cloud_compute_v1::client::RegionTargetTcpProxies;
13421/// let client = RegionTargetTcpProxies::builder().build().await?;
13422/// // use `client` to make requests to the Google Compute Engine API.
13423/// # Ok(()) }
13424/// ```
13425///
13426/// # Service Description
13427///
13428/// Service for the `regionTargetTcpProxies` resource.
13429///
13430/// # Configuration
13431///
13432/// To configure `RegionTargetTcpProxies` use the `with_*` methods in the type returned
13433/// by [builder()][RegionTargetTcpProxies::builder]. The default configuration should
13434/// work for most applications. Common configuration changes include
13435///
13436/// * [with_endpoint()]: by default this client uses the global default endpoint
13437/// (`https://compute.googleapis.com`). Applications using regional
13438/// endpoints or running in restricted networks (e.g. a network configured
13439// with [Private Google Access with VPC Service Controls]) may want to
13440/// override this default.
13441/// * [with_credentials()]: by default this client uses
13442/// [Application Default Credentials]. Applications using custom
13443/// authentication may need to override this default.
13444///
13445/// [with_endpoint()]: super::builder::region_target_tcp_proxies::ClientBuilder::with_endpoint
13446/// [with_credentials()]: super::builder::region_target_tcp_proxies::ClientBuilder::credentials
13447/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13448/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13449///
13450/// # Pooling and Cloning
13451///
13452/// `RegionTargetTcpProxies` holds a connection pool internally, it is advised to
13453/// create one and the reuse it. You do not need to wrap `RegionTargetTcpProxies` in
13454/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13455/// already uses an `Arc` internally.
13456#[cfg(feature = "region-target-tcp-proxies")]
13457#[cfg_attr(docsrs, doc(cfg(feature = "region-target-tcp-proxies")))]
13458#[derive(Clone, Debug)]
13459pub struct RegionTargetTcpProxies {
13460 inner: std::sync::Arc<dyn super::stub::dynamic::RegionTargetTcpProxies>,
13461}
13462
13463#[cfg(feature = "region-target-tcp-proxies")]
13464impl RegionTargetTcpProxies {
13465 /// Returns a builder for [RegionTargetTcpProxies].
13466 ///
13467 /// ```
13468 /// # async fn sample() -> gax::client_builder::Result<()> {
13469 /// # use google_cloud_compute_v1::client::RegionTargetTcpProxies;
13470 /// let client = RegionTargetTcpProxies::builder().build().await?;
13471 /// # Ok(()) }
13472 /// ```
13473 pub fn builder() -> super::builder::region_target_tcp_proxies::ClientBuilder {
13474 gax::client_builder::internal::new_builder(
13475 super::builder::region_target_tcp_proxies::client::Factory,
13476 )
13477 }
13478
13479 /// Creates a new client from the provided stub.
13480 ///
13481 /// The most common case for calling this function is in tests mocking the
13482 /// client's behavior.
13483 pub fn from_stub<T>(stub: T) -> Self
13484 where
13485 T: super::stub::RegionTargetTcpProxies + 'static,
13486 {
13487 Self {
13488 inner: std::sync::Arc::new(stub),
13489 }
13490 }
13491
13492 pub(crate) async fn new(
13493 config: gaxi::options::ClientConfig,
13494 ) -> gax::client_builder::Result<Self> {
13495 let inner = Self::build_inner(config).await?;
13496 Ok(Self { inner })
13497 }
13498
13499 async fn build_inner(
13500 conf: gaxi::options::ClientConfig,
13501 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionTargetTcpProxies>>
13502 {
13503 if gaxi::options::tracing_enabled(&conf) {
13504 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13505 }
13506 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13507 }
13508
13509 async fn build_transport(
13510 conf: gaxi::options::ClientConfig,
13511 ) -> gax::client_builder::Result<impl super::stub::RegionTargetTcpProxies> {
13512 super::transport::RegionTargetTcpProxies::new(conf).await
13513 }
13514
13515 async fn build_with_tracing(
13516 conf: gaxi::options::ClientConfig,
13517 ) -> gax::client_builder::Result<impl super::stub::RegionTargetTcpProxies> {
13518 Self::build_transport(conf)
13519 .await
13520 .map(super::tracing::RegionTargetTcpProxies::new)
13521 }
13522
13523 /// Deletes the specified TargetTcpProxy resource.
13524 pub fn delete(&self) -> super::builder::region_target_tcp_proxies::Delete {
13525 super::builder::region_target_tcp_proxies::Delete::new(self.inner.clone())
13526 }
13527
13528 /// Returns the specified TargetTcpProxy resource.
13529 pub fn get(&self) -> super::builder::region_target_tcp_proxies::Get {
13530 super::builder::region_target_tcp_proxies::Get::new(self.inner.clone())
13531 }
13532
13533 /// Creates a TargetTcpProxy resource in the specified project and region using
13534 /// the data included in the request.
13535 pub fn insert(&self) -> super::builder::region_target_tcp_proxies::Insert {
13536 super::builder::region_target_tcp_proxies::Insert::new(self.inner.clone())
13537 }
13538
13539 /// Retrieves a list of TargetTcpProxy resources
13540 /// available to the specified project in a given region.
13541 pub fn list(&self) -> super::builder::region_target_tcp_proxies::List {
13542 super::builder::region_target_tcp_proxies::List::new(self.inner.clone())
13543 }
13544
13545 /// Retrieves the specified region-specific Operations resource.
13546 pub fn get_operation(&self) -> super::builder::region_target_tcp_proxies::GetOperation {
13547 super::builder::region_target_tcp_proxies::GetOperation::new(self.inner.clone())
13548 }
13549}
13550
13551/// Implements a client for the Google Compute Engine API.
13552///
13553/// # Example
13554/// ```
13555/// # async fn sample() -> gax::client_builder::Result<()> {
13556/// # use google_cloud_compute_v1::client::RegionUrlMaps;
13557/// let client = RegionUrlMaps::builder().build().await?;
13558/// // use `client` to make requests to the Google Compute Engine API.
13559/// # Ok(()) }
13560/// ```
13561///
13562/// # Service Description
13563///
13564/// Service for the `regionUrlMaps` resource.
13565///
13566/// # Configuration
13567///
13568/// To configure `RegionUrlMaps` use the `with_*` methods in the type returned
13569/// by [builder()][RegionUrlMaps::builder]. The default configuration should
13570/// work for most applications. Common configuration changes include
13571///
13572/// * [with_endpoint()]: by default this client uses the global default endpoint
13573/// (`https://compute.googleapis.com`). Applications using regional
13574/// endpoints or running in restricted networks (e.g. a network configured
13575// with [Private Google Access with VPC Service Controls]) may want to
13576/// override this default.
13577/// * [with_credentials()]: by default this client uses
13578/// [Application Default Credentials]. Applications using custom
13579/// authentication may need to override this default.
13580///
13581/// [with_endpoint()]: super::builder::region_url_maps::ClientBuilder::with_endpoint
13582/// [with_credentials()]: super::builder::region_url_maps::ClientBuilder::credentials
13583/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13584/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13585///
13586/// # Pooling and Cloning
13587///
13588/// `RegionUrlMaps` holds a connection pool internally, it is advised to
13589/// create one and the reuse it. You do not need to wrap `RegionUrlMaps` in
13590/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13591/// already uses an `Arc` internally.
13592#[cfg(feature = "region-url-maps")]
13593#[cfg_attr(docsrs, doc(cfg(feature = "region-url-maps")))]
13594#[derive(Clone, Debug)]
13595pub struct RegionUrlMaps {
13596 inner: std::sync::Arc<dyn super::stub::dynamic::RegionUrlMaps>,
13597}
13598
13599#[cfg(feature = "region-url-maps")]
13600impl RegionUrlMaps {
13601 /// Returns a builder for [RegionUrlMaps].
13602 ///
13603 /// ```
13604 /// # async fn sample() -> gax::client_builder::Result<()> {
13605 /// # use google_cloud_compute_v1::client::RegionUrlMaps;
13606 /// let client = RegionUrlMaps::builder().build().await?;
13607 /// # Ok(()) }
13608 /// ```
13609 pub fn builder() -> super::builder::region_url_maps::ClientBuilder {
13610 gax::client_builder::internal::new_builder(super::builder::region_url_maps::client::Factory)
13611 }
13612
13613 /// Creates a new client from the provided stub.
13614 ///
13615 /// The most common case for calling this function is in tests mocking the
13616 /// client's behavior.
13617 pub fn from_stub<T>(stub: T) -> Self
13618 where
13619 T: super::stub::RegionUrlMaps + 'static,
13620 {
13621 Self {
13622 inner: std::sync::Arc::new(stub),
13623 }
13624 }
13625
13626 pub(crate) async fn new(
13627 config: gaxi::options::ClientConfig,
13628 ) -> gax::client_builder::Result<Self> {
13629 let inner = Self::build_inner(config).await?;
13630 Ok(Self { inner })
13631 }
13632
13633 async fn build_inner(
13634 conf: gaxi::options::ClientConfig,
13635 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionUrlMaps>> {
13636 if gaxi::options::tracing_enabled(&conf) {
13637 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13638 }
13639 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13640 }
13641
13642 async fn build_transport(
13643 conf: gaxi::options::ClientConfig,
13644 ) -> gax::client_builder::Result<impl super::stub::RegionUrlMaps> {
13645 super::transport::RegionUrlMaps::new(conf).await
13646 }
13647
13648 async fn build_with_tracing(
13649 conf: gaxi::options::ClientConfig,
13650 ) -> gax::client_builder::Result<impl super::stub::RegionUrlMaps> {
13651 Self::build_transport(conf)
13652 .await
13653 .map(super::tracing::RegionUrlMaps::new)
13654 }
13655
13656 /// Deletes the specified UrlMap resource.
13657 pub fn delete(&self) -> super::builder::region_url_maps::Delete {
13658 super::builder::region_url_maps::Delete::new(self.inner.clone())
13659 }
13660
13661 /// Returns the specified UrlMap resource.
13662 pub fn get(&self) -> super::builder::region_url_maps::Get {
13663 super::builder::region_url_maps::Get::new(self.inner.clone())
13664 }
13665
13666 /// Creates a UrlMap resource in the specified project using
13667 /// the data included in the request.
13668 pub fn insert(&self) -> super::builder::region_url_maps::Insert {
13669 super::builder::region_url_maps::Insert::new(self.inner.clone())
13670 }
13671
13672 /// Retrieves the list of UrlMap resources available to the specified
13673 /// project in the specified region.
13674 pub fn list(&self) -> super::builder::region_url_maps::List {
13675 super::builder::region_url_maps::List::new(self.inner.clone())
13676 }
13677
13678 /// Patches the specified UrlMap resource with the data included in the
13679 /// request. This method supportsPATCH
13680 /// semantics and usesJSON merge
13681 /// patch format and processing rules.
13682 pub fn patch(&self) -> super::builder::region_url_maps::Patch {
13683 super::builder::region_url_maps::Patch::new(self.inner.clone())
13684 }
13685
13686 /// Updates the specified UrlMap resource with the data included in the
13687 /// request.
13688 pub fn update(&self) -> super::builder::region_url_maps::Update {
13689 super::builder::region_url_maps::Update::new(self.inner.clone())
13690 }
13691
13692 /// Runs static validation for the UrlMap. In particular, the tests of the
13693 /// provided UrlMap will be run. Calling this method does NOT create the
13694 /// UrlMap.
13695 pub fn validate(&self) -> super::builder::region_url_maps::Validate {
13696 super::builder::region_url_maps::Validate::new(self.inner.clone())
13697 }
13698
13699 /// Retrieves the specified region-specific Operations resource.
13700 pub fn get_operation(&self) -> super::builder::region_url_maps::GetOperation {
13701 super::builder::region_url_maps::GetOperation::new(self.inner.clone())
13702 }
13703}
13704
13705/// Implements a client for the Google Compute Engine API.
13706///
13707/// # Example
13708/// ```
13709/// # async fn sample() -> gax::client_builder::Result<()> {
13710/// # use google_cloud_compute_v1::client::RegionZones;
13711/// let client = RegionZones::builder().build().await?;
13712/// // use `client` to make requests to the Google Compute Engine API.
13713/// # Ok(()) }
13714/// ```
13715///
13716/// # Service Description
13717///
13718/// Service for the `regionZones` resource.
13719///
13720/// # Configuration
13721///
13722/// To configure `RegionZones` use the `with_*` methods in the type returned
13723/// by [builder()][RegionZones::builder]. The default configuration should
13724/// work for most applications. Common configuration changes include
13725///
13726/// * [with_endpoint()]: by default this client uses the global default endpoint
13727/// (`https://compute.googleapis.com`). Applications using regional
13728/// endpoints or running in restricted networks (e.g. a network configured
13729// with [Private Google Access with VPC Service Controls]) may want to
13730/// override this default.
13731/// * [with_credentials()]: by default this client uses
13732/// [Application Default Credentials]. Applications using custom
13733/// authentication may need to override this default.
13734///
13735/// [with_endpoint()]: super::builder::region_zones::ClientBuilder::with_endpoint
13736/// [with_credentials()]: super::builder::region_zones::ClientBuilder::credentials
13737/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13738/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13739///
13740/// # Pooling and Cloning
13741///
13742/// `RegionZones` holds a connection pool internally, it is advised to
13743/// create one and the reuse it. You do not need to wrap `RegionZones` in
13744/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13745/// already uses an `Arc` internally.
13746#[cfg(feature = "region-zones")]
13747#[cfg_attr(docsrs, doc(cfg(feature = "region-zones")))]
13748#[derive(Clone, Debug)]
13749pub struct RegionZones {
13750 inner: std::sync::Arc<dyn super::stub::dynamic::RegionZones>,
13751}
13752
13753#[cfg(feature = "region-zones")]
13754impl RegionZones {
13755 /// Returns a builder for [RegionZones].
13756 ///
13757 /// ```
13758 /// # async fn sample() -> gax::client_builder::Result<()> {
13759 /// # use google_cloud_compute_v1::client::RegionZones;
13760 /// let client = RegionZones::builder().build().await?;
13761 /// # Ok(()) }
13762 /// ```
13763 pub fn builder() -> super::builder::region_zones::ClientBuilder {
13764 gax::client_builder::internal::new_builder(super::builder::region_zones::client::Factory)
13765 }
13766
13767 /// Creates a new client from the provided stub.
13768 ///
13769 /// The most common case for calling this function is in tests mocking the
13770 /// client's behavior.
13771 pub fn from_stub<T>(stub: T) -> Self
13772 where
13773 T: super::stub::RegionZones + 'static,
13774 {
13775 Self {
13776 inner: std::sync::Arc::new(stub),
13777 }
13778 }
13779
13780 pub(crate) async fn new(
13781 config: gaxi::options::ClientConfig,
13782 ) -> gax::client_builder::Result<Self> {
13783 let inner = Self::build_inner(config).await?;
13784 Ok(Self { inner })
13785 }
13786
13787 async fn build_inner(
13788 conf: gaxi::options::ClientConfig,
13789 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionZones>> {
13790 if gaxi::options::tracing_enabled(&conf) {
13791 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13792 }
13793 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13794 }
13795
13796 async fn build_transport(
13797 conf: gaxi::options::ClientConfig,
13798 ) -> gax::client_builder::Result<impl super::stub::RegionZones> {
13799 super::transport::RegionZones::new(conf).await
13800 }
13801
13802 async fn build_with_tracing(
13803 conf: gaxi::options::ClientConfig,
13804 ) -> gax::client_builder::Result<impl super::stub::RegionZones> {
13805 Self::build_transport(conf)
13806 .await
13807 .map(super::tracing::RegionZones::new)
13808 }
13809
13810 /// Retrieves the list of Zone resources under the specific region available to
13811 /// the specified project.
13812 pub fn list(&self) -> super::builder::region_zones::List {
13813 super::builder::region_zones::List::new(self.inner.clone())
13814 }
13815}
13816
13817/// Implements a client for the Google Compute Engine API.
13818///
13819/// # Example
13820/// ```
13821/// # async fn sample() -> gax::client_builder::Result<()> {
13822/// # use google_cloud_compute_v1::client::Regions;
13823/// let client = Regions::builder().build().await?;
13824/// // use `client` to make requests to the Google Compute Engine API.
13825/// # Ok(()) }
13826/// ```
13827///
13828/// # Service Description
13829///
13830/// Service for the `regions` resource.
13831///
13832/// # Configuration
13833///
13834/// To configure `Regions` use the `with_*` methods in the type returned
13835/// by [builder()][Regions::builder]. The default configuration should
13836/// work for most applications. Common configuration changes include
13837///
13838/// * [with_endpoint()]: by default this client uses the global default endpoint
13839/// (`https://compute.googleapis.com`). Applications using regional
13840/// endpoints or running in restricted networks (e.g. a network configured
13841// with [Private Google Access with VPC Service Controls]) may want to
13842/// override this default.
13843/// * [with_credentials()]: by default this client uses
13844/// [Application Default Credentials]. Applications using custom
13845/// authentication may need to override this default.
13846///
13847/// [with_endpoint()]: super::builder::regions::ClientBuilder::with_endpoint
13848/// [with_credentials()]: super::builder::regions::ClientBuilder::credentials
13849/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13850/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13851///
13852/// # Pooling and Cloning
13853///
13854/// `Regions` holds a connection pool internally, it is advised to
13855/// create one and the reuse it. You do not need to wrap `Regions` in
13856/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13857/// already uses an `Arc` internally.
13858#[cfg(feature = "regions")]
13859#[cfg_attr(docsrs, doc(cfg(feature = "regions")))]
13860#[derive(Clone, Debug)]
13861pub struct Regions {
13862 inner: std::sync::Arc<dyn super::stub::dynamic::Regions>,
13863}
13864
13865#[cfg(feature = "regions")]
13866impl Regions {
13867 /// Returns a builder for [Regions].
13868 ///
13869 /// ```
13870 /// # async fn sample() -> gax::client_builder::Result<()> {
13871 /// # use google_cloud_compute_v1::client::Regions;
13872 /// let client = Regions::builder().build().await?;
13873 /// # Ok(()) }
13874 /// ```
13875 pub fn builder() -> super::builder::regions::ClientBuilder {
13876 gax::client_builder::internal::new_builder(super::builder::regions::client::Factory)
13877 }
13878
13879 /// Creates a new client from the provided stub.
13880 ///
13881 /// The most common case for calling this function is in tests mocking the
13882 /// client's behavior.
13883 pub fn from_stub<T>(stub: T) -> Self
13884 where
13885 T: super::stub::Regions + 'static,
13886 {
13887 Self {
13888 inner: std::sync::Arc::new(stub),
13889 }
13890 }
13891
13892 pub(crate) async fn new(
13893 config: gaxi::options::ClientConfig,
13894 ) -> gax::client_builder::Result<Self> {
13895 let inner = Self::build_inner(config).await?;
13896 Ok(Self { inner })
13897 }
13898
13899 async fn build_inner(
13900 conf: gaxi::options::ClientConfig,
13901 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Regions>> {
13902 if gaxi::options::tracing_enabled(&conf) {
13903 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13904 }
13905 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13906 }
13907
13908 async fn build_transport(
13909 conf: gaxi::options::ClientConfig,
13910 ) -> gax::client_builder::Result<impl super::stub::Regions> {
13911 super::transport::Regions::new(conf).await
13912 }
13913
13914 async fn build_with_tracing(
13915 conf: gaxi::options::ClientConfig,
13916 ) -> gax::client_builder::Result<impl super::stub::Regions> {
13917 Self::build_transport(conf)
13918 .await
13919 .map(super::tracing::Regions::new)
13920 }
13921
13922 /// Returns the specified Region resource.
13923 ///
13924 /// To decrease latency for this method, you can optionally omit any unneeded
13925 /// information from the response by using a field mask. This practice is
13926 /// especially recommended for unused quota information (the `quotas` field).
13927 /// To exclude one or more fields, set your request's `fields` query parameter
13928 /// to only include the fields you need. For example, to only include the `id`
13929 /// and `selfLink` fields, add the query parameter `?fields=id,selfLink` to
13930 /// your request.
13931 ///
13932 /// This method fails if the quota information is unavailable for the region
13933 /// and if the organization policy constraint
13934 /// compute.requireBasicQuotaInResponse is enforced. This
13935 /// constraint, when enforced, disables the fail-open behaviour when quota
13936 /// information (the `items.quotas` field) is unavailable for the region.
13937 /// It is recommended to use the default setting
13938 /// for the constraint unless your application requires the fail-closed
13939 /// behaviour for this method.
13940 pub fn get(&self) -> super::builder::regions::Get {
13941 super::builder::regions::Get::new(self.inner.clone())
13942 }
13943
13944 /// Retrieves the list of region resources available to the specified project.
13945 ///
13946 /// To decrease latency for this method, you can optionally omit any unneeded
13947 /// information from the response by using a field mask. This practice is
13948 /// especially recommended for unused quota information
13949 /// (the `items.quotas` field).
13950 /// To exclude one or more fields, set your request's `fields` query parameter
13951 /// to only include the fields you need. For example, to only include the `id`
13952 /// and `selfLink` fields, add the query parameter `?fields=id,selfLink` to
13953 /// your request.
13954 ///
13955 /// This method fails if the quota information is unavailable for the region
13956 /// and if the organization policy constraint
13957 /// compute.requireBasicQuotaInResponse is enforced. This
13958 /// constraint, when enforced, disables the fail-open behaviour when quota
13959 /// information (the `items.quotas` field) is unavailable for the region.
13960 /// It is recommended to use the default setting
13961 /// for the constraint unless your application requires the fail-closed
13962 /// behaviour for this method.
13963 pub fn list(&self) -> super::builder::regions::List {
13964 super::builder::regions::List::new(self.inner.clone())
13965 }
13966}
13967
13968/// Implements a client for the Google Compute Engine API.
13969///
13970/// # Example
13971/// ```
13972/// # async fn sample() -> gax::client_builder::Result<()> {
13973/// # use google_cloud_compute_v1::client::ReservationBlocks;
13974/// let client = ReservationBlocks::builder().build().await?;
13975/// // use `client` to make requests to the Google Compute Engine API.
13976/// # Ok(()) }
13977/// ```
13978///
13979/// # Service Description
13980///
13981/// Service for the `reservationBlocks` resource.
13982///
13983/// # Configuration
13984///
13985/// To configure `ReservationBlocks` use the `with_*` methods in the type returned
13986/// by [builder()][ReservationBlocks::builder]. The default configuration should
13987/// work for most applications. Common configuration changes include
13988///
13989/// * [with_endpoint()]: by default this client uses the global default endpoint
13990/// (`https://compute.googleapis.com`). Applications using regional
13991/// endpoints or running in restricted networks (e.g. a network configured
13992// with [Private Google Access with VPC Service Controls]) may want to
13993/// override this default.
13994/// * [with_credentials()]: by default this client uses
13995/// [Application Default Credentials]. Applications using custom
13996/// authentication may need to override this default.
13997///
13998/// [with_endpoint()]: super::builder::reservation_blocks::ClientBuilder::with_endpoint
13999/// [with_credentials()]: super::builder::reservation_blocks::ClientBuilder::credentials
14000/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14001/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14002///
14003/// # Pooling and Cloning
14004///
14005/// `ReservationBlocks` holds a connection pool internally, it is advised to
14006/// create one and the reuse it. You do not need to wrap `ReservationBlocks` in
14007/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14008/// already uses an `Arc` internally.
14009#[cfg(feature = "reservation-blocks")]
14010#[cfg_attr(docsrs, doc(cfg(feature = "reservation-blocks")))]
14011#[derive(Clone, Debug)]
14012pub struct ReservationBlocks {
14013 inner: std::sync::Arc<dyn super::stub::dynamic::ReservationBlocks>,
14014}
14015
14016#[cfg(feature = "reservation-blocks")]
14017impl ReservationBlocks {
14018 /// Returns a builder for [ReservationBlocks].
14019 ///
14020 /// ```
14021 /// # async fn sample() -> gax::client_builder::Result<()> {
14022 /// # use google_cloud_compute_v1::client::ReservationBlocks;
14023 /// let client = ReservationBlocks::builder().build().await?;
14024 /// # Ok(()) }
14025 /// ```
14026 pub fn builder() -> super::builder::reservation_blocks::ClientBuilder {
14027 gax::client_builder::internal::new_builder(
14028 super::builder::reservation_blocks::client::Factory,
14029 )
14030 }
14031
14032 /// Creates a new client from the provided stub.
14033 ///
14034 /// The most common case for calling this function is in tests mocking the
14035 /// client's behavior.
14036 pub fn from_stub<T>(stub: T) -> Self
14037 where
14038 T: super::stub::ReservationBlocks + 'static,
14039 {
14040 Self {
14041 inner: std::sync::Arc::new(stub),
14042 }
14043 }
14044
14045 pub(crate) async fn new(
14046 config: gaxi::options::ClientConfig,
14047 ) -> gax::client_builder::Result<Self> {
14048 let inner = Self::build_inner(config).await?;
14049 Ok(Self { inner })
14050 }
14051
14052 async fn build_inner(
14053 conf: gaxi::options::ClientConfig,
14054 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::ReservationBlocks>>
14055 {
14056 if gaxi::options::tracing_enabled(&conf) {
14057 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14058 }
14059 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14060 }
14061
14062 async fn build_transport(
14063 conf: gaxi::options::ClientConfig,
14064 ) -> gax::client_builder::Result<impl super::stub::ReservationBlocks> {
14065 super::transport::ReservationBlocks::new(conf).await
14066 }
14067
14068 async fn build_with_tracing(
14069 conf: gaxi::options::ClientConfig,
14070 ) -> gax::client_builder::Result<impl super::stub::ReservationBlocks> {
14071 Self::build_transport(conf)
14072 .await
14073 .map(super::tracing::ReservationBlocks::new)
14074 }
14075
14076 /// Retrieves information about the specified reservation block.
14077 pub fn get(&self) -> super::builder::reservation_blocks::Get {
14078 super::builder::reservation_blocks::Get::new(self.inner.clone())
14079 }
14080
14081 /// Gets the access control policy for a resource. May be empty if no such
14082 /// policy or resource exists.
14083 pub fn get_iam_policy(&self) -> super::builder::reservation_blocks::GetIamPolicy {
14084 super::builder::reservation_blocks::GetIamPolicy::new(self.inner.clone())
14085 }
14086
14087 /// Retrieves a list of reservation blocks under a single reservation.
14088 pub fn list(&self) -> super::builder::reservation_blocks::List {
14089 super::builder::reservation_blocks::List::new(self.inner.clone())
14090 }
14091
14092 /// Allows customers to perform maintenance on a reservation block
14093 pub fn perform_maintenance(&self) -> super::builder::reservation_blocks::PerformMaintenance {
14094 super::builder::reservation_blocks::PerformMaintenance::new(self.inner.clone())
14095 }
14096
14097 /// Sets the access control policy on the specified resource.
14098 /// Replaces any existing policy.
14099 pub fn set_iam_policy(&self) -> super::builder::reservation_blocks::SetIamPolicy {
14100 super::builder::reservation_blocks::SetIamPolicy::new(self.inner.clone())
14101 }
14102
14103 /// Returns permissions that a caller has on the specified resource.
14104 pub fn test_iam_permissions(&self) -> super::builder::reservation_blocks::TestIamPermissions {
14105 super::builder::reservation_blocks::TestIamPermissions::new(self.inner.clone())
14106 }
14107
14108 /// Retrieves the specified zone-specific Operations resource.
14109 pub fn get_operation(&self) -> super::builder::reservation_blocks::GetOperation {
14110 super::builder::reservation_blocks::GetOperation::new(self.inner.clone())
14111 }
14112}
14113
14114/// Implements a client for the Google Compute Engine API.
14115///
14116/// # Example
14117/// ```
14118/// # async fn sample() -> gax::client_builder::Result<()> {
14119/// # use google_cloud_compute_v1::client::ReservationSlots;
14120/// let client = ReservationSlots::builder().build().await?;
14121/// // use `client` to make requests to the Google Compute Engine API.
14122/// # Ok(()) }
14123/// ```
14124///
14125/// # Service Description
14126///
14127/// Service for the `reservationSlots` resource.
14128///
14129/// # Configuration
14130///
14131/// To configure `ReservationSlots` use the `with_*` methods in the type returned
14132/// by [builder()][ReservationSlots::builder]. The default configuration should
14133/// work for most applications. Common configuration changes include
14134///
14135/// * [with_endpoint()]: by default this client uses the global default endpoint
14136/// (`https://compute.googleapis.com`). Applications using regional
14137/// endpoints or running in restricted networks (e.g. a network configured
14138// with [Private Google Access with VPC Service Controls]) may want to
14139/// override this default.
14140/// * [with_credentials()]: by default this client uses
14141/// [Application Default Credentials]. Applications using custom
14142/// authentication may need to override this default.
14143///
14144/// [with_endpoint()]: super::builder::reservation_slots::ClientBuilder::with_endpoint
14145/// [with_credentials()]: super::builder::reservation_slots::ClientBuilder::credentials
14146/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14147/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14148///
14149/// # Pooling and Cloning
14150///
14151/// `ReservationSlots` holds a connection pool internally, it is advised to
14152/// create one and the reuse it. You do not need to wrap `ReservationSlots` in
14153/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14154/// already uses an `Arc` internally.
14155#[cfg(feature = "reservation-slots")]
14156#[cfg_attr(docsrs, doc(cfg(feature = "reservation-slots")))]
14157#[derive(Clone, Debug)]
14158pub struct ReservationSlots {
14159 inner: std::sync::Arc<dyn super::stub::dynamic::ReservationSlots>,
14160}
14161
14162#[cfg(feature = "reservation-slots")]
14163impl ReservationSlots {
14164 /// Returns a builder for [ReservationSlots].
14165 ///
14166 /// ```
14167 /// # async fn sample() -> gax::client_builder::Result<()> {
14168 /// # use google_cloud_compute_v1::client::ReservationSlots;
14169 /// let client = ReservationSlots::builder().build().await?;
14170 /// # Ok(()) }
14171 /// ```
14172 pub fn builder() -> super::builder::reservation_slots::ClientBuilder {
14173 gax::client_builder::internal::new_builder(
14174 super::builder::reservation_slots::client::Factory,
14175 )
14176 }
14177
14178 /// Creates a new client from the provided stub.
14179 ///
14180 /// The most common case for calling this function is in tests mocking the
14181 /// client's behavior.
14182 pub fn from_stub<T>(stub: T) -> Self
14183 where
14184 T: super::stub::ReservationSlots + 'static,
14185 {
14186 Self {
14187 inner: std::sync::Arc::new(stub),
14188 }
14189 }
14190
14191 pub(crate) async fn new(
14192 config: gaxi::options::ClientConfig,
14193 ) -> gax::client_builder::Result<Self> {
14194 let inner = Self::build_inner(config).await?;
14195 Ok(Self { inner })
14196 }
14197
14198 async fn build_inner(
14199 conf: gaxi::options::ClientConfig,
14200 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::ReservationSlots>>
14201 {
14202 if gaxi::options::tracing_enabled(&conf) {
14203 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14204 }
14205 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14206 }
14207
14208 async fn build_transport(
14209 conf: gaxi::options::ClientConfig,
14210 ) -> gax::client_builder::Result<impl super::stub::ReservationSlots> {
14211 super::transport::ReservationSlots::new(conf).await
14212 }
14213
14214 async fn build_with_tracing(
14215 conf: gaxi::options::ClientConfig,
14216 ) -> gax::client_builder::Result<impl super::stub::ReservationSlots> {
14217 Self::build_transport(conf)
14218 .await
14219 .map(super::tracing::ReservationSlots::new)
14220 }
14221
14222 /// Retrieves information about the specified reservation slot.
14223 pub fn get(&self) -> super::builder::reservation_slots::Get {
14224 super::builder::reservation_slots::Get::new(self.inner.clone())
14225 }
14226
14227 /// Retrieves a list of reservation slots under a single reservation.
14228 pub fn list(&self) -> super::builder::reservation_slots::List {
14229 super::builder::reservation_slots::List::new(self.inner.clone())
14230 }
14231
14232 /// Update a reservation slot in the specified sub-block.
14233 pub fn update(&self) -> super::builder::reservation_slots::Update {
14234 super::builder::reservation_slots::Update::new(self.inner.clone())
14235 }
14236
14237 /// Retrieves the specified zone-specific Operations resource.
14238 pub fn get_operation(&self) -> super::builder::reservation_slots::GetOperation {
14239 super::builder::reservation_slots::GetOperation::new(self.inner.clone())
14240 }
14241}
14242
14243/// Implements a client for the Google Compute Engine API.
14244///
14245/// # Example
14246/// ```
14247/// # async fn sample() -> gax::client_builder::Result<()> {
14248/// # use google_cloud_compute_v1::client::ReservationSubBlocks;
14249/// let client = ReservationSubBlocks::builder().build().await?;
14250/// // use `client` to make requests to the Google Compute Engine API.
14251/// # Ok(()) }
14252/// ```
14253///
14254/// # Service Description
14255///
14256/// Service for the `reservationSubBlocks` resource.
14257///
14258/// # Configuration
14259///
14260/// To configure `ReservationSubBlocks` use the `with_*` methods in the type returned
14261/// by [builder()][ReservationSubBlocks::builder]. The default configuration should
14262/// work for most applications. Common configuration changes include
14263///
14264/// * [with_endpoint()]: by default this client uses the global default endpoint
14265/// (`https://compute.googleapis.com`). Applications using regional
14266/// endpoints or running in restricted networks (e.g. a network configured
14267// with [Private Google Access with VPC Service Controls]) may want to
14268/// override this default.
14269/// * [with_credentials()]: by default this client uses
14270/// [Application Default Credentials]. Applications using custom
14271/// authentication may need to override this default.
14272///
14273/// [with_endpoint()]: super::builder::reservation_sub_blocks::ClientBuilder::with_endpoint
14274/// [with_credentials()]: super::builder::reservation_sub_blocks::ClientBuilder::credentials
14275/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14276/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14277///
14278/// # Pooling and Cloning
14279///
14280/// `ReservationSubBlocks` holds a connection pool internally, it is advised to
14281/// create one and the reuse it. You do not need to wrap `ReservationSubBlocks` in
14282/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14283/// already uses an `Arc` internally.
14284#[cfg(feature = "reservation-sub-blocks")]
14285#[cfg_attr(docsrs, doc(cfg(feature = "reservation-sub-blocks")))]
14286#[derive(Clone, Debug)]
14287pub struct ReservationSubBlocks {
14288 inner: std::sync::Arc<dyn super::stub::dynamic::ReservationSubBlocks>,
14289}
14290
14291#[cfg(feature = "reservation-sub-blocks")]
14292impl ReservationSubBlocks {
14293 /// Returns a builder for [ReservationSubBlocks].
14294 ///
14295 /// ```
14296 /// # async fn sample() -> gax::client_builder::Result<()> {
14297 /// # use google_cloud_compute_v1::client::ReservationSubBlocks;
14298 /// let client = ReservationSubBlocks::builder().build().await?;
14299 /// # Ok(()) }
14300 /// ```
14301 pub fn builder() -> super::builder::reservation_sub_blocks::ClientBuilder {
14302 gax::client_builder::internal::new_builder(
14303 super::builder::reservation_sub_blocks::client::Factory,
14304 )
14305 }
14306
14307 /// Creates a new client from the provided stub.
14308 ///
14309 /// The most common case for calling this function is in tests mocking the
14310 /// client's behavior.
14311 pub fn from_stub<T>(stub: T) -> Self
14312 where
14313 T: super::stub::ReservationSubBlocks + 'static,
14314 {
14315 Self {
14316 inner: std::sync::Arc::new(stub),
14317 }
14318 }
14319
14320 pub(crate) async fn new(
14321 config: gaxi::options::ClientConfig,
14322 ) -> gax::client_builder::Result<Self> {
14323 let inner = Self::build_inner(config).await?;
14324 Ok(Self { inner })
14325 }
14326
14327 async fn build_inner(
14328 conf: gaxi::options::ClientConfig,
14329 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::ReservationSubBlocks>>
14330 {
14331 if gaxi::options::tracing_enabled(&conf) {
14332 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14333 }
14334 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14335 }
14336
14337 async fn build_transport(
14338 conf: gaxi::options::ClientConfig,
14339 ) -> gax::client_builder::Result<impl super::stub::ReservationSubBlocks> {
14340 super::transport::ReservationSubBlocks::new(conf).await
14341 }
14342
14343 async fn build_with_tracing(
14344 conf: gaxi::options::ClientConfig,
14345 ) -> gax::client_builder::Result<impl super::stub::ReservationSubBlocks> {
14346 Self::build_transport(conf)
14347 .await
14348 .map(super::tracing::ReservationSubBlocks::new)
14349 }
14350
14351 /// Retrieves information about the specified reservation subBlock.
14352 pub fn get(&self) -> super::builder::reservation_sub_blocks::Get {
14353 super::builder::reservation_sub_blocks::Get::new(self.inner.clone())
14354 }
14355
14356 /// Gets the access control policy for a resource. May be empty if no such
14357 /// policy or resource exists.
14358 pub fn get_iam_policy(&self) -> super::builder::reservation_sub_blocks::GetIamPolicy {
14359 super::builder::reservation_sub_blocks::GetIamPolicy::new(self.inner.clone())
14360 }
14361
14362 /// Retrieves a list of reservation subBlocks under a single reservation.
14363 pub fn list(&self) -> super::builder::reservation_sub_blocks::List {
14364 super::builder::reservation_sub_blocks::List::new(self.inner.clone())
14365 }
14366
14367 /// Allows customers to perform maintenance on a reservation subBlock
14368 pub fn perform_maintenance(
14369 &self,
14370 ) -> super::builder::reservation_sub_blocks::PerformMaintenance {
14371 super::builder::reservation_sub_blocks::PerformMaintenance::new(self.inner.clone())
14372 }
14373
14374 /// Allows customers to report a faulty subBlock.
14375 pub fn report_faulty(&self) -> super::builder::reservation_sub_blocks::ReportFaulty {
14376 super::builder::reservation_sub_blocks::ReportFaulty::new(self.inner.clone())
14377 }
14378
14379 /// Sets the access control policy on the specified resource.
14380 /// Replaces any existing policy.
14381 pub fn set_iam_policy(&self) -> super::builder::reservation_sub_blocks::SetIamPolicy {
14382 super::builder::reservation_sub_blocks::SetIamPolicy::new(self.inner.clone())
14383 }
14384
14385 /// Returns permissions that a caller has on the specified resource.
14386 pub fn test_iam_permissions(
14387 &self,
14388 ) -> super::builder::reservation_sub_blocks::TestIamPermissions {
14389 super::builder::reservation_sub_blocks::TestIamPermissions::new(self.inner.clone())
14390 }
14391
14392 /// Retrieves the specified zone-specific Operations resource.
14393 pub fn get_operation(&self) -> super::builder::reservation_sub_blocks::GetOperation {
14394 super::builder::reservation_sub_blocks::GetOperation::new(self.inner.clone())
14395 }
14396}
14397
14398/// Implements a client for the Google Compute Engine API.
14399///
14400/// # Example
14401/// ```
14402/// # async fn sample() -> gax::client_builder::Result<()> {
14403/// # use google_cloud_compute_v1::client::Reservations;
14404/// let client = Reservations::builder().build().await?;
14405/// // use `client` to make requests to the Google Compute Engine API.
14406/// # Ok(()) }
14407/// ```
14408///
14409/// # Service Description
14410///
14411/// Service for the `reservations` resource.
14412///
14413/// # Configuration
14414///
14415/// To configure `Reservations` use the `with_*` methods in the type returned
14416/// by [builder()][Reservations::builder]. The default configuration should
14417/// work for most applications. Common configuration changes include
14418///
14419/// * [with_endpoint()]: by default this client uses the global default endpoint
14420/// (`https://compute.googleapis.com`). Applications using regional
14421/// endpoints or running in restricted networks (e.g. a network configured
14422// with [Private Google Access with VPC Service Controls]) may want to
14423/// override this default.
14424/// * [with_credentials()]: by default this client uses
14425/// [Application Default Credentials]. Applications using custom
14426/// authentication may need to override this default.
14427///
14428/// [with_endpoint()]: super::builder::reservations::ClientBuilder::with_endpoint
14429/// [with_credentials()]: super::builder::reservations::ClientBuilder::credentials
14430/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14431/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14432///
14433/// # Pooling and Cloning
14434///
14435/// `Reservations` holds a connection pool internally, it is advised to
14436/// create one and the reuse it. You do not need to wrap `Reservations` in
14437/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14438/// already uses an `Arc` internally.
14439#[cfg(feature = "reservations")]
14440#[cfg_attr(docsrs, doc(cfg(feature = "reservations")))]
14441#[derive(Clone, Debug)]
14442pub struct Reservations {
14443 inner: std::sync::Arc<dyn super::stub::dynamic::Reservations>,
14444}
14445
14446#[cfg(feature = "reservations")]
14447impl Reservations {
14448 /// Returns a builder for [Reservations].
14449 ///
14450 /// ```
14451 /// # async fn sample() -> gax::client_builder::Result<()> {
14452 /// # use google_cloud_compute_v1::client::Reservations;
14453 /// let client = Reservations::builder().build().await?;
14454 /// # Ok(()) }
14455 /// ```
14456 pub fn builder() -> super::builder::reservations::ClientBuilder {
14457 gax::client_builder::internal::new_builder(super::builder::reservations::client::Factory)
14458 }
14459
14460 /// Creates a new client from the provided stub.
14461 ///
14462 /// The most common case for calling this function is in tests mocking the
14463 /// client's behavior.
14464 pub fn from_stub<T>(stub: T) -> Self
14465 where
14466 T: super::stub::Reservations + 'static,
14467 {
14468 Self {
14469 inner: std::sync::Arc::new(stub),
14470 }
14471 }
14472
14473 pub(crate) async fn new(
14474 config: gaxi::options::ClientConfig,
14475 ) -> gax::client_builder::Result<Self> {
14476 let inner = Self::build_inner(config).await?;
14477 Ok(Self { inner })
14478 }
14479
14480 async fn build_inner(
14481 conf: gaxi::options::ClientConfig,
14482 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Reservations>> {
14483 if gaxi::options::tracing_enabled(&conf) {
14484 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14485 }
14486 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14487 }
14488
14489 async fn build_transport(
14490 conf: gaxi::options::ClientConfig,
14491 ) -> gax::client_builder::Result<impl super::stub::Reservations> {
14492 super::transport::Reservations::new(conf).await
14493 }
14494
14495 async fn build_with_tracing(
14496 conf: gaxi::options::ClientConfig,
14497 ) -> gax::client_builder::Result<impl super::stub::Reservations> {
14498 Self::build_transport(conf)
14499 .await
14500 .map(super::tracing::Reservations::new)
14501 }
14502
14503 /// Retrieves an aggregated list of reservations.
14504 ///
14505 /// To prevent failure, it is recommended that you set the
14506 /// `returnPartialSuccess` parameter to `true`.
14507 pub fn aggregated_list(&self) -> super::builder::reservations::AggregatedList {
14508 super::builder::reservations::AggregatedList::new(self.inner.clone())
14509 }
14510
14511 /// Deletes the specified reservation.
14512 pub fn delete(&self) -> super::builder::reservations::Delete {
14513 super::builder::reservations::Delete::new(self.inner.clone())
14514 }
14515
14516 /// Retrieves information about the specified reservation.
14517 pub fn get(&self) -> super::builder::reservations::Get {
14518 super::builder::reservations::Get::new(self.inner.clone())
14519 }
14520
14521 /// Gets the access control policy for a resource. May be empty if no such
14522 /// policy or resource exists.
14523 pub fn get_iam_policy(&self) -> super::builder::reservations::GetIamPolicy {
14524 super::builder::reservations::GetIamPolicy::new(self.inner.clone())
14525 }
14526
14527 /// Creates a new reservation. For more information, readReserving zonal
14528 /// resources.
14529 pub fn insert(&self) -> super::builder::reservations::Insert {
14530 super::builder::reservations::Insert::new(self.inner.clone())
14531 }
14532
14533 /// A list of all the reservations that have been configured for the
14534 /// specified project in specified zone.
14535 pub fn list(&self) -> super::builder::reservations::List {
14536 super::builder::reservations::List::new(self.inner.clone())
14537 }
14538
14539 /// Perform maintenance on an extended reservation
14540 pub fn perform_maintenance(&self) -> super::builder::reservations::PerformMaintenance {
14541 super::builder::reservations::PerformMaintenance::new(self.inner.clone())
14542 }
14543
14544 /// Resizes the reservation (applicable to standalone reservations only). For
14545 /// more information, readModifying
14546 /// reservations.
14547 pub fn resize(&self) -> super::builder::reservations::Resize {
14548 super::builder::reservations::Resize::new(self.inner.clone())
14549 }
14550
14551 /// Sets the access control policy on the specified resource.
14552 /// Replaces any existing policy.
14553 pub fn set_iam_policy(&self) -> super::builder::reservations::SetIamPolicy {
14554 super::builder::reservations::SetIamPolicy::new(self.inner.clone())
14555 }
14556
14557 /// Returns permissions that a caller has on the specified resource.
14558 pub fn test_iam_permissions(&self) -> super::builder::reservations::TestIamPermissions {
14559 super::builder::reservations::TestIamPermissions::new(self.inner.clone())
14560 }
14561
14562 /// Update share settings of the reservation.
14563 pub fn update(&self) -> super::builder::reservations::Update {
14564 super::builder::reservations::Update::new(self.inner.clone())
14565 }
14566
14567 /// Retrieves the specified zone-specific Operations resource.
14568 pub fn get_operation(&self) -> super::builder::reservations::GetOperation {
14569 super::builder::reservations::GetOperation::new(self.inner.clone())
14570 }
14571}
14572
14573/// Implements a client for the Google Compute Engine API.
14574///
14575/// # Example
14576/// ```
14577/// # async fn sample() -> gax::client_builder::Result<()> {
14578/// # use google_cloud_compute_v1::client::ResourcePolicies;
14579/// let client = ResourcePolicies::builder().build().await?;
14580/// // use `client` to make requests to the Google Compute Engine API.
14581/// # Ok(()) }
14582/// ```
14583///
14584/// # Service Description
14585///
14586/// Service for the `resourcePolicies` resource.
14587///
14588/// # Configuration
14589///
14590/// To configure `ResourcePolicies` use the `with_*` methods in the type returned
14591/// by [builder()][ResourcePolicies::builder]. The default configuration should
14592/// work for most applications. Common configuration changes include
14593///
14594/// * [with_endpoint()]: by default this client uses the global default endpoint
14595/// (`https://compute.googleapis.com`). Applications using regional
14596/// endpoints or running in restricted networks (e.g. a network configured
14597// with [Private Google Access with VPC Service Controls]) may want to
14598/// override this default.
14599/// * [with_credentials()]: by default this client uses
14600/// [Application Default Credentials]. Applications using custom
14601/// authentication may need to override this default.
14602///
14603/// [with_endpoint()]: super::builder::resource_policies::ClientBuilder::with_endpoint
14604/// [with_credentials()]: super::builder::resource_policies::ClientBuilder::credentials
14605/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14606/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14607///
14608/// # Pooling and Cloning
14609///
14610/// `ResourcePolicies` holds a connection pool internally, it is advised to
14611/// create one and the reuse it. You do not need to wrap `ResourcePolicies` in
14612/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14613/// already uses an `Arc` internally.
14614#[cfg(feature = "resource-policies")]
14615#[cfg_attr(docsrs, doc(cfg(feature = "resource-policies")))]
14616#[derive(Clone, Debug)]
14617pub struct ResourcePolicies {
14618 inner: std::sync::Arc<dyn super::stub::dynamic::ResourcePolicies>,
14619}
14620
14621#[cfg(feature = "resource-policies")]
14622impl ResourcePolicies {
14623 /// Returns a builder for [ResourcePolicies].
14624 ///
14625 /// ```
14626 /// # async fn sample() -> gax::client_builder::Result<()> {
14627 /// # use google_cloud_compute_v1::client::ResourcePolicies;
14628 /// let client = ResourcePolicies::builder().build().await?;
14629 /// # Ok(()) }
14630 /// ```
14631 pub fn builder() -> super::builder::resource_policies::ClientBuilder {
14632 gax::client_builder::internal::new_builder(
14633 super::builder::resource_policies::client::Factory,
14634 )
14635 }
14636
14637 /// Creates a new client from the provided stub.
14638 ///
14639 /// The most common case for calling this function is in tests mocking the
14640 /// client's behavior.
14641 pub fn from_stub<T>(stub: T) -> Self
14642 where
14643 T: super::stub::ResourcePolicies + 'static,
14644 {
14645 Self {
14646 inner: std::sync::Arc::new(stub),
14647 }
14648 }
14649
14650 pub(crate) async fn new(
14651 config: gaxi::options::ClientConfig,
14652 ) -> gax::client_builder::Result<Self> {
14653 let inner = Self::build_inner(config).await?;
14654 Ok(Self { inner })
14655 }
14656
14657 async fn build_inner(
14658 conf: gaxi::options::ClientConfig,
14659 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::ResourcePolicies>>
14660 {
14661 if gaxi::options::tracing_enabled(&conf) {
14662 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14663 }
14664 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14665 }
14666
14667 async fn build_transport(
14668 conf: gaxi::options::ClientConfig,
14669 ) -> gax::client_builder::Result<impl super::stub::ResourcePolicies> {
14670 super::transport::ResourcePolicies::new(conf).await
14671 }
14672
14673 async fn build_with_tracing(
14674 conf: gaxi::options::ClientConfig,
14675 ) -> gax::client_builder::Result<impl super::stub::ResourcePolicies> {
14676 Self::build_transport(conf)
14677 .await
14678 .map(super::tracing::ResourcePolicies::new)
14679 }
14680
14681 /// Retrieves an aggregated list of resource policies.
14682 ///
14683 /// To prevent failure, Google recommends that you set the
14684 /// `returnPartialSuccess` parameter to `true`.
14685 pub fn aggregated_list(&self) -> super::builder::resource_policies::AggregatedList {
14686 super::builder::resource_policies::AggregatedList::new(self.inner.clone())
14687 }
14688
14689 /// Deletes the specified resource policy.
14690 pub fn delete(&self) -> super::builder::resource_policies::Delete {
14691 super::builder::resource_policies::Delete::new(self.inner.clone())
14692 }
14693
14694 /// Retrieves all information of the specified resource policy.
14695 pub fn get(&self) -> super::builder::resource_policies::Get {
14696 super::builder::resource_policies::Get::new(self.inner.clone())
14697 }
14698
14699 /// Gets the access control policy for a resource. May be empty if no such
14700 /// policy or resource exists.
14701 pub fn get_iam_policy(&self) -> super::builder::resource_policies::GetIamPolicy {
14702 super::builder::resource_policies::GetIamPolicy::new(self.inner.clone())
14703 }
14704
14705 /// Creates a new resource policy.
14706 pub fn insert(&self) -> super::builder::resource_policies::Insert {
14707 super::builder::resource_policies::Insert::new(self.inner.clone())
14708 }
14709
14710 /// A list all the resource policies that have been configured for the
14711 /// specified project in specified region.
14712 pub fn list(&self) -> super::builder::resource_policies::List {
14713 super::builder::resource_policies::List::new(self.inner.clone())
14714 }
14715
14716 /// Modify the specified resource policy.
14717 pub fn patch(&self) -> super::builder::resource_policies::Patch {
14718 super::builder::resource_policies::Patch::new(self.inner.clone())
14719 }
14720
14721 /// Sets the access control policy on the specified resource.
14722 /// Replaces any existing policy.
14723 pub fn set_iam_policy(&self) -> super::builder::resource_policies::SetIamPolicy {
14724 super::builder::resource_policies::SetIamPolicy::new(self.inner.clone())
14725 }
14726
14727 /// Returns permissions that a caller has on the specified resource.
14728 pub fn test_iam_permissions(&self) -> super::builder::resource_policies::TestIamPermissions {
14729 super::builder::resource_policies::TestIamPermissions::new(self.inner.clone())
14730 }
14731
14732 /// Retrieves the specified region-specific Operations resource.
14733 pub fn get_operation(&self) -> super::builder::resource_policies::GetOperation {
14734 super::builder::resource_policies::GetOperation::new(self.inner.clone())
14735 }
14736}
14737
14738/// Implements a client for the Google Compute Engine API.
14739///
14740/// # Example
14741/// ```
14742/// # async fn sample() -> gax::client_builder::Result<()> {
14743/// # use google_cloud_compute_v1::client::Routers;
14744/// let client = Routers::builder().build().await?;
14745/// // use `client` to make requests to the Google Compute Engine API.
14746/// # Ok(()) }
14747/// ```
14748///
14749/// # Service Description
14750///
14751/// Service for the `routers` resource.
14752///
14753/// # Configuration
14754///
14755/// To configure `Routers` use the `with_*` methods in the type returned
14756/// by [builder()][Routers::builder]. The default configuration should
14757/// work for most applications. Common configuration changes include
14758///
14759/// * [with_endpoint()]: by default this client uses the global default endpoint
14760/// (`https://compute.googleapis.com`). Applications using regional
14761/// endpoints or running in restricted networks (e.g. a network configured
14762// with [Private Google Access with VPC Service Controls]) may want to
14763/// override this default.
14764/// * [with_credentials()]: by default this client uses
14765/// [Application Default Credentials]. Applications using custom
14766/// authentication may need to override this default.
14767///
14768/// [with_endpoint()]: super::builder::routers::ClientBuilder::with_endpoint
14769/// [with_credentials()]: super::builder::routers::ClientBuilder::credentials
14770/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14771/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14772///
14773/// # Pooling and Cloning
14774///
14775/// `Routers` holds a connection pool internally, it is advised to
14776/// create one and the reuse it. You do not need to wrap `Routers` in
14777/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14778/// already uses an `Arc` internally.
14779#[cfg(feature = "routers")]
14780#[cfg_attr(docsrs, doc(cfg(feature = "routers")))]
14781#[derive(Clone, Debug)]
14782pub struct Routers {
14783 inner: std::sync::Arc<dyn super::stub::dynamic::Routers>,
14784}
14785
14786#[cfg(feature = "routers")]
14787impl Routers {
14788 /// Returns a builder for [Routers].
14789 ///
14790 /// ```
14791 /// # async fn sample() -> gax::client_builder::Result<()> {
14792 /// # use google_cloud_compute_v1::client::Routers;
14793 /// let client = Routers::builder().build().await?;
14794 /// # Ok(()) }
14795 /// ```
14796 pub fn builder() -> super::builder::routers::ClientBuilder {
14797 gax::client_builder::internal::new_builder(super::builder::routers::client::Factory)
14798 }
14799
14800 /// Creates a new client from the provided stub.
14801 ///
14802 /// The most common case for calling this function is in tests mocking the
14803 /// client's behavior.
14804 pub fn from_stub<T>(stub: T) -> Self
14805 where
14806 T: super::stub::Routers + 'static,
14807 {
14808 Self {
14809 inner: std::sync::Arc::new(stub),
14810 }
14811 }
14812
14813 pub(crate) async fn new(
14814 config: gaxi::options::ClientConfig,
14815 ) -> gax::client_builder::Result<Self> {
14816 let inner = Self::build_inner(config).await?;
14817 Ok(Self { inner })
14818 }
14819
14820 async fn build_inner(
14821 conf: gaxi::options::ClientConfig,
14822 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Routers>> {
14823 if gaxi::options::tracing_enabled(&conf) {
14824 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14825 }
14826 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14827 }
14828
14829 async fn build_transport(
14830 conf: gaxi::options::ClientConfig,
14831 ) -> gax::client_builder::Result<impl super::stub::Routers> {
14832 super::transport::Routers::new(conf).await
14833 }
14834
14835 async fn build_with_tracing(
14836 conf: gaxi::options::ClientConfig,
14837 ) -> gax::client_builder::Result<impl super::stub::Routers> {
14838 Self::build_transport(conf)
14839 .await
14840 .map(super::tracing::Routers::new)
14841 }
14842
14843 /// Retrieves an aggregated list of routers.
14844 ///
14845 /// To prevent failure, Google recommends that you set the
14846 /// `returnPartialSuccess` parameter to `true`.
14847 pub fn aggregated_list(&self) -> super::builder::routers::AggregatedList {
14848 super::builder::routers::AggregatedList::new(self.inner.clone())
14849 }
14850
14851 /// Deletes the specified Router resource.
14852 pub fn delete(&self) -> super::builder::routers::Delete {
14853 super::builder::routers::Delete::new(self.inner.clone())
14854 }
14855
14856 /// Deletes Route Policy
14857 pub fn delete_route_policy(&self) -> super::builder::routers::DeleteRoutePolicy {
14858 super::builder::routers::DeleteRoutePolicy::new(self.inner.clone())
14859 }
14860
14861 /// Returns the specified Router resource.
14862 pub fn get(&self) -> super::builder::routers::Get {
14863 super::builder::routers::Get::new(self.inner.clone())
14864 }
14865
14866 /// Retrieves runtime NAT IP information.
14867 pub fn get_nat_ip_info(&self) -> super::builder::routers::GetNatIpInfo {
14868 super::builder::routers::GetNatIpInfo::new(self.inner.clone())
14869 }
14870
14871 /// Retrieves runtime Nat mapping information of VM endpoints.
14872 pub fn get_nat_mapping_info(&self) -> super::builder::routers::GetNatMappingInfo {
14873 super::builder::routers::GetNatMappingInfo::new(self.inner.clone())
14874 }
14875
14876 /// Returns specified Route Policy
14877 pub fn get_route_policy(&self) -> super::builder::routers::GetRoutePolicy {
14878 super::builder::routers::GetRoutePolicy::new(self.inner.clone())
14879 }
14880
14881 /// Retrieves runtime information of the specified router.
14882 pub fn get_router_status(&self) -> super::builder::routers::GetRouterStatus {
14883 super::builder::routers::GetRouterStatus::new(self.inner.clone())
14884 }
14885
14886 /// Creates a Router resource in the specified project and region using
14887 /// the data included in the request.
14888 pub fn insert(&self) -> super::builder::routers::Insert {
14889 super::builder::routers::Insert::new(self.inner.clone())
14890 }
14891
14892 /// Retrieves a list of Router resources available to the specified project.
14893 pub fn list(&self) -> super::builder::routers::List {
14894 super::builder::routers::List::new(self.inner.clone())
14895 }
14896
14897 /// Retrieves a list of router bgp routes available to the specified project.
14898 pub fn list_bgp_routes(&self) -> super::builder::routers::ListBgpRoutes {
14899 super::builder::routers::ListBgpRoutes::new(self.inner.clone())
14900 }
14901
14902 /// Retrieves a list of router route policy subresources available to the
14903 /// specified project.
14904 pub fn list_route_policies(&self) -> super::builder::routers::ListRoutePolicies {
14905 super::builder::routers::ListRoutePolicies::new(self.inner.clone())
14906 }
14907
14908 /// Patches the specified Router resource with the data included in the
14909 /// request. This method supportsPATCH
14910 /// semantics and usesJSON merge
14911 /// patch format and processing rules.
14912 pub fn patch(&self) -> super::builder::routers::Patch {
14913 super::builder::routers::Patch::new(self.inner.clone())
14914 }
14915
14916 /// Patches Route Policy
14917 pub fn patch_route_policy(&self) -> super::builder::routers::PatchRoutePolicy {
14918 super::builder::routers::PatchRoutePolicy::new(self.inner.clone())
14919 }
14920
14921 /// Preview fields auto-generated during router create andupdate operations.
14922 /// Calling this method does NOT create or update the router.
14923 pub fn preview(&self) -> super::builder::routers::Preview {
14924 super::builder::routers::Preview::new(self.inner.clone())
14925 }
14926
14927 /// Updates the specified Router resource with the data included in the
14928 /// request. This method conforms toPUT semantics, which requests that the state of the
14929 /// target resource be created or replaced with the state defined by the
14930 /// representation enclosed in the request message payload.
14931 pub fn update(&self) -> super::builder::routers::Update {
14932 super::builder::routers::Update::new(self.inner.clone())
14933 }
14934
14935 /// Updates or creates new Route Policy
14936 pub fn update_route_policy(&self) -> super::builder::routers::UpdateRoutePolicy {
14937 super::builder::routers::UpdateRoutePolicy::new(self.inner.clone())
14938 }
14939
14940 /// Retrieves the specified region-specific Operations resource.
14941 pub fn get_operation(&self) -> super::builder::routers::GetOperation {
14942 super::builder::routers::GetOperation::new(self.inner.clone())
14943 }
14944}
14945
14946/// Implements a client for the Google Compute Engine API.
14947///
14948/// # Example
14949/// ```
14950/// # async fn sample() -> gax::client_builder::Result<()> {
14951/// # use google_cloud_compute_v1::client::Routes;
14952/// let client = Routes::builder().build().await?;
14953/// // use `client` to make requests to the Google Compute Engine API.
14954/// # Ok(()) }
14955/// ```
14956///
14957/// # Service Description
14958///
14959/// Service for the `routes` resource.
14960///
14961/// # Configuration
14962///
14963/// To configure `Routes` use the `with_*` methods in the type returned
14964/// by [builder()][Routes::builder]. The default configuration should
14965/// work for most applications. Common configuration changes include
14966///
14967/// * [with_endpoint()]: by default this client uses the global default endpoint
14968/// (`https://compute.googleapis.com`). Applications using regional
14969/// endpoints or running in restricted networks (e.g. a network configured
14970// with [Private Google Access with VPC Service Controls]) may want to
14971/// override this default.
14972/// * [with_credentials()]: by default this client uses
14973/// [Application Default Credentials]. Applications using custom
14974/// authentication may need to override this default.
14975///
14976/// [with_endpoint()]: super::builder::routes::ClientBuilder::with_endpoint
14977/// [with_credentials()]: super::builder::routes::ClientBuilder::credentials
14978/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14979/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14980///
14981/// # Pooling and Cloning
14982///
14983/// `Routes` holds a connection pool internally, it is advised to
14984/// create one and the reuse it. You do not need to wrap `Routes` in
14985/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14986/// already uses an `Arc` internally.
14987#[cfg(feature = "routes")]
14988#[cfg_attr(docsrs, doc(cfg(feature = "routes")))]
14989#[derive(Clone, Debug)]
14990pub struct Routes {
14991 inner: std::sync::Arc<dyn super::stub::dynamic::Routes>,
14992}
14993
14994#[cfg(feature = "routes")]
14995impl Routes {
14996 /// Returns a builder for [Routes].
14997 ///
14998 /// ```
14999 /// # async fn sample() -> gax::client_builder::Result<()> {
15000 /// # use google_cloud_compute_v1::client::Routes;
15001 /// let client = Routes::builder().build().await?;
15002 /// # Ok(()) }
15003 /// ```
15004 pub fn builder() -> super::builder::routes::ClientBuilder {
15005 gax::client_builder::internal::new_builder(super::builder::routes::client::Factory)
15006 }
15007
15008 /// Creates a new client from the provided stub.
15009 ///
15010 /// The most common case for calling this function is in tests mocking the
15011 /// client's behavior.
15012 pub fn from_stub<T>(stub: T) -> Self
15013 where
15014 T: super::stub::Routes + 'static,
15015 {
15016 Self {
15017 inner: std::sync::Arc::new(stub),
15018 }
15019 }
15020
15021 pub(crate) async fn new(
15022 config: gaxi::options::ClientConfig,
15023 ) -> gax::client_builder::Result<Self> {
15024 let inner = Self::build_inner(config).await?;
15025 Ok(Self { inner })
15026 }
15027
15028 async fn build_inner(
15029 conf: gaxi::options::ClientConfig,
15030 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Routes>> {
15031 if gaxi::options::tracing_enabled(&conf) {
15032 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15033 }
15034 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15035 }
15036
15037 async fn build_transport(
15038 conf: gaxi::options::ClientConfig,
15039 ) -> gax::client_builder::Result<impl super::stub::Routes> {
15040 super::transport::Routes::new(conf).await
15041 }
15042
15043 async fn build_with_tracing(
15044 conf: gaxi::options::ClientConfig,
15045 ) -> gax::client_builder::Result<impl super::stub::Routes> {
15046 Self::build_transport(conf)
15047 .await
15048 .map(super::tracing::Routes::new)
15049 }
15050
15051 /// Deletes the specified Route resource.
15052 pub fn delete(&self) -> super::builder::routes::Delete {
15053 super::builder::routes::Delete::new(self.inner.clone())
15054 }
15055
15056 /// Returns the specified Route resource.
15057 pub fn get(&self) -> super::builder::routes::Get {
15058 super::builder::routes::Get::new(self.inner.clone())
15059 }
15060
15061 /// Creates a Route resource in the specified project using the data included
15062 /// in the request.
15063 pub fn insert(&self) -> super::builder::routes::Insert {
15064 super::builder::routes::Insert::new(self.inner.clone())
15065 }
15066
15067 /// Retrieves the list of Route resources available to the specified project.
15068 pub fn list(&self) -> super::builder::routes::List {
15069 super::builder::routes::List::new(self.inner.clone())
15070 }
15071
15072 /// Returns permissions that a caller has on the specified resource.
15073 pub fn test_iam_permissions(&self) -> super::builder::routes::TestIamPermissions {
15074 super::builder::routes::TestIamPermissions::new(self.inner.clone())
15075 }
15076
15077 /// Retrieves the specified Operations resource.
15078 pub fn get_operation(&self) -> super::builder::routes::GetOperation {
15079 super::builder::routes::GetOperation::new(self.inner.clone())
15080 }
15081}
15082
15083/// Implements a client for the Google Compute Engine API.
15084///
15085/// # Example
15086/// ```
15087/// # async fn sample() -> gax::client_builder::Result<()> {
15088/// # use google_cloud_compute_v1::client::SecurityPolicies;
15089/// let client = SecurityPolicies::builder().build().await?;
15090/// // use `client` to make requests to the Google Compute Engine API.
15091/// # Ok(()) }
15092/// ```
15093///
15094/// # Service Description
15095///
15096/// Service for the `securityPolicies` resource.
15097///
15098/// # Configuration
15099///
15100/// To configure `SecurityPolicies` use the `with_*` methods in the type returned
15101/// by [builder()][SecurityPolicies::builder]. The default configuration should
15102/// work for most applications. Common configuration changes include
15103///
15104/// * [with_endpoint()]: by default this client uses the global default endpoint
15105/// (`https://compute.googleapis.com`). Applications using regional
15106/// endpoints or running in restricted networks (e.g. a network configured
15107// with [Private Google Access with VPC Service Controls]) may want to
15108/// override this default.
15109/// * [with_credentials()]: by default this client uses
15110/// [Application Default Credentials]. Applications using custom
15111/// authentication may need to override this default.
15112///
15113/// [with_endpoint()]: super::builder::security_policies::ClientBuilder::with_endpoint
15114/// [with_credentials()]: super::builder::security_policies::ClientBuilder::credentials
15115/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15116/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15117///
15118/// # Pooling and Cloning
15119///
15120/// `SecurityPolicies` holds a connection pool internally, it is advised to
15121/// create one and the reuse it. You do not need to wrap `SecurityPolicies` in
15122/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15123/// already uses an `Arc` internally.
15124#[cfg(feature = "security-policies")]
15125#[cfg_attr(docsrs, doc(cfg(feature = "security-policies")))]
15126#[derive(Clone, Debug)]
15127pub struct SecurityPolicies {
15128 inner: std::sync::Arc<dyn super::stub::dynamic::SecurityPolicies>,
15129}
15130
15131#[cfg(feature = "security-policies")]
15132impl SecurityPolicies {
15133 /// Returns a builder for [SecurityPolicies].
15134 ///
15135 /// ```
15136 /// # async fn sample() -> gax::client_builder::Result<()> {
15137 /// # use google_cloud_compute_v1::client::SecurityPolicies;
15138 /// let client = SecurityPolicies::builder().build().await?;
15139 /// # Ok(()) }
15140 /// ```
15141 pub fn builder() -> super::builder::security_policies::ClientBuilder {
15142 gax::client_builder::internal::new_builder(
15143 super::builder::security_policies::client::Factory,
15144 )
15145 }
15146
15147 /// Creates a new client from the provided stub.
15148 ///
15149 /// The most common case for calling this function is in tests mocking the
15150 /// client's behavior.
15151 pub fn from_stub<T>(stub: T) -> Self
15152 where
15153 T: super::stub::SecurityPolicies + 'static,
15154 {
15155 Self {
15156 inner: std::sync::Arc::new(stub),
15157 }
15158 }
15159
15160 pub(crate) async fn new(
15161 config: gaxi::options::ClientConfig,
15162 ) -> gax::client_builder::Result<Self> {
15163 let inner = Self::build_inner(config).await?;
15164 Ok(Self { inner })
15165 }
15166
15167 async fn build_inner(
15168 conf: gaxi::options::ClientConfig,
15169 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::SecurityPolicies>>
15170 {
15171 if gaxi::options::tracing_enabled(&conf) {
15172 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15173 }
15174 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15175 }
15176
15177 async fn build_transport(
15178 conf: gaxi::options::ClientConfig,
15179 ) -> gax::client_builder::Result<impl super::stub::SecurityPolicies> {
15180 super::transport::SecurityPolicies::new(conf).await
15181 }
15182
15183 async fn build_with_tracing(
15184 conf: gaxi::options::ClientConfig,
15185 ) -> gax::client_builder::Result<impl super::stub::SecurityPolicies> {
15186 Self::build_transport(conf)
15187 .await
15188 .map(super::tracing::SecurityPolicies::new)
15189 }
15190
15191 /// Inserts a rule into a security policy.
15192 pub fn add_rule(&self) -> super::builder::security_policies::AddRule {
15193 super::builder::security_policies::AddRule::new(self.inner.clone())
15194 }
15195
15196 /// Retrieves the list of all SecurityPolicy resources, regional and global,
15197 /// available to the specified project.
15198 ///
15199 /// To prevent failure, Google recommends that you set the
15200 /// `returnPartialSuccess` parameter to `true`.
15201 pub fn aggregated_list(&self) -> super::builder::security_policies::AggregatedList {
15202 super::builder::security_policies::AggregatedList::new(self.inner.clone())
15203 }
15204
15205 /// Deletes the specified policy.
15206 pub fn delete(&self) -> super::builder::security_policies::Delete {
15207 super::builder::security_policies::Delete::new(self.inner.clone())
15208 }
15209
15210 /// List all of the ordered rules present in a single specified policy.
15211 pub fn get(&self) -> super::builder::security_policies::Get {
15212 super::builder::security_policies::Get::new(self.inner.clone())
15213 }
15214
15215 /// Gets a rule at the specified priority.
15216 pub fn get_rule(&self) -> super::builder::security_policies::GetRule {
15217 super::builder::security_policies::GetRule::new(self.inner.clone())
15218 }
15219
15220 /// Creates a new policy in the specified project using the data included in
15221 /// the request.
15222 pub fn insert(&self) -> super::builder::security_policies::Insert {
15223 super::builder::security_policies::Insert::new(self.inner.clone())
15224 }
15225
15226 /// List all the policies that have been configured for the specified project.
15227 pub fn list(&self) -> super::builder::security_policies::List {
15228 super::builder::security_policies::List::new(self.inner.clone())
15229 }
15230
15231 /// Gets the current list of preconfigured Web Application Firewall (WAF)
15232 /// expressions.
15233 pub fn list_preconfigured_expression_sets(
15234 &self,
15235 ) -> super::builder::security_policies::ListPreconfiguredExpressionSets {
15236 super::builder::security_policies::ListPreconfiguredExpressionSets::new(self.inner.clone())
15237 }
15238
15239 /// Patches the specified policy with the data included in the request. To
15240 /// clear fields in the policy, leave the fields empty and specify them in the
15241 /// updateMask. This cannot be used to be update the rules in the policy.
15242 /// Please use the per rule methods like addRule, patchRule, and removeRule
15243 /// instead.
15244 pub fn patch(&self) -> super::builder::security_policies::Patch {
15245 super::builder::security_policies::Patch::new(self.inner.clone())
15246 }
15247
15248 /// Patches a rule at the specified priority. To clear fields in the rule,
15249 /// leave the fields empty and specify them in the updateMask.
15250 pub fn patch_rule(&self) -> super::builder::security_policies::PatchRule {
15251 super::builder::security_policies::PatchRule::new(self.inner.clone())
15252 }
15253
15254 /// Deletes a rule at the specified priority.
15255 pub fn remove_rule(&self) -> super::builder::security_policies::RemoveRule {
15256 super::builder::security_policies::RemoveRule::new(self.inner.clone())
15257 }
15258
15259 /// Sets the labels on a security policy. To learn more about labels,
15260 /// read the Labeling Resources
15261 /// documentation.
15262 pub fn set_labels(&self) -> super::builder::security_policies::SetLabels {
15263 super::builder::security_policies::SetLabels::new(self.inner.clone())
15264 }
15265
15266 /// Retrieves the specified Operations resource.
15267 pub fn get_operation(&self) -> super::builder::security_policies::GetOperation {
15268 super::builder::security_policies::GetOperation::new(self.inner.clone())
15269 }
15270}
15271
15272/// Implements a client for the Google Compute Engine API.
15273///
15274/// # Example
15275/// ```
15276/// # async fn sample() -> gax::client_builder::Result<()> {
15277/// # use google_cloud_compute_v1::client::ServiceAttachments;
15278/// let client = ServiceAttachments::builder().build().await?;
15279/// // use `client` to make requests to the Google Compute Engine API.
15280/// # Ok(()) }
15281/// ```
15282///
15283/// # Service Description
15284///
15285/// Service for the `serviceAttachments` resource.
15286///
15287/// # Configuration
15288///
15289/// To configure `ServiceAttachments` use the `with_*` methods in the type returned
15290/// by [builder()][ServiceAttachments::builder]. The default configuration should
15291/// work for most applications. Common configuration changes include
15292///
15293/// * [with_endpoint()]: by default this client uses the global default endpoint
15294/// (`https://compute.googleapis.com`). Applications using regional
15295/// endpoints or running in restricted networks (e.g. a network configured
15296// with [Private Google Access with VPC Service Controls]) may want to
15297/// override this default.
15298/// * [with_credentials()]: by default this client uses
15299/// [Application Default Credentials]. Applications using custom
15300/// authentication may need to override this default.
15301///
15302/// [with_endpoint()]: super::builder::service_attachments::ClientBuilder::with_endpoint
15303/// [with_credentials()]: super::builder::service_attachments::ClientBuilder::credentials
15304/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15305/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15306///
15307/// # Pooling and Cloning
15308///
15309/// `ServiceAttachments` holds a connection pool internally, it is advised to
15310/// create one and the reuse it. You do not need to wrap `ServiceAttachments` in
15311/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15312/// already uses an `Arc` internally.
15313#[cfg(feature = "service-attachments")]
15314#[cfg_attr(docsrs, doc(cfg(feature = "service-attachments")))]
15315#[derive(Clone, Debug)]
15316pub struct ServiceAttachments {
15317 inner: std::sync::Arc<dyn super::stub::dynamic::ServiceAttachments>,
15318}
15319
15320#[cfg(feature = "service-attachments")]
15321impl ServiceAttachments {
15322 /// Returns a builder for [ServiceAttachments].
15323 ///
15324 /// ```
15325 /// # async fn sample() -> gax::client_builder::Result<()> {
15326 /// # use google_cloud_compute_v1::client::ServiceAttachments;
15327 /// let client = ServiceAttachments::builder().build().await?;
15328 /// # Ok(()) }
15329 /// ```
15330 pub fn builder() -> super::builder::service_attachments::ClientBuilder {
15331 gax::client_builder::internal::new_builder(
15332 super::builder::service_attachments::client::Factory,
15333 )
15334 }
15335
15336 /// Creates a new client from the provided stub.
15337 ///
15338 /// The most common case for calling this function is in tests mocking the
15339 /// client's behavior.
15340 pub fn from_stub<T>(stub: T) -> Self
15341 where
15342 T: super::stub::ServiceAttachments + 'static,
15343 {
15344 Self {
15345 inner: std::sync::Arc::new(stub),
15346 }
15347 }
15348
15349 pub(crate) async fn new(
15350 config: gaxi::options::ClientConfig,
15351 ) -> gax::client_builder::Result<Self> {
15352 let inner = Self::build_inner(config).await?;
15353 Ok(Self { inner })
15354 }
15355
15356 async fn build_inner(
15357 conf: gaxi::options::ClientConfig,
15358 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::ServiceAttachments>>
15359 {
15360 if gaxi::options::tracing_enabled(&conf) {
15361 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15362 }
15363 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15364 }
15365
15366 async fn build_transport(
15367 conf: gaxi::options::ClientConfig,
15368 ) -> gax::client_builder::Result<impl super::stub::ServiceAttachments> {
15369 super::transport::ServiceAttachments::new(conf).await
15370 }
15371
15372 async fn build_with_tracing(
15373 conf: gaxi::options::ClientConfig,
15374 ) -> gax::client_builder::Result<impl super::stub::ServiceAttachments> {
15375 Self::build_transport(conf)
15376 .await
15377 .map(super::tracing::ServiceAttachments::new)
15378 }
15379
15380 /// Retrieves the list of all ServiceAttachment resources,
15381 /// regional and global, available to the specified project.
15382 ///
15383 /// To prevent failure, Google recommends that you set the
15384 /// `returnPartialSuccess` parameter to `true`.
15385 pub fn aggregated_list(&self) -> super::builder::service_attachments::AggregatedList {
15386 super::builder::service_attachments::AggregatedList::new(self.inner.clone())
15387 }
15388
15389 /// Deletes the specified ServiceAttachment in the given scope
15390 pub fn delete(&self) -> super::builder::service_attachments::Delete {
15391 super::builder::service_attachments::Delete::new(self.inner.clone())
15392 }
15393
15394 /// Returns the specified ServiceAttachment resource in the given scope.
15395 pub fn get(&self) -> super::builder::service_attachments::Get {
15396 super::builder::service_attachments::Get::new(self.inner.clone())
15397 }
15398
15399 /// Gets the access control policy for a resource. May be empty if no such
15400 /// policy or resource exists.
15401 pub fn get_iam_policy(&self) -> super::builder::service_attachments::GetIamPolicy {
15402 super::builder::service_attachments::GetIamPolicy::new(self.inner.clone())
15403 }
15404
15405 /// Creates a ServiceAttachment in the specified project in the given scope
15406 /// using the parameters that are included in the request.
15407 pub fn insert(&self) -> super::builder::service_attachments::Insert {
15408 super::builder::service_attachments::Insert::new(self.inner.clone())
15409 }
15410
15411 /// Lists the ServiceAttachments for a project in the given scope.
15412 pub fn list(&self) -> super::builder::service_attachments::List {
15413 super::builder::service_attachments::List::new(self.inner.clone())
15414 }
15415
15416 /// Patches the specified ServiceAttachment resource with the data included in
15417 /// the request. This method supports PATCH
15418 /// semantics and usesJSON merge
15419 /// patch format and processing rules.
15420 pub fn patch(&self) -> super::builder::service_attachments::Patch {
15421 super::builder::service_attachments::Patch::new(self.inner.clone())
15422 }
15423
15424 /// Sets the access control policy on the specified resource.
15425 /// Replaces any existing policy.
15426 pub fn set_iam_policy(&self) -> super::builder::service_attachments::SetIamPolicy {
15427 super::builder::service_attachments::SetIamPolicy::new(self.inner.clone())
15428 }
15429
15430 /// Returns permissions that a caller has on the specified resource.
15431 pub fn test_iam_permissions(&self) -> super::builder::service_attachments::TestIamPermissions {
15432 super::builder::service_attachments::TestIamPermissions::new(self.inner.clone())
15433 }
15434
15435 /// Retrieves the specified region-specific Operations resource.
15436 pub fn get_operation(&self) -> super::builder::service_attachments::GetOperation {
15437 super::builder::service_attachments::GetOperation::new(self.inner.clone())
15438 }
15439}
15440
15441/// Implements a client for the Google Compute Engine API.
15442///
15443/// # Example
15444/// ```
15445/// # async fn sample() -> gax::client_builder::Result<()> {
15446/// # use google_cloud_compute_v1::client::SnapshotSettings;
15447/// let client = SnapshotSettings::builder().build().await?;
15448/// // use `client` to make requests to the Google Compute Engine API.
15449/// # Ok(()) }
15450/// ```
15451///
15452/// # Service Description
15453///
15454/// Service for the `snapshotSettings` resource.
15455///
15456/// # Configuration
15457///
15458/// To configure `SnapshotSettings` use the `with_*` methods in the type returned
15459/// by [builder()][SnapshotSettings::builder]. The default configuration should
15460/// work for most applications. Common configuration changes include
15461///
15462/// * [with_endpoint()]: by default this client uses the global default endpoint
15463/// (`https://compute.googleapis.com`). Applications using regional
15464/// endpoints or running in restricted networks (e.g. a network configured
15465// with [Private Google Access with VPC Service Controls]) may want to
15466/// override this default.
15467/// * [with_credentials()]: by default this client uses
15468/// [Application Default Credentials]. Applications using custom
15469/// authentication may need to override this default.
15470///
15471/// [with_endpoint()]: super::builder::snapshot_settings::ClientBuilder::with_endpoint
15472/// [with_credentials()]: super::builder::snapshot_settings::ClientBuilder::credentials
15473/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15474/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15475///
15476/// # Pooling and Cloning
15477///
15478/// `SnapshotSettings` holds a connection pool internally, it is advised to
15479/// create one and the reuse it. You do not need to wrap `SnapshotSettings` in
15480/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15481/// already uses an `Arc` internally.
15482#[cfg(feature = "snapshot-settings")]
15483#[cfg_attr(docsrs, doc(cfg(feature = "snapshot-settings")))]
15484#[derive(Clone, Debug)]
15485pub struct SnapshotSettings {
15486 inner: std::sync::Arc<dyn super::stub::dynamic::SnapshotSettings>,
15487}
15488
15489#[cfg(feature = "snapshot-settings")]
15490impl SnapshotSettings {
15491 /// Returns a builder for [SnapshotSettings].
15492 ///
15493 /// ```
15494 /// # async fn sample() -> gax::client_builder::Result<()> {
15495 /// # use google_cloud_compute_v1::client::SnapshotSettings;
15496 /// let client = SnapshotSettings::builder().build().await?;
15497 /// # Ok(()) }
15498 /// ```
15499 pub fn builder() -> super::builder::snapshot_settings::ClientBuilder {
15500 gax::client_builder::internal::new_builder(
15501 super::builder::snapshot_settings::client::Factory,
15502 )
15503 }
15504
15505 /// Creates a new client from the provided stub.
15506 ///
15507 /// The most common case for calling this function is in tests mocking the
15508 /// client's behavior.
15509 pub fn from_stub<T>(stub: T) -> Self
15510 where
15511 T: super::stub::SnapshotSettings + 'static,
15512 {
15513 Self {
15514 inner: std::sync::Arc::new(stub),
15515 }
15516 }
15517
15518 pub(crate) async fn new(
15519 config: gaxi::options::ClientConfig,
15520 ) -> gax::client_builder::Result<Self> {
15521 let inner = Self::build_inner(config).await?;
15522 Ok(Self { inner })
15523 }
15524
15525 async fn build_inner(
15526 conf: gaxi::options::ClientConfig,
15527 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::SnapshotSettings>>
15528 {
15529 if gaxi::options::tracing_enabled(&conf) {
15530 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15531 }
15532 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15533 }
15534
15535 async fn build_transport(
15536 conf: gaxi::options::ClientConfig,
15537 ) -> gax::client_builder::Result<impl super::stub::SnapshotSettings> {
15538 super::transport::SnapshotSettings::new(conf).await
15539 }
15540
15541 async fn build_with_tracing(
15542 conf: gaxi::options::ClientConfig,
15543 ) -> gax::client_builder::Result<impl super::stub::SnapshotSettings> {
15544 Self::build_transport(conf)
15545 .await
15546 .map(super::tracing::SnapshotSettings::new)
15547 }
15548
15549 /// Get snapshot settings.
15550 pub fn get(&self) -> super::builder::snapshot_settings::Get {
15551 super::builder::snapshot_settings::Get::new(self.inner.clone())
15552 }
15553
15554 /// Patch snapshot settings.
15555 pub fn patch(&self) -> super::builder::snapshot_settings::Patch {
15556 super::builder::snapshot_settings::Patch::new(self.inner.clone())
15557 }
15558
15559 /// Retrieves the specified Operations resource.
15560 pub fn get_operation(&self) -> super::builder::snapshot_settings::GetOperation {
15561 super::builder::snapshot_settings::GetOperation::new(self.inner.clone())
15562 }
15563}
15564
15565/// Implements a client for the Google Compute Engine API.
15566///
15567/// # Example
15568/// ```
15569/// # async fn sample() -> gax::client_builder::Result<()> {
15570/// # use google_cloud_compute_v1::client::Snapshots;
15571/// let client = Snapshots::builder().build().await?;
15572/// // use `client` to make requests to the Google Compute Engine API.
15573/// # Ok(()) }
15574/// ```
15575///
15576/// # Service Description
15577///
15578/// Service for the `snapshots` resource.
15579///
15580/// # Configuration
15581///
15582/// To configure `Snapshots` use the `with_*` methods in the type returned
15583/// by [builder()][Snapshots::builder]. The default configuration should
15584/// work for most applications. Common configuration changes include
15585///
15586/// * [with_endpoint()]: by default this client uses the global default endpoint
15587/// (`https://compute.googleapis.com`). Applications using regional
15588/// endpoints or running in restricted networks (e.g. a network configured
15589// with [Private Google Access with VPC Service Controls]) may want to
15590/// override this default.
15591/// * [with_credentials()]: by default this client uses
15592/// [Application Default Credentials]. Applications using custom
15593/// authentication may need to override this default.
15594///
15595/// [with_endpoint()]: super::builder::snapshots::ClientBuilder::with_endpoint
15596/// [with_credentials()]: super::builder::snapshots::ClientBuilder::credentials
15597/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15598/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15599///
15600/// # Pooling and Cloning
15601///
15602/// `Snapshots` holds a connection pool internally, it is advised to
15603/// create one and the reuse it. You do not need to wrap `Snapshots` in
15604/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15605/// already uses an `Arc` internally.
15606#[cfg(feature = "snapshots")]
15607#[cfg_attr(docsrs, doc(cfg(feature = "snapshots")))]
15608#[derive(Clone, Debug)]
15609pub struct Snapshots {
15610 inner: std::sync::Arc<dyn super::stub::dynamic::Snapshots>,
15611}
15612
15613#[cfg(feature = "snapshots")]
15614impl Snapshots {
15615 /// Returns a builder for [Snapshots].
15616 ///
15617 /// ```
15618 /// # async fn sample() -> gax::client_builder::Result<()> {
15619 /// # use google_cloud_compute_v1::client::Snapshots;
15620 /// let client = Snapshots::builder().build().await?;
15621 /// # Ok(()) }
15622 /// ```
15623 pub fn builder() -> super::builder::snapshots::ClientBuilder {
15624 gax::client_builder::internal::new_builder(super::builder::snapshots::client::Factory)
15625 }
15626
15627 /// Creates a new client from the provided stub.
15628 ///
15629 /// The most common case for calling this function is in tests mocking the
15630 /// client's behavior.
15631 pub fn from_stub<T>(stub: T) -> Self
15632 where
15633 T: super::stub::Snapshots + 'static,
15634 {
15635 Self {
15636 inner: std::sync::Arc::new(stub),
15637 }
15638 }
15639
15640 pub(crate) async fn new(
15641 config: gaxi::options::ClientConfig,
15642 ) -> gax::client_builder::Result<Self> {
15643 let inner = Self::build_inner(config).await?;
15644 Ok(Self { inner })
15645 }
15646
15647 async fn build_inner(
15648 conf: gaxi::options::ClientConfig,
15649 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Snapshots>> {
15650 if gaxi::options::tracing_enabled(&conf) {
15651 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15652 }
15653 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15654 }
15655
15656 async fn build_transport(
15657 conf: gaxi::options::ClientConfig,
15658 ) -> gax::client_builder::Result<impl super::stub::Snapshots> {
15659 super::transport::Snapshots::new(conf).await
15660 }
15661
15662 async fn build_with_tracing(
15663 conf: gaxi::options::ClientConfig,
15664 ) -> gax::client_builder::Result<impl super::stub::Snapshots> {
15665 Self::build_transport(conf)
15666 .await
15667 .map(super::tracing::Snapshots::new)
15668 }
15669
15670 /// Deletes the specified Snapshot resource. Keep in mind that deleting
15671 /// a single snapshot might not necessarily delete all the data on that
15672 /// snapshot. If any data on the snapshot that is marked for deletion is
15673 /// needed for subsequent snapshots, the data will be moved to the next
15674 /// corresponding snapshot.
15675 ///
15676 /// For more information, seeDeleting
15677 /// snapshots.
15678 pub fn delete(&self) -> super::builder::snapshots::Delete {
15679 super::builder::snapshots::Delete::new(self.inner.clone())
15680 }
15681
15682 /// Returns the specified Snapshot resource.
15683 pub fn get(&self) -> super::builder::snapshots::Get {
15684 super::builder::snapshots::Get::new(self.inner.clone())
15685 }
15686
15687 /// Gets the access control policy for a resource. May be empty if no such
15688 /// policy or resource exists.
15689 pub fn get_iam_policy(&self) -> super::builder::snapshots::GetIamPolicy {
15690 super::builder::snapshots::GetIamPolicy::new(self.inner.clone())
15691 }
15692
15693 /// Creates a snapshot in the specified project using the data included
15694 /// in the request. For regular snapshot creation, consider using this method
15695 /// instead of disks.createSnapshot,
15696 /// as this method supports more features, such as creating snapshots in a
15697 /// project different from the source disk project.
15698 pub fn insert(&self) -> super::builder::snapshots::Insert {
15699 super::builder::snapshots::Insert::new(self.inner.clone())
15700 }
15701
15702 /// Retrieves the list of Snapshot resources contained within
15703 /// the specified project.
15704 pub fn list(&self) -> super::builder::snapshots::List {
15705 super::builder::snapshots::List::new(self.inner.clone())
15706 }
15707
15708 /// Sets the access control policy on the specified resource.
15709 /// Replaces any existing policy.
15710 pub fn set_iam_policy(&self) -> super::builder::snapshots::SetIamPolicy {
15711 super::builder::snapshots::SetIamPolicy::new(self.inner.clone())
15712 }
15713
15714 /// Sets the labels on a snapshot. To learn more about labels, read theLabeling
15715 /// Resources documentation.
15716 pub fn set_labels(&self) -> super::builder::snapshots::SetLabels {
15717 super::builder::snapshots::SetLabels::new(self.inner.clone())
15718 }
15719
15720 /// Returns permissions that a caller has on the specified resource.
15721 pub fn test_iam_permissions(&self) -> super::builder::snapshots::TestIamPermissions {
15722 super::builder::snapshots::TestIamPermissions::new(self.inner.clone())
15723 }
15724
15725 /// Retrieves the specified Operations resource.
15726 pub fn get_operation(&self) -> super::builder::snapshots::GetOperation {
15727 super::builder::snapshots::GetOperation::new(self.inner.clone())
15728 }
15729}
15730
15731/// Implements a client for the Google Compute Engine API.
15732///
15733/// # Example
15734/// ```
15735/// # async fn sample() -> gax::client_builder::Result<()> {
15736/// # use google_cloud_compute_v1::client::SslCertificates;
15737/// let client = SslCertificates::builder().build().await?;
15738/// // use `client` to make requests to the Google Compute Engine API.
15739/// # Ok(()) }
15740/// ```
15741///
15742/// # Service Description
15743///
15744/// Service for the `sslCertificates` resource.
15745///
15746/// # Configuration
15747///
15748/// To configure `SslCertificates` use the `with_*` methods in the type returned
15749/// by [builder()][SslCertificates::builder]. The default configuration should
15750/// work for most applications. Common configuration changes include
15751///
15752/// * [with_endpoint()]: by default this client uses the global default endpoint
15753/// (`https://compute.googleapis.com`). Applications using regional
15754/// endpoints or running in restricted networks (e.g. a network configured
15755// with [Private Google Access with VPC Service Controls]) may want to
15756/// override this default.
15757/// * [with_credentials()]: by default this client uses
15758/// [Application Default Credentials]. Applications using custom
15759/// authentication may need to override this default.
15760///
15761/// [with_endpoint()]: super::builder::ssl_certificates::ClientBuilder::with_endpoint
15762/// [with_credentials()]: super::builder::ssl_certificates::ClientBuilder::credentials
15763/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15764/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15765///
15766/// # Pooling and Cloning
15767///
15768/// `SslCertificates` holds a connection pool internally, it is advised to
15769/// create one and the reuse it. You do not need to wrap `SslCertificates` in
15770/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15771/// already uses an `Arc` internally.
15772#[cfg(feature = "ssl-certificates")]
15773#[cfg_attr(docsrs, doc(cfg(feature = "ssl-certificates")))]
15774#[derive(Clone, Debug)]
15775pub struct SslCertificates {
15776 inner: std::sync::Arc<dyn super::stub::dynamic::SslCertificates>,
15777}
15778
15779#[cfg(feature = "ssl-certificates")]
15780impl SslCertificates {
15781 /// Returns a builder for [SslCertificates].
15782 ///
15783 /// ```
15784 /// # async fn sample() -> gax::client_builder::Result<()> {
15785 /// # use google_cloud_compute_v1::client::SslCertificates;
15786 /// let client = SslCertificates::builder().build().await?;
15787 /// # Ok(()) }
15788 /// ```
15789 pub fn builder() -> super::builder::ssl_certificates::ClientBuilder {
15790 gax::client_builder::internal::new_builder(
15791 super::builder::ssl_certificates::client::Factory,
15792 )
15793 }
15794
15795 /// Creates a new client from the provided stub.
15796 ///
15797 /// The most common case for calling this function is in tests mocking the
15798 /// client's behavior.
15799 pub fn from_stub<T>(stub: T) -> Self
15800 where
15801 T: super::stub::SslCertificates + 'static,
15802 {
15803 Self {
15804 inner: std::sync::Arc::new(stub),
15805 }
15806 }
15807
15808 pub(crate) async fn new(
15809 config: gaxi::options::ClientConfig,
15810 ) -> gax::client_builder::Result<Self> {
15811 let inner = Self::build_inner(config).await?;
15812 Ok(Self { inner })
15813 }
15814
15815 async fn build_inner(
15816 conf: gaxi::options::ClientConfig,
15817 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::SslCertificates>>
15818 {
15819 if gaxi::options::tracing_enabled(&conf) {
15820 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15821 }
15822 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15823 }
15824
15825 async fn build_transport(
15826 conf: gaxi::options::ClientConfig,
15827 ) -> gax::client_builder::Result<impl super::stub::SslCertificates> {
15828 super::transport::SslCertificates::new(conf).await
15829 }
15830
15831 async fn build_with_tracing(
15832 conf: gaxi::options::ClientConfig,
15833 ) -> gax::client_builder::Result<impl super::stub::SslCertificates> {
15834 Self::build_transport(conf)
15835 .await
15836 .map(super::tracing::SslCertificates::new)
15837 }
15838
15839 /// Retrieves the list of all SslCertificate resources, regional and global,
15840 /// available to the specified project.
15841 ///
15842 /// To prevent failure, Google recommends that you set the
15843 /// `returnPartialSuccess` parameter to `true`.
15844 pub fn aggregated_list(&self) -> super::builder::ssl_certificates::AggregatedList {
15845 super::builder::ssl_certificates::AggregatedList::new(self.inner.clone())
15846 }
15847
15848 /// Deletes the specified SslCertificate resource.
15849 pub fn delete(&self) -> super::builder::ssl_certificates::Delete {
15850 super::builder::ssl_certificates::Delete::new(self.inner.clone())
15851 }
15852
15853 /// Returns the specified SslCertificate resource.
15854 pub fn get(&self) -> super::builder::ssl_certificates::Get {
15855 super::builder::ssl_certificates::Get::new(self.inner.clone())
15856 }
15857
15858 /// Creates a SslCertificate resource in the specified project using the data
15859 /// included in the request.
15860 pub fn insert(&self) -> super::builder::ssl_certificates::Insert {
15861 super::builder::ssl_certificates::Insert::new(self.inner.clone())
15862 }
15863
15864 /// Retrieves the list of SslCertificate resources available to the specified
15865 /// project.
15866 pub fn list(&self) -> super::builder::ssl_certificates::List {
15867 super::builder::ssl_certificates::List::new(self.inner.clone())
15868 }
15869
15870 /// Retrieves the specified Operations resource.
15871 pub fn get_operation(&self) -> super::builder::ssl_certificates::GetOperation {
15872 super::builder::ssl_certificates::GetOperation::new(self.inner.clone())
15873 }
15874}
15875
15876/// Implements a client for the Google Compute Engine API.
15877///
15878/// # Example
15879/// ```
15880/// # async fn sample() -> gax::client_builder::Result<()> {
15881/// # use google_cloud_compute_v1::client::SslPolicies;
15882/// let client = SslPolicies::builder().build().await?;
15883/// // use `client` to make requests to the Google Compute Engine API.
15884/// # Ok(()) }
15885/// ```
15886///
15887/// # Service Description
15888///
15889/// Service for the `sslPolicies` resource.
15890///
15891/// # Configuration
15892///
15893/// To configure `SslPolicies` use the `with_*` methods in the type returned
15894/// by [builder()][SslPolicies::builder]. The default configuration should
15895/// work for most applications. Common configuration changes include
15896///
15897/// * [with_endpoint()]: by default this client uses the global default endpoint
15898/// (`https://compute.googleapis.com`). Applications using regional
15899/// endpoints or running in restricted networks (e.g. a network configured
15900// with [Private Google Access with VPC Service Controls]) may want to
15901/// override this default.
15902/// * [with_credentials()]: by default this client uses
15903/// [Application Default Credentials]. Applications using custom
15904/// authentication may need to override this default.
15905///
15906/// [with_endpoint()]: super::builder::ssl_policies::ClientBuilder::with_endpoint
15907/// [with_credentials()]: super::builder::ssl_policies::ClientBuilder::credentials
15908/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15909/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15910///
15911/// # Pooling and Cloning
15912///
15913/// `SslPolicies` holds a connection pool internally, it is advised to
15914/// create one and the reuse it. You do not need to wrap `SslPolicies` in
15915/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15916/// already uses an `Arc` internally.
15917#[cfg(feature = "ssl-policies")]
15918#[cfg_attr(docsrs, doc(cfg(feature = "ssl-policies")))]
15919#[derive(Clone, Debug)]
15920pub struct SslPolicies {
15921 inner: std::sync::Arc<dyn super::stub::dynamic::SslPolicies>,
15922}
15923
15924#[cfg(feature = "ssl-policies")]
15925impl SslPolicies {
15926 /// Returns a builder for [SslPolicies].
15927 ///
15928 /// ```
15929 /// # async fn sample() -> gax::client_builder::Result<()> {
15930 /// # use google_cloud_compute_v1::client::SslPolicies;
15931 /// let client = SslPolicies::builder().build().await?;
15932 /// # Ok(()) }
15933 /// ```
15934 pub fn builder() -> super::builder::ssl_policies::ClientBuilder {
15935 gax::client_builder::internal::new_builder(super::builder::ssl_policies::client::Factory)
15936 }
15937
15938 /// Creates a new client from the provided stub.
15939 ///
15940 /// The most common case for calling this function is in tests mocking the
15941 /// client's behavior.
15942 pub fn from_stub<T>(stub: T) -> Self
15943 where
15944 T: super::stub::SslPolicies + 'static,
15945 {
15946 Self {
15947 inner: std::sync::Arc::new(stub),
15948 }
15949 }
15950
15951 pub(crate) async fn new(
15952 config: gaxi::options::ClientConfig,
15953 ) -> gax::client_builder::Result<Self> {
15954 let inner = Self::build_inner(config).await?;
15955 Ok(Self { inner })
15956 }
15957
15958 async fn build_inner(
15959 conf: gaxi::options::ClientConfig,
15960 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::SslPolicies>> {
15961 if gaxi::options::tracing_enabled(&conf) {
15962 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15963 }
15964 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15965 }
15966
15967 async fn build_transport(
15968 conf: gaxi::options::ClientConfig,
15969 ) -> gax::client_builder::Result<impl super::stub::SslPolicies> {
15970 super::transport::SslPolicies::new(conf).await
15971 }
15972
15973 async fn build_with_tracing(
15974 conf: gaxi::options::ClientConfig,
15975 ) -> gax::client_builder::Result<impl super::stub::SslPolicies> {
15976 Self::build_transport(conf)
15977 .await
15978 .map(super::tracing::SslPolicies::new)
15979 }
15980
15981 /// Retrieves the list of all SslPolicy resources, regional and global,
15982 /// available to the specified project.
15983 ///
15984 /// To prevent failure, Google recommends that you set the
15985 /// `returnPartialSuccess` parameter to `true`.
15986 pub fn aggregated_list(&self) -> super::builder::ssl_policies::AggregatedList {
15987 super::builder::ssl_policies::AggregatedList::new(self.inner.clone())
15988 }
15989
15990 /// Deletes the specified SSL policy. The SSL policy resource can be deleted
15991 /// only if it is not in use by any TargetHttpsProxy or TargetSslProxy
15992 /// resources.
15993 pub fn delete(&self) -> super::builder::ssl_policies::Delete {
15994 super::builder::ssl_policies::Delete::new(self.inner.clone())
15995 }
15996
15997 /// Lists all of the ordered rules present in a single specified policy.
15998 pub fn get(&self) -> super::builder::ssl_policies::Get {
15999 super::builder::ssl_policies::Get::new(self.inner.clone())
16000 }
16001
16002 /// Returns the specified SSL policy resource.
16003 pub fn insert(&self) -> super::builder::ssl_policies::Insert {
16004 super::builder::ssl_policies::Insert::new(self.inner.clone())
16005 }
16006
16007 /// Lists all the SSL policies that have been configured for the specified
16008 /// project.
16009 pub fn list(&self) -> super::builder::ssl_policies::List {
16010 super::builder::ssl_policies::List::new(self.inner.clone())
16011 }
16012
16013 /// Lists all features that can be specified in the SSL policy when using
16014 /// custom profile.
16015 pub fn list_available_features(&self) -> super::builder::ssl_policies::ListAvailableFeatures {
16016 super::builder::ssl_policies::ListAvailableFeatures::new(self.inner.clone())
16017 }
16018
16019 /// Patches the specified SSL policy with the data included in the request.
16020 pub fn patch(&self) -> super::builder::ssl_policies::Patch {
16021 super::builder::ssl_policies::Patch::new(self.inner.clone())
16022 }
16023
16024 /// Retrieves the specified Operations resource.
16025 pub fn get_operation(&self) -> super::builder::ssl_policies::GetOperation {
16026 super::builder::ssl_policies::GetOperation::new(self.inner.clone())
16027 }
16028}
16029
16030/// Implements a client for the Google Compute Engine API.
16031///
16032/// # Example
16033/// ```
16034/// # async fn sample() -> gax::client_builder::Result<()> {
16035/// # use google_cloud_compute_v1::client::StoragePoolTypes;
16036/// let client = StoragePoolTypes::builder().build().await?;
16037/// // use `client` to make requests to the Google Compute Engine API.
16038/// # Ok(()) }
16039/// ```
16040///
16041/// # Service Description
16042///
16043/// Service for the `storagePoolTypes` resource.
16044///
16045/// # Configuration
16046///
16047/// To configure `StoragePoolTypes` use the `with_*` methods in the type returned
16048/// by [builder()][StoragePoolTypes::builder]. The default configuration should
16049/// work for most applications. Common configuration changes include
16050///
16051/// * [with_endpoint()]: by default this client uses the global default endpoint
16052/// (`https://compute.googleapis.com`). Applications using regional
16053/// endpoints or running in restricted networks (e.g. a network configured
16054// with [Private Google Access with VPC Service Controls]) may want to
16055/// override this default.
16056/// * [with_credentials()]: by default this client uses
16057/// [Application Default Credentials]. Applications using custom
16058/// authentication may need to override this default.
16059///
16060/// [with_endpoint()]: super::builder::storage_pool_types::ClientBuilder::with_endpoint
16061/// [with_credentials()]: super::builder::storage_pool_types::ClientBuilder::credentials
16062/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16063/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16064///
16065/// # Pooling and Cloning
16066///
16067/// `StoragePoolTypes` holds a connection pool internally, it is advised to
16068/// create one and the reuse it. You do not need to wrap `StoragePoolTypes` in
16069/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16070/// already uses an `Arc` internally.
16071#[cfg(feature = "storage-pool-types")]
16072#[cfg_attr(docsrs, doc(cfg(feature = "storage-pool-types")))]
16073#[derive(Clone, Debug)]
16074pub struct StoragePoolTypes {
16075 inner: std::sync::Arc<dyn super::stub::dynamic::StoragePoolTypes>,
16076}
16077
16078#[cfg(feature = "storage-pool-types")]
16079impl StoragePoolTypes {
16080 /// Returns a builder for [StoragePoolTypes].
16081 ///
16082 /// ```
16083 /// # async fn sample() -> gax::client_builder::Result<()> {
16084 /// # use google_cloud_compute_v1::client::StoragePoolTypes;
16085 /// let client = StoragePoolTypes::builder().build().await?;
16086 /// # Ok(()) }
16087 /// ```
16088 pub fn builder() -> super::builder::storage_pool_types::ClientBuilder {
16089 gax::client_builder::internal::new_builder(
16090 super::builder::storage_pool_types::client::Factory,
16091 )
16092 }
16093
16094 /// Creates a new client from the provided stub.
16095 ///
16096 /// The most common case for calling this function is in tests mocking the
16097 /// client's behavior.
16098 pub fn from_stub<T>(stub: T) -> Self
16099 where
16100 T: super::stub::StoragePoolTypes + 'static,
16101 {
16102 Self {
16103 inner: std::sync::Arc::new(stub),
16104 }
16105 }
16106
16107 pub(crate) async fn new(
16108 config: gaxi::options::ClientConfig,
16109 ) -> gax::client_builder::Result<Self> {
16110 let inner = Self::build_inner(config).await?;
16111 Ok(Self { inner })
16112 }
16113
16114 async fn build_inner(
16115 conf: gaxi::options::ClientConfig,
16116 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::StoragePoolTypes>>
16117 {
16118 if gaxi::options::tracing_enabled(&conf) {
16119 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16120 }
16121 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16122 }
16123
16124 async fn build_transport(
16125 conf: gaxi::options::ClientConfig,
16126 ) -> gax::client_builder::Result<impl super::stub::StoragePoolTypes> {
16127 super::transport::StoragePoolTypes::new(conf).await
16128 }
16129
16130 async fn build_with_tracing(
16131 conf: gaxi::options::ClientConfig,
16132 ) -> gax::client_builder::Result<impl super::stub::StoragePoolTypes> {
16133 Self::build_transport(conf)
16134 .await
16135 .map(super::tracing::StoragePoolTypes::new)
16136 }
16137
16138 /// Retrieves an aggregated list of storage pool types.
16139 ///
16140 /// To prevent failure, Google recommends that you set the
16141 /// `returnPartialSuccess` parameter to `true`.
16142 pub fn aggregated_list(&self) -> super::builder::storage_pool_types::AggregatedList {
16143 super::builder::storage_pool_types::AggregatedList::new(self.inner.clone())
16144 }
16145
16146 /// Returns the specified storage pool type.
16147 pub fn get(&self) -> super::builder::storage_pool_types::Get {
16148 super::builder::storage_pool_types::Get::new(self.inner.clone())
16149 }
16150
16151 /// Retrieves a list of storage pool types available to the specified
16152 /// project.
16153 pub fn list(&self) -> super::builder::storage_pool_types::List {
16154 super::builder::storage_pool_types::List::new(self.inner.clone())
16155 }
16156}
16157
16158/// Implements a client for the Google Compute Engine API.
16159///
16160/// # Example
16161/// ```
16162/// # async fn sample() -> gax::client_builder::Result<()> {
16163/// # use google_cloud_compute_v1::client::StoragePools;
16164/// let client = StoragePools::builder().build().await?;
16165/// // use `client` to make requests to the Google Compute Engine API.
16166/// # Ok(()) }
16167/// ```
16168///
16169/// # Service Description
16170///
16171/// Service for the `storagePools` resource.
16172///
16173/// # Configuration
16174///
16175/// To configure `StoragePools` use the `with_*` methods in the type returned
16176/// by [builder()][StoragePools::builder]. The default configuration should
16177/// work for most applications. Common configuration changes include
16178///
16179/// * [with_endpoint()]: by default this client uses the global default endpoint
16180/// (`https://compute.googleapis.com`). Applications using regional
16181/// endpoints or running in restricted networks (e.g. a network configured
16182// with [Private Google Access with VPC Service Controls]) may want to
16183/// override this default.
16184/// * [with_credentials()]: by default this client uses
16185/// [Application Default Credentials]. Applications using custom
16186/// authentication may need to override this default.
16187///
16188/// [with_endpoint()]: super::builder::storage_pools::ClientBuilder::with_endpoint
16189/// [with_credentials()]: super::builder::storage_pools::ClientBuilder::credentials
16190/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16191/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16192///
16193/// # Pooling and Cloning
16194///
16195/// `StoragePools` holds a connection pool internally, it is advised to
16196/// create one and the reuse it. You do not need to wrap `StoragePools` in
16197/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16198/// already uses an `Arc` internally.
16199#[cfg(feature = "storage-pools")]
16200#[cfg_attr(docsrs, doc(cfg(feature = "storage-pools")))]
16201#[derive(Clone, Debug)]
16202pub struct StoragePools {
16203 inner: std::sync::Arc<dyn super::stub::dynamic::StoragePools>,
16204}
16205
16206#[cfg(feature = "storage-pools")]
16207impl StoragePools {
16208 /// Returns a builder for [StoragePools].
16209 ///
16210 /// ```
16211 /// # async fn sample() -> gax::client_builder::Result<()> {
16212 /// # use google_cloud_compute_v1::client::StoragePools;
16213 /// let client = StoragePools::builder().build().await?;
16214 /// # Ok(()) }
16215 /// ```
16216 pub fn builder() -> super::builder::storage_pools::ClientBuilder {
16217 gax::client_builder::internal::new_builder(super::builder::storage_pools::client::Factory)
16218 }
16219
16220 /// Creates a new client from the provided stub.
16221 ///
16222 /// The most common case for calling this function is in tests mocking the
16223 /// client's behavior.
16224 pub fn from_stub<T>(stub: T) -> Self
16225 where
16226 T: super::stub::StoragePools + 'static,
16227 {
16228 Self {
16229 inner: std::sync::Arc::new(stub),
16230 }
16231 }
16232
16233 pub(crate) async fn new(
16234 config: gaxi::options::ClientConfig,
16235 ) -> gax::client_builder::Result<Self> {
16236 let inner = Self::build_inner(config).await?;
16237 Ok(Self { inner })
16238 }
16239
16240 async fn build_inner(
16241 conf: gaxi::options::ClientConfig,
16242 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::StoragePools>> {
16243 if gaxi::options::tracing_enabled(&conf) {
16244 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16245 }
16246 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16247 }
16248
16249 async fn build_transport(
16250 conf: gaxi::options::ClientConfig,
16251 ) -> gax::client_builder::Result<impl super::stub::StoragePools> {
16252 super::transport::StoragePools::new(conf).await
16253 }
16254
16255 async fn build_with_tracing(
16256 conf: gaxi::options::ClientConfig,
16257 ) -> gax::client_builder::Result<impl super::stub::StoragePools> {
16258 Self::build_transport(conf)
16259 .await
16260 .map(super::tracing::StoragePools::new)
16261 }
16262
16263 /// Retrieves an aggregated list of storage pools.
16264 ///
16265 /// To prevent failure, Google recommends that you set the
16266 /// `returnPartialSuccess` parameter to `true`.
16267 pub fn aggregated_list(&self) -> super::builder::storage_pools::AggregatedList {
16268 super::builder::storage_pools::AggregatedList::new(self.inner.clone())
16269 }
16270
16271 /// Deletes the specified storage pool. Deleting a storagePool
16272 /// removes its data permanently and is irreversible. However, deleting a
16273 /// storagePool does not delete any snapshots previously
16274 /// made from the storagePool. You must separately delete
16275 /// snapshots.
16276 pub fn delete(&self) -> super::builder::storage_pools::Delete {
16277 super::builder::storage_pools::Delete::new(self.inner.clone())
16278 }
16279
16280 /// Returns a specified storage pool. Gets a list of available
16281 /// storage pools by making a list() request.
16282 pub fn get(&self) -> super::builder::storage_pools::Get {
16283 super::builder::storage_pools::Get::new(self.inner.clone())
16284 }
16285
16286 /// Gets the access control policy for a resource. May be empty if no such
16287 /// policy or resource exists.
16288 pub fn get_iam_policy(&self) -> super::builder::storage_pools::GetIamPolicy {
16289 super::builder::storage_pools::GetIamPolicy::new(self.inner.clone())
16290 }
16291
16292 /// Creates a storage pool in the specified project using the data
16293 /// in the request.
16294 pub fn insert(&self) -> super::builder::storage_pools::Insert {
16295 super::builder::storage_pools::Insert::new(self.inner.clone())
16296 }
16297
16298 /// Retrieves a list of storage pools contained within
16299 /// the specified zone.
16300 pub fn list(&self) -> super::builder::storage_pools::List {
16301 super::builder::storage_pools::List::new(self.inner.clone())
16302 }
16303
16304 /// Lists the disks in a specified storage pool.
16305 pub fn list_disks(&self) -> super::builder::storage_pools::ListDisks {
16306 super::builder::storage_pools::ListDisks::new(self.inner.clone())
16307 }
16308
16309 /// Sets the access control policy on the specified resource.
16310 /// Replaces any existing policy.
16311 pub fn set_iam_policy(&self) -> super::builder::storage_pools::SetIamPolicy {
16312 super::builder::storage_pools::SetIamPolicy::new(self.inner.clone())
16313 }
16314
16315 /// Returns permissions that a caller has on the specified resource.
16316 pub fn test_iam_permissions(&self) -> super::builder::storage_pools::TestIamPermissions {
16317 super::builder::storage_pools::TestIamPermissions::new(self.inner.clone())
16318 }
16319
16320 /// Updates the specified storagePool with the data included in the request.
16321 /// The update is performed only on selected fields included as part
16322 /// of update-mask. Only the following fields can be modified:
16323 /// pool_provisioned_capacity_gb, pool_provisioned_iops and
16324 /// pool_provisioned_throughput.
16325 pub fn update(&self) -> super::builder::storage_pools::Update {
16326 super::builder::storage_pools::Update::new(self.inner.clone())
16327 }
16328
16329 /// Retrieves the specified zone-specific Operations resource.
16330 pub fn get_operation(&self) -> super::builder::storage_pools::GetOperation {
16331 super::builder::storage_pools::GetOperation::new(self.inner.clone())
16332 }
16333}
16334
16335/// Implements a client for the Google Compute Engine API.
16336///
16337/// # Example
16338/// ```
16339/// # async fn sample() -> gax::client_builder::Result<()> {
16340/// # use google_cloud_compute_v1::client::Subnetworks;
16341/// let client = Subnetworks::builder().build().await?;
16342/// // use `client` to make requests to the Google Compute Engine API.
16343/// # Ok(()) }
16344/// ```
16345///
16346/// # Service Description
16347///
16348/// Service for the `subnetworks` resource.
16349///
16350/// # Configuration
16351///
16352/// To configure `Subnetworks` use the `with_*` methods in the type returned
16353/// by [builder()][Subnetworks::builder]. The default configuration should
16354/// work for most applications. Common configuration changes include
16355///
16356/// * [with_endpoint()]: by default this client uses the global default endpoint
16357/// (`https://compute.googleapis.com`). Applications using regional
16358/// endpoints or running in restricted networks (e.g. a network configured
16359// with [Private Google Access with VPC Service Controls]) may want to
16360/// override this default.
16361/// * [with_credentials()]: by default this client uses
16362/// [Application Default Credentials]. Applications using custom
16363/// authentication may need to override this default.
16364///
16365/// [with_endpoint()]: super::builder::subnetworks::ClientBuilder::with_endpoint
16366/// [with_credentials()]: super::builder::subnetworks::ClientBuilder::credentials
16367/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16368/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16369///
16370/// # Pooling and Cloning
16371///
16372/// `Subnetworks` holds a connection pool internally, it is advised to
16373/// create one and the reuse it. You do not need to wrap `Subnetworks` in
16374/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16375/// already uses an `Arc` internally.
16376#[cfg(feature = "subnetworks")]
16377#[cfg_attr(docsrs, doc(cfg(feature = "subnetworks")))]
16378#[derive(Clone, Debug)]
16379pub struct Subnetworks {
16380 inner: std::sync::Arc<dyn super::stub::dynamic::Subnetworks>,
16381}
16382
16383#[cfg(feature = "subnetworks")]
16384impl Subnetworks {
16385 /// Returns a builder for [Subnetworks].
16386 ///
16387 /// ```
16388 /// # async fn sample() -> gax::client_builder::Result<()> {
16389 /// # use google_cloud_compute_v1::client::Subnetworks;
16390 /// let client = Subnetworks::builder().build().await?;
16391 /// # Ok(()) }
16392 /// ```
16393 pub fn builder() -> super::builder::subnetworks::ClientBuilder {
16394 gax::client_builder::internal::new_builder(super::builder::subnetworks::client::Factory)
16395 }
16396
16397 /// Creates a new client from the provided stub.
16398 ///
16399 /// The most common case for calling this function is in tests mocking the
16400 /// client's behavior.
16401 pub fn from_stub<T>(stub: T) -> Self
16402 where
16403 T: super::stub::Subnetworks + 'static,
16404 {
16405 Self {
16406 inner: std::sync::Arc::new(stub),
16407 }
16408 }
16409
16410 pub(crate) async fn new(
16411 config: gaxi::options::ClientConfig,
16412 ) -> gax::client_builder::Result<Self> {
16413 let inner = Self::build_inner(config).await?;
16414 Ok(Self { inner })
16415 }
16416
16417 async fn build_inner(
16418 conf: gaxi::options::ClientConfig,
16419 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Subnetworks>> {
16420 if gaxi::options::tracing_enabled(&conf) {
16421 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16422 }
16423 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16424 }
16425
16426 async fn build_transport(
16427 conf: gaxi::options::ClientConfig,
16428 ) -> gax::client_builder::Result<impl super::stub::Subnetworks> {
16429 super::transport::Subnetworks::new(conf).await
16430 }
16431
16432 async fn build_with_tracing(
16433 conf: gaxi::options::ClientConfig,
16434 ) -> gax::client_builder::Result<impl super::stub::Subnetworks> {
16435 Self::build_transport(conf)
16436 .await
16437 .map(super::tracing::Subnetworks::new)
16438 }
16439
16440 /// Retrieves an aggregated list of subnetworks.
16441 ///
16442 /// To prevent failure, Google recommends that you set the
16443 /// `returnPartialSuccess` parameter to `true`.
16444 pub fn aggregated_list(&self) -> super::builder::subnetworks::AggregatedList {
16445 super::builder::subnetworks::AggregatedList::new(self.inner.clone())
16446 }
16447
16448 /// Deletes the specified subnetwork.
16449 pub fn delete(&self) -> super::builder::subnetworks::Delete {
16450 super::builder::subnetworks::Delete::new(self.inner.clone())
16451 }
16452
16453 /// Expands the IP CIDR range of the subnetwork to a specified value.
16454 pub fn expand_ip_cidr_range(&self) -> super::builder::subnetworks::ExpandIpCidrRange {
16455 super::builder::subnetworks::ExpandIpCidrRange::new(self.inner.clone())
16456 }
16457
16458 /// Returns the specified subnetwork.
16459 pub fn get(&self) -> super::builder::subnetworks::Get {
16460 super::builder::subnetworks::Get::new(self.inner.clone())
16461 }
16462
16463 /// Gets the access control policy for a resource. May be empty if no such
16464 /// policy or resource exists.
16465 pub fn get_iam_policy(&self) -> super::builder::subnetworks::GetIamPolicy {
16466 super::builder::subnetworks::GetIamPolicy::new(self.inner.clone())
16467 }
16468
16469 /// Creates a subnetwork in the specified project using the data
16470 /// included in the request.
16471 pub fn insert(&self) -> super::builder::subnetworks::Insert {
16472 super::builder::subnetworks::Insert::new(self.inner.clone())
16473 }
16474
16475 /// Retrieves a list of subnetworks available to the specified
16476 /// project.
16477 pub fn list(&self) -> super::builder::subnetworks::List {
16478 super::builder::subnetworks::List::new(self.inner.clone())
16479 }
16480
16481 /// Retrieves an aggregated list of all usable subnetworks in the project.
16482 pub fn list_usable(&self) -> super::builder::subnetworks::ListUsable {
16483 super::builder::subnetworks::ListUsable::new(self.inner.clone())
16484 }
16485
16486 /// Patches the specified subnetwork with the data included in the request.
16487 /// Only certain fields can be updated with a patch request
16488 /// as indicated in the field descriptions.
16489 /// You must specify the current fingerprint of the
16490 /// subnetwork resource being patched.
16491 pub fn patch(&self) -> super::builder::subnetworks::Patch {
16492 super::builder::subnetworks::Patch::new(self.inner.clone())
16493 }
16494
16495 /// Sets the access control policy on the specified resource.
16496 /// Replaces any existing policy.
16497 pub fn set_iam_policy(&self) -> super::builder::subnetworks::SetIamPolicy {
16498 super::builder::subnetworks::SetIamPolicy::new(self.inner.clone())
16499 }
16500
16501 /// Set whether VMs in this subnet can access Google services without assigning
16502 /// external IP addresses through Private Google Access.
16503 pub fn set_private_ip_google_access(
16504 &self,
16505 ) -> super::builder::subnetworks::SetPrivateIpGoogleAccess {
16506 super::builder::subnetworks::SetPrivateIpGoogleAccess::new(self.inner.clone())
16507 }
16508
16509 /// Returns permissions that a caller has on the specified resource.
16510 pub fn test_iam_permissions(&self) -> super::builder::subnetworks::TestIamPermissions {
16511 super::builder::subnetworks::TestIamPermissions::new(self.inner.clone())
16512 }
16513
16514 /// Retrieves the specified region-specific Operations resource.
16515 pub fn get_operation(&self) -> super::builder::subnetworks::GetOperation {
16516 super::builder::subnetworks::GetOperation::new(self.inner.clone())
16517 }
16518}
16519
16520/// Implements a client for the Google Compute Engine API.
16521///
16522/// # Example
16523/// ```
16524/// # async fn sample() -> gax::client_builder::Result<()> {
16525/// # use google_cloud_compute_v1::client::TargetGrpcProxies;
16526/// let client = TargetGrpcProxies::builder().build().await?;
16527/// // use `client` to make requests to the Google Compute Engine API.
16528/// # Ok(()) }
16529/// ```
16530///
16531/// # Service Description
16532///
16533/// Service for the `targetGrpcProxies` resource.
16534///
16535/// # Configuration
16536///
16537/// To configure `TargetGrpcProxies` use the `with_*` methods in the type returned
16538/// by [builder()][TargetGrpcProxies::builder]. The default configuration should
16539/// work for most applications. Common configuration changes include
16540///
16541/// * [with_endpoint()]: by default this client uses the global default endpoint
16542/// (`https://compute.googleapis.com`). Applications using regional
16543/// endpoints or running in restricted networks (e.g. a network configured
16544// with [Private Google Access with VPC Service Controls]) may want to
16545/// override this default.
16546/// * [with_credentials()]: by default this client uses
16547/// [Application Default Credentials]. Applications using custom
16548/// authentication may need to override this default.
16549///
16550/// [with_endpoint()]: super::builder::target_grpc_proxies::ClientBuilder::with_endpoint
16551/// [with_credentials()]: super::builder::target_grpc_proxies::ClientBuilder::credentials
16552/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16553/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16554///
16555/// # Pooling and Cloning
16556///
16557/// `TargetGrpcProxies` holds a connection pool internally, it is advised to
16558/// create one and the reuse it. You do not need to wrap `TargetGrpcProxies` in
16559/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16560/// already uses an `Arc` internally.
16561#[cfg(feature = "target-grpc-proxies")]
16562#[cfg_attr(docsrs, doc(cfg(feature = "target-grpc-proxies")))]
16563#[derive(Clone, Debug)]
16564pub struct TargetGrpcProxies {
16565 inner: std::sync::Arc<dyn super::stub::dynamic::TargetGrpcProxies>,
16566}
16567
16568#[cfg(feature = "target-grpc-proxies")]
16569impl TargetGrpcProxies {
16570 /// Returns a builder for [TargetGrpcProxies].
16571 ///
16572 /// ```
16573 /// # async fn sample() -> gax::client_builder::Result<()> {
16574 /// # use google_cloud_compute_v1::client::TargetGrpcProxies;
16575 /// let client = TargetGrpcProxies::builder().build().await?;
16576 /// # Ok(()) }
16577 /// ```
16578 pub fn builder() -> super::builder::target_grpc_proxies::ClientBuilder {
16579 gax::client_builder::internal::new_builder(
16580 super::builder::target_grpc_proxies::client::Factory,
16581 )
16582 }
16583
16584 /// Creates a new client from the provided stub.
16585 ///
16586 /// The most common case for calling this function is in tests mocking the
16587 /// client's behavior.
16588 pub fn from_stub<T>(stub: T) -> Self
16589 where
16590 T: super::stub::TargetGrpcProxies + 'static,
16591 {
16592 Self {
16593 inner: std::sync::Arc::new(stub),
16594 }
16595 }
16596
16597 pub(crate) async fn new(
16598 config: gaxi::options::ClientConfig,
16599 ) -> gax::client_builder::Result<Self> {
16600 let inner = Self::build_inner(config).await?;
16601 Ok(Self { inner })
16602 }
16603
16604 async fn build_inner(
16605 conf: gaxi::options::ClientConfig,
16606 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::TargetGrpcProxies>>
16607 {
16608 if gaxi::options::tracing_enabled(&conf) {
16609 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16610 }
16611 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16612 }
16613
16614 async fn build_transport(
16615 conf: gaxi::options::ClientConfig,
16616 ) -> gax::client_builder::Result<impl super::stub::TargetGrpcProxies> {
16617 super::transport::TargetGrpcProxies::new(conf).await
16618 }
16619
16620 async fn build_with_tracing(
16621 conf: gaxi::options::ClientConfig,
16622 ) -> gax::client_builder::Result<impl super::stub::TargetGrpcProxies> {
16623 Self::build_transport(conf)
16624 .await
16625 .map(super::tracing::TargetGrpcProxies::new)
16626 }
16627
16628 /// Deletes the specified TargetGrpcProxy in the given scope
16629 pub fn delete(&self) -> super::builder::target_grpc_proxies::Delete {
16630 super::builder::target_grpc_proxies::Delete::new(self.inner.clone())
16631 }
16632
16633 /// Returns the specified TargetGrpcProxy resource in the given scope.
16634 pub fn get(&self) -> super::builder::target_grpc_proxies::Get {
16635 super::builder::target_grpc_proxies::Get::new(self.inner.clone())
16636 }
16637
16638 /// Creates a TargetGrpcProxy in the specified project in the given scope
16639 /// using the parameters that are included in the request.
16640 pub fn insert(&self) -> super::builder::target_grpc_proxies::Insert {
16641 super::builder::target_grpc_proxies::Insert::new(self.inner.clone())
16642 }
16643
16644 /// Lists the TargetGrpcProxies for a project in the given scope.
16645 pub fn list(&self) -> super::builder::target_grpc_proxies::List {
16646 super::builder::target_grpc_proxies::List::new(self.inner.clone())
16647 }
16648
16649 /// Patches the specified TargetGrpcProxy resource with the data included in
16650 /// the request. This method supports PATCH
16651 /// semantics and usesJSON merge
16652 /// patch format and processing rules.
16653 pub fn patch(&self) -> super::builder::target_grpc_proxies::Patch {
16654 super::builder::target_grpc_proxies::Patch::new(self.inner.clone())
16655 }
16656
16657 /// Retrieves the specified Operations resource.
16658 pub fn get_operation(&self) -> super::builder::target_grpc_proxies::GetOperation {
16659 super::builder::target_grpc_proxies::GetOperation::new(self.inner.clone())
16660 }
16661}
16662
16663/// Implements a client for the Google Compute Engine API.
16664///
16665/// # Example
16666/// ```
16667/// # async fn sample() -> gax::client_builder::Result<()> {
16668/// # use google_cloud_compute_v1::client::TargetHttpProxies;
16669/// let client = TargetHttpProxies::builder().build().await?;
16670/// // use `client` to make requests to the Google Compute Engine API.
16671/// # Ok(()) }
16672/// ```
16673///
16674/// # Service Description
16675///
16676/// Service for the `targetHttpProxies` resource.
16677///
16678/// # Configuration
16679///
16680/// To configure `TargetHttpProxies` use the `with_*` methods in the type returned
16681/// by [builder()][TargetHttpProxies::builder]. The default configuration should
16682/// work for most applications. Common configuration changes include
16683///
16684/// * [with_endpoint()]: by default this client uses the global default endpoint
16685/// (`https://compute.googleapis.com`). Applications using regional
16686/// endpoints or running in restricted networks (e.g. a network configured
16687// with [Private Google Access with VPC Service Controls]) may want to
16688/// override this default.
16689/// * [with_credentials()]: by default this client uses
16690/// [Application Default Credentials]. Applications using custom
16691/// authentication may need to override this default.
16692///
16693/// [with_endpoint()]: super::builder::target_http_proxies::ClientBuilder::with_endpoint
16694/// [with_credentials()]: super::builder::target_http_proxies::ClientBuilder::credentials
16695/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16696/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16697///
16698/// # Pooling and Cloning
16699///
16700/// `TargetHttpProxies` holds a connection pool internally, it is advised to
16701/// create one and the reuse it. You do not need to wrap `TargetHttpProxies` in
16702/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16703/// already uses an `Arc` internally.
16704#[cfg(feature = "target-http-proxies")]
16705#[cfg_attr(docsrs, doc(cfg(feature = "target-http-proxies")))]
16706#[derive(Clone, Debug)]
16707pub struct TargetHttpProxies {
16708 inner: std::sync::Arc<dyn super::stub::dynamic::TargetHttpProxies>,
16709}
16710
16711#[cfg(feature = "target-http-proxies")]
16712impl TargetHttpProxies {
16713 /// Returns a builder for [TargetHttpProxies].
16714 ///
16715 /// ```
16716 /// # async fn sample() -> gax::client_builder::Result<()> {
16717 /// # use google_cloud_compute_v1::client::TargetHttpProxies;
16718 /// let client = TargetHttpProxies::builder().build().await?;
16719 /// # Ok(()) }
16720 /// ```
16721 pub fn builder() -> super::builder::target_http_proxies::ClientBuilder {
16722 gax::client_builder::internal::new_builder(
16723 super::builder::target_http_proxies::client::Factory,
16724 )
16725 }
16726
16727 /// Creates a new client from the provided stub.
16728 ///
16729 /// The most common case for calling this function is in tests mocking the
16730 /// client's behavior.
16731 pub fn from_stub<T>(stub: T) -> Self
16732 where
16733 T: super::stub::TargetHttpProxies + 'static,
16734 {
16735 Self {
16736 inner: std::sync::Arc::new(stub),
16737 }
16738 }
16739
16740 pub(crate) async fn new(
16741 config: gaxi::options::ClientConfig,
16742 ) -> gax::client_builder::Result<Self> {
16743 let inner = Self::build_inner(config).await?;
16744 Ok(Self { inner })
16745 }
16746
16747 async fn build_inner(
16748 conf: gaxi::options::ClientConfig,
16749 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::TargetHttpProxies>>
16750 {
16751 if gaxi::options::tracing_enabled(&conf) {
16752 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16753 }
16754 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16755 }
16756
16757 async fn build_transport(
16758 conf: gaxi::options::ClientConfig,
16759 ) -> gax::client_builder::Result<impl super::stub::TargetHttpProxies> {
16760 super::transport::TargetHttpProxies::new(conf).await
16761 }
16762
16763 async fn build_with_tracing(
16764 conf: gaxi::options::ClientConfig,
16765 ) -> gax::client_builder::Result<impl super::stub::TargetHttpProxies> {
16766 Self::build_transport(conf)
16767 .await
16768 .map(super::tracing::TargetHttpProxies::new)
16769 }
16770
16771 /// Retrieves the list of all TargetHttpProxy resources, regional and global,
16772 /// available to the specified project.
16773 ///
16774 /// To prevent failure, Google recommends that you set the
16775 /// `returnPartialSuccess` parameter to `true`.
16776 pub fn aggregated_list(&self) -> super::builder::target_http_proxies::AggregatedList {
16777 super::builder::target_http_proxies::AggregatedList::new(self.inner.clone())
16778 }
16779
16780 /// Deletes the specified TargetHttpProxy resource.
16781 pub fn delete(&self) -> super::builder::target_http_proxies::Delete {
16782 super::builder::target_http_proxies::Delete::new(self.inner.clone())
16783 }
16784
16785 /// Returns the specified TargetHttpProxy resource.
16786 pub fn get(&self) -> super::builder::target_http_proxies::Get {
16787 super::builder::target_http_proxies::Get::new(self.inner.clone())
16788 }
16789
16790 /// Creates a TargetHttpProxy resource in the specified
16791 /// project using the data included in the request.
16792 pub fn insert(&self) -> super::builder::target_http_proxies::Insert {
16793 super::builder::target_http_proxies::Insert::new(self.inner.clone())
16794 }
16795
16796 /// Retrieves the list of TargetHttpProxy resources available
16797 /// to the specified project.
16798 pub fn list(&self) -> super::builder::target_http_proxies::List {
16799 super::builder::target_http_proxies::List::new(self.inner.clone())
16800 }
16801
16802 /// Patches the specified TargetHttpProxy resource with the data included in
16803 /// the request. This method supports PATCH
16804 /// semantics and usesJSON merge
16805 /// patch format and processing rules.
16806 pub fn patch(&self) -> super::builder::target_http_proxies::Patch {
16807 super::builder::target_http_proxies::Patch::new(self.inner.clone())
16808 }
16809
16810 /// Changes the URL map for TargetHttpProxy.
16811 pub fn set_url_map(&self) -> super::builder::target_http_proxies::SetUrlMap {
16812 super::builder::target_http_proxies::SetUrlMap::new(self.inner.clone())
16813 }
16814
16815 /// Retrieves the specified Operations resource.
16816 pub fn get_operation(&self) -> super::builder::target_http_proxies::GetOperation {
16817 super::builder::target_http_proxies::GetOperation::new(self.inner.clone())
16818 }
16819}
16820
16821/// Implements a client for the Google Compute Engine API.
16822///
16823/// # Example
16824/// ```
16825/// # async fn sample() -> gax::client_builder::Result<()> {
16826/// # use google_cloud_compute_v1::client::TargetHttpsProxies;
16827/// let client = TargetHttpsProxies::builder().build().await?;
16828/// // use `client` to make requests to the Google Compute Engine API.
16829/// # Ok(()) }
16830/// ```
16831///
16832/// # Service Description
16833///
16834/// Service for the `targetHttpsProxies` resource.
16835///
16836/// # Configuration
16837///
16838/// To configure `TargetHttpsProxies` use the `with_*` methods in the type returned
16839/// by [builder()][TargetHttpsProxies::builder]. The default configuration should
16840/// work for most applications. Common configuration changes include
16841///
16842/// * [with_endpoint()]: by default this client uses the global default endpoint
16843/// (`https://compute.googleapis.com`). Applications using regional
16844/// endpoints or running in restricted networks (e.g. a network configured
16845// with [Private Google Access with VPC Service Controls]) may want to
16846/// override this default.
16847/// * [with_credentials()]: by default this client uses
16848/// [Application Default Credentials]. Applications using custom
16849/// authentication may need to override this default.
16850///
16851/// [with_endpoint()]: super::builder::target_https_proxies::ClientBuilder::with_endpoint
16852/// [with_credentials()]: super::builder::target_https_proxies::ClientBuilder::credentials
16853/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16854/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16855///
16856/// # Pooling and Cloning
16857///
16858/// `TargetHttpsProxies` holds a connection pool internally, it is advised to
16859/// create one and the reuse it. You do not need to wrap `TargetHttpsProxies` in
16860/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16861/// already uses an `Arc` internally.
16862#[cfg(feature = "target-https-proxies")]
16863#[cfg_attr(docsrs, doc(cfg(feature = "target-https-proxies")))]
16864#[derive(Clone, Debug)]
16865pub struct TargetHttpsProxies {
16866 inner: std::sync::Arc<dyn super::stub::dynamic::TargetHttpsProxies>,
16867}
16868
16869#[cfg(feature = "target-https-proxies")]
16870impl TargetHttpsProxies {
16871 /// Returns a builder for [TargetHttpsProxies].
16872 ///
16873 /// ```
16874 /// # async fn sample() -> gax::client_builder::Result<()> {
16875 /// # use google_cloud_compute_v1::client::TargetHttpsProxies;
16876 /// let client = TargetHttpsProxies::builder().build().await?;
16877 /// # Ok(()) }
16878 /// ```
16879 pub fn builder() -> super::builder::target_https_proxies::ClientBuilder {
16880 gax::client_builder::internal::new_builder(
16881 super::builder::target_https_proxies::client::Factory,
16882 )
16883 }
16884
16885 /// Creates a new client from the provided stub.
16886 ///
16887 /// The most common case for calling this function is in tests mocking the
16888 /// client's behavior.
16889 pub fn from_stub<T>(stub: T) -> Self
16890 where
16891 T: super::stub::TargetHttpsProxies + 'static,
16892 {
16893 Self {
16894 inner: std::sync::Arc::new(stub),
16895 }
16896 }
16897
16898 pub(crate) async fn new(
16899 config: gaxi::options::ClientConfig,
16900 ) -> gax::client_builder::Result<Self> {
16901 let inner = Self::build_inner(config).await?;
16902 Ok(Self { inner })
16903 }
16904
16905 async fn build_inner(
16906 conf: gaxi::options::ClientConfig,
16907 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::TargetHttpsProxies>>
16908 {
16909 if gaxi::options::tracing_enabled(&conf) {
16910 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16911 }
16912 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16913 }
16914
16915 async fn build_transport(
16916 conf: gaxi::options::ClientConfig,
16917 ) -> gax::client_builder::Result<impl super::stub::TargetHttpsProxies> {
16918 super::transport::TargetHttpsProxies::new(conf).await
16919 }
16920
16921 async fn build_with_tracing(
16922 conf: gaxi::options::ClientConfig,
16923 ) -> gax::client_builder::Result<impl super::stub::TargetHttpsProxies> {
16924 Self::build_transport(conf)
16925 .await
16926 .map(super::tracing::TargetHttpsProxies::new)
16927 }
16928
16929 /// Retrieves the list of all TargetHttpsProxy resources, regional and global,
16930 /// available to the specified project.
16931 ///
16932 /// To prevent failure, Google recommends that you set the
16933 /// `returnPartialSuccess` parameter to `true`.
16934 pub fn aggregated_list(&self) -> super::builder::target_https_proxies::AggregatedList {
16935 super::builder::target_https_proxies::AggregatedList::new(self.inner.clone())
16936 }
16937
16938 /// Deletes the specified TargetHttpsProxy resource.
16939 pub fn delete(&self) -> super::builder::target_https_proxies::Delete {
16940 super::builder::target_https_proxies::Delete::new(self.inner.clone())
16941 }
16942
16943 /// Returns the specified TargetHttpsProxy resource.
16944 pub fn get(&self) -> super::builder::target_https_proxies::Get {
16945 super::builder::target_https_proxies::Get::new(self.inner.clone())
16946 }
16947
16948 /// Creates a TargetHttpsProxy resource in the specified
16949 /// project using the data included in the request.
16950 pub fn insert(&self) -> super::builder::target_https_proxies::Insert {
16951 super::builder::target_https_proxies::Insert::new(self.inner.clone())
16952 }
16953
16954 /// Retrieves the list of TargetHttpsProxy resources
16955 /// available to the specified project.
16956 pub fn list(&self) -> super::builder::target_https_proxies::List {
16957 super::builder::target_https_proxies::List::new(self.inner.clone())
16958 }
16959
16960 /// Patches the specified TargetHttpsProxy resource with the data included in
16961 /// the request. This method supports PATCH
16962 /// semantics and usesJSON merge
16963 /// patch format and processing rules.
16964 pub fn patch(&self) -> super::builder::target_https_proxies::Patch {
16965 super::builder::target_https_proxies::Patch::new(self.inner.clone())
16966 }
16967
16968 /// Changes the Certificate Map for TargetHttpsProxy.
16969 pub fn set_certificate_map(&self) -> super::builder::target_https_proxies::SetCertificateMap {
16970 super::builder::target_https_proxies::SetCertificateMap::new(self.inner.clone())
16971 }
16972
16973 /// Sets the QUIC override policy for TargetHttpsProxy.
16974 pub fn set_quic_override(&self) -> super::builder::target_https_proxies::SetQuicOverride {
16975 super::builder::target_https_proxies::SetQuicOverride::new(self.inner.clone())
16976 }
16977
16978 /// Replaces SslCertificates for TargetHttpsProxy.
16979 pub fn set_ssl_certificates(&self) -> super::builder::target_https_proxies::SetSslCertificates {
16980 super::builder::target_https_proxies::SetSslCertificates::new(self.inner.clone())
16981 }
16982
16983 /// Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies the
16984 /// server-side support for SSL features. This affects connections between
16985 /// clients and the HTTPS proxy load balancer. They do not affect the
16986 /// connection between the load balancer and the backends.
16987 pub fn set_ssl_policy(&self) -> super::builder::target_https_proxies::SetSslPolicy {
16988 super::builder::target_https_proxies::SetSslPolicy::new(self.inner.clone())
16989 }
16990
16991 /// Changes the URL map for TargetHttpsProxy.
16992 pub fn set_url_map(&self) -> super::builder::target_https_proxies::SetUrlMap {
16993 super::builder::target_https_proxies::SetUrlMap::new(self.inner.clone())
16994 }
16995
16996 /// Retrieves the specified Operations resource.
16997 pub fn get_operation(&self) -> super::builder::target_https_proxies::GetOperation {
16998 super::builder::target_https_proxies::GetOperation::new(self.inner.clone())
16999 }
17000}
17001
17002/// Implements a client for the Google Compute Engine API.
17003///
17004/// # Example
17005/// ```
17006/// # async fn sample() -> gax::client_builder::Result<()> {
17007/// # use google_cloud_compute_v1::client::TargetInstances;
17008/// let client = TargetInstances::builder().build().await?;
17009/// // use `client` to make requests to the Google Compute Engine API.
17010/// # Ok(()) }
17011/// ```
17012///
17013/// # Service Description
17014///
17015/// Service for the `targetInstances` resource.
17016///
17017/// # Configuration
17018///
17019/// To configure `TargetInstances` use the `with_*` methods in the type returned
17020/// by [builder()][TargetInstances::builder]. The default configuration should
17021/// work for most applications. Common configuration changes include
17022///
17023/// * [with_endpoint()]: by default this client uses the global default endpoint
17024/// (`https://compute.googleapis.com`). Applications using regional
17025/// endpoints or running in restricted networks (e.g. a network configured
17026// with [Private Google Access with VPC Service Controls]) may want to
17027/// override this default.
17028/// * [with_credentials()]: by default this client uses
17029/// [Application Default Credentials]. Applications using custom
17030/// authentication may need to override this default.
17031///
17032/// [with_endpoint()]: super::builder::target_instances::ClientBuilder::with_endpoint
17033/// [with_credentials()]: super::builder::target_instances::ClientBuilder::credentials
17034/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17035/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17036///
17037/// # Pooling and Cloning
17038///
17039/// `TargetInstances` holds a connection pool internally, it is advised to
17040/// create one and the reuse it. You do not need to wrap `TargetInstances` in
17041/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17042/// already uses an `Arc` internally.
17043#[cfg(feature = "target-instances")]
17044#[cfg_attr(docsrs, doc(cfg(feature = "target-instances")))]
17045#[derive(Clone, Debug)]
17046pub struct TargetInstances {
17047 inner: std::sync::Arc<dyn super::stub::dynamic::TargetInstances>,
17048}
17049
17050#[cfg(feature = "target-instances")]
17051impl TargetInstances {
17052 /// Returns a builder for [TargetInstances].
17053 ///
17054 /// ```
17055 /// # async fn sample() -> gax::client_builder::Result<()> {
17056 /// # use google_cloud_compute_v1::client::TargetInstances;
17057 /// let client = TargetInstances::builder().build().await?;
17058 /// # Ok(()) }
17059 /// ```
17060 pub fn builder() -> super::builder::target_instances::ClientBuilder {
17061 gax::client_builder::internal::new_builder(
17062 super::builder::target_instances::client::Factory,
17063 )
17064 }
17065
17066 /// Creates a new client from the provided stub.
17067 ///
17068 /// The most common case for calling this function is in tests mocking the
17069 /// client's behavior.
17070 pub fn from_stub<T>(stub: T) -> Self
17071 where
17072 T: super::stub::TargetInstances + 'static,
17073 {
17074 Self {
17075 inner: std::sync::Arc::new(stub),
17076 }
17077 }
17078
17079 pub(crate) async fn new(
17080 config: gaxi::options::ClientConfig,
17081 ) -> gax::client_builder::Result<Self> {
17082 let inner = Self::build_inner(config).await?;
17083 Ok(Self { inner })
17084 }
17085
17086 async fn build_inner(
17087 conf: gaxi::options::ClientConfig,
17088 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::TargetInstances>>
17089 {
17090 if gaxi::options::tracing_enabled(&conf) {
17091 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17092 }
17093 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17094 }
17095
17096 async fn build_transport(
17097 conf: gaxi::options::ClientConfig,
17098 ) -> gax::client_builder::Result<impl super::stub::TargetInstances> {
17099 super::transport::TargetInstances::new(conf).await
17100 }
17101
17102 async fn build_with_tracing(
17103 conf: gaxi::options::ClientConfig,
17104 ) -> gax::client_builder::Result<impl super::stub::TargetInstances> {
17105 Self::build_transport(conf)
17106 .await
17107 .map(super::tracing::TargetInstances::new)
17108 }
17109
17110 /// Retrieves an aggregated list of target instances.
17111 ///
17112 /// To prevent failure, Google recommends that you set the
17113 /// `returnPartialSuccess` parameter to `true`.
17114 pub fn aggregated_list(&self) -> super::builder::target_instances::AggregatedList {
17115 super::builder::target_instances::AggregatedList::new(self.inner.clone())
17116 }
17117
17118 /// Deletes the specified TargetInstance resource.
17119 pub fn delete(&self) -> super::builder::target_instances::Delete {
17120 super::builder::target_instances::Delete::new(self.inner.clone())
17121 }
17122
17123 /// Returns the specified TargetInstance resource.
17124 pub fn get(&self) -> super::builder::target_instances::Get {
17125 super::builder::target_instances::Get::new(self.inner.clone())
17126 }
17127
17128 /// Creates a TargetInstance resource in the specified project and zone using
17129 /// the data included in the request.
17130 pub fn insert(&self) -> super::builder::target_instances::Insert {
17131 super::builder::target_instances::Insert::new(self.inner.clone())
17132 }
17133
17134 /// Retrieves a list of TargetInstance resources available to the specified
17135 /// project and zone.
17136 pub fn list(&self) -> super::builder::target_instances::List {
17137 super::builder::target_instances::List::new(self.inner.clone())
17138 }
17139
17140 /// Sets the Google Cloud Armor security policy for the specified target
17141 /// instance. For more information, seeGoogle
17142 /// Cloud Armor Overview
17143 pub fn set_security_policy(&self) -> super::builder::target_instances::SetSecurityPolicy {
17144 super::builder::target_instances::SetSecurityPolicy::new(self.inner.clone())
17145 }
17146
17147 /// Returns permissions that a caller has on the specified resource.
17148 pub fn test_iam_permissions(&self) -> super::builder::target_instances::TestIamPermissions {
17149 super::builder::target_instances::TestIamPermissions::new(self.inner.clone())
17150 }
17151
17152 /// Retrieves the specified zone-specific Operations resource.
17153 pub fn get_operation(&self) -> super::builder::target_instances::GetOperation {
17154 super::builder::target_instances::GetOperation::new(self.inner.clone())
17155 }
17156}
17157
17158/// Implements a client for the Google Compute Engine API.
17159///
17160/// # Example
17161/// ```
17162/// # async fn sample() -> gax::client_builder::Result<()> {
17163/// # use google_cloud_compute_v1::client::TargetPools;
17164/// let client = TargetPools::builder().build().await?;
17165/// // use `client` to make requests to the Google Compute Engine API.
17166/// # Ok(()) }
17167/// ```
17168///
17169/// # Service Description
17170///
17171/// Service for the `targetPools` resource.
17172///
17173/// # Configuration
17174///
17175/// To configure `TargetPools` use the `with_*` methods in the type returned
17176/// by [builder()][TargetPools::builder]. The default configuration should
17177/// work for most applications. Common configuration changes include
17178///
17179/// * [with_endpoint()]: by default this client uses the global default endpoint
17180/// (`https://compute.googleapis.com`). Applications using regional
17181/// endpoints or running in restricted networks (e.g. a network configured
17182// with [Private Google Access with VPC Service Controls]) may want to
17183/// override this default.
17184/// * [with_credentials()]: by default this client uses
17185/// [Application Default Credentials]. Applications using custom
17186/// authentication may need to override this default.
17187///
17188/// [with_endpoint()]: super::builder::target_pools::ClientBuilder::with_endpoint
17189/// [with_credentials()]: super::builder::target_pools::ClientBuilder::credentials
17190/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17191/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17192///
17193/// # Pooling and Cloning
17194///
17195/// `TargetPools` holds a connection pool internally, it is advised to
17196/// create one and the reuse it. You do not need to wrap `TargetPools` in
17197/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17198/// already uses an `Arc` internally.
17199#[cfg(feature = "target-pools")]
17200#[cfg_attr(docsrs, doc(cfg(feature = "target-pools")))]
17201#[derive(Clone, Debug)]
17202pub struct TargetPools {
17203 inner: std::sync::Arc<dyn super::stub::dynamic::TargetPools>,
17204}
17205
17206#[cfg(feature = "target-pools")]
17207impl TargetPools {
17208 /// Returns a builder for [TargetPools].
17209 ///
17210 /// ```
17211 /// # async fn sample() -> gax::client_builder::Result<()> {
17212 /// # use google_cloud_compute_v1::client::TargetPools;
17213 /// let client = TargetPools::builder().build().await?;
17214 /// # Ok(()) }
17215 /// ```
17216 pub fn builder() -> super::builder::target_pools::ClientBuilder {
17217 gax::client_builder::internal::new_builder(super::builder::target_pools::client::Factory)
17218 }
17219
17220 /// Creates a new client from the provided stub.
17221 ///
17222 /// The most common case for calling this function is in tests mocking the
17223 /// client's behavior.
17224 pub fn from_stub<T>(stub: T) -> Self
17225 where
17226 T: super::stub::TargetPools + 'static,
17227 {
17228 Self {
17229 inner: std::sync::Arc::new(stub),
17230 }
17231 }
17232
17233 pub(crate) async fn new(
17234 config: gaxi::options::ClientConfig,
17235 ) -> gax::client_builder::Result<Self> {
17236 let inner = Self::build_inner(config).await?;
17237 Ok(Self { inner })
17238 }
17239
17240 async fn build_inner(
17241 conf: gaxi::options::ClientConfig,
17242 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::TargetPools>> {
17243 if gaxi::options::tracing_enabled(&conf) {
17244 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17245 }
17246 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17247 }
17248
17249 async fn build_transport(
17250 conf: gaxi::options::ClientConfig,
17251 ) -> gax::client_builder::Result<impl super::stub::TargetPools> {
17252 super::transport::TargetPools::new(conf).await
17253 }
17254
17255 async fn build_with_tracing(
17256 conf: gaxi::options::ClientConfig,
17257 ) -> gax::client_builder::Result<impl super::stub::TargetPools> {
17258 Self::build_transport(conf)
17259 .await
17260 .map(super::tracing::TargetPools::new)
17261 }
17262
17263 /// Adds health check URLs to a target pool.
17264 pub fn add_health_check(&self) -> super::builder::target_pools::AddHealthCheck {
17265 super::builder::target_pools::AddHealthCheck::new(self.inner.clone())
17266 }
17267
17268 /// Adds an instance to a target pool.
17269 pub fn add_instance(&self) -> super::builder::target_pools::AddInstance {
17270 super::builder::target_pools::AddInstance::new(self.inner.clone())
17271 }
17272
17273 /// Retrieves an aggregated list of target pools.
17274 ///
17275 /// To prevent failure, Google recommends that you set the
17276 /// `returnPartialSuccess` parameter to `true`.
17277 pub fn aggregated_list(&self) -> super::builder::target_pools::AggregatedList {
17278 super::builder::target_pools::AggregatedList::new(self.inner.clone())
17279 }
17280
17281 /// Deletes the specified target pool.
17282 pub fn delete(&self) -> super::builder::target_pools::Delete {
17283 super::builder::target_pools::Delete::new(self.inner.clone())
17284 }
17285
17286 /// Returns the specified target pool.
17287 pub fn get(&self) -> super::builder::target_pools::Get {
17288 super::builder::target_pools::Get::new(self.inner.clone())
17289 }
17290
17291 /// Gets the most recent health check results for each IP for the
17292 /// instance that is referenced by the given target pool.
17293 pub fn get_health(&self) -> super::builder::target_pools::GetHealth {
17294 super::builder::target_pools::GetHealth::new(self.inner.clone())
17295 }
17296
17297 /// Creates a target pool in the specified project and region using
17298 /// the data included in the request.
17299 pub fn insert(&self) -> super::builder::target_pools::Insert {
17300 super::builder::target_pools::Insert::new(self.inner.clone())
17301 }
17302
17303 /// Retrieves a list of target pools available to the specified
17304 /// project and region.
17305 pub fn list(&self) -> super::builder::target_pools::List {
17306 super::builder::target_pools::List::new(self.inner.clone())
17307 }
17308
17309 /// Removes health check URL from a target pool.
17310 pub fn remove_health_check(&self) -> super::builder::target_pools::RemoveHealthCheck {
17311 super::builder::target_pools::RemoveHealthCheck::new(self.inner.clone())
17312 }
17313
17314 /// Removes instance URL from a target pool.
17315 pub fn remove_instance(&self) -> super::builder::target_pools::RemoveInstance {
17316 super::builder::target_pools::RemoveInstance::new(self.inner.clone())
17317 }
17318
17319 /// Changes a backup target pool's configurations.
17320 pub fn set_backup(&self) -> super::builder::target_pools::SetBackup {
17321 super::builder::target_pools::SetBackup::new(self.inner.clone())
17322 }
17323
17324 /// Sets the Google Cloud Armor security policy for the specified target pool.
17325 /// For more information, seeGoogle
17326 /// Cloud Armor Overview
17327 pub fn set_security_policy(&self) -> super::builder::target_pools::SetSecurityPolicy {
17328 super::builder::target_pools::SetSecurityPolicy::new(self.inner.clone())
17329 }
17330
17331 /// Returns permissions that a caller has on the specified resource.
17332 pub fn test_iam_permissions(&self) -> super::builder::target_pools::TestIamPermissions {
17333 super::builder::target_pools::TestIamPermissions::new(self.inner.clone())
17334 }
17335
17336 /// Retrieves the specified region-specific Operations resource.
17337 pub fn get_operation(&self) -> super::builder::target_pools::GetOperation {
17338 super::builder::target_pools::GetOperation::new(self.inner.clone())
17339 }
17340}
17341
17342/// Implements a client for the Google Compute Engine API.
17343///
17344/// # Example
17345/// ```
17346/// # async fn sample() -> gax::client_builder::Result<()> {
17347/// # use google_cloud_compute_v1::client::TargetSslProxies;
17348/// let client = TargetSslProxies::builder().build().await?;
17349/// // use `client` to make requests to the Google Compute Engine API.
17350/// # Ok(()) }
17351/// ```
17352///
17353/// # Service Description
17354///
17355/// Service for the `targetSslProxies` resource.
17356///
17357/// # Configuration
17358///
17359/// To configure `TargetSslProxies` use the `with_*` methods in the type returned
17360/// by [builder()][TargetSslProxies::builder]. The default configuration should
17361/// work for most applications. Common configuration changes include
17362///
17363/// * [with_endpoint()]: by default this client uses the global default endpoint
17364/// (`https://compute.googleapis.com`). Applications using regional
17365/// endpoints or running in restricted networks (e.g. a network configured
17366// with [Private Google Access with VPC Service Controls]) may want to
17367/// override this default.
17368/// * [with_credentials()]: by default this client uses
17369/// [Application Default Credentials]. Applications using custom
17370/// authentication may need to override this default.
17371///
17372/// [with_endpoint()]: super::builder::target_ssl_proxies::ClientBuilder::with_endpoint
17373/// [with_credentials()]: super::builder::target_ssl_proxies::ClientBuilder::credentials
17374/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17375/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17376///
17377/// # Pooling and Cloning
17378///
17379/// `TargetSslProxies` holds a connection pool internally, it is advised to
17380/// create one and the reuse it. You do not need to wrap `TargetSslProxies` in
17381/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17382/// already uses an `Arc` internally.
17383#[cfg(feature = "target-ssl-proxies")]
17384#[cfg_attr(docsrs, doc(cfg(feature = "target-ssl-proxies")))]
17385#[derive(Clone, Debug)]
17386pub struct TargetSslProxies {
17387 inner: std::sync::Arc<dyn super::stub::dynamic::TargetSslProxies>,
17388}
17389
17390#[cfg(feature = "target-ssl-proxies")]
17391impl TargetSslProxies {
17392 /// Returns a builder for [TargetSslProxies].
17393 ///
17394 /// ```
17395 /// # async fn sample() -> gax::client_builder::Result<()> {
17396 /// # use google_cloud_compute_v1::client::TargetSslProxies;
17397 /// let client = TargetSslProxies::builder().build().await?;
17398 /// # Ok(()) }
17399 /// ```
17400 pub fn builder() -> super::builder::target_ssl_proxies::ClientBuilder {
17401 gax::client_builder::internal::new_builder(
17402 super::builder::target_ssl_proxies::client::Factory,
17403 )
17404 }
17405
17406 /// Creates a new client from the provided stub.
17407 ///
17408 /// The most common case for calling this function is in tests mocking the
17409 /// client's behavior.
17410 pub fn from_stub<T>(stub: T) -> Self
17411 where
17412 T: super::stub::TargetSslProxies + 'static,
17413 {
17414 Self {
17415 inner: std::sync::Arc::new(stub),
17416 }
17417 }
17418
17419 pub(crate) async fn new(
17420 config: gaxi::options::ClientConfig,
17421 ) -> gax::client_builder::Result<Self> {
17422 let inner = Self::build_inner(config).await?;
17423 Ok(Self { inner })
17424 }
17425
17426 async fn build_inner(
17427 conf: gaxi::options::ClientConfig,
17428 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::TargetSslProxies>>
17429 {
17430 if gaxi::options::tracing_enabled(&conf) {
17431 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17432 }
17433 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17434 }
17435
17436 async fn build_transport(
17437 conf: gaxi::options::ClientConfig,
17438 ) -> gax::client_builder::Result<impl super::stub::TargetSslProxies> {
17439 super::transport::TargetSslProxies::new(conf).await
17440 }
17441
17442 async fn build_with_tracing(
17443 conf: gaxi::options::ClientConfig,
17444 ) -> gax::client_builder::Result<impl super::stub::TargetSslProxies> {
17445 Self::build_transport(conf)
17446 .await
17447 .map(super::tracing::TargetSslProxies::new)
17448 }
17449
17450 /// Deletes the specified TargetSslProxy resource.
17451 pub fn delete(&self) -> super::builder::target_ssl_proxies::Delete {
17452 super::builder::target_ssl_proxies::Delete::new(self.inner.clone())
17453 }
17454
17455 /// Returns the specified TargetSslProxy resource.
17456 pub fn get(&self) -> super::builder::target_ssl_proxies::Get {
17457 super::builder::target_ssl_proxies::Get::new(self.inner.clone())
17458 }
17459
17460 /// Creates a TargetSslProxy resource in the specified project using
17461 /// the data included in the request.
17462 pub fn insert(&self) -> super::builder::target_ssl_proxies::Insert {
17463 super::builder::target_ssl_proxies::Insert::new(self.inner.clone())
17464 }
17465
17466 /// Retrieves the list of TargetSslProxy resources
17467 /// available to the specified project.
17468 pub fn list(&self) -> super::builder::target_ssl_proxies::List {
17469 super::builder::target_ssl_proxies::List::new(self.inner.clone())
17470 }
17471
17472 /// Changes the BackendService for TargetSslProxy.
17473 pub fn set_backend_service(&self) -> super::builder::target_ssl_proxies::SetBackendService {
17474 super::builder::target_ssl_proxies::SetBackendService::new(self.inner.clone())
17475 }
17476
17477 /// Changes the Certificate Map for TargetSslProxy.
17478 pub fn set_certificate_map(&self) -> super::builder::target_ssl_proxies::SetCertificateMap {
17479 super::builder::target_ssl_proxies::SetCertificateMap::new(self.inner.clone())
17480 }
17481
17482 /// Changes the ProxyHeaderType for TargetSslProxy.
17483 pub fn set_proxy_header(&self) -> super::builder::target_ssl_proxies::SetProxyHeader {
17484 super::builder::target_ssl_proxies::SetProxyHeader::new(self.inner.clone())
17485 }
17486
17487 /// Changes SslCertificates for TargetSslProxy.
17488 pub fn set_ssl_certificates(&self) -> super::builder::target_ssl_proxies::SetSslCertificates {
17489 super::builder::target_ssl_proxies::SetSslCertificates::new(self.inner.clone())
17490 }
17491
17492 /// Sets the SSL policy for TargetSslProxy. The SSL policy specifies the
17493 /// server-side support for SSL features. This affects connections between
17494 /// clients and the load balancer. They do not affect the
17495 /// connection between the load balancer and the backends.
17496 pub fn set_ssl_policy(&self) -> super::builder::target_ssl_proxies::SetSslPolicy {
17497 super::builder::target_ssl_proxies::SetSslPolicy::new(self.inner.clone())
17498 }
17499
17500 /// Returns permissions that a caller has on the specified resource.
17501 pub fn test_iam_permissions(&self) -> super::builder::target_ssl_proxies::TestIamPermissions {
17502 super::builder::target_ssl_proxies::TestIamPermissions::new(self.inner.clone())
17503 }
17504
17505 /// Retrieves the specified Operations resource.
17506 pub fn get_operation(&self) -> super::builder::target_ssl_proxies::GetOperation {
17507 super::builder::target_ssl_proxies::GetOperation::new(self.inner.clone())
17508 }
17509}
17510
17511/// Implements a client for the Google Compute Engine API.
17512///
17513/// # Example
17514/// ```
17515/// # async fn sample() -> gax::client_builder::Result<()> {
17516/// # use google_cloud_compute_v1::client::TargetTcpProxies;
17517/// let client = TargetTcpProxies::builder().build().await?;
17518/// // use `client` to make requests to the Google Compute Engine API.
17519/// # Ok(()) }
17520/// ```
17521///
17522/// # Service Description
17523///
17524/// Service for the `targetTcpProxies` resource.
17525///
17526/// # Configuration
17527///
17528/// To configure `TargetTcpProxies` use the `with_*` methods in the type returned
17529/// by [builder()][TargetTcpProxies::builder]. The default configuration should
17530/// work for most applications. Common configuration changes include
17531///
17532/// * [with_endpoint()]: by default this client uses the global default endpoint
17533/// (`https://compute.googleapis.com`). Applications using regional
17534/// endpoints or running in restricted networks (e.g. a network configured
17535// with [Private Google Access with VPC Service Controls]) may want to
17536/// override this default.
17537/// * [with_credentials()]: by default this client uses
17538/// [Application Default Credentials]. Applications using custom
17539/// authentication may need to override this default.
17540///
17541/// [with_endpoint()]: super::builder::target_tcp_proxies::ClientBuilder::with_endpoint
17542/// [with_credentials()]: super::builder::target_tcp_proxies::ClientBuilder::credentials
17543/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17544/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17545///
17546/// # Pooling and Cloning
17547///
17548/// `TargetTcpProxies` holds a connection pool internally, it is advised to
17549/// create one and the reuse it. You do not need to wrap `TargetTcpProxies` in
17550/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17551/// already uses an `Arc` internally.
17552#[cfg(feature = "target-tcp-proxies")]
17553#[cfg_attr(docsrs, doc(cfg(feature = "target-tcp-proxies")))]
17554#[derive(Clone, Debug)]
17555pub struct TargetTcpProxies {
17556 inner: std::sync::Arc<dyn super::stub::dynamic::TargetTcpProxies>,
17557}
17558
17559#[cfg(feature = "target-tcp-proxies")]
17560impl TargetTcpProxies {
17561 /// Returns a builder for [TargetTcpProxies].
17562 ///
17563 /// ```
17564 /// # async fn sample() -> gax::client_builder::Result<()> {
17565 /// # use google_cloud_compute_v1::client::TargetTcpProxies;
17566 /// let client = TargetTcpProxies::builder().build().await?;
17567 /// # Ok(()) }
17568 /// ```
17569 pub fn builder() -> super::builder::target_tcp_proxies::ClientBuilder {
17570 gax::client_builder::internal::new_builder(
17571 super::builder::target_tcp_proxies::client::Factory,
17572 )
17573 }
17574
17575 /// Creates a new client from the provided stub.
17576 ///
17577 /// The most common case for calling this function is in tests mocking the
17578 /// client's behavior.
17579 pub fn from_stub<T>(stub: T) -> Self
17580 where
17581 T: super::stub::TargetTcpProxies + 'static,
17582 {
17583 Self {
17584 inner: std::sync::Arc::new(stub),
17585 }
17586 }
17587
17588 pub(crate) async fn new(
17589 config: gaxi::options::ClientConfig,
17590 ) -> gax::client_builder::Result<Self> {
17591 let inner = Self::build_inner(config).await?;
17592 Ok(Self { inner })
17593 }
17594
17595 async fn build_inner(
17596 conf: gaxi::options::ClientConfig,
17597 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::TargetTcpProxies>>
17598 {
17599 if gaxi::options::tracing_enabled(&conf) {
17600 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17601 }
17602 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17603 }
17604
17605 async fn build_transport(
17606 conf: gaxi::options::ClientConfig,
17607 ) -> gax::client_builder::Result<impl super::stub::TargetTcpProxies> {
17608 super::transport::TargetTcpProxies::new(conf).await
17609 }
17610
17611 async fn build_with_tracing(
17612 conf: gaxi::options::ClientConfig,
17613 ) -> gax::client_builder::Result<impl super::stub::TargetTcpProxies> {
17614 Self::build_transport(conf)
17615 .await
17616 .map(super::tracing::TargetTcpProxies::new)
17617 }
17618
17619 /// Retrieves the list of all TargetTcpProxy resources, regional and global,
17620 /// available to the specified project.
17621 ///
17622 /// To prevent failure, Google recommends that you set the
17623 /// `returnPartialSuccess` parameter to `true`.
17624 pub fn aggregated_list(&self) -> super::builder::target_tcp_proxies::AggregatedList {
17625 super::builder::target_tcp_proxies::AggregatedList::new(self.inner.clone())
17626 }
17627
17628 /// Deletes the specified TargetTcpProxy resource.
17629 pub fn delete(&self) -> super::builder::target_tcp_proxies::Delete {
17630 super::builder::target_tcp_proxies::Delete::new(self.inner.clone())
17631 }
17632
17633 /// Returns the specified TargetTcpProxy resource.
17634 pub fn get(&self) -> super::builder::target_tcp_proxies::Get {
17635 super::builder::target_tcp_proxies::Get::new(self.inner.clone())
17636 }
17637
17638 /// Creates a TargetTcpProxy resource in the specified project using
17639 /// the data included in the request.
17640 pub fn insert(&self) -> super::builder::target_tcp_proxies::Insert {
17641 super::builder::target_tcp_proxies::Insert::new(self.inner.clone())
17642 }
17643
17644 /// Retrieves the list of TargetTcpProxy resources
17645 /// available to the specified project.
17646 pub fn list(&self) -> super::builder::target_tcp_proxies::List {
17647 super::builder::target_tcp_proxies::List::new(self.inner.clone())
17648 }
17649
17650 /// Changes the BackendService for TargetTcpProxy.
17651 pub fn set_backend_service(&self) -> super::builder::target_tcp_proxies::SetBackendService {
17652 super::builder::target_tcp_proxies::SetBackendService::new(self.inner.clone())
17653 }
17654
17655 /// Changes the ProxyHeaderType for TargetTcpProxy.
17656 pub fn set_proxy_header(&self) -> super::builder::target_tcp_proxies::SetProxyHeader {
17657 super::builder::target_tcp_proxies::SetProxyHeader::new(self.inner.clone())
17658 }
17659
17660 /// Returns permissions that a caller has on the specified resource.
17661 pub fn test_iam_permissions(&self) -> super::builder::target_tcp_proxies::TestIamPermissions {
17662 super::builder::target_tcp_proxies::TestIamPermissions::new(self.inner.clone())
17663 }
17664
17665 /// Retrieves the specified Operations resource.
17666 pub fn get_operation(&self) -> super::builder::target_tcp_proxies::GetOperation {
17667 super::builder::target_tcp_proxies::GetOperation::new(self.inner.clone())
17668 }
17669}
17670
17671/// Implements a client for the Google Compute Engine API.
17672///
17673/// # Example
17674/// ```
17675/// # async fn sample() -> gax::client_builder::Result<()> {
17676/// # use google_cloud_compute_v1::client::TargetVpnGateways;
17677/// let client = TargetVpnGateways::builder().build().await?;
17678/// // use `client` to make requests to the Google Compute Engine API.
17679/// # Ok(()) }
17680/// ```
17681///
17682/// # Service Description
17683///
17684/// Service for the `targetVpnGateways` resource.
17685///
17686/// # Configuration
17687///
17688/// To configure `TargetVpnGateways` use the `with_*` methods in the type returned
17689/// by [builder()][TargetVpnGateways::builder]. The default configuration should
17690/// work for most applications. Common configuration changes include
17691///
17692/// * [with_endpoint()]: by default this client uses the global default endpoint
17693/// (`https://compute.googleapis.com`). Applications using regional
17694/// endpoints or running in restricted networks (e.g. a network configured
17695// with [Private Google Access with VPC Service Controls]) may want to
17696/// override this default.
17697/// * [with_credentials()]: by default this client uses
17698/// [Application Default Credentials]. Applications using custom
17699/// authentication may need to override this default.
17700///
17701/// [with_endpoint()]: super::builder::target_vpn_gateways::ClientBuilder::with_endpoint
17702/// [with_credentials()]: super::builder::target_vpn_gateways::ClientBuilder::credentials
17703/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17704/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17705///
17706/// # Pooling and Cloning
17707///
17708/// `TargetVpnGateways` holds a connection pool internally, it is advised to
17709/// create one and the reuse it. You do not need to wrap `TargetVpnGateways` in
17710/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17711/// already uses an `Arc` internally.
17712#[cfg(feature = "target-vpn-gateways")]
17713#[cfg_attr(docsrs, doc(cfg(feature = "target-vpn-gateways")))]
17714#[derive(Clone, Debug)]
17715pub struct TargetVpnGateways {
17716 inner: std::sync::Arc<dyn super::stub::dynamic::TargetVpnGateways>,
17717}
17718
17719#[cfg(feature = "target-vpn-gateways")]
17720impl TargetVpnGateways {
17721 /// Returns a builder for [TargetVpnGateways].
17722 ///
17723 /// ```
17724 /// # async fn sample() -> gax::client_builder::Result<()> {
17725 /// # use google_cloud_compute_v1::client::TargetVpnGateways;
17726 /// let client = TargetVpnGateways::builder().build().await?;
17727 /// # Ok(()) }
17728 /// ```
17729 pub fn builder() -> super::builder::target_vpn_gateways::ClientBuilder {
17730 gax::client_builder::internal::new_builder(
17731 super::builder::target_vpn_gateways::client::Factory,
17732 )
17733 }
17734
17735 /// Creates a new client from the provided stub.
17736 ///
17737 /// The most common case for calling this function is in tests mocking the
17738 /// client's behavior.
17739 pub fn from_stub<T>(stub: T) -> Self
17740 where
17741 T: super::stub::TargetVpnGateways + 'static,
17742 {
17743 Self {
17744 inner: std::sync::Arc::new(stub),
17745 }
17746 }
17747
17748 pub(crate) async fn new(
17749 config: gaxi::options::ClientConfig,
17750 ) -> gax::client_builder::Result<Self> {
17751 let inner = Self::build_inner(config).await?;
17752 Ok(Self { inner })
17753 }
17754
17755 async fn build_inner(
17756 conf: gaxi::options::ClientConfig,
17757 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::TargetVpnGateways>>
17758 {
17759 if gaxi::options::tracing_enabled(&conf) {
17760 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17761 }
17762 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17763 }
17764
17765 async fn build_transport(
17766 conf: gaxi::options::ClientConfig,
17767 ) -> gax::client_builder::Result<impl super::stub::TargetVpnGateways> {
17768 super::transport::TargetVpnGateways::new(conf).await
17769 }
17770
17771 async fn build_with_tracing(
17772 conf: gaxi::options::ClientConfig,
17773 ) -> gax::client_builder::Result<impl super::stub::TargetVpnGateways> {
17774 Self::build_transport(conf)
17775 .await
17776 .map(super::tracing::TargetVpnGateways::new)
17777 }
17778
17779 /// Retrieves an aggregated list of target VPN gateways.
17780 ///
17781 /// To prevent failure, Google recommends that you set the
17782 /// `returnPartialSuccess` parameter to `true`.
17783 pub fn aggregated_list(&self) -> super::builder::target_vpn_gateways::AggregatedList {
17784 super::builder::target_vpn_gateways::AggregatedList::new(self.inner.clone())
17785 }
17786
17787 /// Deletes the specified target VPN gateway.
17788 pub fn delete(&self) -> super::builder::target_vpn_gateways::Delete {
17789 super::builder::target_vpn_gateways::Delete::new(self.inner.clone())
17790 }
17791
17792 /// Returns the specified target VPN gateway.
17793 pub fn get(&self) -> super::builder::target_vpn_gateways::Get {
17794 super::builder::target_vpn_gateways::Get::new(self.inner.clone())
17795 }
17796
17797 /// Creates a target VPN gateway in the specified project and region using
17798 /// the data included in the request.
17799 pub fn insert(&self) -> super::builder::target_vpn_gateways::Insert {
17800 super::builder::target_vpn_gateways::Insert::new(self.inner.clone())
17801 }
17802
17803 /// Retrieves a list of target VPN gateways available to the specified
17804 /// project and region.
17805 pub fn list(&self) -> super::builder::target_vpn_gateways::List {
17806 super::builder::target_vpn_gateways::List::new(self.inner.clone())
17807 }
17808
17809 /// Sets the labels on a TargetVpnGateway. To learn more about labels, read theLabeling
17810 /// Resources documentation.
17811 pub fn set_labels(&self) -> super::builder::target_vpn_gateways::SetLabels {
17812 super::builder::target_vpn_gateways::SetLabels::new(self.inner.clone())
17813 }
17814
17815 /// Retrieves the specified region-specific Operations resource.
17816 pub fn get_operation(&self) -> super::builder::target_vpn_gateways::GetOperation {
17817 super::builder::target_vpn_gateways::GetOperation::new(self.inner.clone())
17818 }
17819}
17820
17821/// Implements a client for the Google Compute Engine API.
17822///
17823/// # Example
17824/// ```
17825/// # async fn sample() -> gax::client_builder::Result<()> {
17826/// # use google_cloud_compute_v1::client::UrlMaps;
17827/// let client = UrlMaps::builder().build().await?;
17828/// // use `client` to make requests to the Google Compute Engine API.
17829/// # Ok(()) }
17830/// ```
17831///
17832/// # Service Description
17833///
17834/// Service for the `urlMaps` resource.
17835///
17836/// # Configuration
17837///
17838/// To configure `UrlMaps` use the `with_*` methods in the type returned
17839/// by [builder()][UrlMaps::builder]. The default configuration should
17840/// work for most applications. Common configuration changes include
17841///
17842/// * [with_endpoint()]: by default this client uses the global default endpoint
17843/// (`https://compute.googleapis.com`). Applications using regional
17844/// endpoints or running in restricted networks (e.g. a network configured
17845// with [Private Google Access with VPC Service Controls]) may want to
17846/// override this default.
17847/// * [with_credentials()]: by default this client uses
17848/// [Application Default Credentials]. Applications using custom
17849/// authentication may need to override this default.
17850///
17851/// [with_endpoint()]: super::builder::url_maps::ClientBuilder::with_endpoint
17852/// [with_credentials()]: super::builder::url_maps::ClientBuilder::credentials
17853/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17854/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17855///
17856/// # Pooling and Cloning
17857///
17858/// `UrlMaps` holds a connection pool internally, it is advised to
17859/// create one and the reuse it. You do not need to wrap `UrlMaps` in
17860/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17861/// already uses an `Arc` internally.
17862#[cfg(feature = "url-maps")]
17863#[cfg_attr(docsrs, doc(cfg(feature = "url-maps")))]
17864#[derive(Clone, Debug)]
17865pub struct UrlMaps {
17866 inner: std::sync::Arc<dyn super::stub::dynamic::UrlMaps>,
17867}
17868
17869#[cfg(feature = "url-maps")]
17870impl UrlMaps {
17871 /// Returns a builder for [UrlMaps].
17872 ///
17873 /// ```
17874 /// # async fn sample() -> gax::client_builder::Result<()> {
17875 /// # use google_cloud_compute_v1::client::UrlMaps;
17876 /// let client = UrlMaps::builder().build().await?;
17877 /// # Ok(()) }
17878 /// ```
17879 pub fn builder() -> super::builder::url_maps::ClientBuilder {
17880 gax::client_builder::internal::new_builder(super::builder::url_maps::client::Factory)
17881 }
17882
17883 /// Creates a new client from the provided stub.
17884 ///
17885 /// The most common case for calling this function is in tests mocking the
17886 /// client's behavior.
17887 pub fn from_stub<T>(stub: T) -> Self
17888 where
17889 T: super::stub::UrlMaps + 'static,
17890 {
17891 Self {
17892 inner: std::sync::Arc::new(stub),
17893 }
17894 }
17895
17896 pub(crate) async fn new(
17897 config: gaxi::options::ClientConfig,
17898 ) -> gax::client_builder::Result<Self> {
17899 let inner = Self::build_inner(config).await?;
17900 Ok(Self { inner })
17901 }
17902
17903 async fn build_inner(
17904 conf: gaxi::options::ClientConfig,
17905 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::UrlMaps>> {
17906 if gaxi::options::tracing_enabled(&conf) {
17907 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17908 }
17909 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17910 }
17911
17912 async fn build_transport(
17913 conf: gaxi::options::ClientConfig,
17914 ) -> gax::client_builder::Result<impl super::stub::UrlMaps> {
17915 super::transport::UrlMaps::new(conf).await
17916 }
17917
17918 async fn build_with_tracing(
17919 conf: gaxi::options::ClientConfig,
17920 ) -> gax::client_builder::Result<impl super::stub::UrlMaps> {
17921 Self::build_transport(conf)
17922 .await
17923 .map(super::tracing::UrlMaps::new)
17924 }
17925
17926 /// Retrieves the list of all UrlMap resources, regional and global,
17927 /// available to the specified project.
17928 ///
17929 /// To prevent failure, Google recommends that you set the
17930 /// `returnPartialSuccess` parameter to `true`.
17931 pub fn aggregated_list(&self) -> super::builder::url_maps::AggregatedList {
17932 super::builder::url_maps::AggregatedList::new(self.inner.clone())
17933 }
17934
17935 /// Deletes the specified UrlMap resource.
17936 pub fn delete(&self) -> super::builder::url_maps::Delete {
17937 super::builder::url_maps::Delete::new(self.inner.clone())
17938 }
17939
17940 /// Returns the specified UrlMap resource.
17941 pub fn get(&self) -> super::builder::url_maps::Get {
17942 super::builder::url_maps::Get::new(self.inner.clone())
17943 }
17944
17945 /// Creates a UrlMap resource in the specified project using
17946 /// the data included in the request.
17947 pub fn insert(&self) -> super::builder::url_maps::Insert {
17948 super::builder::url_maps::Insert::new(self.inner.clone())
17949 }
17950
17951 /// Initiates a cache invalidation operation, invalidating the specified path,
17952 /// scoped to the specified UrlMap.
17953 ///
17954 /// For more information, see [Invalidating cached
17955 /// content](/cdn/docs/invalidating-cached-content).
17956 pub fn invalidate_cache(&self) -> super::builder::url_maps::InvalidateCache {
17957 super::builder::url_maps::InvalidateCache::new(self.inner.clone())
17958 }
17959
17960 /// Retrieves the list of UrlMap resources available to the specified
17961 /// project.
17962 pub fn list(&self) -> super::builder::url_maps::List {
17963 super::builder::url_maps::List::new(self.inner.clone())
17964 }
17965
17966 /// Patches the specified UrlMap resource with the data included in the
17967 /// request. This method supportsPATCH
17968 /// semantics and uses theJSON merge
17969 /// patch format and processing rules.
17970 pub fn patch(&self) -> super::builder::url_maps::Patch {
17971 super::builder::url_maps::Patch::new(self.inner.clone())
17972 }
17973
17974 /// Returns permissions that a caller has on the specified resource.
17975 pub fn test_iam_permissions(&self) -> super::builder::url_maps::TestIamPermissions {
17976 super::builder::url_maps::TestIamPermissions::new(self.inner.clone())
17977 }
17978
17979 /// Updates the specified UrlMap resource with the data included in the
17980 /// request.
17981 pub fn update(&self) -> super::builder::url_maps::Update {
17982 super::builder::url_maps::Update::new(self.inner.clone())
17983 }
17984
17985 /// Runs static validation for the UrlMap. In particular, the tests of the
17986 /// provided UrlMap will be run. Calling this method does NOT create the
17987 /// UrlMap.
17988 pub fn validate(&self) -> super::builder::url_maps::Validate {
17989 super::builder::url_maps::Validate::new(self.inner.clone())
17990 }
17991
17992 /// Retrieves the specified Operations resource.
17993 pub fn get_operation(&self) -> super::builder::url_maps::GetOperation {
17994 super::builder::url_maps::GetOperation::new(self.inner.clone())
17995 }
17996}
17997
17998/// Implements a client for the Google Compute Engine API.
17999///
18000/// # Example
18001/// ```
18002/// # async fn sample() -> gax::client_builder::Result<()> {
18003/// # use google_cloud_compute_v1::client::VpnGateways;
18004/// let client = VpnGateways::builder().build().await?;
18005/// // use `client` to make requests to the Google Compute Engine API.
18006/// # Ok(()) }
18007/// ```
18008///
18009/// # Service Description
18010///
18011/// Service for the `vpnGateways` resource.
18012///
18013/// # Configuration
18014///
18015/// To configure `VpnGateways` use the `with_*` methods in the type returned
18016/// by [builder()][VpnGateways::builder]. The default configuration should
18017/// work for most applications. Common configuration changes include
18018///
18019/// * [with_endpoint()]: by default this client uses the global default endpoint
18020/// (`https://compute.googleapis.com`). Applications using regional
18021/// endpoints or running in restricted networks (e.g. a network configured
18022// with [Private Google Access with VPC Service Controls]) may want to
18023/// override this default.
18024/// * [with_credentials()]: by default this client uses
18025/// [Application Default Credentials]. Applications using custom
18026/// authentication may need to override this default.
18027///
18028/// [with_endpoint()]: super::builder::vpn_gateways::ClientBuilder::with_endpoint
18029/// [with_credentials()]: super::builder::vpn_gateways::ClientBuilder::credentials
18030/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18031/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18032///
18033/// # Pooling and Cloning
18034///
18035/// `VpnGateways` holds a connection pool internally, it is advised to
18036/// create one and the reuse it. You do not need to wrap `VpnGateways` in
18037/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18038/// already uses an `Arc` internally.
18039#[cfg(feature = "vpn-gateways")]
18040#[cfg_attr(docsrs, doc(cfg(feature = "vpn-gateways")))]
18041#[derive(Clone, Debug)]
18042pub struct VpnGateways {
18043 inner: std::sync::Arc<dyn super::stub::dynamic::VpnGateways>,
18044}
18045
18046#[cfg(feature = "vpn-gateways")]
18047impl VpnGateways {
18048 /// Returns a builder for [VpnGateways].
18049 ///
18050 /// ```
18051 /// # async fn sample() -> gax::client_builder::Result<()> {
18052 /// # use google_cloud_compute_v1::client::VpnGateways;
18053 /// let client = VpnGateways::builder().build().await?;
18054 /// # Ok(()) }
18055 /// ```
18056 pub fn builder() -> super::builder::vpn_gateways::ClientBuilder {
18057 gax::client_builder::internal::new_builder(super::builder::vpn_gateways::client::Factory)
18058 }
18059
18060 /// Creates a new client from the provided stub.
18061 ///
18062 /// The most common case for calling this function is in tests mocking the
18063 /// client's behavior.
18064 pub fn from_stub<T>(stub: T) -> Self
18065 where
18066 T: super::stub::VpnGateways + 'static,
18067 {
18068 Self {
18069 inner: std::sync::Arc::new(stub),
18070 }
18071 }
18072
18073 pub(crate) async fn new(
18074 config: gaxi::options::ClientConfig,
18075 ) -> gax::client_builder::Result<Self> {
18076 let inner = Self::build_inner(config).await?;
18077 Ok(Self { inner })
18078 }
18079
18080 async fn build_inner(
18081 conf: gaxi::options::ClientConfig,
18082 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::VpnGateways>> {
18083 if gaxi::options::tracing_enabled(&conf) {
18084 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18085 }
18086 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18087 }
18088
18089 async fn build_transport(
18090 conf: gaxi::options::ClientConfig,
18091 ) -> gax::client_builder::Result<impl super::stub::VpnGateways> {
18092 super::transport::VpnGateways::new(conf).await
18093 }
18094
18095 async fn build_with_tracing(
18096 conf: gaxi::options::ClientConfig,
18097 ) -> gax::client_builder::Result<impl super::stub::VpnGateways> {
18098 Self::build_transport(conf)
18099 .await
18100 .map(super::tracing::VpnGateways::new)
18101 }
18102
18103 /// Retrieves an aggregated list of VPN gateways.
18104 ///
18105 /// To prevent failure, Google recommends that you set the
18106 /// `returnPartialSuccess` parameter to `true`.
18107 pub fn aggregated_list(&self) -> super::builder::vpn_gateways::AggregatedList {
18108 super::builder::vpn_gateways::AggregatedList::new(self.inner.clone())
18109 }
18110
18111 /// Deletes the specified VPN gateway.
18112 pub fn delete(&self) -> super::builder::vpn_gateways::Delete {
18113 super::builder::vpn_gateways::Delete::new(self.inner.clone())
18114 }
18115
18116 /// Returns the specified VPN gateway.
18117 pub fn get(&self) -> super::builder::vpn_gateways::Get {
18118 super::builder::vpn_gateways::Get::new(self.inner.clone())
18119 }
18120
18121 /// Returns the status for the specified VPN gateway.
18122 pub fn get_status(&self) -> super::builder::vpn_gateways::GetStatus {
18123 super::builder::vpn_gateways::GetStatus::new(self.inner.clone())
18124 }
18125
18126 /// Creates a VPN gateway in the specified project and region using
18127 /// the data included in the request.
18128 pub fn insert(&self) -> super::builder::vpn_gateways::Insert {
18129 super::builder::vpn_gateways::Insert::new(self.inner.clone())
18130 }
18131
18132 /// Retrieves a list of VPN gateways available to the specified
18133 /// project and region.
18134 pub fn list(&self) -> super::builder::vpn_gateways::List {
18135 super::builder::vpn_gateways::List::new(self.inner.clone())
18136 }
18137
18138 /// Sets the labels on a VpnGateway. To learn more about labels, read theLabeling
18139 /// Resources documentation.
18140 pub fn set_labels(&self) -> super::builder::vpn_gateways::SetLabels {
18141 super::builder::vpn_gateways::SetLabels::new(self.inner.clone())
18142 }
18143
18144 /// Returns permissions that a caller has on the specified resource.
18145 pub fn test_iam_permissions(&self) -> super::builder::vpn_gateways::TestIamPermissions {
18146 super::builder::vpn_gateways::TestIamPermissions::new(self.inner.clone())
18147 }
18148
18149 /// Retrieves the specified region-specific Operations resource.
18150 pub fn get_operation(&self) -> super::builder::vpn_gateways::GetOperation {
18151 super::builder::vpn_gateways::GetOperation::new(self.inner.clone())
18152 }
18153}
18154
18155/// Implements a client for the Google Compute Engine API.
18156///
18157/// # Example
18158/// ```
18159/// # async fn sample() -> gax::client_builder::Result<()> {
18160/// # use google_cloud_compute_v1::client::VpnTunnels;
18161/// let client = VpnTunnels::builder().build().await?;
18162/// // use `client` to make requests to the Google Compute Engine API.
18163/// # Ok(()) }
18164/// ```
18165///
18166/// # Service Description
18167///
18168/// Service for the `vpnTunnels` resource.
18169///
18170/// # Configuration
18171///
18172/// To configure `VpnTunnels` use the `with_*` methods in the type returned
18173/// by [builder()][VpnTunnels::builder]. The default configuration should
18174/// work for most applications. Common configuration changes include
18175///
18176/// * [with_endpoint()]: by default this client uses the global default endpoint
18177/// (`https://compute.googleapis.com`). Applications using regional
18178/// endpoints or running in restricted networks (e.g. a network configured
18179// with [Private Google Access with VPC Service Controls]) may want to
18180/// override this default.
18181/// * [with_credentials()]: by default this client uses
18182/// [Application Default Credentials]. Applications using custom
18183/// authentication may need to override this default.
18184///
18185/// [with_endpoint()]: super::builder::vpn_tunnels::ClientBuilder::with_endpoint
18186/// [with_credentials()]: super::builder::vpn_tunnels::ClientBuilder::credentials
18187/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18188/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18189///
18190/// # Pooling and Cloning
18191///
18192/// `VpnTunnels` holds a connection pool internally, it is advised to
18193/// create one and the reuse it. You do not need to wrap `VpnTunnels` in
18194/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18195/// already uses an `Arc` internally.
18196#[cfg(feature = "vpn-tunnels")]
18197#[cfg_attr(docsrs, doc(cfg(feature = "vpn-tunnels")))]
18198#[derive(Clone, Debug)]
18199pub struct VpnTunnels {
18200 inner: std::sync::Arc<dyn super::stub::dynamic::VpnTunnels>,
18201}
18202
18203#[cfg(feature = "vpn-tunnels")]
18204impl VpnTunnels {
18205 /// Returns a builder for [VpnTunnels].
18206 ///
18207 /// ```
18208 /// # async fn sample() -> gax::client_builder::Result<()> {
18209 /// # use google_cloud_compute_v1::client::VpnTunnels;
18210 /// let client = VpnTunnels::builder().build().await?;
18211 /// # Ok(()) }
18212 /// ```
18213 pub fn builder() -> super::builder::vpn_tunnels::ClientBuilder {
18214 gax::client_builder::internal::new_builder(super::builder::vpn_tunnels::client::Factory)
18215 }
18216
18217 /// Creates a new client from the provided stub.
18218 ///
18219 /// The most common case for calling this function is in tests mocking the
18220 /// client's behavior.
18221 pub fn from_stub<T>(stub: T) -> Self
18222 where
18223 T: super::stub::VpnTunnels + 'static,
18224 {
18225 Self {
18226 inner: std::sync::Arc::new(stub),
18227 }
18228 }
18229
18230 pub(crate) async fn new(
18231 config: gaxi::options::ClientConfig,
18232 ) -> gax::client_builder::Result<Self> {
18233 let inner = Self::build_inner(config).await?;
18234 Ok(Self { inner })
18235 }
18236
18237 async fn build_inner(
18238 conf: gaxi::options::ClientConfig,
18239 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::VpnTunnels>> {
18240 if gaxi::options::tracing_enabled(&conf) {
18241 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18242 }
18243 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18244 }
18245
18246 async fn build_transport(
18247 conf: gaxi::options::ClientConfig,
18248 ) -> gax::client_builder::Result<impl super::stub::VpnTunnels> {
18249 super::transport::VpnTunnels::new(conf).await
18250 }
18251
18252 async fn build_with_tracing(
18253 conf: gaxi::options::ClientConfig,
18254 ) -> gax::client_builder::Result<impl super::stub::VpnTunnels> {
18255 Self::build_transport(conf)
18256 .await
18257 .map(super::tracing::VpnTunnels::new)
18258 }
18259
18260 /// Retrieves an aggregated list of VPN tunnels.
18261 ///
18262 /// To prevent failure, Google recommends that you set the
18263 /// `returnPartialSuccess` parameter to `true`.
18264 pub fn aggregated_list(&self) -> super::builder::vpn_tunnels::AggregatedList {
18265 super::builder::vpn_tunnels::AggregatedList::new(self.inner.clone())
18266 }
18267
18268 /// Deletes the specified VpnTunnel resource.
18269 pub fn delete(&self) -> super::builder::vpn_tunnels::Delete {
18270 super::builder::vpn_tunnels::Delete::new(self.inner.clone())
18271 }
18272
18273 /// Returns the specified VpnTunnel resource.
18274 pub fn get(&self) -> super::builder::vpn_tunnels::Get {
18275 super::builder::vpn_tunnels::Get::new(self.inner.clone())
18276 }
18277
18278 /// Creates a VpnTunnel resource in the specified project and region using
18279 /// the data included in the request.
18280 pub fn insert(&self) -> super::builder::vpn_tunnels::Insert {
18281 super::builder::vpn_tunnels::Insert::new(self.inner.clone())
18282 }
18283
18284 /// Retrieves a list of VpnTunnel resources contained in the specified
18285 /// project and region.
18286 pub fn list(&self) -> super::builder::vpn_tunnels::List {
18287 super::builder::vpn_tunnels::List::new(self.inner.clone())
18288 }
18289
18290 /// Sets the labels on a VpnTunnel. To learn more about labels, read theLabeling
18291 /// Resources documentation.
18292 pub fn set_labels(&self) -> super::builder::vpn_tunnels::SetLabels {
18293 super::builder::vpn_tunnels::SetLabels::new(self.inner.clone())
18294 }
18295
18296 /// Retrieves the specified region-specific Operations resource.
18297 pub fn get_operation(&self) -> super::builder::vpn_tunnels::GetOperation {
18298 super::builder::vpn_tunnels::GetOperation::new(self.inner.clone())
18299 }
18300}
18301
18302/// Implements a client for the Google Compute Engine API.
18303///
18304/// # Example
18305/// ```
18306/// # async fn sample() -> gax::client_builder::Result<()> {
18307/// # use google_cloud_compute_v1::client::WireGroups;
18308/// let client = WireGroups::builder().build().await?;
18309/// // use `client` to make requests to the Google Compute Engine API.
18310/// # Ok(()) }
18311/// ```
18312///
18313/// # Service Description
18314///
18315/// Service for the `wireGroups` resource.
18316///
18317/// # Configuration
18318///
18319/// To configure `WireGroups` use the `with_*` methods in the type returned
18320/// by [builder()][WireGroups::builder]. The default configuration should
18321/// work for most applications. Common configuration changes include
18322///
18323/// * [with_endpoint()]: by default this client uses the global default endpoint
18324/// (`https://compute.googleapis.com`). Applications using regional
18325/// endpoints or running in restricted networks (e.g. a network configured
18326// with [Private Google Access with VPC Service Controls]) may want to
18327/// override this default.
18328/// * [with_credentials()]: by default this client uses
18329/// [Application Default Credentials]. Applications using custom
18330/// authentication may need to override this default.
18331///
18332/// [with_endpoint()]: super::builder::wire_groups::ClientBuilder::with_endpoint
18333/// [with_credentials()]: super::builder::wire_groups::ClientBuilder::credentials
18334/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18335/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18336///
18337/// # Pooling and Cloning
18338///
18339/// `WireGroups` holds a connection pool internally, it is advised to
18340/// create one and the reuse it. You do not need to wrap `WireGroups` in
18341/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18342/// already uses an `Arc` internally.
18343#[cfg(feature = "wire-groups")]
18344#[cfg_attr(docsrs, doc(cfg(feature = "wire-groups")))]
18345#[derive(Clone, Debug)]
18346pub struct WireGroups {
18347 inner: std::sync::Arc<dyn super::stub::dynamic::WireGroups>,
18348}
18349
18350#[cfg(feature = "wire-groups")]
18351impl WireGroups {
18352 /// Returns a builder for [WireGroups].
18353 ///
18354 /// ```
18355 /// # async fn sample() -> gax::client_builder::Result<()> {
18356 /// # use google_cloud_compute_v1::client::WireGroups;
18357 /// let client = WireGroups::builder().build().await?;
18358 /// # Ok(()) }
18359 /// ```
18360 pub fn builder() -> super::builder::wire_groups::ClientBuilder {
18361 gax::client_builder::internal::new_builder(super::builder::wire_groups::client::Factory)
18362 }
18363
18364 /// Creates a new client from the provided stub.
18365 ///
18366 /// The most common case for calling this function is in tests mocking the
18367 /// client's behavior.
18368 pub fn from_stub<T>(stub: T) -> Self
18369 where
18370 T: super::stub::WireGroups + 'static,
18371 {
18372 Self {
18373 inner: std::sync::Arc::new(stub),
18374 }
18375 }
18376
18377 pub(crate) async fn new(
18378 config: gaxi::options::ClientConfig,
18379 ) -> gax::client_builder::Result<Self> {
18380 let inner = Self::build_inner(config).await?;
18381 Ok(Self { inner })
18382 }
18383
18384 async fn build_inner(
18385 conf: gaxi::options::ClientConfig,
18386 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::WireGroups>> {
18387 if gaxi::options::tracing_enabled(&conf) {
18388 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18389 }
18390 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18391 }
18392
18393 async fn build_transport(
18394 conf: gaxi::options::ClientConfig,
18395 ) -> gax::client_builder::Result<impl super::stub::WireGroups> {
18396 super::transport::WireGroups::new(conf).await
18397 }
18398
18399 async fn build_with_tracing(
18400 conf: gaxi::options::ClientConfig,
18401 ) -> gax::client_builder::Result<impl super::stub::WireGroups> {
18402 Self::build_transport(conf)
18403 .await
18404 .map(super::tracing::WireGroups::new)
18405 }
18406
18407 /// Deletes the specified wire group in the given scope.
18408 pub fn delete(&self) -> super::builder::wire_groups::Delete {
18409 super::builder::wire_groups::Delete::new(self.inner.clone())
18410 }
18411
18412 /// Gets the specified wire group resource in the given scope.
18413 pub fn get(&self) -> super::builder::wire_groups::Get {
18414 super::builder::wire_groups::Get::new(self.inner.clone())
18415 }
18416
18417 /// Creates a wire group in the specified project in the given scope
18418 /// using the parameters that are included in the request.
18419 pub fn insert(&self) -> super::builder::wire_groups::Insert {
18420 super::builder::wire_groups::Insert::new(self.inner.clone())
18421 }
18422
18423 /// Lists the wire groups for a project in the given scope.
18424 pub fn list(&self) -> super::builder::wire_groups::List {
18425 super::builder::wire_groups::List::new(self.inner.clone())
18426 }
18427
18428 /// Updates the specified wire group resource with the data included in the
18429 /// request. This method supportsPATCH
18430 /// semantics and usesJSON merge
18431 /// patch format and processing rules.
18432 pub fn patch(&self) -> super::builder::wire_groups::Patch {
18433 super::builder::wire_groups::Patch::new(self.inner.clone())
18434 }
18435
18436 /// Retrieves the specified Operations resource.
18437 pub fn get_operation(&self) -> super::builder::wire_groups::GetOperation {
18438 super::builder::wire_groups::GetOperation::new(self.inner.clone())
18439 }
18440}
18441
18442/// Implements a client for the Google Compute Engine API.
18443///
18444/// # Example
18445/// ```
18446/// # async fn sample() -> gax::client_builder::Result<()> {
18447/// # use google_cloud_compute_v1::client::ZoneOperations;
18448/// let client = ZoneOperations::builder().build().await?;
18449/// // use `client` to make requests to the Google Compute Engine API.
18450/// # Ok(()) }
18451/// ```
18452///
18453/// # Service Description
18454///
18455/// Service for the `zoneOperations` resource.
18456///
18457/// # Configuration
18458///
18459/// To configure `ZoneOperations` use the `with_*` methods in the type returned
18460/// by [builder()][ZoneOperations::builder]. The default configuration should
18461/// work for most applications. Common configuration changes include
18462///
18463/// * [with_endpoint()]: by default this client uses the global default endpoint
18464/// (`https://compute.googleapis.com`). Applications using regional
18465/// endpoints or running in restricted networks (e.g. a network configured
18466// with [Private Google Access with VPC Service Controls]) may want to
18467/// override this default.
18468/// * [with_credentials()]: by default this client uses
18469/// [Application Default Credentials]. Applications using custom
18470/// authentication may need to override this default.
18471///
18472/// [with_endpoint()]: super::builder::zone_operations::ClientBuilder::with_endpoint
18473/// [with_credentials()]: super::builder::zone_operations::ClientBuilder::credentials
18474/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18475/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18476///
18477/// # Pooling and Cloning
18478///
18479/// `ZoneOperations` holds a connection pool internally, it is advised to
18480/// create one and the reuse it. You do not need to wrap `ZoneOperations` in
18481/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18482/// already uses an `Arc` internally.
18483#[cfg(feature = "zone-operations")]
18484#[cfg_attr(docsrs, doc(cfg(feature = "zone-operations")))]
18485#[derive(Clone, Debug)]
18486pub struct ZoneOperations {
18487 inner: std::sync::Arc<dyn super::stub::dynamic::ZoneOperations>,
18488}
18489
18490#[cfg(feature = "zone-operations")]
18491impl ZoneOperations {
18492 /// Returns a builder for [ZoneOperations].
18493 ///
18494 /// ```
18495 /// # async fn sample() -> gax::client_builder::Result<()> {
18496 /// # use google_cloud_compute_v1::client::ZoneOperations;
18497 /// let client = ZoneOperations::builder().build().await?;
18498 /// # Ok(()) }
18499 /// ```
18500 pub fn builder() -> super::builder::zone_operations::ClientBuilder {
18501 gax::client_builder::internal::new_builder(super::builder::zone_operations::client::Factory)
18502 }
18503
18504 /// Creates a new client from the provided stub.
18505 ///
18506 /// The most common case for calling this function is in tests mocking the
18507 /// client's behavior.
18508 pub fn from_stub<T>(stub: T) -> Self
18509 where
18510 T: super::stub::ZoneOperations + 'static,
18511 {
18512 Self {
18513 inner: std::sync::Arc::new(stub),
18514 }
18515 }
18516
18517 pub(crate) async fn new(
18518 config: gaxi::options::ClientConfig,
18519 ) -> gax::client_builder::Result<Self> {
18520 let inner = Self::build_inner(config).await?;
18521 Ok(Self { inner })
18522 }
18523
18524 async fn build_inner(
18525 conf: gaxi::options::ClientConfig,
18526 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::ZoneOperations>> {
18527 if gaxi::options::tracing_enabled(&conf) {
18528 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18529 }
18530 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18531 }
18532
18533 async fn build_transport(
18534 conf: gaxi::options::ClientConfig,
18535 ) -> gax::client_builder::Result<impl super::stub::ZoneOperations> {
18536 super::transport::ZoneOperations::new(conf).await
18537 }
18538
18539 async fn build_with_tracing(
18540 conf: gaxi::options::ClientConfig,
18541 ) -> gax::client_builder::Result<impl super::stub::ZoneOperations> {
18542 Self::build_transport(conf)
18543 .await
18544 .map(super::tracing::ZoneOperations::new)
18545 }
18546
18547 /// Deletes the specified zone-specific Operations resource.
18548 pub fn delete(&self) -> super::builder::zone_operations::Delete {
18549 super::builder::zone_operations::Delete::new(self.inner.clone())
18550 }
18551
18552 /// Retrieves the specified zone-specific Operations resource.
18553 pub fn get(&self) -> super::builder::zone_operations::Get {
18554 super::builder::zone_operations::Get::new(self.inner.clone())
18555 }
18556
18557 /// Retrieves a list of Operation resources contained within
18558 /// the specified zone.
18559 pub fn list(&self) -> super::builder::zone_operations::List {
18560 super::builder::zone_operations::List::new(self.inner.clone())
18561 }
18562
18563 /// Waits for the specified Operation resource to return as `DONE`
18564 /// or for the request to approach the 2 minute deadline, and retrieves the
18565 /// specified Operation resource. This method waits for no more than the
18566 /// 2 minutes and then returns the current state of the
18567 /// operation, which might be `DONE` or still in progress.
18568 ///
18569 /// This method is called on a best-effort basis. Specifically:
18570 ///
18571 /// ```norust
18572 /// - In uncommon cases, when the server is overloaded, the request might
18573 /// return before the default deadline is reached, or might return after zero
18574 /// seconds.
18575 /// ```
18576 ///
18577 /// - If the default deadline is reached, there is no guarantee that the
18578 /// operation is actually done when the method returns. Be prepared to retry
18579 /// if the operation is not `DONE`.
18580 pub fn wait(&self) -> super::builder::zone_operations::Wait {
18581 super::builder::zone_operations::Wait::new(self.inner.clone())
18582 }
18583}
18584
18585/// Implements a client for the Google Compute Engine API.
18586///
18587/// # Example
18588/// ```
18589/// # async fn sample() -> gax::client_builder::Result<()> {
18590/// # use google_cloud_compute_v1::client::Zones;
18591/// let client = Zones::builder().build().await?;
18592/// // use `client` to make requests to the Google Compute Engine API.
18593/// # Ok(()) }
18594/// ```
18595///
18596/// # Service Description
18597///
18598/// Service for the `zones` resource.
18599///
18600/// # Configuration
18601///
18602/// To configure `Zones` use the `with_*` methods in the type returned
18603/// by [builder()][Zones::builder]. The default configuration should
18604/// work for most applications. Common configuration changes include
18605///
18606/// * [with_endpoint()]: by default this client uses the global default endpoint
18607/// (`https://compute.googleapis.com`). Applications using regional
18608/// endpoints or running in restricted networks (e.g. a network configured
18609// with [Private Google Access with VPC Service Controls]) may want to
18610/// override this default.
18611/// * [with_credentials()]: by default this client uses
18612/// [Application Default Credentials]. Applications using custom
18613/// authentication may need to override this default.
18614///
18615/// [with_endpoint()]: super::builder::zones::ClientBuilder::with_endpoint
18616/// [with_credentials()]: super::builder::zones::ClientBuilder::credentials
18617/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18618/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18619///
18620/// # Pooling and Cloning
18621///
18622/// `Zones` holds a connection pool internally, it is advised to
18623/// create one and the reuse it. You do not need to wrap `Zones` in
18624/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18625/// already uses an `Arc` internally.
18626#[cfg(feature = "zones")]
18627#[cfg_attr(docsrs, doc(cfg(feature = "zones")))]
18628#[derive(Clone, Debug)]
18629pub struct Zones {
18630 inner: std::sync::Arc<dyn super::stub::dynamic::Zones>,
18631}
18632
18633#[cfg(feature = "zones")]
18634impl Zones {
18635 /// Returns a builder for [Zones].
18636 ///
18637 /// ```
18638 /// # async fn sample() -> gax::client_builder::Result<()> {
18639 /// # use google_cloud_compute_v1::client::Zones;
18640 /// let client = Zones::builder().build().await?;
18641 /// # Ok(()) }
18642 /// ```
18643 pub fn builder() -> super::builder::zones::ClientBuilder {
18644 gax::client_builder::internal::new_builder(super::builder::zones::client::Factory)
18645 }
18646
18647 /// Creates a new client from the provided stub.
18648 ///
18649 /// The most common case for calling this function is in tests mocking the
18650 /// client's behavior.
18651 pub fn from_stub<T>(stub: T) -> Self
18652 where
18653 T: super::stub::Zones + 'static,
18654 {
18655 Self {
18656 inner: std::sync::Arc::new(stub),
18657 }
18658 }
18659
18660 pub(crate) async fn new(
18661 config: gaxi::options::ClientConfig,
18662 ) -> gax::client_builder::Result<Self> {
18663 let inner = Self::build_inner(config).await?;
18664 Ok(Self { inner })
18665 }
18666
18667 async fn build_inner(
18668 conf: gaxi::options::ClientConfig,
18669 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Zones>> {
18670 if gaxi::options::tracing_enabled(&conf) {
18671 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18672 }
18673 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18674 }
18675
18676 async fn build_transport(
18677 conf: gaxi::options::ClientConfig,
18678 ) -> gax::client_builder::Result<impl super::stub::Zones> {
18679 super::transport::Zones::new(conf).await
18680 }
18681
18682 async fn build_with_tracing(
18683 conf: gaxi::options::ClientConfig,
18684 ) -> gax::client_builder::Result<impl super::stub::Zones> {
18685 Self::build_transport(conf)
18686 .await
18687 .map(super::tracing::Zones::new)
18688 }
18689
18690 /// Returns the specified Zone resource.
18691 pub fn get(&self) -> super::builder::zones::Get {
18692 super::builder::zones::Get::new(self.inner.clone())
18693 }
18694
18695 /// Retrieves the list of Zone resources available to the specified project.
18696 pub fn list(&self) -> super::builder::zones::List {
18697 super::builder::zones::List::new(self.inner.clone())
18698 }
18699}