google_cloud_compute_v1/client.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16#![allow(rustdoc::bare_urls)]
17#![allow(rustdoc::broken_intra_doc_links)]
18#![allow(rustdoc::redundant_explicit_links)]
19
20/// Implements a client for the Google Compute Engine API.
21///
22/// # Example
23/// ```
24/// # use google_cloud_compute_v1::client::AcceleratorTypes;
25/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
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::with_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 reuse it. You do not need to wrap `AcceleratorTypes` in
59/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
60/// already uses an `Arc` internally.
61#[cfg(feature = "accelerator-types")]
62#[cfg_attr(docsrs, doc(cfg(feature = "accelerator-types")))]
63#[derive(Clone, Debug)]
64pub struct AcceleratorTypes {
65 inner: std::sync::Arc<dyn super::stub::dynamic::AcceleratorTypes>,
66}
67
68#[cfg(feature = "accelerator-types")]
69impl AcceleratorTypes {
70 /// Returns a builder for [AcceleratorTypes].
71 ///
72 /// ```
73 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
74 /// # use google_cloud_compute_v1::client::AcceleratorTypes;
75 /// let client = AcceleratorTypes::builder().build().await?;
76 /// # Ok(()) }
77 /// ```
78 pub fn builder() -> super::builder::accelerator_types::ClientBuilder {
79 crate::new_client_builder(super::builder::accelerator_types::client::Factory)
80 }
81
82 /// Creates a new client from the provided stub.
83 ///
84 /// The most common case for calling this function is in tests mocking the
85 /// client's behavior.
86 pub fn from_stub<T>(stub: T) -> Self
87 where
88 T: super::stub::AcceleratorTypes + 'static,
89 {
90 Self {
91 inner: std::sync::Arc::new(stub),
92 }
93 }
94
95 pub(crate) async fn new(
96 config: gaxi::options::ClientConfig,
97 ) -> crate::ClientBuilderResult<Self> {
98 let inner = Self::build_inner(config).await?;
99 Ok(Self { inner })
100 }
101
102 async fn build_inner(
103 conf: gaxi::options::ClientConfig,
104 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::AcceleratorTypes>>
105 {
106 if gaxi::options::tracing_enabled(&conf) {
107 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
108 }
109 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
110 }
111
112 async fn build_transport(
113 conf: gaxi::options::ClientConfig,
114 ) -> crate::ClientBuilderResult<impl super::stub::AcceleratorTypes> {
115 super::transport::AcceleratorTypes::new(conf).await
116 }
117
118 async fn build_with_tracing(
119 conf: gaxi::options::ClientConfig,
120 ) -> crate::ClientBuilderResult<impl super::stub::AcceleratorTypes> {
121 Self::build_transport(conf)
122 .await
123 .map(super::tracing::AcceleratorTypes::new)
124 }
125
126 /// Retrieves an aggregated list of accelerator types.
127 ///
128 /// To prevent failure, it is recommended that you set the
129 /// `returnPartialSuccess` parameter to `true`.
130 pub fn aggregated_list(&self) -> super::builder::accelerator_types::AggregatedList {
131 super::builder::accelerator_types::AggregatedList::new(self.inner.clone())
132 }
133
134 /// Returns the specified accelerator type.
135 pub fn get(&self) -> super::builder::accelerator_types::Get {
136 super::builder::accelerator_types::Get::new(self.inner.clone())
137 }
138
139 /// Retrieves a list of accelerator types that are available to the specified
140 /// project.
141 pub fn list(&self) -> super::builder::accelerator_types::List {
142 super::builder::accelerator_types::List::new(self.inner.clone())
143 }
144}
145
146/// Implements a client for the Google Compute Engine API.
147///
148/// # Example
149/// ```
150/// # use google_cloud_compute_v1::client::Addresses;
151/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
152/// let client = Addresses::builder().build().await?;
153/// // use `client` to make requests to the Google Compute Engine API.
154/// # Ok(()) }
155/// ```
156///
157/// # Service Description
158///
159/// Service for the `addresses` resource.
160///
161/// # Configuration
162///
163/// To configure `Addresses` use the `with_*` methods in the type returned
164/// by [builder()][Addresses::builder]. The default configuration should
165/// work for most applications. Common configuration changes include
166///
167/// * [with_endpoint()]: by default this client uses the global default endpoint
168/// (`https://compute.googleapis.com`). Applications using regional
169/// endpoints or running in restricted networks (e.g. a network configured
170// with [Private Google Access with VPC Service Controls]) may want to
171/// override this default.
172/// * [with_credentials()]: by default this client uses
173/// [Application Default Credentials]. Applications using custom
174/// authentication may need to override this default.
175///
176/// [with_endpoint()]: super::builder::addresses::ClientBuilder::with_endpoint
177/// [with_credentials()]: super::builder::addresses::ClientBuilder::with_credentials
178/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
179/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
180///
181/// # Pooling and Cloning
182///
183/// `Addresses` holds a connection pool internally, it is advised to
184/// create one and reuse it. You do not need to wrap `Addresses` in
185/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
186/// already uses an `Arc` internally.
187#[cfg(feature = "addresses")]
188#[cfg_attr(docsrs, doc(cfg(feature = "addresses")))]
189#[derive(Clone, Debug)]
190pub struct Addresses {
191 inner: std::sync::Arc<dyn super::stub::dynamic::Addresses>,
192}
193
194#[cfg(feature = "addresses")]
195impl Addresses {
196 /// Returns a builder for [Addresses].
197 ///
198 /// ```
199 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
200 /// # use google_cloud_compute_v1::client::Addresses;
201 /// let client = Addresses::builder().build().await?;
202 /// # Ok(()) }
203 /// ```
204 pub fn builder() -> super::builder::addresses::ClientBuilder {
205 crate::new_client_builder(super::builder::addresses::client::Factory)
206 }
207
208 /// Creates a new client from the provided stub.
209 ///
210 /// The most common case for calling this function is in tests mocking the
211 /// client's behavior.
212 pub fn from_stub<T>(stub: T) -> Self
213 where
214 T: super::stub::Addresses + 'static,
215 {
216 Self {
217 inner: std::sync::Arc::new(stub),
218 }
219 }
220
221 pub(crate) async fn new(
222 config: gaxi::options::ClientConfig,
223 ) -> crate::ClientBuilderResult<Self> {
224 let inner = Self::build_inner(config).await?;
225 Ok(Self { inner })
226 }
227
228 async fn build_inner(
229 conf: gaxi::options::ClientConfig,
230 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Addresses>> {
231 if gaxi::options::tracing_enabled(&conf) {
232 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
233 }
234 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
235 }
236
237 async fn build_transport(
238 conf: gaxi::options::ClientConfig,
239 ) -> crate::ClientBuilderResult<impl super::stub::Addresses> {
240 super::transport::Addresses::new(conf).await
241 }
242
243 async fn build_with_tracing(
244 conf: gaxi::options::ClientConfig,
245 ) -> crate::ClientBuilderResult<impl super::stub::Addresses> {
246 Self::build_transport(conf)
247 .await
248 .map(super::tracing::Addresses::new)
249 }
250
251 /// Retrieves an aggregated list of addresses.
252 ///
253 /// To prevent failure, it is recommended that you set the
254 /// `returnPartialSuccess` parameter to `true`.
255 pub fn aggregated_list(&self) -> super::builder::addresses::AggregatedList {
256 super::builder::addresses::AggregatedList::new(self.inner.clone())
257 }
258
259 /// Deletes the specified address resource.
260 pub fn delete(&self) -> super::builder::addresses::Delete {
261 super::builder::addresses::Delete::new(self.inner.clone())
262 }
263
264 /// Returns the specified address resource.
265 pub fn get(&self) -> super::builder::addresses::Get {
266 super::builder::addresses::Get::new(self.inner.clone())
267 }
268
269 /// Creates an address resource in the specified project by using the data
270 /// included in the request.
271 pub fn insert(&self) -> super::builder::addresses::Insert {
272 super::builder::addresses::Insert::new(self.inner.clone())
273 }
274
275 /// Retrieves a list of addresses contained within
276 /// the specified region.
277 pub fn list(&self) -> super::builder::addresses::List {
278 super::builder::addresses::List::new(self.inner.clone())
279 }
280
281 /// Moves the specified address resource.
282 pub fn r#move(&self) -> super::builder::addresses::Move {
283 super::builder::addresses::Move::new(self.inner.clone())
284 }
285
286 /// Sets the labels on an Address. To learn more about labels, read theLabeling
287 /// Resources documentation.
288 pub fn set_labels(&self) -> super::builder::addresses::SetLabels {
289 super::builder::addresses::SetLabels::new(self.inner.clone())
290 }
291
292 /// Returns permissions that a caller has on the specified resource.
293 pub fn test_iam_permissions(&self) -> super::builder::addresses::TestIamPermissions {
294 super::builder::addresses::TestIamPermissions::new(self.inner.clone())
295 }
296
297 /// Retrieves the specified region-specific Operations resource.
298 pub fn get_operation(&self) -> super::builder::addresses::GetOperation {
299 super::builder::addresses::GetOperation::new(self.inner.clone())
300 }
301}
302
303/// Implements a client for the Google Compute Engine API.
304///
305/// # Example
306/// ```
307/// # use google_cloud_compute_v1::client::Advice;
308/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
309/// let client = Advice::builder().build().await?;
310/// // use `client` to make requests to the Google Compute Engine API.
311/// # Ok(()) }
312/// ```
313///
314/// # Service Description
315///
316/// Service for the `advice` resource.
317///
318/// # Configuration
319///
320/// To configure `Advice` use the `with_*` methods in the type returned
321/// by [builder()][Advice::builder]. The default configuration should
322/// work for most applications. Common configuration changes include
323///
324/// * [with_endpoint()]: by default this client uses the global default endpoint
325/// (`https://compute.googleapis.com`). Applications using regional
326/// endpoints or running in restricted networks (e.g. a network configured
327// with [Private Google Access with VPC Service Controls]) may want to
328/// override this default.
329/// * [with_credentials()]: by default this client uses
330/// [Application Default Credentials]. Applications using custom
331/// authentication may need to override this default.
332///
333/// [with_endpoint()]: super::builder::advice::ClientBuilder::with_endpoint
334/// [with_credentials()]: super::builder::advice::ClientBuilder::with_credentials
335/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
336/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
337///
338/// # Pooling and Cloning
339///
340/// `Advice` holds a connection pool internally, it is advised to
341/// create one and reuse it. You do not need to wrap `Advice` in
342/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
343/// already uses an `Arc` internally.
344#[cfg(feature = "advice")]
345#[cfg_attr(docsrs, doc(cfg(feature = "advice")))]
346#[derive(Clone, Debug)]
347pub struct Advice {
348 inner: std::sync::Arc<dyn super::stub::dynamic::Advice>,
349}
350
351#[cfg(feature = "advice")]
352impl Advice {
353 /// Returns a builder for [Advice].
354 ///
355 /// ```
356 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
357 /// # use google_cloud_compute_v1::client::Advice;
358 /// let client = Advice::builder().build().await?;
359 /// # Ok(()) }
360 /// ```
361 pub fn builder() -> super::builder::advice::ClientBuilder {
362 crate::new_client_builder(super::builder::advice::client::Factory)
363 }
364
365 /// Creates a new client from the provided stub.
366 ///
367 /// The most common case for calling this function is in tests mocking the
368 /// client's behavior.
369 pub fn from_stub<T>(stub: T) -> Self
370 where
371 T: super::stub::Advice + 'static,
372 {
373 Self {
374 inner: std::sync::Arc::new(stub),
375 }
376 }
377
378 pub(crate) async fn new(
379 config: gaxi::options::ClientConfig,
380 ) -> crate::ClientBuilderResult<Self> {
381 let inner = Self::build_inner(config).await?;
382 Ok(Self { inner })
383 }
384
385 async fn build_inner(
386 conf: gaxi::options::ClientConfig,
387 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Advice>> {
388 if gaxi::options::tracing_enabled(&conf) {
389 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
390 }
391 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
392 }
393
394 async fn build_transport(
395 conf: gaxi::options::ClientConfig,
396 ) -> crate::ClientBuilderResult<impl super::stub::Advice> {
397 super::transport::Advice::new(conf).await
398 }
399
400 async fn build_with_tracing(
401 conf: gaxi::options::ClientConfig,
402 ) -> crate::ClientBuilderResult<impl super::stub::Advice> {
403 Self::build_transport(conf)
404 .await
405 .map(super::tracing::Advice::new)
406 }
407
408 /// Advise how, where and when to create the requested amount of instances
409 /// with specified accelerators, within the specified time and location limits.
410 /// The method recommends creating future reservations for the requested
411 /// resources.
412 pub fn calendar_mode(&self) -> super::builder::advice::CalendarMode {
413 super::builder::advice::CalendarMode::new(self.inner.clone())
414 }
415}
416
417/// Implements a client for the Google Compute Engine API.
418///
419/// # Example
420/// ```
421/// # use google_cloud_compute_v1::client::Autoscalers;
422/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
423/// let client = Autoscalers::builder().build().await?;
424/// // use `client` to make requests to the Google Compute Engine API.
425/// # Ok(()) }
426/// ```
427///
428/// # Service Description
429///
430/// Service for the `autoscalers` resource.
431///
432/// # Configuration
433///
434/// To configure `Autoscalers` use the `with_*` methods in the type returned
435/// by [builder()][Autoscalers::builder]. The default configuration should
436/// work for most applications. Common configuration changes include
437///
438/// * [with_endpoint()]: by default this client uses the global default endpoint
439/// (`https://compute.googleapis.com`). Applications using regional
440/// endpoints or running in restricted networks (e.g. a network configured
441// with [Private Google Access with VPC Service Controls]) may want to
442/// override this default.
443/// * [with_credentials()]: by default this client uses
444/// [Application Default Credentials]. Applications using custom
445/// authentication may need to override this default.
446///
447/// [with_endpoint()]: super::builder::autoscalers::ClientBuilder::with_endpoint
448/// [with_credentials()]: super::builder::autoscalers::ClientBuilder::with_credentials
449/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
450/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
451///
452/// # Pooling and Cloning
453///
454/// `Autoscalers` holds a connection pool internally, it is advised to
455/// create one and reuse it. You do not need to wrap `Autoscalers` in
456/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
457/// already uses an `Arc` internally.
458#[cfg(feature = "autoscalers")]
459#[cfg_attr(docsrs, doc(cfg(feature = "autoscalers")))]
460#[derive(Clone, Debug)]
461pub struct Autoscalers {
462 inner: std::sync::Arc<dyn super::stub::dynamic::Autoscalers>,
463}
464
465#[cfg(feature = "autoscalers")]
466impl Autoscalers {
467 /// Returns a builder for [Autoscalers].
468 ///
469 /// ```
470 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
471 /// # use google_cloud_compute_v1::client::Autoscalers;
472 /// let client = Autoscalers::builder().build().await?;
473 /// # Ok(()) }
474 /// ```
475 pub fn builder() -> super::builder::autoscalers::ClientBuilder {
476 crate::new_client_builder(super::builder::autoscalers::client::Factory)
477 }
478
479 /// Creates a new client from the provided stub.
480 ///
481 /// The most common case for calling this function is in tests mocking the
482 /// client's behavior.
483 pub fn from_stub<T>(stub: T) -> Self
484 where
485 T: super::stub::Autoscalers + 'static,
486 {
487 Self {
488 inner: std::sync::Arc::new(stub),
489 }
490 }
491
492 pub(crate) async fn new(
493 config: gaxi::options::ClientConfig,
494 ) -> crate::ClientBuilderResult<Self> {
495 let inner = Self::build_inner(config).await?;
496 Ok(Self { inner })
497 }
498
499 async fn build_inner(
500 conf: gaxi::options::ClientConfig,
501 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Autoscalers>> {
502 if gaxi::options::tracing_enabled(&conf) {
503 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
504 }
505 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
506 }
507
508 async fn build_transport(
509 conf: gaxi::options::ClientConfig,
510 ) -> crate::ClientBuilderResult<impl super::stub::Autoscalers> {
511 super::transport::Autoscalers::new(conf).await
512 }
513
514 async fn build_with_tracing(
515 conf: gaxi::options::ClientConfig,
516 ) -> crate::ClientBuilderResult<impl super::stub::Autoscalers> {
517 Self::build_transport(conf)
518 .await
519 .map(super::tracing::Autoscalers::new)
520 }
521
522 /// Retrieves an aggregated list of autoscalers.
523 ///
524 /// To prevent failure, it is recommended that you set the
525 /// `returnPartialSuccess` parameter to `true`.
526 pub fn aggregated_list(&self) -> super::builder::autoscalers::AggregatedList {
527 super::builder::autoscalers::AggregatedList::new(self.inner.clone())
528 }
529
530 /// Deletes the specified autoscaler.
531 pub fn delete(&self) -> super::builder::autoscalers::Delete {
532 super::builder::autoscalers::Delete::new(self.inner.clone())
533 }
534
535 /// Returns the specified autoscaler resource.
536 pub fn get(&self) -> super::builder::autoscalers::Get {
537 super::builder::autoscalers::Get::new(self.inner.clone())
538 }
539
540 /// Creates an autoscaler in the specified project using the data
541 /// included in the request.
542 pub fn insert(&self) -> super::builder::autoscalers::Insert {
543 super::builder::autoscalers::Insert::new(self.inner.clone())
544 }
545
546 /// Retrieves a list of autoscalers contained within
547 /// the specified zone.
548 pub fn list(&self) -> super::builder::autoscalers::List {
549 super::builder::autoscalers::List::new(self.inner.clone())
550 }
551
552 /// Updates an autoscaler in the specified project using the data
553 /// included in the request. This method supportsPATCH
554 /// semantics and uses theJSON merge
555 /// patch format and processing rules.
556 pub fn patch(&self) -> super::builder::autoscalers::Patch {
557 super::builder::autoscalers::Patch::new(self.inner.clone())
558 }
559
560 /// Returns permissions that a caller has on the specified resource.
561 pub fn test_iam_permissions(&self) -> super::builder::autoscalers::TestIamPermissions {
562 super::builder::autoscalers::TestIamPermissions::new(self.inner.clone())
563 }
564
565 /// Updates an autoscaler in the specified project using the data
566 /// included in the request.
567 pub fn update(&self) -> super::builder::autoscalers::Update {
568 super::builder::autoscalers::Update::new(self.inner.clone())
569 }
570
571 /// Retrieves the specified zone-specific Operations resource.
572 pub fn get_operation(&self) -> super::builder::autoscalers::GetOperation {
573 super::builder::autoscalers::GetOperation::new(self.inner.clone())
574 }
575}
576
577/// Implements a client for the Google Compute Engine API.
578///
579/// # Example
580/// ```
581/// # use google_cloud_compute_v1::client::BackendBuckets;
582/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
583/// let client = BackendBuckets::builder().build().await?;
584/// // use `client` to make requests to the Google Compute Engine API.
585/// # Ok(()) }
586/// ```
587///
588/// # Service Description
589///
590/// Service for the `backendBuckets` resource.
591///
592/// # Configuration
593///
594/// To configure `BackendBuckets` use the `with_*` methods in the type returned
595/// by [builder()][BackendBuckets::builder]. The default configuration should
596/// work for most applications. Common configuration changes include
597///
598/// * [with_endpoint()]: by default this client uses the global default endpoint
599/// (`https://compute.googleapis.com`). Applications using regional
600/// endpoints or running in restricted networks (e.g. a network configured
601// with [Private Google Access with VPC Service Controls]) may want to
602/// override this default.
603/// * [with_credentials()]: by default this client uses
604/// [Application Default Credentials]. Applications using custom
605/// authentication may need to override this default.
606///
607/// [with_endpoint()]: super::builder::backend_buckets::ClientBuilder::with_endpoint
608/// [with_credentials()]: super::builder::backend_buckets::ClientBuilder::with_credentials
609/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
610/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
611///
612/// # Pooling and Cloning
613///
614/// `BackendBuckets` holds a connection pool internally, it is advised to
615/// create one and reuse it. You do not need to wrap `BackendBuckets` in
616/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
617/// already uses an `Arc` internally.
618#[cfg(feature = "backend-buckets")]
619#[cfg_attr(docsrs, doc(cfg(feature = "backend-buckets")))]
620#[derive(Clone, Debug)]
621pub struct BackendBuckets {
622 inner: std::sync::Arc<dyn super::stub::dynamic::BackendBuckets>,
623}
624
625#[cfg(feature = "backend-buckets")]
626impl BackendBuckets {
627 /// Returns a builder for [BackendBuckets].
628 ///
629 /// ```
630 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
631 /// # use google_cloud_compute_v1::client::BackendBuckets;
632 /// let client = BackendBuckets::builder().build().await?;
633 /// # Ok(()) }
634 /// ```
635 pub fn builder() -> super::builder::backend_buckets::ClientBuilder {
636 crate::new_client_builder(super::builder::backend_buckets::client::Factory)
637 }
638
639 /// Creates a new client from the provided stub.
640 ///
641 /// The most common case for calling this function is in tests mocking the
642 /// client's behavior.
643 pub fn from_stub<T>(stub: T) -> Self
644 where
645 T: super::stub::BackendBuckets + 'static,
646 {
647 Self {
648 inner: std::sync::Arc::new(stub),
649 }
650 }
651
652 pub(crate) async fn new(
653 config: gaxi::options::ClientConfig,
654 ) -> crate::ClientBuilderResult<Self> {
655 let inner = Self::build_inner(config).await?;
656 Ok(Self { inner })
657 }
658
659 async fn build_inner(
660 conf: gaxi::options::ClientConfig,
661 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::BackendBuckets>> {
662 if gaxi::options::tracing_enabled(&conf) {
663 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
664 }
665 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
666 }
667
668 async fn build_transport(
669 conf: gaxi::options::ClientConfig,
670 ) -> crate::ClientBuilderResult<impl super::stub::BackendBuckets> {
671 super::transport::BackendBuckets::new(conf).await
672 }
673
674 async fn build_with_tracing(
675 conf: gaxi::options::ClientConfig,
676 ) -> crate::ClientBuilderResult<impl super::stub::BackendBuckets> {
677 Self::build_transport(conf)
678 .await
679 .map(super::tracing::BackendBuckets::new)
680 }
681
682 /// Adds a key for validating requests with signed URLs for this backend
683 /// bucket.
684 pub fn add_signed_url_key(&self) -> super::builder::backend_buckets::AddSignedUrlKey {
685 super::builder::backend_buckets::AddSignedUrlKey::new(self.inner.clone())
686 }
687
688 /// Deletes the specified BackendBucket resource.
689 pub fn delete(&self) -> super::builder::backend_buckets::Delete {
690 super::builder::backend_buckets::Delete::new(self.inner.clone())
691 }
692
693 /// Deletes a key for validating requests with signed URLs for this backend
694 /// bucket.
695 pub fn delete_signed_url_key(&self) -> super::builder::backend_buckets::DeleteSignedUrlKey {
696 super::builder::backend_buckets::DeleteSignedUrlKey::new(self.inner.clone())
697 }
698
699 /// Returns the specified BackendBucket resource.
700 pub fn get(&self) -> super::builder::backend_buckets::Get {
701 super::builder::backend_buckets::Get::new(self.inner.clone())
702 }
703
704 /// Gets the access control policy for a resource. May be empty if no such
705 /// policy or resource exists.
706 pub fn get_iam_policy(&self) -> super::builder::backend_buckets::GetIamPolicy {
707 super::builder::backend_buckets::GetIamPolicy::new(self.inner.clone())
708 }
709
710 /// Creates a BackendBucket resource in the specified project using
711 /// the data included in the request.
712 pub fn insert(&self) -> super::builder::backend_buckets::Insert {
713 super::builder::backend_buckets::Insert::new(self.inner.clone())
714 }
715
716 /// Retrieves the list of BackendBucket resources available to the specified
717 /// project.
718 pub fn list(&self) -> super::builder::backend_buckets::List {
719 super::builder::backend_buckets::List::new(self.inner.clone())
720 }
721
722 /// Updates the specified BackendBucket resource with the data included in the
723 /// request. This method supportsPATCH
724 /// semantics and uses theJSON merge
725 /// patch format and processing rules.
726 pub fn patch(&self) -> super::builder::backend_buckets::Patch {
727 super::builder::backend_buckets::Patch::new(self.inner.clone())
728 }
729
730 /// Sets the edge security policy for the specified backend bucket.
731 pub fn set_edge_security_policy(
732 &self,
733 ) -> super::builder::backend_buckets::SetEdgeSecurityPolicy {
734 super::builder::backend_buckets::SetEdgeSecurityPolicy::new(self.inner.clone())
735 }
736
737 /// Sets the access control policy on the specified resource.
738 /// Replaces any existing policy.
739 pub fn set_iam_policy(&self) -> super::builder::backend_buckets::SetIamPolicy {
740 super::builder::backend_buckets::SetIamPolicy::new(self.inner.clone())
741 }
742
743 /// Returns permissions that a caller has on the specified resource.
744 pub fn test_iam_permissions(&self) -> super::builder::backend_buckets::TestIamPermissions {
745 super::builder::backend_buckets::TestIamPermissions::new(self.inner.clone())
746 }
747
748 /// Updates the specified BackendBucket resource with the data included in the
749 /// request.
750 pub fn update(&self) -> super::builder::backend_buckets::Update {
751 super::builder::backend_buckets::Update::new(self.inner.clone())
752 }
753
754 /// Retrieves the specified Operations resource.
755 pub fn get_operation(&self) -> super::builder::backend_buckets::GetOperation {
756 super::builder::backend_buckets::GetOperation::new(self.inner.clone())
757 }
758}
759
760/// Implements a client for the Google Compute Engine API.
761///
762/// # Example
763/// ```
764/// # use google_cloud_compute_v1::client::BackendServices;
765/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
766/// let client = BackendServices::builder().build().await?;
767/// // use `client` to make requests to the Google Compute Engine API.
768/// # Ok(()) }
769/// ```
770///
771/// # Service Description
772///
773/// Service for the `backendServices` resource.
774///
775/// # Configuration
776///
777/// To configure `BackendServices` use the `with_*` methods in the type returned
778/// by [builder()][BackendServices::builder]. The default configuration should
779/// work for most applications. Common configuration changes include
780///
781/// * [with_endpoint()]: by default this client uses the global default endpoint
782/// (`https://compute.googleapis.com`). Applications using regional
783/// endpoints or running in restricted networks (e.g. a network configured
784// with [Private Google Access with VPC Service Controls]) may want to
785/// override this default.
786/// * [with_credentials()]: by default this client uses
787/// [Application Default Credentials]. Applications using custom
788/// authentication may need to override this default.
789///
790/// [with_endpoint()]: super::builder::backend_services::ClientBuilder::with_endpoint
791/// [with_credentials()]: super::builder::backend_services::ClientBuilder::with_credentials
792/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
793/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
794///
795/// # Pooling and Cloning
796///
797/// `BackendServices` holds a connection pool internally, it is advised to
798/// create one and reuse it. You do not need to wrap `BackendServices` in
799/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
800/// already uses an `Arc` internally.
801#[cfg(feature = "backend-services")]
802#[cfg_attr(docsrs, doc(cfg(feature = "backend-services")))]
803#[derive(Clone, Debug)]
804pub struct BackendServices {
805 inner: std::sync::Arc<dyn super::stub::dynamic::BackendServices>,
806}
807
808#[cfg(feature = "backend-services")]
809impl BackendServices {
810 /// Returns a builder for [BackendServices].
811 ///
812 /// ```
813 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
814 /// # use google_cloud_compute_v1::client::BackendServices;
815 /// let client = BackendServices::builder().build().await?;
816 /// # Ok(()) }
817 /// ```
818 pub fn builder() -> super::builder::backend_services::ClientBuilder {
819 crate::new_client_builder(super::builder::backend_services::client::Factory)
820 }
821
822 /// Creates a new client from the provided stub.
823 ///
824 /// The most common case for calling this function is in tests mocking the
825 /// client's behavior.
826 pub fn from_stub<T>(stub: T) -> Self
827 where
828 T: super::stub::BackendServices + 'static,
829 {
830 Self {
831 inner: std::sync::Arc::new(stub),
832 }
833 }
834
835 pub(crate) async fn new(
836 config: gaxi::options::ClientConfig,
837 ) -> crate::ClientBuilderResult<Self> {
838 let inner = Self::build_inner(config).await?;
839 Ok(Self { inner })
840 }
841
842 async fn build_inner(
843 conf: gaxi::options::ClientConfig,
844 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::BackendServices>> {
845 if gaxi::options::tracing_enabled(&conf) {
846 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
847 }
848 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
849 }
850
851 async fn build_transport(
852 conf: gaxi::options::ClientConfig,
853 ) -> crate::ClientBuilderResult<impl super::stub::BackendServices> {
854 super::transport::BackendServices::new(conf).await
855 }
856
857 async fn build_with_tracing(
858 conf: gaxi::options::ClientConfig,
859 ) -> crate::ClientBuilderResult<impl super::stub::BackendServices> {
860 Self::build_transport(conf)
861 .await
862 .map(super::tracing::BackendServices::new)
863 }
864
865 /// Adds a key for validating requests with signed URLs for this backend
866 /// service.
867 pub fn add_signed_url_key(&self) -> super::builder::backend_services::AddSignedUrlKey {
868 super::builder::backend_services::AddSignedUrlKey::new(self.inner.clone())
869 }
870
871 /// Retrieves the list of all BackendService resources, regional and global,
872 /// available to the specified project.
873 ///
874 /// To prevent failure, it is recommended that you set the
875 /// `returnPartialSuccess` parameter to `true`.
876 pub fn aggregated_list(&self) -> super::builder::backend_services::AggregatedList {
877 super::builder::backend_services::AggregatedList::new(self.inner.clone())
878 }
879
880 /// Deletes the specified BackendService resource.
881 pub fn delete(&self) -> super::builder::backend_services::Delete {
882 super::builder::backend_services::Delete::new(self.inner.clone())
883 }
884
885 /// Deletes a key for validating requests with signed URLs for this backend
886 /// service.
887 pub fn delete_signed_url_key(&self) -> super::builder::backend_services::DeleteSignedUrlKey {
888 super::builder::backend_services::DeleteSignedUrlKey::new(self.inner.clone())
889 }
890
891 /// Returns the specified BackendService resource.
892 pub fn get(&self) -> super::builder::backend_services::Get {
893 super::builder::backend_services::Get::new(self.inner.clone())
894 }
895
896 /// Returns effective security policies applied to this backend service.
897 pub fn get_effective_security_policies(
898 &self,
899 ) -> super::builder::backend_services::GetEffectiveSecurityPolicies {
900 super::builder::backend_services::GetEffectiveSecurityPolicies::new(self.inner.clone())
901 }
902
903 /// Gets the most recent health check results for this
904 /// BackendService.
905 ///
906 /// Example request body:
907 ///
908 /// {
909 /// "group": "/zones/us-east1-b/instanceGroups/lb-backend-example"
910 /// }
911 pub fn get_health(&self) -> super::builder::backend_services::GetHealth {
912 super::builder::backend_services::GetHealth::new(self.inner.clone())
913 }
914
915 /// Gets the access control policy for a resource. May be empty if no such
916 /// policy or resource exists.
917 pub fn get_iam_policy(&self) -> super::builder::backend_services::GetIamPolicy {
918 super::builder::backend_services::GetIamPolicy::new(self.inner.clone())
919 }
920
921 /// Creates a BackendService resource in the specified project using
922 /// the data included in the request. For more information, see
923 /// Backend services overview.
924 pub fn insert(&self) -> super::builder::backend_services::Insert {
925 super::builder::backend_services::Insert::new(self.inner.clone())
926 }
927
928 /// Retrieves the list of BackendService resources available to the specified
929 /// project.
930 pub fn list(&self) -> super::builder::backend_services::List {
931 super::builder::backend_services::List::new(self.inner.clone())
932 }
933
934 /// Retrieves a list of all usable backend services in the specified project.
935 pub fn list_usable(&self) -> super::builder::backend_services::ListUsable {
936 super::builder::backend_services::ListUsable::new(self.inner.clone())
937 }
938
939 /// Patches the specified BackendService resource with the data included in the
940 /// request. For more information, see
941 /// Backend services overview. This method
942 /// supports PATCH semantics and uses the JSON merge
943 /// patch format and processing rules.
944 pub fn patch(&self) -> super::builder::backend_services::Patch {
945 super::builder::backend_services::Patch::new(self.inner.clone())
946 }
947
948 /// Sets the edge security policy for the specified backend service.
949 pub fn set_edge_security_policy(
950 &self,
951 ) -> super::builder::backend_services::SetEdgeSecurityPolicy {
952 super::builder::backend_services::SetEdgeSecurityPolicy::new(self.inner.clone())
953 }
954
955 /// Sets the access control policy on the specified resource.
956 /// Replaces any existing policy.
957 pub fn set_iam_policy(&self) -> super::builder::backend_services::SetIamPolicy {
958 super::builder::backend_services::SetIamPolicy::new(self.inner.clone())
959 }
960
961 /// Sets the Google Cloud Armor security policy for the specified backend
962 /// service. For more information, seeGoogle
963 /// Cloud Armor Overview
964 pub fn set_security_policy(&self) -> super::builder::backend_services::SetSecurityPolicy {
965 super::builder::backend_services::SetSecurityPolicy::new(self.inner.clone())
966 }
967
968 /// Returns permissions that a caller has on the specified resource.
969 pub fn test_iam_permissions(&self) -> super::builder::backend_services::TestIamPermissions {
970 super::builder::backend_services::TestIamPermissions::new(self.inner.clone())
971 }
972
973 /// Updates the specified BackendService resource with the data included in the
974 /// request. For more information, seeBackend
975 /// services overview.
976 pub fn update(&self) -> super::builder::backend_services::Update {
977 super::builder::backend_services::Update::new(self.inner.clone())
978 }
979
980 /// Retrieves the specified Operations resource.
981 pub fn get_operation(&self) -> super::builder::backend_services::GetOperation {
982 super::builder::backend_services::GetOperation::new(self.inner.clone())
983 }
984}
985
986/// Implements a client for the Google Compute Engine API.
987///
988/// # Example
989/// ```
990/// # use google_cloud_compute_v1::client::CrossSiteNetworks;
991/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
992/// let client = CrossSiteNetworks::builder().build().await?;
993/// // use `client` to make requests to the Google Compute Engine API.
994/// # Ok(()) }
995/// ```
996///
997/// # Service Description
998///
999/// Service for the `crossSiteNetworks` resource.
1000///
1001/// # Configuration
1002///
1003/// To configure `CrossSiteNetworks` use the `with_*` methods in the type returned
1004/// by [builder()][CrossSiteNetworks::builder]. The default configuration should
1005/// work for most applications. Common configuration changes include
1006///
1007/// * [with_endpoint()]: by default this client uses the global default endpoint
1008/// (`https://compute.googleapis.com`). Applications using regional
1009/// endpoints or running in restricted networks (e.g. a network configured
1010// with [Private Google Access with VPC Service Controls]) may want to
1011/// override this default.
1012/// * [with_credentials()]: by default this client uses
1013/// [Application Default Credentials]. Applications using custom
1014/// authentication may need to override this default.
1015///
1016/// [with_endpoint()]: super::builder::cross_site_networks::ClientBuilder::with_endpoint
1017/// [with_credentials()]: super::builder::cross_site_networks::ClientBuilder::with_credentials
1018/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1019/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1020///
1021/// # Pooling and Cloning
1022///
1023/// `CrossSiteNetworks` holds a connection pool internally, it is advised to
1024/// create one and reuse it. You do not need to wrap `CrossSiteNetworks` in
1025/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1026/// already uses an `Arc` internally.
1027#[cfg(feature = "cross-site-networks")]
1028#[cfg_attr(docsrs, doc(cfg(feature = "cross-site-networks")))]
1029#[derive(Clone, Debug)]
1030pub struct CrossSiteNetworks {
1031 inner: std::sync::Arc<dyn super::stub::dynamic::CrossSiteNetworks>,
1032}
1033
1034#[cfg(feature = "cross-site-networks")]
1035impl CrossSiteNetworks {
1036 /// Returns a builder for [CrossSiteNetworks].
1037 ///
1038 /// ```
1039 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1040 /// # use google_cloud_compute_v1::client::CrossSiteNetworks;
1041 /// let client = CrossSiteNetworks::builder().build().await?;
1042 /// # Ok(()) }
1043 /// ```
1044 pub fn builder() -> super::builder::cross_site_networks::ClientBuilder {
1045 crate::new_client_builder(super::builder::cross_site_networks::client::Factory)
1046 }
1047
1048 /// Creates a new client from the provided stub.
1049 ///
1050 /// The most common case for calling this function is in tests mocking the
1051 /// client's behavior.
1052 pub fn from_stub<T>(stub: T) -> Self
1053 where
1054 T: super::stub::CrossSiteNetworks + 'static,
1055 {
1056 Self {
1057 inner: std::sync::Arc::new(stub),
1058 }
1059 }
1060
1061 pub(crate) async fn new(
1062 config: gaxi::options::ClientConfig,
1063 ) -> crate::ClientBuilderResult<Self> {
1064 let inner = Self::build_inner(config).await?;
1065 Ok(Self { inner })
1066 }
1067
1068 async fn build_inner(
1069 conf: gaxi::options::ClientConfig,
1070 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::CrossSiteNetworks>>
1071 {
1072 if gaxi::options::tracing_enabled(&conf) {
1073 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1074 }
1075 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1076 }
1077
1078 async fn build_transport(
1079 conf: gaxi::options::ClientConfig,
1080 ) -> crate::ClientBuilderResult<impl super::stub::CrossSiteNetworks> {
1081 super::transport::CrossSiteNetworks::new(conf).await
1082 }
1083
1084 async fn build_with_tracing(
1085 conf: gaxi::options::ClientConfig,
1086 ) -> crate::ClientBuilderResult<impl super::stub::CrossSiteNetworks> {
1087 Self::build_transport(conf)
1088 .await
1089 .map(super::tracing::CrossSiteNetworks::new)
1090 }
1091
1092 /// Deletes the specified cross-site network in the given scope.
1093 pub fn delete(&self) -> super::builder::cross_site_networks::Delete {
1094 super::builder::cross_site_networks::Delete::new(self.inner.clone())
1095 }
1096
1097 /// Returns the specified cross-site network in the given scope.
1098 pub fn get(&self) -> super::builder::cross_site_networks::Get {
1099 super::builder::cross_site_networks::Get::new(self.inner.clone())
1100 }
1101
1102 /// Creates a cross-site network in the specified project in the given scope
1103 /// using the parameters that are included in the request.
1104 pub fn insert(&self) -> super::builder::cross_site_networks::Insert {
1105 super::builder::cross_site_networks::Insert::new(self.inner.clone())
1106 }
1107
1108 /// Lists the cross-site networks for a project in the given scope.
1109 pub fn list(&self) -> super::builder::cross_site_networks::List {
1110 super::builder::cross_site_networks::List::new(self.inner.clone())
1111 }
1112
1113 /// Updates the specified cross-site network with the data included in
1114 /// the request. This method supportsPATCH
1115 /// semantics and uses theJSON merge
1116 /// patch format and processing rules.
1117 pub fn patch(&self) -> super::builder::cross_site_networks::Patch {
1118 super::builder::cross_site_networks::Patch::new(self.inner.clone())
1119 }
1120
1121 /// Retrieves the specified Operations resource.
1122 pub fn get_operation(&self) -> super::builder::cross_site_networks::GetOperation {
1123 super::builder::cross_site_networks::GetOperation::new(self.inner.clone())
1124 }
1125}
1126
1127/// Implements a client for the Google Compute Engine API.
1128///
1129/// # Example
1130/// ```
1131/// # use google_cloud_compute_v1::client::DiskTypes;
1132/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
1133/// let client = DiskTypes::builder().build().await?;
1134/// // use `client` to make requests to the Google Compute Engine API.
1135/// # Ok(()) }
1136/// ```
1137///
1138/// # Service Description
1139///
1140/// Service for the `diskTypes` resource.
1141///
1142/// # Configuration
1143///
1144/// To configure `DiskTypes` use the `with_*` methods in the type returned
1145/// by [builder()][DiskTypes::builder]. The default configuration should
1146/// work for most applications. Common configuration changes include
1147///
1148/// * [with_endpoint()]: by default this client uses the global default endpoint
1149/// (`https://compute.googleapis.com`). Applications using regional
1150/// endpoints or running in restricted networks (e.g. a network configured
1151// with [Private Google Access with VPC Service Controls]) may want to
1152/// override this default.
1153/// * [with_credentials()]: by default this client uses
1154/// [Application Default Credentials]. Applications using custom
1155/// authentication may need to override this default.
1156///
1157/// [with_endpoint()]: super::builder::disk_types::ClientBuilder::with_endpoint
1158/// [with_credentials()]: super::builder::disk_types::ClientBuilder::with_credentials
1159/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1160/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1161///
1162/// # Pooling and Cloning
1163///
1164/// `DiskTypes` holds a connection pool internally, it is advised to
1165/// create one and reuse it. You do not need to wrap `DiskTypes` in
1166/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1167/// already uses an `Arc` internally.
1168#[cfg(feature = "disk-types")]
1169#[cfg_attr(docsrs, doc(cfg(feature = "disk-types")))]
1170#[derive(Clone, Debug)]
1171pub struct DiskTypes {
1172 inner: std::sync::Arc<dyn super::stub::dynamic::DiskTypes>,
1173}
1174
1175#[cfg(feature = "disk-types")]
1176impl DiskTypes {
1177 /// Returns a builder for [DiskTypes].
1178 ///
1179 /// ```
1180 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1181 /// # use google_cloud_compute_v1::client::DiskTypes;
1182 /// let client = DiskTypes::builder().build().await?;
1183 /// # Ok(()) }
1184 /// ```
1185 pub fn builder() -> super::builder::disk_types::ClientBuilder {
1186 crate::new_client_builder(super::builder::disk_types::client::Factory)
1187 }
1188
1189 /// Creates a new client from the provided stub.
1190 ///
1191 /// The most common case for calling this function is in tests mocking the
1192 /// client's behavior.
1193 pub fn from_stub<T>(stub: T) -> Self
1194 where
1195 T: super::stub::DiskTypes + 'static,
1196 {
1197 Self {
1198 inner: std::sync::Arc::new(stub),
1199 }
1200 }
1201
1202 pub(crate) async fn new(
1203 config: gaxi::options::ClientConfig,
1204 ) -> crate::ClientBuilderResult<Self> {
1205 let inner = Self::build_inner(config).await?;
1206 Ok(Self { inner })
1207 }
1208
1209 async fn build_inner(
1210 conf: gaxi::options::ClientConfig,
1211 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::DiskTypes>> {
1212 if gaxi::options::tracing_enabled(&conf) {
1213 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1214 }
1215 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1216 }
1217
1218 async fn build_transport(
1219 conf: gaxi::options::ClientConfig,
1220 ) -> crate::ClientBuilderResult<impl super::stub::DiskTypes> {
1221 super::transport::DiskTypes::new(conf).await
1222 }
1223
1224 async fn build_with_tracing(
1225 conf: gaxi::options::ClientConfig,
1226 ) -> crate::ClientBuilderResult<impl super::stub::DiskTypes> {
1227 Self::build_transport(conf)
1228 .await
1229 .map(super::tracing::DiskTypes::new)
1230 }
1231
1232 /// Retrieves an aggregated list of disk types.
1233 ///
1234 /// To prevent failure, it is recommended that you set the
1235 /// `returnPartialSuccess` parameter to `true`.
1236 pub fn aggregated_list(&self) -> super::builder::disk_types::AggregatedList {
1237 super::builder::disk_types::AggregatedList::new(self.inner.clone())
1238 }
1239
1240 /// Returns the specified disk type.
1241 pub fn get(&self) -> super::builder::disk_types::Get {
1242 super::builder::disk_types::Get::new(self.inner.clone())
1243 }
1244
1245 /// Retrieves a list of disk types available to the specified
1246 /// project.
1247 pub fn list(&self) -> super::builder::disk_types::List {
1248 super::builder::disk_types::List::new(self.inner.clone())
1249 }
1250}
1251
1252/// Implements a client for the Google Compute Engine API.
1253///
1254/// # Example
1255/// ```
1256/// # use google_cloud_compute_v1::client::Disks;
1257/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
1258/// let client = Disks::builder().build().await?;
1259/// // use `client` to make requests to the Google Compute Engine API.
1260/// # Ok(()) }
1261/// ```
1262///
1263/// # Service Description
1264///
1265/// Service for the `disks` resource.
1266///
1267/// # Configuration
1268///
1269/// To configure `Disks` use the `with_*` methods in the type returned
1270/// by [builder()][Disks::builder]. The default configuration should
1271/// work for most applications. Common configuration changes include
1272///
1273/// * [with_endpoint()]: by default this client uses the global default endpoint
1274/// (`https://compute.googleapis.com`). Applications using regional
1275/// endpoints or running in restricted networks (e.g. a network configured
1276// with [Private Google Access with VPC Service Controls]) may want to
1277/// override this default.
1278/// * [with_credentials()]: by default this client uses
1279/// [Application Default Credentials]. Applications using custom
1280/// authentication may need to override this default.
1281///
1282/// [with_endpoint()]: super::builder::disks::ClientBuilder::with_endpoint
1283/// [with_credentials()]: super::builder::disks::ClientBuilder::with_credentials
1284/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1285/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1286///
1287/// # Pooling and Cloning
1288///
1289/// `Disks` holds a connection pool internally, it is advised to
1290/// create one and reuse it. You do not need to wrap `Disks` in
1291/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1292/// already uses an `Arc` internally.
1293#[cfg(feature = "disks")]
1294#[cfg_attr(docsrs, doc(cfg(feature = "disks")))]
1295#[derive(Clone, Debug)]
1296pub struct Disks {
1297 inner: std::sync::Arc<dyn super::stub::dynamic::Disks>,
1298}
1299
1300#[cfg(feature = "disks")]
1301impl Disks {
1302 /// Returns a builder for [Disks].
1303 ///
1304 /// ```
1305 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1306 /// # use google_cloud_compute_v1::client::Disks;
1307 /// let client = Disks::builder().build().await?;
1308 /// # Ok(()) }
1309 /// ```
1310 pub fn builder() -> super::builder::disks::ClientBuilder {
1311 crate::new_client_builder(super::builder::disks::client::Factory)
1312 }
1313
1314 /// Creates a new client from the provided stub.
1315 ///
1316 /// The most common case for calling this function is in tests mocking the
1317 /// client's behavior.
1318 pub fn from_stub<T>(stub: T) -> Self
1319 where
1320 T: super::stub::Disks + 'static,
1321 {
1322 Self {
1323 inner: std::sync::Arc::new(stub),
1324 }
1325 }
1326
1327 pub(crate) async fn new(
1328 config: gaxi::options::ClientConfig,
1329 ) -> crate::ClientBuilderResult<Self> {
1330 let inner = Self::build_inner(config).await?;
1331 Ok(Self { inner })
1332 }
1333
1334 async fn build_inner(
1335 conf: gaxi::options::ClientConfig,
1336 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Disks>> {
1337 if gaxi::options::tracing_enabled(&conf) {
1338 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1339 }
1340 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1341 }
1342
1343 async fn build_transport(
1344 conf: gaxi::options::ClientConfig,
1345 ) -> crate::ClientBuilderResult<impl super::stub::Disks> {
1346 super::transport::Disks::new(conf).await
1347 }
1348
1349 async fn build_with_tracing(
1350 conf: gaxi::options::ClientConfig,
1351 ) -> crate::ClientBuilderResult<impl super::stub::Disks> {
1352 Self::build_transport(conf)
1353 .await
1354 .map(super::tracing::Disks::new)
1355 }
1356
1357 /// Adds existing resource policies to a disk. You can only add one
1358 /// policy which will be applied to this disk for scheduling snapshot
1359 /// creation.
1360 pub fn add_resource_policies(&self) -> super::builder::disks::AddResourcePolicies {
1361 super::builder::disks::AddResourcePolicies::new(self.inner.clone())
1362 }
1363
1364 /// Retrieves an aggregated list of persistent disks.
1365 ///
1366 /// To prevent failure, it is recommended that you set the
1367 /// `returnPartialSuccess` parameter to `true`.
1368 pub fn aggregated_list(&self) -> super::builder::disks::AggregatedList {
1369 super::builder::disks::AggregatedList::new(self.inner.clone())
1370 }
1371
1372 /// Bulk create a set of disks.
1373 pub fn bulk_insert(&self) -> super::builder::disks::BulkInsert {
1374 super::builder::disks::BulkInsert::new(self.inner.clone())
1375 }
1376
1377 /// Sets the labels on many disks at once. To learn more about labels, read theLabeling
1378 /// Resources documentation.
1379 pub fn bulk_set_labels(&self) -> super::builder::disks::BulkSetLabels {
1380 super::builder::disks::BulkSetLabels::new(self.inner.clone())
1381 }
1382
1383 /// Creates a snapshot of a specified persistent disk. For regular snapshot
1384 /// creation, consider using snapshots.insert
1385 /// instead, as that method supports more features, such as creating snapshots
1386 /// in a project different from the source disk project.
1387 pub fn create_snapshot(&self) -> super::builder::disks::CreateSnapshot {
1388 super::builder::disks::CreateSnapshot::new(self.inner.clone())
1389 }
1390
1391 /// Deletes the specified persistent disk. Deleting a disk removes its data
1392 /// permanently and is irreversible. However, deleting a disk does not
1393 /// delete any snapshots
1394 /// previously made from the disk. You must separatelydelete
1395 /// snapshots.
1396 pub fn delete(&self) -> super::builder::disks::Delete {
1397 super::builder::disks::Delete::new(self.inner.clone())
1398 }
1399
1400 /// Returns the specified persistent disk.
1401 pub fn get(&self) -> super::builder::disks::Get {
1402 super::builder::disks::Get::new(self.inner.clone())
1403 }
1404
1405 /// Gets the access control policy for a resource. May be empty if no such
1406 /// policy or resource exists.
1407 pub fn get_iam_policy(&self) -> super::builder::disks::GetIamPolicy {
1408 super::builder::disks::GetIamPolicy::new(self.inner.clone())
1409 }
1410
1411 /// Creates a persistent disk in the specified project using the data
1412 /// in the request. You can create a disk from a source
1413 /// (sourceImage, sourceSnapshot, orsourceDisk) or create an empty 500 GB data disk by
1414 /// omitting all properties. You can also create a disk that is larger than
1415 /// the default size by specifying the sizeGb property.
1416 pub fn insert(&self) -> super::builder::disks::Insert {
1417 super::builder::disks::Insert::new(self.inner.clone())
1418 }
1419
1420 /// Retrieves a list of persistent disks contained within
1421 /// the specified zone.
1422 pub fn list(&self) -> super::builder::disks::List {
1423 super::builder::disks::List::new(self.inner.clone())
1424 }
1425
1426 /// Removes resource policies from a disk.
1427 pub fn remove_resource_policies(&self) -> super::builder::disks::RemoveResourcePolicies {
1428 super::builder::disks::RemoveResourcePolicies::new(self.inner.clone())
1429 }
1430
1431 /// Resizes the specified persistent disk.
1432 /// You can only increase the size of the disk.
1433 pub fn resize(&self) -> super::builder::disks::Resize {
1434 super::builder::disks::Resize::new(self.inner.clone())
1435 }
1436
1437 /// Sets the access control policy on the specified resource.
1438 /// Replaces any existing policy.
1439 pub fn set_iam_policy(&self) -> super::builder::disks::SetIamPolicy {
1440 super::builder::disks::SetIamPolicy::new(self.inner.clone())
1441 }
1442
1443 /// Sets the labels on a disk. To learn more about labels, read theLabeling
1444 /// Resources documentation.
1445 pub fn set_labels(&self) -> super::builder::disks::SetLabels {
1446 super::builder::disks::SetLabels::new(self.inner.clone())
1447 }
1448
1449 /// Starts asynchronous replication.
1450 /// Must be invoked on the primary disk.
1451 pub fn start_async_replication(&self) -> super::builder::disks::StartAsyncReplication {
1452 super::builder::disks::StartAsyncReplication::new(self.inner.clone())
1453 }
1454
1455 /// Stops asynchronous replication.
1456 /// Can be invoked either on the primary or on the secondary disk.
1457 pub fn stop_async_replication(&self) -> super::builder::disks::StopAsyncReplication {
1458 super::builder::disks::StopAsyncReplication::new(self.inner.clone())
1459 }
1460
1461 /// Stops asynchronous replication for a consistency group of disks.
1462 /// Can be invoked either in the primary or secondary scope.
1463 pub fn stop_group_async_replication(&self) -> super::builder::disks::StopGroupAsyncReplication {
1464 super::builder::disks::StopGroupAsyncReplication::new(self.inner.clone())
1465 }
1466
1467 /// Returns permissions that a caller has on the specified resource.
1468 pub fn test_iam_permissions(&self) -> super::builder::disks::TestIamPermissions {
1469 super::builder::disks::TestIamPermissions::new(self.inner.clone())
1470 }
1471
1472 /// Updates the specified disk with the data included in the request.
1473 /// The update is performed only on selected fields included as part
1474 /// of update-mask.
1475 pub fn update(&self) -> super::builder::disks::Update {
1476 super::builder::disks::Update::new(self.inner.clone())
1477 }
1478
1479 /// Retrieves the specified zone-specific Operations resource.
1480 pub fn get_operation(&self) -> super::builder::disks::GetOperation {
1481 super::builder::disks::GetOperation::new(self.inner.clone())
1482 }
1483}
1484
1485/// Implements a client for the Google Compute Engine API.
1486///
1487/// # Example
1488/// ```
1489/// # use google_cloud_compute_v1::client::ExternalVpnGateways;
1490/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
1491/// let client = ExternalVpnGateways::builder().build().await?;
1492/// // use `client` to make requests to the Google Compute Engine API.
1493/// # Ok(()) }
1494/// ```
1495///
1496/// # Service Description
1497///
1498/// Service for the `externalVpnGateways` resource.
1499///
1500/// # Configuration
1501///
1502/// To configure `ExternalVpnGateways` use the `with_*` methods in the type returned
1503/// by [builder()][ExternalVpnGateways::builder]. The default configuration should
1504/// work for most applications. Common configuration changes include
1505///
1506/// * [with_endpoint()]: by default this client uses the global default endpoint
1507/// (`https://compute.googleapis.com`). Applications using regional
1508/// endpoints or running in restricted networks (e.g. a network configured
1509// with [Private Google Access with VPC Service Controls]) may want to
1510/// override this default.
1511/// * [with_credentials()]: by default this client uses
1512/// [Application Default Credentials]. Applications using custom
1513/// authentication may need to override this default.
1514///
1515/// [with_endpoint()]: super::builder::external_vpn_gateways::ClientBuilder::with_endpoint
1516/// [with_credentials()]: super::builder::external_vpn_gateways::ClientBuilder::with_credentials
1517/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1518/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1519///
1520/// # Pooling and Cloning
1521///
1522/// `ExternalVpnGateways` holds a connection pool internally, it is advised to
1523/// create one and reuse it. You do not need to wrap `ExternalVpnGateways` in
1524/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1525/// already uses an `Arc` internally.
1526#[cfg(feature = "external-vpn-gateways")]
1527#[cfg_attr(docsrs, doc(cfg(feature = "external-vpn-gateways")))]
1528#[derive(Clone, Debug)]
1529pub struct ExternalVpnGateways {
1530 inner: std::sync::Arc<dyn super::stub::dynamic::ExternalVpnGateways>,
1531}
1532
1533#[cfg(feature = "external-vpn-gateways")]
1534impl ExternalVpnGateways {
1535 /// Returns a builder for [ExternalVpnGateways].
1536 ///
1537 /// ```
1538 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1539 /// # use google_cloud_compute_v1::client::ExternalVpnGateways;
1540 /// let client = ExternalVpnGateways::builder().build().await?;
1541 /// # Ok(()) }
1542 /// ```
1543 pub fn builder() -> super::builder::external_vpn_gateways::ClientBuilder {
1544 crate::new_client_builder(super::builder::external_vpn_gateways::client::Factory)
1545 }
1546
1547 /// Creates a new client from the provided stub.
1548 ///
1549 /// The most common case for calling this function is in tests mocking the
1550 /// client's behavior.
1551 pub fn from_stub<T>(stub: T) -> Self
1552 where
1553 T: super::stub::ExternalVpnGateways + 'static,
1554 {
1555 Self {
1556 inner: std::sync::Arc::new(stub),
1557 }
1558 }
1559
1560 pub(crate) async fn new(
1561 config: gaxi::options::ClientConfig,
1562 ) -> crate::ClientBuilderResult<Self> {
1563 let inner = Self::build_inner(config).await?;
1564 Ok(Self { inner })
1565 }
1566
1567 async fn build_inner(
1568 conf: gaxi::options::ClientConfig,
1569 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ExternalVpnGateways>>
1570 {
1571 if gaxi::options::tracing_enabled(&conf) {
1572 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1573 }
1574 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1575 }
1576
1577 async fn build_transport(
1578 conf: gaxi::options::ClientConfig,
1579 ) -> crate::ClientBuilderResult<impl super::stub::ExternalVpnGateways> {
1580 super::transport::ExternalVpnGateways::new(conf).await
1581 }
1582
1583 async fn build_with_tracing(
1584 conf: gaxi::options::ClientConfig,
1585 ) -> crate::ClientBuilderResult<impl super::stub::ExternalVpnGateways> {
1586 Self::build_transport(conf)
1587 .await
1588 .map(super::tracing::ExternalVpnGateways::new)
1589 }
1590
1591 /// Deletes the specified externalVpnGateway.
1592 pub fn delete(&self) -> super::builder::external_vpn_gateways::Delete {
1593 super::builder::external_vpn_gateways::Delete::new(self.inner.clone())
1594 }
1595
1596 /// Returns the specified externalVpnGateway. Get a list of available
1597 /// externalVpnGateways by making a list() request.
1598 pub fn get(&self) -> super::builder::external_vpn_gateways::Get {
1599 super::builder::external_vpn_gateways::Get::new(self.inner.clone())
1600 }
1601
1602 /// Creates a ExternalVpnGateway in the specified project using
1603 /// the data included in the request.
1604 pub fn insert(&self) -> super::builder::external_vpn_gateways::Insert {
1605 super::builder::external_vpn_gateways::Insert::new(self.inner.clone())
1606 }
1607
1608 /// Retrieves the list of ExternalVpnGateway available to the specified
1609 /// project.
1610 pub fn list(&self) -> super::builder::external_vpn_gateways::List {
1611 super::builder::external_vpn_gateways::List::new(self.inner.clone())
1612 }
1613
1614 /// Sets the labels on an ExternalVpnGateway. To learn more about labels,
1615 /// read the Labeling
1616 /// Resources documentation.
1617 pub fn set_labels(&self) -> super::builder::external_vpn_gateways::SetLabels {
1618 super::builder::external_vpn_gateways::SetLabels::new(self.inner.clone())
1619 }
1620
1621 /// Returns permissions that a caller has on the specified resource.
1622 pub fn test_iam_permissions(
1623 &self,
1624 ) -> super::builder::external_vpn_gateways::TestIamPermissions {
1625 super::builder::external_vpn_gateways::TestIamPermissions::new(self.inner.clone())
1626 }
1627
1628 /// Retrieves the specified Operations resource.
1629 pub fn get_operation(&self) -> super::builder::external_vpn_gateways::GetOperation {
1630 super::builder::external_vpn_gateways::GetOperation::new(self.inner.clone())
1631 }
1632}
1633
1634/// Implements a client for the Google Compute Engine API.
1635///
1636/// # Example
1637/// ```
1638/// # use google_cloud_compute_v1::client::FirewallPolicies;
1639/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
1640/// let client = FirewallPolicies::builder().build().await?;
1641/// // use `client` to make requests to the Google Compute Engine API.
1642/// # Ok(()) }
1643/// ```
1644///
1645/// # Service Description
1646///
1647/// Service for the `firewallPolicies` resource.
1648///
1649/// # Configuration
1650///
1651/// To configure `FirewallPolicies` use the `with_*` methods in the type returned
1652/// by [builder()][FirewallPolicies::builder]. The default configuration should
1653/// work for most applications. Common configuration changes include
1654///
1655/// * [with_endpoint()]: by default this client uses the global default endpoint
1656/// (`https://compute.googleapis.com`). Applications using regional
1657/// endpoints or running in restricted networks (e.g. a network configured
1658// with [Private Google Access with VPC Service Controls]) may want to
1659/// override this default.
1660/// * [with_credentials()]: by default this client uses
1661/// [Application Default Credentials]. Applications using custom
1662/// authentication may need to override this default.
1663///
1664/// [with_endpoint()]: super::builder::firewall_policies::ClientBuilder::with_endpoint
1665/// [with_credentials()]: super::builder::firewall_policies::ClientBuilder::with_credentials
1666/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1667/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1668///
1669/// # Pooling and Cloning
1670///
1671/// `FirewallPolicies` holds a connection pool internally, it is advised to
1672/// create one and reuse it. You do not need to wrap `FirewallPolicies` in
1673/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1674/// already uses an `Arc` internally.
1675#[cfg(feature = "firewall-policies")]
1676#[cfg_attr(docsrs, doc(cfg(feature = "firewall-policies")))]
1677#[derive(Clone, Debug)]
1678pub struct FirewallPolicies {
1679 inner: std::sync::Arc<dyn super::stub::dynamic::FirewallPolicies>,
1680}
1681
1682#[cfg(feature = "firewall-policies")]
1683impl FirewallPolicies {
1684 /// Returns a builder for [FirewallPolicies].
1685 ///
1686 /// ```
1687 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1688 /// # use google_cloud_compute_v1::client::FirewallPolicies;
1689 /// let client = FirewallPolicies::builder().build().await?;
1690 /// # Ok(()) }
1691 /// ```
1692 pub fn builder() -> super::builder::firewall_policies::ClientBuilder {
1693 crate::new_client_builder(super::builder::firewall_policies::client::Factory)
1694 }
1695
1696 /// Creates a new client from the provided stub.
1697 ///
1698 /// The most common case for calling this function is in tests mocking the
1699 /// client's behavior.
1700 pub fn from_stub<T>(stub: T) -> Self
1701 where
1702 T: super::stub::FirewallPolicies + 'static,
1703 {
1704 Self {
1705 inner: std::sync::Arc::new(stub),
1706 }
1707 }
1708
1709 pub(crate) async fn new(
1710 config: gaxi::options::ClientConfig,
1711 ) -> crate::ClientBuilderResult<Self> {
1712 let inner = Self::build_inner(config).await?;
1713 Ok(Self { inner })
1714 }
1715
1716 async fn build_inner(
1717 conf: gaxi::options::ClientConfig,
1718 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::FirewallPolicies>>
1719 {
1720 if gaxi::options::tracing_enabled(&conf) {
1721 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1722 }
1723 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1724 }
1725
1726 async fn build_transport(
1727 conf: gaxi::options::ClientConfig,
1728 ) -> crate::ClientBuilderResult<impl super::stub::FirewallPolicies> {
1729 super::transport::FirewallPolicies::new(conf).await
1730 }
1731
1732 async fn build_with_tracing(
1733 conf: gaxi::options::ClientConfig,
1734 ) -> crate::ClientBuilderResult<impl super::stub::FirewallPolicies> {
1735 Self::build_transport(conf)
1736 .await
1737 .map(super::tracing::FirewallPolicies::new)
1738 }
1739
1740 /// Inserts an association for the specified firewall policy.
1741 pub fn add_association(&self) -> super::builder::firewall_policies::AddAssociation {
1742 super::builder::firewall_policies::AddAssociation::new(self.inner.clone())
1743 }
1744
1745 /// Inserts a rule into a firewall policy.
1746 pub fn add_rule(&self) -> super::builder::firewall_policies::AddRule {
1747 super::builder::firewall_policies::AddRule::new(self.inner.clone())
1748 }
1749
1750 /// Copies rules to the specified firewall policy.
1751 pub fn clone_rules(&self) -> super::builder::firewall_policies::CloneRules {
1752 super::builder::firewall_policies::CloneRules::new(self.inner.clone())
1753 }
1754
1755 /// Deletes the specified policy.
1756 pub fn delete(&self) -> super::builder::firewall_policies::Delete {
1757 super::builder::firewall_policies::Delete::new(self.inner.clone())
1758 }
1759
1760 /// Returns the specified firewall policy.
1761 pub fn get(&self) -> super::builder::firewall_policies::Get {
1762 super::builder::firewall_policies::Get::new(self.inner.clone())
1763 }
1764
1765 /// Gets an association with the specified name.
1766 pub fn get_association(&self) -> super::builder::firewall_policies::GetAssociation {
1767 super::builder::firewall_policies::GetAssociation::new(self.inner.clone())
1768 }
1769
1770 /// Gets the access control policy for a resource. May be empty if no such
1771 /// policy or resource exists.
1772 pub fn get_iam_policy(&self) -> super::builder::firewall_policies::GetIamPolicy {
1773 super::builder::firewall_policies::GetIamPolicy::new(self.inner.clone())
1774 }
1775
1776 /// Gets a rule of the specified priority.
1777 pub fn get_rule(&self) -> super::builder::firewall_policies::GetRule {
1778 super::builder::firewall_policies::GetRule::new(self.inner.clone())
1779 }
1780
1781 /// Creates a new policy in the specified project using the data included in
1782 /// the request.
1783 pub fn insert(&self) -> super::builder::firewall_policies::Insert {
1784 super::builder::firewall_policies::Insert::new(self.inner.clone())
1785 }
1786
1787 /// Lists all the policies that have been configured for the specified
1788 /// folder or organization.
1789 pub fn list(&self) -> super::builder::firewall_policies::List {
1790 super::builder::firewall_policies::List::new(self.inner.clone())
1791 }
1792
1793 /// Lists associations of a specified target, i.e., organization or folder.
1794 pub fn list_associations(&self) -> super::builder::firewall_policies::ListAssociations {
1795 super::builder::firewall_policies::ListAssociations::new(self.inner.clone())
1796 }
1797
1798 /// Moves the specified firewall policy.
1799 pub fn r#move(&self) -> super::builder::firewall_policies::Move {
1800 super::builder::firewall_policies::Move::new(self.inner.clone())
1801 }
1802
1803 /// Patches the specified policy with the data included in the request.
1804 pub fn patch(&self) -> super::builder::firewall_policies::Patch {
1805 super::builder::firewall_policies::Patch::new(self.inner.clone())
1806 }
1807
1808 /// Patches a rule of the specified priority.
1809 pub fn patch_rule(&self) -> super::builder::firewall_policies::PatchRule {
1810 super::builder::firewall_policies::PatchRule::new(self.inner.clone())
1811 }
1812
1813 /// Removes an association for the specified firewall policy.
1814 pub fn remove_association(&self) -> super::builder::firewall_policies::RemoveAssociation {
1815 super::builder::firewall_policies::RemoveAssociation::new(self.inner.clone())
1816 }
1817
1818 /// Deletes a rule of the specified priority.
1819 pub fn remove_rule(&self) -> super::builder::firewall_policies::RemoveRule {
1820 super::builder::firewall_policies::RemoveRule::new(self.inner.clone())
1821 }
1822
1823 /// Sets the access control policy on the specified resource.
1824 /// Replaces any existing policy.
1825 pub fn set_iam_policy(&self) -> super::builder::firewall_policies::SetIamPolicy {
1826 super::builder::firewall_policies::SetIamPolicy::new(self.inner.clone())
1827 }
1828
1829 /// Returns permissions that a caller has on the specified resource.
1830 pub fn test_iam_permissions(&self) -> super::builder::firewall_policies::TestIamPermissions {
1831 super::builder::firewall_policies::TestIamPermissions::new(self.inner.clone())
1832 }
1833
1834 /// Retrieves the specified Operations resource. Gets a list of operations
1835 /// by making a `list()` request.
1836 pub fn get_operation(&self) -> super::builder::firewall_policies::GetOperation {
1837 super::builder::firewall_policies::GetOperation::new(self.inner.clone())
1838 }
1839}
1840
1841/// Implements a client for the Google Compute Engine API.
1842///
1843/// # Example
1844/// ```
1845/// # use google_cloud_compute_v1::client::Firewalls;
1846/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
1847/// let client = Firewalls::builder().build().await?;
1848/// // use `client` to make requests to the Google Compute Engine API.
1849/// # Ok(()) }
1850/// ```
1851///
1852/// # Service Description
1853///
1854/// Service for the `firewalls` resource.
1855///
1856/// # Configuration
1857///
1858/// To configure `Firewalls` use the `with_*` methods in the type returned
1859/// by [builder()][Firewalls::builder]. The default configuration should
1860/// work for most applications. Common configuration changes include
1861///
1862/// * [with_endpoint()]: by default this client uses the global default endpoint
1863/// (`https://compute.googleapis.com`). Applications using regional
1864/// endpoints or running in restricted networks (e.g. a network configured
1865// with [Private Google Access with VPC Service Controls]) may want to
1866/// override this default.
1867/// * [with_credentials()]: by default this client uses
1868/// [Application Default Credentials]. Applications using custom
1869/// authentication may need to override this default.
1870///
1871/// [with_endpoint()]: super::builder::firewalls::ClientBuilder::with_endpoint
1872/// [with_credentials()]: super::builder::firewalls::ClientBuilder::with_credentials
1873/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1874/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1875///
1876/// # Pooling and Cloning
1877///
1878/// `Firewalls` holds a connection pool internally, it is advised to
1879/// create one and reuse it. You do not need to wrap `Firewalls` in
1880/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1881/// already uses an `Arc` internally.
1882#[cfg(feature = "firewalls")]
1883#[cfg_attr(docsrs, doc(cfg(feature = "firewalls")))]
1884#[derive(Clone, Debug)]
1885pub struct Firewalls {
1886 inner: std::sync::Arc<dyn super::stub::dynamic::Firewalls>,
1887}
1888
1889#[cfg(feature = "firewalls")]
1890impl Firewalls {
1891 /// Returns a builder for [Firewalls].
1892 ///
1893 /// ```
1894 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1895 /// # use google_cloud_compute_v1::client::Firewalls;
1896 /// let client = Firewalls::builder().build().await?;
1897 /// # Ok(()) }
1898 /// ```
1899 pub fn builder() -> super::builder::firewalls::ClientBuilder {
1900 crate::new_client_builder(super::builder::firewalls::client::Factory)
1901 }
1902
1903 /// Creates a new client from the provided stub.
1904 ///
1905 /// The most common case for calling this function is in tests mocking the
1906 /// client's behavior.
1907 pub fn from_stub<T>(stub: T) -> Self
1908 where
1909 T: super::stub::Firewalls + 'static,
1910 {
1911 Self {
1912 inner: std::sync::Arc::new(stub),
1913 }
1914 }
1915
1916 pub(crate) async fn new(
1917 config: gaxi::options::ClientConfig,
1918 ) -> crate::ClientBuilderResult<Self> {
1919 let inner = Self::build_inner(config).await?;
1920 Ok(Self { inner })
1921 }
1922
1923 async fn build_inner(
1924 conf: gaxi::options::ClientConfig,
1925 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Firewalls>> {
1926 if gaxi::options::tracing_enabled(&conf) {
1927 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1928 }
1929 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1930 }
1931
1932 async fn build_transport(
1933 conf: gaxi::options::ClientConfig,
1934 ) -> crate::ClientBuilderResult<impl super::stub::Firewalls> {
1935 super::transport::Firewalls::new(conf).await
1936 }
1937
1938 async fn build_with_tracing(
1939 conf: gaxi::options::ClientConfig,
1940 ) -> crate::ClientBuilderResult<impl super::stub::Firewalls> {
1941 Self::build_transport(conf)
1942 .await
1943 .map(super::tracing::Firewalls::new)
1944 }
1945
1946 /// Deletes the specified firewall.
1947 pub fn delete(&self) -> super::builder::firewalls::Delete {
1948 super::builder::firewalls::Delete::new(self.inner.clone())
1949 }
1950
1951 /// Returns the specified firewall.
1952 pub fn get(&self) -> super::builder::firewalls::Get {
1953 super::builder::firewalls::Get::new(self.inner.clone())
1954 }
1955
1956 /// Creates a firewall rule in the specified project using the data
1957 /// included in the request.
1958 pub fn insert(&self) -> super::builder::firewalls::Insert {
1959 super::builder::firewalls::Insert::new(self.inner.clone())
1960 }
1961
1962 /// Retrieves the list of firewall rules available to the specified
1963 /// project.
1964 pub fn list(&self) -> super::builder::firewalls::List {
1965 super::builder::firewalls::List::new(self.inner.clone())
1966 }
1967
1968 /// Updates the specified firewall rule with the data included in the
1969 /// request. This method supportsPATCH
1970 /// semantics and uses theJSON merge
1971 /// patch format and processing rules.
1972 pub fn patch(&self) -> super::builder::firewalls::Patch {
1973 super::builder::firewalls::Patch::new(self.inner.clone())
1974 }
1975
1976 /// Returns permissions that a caller has on the specified resource.
1977 pub fn test_iam_permissions(&self) -> super::builder::firewalls::TestIamPermissions {
1978 super::builder::firewalls::TestIamPermissions::new(self.inner.clone())
1979 }
1980
1981 /// Updates the specified firewall rule with the data included in the
1982 /// request.
1983 /// Note that all fields will be updated if using PUT, even fields that are not
1984 /// specified. To update individual fields, please use PATCH instead.
1985 pub fn update(&self) -> super::builder::firewalls::Update {
1986 super::builder::firewalls::Update::new(self.inner.clone())
1987 }
1988
1989 /// Retrieves the specified Operations resource.
1990 pub fn get_operation(&self) -> super::builder::firewalls::GetOperation {
1991 super::builder::firewalls::GetOperation::new(self.inner.clone())
1992 }
1993}
1994
1995/// Implements a client for the Google Compute Engine API.
1996///
1997/// # Example
1998/// ```
1999/// # use google_cloud_compute_v1::client::ForwardingRules;
2000/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
2001/// let client = ForwardingRules::builder().build().await?;
2002/// // use `client` to make requests to the Google Compute Engine API.
2003/// # Ok(()) }
2004/// ```
2005///
2006/// # Service Description
2007///
2008/// Service for the `forwardingRules` resource.
2009///
2010/// # Configuration
2011///
2012/// To configure `ForwardingRules` use the `with_*` methods in the type returned
2013/// by [builder()][ForwardingRules::builder]. The default configuration should
2014/// work for most applications. Common configuration changes include
2015///
2016/// * [with_endpoint()]: by default this client uses the global default endpoint
2017/// (`https://compute.googleapis.com`). Applications using regional
2018/// endpoints or running in restricted networks (e.g. a network configured
2019// with [Private Google Access with VPC Service Controls]) may want to
2020/// override this default.
2021/// * [with_credentials()]: by default this client uses
2022/// [Application Default Credentials]. Applications using custom
2023/// authentication may need to override this default.
2024///
2025/// [with_endpoint()]: super::builder::forwarding_rules::ClientBuilder::with_endpoint
2026/// [with_credentials()]: super::builder::forwarding_rules::ClientBuilder::with_credentials
2027/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2028/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2029///
2030/// # Pooling and Cloning
2031///
2032/// `ForwardingRules` holds a connection pool internally, it is advised to
2033/// create one and reuse it. You do not need to wrap `ForwardingRules` in
2034/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2035/// already uses an `Arc` internally.
2036#[cfg(feature = "forwarding-rules")]
2037#[cfg_attr(docsrs, doc(cfg(feature = "forwarding-rules")))]
2038#[derive(Clone, Debug)]
2039pub struct ForwardingRules {
2040 inner: std::sync::Arc<dyn super::stub::dynamic::ForwardingRules>,
2041}
2042
2043#[cfg(feature = "forwarding-rules")]
2044impl ForwardingRules {
2045 /// Returns a builder for [ForwardingRules].
2046 ///
2047 /// ```
2048 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2049 /// # use google_cloud_compute_v1::client::ForwardingRules;
2050 /// let client = ForwardingRules::builder().build().await?;
2051 /// # Ok(()) }
2052 /// ```
2053 pub fn builder() -> super::builder::forwarding_rules::ClientBuilder {
2054 crate::new_client_builder(super::builder::forwarding_rules::client::Factory)
2055 }
2056
2057 /// Creates a new client from the provided stub.
2058 ///
2059 /// The most common case for calling this function is in tests mocking the
2060 /// client's behavior.
2061 pub fn from_stub<T>(stub: T) -> Self
2062 where
2063 T: super::stub::ForwardingRules + 'static,
2064 {
2065 Self {
2066 inner: std::sync::Arc::new(stub),
2067 }
2068 }
2069
2070 pub(crate) async fn new(
2071 config: gaxi::options::ClientConfig,
2072 ) -> crate::ClientBuilderResult<Self> {
2073 let inner = Self::build_inner(config).await?;
2074 Ok(Self { inner })
2075 }
2076
2077 async fn build_inner(
2078 conf: gaxi::options::ClientConfig,
2079 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ForwardingRules>> {
2080 if gaxi::options::tracing_enabled(&conf) {
2081 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2082 }
2083 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2084 }
2085
2086 async fn build_transport(
2087 conf: gaxi::options::ClientConfig,
2088 ) -> crate::ClientBuilderResult<impl super::stub::ForwardingRules> {
2089 super::transport::ForwardingRules::new(conf).await
2090 }
2091
2092 async fn build_with_tracing(
2093 conf: gaxi::options::ClientConfig,
2094 ) -> crate::ClientBuilderResult<impl super::stub::ForwardingRules> {
2095 Self::build_transport(conf)
2096 .await
2097 .map(super::tracing::ForwardingRules::new)
2098 }
2099
2100 /// Retrieves an aggregated list of forwarding rules.
2101 ///
2102 /// To prevent failure, it is recommended that you set the
2103 /// `returnPartialSuccess` parameter to `true`.
2104 pub fn aggregated_list(&self) -> super::builder::forwarding_rules::AggregatedList {
2105 super::builder::forwarding_rules::AggregatedList::new(self.inner.clone())
2106 }
2107
2108 /// Deletes the specified ForwardingRule resource.
2109 pub fn delete(&self) -> super::builder::forwarding_rules::Delete {
2110 super::builder::forwarding_rules::Delete::new(self.inner.clone())
2111 }
2112
2113 /// Returns the specified ForwardingRule resource.
2114 pub fn get(&self) -> super::builder::forwarding_rules::Get {
2115 super::builder::forwarding_rules::Get::new(self.inner.clone())
2116 }
2117
2118 /// Creates a ForwardingRule resource in the specified project and region using
2119 /// the data included in the request.
2120 pub fn insert(&self) -> super::builder::forwarding_rules::Insert {
2121 super::builder::forwarding_rules::Insert::new(self.inner.clone())
2122 }
2123
2124 /// Retrieves a list of ForwardingRule resources available to the specified
2125 /// project and region.
2126 pub fn list(&self) -> super::builder::forwarding_rules::List {
2127 super::builder::forwarding_rules::List::new(self.inner.clone())
2128 }
2129
2130 /// Updates the specified forwarding rule with the data included in the
2131 /// request. This method supportsPATCH
2132 /// semantics and uses theJSON merge
2133 /// patch format and processing rules. Currently, you can only
2134 /// patch the network_tier field.
2135 pub fn patch(&self) -> super::builder::forwarding_rules::Patch {
2136 super::builder::forwarding_rules::Patch::new(self.inner.clone())
2137 }
2138
2139 /// Sets the labels on the specified resource. To learn more about labels,
2140 /// read the
2141 /// Labeling Resources documentation.
2142 pub fn set_labels(&self) -> super::builder::forwarding_rules::SetLabels {
2143 super::builder::forwarding_rules::SetLabels::new(self.inner.clone())
2144 }
2145
2146 /// Changes target URL for forwarding rule. The new target should be of the
2147 /// same type as the old target.
2148 pub fn set_target(&self) -> super::builder::forwarding_rules::SetTarget {
2149 super::builder::forwarding_rules::SetTarget::new(self.inner.clone())
2150 }
2151
2152 /// Retrieves the specified region-specific Operations resource.
2153 pub fn get_operation(&self) -> super::builder::forwarding_rules::GetOperation {
2154 super::builder::forwarding_rules::GetOperation::new(self.inner.clone())
2155 }
2156}
2157
2158/// Implements a client for the Google Compute Engine API.
2159///
2160/// # Example
2161/// ```
2162/// # use google_cloud_compute_v1::client::FutureReservations;
2163/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
2164/// let client = FutureReservations::builder().build().await?;
2165/// // use `client` to make requests to the Google Compute Engine API.
2166/// # Ok(()) }
2167/// ```
2168///
2169/// # Service Description
2170///
2171/// Service for the `futureReservations` resource.
2172///
2173/// # Configuration
2174///
2175/// To configure `FutureReservations` use the `with_*` methods in the type returned
2176/// by [builder()][FutureReservations::builder]. The default configuration should
2177/// work for most applications. Common configuration changes include
2178///
2179/// * [with_endpoint()]: by default this client uses the global default endpoint
2180/// (`https://compute.googleapis.com`). Applications using regional
2181/// endpoints or running in restricted networks (e.g. a network configured
2182// with [Private Google Access with VPC Service Controls]) may want to
2183/// override this default.
2184/// * [with_credentials()]: by default this client uses
2185/// [Application Default Credentials]. Applications using custom
2186/// authentication may need to override this default.
2187///
2188/// [with_endpoint()]: super::builder::future_reservations::ClientBuilder::with_endpoint
2189/// [with_credentials()]: super::builder::future_reservations::ClientBuilder::with_credentials
2190/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2191/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2192///
2193/// # Pooling and Cloning
2194///
2195/// `FutureReservations` holds a connection pool internally, it is advised to
2196/// create one and reuse it. You do not need to wrap `FutureReservations` in
2197/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2198/// already uses an `Arc` internally.
2199#[cfg(feature = "future-reservations")]
2200#[cfg_attr(docsrs, doc(cfg(feature = "future-reservations")))]
2201#[derive(Clone, Debug)]
2202pub struct FutureReservations {
2203 inner: std::sync::Arc<dyn super::stub::dynamic::FutureReservations>,
2204}
2205
2206#[cfg(feature = "future-reservations")]
2207impl FutureReservations {
2208 /// Returns a builder for [FutureReservations].
2209 ///
2210 /// ```
2211 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2212 /// # use google_cloud_compute_v1::client::FutureReservations;
2213 /// let client = FutureReservations::builder().build().await?;
2214 /// # Ok(()) }
2215 /// ```
2216 pub fn builder() -> super::builder::future_reservations::ClientBuilder {
2217 crate::new_client_builder(super::builder::future_reservations::client::Factory)
2218 }
2219
2220 /// Creates a new client from the provided stub.
2221 ///
2222 /// The most common case for calling this function is in tests mocking the
2223 /// client's behavior.
2224 pub fn from_stub<T>(stub: T) -> Self
2225 where
2226 T: super::stub::FutureReservations + 'static,
2227 {
2228 Self {
2229 inner: std::sync::Arc::new(stub),
2230 }
2231 }
2232
2233 pub(crate) async fn new(
2234 config: gaxi::options::ClientConfig,
2235 ) -> crate::ClientBuilderResult<Self> {
2236 let inner = Self::build_inner(config).await?;
2237 Ok(Self { inner })
2238 }
2239
2240 async fn build_inner(
2241 conf: gaxi::options::ClientConfig,
2242 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::FutureReservations>>
2243 {
2244 if gaxi::options::tracing_enabled(&conf) {
2245 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2246 }
2247 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2248 }
2249
2250 async fn build_transport(
2251 conf: gaxi::options::ClientConfig,
2252 ) -> crate::ClientBuilderResult<impl super::stub::FutureReservations> {
2253 super::transport::FutureReservations::new(conf).await
2254 }
2255
2256 async fn build_with_tracing(
2257 conf: gaxi::options::ClientConfig,
2258 ) -> crate::ClientBuilderResult<impl super::stub::FutureReservations> {
2259 Self::build_transport(conf)
2260 .await
2261 .map(super::tracing::FutureReservations::new)
2262 }
2263
2264 /// Retrieves an aggregated list of future reservations.
2265 ///
2266 /// To prevent failure, it is recommended that you set the
2267 /// `returnPartialSuccess` parameter to `true`.
2268 pub fn aggregated_list(&self) -> super::builder::future_reservations::AggregatedList {
2269 super::builder::future_reservations::AggregatedList::new(self.inner.clone())
2270 }
2271
2272 /// Cancel the specified future reservation.
2273 pub fn cancel(&self) -> super::builder::future_reservations::Cancel {
2274 super::builder::future_reservations::Cancel::new(self.inner.clone())
2275 }
2276
2277 /// Deletes the specified future reservation.
2278 pub fn delete(&self) -> super::builder::future_reservations::Delete {
2279 super::builder::future_reservations::Delete::new(self.inner.clone())
2280 }
2281
2282 /// Retrieves information about the specified future reservation.
2283 pub fn get(&self) -> super::builder::future_reservations::Get {
2284 super::builder::future_reservations::Get::new(self.inner.clone())
2285 }
2286
2287 /// Creates a new Future Reservation.
2288 pub fn insert(&self) -> super::builder::future_reservations::Insert {
2289 super::builder::future_reservations::Insert::new(self.inner.clone())
2290 }
2291
2292 /// A list of all the future reservations that have been configured for the
2293 /// specified project in specified zone.
2294 pub fn list(&self) -> super::builder::future_reservations::List {
2295 super::builder::future_reservations::List::new(self.inner.clone())
2296 }
2297
2298 /// Updates the specified future reservation.
2299 pub fn update(&self) -> super::builder::future_reservations::Update {
2300 super::builder::future_reservations::Update::new(self.inner.clone())
2301 }
2302
2303 /// Retrieves the specified zone-specific Operations resource.
2304 pub fn get_operation(&self) -> super::builder::future_reservations::GetOperation {
2305 super::builder::future_reservations::GetOperation::new(self.inner.clone())
2306 }
2307}
2308
2309/// Implements a client for the Google Compute Engine API.
2310///
2311/// # Example
2312/// ```
2313/// # use google_cloud_compute_v1::client::GlobalAddresses;
2314/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
2315/// let client = GlobalAddresses::builder().build().await?;
2316/// // use `client` to make requests to the Google Compute Engine API.
2317/// # Ok(()) }
2318/// ```
2319///
2320/// # Service Description
2321///
2322/// Service for the `globalAddresses` resource.
2323///
2324/// # Configuration
2325///
2326/// To configure `GlobalAddresses` use the `with_*` methods in the type returned
2327/// by [builder()][GlobalAddresses::builder]. The default configuration should
2328/// work for most applications. Common configuration changes include
2329///
2330/// * [with_endpoint()]: by default this client uses the global default endpoint
2331/// (`https://compute.googleapis.com`). Applications using regional
2332/// endpoints or running in restricted networks (e.g. a network configured
2333// with [Private Google Access with VPC Service Controls]) may want to
2334/// override this default.
2335/// * [with_credentials()]: by default this client uses
2336/// [Application Default Credentials]. Applications using custom
2337/// authentication may need to override this default.
2338///
2339/// [with_endpoint()]: super::builder::global_addresses::ClientBuilder::with_endpoint
2340/// [with_credentials()]: super::builder::global_addresses::ClientBuilder::with_credentials
2341/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2342/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2343///
2344/// # Pooling and Cloning
2345///
2346/// `GlobalAddresses` holds a connection pool internally, it is advised to
2347/// create one and reuse it. You do not need to wrap `GlobalAddresses` in
2348/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2349/// already uses an `Arc` internally.
2350#[cfg(feature = "global-addresses")]
2351#[cfg_attr(docsrs, doc(cfg(feature = "global-addresses")))]
2352#[derive(Clone, Debug)]
2353pub struct GlobalAddresses {
2354 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalAddresses>,
2355}
2356
2357#[cfg(feature = "global-addresses")]
2358impl GlobalAddresses {
2359 /// Returns a builder for [GlobalAddresses].
2360 ///
2361 /// ```
2362 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2363 /// # use google_cloud_compute_v1::client::GlobalAddresses;
2364 /// let client = GlobalAddresses::builder().build().await?;
2365 /// # Ok(()) }
2366 /// ```
2367 pub fn builder() -> super::builder::global_addresses::ClientBuilder {
2368 crate::new_client_builder(super::builder::global_addresses::client::Factory)
2369 }
2370
2371 /// Creates a new client from the provided stub.
2372 ///
2373 /// The most common case for calling this function is in tests mocking the
2374 /// client's behavior.
2375 pub fn from_stub<T>(stub: T) -> Self
2376 where
2377 T: super::stub::GlobalAddresses + 'static,
2378 {
2379 Self {
2380 inner: std::sync::Arc::new(stub),
2381 }
2382 }
2383
2384 pub(crate) async fn new(
2385 config: gaxi::options::ClientConfig,
2386 ) -> crate::ClientBuilderResult<Self> {
2387 let inner = Self::build_inner(config).await?;
2388 Ok(Self { inner })
2389 }
2390
2391 async fn build_inner(
2392 conf: gaxi::options::ClientConfig,
2393 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::GlobalAddresses>> {
2394 if gaxi::options::tracing_enabled(&conf) {
2395 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2396 }
2397 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2398 }
2399
2400 async fn build_transport(
2401 conf: gaxi::options::ClientConfig,
2402 ) -> crate::ClientBuilderResult<impl super::stub::GlobalAddresses> {
2403 super::transport::GlobalAddresses::new(conf).await
2404 }
2405
2406 async fn build_with_tracing(
2407 conf: gaxi::options::ClientConfig,
2408 ) -> crate::ClientBuilderResult<impl super::stub::GlobalAddresses> {
2409 Self::build_transport(conf)
2410 .await
2411 .map(super::tracing::GlobalAddresses::new)
2412 }
2413
2414 /// Deletes the specified address resource.
2415 pub fn delete(&self) -> super::builder::global_addresses::Delete {
2416 super::builder::global_addresses::Delete::new(self.inner.clone())
2417 }
2418
2419 /// Returns the specified address resource.
2420 pub fn get(&self) -> super::builder::global_addresses::Get {
2421 super::builder::global_addresses::Get::new(self.inner.clone())
2422 }
2423
2424 /// Creates an address resource in the specified project by using the data
2425 /// included in the request.
2426 pub fn insert(&self) -> super::builder::global_addresses::Insert {
2427 super::builder::global_addresses::Insert::new(self.inner.clone())
2428 }
2429
2430 /// Retrieves a list of global addresses.
2431 pub fn list(&self) -> super::builder::global_addresses::List {
2432 super::builder::global_addresses::List::new(self.inner.clone())
2433 }
2434
2435 /// Moves the specified address resource from one project to another project.
2436 pub fn r#move(&self) -> super::builder::global_addresses::Move {
2437 super::builder::global_addresses::Move::new(self.inner.clone())
2438 }
2439
2440 /// Sets the labels on a GlobalAddress. To learn more about labels, read theLabeling
2441 /// Resources documentation.
2442 pub fn set_labels(&self) -> super::builder::global_addresses::SetLabels {
2443 super::builder::global_addresses::SetLabels::new(self.inner.clone())
2444 }
2445
2446 /// Returns permissions that a caller has on the specified resource.
2447 pub fn test_iam_permissions(&self) -> super::builder::global_addresses::TestIamPermissions {
2448 super::builder::global_addresses::TestIamPermissions::new(self.inner.clone())
2449 }
2450
2451 /// Retrieves the specified Operations resource.
2452 pub fn get_operation(&self) -> super::builder::global_addresses::GetOperation {
2453 super::builder::global_addresses::GetOperation::new(self.inner.clone())
2454 }
2455}
2456
2457/// Implements a client for the Google Compute Engine API.
2458///
2459/// # Example
2460/// ```
2461/// # use google_cloud_compute_v1::client::GlobalForwardingRules;
2462/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
2463/// let client = GlobalForwardingRules::builder().build().await?;
2464/// // use `client` to make requests to the Google Compute Engine API.
2465/// # Ok(()) }
2466/// ```
2467///
2468/// # Service Description
2469///
2470/// Service for the `globalForwardingRules` resource.
2471///
2472/// # Configuration
2473///
2474/// To configure `GlobalForwardingRules` use the `with_*` methods in the type returned
2475/// by [builder()][GlobalForwardingRules::builder]. The default configuration should
2476/// work for most applications. Common configuration changes include
2477///
2478/// * [with_endpoint()]: by default this client uses the global default endpoint
2479/// (`https://compute.googleapis.com`). Applications using regional
2480/// endpoints or running in restricted networks (e.g. a network configured
2481// with [Private Google Access with VPC Service Controls]) may want to
2482/// override this default.
2483/// * [with_credentials()]: by default this client uses
2484/// [Application Default Credentials]. Applications using custom
2485/// authentication may need to override this default.
2486///
2487/// [with_endpoint()]: super::builder::global_forwarding_rules::ClientBuilder::with_endpoint
2488/// [with_credentials()]: super::builder::global_forwarding_rules::ClientBuilder::with_credentials
2489/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2490/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2491///
2492/// # Pooling and Cloning
2493///
2494/// `GlobalForwardingRules` holds a connection pool internally, it is advised to
2495/// create one and reuse it. You do not need to wrap `GlobalForwardingRules` in
2496/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2497/// already uses an `Arc` internally.
2498#[cfg(feature = "global-forwarding-rules")]
2499#[cfg_attr(docsrs, doc(cfg(feature = "global-forwarding-rules")))]
2500#[derive(Clone, Debug)]
2501pub struct GlobalForwardingRules {
2502 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalForwardingRules>,
2503}
2504
2505#[cfg(feature = "global-forwarding-rules")]
2506impl GlobalForwardingRules {
2507 /// Returns a builder for [GlobalForwardingRules].
2508 ///
2509 /// ```
2510 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2511 /// # use google_cloud_compute_v1::client::GlobalForwardingRules;
2512 /// let client = GlobalForwardingRules::builder().build().await?;
2513 /// # Ok(()) }
2514 /// ```
2515 pub fn builder() -> super::builder::global_forwarding_rules::ClientBuilder {
2516 crate::new_client_builder(super::builder::global_forwarding_rules::client::Factory)
2517 }
2518
2519 /// Creates a new client from the provided stub.
2520 ///
2521 /// The most common case for calling this function is in tests mocking the
2522 /// client's behavior.
2523 pub fn from_stub<T>(stub: T) -> Self
2524 where
2525 T: super::stub::GlobalForwardingRules + 'static,
2526 {
2527 Self {
2528 inner: std::sync::Arc::new(stub),
2529 }
2530 }
2531
2532 pub(crate) async fn new(
2533 config: gaxi::options::ClientConfig,
2534 ) -> crate::ClientBuilderResult<Self> {
2535 let inner = Self::build_inner(config).await?;
2536 Ok(Self { inner })
2537 }
2538
2539 async fn build_inner(
2540 conf: gaxi::options::ClientConfig,
2541 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::GlobalForwardingRules>>
2542 {
2543 if gaxi::options::tracing_enabled(&conf) {
2544 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2545 }
2546 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2547 }
2548
2549 async fn build_transport(
2550 conf: gaxi::options::ClientConfig,
2551 ) -> crate::ClientBuilderResult<impl super::stub::GlobalForwardingRules> {
2552 super::transport::GlobalForwardingRules::new(conf).await
2553 }
2554
2555 async fn build_with_tracing(
2556 conf: gaxi::options::ClientConfig,
2557 ) -> crate::ClientBuilderResult<impl super::stub::GlobalForwardingRules> {
2558 Self::build_transport(conf)
2559 .await
2560 .map(super::tracing::GlobalForwardingRules::new)
2561 }
2562
2563 /// Deletes the specified GlobalForwardingRule resource.
2564 pub fn delete(&self) -> super::builder::global_forwarding_rules::Delete {
2565 super::builder::global_forwarding_rules::Delete::new(self.inner.clone())
2566 }
2567
2568 /// Returns the specified GlobalForwardingRule resource. Gets a list of
2569 /// available forwarding rules by making a list() request.
2570 pub fn get(&self) -> super::builder::global_forwarding_rules::Get {
2571 super::builder::global_forwarding_rules::Get::new(self.inner.clone())
2572 }
2573
2574 /// Creates a GlobalForwardingRule resource in the specified project using
2575 /// the data included in the request.
2576 pub fn insert(&self) -> super::builder::global_forwarding_rules::Insert {
2577 super::builder::global_forwarding_rules::Insert::new(self.inner.clone())
2578 }
2579
2580 /// Retrieves a list of GlobalForwardingRule resources available to the
2581 /// specified project.
2582 pub fn list(&self) -> super::builder::global_forwarding_rules::List {
2583 super::builder::global_forwarding_rules::List::new(self.inner.clone())
2584 }
2585
2586 /// Updates the specified forwarding rule with the data included in the
2587 /// request. This method supportsPATCH
2588 /// semantics and uses theJSON merge
2589 /// patch format and processing rules. Currently, you can only
2590 /// patch the network_tier field.
2591 pub fn patch(&self) -> super::builder::global_forwarding_rules::Patch {
2592 super::builder::global_forwarding_rules::Patch::new(self.inner.clone())
2593 }
2594
2595 /// Sets the labels on the specified resource. To learn more about labels,
2596 /// read the
2597 /// Labeling resources documentation.
2598 pub fn set_labels(&self) -> super::builder::global_forwarding_rules::SetLabels {
2599 super::builder::global_forwarding_rules::SetLabels::new(self.inner.clone())
2600 }
2601
2602 /// Changes target URL for the GlobalForwardingRule resource. The new target
2603 /// should be of the same type as the old target.
2604 pub fn set_target(&self) -> super::builder::global_forwarding_rules::SetTarget {
2605 super::builder::global_forwarding_rules::SetTarget::new(self.inner.clone())
2606 }
2607
2608 /// Retrieves the specified Operations resource.
2609 pub fn get_operation(&self) -> super::builder::global_forwarding_rules::GetOperation {
2610 super::builder::global_forwarding_rules::GetOperation::new(self.inner.clone())
2611 }
2612}
2613
2614/// Implements a client for the Google Compute Engine API.
2615///
2616/// # Example
2617/// ```
2618/// # use google_cloud_compute_v1::client::GlobalNetworkEndpointGroups;
2619/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
2620/// let client = GlobalNetworkEndpointGroups::builder().build().await?;
2621/// // use `client` to make requests to the Google Compute Engine API.
2622/// # Ok(()) }
2623/// ```
2624///
2625/// # Service Description
2626///
2627/// Service for the `globalNetworkEndpointGroups` resource.
2628///
2629/// # Configuration
2630///
2631/// To configure `GlobalNetworkEndpointGroups` use the `with_*` methods in the type returned
2632/// by [builder()][GlobalNetworkEndpointGroups::builder]. The default configuration should
2633/// work for most applications. Common configuration changes include
2634///
2635/// * [with_endpoint()]: by default this client uses the global default endpoint
2636/// (`https://compute.googleapis.com`). Applications using regional
2637/// endpoints or running in restricted networks (e.g. a network configured
2638// with [Private Google Access with VPC Service Controls]) may want to
2639/// override this default.
2640/// * [with_credentials()]: by default this client uses
2641/// [Application Default Credentials]. Applications using custom
2642/// authentication may need to override this default.
2643///
2644/// [with_endpoint()]: super::builder::global_network_endpoint_groups::ClientBuilder::with_endpoint
2645/// [with_credentials()]: super::builder::global_network_endpoint_groups::ClientBuilder::with_credentials
2646/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2647/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2648///
2649/// # Pooling and Cloning
2650///
2651/// `GlobalNetworkEndpointGroups` holds a connection pool internally, it is advised to
2652/// create one and reuse it. You do not need to wrap `GlobalNetworkEndpointGroups` in
2653/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2654/// already uses an `Arc` internally.
2655#[cfg(feature = "global-network-endpoint-groups")]
2656#[cfg_attr(docsrs, doc(cfg(feature = "global-network-endpoint-groups")))]
2657#[derive(Clone, Debug)]
2658pub struct GlobalNetworkEndpointGroups {
2659 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalNetworkEndpointGroups>,
2660}
2661
2662#[cfg(feature = "global-network-endpoint-groups")]
2663impl GlobalNetworkEndpointGroups {
2664 /// Returns a builder for [GlobalNetworkEndpointGroups].
2665 ///
2666 /// ```
2667 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2668 /// # use google_cloud_compute_v1::client::GlobalNetworkEndpointGroups;
2669 /// let client = GlobalNetworkEndpointGroups::builder().build().await?;
2670 /// # Ok(()) }
2671 /// ```
2672 pub fn builder() -> super::builder::global_network_endpoint_groups::ClientBuilder {
2673 crate::new_client_builder(super::builder::global_network_endpoint_groups::client::Factory)
2674 }
2675
2676 /// Creates a new client from the provided stub.
2677 ///
2678 /// The most common case for calling this function is in tests mocking the
2679 /// client's behavior.
2680 pub fn from_stub<T>(stub: T) -> Self
2681 where
2682 T: super::stub::GlobalNetworkEndpointGroups + 'static,
2683 {
2684 Self {
2685 inner: std::sync::Arc::new(stub),
2686 }
2687 }
2688
2689 pub(crate) async fn new(
2690 config: gaxi::options::ClientConfig,
2691 ) -> crate::ClientBuilderResult<Self> {
2692 let inner = Self::build_inner(config).await?;
2693 Ok(Self { inner })
2694 }
2695
2696 async fn build_inner(
2697 conf: gaxi::options::ClientConfig,
2698 ) -> crate::ClientBuilderResult<
2699 std::sync::Arc<dyn super::stub::dynamic::GlobalNetworkEndpointGroups>,
2700 > {
2701 if gaxi::options::tracing_enabled(&conf) {
2702 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2703 }
2704 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2705 }
2706
2707 async fn build_transport(
2708 conf: gaxi::options::ClientConfig,
2709 ) -> crate::ClientBuilderResult<impl super::stub::GlobalNetworkEndpointGroups> {
2710 super::transport::GlobalNetworkEndpointGroups::new(conf).await
2711 }
2712
2713 async fn build_with_tracing(
2714 conf: gaxi::options::ClientConfig,
2715 ) -> crate::ClientBuilderResult<impl super::stub::GlobalNetworkEndpointGroups> {
2716 Self::build_transport(conf)
2717 .await
2718 .map(super::tracing::GlobalNetworkEndpointGroups::new)
2719 }
2720
2721 /// Attach a network endpoint to the specified network endpoint group.
2722 pub fn attach_network_endpoints(
2723 &self,
2724 ) -> super::builder::global_network_endpoint_groups::AttachNetworkEndpoints {
2725 super::builder::global_network_endpoint_groups::AttachNetworkEndpoints::new(
2726 self.inner.clone(),
2727 )
2728 }
2729
2730 /// Deletes the specified network endpoint group.Note that the NEG cannot be
2731 /// deleted if there are backend services referencing it.
2732 pub fn delete(&self) -> super::builder::global_network_endpoint_groups::Delete {
2733 super::builder::global_network_endpoint_groups::Delete::new(self.inner.clone())
2734 }
2735
2736 /// Detach the network endpoint from the specified network endpoint group.
2737 pub fn detach_network_endpoints(
2738 &self,
2739 ) -> super::builder::global_network_endpoint_groups::DetachNetworkEndpoints {
2740 super::builder::global_network_endpoint_groups::DetachNetworkEndpoints::new(
2741 self.inner.clone(),
2742 )
2743 }
2744
2745 /// Returns the specified network endpoint group.
2746 pub fn get(&self) -> super::builder::global_network_endpoint_groups::Get {
2747 super::builder::global_network_endpoint_groups::Get::new(self.inner.clone())
2748 }
2749
2750 /// Creates a network endpoint group in the specified project using the
2751 /// parameters that are included in the request.
2752 ///
2753 /// Note: Use the following APIs to manage network endpoint groups:
2754 ///
2755 /// - To manage NEGs with zonal scope (such as zonal NEGs, hybrid connectivity
2756 /// NEGs): zonal
2757 /// API
2758 /// - To manage NEGs with regional scope (such as regional internet NEGs,
2759 /// serverless NEGs, Private Service Connect NEGs): regional
2760 /// API
2761 /// - To manage NEGs with global scope (such as global internet NEGs):global
2762 /// API
2763 pub fn insert(&self) -> super::builder::global_network_endpoint_groups::Insert {
2764 super::builder::global_network_endpoint_groups::Insert::new(self.inner.clone())
2765 }
2766
2767 /// Retrieves the list of network endpoint groups that are located in the
2768 /// specified project.
2769 pub fn list(&self) -> super::builder::global_network_endpoint_groups::List {
2770 super::builder::global_network_endpoint_groups::List::new(self.inner.clone())
2771 }
2772
2773 /// Lists the network endpoints in the specified network endpoint group.
2774 pub fn list_network_endpoints(
2775 &self,
2776 ) -> super::builder::global_network_endpoint_groups::ListNetworkEndpoints {
2777 super::builder::global_network_endpoint_groups::ListNetworkEndpoints::new(
2778 self.inner.clone(),
2779 )
2780 }
2781
2782 /// Retrieves the specified Operations resource.
2783 pub fn get_operation(&self) -> super::builder::global_network_endpoint_groups::GetOperation {
2784 super::builder::global_network_endpoint_groups::GetOperation::new(self.inner.clone())
2785 }
2786}
2787
2788/// Implements a client for the Google Compute Engine API.
2789///
2790/// # Example
2791/// ```
2792/// # use google_cloud_compute_v1::client::GlobalOperations;
2793/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
2794/// let client = GlobalOperations::builder().build().await?;
2795/// // use `client` to make requests to the Google Compute Engine API.
2796/// # Ok(()) }
2797/// ```
2798///
2799/// # Service Description
2800///
2801/// Service for the `globalOperations` resource.
2802///
2803/// # Configuration
2804///
2805/// To configure `GlobalOperations` use the `with_*` methods in the type returned
2806/// by [builder()][GlobalOperations::builder]. The default configuration should
2807/// work for most applications. Common configuration changes include
2808///
2809/// * [with_endpoint()]: by default this client uses the global default endpoint
2810/// (`https://compute.googleapis.com`). Applications using regional
2811/// endpoints or running in restricted networks (e.g. a network configured
2812// with [Private Google Access with VPC Service Controls]) may want to
2813/// override this default.
2814/// * [with_credentials()]: by default this client uses
2815/// [Application Default Credentials]. Applications using custom
2816/// authentication may need to override this default.
2817///
2818/// [with_endpoint()]: super::builder::global_operations::ClientBuilder::with_endpoint
2819/// [with_credentials()]: super::builder::global_operations::ClientBuilder::with_credentials
2820/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2821/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2822///
2823/// # Pooling and Cloning
2824///
2825/// `GlobalOperations` holds a connection pool internally, it is advised to
2826/// create one and reuse it. You do not need to wrap `GlobalOperations` in
2827/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2828/// already uses an `Arc` internally.
2829#[cfg(feature = "global-operations")]
2830#[cfg_attr(docsrs, doc(cfg(feature = "global-operations")))]
2831#[derive(Clone, Debug)]
2832pub struct GlobalOperations {
2833 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalOperations>,
2834}
2835
2836#[cfg(feature = "global-operations")]
2837impl GlobalOperations {
2838 /// Returns a builder for [GlobalOperations].
2839 ///
2840 /// ```
2841 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2842 /// # use google_cloud_compute_v1::client::GlobalOperations;
2843 /// let client = GlobalOperations::builder().build().await?;
2844 /// # Ok(()) }
2845 /// ```
2846 pub fn builder() -> super::builder::global_operations::ClientBuilder {
2847 crate::new_client_builder(super::builder::global_operations::client::Factory)
2848 }
2849
2850 /// Creates a new client from the provided stub.
2851 ///
2852 /// The most common case for calling this function is in tests mocking the
2853 /// client's behavior.
2854 pub fn from_stub<T>(stub: T) -> Self
2855 where
2856 T: super::stub::GlobalOperations + 'static,
2857 {
2858 Self {
2859 inner: std::sync::Arc::new(stub),
2860 }
2861 }
2862
2863 pub(crate) async fn new(
2864 config: gaxi::options::ClientConfig,
2865 ) -> crate::ClientBuilderResult<Self> {
2866 let inner = Self::build_inner(config).await?;
2867 Ok(Self { inner })
2868 }
2869
2870 async fn build_inner(
2871 conf: gaxi::options::ClientConfig,
2872 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::GlobalOperations>>
2873 {
2874 if gaxi::options::tracing_enabled(&conf) {
2875 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2876 }
2877 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2878 }
2879
2880 async fn build_transport(
2881 conf: gaxi::options::ClientConfig,
2882 ) -> crate::ClientBuilderResult<impl super::stub::GlobalOperations> {
2883 super::transport::GlobalOperations::new(conf).await
2884 }
2885
2886 async fn build_with_tracing(
2887 conf: gaxi::options::ClientConfig,
2888 ) -> crate::ClientBuilderResult<impl super::stub::GlobalOperations> {
2889 Self::build_transport(conf)
2890 .await
2891 .map(super::tracing::GlobalOperations::new)
2892 }
2893
2894 /// Retrieves an aggregated list of all operations.
2895 ///
2896 /// To prevent failure, Google recommends that you set the
2897 /// `returnPartialSuccess` parameter to `true`.
2898 pub fn aggregated_list(&self) -> super::builder::global_operations::AggregatedList {
2899 super::builder::global_operations::AggregatedList::new(self.inner.clone())
2900 }
2901
2902 /// Deletes the specified Operations resource.
2903 pub fn delete(&self) -> super::builder::global_operations::Delete {
2904 super::builder::global_operations::Delete::new(self.inner.clone())
2905 }
2906
2907 /// Retrieves the specified Operations resource.
2908 pub fn get(&self) -> super::builder::global_operations::Get {
2909 super::builder::global_operations::Get::new(self.inner.clone())
2910 }
2911
2912 /// Retrieves a list of Operation resources contained within the specified
2913 /// project.
2914 pub fn list(&self) -> super::builder::global_operations::List {
2915 super::builder::global_operations::List::new(self.inner.clone())
2916 }
2917
2918 /// Waits for the specified Operation resource to return as `DONE`
2919 /// or for the request to approach the 2 minute deadline, and retrieves the
2920 /// specified Operation resource. This method differs from the
2921 /// `GET` method in that it waits for no more than the default
2922 /// deadline (2 minutes) and then returns the current state of the operation,
2923 /// which might be `DONE` or still in progress.
2924 ///
2925 /// This method is called on a best-effort basis. Specifically:
2926 ///
2927 /// ```norust
2928 /// - In uncommon cases, when the server is overloaded, the request might
2929 /// return before the default deadline is reached, or might return after zero
2930 /// seconds.
2931 /// ```
2932 ///
2933 /// - If the default deadline is reached, there is no guarantee that the
2934 /// operation is actually done when the method returns. Be prepared to retry
2935 /// if the operation is not `DONE`.
2936 pub fn wait(&self) -> super::builder::global_operations::Wait {
2937 super::builder::global_operations::Wait::new(self.inner.clone())
2938 }
2939}
2940
2941/// Implements a client for the Google Compute Engine API.
2942///
2943/// # Example
2944/// ```
2945/// # use google_cloud_compute_v1::client::GlobalOrganizationOperations;
2946/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
2947/// let client = GlobalOrganizationOperations::builder().build().await?;
2948/// // use `client` to make requests to the Google Compute Engine API.
2949/// # Ok(()) }
2950/// ```
2951///
2952/// # Service Description
2953///
2954/// Service for the `globalOrganizationOperations` resource.
2955///
2956/// # Configuration
2957///
2958/// To configure `GlobalOrganizationOperations` use the `with_*` methods in the type returned
2959/// by [builder()][GlobalOrganizationOperations::builder]. The default configuration should
2960/// work for most applications. Common configuration changes include
2961///
2962/// * [with_endpoint()]: by default this client uses the global default endpoint
2963/// (`https://compute.googleapis.com`). Applications using regional
2964/// endpoints or running in restricted networks (e.g. a network configured
2965// with [Private Google Access with VPC Service Controls]) may want to
2966/// override this default.
2967/// * [with_credentials()]: by default this client uses
2968/// [Application Default Credentials]. Applications using custom
2969/// authentication may need to override this default.
2970///
2971/// [with_endpoint()]: super::builder::global_organization_operations::ClientBuilder::with_endpoint
2972/// [with_credentials()]: super::builder::global_organization_operations::ClientBuilder::with_credentials
2973/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2974/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2975///
2976/// # Pooling and Cloning
2977///
2978/// `GlobalOrganizationOperations` holds a connection pool internally, it is advised to
2979/// create one and reuse it. You do not need to wrap `GlobalOrganizationOperations` in
2980/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2981/// already uses an `Arc` internally.
2982#[cfg(feature = "global-organization-operations")]
2983#[cfg_attr(docsrs, doc(cfg(feature = "global-organization-operations")))]
2984#[derive(Clone, Debug)]
2985pub struct GlobalOrganizationOperations {
2986 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalOrganizationOperations>,
2987}
2988
2989#[cfg(feature = "global-organization-operations")]
2990impl GlobalOrganizationOperations {
2991 /// Returns a builder for [GlobalOrganizationOperations].
2992 ///
2993 /// ```
2994 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2995 /// # use google_cloud_compute_v1::client::GlobalOrganizationOperations;
2996 /// let client = GlobalOrganizationOperations::builder().build().await?;
2997 /// # Ok(()) }
2998 /// ```
2999 pub fn builder() -> super::builder::global_organization_operations::ClientBuilder {
3000 crate::new_client_builder(super::builder::global_organization_operations::client::Factory)
3001 }
3002
3003 /// Creates a new client from the provided stub.
3004 ///
3005 /// The most common case for calling this function is in tests mocking the
3006 /// client's behavior.
3007 pub fn from_stub<T>(stub: T) -> Self
3008 where
3009 T: super::stub::GlobalOrganizationOperations + 'static,
3010 {
3011 Self {
3012 inner: std::sync::Arc::new(stub),
3013 }
3014 }
3015
3016 pub(crate) async fn new(
3017 config: gaxi::options::ClientConfig,
3018 ) -> crate::ClientBuilderResult<Self> {
3019 let inner = Self::build_inner(config).await?;
3020 Ok(Self { inner })
3021 }
3022
3023 async fn build_inner(
3024 conf: gaxi::options::ClientConfig,
3025 ) -> crate::ClientBuilderResult<
3026 std::sync::Arc<dyn super::stub::dynamic::GlobalOrganizationOperations>,
3027 > {
3028 if gaxi::options::tracing_enabled(&conf) {
3029 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3030 }
3031 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3032 }
3033
3034 async fn build_transport(
3035 conf: gaxi::options::ClientConfig,
3036 ) -> crate::ClientBuilderResult<impl super::stub::GlobalOrganizationOperations> {
3037 super::transport::GlobalOrganizationOperations::new(conf).await
3038 }
3039
3040 async fn build_with_tracing(
3041 conf: gaxi::options::ClientConfig,
3042 ) -> crate::ClientBuilderResult<impl super::stub::GlobalOrganizationOperations> {
3043 Self::build_transport(conf)
3044 .await
3045 .map(super::tracing::GlobalOrganizationOperations::new)
3046 }
3047
3048 /// Deletes the specified Operations resource.
3049 pub fn delete(&self) -> super::builder::global_organization_operations::Delete {
3050 super::builder::global_organization_operations::Delete::new(self.inner.clone())
3051 }
3052
3053 /// Retrieves the specified Operations resource. Gets a list of operations
3054 /// by making a `list()` request.
3055 pub fn get(&self) -> super::builder::global_organization_operations::Get {
3056 super::builder::global_organization_operations::Get::new(self.inner.clone())
3057 }
3058
3059 /// Retrieves a list of Operation resources contained within the specified
3060 /// organization.
3061 pub fn list(&self) -> super::builder::global_organization_operations::List {
3062 super::builder::global_organization_operations::List::new(self.inner.clone())
3063 }
3064}
3065
3066/// Implements a client for the Google Compute Engine API.
3067///
3068/// # Example
3069/// ```
3070/// # use google_cloud_compute_v1::client::GlobalPublicDelegatedPrefixes;
3071/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
3072/// let client = GlobalPublicDelegatedPrefixes::builder().build().await?;
3073/// // use `client` to make requests to the Google Compute Engine API.
3074/// # Ok(()) }
3075/// ```
3076///
3077/// # Service Description
3078///
3079/// Service for the `globalPublicDelegatedPrefixes` resource.
3080///
3081/// # Configuration
3082///
3083/// To configure `GlobalPublicDelegatedPrefixes` use the `with_*` methods in the type returned
3084/// by [builder()][GlobalPublicDelegatedPrefixes::builder]. The default configuration should
3085/// work for most applications. Common configuration changes include
3086///
3087/// * [with_endpoint()]: by default this client uses the global default endpoint
3088/// (`https://compute.googleapis.com`). Applications using regional
3089/// endpoints or running in restricted networks (e.g. a network configured
3090// with [Private Google Access with VPC Service Controls]) may want to
3091/// override this default.
3092/// * [with_credentials()]: by default this client uses
3093/// [Application Default Credentials]. Applications using custom
3094/// authentication may need to override this default.
3095///
3096/// [with_endpoint()]: super::builder::global_public_delegated_prefixes::ClientBuilder::with_endpoint
3097/// [with_credentials()]: super::builder::global_public_delegated_prefixes::ClientBuilder::with_credentials
3098/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3099/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3100///
3101/// # Pooling and Cloning
3102///
3103/// `GlobalPublicDelegatedPrefixes` holds a connection pool internally, it is advised to
3104/// create one and reuse it. You do not need to wrap `GlobalPublicDelegatedPrefixes` in
3105/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3106/// already uses an `Arc` internally.
3107#[cfg(feature = "global-public-delegated-prefixes")]
3108#[cfg_attr(docsrs, doc(cfg(feature = "global-public-delegated-prefixes")))]
3109#[derive(Clone, Debug)]
3110pub struct GlobalPublicDelegatedPrefixes {
3111 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalPublicDelegatedPrefixes>,
3112}
3113
3114#[cfg(feature = "global-public-delegated-prefixes")]
3115impl GlobalPublicDelegatedPrefixes {
3116 /// Returns a builder for [GlobalPublicDelegatedPrefixes].
3117 ///
3118 /// ```
3119 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3120 /// # use google_cloud_compute_v1::client::GlobalPublicDelegatedPrefixes;
3121 /// let client = GlobalPublicDelegatedPrefixes::builder().build().await?;
3122 /// # Ok(()) }
3123 /// ```
3124 pub fn builder() -> super::builder::global_public_delegated_prefixes::ClientBuilder {
3125 crate::new_client_builder(super::builder::global_public_delegated_prefixes::client::Factory)
3126 }
3127
3128 /// Creates a new client from the provided stub.
3129 ///
3130 /// The most common case for calling this function is in tests mocking the
3131 /// client's behavior.
3132 pub fn from_stub<T>(stub: T) -> Self
3133 where
3134 T: super::stub::GlobalPublicDelegatedPrefixes + 'static,
3135 {
3136 Self {
3137 inner: std::sync::Arc::new(stub),
3138 }
3139 }
3140
3141 pub(crate) async fn new(
3142 config: gaxi::options::ClientConfig,
3143 ) -> crate::ClientBuilderResult<Self> {
3144 let inner = Self::build_inner(config).await?;
3145 Ok(Self { inner })
3146 }
3147
3148 async fn build_inner(
3149 conf: gaxi::options::ClientConfig,
3150 ) -> crate::ClientBuilderResult<
3151 std::sync::Arc<dyn super::stub::dynamic::GlobalPublicDelegatedPrefixes>,
3152 > {
3153 if gaxi::options::tracing_enabled(&conf) {
3154 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3155 }
3156 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3157 }
3158
3159 async fn build_transport(
3160 conf: gaxi::options::ClientConfig,
3161 ) -> crate::ClientBuilderResult<impl super::stub::GlobalPublicDelegatedPrefixes> {
3162 super::transport::GlobalPublicDelegatedPrefixes::new(conf).await
3163 }
3164
3165 async fn build_with_tracing(
3166 conf: gaxi::options::ClientConfig,
3167 ) -> crate::ClientBuilderResult<impl super::stub::GlobalPublicDelegatedPrefixes> {
3168 Self::build_transport(conf)
3169 .await
3170 .map(super::tracing::GlobalPublicDelegatedPrefixes::new)
3171 }
3172
3173 /// Deletes the specified global PublicDelegatedPrefix.
3174 pub fn delete(&self) -> super::builder::global_public_delegated_prefixes::Delete {
3175 super::builder::global_public_delegated_prefixes::Delete::new(self.inner.clone())
3176 }
3177
3178 /// Returns the specified global PublicDelegatedPrefix resource.
3179 pub fn get(&self) -> super::builder::global_public_delegated_prefixes::Get {
3180 super::builder::global_public_delegated_prefixes::Get::new(self.inner.clone())
3181 }
3182
3183 /// Creates a global PublicDelegatedPrefix in the specified project using the
3184 /// parameters that are included in the request.
3185 pub fn insert(&self) -> super::builder::global_public_delegated_prefixes::Insert {
3186 super::builder::global_public_delegated_prefixes::Insert::new(self.inner.clone())
3187 }
3188
3189 /// Lists the global PublicDelegatedPrefixes for a project.
3190 pub fn list(&self) -> super::builder::global_public_delegated_prefixes::List {
3191 super::builder::global_public_delegated_prefixes::List::new(self.inner.clone())
3192 }
3193
3194 /// Patches the specified global PublicDelegatedPrefix resource with the data
3195 /// included in the request. This method supportsPATCH
3196 /// semantics and usesJSON merge
3197 /// patch format and processing rules.
3198 pub fn patch(&self) -> super::builder::global_public_delegated_prefixes::Patch {
3199 super::builder::global_public_delegated_prefixes::Patch::new(self.inner.clone())
3200 }
3201
3202 /// Retrieves the specified Operations resource.
3203 pub fn get_operation(&self) -> super::builder::global_public_delegated_prefixes::GetOperation {
3204 super::builder::global_public_delegated_prefixes::GetOperation::new(self.inner.clone())
3205 }
3206}
3207
3208/// Implements a client for the Google Compute Engine API.
3209///
3210/// # Example
3211/// ```
3212/// # use google_cloud_compute_v1::client::HealthChecks;
3213/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
3214/// let client = HealthChecks::builder().build().await?;
3215/// // use `client` to make requests to the Google Compute Engine API.
3216/// # Ok(()) }
3217/// ```
3218///
3219/// # Service Description
3220///
3221/// Service for the `healthChecks` resource.
3222///
3223/// # Configuration
3224///
3225/// To configure `HealthChecks` use the `with_*` methods in the type returned
3226/// by [builder()][HealthChecks::builder]. The default configuration should
3227/// work for most applications. Common configuration changes include
3228///
3229/// * [with_endpoint()]: by default this client uses the global default endpoint
3230/// (`https://compute.googleapis.com`). Applications using regional
3231/// endpoints or running in restricted networks (e.g. a network configured
3232// with [Private Google Access with VPC Service Controls]) may want to
3233/// override this default.
3234/// * [with_credentials()]: by default this client uses
3235/// [Application Default Credentials]. Applications using custom
3236/// authentication may need to override this default.
3237///
3238/// [with_endpoint()]: super::builder::health_checks::ClientBuilder::with_endpoint
3239/// [with_credentials()]: super::builder::health_checks::ClientBuilder::with_credentials
3240/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3241/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3242///
3243/// # Pooling and Cloning
3244///
3245/// `HealthChecks` holds a connection pool internally, it is advised to
3246/// create one and reuse it. You do not need to wrap `HealthChecks` in
3247/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3248/// already uses an `Arc` internally.
3249#[cfg(feature = "health-checks")]
3250#[cfg_attr(docsrs, doc(cfg(feature = "health-checks")))]
3251#[derive(Clone, Debug)]
3252pub struct HealthChecks {
3253 inner: std::sync::Arc<dyn super::stub::dynamic::HealthChecks>,
3254}
3255
3256#[cfg(feature = "health-checks")]
3257impl HealthChecks {
3258 /// Returns a builder for [HealthChecks].
3259 ///
3260 /// ```
3261 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3262 /// # use google_cloud_compute_v1::client::HealthChecks;
3263 /// let client = HealthChecks::builder().build().await?;
3264 /// # Ok(()) }
3265 /// ```
3266 pub fn builder() -> super::builder::health_checks::ClientBuilder {
3267 crate::new_client_builder(super::builder::health_checks::client::Factory)
3268 }
3269
3270 /// Creates a new client from the provided stub.
3271 ///
3272 /// The most common case for calling this function is in tests mocking the
3273 /// client's behavior.
3274 pub fn from_stub<T>(stub: T) -> Self
3275 where
3276 T: super::stub::HealthChecks + 'static,
3277 {
3278 Self {
3279 inner: std::sync::Arc::new(stub),
3280 }
3281 }
3282
3283 pub(crate) async fn new(
3284 config: gaxi::options::ClientConfig,
3285 ) -> crate::ClientBuilderResult<Self> {
3286 let inner = Self::build_inner(config).await?;
3287 Ok(Self { inner })
3288 }
3289
3290 async fn build_inner(
3291 conf: gaxi::options::ClientConfig,
3292 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::HealthChecks>> {
3293 if gaxi::options::tracing_enabled(&conf) {
3294 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3295 }
3296 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3297 }
3298
3299 async fn build_transport(
3300 conf: gaxi::options::ClientConfig,
3301 ) -> crate::ClientBuilderResult<impl super::stub::HealthChecks> {
3302 super::transport::HealthChecks::new(conf).await
3303 }
3304
3305 async fn build_with_tracing(
3306 conf: gaxi::options::ClientConfig,
3307 ) -> crate::ClientBuilderResult<impl super::stub::HealthChecks> {
3308 Self::build_transport(conf)
3309 .await
3310 .map(super::tracing::HealthChecks::new)
3311 }
3312
3313 /// Retrieves the list of all HealthCheck resources, regional and global,
3314 /// available to the specified project.
3315 ///
3316 /// To prevent failure, Google recommends that you set the
3317 /// `returnPartialSuccess` parameter to `true`.
3318 pub fn aggregated_list(&self) -> super::builder::health_checks::AggregatedList {
3319 super::builder::health_checks::AggregatedList::new(self.inner.clone())
3320 }
3321
3322 /// Deletes the specified HealthCheck resource.
3323 pub fn delete(&self) -> super::builder::health_checks::Delete {
3324 super::builder::health_checks::Delete::new(self.inner.clone())
3325 }
3326
3327 /// Returns the specified HealthCheck resource.
3328 pub fn get(&self) -> super::builder::health_checks::Get {
3329 super::builder::health_checks::Get::new(self.inner.clone())
3330 }
3331
3332 /// Creates a HealthCheck resource in the specified project using the data
3333 /// included in the request.
3334 pub fn insert(&self) -> super::builder::health_checks::Insert {
3335 super::builder::health_checks::Insert::new(self.inner.clone())
3336 }
3337
3338 /// Retrieves the list of HealthCheck resources available to the specified
3339 /// project.
3340 pub fn list(&self) -> super::builder::health_checks::List {
3341 super::builder::health_checks::List::new(self.inner.clone())
3342 }
3343
3344 /// Updates a HealthCheck resource in the specified project using the data
3345 /// included in the request. This method supportsPATCH
3346 /// semantics and uses theJSON merge
3347 /// patch format and processing rules.
3348 pub fn patch(&self) -> super::builder::health_checks::Patch {
3349 super::builder::health_checks::Patch::new(self.inner.clone())
3350 }
3351
3352 /// Returns permissions that a caller has on the specified resource.
3353 pub fn test_iam_permissions(&self) -> super::builder::health_checks::TestIamPermissions {
3354 super::builder::health_checks::TestIamPermissions::new(self.inner.clone())
3355 }
3356
3357 /// Updates a HealthCheck resource in the specified project using the data
3358 /// included in the request.
3359 pub fn update(&self) -> super::builder::health_checks::Update {
3360 super::builder::health_checks::Update::new(self.inner.clone())
3361 }
3362
3363 /// Retrieves the specified Operations resource.
3364 pub fn get_operation(&self) -> super::builder::health_checks::GetOperation {
3365 super::builder::health_checks::GetOperation::new(self.inner.clone())
3366 }
3367}
3368
3369/// Implements a client for the Google Compute Engine API.
3370///
3371/// # Example
3372/// ```
3373/// # use google_cloud_compute_v1::client::HttpHealthChecks;
3374/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
3375/// let client = HttpHealthChecks::builder().build().await?;
3376/// // use `client` to make requests to the Google Compute Engine API.
3377/// # Ok(()) }
3378/// ```
3379///
3380/// # Service Description
3381///
3382/// Service for the `httpHealthChecks` resource.
3383///
3384/// # Configuration
3385///
3386/// To configure `HttpHealthChecks` use the `with_*` methods in the type returned
3387/// by [builder()][HttpHealthChecks::builder]. The default configuration should
3388/// work for most applications. Common configuration changes include
3389///
3390/// * [with_endpoint()]: by default this client uses the global default endpoint
3391/// (`https://compute.googleapis.com`). Applications using regional
3392/// endpoints or running in restricted networks (e.g. a network configured
3393// with [Private Google Access with VPC Service Controls]) may want to
3394/// override this default.
3395/// * [with_credentials()]: by default this client uses
3396/// [Application Default Credentials]. Applications using custom
3397/// authentication may need to override this default.
3398///
3399/// [with_endpoint()]: super::builder::http_health_checks::ClientBuilder::with_endpoint
3400/// [with_credentials()]: super::builder::http_health_checks::ClientBuilder::with_credentials
3401/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3402/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3403///
3404/// # Pooling and Cloning
3405///
3406/// `HttpHealthChecks` holds a connection pool internally, it is advised to
3407/// create one and reuse it. You do not need to wrap `HttpHealthChecks` in
3408/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3409/// already uses an `Arc` internally.
3410#[cfg(feature = "http-health-checks")]
3411#[cfg_attr(docsrs, doc(cfg(feature = "http-health-checks")))]
3412#[derive(Clone, Debug)]
3413pub struct HttpHealthChecks {
3414 inner: std::sync::Arc<dyn super::stub::dynamic::HttpHealthChecks>,
3415}
3416
3417#[cfg(feature = "http-health-checks")]
3418impl HttpHealthChecks {
3419 /// Returns a builder for [HttpHealthChecks].
3420 ///
3421 /// ```
3422 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3423 /// # use google_cloud_compute_v1::client::HttpHealthChecks;
3424 /// let client = HttpHealthChecks::builder().build().await?;
3425 /// # Ok(()) }
3426 /// ```
3427 pub fn builder() -> super::builder::http_health_checks::ClientBuilder {
3428 crate::new_client_builder(super::builder::http_health_checks::client::Factory)
3429 }
3430
3431 /// Creates a new client from the provided stub.
3432 ///
3433 /// The most common case for calling this function is in tests mocking the
3434 /// client's behavior.
3435 pub fn from_stub<T>(stub: T) -> Self
3436 where
3437 T: super::stub::HttpHealthChecks + 'static,
3438 {
3439 Self {
3440 inner: std::sync::Arc::new(stub),
3441 }
3442 }
3443
3444 pub(crate) async fn new(
3445 config: gaxi::options::ClientConfig,
3446 ) -> crate::ClientBuilderResult<Self> {
3447 let inner = Self::build_inner(config).await?;
3448 Ok(Self { inner })
3449 }
3450
3451 async fn build_inner(
3452 conf: gaxi::options::ClientConfig,
3453 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::HttpHealthChecks>>
3454 {
3455 if gaxi::options::tracing_enabled(&conf) {
3456 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3457 }
3458 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3459 }
3460
3461 async fn build_transport(
3462 conf: gaxi::options::ClientConfig,
3463 ) -> crate::ClientBuilderResult<impl super::stub::HttpHealthChecks> {
3464 super::transport::HttpHealthChecks::new(conf).await
3465 }
3466
3467 async fn build_with_tracing(
3468 conf: gaxi::options::ClientConfig,
3469 ) -> crate::ClientBuilderResult<impl super::stub::HttpHealthChecks> {
3470 Self::build_transport(conf)
3471 .await
3472 .map(super::tracing::HttpHealthChecks::new)
3473 }
3474
3475 /// Deletes the specified HttpHealthCheck resource.
3476 pub fn delete(&self) -> super::builder::http_health_checks::Delete {
3477 super::builder::http_health_checks::Delete::new(self.inner.clone())
3478 }
3479
3480 /// Returns the specified HttpHealthCheck resource.
3481 pub fn get(&self) -> super::builder::http_health_checks::Get {
3482 super::builder::http_health_checks::Get::new(self.inner.clone())
3483 }
3484
3485 /// Creates a HttpHealthCheck resource in the specified project using the data
3486 /// included in the request.
3487 pub fn insert(&self) -> super::builder::http_health_checks::Insert {
3488 super::builder::http_health_checks::Insert::new(self.inner.clone())
3489 }
3490
3491 /// Retrieves the list of HttpHealthCheck resources available to the specified
3492 /// project.
3493 pub fn list(&self) -> super::builder::http_health_checks::List {
3494 super::builder::http_health_checks::List::new(self.inner.clone())
3495 }
3496
3497 /// Updates a HttpHealthCheck resource in the specified project using the data
3498 /// included in the request. This method supportsPATCH
3499 /// semantics and uses theJSON merge
3500 /// patch format and processing rules.
3501 pub fn patch(&self) -> super::builder::http_health_checks::Patch {
3502 super::builder::http_health_checks::Patch::new(self.inner.clone())
3503 }
3504
3505 /// Returns permissions that a caller has on the specified resource.
3506 pub fn test_iam_permissions(&self) -> super::builder::http_health_checks::TestIamPermissions {
3507 super::builder::http_health_checks::TestIamPermissions::new(self.inner.clone())
3508 }
3509
3510 /// Updates a HttpHealthCheck resource in the specified project using the data
3511 /// included in the request.
3512 pub fn update(&self) -> super::builder::http_health_checks::Update {
3513 super::builder::http_health_checks::Update::new(self.inner.clone())
3514 }
3515
3516 /// Retrieves the specified Operations resource.
3517 pub fn get_operation(&self) -> super::builder::http_health_checks::GetOperation {
3518 super::builder::http_health_checks::GetOperation::new(self.inner.clone())
3519 }
3520}
3521
3522/// Implements a client for the Google Compute Engine API.
3523///
3524/// # Example
3525/// ```
3526/// # use google_cloud_compute_v1::client::HttpsHealthChecks;
3527/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
3528/// let client = HttpsHealthChecks::builder().build().await?;
3529/// // use `client` to make requests to the Google Compute Engine API.
3530/// # Ok(()) }
3531/// ```
3532///
3533/// # Service Description
3534///
3535/// Service for the `httpsHealthChecks` resource.
3536///
3537/// # Configuration
3538///
3539/// To configure `HttpsHealthChecks` use the `with_*` methods in the type returned
3540/// by [builder()][HttpsHealthChecks::builder]. The default configuration should
3541/// work for most applications. Common configuration changes include
3542///
3543/// * [with_endpoint()]: by default this client uses the global default endpoint
3544/// (`https://compute.googleapis.com`). Applications using regional
3545/// endpoints or running in restricted networks (e.g. a network configured
3546// with [Private Google Access with VPC Service Controls]) may want to
3547/// override this default.
3548/// * [with_credentials()]: by default this client uses
3549/// [Application Default Credentials]. Applications using custom
3550/// authentication may need to override this default.
3551///
3552/// [with_endpoint()]: super::builder::https_health_checks::ClientBuilder::with_endpoint
3553/// [with_credentials()]: super::builder::https_health_checks::ClientBuilder::with_credentials
3554/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3555/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3556///
3557/// # Pooling and Cloning
3558///
3559/// `HttpsHealthChecks` holds a connection pool internally, it is advised to
3560/// create one and reuse it. You do not need to wrap `HttpsHealthChecks` in
3561/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3562/// already uses an `Arc` internally.
3563#[cfg(feature = "https-health-checks")]
3564#[cfg_attr(docsrs, doc(cfg(feature = "https-health-checks")))]
3565#[derive(Clone, Debug)]
3566pub struct HttpsHealthChecks {
3567 inner: std::sync::Arc<dyn super::stub::dynamic::HttpsHealthChecks>,
3568}
3569
3570#[cfg(feature = "https-health-checks")]
3571impl HttpsHealthChecks {
3572 /// Returns a builder for [HttpsHealthChecks].
3573 ///
3574 /// ```
3575 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3576 /// # use google_cloud_compute_v1::client::HttpsHealthChecks;
3577 /// let client = HttpsHealthChecks::builder().build().await?;
3578 /// # Ok(()) }
3579 /// ```
3580 pub fn builder() -> super::builder::https_health_checks::ClientBuilder {
3581 crate::new_client_builder(super::builder::https_health_checks::client::Factory)
3582 }
3583
3584 /// Creates a new client from the provided stub.
3585 ///
3586 /// The most common case for calling this function is in tests mocking the
3587 /// client's behavior.
3588 pub fn from_stub<T>(stub: T) -> Self
3589 where
3590 T: super::stub::HttpsHealthChecks + 'static,
3591 {
3592 Self {
3593 inner: std::sync::Arc::new(stub),
3594 }
3595 }
3596
3597 pub(crate) async fn new(
3598 config: gaxi::options::ClientConfig,
3599 ) -> crate::ClientBuilderResult<Self> {
3600 let inner = Self::build_inner(config).await?;
3601 Ok(Self { inner })
3602 }
3603
3604 async fn build_inner(
3605 conf: gaxi::options::ClientConfig,
3606 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::HttpsHealthChecks>>
3607 {
3608 if gaxi::options::tracing_enabled(&conf) {
3609 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3610 }
3611 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3612 }
3613
3614 async fn build_transport(
3615 conf: gaxi::options::ClientConfig,
3616 ) -> crate::ClientBuilderResult<impl super::stub::HttpsHealthChecks> {
3617 super::transport::HttpsHealthChecks::new(conf).await
3618 }
3619
3620 async fn build_with_tracing(
3621 conf: gaxi::options::ClientConfig,
3622 ) -> crate::ClientBuilderResult<impl super::stub::HttpsHealthChecks> {
3623 Self::build_transport(conf)
3624 .await
3625 .map(super::tracing::HttpsHealthChecks::new)
3626 }
3627
3628 /// Deletes the specified HttpsHealthCheck resource.
3629 pub fn delete(&self) -> super::builder::https_health_checks::Delete {
3630 super::builder::https_health_checks::Delete::new(self.inner.clone())
3631 }
3632
3633 /// Returns the specified HttpsHealthCheck resource.
3634 pub fn get(&self) -> super::builder::https_health_checks::Get {
3635 super::builder::https_health_checks::Get::new(self.inner.clone())
3636 }
3637
3638 /// Creates a HttpsHealthCheck resource in the specified project using the data
3639 /// included in the request.
3640 pub fn insert(&self) -> super::builder::https_health_checks::Insert {
3641 super::builder::https_health_checks::Insert::new(self.inner.clone())
3642 }
3643
3644 /// Retrieves the list of HttpsHealthCheck resources available to the specified
3645 /// project.
3646 pub fn list(&self) -> super::builder::https_health_checks::List {
3647 super::builder::https_health_checks::List::new(self.inner.clone())
3648 }
3649
3650 /// Updates a HttpsHealthCheck resource in the specified project using the data
3651 /// included in the request. This method supportsPATCH
3652 /// semantics and uses theJSON merge
3653 /// patch format and processing rules.
3654 pub fn patch(&self) -> super::builder::https_health_checks::Patch {
3655 super::builder::https_health_checks::Patch::new(self.inner.clone())
3656 }
3657
3658 /// Returns permissions that a caller has on the specified resource.
3659 pub fn test_iam_permissions(&self) -> super::builder::https_health_checks::TestIamPermissions {
3660 super::builder::https_health_checks::TestIamPermissions::new(self.inner.clone())
3661 }
3662
3663 /// Updates a HttpsHealthCheck resource in the specified project using the data
3664 /// included in the request.
3665 pub fn update(&self) -> super::builder::https_health_checks::Update {
3666 super::builder::https_health_checks::Update::new(self.inner.clone())
3667 }
3668
3669 /// Retrieves the specified Operations resource.
3670 pub fn get_operation(&self) -> super::builder::https_health_checks::GetOperation {
3671 super::builder::https_health_checks::GetOperation::new(self.inner.clone())
3672 }
3673}
3674
3675/// Implements a client for the Google Compute Engine API.
3676///
3677/// # Example
3678/// ```
3679/// # use google_cloud_compute_v1::client::ImageFamilyViews;
3680/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
3681/// let client = ImageFamilyViews::builder().build().await?;
3682/// // use `client` to make requests to the Google Compute Engine API.
3683/// # Ok(()) }
3684/// ```
3685///
3686/// # Service Description
3687///
3688/// Service for the `imageFamilyViews` resource.
3689///
3690/// # Configuration
3691///
3692/// To configure `ImageFamilyViews` use the `with_*` methods in the type returned
3693/// by [builder()][ImageFamilyViews::builder]. The default configuration should
3694/// work for most applications. Common configuration changes include
3695///
3696/// * [with_endpoint()]: by default this client uses the global default endpoint
3697/// (`https://compute.googleapis.com`). Applications using regional
3698/// endpoints or running in restricted networks (e.g. a network configured
3699// with [Private Google Access with VPC Service Controls]) may want to
3700/// override this default.
3701/// * [with_credentials()]: by default this client uses
3702/// [Application Default Credentials]. Applications using custom
3703/// authentication may need to override this default.
3704///
3705/// [with_endpoint()]: super::builder::image_family_views::ClientBuilder::with_endpoint
3706/// [with_credentials()]: super::builder::image_family_views::ClientBuilder::with_credentials
3707/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3708/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3709///
3710/// # Pooling and Cloning
3711///
3712/// `ImageFamilyViews` holds a connection pool internally, it is advised to
3713/// create one and reuse it. You do not need to wrap `ImageFamilyViews` in
3714/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3715/// already uses an `Arc` internally.
3716#[cfg(feature = "image-family-views")]
3717#[cfg_attr(docsrs, doc(cfg(feature = "image-family-views")))]
3718#[derive(Clone, Debug)]
3719pub struct ImageFamilyViews {
3720 inner: std::sync::Arc<dyn super::stub::dynamic::ImageFamilyViews>,
3721}
3722
3723#[cfg(feature = "image-family-views")]
3724impl ImageFamilyViews {
3725 /// Returns a builder for [ImageFamilyViews].
3726 ///
3727 /// ```
3728 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3729 /// # use google_cloud_compute_v1::client::ImageFamilyViews;
3730 /// let client = ImageFamilyViews::builder().build().await?;
3731 /// # Ok(()) }
3732 /// ```
3733 pub fn builder() -> super::builder::image_family_views::ClientBuilder {
3734 crate::new_client_builder(super::builder::image_family_views::client::Factory)
3735 }
3736
3737 /// Creates a new client from the provided stub.
3738 ///
3739 /// The most common case for calling this function is in tests mocking the
3740 /// client's behavior.
3741 pub fn from_stub<T>(stub: T) -> Self
3742 where
3743 T: super::stub::ImageFamilyViews + 'static,
3744 {
3745 Self {
3746 inner: std::sync::Arc::new(stub),
3747 }
3748 }
3749
3750 pub(crate) async fn new(
3751 config: gaxi::options::ClientConfig,
3752 ) -> crate::ClientBuilderResult<Self> {
3753 let inner = Self::build_inner(config).await?;
3754 Ok(Self { inner })
3755 }
3756
3757 async fn build_inner(
3758 conf: gaxi::options::ClientConfig,
3759 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ImageFamilyViews>>
3760 {
3761 if gaxi::options::tracing_enabled(&conf) {
3762 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3763 }
3764 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3765 }
3766
3767 async fn build_transport(
3768 conf: gaxi::options::ClientConfig,
3769 ) -> crate::ClientBuilderResult<impl super::stub::ImageFamilyViews> {
3770 super::transport::ImageFamilyViews::new(conf).await
3771 }
3772
3773 async fn build_with_tracing(
3774 conf: gaxi::options::ClientConfig,
3775 ) -> crate::ClientBuilderResult<impl super::stub::ImageFamilyViews> {
3776 Self::build_transport(conf)
3777 .await
3778 .map(super::tracing::ImageFamilyViews::new)
3779 }
3780
3781 /// Returns the latest image that is part of an image family, is not
3782 /// deprecated and is rolled out in the specified zone.
3783 pub fn get(&self) -> super::builder::image_family_views::Get {
3784 super::builder::image_family_views::Get::new(self.inner.clone())
3785 }
3786}
3787
3788/// Implements a client for the Google Compute Engine API.
3789///
3790/// # Example
3791/// ```
3792/// # use google_cloud_compute_v1::client::Images;
3793/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
3794/// let client = Images::builder().build().await?;
3795/// // use `client` to make requests to the Google Compute Engine API.
3796/// # Ok(()) }
3797/// ```
3798///
3799/// # Service Description
3800///
3801/// Service for the `images` resource.
3802///
3803/// # Configuration
3804///
3805/// To configure `Images` use the `with_*` methods in the type returned
3806/// by [builder()][Images::builder]. The default configuration should
3807/// work for most applications. Common configuration changes include
3808///
3809/// * [with_endpoint()]: by default this client uses the global default endpoint
3810/// (`https://compute.googleapis.com`). Applications using regional
3811/// endpoints or running in restricted networks (e.g. a network configured
3812// with [Private Google Access with VPC Service Controls]) may want to
3813/// override this default.
3814/// * [with_credentials()]: by default this client uses
3815/// [Application Default Credentials]. Applications using custom
3816/// authentication may need to override this default.
3817///
3818/// [with_endpoint()]: super::builder::images::ClientBuilder::with_endpoint
3819/// [with_credentials()]: super::builder::images::ClientBuilder::with_credentials
3820/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3821/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3822///
3823/// # Pooling and Cloning
3824///
3825/// `Images` holds a connection pool internally, it is advised to
3826/// create one and reuse it. You do not need to wrap `Images` in
3827/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3828/// already uses an `Arc` internally.
3829#[cfg(feature = "images")]
3830#[cfg_attr(docsrs, doc(cfg(feature = "images")))]
3831#[derive(Clone, Debug)]
3832pub struct Images {
3833 inner: std::sync::Arc<dyn super::stub::dynamic::Images>,
3834}
3835
3836#[cfg(feature = "images")]
3837impl Images {
3838 /// Returns a builder for [Images].
3839 ///
3840 /// ```
3841 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3842 /// # use google_cloud_compute_v1::client::Images;
3843 /// let client = Images::builder().build().await?;
3844 /// # Ok(()) }
3845 /// ```
3846 pub fn builder() -> super::builder::images::ClientBuilder {
3847 crate::new_client_builder(super::builder::images::client::Factory)
3848 }
3849
3850 /// Creates a new client from the provided stub.
3851 ///
3852 /// The most common case for calling this function is in tests mocking the
3853 /// client's behavior.
3854 pub fn from_stub<T>(stub: T) -> Self
3855 where
3856 T: super::stub::Images + 'static,
3857 {
3858 Self {
3859 inner: std::sync::Arc::new(stub),
3860 }
3861 }
3862
3863 pub(crate) async fn new(
3864 config: gaxi::options::ClientConfig,
3865 ) -> crate::ClientBuilderResult<Self> {
3866 let inner = Self::build_inner(config).await?;
3867 Ok(Self { inner })
3868 }
3869
3870 async fn build_inner(
3871 conf: gaxi::options::ClientConfig,
3872 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Images>> {
3873 if gaxi::options::tracing_enabled(&conf) {
3874 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3875 }
3876 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3877 }
3878
3879 async fn build_transport(
3880 conf: gaxi::options::ClientConfig,
3881 ) -> crate::ClientBuilderResult<impl super::stub::Images> {
3882 super::transport::Images::new(conf).await
3883 }
3884
3885 async fn build_with_tracing(
3886 conf: gaxi::options::ClientConfig,
3887 ) -> crate::ClientBuilderResult<impl super::stub::Images> {
3888 Self::build_transport(conf)
3889 .await
3890 .map(super::tracing::Images::new)
3891 }
3892
3893 /// Deletes the specified image.
3894 pub fn delete(&self) -> super::builder::images::Delete {
3895 super::builder::images::Delete::new(self.inner.clone())
3896 }
3897
3898 /// Sets the deprecation status of an image.
3899 ///
3900 /// If an empty request body is given, clears the deprecation status instead.
3901 pub fn deprecate(&self) -> super::builder::images::Deprecate {
3902 super::builder::images::Deprecate::new(self.inner.clone())
3903 }
3904
3905 /// Returns the specified image.
3906 pub fn get(&self) -> super::builder::images::Get {
3907 super::builder::images::Get::new(self.inner.clone())
3908 }
3909
3910 /// Returns the latest image that is part of an image family and is not
3911 /// deprecated. For more information on image families, seePublic
3912 /// image families documentation.
3913 pub fn get_from_family(&self) -> super::builder::images::GetFromFamily {
3914 super::builder::images::GetFromFamily::new(self.inner.clone())
3915 }
3916
3917 /// Gets the access control policy for a resource. May be empty if no such
3918 /// policy or resource exists.
3919 pub fn get_iam_policy(&self) -> super::builder::images::GetIamPolicy {
3920 super::builder::images::GetIamPolicy::new(self.inner.clone())
3921 }
3922
3923 /// Creates an image in the specified project using the data included
3924 /// in the request.
3925 pub fn insert(&self) -> super::builder::images::Insert {
3926 super::builder::images::Insert::new(self.inner.clone())
3927 }
3928
3929 /// Retrieves the list of custom images
3930 /// available to the specified project. Custom images are images you
3931 /// create that belong to your project. This method does not
3932 /// get any images that belong to other projects, including publicly-available
3933 /// images, like Debian 8. If you want to get a list of publicly-available
3934 /// images, use this method to make a request to the respective image project,
3935 /// such as debian-cloud or windows-cloud.
3936 pub fn list(&self) -> super::builder::images::List {
3937 super::builder::images::List::new(self.inner.clone())
3938 }
3939
3940 /// Patches the specified image with the data included in the request.
3941 /// Only the following fields can be modified: family, description,
3942 /// deprecation status.
3943 pub fn patch(&self) -> super::builder::images::Patch {
3944 super::builder::images::Patch::new(self.inner.clone())
3945 }
3946
3947 /// Sets the access control policy on the specified resource.
3948 /// Replaces any existing policy.
3949 pub fn set_iam_policy(&self) -> super::builder::images::SetIamPolicy {
3950 super::builder::images::SetIamPolicy::new(self.inner.clone())
3951 }
3952
3953 /// Sets the labels on an image. To learn more about labels, read theLabeling
3954 /// Resources documentation.
3955 pub fn set_labels(&self) -> super::builder::images::SetLabels {
3956 super::builder::images::SetLabels::new(self.inner.clone())
3957 }
3958
3959 /// Returns permissions that a caller has on the specified resource.
3960 pub fn test_iam_permissions(&self) -> super::builder::images::TestIamPermissions {
3961 super::builder::images::TestIamPermissions::new(self.inner.clone())
3962 }
3963
3964 /// Retrieves the specified Operations resource.
3965 pub fn get_operation(&self) -> super::builder::images::GetOperation {
3966 super::builder::images::GetOperation::new(self.inner.clone())
3967 }
3968}
3969
3970/// Implements a client for the Google Compute Engine API.
3971///
3972/// # Example
3973/// ```
3974/// # use google_cloud_compute_v1::client::InstanceGroupManagerResizeRequests;
3975/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
3976/// let client = InstanceGroupManagerResizeRequests::builder().build().await?;
3977/// // use `client` to make requests to the Google Compute Engine API.
3978/// # Ok(()) }
3979/// ```
3980///
3981/// # Service Description
3982///
3983/// Service for the `instanceGroupManagerResizeRequests` resource.
3984///
3985/// # Configuration
3986///
3987/// To configure `InstanceGroupManagerResizeRequests` use the `with_*` methods in the type returned
3988/// by [builder()][InstanceGroupManagerResizeRequests::builder]. The default configuration should
3989/// work for most applications. Common configuration changes include
3990///
3991/// * [with_endpoint()]: by default this client uses the global default endpoint
3992/// (`https://compute.googleapis.com`). Applications using regional
3993/// endpoints or running in restricted networks (e.g. a network configured
3994// with [Private Google Access with VPC Service Controls]) may want to
3995/// override this default.
3996/// * [with_credentials()]: by default this client uses
3997/// [Application Default Credentials]. Applications using custom
3998/// authentication may need to override this default.
3999///
4000/// [with_endpoint()]: super::builder::instance_group_manager_resize_requests::ClientBuilder::with_endpoint
4001/// [with_credentials()]: super::builder::instance_group_manager_resize_requests::ClientBuilder::with_credentials
4002/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4003/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4004///
4005/// # Pooling and Cloning
4006///
4007/// `InstanceGroupManagerResizeRequests` holds a connection pool internally, it is advised to
4008/// create one and reuse it. You do not need to wrap `InstanceGroupManagerResizeRequests` in
4009/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4010/// already uses an `Arc` internally.
4011#[cfg(feature = "instance-group-manager-resize-requests")]
4012#[cfg_attr(docsrs, doc(cfg(feature = "instance-group-manager-resize-requests")))]
4013#[derive(Clone, Debug)]
4014pub struct InstanceGroupManagerResizeRequests {
4015 inner: std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagerResizeRequests>,
4016}
4017
4018#[cfg(feature = "instance-group-manager-resize-requests")]
4019impl InstanceGroupManagerResizeRequests {
4020 /// Returns a builder for [InstanceGroupManagerResizeRequests].
4021 ///
4022 /// ```
4023 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4024 /// # use google_cloud_compute_v1::client::InstanceGroupManagerResizeRequests;
4025 /// let client = InstanceGroupManagerResizeRequests::builder().build().await?;
4026 /// # Ok(()) }
4027 /// ```
4028 pub fn builder() -> super::builder::instance_group_manager_resize_requests::ClientBuilder {
4029 crate::new_client_builder(
4030 super::builder::instance_group_manager_resize_requests::client::Factory,
4031 )
4032 }
4033
4034 /// Creates a new client from the provided stub.
4035 ///
4036 /// The most common case for calling this function is in tests mocking the
4037 /// client's behavior.
4038 pub fn from_stub<T>(stub: T) -> Self
4039 where
4040 T: super::stub::InstanceGroupManagerResizeRequests + 'static,
4041 {
4042 Self {
4043 inner: std::sync::Arc::new(stub),
4044 }
4045 }
4046
4047 pub(crate) async fn new(
4048 config: gaxi::options::ClientConfig,
4049 ) -> crate::ClientBuilderResult<Self> {
4050 let inner = Self::build_inner(config).await?;
4051 Ok(Self { inner })
4052 }
4053
4054 async fn build_inner(
4055 conf: gaxi::options::ClientConfig,
4056 ) -> crate::ClientBuilderResult<
4057 std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagerResizeRequests>,
4058 > {
4059 if gaxi::options::tracing_enabled(&conf) {
4060 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4061 }
4062 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4063 }
4064
4065 async fn build_transport(
4066 conf: gaxi::options::ClientConfig,
4067 ) -> crate::ClientBuilderResult<impl super::stub::InstanceGroupManagerResizeRequests> {
4068 super::transport::InstanceGroupManagerResizeRequests::new(conf).await
4069 }
4070
4071 async fn build_with_tracing(
4072 conf: gaxi::options::ClientConfig,
4073 ) -> crate::ClientBuilderResult<impl super::stub::InstanceGroupManagerResizeRequests> {
4074 Self::build_transport(conf)
4075 .await
4076 .map(super::tracing::InstanceGroupManagerResizeRequests::new)
4077 }
4078
4079 /// Cancels the specified resize request and removes it from the queue.
4080 /// Cancelled resize request does no longer wait for the resources to be
4081 /// provisioned. Cancel is only possible for requests that are accepted in the
4082 /// queue.
4083 pub fn cancel(&self) -> super::builder::instance_group_manager_resize_requests::Cancel {
4084 super::builder::instance_group_manager_resize_requests::Cancel::new(self.inner.clone())
4085 }
4086
4087 /// Deletes the specified, inactive resize request. Requests that are still
4088 /// active cannot be deleted. Deleting request does not delete instances that
4089 /// were provisioned previously.
4090 pub fn delete(&self) -> super::builder::instance_group_manager_resize_requests::Delete {
4091 super::builder::instance_group_manager_resize_requests::Delete::new(self.inner.clone())
4092 }
4093
4094 /// Returns all of the details about the specified resize request.
4095 pub fn get(&self) -> super::builder::instance_group_manager_resize_requests::Get {
4096 super::builder::instance_group_manager_resize_requests::Get::new(self.inner.clone())
4097 }
4098
4099 /// Creates a new resize request that starts provisioning VMs immediately
4100 /// or queues VM creation.
4101 pub fn insert(&self) -> super::builder::instance_group_manager_resize_requests::Insert {
4102 super::builder::instance_group_manager_resize_requests::Insert::new(self.inner.clone())
4103 }
4104
4105 /// Retrieves a list of resize requests that are contained in the
4106 /// managed instance group.
4107 pub fn list(&self) -> super::builder::instance_group_manager_resize_requests::List {
4108 super::builder::instance_group_manager_resize_requests::List::new(self.inner.clone())
4109 }
4110
4111 /// Retrieves the specified zone-specific Operations resource.
4112 pub fn get_operation(
4113 &self,
4114 ) -> super::builder::instance_group_manager_resize_requests::GetOperation {
4115 super::builder::instance_group_manager_resize_requests::GetOperation::new(
4116 self.inner.clone(),
4117 )
4118 }
4119}
4120
4121/// Implements a client for the Google Compute Engine API.
4122///
4123/// # Example
4124/// ```
4125/// # use google_cloud_compute_v1::client::InstanceGroupManagers;
4126/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
4127/// let client = InstanceGroupManagers::builder().build().await?;
4128/// // use `client` to make requests to the Google Compute Engine API.
4129/// # Ok(()) }
4130/// ```
4131///
4132/// # Service Description
4133///
4134/// Service for the `instanceGroupManagers` resource.
4135///
4136/// # Configuration
4137///
4138/// To configure `InstanceGroupManagers` use the `with_*` methods in the type returned
4139/// by [builder()][InstanceGroupManagers::builder]. The default configuration should
4140/// work for most applications. Common configuration changes include
4141///
4142/// * [with_endpoint()]: by default this client uses the global default endpoint
4143/// (`https://compute.googleapis.com`). Applications using regional
4144/// endpoints or running in restricted networks (e.g. a network configured
4145// with [Private Google Access with VPC Service Controls]) may want to
4146/// override this default.
4147/// * [with_credentials()]: by default this client uses
4148/// [Application Default Credentials]. Applications using custom
4149/// authentication may need to override this default.
4150///
4151/// [with_endpoint()]: super::builder::instance_group_managers::ClientBuilder::with_endpoint
4152/// [with_credentials()]: super::builder::instance_group_managers::ClientBuilder::with_credentials
4153/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4154/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4155///
4156/// # Pooling and Cloning
4157///
4158/// `InstanceGroupManagers` holds a connection pool internally, it is advised to
4159/// create one and reuse it. You do not need to wrap `InstanceGroupManagers` in
4160/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4161/// already uses an `Arc` internally.
4162#[cfg(feature = "instance-group-managers")]
4163#[cfg_attr(docsrs, doc(cfg(feature = "instance-group-managers")))]
4164#[derive(Clone, Debug)]
4165pub struct InstanceGroupManagers {
4166 inner: std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagers>,
4167}
4168
4169#[cfg(feature = "instance-group-managers")]
4170impl InstanceGroupManagers {
4171 /// Returns a builder for [InstanceGroupManagers].
4172 ///
4173 /// ```
4174 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4175 /// # use google_cloud_compute_v1::client::InstanceGroupManagers;
4176 /// let client = InstanceGroupManagers::builder().build().await?;
4177 /// # Ok(()) }
4178 /// ```
4179 pub fn builder() -> super::builder::instance_group_managers::ClientBuilder {
4180 crate::new_client_builder(super::builder::instance_group_managers::client::Factory)
4181 }
4182
4183 /// Creates a new client from the provided stub.
4184 ///
4185 /// The most common case for calling this function is in tests mocking the
4186 /// client's behavior.
4187 pub fn from_stub<T>(stub: T) -> Self
4188 where
4189 T: super::stub::InstanceGroupManagers + 'static,
4190 {
4191 Self {
4192 inner: std::sync::Arc::new(stub),
4193 }
4194 }
4195
4196 pub(crate) async fn new(
4197 config: gaxi::options::ClientConfig,
4198 ) -> crate::ClientBuilderResult<Self> {
4199 let inner = Self::build_inner(config).await?;
4200 Ok(Self { inner })
4201 }
4202
4203 async fn build_inner(
4204 conf: gaxi::options::ClientConfig,
4205 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagers>>
4206 {
4207 if gaxi::options::tracing_enabled(&conf) {
4208 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4209 }
4210 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4211 }
4212
4213 async fn build_transport(
4214 conf: gaxi::options::ClientConfig,
4215 ) -> crate::ClientBuilderResult<impl super::stub::InstanceGroupManagers> {
4216 super::transport::InstanceGroupManagers::new(conf).await
4217 }
4218
4219 async fn build_with_tracing(
4220 conf: gaxi::options::ClientConfig,
4221 ) -> crate::ClientBuilderResult<impl super::stub::InstanceGroupManagers> {
4222 Self::build_transport(conf)
4223 .await
4224 .map(super::tracing::InstanceGroupManagers::new)
4225 }
4226
4227 /// Flags the specified instances to be removed from the
4228 /// managed instance group. Abandoning an instance does not delete the
4229 /// instance, but it does remove the instance from any target pools that are
4230 /// applied by the managed instance group. This method reduces thetargetSize of the managed instance group by the
4231 /// number of instances that you abandon. This operation is marked asDONE when the action is scheduled even if the instances have
4232 /// not yet been removed from the group. You must separately verify the
4233 /// status of the abandoning action with thelistmanagedinstances
4234 /// method.
4235 ///
4236 /// If the group is part of a backend
4237 /// service that has enabled
4238 /// connection draining, it can take up to 60 seconds after the connection
4239 /// draining duration has elapsed before the VM instance is removed or deleted.
4240 ///
4241 /// You can specify a maximum of 1000 instances with this method per request.
4242 pub fn abandon_instances(&self) -> super::builder::instance_group_managers::AbandonInstances {
4243 super::builder::instance_group_managers::AbandonInstances::new(self.inner.clone())
4244 }
4245
4246 /// Retrieves the list of managed instance groups and groups them by zone.
4247 ///
4248 /// To prevent failure, Google recommends that you set the
4249 /// `returnPartialSuccess` parameter to `true`.
4250 pub fn aggregated_list(&self) -> super::builder::instance_group_managers::AggregatedList {
4251 super::builder::instance_group_managers::AggregatedList::new(self.inner.clone())
4252 }
4253
4254 /// Applies changes to selected instances on the managed instance group.
4255 /// This method can be used to apply new overrides and/or new versions.
4256 pub fn apply_updates_to_instances(
4257 &self,
4258 ) -> super::builder::instance_group_managers::ApplyUpdatesToInstances {
4259 super::builder::instance_group_managers::ApplyUpdatesToInstances::new(self.inner.clone())
4260 }
4261
4262 /// Creates instances with per-instance configurations in this managed instance
4263 /// group. Instances are created using the current instance template. Thecreate instances operation is marked DONE if thecreateInstances request is successful. The underlying actions
4264 /// take additional time. You must separately verify the status of thecreating or actions with the listmanagedinstances
4265 /// method.
4266 pub fn create_instances(&self) -> super::builder::instance_group_managers::CreateInstances {
4267 super::builder::instance_group_managers::CreateInstances::new(self.inner.clone())
4268 }
4269
4270 /// Deletes the specified managed instance group and all of the instances
4271 /// in that group. Note that the instance group must not belong to a
4272 /// backend service. Read
4273 /// Deleting an instance group for more information.
4274 pub fn delete(&self) -> super::builder::instance_group_managers::Delete {
4275 super::builder::instance_group_managers::Delete::new(self.inner.clone())
4276 }
4277
4278 /// Flags the specified instances in the managed instance group for immediate
4279 /// deletion. The instances are also removed from any target
4280 /// pools of which they were a member. This method reduces thetargetSize of the managed instance group by the number of
4281 /// instances that you delete. This operation is marked as DONE
4282 /// when the action is scheduled even if the instances are still being deleted.
4283 /// You must separately verify the status of the deleting action
4284 /// with thelistmanagedinstances
4285 /// method.
4286 ///
4287 /// If the group is part of a backend
4288 /// service that has enabled
4289 /// connection draining, it can take up to 60 seconds after the connection
4290 /// draining duration has elapsed before the VM instance is removed or deleted.
4291 ///
4292 /// You can specify a maximum of 1000 instances with this method per request.
4293 pub fn delete_instances(&self) -> super::builder::instance_group_managers::DeleteInstances {
4294 super::builder::instance_group_managers::DeleteInstances::new(self.inner.clone())
4295 }
4296
4297 /// Deletes selected per-instance configurations for the managed instance
4298 /// group.
4299 pub fn delete_per_instance_configs(
4300 &self,
4301 ) -> super::builder::instance_group_managers::DeletePerInstanceConfigs {
4302 super::builder::instance_group_managers::DeletePerInstanceConfigs::new(self.inner.clone())
4303 }
4304
4305 /// Returns all of the details about the specified managed instance group.
4306 pub fn get(&self) -> super::builder::instance_group_managers::Get {
4307 super::builder::instance_group_managers::Get::new(self.inner.clone())
4308 }
4309
4310 /// Creates a managed instance group using the information that you specify
4311 /// in the request. After the group is created, instances in the group are
4312 /// created using the specified instance template.
4313 /// This operation is marked as DONE when the group is created
4314 /// even if the instances in the group have not yet been created. You
4315 /// must separately verify the status of the individual instances with thelistmanagedinstances
4316 /// method.
4317 ///
4318 /// A managed instance group can have up to 1000 VM instances per group. Please
4319 /// contact Cloud Support if you need an increase in
4320 /// this limit.
4321 pub fn insert(&self) -> super::builder::instance_group_managers::Insert {
4322 super::builder::instance_group_managers::Insert::new(self.inner.clone())
4323 }
4324
4325 /// Retrieves a list of managed instance groups that are contained within the
4326 /// specified project and zone.
4327 pub fn list(&self) -> super::builder::instance_group_managers::List {
4328 super::builder::instance_group_managers::List::new(self.inner.clone())
4329 }
4330
4331 /// Lists all errors thrown by actions on instances for a given managed
4332 /// instance group. The filter and orderBy query
4333 /// parameters are not supported.
4334 pub fn list_errors(&self) -> super::builder::instance_group_managers::ListErrors {
4335 super::builder::instance_group_managers::ListErrors::new(self.inner.clone())
4336 }
4337
4338 /// Lists all of the instances in the managed instance group. Each instance
4339 /// in the list has a currentAction, which indicates the action
4340 /// that the managed instance group is performing on the instance. For example,
4341 /// if the group is still creating an instance, the currentAction
4342 /// is CREATING. If a previous action failed, the
4343 /// list displays the errors for that failed action. The orderBy
4344 /// query parameter is not supported. The `pageToken` query parameter is
4345 /// supported only if the group's `listManagedInstancesResults` field is set
4346 /// to `PAGINATED`.
4347 pub fn list_managed_instances(
4348 &self,
4349 ) -> super::builder::instance_group_managers::ListManagedInstances {
4350 super::builder::instance_group_managers::ListManagedInstances::new(self.inner.clone())
4351 }
4352
4353 /// Lists all of the per-instance configurations defined for the managed
4354 /// instance group. The orderBy query parameter is not supported.
4355 pub fn list_per_instance_configs(
4356 &self,
4357 ) -> super::builder::instance_group_managers::ListPerInstanceConfigs {
4358 super::builder::instance_group_managers::ListPerInstanceConfigs::new(self.inner.clone())
4359 }
4360
4361 /// Updates a managed instance group using the information that you specify
4362 /// in the request.
4363 /// This operation is marked as DONE when the group is patched
4364 /// even if the instances in the group are still in the process of being
4365 /// patched. You must separately verify the status of the individual instances
4366 /// with thelistManagedInstances
4367 /// method. This method supportsPATCH
4368 /// semantics and uses theJSON merge
4369 /// patch format and processing rules.
4370 ///
4371 /// If you update your group to specify a new template or instance
4372 /// configuration, it's possible that your intended specification for each VM
4373 /// in the group is different from the current state of that VM. To learn how
4374 /// to apply an updated configuration to the VMs in a MIG, seeUpdating instances in
4375 /// a MIG.
4376 pub fn patch(&self) -> super::builder::instance_group_managers::Patch {
4377 super::builder::instance_group_managers::Patch::new(self.inner.clone())
4378 }
4379
4380 /// Inserts or patches per-instance configurations for the managed instance
4381 /// group. perInstanceConfig.name serves as a key used to
4382 /// distinguish whether to perform insert or patch.
4383 pub fn patch_per_instance_configs(
4384 &self,
4385 ) -> super::builder::instance_group_managers::PatchPerInstanceConfigs {
4386 super::builder::instance_group_managers::PatchPerInstanceConfigs::new(self.inner.clone())
4387 }
4388
4389 /// Flags the specified VM instances in the managed instance group to be
4390 /// immediately recreated. Each instance is recreated using the group's current
4391 /// configuration. This operation is marked as DONE when the flag
4392 /// is set even if the instances have not yet been recreated. You must
4393 /// separately verify the status of each instance by checking itscurrentAction field; for more information, see Checking
4394 /// the status of managed instances.
4395 ///
4396 /// If the group is part of a backend
4397 /// service that has enabled
4398 /// connection draining, it can take up to 60 seconds after the connection
4399 /// draining duration has elapsed before the VM instance is removed or deleted.
4400 ///
4401 /// You can specify a maximum of 1000 instances with this method per request.
4402 pub fn recreate_instances(&self) -> super::builder::instance_group_managers::RecreateInstances {
4403 super::builder::instance_group_managers::RecreateInstances::new(self.inner.clone())
4404 }
4405
4406 /// Resizes the managed instance group. If you increase the size, the group
4407 /// creates new instances using the current instance template. If you decrease
4408 /// the size, the group deletes instances. The resize operation is markedDONE when the resize actions are scheduled even if the group
4409 /// has not yet added or deleted any instances. You must separately
4410 /// verify the status of the creating or deleting
4411 /// actions with thelistmanagedinstances
4412 /// method.
4413 ///
4414 /// When resizing down, the instance group arbitrarily chooses the order in
4415 /// which VMs are deleted. The group takes into account some VM attributes when
4416 /// making the selection including:
4417 ///
4418 /// + The status of the VM instance.
4419 /// + The health of the VM instance.
4420 /// + The instance template version the VM is based on.
4421 /// + For regional managed instance groups, the location of the VM instance.
4422 ///
4423 /// This list is subject to change.
4424 ///
4425 /// If the group is part of a backend
4426 /// service that has enabled
4427 /// connection draining, it can take up to 60 seconds after the connection
4428 /// draining duration has elapsed before the VM instance is removed or deleted.
4429 pub fn resize(&self) -> super::builder::instance_group_managers::Resize {
4430 super::builder::instance_group_managers::Resize::new(self.inner.clone())
4431 }
4432
4433 /// Flags the specified instances in the managed instance group to be
4434 /// resumed. This method increases thetargetSize and decreases the targetSuspendedSize
4435 /// of the managed instance group by the number of instances that you resume.
4436 /// The resumeInstances operation is marked DONE if
4437 /// the resumeInstances request is successful. The underlying
4438 /// actions take additional time. You must separately verify the status of theRESUMING action with thelistmanagedinstances
4439 /// method.
4440 ///
4441 /// In this request, you can only specify instances that are suspended. For
4442 /// example, if an instance was previously suspended using the suspendInstances
4443 /// method, it can be resumed using the resumeInstances method.
4444 ///
4445 /// If a health check is attached to the managed instance group, the specified
4446 /// instances will be verified as healthy after they are resumed.
4447 ///
4448 /// You can specify a maximum of 1000 instances with this method per request.
4449 pub fn resume_instances(&self) -> super::builder::instance_group_managers::ResumeInstances {
4450 super::builder::instance_group_managers::ResumeInstances::new(self.inner.clone())
4451 }
4452
4453 /// Specifies the instance template to use when creating new instances in this
4454 /// group. The templates for existing instances in the group do not change
4455 /// unless you run recreateInstances, runapplyUpdatesToInstances, or set the group'supdatePolicy.type to PROACTIVE.
4456 pub fn set_instance_template(
4457 &self,
4458 ) -> super::builder::instance_group_managers::SetInstanceTemplate {
4459 super::builder::instance_group_managers::SetInstanceTemplate::new(self.inner.clone())
4460 }
4461
4462 /// Modifies the target pools to which all instances in this managed instance
4463 /// group are assigned. The target pools automatically apply to all of the
4464 /// instances in the managed instance group. This operation is markedDONE when you make the request even if the instances have not
4465 /// yet been added to their target pools. The change might take some time to
4466 /// apply to all of the instances in the group depending on the size of the
4467 /// group.
4468 pub fn set_target_pools(&self) -> super::builder::instance_group_managers::SetTargetPools {
4469 super::builder::instance_group_managers::SetTargetPools::new(self.inner.clone())
4470 }
4471
4472 /// Flags the specified instances in the managed instance group to be
4473 /// started. This method increases thetargetSize and decreases the targetStoppedSize
4474 /// of the managed instance group by the number of instances that you start.
4475 /// The startInstances operation is marked DONE if
4476 /// the startInstances request is successful. The underlying
4477 /// actions take additional time. You must separately verify the status of theSTARTING action with thelistmanagedinstances
4478 /// method.
4479 ///
4480 /// In this request, you can only specify instances that are stopped. For
4481 /// example, if an instance was previously stopped using the stopInstances
4482 /// method, it can be started using the startInstances method.
4483 ///
4484 /// If a health check is attached to the managed instance group, the specified
4485 /// instances will be verified as healthy after they are started.
4486 ///
4487 /// You can specify a maximum of 1000 instances with this method per request.
4488 pub fn start_instances(&self) -> super::builder::instance_group_managers::StartInstances {
4489 super::builder::instance_group_managers::StartInstances::new(self.inner.clone())
4490 }
4491
4492 /// Flags the specified instances in the managed instance group to be
4493 /// immediately stopped. You can only specify instances that are running in
4494 /// this request. This method reduces thetargetSize and increases the targetStoppedSize
4495 /// of the managed instance group by the number of instances that you stop.
4496 /// The stopInstances operation is marked DONE if
4497 /// the stopInstances request is successful. The underlying
4498 /// actions take additional time. You must separately verify the status of theSTOPPING action with thelistmanagedinstances
4499 /// method.
4500 ///
4501 /// If the standbyPolicy.initialDelaySec field is set, the group
4502 /// delays stopping the instances until initialDelaySec have
4503 /// passed from instance.creationTimestamp (that is, when the
4504 /// instance was created). This delay gives your application time to
4505 /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
4506 /// will be zero delay.
4507 ///
4508 /// If the group is part of a backend
4509 /// service that has enabled
4510 /// connection draining, it can take up to 60 seconds after the connection
4511 /// draining duration has elapsed before the VM instance is stopped.
4512 ///
4513 /// Stopped instances can be started using the startInstances
4514 /// method.
4515 ///
4516 /// You can specify a maximum of 1000 instances with this method per request.
4517 pub fn stop_instances(&self) -> super::builder::instance_group_managers::StopInstances {
4518 super::builder::instance_group_managers::StopInstances::new(self.inner.clone())
4519 }
4520
4521 /// Flags the specified instances in the managed instance group to be
4522 /// immediately suspended. You can only specify instances that are running in
4523 /// this request. This method reduces thetargetSize and increases the targetSuspendedSize
4524 /// of the managed instance group by the number of instances that you suspend.
4525 /// The suspendInstances operation is marked DONE if
4526 /// the suspendInstances request is successful. The underlying
4527 /// actions take additional time. You must separately verify the status of theSUSPENDING action with thelistmanagedinstances
4528 /// method.
4529 ///
4530 /// If the standbyPolicy.initialDelaySec field is set, the group
4531 /// delays suspension of the instances until initialDelaySec have
4532 /// passed from instance.creationTimestamp (that is, when the
4533 /// instance was created). This delay gives your application time to
4534 /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
4535 /// will be zero delay.
4536 ///
4537 /// If the group is part of a backend
4538 /// service that has enabled
4539 /// connection draining, it can take up to 60 seconds after the connection
4540 /// draining duration has elapsed before the VM instance is suspended.
4541 ///
4542 /// Suspended instances can be resumed using the resumeInstances
4543 /// method.
4544 ///
4545 /// You can specify a maximum of 1000 instances with this method per request.
4546 pub fn suspend_instances(&self) -> super::builder::instance_group_managers::SuspendInstances {
4547 super::builder::instance_group_managers::SuspendInstances::new(self.inner.clone())
4548 }
4549
4550 /// Inserts or updates per-instance configurations for the managed instance
4551 /// group. perInstanceConfig.name serves as a key used to
4552 /// distinguish whether to perform insert or patch.
4553 pub fn update_per_instance_configs(
4554 &self,
4555 ) -> super::builder::instance_group_managers::UpdatePerInstanceConfigs {
4556 super::builder::instance_group_managers::UpdatePerInstanceConfigs::new(self.inner.clone())
4557 }
4558
4559 /// Retrieves the specified zone-specific Operations resource.
4560 pub fn get_operation(&self) -> super::builder::instance_group_managers::GetOperation {
4561 super::builder::instance_group_managers::GetOperation::new(self.inner.clone())
4562 }
4563}
4564
4565/// Implements a client for the Google Compute Engine API.
4566///
4567/// # Example
4568/// ```
4569/// # use google_cloud_compute_v1::client::InstanceGroups;
4570/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
4571/// let client = InstanceGroups::builder().build().await?;
4572/// // use `client` to make requests to the Google Compute Engine API.
4573/// # Ok(()) }
4574/// ```
4575///
4576/// # Service Description
4577///
4578/// Service for the `instanceGroups` resource.
4579///
4580/// # Configuration
4581///
4582/// To configure `InstanceGroups` use the `with_*` methods in the type returned
4583/// by [builder()][InstanceGroups::builder]. The default configuration should
4584/// work for most applications. Common configuration changes include
4585///
4586/// * [with_endpoint()]: by default this client uses the global default endpoint
4587/// (`https://compute.googleapis.com`). Applications using regional
4588/// endpoints or running in restricted networks (e.g. a network configured
4589// with [Private Google Access with VPC Service Controls]) may want to
4590/// override this default.
4591/// * [with_credentials()]: by default this client uses
4592/// [Application Default Credentials]. Applications using custom
4593/// authentication may need to override this default.
4594///
4595/// [with_endpoint()]: super::builder::instance_groups::ClientBuilder::with_endpoint
4596/// [with_credentials()]: super::builder::instance_groups::ClientBuilder::with_credentials
4597/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4598/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4599///
4600/// # Pooling and Cloning
4601///
4602/// `InstanceGroups` holds a connection pool internally, it is advised to
4603/// create one and reuse it. You do not need to wrap `InstanceGroups` in
4604/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4605/// already uses an `Arc` internally.
4606#[cfg(feature = "instance-groups")]
4607#[cfg_attr(docsrs, doc(cfg(feature = "instance-groups")))]
4608#[derive(Clone, Debug)]
4609pub struct InstanceGroups {
4610 inner: std::sync::Arc<dyn super::stub::dynamic::InstanceGroups>,
4611}
4612
4613#[cfg(feature = "instance-groups")]
4614impl InstanceGroups {
4615 /// Returns a builder for [InstanceGroups].
4616 ///
4617 /// ```
4618 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4619 /// # use google_cloud_compute_v1::client::InstanceGroups;
4620 /// let client = InstanceGroups::builder().build().await?;
4621 /// # Ok(()) }
4622 /// ```
4623 pub fn builder() -> super::builder::instance_groups::ClientBuilder {
4624 crate::new_client_builder(super::builder::instance_groups::client::Factory)
4625 }
4626
4627 /// Creates a new client from the provided stub.
4628 ///
4629 /// The most common case for calling this function is in tests mocking the
4630 /// client's behavior.
4631 pub fn from_stub<T>(stub: T) -> Self
4632 where
4633 T: super::stub::InstanceGroups + 'static,
4634 {
4635 Self {
4636 inner: std::sync::Arc::new(stub),
4637 }
4638 }
4639
4640 pub(crate) async fn new(
4641 config: gaxi::options::ClientConfig,
4642 ) -> crate::ClientBuilderResult<Self> {
4643 let inner = Self::build_inner(config).await?;
4644 Ok(Self { inner })
4645 }
4646
4647 async fn build_inner(
4648 conf: gaxi::options::ClientConfig,
4649 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InstanceGroups>> {
4650 if gaxi::options::tracing_enabled(&conf) {
4651 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4652 }
4653 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4654 }
4655
4656 async fn build_transport(
4657 conf: gaxi::options::ClientConfig,
4658 ) -> crate::ClientBuilderResult<impl super::stub::InstanceGroups> {
4659 super::transport::InstanceGroups::new(conf).await
4660 }
4661
4662 async fn build_with_tracing(
4663 conf: gaxi::options::ClientConfig,
4664 ) -> crate::ClientBuilderResult<impl super::stub::InstanceGroups> {
4665 Self::build_transport(conf)
4666 .await
4667 .map(super::tracing::InstanceGroups::new)
4668 }
4669
4670 /// Adds a list of instances to the specified instance group. All of the
4671 /// instances in the instance group must be in the same network/subnetwork.
4672 /// Read
4673 /// Adding instances for more information.
4674 pub fn add_instances(&self) -> super::builder::instance_groups::AddInstances {
4675 super::builder::instance_groups::AddInstances::new(self.inner.clone())
4676 }
4677
4678 /// Retrieves the list of instance groups and sorts them by zone.
4679 ///
4680 /// To prevent failure, Google recommends that you set the
4681 /// `returnPartialSuccess` parameter to `true`.
4682 pub fn aggregated_list(&self) -> super::builder::instance_groups::AggregatedList {
4683 super::builder::instance_groups::AggregatedList::new(self.inner.clone())
4684 }
4685
4686 /// Deletes the specified instance group. The instances in the group are not
4687 /// deleted. Note that instance group must not belong to a backend service.
4688 /// Read
4689 /// Deleting an instance group for more information.
4690 pub fn delete(&self) -> super::builder::instance_groups::Delete {
4691 super::builder::instance_groups::Delete::new(self.inner.clone())
4692 }
4693
4694 /// Returns the specified zonal instance group. Get a list of available zonal
4695 /// instance groups by making a list() request.
4696 ///
4697 /// For managed instance groups, use theinstanceGroupManagers
4698 /// or regionInstanceGroupManagers
4699 /// methods instead.
4700 pub fn get(&self) -> super::builder::instance_groups::Get {
4701 super::builder::instance_groups::Get::new(self.inner.clone())
4702 }
4703
4704 /// Creates an instance group in the specified project using the
4705 /// parameters that are included in the request.
4706 pub fn insert(&self) -> super::builder::instance_groups::Insert {
4707 super::builder::instance_groups::Insert::new(self.inner.clone())
4708 }
4709
4710 /// Retrieves the list of zonal instance group resources contained within the
4711 /// specified zone.
4712 ///
4713 /// For managed instance groups, use theinstanceGroupManagers
4714 /// or regionInstanceGroupManagers
4715 /// methods instead.
4716 pub fn list(&self) -> super::builder::instance_groups::List {
4717 super::builder::instance_groups::List::new(self.inner.clone())
4718 }
4719
4720 /// Lists the instances in the specified instance group.
4721 /// The orderBy query parameter is not supported.
4722 /// The filter query parameter is supported, but only for
4723 /// expressions that use `eq` (equal) or `ne` (not equal) operators.
4724 pub fn list_instances(&self) -> super::builder::instance_groups::ListInstances {
4725 super::builder::instance_groups::ListInstances::new(self.inner.clone())
4726 }
4727
4728 /// Removes one or more instances from the specified instance group, but does
4729 /// not delete those instances.
4730 ///
4731 /// If the group is part of a backend
4732 /// service that has enabled
4733 /// connection draining, it can take up to 60 seconds after the connection
4734 /// draining duration before the VM instance is removed or deleted.
4735 pub fn remove_instances(&self) -> super::builder::instance_groups::RemoveInstances {
4736 super::builder::instance_groups::RemoveInstances::new(self.inner.clone())
4737 }
4738
4739 /// Sets the named ports for the specified instance group.
4740 pub fn set_named_ports(&self) -> super::builder::instance_groups::SetNamedPorts {
4741 super::builder::instance_groups::SetNamedPorts::new(self.inner.clone())
4742 }
4743
4744 /// Returns permissions that a caller has on the specified resource.
4745 pub fn test_iam_permissions(&self) -> super::builder::instance_groups::TestIamPermissions {
4746 super::builder::instance_groups::TestIamPermissions::new(self.inner.clone())
4747 }
4748
4749 /// Retrieves the specified zone-specific Operations resource.
4750 pub fn get_operation(&self) -> super::builder::instance_groups::GetOperation {
4751 super::builder::instance_groups::GetOperation::new(self.inner.clone())
4752 }
4753}
4754
4755/// Implements a client for the Google Compute Engine API.
4756///
4757/// # Example
4758/// ```
4759/// # use google_cloud_compute_v1::client::InstanceSettings;
4760/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
4761/// let client = InstanceSettings::builder().build().await?;
4762/// // use `client` to make requests to the Google Compute Engine API.
4763/// # Ok(()) }
4764/// ```
4765///
4766/// # Service Description
4767///
4768/// Service for the `instanceSettings` resource.
4769///
4770/// # Configuration
4771///
4772/// To configure `InstanceSettings` use the `with_*` methods in the type returned
4773/// by [builder()][InstanceSettings::builder]. The default configuration should
4774/// work for most applications. Common configuration changes include
4775///
4776/// * [with_endpoint()]: by default this client uses the global default endpoint
4777/// (`https://compute.googleapis.com`). Applications using regional
4778/// endpoints or running in restricted networks (e.g. a network configured
4779// with [Private Google Access with VPC Service Controls]) may want to
4780/// override this default.
4781/// * [with_credentials()]: by default this client uses
4782/// [Application Default Credentials]. Applications using custom
4783/// authentication may need to override this default.
4784///
4785/// [with_endpoint()]: super::builder::instance_settings::ClientBuilder::with_endpoint
4786/// [with_credentials()]: super::builder::instance_settings::ClientBuilder::with_credentials
4787/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4788/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4789///
4790/// # Pooling and Cloning
4791///
4792/// `InstanceSettings` holds a connection pool internally, it is advised to
4793/// create one and reuse it. You do not need to wrap `InstanceSettings` in
4794/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4795/// already uses an `Arc` internally.
4796#[cfg(feature = "instance-settings")]
4797#[cfg_attr(docsrs, doc(cfg(feature = "instance-settings")))]
4798#[derive(Clone, Debug)]
4799pub struct InstanceSettings {
4800 inner: std::sync::Arc<dyn super::stub::dynamic::InstanceSettings>,
4801}
4802
4803#[cfg(feature = "instance-settings")]
4804impl InstanceSettings {
4805 /// Returns a builder for [InstanceSettings].
4806 ///
4807 /// ```
4808 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4809 /// # use google_cloud_compute_v1::client::InstanceSettings;
4810 /// let client = InstanceSettings::builder().build().await?;
4811 /// # Ok(()) }
4812 /// ```
4813 pub fn builder() -> super::builder::instance_settings::ClientBuilder {
4814 crate::new_client_builder(super::builder::instance_settings::client::Factory)
4815 }
4816
4817 /// Creates a new client from the provided stub.
4818 ///
4819 /// The most common case for calling this function is in tests mocking the
4820 /// client's behavior.
4821 pub fn from_stub<T>(stub: T) -> Self
4822 where
4823 T: super::stub::InstanceSettings + 'static,
4824 {
4825 Self {
4826 inner: std::sync::Arc::new(stub),
4827 }
4828 }
4829
4830 pub(crate) async fn new(
4831 config: gaxi::options::ClientConfig,
4832 ) -> crate::ClientBuilderResult<Self> {
4833 let inner = Self::build_inner(config).await?;
4834 Ok(Self { inner })
4835 }
4836
4837 async fn build_inner(
4838 conf: gaxi::options::ClientConfig,
4839 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InstanceSettings>>
4840 {
4841 if gaxi::options::tracing_enabled(&conf) {
4842 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4843 }
4844 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4845 }
4846
4847 async fn build_transport(
4848 conf: gaxi::options::ClientConfig,
4849 ) -> crate::ClientBuilderResult<impl super::stub::InstanceSettings> {
4850 super::transport::InstanceSettings::new(conf).await
4851 }
4852
4853 async fn build_with_tracing(
4854 conf: gaxi::options::ClientConfig,
4855 ) -> crate::ClientBuilderResult<impl super::stub::InstanceSettings> {
4856 Self::build_transport(conf)
4857 .await
4858 .map(super::tracing::InstanceSettings::new)
4859 }
4860
4861 /// Get Instance settings.
4862 pub fn get(&self) -> super::builder::instance_settings::Get {
4863 super::builder::instance_settings::Get::new(self.inner.clone())
4864 }
4865
4866 /// Patch Instance settings
4867 pub fn patch(&self) -> super::builder::instance_settings::Patch {
4868 super::builder::instance_settings::Patch::new(self.inner.clone())
4869 }
4870
4871 /// Retrieves the specified zone-specific Operations resource.
4872 pub fn get_operation(&self) -> super::builder::instance_settings::GetOperation {
4873 super::builder::instance_settings::GetOperation::new(self.inner.clone())
4874 }
4875}
4876
4877/// Implements a client for the Google Compute Engine API.
4878///
4879/// # Example
4880/// ```
4881/// # use google_cloud_compute_v1::client::InstanceTemplates;
4882/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
4883/// let client = InstanceTemplates::builder().build().await?;
4884/// // use `client` to make requests to the Google Compute Engine API.
4885/// # Ok(()) }
4886/// ```
4887///
4888/// # Service Description
4889///
4890/// Service for the `instanceTemplates` resource.
4891///
4892/// # Configuration
4893///
4894/// To configure `InstanceTemplates` use the `with_*` methods in the type returned
4895/// by [builder()][InstanceTemplates::builder]. The default configuration should
4896/// work for most applications. Common configuration changes include
4897///
4898/// * [with_endpoint()]: by default this client uses the global default endpoint
4899/// (`https://compute.googleapis.com`). Applications using regional
4900/// endpoints or running in restricted networks (e.g. a network configured
4901// with [Private Google Access with VPC Service Controls]) may want to
4902/// override this default.
4903/// * [with_credentials()]: by default this client uses
4904/// [Application Default Credentials]. Applications using custom
4905/// authentication may need to override this default.
4906///
4907/// [with_endpoint()]: super::builder::instance_templates::ClientBuilder::with_endpoint
4908/// [with_credentials()]: super::builder::instance_templates::ClientBuilder::with_credentials
4909/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4910/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4911///
4912/// # Pooling and Cloning
4913///
4914/// `InstanceTemplates` holds a connection pool internally, it is advised to
4915/// create one and reuse it. You do not need to wrap `InstanceTemplates` in
4916/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4917/// already uses an `Arc` internally.
4918#[cfg(feature = "instance-templates")]
4919#[cfg_attr(docsrs, doc(cfg(feature = "instance-templates")))]
4920#[derive(Clone, Debug)]
4921pub struct InstanceTemplates {
4922 inner: std::sync::Arc<dyn super::stub::dynamic::InstanceTemplates>,
4923}
4924
4925#[cfg(feature = "instance-templates")]
4926impl InstanceTemplates {
4927 /// Returns a builder for [InstanceTemplates].
4928 ///
4929 /// ```
4930 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4931 /// # use google_cloud_compute_v1::client::InstanceTemplates;
4932 /// let client = InstanceTemplates::builder().build().await?;
4933 /// # Ok(()) }
4934 /// ```
4935 pub fn builder() -> super::builder::instance_templates::ClientBuilder {
4936 crate::new_client_builder(super::builder::instance_templates::client::Factory)
4937 }
4938
4939 /// Creates a new client from the provided stub.
4940 ///
4941 /// The most common case for calling this function is in tests mocking the
4942 /// client's behavior.
4943 pub fn from_stub<T>(stub: T) -> Self
4944 where
4945 T: super::stub::InstanceTemplates + 'static,
4946 {
4947 Self {
4948 inner: std::sync::Arc::new(stub),
4949 }
4950 }
4951
4952 pub(crate) async fn new(
4953 config: gaxi::options::ClientConfig,
4954 ) -> crate::ClientBuilderResult<Self> {
4955 let inner = Self::build_inner(config).await?;
4956 Ok(Self { inner })
4957 }
4958
4959 async fn build_inner(
4960 conf: gaxi::options::ClientConfig,
4961 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InstanceTemplates>>
4962 {
4963 if gaxi::options::tracing_enabled(&conf) {
4964 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4965 }
4966 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4967 }
4968
4969 async fn build_transport(
4970 conf: gaxi::options::ClientConfig,
4971 ) -> crate::ClientBuilderResult<impl super::stub::InstanceTemplates> {
4972 super::transport::InstanceTemplates::new(conf).await
4973 }
4974
4975 async fn build_with_tracing(
4976 conf: gaxi::options::ClientConfig,
4977 ) -> crate::ClientBuilderResult<impl super::stub::InstanceTemplates> {
4978 Self::build_transport(conf)
4979 .await
4980 .map(super::tracing::InstanceTemplates::new)
4981 }
4982
4983 /// Retrieves the list of all InstanceTemplates resources, regional and global,
4984 /// available to the specified project.
4985 ///
4986 /// To prevent failure, Google recommends that you set the
4987 /// `returnPartialSuccess` parameter to `true`.
4988 pub fn aggregated_list(&self) -> super::builder::instance_templates::AggregatedList {
4989 super::builder::instance_templates::AggregatedList::new(self.inner.clone())
4990 }
4991
4992 /// Deletes the specified instance template. Deleting an instance template is
4993 /// permanent and cannot be undone. It is not possible to delete templates
4994 /// that are already in use by a managed instance group.
4995 pub fn delete(&self) -> super::builder::instance_templates::Delete {
4996 super::builder::instance_templates::Delete::new(self.inner.clone())
4997 }
4998
4999 /// Returns the specified instance template.
5000 pub fn get(&self) -> super::builder::instance_templates::Get {
5001 super::builder::instance_templates::Get::new(self.inner.clone())
5002 }
5003
5004 /// Gets the access control policy for a resource. May be empty if no such
5005 /// policy or resource exists.
5006 pub fn get_iam_policy(&self) -> super::builder::instance_templates::GetIamPolicy {
5007 super::builder::instance_templates::GetIamPolicy::new(self.inner.clone())
5008 }
5009
5010 /// Creates an instance template in the specified project using the
5011 /// data that is included in the request. If you are creating a new template to
5012 /// update an existing instance group, your new instance template must use the
5013 /// same network or, if applicable, the same subnetwork as the original
5014 /// template.
5015 pub fn insert(&self) -> super::builder::instance_templates::Insert {
5016 super::builder::instance_templates::Insert::new(self.inner.clone())
5017 }
5018
5019 /// Retrieves a list of instance templates that are contained within
5020 /// the specified project.
5021 pub fn list(&self) -> super::builder::instance_templates::List {
5022 super::builder::instance_templates::List::new(self.inner.clone())
5023 }
5024
5025 /// Sets the access control policy on the specified resource.
5026 /// Replaces any existing policy.
5027 pub fn set_iam_policy(&self) -> super::builder::instance_templates::SetIamPolicy {
5028 super::builder::instance_templates::SetIamPolicy::new(self.inner.clone())
5029 }
5030
5031 /// Returns permissions that a caller has on the specified resource.
5032 pub fn test_iam_permissions(&self) -> super::builder::instance_templates::TestIamPermissions {
5033 super::builder::instance_templates::TestIamPermissions::new(self.inner.clone())
5034 }
5035
5036 /// Retrieves the specified Operations resource.
5037 pub fn get_operation(&self) -> super::builder::instance_templates::GetOperation {
5038 super::builder::instance_templates::GetOperation::new(self.inner.clone())
5039 }
5040}
5041
5042/// Implements a client for the Google Compute Engine API.
5043///
5044/// # Example
5045/// ```
5046/// # use google_cloud_compute_v1::client::Instances;
5047/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
5048/// let client = Instances::builder().build().await?;
5049/// // use `client` to make requests to the Google Compute Engine API.
5050/// # Ok(()) }
5051/// ```
5052///
5053/// # Service Description
5054///
5055/// Service for the `instances` resource.
5056///
5057/// # Configuration
5058///
5059/// To configure `Instances` use the `with_*` methods in the type returned
5060/// by [builder()][Instances::builder]. The default configuration should
5061/// work for most applications. Common configuration changes include
5062///
5063/// * [with_endpoint()]: by default this client uses the global default endpoint
5064/// (`https://compute.googleapis.com`). Applications using regional
5065/// endpoints or running in restricted networks (e.g. a network configured
5066// with [Private Google Access with VPC Service Controls]) may want to
5067/// override this default.
5068/// * [with_credentials()]: by default this client uses
5069/// [Application Default Credentials]. Applications using custom
5070/// authentication may need to override this default.
5071///
5072/// [with_endpoint()]: super::builder::instances::ClientBuilder::with_endpoint
5073/// [with_credentials()]: super::builder::instances::ClientBuilder::with_credentials
5074/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5075/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5076///
5077/// # Pooling and Cloning
5078///
5079/// `Instances` holds a connection pool internally, it is advised to
5080/// create one and reuse it. You do not need to wrap `Instances` in
5081/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5082/// already uses an `Arc` internally.
5083#[cfg(feature = "instances")]
5084#[cfg_attr(docsrs, doc(cfg(feature = "instances")))]
5085#[derive(Clone, Debug)]
5086pub struct Instances {
5087 inner: std::sync::Arc<dyn super::stub::dynamic::Instances>,
5088}
5089
5090#[cfg(feature = "instances")]
5091impl Instances {
5092 /// Returns a builder for [Instances].
5093 ///
5094 /// ```
5095 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5096 /// # use google_cloud_compute_v1::client::Instances;
5097 /// let client = Instances::builder().build().await?;
5098 /// # Ok(()) }
5099 /// ```
5100 pub fn builder() -> super::builder::instances::ClientBuilder {
5101 crate::new_client_builder(super::builder::instances::client::Factory)
5102 }
5103
5104 /// Creates a new client from the provided stub.
5105 ///
5106 /// The most common case for calling this function is in tests mocking the
5107 /// client's behavior.
5108 pub fn from_stub<T>(stub: T) -> Self
5109 where
5110 T: super::stub::Instances + 'static,
5111 {
5112 Self {
5113 inner: std::sync::Arc::new(stub),
5114 }
5115 }
5116
5117 pub(crate) async fn new(
5118 config: gaxi::options::ClientConfig,
5119 ) -> crate::ClientBuilderResult<Self> {
5120 let inner = Self::build_inner(config).await?;
5121 Ok(Self { inner })
5122 }
5123
5124 async fn build_inner(
5125 conf: gaxi::options::ClientConfig,
5126 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Instances>> {
5127 if gaxi::options::tracing_enabled(&conf) {
5128 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5129 }
5130 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5131 }
5132
5133 async fn build_transport(
5134 conf: gaxi::options::ClientConfig,
5135 ) -> crate::ClientBuilderResult<impl super::stub::Instances> {
5136 super::transport::Instances::new(conf).await
5137 }
5138
5139 async fn build_with_tracing(
5140 conf: gaxi::options::ClientConfig,
5141 ) -> crate::ClientBuilderResult<impl super::stub::Instances> {
5142 Self::build_transport(conf)
5143 .await
5144 .map(super::tracing::Instances::new)
5145 }
5146
5147 /// Adds an access config to an instance's network interface.
5148 pub fn add_access_config(&self) -> super::builder::instances::AddAccessConfig {
5149 super::builder::instances::AddAccessConfig::new(self.inner.clone())
5150 }
5151
5152 /// Adds one dynamic network interface to an active instance.
5153 pub fn add_network_interface(&self) -> super::builder::instances::AddNetworkInterface {
5154 super::builder::instances::AddNetworkInterface::new(self.inner.clone())
5155 }
5156
5157 /// Adds existing resource policies to an instance. You can only add one
5158 /// policy right now which will be applied to this instance for scheduling live
5159 /// migrations.
5160 pub fn add_resource_policies(&self) -> super::builder::instances::AddResourcePolicies {
5161 super::builder::instances::AddResourcePolicies::new(self.inner.clone())
5162 }
5163
5164 /// Retrieves an aggregated list of all of the instances in your project
5165 /// across all regions and zones.
5166 ///
5167 /// The performance of this method degrades when a filter is specified on a
5168 /// project that has a very large number of instances.
5169 ///
5170 /// To prevent failure, Google recommends that you set the
5171 /// `returnPartialSuccess` parameter to `true`.
5172 pub fn aggregated_list(&self) -> super::builder::instances::AggregatedList {
5173 super::builder::instances::AggregatedList::new(self.inner.clone())
5174 }
5175
5176 /// Attaches an existing Disk resource to an instance. You must first
5177 /// create the disk before you can attach it. It is not possible to create
5178 /// and attach a disk at the same time. For more information, readAdding a
5179 /// persistent disk to your instance.
5180 pub fn attach_disk(&self) -> super::builder::instances::AttachDisk {
5181 super::builder::instances::AttachDisk::new(self.inner.clone())
5182 }
5183
5184 /// Creates multiple instances. Count specifies the number of instances to
5185 /// create. For more information, seeAbout bulk
5186 /// creation of VMs.
5187 pub fn bulk_insert(&self) -> super::builder::instances::BulkInsert {
5188 super::builder::instances::BulkInsert::new(self.inner.clone())
5189 }
5190
5191 /// Deletes the specified Instance resource. For more information, seeDeleting
5192 /// an instance.
5193 pub fn delete(&self) -> super::builder::instances::Delete {
5194 super::builder::instances::Delete::new(self.inner.clone())
5195 }
5196
5197 /// Deletes an access config from an instance's network interface.
5198 pub fn delete_access_config(&self) -> super::builder::instances::DeleteAccessConfig {
5199 super::builder::instances::DeleteAccessConfig::new(self.inner.clone())
5200 }
5201
5202 /// Deletes one dynamic network interface from an active instance.
5203 /// InstancesDeleteNetworkInterfaceRequest indicates:
5204 ///
5205 /// - instance from which to delete, using project+zone+resource_id fields;
5206 /// - dynamic network interface to be deleted, using network_interface_name
5207 /// field;
5208 pub fn delete_network_interface(&self) -> super::builder::instances::DeleteNetworkInterface {
5209 super::builder::instances::DeleteNetworkInterface::new(self.inner.clone())
5210 }
5211
5212 /// Detaches a disk from an instance.
5213 pub fn detach_disk(&self) -> super::builder::instances::DetachDisk {
5214 super::builder::instances::DetachDisk::new(self.inner.clone())
5215 }
5216
5217 /// Returns the specified Instance resource.
5218 pub fn get(&self) -> super::builder::instances::Get {
5219 super::builder::instances::Get::new(self.inner.clone())
5220 }
5221
5222 /// Returns effective firewalls applied to an interface of the instance.
5223 pub fn get_effective_firewalls(&self) -> super::builder::instances::GetEffectiveFirewalls {
5224 super::builder::instances::GetEffectiveFirewalls::new(self.inner.clone())
5225 }
5226
5227 /// Returns the specified guest attributes entry.
5228 pub fn get_guest_attributes(&self) -> super::builder::instances::GetGuestAttributes {
5229 super::builder::instances::GetGuestAttributes::new(self.inner.clone())
5230 }
5231
5232 /// Gets the access control policy for a resource. May be empty if no such
5233 /// policy or resource exists.
5234 pub fn get_iam_policy(&self) -> super::builder::instances::GetIamPolicy {
5235 super::builder::instances::GetIamPolicy::new(self.inner.clone())
5236 }
5237
5238 /// Returns the screenshot from the specified instance.
5239 pub fn get_screenshot(&self) -> super::builder::instances::GetScreenshot {
5240 super::builder::instances::GetScreenshot::new(self.inner.clone())
5241 }
5242
5243 /// Returns the last 1 MB of serial port output from the specified instance.
5244 pub fn get_serial_port_output(&self) -> super::builder::instances::GetSerialPortOutput {
5245 super::builder::instances::GetSerialPortOutput::new(self.inner.clone())
5246 }
5247
5248 /// Returns the Shielded Instance Identity of an instance
5249 pub fn get_shielded_instance_identity(
5250 &self,
5251 ) -> super::builder::instances::GetShieldedInstanceIdentity {
5252 super::builder::instances::GetShieldedInstanceIdentity::new(self.inner.clone())
5253 }
5254
5255 /// Creates an instance resource in the specified project using the data
5256 /// included in the request.
5257 pub fn insert(&self) -> super::builder::instances::Insert {
5258 super::builder::instances::Insert::new(self.inner.clone())
5259 }
5260
5261 /// Retrieves the list of instances contained within
5262 /// the specified zone.
5263 pub fn list(&self) -> super::builder::instances::List {
5264 super::builder::instances::List::new(self.inner.clone())
5265 }
5266
5267 /// Retrieves a list of resources that refer to the VM instance specified in
5268 /// the request. For example, if the VM instance is part of a managed or
5269 /// unmanaged instance group, the referrers list includes the instance group.
5270 /// For more information, readViewing
5271 /// referrers to VM instances.
5272 pub fn list_referrers(&self) -> super::builder::instances::ListReferrers {
5273 super::builder::instances::ListReferrers::new(self.inner.clone())
5274 }
5275
5276 /// Perform a manual maintenance on the instance.
5277 pub fn perform_maintenance(&self) -> super::builder::instances::PerformMaintenance {
5278 super::builder::instances::PerformMaintenance::new(self.inner.clone())
5279 }
5280
5281 /// Removes resource policies from an instance.
5282 pub fn remove_resource_policies(&self) -> super::builder::instances::RemoveResourcePolicies {
5283 super::builder::instances::RemoveResourcePolicies::new(self.inner.clone())
5284 }
5285
5286 /// Mark the host as faulty and try to restart the instance on a new host.
5287 pub fn report_host_as_faulty(&self) -> super::builder::instances::ReportHostAsFaulty {
5288 super::builder::instances::ReportHostAsFaulty::new(self.inner.clone())
5289 }
5290
5291 /// Performs a reset on the instance. This is a hard reset. The VM
5292 /// does not do a graceful shutdown. For more information, seeResetting
5293 /// an instance.
5294 pub fn reset(&self) -> super::builder::instances::Reset {
5295 super::builder::instances::Reset::new(self.inner.clone())
5296 }
5297
5298 /// Resumes an instance that was suspended using theinstances().suspend
5299 /// method.
5300 pub fn resume(&self) -> super::builder::instances::Resume {
5301 super::builder::instances::Resume::new(self.inner.clone())
5302 }
5303
5304 /// Sends diagnostic interrupt to the instance.
5305 pub fn send_diagnostic_interrupt(&self) -> super::builder::instances::SendDiagnosticInterrupt {
5306 super::builder::instances::SendDiagnosticInterrupt::new(self.inner.clone())
5307 }
5308
5309 /// Sets deletion protection on the instance.
5310 pub fn set_deletion_protection(&self) -> super::builder::instances::SetDeletionProtection {
5311 super::builder::instances::SetDeletionProtection::new(self.inner.clone())
5312 }
5313
5314 /// Sets the auto-delete flag for a disk attached to an instance.
5315 pub fn set_disk_auto_delete(&self) -> super::builder::instances::SetDiskAutoDelete {
5316 super::builder::instances::SetDiskAutoDelete::new(self.inner.clone())
5317 }
5318
5319 /// Sets the access control policy on the specified resource.
5320 /// Replaces any existing policy.
5321 pub fn set_iam_policy(&self) -> super::builder::instances::SetIamPolicy {
5322 super::builder::instances::SetIamPolicy::new(self.inner.clone())
5323 }
5324
5325 /// Sets labels on an instance. To learn more about labels, read theLabeling
5326 /// Resources documentation.
5327 pub fn set_labels(&self) -> super::builder::instances::SetLabels {
5328 super::builder::instances::SetLabels::new(self.inner.clone())
5329 }
5330
5331 /// Changes the number and/or type of accelerator for a stopped instance to the
5332 /// values specified in the request.
5333 pub fn set_machine_resources(&self) -> super::builder::instances::SetMachineResources {
5334 super::builder::instances::SetMachineResources::new(self.inner.clone())
5335 }
5336
5337 /// Changes the machine type for a stopped instance to the machine
5338 /// type specified in the request.
5339 pub fn set_machine_type(&self) -> super::builder::instances::SetMachineType {
5340 super::builder::instances::SetMachineType::new(self.inner.clone())
5341 }
5342
5343 /// Sets metadata for the specified instance to the data included
5344 /// in the request.
5345 pub fn set_metadata(&self) -> super::builder::instances::SetMetadata {
5346 super::builder::instances::SetMetadata::new(self.inner.clone())
5347 }
5348
5349 /// Changes the minimum CPU platform that this instance should use.
5350 /// This method can only
5351 /// be called on a stopped instance. For more information, readSpecifying a
5352 /// Minimum CPU Platform.
5353 pub fn set_min_cpu_platform(&self) -> super::builder::instances::SetMinCpuPlatform {
5354 super::builder::instances::SetMinCpuPlatform::new(self.inner.clone())
5355 }
5356
5357 /// Sets name of an instance.
5358 pub fn set_name(&self) -> super::builder::instances::SetName {
5359 super::builder::instances::SetName::new(self.inner.clone())
5360 }
5361
5362 /// Sets an instance's scheduling options. You can only call this method on astopped instance,
5363 /// that is, a VM instance that is in a `TERMINATED` state. SeeInstance Life
5364 /// Cycle for more information on the possible instance states.
5365 /// For more information about setting scheduling options for a VM, seeSet
5366 /// VM host maintenance policy.
5367 pub fn set_scheduling(&self) -> super::builder::instances::SetScheduling {
5368 super::builder::instances::SetScheduling::new(self.inner.clone())
5369 }
5370
5371 /// Sets the Google Cloud Armor security policy for the specified instance.
5372 /// For more information, seeGoogle
5373 /// Cloud Armor Overview
5374 pub fn set_security_policy(&self) -> super::builder::instances::SetSecurityPolicy {
5375 super::builder::instances::SetSecurityPolicy::new(self.inner.clone())
5376 }
5377
5378 /// Sets the service account on the instance. For more information,
5379 /// readChanging
5380 /// the service account and access scopes for an instance.
5381 pub fn set_service_account(&self) -> super::builder::instances::SetServiceAccount {
5382 super::builder::instances::SetServiceAccount::new(self.inner.clone())
5383 }
5384
5385 /// Sets the Shielded Instance integrity policy for an instance. You can
5386 /// only use this method on a running instance. This method
5387 /// supports PATCH semantics and uses the JSON merge
5388 /// patch format and processing rules.
5389 pub fn set_shielded_instance_integrity_policy(
5390 &self,
5391 ) -> super::builder::instances::SetShieldedInstanceIntegrityPolicy {
5392 super::builder::instances::SetShieldedInstanceIntegrityPolicy::new(self.inner.clone())
5393 }
5394
5395 /// Sets network tags
5396 /// for the specified instance to the data included in the request.
5397 pub fn set_tags(&self) -> super::builder::instances::SetTags {
5398 super::builder::instances::SetTags::new(self.inner.clone())
5399 }
5400
5401 /// Simulates a host maintenance event on a VM. For more information, see
5402 /// Simulate a host maintenance event.
5403 pub fn simulate_maintenance_event(
5404 &self,
5405 ) -> super::builder::instances::SimulateMaintenanceEvent {
5406 super::builder::instances::SimulateMaintenanceEvent::new(self.inner.clone())
5407 }
5408
5409 /// Starts an instance that was stopped using theinstances().stop
5410 /// method. For more information, seeRestart an
5411 /// instance.
5412 pub fn start(&self) -> super::builder::instances::Start {
5413 super::builder::instances::Start::new(self.inner.clone())
5414 }
5415
5416 /// Starts an instance that was stopped using theinstances().stop
5417 /// method. For more information, seeRestart an
5418 /// instance.
5419 pub fn start_with_encryption_key(&self) -> super::builder::instances::StartWithEncryptionKey {
5420 super::builder::instances::StartWithEncryptionKey::new(self.inner.clone())
5421 }
5422
5423 /// Stops a running instance, shutting it down cleanly, and allows
5424 /// you to restart the instance at a later time. Stopped instances do not incur
5425 /// VM usage charges while they are stopped. However, resources that the VM is
5426 /// using, such as persistent disks and static IP addresses, will continue to
5427 /// be charged until they are deleted. For more information, seeStopping
5428 /// an instance.
5429 pub fn stop(&self) -> super::builder::instances::Stop {
5430 super::builder::instances::Stop::new(self.inner.clone())
5431 }
5432
5433 /// This method suspends a running instance, saving its state to persistent
5434 /// storage, and allows you to resume the instance at a later time. Suspended
5435 /// instances have no compute costs (cores or RAM), and incur only storage
5436 /// charges for the saved VM memory and localSSD data. Any charged resources
5437 /// the virtual machine was using, such as persistent disks and static IP
5438 /// addresses, will continue to be charged while the instance is suspended.
5439 /// For more information, see
5440 /// Suspending and resuming an instance.
5441 pub fn suspend(&self) -> super::builder::instances::Suspend {
5442 super::builder::instances::Suspend::new(self.inner.clone())
5443 }
5444
5445 /// Returns permissions that a caller has on the specified resource.
5446 pub fn test_iam_permissions(&self) -> super::builder::instances::TestIamPermissions {
5447 super::builder::instances::TestIamPermissions::new(self.inner.clone())
5448 }
5449
5450 /// Updates an instance only if the necessary resources are available. This
5451 /// method can update only a specific set of instance properties. See
5452 /// Updating a running instance for a list of updatable instance
5453 /// properties.
5454 pub fn update(&self) -> super::builder::instances::Update {
5455 super::builder::instances::Update::new(self.inner.clone())
5456 }
5457
5458 /// Updates the specified access config from an instance's network interface
5459 /// with the data included in the request. This method supportsPATCH
5460 /// semantics and uses theJSON merge
5461 /// patch format and processing rules.
5462 pub fn update_access_config(&self) -> super::builder::instances::UpdateAccessConfig {
5463 super::builder::instances::UpdateAccessConfig::new(self.inner.clone())
5464 }
5465
5466 /// Updates the Display config for a VM instance. You can
5467 /// only use this method on a stopped VM instance. This method supportsPATCH
5468 /// semantics and uses theJSON merge
5469 /// patch format and processing rules.
5470 pub fn update_display_device(&self) -> super::builder::instances::UpdateDisplayDevice {
5471 super::builder::instances::UpdateDisplayDevice::new(self.inner.clone())
5472 }
5473
5474 /// Updates an instance's network interface. This method can only update an
5475 /// interface's alias IP range and attached network. See Modifying
5476 /// alias IP ranges for an existing instance for instructions on
5477 /// changing alias IP ranges. See Migrating
5478 /// a VM between networks for instructions on migrating an interface.
5479 /// This method follows PATCH semantics.
5480 pub fn update_network_interface(&self) -> super::builder::instances::UpdateNetworkInterface {
5481 super::builder::instances::UpdateNetworkInterface::new(self.inner.clone())
5482 }
5483
5484 /// Updates the Shielded Instance config for an instance. You can
5485 /// only use this method on a stopped instance. This method supportsPATCH
5486 /// semantics and uses theJSON merge
5487 /// patch format and processing rules.
5488 pub fn update_shielded_instance_config(
5489 &self,
5490 ) -> super::builder::instances::UpdateShieldedInstanceConfig {
5491 super::builder::instances::UpdateShieldedInstanceConfig::new(self.inner.clone())
5492 }
5493
5494 /// Retrieves the specified zone-specific Operations resource.
5495 pub fn get_operation(&self) -> super::builder::instances::GetOperation {
5496 super::builder::instances::GetOperation::new(self.inner.clone())
5497 }
5498}
5499
5500/// Implements a client for the Google Compute Engine API.
5501///
5502/// # Example
5503/// ```
5504/// # use google_cloud_compute_v1::client::InstantSnapshots;
5505/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
5506/// let client = InstantSnapshots::builder().build().await?;
5507/// // use `client` to make requests to the Google Compute Engine API.
5508/// # Ok(()) }
5509/// ```
5510///
5511/// # Service Description
5512///
5513/// Service for the `instantSnapshots` resource.
5514///
5515/// # Configuration
5516///
5517/// To configure `InstantSnapshots` use the `with_*` methods in the type returned
5518/// by [builder()][InstantSnapshots::builder]. The default configuration should
5519/// work for most applications. Common configuration changes include
5520///
5521/// * [with_endpoint()]: by default this client uses the global default endpoint
5522/// (`https://compute.googleapis.com`). Applications using regional
5523/// endpoints or running in restricted networks (e.g. a network configured
5524// with [Private Google Access with VPC Service Controls]) may want to
5525/// override this default.
5526/// * [with_credentials()]: by default this client uses
5527/// [Application Default Credentials]. Applications using custom
5528/// authentication may need to override this default.
5529///
5530/// [with_endpoint()]: super::builder::instant_snapshots::ClientBuilder::with_endpoint
5531/// [with_credentials()]: super::builder::instant_snapshots::ClientBuilder::with_credentials
5532/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5533/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5534///
5535/// # Pooling and Cloning
5536///
5537/// `InstantSnapshots` holds a connection pool internally, it is advised to
5538/// create one and reuse it. You do not need to wrap `InstantSnapshots` in
5539/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5540/// already uses an `Arc` internally.
5541#[cfg(feature = "instant-snapshots")]
5542#[cfg_attr(docsrs, doc(cfg(feature = "instant-snapshots")))]
5543#[derive(Clone, Debug)]
5544pub struct InstantSnapshots {
5545 inner: std::sync::Arc<dyn super::stub::dynamic::InstantSnapshots>,
5546}
5547
5548#[cfg(feature = "instant-snapshots")]
5549impl InstantSnapshots {
5550 /// Returns a builder for [InstantSnapshots].
5551 ///
5552 /// ```
5553 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5554 /// # use google_cloud_compute_v1::client::InstantSnapshots;
5555 /// let client = InstantSnapshots::builder().build().await?;
5556 /// # Ok(()) }
5557 /// ```
5558 pub fn builder() -> super::builder::instant_snapshots::ClientBuilder {
5559 crate::new_client_builder(super::builder::instant_snapshots::client::Factory)
5560 }
5561
5562 /// Creates a new client from the provided stub.
5563 ///
5564 /// The most common case for calling this function is in tests mocking the
5565 /// client's behavior.
5566 pub fn from_stub<T>(stub: T) -> Self
5567 where
5568 T: super::stub::InstantSnapshots + 'static,
5569 {
5570 Self {
5571 inner: std::sync::Arc::new(stub),
5572 }
5573 }
5574
5575 pub(crate) async fn new(
5576 config: gaxi::options::ClientConfig,
5577 ) -> crate::ClientBuilderResult<Self> {
5578 let inner = Self::build_inner(config).await?;
5579 Ok(Self { inner })
5580 }
5581
5582 async fn build_inner(
5583 conf: gaxi::options::ClientConfig,
5584 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InstantSnapshots>>
5585 {
5586 if gaxi::options::tracing_enabled(&conf) {
5587 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5588 }
5589 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5590 }
5591
5592 async fn build_transport(
5593 conf: gaxi::options::ClientConfig,
5594 ) -> crate::ClientBuilderResult<impl super::stub::InstantSnapshots> {
5595 super::transport::InstantSnapshots::new(conf).await
5596 }
5597
5598 async fn build_with_tracing(
5599 conf: gaxi::options::ClientConfig,
5600 ) -> crate::ClientBuilderResult<impl super::stub::InstantSnapshots> {
5601 Self::build_transport(conf)
5602 .await
5603 .map(super::tracing::InstantSnapshots::new)
5604 }
5605
5606 /// Retrieves an aggregated list of instantSnapshots.
5607 ///
5608 /// To prevent failure, Google recommends that you set the
5609 /// `returnPartialSuccess` parameter to `true`.
5610 pub fn aggregated_list(&self) -> super::builder::instant_snapshots::AggregatedList {
5611 super::builder::instant_snapshots::AggregatedList::new(self.inner.clone())
5612 }
5613
5614 /// Deletes the specified InstantSnapshot resource. Keep in mind that deleting
5615 /// a single instantSnapshot might not necessarily delete all the data on that
5616 /// instantSnapshot. If any data on the instantSnapshot that is marked for
5617 /// deletion is needed for subsequent instantSnapshots, the data will be moved
5618 /// to the next corresponding instantSnapshot.
5619 ///
5620 /// For more information, seeDeleting
5621 /// instantSnapshots.
5622 pub fn delete(&self) -> super::builder::instant_snapshots::Delete {
5623 super::builder::instant_snapshots::Delete::new(self.inner.clone())
5624 }
5625
5626 /// Returns the specified InstantSnapshot resource in the specified zone.
5627 pub fn get(&self) -> super::builder::instant_snapshots::Get {
5628 super::builder::instant_snapshots::Get::new(self.inner.clone())
5629 }
5630
5631 /// Gets the access control policy for a resource. May be empty if no such
5632 /// policy or resource exists.
5633 pub fn get_iam_policy(&self) -> super::builder::instant_snapshots::GetIamPolicy {
5634 super::builder::instant_snapshots::GetIamPolicy::new(self.inner.clone())
5635 }
5636
5637 /// Creates an instant snapshot in the specified zone.
5638 pub fn insert(&self) -> super::builder::instant_snapshots::Insert {
5639 super::builder::instant_snapshots::Insert::new(self.inner.clone())
5640 }
5641
5642 /// Retrieves the list of InstantSnapshot resources contained within
5643 /// the specified zone.
5644 pub fn list(&self) -> super::builder::instant_snapshots::List {
5645 super::builder::instant_snapshots::List::new(self.inner.clone())
5646 }
5647
5648 /// Sets the access control policy on the specified resource.
5649 /// Replaces any existing policy.
5650 pub fn set_iam_policy(&self) -> super::builder::instant_snapshots::SetIamPolicy {
5651 super::builder::instant_snapshots::SetIamPolicy::new(self.inner.clone())
5652 }
5653
5654 /// Sets the labels on a instantSnapshot in the given zone. To learn more about
5655 /// labels, read the Labeling
5656 /// Resources documentation.
5657 pub fn set_labels(&self) -> super::builder::instant_snapshots::SetLabels {
5658 super::builder::instant_snapshots::SetLabels::new(self.inner.clone())
5659 }
5660
5661 /// Returns permissions that a caller has on the specified resource.
5662 pub fn test_iam_permissions(&self) -> super::builder::instant_snapshots::TestIamPermissions {
5663 super::builder::instant_snapshots::TestIamPermissions::new(self.inner.clone())
5664 }
5665
5666 /// Retrieves the specified zone-specific Operations resource.
5667 pub fn get_operation(&self) -> super::builder::instant_snapshots::GetOperation {
5668 super::builder::instant_snapshots::GetOperation::new(self.inner.clone())
5669 }
5670}
5671
5672/// Implements a client for the Google Compute Engine API.
5673///
5674/// # Example
5675/// ```
5676/// # use google_cloud_compute_v1::client::InterconnectAttachmentGroups;
5677/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
5678/// let client = InterconnectAttachmentGroups::builder().build().await?;
5679/// // use `client` to make requests to the Google Compute Engine API.
5680/// # Ok(()) }
5681/// ```
5682///
5683/// # Service Description
5684///
5685/// Service for the `interconnectAttachmentGroups` resource.
5686///
5687/// # Configuration
5688///
5689/// To configure `InterconnectAttachmentGroups` use the `with_*` methods in the type returned
5690/// by [builder()][InterconnectAttachmentGroups::builder]. The default configuration should
5691/// work for most applications. Common configuration changes include
5692///
5693/// * [with_endpoint()]: by default this client uses the global default endpoint
5694/// (`https://compute.googleapis.com`). Applications using regional
5695/// endpoints or running in restricted networks (e.g. a network configured
5696// with [Private Google Access with VPC Service Controls]) may want to
5697/// override this default.
5698/// * [with_credentials()]: by default this client uses
5699/// [Application Default Credentials]. Applications using custom
5700/// authentication may need to override this default.
5701///
5702/// [with_endpoint()]: super::builder::interconnect_attachment_groups::ClientBuilder::with_endpoint
5703/// [with_credentials()]: super::builder::interconnect_attachment_groups::ClientBuilder::with_credentials
5704/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5705/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5706///
5707/// # Pooling and Cloning
5708///
5709/// `InterconnectAttachmentGroups` holds a connection pool internally, it is advised to
5710/// create one and reuse it. You do not need to wrap `InterconnectAttachmentGroups` in
5711/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5712/// already uses an `Arc` internally.
5713#[cfg(feature = "interconnect-attachment-groups")]
5714#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-attachment-groups")))]
5715#[derive(Clone, Debug)]
5716pub struct InterconnectAttachmentGroups {
5717 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachmentGroups>,
5718}
5719
5720#[cfg(feature = "interconnect-attachment-groups")]
5721impl InterconnectAttachmentGroups {
5722 /// Returns a builder for [InterconnectAttachmentGroups].
5723 ///
5724 /// ```
5725 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5726 /// # use google_cloud_compute_v1::client::InterconnectAttachmentGroups;
5727 /// let client = InterconnectAttachmentGroups::builder().build().await?;
5728 /// # Ok(()) }
5729 /// ```
5730 pub fn builder() -> super::builder::interconnect_attachment_groups::ClientBuilder {
5731 crate::new_client_builder(super::builder::interconnect_attachment_groups::client::Factory)
5732 }
5733
5734 /// Creates a new client from the provided stub.
5735 ///
5736 /// The most common case for calling this function is in tests mocking the
5737 /// client's behavior.
5738 pub fn from_stub<T>(stub: T) -> Self
5739 where
5740 T: super::stub::InterconnectAttachmentGroups + 'static,
5741 {
5742 Self {
5743 inner: std::sync::Arc::new(stub),
5744 }
5745 }
5746
5747 pub(crate) async fn new(
5748 config: gaxi::options::ClientConfig,
5749 ) -> crate::ClientBuilderResult<Self> {
5750 let inner = Self::build_inner(config).await?;
5751 Ok(Self { inner })
5752 }
5753
5754 async fn build_inner(
5755 conf: gaxi::options::ClientConfig,
5756 ) -> crate::ClientBuilderResult<
5757 std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachmentGroups>,
5758 > {
5759 if gaxi::options::tracing_enabled(&conf) {
5760 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5761 }
5762 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5763 }
5764
5765 async fn build_transport(
5766 conf: gaxi::options::ClientConfig,
5767 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectAttachmentGroups> {
5768 super::transport::InterconnectAttachmentGroups::new(conf).await
5769 }
5770
5771 async fn build_with_tracing(
5772 conf: gaxi::options::ClientConfig,
5773 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectAttachmentGroups> {
5774 Self::build_transport(conf)
5775 .await
5776 .map(super::tracing::InterconnectAttachmentGroups::new)
5777 }
5778
5779 /// Deletes the specified InterconnectAttachmentGroup in the given scope
5780 pub fn delete(&self) -> super::builder::interconnect_attachment_groups::Delete {
5781 super::builder::interconnect_attachment_groups::Delete::new(self.inner.clone())
5782 }
5783
5784 /// Returns the specified InterconnectAttachmentGroup resource in the given
5785 /// scope.
5786 pub fn get(&self) -> super::builder::interconnect_attachment_groups::Get {
5787 super::builder::interconnect_attachment_groups::Get::new(self.inner.clone())
5788 }
5789
5790 /// Gets the access control policy for a resource. May be empty if no such
5791 /// policy or resource exists.
5792 pub fn get_iam_policy(&self) -> super::builder::interconnect_attachment_groups::GetIamPolicy {
5793 super::builder::interconnect_attachment_groups::GetIamPolicy::new(self.inner.clone())
5794 }
5795
5796 /// Returns the InterconnectAttachmentStatuses for the specified
5797 /// InterconnectAttachmentGroup resource.
5798 pub fn get_operational_status(
5799 &self,
5800 ) -> super::builder::interconnect_attachment_groups::GetOperationalStatus {
5801 super::builder::interconnect_attachment_groups::GetOperationalStatus::new(
5802 self.inner.clone(),
5803 )
5804 }
5805
5806 /// Creates a InterconnectAttachmentGroup in the specified project in the given
5807 /// scope using the parameters that are included in the request.
5808 pub fn insert(&self) -> super::builder::interconnect_attachment_groups::Insert {
5809 super::builder::interconnect_attachment_groups::Insert::new(self.inner.clone())
5810 }
5811
5812 /// Lists the InterconnectAttachmentGroups for a project in the given scope.
5813 pub fn list(&self) -> super::builder::interconnect_attachment_groups::List {
5814 super::builder::interconnect_attachment_groups::List::new(self.inner.clone())
5815 }
5816
5817 /// Patches the specified InterconnectAttachmentGroup resource with the data
5818 /// included in the request. This method supports PATCH
5819 /// semantics and usesJSON merge
5820 /// patch format and processing rules.
5821 pub fn patch(&self) -> super::builder::interconnect_attachment_groups::Patch {
5822 super::builder::interconnect_attachment_groups::Patch::new(self.inner.clone())
5823 }
5824
5825 /// Sets the access control policy on the specified resource.
5826 /// Replaces any existing policy.
5827 pub fn set_iam_policy(&self) -> super::builder::interconnect_attachment_groups::SetIamPolicy {
5828 super::builder::interconnect_attachment_groups::SetIamPolicy::new(self.inner.clone())
5829 }
5830
5831 /// Returns permissions that a caller has on the specified resource.
5832 pub fn test_iam_permissions(
5833 &self,
5834 ) -> super::builder::interconnect_attachment_groups::TestIamPermissions {
5835 super::builder::interconnect_attachment_groups::TestIamPermissions::new(self.inner.clone())
5836 }
5837
5838 /// Retrieves the specified Operations resource.
5839 pub fn get_operation(&self) -> super::builder::interconnect_attachment_groups::GetOperation {
5840 super::builder::interconnect_attachment_groups::GetOperation::new(self.inner.clone())
5841 }
5842}
5843
5844/// Implements a client for the Google Compute Engine API.
5845///
5846/// # Example
5847/// ```
5848/// # use google_cloud_compute_v1::client::InterconnectAttachments;
5849/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
5850/// let client = InterconnectAttachments::builder().build().await?;
5851/// // use `client` to make requests to the Google Compute Engine API.
5852/// # Ok(()) }
5853/// ```
5854///
5855/// # Service Description
5856///
5857/// Service for the `interconnectAttachments` resource.
5858///
5859/// # Configuration
5860///
5861/// To configure `InterconnectAttachments` use the `with_*` methods in the type returned
5862/// by [builder()][InterconnectAttachments::builder]. The default configuration should
5863/// work for most applications. Common configuration changes include
5864///
5865/// * [with_endpoint()]: by default this client uses the global default endpoint
5866/// (`https://compute.googleapis.com`). Applications using regional
5867/// endpoints or running in restricted networks (e.g. a network configured
5868// with [Private Google Access with VPC Service Controls]) may want to
5869/// override this default.
5870/// * [with_credentials()]: by default this client uses
5871/// [Application Default Credentials]. Applications using custom
5872/// authentication may need to override this default.
5873///
5874/// [with_endpoint()]: super::builder::interconnect_attachments::ClientBuilder::with_endpoint
5875/// [with_credentials()]: super::builder::interconnect_attachments::ClientBuilder::with_credentials
5876/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5877/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5878///
5879/// # Pooling and Cloning
5880///
5881/// `InterconnectAttachments` holds a connection pool internally, it is advised to
5882/// create one and reuse it. You do not need to wrap `InterconnectAttachments` in
5883/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5884/// already uses an `Arc` internally.
5885#[cfg(feature = "interconnect-attachments")]
5886#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-attachments")))]
5887#[derive(Clone, Debug)]
5888pub struct InterconnectAttachments {
5889 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachments>,
5890}
5891
5892#[cfg(feature = "interconnect-attachments")]
5893impl InterconnectAttachments {
5894 /// Returns a builder for [InterconnectAttachments].
5895 ///
5896 /// ```
5897 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5898 /// # use google_cloud_compute_v1::client::InterconnectAttachments;
5899 /// let client = InterconnectAttachments::builder().build().await?;
5900 /// # Ok(()) }
5901 /// ```
5902 pub fn builder() -> super::builder::interconnect_attachments::ClientBuilder {
5903 crate::new_client_builder(super::builder::interconnect_attachments::client::Factory)
5904 }
5905
5906 /// Creates a new client from the provided stub.
5907 ///
5908 /// The most common case for calling this function is in tests mocking the
5909 /// client's behavior.
5910 pub fn from_stub<T>(stub: T) -> Self
5911 where
5912 T: super::stub::InterconnectAttachments + 'static,
5913 {
5914 Self {
5915 inner: std::sync::Arc::new(stub),
5916 }
5917 }
5918
5919 pub(crate) async fn new(
5920 config: gaxi::options::ClientConfig,
5921 ) -> crate::ClientBuilderResult<Self> {
5922 let inner = Self::build_inner(config).await?;
5923 Ok(Self { inner })
5924 }
5925
5926 async fn build_inner(
5927 conf: gaxi::options::ClientConfig,
5928 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachments>>
5929 {
5930 if gaxi::options::tracing_enabled(&conf) {
5931 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5932 }
5933 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5934 }
5935
5936 async fn build_transport(
5937 conf: gaxi::options::ClientConfig,
5938 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectAttachments> {
5939 super::transport::InterconnectAttachments::new(conf).await
5940 }
5941
5942 async fn build_with_tracing(
5943 conf: gaxi::options::ClientConfig,
5944 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectAttachments> {
5945 Self::build_transport(conf)
5946 .await
5947 .map(super::tracing::InterconnectAttachments::new)
5948 }
5949
5950 /// Retrieves an aggregated list of interconnect attachments.
5951 ///
5952 /// To prevent failure, Google recommends that you set the
5953 /// `returnPartialSuccess` parameter to `true`.
5954 pub fn aggregated_list(&self) -> super::builder::interconnect_attachments::AggregatedList {
5955 super::builder::interconnect_attachments::AggregatedList::new(self.inner.clone())
5956 }
5957
5958 /// Deletes the specified interconnect attachment.
5959 pub fn delete(&self) -> super::builder::interconnect_attachments::Delete {
5960 super::builder::interconnect_attachments::Delete::new(self.inner.clone())
5961 }
5962
5963 /// Returns the specified interconnect attachment.
5964 pub fn get(&self) -> super::builder::interconnect_attachments::Get {
5965 super::builder::interconnect_attachments::Get::new(self.inner.clone())
5966 }
5967
5968 /// Creates an InterconnectAttachment in the specified project using the data
5969 /// included in the request.
5970 pub fn insert(&self) -> super::builder::interconnect_attachments::Insert {
5971 super::builder::interconnect_attachments::Insert::new(self.inner.clone())
5972 }
5973
5974 /// Retrieves the list of interconnect attachments contained within
5975 /// the specified region.
5976 pub fn list(&self) -> super::builder::interconnect_attachments::List {
5977 super::builder::interconnect_attachments::List::new(self.inner.clone())
5978 }
5979
5980 /// Updates the specified interconnect attachment with the data included in the
5981 /// request. This method supportsPATCH
5982 /// semantics and uses theJSON merge
5983 /// patch format and processing rules.
5984 pub fn patch(&self) -> super::builder::interconnect_attachments::Patch {
5985 super::builder::interconnect_attachments::Patch::new(self.inner.clone())
5986 }
5987
5988 /// Sets the labels on an InterconnectAttachment. To learn more about labels,
5989 /// read the Labeling
5990 /// Resources documentation.
5991 pub fn set_labels(&self) -> super::builder::interconnect_attachments::SetLabels {
5992 super::builder::interconnect_attachments::SetLabels::new(self.inner.clone())
5993 }
5994
5995 /// Retrieves the specified region-specific Operations resource.
5996 pub fn get_operation(&self) -> super::builder::interconnect_attachments::GetOperation {
5997 super::builder::interconnect_attachments::GetOperation::new(self.inner.clone())
5998 }
5999}
6000
6001/// Implements a client for the Google Compute Engine API.
6002///
6003/// # Example
6004/// ```
6005/// # use google_cloud_compute_v1::client::InterconnectGroups;
6006/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
6007/// let client = InterconnectGroups::builder().build().await?;
6008/// // use `client` to make requests to the Google Compute Engine API.
6009/// # Ok(()) }
6010/// ```
6011///
6012/// # Service Description
6013///
6014/// Service for the `interconnectGroups` resource.
6015///
6016/// # Configuration
6017///
6018/// To configure `InterconnectGroups` use the `with_*` methods in the type returned
6019/// by [builder()][InterconnectGroups::builder]. The default configuration should
6020/// work for most applications. Common configuration changes include
6021///
6022/// * [with_endpoint()]: by default this client uses the global default endpoint
6023/// (`https://compute.googleapis.com`). Applications using regional
6024/// endpoints or running in restricted networks (e.g. a network configured
6025// with [Private Google Access with VPC Service Controls]) may want to
6026/// override this default.
6027/// * [with_credentials()]: by default this client uses
6028/// [Application Default Credentials]. Applications using custom
6029/// authentication may need to override this default.
6030///
6031/// [with_endpoint()]: super::builder::interconnect_groups::ClientBuilder::with_endpoint
6032/// [with_credentials()]: super::builder::interconnect_groups::ClientBuilder::with_credentials
6033/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6034/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6035///
6036/// # Pooling and Cloning
6037///
6038/// `InterconnectGroups` holds a connection pool internally, it is advised to
6039/// create one and reuse it. You do not need to wrap `InterconnectGroups` in
6040/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6041/// already uses an `Arc` internally.
6042#[cfg(feature = "interconnect-groups")]
6043#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-groups")))]
6044#[derive(Clone, Debug)]
6045pub struct InterconnectGroups {
6046 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectGroups>,
6047}
6048
6049#[cfg(feature = "interconnect-groups")]
6050impl InterconnectGroups {
6051 /// Returns a builder for [InterconnectGroups].
6052 ///
6053 /// ```
6054 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6055 /// # use google_cloud_compute_v1::client::InterconnectGroups;
6056 /// let client = InterconnectGroups::builder().build().await?;
6057 /// # Ok(()) }
6058 /// ```
6059 pub fn builder() -> super::builder::interconnect_groups::ClientBuilder {
6060 crate::new_client_builder(super::builder::interconnect_groups::client::Factory)
6061 }
6062
6063 /// Creates a new client from the provided stub.
6064 ///
6065 /// The most common case for calling this function is in tests mocking the
6066 /// client's behavior.
6067 pub fn from_stub<T>(stub: T) -> Self
6068 where
6069 T: super::stub::InterconnectGroups + 'static,
6070 {
6071 Self {
6072 inner: std::sync::Arc::new(stub),
6073 }
6074 }
6075
6076 pub(crate) async fn new(
6077 config: gaxi::options::ClientConfig,
6078 ) -> crate::ClientBuilderResult<Self> {
6079 let inner = Self::build_inner(config).await?;
6080 Ok(Self { inner })
6081 }
6082
6083 async fn build_inner(
6084 conf: gaxi::options::ClientConfig,
6085 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InterconnectGroups>>
6086 {
6087 if gaxi::options::tracing_enabled(&conf) {
6088 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6089 }
6090 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6091 }
6092
6093 async fn build_transport(
6094 conf: gaxi::options::ClientConfig,
6095 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectGroups> {
6096 super::transport::InterconnectGroups::new(conf).await
6097 }
6098
6099 async fn build_with_tracing(
6100 conf: gaxi::options::ClientConfig,
6101 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectGroups> {
6102 Self::build_transport(conf)
6103 .await
6104 .map(super::tracing::InterconnectGroups::new)
6105 }
6106
6107 /// Create Interconnects with redundancy by creating them in a specified
6108 /// interconnect group.
6109 pub fn create_members(&self) -> super::builder::interconnect_groups::CreateMembers {
6110 super::builder::interconnect_groups::CreateMembers::new(self.inner.clone())
6111 }
6112
6113 /// Deletes the specified InterconnectGroup in the given scope
6114 pub fn delete(&self) -> super::builder::interconnect_groups::Delete {
6115 super::builder::interconnect_groups::Delete::new(self.inner.clone())
6116 }
6117
6118 /// Returns the specified InterconnectGroup resource in the given scope.
6119 pub fn get(&self) -> super::builder::interconnect_groups::Get {
6120 super::builder::interconnect_groups::Get::new(self.inner.clone())
6121 }
6122
6123 /// Gets the access control policy for a resource. May be empty if no such
6124 /// policy or resource exists.
6125 pub fn get_iam_policy(&self) -> super::builder::interconnect_groups::GetIamPolicy {
6126 super::builder::interconnect_groups::GetIamPolicy::new(self.inner.clone())
6127 }
6128
6129 /// Returns the interconnectStatuses for the specified
6130 /// InterconnectGroup.
6131 pub fn get_operational_status(
6132 &self,
6133 ) -> super::builder::interconnect_groups::GetOperationalStatus {
6134 super::builder::interconnect_groups::GetOperationalStatus::new(self.inner.clone())
6135 }
6136
6137 /// Creates a InterconnectGroup in the specified project in the given scope
6138 /// using the parameters that are included in the request.
6139 pub fn insert(&self) -> super::builder::interconnect_groups::Insert {
6140 super::builder::interconnect_groups::Insert::new(self.inner.clone())
6141 }
6142
6143 /// Lists the InterconnectGroups for a project in the given scope.
6144 pub fn list(&self) -> super::builder::interconnect_groups::List {
6145 super::builder::interconnect_groups::List::new(self.inner.clone())
6146 }
6147
6148 /// Patches the specified InterconnectGroup resource with the data included in
6149 /// the request. This method supports PATCH
6150 /// semantics and usesJSON merge
6151 /// patch format and processing rules.
6152 pub fn patch(&self) -> super::builder::interconnect_groups::Patch {
6153 super::builder::interconnect_groups::Patch::new(self.inner.clone())
6154 }
6155
6156 /// Sets the access control policy on the specified resource.
6157 /// Replaces any existing policy.
6158 pub fn set_iam_policy(&self) -> super::builder::interconnect_groups::SetIamPolicy {
6159 super::builder::interconnect_groups::SetIamPolicy::new(self.inner.clone())
6160 }
6161
6162 /// Returns permissions that a caller has on the specified resource.
6163 pub fn test_iam_permissions(&self) -> super::builder::interconnect_groups::TestIamPermissions {
6164 super::builder::interconnect_groups::TestIamPermissions::new(self.inner.clone())
6165 }
6166
6167 /// Retrieves the specified Operations resource.
6168 pub fn get_operation(&self) -> super::builder::interconnect_groups::GetOperation {
6169 super::builder::interconnect_groups::GetOperation::new(self.inner.clone())
6170 }
6171}
6172
6173/// Implements a client for the Google Compute Engine API.
6174///
6175/// # Example
6176/// ```
6177/// # use google_cloud_compute_v1::client::InterconnectLocations;
6178/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
6179/// let client = InterconnectLocations::builder().build().await?;
6180/// // use `client` to make requests to the Google Compute Engine API.
6181/// # Ok(()) }
6182/// ```
6183///
6184/// # Service Description
6185///
6186/// Service for the `interconnectLocations` resource.
6187///
6188/// # Configuration
6189///
6190/// To configure `InterconnectLocations` use the `with_*` methods in the type returned
6191/// by [builder()][InterconnectLocations::builder]. The default configuration should
6192/// work for most applications. Common configuration changes include
6193///
6194/// * [with_endpoint()]: by default this client uses the global default endpoint
6195/// (`https://compute.googleapis.com`). Applications using regional
6196/// endpoints or running in restricted networks (e.g. a network configured
6197// with [Private Google Access with VPC Service Controls]) may want to
6198/// override this default.
6199/// * [with_credentials()]: by default this client uses
6200/// [Application Default Credentials]. Applications using custom
6201/// authentication may need to override this default.
6202///
6203/// [with_endpoint()]: super::builder::interconnect_locations::ClientBuilder::with_endpoint
6204/// [with_credentials()]: super::builder::interconnect_locations::ClientBuilder::with_credentials
6205/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6206/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6207///
6208/// # Pooling and Cloning
6209///
6210/// `InterconnectLocations` holds a connection pool internally, it is advised to
6211/// create one and reuse it. You do not need to wrap `InterconnectLocations` in
6212/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6213/// already uses an `Arc` internally.
6214#[cfg(feature = "interconnect-locations")]
6215#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-locations")))]
6216#[derive(Clone, Debug)]
6217pub struct InterconnectLocations {
6218 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectLocations>,
6219}
6220
6221#[cfg(feature = "interconnect-locations")]
6222impl InterconnectLocations {
6223 /// Returns a builder for [InterconnectLocations].
6224 ///
6225 /// ```
6226 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6227 /// # use google_cloud_compute_v1::client::InterconnectLocations;
6228 /// let client = InterconnectLocations::builder().build().await?;
6229 /// # Ok(()) }
6230 /// ```
6231 pub fn builder() -> super::builder::interconnect_locations::ClientBuilder {
6232 crate::new_client_builder(super::builder::interconnect_locations::client::Factory)
6233 }
6234
6235 /// Creates a new client from the provided stub.
6236 ///
6237 /// The most common case for calling this function is in tests mocking the
6238 /// client's behavior.
6239 pub fn from_stub<T>(stub: T) -> Self
6240 where
6241 T: super::stub::InterconnectLocations + 'static,
6242 {
6243 Self {
6244 inner: std::sync::Arc::new(stub),
6245 }
6246 }
6247
6248 pub(crate) async fn new(
6249 config: gaxi::options::ClientConfig,
6250 ) -> crate::ClientBuilderResult<Self> {
6251 let inner = Self::build_inner(config).await?;
6252 Ok(Self { inner })
6253 }
6254
6255 async fn build_inner(
6256 conf: gaxi::options::ClientConfig,
6257 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InterconnectLocations>>
6258 {
6259 if gaxi::options::tracing_enabled(&conf) {
6260 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6261 }
6262 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6263 }
6264
6265 async fn build_transport(
6266 conf: gaxi::options::ClientConfig,
6267 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectLocations> {
6268 super::transport::InterconnectLocations::new(conf).await
6269 }
6270
6271 async fn build_with_tracing(
6272 conf: gaxi::options::ClientConfig,
6273 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectLocations> {
6274 Self::build_transport(conf)
6275 .await
6276 .map(super::tracing::InterconnectLocations::new)
6277 }
6278
6279 /// Returns the details for the specified interconnect location. Gets a list of
6280 /// available interconnect locations by making a list() request.
6281 pub fn get(&self) -> super::builder::interconnect_locations::Get {
6282 super::builder::interconnect_locations::Get::new(self.inner.clone())
6283 }
6284
6285 /// Retrieves the list of interconnect locations available to the specified
6286 /// project.
6287 pub fn list(&self) -> super::builder::interconnect_locations::List {
6288 super::builder::interconnect_locations::List::new(self.inner.clone())
6289 }
6290}
6291
6292/// Implements a client for the Google Compute Engine API.
6293///
6294/// # Example
6295/// ```
6296/// # use google_cloud_compute_v1::client::InterconnectRemoteLocations;
6297/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
6298/// let client = InterconnectRemoteLocations::builder().build().await?;
6299/// // use `client` to make requests to the Google Compute Engine API.
6300/// # Ok(()) }
6301/// ```
6302///
6303/// # Service Description
6304///
6305/// Service for the `interconnectRemoteLocations` resource.
6306///
6307/// # Configuration
6308///
6309/// To configure `InterconnectRemoteLocations` use the `with_*` methods in the type returned
6310/// by [builder()][InterconnectRemoteLocations::builder]. The default configuration should
6311/// work for most applications. Common configuration changes include
6312///
6313/// * [with_endpoint()]: by default this client uses the global default endpoint
6314/// (`https://compute.googleapis.com`). Applications using regional
6315/// endpoints or running in restricted networks (e.g. a network configured
6316// with [Private Google Access with VPC Service Controls]) may want to
6317/// override this default.
6318/// * [with_credentials()]: by default this client uses
6319/// [Application Default Credentials]. Applications using custom
6320/// authentication may need to override this default.
6321///
6322/// [with_endpoint()]: super::builder::interconnect_remote_locations::ClientBuilder::with_endpoint
6323/// [with_credentials()]: super::builder::interconnect_remote_locations::ClientBuilder::with_credentials
6324/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6325/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6326///
6327/// # Pooling and Cloning
6328///
6329/// `InterconnectRemoteLocations` holds a connection pool internally, it is advised to
6330/// create one and reuse it. You do not need to wrap `InterconnectRemoteLocations` in
6331/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6332/// already uses an `Arc` internally.
6333#[cfg(feature = "interconnect-remote-locations")]
6334#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-remote-locations")))]
6335#[derive(Clone, Debug)]
6336pub struct InterconnectRemoteLocations {
6337 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectRemoteLocations>,
6338}
6339
6340#[cfg(feature = "interconnect-remote-locations")]
6341impl InterconnectRemoteLocations {
6342 /// Returns a builder for [InterconnectRemoteLocations].
6343 ///
6344 /// ```
6345 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6346 /// # use google_cloud_compute_v1::client::InterconnectRemoteLocations;
6347 /// let client = InterconnectRemoteLocations::builder().build().await?;
6348 /// # Ok(()) }
6349 /// ```
6350 pub fn builder() -> super::builder::interconnect_remote_locations::ClientBuilder {
6351 crate::new_client_builder(super::builder::interconnect_remote_locations::client::Factory)
6352 }
6353
6354 /// Creates a new client from the provided stub.
6355 ///
6356 /// The most common case for calling this function is in tests mocking the
6357 /// client's behavior.
6358 pub fn from_stub<T>(stub: T) -> Self
6359 where
6360 T: super::stub::InterconnectRemoteLocations + 'static,
6361 {
6362 Self {
6363 inner: std::sync::Arc::new(stub),
6364 }
6365 }
6366
6367 pub(crate) async fn new(
6368 config: gaxi::options::ClientConfig,
6369 ) -> crate::ClientBuilderResult<Self> {
6370 let inner = Self::build_inner(config).await?;
6371 Ok(Self { inner })
6372 }
6373
6374 async fn build_inner(
6375 conf: gaxi::options::ClientConfig,
6376 ) -> crate::ClientBuilderResult<
6377 std::sync::Arc<dyn super::stub::dynamic::InterconnectRemoteLocations>,
6378 > {
6379 if gaxi::options::tracing_enabled(&conf) {
6380 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6381 }
6382 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6383 }
6384
6385 async fn build_transport(
6386 conf: gaxi::options::ClientConfig,
6387 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectRemoteLocations> {
6388 super::transport::InterconnectRemoteLocations::new(conf).await
6389 }
6390
6391 async fn build_with_tracing(
6392 conf: gaxi::options::ClientConfig,
6393 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectRemoteLocations> {
6394 Self::build_transport(conf)
6395 .await
6396 .map(super::tracing::InterconnectRemoteLocations::new)
6397 }
6398
6399 /// Returns the details for the specified interconnect remote location. Gets a
6400 /// list of available interconnect remote locations by making alist() request.
6401 pub fn get(&self) -> super::builder::interconnect_remote_locations::Get {
6402 super::builder::interconnect_remote_locations::Get::new(self.inner.clone())
6403 }
6404
6405 /// Retrieves the list of interconnect remote locations available to the
6406 /// specified project.
6407 pub fn list(&self) -> super::builder::interconnect_remote_locations::List {
6408 super::builder::interconnect_remote_locations::List::new(self.inner.clone())
6409 }
6410}
6411
6412/// Implements a client for the Google Compute Engine API.
6413///
6414/// # Example
6415/// ```
6416/// # use google_cloud_compute_v1::client::Interconnects;
6417/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
6418/// let client = Interconnects::builder().build().await?;
6419/// // use `client` to make requests to the Google Compute Engine API.
6420/// # Ok(()) }
6421/// ```
6422///
6423/// # Service Description
6424///
6425/// Service for the `interconnects` resource.
6426///
6427/// # Configuration
6428///
6429/// To configure `Interconnects` use the `with_*` methods in the type returned
6430/// by [builder()][Interconnects::builder]. The default configuration should
6431/// work for most applications. Common configuration changes include
6432///
6433/// * [with_endpoint()]: by default this client uses the global default endpoint
6434/// (`https://compute.googleapis.com`). Applications using regional
6435/// endpoints or running in restricted networks (e.g. a network configured
6436// with [Private Google Access with VPC Service Controls]) may want to
6437/// override this default.
6438/// * [with_credentials()]: by default this client uses
6439/// [Application Default Credentials]. Applications using custom
6440/// authentication may need to override this default.
6441///
6442/// [with_endpoint()]: super::builder::interconnects::ClientBuilder::with_endpoint
6443/// [with_credentials()]: super::builder::interconnects::ClientBuilder::with_credentials
6444/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6445/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6446///
6447/// # Pooling and Cloning
6448///
6449/// `Interconnects` holds a connection pool internally, it is advised to
6450/// create one and reuse it. You do not need to wrap `Interconnects` in
6451/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6452/// already uses an `Arc` internally.
6453#[cfg(feature = "interconnects")]
6454#[cfg_attr(docsrs, doc(cfg(feature = "interconnects")))]
6455#[derive(Clone, Debug)]
6456pub struct Interconnects {
6457 inner: std::sync::Arc<dyn super::stub::dynamic::Interconnects>,
6458}
6459
6460#[cfg(feature = "interconnects")]
6461impl Interconnects {
6462 /// Returns a builder for [Interconnects].
6463 ///
6464 /// ```
6465 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6466 /// # use google_cloud_compute_v1::client::Interconnects;
6467 /// let client = Interconnects::builder().build().await?;
6468 /// # Ok(()) }
6469 /// ```
6470 pub fn builder() -> super::builder::interconnects::ClientBuilder {
6471 crate::new_client_builder(super::builder::interconnects::client::Factory)
6472 }
6473
6474 /// Creates a new client from the provided stub.
6475 ///
6476 /// The most common case for calling this function is in tests mocking the
6477 /// client's behavior.
6478 pub fn from_stub<T>(stub: T) -> Self
6479 where
6480 T: super::stub::Interconnects + 'static,
6481 {
6482 Self {
6483 inner: std::sync::Arc::new(stub),
6484 }
6485 }
6486
6487 pub(crate) async fn new(
6488 config: gaxi::options::ClientConfig,
6489 ) -> crate::ClientBuilderResult<Self> {
6490 let inner = Self::build_inner(config).await?;
6491 Ok(Self { inner })
6492 }
6493
6494 async fn build_inner(
6495 conf: gaxi::options::ClientConfig,
6496 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Interconnects>> {
6497 if gaxi::options::tracing_enabled(&conf) {
6498 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6499 }
6500 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6501 }
6502
6503 async fn build_transport(
6504 conf: gaxi::options::ClientConfig,
6505 ) -> crate::ClientBuilderResult<impl super::stub::Interconnects> {
6506 super::transport::Interconnects::new(conf).await
6507 }
6508
6509 async fn build_with_tracing(
6510 conf: gaxi::options::ClientConfig,
6511 ) -> crate::ClientBuilderResult<impl super::stub::Interconnects> {
6512 Self::build_transport(conf)
6513 .await
6514 .map(super::tracing::Interconnects::new)
6515 }
6516
6517 /// Deletes the specified Interconnect.
6518 pub fn delete(&self) -> super::builder::interconnects::Delete {
6519 super::builder::interconnects::Delete::new(self.inner.clone())
6520 }
6521
6522 /// Returns the specified Interconnect. Get a list of available Interconnects
6523 /// by making a list() request.
6524 pub fn get(&self) -> super::builder::interconnects::Get {
6525 super::builder::interconnects::Get::new(self.inner.clone())
6526 }
6527
6528 /// Returns the interconnectDiagnostics for the specified
6529 /// Interconnect.
6530 ///
6531 /// In the event of a
6532 /// global outage, do not use this API to make decisions about where to
6533 /// redirect your network traffic.
6534 ///
6535 /// Unlike a VLAN attachment, which is regional, a Cloud Interconnect
6536 /// connection is a global resource. A global outage can prevent this
6537 /// API from functioning properly.
6538 pub fn get_diagnostics(&self) -> super::builder::interconnects::GetDiagnostics {
6539 super::builder::interconnects::GetDiagnostics::new(self.inner.clone())
6540 }
6541
6542 /// Returns the interconnectMacsecConfig for the specified
6543 /// Interconnect.
6544 pub fn get_macsec_config(&self) -> super::builder::interconnects::GetMacsecConfig {
6545 super::builder::interconnects::GetMacsecConfig::new(self.inner.clone())
6546 }
6547
6548 /// Creates an Interconnect in the specified project using
6549 /// the data included in the request.
6550 pub fn insert(&self) -> super::builder::interconnects::Insert {
6551 super::builder::interconnects::Insert::new(self.inner.clone())
6552 }
6553
6554 /// Retrieves the list of Interconnects available to the specified project.
6555 pub fn list(&self) -> super::builder::interconnects::List {
6556 super::builder::interconnects::List::new(self.inner.clone())
6557 }
6558
6559 /// Updates the specified Interconnect with the data included in the request.
6560 /// This method supportsPATCH
6561 /// semantics and uses theJSON merge
6562 /// patch format and processing rules.
6563 pub fn patch(&self) -> super::builder::interconnects::Patch {
6564 super::builder::interconnects::Patch::new(self.inner.clone())
6565 }
6566
6567 /// Sets the labels on an Interconnect. To learn more about labels,
6568 /// read the Labeling
6569 /// Resources documentation.
6570 pub fn set_labels(&self) -> super::builder::interconnects::SetLabels {
6571 super::builder::interconnects::SetLabels::new(self.inner.clone())
6572 }
6573
6574 /// Retrieves the specified Operations resource.
6575 pub fn get_operation(&self) -> super::builder::interconnects::GetOperation {
6576 super::builder::interconnects::GetOperation::new(self.inner.clone())
6577 }
6578}
6579
6580/// Implements a client for the Google Compute Engine API.
6581///
6582/// # Example
6583/// ```
6584/// # use google_cloud_compute_v1::client::LicenseCodes;
6585/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
6586/// let client = LicenseCodes::builder().build().await?;
6587/// // use `client` to make requests to the Google Compute Engine API.
6588/// # Ok(()) }
6589/// ```
6590///
6591/// # Service Description
6592///
6593/// Service for the `licenseCodes` resource.
6594///
6595/// # Configuration
6596///
6597/// To configure `LicenseCodes` use the `with_*` methods in the type returned
6598/// by [builder()][LicenseCodes::builder]. The default configuration should
6599/// work for most applications. Common configuration changes include
6600///
6601/// * [with_endpoint()]: by default this client uses the global default endpoint
6602/// (`https://compute.googleapis.com`). Applications using regional
6603/// endpoints or running in restricted networks (e.g. a network configured
6604// with [Private Google Access with VPC Service Controls]) may want to
6605/// override this default.
6606/// * [with_credentials()]: by default this client uses
6607/// [Application Default Credentials]. Applications using custom
6608/// authentication may need to override this default.
6609///
6610/// [with_endpoint()]: super::builder::license_codes::ClientBuilder::with_endpoint
6611/// [with_credentials()]: super::builder::license_codes::ClientBuilder::with_credentials
6612/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6613/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6614///
6615/// # Pooling and Cloning
6616///
6617/// `LicenseCodes` holds a connection pool internally, it is advised to
6618/// create one and reuse it. You do not need to wrap `LicenseCodes` in
6619/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6620/// already uses an `Arc` internally.
6621#[cfg(feature = "license-codes")]
6622#[cfg_attr(docsrs, doc(cfg(feature = "license-codes")))]
6623#[derive(Clone, Debug)]
6624pub struct LicenseCodes {
6625 inner: std::sync::Arc<dyn super::stub::dynamic::LicenseCodes>,
6626}
6627
6628#[cfg(feature = "license-codes")]
6629impl LicenseCodes {
6630 /// Returns a builder for [LicenseCodes].
6631 ///
6632 /// ```
6633 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6634 /// # use google_cloud_compute_v1::client::LicenseCodes;
6635 /// let client = LicenseCodes::builder().build().await?;
6636 /// # Ok(()) }
6637 /// ```
6638 pub fn builder() -> super::builder::license_codes::ClientBuilder {
6639 crate::new_client_builder(super::builder::license_codes::client::Factory)
6640 }
6641
6642 /// Creates a new client from the provided stub.
6643 ///
6644 /// The most common case for calling this function is in tests mocking the
6645 /// client's behavior.
6646 pub fn from_stub<T>(stub: T) -> Self
6647 where
6648 T: super::stub::LicenseCodes + 'static,
6649 {
6650 Self {
6651 inner: std::sync::Arc::new(stub),
6652 }
6653 }
6654
6655 pub(crate) async fn new(
6656 config: gaxi::options::ClientConfig,
6657 ) -> crate::ClientBuilderResult<Self> {
6658 let inner = Self::build_inner(config).await?;
6659 Ok(Self { inner })
6660 }
6661
6662 async fn build_inner(
6663 conf: gaxi::options::ClientConfig,
6664 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::LicenseCodes>> {
6665 if gaxi::options::tracing_enabled(&conf) {
6666 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6667 }
6668 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6669 }
6670
6671 async fn build_transport(
6672 conf: gaxi::options::ClientConfig,
6673 ) -> crate::ClientBuilderResult<impl super::stub::LicenseCodes> {
6674 super::transport::LicenseCodes::new(conf).await
6675 }
6676
6677 async fn build_with_tracing(
6678 conf: gaxi::options::ClientConfig,
6679 ) -> crate::ClientBuilderResult<impl super::stub::LicenseCodes> {
6680 Self::build_transport(conf)
6681 .await
6682 .map(super::tracing::LicenseCodes::new)
6683 }
6684
6685 /// Return a specified license code. License codes are mirrored across
6686 /// all projects that have permissions to read the License Code.
6687 /// *Caution* This resource is intended
6688 /// for use only by third-party partners who are creatingCloud Marketplace
6689 /// images.
6690 pub fn get(&self) -> super::builder::license_codes::Get {
6691 super::builder::license_codes::Get::new(self.inner.clone())
6692 }
6693
6694 /// Returns permissions that a caller has on the specified resource.
6695 /// *Caution* This resource is intended
6696 /// for use only by third-party partners who are creatingCloud Marketplace
6697 /// images.
6698 pub fn test_iam_permissions(&self) -> super::builder::license_codes::TestIamPermissions {
6699 super::builder::license_codes::TestIamPermissions::new(self.inner.clone())
6700 }
6701}
6702
6703/// Implements a client for the Google Compute Engine API.
6704///
6705/// # Example
6706/// ```
6707/// # use google_cloud_compute_v1::client::Licenses;
6708/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
6709/// let client = Licenses::builder().build().await?;
6710/// // use `client` to make requests to the Google Compute Engine API.
6711/// # Ok(()) }
6712/// ```
6713///
6714/// # Service Description
6715///
6716/// Service for the `licenses` resource.
6717///
6718/// # Configuration
6719///
6720/// To configure `Licenses` use the `with_*` methods in the type returned
6721/// by [builder()][Licenses::builder]. The default configuration should
6722/// work for most applications. Common configuration changes include
6723///
6724/// * [with_endpoint()]: by default this client uses the global default endpoint
6725/// (`https://compute.googleapis.com`). Applications using regional
6726/// endpoints or running in restricted networks (e.g. a network configured
6727// with [Private Google Access with VPC Service Controls]) may want to
6728/// override this default.
6729/// * [with_credentials()]: by default this client uses
6730/// [Application Default Credentials]. Applications using custom
6731/// authentication may need to override this default.
6732///
6733/// [with_endpoint()]: super::builder::licenses::ClientBuilder::with_endpoint
6734/// [with_credentials()]: super::builder::licenses::ClientBuilder::with_credentials
6735/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6736/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6737///
6738/// # Pooling and Cloning
6739///
6740/// `Licenses` holds a connection pool internally, it is advised to
6741/// create one and reuse it. You do not need to wrap `Licenses` in
6742/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6743/// already uses an `Arc` internally.
6744#[cfg(feature = "licenses")]
6745#[cfg_attr(docsrs, doc(cfg(feature = "licenses")))]
6746#[derive(Clone, Debug)]
6747pub struct Licenses {
6748 inner: std::sync::Arc<dyn super::stub::dynamic::Licenses>,
6749}
6750
6751#[cfg(feature = "licenses")]
6752impl Licenses {
6753 /// Returns a builder for [Licenses].
6754 ///
6755 /// ```
6756 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6757 /// # use google_cloud_compute_v1::client::Licenses;
6758 /// let client = Licenses::builder().build().await?;
6759 /// # Ok(()) }
6760 /// ```
6761 pub fn builder() -> super::builder::licenses::ClientBuilder {
6762 crate::new_client_builder(super::builder::licenses::client::Factory)
6763 }
6764
6765 /// Creates a new client from the provided stub.
6766 ///
6767 /// The most common case for calling this function is in tests mocking the
6768 /// client's behavior.
6769 pub fn from_stub<T>(stub: T) -> Self
6770 where
6771 T: super::stub::Licenses + 'static,
6772 {
6773 Self {
6774 inner: std::sync::Arc::new(stub),
6775 }
6776 }
6777
6778 pub(crate) async fn new(
6779 config: gaxi::options::ClientConfig,
6780 ) -> crate::ClientBuilderResult<Self> {
6781 let inner = Self::build_inner(config).await?;
6782 Ok(Self { inner })
6783 }
6784
6785 async fn build_inner(
6786 conf: gaxi::options::ClientConfig,
6787 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Licenses>> {
6788 if gaxi::options::tracing_enabled(&conf) {
6789 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6790 }
6791 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6792 }
6793
6794 async fn build_transport(
6795 conf: gaxi::options::ClientConfig,
6796 ) -> crate::ClientBuilderResult<impl super::stub::Licenses> {
6797 super::transport::Licenses::new(conf).await
6798 }
6799
6800 async fn build_with_tracing(
6801 conf: gaxi::options::ClientConfig,
6802 ) -> crate::ClientBuilderResult<impl super::stub::Licenses> {
6803 Self::build_transport(conf)
6804 .await
6805 .map(super::tracing::Licenses::new)
6806 }
6807
6808 /// Deletes the specified license.
6809 /// *Caution* This resource is intended
6810 /// for use only by third-party partners who are creatingCloud Marketplace
6811 /// images.
6812 pub fn delete(&self) -> super::builder::licenses::Delete {
6813 super::builder::licenses::Delete::new(self.inner.clone())
6814 }
6815
6816 /// Returns the specified License resource.
6817 /// *Caution* This resource is intended
6818 /// for use only by third-party partners who are creatingCloud Marketplace
6819 /// images.
6820 pub fn get(&self) -> super::builder::licenses::Get {
6821 super::builder::licenses::Get::new(self.inner.clone())
6822 }
6823
6824 /// Gets the access control policy for a resource. May be empty if no such
6825 /// policy or resource exists.
6826 /// *Caution* This resource is intended
6827 /// for use only by third-party partners who are creatingCloud Marketplace
6828 /// images.
6829 pub fn get_iam_policy(&self) -> super::builder::licenses::GetIamPolicy {
6830 super::builder::licenses::GetIamPolicy::new(self.inner.clone())
6831 }
6832
6833 /// Create a License resource in the specified project.
6834 /// *Caution* This resource is intended
6835 /// for use only by third-party partners who are creatingCloud Marketplace
6836 /// images.
6837 pub fn insert(&self) -> super::builder::licenses::Insert {
6838 super::builder::licenses::Insert::new(self.inner.clone())
6839 }
6840
6841 /// Retrieves the list of licenses
6842 /// available in the specified project. This method does not
6843 /// get any licenses that belong to other projects, including licenses attached
6844 /// to publicly-available images, like Debian 9. If you want to get a list of
6845 /// publicly-available licenses, use this method to make a request to the
6846 /// respective image project, such as debian-cloud orwindows-cloud.
6847 /// *Caution* This resource is intended
6848 /// for use only by third-party partners who are creatingCloud Marketplace
6849 /// images.
6850 pub fn list(&self) -> super::builder::licenses::List {
6851 super::builder::licenses::List::new(self.inner.clone())
6852 }
6853
6854 /// Sets the access control policy on the specified resource.
6855 /// Replaces any existing policy.
6856 /// *Caution* This resource is intended
6857 /// for use only by third-party partners who are creatingCloud Marketplace
6858 /// images.
6859 pub fn set_iam_policy(&self) -> super::builder::licenses::SetIamPolicy {
6860 super::builder::licenses::SetIamPolicy::new(self.inner.clone())
6861 }
6862
6863 /// Returns permissions that a caller has on the specified resource.
6864 /// *Caution* This resource is intended
6865 /// for use only by third-party partners who are creatingCloud Marketplace
6866 /// images.
6867 pub fn test_iam_permissions(&self) -> super::builder::licenses::TestIamPermissions {
6868 super::builder::licenses::TestIamPermissions::new(self.inner.clone())
6869 }
6870
6871 /// Updates a License resource in the specified project.
6872 /// *Caution* This resource is intended
6873 /// for use only by third-party partners who are creatingCloud Marketplace
6874 /// images.
6875 pub fn update(&self) -> super::builder::licenses::Update {
6876 super::builder::licenses::Update::new(self.inner.clone())
6877 }
6878
6879 /// Retrieves the specified Operations resource.
6880 pub fn get_operation(&self) -> super::builder::licenses::GetOperation {
6881 super::builder::licenses::GetOperation::new(self.inner.clone())
6882 }
6883}
6884
6885/// Implements a client for the Google Compute Engine API.
6886///
6887/// # Example
6888/// ```
6889/// # use google_cloud_compute_v1::client::MachineImages;
6890/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
6891/// let client = MachineImages::builder().build().await?;
6892/// // use `client` to make requests to the Google Compute Engine API.
6893/// # Ok(()) }
6894/// ```
6895///
6896/// # Service Description
6897///
6898/// Service for the `machineImages` resource.
6899///
6900/// # Configuration
6901///
6902/// To configure `MachineImages` use the `with_*` methods in the type returned
6903/// by [builder()][MachineImages::builder]. The default configuration should
6904/// work for most applications. Common configuration changes include
6905///
6906/// * [with_endpoint()]: by default this client uses the global default endpoint
6907/// (`https://compute.googleapis.com`). Applications using regional
6908/// endpoints or running in restricted networks (e.g. a network configured
6909// with [Private Google Access with VPC Service Controls]) may want to
6910/// override this default.
6911/// * [with_credentials()]: by default this client uses
6912/// [Application Default Credentials]. Applications using custom
6913/// authentication may need to override this default.
6914///
6915/// [with_endpoint()]: super::builder::machine_images::ClientBuilder::with_endpoint
6916/// [with_credentials()]: super::builder::machine_images::ClientBuilder::with_credentials
6917/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6918/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6919///
6920/// # Pooling and Cloning
6921///
6922/// `MachineImages` holds a connection pool internally, it is advised to
6923/// create one and reuse it. You do not need to wrap `MachineImages` in
6924/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6925/// already uses an `Arc` internally.
6926#[cfg(feature = "machine-images")]
6927#[cfg_attr(docsrs, doc(cfg(feature = "machine-images")))]
6928#[derive(Clone, Debug)]
6929pub struct MachineImages {
6930 inner: std::sync::Arc<dyn super::stub::dynamic::MachineImages>,
6931}
6932
6933#[cfg(feature = "machine-images")]
6934impl MachineImages {
6935 /// Returns a builder for [MachineImages].
6936 ///
6937 /// ```
6938 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6939 /// # use google_cloud_compute_v1::client::MachineImages;
6940 /// let client = MachineImages::builder().build().await?;
6941 /// # Ok(()) }
6942 /// ```
6943 pub fn builder() -> super::builder::machine_images::ClientBuilder {
6944 crate::new_client_builder(super::builder::machine_images::client::Factory)
6945 }
6946
6947 /// Creates a new client from the provided stub.
6948 ///
6949 /// The most common case for calling this function is in tests mocking the
6950 /// client's behavior.
6951 pub fn from_stub<T>(stub: T) -> Self
6952 where
6953 T: super::stub::MachineImages + 'static,
6954 {
6955 Self {
6956 inner: std::sync::Arc::new(stub),
6957 }
6958 }
6959
6960 pub(crate) async fn new(
6961 config: gaxi::options::ClientConfig,
6962 ) -> crate::ClientBuilderResult<Self> {
6963 let inner = Self::build_inner(config).await?;
6964 Ok(Self { inner })
6965 }
6966
6967 async fn build_inner(
6968 conf: gaxi::options::ClientConfig,
6969 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::MachineImages>> {
6970 if gaxi::options::tracing_enabled(&conf) {
6971 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6972 }
6973 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6974 }
6975
6976 async fn build_transport(
6977 conf: gaxi::options::ClientConfig,
6978 ) -> crate::ClientBuilderResult<impl super::stub::MachineImages> {
6979 super::transport::MachineImages::new(conf).await
6980 }
6981
6982 async fn build_with_tracing(
6983 conf: gaxi::options::ClientConfig,
6984 ) -> crate::ClientBuilderResult<impl super::stub::MachineImages> {
6985 Self::build_transport(conf)
6986 .await
6987 .map(super::tracing::MachineImages::new)
6988 }
6989
6990 /// Deletes the specified machine image. Deleting a machine image is permanent
6991 /// and cannot be undone.
6992 pub fn delete(&self) -> super::builder::machine_images::Delete {
6993 super::builder::machine_images::Delete::new(self.inner.clone())
6994 }
6995
6996 /// Returns the specified machine image.
6997 pub fn get(&self) -> super::builder::machine_images::Get {
6998 super::builder::machine_images::Get::new(self.inner.clone())
6999 }
7000
7001 /// Gets the access control policy for a resource. May be empty if no such
7002 /// policy or resource exists.
7003 pub fn get_iam_policy(&self) -> super::builder::machine_images::GetIamPolicy {
7004 super::builder::machine_images::GetIamPolicy::new(self.inner.clone())
7005 }
7006
7007 /// Creates a machine image in the specified project using the
7008 /// data that is included in the request. If you are creating a new machine
7009 /// image to update an existing instance, your new machine image should use the
7010 /// same network or, if applicable, the same subnetwork as the original
7011 /// instance.
7012 pub fn insert(&self) -> super::builder::machine_images::Insert {
7013 super::builder::machine_images::Insert::new(self.inner.clone())
7014 }
7015
7016 /// Retrieves a list of machine images that are contained within
7017 /// the specified project.
7018 pub fn list(&self) -> super::builder::machine_images::List {
7019 super::builder::machine_images::List::new(self.inner.clone())
7020 }
7021
7022 /// Sets the access control policy on the specified resource.
7023 /// Replaces any existing policy.
7024 pub fn set_iam_policy(&self) -> super::builder::machine_images::SetIamPolicy {
7025 super::builder::machine_images::SetIamPolicy::new(self.inner.clone())
7026 }
7027
7028 /// Sets the labels on a machine image. To learn more about labels, read theLabeling
7029 /// Resources documentation.
7030 pub fn set_labels(&self) -> super::builder::machine_images::SetLabels {
7031 super::builder::machine_images::SetLabels::new(self.inner.clone())
7032 }
7033
7034 /// Returns permissions that a caller has on the specified resource.
7035 pub fn test_iam_permissions(&self) -> super::builder::machine_images::TestIamPermissions {
7036 super::builder::machine_images::TestIamPermissions::new(self.inner.clone())
7037 }
7038
7039 /// Retrieves the specified Operations resource.
7040 pub fn get_operation(&self) -> super::builder::machine_images::GetOperation {
7041 super::builder::machine_images::GetOperation::new(self.inner.clone())
7042 }
7043}
7044
7045/// Implements a client for the Google Compute Engine API.
7046///
7047/// # Example
7048/// ```
7049/// # use google_cloud_compute_v1::client::MachineTypes;
7050/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
7051/// let client = MachineTypes::builder().build().await?;
7052/// // use `client` to make requests to the Google Compute Engine API.
7053/// # Ok(()) }
7054/// ```
7055///
7056/// # Service Description
7057///
7058/// Service for the `machineTypes` resource.
7059///
7060/// # Configuration
7061///
7062/// To configure `MachineTypes` use the `with_*` methods in the type returned
7063/// by [builder()][MachineTypes::builder]. The default configuration should
7064/// work for most applications. Common configuration changes include
7065///
7066/// * [with_endpoint()]: by default this client uses the global default endpoint
7067/// (`https://compute.googleapis.com`). Applications using regional
7068/// endpoints or running in restricted networks (e.g. a network configured
7069// with [Private Google Access with VPC Service Controls]) may want to
7070/// override this default.
7071/// * [with_credentials()]: by default this client uses
7072/// [Application Default Credentials]. Applications using custom
7073/// authentication may need to override this default.
7074///
7075/// [with_endpoint()]: super::builder::machine_types::ClientBuilder::with_endpoint
7076/// [with_credentials()]: super::builder::machine_types::ClientBuilder::with_credentials
7077/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7078/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7079///
7080/// # Pooling and Cloning
7081///
7082/// `MachineTypes` holds a connection pool internally, it is advised to
7083/// create one and reuse it. You do not need to wrap `MachineTypes` in
7084/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7085/// already uses an `Arc` internally.
7086#[cfg(feature = "machine-types")]
7087#[cfg_attr(docsrs, doc(cfg(feature = "machine-types")))]
7088#[derive(Clone, Debug)]
7089pub struct MachineTypes {
7090 inner: std::sync::Arc<dyn super::stub::dynamic::MachineTypes>,
7091}
7092
7093#[cfg(feature = "machine-types")]
7094impl MachineTypes {
7095 /// Returns a builder for [MachineTypes].
7096 ///
7097 /// ```
7098 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7099 /// # use google_cloud_compute_v1::client::MachineTypes;
7100 /// let client = MachineTypes::builder().build().await?;
7101 /// # Ok(()) }
7102 /// ```
7103 pub fn builder() -> super::builder::machine_types::ClientBuilder {
7104 crate::new_client_builder(super::builder::machine_types::client::Factory)
7105 }
7106
7107 /// Creates a new client from the provided stub.
7108 ///
7109 /// The most common case for calling this function is in tests mocking the
7110 /// client's behavior.
7111 pub fn from_stub<T>(stub: T) -> Self
7112 where
7113 T: super::stub::MachineTypes + 'static,
7114 {
7115 Self {
7116 inner: std::sync::Arc::new(stub),
7117 }
7118 }
7119
7120 pub(crate) async fn new(
7121 config: gaxi::options::ClientConfig,
7122 ) -> crate::ClientBuilderResult<Self> {
7123 let inner = Self::build_inner(config).await?;
7124 Ok(Self { inner })
7125 }
7126
7127 async fn build_inner(
7128 conf: gaxi::options::ClientConfig,
7129 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::MachineTypes>> {
7130 if gaxi::options::tracing_enabled(&conf) {
7131 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7132 }
7133 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7134 }
7135
7136 async fn build_transport(
7137 conf: gaxi::options::ClientConfig,
7138 ) -> crate::ClientBuilderResult<impl super::stub::MachineTypes> {
7139 super::transport::MachineTypes::new(conf).await
7140 }
7141
7142 async fn build_with_tracing(
7143 conf: gaxi::options::ClientConfig,
7144 ) -> crate::ClientBuilderResult<impl super::stub::MachineTypes> {
7145 Self::build_transport(conf)
7146 .await
7147 .map(super::tracing::MachineTypes::new)
7148 }
7149
7150 /// Retrieves an aggregated list of machine types.
7151 ///
7152 /// To prevent failure, Google recommends that you set the
7153 /// `returnPartialSuccess` parameter to `true`.
7154 pub fn aggregated_list(&self) -> super::builder::machine_types::AggregatedList {
7155 super::builder::machine_types::AggregatedList::new(self.inner.clone())
7156 }
7157
7158 /// Returns the specified machine type.
7159 pub fn get(&self) -> super::builder::machine_types::Get {
7160 super::builder::machine_types::Get::new(self.inner.clone())
7161 }
7162
7163 /// Retrieves a list of machine types available to the specified
7164 /// project.
7165 pub fn list(&self) -> super::builder::machine_types::List {
7166 super::builder::machine_types::List::new(self.inner.clone())
7167 }
7168}
7169
7170/// Implements a client for the Google Compute Engine API.
7171///
7172/// # Example
7173/// ```
7174/// # use google_cloud_compute_v1::client::NetworkAttachments;
7175/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
7176/// let client = NetworkAttachments::builder().build().await?;
7177/// // use `client` to make requests to the Google Compute Engine API.
7178/// # Ok(()) }
7179/// ```
7180///
7181/// # Service Description
7182///
7183/// Service for the `networkAttachments` resource.
7184///
7185/// # Configuration
7186///
7187/// To configure `NetworkAttachments` use the `with_*` methods in the type returned
7188/// by [builder()][NetworkAttachments::builder]. The default configuration should
7189/// work for most applications. Common configuration changes include
7190///
7191/// * [with_endpoint()]: by default this client uses the global default endpoint
7192/// (`https://compute.googleapis.com`). Applications using regional
7193/// endpoints or running in restricted networks (e.g. a network configured
7194// with [Private Google Access with VPC Service Controls]) may want to
7195/// override this default.
7196/// * [with_credentials()]: by default this client uses
7197/// [Application Default Credentials]. Applications using custom
7198/// authentication may need to override this default.
7199///
7200/// [with_endpoint()]: super::builder::network_attachments::ClientBuilder::with_endpoint
7201/// [with_credentials()]: super::builder::network_attachments::ClientBuilder::with_credentials
7202/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7203/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7204///
7205/// # Pooling and Cloning
7206///
7207/// `NetworkAttachments` holds a connection pool internally, it is advised to
7208/// create one and reuse it. You do not need to wrap `NetworkAttachments` in
7209/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7210/// already uses an `Arc` internally.
7211#[cfg(feature = "network-attachments")]
7212#[cfg_attr(docsrs, doc(cfg(feature = "network-attachments")))]
7213#[derive(Clone, Debug)]
7214pub struct NetworkAttachments {
7215 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkAttachments>,
7216}
7217
7218#[cfg(feature = "network-attachments")]
7219impl NetworkAttachments {
7220 /// Returns a builder for [NetworkAttachments].
7221 ///
7222 /// ```
7223 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7224 /// # use google_cloud_compute_v1::client::NetworkAttachments;
7225 /// let client = NetworkAttachments::builder().build().await?;
7226 /// # Ok(()) }
7227 /// ```
7228 pub fn builder() -> super::builder::network_attachments::ClientBuilder {
7229 crate::new_client_builder(super::builder::network_attachments::client::Factory)
7230 }
7231
7232 /// Creates a new client from the provided stub.
7233 ///
7234 /// The most common case for calling this function is in tests mocking the
7235 /// client's behavior.
7236 pub fn from_stub<T>(stub: T) -> Self
7237 where
7238 T: super::stub::NetworkAttachments + 'static,
7239 {
7240 Self {
7241 inner: std::sync::Arc::new(stub),
7242 }
7243 }
7244
7245 pub(crate) async fn new(
7246 config: gaxi::options::ClientConfig,
7247 ) -> crate::ClientBuilderResult<Self> {
7248 let inner = Self::build_inner(config).await?;
7249 Ok(Self { inner })
7250 }
7251
7252 async fn build_inner(
7253 conf: gaxi::options::ClientConfig,
7254 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NetworkAttachments>>
7255 {
7256 if gaxi::options::tracing_enabled(&conf) {
7257 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7258 }
7259 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7260 }
7261
7262 async fn build_transport(
7263 conf: gaxi::options::ClientConfig,
7264 ) -> crate::ClientBuilderResult<impl super::stub::NetworkAttachments> {
7265 super::transport::NetworkAttachments::new(conf).await
7266 }
7267
7268 async fn build_with_tracing(
7269 conf: gaxi::options::ClientConfig,
7270 ) -> crate::ClientBuilderResult<impl super::stub::NetworkAttachments> {
7271 Self::build_transport(conf)
7272 .await
7273 .map(super::tracing::NetworkAttachments::new)
7274 }
7275
7276 /// Retrieves the list of all NetworkAttachment resources,
7277 /// regional and global, available to the specified project.
7278 ///
7279 /// To prevent failure, Google recommends that you set the
7280 /// `returnPartialSuccess` parameter to `true`.
7281 pub fn aggregated_list(&self) -> super::builder::network_attachments::AggregatedList {
7282 super::builder::network_attachments::AggregatedList::new(self.inner.clone())
7283 }
7284
7285 /// Deletes the specified NetworkAttachment in the given scope
7286 pub fn delete(&self) -> super::builder::network_attachments::Delete {
7287 super::builder::network_attachments::Delete::new(self.inner.clone())
7288 }
7289
7290 /// Returns the specified NetworkAttachment resource in the given scope.
7291 pub fn get(&self) -> super::builder::network_attachments::Get {
7292 super::builder::network_attachments::Get::new(self.inner.clone())
7293 }
7294
7295 /// Gets the access control policy for a resource. May be empty if no such
7296 /// policy or resource exists.
7297 pub fn get_iam_policy(&self) -> super::builder::network_attachments::GetIamPolicy {
7298 super::builder::network_attachments::GetIamPolicy::new(self.inner.clone())
7299 }
7300
7301 /// Creates a NetworkAttachment in the specified project in the given scope
7302 /// using the parameters that are included in the request.
7303 pub fn insert(&self) -> super::builder::network_attachments::Insert {
7304 super::builder::network_attachments::Insert::new(self.inner.clone())
7305 }
7306
7307 /// Lists the NetworkAttachments for a project in the given scope.
7308 pub fn list(&self) -> super::builder::network_attachments::List {
7309 super::builder::network_attachments::List::new(self.inner.clone())
7310 }
7311
7312 /// Patches the specified NetworkAttachment resource with the data included in
7313 /// the request. This method supports PATCH
7314 /// semantics and usesJSON merge
7315 /// patch format and processing rules.
7316 pub fn patch(&self) -> super::builder::network_attachments::Patch {
7317 super::builder::network_attachments::Patch::new(self.inner.clone())
7318 }
7319
7320 /// Sets the access control policy on the specified resource.
7321 /// Replaces any existing policy.
7322 pub fn set_iam_policy(&self) -> super::builder::network_attachments::SetIamPolicy {
7323 super::builder::network_attachments::SetIamPolicy::new(self.inner.clone())
7324 }
7325
7326 /// Returns permissions that a caller has on the specified resource.
7327 pub fn test_iam_permissions(&self) -> super::builder::network_attachments::TestIamPermissions {
7328 super::builder::network_attachments::TestIamPermissions::new(self.inner.clone())
7329 }
7330
7331 /// Retrieves the specified region-specific Operations resource.
7332 pub fn get_operation(&self) -> super::builder::network_attachments::GetOperation {
7333 super::builder::network_attachments::GetOperation::new(self.inner.clone())
7334 }
7335}
7336
7337/// Implements a client for the Google Compute Engine API.
7338///
7339/// # Example
7340/// ```
7341/// # use google_cloud_compute_v1::client::NetworkEdgeSecurityServices;
7342/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
7343/// let client = NetworkEdgeSecurityServices::builder().build().await?;
7344/// // use `client` to make requests to the Google Compute Engine API.
7345/// # Ok(()) }
7346/// ```
7347///
7348/// # Service Description
7349///
7350/// Service for the `networkEdgeSecurityServices` resource.
7351///
7352/// # Configuration
7353///
7354/// To configure `NetworkEdgeSecurityServices` use the `with_*` methods in the type returned
7355/// by [builder()][NetworkEdgeSecurityServices::builder]. The default configuration should
7356/// work for most applications. Common configuration changes include
7357///
7358/// * [with_endpoint()]: by default this client uses the global default endpoint
7359/// (`https://compute.googleapis.com`). Applications using regional
7360/// endpoints or running in restricted networks (e.g. a network configured
7361// with [Private Google Access with VPC Service Controls]) may want to
7362/// override this default.
7363/// * [with_credentials()]: by default this client uses
7364/// [Application Default Credentials]. Applications using custom
7365/// authentication may need to override this default.
7366///
7367/// [with_endpoint()]: super::builder::network_edge_security_services::ClientBuilder::with_endpoint
7368/// [with_credentials()]: super::builder::network_edge_security_services::ClientBuilder::with_credentials
7369/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7370/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7371///
7372/// # Pooling and Cloning
7373///
7374/// `NetworkEdgeSecurityServices` holds a connection pool internally, it is advised to
7375/// create one and reuse it. You do not need to wrap `NetworkEdgeSecurityServices` in
7376/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7377/// already uses an `Arc` internally.
7378#[cfg(feature = "network-edge-security-services")]
7379#[cfg_attr(docsrs, doc(cfg(feature = "network-edge-security-services")))]
7380#[derive(Clone, Debug)]
7381pub struct NetworkEdgeSecurityServices {
7382 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkEdgeSecurityServices>,
7383}
7384
7385#[cfg(feature = "network-edge-security-services")]
7386impl NetworkEdgeSecurityServices {
7387 /// Returns a builder for [NetworkEdgeSecurityServices].
7388 ///
7389 /// ```
7390 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7391 /// # use google_cloud_compute_v1::client::NetworkEdgeSecurityServices;
7392 /// let client = NetworkEdgeSecurityServices::builder().build().await?;
7393 /// # Ok(()) }
7394 /// ```
7395 pub fn builder() -> super::builder::network_edge_security_services::ClientBuilder {
7396 crate::new_client_builder(super::builder::network_edge_security_services::client::Factory)
7397 }
7398
7399 /// Creates a new client from the provided stub.
7400 ///
7401 /// The most common case for calling this function is in tests mocking the
7402 /// client's behavior.
7403 pub fn from_stub<T>(stub: T) -> Self
7404 where
7405 T: super::stub::NetworkEdgeSecurityServices + 'static,
7406 {
7407 Self {
7408 inner: std::sync::Arc::new(stub),
7409 }
7410 }
7411
7412 pub(crate) async fn new(
7413 config: gaxi::options::ClientConfig,
7414 ) -> crate::ClientBuilderResult<Self> {
7415 let inner = Self::build_inner(config).await?;
7416 Ok(Self { inner })
7417 }
7418
7419 async fn build_inner(
7420 conf: gaxi::options::ClientConfig,
7421 ) -> crate::ClientBuilderResult<
7422 std::sync::Arc<dyn super::stub::dynamic::NetworkEdgeSecurityServices>,
7423 > {
7424 if gaxi::options::tracing_enabled(&conf) {
7425 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7426 }
7427 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7428 }
7429
7430 async fn build_transport(
7431 conf: gaxi::options::ClientConfig,
7432 ) -> crate::ClientBuilderResult<impl super::stub::NetworkEdgeSecurityServices> {
7433 super::transport::NetworkEdgeSecurityServices::new(conf).await
7434 }
7435
7436 async fn build_with_tracing(
7437 conf: gaxi::options::ClientConfig,
7438 ) -> crate::ClientBuilderResult<impl super::stub::NetworkEdgeSecurityServices> {
7439 Self::build_transport(conf)
7440 .await
7441 .map(super::tracing::NetworkEdgeSecurityServices::new)
7442 }
7443
7444 /// Retrieves the list of all NetworkEdgeSecurityService resources available to
7445 /// the specified project.
7446 ///
7447 /// To prevent failure, Google recommends that you set the
7448 /// `returnPartialSuccess` parameter to `true`.
7449 pub fn aggregated_list(
7450 &self,
7451 ) -> super::builder::network_edge_security_services::AggregatedList {
7452 super::builder::network_edge_security_services::AggregatedList::new(self.inner.clone())
7453 }
7454
7455 /// Deletes the specified service.
7456 pub fn delete(&self) -> super::builder::network_edge_security_services::Delete {
7457 super::builder::network_edge_security_services::Delete::new(self.inner.clone())
7458 }
7459
7460 /// Gets a specified NetworkEdgeSecurityService.
7461 pub fn get(&self) -> super::builder::network_edge_security_services::Get {
7462 super::builder::network_edge_security_services::Get::new(self.inner.clone())
7463 }
7464
7465 /// Creates a new service in the specified project using the data included in
7466 /// the request.
7467 pub fn insert(&self) -> super::builder::network_edge_security_services::Insert {
7468 super::builder::network_edge_security_services::Insert::new(self.inner.clone())
7469 }
7470
7471 /// Patches the specified policy with the data included in the request.
7472 pub fn patch(&self) -> super::builder::network_edge_security_services::Patch {
7473 super::builder::network_edge_security_services::Patch::new(self.inner.clone())
7474 }
7475
7476 /// Retrieves the specified region-specific Operations resource.
7477 pub fn get_operation(&self) -> super::builder::network_edge_security_services::GetOperation {
7478 super::builder::network_edge_security_services::GetOperation::new(self.inner.clone())
7479 }
7480}
7481
7482/// Implements a client for the Google Compute Engine API.
7483///
7484/// # Example
7485/// ```
7486/// # use google_cloud_compute_v1::client::NetworkEndpointGroups;
7487/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
7488/// let client = NetworkEndpointGroups::builder().build().await?;
7489/// // use `client` to make requests to the Google Compute Engine API.
7490/// # Ok(()) }
7491/// ```
7492///
7493/// # Service Description
7494///
7495/// Service for the `networkEndpointGroups` resource.
7496///
7497/// # Configuration
7498///
7499/// To configure `NetworkEndpointGroups` use the `with_*` methods in the type returned
7500/// by [builder()][NetworkEndpointGroups::builder]. The default configuration should
7501/// work for most applications. Common configuration changes include
7502///
7503/// * [with_endpoint()]: by default this client uses the global default endpoint
7504/// (`https://compute.googleapis.com`). Applications using regional
7505/// endpoints or running in restricted networks (e.g. a network configured
7506// with [Private Google Access with VPC Service Controls]) may want to
7507/// override this default.
7508/// * [with_credentials()]: by default this client uses
7509/// [Application Default Credentials]. Applications using custom
7510/// authentication may need to override this default.
7511///
7512/// [with_endpoint()]: super::builder::network_endpoint_groups::ClientBuilder::with_endpoint
7513/// [with_credentials()]: super::builder::network_endpoint_groups::ClientBuilder::with_credentials
7514/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7515/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7516///
7517/// # Pooling and Cloning
7518///
7519/// `NetworkEndpointGroups` holds a connection pool internally, it is advised to
7520/// create one and reuse it. You do not need to wrap `NetworkEndpointGroups` in
7521/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7522/// already uses an `Arc` internally.
7523#[cfg(feature = "network-endpoint-groups")]
7524#[cfg_attr(docsrs, doc(cfg(feature = "network-endpoint-groups")))]
7525#[derive(Clone, Debug)]
7526pub struct NetworkEndpointGroups {
7527 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkEndpointGroups>,
7528}
7529
7530#[cfg(feature = "network-endpoint-groups")]
7531impl NetworkEndpointGroups {
7532 /// Returns a builder for [NetworkEndpointGroups].
7533 ///
7534 /// ```
7535 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7536 /// # use google_cloud_compute_v1::client::NetworkEndpointGroups;
7537 /// let client = NetworkEndpointGroups::builder().build().await?;
7538 /// # Ok(()) }
7539 /// ```
7540 pub fn builder() -> super::builder::network_endpoint_groups::ClientBuilder {
7541 crate::new_client_builder(super::builder::network_endpoint_groups::client::Factory)
7542 }
7543
7544 /// Creates a new client from the provided stub.
7545 ///
7546 /// The most common case for calling this function is in tests mocking the
7547 /// client's behavior.
7548 pub fn from_stub<T>(stub: T) -> Self
7549 where
7550 T: super::stub::NetworkEndpointGroups + 'static,
7551 {
7552 Self {
7553 inner: std::sync::Arc::new(stub),
7554 }
7555 }
7556
7557 pub(crate) async fn new(
7558 config: gaxi::options::ClientConfig,
7559 ) -> crate::ClientBuilderResult<Self> {
7560 let inner = Self::build_inner(config).await?;
7561 Ok(Self { inner })
7562 }
7563
7564 async fn build_inner(
7565 conf: gaxi::options::ClientConfig,
7566 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NetworkEndpointGroups>>
7567 {
7568 if gaxi::options::tracing_enabled(&conf) {
7569 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7570 }
7571 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7572 }
7573
7574 async fn build_transport(
7575 conf: gaxi::options::ClientConfig,
7576 ) -> crate::ClientBuilderResult<impl super::stub::NetworkEndpointGroups> {
7577 super::transport::NetworkEndpointGroups::new(conf).await
7578 }
7579
7580 async fn build_with_tracing(
7581 conf: gaxi::options::ClientConfig,
7582 ) -> crate::ClientBuilderResult<impl super::stub::NetworkEndpointGroups> {
7583 Self::build_transport(conf)
7584 .await
7585 .map(super::tracing::NetworkEndpointGroups::new)
7586 }
7587
7588 /// Retrieves the list of network endpoint groups and sorts them by zone.
7589 ///
7590 /// To prevent failure, Google recommends that you set the
7591 /// `returnPartialSuccess` parameter to `true`.
7592 pub fn aggregated_list(&self) -> super::builder::network_endpoint_groups::AggregatedList {
7593 super::builder::network_endpoint_groups::AggregatedList::new(self.inner.clone())
7594 }
7595
7596 /// Attach a list of network endpoints to the specified network endpoint group.
7597 pub fn attach_network_endpoints(
7598 &self,
7599 ) -> super::builder::network_endpoint_groups::AttachNetworkEndpoints {
7600 super::builder::network_endpoint_groups::AttachNetworkEndpoints::new(self.inner.clone())
7601 }
7602
7603 /// Deletes the specified network endpoint group. The network endpoints in the
7604 /// NEG and the VM instances they belong to are not terminated when the NEG is
7605 /// deleted. Note that the NEG cannot be deleted if there are backend services
7606 /// referencing it.
7607 pub fn delete(&self) -> super::builder::network_endpoint_groups::Delete {
7608 super::builder::network_endpoint_groups::Delete::new(self.inner.clone())
7609 }
7610
7611 /// Detach a list of network endpoints from the specified network endpoint
7612 /// group.
7613 pub fn detach_network_endpoints(
7614 &self,
7615 ) -> super::builder::network_endpoint_groups::DetachNetworkEndpoints {
7616 super::builder::network_endpoint_groups::DetachNetworkEndpoints::new(self.inner.clone())
7617 }
7618
7619 /// Returns the specified network endpoint group.
7620 pub fn get(&self) -> super::builder::network_endpoint_groups::Get {
7621 super::builder::network_endpoint_groups::Get::new(self.inner.clone())
7622 }
7623
7624 /// Creates a network endpoint group in the specified project using the
7625 /// parameters that are included in the request.
7626 ///
7627 /// Note: Use the following APIs to manage network endpoint groups:
7628 ///
7629 /// - To manage NEGs with zonal scope (such as zonal NEGs, hybrid connectivity
7630 /// NEGs): zonal
7631 /// API
7632 /// - To manage NEGs with regional scope (such as regional internet NEGs,
7633 /// serverless NEGs, Private Service Connect NEGs): regional
7634 /// API
7635 /// - To manage NEGs with global scope (such as global internet NEGs):global
7636 /// API
7637 pub fn insert(&self) -> super::builder::network_endpoint_groups::Insert {
7638 super::builder::network_endpoint_groups::Insert::new(self.inner.clone())
7639 }
7640
7641 /// Retrieves the list of network endpoint groups that are located in the
7642 /// specified project and zone.
7643 pub fn list(&self) -> super::builder::network_endpoint_groups::List {
7644 super::builder::network_endpoint_groups::List::new(self.inner.clone())
7645 }
7646
7647 /// Lists the network endpoints in the specified network endpoint group.
7648 pub fn list_network_endpoints(
7649 &self,
7650 ) -> super::builder::network_endpoint_groups::ListNetworkEndpoints {
7651 super::builder::network_endpoint_groups::ListNetworkEndpoints::new(self.inner.clone())
7652 }
7653
7654 /// Returns permissions that a caller has on the specified resource.
7655 pub fn test_iam_permissions(
7656 &self,
7657 ) -> super::builder::network_endpoint_groups::TestIamPermissions {
7658 super::builder::network_endpoint_groups::TestIamPermissions::new(self.inner.clone())
7659 }
7660
7661 /// Retrieves the specified zone-specific Operations resource.
7662 pub fn get_operation(&self) -> super::builder::network_endpoint_groups::GetOperation {
7663 super::builder::network_endpoint_groups::GetOperation::new(self.inner.clone())
7664 }
7665}
7666
7667/// Implements a client for the Google Compute Engine API.
7668///
7669/// # Example
7670/// ```
7671/// # use google_cloud_compute_v1::client::NetworkFirewallPolicies;
7672/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
7673/// let client = NetworkFirewallPolicies::builder().build().await?;
7674/// // use `client` to make requests to the Google Compute Engine API.
7675/// # Ok(()) }
7676/// ```
7677///
7678/// # Service Description
7679///
7680/// Service for the `networkFirewallPolicies` resource.
7681///
7682/// # Configuration
7683///
7684/// To configure `NetworkFirewallPolicies` use the `with_*` methods in the type returned
7685/// by [builder()][NetworkFirewallPolicies::builder]. The default configuration should
7686/// work for most applications. Common configuration changes include
7687///
7688/// * [with_endpoint()]: by default this client uses the global default endpoint
7689/// (`https://compute.googleapis.com`). Applications using regional
7690/// endpoints or running in restricted networks (e.g. a network configured
7691// with [Private Google Access with VPC Service Controls]) may want to
7692/// override this default.
7693/// * [with_credentials()]: by default this client uses
7694/// [Application Default Credentials]. Applications using custom
7695/// authentication may need to override this default.
7696///
7697/// [with_endpoint()]: super::builder::network_firewall_policies::ClientBuilder::with_endpoint
7698/// [with_credentials()]: super::builder::network_firewall_policies::ClientBuilder::with_credentials
7699/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7700/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7701///
7702/// # Pooling and Cloning
7703///
7704/// `NetworkFirewallPolicies` holds a connection pool internally, it is advised to
7705/// create one and reuse it. You do not need to wrap `NetworkFirewallPolicies` in
7706/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7707/// already uses an `Arc` internally.
7708#[cfg(feature = "network-firewall-policies")]
7709#[cfg_attr(docsrs, doc(cfg(feature = "network-firewall-policies")))]
7710#[derive(Clone, Debug)]
7711pub struct NetworkFirewallPolicies {
7712 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkFirewallPolicies>,
7713}
7714
7715#[cfg(feature = "network-firewall-policies")]
7716impl NetworkFirewallPolicies {
7717 /// Returns a builder for [NetworkFirewallPolicies].
7718 ///
7719 /// ```
7720 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7721 /// # use google_cloud_compute_v1::client::NetworkFirewallPolicies;
7722 /// let client = NetworkFirewallPolicies::builder().build().await?;
7723 /// # Ok(()) }
7724 /// ```
7725 pub fn builder() -> super::builder::network_firewall_policies::ClientBuilder {
7726 crate::new_client_builder(super::builder::network_firewall_policies::client::Factory)
7727 }
7728
7729 /// Creates a new client from the provided stub.
7730 ///
7731 /// The most common case for calling this function is in tests mocking the
7732 /// client's behavior.
7733 pub fn from_stub<T>(stub: T) -> Self
7734 where
7735 T: super::stub::NetworkFirewallPolicies + 'static,
7736 {
7737 Self {
7738 inner: std::sync::Arc::new(stub),
7739 }
7740 }
7741
7742 pub(crate) async fn new(
7743 config: gaxi::options::ClientConfig,
7744 ) -> crate::ClientBuilderResult<Self> {
7745 let inner = Self::build_inner(config).await?;
7746 Ok(Self { inner })
7747 }
7748
7749 async fn build_inner(
7750 conf: gaxi::options::ClientConfig,
7751 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NetworkFirewallPolicies>>
7752 {
7753 if gaxi::options::tracing_enabled(&conf) {
7754 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7755 }
7756 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7757 }
7758
7759 async fn build_transport(
7760 conf: gaxi::options::ClientConfig,
7761 ) -> crate::ClientBuilderResult<impl super::stub::NetworkFirewallPolicies> {
7762 super::transport::NetworkFirewallPolicies::new(conf).await
7763 }
7764
7765 async fn build_with_tracing(
7766 conf: gaxi::options::ClientConfig,
7767 ) -> crate::ClientBuilderResult<impl super::stub::NetworkFirewallPolicies> {
7768 Self::build_transport(conf)
7769 .await
7770 .map(super::tracing::NetworkFirewallPolicies::new)
7771 }
7772
7773 /// Inserts an association for the specified firewall policy.
7774 pub fn add_association(&self) -> super::builder::network_firewall_policies::AddAssociation {
7775 super::builder::network_firewall_policies::AddAssociation::new(self.inner.clone())
7776 }
7777
7778 /// Inserts a packet mirroring rule into a firewall policy.
7779 pub fn add_packet_mirroring_rule(
7780 &self,
7781 ) -> super::builder::network_firewall_policies::AddPacketMirroringRule {
7782 super::builder::network_firewall_policies::AddPacketMirroringRule::new(self.inner.clone())
7783 }
7784
7785 /// Inserts a rule into a firewall policy.
7786 pub fn add_rule(&self) -> super::builder::network_firewall_policies::AddRule {
7787 super::builder::network_firewall_policies::AddRule::new(self.inner.clone())
7788 }
7789
7790 /// Retrieves an aggregated list of network firewall policies, listing network
7791 /// firewall policies from all applicable scopes (global and regional) and
7792 /// grouping the results per scope.
7793 ///
7794 /// To prevent failure, it is recommended that you set the
7795 /// `returnPartialSuccess` parameter to `true`.
7796 pub fn aggregated_list(&self) -> super::builder::network_firewall_policies::AggregatedList {
7797 super::builder::network_firewall_policies::AggregatedList::new(self.inner.clone())
7798 }
7799
7800 /// Copies rules to the specified firewall policy.
7801 pub fn clone_rules(&self) -> super::builder::network_firewall_policies::CloneRules {
7802 super::builder::network_firewall_policies::CloneRules::new(self.inner.clone())
7803 }
7804
7805 /// Deletes the specified policy.
7806 pub fn delete(&self) -> super::builder::network_firewall_policies::Delete {
7807 super::builder::network_firewall_policies::Delete::new(self.inner.clone())
7808 }
7809
7810 /// Returns the specified network firewall policy.
7811 pub fn get(&self) -> super::builder::network_firewall_policies::Get {
7812 super::builder::network_firewall_policies::Get::new(self.inner.clone())
7813 }
7814
7815 /// Gets an association with the specified name.
7816 pub fn get_association(&self) -> super::builder::network_firewall_policies::GetAssociation {
7817 super::builder::network_firewall_policies::GetAssociation::new(self.inner.clone())
7818 }
7819
7820 /// Gets the access control policy for a resource. May be empty if no such
7821 /// policy or resource exists.
7822 pub fn get_iam_policy(&self) -> super::builder::network_firewall_policies::GetIamPolicy {
7823 super::builder::network_firewall_policies::GetIamPolicy::new(self.inner.clone())
7824 }
7825
7826 /// Gets a packet mirroring rule of the specified priority.
7827 pub fn get_packet_mirroring_rule(
7828 &self,
7829 ) -> super::builder::network_firewall_policies::GetPacketMirroringRule {
7830 super::builder::network_firewall_policies::GetPacketMirroringRule::new(self.inner.clone())
7831 }
7832
7833 /// Gets a rule of the specified priority.
7834 pub fn get_rule(&self) -> super::builder::network_firewall_policies::GetRule {
7835 super::builder::network_firewall_policies::GetRule::new(self.inner.clone())
7836 }
7837
7838 /// Creates a new policy in the specified project using the data included in
7839 /// the request.
7840 pub fn insert(&self) -> super::builder::network_firewall_policies::Insert {
7841 super::builder::network_firewall_policies::Insert::new(self.inner.clone())
7842 }
7843
7844 /// Lists all the policies that have been configured for the specified project.
7845 pub fn list(&self) -> super::builder::network_firewall_policies::List {
7846 super::builder::network_firewall_policies::List::new(self.inner.clone())
7847 }
7848
7849 /// Patches the specified policy with the data included in the request.
7850 pub fn patch(&self) -> super::builder::network_firewall_policies::Patch {
7851 super::builder::network_firewall_policies::Patch::new(self.inner.clone())
7852 }
7853
7854 /// Patches a packet mirroring rule of the specified priority.
7855 pub fn patch_packet_mirroring_rule(
7856 &self,
7857 ) -> super::builder::network_firewall_policies::PatchPacketMirroringRule {
7858 super::builder::network_firewall_policies::PatchPacketMirroringRule::new(self.inner.clone())
7859 }
7860
7861 /// Patches a rule of the specified priority.
7862 pub fn patch_rule(&self) -> super::builder::network_firewall_policies::PatchRule {
7863 super::builder::network_firewall_policies::PatchRule::new(self.inner.clone())
7864 }
7865
7866 /// Removes an association for the specified firewall policy.
7867 pub fn remove_association(
7868 &self,
7869 ) -> super::builder::network_firewall_policies::RemoveAssociation {
7870 super::builder::network_firewall_policies::RemoveAssociation::new(self.inner.clone())
7871 }
7872
7873 /// Deletes a packet mirroring rule of the specified priority.
7874 pub fn remove_packet_mirroring_rule(
7875 &self,
7876 ) -> super::builder::network_firewall_policies::RemovePacketMirroringRule {
7877 super::builder::network_firewall_policies::RemovePacketMirroringRule::new(
7878 self.inner.clone(),
7879 )
7880 }
7881
7882 /// Deletes a rule of the specified priority.
7883 pub fn remove_rule(&self) -> super::builder::network_firewall_policies::RemoveRule {
7884 super::builder::network_firewall_policies::RemoveRule::new(self.inner.clone())
7885 }
7886
7887 /// Sets the access control policy on the specified resource.
7888 /// Replaces any existing policy.
7889 pub fn set_iam_policy(&self) -> super::builder::network_firewall_policies::SetIamPolicy {
7890 super::builder::network_firewall_policies::SetIamPolicy::new(self.inner.clone())
7891 }
7892
7893 /// Returns permissions that a caller has on the specified resource.
7894 pub fn test_iam_permissions(
7895 &self,
7896 ) -> super::builder::network_firewall_policies::TestIamPermissions {
7897 super::builder::network_firewall_policies::TestIamPermissions::new(self.inner.clone())
7898 }
7899
7900 /// Retrieves the specified Operations resource.
7901 pub fn get_operation(&self) -> super::builder::network_firewall_policies::GetOperation {
7902 super::builder::network_firewall_policies::GetOperation::new(self.inner.clone())
7903 }
7904}
7905
7906/// Implements a client for the Google Compute Engine API.
7907///
7908/// # Example
7909/// ```
7910/// # use google_cloud_compute_v1::client::NetworkProfiles;
7911/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
7912/// let client = NetworkProfiles::builder().build().await?;
7913/// // use `client` to make requests to the Google Compute Engine API.
7914/// # Ok(()) }
7915/// ```
7916///
7917/// # Service Description
7918///
7919/// Service for the `networkProfiles` resource.
7920///
7921/// # Configuration
7922///
7923/// To configure `NetworkProfiles` use the `with_*` methods in the type returned
7924/// by [builder()][NetworkProfiles::builder]. The default configuration should
7925/// work for most applications. Common configuration changes include
7926///
7927/// * [with_endpoint()]: by default this client uses the global default endpoint
7928/// (`https://compute.googleapis.com`). Applications using regional
7929/// endpoints or running in restricted networks (e.g. a network configured
7930// with [Private Google Access with VPC Service Controls]) may want to
7931/// override this default.
7932/// * [with_credentials()]: by default this client uses
7933/// [Application Default Credentials]. Applications using custom
7934/// authentication may need to override this default.
7935///
7936/// [with_endpoint()]: super::builder::network_profiles::ClientBuilder::with_endpoint
7937/// [with_credentials()]: super::builder::network_profiles::ClientBuilder::with_credentials
7938/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7939/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7940///
7941/// # Pooling and Cloning
7942///
7943/// `NetworkProfiles` holds a connection pool internally, it is advised to
7944/// create one and reuse it. You do not need to wrap `NetworkProfiles` in
7945/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7946/// already uses an `Arc` internally.
7947#[cfg(feature = "network-profiles")]
7948#[cfg_attr(docsrs, doc(cfg(feature = "network-profiles")))]
7949#[derive(Clone, Debug)]
7950pub struct NetworkProfiles {
7951 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkProfiles>,
7952}
7953
7954#[cfg(feature = "network-profiles")]
7955impl NetworkProfiles {
7956 /// Returns a builder for [NetworkProfiles].
7957 ///
7958 /// ```
7959 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7960 /// # use google_cloud_compute_v1::client::NetworkProfiles;
7961 /// let client = NetworkProfiles::builder().build().await?;
7962 /// # Ok(()) }
7963 /// ```
7964 pub fn builder() -> super::builder::network_profiles::ClientBuilder {
7965 crate::new_client_builder(super::builder::network_profiles::client::Factory)
7966 }
7967
7968 /// Creates a new client from the provided stub.
7969 ///
7970 /// The most common case for calling this function is in tests mocking the
7971 /// client's behavior.
7972 pub fn from_stub<T>(stub: T) -> Self
7973 where
7974 T: super::stub::NetworkProfiles + 'static,
7975 {
7976 Self {
7977 inner: std::sync::Arc::new(stub),
7978 }
7979 }
7980
7981 pub(crate) async fn new(
7982 config: gaxi::options::ClientConfig,
7983 ) -> crate::ClientBuilderResult<Self> {
7984 let inner = Self::build_inner(config).await?;
7985 Ok(Self { inner })
7986 }
7987
7988 async fn build_inner(
7989 conf: gaxi::options::ClientConfig,
7990 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NetworkProfiles>> {
7991 if gaxi::options::tracing_enabled(&conf) {
7992 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7993 }
7994 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7995 }
7996
7997 async fn build_transport(
7998 conf: gaxi::options::ClientConfig,
7999 ) -> crate::ClientBuilderResult<impl super::stub::NetworkProfiles> {
8000 super::transport::NetworkProfiles::new(conf).await
8001 }
8002
8003 async fn build_with_tracing(
8004 conf: gaxi::options::ClientConfig,
8005 ) -> crate::ClientBuilderResult<impl super::stub::NetworkProfiles> {
8006 Self::build_transport(conf)
8007 .await
8008 .map(super::tracing::NetworkProfiles::new)
8009 }
8010
8011 /// Returns the specified network profile.
8012 pub fn get(&self) -> super::builder::network_profiles::Get {
8013 super::builder::network_profiles::Get::new(self.inner.clone())
8014 }
8015
8016 /// Retrieves a list of network profiles available to the specified
8017 /// project.
8018 pub fn list(&self) -> super::builder::network_profiles::List {
8019 super::builder::network_profiles::List::new(self.inner.clone())
8020 }
8021}
8022
8023/// Implements a client for the Google Compute Engine API.
8024///
8025/// # Example
8026/// ```
8027/// # use google_cloud_compute_v1::client::Networks;
8028/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
8029/// let client = Networks::builder().build().await?;
8030/// // use `client` to make requests to the Google Compute Engine API.
8031/// # Ok(()) }
8032/// ```
8033///
8034/// # Service Description
8035///
8036/// Service for the `networks` resource.
8037///
8038/// # Configuration
8039///
8040/// To configure `Networks` use the `with_*` methods in the type returned
8041/// by [builder()][Networks::builder]. The default configuration should
8042/// work for most applications. Common configuration changes include
8043///
8044/// * [with_endpoint()]: by default this client uses the global default endpoint
8045/// (`https://compute.googleapis.com`). Applications using regional
8046/// endpoints or running in restricted networks (e.g. a network configured
8047// with [Private Google Access with VPC Service Controls]) may want to
8048/// override this default.
8049/// * [with_credentials()]: by default this client uses
8050/// [Application Default Credentials]. Applications using custom
8051/// authentication may need to override this default.
8052///
8053/// [with_endpoint()]: super::builder::networks::ClientBuilder::with_endpoint
8054/// [with_credentials()]: super::builder::networks::ClientBuilder::with_credentials
8055/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8056/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8057///
8058/// # Pooling and Cloning
8059///
8060/// `Networks` holds a connection pool internally, it is advised to
8061/// create one and reuse it. You do not need to wrap `Networks` in
8062/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8063/// already uses an `Arc` internally.
8064#[cfg(feature = "networks")]
8065#[cfg_attr(docsrs, doc(cfg(feature = "networks")))]
8066#[derive(Clone, Debug)]
8067pub struct Networks {
8068 inner: std::sync::Arc<dyn super::stub::dynamic::Networks>,
8069}
8070
8071#[cfg(feature = "networks")]
8072impl Networks {
8073 /// Returns a builder for [Networks].
8074 ///
8075 /// ```
8076 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8077 /// # use google_cloud_compute_v1::client::Networks;
8078 /// let client = Networks::builder().build().await?;
8079 /// # Ok(()) }
8080 /// ```
8081 pub fn builder() -> super::builder::networks::ClientBuilder {
8082 crate::new_client_builder(super::builder::networks::client::Factory)
8083 }
8084
8085 /// Creates a new client from the provided stub.
8086 ///
8087 /// The most common case for calling this function is in tests mocking the
8088 /// client's behavior.
8089 pub fn from_stub<T>(stub: T) -> Self
8090 where
8091 T: super::stub::Networks + 'static,
8092 {
8093 Self {
8094 inner: std::sync::Arc::new(stub),
8095 }
8096 }
8097
8098 pub(crate) async fn new(
8099 config: gaxi::options::ClientConfig,
8100 ) -> crate::ClientBuilderResult<Self> {
8101 let inner = Self::build_inner(config).await?;
8102 Ok(Self { inner })
8103 }
8104
8105 async fn build_inner(
8106 conf: gaxi::options::ClientConfig,
8107 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Networks>> {
8108 if gaxi::options::tracing_enabled(&conf) {
8109 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8110 }
8111 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8112 }
8113
8114 async fn build_transport(
8115 conf: gaxi::options::ClientConfig,
8116 ) -> crate::ClientBuilderResult<impl super::stub::Networks> {
8117 super::transport::Networks::new(conf).await
8118 }
8119
8120 async fn build_with_tracing(
8121 conf: gaxi::options::ClientConfig,
8122 ) -> crate::ClientBuilderResult<impl super::stub::Networks> {
8123 Self::build_transport(conf)
8124 .await
8125 .map(super::tracing::Networks::new)
8126 }
8127
8128 /// Adds a peering to the specified network.
8129 pub fn add_peering(&self) -> super::builder::networks::AddPeering {
8130 super::builder::networks::AddPeering::new(self.inner.clone())
8131 }
8132
8133 /// Deletes the specified network.
8134 pub fn delete(&self) -> super::builder::networks::Delete {
8135 super::builder::networks::Delete::new(self.inner.clone())
8136 }
8137
8138 /// Returns the specified network.
8139 pub fn get(&self) -> super::builder::networks::Get {
8140 super::builder::networks::Get::new(self.inner.clone())
8141 }
8142
8143 /// Returns the effective firewalls on a given network.
8144 pub fn get_effective_firewalls(&self) -> super::builder::networks::GetEffectiveFirewalls {
8145 super::builder::networks::GetEffectiveFirewalls::new(self.inner.clone())
8146 }
8147
8148 /// Creates a network in the specified project using the data included
8149 /// in the request.
8150 pub fn insert(&self) -> super::builder::networks::Insert {
8151 super::builder::networks::Insert::new(self.inner.clone())
8152 }
8153
8154 /// Retrieves the list of networks available to the specified project.
8155 pub fn list(&self) -> super::builder::networks::List {
8156 super::builder::networks::List::new(self.inner.clone())
8157 }
8158
8159 /// Lists the peering routes exchanged over peering connection.
8160 pub fn list_peering_routes(&self) -> super::builder::networks::ListPeeringRoutes {
8161 super::builder::networks::ListPeeringRoutes::new(self.inner.clone())
8162 }
8163
8164 /// Patches the specified network with the data included in the request.
8165 /// Only routingConfig can be modified.
8166 pub fn patch(&self) -> super::builder::networks::Patch {
8167 super::builder::networks::Patch::new(self.inner.clone())
8168 }
8169
8170 /// Removes a peering from the specified network.
8171 pub fn remove_peering(&self) -> super::builder::networks::RemovePeering {
8172 super::builder::networks::RemovePeering::new(self.inner.clone())
8173 }
8174
8175 /// Requests to remove a peering from the specified network. Applicable only
8176 /// for PeeringConnection with update_strategy=CONSENSUS.
8177 pub fn request_remove_peering(&self) -> super::builder::networks::RequestRemovePeering {
8178 super::builder::networks::RequestRemovePeering::new(self.inner.clone())
8179 }
8180
8181 /// Switches the network mode from auto subnet mode to custom subnet mode.
8182 pub fn switch_to_custom_mode(&self) -> super::builder::networks::SwitchToCustomMode {
8183 super::builder::networks::SwitchToCustomMode::new(self.inner.clone())
8184 }
8185
8186 /// Updates the specified network peering with the data included in the
8187 /// request. You can only modify the NetworkPeering.export_custom_routes field
8188 /// and the NetworkPeering.import_custom_routes field.
8189 pub fn update_peering(&self) -> super::builder::networks::UpdatePeering {
8190 super::builder::networks::UpdatePeering::new(self.inner.clone())
8191 }
8192
8193 /// Retrieves the specified Operations resource.
8194 pub fn get_operation(&self) -> super::builder::networks::GetOperation {
8195 super::builder::networks::GetOperation::new(self.inner.clone())
8196 }
8197}
8198
8199/// Implements a client for the Google Compute Engine API.
8200///
8201/// # Example
8202/// ```
8203/// # use google_cloud_compute_v1::client::NodeGroups;
8204/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
8205/// let client = NodeGroups::builder().build().await?;
8206/// // use `client` to make requests to the Google Compute Engine API.
8207/// # Ok(()) }
8208/// ```
8209///
8210/// # Service Description
8211///
8212/// Service for the `nodeGroups` resource.
8213///
8214/// # Configuration
8215///
8216/// To configure `NodeGroups` use the `with_*` methods in the type returned
8217/// by [builder()][NodeGroups::builder]. The default configuration should
8218/// work for most applications. Common configuration changes include
8219///
8220/// * [with_endpoint()]: by default this client uses the global default endpoint
8221/// (`https://compute.googleapis.com`). Applications using regional
8222/// endpoints or running in restricted networks (e.g. a network configured
8223// with [Private Google Access with VPC Service Controls]) may want to
8224/// override this default.
8225/// * [with_credentials()]: by default this client uses
8226/// [Application Default Credentials]. Applications using custom
8227/// authentication may need to override this default.
8228///
8229/// [with_endpoint()]: super::builder::node_groups::ClientBuilder::with_endpoint
8230/// [with_credentials()]: super::builder::node_groups::ClientBuilder::with_credentials
8231/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8232/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8233///
8234/// # Pooling and Cloning
8235///
8236/// `NodeGroups` holds a connection pool internally, it is advised to
8237/// create one and reuse it. You do not need to wrap `NodeGroups` in
8238/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8239/// already uses an `Arc` internally.
8240#[cfg(feature = "node-groups")]
8241#[cfg_attr(docsrs, doc(cfg(feature = "node-groups")))]
8242#[derive(Clone, Debug)]
8243pub struct NodeGroups {
8244 inner: std::sync::Arc<dyn super::stub::dynamic::NodeGroups>,
8245}
8246
8247#[cfg(feature = "node-groups")]
8248impl NodeGroups {
8249 /// Returns a builder for [NodeGroups].
8250 ///
8251 /// ```
8252 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8253 /// # use google_cloud_compute_v1::client::NodeGroups;
8254 /// let client = NodeGroups::builder().build().await?;
8255 /// # Ok(()) }
8256 /// ```
8257 pub fn builder() -> super::builder::node_groups::ClientBuilder {
8258 crate::new_client_builder(super::builder::node_groups::client::Factory)
8259 }
8260
8261 /// Creates a new client from the provided stub.
8262 ///
8263 /// The most common case for calling this function is in tests mocking the
8264 /// client's behavior.
8265 pub fn from_stub<T>(stub: T) -> Self
8266 where
8267 T: super::stub::NodeGroups + 'static,
8268 {
8269 Self {
8270 inner: std::sync::Arc::new(stub),
8271 }
8272 }
8273
8274 pub(crate) async fn new(
8275 config: gaxi::options::ClientConfig,
8276 ) -> crate::ClientBuilderResult<Self> {
8277 let inner = Self::build_inner(config).await?;
8278 Ok(Self { inner })
8279 }
8280
8281 async fn build_inner(
8282 conf: gaxi::options::ClientConfig,
8283 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NodeGroups>> {
8284 if gaxi::options::tracing_enabled(&conf) {
8285 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8286 }
8287 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8288 }
8289
8290 async fn build_transport(
8291 conf: gaxi::options::ClientConfig,
8292 ) -> crate::ClientBuilderResult<impl super::stub::NodeGroups> {
8293 super::transport::NodeGroups::new(conf).await
8294 }
8295
8296 async fn build_with_tracing(
8297 conf: gaxi::options::ClientConfig,
8298 ) -> crate::ClientBuilderResult<impl super::stub::NodeGroups> {
8299 Self::build_transport(conf)
8300 .await
8301 .map(super::tracing::NodeGroups::new)
8302 }
8303
8304 /// Adds specified number of nodes to the node group.
8305 pub fn add_nodes(&self) -> super::builder::node_groups::AddNodes {
8306 super::builder::node_groups::AddNodes::new(self.inner.clone())
8307 }
8308
8309 /// Retrieves an aggregated list of node groups.
8310 /// Note: use nodeGroups.listNodes for more details about each group.
8311 ///
8312 /// To prevent failure, Google recommends that you set the
8313 /// `returnPartialSuccess` parameter to `true`.
8314 pub fn aggregated_list(&self) -> super::builder::node_groups::AggregatedList {
8315 super::builder::node_groups::AggregatedList::new(self.inner.clone())
8316 }
8317
8318 /// Deletes the specified NodeGroup resource.
8319 pub fn delete(&self) -> super::builder::node_groups::Delete {
8320 super::builder::node_groups::Delete::new(self.inner.clone())
8321 }
8322
8323 /// Deletes specified nodes from the node group.
8324 pub fn delete_nodes(&self) -> super::builder::node_groups::DeleteNodes {
8325 super::builder::node_groups::DeleteNodes::new(self.inner.clone())
8326 }
8327
8328 /// Returns the specified NodeGroup. Get a list of available NodeGroups
8329 /// by making a list() request.
8330 /// Note: the "nodes" field should not be used. Use nodeGroups.listNodes
8331 /// instead.
8332 pub fn get(&self) -> super::builder::node_groups::Get {
8333 super::builder::node_groups::Get::new(self.inner.clone())
8334 }
8335
8336 /// Gets the access control policy for a resource. May be empty if no such
8337 /// policy or resource exists.
8338 pub fn get_iam_policy(&self) -> super::builder::node_groups::GetIamPolicy {
8339 super::builder::node_groups::GetIamPolicy::new(self.inner.clone())
8340 }
8341
8342 /// Creates a NodeGroup resource in the specified project using the data
8343 /// included in the request.
8344 pub fn insert(&self) -> super::builder::node_groups::Insert {
8345 super::builder::node_groups::Insert::new(self.inner.clone())
8346 }
8347
8348 /// Retrieves a list of node groups available to the specified project.
8349 /// Note: use nodeGroups.listNodes for more details about each group.
8350 pub fn list(&self) -> super::builder::node_groups::List {
8351 super::builder::node_groups::List::new(self.inner.clone())
8352 }
8353
8354 /// Lists nodes in the node group.
8355 pub fn list_nodes(&self) -> super::builder::node_groups::ListNodes {
8356 super::builder::node_groups::ListNodes::new(self.inner.clone())
8357 }
8358
8359 /// Updates the specified node group.
8360 pub fn patch(&self) -> super::builder::node_groups::Patch {
8361 super::builder::node_groups::Patch::new(self.inner.clone())
8362 }
8363
8364 /// Perform maintenance on a subset of nodes in the node group.
8365 pub fn perform_maintenance(&self) -> super::builder::node_groups::PerformMaintenance {
8366 super::builder::node_groups::PerformMaintenance::new(self.inner.clone())
8367 }
8368
8369 /// Sets the access control policy on the specified resource.
8370 /// Replaces any existing policy.
8371 pub fn set_iam_policy(&self) -> super::builder::node_groups::SetIamPolicy {
8372 super::builder::node_groups::SetIamPolicy::new(self.inner.clone())
8373 }
8374
8375 /// Updates the node template of the node group.
8376 pub fn set_node_template(&self) -> super::builder::node_groups::SetNodeTemplate {
8377 super::builder::node_groups::SetNodeTemplate::new(self.inner.clone())
8378 }
8379
8380 /// Simulates maintenance event on specified nodes from the node group.
8381 pub fn simulate_maintenance_event(
8382 &self,
8383 ) -> super::builder::node_groups::SimulateMaintenanceEvent {
8384 super::builder::node_groups::SimulateMaintenanceEvent::new(self.inner.clone())
8385 }
8386
8387 /// Returns permissions that a caller has on the specified resource.
8388 pub fn test_iam_permissions(&self) -> super::builder::node_groups::TestIamPermissions {
8389 super::builder::node_groups::TestIamPermissions::new(self.inner.clone())
8390 }
8391
8392 /// Retrieves the specified zone-specific Operations resource.
8393 pub fn get_operation(&self) -> super::builder::node_groups::GetOperation {
8394 super::builder::node_groups::GetOperation::new(self.inner.clone())
8395 }
8396}
8397
8398/// Implements a client for the Google Compute Engine API.
8399///
8400/// # Example
8401/// ```
8402/// # use google_cloud_compute_v1::client::NodeTemplates;
8403/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
8404/// let client = NodeTemplates::builder().build().await?;
8405/// // use `client` to make requests to the Google Compute Engine API.
8406/// # Ok(()) }
8407/// ```
8408///
8409/// # Service Description
8410///
8411/// Service for the `nodeTemplates` resource.
8412///
8413/// # Configuration
8414///
8415/// To configure `NodeTemplates` use the `with_*` methods in the type returned
8416/// by [builder()][NodeTemplates::builder]. The default configuration should
8417/// work for most applications. Common configuration changes include
8418///
8419/// * [with_endpoint()]: by default this client uses the global default endpoint
8420/// (`https://compute.googleapis.com`). Applications using regional
8421/// endpoints or running in restricted networks (e.g. a network configured
8422// with [Private Google Access with VPC Service Controls]) may want to
8423/// override this default.
8424/// * [with_credentials()]: by default this client uses
8425/// [Application Default Credentials]. Applications using custom
8426/// authentication may need to override this default.
8427///
8428/// [with_endpoint()]: super::builder::node_templates::ClientBuilder::with_endpoint
8429/// [with_credentials()]: super::builder::node_templates::ClientBuilder::with_credentials
8430/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8431/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8432///
8433/// # Pooling and Cloning
8434///
8435/// `NodeTemplates` holds a connection pool internally, it is advised to
8436/// create one and reuse it. You do not need to wrap `NodeTemplates` in
8437/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8438/// already uses an `Arc` internally.
8439#[cfg(feature = "node-templates")]
8440#[cfg_attr(docsrs, doc(cfg(feature = "node-templates")))]
8441#[derive(Clone, Debug)]
8442pub struct NodeTemplates {
8443 inner: std::sync::Arc<dyn super::stub::dynamic::NodeTemplates>,
8444}
8445
8446#[cfg(feature = "node-templates")]
8447impl NodeTemplates {
8448 /// Returns a builder for [NodeTemplates].
8449 ///
8450 /// ```
8451 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8452 /// # use google_cloud_compute_v1::client::NodeTemplates;
8453 /// let client = NodeTemplates::builder().build().await?;
8454 /// # Ok(()) }
8455 /// ```
8456 pub fn builder() -> super::builder::node_templates::ClientBuilder {
8457 crate::new_client_builder(super::builder::node_templates::client::Factory)
8458 }
8459
8460 /// Creates a new client from the provided stub.
8461 ///
8462 /// The most common case for calling this function is in tests mocking the
8463 /// client's behavior.
8464 pub fn from_stub<T>(stub: T) -> Self
8465 where
8466 T: super::stub::NodeTemplates + 'static,
8467 {
8468 Self {
8469 inner: std::sync::Arc::new(stub),
8470 }
8471 }
8472
8473 pub(crate) async fn new(
8474 config: gaxi::options::ClientConfig,
8475 ) -> crate::ClientBuilderResult<Self> {
8476 let inner = Self::build_inner(config).await?;
8477 Ok(Self { inner })
8478 }
8479
8480 async fn build_inner(
8481 conf: gaxi::options::ClientConfig,
8482 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NodeTemplates>> {
8483 if gaxi::options::tracing_enabled(&conf) {
8484 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8485 }
8486 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8487 }
8488
8489 async fn build_transport(
8490 conf: gaxi::options::ClientConfig,
8491 ) -> crate::ClientBuilderResult<impl super::stub::NodeTemplates> {
8492 super::transport::NodeTemplates::new(conf).await
8493 }
8494
8495 async fn build_with_tracing(
8496 conf: gaxi::options::ClientConfig,
8497 ) -> crate::ClientBuilderResult<impl super::stub::NodeTemplates> {
8498 Self::build_transport(conf)
8499 .await
8500 .map(super::tracing::NodeTemplates::new)
8501 }
8502
8503 /// Retrieves an aggregated list of node templates.
8504 ///
8505 /// To prevent failure, Google recommends that you set the
8506 /// `returnPartialSuccess` parameter to `true`.
8507 pub fn aggregated_list(&self) -> super::builder::node_templates::AggregatedList {
8508 super::builder::node_templates::AggregatedList::new(self.inner.clone())
8509 }
8510
8511 /// Deletes the specified NodeTemplate resource.
8512 pub fn delete(&self) -> super::builder::node_templates::Delete {
8513 super::builder::node_templates::Delete::new(self.inner.clone())
8514 }
8515
8516 /// Returns the specified node template.
8517 pub fn get(&self) -> super::builder::node_templates::Get {
8518 super::builder::node_templates::Get::new(self.inner.clone())
8519 }
8520
8521 /// Gets the access control policy for a resource. May be empty if no such
8522 /// policy or resource exists.
8523 pub fn get_iam_policy(&self) -> super::builder::node_templates::GetIamPolicy {
8524 super::builder::node_templates::GetIamPolicy::new(self.inner.clone())
8525 }
8526
8527 /// Creates a NodeTemplate resource in the specified project using the data
8528 /// included in the request.
8529 pub fn insert(&self) -> super::builder::node_templates::Insert {
8530 super::builder::node_templates::Insert::new(self.inner.clone())
8531 }
8532
8533 /// Retrieves a list of node templates available to the specified
8534 /// project.
8535 pub fn list(&self) -> super::builder::node_templates::List {
8536 super::builder::node_templates::List::new(self.inner.clone())
8537 }
8538
8539 /// Sets the access control policy on the specified resource.
8540 /// Replaces any existing policy.
8541 pub fn set_iam_policy(&self) -> super::builder::node_templates::SetIamPolicy {
8542 super::builder::node_templates::SetIamPolicy::new(self.inner.clone())
8543 }
8544
8545 /// Returns permissions that a caller has on the specified resource.
8546 pub fn test_iam_permissions(&self) -> super::builder::node_templates::TestIamPermissions {
8547 super::builder::node_templates::TestIamPermissions::new(self.inner.clone())
8548 }
8549
8550 /// Retrieves the specified region-specific Operations resource.
8551 pub fn get_operation(&self) -> super::builder::node_templates::GetOperation {
8552 super::builder::node_templates::GetOperation::new(self.inner.clone())
8553 }
8554}
8555
8556/// Implements a client for the Google Compute Engine API.
8557///
8558/// # Example
8559/// ```
8560/// # use google_cloud_compute_v1::client::NodeTypes;
8561/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
8562/// let client = NodeTypes::builder().build().await?;
8563/// // use `client` to make requests to the Google Compute Engine API.
8564/// # Ok(()) }
8565/// ```
8566///
8567/// # Service Description
8568///
8569/// Service for the `nodeTypes` resource.
8570///
8571/// # Configuration
8572///
8573/// To configure `NodeTypes` use the `with_*` methods in the type returned
8574/// by [builder()][NodeTypes::builder]. The default configuration should
8575/// work for most applications. Common configuration changes include
8576///
8577/// * [with_endpoint()]: by default this client uses the global default endpoint
8578/// (`https://compute.googleapis.com`). Applications using regional
8579/// endpoints or running in restricted networks (e.g. a network configured
8580// with [Private Google Access with VPC Service Controls]) may want to
8581/// override this default.
8582/// * [with_credentials()]: by default this client uses
8583/// [Application Default Credentials]. Applications using custom
8584/// authentication may need to override this default.
8585///
8586/// [with_endpoint()]: super::builder::node_types::ClientBuilder::with_endpoint
8587/// [with_credentials()]: super::builder::node_types::ClientBuilder::with_credentials
8588/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8589/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8590///
8591/// # Pooling and Cloning
8592///
8593/// `NodeTypes` holds a connection pool internally, it is advised to
8594/// create one and reuse it. You do not need to wrap `NodeTypes` in
8595/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8596/// already uses an `Arc` internally.
8597#[cfg(feature = "node-types")]
8598#[cfg_attr(docsrs, doc(cfg(feature = "node-types")))]
8599#[derive(Clone, Debug)]
8600pub struct NodeTypes {
8601 inner: std::sync::Arc<dyn super::stub::dynamic::NodeTypes>,
8602}
8603
8604#[cfg(feature = "node-types")]
8605impl NodeTypes {
8606 /// Returns a builder for [NodeTypes].
8607 ///
8608 /// ```
8609 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8610 /// # use google_cloud_compute_v1::client::NodeTypes;
8611 /// let client = NodeTypes::builder().build().await?;
8612 /// # Ok(()) }
8613 /// ```
8614 pub fn builder() -> super::builder::node_types::ClientBuilder {
8615 crate::new_client_builder(super::builder::node_types::client::Factory)
8616 }
8617
8618 /// Creates a new client from the provided stub.
8619 ///
8620 /// The most common case for calling this function is in tests mocking the
8621 /// client's behavior.
8622 pub fn from_stub<T>(stub: T) -> Self
8623 where
8624 T: super::stub::NodeTypes + 'static,
8625 {
8626 Self {
8627 inner: std::sync::Arc::new(stub),
8628 }
8629 }
8630
8631 pub(crate) async fn new(
8632 config: gaxi::options::ClientConfig,
8633 ) -> crate::ClientBuilderResult<Self> {
8634 let inner = Self::build_inner(config).await?;
8635 Ok(Self { inner })
8636 }
8637
8638 async fn build_inner(
8639 conf: gaxi::options::ClientConfig,
8640 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NodeTypes>> {
8641 if gaxi::options::tracing_enabled(&conf) {
8642 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8643 }
8644 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8645 }
8646
8647 async fn build_transport(
8648 conf: gaxi::options::ClientConfig,
8649 ) -> crate::ClientBuilderResult<impl super::stub::NodeTypes> {
8650 super::transport::NodeTypes::new(conf).await
8651 }
8652
8653 async fn build_with_tracing(
8654 conf: gaxi::options::ClientConfig,
8655 ) -> crate::ClientBuilderResult<impl super::stub::NodeTypes> {
8656 Self::build_transport(conf)
8657 .await
8658 .map(super::tracing::NodeTypes::new)
8659 }
8660
8661 /// Retrieves an aggregated list of node types.
8662 ///
8663 /// To prevent failure, Google recommends that you set the
8664 /// `returnPartialSuccess` parameter to `true`.
8665 pub fn aggregated_list(&self) -> super::builder::node_types::AggregatedList {
8666 super::builder::node_types::AggregatedList::new(self.inner.clone())
8667 }
8668
8669 /// Returns the specified node type.
8670 pub fn get(&self) -> super::builder::node_types::Get {
8671 super::builder::node_types::Get::new(self.inner.clone())
8672 }
8673
8674 /// Retrieves a list of node types available to the specified
8675 /// project.
8676 pub fn list(&self) -> super::builder::node_types::List {
8677 super::builder::node_types::List::new(self.inner.clone())
8678 }
8679}
8680
8681/// Implements a client for the Google Compute Engine API.
8682///
8683/// # Example
8684/// ```
8685/// # use google_cloud_compute_v1::client::OrganizationSecurityPolicies;
8686/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
8687/// let client = OrganizationSecurityPolicies::builder().build().await?;
8688/// // use `client` to make requests to the Google Compute Engine API.
8689/// # Ok(()) }
8690/// ```
8691///
8692/// # Service Description
8693///
8694/// Service for the `organizationSecurityPolicies` resource.
8695///
8696/// # Configuration
8697///
8698/// To configure `OrganizationSecurityPolicies` use the `with_*` methods in the type returned
8699/// by [builder()][OrganizationSecurityPolicies::builder]. The default configuration should
8700/// work for most applications. Common configuration changes include
8701///
8702/// * [with_endpoint()]: by default this client uses the global default endpoint
8703/// (`https://compute.googleapis.com`). Applications using regional
8704/// endpoints or running in restricted networks (e.g. a network configured
8705// with [Private Google Access with VPC Service Controls]) may want to
8706/// override this default.
8707/// * [with_credentials()]: by default this client uses
8708/// [Application Default Credentials]. Applications using custom
8709/// authentication may need to override this default.
8710///
8711/// [with_endpoint()]: super::builder::organization_security_policies::ClientBuilder::with_endpoint
8712/// [with_credentials()]: super::builder::organization_security_policies::ClientBuilder::with_credentials
8713/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8714/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8715///
8716/// # Pooling and Cloning
8717///
8718/// `OrganizationSecurityPolicies` holds a connection pool internally, it is advised to
8719/// create one and reuse it. You do not need to wrap `OrganizationSecurityPolicies` in
8720/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8721/// already uses an `Arc` internally.
8722#[cfg(feature = "organization-security-policies")]
8723#[cfg_attr(docsrs, doc(cfg(feature = "organization-security-policies")))]
8724#[derive(Clone, Debug)]
8725pub struct OrganizationSecurityPolicies {
8726 inner: std::sync::Arc<dyn super::stub::dynamic::OrganizationSecurityPolicies>,
8727}
8728
8729#[cfg(feature = "organization-security-policies")]
8730impl OrganizationSecurityPolicies {
8731 /// Returns a builder for [OrganizationSecurityPolicies].
8732 ///
8733 /// ```
8734 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8735 /// # use google_cloud_compute_v1::client::OrganizationSecurityPolicies;
8736 /// let client = OrganizationSecurityPolicies::builder().build().await?;
8737 /// # Ok(()) }
8738 /// ```
8739 pub fn builder() -> super::builder::organization_security_policies::ClientBuilder {
8740 crate::new_client_builder(super::builder::organization_security_policies::client::Factory)
8741 }
8742
8743 /// Creates a new client from the provided stub.
8744 ///
8745 /// The most common case for calling this function is in tests mocking the
8746 /// client's behavior.
8747 pub fn from_stub<T>(stub: T) -> Self
8748 where
8749 T: super::stub::OrganizationSecurityPolicies + 'static,
8750 {
8751 Self {
8752 inner: std::sync::Arc::new(stub),
8753 }
8754 }
8755
8756 pub(crate) async fn new(
8757 config: gaxi::options::ClientConfig,
8758 ) -> crate::ClientBuilderResult<Self> {
8759 let inner = Self::build_inner(config).await?;
8760 Ok(Self { inner })
8761 }
8762
8763 async fn build_inner(
8764 conf: gaxi::options::ClientConfig,
8765 ) -> crate::ClientBuilderResult<
8766 std::sync::Arc<dyn super::stub::dynamic::OrganizationSecurityPolicies>,
8767 > {
8768 if gaxi::options::tracing_enabled(&conf) {
8769 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8770 }
8771 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8772 }
8773
8774 async fn build_transport(
8775 conf: gaxi::options::ClientConfig,
8776 ) -> crate::ClientBuilderResult<impl super::stub::OrganizationSecurityPolicies> {
8777 super::transport::OrganizationSecurityPolicies::new(conf).await
8778 }
8779
8780 async fn build_with_tracing(
8781 conf: gaxi::options::ClientConfig,
8782 ) -> crate::ClientBuilderResult<impl super::stub::OrganizationSecurityPolicies> {
8783 Self::build_transport(conf)
8784 .await
8785 .map(super::tracing::OrganizationSecurityPolicies::new)
8786 }
8787
8788 /// Inserts an association for the specified security policy.
8789 ///
8790 /// This has billing implications. Projects in the hierarchy with effective
8791 /// hierarchical security policies will be automatically enrolled into Cloud
8792 /// Armor Enterprise if not already enrolled.
8793 ///
8794 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8795 /// versions of this API were used to modify firewall policies. This usage is
8796 /// now disabled for most organizations. Use firewallPolicies.addAssociation
8797 /// instead.
8798 pub fn add_association(
8799 &self,
8800 ) -> super::builder::organization_security_policies::AddAssociation {
8801 super::builder::organization_security_policies::AddAssociation::new(self.inner.clone())
8802 }
8803
8804 /// Inserts a rule into a security policy.
8805 ///
8806 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8807 /// versions of this API were used to modify firewall policies. This usage is
8808 /// now disabled for most organizations. Use firewallPolicies.addRule instead.
8809 pub fn add_rule(&self) -> super::builder::organization_security_policies::AddRule {
8810 super::builder::organization_security_policies::AddRule::new(self.inner.clone())
8811 }
8812
8813 /// Copies rules to the specified security policy.
8814 ///
8815 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8816 /// versions of this API were used to modify firewall policies. This usage is
8817 /// now disabled for most organizations. Use firewallPolicies.cloneRules
8818 /// instead.
8819 pub fn copy_rules(&self) -> super::builder::organization_security_policies::CopyRules {
8820 super::builder::organization_security_policies::CopyRules::new(self.inner.clone())
8821 }
8822
8823 /// Deletes the specified policy.
8824 ///
8825 /// Use this API to remove Cloud Armor policies. Previously, alpha and beta
8826 /// versions of this API were used to remove firewall policies. This usage is
8827 /// now disabled for most organizations. Use firewallPolicies.delete instead.
8828 pub fn delete(&self) -> super::builder::organization_security_policies::Delete {
8829 super::builder::organization_security_policies::Delete::new(self.inner.clone())
8830 }
8831
8832 /// List all of the ordered rules present in a single specified policy.
8833 ///
8834 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
8835 /// versions of this API were used to read firewall policies. This usage is now
8836 /// disabled for most organizations. Use firewallPolicies.get instead.
8837 pub fn get(&self) -> super::builder::organization_security_policies::Get {
8838 super::builder::organization_security_policies::Get::new(self.inner.clone())
8839 }
8840
8841 /// Gets an association with the specified name.
8842 ///
8843 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
8844 /// versions of this API were used to read firewall policies. This usage is
8845 /// now disabled for most organizations. Use firewallPolicies.getAssociation
8846 /// instead.
8847 pub fn get_association(
8848 &self,
8849 ) -> super::builder::organization_security_policies::GetAssociation {
8850 super::builder::organization_security_policies::GetAssociation::new(self.inner.clone())
8851 }
8852
8853 /// Gets a rule at the specified priority.
8854 ///
8855 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
8856 /// versions of this API were used to read firewall policies. This usage is now
8857 /// disabled for most organizations. Use firewallPolicies.getRule instead.
8858 pub fn get_rule(&self) -> super::builder::organization_security_policies::GetRule {
8859 super::builder::organization_security_policies::GetRule::new(self.inner.clone())
8860 }
8861
8862 /// Creates a new policy in the specified organization using the data included
8863 /// in the request.
8864 ///
8865 /// Use this API to add Cloud Armor policies. Previously, alpha and beta
8866 /// versions of this API were used to add firewall policies. This usage is now
8867 /// disabled for most organizations. Use firewallPolicies.insert instead.
8868 pub fn insert(&self) -> super::builder::organization_security_policies::Insert {
8869 super::builder::organization_security_policies::Insert::new(self.inner.clone())
8870 }
8871
8872 /// List all the policies that have been configured for the specified
8873 /// organization.
8874 ///
8875 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
8876 /// versions of this API were used to read firewall policies. This usage is now
8877 /// disabled for most organizations. Use firewallPolicies.list instead.
8878 pub fn list(&self) -> super::builder::organization_security_policies::List {
8879 super::builder::organization_security_policies::List::new(self.inner.clone())
8880 }
8881
8882 /// Lists associations of a specified target, i.e., organization or folder.
8883 ///
8884 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
8885 /// versions of this API were used to read firewall policies. This usage is
8886 /// now disabled for most organizations. Use firewallPolicies.listAssociations
8887 /// instead.
8888 pub fn list_associations(
8889 &self,
8890 ) -> super::builder::organization_security_policies::ListAssociations {
8891 super::builder::organization_security_policies::ListAssociations::new(self.inner.clone())
8892 }
8893
8894 /// Gets the current list of preconfigured Web Application Firewall (WAF)
8895 /// expressions.
8896 pub fn list_preconfigured_expression_sets(
8897 &self,
8898 ) -> super::builder::organization_security_policies::ListPreconfiguredExpressionSets {
8899 super::builder::organization_security_policies::ListPreconfiguredExpressionSets::new(
8900 self.inner.clone(),
8901 )
8902 }
8903
8904 /// Moves the specified security policy.
8905 ///
8906 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8907 /// versions of this API were used to modify firewall policies. This usage is
8908 /// now disabled for most organizations. Use firewallPolicies.move instead.
8909 pub fn r#move(&self) -> super::builder::organization_security_policies::Move {
8910 super::builder::organization_security_policies::Move::new(self.inner.clone())
8911 }
8912
8913 /// Patches the specified policy with the data included in the request.
8914 ///
8915 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8916 /// versions of this API were used to modify firewall policies. This usage is
8917 /// now disabled for most organizations. Use firewallPolicies.patch instead.
8918 pub fn patch(&self) -> super::builder::organization_security_policies::Patch {
8919 super::builder::organization_security_policies::Patch::new(self.inner.clone())
8920 }
8921
8922 /// Patches a rule at the specified priority.
8923 ///
8924 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8925 /// versions of this API were used to modify firewall policies. This usage is
8926 /// now disabled for most organizations. Use firewallPolicies.patchRule
8927 /// instead.
8928 pub fn patch_rule(&self) -> super::builder::organization_security_policies::PatchRule {
8929 super::builder::organization_security_policies::PatchRule::new(self.inner.clone())
8930 }
8931
8932 /// Removes an association for the specified security policy.
8933 ///
8934 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8935 /// versions of this API were used to modify firewall policies. This usage is
8936 /// now disabled for most organizations. Use firewallPolicies.removeAssociation
8937 /// instead.
8938 pub fn remove_association(
8939 &self,
8940 ) -> super::builder::organization_security_policies::RemoveAssociation {
8941 super::builder::organization_security_policies::RemoveAssociation::new(self.inner.clone())
8942 }
8943
8944 /// Deletes a rule at the specified priority.
8945 ///
8946 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8947 /// versions of this API were used to modify firewall policies. This usage is
8948 /// now disabled for most organizations. Use firewallPolicies.removeRule
8949 /// instead.
8950 pub fn remove_rule(&self) -> super::builder::organization_security_policies::RemoveRule {
8951 super::builder::organization_security_policies::RemoveRule::new(self.inner.clone())
8952 }
8953
8954 /// Retrieves the specified Operations resource. Gets a list of operations
8955 /// by making a `list()` request.
8956 pub fn get_operation(&self) -> super::builder::organization_security_policies::GetOperation {
8957 super::builder::organization_security_policies::GetOperation::new(self.inner.clone())
8958 }
8959}
8960
8961/// Implements a client for the Google Compute Engine API.
8962///
8963/// # Example
8964/// ```
8965/// # use google_cloud_compute_v1::client::PacketMirrorings;
8966/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
8967/// let client = PacketMirrorings::builder().build().await?;
8968/// // use `client` to make requests to the Google Compute Engine API.
8969/// # Ok(()) }
8970/// ```
8971///
8972/// # Service Description
8973///
8974/// Service for the `packetMirrorings` resource.
8975///
8976/// # Configuration
8977///
8978/// To configure `PacketMirrorings` use the `with_*` methods in the type returned
8979/// by [builder()][PacketMirrorings::builder]. The default configuration should
8980/// work for most applications. Common configuration changes include
8981///
8982/// * [with_endpoint()]: by default this client uses the global default endpoint
8983/// (`https://compute.googleapis.com`). Applications using regional
8984/// endpoints or running in restricted networks (e.g. a network configured
8985// with [Private Google Access with VPC Service Controls]) may want to
8986/// override this default.
8987/// * [with_credentials()]: by default this client uses
8988/// [Application Default Credentials]. Applications using custom
8989/// authentication may need to override this default.
8990///
8991/// [with_endpoint()]: super::builder::packet_mirrorings::ClientBuilder::with_endpoint
8992/// [with_credentials()]: super::builder::packet_mirrorings::ClientBuilder::with_credentials
8993/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8994/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8995///
8996/// # Pooling and Cloning
8997///
8998/// `PacketMirrorings` holds a connection pool internally, it is advised to
8999/// create one and reuse it. You do not need to wrap `PacketMirrorings` in
9000/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9001/// already uses an `Arc` internally.
9002#[cfg(feature = "packet-mirrorings")]
9003#[cfg_attr(docsrs, doc(cfg(feature = "packet-mirrorings")))]
9004#[derive(Clone, Debug)]
9005pub struct PacketMirrorings {
9006 inner: std::sync::Arc<dyn super::stub::dynamic::PacketMirrorings>,
9007}
9008
9009#[cfg(feature = "packet-mirrorings")]
9010impl PacketMirrorings {
9011 /// Returns a builder for [PacketMirrorings].
9012 ///
9013 /// ```
9014 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9015 /// # use google_cloud_compute_v1::client::PacketMirrorings;
9016 /// let client = PacketMirrorings::builder().build().await?;
9017 /// # Ok(()) }
9018 /// ```
9019 pub fn builder() -> super::builder::packet_mirrorings::ClientBuilder {
9020 crate::new_client_builder(super::builder::packet_mirrorings::client::Factory)
9021 }
9022
9023 /// Creates a new client from the provided stub.
9024 ///
9025 /// The most common case for calling this function is in tests mocking the
9026 /// client's behavior.
9027 pub fn from_stub<T>(stub: T) -> Self
9028 where
9029 T: super::stub::PacketMirrorings + 'static,
9030 {
9031 Self {
9032 inner: std::sync::Arc::new(stub),
9033 }
9034 }
9035
9036 pub(crate) async fn new(
9037 config: gaxi::options::ClientConfig,
9038 ) -> crate::ClientBuilderResult<Self> {
9039 let inner = Self::build_inner(config).await?;
9040 Ok(Self { inner })
9041 }
9042
9043 async fn build_inner(
9044 conf: gaxi::options::ClientConfig,
9045 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::PacketMirrorings>>
9046 {
9047 if gaxi::options::tracing_enabled(&conf) {
9048 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9049 }
9050 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9051 }
9052
9053 async fn build_transport(
9054 conf: gaxi::options::ClientConfig,
9055 ) -> crate::ClientBuilderResult<impl super::stub::PacketMirrorings> {
9056 super::transport::PacketMirrorings::new(conf).await
9057 }
9058
9059 async fn build_with_tracing(
9060 conf: gaxi::options::ClientConfig,
9061 ) -> crate::ClientBuilderResult<impl super::stub::PacketMirrorings> {
9062 Self::build_transport(conf)
9063 .await
9064 .map(super::tracing::PacketMirrorings::new)
9065 }
9066
9067 /// Retrieves an aggregated list of packetMirrorings.
9068 ///
9069 /// To prevent failure, Google recommends that you set the
9070 /// `returnPartialSuccess` parameter to `true`.
9071 pub fn aggregated_list(&self) -> super::builder::packet_mirrorings::AggregatedList {
9072 super::builder::packet_mirrorings::AggregatedList::new(self.inner.clone())
9073 }
9074
9075 /// Deletes the specified PacketMirroring resource.
9076 pub fn delete(&self) -> super::builder::packet_mirrorings::Delete {
9077 super::builder::packet_mirrorings::Delete::new(self.inner.clone())
9078 }
9079
9080 /// Returns the specified PacketMirroring resource.
9081 pub fn get(&self) -> super::builder::packet_mirrorings::Get {
9082 super::builder::packet_mirrorings::Get::new(self.inner.clone())
9083 }
9084
9085 /// Creates a PacketMirroring resource in the specified project and region
9086 /// using the data included in the request.
9087 pub fn insert(&self) -> super::builder::packet_mirrorings::Insert {
9088 super::builder::packet_mirrorings::Insert::new(self.inner.clone())
9089 }
9090
9091 /// Retrieves a list of PacketMirroring resources available to the specified
9092 /// project and region.
9093 pub fn list(&self) -> super::builder::packet_mirrorings::List {
9094 super::builder::packet_mirrorings::List::new(self.inner.clone())
9095 }
9096
9097 /// Patches the specified PacketMirroring resource with the data included in
9098 /// the request. This method supportsPATCH
9099 /// semantics and usesJSON merge
9100 /// patch format and processing rules.
9101 pub fn patch(&self) -> super::builder::packet_mirrorings::Patch {
9102 super::builder::packet_mirrorings::Patch::new(self.inner.clone())
9103 }
9104
9105 /// Returns permissions that a caller has on the specified resource.
9106 pub fn test_iam_permissions(&self) -> super::builder::packet_mirrorings::TestIamPermissions {
9107 super::builder::packet_mirrorings::TestIamPermissions::new(self.inner.clone())
9108 }
9109
9110 /// Retrieves the specified region-specific Operations resource.
9111 pub fn get_operation(&self) -> super::builder::packet_mirrorings::GetOperation {
9112 super::builder::packet_mirrorings::GetOperation::new(self.inner.clone())
9113 }
9114}
9115
9116/// Implements a client for the Google Compute Engine API.
9117///
9118/// # Example
9119/// ```
9120/// # use google_cloud_compute_v1::client::PreviewFeatures;
9121/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
9122/// let client = PreviewFeatures::builder().build().await?;
9123/// // use `client` to make requests to the Google Compute Engine API.
9124/// # Ok(()) }
9125/// ```
9126///
9127/// # Service Description
9128///
9129/// Service for the `previewFeatures` resource.
9130///
9131/// # Configuration
9132///
9133/// To configure `PreviewFeatures` use the `with_*` methods in the type returned
9134/// by [builder()][PreviewFeatures::builder]. The default configuration should
9135/// work for most applications. Common configuration changes include
9136///
9137/// * [with_endpoint()]: by default this client uses the global default endpoint
9138/// (`https://compute.googleapis.com`). Applications using regional
9139/// endpoints or running in restricted networks (e.g. a network configured
9140// with [Private Google Access with VPC Service Controls]) may want to
9141/// override this default.
9142/// * [with_credentials()]: by default this client uses
9143/// [Application Default Credentials]. Applications using custom
9144/// authentication may need to override this default.
9145///
9146/// [with_endpoint()]: super::builder::preview_features::ClientBuilder::with_endpoint
9147/// [with_credentials()]: super::builder::preview_features::ClientBuilder::with_credentials
9148/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9149/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9150///
9151/// # Pooling and Cloning
9152///
9153/// `PreviewFeatures` holds a connection pool internally, it is advised to
9154/// create one and reuse it. You do not need to wrap `PreviewFeatures` in
9155/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9156/// already uses an `Arc` internally.
9157#[cfg(feature = "preview-features")]
9158#[cfg_attr(docsrs, doc(cfg(feature = "preview-features")))]
9159#[derive(Clone, Debug)]
9160pub struct PreviewFeatures {
9161 inner: std::sync::Arc<dyn super::stub::dynamic::PreviewFeatures>,
9162}
9163
9164#[cfg(feature = "preview-features")]
9165impl PreviewFeatures {
9166 /// Returns a builder for [PreviewFeatures].
9167 ///
9168 /// ```
9169 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9170 /// # use google_cloud_compute_v1::client::PreviewFeatures;
9171 /// let client = PreviewFeatures::builder().build().await?;
9172 /// # Ok(()) }
9173 /// ```
9174 pub fn builder() -> super::builder::preview_features::ClientBuilder {
9175 crate::new_client_builder(super::builder::preview_features::client::Factory)
9176 }
9177
9178 /// Creates a new client from the provided stub.
9179 ///
9180 /// The most common case for calling this function is in tests mocking the
9181 /// client's behavior.
9182 pub fn from_stub<T>(stub: T) -> Self
9183 where
9184 T: super::stub::PreviewFeatures + 'static,
9185 {
9186 Self {
9187 inner: std::sync::Arc::new(stub),
9188 }
9189 }
9190
9191 pub(crate) async fn new(
9192 config: gaxi::options::ClientConfig,
9193 ) -> crate::ClientBuilderResult<Self> {
9194 let inner = Self::build_inner(config).await?;
9195 Ok(Self { inner })
9196 }
9197
9198 async fn build_inner(
9199 conf: gaxi::options::ClientConfig,
9200 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::PreviewFeatures>> {
9201 if gaxi::options::tracing_enabled(&conf) {
9202 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9203 }
9204 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9205 }
9206
9207 async fn build_transport(
9208 conf: gaxi::options::ClientConfig,
9209 ) -> crate::ClientBuilderResult<impl super::stub::PreviewFeatures> {
9210 super::transport::PreviewFeatures::new(conf).await
9211 }
9212
9213 async fn build_with_tracing(
9214 conf: gaxi::options::ClientConfig,
9215 ) -> crate::ClientBuilderResult<impl super::stub::PreviewFeatures> {
9216 Self::build_transport(conf)
9217 .await
9218 .map(super::tracing::PreviewFeatures::new)
9219 }
9220
9221 /// Returns the details of the given PreviewFeature.
9222 pub fn get(&self) -> super::builder::preview_features::Get {
9223 super::builder::preview_features::Get::new(self.inner.clone())
9224 }
9225
9226 /// Returns the details of the given PreviewFeature.
9227 pub fn list(&self) -> super::builder::preview_features::List {
9228 super::builder::preview_features::List::new(self.inner.clone())
9229 }
9230
9231 /// Patches the given PreviewFeature. This method is used to enable or disable
9232 /// a PreviewFeature.
9233 pub fn update(&self) -> super::builder::preview_features::Update {
9234 super::builder::preview_features::Update::new(self.inner.clone())
9235 }
9236
9237 /// Retrieves the specified Operations resource.
9238 pub fn get_operation(&self) -> super::builder::preview_features::GetOperation {
9239 super::builder::preview_features::GetOperation::new(self.inner.clone())
9240 }
9241}
9242
9243/// Implements a client for the Google Compute Engine API.
9244///
9245/// # Example
9246/// ```
9247/// # use google_cloud_compute_v1::client::Projects;
9248/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
9249/// let client = Projects::builder().build().await?;
9250/// // use `client` to make requests to the Google Compute Engine API.
9251/// # Ok(()) }
9252/// ```
9253///
9254/// # Service Description
9255///
9256/// Service for the `projects` resource.
9257///
9258/// # Configuration
9259///
9260/// To configure `Projects` use the `with_*` methods in the type returned
9261/// by [builder()][Projects::builder]. The default configuration should
9262/// work for most applications. Common configuration changes include
9263///
9264/// * [with_endpoint()]: by default this client uses the global default endpoint
9265/// (`https://compute.googleapis.com`). Applications using regional
9266/// endpoints or running in restricted networks (e.g. a network configured
9267// with [Private Google Access with VPC Service Controls]) may want to
9268/// override this default.
9269/// * [with_credentials()]: by default this client uses
9270/// [Application Default Credentials]. Applications using custom
9271/// authentication may need to override this default.
9272///
9273/// [with_endpoint()]: super::builder::projects::ClientBuilder::with_endpoint
9274/// [with_credentials()]: super::builder::projects::ClientBuilder::with_credentials
9275/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9276/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9277///
9278/// # Pooling and Cloning
9279///
9280/// `Projects` holds a connection pool internally, it is advised to
9281/// create one and reuse it. You do not need to wrap `Projects` in
9282/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9283/// already uses an `Arc` internally.
9284#[cfg(feature = "projects")]
9285#[cfg_attr(docsrs, doc(cfg(feature = "projects")))]
9286#[derive(Clone, Debug)]
9287pub struct Projects {
9288 inner: std::sync::Arc<dyn super::stub::dynamic::Projects>,
9289}
9290
9291#[cfg(feature = "projects")]
9292impl Projects {
9293 /// Returns a builder for [Projects].
9294 ///
9295 /// ```
9296 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9297 /// # use google_cloud_compute_v1::client::Projects;
9298 /// let client = Projects::builder().build().await?;
9299 /// # Ok(()) }
9300 /// ```
9301 pub fn builder() -> super::builder::projects::ClientBuilder {
9302 crate::new_client_builder(super::builder::projects::client::Factory)
9303 }
9304
9305 /// Creates a new client from the provided stub.
9306 ///
9307 /// The most common case for calling this function is in tests mocking the
9308 /// client's behavior.
9309 pub fn from_stub<T>(stub: T) -> Self
9310 where
9311 T: super::stub::Projects + 'static,
9312 {
9313 Self {
9314 inner: std::sync::Arc::new(stub),
9315 }
9316 }
9317
9318 pub(crate) async fn new(
9319 config: gaxi::options::ClientConfig,
9320 ) -> crate::ClientBuilderResult<Self> {
9321 let inner = Self::build_inner(config).await?;
9322 Ok(Self { inner })
9323 }
9324
9325 async fn build_inner(
9326 conf: gaxi::options::ClientConfig,
9327 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Projects>> {
9328 if gaxi::options::tracing_enabled(&conf) {
9329 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9330 }
9331 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9332 }
9333
9334 async fn build_transport(
9335 conf: gaxi::options::ClientConfig,
9336 ) -> crate::ClientBuilderResult<impl super::stub::Projects> {
9337 super::transport::Projects::new(conf).await
9338 }
9339
9340 async fn build_with_tracing(
9341 conf: gaxi::options::ClientConfig,
9342 ) -> crate::ClientBuilderResult<impl super::stub::Projects> {
9343 Self::build_transport(conf)
9344 .await
9345 .map(super::tracing::Projects::new)
9346 }
9347
9348 /// Disable this project as a shared VPC host project.
9349 pub fn disable_xpn_host(&self) -> super::builder::projects::DisableXpnHost {
9350 super::builder::projects::DisableXpnHost::new(self.inner.clone())
9351 }
9352
9353 /// Disable a service resource (also known as service project) associated with
9354 /// this host project.
9355 pub fn disable_xpn_resource(&self) -> super::builder::projects::DisableXpnResource {
9356 super::builder::projects::DisableXpnResource::new(self.inner.clone())
9357 }
9358
9359 /// Enable this project as a shared VPC host project.
9360 pub fn enable_xpn_host(&self) -> super::builder::projects::EnableXpnHost {
9361 super::builder::projects::EnableXpnHost::new(self.inner.clone())
9362 }
9363
9364 /// Enable service resource (a.k.a service project) for a host project, so that
9365 /// subnets in the host project can be used by instances in the service
9366 /// project.
9367 pub fn enable_xpn_resource(&self) -> super::builder::projects::EnableXpnResource {
9368 super::builder::projects::EnableXpnResource::new(self.inner.clone())
9369 }
9370
9371 /// Returns the specified Project resource.
9372 ///
9373 /// To decrease latency for this method, you can optionally omit any unneeded
9374 /// information from the response by using a field mask. This practice is
9375 /// especially recommended for unused quota information (the `quotas` field).
9376 /// To exclude one or more fields, set your request's `fields` query parameter
9377 /// to only include the fields you need. For example, to only include the `id`
9378 /// and `selfLink` fields, add the query parameter `?fields=id,selfLink` to
9379 /// your request.
9380 pub fn get(&self) -> super::builder::projects::Get {
9381 super::builder::projects::Get::new(self.inner.clone())
9382 }
9383
9384 /// Gets the shared VPC host project that this project links to. May be empty
9385 /// if no link exists.
9386 pub fn get_xpn_host(&self) -> super::builder::projects::GetXpnHost {
9387 super::builder::projects::GetXpnHost::new(self.inner.clone())
9388 }
9389
9390 /// Gets service resources (a.k.a service project) associated with this host
9391 /// project.
9392 pub fn get_xpn_resources(&self) -> super::builder::projects::GetXpnResources {
9393 super::builder::projects::GetXpnResources::new(self.inner.clone())
9394 }
9395
9396 /// Lists all shared VPC host projects visible to the user in an organization.
9397 pub fn list_xpn_hosts(&self) -> super::builder::projects::ListXpnHosts {
9398 super::builder::projects::ListXpnHosts::new(self.inner.clone())
9399 }
9400
9401 /// Moves a persistent disk from one zone to another.
9402 /// *Note*: The moveDisk API will be deprecated on September 29, 2026.
9403 ///
9404 /// Starting September 29, 2025, you can't use the moveDisk API on new
9405 /// projects. To move a disk to a different region or zone, follow the steps in
9406 /// [Change the location of a
9407 /// disk](https://cloud.google.com/compute/docs/disks/migrate-to-hyperdisk#migrate-to-hd).
9408 ///
9409 /// Projects that already use the moveDisk API can continue usage until
9410 /// September 29, 2026.
9411 ///
9412 /// Starting November 1, 2025, API responses will include a warning message in
9413 /// the response body about the upcoming deprecation. You can skip the message
9414 /// to continue using the service without interruption.
9415 #[deprecated]
9416 pub fn move_disk(&self) -> super::builder::projects::MoveDisk {
9417 super::builder::projects::MoveDisk::new(self.inner.clone())
9418 }
9419
9420 /// Moves an instance and its attached persistent disks from one zone to
9421 /// another.
9422 /// *Note*: Moving VMs or disks by using this method might
9423 /// cause unexpected behavior. For more information, see the [known
9424 /// issue](/compute/docs/troubleshooting/known-issues#moving_vms_or_disks_using_the_moveinstance_api_or_the_causes_unexpected_behavior).
9425 /// [Deprecated] This method is deprecated. See [moving instance across
9426 /// zones](/compute/docs/instances/moving-instance-across-zones) instead.
9427 #[deprecated]
9428 pub fn move_instance(&self) -> super::builder::projects::MoveInstance {
9429 super::builder::projects::MoveInstance::new(self.inner.clone())
9430 }
9431
9432 /// Sets the Cloud Armor tier of the project. To set ENTERPRISE or above the
9433 /// billing account of the project must be subscribed to Cloud Armor
9434 /// Enterprise. See Subscribing
9435 /// to Cloud Armor Enterprise for more information.
9436 pub fn set_cloud_armor_tier(&self) -> super::builder::projects::SetCloudArmorTier {
9437 super::builder::projects::SetCloudArmorTier::new(self.inner.clone())
9438 }
9439
9440 /// Sets metadata common to all instances within the specified project using
9441 /// the data included in the request.
9442 pub fn set_common_instance_metadata(
9443 &self,
9444 ) -> super::builder::projects::SetCommonInstanceMetadata {
9445 super::builder::projects::SetCommonInstanceMetadata::new(self.inner.clone())
9446 }
9447
9448 /// Sets the default network tier of the project. The default network tier is
9449 /// used when an address/forwardingRule/instance is created without specifying
9450 /// the network tier field.
9451 pub fn set_default_network_tier(&self) -> super::builder::projects::SetDefaultNetworkTier {
9452 super::builder::projects::SetDefaultNetworkTier::new(self.inner.clone())
9453 }
9454
9455 /// Enables the usage export feature and sets theusage export bucket
9456 /// where reports are stored. If you provide an empty request body using this
9457 /// method, the usage export feature will be disabled.
9458 pub fn set_usage_export_bucket(&self) -> super::builder::projects::SetUsageExportBucket {
9459 super::builder::projects::SetUsageExportBucket::new(self.inner.clone())
9460 }
9461
9462 /// Retrieves the specified Operations resource.
9463 pub fn get_operation(&self) -> super::builder::projects::GetOperation {
9464 super::builder::projects::GetOperation::new(self.inner.clone())
9465 }
9466}
9467
9468/// Implements a client for the Google Compute Engine API.
9469///
9470/// # Example
9471/// ```
9472/// # use google_cloud_compute_v1::client::PublicAdvertisedPrefixes;
9473/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
9474/// let client = PublicAdvertisedPrefixes::builder().build().await?;
9475/// // use `client` to make requests to the Google Compute Engine API.
9476/// # Ok(()) }
9477/// ```
9478///
9479/// # Service Description
9480///
9481/// Service for the `publicAdvertisedPrefixes` resource.
9482///
9483/// # Configuration
9484///
9485/// To configure `PublicAdvertisedPrefixes` use the `with_*` methods in the type returned
9486/// by [builder()][PublicAdvertisedPrefixes::builder]. The default configuration should
9487/// work for most applications. Common configuration changes include
9488///
9489/// * [with_endpoint()]: by default this client uses the global default endpoint
9490/// (`https://compute.googleapis.com`). Applications using regional
9491/// endpoints or running in restricted networks (e.g. a network configured
9492// with [Private Google Access with VPC Service Controls]) may want to
9493/// override this default.
9494/// * [with_credentials()]: by default this client uses
9495/// [Application Default Credentials]. Applications using custom
9496/// authentication may need to override this default.
9497///
9498/// [with_endpoint()]: super::builder::public_advertised_prefixes::ClientBuilder::with_endpoint
9499/// [with_credentials()]: super::builder::public_advertised_prefixes::ClientBuilder::with_credentials
9500/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9501/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9502///
9503/// # Pooling and Cloning
9504///
9505/// `PublicAdvertisedPrefixes` holds a connection pool internally, it is advised to
9506/// create one and reuse it. You do not need to wrap `PublicAdvertisedPrefixes` in
9507/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9508/// already uses an `Arc` internally.
9509#[cfg(feature = "public-advertised-prefixes")]
9510#[cfg_attr(docsrs, doc(cfg(feature = "public-advertised-prefixes")))]
9511#[derive(Clone, Debug)]
9512pub struct PublicAdvertisedPrefixes {
9513 inner: std::sync::Arc<dyn super::stub::dynamic::PublicAdvertisedPrefixes>,
9514}
9515
9516#[cfg(feature = "public-advertised-prefixes")]
9517impl PublicAdvertisedPrefixes {
9518 /// Returns a builder for [PublicAdvertisedPrefixes].
9519 ///
9520 /// ```
9521 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9522 /// # use google_cloud_compute_v1::client::PublicAdvertisedPrefixes;
9523 /// let client = PublicAdvertisedPrefixes::builder().build().await?;
9524 /// # Ok(()) }
9525 /// ```
9526 pub fn builder() -> super::builder::public_advertised_prefixes::ClientBuilder {
9527 crate::new_client_builder(super::builder::public_advertised_prefixes::client::Factory)
9528 }
9529
9530 /// Creates a new client from the provided stub.
9531 ///
9532 /// The most common case for calling this function is in tests mocking the
9533 /// client's behavior.
9534 pub fn from_stub<T>(stub: T) -> Self
9535 where
9536 T: super::stub::PublicAdvertisedPrefixes + 'static,
9537 {
9538 Self {
9539 inner: std::sync::Arc::new(stub),
9540 }
9541 }
9542
9543 pub(crate) async fn new(
9544 config: gaxi::options::ClientConfig,
9545 ) -> crate::ClientBuilderResult<Self> {
9546 let inner = Self::build_inner(config).await?;
9547 Ok(Self { inner })
9548 }
9549
9550 async fn build_inner(
9551 conf: gaxi::options::ClientConfig,
9552 ) -> crate::ClientBuilderResult<
9553 std::sync::Arc<dyn super::stub::dynamic::PublicAdvertisedPrefixes>,
9554 > {
9555 if gaxi::options::tracing_enabled(&conf) {
9556 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9557 }
9558 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9559 }
9560
9561 async fn build_transport(
9562 conf: gaxi::options::ClientConfig,
9563 ) -> crate::ClientBuilderResult<impl super::stub::PublicAdvertisedPrefixes> {
9564 super::transport::PublicAdvertisedPrefixes::new(conf).await
9565 }
9566
9567 async fn build_with_tracing(
9568 conf: gaxi::options::ClientConfig,
9569 ) -> crate::ClientBuilderResult<impl super::stub::PublicAdvertisedPrefixes> {
9570 Self::build_transport(conf)
9571 .await
9572 .map(super::tracing::PublicAdvertisedPrefixes::new)
9573 }
9574
9575 /// Announces the specified PublicAdvertisedPrefix
9576 pub fn announce(&self) -> super::builder::public_advertised_prefixes::Announce {
9577 super::builder::public_advertised_prefixes::Announce::new(self.inner.clone())
9578 }
9579
9580 /// Deletes the specified PublicAdvertisedPrefix
9581 pub fn delete(&self) -> super::builder::public_advertised_prefixes::Delete {
9582 super::builder::public_advertised_prefixes::Delete::new(self.inner.clone())
9583 }
9584
9585 /// Returns the specified PublicAdvertisedPrefix resource.
9586 pub fn get(&self) -> super::builder::public_advertised_prefixes::Get {
9587 super::builder::public_advertised_prefixes::Get::new(self.inner.clone())
9588 }
9589
9590 /// Creates a PublicAdvertisedPrefix in the specified project
9591 /// using the parameters that are included in the request.
9592 pub fn insert(&self) -> super::builder::public_advertised_prefixes::Insert {
9593 super::builder::public_advertised_prefixes::Insert::new(self.inner.clone())
9594 }
9595
9596 /// Lists the PublicAdvertisedPrefixes for a project.
9597 pub fn list(&self) -> super::builder::public_advertised_prefixes::List {
9598 super::builder::public_advertised_prefixes::List::new(self.inner.clone())
9599 }
9600
9601 /// Patches the specified Router resource with the data included in the
9602 /// request. This method supportsPATCH
9603 /// semantics and usesJSON merge
9604 /// patch format and processing rules.
9605 pub fn patch(&self) -> super::builder::public_advertised_prefixes::Patch {
9606 super::builder::public_advertised_prefixes::Patch::new(self.inner.clone())
9607 }
9608
9609 /// Withdraws the specified PublicAdvertisedPrefix
9610 pub fn withdraw(&self) -> super::builder::public_advertised_prefixes::Withdraw {
9611 super::builder::public_advertised_prefixes::Withdraw::new(self.inner.clone())
9612 }
9613
9614 /// Retrieves the specified Operations resource.
9615 pub fn get_operation(&self) -> super::builder::public_advertised_prefixes::GetOperation {
9616 super::builder::public_advertised_prefixes::GetOperation::new(self.inner.clone())
9617 }
9618}
9619
9620/// Implements a client for the Google Compute Engine API.
9621///
9622/// # Example
9623/// ```
9624/// # use google_cloud_compute_v1::client::PublicDelegatedPrefixes;
9625/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
9626/// let client = PublicDelegatedPrefixes::builder().build().await?;
9627/// // use `client` to make requests to the Google Compute Engine API.
9628/// # Ok(()) }
9629/// ```
9630///
9631/// # Service Description
9632///
9633/// Service for the `publicDelegatedPrefixes` resource.
9634///
9635/// # Configuration
9636///
9637/// To configure `PublicDelegatedPrefixes` use the `with_*` methods in the type returned
9638/// by [builder()][PublicDelegatedPrefixes::builder]. The default configuration should
9639/// work for most applications. Common configuration changes include
9640///
9641/// * [with_endpoint()]: by default this client uses the global default endpoint
9642/// (`https://compute.googleapis.com`). Applications using regional
9643/// endpoints or running in restricted networks (e.g. a network configured
9644// with [Private Google Access with VPC Service Controls]) may want to
9645/// override this default.
9646/// * [with_credentials()]: by default this client uses
9647/// [Application Default Credentials]. Applications using custom
9648/// authentication may need to override this default.
9649///
9650/// [with_endpoint()]: super::builder::public_delegated_prefixes::ClientBuilder::with_endpoint
9651/// [with_credentials()]: super::builder::public_delegated_prefixes::ClientBuilder::with_credentials
9652/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9653/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9654///
9655/// # Pooling and Cloning
9656///
9657/// `PublicDelegatedPrefixes` holds a connection pool internally, it is advised to
9658/// create one and reuse it. You do not need to wrap `PublicDelegatedPrefixes` in
9659/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9660/// already uses an `Arc` internally.
9661#[cfg(feature = "public-delegated-prefixes")]
9662#[cfg_attr(docsrs, doc(cfg(feature = "public-delegated-prefixes")))]
9663#[derive(Clone, Debug)]
9664pub struct PublicDelegatedPrefixes {
9665 inner: std::sync::Arc<dyn super::stub::dynamic::PublicDelegatedPrefixes>,
9666}
9667
9668#[cfg(feature = "public-delegated-prefixes")]
9669impl PublicDelegatedPrefixes {
9670 /// Returns a builder for [PublicDelegatedPrefixes].
9671 ///
9672 /// ```
9673 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9674 /// # use google_cloud_compute_v1::client::PublicDelegatedPrefixes;
9675 /// let client = PublicDelegatedPrefixes::builder().build().await?;
9676 /// # Ok(()) }
9677 /// ```
9678 pub fn builder() -> super::builder::public_delegated_prefixes::ClientBuilder {
9679 crate::new_client_builder(super::builder::public_delegated_prefixes::client::Factory)
9680 }
9681
9682 /// Creates a new client from the provided stub.
9683 ///
9684 /// The most common case for calling this function is in tests mocking the
9685 /// client's behavior.
9686 pub fn from_stub<T>(stub: T) -> Self
9687 where
9688 T: super::stub::PublicDelegatedPrefixes + 'static,
9689 {
9690 Self {
9691 inner: std::sync::Arc::new(stub),
9692 }
9693 }
9694
9695 pub(crate) async fn new(
9696 config: gaxi::options::ClientConfig,
9697 ) -> crate::ClientBuilderResult<Self> {
9698 let inner = Self::build_inner(config).await?;
9699 Ok(Self { inner })
9700 }
9701
9702 async fn build_inner(
9703 conf: gaxi::options::ClientConfig,
9704 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::PublicDelegatedPrefixes>>
9705 {
9706 if gaxi::options::tracing_enabled(&conf) {
9707 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9708 }
9709 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9710 }
9711
9712 async fn build_transport(
9713 conf: gaxi::options::ClientConfig,
9714 ) -> crate::ClientBuilderResult<impl super::stub::PublicDelegatedPrefixes> {
9715 super::transport::PublicDelegatedPrefixes::new(conf).await
9716 }
9717
9718 async fn build_with_tracing(
9719 conf: gaxi::options::ClientConfig,
9720 ) -> crate::ClientBuilderResult<impl super::stub::PublicDelegatedPrefixes> {
9721 Self::build_transport(conf)
9722 .await
9723 .map(super::tracing::PublicDelegatedPrefixes::new)
9724 }
9725
9726 /// Lists all PublicDelegatedPrefix resources owned by the specific project
9727 /// across all scopes.
9728 ///
9729 /// To prevent failure, Google recommends that you set the
9730 /// `returnPartialSuccess` parameter to `true`.
9731 pub fn aggregated_list(&self) -> super::builder::public_delegated_prefixes::AggregatedList {
9732 super::builder::public_delegated_prefixes::AggregatedList::new(self.inner.clone())
9733 }
9734
9735 /// Announces the specified PublicDelegatedPrefix in the given region.
9736 pub fn announce(&self) -> super::builder::public_delegated_prefixes::Announce {
9737 super::builder::public_delegated_prefixes::Announce::new(self.inner.clone())
9738 }
9739
9740 /// Deletes the specified PublicDelegatedPrefix in the given region.
9741 pub fn delete(&self) -> super::builder::public_delegated_prefixes::Delete {
9742 super::builder::public_delegated_prefixes::Delete::new(self.inner.clone())
9743 }
9744
9745 /// Returns the specified PublicDelegatedPrefix resource in the given region.
9746 pub fn get(&self) -> super::builder::public_delegated_prefixes::Get {
9747 super::builder::public_delegated_prefixes::Get::new(self.inner.clone())
9748 }
9749
9750 /// Creates a PublicDelegatedPrefix in the specified project in the given
9751 /// region using the parameters that are included in the request.
9752 pub fn insert(&self) -> super::builder::public_delegated_prefixes::Insert {
9753 super::builder::public_delegated_prefixes::Insert::new(self.inner.clone())
9754 }
9755
9756 /// Lists the PublicDelegatedPrefixes for a project in the given region.
9757 pub fn list(&self) -> super::builder::public_delegated_prefixes::List {
9758 super::builder::public_delegated_prefixes::List::new(self.inner.clone())
9759 }
9760
9761 /// Patches the specified PublicDelegatedPrefix resource with the data included
9762 /// in the request. This method supportsPATCH
9763 /// semantics and usesJSON merge
9764 /// patch format and processing rules.
9765 pub fn patch(&self) -> super::builder::public_delegated_prefixes::Patch {
9766 super::builder::public_delegated_prefixes::Patch::new(self.inner.clone())
9767 }
9768
9769 /// Withdraws the specified PublicDelegatedPrefix in the given region.
9770 pub fn withdraw(&self) -> super::builder::public_delegated_prefixes::Withdraw {
9771 super::builder::public_delegated_prefixes::Withdraw::new(self.inner.clone())
9772 }
9773
9774 /// Retrieves the specified region-specific Operations resource.
9775 pub fn get_operation(&self) -> super::builder::public_delegated_prefixes::GetOperation {
9776 super::builder::public_delegated_prefixes::GetOperation::new(self.inner.clone())
9777 }
9778}
9779
9780/// Implements a client for the Google Compute Engine API.
9781///
9782/// # Example
9783/// ```
9784/// # use google_cloud_compute_v1::client::RegionAutoscalers;
9785/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
9786/// let client = RegionAutoscalers::builder().build().await?;
9787/// // use `client` to make requests to the Google Compute Engine API.
9788/// # Ok(()) }
9789/// ```
9790///
9791/// # Service Description
9792///
9793/// Service for the `regionAutoscalers` resource.
9794///
9795/// # Configuration
9796///
9797/// To configure `RegionAutoscalers` use the `with_*` methods in the type returned
9798/// by [builder()][RegionAutoscalers::builder]. The default configuration should
9799/// work for most applications. Common configuration changes include
9800///
9801/// * [with_endpoint()]: by default this client uses the global default endpoint
9802/// (`https://compute.googleapis.com`). Applications using regional
9803/// endpoints or running in restricted networks (e.g. a network configured
9804// with [Private Google Access with VPC Service Controls]) may want to
9805/// override this default.
9806/// * [with_credentials()]: by default this client uses
9807/// [Application Default Credentials]. Applications using custom
9808/// authentication may need to override this default.
9809///
9810/// [with_endpoint()]: super::builder::region_autoscalers::ClientBuilder::with_endpoint
9811/// [with_credentials()]: super::builder::region_autoscalers::ClientBuilder::with_credentials
9812/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9813/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9814///
9815/// # Pooling and Cloning
9816///
9817/// `RegionAutoscalers` holds a connection pool internally, it is advised to
9818/// create one and reuse it. You do not need to wrap `RegionAutoscalers` in
9819/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9820/// already uses an `Arc` internally.
9821#[cfg(feature = "region-autoscalers")]
9822#[cfg_attr(docsrs, doc(cfg(feature = "region-autoscalers")))]
9823#[derive(Clone, Debug)]
9824pub struct RegionAutoscalers {
9825 inner: std::sync::Arc<dyn super::stub::dynamic::RegionAutoscalers>,
9826}
9827
9828#[cfg(feature = "region-autoscalers")]
9829impl RegionAutoscalers {
9830 /// Returns a builder for [RegionAutoscalers].
9831 ///
9832 /// ```
9833 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9834 /// # use google_cloud_compute_v1::client::RegionAutoscalers;
9835 /// let client = RegionAutoscalers::builder().build().await?;
9836 /// # Ok(()) }
9837 /// ```
9838 pub fn builder() -> super::builder::region_autoscalers::ClientBuilder {
9839 crate::new_client_builder(super::builder::region_autoscalers::client::Factory)
9840 }
9841
9842 /// Creates a new client from the provided stub.
9843 ///
9844 /// The most common case for calling this function is in tests mocking the
9845 /// client's behavior.
9846 pub fn from_stub<T>(stub: T) -> Self
9847 where
9848 T: super::stub::RegionAutoscalers + 'static,
9849 {
9850 Self {
9851 inner: std::sync::Arc::new(stub),
9852 }
9853 }
9854
9855 pub(crate) async fn new(
9856 config: gaxi::options::ClientConfig,
9857 ) -> crate::ClientBuilderResult<Self> {
9858 let inner = Self::build_inner(config).await?;
9859 Ok(Self { inner })
9860 }
9861
9862 async fn build_inner(
9863 conf: gaxi::options::ClientConfig,
9864 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionAutoscalers>>
9865 {
9866 if gaxi::options::tracing_enabled(&conf) {
9867 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9868 }
9869 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9870 }
9871
9872 async fn build_transport(
9873 conf: gaxi::options::ClientConfig,
9874 ) -> crate::ClientBuilderResult<impl super::stub::RegionAutoscalers> {
9875 super::transport::RegionAutoscalers::new(conf).await
9876 }
9877
9878 async fn build_with_tracing(
9879 conf: gaxi::options::ClientConfig,
9880 ) -> crate::ClientBuilderResult<impl super::stub::RegionAutoscalers> {
9881 Self::build_transport(conf)
9882 .await
9883 .map(super::tracing::RegionAutoscalers::new)
9884 }
9885
9886 /// Deletes the specified autoscaler.
9887 pub fn delete(&self) -> super::builder::region_autoscalers::Delete {
9888 super::builder::region_autoscalers::Delete::new(self.inner.clone())
9889 }
9890
9891 /// Returns the specified autoscaler.
9892 pub fn get(&self) -> super::builder::region_autoscalers::Get {
9893 super::builder::region_autoscalers::Get::new(self.inner.clone())
9894 }
9895
9896 /// Creates an autoscaler in the specified project using
9897 /// the data included in the request.
9898 pub fn insert(&self) -> super::builder::region_autoscalers::Insert {
9899 super::builder::region_autoscalers::Insert::new(self.inner.clone())
9900 }
9901
9902 /// Retrieves a list of autoscalers contained within
9903 /// the specified region.
9904 pub fn list(&self) -> super::builder::region_autoscalers::List {
9905 super::builder::region_autoscalers::List::new(self.inner.clone())
9906 }
9907
9908 /// Updates an autoscaler in the specified project using
9909 /// the data included in the request. This method supportsPATCH
9910 /// semantics and uses theJSON merge
9911 /// patch format and processing rules.
9912 pub fn patch(&self) -> super::builder::region_autoscalers::Patch {
9913 super::builder::region_autoscalers::Patch::new(self.inner.clone())
9914 }
9915
9916 /// Returns permissions that a caller has on the specified resource.
9917 pub fn test_iam_permissions(&self) -> super::builder::region_autoscalers::TestIamPermissions {
9918 super::builder::region_autoscalers::TestIamPermissions::new(self.inner.clone())
9919 }
9920
9921 /// Updates an autoscaler in the specified project using
9922 /// the data included in the request.
9923 pub fn update(&self) -> super::builder::region_autoscalers::Update {
9924 super::builder::region_autoscalers::Update::new(self.inner.clone())
9925 }
9926
9927 /// Retrieves the specified region-specific Operations resource.
9928 pub fn get_operation(&self) -> super::builder::region_autoscalers::GetOperation {
9929 super::builder::region_autoscalers::GetOperation::new(self.inner.clone())
9930 }
9931}
9932
9933/// Implements a client for the Google Compute Engine API.
9934///
9935/// # Example
9936/// ```
9937/// # use google_cloud_compute_v1::client::RegionBackendServices;
9938/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
9939/// let client = RegionBackendServices::builder().build().await?;
9940/// // use `client` to make requests to the Google Compute Engine API.
9941/// # Ok(()) }
9942/// ```
9943///
9944/// # Service Description
9945///
9946/// Service for the `regionBackendServices` resource.
9947///
9948/// # Configuration
9949///
9950/// To configure `RegionBackendServices` use the `with_*` methods in the type returned
9951/// by [builder()][RegionBackendServices::builder]. The default configuration should
9952/// work for most applications. Common configuration changes include
9953///
9954/// * [with_endpoint()]: by default this client uses the global default endpoint
9955/// (`https://compute.googleapis.com`). Applications using regional
9956/// endpoints or running in restricted networks (e.g. a network configured
9957// with [Private Google Access with VPC Service Controls]) may want to
9958/// override this default.
9959/// * [with_credentials()]: by default this client uses
9960/// [Application Default Credentials]. Applications using custom
9961/// authentication may need to override this default.
9962///
9963/// [with_endpoint()]: super::builder::region_backend_services::ClientBuilder::with_endpoint
9964/// [with_credentials()]: super::builder::region_backend_services::ClientBuilder::with_credentials
9965/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9966/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9967///
9968/// # Pooling and Cloning
9969///
9970/// `RegionBackendServices` holds a connection pool internally, it is advised to
9971/// create one and reuse it. You do not need to wrap `RegionBackendServices` in
9972/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9973/// already uses an `Arc` internally.
9974#[cfg(feature = "region-backend-services")]
9975#[cfg_attr(docsrs, doc(cfg(feature = "region-backend-services")))]
9976#[derive(Clone, Debug)]
9977pub struct RegionBackendServices {
9978 inner: std::sync::Arc<dyn super::stub::dynamic::RegionBackendServices>,
9979}
9980
9981#[cfg(feature = "region-backend-services")]
9982impl RegionBackendServices {
9983 /// Returns a builder for [RegionBackendServices].
9984 ///
9985 /// ```
9986 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9987 /// # use google_cloud_compute_v1::client::RegionBackendServices;
9988 /// let client = RegionBackendServices::builder().build().await?;
9989 /// # Ok(()) }
9990 /// ```
9991 pub fn builder() -> super::builder::region_backend_services::ClientBuilder {
9992 crate::new_client_builder(super::builder::region_backend_services::client::Factory)
9993 }
9994
9995 /// Creates a new client from the provided stub.
9996 ///
9997 /// The most common case for calling this function is in tests mocking the
9998 /// client's behavior.
9999 pub fn from_stub<T>(stub: T) -> Self
10000 where
10001 T: super::stub::RegionBackendServices + 'static,
10002 {
10003 Self {
10004 inner: std::sync::Arc::new(stub),
10005 }
10006 }
10007
10008 pub(crate) async fn new(
10009 config: gaxi::options::ClientConfig,
10010 ) -> crate::ClientBuilderResult<Self> {
10011 let inner = Self::build_inner(config).await?;
10012 Ok(Self { inner })
10013 }
10014
10015 async fn build_inner(
10016 conf: gaxi::options::ClientConfig,
10017 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionBackendServices>>
10018 {
10019 if gaxi::options::tracing_enabled(&conf) {
10020 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10021 }
10022 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10023 }
10024
10025 async fn build_transport(
10026 conf: gaxi::options::ClientConfig,
10027 ) -> crate::ClientBuilderResult<impl super::stub::RegionBackendServices> {
10028 super::transport::RegionBackendServices::new(conf).await
10029 }
10030
10031 async fn build_with_tracing(
10032 conf: gaxi::options::ClientConfig,
10033 ) -> crate::ClientBuilderResult<impl super::stub::RegionBackendServices> {
10034 Self::build_transport(conf)
10035 .await
10036 .map(super::tracing::RegionBackendServices::new)
10037 }
10038
10039 /// Deletes the specified regional BackendService resource.
10040 pub fn delete(&self) -> super::builder::region_backend_services::Delete {
10041 super::builder::region_backend_services::Delete::new(self.inner.clone())
10042 }
10043
10044 /// Returns the specified regional BackendService resource.
10045 pub fn get(&self) -> super::builder::region_backend_services::Get {
10046 super::builder::region_backend_services::Get::new(self.inner.clone())
10047 }
10048
10049 /// Gets the most recent health check results for this
10050 /// regional BackendService.
10051 pub fn get_health(&self) -> super::builder::region_backend_services::GetHealth {
10052 super::builder::region_backend_services::GetHealth::new(self.inner.clone())
10053 }
10054
10055 /// Gets the access control policy for a resource. May be empty if no such
10056 /// policy or resource exists.
10057 pub fn get_iam_policy(&self) -> super::builder::region_backend_services::GetIamPolicy {
10058 super::builder::region_backend_services::GetIamPolicy::new(self.inner.clone())
10059 }
10060
10061 /// Creates a regional BackendService resource in the specified project using
10062 /// the data included in the request. For more information, see
10063 /// Backend services overview.
10064 pub fn insert(&self) -> super::builder::region_backend_services::Insert {
10065 super::builder::region_backend_services::Insert::new(self.inner.clone())
10066 }
10067
10068 /// Retrieves the list of regional BackendService resources available to the
10069 /// specified project in the given region.
10070 pub fn list(&self) -> super::builder::region_backend_services::List {
10071 super::builder::region_backend_services::List::new(self.inner.clone())
10072 }
10073
10074 /// Retrieves a list of all usable backend services in the specified project in
10075 /// the given region.
10076 pub fn list_usable(&self) -> super::builder::region_backend_services::ListUsable {
10077 super::builder::region_backend_services::ListUsable::new(self.inner.clone())
10078 }
10079
10080 /// Updates the specified regional BackendService resource with the data
10081 /// included in the request. For more information, see
10082 /// Understanding backend services This method
10083 /// supports PATCH semantics and uses the JSON merge
10084 /// patch format and processing rules.
10085 pub fn patch(&self) -> super::builder::region_backend_services::Patch {
10086 super::builder::region_backend_services::Patch::new(self.inner.clone())
10087 }
10088
10089 /// Sets the access control policy on the specified resource.
10090 /// Replaces any existing policy.
10091 pub fn set_iam_policy(&self) -> super::builder::region_backend_services::SetIamPolicy {
10092 super::builder::region_backend_services::SetIamPolicy::new(self.inner.clone())
10093 }
10094
10095 /// Sets the Google Cloud Armor security policy for the specified backend
10096 /// service. For more information, seeGoogle
10097 /// Cloud Armor Overview
10098 pub fn set_security_policy(
10099 &self,
10100 ) -> super::builder::region_backend_services::SetSecurityPolicy {
10101 super::builder::region_backend_services::SetSecurityPolicy::new(self.inner.clone())
10102 }
10103
10104 /// Returns permissions that a caller has on the specified resource.
10105 pub fn test_iam_permissions(
10106 &self,
10107 ) -> super::builder::region_backend_services::TestIamPermissions {
10108 super::builder::region_backend_services::TestIamPermissions::new(self.inner.clone())
10109 }
10110
10111 /// Updates the specified regional BackendService resource with the data
10112 /// included in the request. For more information,
10113 /// see
10114 /// Backend services overview.
10115 pub fn update(&self) -> super::builder::region_backend_services::Update {
10116 super::builder::region_backend_services::Update::new(self.inner.clone())
10117 }
10118
10119 /// Retrieves the specified region-specific Operations resource.
10120 pub fn get_operation(&self) -> super::builder::region_backend_services::GetOperation {
10121 super::builder::region_backend_services::GetOperation::new(self.inner.clone())
10122 }
10123}
10124
10125/// Implements a client for the Google Compute Engine API.
10126///
10127/// # Example
10128/// ```
10129/// # use google_cloud_compute_v1::client::RegionCommitments;
10130/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
10131/// let client = RegionCommitments::builder().build().await?;
10132/// // use `client` to make requests to the Google Compute Engine API.
10133/// # Ok(()) }
10134/// ```
10135///
10136/// # Service Description
10137///
10138/// Service for the `regionCommitments` resource.
10139///
10140/// # Configuration
10141///
10142/// To configure `RegionCommitments` use the `with_*` methods in the type returned
10143/// by [builder()][RegionCommitments::builder]. The default configuration should
10144/// work for most applications. Common configuration changes include
10145///
10146/// * [with_endpoint()]: by default this client uses the global default endpoint
10147/// (`https://compute.googleapis.com`). Applications using regional
10148/// endpoints or running in restricted networks (e.g. a network configured
10149// with [Private Google Access with VPC Service Controls]) may want to
10150/// override this default.
10151/// * [with_credentials()]: by default this client uses
10152/// [Application Default Credentials]. Applications using custom
10153/// authentication may need to override this default.
10154///
10155/// [with_endpoint()]: super::builder::region_commitments::ClientBuilder::with_endpoint
10156/// [with_credentials()]: super::builder::region_commitments::ClientBuilder::with_credentials
10157/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10158/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10159///
10160/// # Pooling and Cloning
10161///
10162/// `RegionCommitments` holds a connection pool internally, it is advised to
10163/// create one and reuse it. You do not need to wrap `RegionCommitments` in
10164/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10165/// already uses an `Arc` internally.
10166#[cfg(feature = "region-commitments")]
10167#[cfg_attr(docsrs, doc(cfg(feature = "region-commitments")))]
10168#[derive(Clone, Debug)]
10169pub struct RegionCommitments {
10170 inner: std::sync::Arc<dyn super::stub::dynamic::RegionCommitments>,
10171}
10172
10173#[cfg(feature = "region-commitments")]
10174impl RegionCommitments {
10175 /// Returns a builder for [RegionCommitments].
10176 ///
10177 /// ```
10178 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10179 /// # use google_cloud_compute_v1::client::RegionCommitments;
10180 /// let client = RegionCommitments::builder().build().await?;
10181 /// # Ok(()) }
10182 /// ```
10183 pub fn builder() -> super::builder::region_commitments::ClientBuilder {
10184 crate::new_client_builder(super::builder::region_commitments::client::Factory)
10185 }
10186
10187 /// Creates a new client from the provided stub.
10188 ///
10189 /// The most common case for calling this function is in tests mocking the
10190 /// client's behavior.
10191 pub fn from_stub<T>(stub: T) -> Self
10192 where
10193 T: super::stub::RegionCommitments + 'static,
10194 {
10195 Self {
10196 inner: std::sync::Arc::new(stub),
10197 }
10198 }
10199
10200 pub(crate) async fn new(
10201 config: gaxi::options::ClientConfig,
10202 ) -> crate::ClientBuilderResult<Self> {
10203 let inner = Self::build_inner(config).await?;
10204 Ok(Self { inner })
10205 }
10206
10207 async fn build_inner(
10208 conf: gaxi::options::ClientConfig,
10209 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionCommitments>>
10210 {
10211 if gaxi::options::tracing_enabled(&conf) {
10212 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10213 }
10214 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10215 }
10216
10217 async fn build_transport(
10218 conf: gaxi::options::ClientConfig,
10219 ) -> crate::ClientBuilderResult<impl super::stub::RegionCommitments> {
10220 super::transport::RegionCommitments::new(conf).await
10221 }
10222
10223 async fn build_with_tracing(
10224 conf: gaxi::options::ClientConfig,
10225 ) -> crate::ClientBuilderResult<impl super::stub::RegionCommitments> {
10226 Self::build_transport(conf)
10227 .await
10228 .map(super::tracing::RegionCommitments::new)
10229 }
10230
10231 /// Retrieves an aggregated list of commitments by region.
10232 ///
10233 /// To prevent failure, it is recommended that you set the
10234 /// `returnPartialSuccess` parameter to `true`.
10235 pub fn aggregated_list(&self) -> super::builder::region_commitments::AggregatedList {
10236 super::builder::region_commitments::AggregatedList::new(self.inner.clone())
10237 }
10238
10239 /// Returns the specified commitment resource.
10240 pub fn get(&self) -> super::builder::region_commitments::Get {
10241 super::builder::region_commitments::Get::new(self.inner.clone())
10242 }
10243
10244 /// Creates a commitment in the specified project using the data
10245 /// included in the request.
10246 pub fn insert(&self) -> super::builder::region_commitments::Insert {
10247 super::builder::region_commitments::Insert::new(self.inner.clone())
10248 }
10249
10250 /// Retrieves a list of commitments contained within
10251 /// the specified region.
10252 pub fn list(&self) -> super::builder::region_commitments::List {
10253 super::builder::region_commitments::List::new(self.inner.clone())
10254 }
10255
10256 /// Updates the specified commitment with the data included in the request.
10257 /// Update is performed only on selected fields included as part of
10258 /// update-mask. Only the following fields can be updated: auto_renew and plan.
10259 pub fn update(&self) -> super::builder::region_commitments::Update {
10260 super::builder::region_commitments::Update::new(self.inner.clone())
10261 }
10262
10263 /// Retrieves the specified region-specific Operations resource.
10264 pub fn get_operation(&self) -> super::builder::region_commitments::GetOperation {
10265 super::builder::region_commitments::GetOperation::new(self.inner.clone())
10266 }
10267}
10268
10269/// Implements a client for the Google Compute Engine API.
10270///
10271/// # Example
10272/// ```
10273/// # use google_cloud_compute_v1::client::RegionCompositeHealthChecks;
10274/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
10275/// let client = RegionCompositeHealthChecks::builder().build().await?;
10276/// // use `client` to make requests to the Google Compute Engine API.
10277/// # Ok(()) }
10278/// ```
10279///
10280/// # Service Description
10281///
10282/// Service for the `regionCompositeHealthChecks` resource.
10283///
10284/// # Configuration
10285///
10286/// To configure `RegionCompositeHealthChecks` use the `with_*` methods in the type returned
10287/// by [builder()][RegionCompositeHealthChecks::builder]. The default configuration should
10288/// work for most applications. Common configuration changes include
10289///
10290/// * [with_endpoint()]: by default this client uses the global default endpoint
10291/// (`https://compute.googleapis.com`). Applications using regional
10292/// endpoints or running in restricted networks (e.g. a network configured
10293// with [Private Google Access with VPC Service Controls]) may want to
10294/// override this default.
10295/// * [with_credentials()]: by default this client uses
10296/// [Application Default Credentials]. Applications using custom
10297/// authentication may need to override this default.
10298///
10299/// [with_endpoint()]: super::builder::region_composite_health_checks::ClientBuilder::with_endpoint
10300/// [with_credentials()]: super::builder::region_composite_health_checks::ClientBuilder::with_credentials
10301/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10302/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10303///
10304/// # Pooling and Cloning
10305///
10306/// `RegionCompositeHealthChecks` holds a connection pool internally, it is advised to
10307/// create one and reuse it. You do not need to wrap `RegionCompositeHealthChecks` in
10308/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10309/// already uses an `Arc` internally.
10310#[cfg(feature = "region-composite-health-checks")]
10311#[cfg_attr(docsrs, doc(cfg(feature = "region-composite-health-checks")))]
10312#[derive(Clone, Debug)]
10313pub struct RegionCompositeHealthChecks {
10314 inner: std::sync::Arc<dyn super::stub::dynamic::RegionCompositeHealthChecks>,
10315}
10316
10317#[cfg(feature = "region-composite-health-checks")]
10318impl RegionCompositeHealthChecks {
10319 /// Returns a builder for [RegionCompositeHealthChecks].
10320 ///
10321 /// ```
10322 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10323 /// # use google_cloud_compute_v1::client::RegionCompositeHealthChecks;
10324 /// let client = RegionCompositeHealthChecks::builder().build().await?;
10325 /// # Ok(()) }
10326 /// ```
10327 pub fn builder() -> super::builder::region_composite_health_checks::ClientBuilder {
10328 crate::new_client_builder(super::builder::region_composite_health_checks::client::Factory)
10329 }
10330
10331 /// Creates a new client from the provided stub.
10332 ///
10333 /// The most common case for calling this function is in tests mocking the
10334 /// client's behavior.
10335 pub fn from_stub<T>(stub: T) -> Self
10336 where
10337 T: super::stub::RegionCompositeHealthChecks + 'static,
10338 {
10339 Self {
10340 inner: std::sync::Arc::new(stub),
10341 }
10342 }
10343
10344 pub(crate) async fn new(
10345 config: gaxi::options::ClientConfig,
10346 ) -> crate::ClientBuilderResult<Self> {
10347 let inner = Self::build_inner(config).await?;
10348 Ok(Self { inner })
10349 }
10350
10351 async fn build_inner(
10352 conf: gaxi::options::ClientConfig,
10353 ) -> crate::ClientBuilderResult<
10354 std::sync::Arc<dyn super::stub::dynamic::RegionCompositeHealthChecks>,
10355 > {
10356 if gaxi::options::tracing_enabled(&conf) {
10357 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10358 }
10359 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10360 }
10361
10362 async fn build_transport(
10363 conf: gaxi::options::ClientConfig,
10364 ) -> crate::ClientBuilderResult<impl super::stub::RegionCompositeHealthChecks> {
10365 super::transport::RegionCompositeHealthChecks::new(conf).await
10366 }
10367
10368 async fn build_with_tracing(
10369 conf: gaxi::options::ClientConfig,
10370 ) -> crate::ClientBuilderResult<impl super::stub::RegionCompositeHealthChecks> {
10371 Self::build_transport(conf)
10372 .await
10373 .map(super::tracing::RegionCompositeHealthChecks::new)
10374 }
10375
10376 /// Retrieves the list of all CompositeHealthCheck resources (all
10377 /// regional) available to the specified project.
10378 ///
10379 /// To prevent failure, it is recommended that you set the
10380 /// `returnPartialSuccess` parameter to `true`.
10381 pub fn aggregated_list(
10382 &self,
10383 ) -> super::builder::region_composite_health_checks::AggregatedList {
10384 super::builder::region_composite_health_checks::AggregatedList::new(self.inner.clone())
10385 }
10386
10387 /// Deletes the specified CompositeHealthCheck in the given region
10388 pub fn delete(&self) -> super::builder::region_composite_health_checks::Delete {
10389 super::builder::region_composite_health_checks::Delete::new(self.inner.clone())
10390 }
10391
10392 /// Returns the specified CompositeHealthCheck resource in the given region.
10393 pub fn get(&self) -> super::builder::region_composite_health_checks::Get {
10394 super::builder::region_composite_health_checks::Get::new(self.inner.clone())
10395 }
10396
10397 /// Create a CompositeHealthCheck in the specified project in the given region
10398 /// using the parameters that are included in the request.
10399 pub fn insert(&self) -> super::builder::region_composite_health_checks::Insert {
10400 super::builder::region_composite_health_checks::Insert::new(self.inner.clone())
10401 }
10402
10403 /// Lists the CompositeHealthChecks for a project in the given region.
10404 pub fn list(&self) -> super::builder::region_composite_health_checks::List {
10405 super::builder::region_composite_health_checks::List::new(self.inner.clone())
10406 }
10407
10408 /// Updates the specified regional CompositeHealthCheck resource
10409 /// with the data included in the request. This method supportsPATCH
10410 /// semantics and uses theJSON merge
10411 /// patch format and processing rules.
10412 pub fn patch(&self) -> super::builder::region_composite_health_checks::Patch {
10413 super::builder::region_composite_health_checks::Patch::new(self.inner.clone())
10414 }
10415
10416 /// Returns permissions that a caller has on the specified resource.
10417 pub fn test_iam_permissions(
10418 &self,
10419 ) -> super::builder::region_composite_health_checks::TestIamPermissions {
10420 super::builder::region_composite_health_checks::TestIamPermissions::new(self.inner.clone())
10421 }
10422
10423 /// Retrieves the specified region-specific Operations resource.
10424 pub fn get_operation(&self) -> super::builder::region_composite_health_checks::GetOperation {
10425 super::builder::region_composite_health_checks::GetOperation::new(self.inner.clone())
10426 }
10427}
10428
10429/// Implements a client for the Google Compute Engine API.
10430///
10431/// # Example
10432/// ```
10433/// # use google_cloud_compute_v1::client::RegionDiskTypes;
10434/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
10435/// let client = RegionDiskTypes::builder().build().await?;
10436/// // use `client` to make requests to the Google Compute Engine API.
10437/// # Ok(()) }
10438/// ```
10439///
10440/// # Service Description
10441///
10442/// Service for the `regionDiskTypes` resource.
10443///
10444/// # Configuration
10445///
10446/// To configure `RegionDiskTypes` use the `with_*` methods in the type returned
10447/// by [builder()][RegionDiskTypes::builder]. The default configuration should
10448/// work for most applications. Common configuration changes include
10449///
10450/// * [with_endpoint()]: by default this client uses the global default endpoint
10451/// (`https://compute.googleapis.com`). Applications using regional
10452/// endpoints or running in restricted networks (e.g. a network configured
10453// with [Private Google Access with VPC Service Controls]) may want to
10454/// override this default.
10455/// * [with_credentials()]: by default this client uses
10456/// [Application Default Credentials]. Applications using custom
10457/// authentication may need to override this default.
10458///
10459/// [with_endpoint()]: super::builder::region_disk_types::ClientBuilder::with_endpoint
10460/// [with_credentials()]: super::builder::region_disk_types::ClientBuilder::with_credentials
10461/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10462/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10463///
10464/// # Pooling and Cloning
10465///
10466/// `RegionDiskTypes` holds a connection pool internally, it is advised to
10467/// create one and reuse it. You do not need to wrap `RegionDiskTypes` in
10468/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10469/// already uses an `Arc` internally.
10470#[cfg(feature = "region-disk-types")]
10471#[cfg_attr(docsrs, doc(cfg(feature = "region-disk-types")))]
10472#[derive(Clone, Debug)]
10473pub struct RegionDiskTypes {
10474 inner: std::sync::Arc<dyn super::stub::dynamic::RegionDiskTypes>,
10475}
10476
10477#[cfg(feature = "region-disk-types")]
10478impl RegionDiskTypes {
10479 /// Returns a builder for [RegionDiskTypes].
10480 ///
10481 /// ```
10482 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10483 /// # use google_cloud_compute_v1::client::RegionDiskTypes;
10484 /// let client = RegionDiskTypes::builder().build().await?;
10485 /// # Ok(()) }
10486 /// ```
10487 pub fn builder() -> super::builder::region_disk_types::ClientBuilder {
10488 crate::new_client_builder(super::builder::region_disk_types::client::Factory)
10489 }
10490
10491 /// Creates a new client from the provided stub.
10492 ///
10493 /// The most common case for calling this function is in tests mocking the
10494 /// client's behavior.
10495 pub fn from_stub<T>(stub: T) -> Self
10496 where
10497 T: super::stub::RegionDiskTypes + 'static,
10498 {
10499 Self {
10500 inner: std::sync::Arc::new(stub),
10501 }
10502 }
10503
10504 pub(crate) async fn new(
10505 config: gaxi::options::ClientConfig,
10506 ) -> crate::ClientBuilderResult<Self> {
10507 let inner = Self::build_inner(config).await?;
10508 Ok(Self { inner })
10509 }
10510
10511 async fn build_inner(
10512 conf: gaxi::options::ClientConfig,
10513 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionDiskTypes>> {
10514 if gaxi::options::tracing_enabled(&conf) {
10515 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10516 }
10517 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10518 }
10519
10520 async fn build_transport(
10521 conf: gaxi::options::ClientConfig,
10522 ) -> crate::ClientBuilderResult<impl super::stub::RegionDiskTypes> {
10523 super::transport::RegionDiskTypes::new(conf).await
10524 }
10525
10526 async fn build_with_tracing(
10527 conf: gaxi::options::ClientConfig,
10528 ) -> crate::ClientBuilderResult<impl super::stub::RegionDiskTypes> {
10529 Self::build_transport(conf)
10530 .await
10531 .map(super::tracing::RegionDiskTypes::new)
10532 }
10533
10534 /// Returns the specified regional disk type.
10535 pub fn get(&self) -> super::builder::region_disk_types::Get {
10536 super::builder::region_disk_types::Get::new(self.inner.clone())
10537 }
10538
10539 /// Retrieves a list of regional disk types available to the specified project.
10540 pub fn list(&self) -> super::builder::region_disk_types::List {
10541 super::builder::region_disk_types::List::new(self.inner.clone())
10542 }
10543}
10544
10545/// Implements a client for the Google Compute Engine API.
10546///
10547/// # Example
10548/// ```
10549/// # use google_cloud_compute_v1::client::RegionDisks;
10550/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
10551/// let client = RegionDisks::builder().build().await?;
10552/// // use `client` to make requests to the Google Compute Engine API.
10553/// # Ok(()) }
10554/// ```
10555///
10556/// # Service Description
10557///
10558/// Service for the `regionDisks` resource.
10559///
10560/// # Configuration
10561///
10562/// To configure `RegionDisks` use the `with_*` methods in the type returned
10563/// by [builder()][RegionDisks::builder]. The default configuration should
10564/// work for most applications. Common configuration changes include
10565///
10566/// * [with_endpoint()]: by default this client uses the global default endpoint
10567/// (`https://compute.googleapis.com`). Applications using regional
10568/// endpoints or running in restricted networks (e.g. a network configured
10569// with [Private Google Access with VPC Service Controls]) may want to
10570/// override this default.
10571/// * [with_credentials()]: by default this client uses
10572/// [Application Default Credentials]. Applications using custom
10573/// authentication may need to override this default.
10574///
10575/// [with_endpoint()]: super::builder::region_disks::ClientBuilder::with_endpoint
10576/// [with_credentials()]: super::builder::region_disks::ClientBuilder::with_credentials
10577/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10578/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10579///
10580/// # Pooling and Cloning
10581///
10582/// `RegionDisks` holds a connection pool internally, it is advised to
10583/// create one and reuse it. You do not need to wrap `RegionDisks` in
10584/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10585/// already uses an `Arc` internally.
10586#[cfg(feature = "region-disks")]
10587#[cfg_attr(docsrs, doc(cfg(feature = "region-disks")))]
10588#[derive(Clone, Debug)]
10589pub struct RegionDisks {
10590 inner: std::sync::Arc<dyn super::stub::dynamic::RegionDisks>,
10591}
10592
10593#[cfg(feature = "region-disks")]
10594impl RegionDisks {
10595 /// Returns a builder for [RegionDisks].
10596 ///
10597 /// ```
10598 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10599 /// # use google_cloud_compute_v1::client::RegionDisks;
10600 /// let client = RegionDisks::builder().build().await?;
10601 /// # Ok(()) }
10602 /// ```
10603 pub fn builder() -> super::builder::region_disks::ClientBuilder {
10604 crate::new_client_builder(super::builder::region_disks::client::Factory)
10605 }
10606
10607 /// Creates a new client from the provided stub.
10608 ///
10609 /// The most common case for calling this function is in tests mocking the
10610 /// client's behavior.
10611 pub fn from_stub<T>(stub: T) -> Self
10612 where
10613 T: super::stub::RegionDisks + 'static,
10614 {
10615 Self {
10616 inner: std::sync::Arc::new(stub),
10617 }
10618 }
10619
10620 pub(crate) async fn new(
10621 config: gaxi::options::ClientConfig,
10622 ) -> crate::ClientBuilderResult<Self> {
10623 let inner = Self::build_inner(config).await?;
10624 Ok(Self { inner })
10625 }
10626
10627 async fn build_inner(
10628 conf: gaxi::options::ClientConfig,
10629 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionDisks>> {
10630 if gaxi::options::tracing_enabled(&conf) {
10631 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10632 }
10633 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10634 }
10635
10636 async fn build_transport(
10637 conf: gaxi::options::ClientConfig,
10638 ) -> crate::ClientBuilderResult<impl super::stub::RegionDisks> {
10639 super::transport::RegionDisks::new(conf).await
10640 }
10641
10642 async fn build_with_tracing(
10643 conf: gaxi::options::ClientConfig,
10644 ) -> crate::ClientBuilderResult<impl super::stub::RegionDisks> {
10645 Self::build_transport(conf)
10646 .await
10647 .map(super::tracing::RegionDisks::new)
10648 }
10649
10650 /// Adds existing resource policies to a regional disk. You can only add one
10651 /// policy which will be applied to this disk for scheduling snapshot
10652 /// creation.
10653 pub fn add_resource_policies(&self) -> super::builder::region_disks::AddResourcePolicies {
10654 super::builder::region_disks::AddResourcePolicies::new(self.inner.clone())
10655 }
10656
10657 /// Bulk create a set of disks.
10658 pub fn bulk_insert(&self) -> super::builder::region_disks::BulkInsert {
10659 super::builder::region_disks::BulkInsert::new(self.inner.clone())
10660 }
10661
10662 /// Creates a snapshot of a specified persistent disk. For regular snapshot
10663 /// creation, consider using snapshots.insert
10664 /// instead, as that method supports more features, such as creating snapshots
10665 /// in a project different from the source disk project.
10666 pub fn create_snapshot(&self) -> super::builder::region_disks::CreateSnapshot {
10667 super::builder::region_disks::CreateSnapshot::new(self.inner.clone())
10668 }
10669
10670 /// Deletes the specified regional persistent disk. Deleting a regional disk
10671 /// removes all the replicas of its data permanently and is irreversible.
10672 /// However, deleting a disk does not delete anysnapshots
10673 /// previously made from the disk. You must separatelydelete
10674 /// snapshots.
10675 pub fn delete(&self) -> super::builder::region_disks::Delete {
10676 super::builder::region_disks::Delete::new(self.inner.clone())
10677 }
10678
10679 /// Returns a specified regional persistent disk.
10680 pub fn get(&self) -> super::builder::region_disks::Get {
10681 super::builder::region_disks::Get::new(self.inner.clone())
10682 }
10683
10684 /// Gets the access control policy for a resource. May be empty if no such
10685 /// policy or resource exists.
10686 pub fn get_iam_policy(&self) -> super::builder::region_disks::GetIamPolicy {
10687 super::builder::region_disks::GetIamPolicy::new(self.inner.clone())
10688 }
10689
10690 /// Creates a persistent regional disk in the specified project using the data
10691 /// included in the request.
10692 pub fn insert(&self) -> super::builder::region_disks::Insert {
10693 super::builder::region_disks::Insert::new(self.inner.clone())
10694 }
10695
10696 /// Retrieves the list of persistent disks contained within
10697 /// the specified region.
10698 pub fn list(&self) -> super::builder::region_disks::List {
10699 super::builder::region_disks::List::new(self.inner.clone())
10700 }
10701
10702 /// Removes resource policies from a regional disk.
10703 pub fn remove_resource_policies(&self) -> super::builder::region_disks::RemoveResourcePolicies {
10704 super::builder::region_disks::RemoveResourcePolicies::new(self.inner.clone())
10705 }
10706
10707 /// Resizes the specified regional persistent disk.
10708 pub fn resize(&self) -> super::builder::region_disks::Resize {
10709 super::builder::region_disks::Resize::new(self.inner.clone())
10710 }
10711
10712 /// Sets the access control policy on the specified resource.
10713 /// Replaces any existing policy.
10714 pub fn set_iam_policy(&self) -> super::builder::region_disks::SetIamPolicy {
10715 super::builder::region_disks::SetIamPolicy::new(self.inner.clone())
10716 }
10717
10718 /// Sets the labels on the target regional disk.
10719 pub fn set_labels(&self) -> super::builder::region_disks::SetLabels {
10720 super::builder::region_disks::SetLabels::new(self.inner.clone())
10721 }
10722
10723 /// Starts asynchronous replication.
10724 /// Must be invoked on the primary disk.
10725 pub fn start_async_replication(&self) -> super::builder::region_disks::StartAsyncReplication {
10726 super::builder::region_disks::StartAsyncReplication::new(self.inner.clone())
10727 }
10728
10729 /// Stops asynchronous replication.
10730 /// Can be invoked either on the primary or on the secondary disk.
10731 pub fn stop_async_replication(&self) -> super::builder::region_disks::StopAsyncReplication {
10732 super::builder::region_disks::StopAsyncReplication::new(self.inner.clone())
10733 }
10734
10735 /// Stops asynchronous replication for a consistency group of disks.
10736 /// Can be invoked either in the primary or secondary scope.
10737 pub fn stop_group_async_replication(
10738 &self,
10739 ) -> super::builder::region_disks::StopGroupAsyncReplication {
10740 super::builder::region_disks::StopGroupAsyncReplication::new(self.inner.clone())
10741 }
10742
10743 /// Returns permissions that a caller has on the specified resource.
10744 pub fn test_iam_permissions(&self) -> super::builder::region_disks::TestIamPermissions {
10745 super::builder::region_disks::TestIamPermissions::new(self.inner.clone())
10746 }
10747
10748 /// Update the specified disk with the data included in the request. Update is
10749 /// performed only on selected fields included as part of update-mask.
10750 pub fn update(&self) -> super::builder::region_disks::Update {
10751 super::builder::region_disks::Update::new(self.inner.clone())
10752 }
10753
10754 /// Retrieves the specified region-specific Operations resource.
10755 pub fn get_operation(&self) -> super::builder::region_disks::GetOperation {
10756 super::builder::region_disks::GetOperation::new(self.inner.clone())
10757 }
10758}
10759
10760/// Implements a client for the Google Compute Engine API.
10761///
10762/// # Example
10763/// ```
10764/// # use google_cloud_compute_v1::client::RegionHealthAggregationPolicies;
10765/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
10766/// let client = RegionHealthAggregationPolicies::builder().build().await?;
10767/// // use `client` to make requests to the Google Compute Engine API.
10768/// # Ok(()) }
10769/// ```
10770///
10771/// # Service Description
10772///
10773/// Service for the `regionHealthAggregationPolicies` resource.
10774///
10775/// # Configuration
10776///
10777/// To configure `RegionHealthAggregationPolicies` use the `with_*` methods in the type returned
10778/// by [builder()][RegionHealthAggregationPolicies::builder]. The default configuration should
10779/// work for most applications. Common configuration changes include
10780///
10781/// * [with_endpoint()]: by default this client uses the global default endpoint
10782/// (`https://compute.googleapis.com`). Applications using regional
10783/// endpoints or running in restricted networks (e.g. a network configured
10784// with [Private Google Access with VPC Service Controls]) may want to
10785/// override this default.
10786/// * [with_credentials()]: by default this client uses
10787/// [Application Default Credentials]. Applications using custom
10788/// authentication may need to override this default.
10789///
10790/// [with_endpoint()]: super::builder::region_health_aggregation_policies::ClientBuilder::with_endpoint
10791/// [with_credentials()]: super::builder::region_health_aggregation_policies::ClientBuilder::with_credentials
10792/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10793/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10794///
10795/// # Pooling and Cloning
10796///
10797/// `RegionHealthAggregationPolicies` holds a connection pool internally, it is advised to
10798/// create one and reuse it. You do not need to wrap `RegionHealthAggregationPolicies` in
10799/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10800/// already uses an `Arc` internally.
10801#[cfg(feature = "region-health-aggregation-policies")]
10802#[cfg_attr(docsrs, doc(cfg(feature = "region-health-aggregation-policies")))]
10803#[derive(Clone, Debug)]
10804pub struct RegionHealthAggregationPolicies {
10805 inner: std::sync::Arc<dyn super::stub::dynamic::RegionHealthAggregationPolicies>,
10806}
10807
10808#[cfg(feature = "region-health-aggregation-policies")]
10809impl RegionHealthAggregationPolicies {
10810 /// Returns a builder for [RegionHealthAggregationPolicies].
10811 ///
10812 /// ```
10813 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10814 /// # use google_cloud_compute_v1::client::RegionHealthAggregationPolicies;
10815 /// let client = RegionHealthAggregationPolicies::builder().build().await?;
10816 /// # Ok(()) }
10817 /// ```
10818 pub fn builder() -> super::builder::region_health_aggregation_policies::ClientBuilder {
10819 crate::new_client_builder(
10820 super::builder::region_health_aggregation_policies::client::Factory,
10821 )
10822 }
10823
10824 /// Creates a new client from the provided stub.
10825 ///
10826 /// The most common case for calling this function is in tests mocking the
10827 /// client's behavior.
10828 pub fn from_stub<T>(stub: T) -> Self
10829 where
10830 T: super::stub::RegionHealthAggregationPolicies + 'static,
10831 {
10832 Self {
10833 inner: std::sync::Arc::new(stub),
10834 }
10835 }
10836
10837 pub(crate) async fn new(
10838 config: gaxi::options::ClientConfig,
10839 ) -> crate::ClientBuilderResult<Self> {
10840 let inner = Self::build_inner(config).await?;
10841 Ok(Self { inner })
10842 }
10843
10844 async fn build_inner(
10845 conf: gaxi::options::ClientConfig,
10846 ) -> crate::ClientBuilderResult<
10847 std::sync::Arc<dyn super::stub::dynamic::RegionHealthAggregationPolicies>,
10848 > {
10849 if gaxi::options::tracing_enabled(&conf) {
10850 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10851 }
10852 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10853 }
10854
10855 async fn build_transport(
10856 conf: gaxi::options::ClientConfig,
10857 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthAggregationPolicies> {
10858 super::transport::RegionHealthAggregationPolicies::new(conf).await
10859 }
10860
10861 async fn build_with_tracing(
10862 conf: gaxi::options::ClientConfig,
10863 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthAggregationPolicies> {
10864 Self::build_transport(conf)
10865 .await
10866 .map(super::tracing::RegionHealthAggregationPolicies::new)
10867 }
10868
10869 /// Retrieves the list of all HealthAggregationPolicy resources,
10870 /// regional and global, available to the specified project.
10871 ///
10872 /// To prevent failure, it is recommended that you set the
10873 /// `returnPartialSuccess` parameter to `true`.
10874 pub fn aggregated_list(
10875 &self,
10876 ) -> super::builder::region_health_aggregation_policies::AggregatedList {
10877 super::builder::region_health_aggregation_policies::AggregatedList::new(self.inner.clone())
10878 }
10879
10880 /// Deletes the specified HealthAggregationPolicy in the given region.
10881 pub fn delete(&self) -> super::builder::region_health_aggregation_policies::Delete {
10882 super::builder::region_health_aggregation_policies::Delete::new(self.inner.clone())
10883 }
10884
10885 /// Returns the specified HealthAggregationPolicy resource in the given region.
10886 pub fn get(&self) -> super::builder::region_health_aggregation_policies::Get {
10887 super::builder::region_health_aggregation_policies::Get::new(self.inner.clone())
10888 }
10889
10890 /// Create a HealthAggregationPolicy in the specified project in the given
10891 /// region using the parameters that are included in the request.
10892 pub fn insert(&self) -> super::builder::region_health_aggregation_policies::Insert {
10893 super::builder::region_health_aggregation_policies::Insert::new(self.inner.clone())
10894 }
10895
10896 /// Lists the HealthAggregationPolicies for a project in the given region.
10897 pub fn list(&self) -> super::builder::region_health_aggregation_policies::List {
10898 super::builder::region_health_aggregation_policies::List::new(self.inner.clone())
10899 }
10900
10901 /// Updates the specified regional HealthAggregationPolicy
10902 /// resource with the data included in the request. This method supportsPATCH
10903 /// semantics and uses theJSON merge
10904 /// patch format and processing rules.
10905 pub fn patch(&self) -> super::builder::region_health_aggregation_policies::Patch {
10906 super::builder::region_health_aggregation_policies::Patch::new(self.inner.clone())
10907 }
10908
10909 /// Returns permissions that a caller has on the specified resource.
10910 pub fn test_iam_permissions(
10911 &self,
10912 ) -> super::builder::region_health_aggregation_policies::TestIamPermissions {
10913 super::builder::region_health_aggregation_policies::TestIamPermissions::new(
10914 self.inner.clone(),
10915 )
10916 }
10917
10918 /// Retrieves the specified region-specific Operations resource.
10919 pub fn get_operation(
10920 &self,
10921 ) -> super::builder::region_health_aggregation_policies::GetOperation {
10922 super::builder::region_health_aggregation_policies::GetOperation::new(self.inner.clone())
10923 }
10924}
10925
10926/// Implements a client for the Google Compute Engine API.
10927///
10928/// # Example
10929/// ```
10930/// # use google_cloud_compute_v1::client::RegionHealthCheckServices;
10931/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
10932/// let client = RegionHealthCheckServices::builder().build().await?;
10933/// // use `client` to make requests to the Google Compute Engine API.
10934/// # Ok(()) }
10935/// ```
10936///
10937/// # Service Description
10938///
10939/// Service for the `regionHealthCheckServices` resource.
10940///
10941/// # Configuration
10942///
10943/// To configure `RegionHealthCheckServices` use the `with_*` methods in the type returned
10944/// by [builder()][RegionHealthCheckServices::builder]. The default configuration should
10945/// work for most applications. Common configuration changes include
10946///
10947/// * [with_endpoint()]: by default this client uses the global default endpoint
10948/// (`https://compute.googleapis.com`). Applications using regional
10949/// endpoints or running in restricted networks (e.g. a network configured
10950// with [Private Google Access with VPC Service Controls]) may want to
10951/// override this default.
10952/// * [with_credentials()]: by default this client uses
10953/// [Application Default Credentials]. Applications using custom
10954/// authentication may need to override this default.
10955///
10956/// [with_endpoint()]: super::builder::region_health_check_services::ClientBuilder::with_endpoint
10957/// [with_credentials()]: super::builder::region_health_check_services::ClientBuilder::with_credentials
10958/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10959/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10960///
10961/// # Pooling and Cloning
10962///
10963/// `RegionHealthCheckServices` holds a connection pool internally, it is advised to
10964/// create one and reuse it. You do not need to wrap `RegionHealthCheckServices` in
10965/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10966/// already uses an `Arc` internally.
10967#[cfg(feature = "region-health-check-services")]
10968#[cfg_attr(docsrs, doc(cfg(feature = "region-health-check-services")))]
10969#[derive(Clone, Debug)]
10970pub struct RegionHealthCheckServices {
10971 inner: std::sync::Arc<dyn super::stub::dynamic::RegionHealthCheckServices>,
10972}
10973
10974#[cfg(feature = "region-health-check-services")]
10975impl RegionHealthCheckServices {
10976 /// Returns a builder for [RegionHealthCheckServices].
10977 ///
10978 /// ```
10979 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10980 /// # use google_cloud_compute_v1::client::RegionHealthCheckServices;
10981 /// let client = RegionHealthCheckServices::builder().build().await?;
10982 /// # Ok(()) }
10983 /// ```
10984 pub fn builder() -> super::builder::region_health_check_services::ClientBuilder {
10985 crate::new_client_builder(super::builder::region_health_check_services::client::Factory)
10986 }
10987
10988 /// Creates a new client from the provided stub.
10989 ///
10990 /// The most common case for calling this function is in tests mocking the
10991 /// client's behavior.
10992 pub fn from_stub<T>(stub: T) -> Self
10993 where
10994 T: super::stub::RegionHealthCheckServices + 'static,
10995 {
10996 Self {
10997 inner: std::sync::Arc::new(stub),
10998 }
10999 }
11000
11001 pub(crate) async fn new(
11002 config: gaxi::options::ClientConfig,
11003 ) -> crate::ClientBuilderResult<Self> {
11004 let inner = Self::build_inner(config).await?;
11005 Ok(Self { inner })
11006 }
11007
11008 async fn build_inner(
11009 conf: gaxi::options::ClientConfig,
11010 ) -> crate::ClientBuilderResult<
11011 std::sync::Arc<dyn super::stub::dynamic::RegionHealthCheckServices>,
11012 > {
11013 if gaxi::options::tracing_enabled(&conf) {
11014 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11015 }
11016 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11017 }
11018
11019 async fn build_transport(
11020 conf: gaxi::options::ClientConfig,
11021 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthCheckServices> {
11022 super::transport::RegionHealthCheckServices::new(conf).await
11023 }
11024
11025 async fn build_with_tracing(
11026 conf: gaxi::options::ClientConfig,
11027 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthCheckServices> {
11028 Self::build_transport(conf)
11029 .await
11030 .map(super::tracing::RegionHealthCheckServices::new)
11031 }
11032
11033 /// Retrieves the list of all HealthCheckService resources,
11034 /// regional and global, available to the specified project.
11035 ///
11036 /// To prevent failure, it is recommended that you set the
11037 /// `returnPartialSuccess` parameter to `true`.
11038 pub fn aggregated_list(&self) -> super::builder::region_health_check_services::AggregatedList {
11039 super::builder::region_health_check_services::AggregatedList::new(self.inner.clone())
11040 }
11041
11042 /// Deletes the specified regional HealthCheckService.
11043 pub fn delete(&self) -> super::builder::region_health_check_services::Delete {
11044 super::builder::region_health_check_services::Delete::new(self.inner.clone())
11045 }
11046
11047 /// Returns the specified regional HealthCheckService resource.
11048 pub fn get(&self) -> super::builder::region_health_check_services::Get {
11049 super::builder::region_health_check_services::Get::new(self.inner.clone())
11050 }
11051
11052 /// Creates a regional HealthCheckService resource in the
11053 /// specified project and region using the data included in the request.
11054 pub fn insert(&self) -> super::builder::region_health_check_services::Insert {
11055 super::builder::region_health_check_services::Insert::new(self.inner.clone())
11056 }
11057
11058 /// Lists all the HealthCheckService resources that have been
11059 /// configured for the specified project in the given region.
11060 pub fn list(&self) -> super::builder::region_health_check_services::List {
11061 super::builder::region_health_check_services::List::new(self.inner.clone())
11062 }
11063
11064 /// Updates the specified regional HealthCheckService resource
11065 /// with the data included in the request. This method supportsPATCH
11066 /// semantics and uses theJSON merge
11067 /// patch format and processing rules.
11068 pub fn patch(&self) -> super::builder::region_health_check_services::Patch {
11069 super::builder::region_health_check_services::Patch::new(self.inner.clone())
11070 }
11071
11072 /// Returns permissions that a caller has on the specified resource.
11073 pub fn test_iam_permissions(
11074 &self,
11075 ) -> super::builder::region_health_check_services::TestIamPermissions {
11076 super::builder::region_health_check_services::TestIamPermissions::new(self.inner.clone())
11077 }
11078
11079 /// Retrieves the specified region-specific Operations resource.
11080 pub fn get_operation(&self) -> super::builder::region_health_check_services::GetOperation {
11081 super::builder::region_health_check_services::GetOperation::new(self.inner.clone())
11082 }
11083}
11084
11085/// Implements a client for the Google Compute Engine API.
11086///
11087/// # Example
11088/// ```
11089/// # use google_cloud_compute_v1::client::RegionHealthChecks;
11090/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
11091/// let client = RegionHealthChecks::builder().build().await?;
11092/// // use `client` to make requests to the Google Compute Engine API.
11093/// # Ok(()) }
11094/// ```
11095///
11096/// # Service Description
11097///
11098/// Service for the `regionHealthChecks` resource.
11099///
11100/// # Configuration
11101///
11102/// To configure `RegionHealthChecks` use the `with_*` methods in the type returned
11103/// by [builder()][RegionHealthChecks::builder]. The default configuration should
11104/// work for most applications. Common configuration changes include
11105///
11106/// * [with_endpoint()]: by default this client uses the global default endpoint
11107/// (`https://compute.googleapis.com`). Applications using regional
11108/// endpoints or running in restricted networks (e.g. a network configured
11109// with [Private Google Access with VPC Service Controls]) may want to
11110/// override this default.
11111/// * [with_credentials()]: by default this client uses
11112/// [Application Default Credentials]. Applications using custom
11113/// authentication may need to override this default.
11114///
11115/// [with_endpoint()]: super::builder::region_health_checks::ClientBuilder::with_endpoint
11116/// [with_credentials()]: super::builder::region_health_checks::ClientBuilder::with_credentials
11117/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11118/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11119///
11120/// # Pooling and Cloning
11121///
11122/// `RegionHealthChecks` holds a connection pool internally, it is advised to
11123/// create one and reuse it. You do not need to wrap `RegionHealthChecks` in
11124/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11125/// already uses an `Arc` internally.
11126#[cfg(feature = "region-health-checks")]
11127#[cfg_attr(docsrs, doc(cfg(feature = "region-health-checks")))]
11128#[derive(Clone, Debug)]
11129pub struct RegionHealthChecks {
11130 inner: std::sync::Arc<dyn super::stub::dynamic::RegionHealthChecks>,
11131}
11132
11133#[cfg(feature = "region-health-checks")]
11134impl RegionHealthChecks {
11135 /// Returns a builder for [RegionHealthChecks].
11136 ///
11137 /// ```
11138 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11139 /// # use google_cloud_compute_v1::client::RegionHealthChecks;
11140 /// let client = RegionHealthChecks::builder().build().await?;
11141 /// # Ok(()) }
11142 /// ```
11143 pub fn builder() -> super::builder::region_health_checks::ClientBuilder {
11144 crate::new_client_builder(super::builder::region_health_checks::client::Factory)
11145 }
11146
11147 /// Creates a new client from the provided stub.
11148 ///
11149 /// The most common case for calling this function is in tests mocking the
11150 /// client's behavior.
11151 pub fn from_stub<T>(stub: T) -> Self
11152 where
11153 T: super::stub::RegionHealthChecks + 'static,
11154 {
11155 Self {
11156 inner: std::sync::Arc::new(stub),
11157 }
11158 }
11159
11160 pub(crate) async fn new(
11161 config: gaxi::options::ClientConfig,
11162 ) -> crate::ClientBuilderResult<Self> {
11163 let inner = Self::build_inner(config).await?;
11164 Ok(Self { inner })
11165 }
11166
11167 async fn build_inner(
11168 conf: gaxi::options::ClientConfig,
11169 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionHealthChecks>>
11170 {
11171 if gaxi::options::tracing_enabled(&conf) {
11172 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11173 }
11174 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11175 }
11176
11177 async fn build_transport(
11178 conf: gaxi::options::ClientConfig,
11179 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthChecks> {
11180 super::transport::RegionHealthChecks::new(conf).await
11181 }
11182
11183 async fn build_with_tracing(
11184 conf: gaxi::options::ClientConfig,
11185 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthChecks> {
11186 Self::build_transport(conf)
11187 .await
11188 .map(super::tracing::RegionHealthChecks::new)
11189 }
11190
11191 /// Deletes the specified HealthCheck resource.
11192 pub fn delete(&self) -> super::builder::region_health_checks::Delete {
11193 super::builder::region_health_checks::Delete::new(self.inner.clone())
11194 }
11195
11196 /// Returns the specified HealthCheck resource.
11197 pub fn get(&self) -> super::builder::region_health_checks::Get {
11198 super::builder::region_health_checks::Get::new(self.inner.clone())
11199 }
11200
11201 /// Creates a HealthCheck resource in the specified project using the data
11202 /// included in the request.
11203 pub fn insert(&self) -> super::builder::region_health_checks::Insert {
11204 super::builder::region_health_checks::Insert::new(self.inner.clone())
11205 }
11206
11207 /// Retrieves the list of HealthCheck resources available to the specified
11208 /// project.
11209 pub fn list(&self) -> super::builder::region_health_checks::List {
11210 super::builder::region_health_checks::List::new(self.inner.clone())
11211 }
11212
11213 /// Updates a HealthCheck resource in the specified project using the data
11214 /// included in the request. This method supportsPATCH
11215 /// semantics and uses theJSON merge
11216 /// patch format and processing rules.
11217 pub fn patch(&self) -> super::builder::region_health_checks::Patch {
11218 super::builder::region_health_checks::Patch::new(self.inner.clone())
11219 }
11220
11221 /// Returns permissions that a caller has on the specified resource.
11222 pub fn test_iam_permissions(&self) -> super::builder::region_health_checks::TestIamPermissions {
11223 super::builder::region_health_checks::TestIamPermissions::new(self.inner.clone())
11224 }
11225
11226 /// Updates a HealthCheck resource in the specified project using the data
11227 /// included in the request.
11228 pub fn update(&self) -> super::builder::region_health_checks::Update {
11229 super::builder::region_health_checks::Update::new(self.inner.clone())
11230 }
11231
11232 /// Retrieves the specified region-specific Operations resource.
11233 pub fn get_operation(&self) -> super::builder::region_health_checks::GetOperation {
11234 super::builder::region_health_checks::GetOperation::new(self.inner.clone())
11235 }
11236}
11237
11238/// Implements a client for the Google Compute Engine API.
11239///
11240/// # Example
11241/// ```
11242/// # use google_cloud_compute_v1::client::RegionHealthSources;
11243/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
11244/// let client = RegionHealthSources::builder().build().await?;
11245/// // use `client` to make requests to the Google Compute Engine API.
11246/// # Ok(()) }
11247/// ```
11248///
11249/// # Service Description
11250///
11251/// Service for the `regionHealthSources` resource.
11252///
11253/// # Configuration
11254///
11255/// To configure `RegionHealthSources` use the `with_*` methods in the type returned
11256/// by [builder()][RegionHealthSources::builder]. The default configuration should
11257/// work for most applications. Common configuration changes include
11258///
11259/// * [with_endpoint()]: by default this client uses the global default endpoint
11260/// (`https://compute.googleapis.com`). Applications using regional
11261/// endpoints or running in restricted networks (e.g. a network configured
11262// with [Private Google Access with VPC Service Controls]) may want to
11263/// override this default.
11264/// * [with_credentials()]: by default this client uses
11265/// [Application Default Credentials]. Applications using custom
11266/// authentication may need to override this default.
11267///
11268/// [with_endpoint()]: super::builder::region_health_sources::ClientBuilder::with_endpoint
11269/// [with_credentials()]: super::builder::region_health_sources::ClientBuilder::with_credentials
11270/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11271/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11272///
11273/// # Pooling and Cloning
11274///
11275/// `RegionHealthSources` holds a connection pool internally, it is advised to
11276/// create one and reuse it. You do not need to wrap `RegionHealthSources` in
11277/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11278/// already uses an `Arc` internally.
11279#[cfg(feature = "region-health-sources")]
11280#[cfg_attr(docsrs, doc(cfg(feature = "region-health-sources")))]
11281#[derive(Clone, Debug)]
11282pub struct RegionHealthSources {
11283 inner: std::sync::Arc<dyn super::stub::dynamic::RegionHealthSources>,
11284}
11285
11286#[cfg(feature = "region-health-sources")]
11287impl RegionHealthSources {
11288 /// Returns a builder for [RegionHealthSources].
11289 ///
11290 /// ```
11291 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11292 /// # use google_cloud_compute_v1::client::RegionHealthSources;
11293 /// let client = RegionHealthSources::builder().build().await?;
11294 /// # Ok(()) }
11295 /// ```
11296 pub fn builder() -> super::builder::region_health_sources::ClientBuilder {
11297 crate::new_client_builder(super::builder::region_health_sources::client::Factory)
11298 }
11299
11300 /// Creates a new client from the provided stub.
11301 ///
11302 /// The most common case for calling this function is in tests mocking the
11303 /// client's behavior.
11304 pub fn from_stub<T>(stub: T) -> Self
11305 where
11306 T: super::stub::RegionHealthSources + 'static,
11307 {
11308 Self {
11309 inner: std::sync::Arc::new(stub),
11310 }
11311 }
11312
11313 pub(crate) async fn new(
11314 config: gaxi::options::ClientConfig,
11315 ) -> crate::ClientBuilderResult<Self> {
11316 let inner = Self::build_inner(config).await?;
11317 Ok(Self { inner })
11318 }
11319
11320 async fn build_inner(
11321 conf: gaxi::options::ClientConfig,
11322 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionHealthSources>>
11323 {
11324 if gaxi::options::tracing_enabled(&conf) {
11325 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11326 }
11327 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11328 }
11329
11330 async fn build_transport(
11331 conf: gaxi::options::ClientConfig,
11332 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthSources> {
11333 super::transport::RegionHealthSources::new(conf).await
11334 }
11335
11336 async fn build_with_tracing(
11337 conf: gaxi::options::ClientConfig,
11338 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthSources> {
11339 Self::build_transport(conf)
11340 .await
11341 .map(super::tracing::RegionHealthSources::new)
11342 }
11343
11344 /// Retrieves the list of all HealthSource resources (all
11345 /// regional) available to the specified project.
11346 ///
11347 /// To prevent failure, Google recommends that you set the
11348 /// `returnPartialSuccess` parameter to `true`.
11349 pub fn aggregated_list(&self) -> super::builder::region_health_sources::AggregatedList {
11350 super::builder::region_health_sources::AggregatedList::new(self.inner.clone())
11351 }
11352
11353 /// Deletes the specified HealthSource in the given region
11354 pub fn delete(&self) -> super::builder::region_health_sources::Delete {
11355 super::builder::region_health_sources::Delete::new(self.inner.clone())
11356 }
11357
11358 /// Returns the specified HealthSource resource in the given region.
11359 pub fn get(&self) -> super::builder::region_health_sources::Get {
11360 super::builder::region_health_sources::Get::new(self.inner.clone())
11361 }
11362
11363 /// Create a HealthSource in the specified project in the given region
11364 /// using the parameters that are included in the request.
11365 pub fn insert(&self) -> super::builder::region_health_sources::Insert {
11366 super::builder::region_health_sources::Insert::new(self.inner.clone())
11367 }
11368
11369 /// Lists the HealthSources for a project in the given region.
11370 pub fn list(&self) -> super::builder::region_health_sources::List {
11371 super::builder::region_health_sources::List::new(self.inner.clone())
11372 }
11373
11374 /// Updates the specified regional HealthSource resource
11375 /// with the data included in the request. This method supportsPATCH
11376 /// semantics and uses theJSON merge
11377 /// patch format and processing rules.
11378 pub fn patch(&self) -> super::builder::region_health_sources::Patch {
11379 super::builder::region_health_sources::Patch::new(self.inner.clone())
11380 }
11381
11382 /// Returns permissions that a caller has on the specified resource.
11383 pub fn test_iam_permissions(
11384 &self,
11385 ) -> super::builder::region_health_sources::TestIamPermissions {
11386 super::builder::region_health_sources::TestIamPermissions::new(self.inner.clone())
11387 }
11388
11389 /// Retrieves the specified region-specific Operations resource.
11390 pub fn get_operation(&self) -> super::builder::region_health_sources::GetOperation {
11391 super::builder::region_health_sources::GetOperation::new(self.inner.clone())
11392 }
11393}
11394
11395/// Implements a client for the Google Compute Engine API.
11396///
11397/// # Example
11398/// ```
11399/// # use google_cloud_compute_v1::client::RegionInstanceGroupManagers;
11400/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
11401/// let client = RegionInstanceGroupManagers::builder().build().await?;
11402/// // use `client` to make requests to the Google Compute Engine API.
11403/// # Ok(()) }
11404/// ```
11405///
11406/// # Service Description
11407///
11408/// Service for the `regionInstanceGroupManagers` resource.
11409///
11410/// # Configuration
11411///
11412/// To configure `RegionInstanceGroupManagers` use the `with_*` methods in the type returned
11413/// by [builder()][RegionInstanceGroupManagers::builder]. The default configuration should
11414/// work for most applications. Common configuration changes include
11415///
11416/// * [with_endpoint()]: by default this client uses the global default endpoint
11417/// (`https://compute.googleapis.com`). Applications using regional
11418/// endpoints or running in restricted networks (e.g. a network configured
11419// with [Private Google Access with VPC Service Controls]) may want to
11420/// override this default.
11421/// * [with_credentials()]: by default this client uses
11422/// [Application Default Credentials]. Applications using custom
11423/// authentication may need to override this default.
11424///
11425/// [with_endpoint()]: super::builder::region_instance_group_managers::ClientBuilder::with_endpoint
11426/// [with_credentials()]: super::builder::region_instance_group_managers::ClientBuilder::with_credentials
11427/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11428/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11429///
11430/// # Pooling and Cloning
11431///
11432/// `RegionInstanceGroupManagers` holds a connection pool internally, it is advised to
11433/// create one and reuse it. You do not need to wrap `RegionInstanceGroupManagers` in
11434/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11435/// already uses an `Arc` internally.
11436#[cfg(feature = "region-instance-group-managers")]
11437#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-group-managers")))]
11438#[derive(Clone, Debug)]
11439pub struct RegionInstanceGroupManagers {
11440 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroupManagers>,
11441}
11442
11443#[cfg(feature = "region-instance-group-managers")]
11444impl RegionInstanceGroupManagers {
11445 /// Returns a builder for [RegionInstanceGroupManagers].
11446 ///
11447 /// ```
11448 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11449 /// # use google_cloud_compute_v1::client::RegionInstanceGroupManagers;
11450 /// let client = RegionInstanceGroupManagers::builder().build().await?;
11451 /// # Ok(()) }
11452 /// ```
11453 pub fn builder() -> super::builder::region_instance_group_managers::ClientBuilder {
11454 crate::new_client_builder(super::builder::region_instance_group_managers::client::Factory)
11455 }
11456
11457 /// Creates a new client from the provided stub.
11458 ///
11459 /// The most common case for calling this function is in tests mocking the
11460 /// client's behavior.
11461 pub fn from_stub<T>(stub: T) -> Self
11462 where
11463 T: super::stub::RegionInstanceGroupManagers + 'static,
11464 {
11465 Self {
11466 inner: std::sync::Arc::new(stub),
11467 }
11468 }
11469
11470 pub(crate) async fn new(
11471 config: gaxi::options::ClientConfig,
11472 ) -> crate::ClientBuilderResult<Self> {
11473 let inner = Self::build_inner(config).await?;
11474 Ok(Self { inner })
11475 }
11476
11477 async fn build_inner(
11478 conf: gaxi::options::ClientConfig,
11479 ) -> crate::ClientBuilderResult<
11480 std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroupManagers>,
11481 > {
11482 if gaxi::options::tracing_enabled(&conf) {
11483 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11484 }
11485 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11486 }
11487
11488 async fn build_transport(
11489 conf: gaxi::options::ClientConfig,
11490 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroupManagers> {
11491 super::transport::RegionInstanceGroupManagers::new(conf).await
11492 }
11493
11494 async fn build_with_tracing(
11495 conf: gaxi::options::ClientConfig,
11496 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroupManagers> {
11497 Self::build_transport(conf)
11498 .await
11499 .map(super::tracing::RegionInstanceGroupManagers::new)
11500 }
11501
11502 /// Flags the specified instances to be immediately removed from the managed
11503 /// instance group. Abandoning an instance does not delete the
11504 /// instance, but it does remove the instance from any target pools that are
11505 /// applied by the managed instance group. This method reduces thetargetSize of the managed instance group by the
11506 /// number of instances that you abandon. This operation is marked asDONE when the action is scheduled even if the instances have
11507 /// not yet been removed from the group. You must separately verify the
11508 /// status of the abandoning action with thelistmanagedinstances
11509 /// method.
11510 ///
11511 /// If the group is part of a backend
11512 /// service that has enabled
11513 /// connection draining, it can take up to 60 seconds after the connection
11514 /// draining duration has elapsed before the VM instance is removed or deleted.
11515 ///
11516 /// You can specify a maximum of 1000 instances with this method per request.
11517 pub fn abandon_instances(
11518 &self,
11519 ) -> super::builder::region_instance_group_managers::AbandonInstances {
11520 super::builder::region_instance_group_managers::AbandonInstances::new(self.inner.clone())
11521 }
11522
11523 /// Apply updates to selected instances the managed instance group.
11524 pub fn apply_updates_to_instances(
11525 &self,
11526 ) -> super::builder::region_instance_group_managers::ApplyUpdatesToInstances {
11527 super::builder::region_instance_group_managers::ApplyUpdatesToInstances::new(
11528 self.inner.clone(),
11529 )
11530 }
11531
11532 /// Creates instances with per-instance configurations in this regional managed
11533 /// instance group. Instances are created using the current instance template.
11534 /// The create instances operation is marked DONE if
11535 /// the createInstances request is successful. The underlying
11536 /// actions take additional time. You must separately verify the status of thecreating or actions with the listmanagedinstances
11537 /// method.
11538 pub fn create_instances(
11539 &self,
11540 ) -> super::builder::region_instance_group_managers::CreateInstances {
11541 super::builder::region_instance_group_managers::CreateInstances::new(self.inner.clone())
11542 }
11543
11544 /// Deletes the specified managed instance group and all of the instances
11545 /// in that group.
11546 pub fn delete(&self) -> super::builder::region_instance_group_managers::Delete {
11547 super::builder::region_instance_group_managers::Delete::new(self.inner.clone())
11548 }
11549
11550 /// Flags the specified instances in the managed instance group to be
11551 /// immediately deleted. The instances are also removed from any target
11552 /// pools of which they were a member. This method reduces thetargetSize of the managed instance group by the number of
11553 /// instances that you delete.
11554 /// The deleteInstances operation is marked DONE if
11555 /// the deleteInstances request is successful. The underlying
11556 /// actions take additional time. You must separately verify the status of thedeleting action with thelistmanagedinstances
11557 /// method.
11558 ///
11559 /// If the group is part of a backend
11560 /// service that has enabled
11561 /// connection draining, it can take up to 60 seconds after the connection
11562 /// draining duration has elapsed before the VM instance is removed or deleted.
11563 ///
11564 /// You can specify a maximum of 1000 instances with this method per request.
11565 pub fn delete_instances(
11566 &self,
11567 ) -> super::builder::region_instance_group_managers::DeleteInstances {
11568 super::builder::region_instance_group_managers::DeleteInstances::new(self.inner.clone())
11569 }
11570
11571 /// Deletes selected per-instance configurations for the managed instance
11572 /// group.
11573 pub fn delete_per_instance_configs(
11574 &self,
11575 ) -> super::builder::region_instance_group_managers::DeletePerInstanceConfigs {
11576 super::builder::region_instance_group_managers::DeletePerInstanceConfigs::new(
11577 self.inner.clone(),
11578 )
11579 }
11580
11581 /// Returns all of the details about the specified managed instance group.
11582 pub fn get(&self) -> super::builder::region_instance_group_managers::Get {
11583 super::builder::region_instance_group_managers::Get::new(self.inner.clone())
11584 }
11585
11586 /// Creates a managed instance group using the information that you specify
11587 /// in the request. After the group is created, instances in the group are
11588 /// created using the specified instance template.
11589 /// This operation is marked as DONE when the group is created
11590 /// even if the instances in the group have not yet been created. You must
11591 /// separately verify the status of the individual instances with thelistmanagedinstances
11592 /// method.
11593 ///
11594 /// A regional managed instance group can contain up to 2000 instances.
11595 pub fn insert(&self) -> super::builder::region_instance_group_managers::Insert {
11596 super::builder::region_instance_group_managers::Insert::new(self.inner.clone())
11597 }
11598
11599 /// Retrieves the list of managed instance groups that are contained
11600 /// within the specified region.
11601 pub fn list(&self) -> super::builder::region_instance_group_managers::List {
11602 super::builder::region_instance_group_managers::List::new(self.inner.clone())
11603 }
11604
11605 /// Lists all errors thrown by actions on instances for a given regional
11606 /// managed instance group. The filter andorderBy query parameters are not supported.
11607 pub fn list_errors(&self) -> super::builder::region_instance_group_managers::ListErrors {
11608 super::builder::region_instance_group_managers::ListErrors::new(self.inner.clone())
11609 }
11610
11611 /// Lists the instances in the managed instance group and instances that are
11612 /// scheduled to be created. The list includes any current actions
11613 /// that the group has scheduled for its instances. The orderBy
11614 /// query parameter is not supported. The `pageToken` query parameter is
11615 /// supported only if the group's `listManagedInstancesResults` field is set
11616 /// to `PAGINATED`.
11617 pub fn list_managed_instances(
11618 &self,
11619 ) -> super::builder::region_instance_group_managers::ListManagedInstances {
11620 super::builder::region_instance_group_managers::ListManagedInstances::new(
11621 self.inner.clone(),
11622 )
11623 }
11624
11625 /// Lists all of the per-instance configurations defined for the managed
11626 /// instance group. The orderBy query parameter is not supported.
11627 pub fn list_per_instance_configs(
11628 &self,
11629 ) -> super::builder::region_instance_group_managers::ListPerInstanceConfigs {
11630 super::builder::region_instance_group_managers::ListPerInstanceConfigs::new(
11631 self.inner.clone(),
11632 )
11633 }
11634
11635 /// Updates a managed instance group using the information that you specify
11636 /// in the request.
11637 /// This operation is marked as DONE when the group is patched
11638 /// even if the instances in the group are still in the process of being
11639 /// patched. You must separately verify the status of the individual instances
11640 /// with the listmanagedinstances
11641 /// method. This method supportsPATCH
11642 /// semantics and uses theJSON merge
11643 /// patch format and processing rules.
11644 ///
11645 /// If you update your group to specify a new template or instance
11646 /// configuration, it's possible that your intended specification for each VM
11647 /// in the group is different from the current state of that VM. To learn how
11648 /// to apply an updated configuration to the VMs in a MIG, seeUpdating instances in
11649 /// a MIG.
11650 pub fn patch(&self) -> super::builder::region_instance_group_managers::Patch {
11651 super::builder::region_instance_group_managers::Patch::new(self.inner.clone())
11652 }
11653
11654 /// Inserts or patches per-instance configurations for the managed instance
11655 /// group. perInstanceConfig.name serves as a key used to
11656 /// distinguish whether to perform insert or patch.
11657 pub fn patch_per_instance_configs(
11658 &self,
11659 ) -> super::builder::region_instance_group_managers::PatchPerInstanceConfigs {
11660 super::builder::region_instance_group_managers::PatchPerInstanceConfigs::new(
11661 self.inner.clone(),
11662 )
11663 }
11664
11665 /// Flags the specified VM instances in the managed instance group to be
11666 /// immediately recreated. Each instance is recreated using the group's current
11667 /// configuration. This operation is marked as DONE when the flag
11668 /// is set even if the instances have not yet been recreated. You must
11669 /// separately verify the status of each instance by checking itscurrentAction field; for more information, see Checking
11670 /// the status of managed instances.
11671 ///
11672 /// If the group is part of a backend
11673 /// service that has enabled
11674 /// connection draining, it can take up to 60 seconds after the connection
11675 /// draining duration has elapsed before the VM instance is removed or deleted.
11676 ///
11677 /// You can specify a maximum of 1000 instances with this method per request.
11678 pub fn recreate_instances(
11679 &self,
11680 ) -> super::builder::region_instance_group_managers::RecreateInstances {
11681 super::builder::region_instance_group_managers::RecreateInstances::new(self.inner.clone())
11682 }
11683
11684 /// Changes the intended size of the managed instance group. If you increase
11685 /// the size, the group creates new instances using the current instance
11686 /// template. If you decrease the size, the group deletes one or more
11687 /// instances.
11688 ///
11689 /// The resize operation is marked DONE if theresize request is successful. The underlying actions take
11690 /// additional time. You must separately verify the status of thecreating or deleting actions with thelistmanagedinstances
11691 /// method.
11692 ///
11693 /// If the group is part of a backend
11694 /// service that has enabled
11695 /// connection draining, it can take up to 60 seconds after the connection
11696 /// draining duration has elapsed before the VM instance is removed or deleted.
11697 pub fn resize(&self) -> super::builder::region_instance_group_managers::Resize {
11698 super::builder::region_instance_group_managers::Resize::new(self.inner.clone())
11699 }
11700
11701 /// Flags the specified instances in the managed instance group to be
11702 /// resumed. This method increases thetargetSize and decreases the targetSuspendedSize
11703 /// of the managed instance group by the number of instances that you resume.
11704 /// The resumeInstances operation is marked DONE if
11705 /// the resumeInstances request is successful. The underlying
11706 /// actions take additional time. You must separately verify the status of theRESUMING action with thelistmanagedinstances
11707 /// method.
11708 ///
11709 /// In this request, you can only specify instances that are suspended. For
11710 /// example, if an instance was previously suspended using the suspendInstances
11711 /// method, it can be resumed using the resumeInstances method.
11712 ///
11713 /// If a health check is attached to the managed instance group, the specified
11714 /// instances will be verified as healthy after they are resumed.
11715 ///
11716 /// You can specify a maximum of 1000 instances with this method per request.
11717 pub fn resume_instances(
11718 &self,
11719 ) -> super::builder::region_instance_group_managers::ResumeInstances {
11720 super::builder::region_instance_group_managers::ResumeInstances::new(self.inner.clone())
11721 }
11722
11723 /// Sets the instance template to use when creating new instances or recreating
11724 /// instances in this group. Existing instances are not affected.
11725 pub fn set_instance_template(
11726 &self,
11727 ) -> super::builder::region_instance_group_managers::SetInstanceTemplate {
11728 super::builder::region_instance_group_managers::SetInstanceTemplate::new(self.inner.clone())
11729 }
11730
11731 /// Modifies the target pools to which all new instances in this group are
11732 /// assigned. Existing instances in the group are not affected.
11733 pub fn set_target_pools(
11734 &self,
11735 ) -> super::builder::region_instance_group_managers::SetTargetPools {
11736 super::builder::region_instance_group_managers::SetTargetPools::new(self.inner.clone())
11737 }
11738
11739 /// Flags the specified instances in the managed instance group to be
11740 /// started. This method increases thetargetSize and decreases the targetStoppedSize
11741 /// of the managed instance group by the number of instances that you start.
11742 /// The startInstances operation is marked DONE if
11743 /// the startInstances request is successful. The underlying
11744 /// actions take additional time. You must separately verify the status of theSTARTING action with thelistmanagedinstances
11745 /// method.
11746 ///
11747 /// In this request, you can only specify instances that are stopped. For
11748 /// example, if an instance was previously stopped using the stopInstances
11749 /// method, it can be started using the startInstances method.
11750 ///
11751 /// If a health check is attached to the managed instance group, the specified
11752 /// instances will be verified as healthy after they are started.
11753 ///
11754 /// You can specify a maximum of 1000 instances with this method per request.
11755 pub fn start_instances(
11756 &self,
11757 ) -> super::builder::region_instance_group_managers::StartInstances {
11758 super::builder::region_instance_group_managers::StartInstances::new(self.inner.clone())
11759 }
11760
11761 /// Flags the specified instances in the managed instance group to be
11762 /// immediately stopped. You can only specify instances that are running in
11763 /// this request. This method reduces thetargetSize and increases the targetStoppedSize
11764 /// of the managed instance group by the number of instances that you stop.
11765 /// The stopInstances operation is marked DONE if
11766 /// the stopInstances request is successful. The underlying
11767 /// actions take additional time. You must separately verify the status of theSTOPPING action with thelistmanagedinstances
11768 /// method.
11769 ///
11770 /// If the standbyPolicy.initialDelaySec field is set, the group
11771 /// delays stopping the instances until initialDelaySec have
11772 /// passed from instance.creationTimestamp (that is, when the
11773 /// instance was created). This delay gives your application time to
11774 /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
11775 /// will be zero delay.
11776 ///
11777 /// If the group is part of a backend
11778 /// service that has enabled
11779 /// connection draining, it can take up to 60 seconds after the connection
11780 /// draining duration has elapsed before the VM instance is stopped.
11781 ///
11782 /// Stopped instances can be started using the startInstances
11783 /// method.
11784 ///
11785 /// You can specify a maximum of 1000 instances with this method per request.
11786 pub fn stop_instances(&self) -> super::builder::region_instance_group_managers::StopInstances {
11787 super::builder::region_instance_group_managers::StopInstances::new(self.inner.clone())
11788 }
11789
11790 /// Flags the specified instances in the managed instance group to be
11791 /// immediately suspended. You can only specify instances that are running in
11792 /// this request. This method reduces thetargetSize and increases the targetSuspendedSize
11793 /// of the managed instance group by the number of instances that you suspend.
11794 /// The suspendInstances operation is marked DONE if
11795 /// the suspendInstances request is successful. The underlying
11796 /// actions take additional time. You must separately verify the status of theSUSPENDING action with thelistmanagedinstances
11797 /// method.
11798 ///
11799 /// If the standbyPolicy.initialDelaySec field is set, the group
11800 /// delays suspension of the instances until initialDelaySec have
11801 /// passed from instance.creationTimestamp (that is, when the
11802 /// instance was created). This delay gives your application time to
11803 /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
11804 /// will be zero delay.
11805 ///
11806 /// If the group is part of a backend
11807 /// service that has enabled
11808 /// connection draining, it can take up to 60 seconds after the connection
11809 /// draining duration has elapsed before the VM instance is suspended.
11810 ///
11811 /// Suspended instances can be resumed using the resumeInstances
11812 /// method.
11813 ///
11814 /// You can specify a maximum of 1000 instances with this method per request.
11815 pub fn suspend_instances(
11816 &self,
11817 ) -> super::builder::region_instance_group_managers::SuspendInstances {
11818 super::builder::region_instance_group_managers::SuspendInstances::new(self.inner.clone())
11819 }
11820
11821 /// Inserts or updates per-instance configurations for the managed instance
11822 /// group. perInstanceConfig.name serves as a key used to
11823 /// distinguish whether to perform insert or patch.
11824 pub fn update_per_instance_configs(
11825 &self,
11826 ) -> super::builder::region_instance_group_managers::UpdatePerInstanceConfigs {
11827 super::builder::region_instance_group_managers::UpdatePerInstanceConfigs::new(
11828 self.inner.clone(),
11829 )
11830 }
11831
11832 /// Retrieves the specified region-specific Operations resource.
11833 pub fn get_operation(&self) -> super::builder::region_instance_group_managers::GetOperation {
11834 super::builder::region_instance_group_managers::GetOperation::new(self.inner.clone())
11835 }
11836}
11837
11838/// Implements a client for the Google Compute Engine API.
11839///
11840/// # Example
11841/// ```
11842/// # use google_cloud_compute_v1::client::RegionInstanceGroups;
11843/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
11844/// let client = RegionInstanceGroups::builder().build().await?;
11845/// // use `client` to make requests to the Google Compute Engine API.
11846/// # Ok(()) }
11847/// ```
11848///
11849/// # Service Description
11850///
11851/// Service for the `regionInstanceGroups` resource.
11852///
11853/// # Configuration
11854///
11855/// To configure `RegionInstanceGroups` use the `with_*` methods in the type returned
11856/// by [builder()][RegionInstanceGroups::builder]. The default configuration should
11857/// work for most applications. Common configuration changes include
11858///
11859/// * [with_endpoint()]: by default this client uses the global default endpoint
11860/// (`https://compute.googleapis.com`). Applications using regional
11861/// endpoints or running in restricted networks (e.g. a network configured
11862// with [Private Google Access with VPC Service Controls]) may want to
11863/// override this default.
11864/// * [with_credentials()]: by default this client uses
11865/// [Application Default Credentials]. Applications using custom
11866/// authentication may need to override this default.
11867///
11868/// [with_endpoint()]: super::builder::region_instance_groups::ClientBuilder::with_endpoint
11869/// [with_credentials()]: super::builder::region_instance_groups::ClientBuilder::with_credentials
11870/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11871/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11872///
11873/// # Pooling and Cloning
11874///
11875/// `RegionInstanceGroups` holds a connection pool internally, it is advised to
11876/// create one and reuse it. You do not need to wrap `RegionInstanceGroups` in
11877/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11878/// already uses an `Arc` internally.
11879#[cfg(feature = "region-instance-groups")]
11880#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-groups")))]
11881#[derive(Clone, Debug)]
11882pub struct RegionInstanceGroups {
11883 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroups>,
11884}
11885
11886#[cfg(feature = "region-instance-groups")]
11887impl RegionInstanceGroups {
11888 /// Returns a builder for [RegionInstanceGroups].
11889 ///
11890 /// ```
11891 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11892 /// # use google_cloud_compute_v1::client::RegionInstanceGroups;
11893 /// let client = RegionInstanceGroups::builder().build().await?;
11894 /// # Ok(()) }
11895 /// ```
11896 pub fn builder() -> super::builder::region_instance_groups::ClientBuilder {
11897 crate::new_client_builder(super::builder::region_instance_groups::client::Factory)
11898 }
11899
11900 /// Creates a new client from the provided stub.
11901 ///
11902 /// The most common case for calling this function is in tests mocking the
11903 /// client's behavior.
11904 pub fn from_stub<T>(stub: T) -> Self
11905 where
11906 T: super::stub::RegionInstanceGroups + 'static,
11907 {
11908 Self {
11909 inner: std::sync::Arc::new(stub),
11910 }
11911 }
11912
11913 pub(crate) async fn new(
11914 config: gaxi::options::ClientConfig,
11915 ) -> crate::ClientBuilderResult<Self> {
11916 let inner = Self::build_inner(config).await?;
11917 Ok(Self { inner })
11918 }
11919
11920 async fn build_inner(
11921 conf: gaxi::options::ClientConfig,
11922 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroups>>
11923 {
11924 if gaxi::options::tracing_enabled(&conf) {
11925 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11926 }
11927 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11928 }
11929
11930 async fn build_transport(
11931 conf: gaxi::options::ClientConfig,
11932 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroups> {
11933 super::transport::RegionInstanceGroups::new(conf).await
11934 }
11935
11936 async fn build_with_tracing(
11937 conf: gaxi::options::ClientConfig,
11938 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroups> {
11939 Self::build_transport(conf)
11940 .await
11941 .map(super::tracing::RegionInstanceGroups::new)
11942 }
11943
11944 /// Returns the specified instance group resource.
11945 pub fn get(&self) -> super::builder::region_instance_groups::Get {
11946 super::builder::region_instance_groups::Get::new(self.inner.clone())
11947 }
11948
11949 /// Retrieves the list of instance group resources contained within
11950 /// the specified region.
11951 pub fn list(&self) -> super::builder::region_instance_groups::List {
11952 super::builder::region_instance_groups::List::new(self.inner.clone())
11953 }
11954
11955 /// Lists the instances in the specified instance group and displays
11956 /// information about the named ports. Depending on the specified options, this
11957 /// method can list all instances or only the instances that are running.
11958 /// The orderBy query parameter is not supported.
11959 pub fn list_instances(&self) -> super::builder::region_instance_groups::ListInstances {
11960 super::builder::region_instance_groups::ListInstances::new(self.inner.clone())
11961 }
11962
11963 /// Sets the named ports for the specified regional instance group.
11964 pub fn set_named_ports(&self) -> super::builder::region_instance_groups::SetNamedPorts {
11965 super::builder::region_instance_groups::SetNamedPorts::new(self.inner.clone())
11966 }
11967
11968 /// Returns permissions that a caller has on the specified resource.
11969 pub fn test_iam_permissions(
11970 &self,
11971 ) -> super::builder::region_instance_groups::TestIamPermissions {
11972 super::builder::region_instance_groups::TestIamPermissions::new(self.inner.clone())
11973 }
11974
11975 /// Retrieves the specified region-specific Operations resource.
11976 pub fn get_operation(&self) -> super::builder::region_instance_groups::GetOperation {
11977 super::builder::region_instance_groups::GetOperation::new(self.inner.clone())
11978 }
11979}
11980
11981/// Implements a client for the Google Compute Engine API.
11982///
11983/// # Example
11984/// ```
11985/// # use google_cloud_compute_v1::client::RegionInstanceTemplates;
11986/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
11987/// let client = RegionInstanceTemplates::builder().build().await?;
11988/// // use `client` to make requests to the Google Compute Engine API.
11989/// # Ok(()) }
11990/// ```
11991///
11992/// # Service Description
11993///
11994/// Service for the `regionInstanceTemplates` resource.
11995///
11996/// # Configuration
11997///
11998/// To configure `RegionInstanceTemplates` use the `with_*` methods in the type returned
11999/// by [builder()][RegionInstanceTemplates::builder]. The default configuration should
12000/// work for most applications. Common configuration changes include
12001///
12002/// * [with_endpoint()]: by default this client uses the global default endpoint
12003/// (`https://compute.googleapis.com`). Applications using regional
12004/// endpoints or running in restricted networks (e.g. a network configured
12005// with [Private Google Access with VPC Service Controls]) may want to
12006/// override this default.
12007/// * [with_credentials()]: by default this client uses
12008/// [Application Default Credentials]. Applications using custom
12009/// authentication may need to override this default.
12010///
12011/// [with_endpoint()]: super::builder::region_instance_templates::ClientBuilder::with_endpoint
12012/// [with_credentials()]: super::builder::region_instance_templates::ClientBuilder::with_credentials
12013/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12014/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12015///
12016/// # Pooling and Cloning
12017///
12018/// `RegionInstanceTemplates` holds a connection pool internally, it is advised to
12019/// create one and reuse it. You do not need to wrap `RegionInstanceTemplates` in
12020/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12021/// already uses an `Arc` internally.
12022#[cfg(feature = "region-instance-templates")]
12023#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-templates")))]
12024#[derive(Clone, Debug)]
12025pub struct RegionInstanceTemplates {
12026 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceTemplates>,
12027}
12028
12029#[cfg(feature = "region-instance-templates")]
12030impl RegionInstanceTemplates {
12031 /// Returns a builder for [RegionInstanceTemplates].
12032 ///
12033 /// ```
12034 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12035 /// # use google_cloud_compute_v1::client::RegionInstanceTemplates;
12036 /// let client = RegionInstanceTemplates::builder().build().await?;
12037 /// # Ok(()) }
12038 /// ```
12039 pub fn builder() -> super::builder::region_instance_templates::ClientBuilder {
12040 crate::new_client_builder(super::builder::region_instance_templates::client::Factory)
12041 }
12042
12043 /// Creates a new client from the provided stub.
12044 ///
12045 /// The most common case for calling this function is in tests mocking the
12046 /// client's behavior.
12047 pub fn from_stub<T>(stub: T) -> Self
12048 where
12049 T: super::stub::RegionInstanceTemplates + 'static,
12050 {
12051 Self {
12052 inner: std::sync::Arc::new(stub),
12053 }
12054 }
12055
12056 pub(crate) async fn new(
12057 config: gaxi::options::ClientConfig,
12058 ) -> crate::ClientBuilderResult<Self> {
12059 let inner = Self::build_inner(config).await?;
12060 Ok(Self { inner })
12061 }
12062
12063 async fn build_inner(
12064 conf: gaxi::options::ClientConfig,
12065 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionInstanceTemplates>>
12066 {
12067 if gaxi::options::tracing_enabled(&conf) {
12068 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12069 }
12070 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12071 }
12072
12073 async fn build_transport(
12074 conf: gaxi::options::ClientConfig,
12075 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceTemplates> {
12076 super::transport::RegionInstanceTemplates::new(conf).await
12077 }
12078
12079 async fn build_with_tracing(
12080 conf: gaxi::options::ClientConfig,
12081 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceTemplates> {
12082 Self::build_transport(conf)
12083 .await
12084 .map(super::tracing::RegionInstanceTemplates::new)
12085 }
12086
12087 /// Deletes the specified instance template. Deleting an instance template is
12088 /// permanent and cannot be undone.
12089 pub fn delete(&self) -> super::builder::region_instance_templates::Delete {
12090 super::builder::region_instance_templates::Delete::new(self.inner.clone())
12091 }
12092
12093 /// Returns the specified instance template.
12094 pub fn get(&self) -> super::builder::region_instance_templates::Get {
12095 super::builder::region_instance_templates::Get::new(self.inner.clone())
12096 }
12097
12098 /// Creates an instance template in the specified project and region using the
12099 /// global instance template whose URL is included in the request.
12100 pub fn insert(&self) -> super::builder::region_instance_templates::Insert {
12101 super::builder::region_instance_templates::Insert::new(self.inner.clone())
12102 }
12103
12104 /// Retrieves a list of instance templates that are contained within the
12105 /// specified project and region.
12106 pub fn list(&self) -> super::builder::region_instance_templates::List {
12107 super::builder::region_instance_templates::List::new(self.inner.clone())
12108 }
12109
12110 /// Retrieves the specified region-specific Operations resource.
12111 pub fn get_operation(&self) -> super::builder::region_instance_templates::GetOperation {
12112 super::builder::region_instance_templates::GetOperation::new(self.inner.clone())
12113 }
12114}
12115
12116/// Implements a client for the Google Compute Engine API.
12117///
12118/// # Example
12119/// ```
12120/// # use google_cloud_compute_v1::client::RegionInstances;
12121/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
12122/// let client = RegionInstances::builder().build().await?;
12123/// // use `client` to make requests to the Google Compute Engine API.
12124/// # Ok(()) }
12125/// ```
12126///
12127/// # Service Description
12128///
12129/// Service for the `regionInstances` resource.
12130///
12131/// # Configuration
12132///
12133/// To configure `RegionInstances` use the `with_*` methods in the type returned
12134/// by [builder()][RegionInstances::builder]. The default configuration should
12135/// work for most applications. Common configuration changes include
12136///
12137/// * [with_endpoint()]: by default this client uses the global default endpoint
12138/// (`https://compute.googleapis.com`). Applications using regional
12139/// endpoints or running in restricted networks (e.g. a network configured
12140// with [Private Google Access with VPC Service Controls]) may want to
12141/// override this default.
12142/// * [with_credentials()]: by default this client uses
12143/// [Application Default Credentials]. Applications using custom
12144/// authentication may need to override this default.
12145///
12146/// [with_endpoint()]: super::builder::region_instances::ClientBuilder::with_endpoint
12147/// [with_credentials()]: super::builder::region_instances::ClientBuilder::with_credentials
12148/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12149/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12150///
12151/// # Pooling and Cloning
12152///
12153/// `RegionInstances` holds a connection pool internally, it is advised to
12154/// create one and reuse it. You do not need to wrap `RegionInstances` in
12155/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12156/// already uses an `Arc` internally.
12157#[cfg(feature = "region-instances")]
12158#[cfg_attr(docsrs, doc(cfg(feature = "region-instances")))]
12159#[derive(Clone, Debug)]
12160pub struct RegionInstances {
12161 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstances>,
12162}
12163
12164#[cfg(feature = "region-instances")]
12165impl RegionInstances {
12166 /// Returns a builder for [RegionInstances].
12167 ///
12168 /// ```
12169 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12170 /// # use google_cloud_compute_v1::client::RegionInstances;
12171 /// let client = RegionInstances::builder().build().await?;
12172 /// # Ok(()) }
12173 /// ```
12174 pub fn builder() -> super::builder::region_instances::ClientBuilder {
12175 crate::new_client_builder(super::builder::region_instances::client::Factory)
12176 }
12177
12178 /// Creates a new client from the provided stub.
12179 ///
12180 /// The most common case for calling this function is in tests mocking the
12181 /// client's behavior.
12182 pub fn from_stub<T>(stub: T) -> Self
12183 where
12184 T: super::stub::RegionInstances + 'static,
12185 {
12186 Self {
12187 inner: std::sync::Arc::new(stub),
12188 }
12189 }
12190
12191 pub(crate) async fn new(
12192 config: gaxi::options::ClientConfig,
12193 ) -> crate::ClientBuilderResult<Self> {
12194 let inner = Self::build_inner(config).await?;
12195 Ok(Self { inner })
12196 }
12197
12198 async fn build_inner(
12199 conf: gaxi::options::ClientConfig,
12200 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionInstances>> {
12201 if gaxi::options::tracing_enabled(&conf) {
12202 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12203 }
12204 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12205 }
12206
12207 async fn build_transport(
12208 conf: gaxi::options::ClientConfig,
12209 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstances> {
12210 super::transport::RegionInstances::new(conf).await
12211 }
12212
12213 async fn build_with_tracing(
12214 conf: gaxi::options::ClientConfig,
12215 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstances> {
12216 Self::build_transport(conf)
12217 .await
12218 .map(super::tracing::RegionInstances::new)
12219 }
12220
12221 /// Creates multiple instances in a given region. Count specifies the number of
12222 /// instances to create.
12223 pub fn bulk_insert(&self) -> super::builder::region_instances::BulkInsert {
12224 super::builder::region_instances::BulkInsert::new(self.inner.clone())
12225 }
12226
12227 /// Retrieves the specified region-specific Operations resource.
12228 pub fn get_operation(&self) -> super::builder::region_instances::GetOperation {
12229 super::builder::region_instances::GetOperation::new(self.inner.clone())
12230 }
12231}
12232
12233/// Implements a client for the Google Compute Engine API.
12234///
12235/// # Example
12236/// ```
12237/// # use google_cloud_compute_v1::client::RegionInstantSnapshots;
12238/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
12239/// let client = RegionInstantSnapshots::builder().build().await?;
12240/// // use `client` to make requests to the Google Compute Engine API.
12241/// # Ok(()) }
12242/// ```
12243///
12244/// # Service Description
12245///
12246/// Service for the `regionInstantSnapshots` resource.
12247///
12248/// # Configuration
12249///
12250/// To configure `RegionInstantSnapshots` use the `with_*` methods in the type returned
12251/// by [builder()][RegionInstantSnapshots::builder]. The default configuration should
12252/// work for most applications. Common configuration changes include
12253///
12254/// * [with_endpoint()]: by default this client uses the global default endpoint
12255/// (`https://compute.googleapis.com`). Applications using regional
12256/// endpoints or running in restricted networks (e.g. a network configured
12257// with [Private Google Access with VPC Service Controls]) may want to
12258/// override this default.
12259/// * [with_credentials()]: by default this client uses
12260/// [Application Default Credentials]. Applications using custom
12261/// authentication may need to override this default.
12262///
12263/// [with_endpoint()]: super::builder::region_instant_snapshots::ClientBuilder::with_endpoint
12264/// [with_credentials()]: super::builder::region_instant_snapshots::ClientBuilder::with_credentials
12265/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12266/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12267///
12268/// # Pooling and Cloning
12269///
12270/// `RegionInstantSnapshots` holds a connection pool internally, it is advised to
12271/// create one and reuse it. You do not need to wrap `RegionInstantSnapshots` in
12272/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12273/// already uses an `Arc` internally.
12274#[cfg(feature = "region-instant-snapshots")]
12275#[cfg_attr(docsrs, doc(cfg(feature = "region-instant-snapshots")))]
12276#[derive(Clone, Debug)]
12277pub struct RegionInstantSnapshots {
12278 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstantSnapshots>,
12279}
12280
12281#[cfg(feature = "region-instant-snapshots")]
12282impl RegionInstantSnapshots {
12283 /// Returns a builder for [RegionInstantSnapshots].
12284 ///
12285 /// ```
12286 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12287 /// # use google_cloud_compute_v1::client::RegionInstantSnapshots;
12288 /// let client = RegionInstantSnapshots::builder().build().await?;
12289 /// # Ok(()) }
12290 /// ```
12291 pub fn builder() -> super::builder::region_instant_snapshots::ClientBuilder {
12292 crate::new_client_builder(super::builder::region_instant_snapshots::client::Factory)
12293 }
12294
12295 /// Creates a new client from the provided stub.
12296 ///
12297 /// The most common case for calling this function is in tests mocking the
12298 /// client's behavior.
12299 pub fn from_stub<T>(stub: T) -> Self
12300 where
12301 T: super::stub::RegionInstantSnapshots + 'static,
12302 {
12303 Self {
12304 inner: std::sync::Arc::new(stub),
12305 }
12306 }
12307
12308 pub(crate) async fn new(
12309 config: gaxi::options::ClientConfig,
12310 ) -> crate::ClientBuilderResult<Self> {
12311 let inner = Self::build_inner(config).await?;
12312 Ok(Self { inner })
12313 }
12314
12315 async fn build_inner(
12316 conf: gaxi::options::ClientConfig,
12317 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionInstantSnapshots>>
12318 {
12319 if gaxi::options::tracing_enabled(&conf) {
12320 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12321 }
12322 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12323 }
12324
12325 async fn build_transport(
12326 conf: gaxi::options::ClientConfig,
12327 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstantSnapshots> {
12328 super::transport::RegionInstantSnapshots::new(conf).await
12329 }
12330
12331 async fn build_with_tracing(
12332 conf: gaxi::options::ClientConfig,
12333 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstantSnapshots> {
12334 Self::build_transport(conf)
12335 .await
12336 .map(super::tracing::RegionInstantSnapshots::new)
12337 }
12338
12339 /// Deletes the specified InstantSnapshot resource. Keep in mind that deleting
12340 /// a single instantSnapshot might not necessarily delete all the data on that
12341 /// instantSnapshot. If any data on the instantSnapshot that is marked for
12342 /// deletion is needed for subsequent instantSnapshots, the data will be moved
12343 /// to the next corresponding instantSnapshot.
12344 ///
12345 /// For more information, seeDeleting
12346 /// instantSnapshots.
12347 pub fn delete(&self) -> super::builder::region_instant_snapshots::Delete {
12348 super::builder::region_instant_snapshots::Delete::new(self.inner.clone())
12349 }
12350
12351 /// Returns the specified InstantSnapshot resource in the specified region.
12352 pub fn get(&self) -> super::builder::region_instant_snapshots::Get {
12353 super::builder::region_instant_snapshots::Get::new(self.inner.clone())
12354 }
12355
12356 /// Gets the access control policy for a resource. May be empty if no such
12357 /// policy or resource exists.
12358 pub fn get_iam_policy(&self) -> super::builder::region_instant_snapshots::GetIamPolicy {
12359 super::builder::region_instant_snapshots::GetIamPolicy::new(self.inner.clone())
12360 }
12361
12362 /// Creates an instant snapshot in the specified region.
12363 pub fn insert(&self) -> super::builder::region_instant_snapshots::Insert {
12364 super::builder::region_instant_snapshots::Insert::new(self.inner.clone())
12365 }
12366
12367 /// Retrieves the list of InstantSnapshot resources contained within
12368 /// the specified region.
12369 pub fn list(&self) -> super::builder::region_instant_snapshots::List {
12370 super::builder::region_instant_snapshots::List::new(self.inner.clone())
12371 }
12372
12373 /// Sets the access control policy on the specified resource.
12374 /// Replaces any existing policy.
12375 pub fn set_iam_policy(&self) -> super::builder::region_instant_snapshots::SetIamPolicy {
12376 super::builder::region_instant_snapshots::SetIamPolicy::new(self.inner.clone())
12377 }
12378
12379 /// Sets the labels on a instantSnapshot in the given region. To learn more
12380 /// about labels, read the Labeling
12381 /// Resources documentation.
12382 pub fn set_labels(&self) -> super::builder::region_instant_snapshots::SetLabels {
12383 super::builder::region_instant_snapshots::SetLabels::new(self.inner.clone())
12384 }
12385
12386 /// Returns permissions that a caller has on the specified resource.
12387 pub fn test_iam_permissions(
12388 &self,
12389 ) -> super::builder::region_instant_snapshots::TestIamPermissions {
12390 super::builder::region_instant_snapshots::TestIamPermissions::new(self.inner.clone())
12391 }
12392
12393 /// Retrieves the specified region-specific Operations resource.
12394 pub fn get_operation(&self) -> super::builder::region_instant_snapshots::GetOperation {
12395 super::builder::region_instant_snapshots::GetOperation::new(self.inner.clone())
12396 }
12397}
12398
12399/// Implements a client for the Google Compute Engine API.
12400///
12401/// # Example
12402/// ```
12403/// # use google_cloud_compute_v1::client::RegionNetworkEndpointGroups;
12404/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
12405/// let client = RegionNetworkEndpointGroups::builder().build().await?;
12406/// // use `client` to make requests to the Google Compute Engine API.
12407/// # Ok(()) }
12408/// ```
12409///
12410/// # Service Description
12411///
12412/// Service for the `regionNetworkEndpointGroups` resource.
12413///
12414/// # Configuration
12415///
12416/// To configure `RegionNetworkEndpointGroups` use the `with_*` methods in the type returned
12417/// by [builder()][RegionNetworkEndpointGroups::builder]. The default configuration should
12418/// work for most applications. Common configuration changes include
12419///
12420/// * [with_endpoint()]: by default this client uses the global default endpoint
12421/// (`https://compute.googleapis.com`). Applications using regional
12422/// endpoints or running in restricted networks (e.g. a network configured
12423// with [Private Google Access with VPC Service Controls]) may want to
12424/// override this default.
12425/// * [with_credentials()]: by default this client uses
12426/// [Application Default Credentials]. Applications using custom
12427/// authentication may need to override this default.
12428///
12429/// [with_endpoint()]: super::builder::region_network_endpoint_groups::ClientBuilder::with_endpoint
12430/// [with_credentials()]: super::builder::region_network_endpoint_groups::ClientBuilder::with_credentials
12431/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12432/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12433///
12434/// # Pooling and Cloning
12435///
12436/// `RegionNetworkEndpointGroups` holds a connection pool internally, it is advised to
12437/// create one and reuse it. You do not need to wrap `RegionNetworkEndpointGroups` in
12438/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12439/// already uses an `Arc` internally.
12440#[cfg(feature = "region-network-endpoint-groups")]
12441#[cfg_attr(docsrs, doc(cfg(feature = "region-network-endpoint-groups")))]
12442#[derive(Clone, Debug)]
12443pub struct RegionNetworkEndpointGroups {
12444 inner: std::sync::Arc<dyn super::stub::dynamic::RegionNetworkEndpointGroups>,
12445}
12446
12447#[cfg(feature = "region-network-endpoint-groups")]
12448impl RegionNetworkEndpointGroups {
12449 /// Returns a builder for [RegionNetworkEndpointGroups].
12450 ///
12451 /// ```
12452 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12453 /// # use google_cloud_compute_v1::client::RegionNetworkEndpointGroups;
12454 /// let client = RegionNetworkEndpointGroups::builder().build().await?;
12455 /// # Ok(()) }
12456 /// ```
12457 pub fn builder() -> super::builder::region_network_endpoint_groups::ClientBuilder {
12458 crate::new_client_builder(super::builder::region_network_endpoint_groups::client::Factory)
12459 }
12460
12461 /// Creates a new client from the provided stub.
12462 ///
12463 /// The most common case for calling this function is in tests mocking the
12464 /// client's behavior.
12465 pub fn from_stub<T>(stub: T) -> Self
12466 where
12467 T: super::stub::RegionNetworkEndpointGroups + 'static,
12468 {
12469 Self {
12470 inner: std::sync::Arc::new(stub),
12471 }
12472 }
12473
12474 pub(crate) async fn new(
12475 config: gaxi::options::ClientConfig,
12476 ) -> crate::ClientBuilderResult<Self> {
12477 let inner = Self::build_inner(config).await?;
12478 Ok(Self { inner })
12479 }
12480
12481 async fn build_inner(
12482 conf: gaxi::options::ClientConfig,
12483 ) -> crate::ClientBuilderResult<
12484 std::sync::Arc<dyn super::stub::dynamic::RegionNetworkEndpointGroups>,
12485 > {
12486 if gaxi::options::tracing_enabled(&conf) {
12487 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12488 }
12489 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12490 }
12491
12492 async fn build_transport(
12493 conf: gaxi::options::ClientConfig,
12494 ) -> crate::ClientBuilderResult<impl super::stub::RegionNetworkEndpointGroups> {
12495 super::transport::RegionNetworkEndpointGroups::new(conf).await
12496 }
12497
12498 async fn build_with_tracing(
12499 conf: gaxi::options::ClientConfig,
12500 ) -> crate::ClientBuilderResult<impl super::stub::RegionNetworkEndpointGroups> {
12501 Self::build_transport(conf)
12502 .await
12503 .map(super::tracing::RegionNetworkEndpointGroups::new)
12504 }
12505
12506 /// Attach a list of network endpoints to the specified network endpoint group.
12507 pub fn attach_network_endpoints(
12508 &self,
12509 ) -> super::builder::region_network_endpoint_groups::AttachNetworkEndpoints {
12510 super::builder::region_network_endpoint_groups::AttachNetworkEndpoints::new(
12511 self.inner.clone(),
12512 )
12513 }
12514
12515 /// Deletes the specified network endpoint group. Note that the NEG cannot be
12516 /// deleted if it is configured as a backend of a backend service.
12517 pub fn delete(&self) -> super::builder::region_network_endpoint_groups::Delete {
12518 super::builder::region_network_endpoint_groups::Delete::new(self.inner.clone())
12519 }
12520
12521 /// Detach the network endpoint from the specified network endpoint group.
12522 pub fn detach_network_endpoints(
12523 &self,
12524 ) -> super::builder::region_network_endpoint_groups::DetachNetworkEndpoints {
12525 super::builder::region_network_endpoint_groups::DetachNetworkEndpoints::new(
12526 self.inner.clone(),
12527 )
12528 }
12529
12530 /// Returns the specified network endpoint group.
12531 pub fn get(&self) -> super::builder::region_network_endpoint_groups::Get {
12532 super::builder::region_network_endpoint_groups::Get::new(self.inner.clone())
12533 }
12534
12535 /// Creates a network endpoint group in the specified project using the
12536 /// parameters that are included in the request.
12537 ///
12538 /// Note: Use the following APIs to manage network endpoint groups:
12539 ///
12540 /// - To manage NEGs with zonal scope (such as zonal NEGs, hybrid connectivity
12541 /// NEGs): zonal
12542 /// API
12543 /// - To manage NEGs with regional scope (such as regional internet NEGs,
12544 /// serverless NEGs, Private Service Connect NEGs): regional
12545 /// API
12546 /// - To manage NEGs with global scope (such as global internet NEGs):global
12547 /// API
12548 pub fn insert(&self) -> super::builder::region_network_endpoint_groups::Insert {
12549 super::builder::region_network_endpoint_groups::Insert::new(self.inner.clone())
12550 }
12551
12552 /// Retrieves the list of regional network endpoint groups available to the
12553 /// specified project in the given region.
12554 pub fn list(&self) -> super::builder::region_network_endpoint_groups::List {
12555 super::builder::region_network_endpoint_groups::List::new(self.inner.clone())
12556 }
12557
12558 /// Lists the network endpoints in the specified network endpoint group.
12559 pub fn list_network_endpoints(
12560 &self,
12561 ) -> super::builder::region_network_endpoint_groups::ListNetworkEndpoints {
12562 super::builder::region_network_endpoint_groups::ListNetworkEndpoints::new(
12563 self.inner.clone(),
12564 )
12565 }
12566
12567 /// Retrieves the specified region-specific Operations resource.
12568 pub fn get_operation(&self) -> super::builder::region_network_endpoint_groups::GetOperation {
12569 super::builder::region_network_endpoint_groups::GetOperation::new(self.inner.clone())
12570 }
12571}
12572
12573/// Implements a client for the Google Compute Engine API.
12574///
12575/// # Example
12576/// ```
12577/// # use google_cloud_compute_v1::client::RegionNetworkFirewallPolicies;
12578/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
12579/// let client = RegionNetworkFirewallPolicies::builder().build().await?;
12580/// // use `client` to make requests to the Google Compute Engine API.
12581/// # Ok(()) }
12582/// ```
12583///
12584/// # Service Description
12585///
12586/// Service for the `regionNetworkFirewallPolicies` resource.
12587///
12588/// # Configuration
12589///
12590/// To configure `RegionNetworkFirewallPolicies` use the `with_*` methods in the type returned
12591/// by [builder()][RegionNetworkFirewallPolicies::builder]. The default configuration should
12592/// work for most applications. Common configuration changes include
12593///
12594/// * [with_endpoint()]: by default this client uses the global default endpoint
12595/// (`https://compute.googleapis.com`). Applications using regional
12596/// endpoints or running in restricted networks (e.g. a network configured
12597// with [Private Google Access with VPC Service Controls]) may want to
12598/// override this default.
12599/// * [with_credentials()]: by default this client uses
12600/// [Application Default Credentials]. Applications using custom
12601/// authentication may need to override this default.
12602///
12603/// [with_endpoint()]: super::builder::region_network_firewall_policies::ClientBuilder::with_endpoint
12604/// [with_credentials()]: super::builder::region_network_firewall_policies::ClientBuilder::with_credentials
12605/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12606/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12607///
12608/// # Pooling and Cloning
12609///
12610/// `RegionNetworkFirewallPolicies` holds a connection pool internally, it is advised to
12611/// create one and reuse it. You do not need to wrap `RegionNetworkFirewallPolicies` in
12612/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12613/// already uses an `Arc` internally.
12614#[cfg(feature = "region-network-firewall-policies")]
12615#[cfg_attr(docsrs, doc(cfg(feature = "region-network-firewall-policies")))]
12616#[derive(Clone, Debug)]
12617pub struct RegionNetworkFirewallPolicies {
12618 inner: std::sync::Arc<dyn super::stub::dynamic::RegionNetworkFirewallPolicies>,
12619}
12620
12621#[cfg(feature = "region-network-firewall-policies")]
12622impl RegionNetworkFirewallPolicies {
12623 /// Returns a builder for [RegionNetworkFirewallPolicies].
12624 ///
12625 /// ```
12626 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12627 /// # use google_cloud_compute_v1::client::RegionNetworkFirewallPolicies;
12628 /// let client = RegionNetworkFirewallPolicies::builder().build().await?;
12629 /// # Ok(()) }
12630 /// ```
12631 pub fn builder() -> super::builder::region_network_firewall_policies::ClientBuilder {
12632 crate::new_client_builder(super::builder::region_network_firewall_policies::client::Factory)
12633 }
12634
12635 /// Creates a new client from the provided stub.
12636 ///
12637 /// The most common case for calling this function is in tests mocking the
12638 /// client's behavior.
12639 pub fn from_stub<T>(stub: T) -> Self
12640 where
12641 T: super::stub::RegionNetworkFirewallPolicies + 'static,
12642 {
12643 Self {
12644 inner: std::sync::Arc::new(stub),
12645 }
12646 }
12647
12648 pub(crate) async fn new(
12649 config: gaxi::options::ClientConfig,
12650 ) -> crate::ClientBuilderResult<Self> {
12651 let inner = Self::build_inner(config).await?;
12652 Ok(Self { inner })
12653 }
12654
12655 async fn build_inner(
12656 conf: gaxi::options::ClientConfig,
12657 ) -> crate::ClientBuilderResult<
12658 std::sync::Arc<dyn super::stub::dynamic::RegionNetworkFirewallPolicies>,
12659 > {
12660 if gaxi::options::tracing_enabled(&conf) {
12661 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12662 }
12663 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12664 }
12665
12666 async fn build_transport(
12667 conf: gaxi::options::ClientConfig,
12668 ) -> crate::ClientBuilderResult<impl super::stub::RegionNetworkFirewallPolicies> {
12669 super::transport::RegionNetworkFirewallPolicies::new(conf).await
12670 }
12671
12672 async fn build_with_tracing(
12673 conf: gaxi::options::ClientConfig,
12674 ) -> crate::ClientBuilderResult<impl super::stub::RegionNetworkFirewallPolicies> {
12675 Self::build_transport(conf)
12676 .await
12677 .map(super::tracing::RegionNetworkFirewallPolicies::new)
12678 }
12679
12680 /// Inserts an association for the specified network firewall policy.
12681 pub fn add_association(
12682 &self,
12683 ) -> super::builder::region_network_firewall_policies::AddAssociation {
12684 super::builder::region_network_firewall_policies::AddAssociation::new(self.inner.clone())
12685 }
12686
12687 /// Inserts a rule into a network firewall policy.
12688 pub fn add_rule(&self) -> super::builder::region_network_firewall_policies::AddRule {
12689 super::builder::region_network_firewall_policies::AddRule::new(self.inner.clone())
12690 }
12691
12692 /// Copies rules to the specified network firewall policy.
12693 pub fn clone_rules(&self) -> super::builder::region_network_firewall_policies::CloneRules {
12694 super::builder::region_network_firewall_policies::CloneRules::new(self.inner.clone())
12695 }
12696
12697 /// Deletes the specified network firewall policy.
12698 pub fn delete(&self) -> super::builder::region_network_firewall_policies::Delete {
12699 super::builder::region_network_firewall_policies::Delete::new(self.inner.clone())
12700 }
12701
12702 /// Returns the specified network firewall policy.
12703 pub fn get(&self) -> super::builder::region_network_firewall_policies::Get {
12704 super::builder::region_network_firewall_policies::Get::new(self.inner.clone())
12705 }
12706
12707 /// Gets an association with the specified name.
12708 pub fn get_association(
12709 &self,
12710 ) -> super::builder::region_network_firewall_policies::GetAssociation {
12711 super::builder::region_network_firewall_policies::GetAssociation::new(self.inner.clone())
12712 }
12713
12714 /// Returns the effective firewalls on a given network.
12715 pub fn get_effective_firewalls(
12716 &self,
12717 ) -> super::builder::region_network_firewall_policies::GetEffectiveFirewalls {
12718 super::builder::region_network_firewall_policies::GetEffectiveFirewalls::new(
12719 self.inner.clone(),
12720 )
12721 }
12722
12723 /// Gets the access control policy for a resource. May be empty if no such
12724 /// policy or resource exists.
12725 pub fn get_iam_policy(&self) -> super::builder::region_network_firewall_policies::GetIamPolicy {
12726 super::builder::region_network_firewall_policies::GetIamPolicy::new(self.inner.clone())
12727 }
12728
12729 /// Gets a rule of the specified priority.
12730 pub fn get_rule(&self) -> super::builder::region_network_firewall_policies::GetRule {
12731 super::builder::region_network_firewall_policies::GetRule::new(self.inner.clone())
12732 }
12733
12734 /// Creates a new network firewall policy in the specified project and region.
12735 pub fn insert(&self) -> super::builder::region_network_firewall_policies::Insert {
12736 super::builder::region_network_firewall_policies::Insert::new(self.inner.clone())
12737 }
12738
12739 /// Lists all the network firewall policies that have been configured
12740 /// for the specified project in the given region.
12741 pub fn list(&self) -> super::builder::region_network_firewall_policies::List {
12742 super::builder::region_network_firewall_policies::List::new(self.inner.clone())
12743 }
12744
12745 /// Patches the specified network firewall policy.
12746 pub fn patch(&self) -> super::builder::region_network_firewall_policies::Patch {
12747 super::builder::region_network_firewall_policies::Patch::new(self.inner.clone())
12748 }
12749
12750 /// Patches a rule of the specified priority.
12751 pub fn patch_rule(&self) -> super::builder::region_network_firewall_policies::PatchRule {
12752 super::builder::region_network_firewall_policies::PatchRule::new(self.inner.clone())
12753 }
12754
12755 /// Removes an association for the specified network firewall policy.
12756 pub fn remove_association(
12757 &self,
12758 ) -> super::builder::region_network_firewall_policies::RemoveAssociation {
12759 super::builder::region_network_firewall_policies::RemoveAssociation::new(self.inner.clone())
12760 }
12761
12762 /// Deletes a rule of the specified priority.
12763 pub fn remove_rule(&self) -> super::builder::region_network_firewall_policies::RemoveRule {
12764 super::builder::region_network_firewall_policies::RemoveRule::new(self.inner.clone())
12765 }
12766
12767 /// Sets the access control policy on the specified resource.
12768 /// Replaces any existing policy.
12769 pub fn set_iam_policy(&self) -> super::builder::region_network_firewall_policies::SetIamPolicy {
12770 super::builder::region_network_firewall_policies::SetIamPolicy::new(self.inner.clone())
12771 }
12772
12773 /// Returns permissions that a caller has on the specified resource.
12774 pub fn test_iam_permissions(
12775 &self,
12776 ) -> super::builder::region_network_firewall_policies::TestIamPermissions {
12777 super::builder::region_network_firewall_policies::TestIamPermissions::new(
12778 self.inner.clone(),
12779 )
12780 }
12781
12782 /// Retrieves the specified region-specific Operations resource.
12783 pub fn get_operation(&self) -> super::builder::region_network_firewall_policies::GetOperation {
12784 super::builder::region_network_firewall_policies::GetOperation::new(self.inner.clone())
12785 }
12786}
12787
12788/// Implements a client for the Google Compute Engine API.
12789///
12790/// # Example
12791/// ```
12792/// # use google_cloud_compute_v1::client::RegionNotificationEndpoints;
12793/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
12794/// let client = RegionNotificationEndpoints::builder().build().await?;
12795/// // use `client` to make requests to the Google Compute Engine API.
12796/// # Ok(()) }
12797/// ```
12798///
12799/// # Service Description
12800///
12801/// Service for the `regionNotificationEndpoints` resource.
12802///
12803/// # Configuration
12804///
12805/// To configure `RegionNotificationEndpoints` use the `with_*` methods in the type returned
12806/// by [builder()][RegionNotificationEndpoints::builder]. The default configuration should
12807/// work for most applications. Common configuration changes include
12808///
12809/// * [with_endpoint()]: by default this client uses the global default endpoint
12810/// (`https://compute.googleapis.com`). Applications using regional
12811/// endpoints or running in restricted networks (e.g. a network configured
12812// with [Private Google Access with VPC Service Controls]) may want to
12813/// override this default.
12814/// * [with_credentials()]: by default this client uses
12815/// [Application Default Credentials]. Applications using custom
12816/// authentication may need to override this default.
12817///
12818/// [with_endpoint()]: super::builder::region_notification_endpoints::ClientBuilder::with_endpoint
12819/// [with_credentials()]: super::builder::region_notification_endpoints::ClientBuilder::with_credentials
12820/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12821/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12822///
12823/// # Pooling and Cloning
12824///
12825/// `RegionNotificationEndpoints` holds a connection pool internally, it is advised to
12826/// create one and reuse it. You do not need to wrap `RegionNotificationEndpoints` in
12827/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12828/// already uses an `Arc` internally.
12829#[cfg(feature = "region-notification-endpoints")]
12830#[cfg_attr(docsrs, doc(cfg(feature = "region-notification-endpoints")))]
12831#[derive(Clone, Debug)]
12832pub struct RegionNotificationEndpoints {
12833 inner: std::sync::Arc<dyn super::stub::dynamic::RegionNotificationEndpoints>,
12834}
12835
12836#[cfg(feature = "region-notification-endpoints")]
12837impl RegionNotificationEndpoints {
12838 /// Returns a builder for [RegionNotificationEndpoints].
12839 ///
12840 /// ```
12841 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12842 /// # use google_cloud_compute_v1::client::RegionNotificationEndpoints;
12843 /// let client = RegionNotificationEndpoints::builder().build().await?;
12844 /// # Ok(()) }
12845 /// ```
12846 pub fn builder() -> super::builder::region_notification_endpoints::ClientBuilder {
12847 crate::new_client_builder(super::builder::region_notification_endpoints::client::Factory)
12848 }
12849
12850 /// Creates a new client from the provided stub.
12851 ///
12852 /// The most common case for calling this function is in tests mocking the
12853 /// client's behavior.
12854 pub fn from_stub<T>(stub: T) -> Self
12855 where
12856 T: super::stub::RegionNotificationEndpoints + 'static,
12857 {
12858 Self {
12859 inner: std::sync::Arc::new(stub),
12860 }
12861 }
12862
12863 pub(crate) async fn new(
12864 config: gaxi::options::ClientConfig,
12865 ) -> crate::ClientBuilderResult<Self> {
12866 let inner = Self::build_inner(config).await?;
12867 Ok(Self { inner })
12868 }
12869
12870 async fn build_inner(
12871 conf: gaxi::options::ClientConfig,
12872 ) -> crate::ClientBuilderResult<
12873 std::sync::Arc<dyn super::stub::dynamic::RegionNotificationEndpoints>,
12874 > {
12875 if gaxi::options::tracing_enabled(&conf) {
12876 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12877 }
12878 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12879 }
12880
12881 async fn build_transport(
12882 conf: gaxi::options::ClientConfig,
12883 ) -> crate::ClientBuilderResult<impl super::stub::RegionNotificationEndpoints> {
12884 super::transport::RegionNotificationEndpoints::new(conf).await
12885 }
12886
12887 async fn build_with_tracing(
12888 conf: gaxi::options::ClientConfig,
12889 ) -> crate::ClientBuilderResult<impl super::stub::RegionNotificationEndpoints> {
12890 Self::build_transport(conf)
12891 .await
12892 .map(super::tracing::RegionNotificationEndpoints::new)
12893 }
12894
12895 /// Retrieves the list of all NotificationEndpoint resources,
12896 /// regional and global, available to the specified project.
12897 pub fn aggregated_list(&self) -> super::builder::region_notification_endpoints::AggregatedList {
12898 super::builder::region_notification_endpoints::AggregatedList::new(self.inner.clone())
12899 }
12900
12901 /// Deletes the specified NotificationEndpoint in the given region
12902 pub fn delete(&self) -> super::builder::region_notification_endpoints::Delete {
12903 super::builder::region_notification_endpoints::Delete::new(self.inner.clone())
12904 }
12905
12906 /// Returns the specified NotificationEndpoint resource in the given region.
12907 pub fn get(&self) -> super::builder::region_notification_endpoints::Get {
12908 super::builder::region_notification_endpoints::Get::new(self.inner.clone())
12909 }
12910
12911 /// Create a NotificationEndpoint in the specified project in the given region
12912 /// using the parameters that are included in the request.
12913 pub fn insert(&self) -> super::builder::region_notification_endpoints::Insert {
12914 super::builder::region_notification_endpoints::Insert::new(self.inner.clone())
12915 }
12916
12917 /// Lists the NotificationEndpoints for a project in the given region.
12918 pub fn list(&self) -> super::builder::region_notification_endpoints::List {
12919 super::builder::region_notification_endpoints::List::new(self.inner.clone())
12920 }
12921
12922 /// Returns permissions that a caller has on the specified resource.
12923 pub fn test_iam_permissions(
12924 &self,
12925 ) -> super::builder::region_notification_endpoints::TestIamPermissions {
12926 super::builder::region_notification_endpoints::TestIamPermissions::new(self.inner.clone())
12927 }
12928
12929 /// Retrieves the specified region-specific Operations resource.
12930 pub fn get_operation(&self) -> super::builder::region_notification_endpoints::GetOperation {
12931 super::builder::region_notification_endpoints::GetOperation::new(self.inner.clone())
12932 }
12933}
12934
12935/// Implements a client for the Google Compute Engine API.
12936///
12937/// # Example
12938/// ```
12939/// # use google_cloud_compute_v1::client::RegionOperations;
12940/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
12941/// let client = RegionOperations::builder().build().await?;
12942/// // use `client` to make requests to the Google Compute Engine API.
12943/// # Ok(()) }
12944/// ```
12945///
12946/// # Service Description
12947///
12948/// Service for the `regionOperations` resource.
12949///
12950/// # Configuration
12951///
12952/// To configure `RegionOperations` use the `with_*` methods in the type returned
12953/// by [builder()][RegionOperations::builder]. The default configuration should
12954/// work for most applications. Common configuration changes include
12955///
12956/// * [with_endpoint()]: by default this client uses the global default endpoint
12957/// (`https://compute.googleapis.com`). Applications using regional
12958/// endpoints or running in restricted networks (e.g. a network configured
12959// with [Private Google Access with VPC Service Controls]) may want to
12960/// override this default.
12961/// * [with_credentials()]: by default this client uses
12962/// [Application Default Credentials]. Applications using custom
12963/// authentication may need to override this default.
12964///
12965/// [with_endpoint()]: super::builder::region_operations::ClientBuilder::with_endpoint
12966/// [with_credentials()]: super::builder::region_operations::ClientBuilder::with_credentials
12967/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12968/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12969///
12970/// # Pooling and Cloning
12971///
12972/// `RegionOperations` holds a connection pool internally, it is advised to
12973/// create one and reuse it. You do not need to wrap `RegionOperations` in
12974/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12975/// already uses an `Arc` internally.
12976#[cfg(feature = "region-operations")]
12977#[cfg_attr(docsrs, doc(cfg(feature = "region-operations")))]
12978#[derive(Clone, Debug)]
12979pub struct RegionOperations {
12980 inner: std::sync::Arc<dyn super::stub::dynamic::RegionOperations>,
12981}
12982
12983#[cfg(feature = "region-operations")]
12984impl RegionOperations {
12985 /// Returns a builder for [RegionOperations].
12986 ///
12987 /// ```
12988 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12989 /// # use google_cloud_compute_v1::client::RegionOperations;
12990 /// let client = RegionOperations::builder().build().await?;
12991 /// # Ok(()) }
12992 /// ```
12993 pub fn builder() -> super::builder::region_operations::ClientBuilder {
12994 crate::new_client_builder(super::builder::region_operations::client::Factory)
12995 }
12996
12997 /// Creates a new client from the provided stub.
12998 ///
12999 /// The most common case for calling this function is in tests mocking the
13000 /// client's behavior.
13001 pub fn from_stub<T>(stub: T) -> Self
13002 where
13003 T: super::stub::RegionOperations + 'static,
13004 {
13005 Self {
13006 inner: std::sync::Arc::new(stub),
13007 }
13008 }
13009
13010 pub(crate) async fn new(
13011 config: gaxi::options::ClientConfig,
13012 ) -> crate::ClientBuilderResult<Self> {
13013 let inner = Self::build_inner(config).await?;
13014 Ok(Self { inner })
13015 }
13016
13017 async fn build_inner(
13018 conf: gaxi::options::ClientConfig,
13019 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionOperations>>
13020 {
13021 if gaxi::options::tracing_enabled(&conf) {
13022 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13023 }
13024 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13025 }
13026
13027 async fn build_transport(
13028 conf: gaxi::options::ClientConfig,
13029 ) -> crate::ClientBuilderResult<impl super::stub::RegionOperations> {
13030 super::transport::RegionOperations::new(conf).await
13031 }
13032
13033 async fn build_with_tracing(
13034 conf: gaxi::options::ClientConfig,
13035 ) -> crate::ClientBuilderResult<impl super::stub::RegionOperations> {
13036 Self::build_transport(conf)
13037 .await
13038 .map(super::tracing::RegionOperations::new)
13039 }
13040
13041 /// Deletes the specified region-specific Operations resource.
13042 pub fn delete(&self) -> super::builder::region_operations::Delete {
13043 super::builder::region_operations::Delete::new(self.inner.clone())
13044 }
13045
13046 /// Retrieves the specified region-specific Operations resource.
13047 pub fn get(&self) -> super::builder::region_operations::Get {
13048 super::builder::region_operations::Get::new(self.inner.clone())
13049 }
13050
13051 /// Retrieves a list of Operation resources contained within
13052 /// the specified region.
13053 pub fn list(&self) -> super::builder::region_operations::List {
13054 super::builder::region_operations::List::new(self.inner.clone())
13055 }
13056
13057 /// Waits for the specified Operation resource to return as `DONE`
13058 /// or for the request to approach the 2 minute deadline, and retrieves the
13059 /// specified Operation resource. This method differs from the
13060 /// `GET` method in that it waits for no more than the default
13061 /// deadline (2 minutes) and then returns the current state of the operation,
13062 /// which might be `DONE` or still in progress.
13063 ///
13064 /// This method is called on a best-effort basis. Specifically:
13065 ///
13066 /// ```norust
13067 /// - In uncommon cases, when the server is overloaded, the request might
13068 /// return before the default deadline is reached, or might return after zero
13069 /// seconds.
13070 /// ```
13071 ///
13072 /// - If the default deadline is reached, there is no guarantee that the
13073 /// operation is actually done when the method returns. Be prepared to retry
13074 /// if the operation is not `DONE`.
13075 pub fn wait(&self) -> super::builder::region_operations::Wait {
13076 super::builder::region_operations::Wait::new(self.inner.clone())
13077 }
13078}
13079
13080/// Implements a client for the Google Compute Engine API.
13081///
13082/// # Example
13083/// ```
13084/// # use google_cloud_compute_v1::client::RegionSecurityPolicies;
13085/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
13086/// let client = RegionSecurityPolicies::builder().build().await?;
13087/// // use `client` to make requests to the Google Compute Engine API.
13088/// # Ok(()) }
13089/// ```
13090///
13091/// # Service Description
13092///
13093/// Service for the `regionSecurityPolicies` resource.
13094///
13095/// # Configuration
13096///
13097/// To configure `RegionSecurityPolicies` use the `with_*` methods in the type returned
13098/// by [builder()][RegionSecurityPolicies::builder]. The default configuration should
13099/// work for most applications. Common configuration changes include
13100///
13101/// * [with_endpoint()]: by default this client uses the global default endpoint
13102/// (`https://compute.googleapis.com`). Applications using regional
13103/// endpoints or running in restricted networks (e.g. a network configured
13104// with [Private Google Access with VPC Service Controls]) may want to
13105/// override this default.
13106/// * [with_credentials()]: by default this client uses
13107/// [Application Default Credentials]. Applications using custom
13108/// authentication may need to override this default.
13109///
13110/// [with_endpoint()]: super::builder::region_security_policies::ClientBuilder::with_endpoint
13111/// [with_credentials()]: super::builder::region_security_policies::ClientBuilder::with_credentials
13112/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13113/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13114///
13115/// # Pooling and Cloning
13116///
13117/// `RegionSecurityPolicies` holds a connection pool internally, it is advised to
13118/// create one and reuse it. You do not need to wrap `RegionSecurityPolicies` in
13119/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13120/// already uses an `Arc` internally.
13121#[cfg(feature = "region-security-policies")]
13122#[cfg_attr(docsrs, doc(cfg(feature = "region-security-policies")))]
13123#[derive(Clone, Debug)]
13124pub struct RegionSecurityPolicies {
13125 inner: std::sync::Arc<dyn super::stub::dynamic::RegionSecurityPolicies>,
13126}
13127
13128#[cfg(feature = "region-security-policies")]
13129impl RegionSecurityPolicies {
13130 /// Returns a builder for [RegionSecurityPolicies].
13131 ///
13132 /// ```
13133 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13134 /// # use google_cloud_compute_v1::client::RegionSecurityPolicies;
13135 /// let client = RegionSecurityPolicies::builder().build().await?;
13136 /// # Ok(()) }
13137 /// ```
13138 pub fn builder() -> super::builder::region_security_policies::ClientBuilder {
13139 crate::new_client_builder(super::builder::region_security_policies::client::Factory)
13140 }
13141
13142 /// Creates a new client from the provided stub.
13143 ///
13144 /// The most common case for calling this function is in tests mocking the
13145 /// client's behavior.
13146 pub fn from_stub<T>(stub: T) -> Self
13147 where
13148 T: super::stub::RegionSecurityPolicies + 'static,
13149 {
13150 Self {
13151 inner: std::sync::Arc::new(stub),
13152 }
13153 }
13154
13155 pub(crate) async fn new(
13156 config: gaxi::options::ClientConfig,
13157 ) -> crate::ClientBuilderResult<Self> {
13158 let inner = Self::build_inner(config).await?;
13159 Ok(Self { inner })
13160 }
13161
13162 async fn build_inner(
13163 conf: gaxi::options::ClientConfig,
13164 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionSecurityPolicies>>
13165 {
13166 if gaxi::options::tracing_enabled(&conf) {
13167 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13168 }
13169 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13170 }
13171
13172 async fn build_transport(
13173 conf: gaxi::options::ClientConfig,
13174 ) -> crate::ClientBuilderResult<impl super::stub::RegionSecurityPolicies> {
13175 super::transport::RegionSecurityPolicies::new(conf).await
13176 }
13177
13178 async fn build_with_tracing(
13179 conf: gaxi::options::ClientConfig,
13180 ) -> crate::ClientBuilderResult<impl super::stub::RegionSecurityPolicies> {
13181 Self::build_transport(conf)
13182 .await
13183 .map(super::tracing::RegionSecurityPolicies::new)
13184 }
13185
13186 /// Inserts a rule into a security policy.
13187 pub fn add_rule(&self) -> super::builder::region_security_policies::AddRule {
13188 super::builder::region_security_policies::AddRule::new(self.inner.clone())
13189 }
13190
13191 /// Deletes the specified policy.
13192 pub fn delete(&self) -> super::builder::region_security_policies::Delete {
13193 super::builder::region_security_policies::Delete::new(self.inner.clone())
13194 }
13195
13196 /// List all of the ordered rules present in a single specified policy.
13197 pub fn get(&self) -> super::builder::region_security_policies::Get {
13198 super::builder::region_security_policies::Get::new(self.inner.clone())
13199 }
13200
13201 /// Gets a rule at the specified priority.
13202 pub fn get_rule(&self) -> super::builder::region_security_policies::GetRule {
13203 super::builder::region_security_policies::GetRule::new(self.inner.clone())
13204 }
13205
13206 /// Creates a new policy in the specified project using the data included in
13207 /// the request.
13208 pub fn insert(&self) -> super::builder::region_security_policies::Insert {
13209 super::builder::region_security_policies::Insert::new(self.inner.clone())
13210 }
13211
13212 /// List all the policies that have been configured for the specified project
13213 /// and region.
13214 pub fn list(&self) -> super::builder::region_security_policies::List {
13215 super::builder::region_security_policies::List::new(self.inner.clone())
13216 }
13217
13218 /// Patches the specified policy with the data included in the request. To
13219 /// clear fields in the policy, leave the fields empty and specify them in the
13220 /// updateMask. This cannot be used to be update the rules in the policy.
13221 /// Please use the per rule methods like addRule, patchRule, and removeRule
13222 /// instead.
13223 pub fn patch(&self) -> super::builder::region_security_policies::Patch {
13224 super::builder::region_security_policies::Patch::new(self.inner.clone())
13225 }
13226
13227 /// Patches a rule at the specified priority. To clear fields in the rule,
13228 /// leave the fields empty and specify them in the updateMask.
13229 pub fn patch_rule(&self) -> super::builder::region_security_policies::PatchRule {
13230 super::builder::region_security_policies::PatchRule::new(self.inner.clone())
13231 }
13232
13233 /// Deletes a rule at the specified priority.
13234 pub fn remove_rule(&self) -> super::builder::region_security_policies::RemoveRule {
13235 super::builder::region_security_policies::RemoveRule::new(self.inner.clone())
13236 }
13237
13238 /// Sets the labels on a security policy. To learn more about labels,
13239 /// read the Labeling Resources
13240 /// documentation.
13241 pub fn set_labels(&self) -> super::builder::region_security_policies::SetLabels {
13242 super::builder::region_security_policies::SetLabels::new(self.inner.clone())
13243 }
13244
13245 /// Retrieves the specified region-specific Operations resource.
13246 pub fn get_operation(&self) -> super::builder::region_security_policies::GetOperation {
13247 super::builder::region_security_policies::GetOperation::new(self.inner.clone())
13248 }
13249}
13250
13251/// Implements a client for the Google Compute Engine API.
13252///
13253/// # Example
13254/// ```
13255/// # use google_cloud_compute_v1::client::RegionSslCertificates;
13256/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
13257/// let client = RegionSslCertificates::builder().build().await?;
13258/// // use `client` to make requests to the Google Compute Engine API.
13259/// # Ok(()) }
13260/// ```
13261///
13262/// # Service Description
13263///
13264/// Service for the `regionSslCertificates` resource.
13265///
13266/// # Configuration
13267///
13268/// To configure `RegionSslCertificates` use the `with_*` methods in the type returned
13269/// by [builder()][RegionSslCertificates::builder]. The default configuration should
13270/// work for most applications. Common configuration changes include
13271///
13272/// * [with_endpoint()]: by default this client uses the global default endpoint
13273/// (`https://compute.googleapis.com`). Applications using regional
13274/// endpoints or running in restricted networks (e.g. a network configured
13275// with [Private Google Access with VPC Service Controls]) may want to
13276/// override this default.
13277/// * [with_credentials()]: by default this client uses
13278/// [Application Default Credentials]. Applications using custom
13279/// authentication may need to override this default.
13280///
13281/// [with_endpoint()]: super::builder::region_ssl_certificates::ClientBuilder::with_endpoint
13282/// [with_credentials()]: super::builder::region_ssl_certificates::ClientBuilder::with_credentials
13283/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13284/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13285///
13286/// # Pooling and Cloning
13287///
13288/// `RegionSslCertificates` holds a connection pool internally, it is advised to
13289/// create one and reuse it. You do not need to wrap `RegionSslCertificates` in
13290/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13291/// already uses an `Arc` internally.
13292#[cfg(feature = "region-ssl-certificates")]
13293#[cfg_attr(docsrs, doc(cfg(feature = "region-ssl-certificates")))]
13294#[derive(Clone, Debug)]
13295pub struct RegionSslCertificates {
13296 inner: std::sync::Arc<dyn super::stub::dynamic::RegionSslCertificates>,
13297}
13298
13299#[cfg(feature = "region-ssl-certificates")]
13300impl RegionSslCertificates {
13301 /// Returns a builder for [RegionSslCertificates].
13302 ///
13303 /// ```
13304 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13305 /// # use google_cloud_compute_v1::client::RegionSslCertificates;
13306 /// let client = RegionSslCertificates::builder().build().await?;
13307 /// # Ok(()) }
13308 /// ```
13309 pub fn builder() -> super::builder::region_ssl_certificates::ClientBuilder {
13310 crate::new_client_builder(super::builder::region_ssl_certificates::client::Factory)
13311 }
13312
13313 /// Creates a new client from the provided stub.
13314 ///
13315 /// The most common case for calling this function is in tests mocking the
13316 /// client's behavior.
13317 pub fn from_stub<T>(stub: T) -> Self
13318 where
13319 T: super::stub::RegionSslCertificates + 'static,
13320 {
13321 Self {
13322 inner: std::sync::Arc::new(stub),
13323 }
13324 }
13325
13326 pub(crate) async fn new(
13327 config: gaxi::options::ClientConfig,
13328 ) -> crate::ClientBuilderResult<Self> {
13329 let inner = Self::build_inner(config).await?;
13330 Ok(Self { inner })
13331 }
13332
13333 async fn build_inner(
13334 conf: gaxi::options::ClientConfig,
13335 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionSslCertificates>>
13336 {
13337 if gaxi::options::tracing_enabled(&conf) {
13338 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13339 }
13340 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13341 }
13342
13343 async fn build_transport(
13344 conf: gaxi::options::ClientConfig,
13345 ) -> crate::ClientBuilderResult<impl super::stub::RegionSslCertificates> {
13346 super::transport::RegionSslCertificates::new(conf).await
13347 }
13348
13349 async fn build_with_tracing(
13350 conf: gaxi::options::ClientConfig,
13351 ) -> crate::ClientBuilderResult<impl super::stub::RegionSslCertificates> {
13352 Self::build_transport(conf)
13353 .await
13354 .map(super::tracing::RegionSslCertificates::new)
13355 }
13356
13357 /// Deletes the specified SslCertificate resource in the region.
13358 pub fn delete(&self) -> super::builder::region_ssl_certificates::Delete {
13359 super::builder::region_ssl_certificates::Delete::new(self.inner.clone())
13360 }
13361
13362 /// Returns the specified SslCertificate resource in the specified region. Get
13363 /// a list of available SSL certificates by making a list()
13364 /// request.
13365 pub fn get(&self) -> super::builder::region_ssl_certificates::Get {
13366 super::builder::region_ssl_certificates::Get::new(self.inner.clone())
13367 }
13368
13369 /// Creates a SslCertificate resource in the specified project and region using
13370 /// the data included in the request
13371 pub fn insert(&self) -> super::builder::region_ssl_certificates::Insert {
13372 super::builder::region_ssl_certificates::Insert::new(self.inner.clone())
13373 }
13374
13375 /// Retrieves the list of SslCertificate resources available to the specified
13376 /// project in the specified region.
13377 pub fn list(&self) -> super::builder::region_ssl_certificates::List {
13378 super::builder::region_ssl_certificates::List::new(self.inner.clone())
13379 }
13380
13381 /// Retrieves the specified region-specific Operations resource.
13382 pub fn get_operation(&self) -> super::builder::region_ssl_certificates::GetOperation {
13383 super::builder::region_ssl_certificates::GetOperation::new(self.inner.clone())
13384 }
13385}
13386
13387/// Implements a client for the Google Compute Engine API.
13388///
13389/// # Example
13390/// ```
13391/// # use google_cloud_compute_v1::client::RegionSslPolicies;
13392/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
13393/// let client = RegionSslPolicies::builder().build().await?;
13394/// // use `client` to make requests to the Google Compute Engine API.
13395/// # Ok(()) }
13396/// ```
13397///
13398/// # Service Description
13399///
13400/// Service for the `regionSslPolicies` resource.
13401///
13402/// # Configuration
13403///
13404/// To configure `RegionSslPolicies` use the `with_*` methods in the type returned
13405/// by [builder()][RegionSslPolicies::builder]. The default configuration should
13406/// work for most applications. Common configuration changes include
13407///
13408/// * [with_endpoint()]: by default this client uses the global default endpoint
13409/// (`https://compute.googleapis.com`). Applications using regional
13410/// endpoints or running in restricted networks (e.g. a network configured
13411// with [Private Google Access with VPC Service Controls]) may want to
13412/// override this default.
13413/// * [with_credentials()]: by default this client uses
13414/// [Application Default Credentials]. Applications using custom
13415/// authentication may need to override this default.
13416///
13417/// [with_endpoint()]: super::builder::region_ssl_policies::ClientBuilder::with_endpoint
13418/// [with_credentials()]: super::builder::region_ssl_policies::ClientBuilder::with_credentials
13419/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13420/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13421///
13422/// # Pooling and Cloning
13423///
13424/// `RegionSslPolicies` holds a connection pool internally, it is advised to
13425/// create one and reuse it. You do not need to wrap `RegionSslPolicies` in
13426/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13427/// already uses an `Arc` internally.
13428#[cfg(feature = "region-ssl-policies")]
13429#[cfg_attr(docsrs, doc(cfg(feature = "region-ssl-policies")))]
13430#[derive(Clone, Debug)]
13431pub struct RegionSslPolicies {
13432 inner: std::sync::Arc<dyn super::stub::dynamic::RegionSslPolicies>,
13433}
13434
13435#[cfg(feature = "region-ssl-policies")]
13436impl RegionSslPolicies {
13437 /// Returns a builder for [RegionSslPolicies].
13438 ///
13439 /// ```
13440 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13441 /// # use google_cloud_compute_v1::client::RegionSslPolicies;
13442 /// let client = RegionSslPolicies::builder().build().await?;
13443 /// # Ok(()) }
13444 /// ```
13445 pub fn builder() -> super::builder::region_ssl_policies::ClientBuilder {
13446 crate::new_client_builder(super::builder::region_ssl_policies::client::Factory)
13447 }
13448
13449 /// Creates a new client from the provided stub.
13450 ///
13451 /// The most common case for calling this function is in tests mocking the
13452 /// client's behavior.
13453 pub fn from_stub<T>(stub: T) -> Self
13454 where
13455 T: super::stub::RegionSslPolicies + 'static,
13456 {
13457 Self {
13458 inner: std::sync::Arc::new(stub),
13459 }
13460 }
13461
13462 pub(crate) async fn new(
13463 config: gaxi::options::ClientConfig,
13464 ) -> crate::ClientBuilderResult<Self> {
13465 let inner = Self::build_inner(config).await?;
13466 Ok(Self { inner })
13467 }
13468
13469 async fn build_inner(
13470 conf: gaxi::options::ClientConfig,
13471 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionSslPolicies>>
13472 {
13473 if gaxi::options::tracing_enabled(&conf) {
13474 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13475 }
13476 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13477 }
13478
13479 async fn build_transport(
13480 conf: gaxi::options::ClientConfig,
13481 ) -> crate::ClientBuilderResult<impl super::stub::RegionSslPolicies> {
13482 super::transport::RegionSslPolicies::new(conf).await
13483 }
13484
13485 async fn build_with_tracing(
13486 conf: gaxi::options::ClientConfig,
13487 ) -> crate::ClientBuilderResult<impl super::stub::RegionSslPolicies> {
13488 Self::build_transport(conf)
13489 .await
13490 .map(super::tracing::RegionSslPolicies::new)
13491 }
13492
13493 /// Deletes the specified SSL policy. The SSL policy resource can be deleted
13494 /// only if it is not in use by any TargetHttpsProxy or TargetSslProxy
13495 /// resources.
13496 pub fn delete(&self) -> super::builder::region_ssl_policies::Delete {
13497 super::builder::region_ssl_policies::Delete::new(self.inner.clone())
13498 }
13499
13500 /// Lists all of the ordered rules present in a single specified policy.
13501 pub fn get(&self) -> super::builder::region_ssl_policies::Get {
13502 super::builder::region_ssl_policies::Get::new(self.inner.clone())
13503 }
13504
13505 /// Creates a new policy in the specified project and region using the data
13506 /// included in the request.
13507 pub fn insert(&self) -> super::builder::region_ssl_policies::Insert {
13508 super::builder::region_ssl_policies::Insert::new(self.inner.clone())
13509 }
13510
13511 /// Lists all the SSL policies that have been configured for the specified
13512 /// project and region.
13513 pub fn list(&self) -> super::builder::region_ssl_policies::List {
13514 super::builder::region_ssl_policies::List::new(self.inner.clone())
13515 }
13516
13517 /// Lists all features that can be specified in the SSL policy when using
13518 /// custom profile.
13519 pub fn list_available_features(
13520 &self,
13521 ) -> super::builder::region_ssl_policies::ListAvailableFeatures {
13522 super::builder::region_ssl_policies::ListAvailableFeatures::new(self.inner.clone())
13523 }
13524
13525 /// Patches the specified SSL policy with the data included in the request.
13526 pub fn patch(&self) -> super::builder::region_ssl_policies::Patch {
13527 super::builder::region_ssl_policies::Patch::new(self.inner.clone())
13528 }
13529
13530 /// Retrieves the specified region-specific Operations resource.
13531 pub fn get_operation(&self) -> super::builder::region_ssl_policies::GetOperation {
13532 super::builder::region_ssl_policies::GetOperation::new(self.inner.clone())
13533 }
13534}
13535
13536/// Implements a client for the Google Compute Engine API.
13537///
13538/// # Example
13539/// ```
13540/// # use google_cloud_compute_v1::client::RegionTargetHttpProxies;
13541/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
13542/// let client = RegionTargetHttpProxies::builder().build().await?;
13543/// // use `client` to make requests to the Google Compute Engine API.
13544/// # Ok(()) }
13545/// ```
13546///
13547/// # Service Description
13548///
13549/// Service for the `regionTargetHttpProxies` resource.
13550///
13551/// # Configuration
13552///
13553/// To configure `RegionTargetHttpProxies` use the `with_*` methods in the type returned
13554/// by [builder()][RegionTargetHttpProxies::builder]. The default configuration should
13555/// work for most applications. Common configuration changes include
13556///
13557/// * [with_endpoint()]: by default this client uses the global default endpoint
13558/// (`https://compute.googleapis.com`). Applications using regional
13559/// endpoints or running in restricted networks (e.g. a network configured
13560// with [Private Google Access with VPC Service Controls]) may want to
13561/// override this default.
13562/// * [with_credentials()]: by default this client uses
13563/// [Application Default Credentials]. Applications using custom
13564/// authentication may need to override this default.
13565///
13566/// [with_endpoint()]: super::builder::region_target_http_proxies::ClientBuilder::with_endpoint
13567/// [with_credentials()]: super::builder::region_target_http_proxies::ClientBuilder::with_credentials
13568/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13569/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13570///
13571/// # Pooling and Cloning
13572///
13573/// `RegionTargetHttpProxies` holds a connection pool internally, it is advised to
13574/// create one and reuse it. You do not need to wrap `RegionTargetHttpProxies` in
13575/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13576/// already uses an `Arc` internally.
13577#[cfg(feature = "region-target-http-proxies")]
13578#[cfg_attr(docsrs, doc(cfg(feature = "region-target-http-proxies")))]
13579#[derive(Clone, Debug)]
13580pub struct RegionTargetHttpProxies {
13581 inner: std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpProxies>,
13582}
13583
13584#[cfg(feature = "region-target-http-proxies")]
13585impl RegionTargetHttpProxies {
13586 /// Returns a builder for [RegionTargetHttpProxies].
13587 ///
13588 /// ```
13589 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13590 /// # use google_cloud_compute_v1::client::RegionTargetHttpProxies;
13591 /// let client = RegionTargetHttpProxies::builder().build().await?;
13592 /// # Ok(()) }
13593 /// ```
13594 pub fn builder() -> super::builder::region_target_http_proxies::ClientBuilder {
13595 crate::new_client_builder(super::builder::region_target_http_proxies::client::Factory)
13596 }
13597
13598 /// Creates a new client from the provided stub.
13599 ///
13600 /// The most common case for calling this function is in tests mocking the
13601 /// client's behavior.
13602 pub fn from_stub<T>(stub: T) -> Self
13603 where
13604 T: super::stub::RegionTargetHttpProxies + 'static,
13605 {
13606 Self {
13607 inner: std::sync::Arc::new(stub),
13608 }
13609 }
13610
13611 pub(crate) async fn new(
13612 config: gaxi::options::ClientConfig,
13613 ) -> crate::ClientBuilderResult<Self> {
13614 let inner = Self::build_inner(config).await?;
13615 Ok(Self { inner })
13616 }
13617
13618 async fn build_inner(
13619 conf: gaxi::options::ClientConfig,
13620 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpProxies>>
13621 {
13622 if gaxi::options::tracing_enabled(&conf) {
13623 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13624 }
13625 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13626 }
13627
13628 async fn build_transport(
13629 conf: gaxi::options::ClientConfig,
13630 ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetHttpProxies> {
13631 super::transport::RegionTargetHttpProxies::new(conf).await
13632 }
13633
13634 async fn build_with_tracing(
13635 conf: gaxi::options::ClientConfig,
13636 ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetHttpProxies> {
13637 Self::build_transport(conf)
13638 .await
13639 .map(super::tracing::RegionTargetHttpProxies::new)
13640 }
13641
13642 /// Deletes the specified TargetHttpProxy resource.
13643 pub fn delete(&self) -> super::builder::region_target_http_proxies::Delete {
13644 super::builder::region_target_http_proxies::Delete::new(self.inner.clone())
13645 }
13646
13647 /// Returns the specified TargetHttpProxy resource in the specified region.
13648 pub fn get(&self) -> super::builder::region_target_http_proxies::Get {
13649 super::builder::region_target_http_proxies::Get::new(self.inner.clone())
13650 }
13651
13652 /// Creates a TargetHttpProxy resource in the specified project and region
13653 /// using the data included in the request.
13654 pub fn insert(&self) -> super::builder::region_target_http_proxies::Insert {
13655 super::builder::region_target_http_proxies::Insert::new(self.inner.clone())
13656 }
13657
13658 /// Retrieves the list of TargetHttpProxy resources available
13659 /// to the specified project in the specified region.
13660 pub fn list(&self) -> super::builder::region_target_http_proxies::List {
13661 super::builder::region_target_http_proxies::List::new(self.inner.clone())
13662 }
13663
13664 /// Changes the URL map for TargetHttpProxy.
13665 pub fn set_url_map(&self) -> super::builder::region_target_http_proxies::SetUrlMap {
13666 super::builder::region_target_http_proxies::SetUrlMap::new(self.inner.clone())
13667 }
13668
13669 /// Retrieves the specified region-specific Operations resource.
13670 pub fn get_operation(&self) -> super::builder::region_target_http_proxies::GetOperation {
13671 super::builder::region_target_http_proxies::GetOperation::new(self.inner.clone())
13672 }
13673}
13674
13675/// Implements a client for the Google Compute Engine API.
13676///
13677/// # Example
13678/// ```
13679/// # use google_cloud_compute_v1::client::RegionTargetHttpsProxies;
13680/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
13681/// let client = RegionTargetHttpsProxies::builder().build().await?;
13682/// // use `client` to make requests to the Google Compute Engine API.
13683/// # Ok(()) }
13684/// ```
13685///
13686/// # Service Description
13687///
13688/// Service for the `regionTargetHttpsProxies` resource.
13689///
13690/// # Configuration
13691///
13692/// To configure `RegionTargetHttpsProxies` use the `with_*` methods in the type returned
13693/// by [builder()][RegionTargetHttpsProxies::builder]. The default configuration should
13694/// work for most applications. Common configuration changes include
13695///
13696/// * [with_endpoint()]: by default this client uses the global default endpoint
13697/// (`https://compute.googleapis.com`). Applications using regional
13698/// endpoints or running in restricted networks (e.g. a network configured
13699// with [Private Google Access with VPC Service Controls]) may want to
13700/// override this default.
13701/// * [with_credentials()]: by default this client uses
13702/// [Application Default Credentials]. Applications using custom
13703/// authentication may need to override this default.
13704///
13705/// [with_endpoint()]: super::builder::region_target_https_proxies::ClientBuilder::with_endpoint
13706/// [with_credentials()]: super::builder::region_target_https_proxies::ClientBuilder::with_credentials
13707/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13708/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13709///
13710/// # Pooling and Cloning
13711///
13712/// `RegionTargetHttpsProxies` holds a connection pool internally, it is advised to
13713/// create one and reuse it. You do not need to wrap `RegionTargetHttpsProxies` in
13714/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13715/// already uses an `Arc` internally.
13716#[cfg(feature = "region-target-https-proxies")]
13717#[cfg_attr(docsrs, doc(cfg(feature = "region-target-https-proxies")))]
13718#[derive(Clone, Debug)]
13719pub struct RegionTargetHttpsProxies {
13720 inner: std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpsProxies>,
13721}
13722
13723#[cfg(feature = "region-target-https-proxies")]
13724impl RegionTargetHttpsProxies {
13725 /// Returns a builder for [RegionTargetHttpsProxies].
13726 ///
13727 /// ```
13728 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13729 /// # use google_cloud_compute_v1::client::RegionTargetHttpsProxies;
13730 /// let client = RegionTargetHttpsProxies::builder().build().await?;
13731 /// # Ok(()) }
13732 /// ```
13733 pub fn builder() -> super::builder::region_target_https_proxies::ClientBuilder {
13734 crate::new_client_builder(super::builder::region_target_https_proxies::client::Factory)
13735 }
13736
13737 /// Creates a new client from the provided stub.
13738 ///
13739 /// The most common case for calling this function is in tests mocking the
13740 /// client's behavior.
13741 pub fn from_stub<T>(stub: T) -> Self
13742 where
13743 T: super::stub::RegionTargetHttpsProxies + 'static,
13744 {
13745 Self {
13746 inner: std::sync::Arc::new(stub),
13747 }
13748 }
13749
13750 pub(crate) async fn new(
13751 config: gaxi::options::ClientConfig,
13752 ) -> crate::ClientBuilderResult<Self> {
13753 let inner = Self::build_inner(config).await?;
13754 Ok(Self { inner })
13755 }
13756
13757 async fn build_inner(
13758 conf: gaxi::options::ClientConfig,
13759 ) -> crate::ClientBuilderResult<
13760 std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpsProxies>,
13761 > {
13762 if gaxi::options::tracing_enabled(&conf) {
13763 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13764 }
13765 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13766 }
13767
13768 async fn build_transport(
13769 conf: gaxi::options::ClientConfig,
13770 ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetHttpsProxies> {
13771 super::transport::RegionTargetHttpsProxies::new(conf).await
13772 }
13773
13774 async fn build_with_tracing(
13775 conf: gaxi::options::ClientConfig,
13776 ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetHttpsProxies> {
13777 Self::build_transport(conf)
13778 .await
13779 .map(super::tracing::RegionTargetHttpsProxies::new)
13780 }
13781
13782 /// Deletes the specified TargetHttpsProxy resource.
13783 pub fn delete(&self) -> super::builder::region_target_https_proxies::Delete {
13784 super::builder::region_target_https_proxies::Delete::new(self.inner.clone())
13785 }
13786
13787 /// Returns the specified TargetHttpsProxy resource in the specified region.
13788 pub fn get(&self) -> super::builder::region_target_https_proxies::Get {
13789 super::builder::region_target_https_proxies::Get::new(self.inner.clone())
13790 }
13791
13792 /// Creates a TargetHttpsProxy resource in the specified project and region
13793 /// using the data included in the request.
13794 pub fn insert(&self) -> super::builder::region_target_https_proxies::Insert {
13795 super::builder::region_target_https_proxies::Insert::new(self.inner.clone())
13796 }
13797
13798 /// Retrieves the list of TargetHttpsProxy resources available
13799 /// to the specified project in the specified region.
13800 pub fn list(&self) -> super::builder::region_target_https_proxies::List {
13801 super::builder::region_target_https_proxies::List::new(self.inner.clone())
13802 }
13803
13804 /// Patches the specified regional TargetHttpsProxy resource with the data
13805 /// included in the request. This method supports PATCH
13806 /// semantics and usesJSON merge
13807 /// patch format and processing rules.
13808 pub fn patch(&self) -> super::builder::region_target_https_proxies::Patch {
13809 super::builder::region_target_https_proxies::Patch::new(self.inner.clone())
13810 }
13811
13812 /// Replaces SslCertificates for TargetHttpsProxy.
13813 pub fn set_ssl_certificates(
13814 &self,
13815 ) -> super::builder::region_target_https_proxies::SetSslCertificates {
13816 super::builder::region_target_https_proxies::SetSslCertificates::new(self.inner.clone())
13817 }
13818
13819 /// Changes the URL map for TargetHttpsProxy.
13820 pub fn set_url_map(&self) -> super::builder::region_target_https_proxies::SetUrlMap {
13821 super::builder::region_target_https_proxies::SetUrlMap::new(self.inner.clone())
13822 }
13823
13824 /// Retrieves the specified region-specific Operations resource.
13825 pub fn get_operation(&self) -> super::builder::region_target_https_proxies::GetOperation {
13826 super::builder::region_target_https_proxies::GetOperation::new(self.inner.clone())
13827 }
13828}
13829
13830/// Implements a client for the Google Compute Engine API.
13831///
13832/// # Example
13833/// ```
13834/// # use google_cloud_compute_v1::client::RegionTargetTcpProxies;
13835/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
13836/// let client = RegionTargetTcpProxies::builder().build().await?;
13837/// // use `client` to make requests to the Google Compute Engine API.
13838/// # Ok(()) }
13839/// ```
13840///
13841/// # Service Description
13842///
13843/// Service for the `regionTargetTcpProxies` resource.
13844///
13845/// # Configuration
13846///
13847/// To configure `RegionTargetTcpProxies` use the `with_*` methods in the type returned
13848/// by [builder()][RegionTargetTcpProxies::builder]. The default configuration should
13849/// work for most applications. Common configuration changes include
13850///
13851/// * [with_endpoint()]: by default this client uses the global default endpoint
13852/// (`https://compute.googleapis.com`). Applications using regional
13853/// endpoints or running in restricted networks (e.g. a network configured
13854// with [Private Google Access with VPC Service Controls]) may want to
13855/// override this default.
13856/// * [with_credentials()]: by default this client uses
13857/// [Application Default Credentials]. Applications using custom
13858/// authentication may need to override this default.
13859///
13860/// [with_endpoint()]: super::builder::region_target_tcp_proxies::ClientBuilder::with_endpoint
13861/// [with_credentials()]: super::builder::region_target_tcp_proxies::ClientBuilder::with_credentials
13862/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13863/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13864///
13865/// # Pooling and Cloning
13866///
13867/// `RegionTargetTcpProxies` holds a connection pool internally, it is advised to
13868/// create one and reuse it. You do not need to wrap `RegionTargetTcpProxies` in
13869/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13870/// already uses an `Arc` internally.
13871#[cfg(feature = "region-target-tcp-proxies")]
13872#[cfg_attr(docsrs, doc(cfg(feature = "region-target-tcp-proxies")))]
13873#[derive(Clone, Debug)]
13874pub struct RegionTargetTcpProxies {
13875 inner: std::sync::Arc<dyn super::stub::dynamic::RegionTargetTcpProxies>,
13876}
13877
13878#[cfg(feature = "region-target-tcp-proxies")]
13879impl RegionTargetTcpProxies {
13880 /// Returns a builder for [RegionTargetTcpProxies].
13881 ///
13882 /// ```
13883 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13884 /// # use google_cloud_compute_v1::client::RegionTargetTcpProxies;
13885 /// let client = RegionTargetTcpProxies::builder().build().await?;
13886 /// # Ok(()) }
13887 /// ```
13888 pub fn builder() -> super::builder::region_target_tcp_proxies::ClientBuilder {
13889 crate::new_client_builder(super::builder::region_target_tcp_proxies::client::Factory)
13890 }
13891
13892 /// Creates a new client from the provided stub.
13893 ///
13894 /// The most common case for calling this function is in tests mocking the
13895 /// client's behavior.
13896 pub fn from_stub<T>(stub: T) -> Self
13897 where
13898 T: super::stub::RegionTargetTcpProxies + 'static,
13899 {
13900 Self {
13901 inner: std::sync::Arc::new(stub),
13902 }
13903 }
13904
13905 pub(crate) async fn new(
13906 config: gaxi::options::ClientConfig,
13907 ) -> crate::ClientBuilderResult<Self> {
13908 let inner = Self::build_inner(config).await?;
13909 Ok(Self { inner })
13910 }
13911
13912 async fn build_inner(
13913 conf: gaxi::options::ClientConfig,
13914 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionTargetTcpProxies>>
13915 {
13916 if gaxi::options::tracing_enabled(&conf) {
13917 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13918 }
13919 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13920 }
13921
13922 async fn build_transport(
13923 conf: gaxi::options::ClientConfig,
13924 ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetTcpProxies> {
13925 super::transport::RegionTargetTcpProxies::new(conf).await
13926 }
13927
13928 async fn build_with_tracing(
13929 conf: gaxi::options::ClientConfig,
13930 ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetTcpProxies> {
13931 Self::build_transport(conf)
13932 .await
13933 .map(super::tracing::RegionTargetTcpProxies::new)
13934 }
13935
13936 /// Deletes the specified TargetTcpProxy resource.
13937 pub fn delete(&self) -> super::builder::region_target_tcp_proxies::Delete {
13938 super::builder::region_target_tcp_proxies::Delete::new(self.inner.clone())
13939 }
13940
13941 /// Returns the specified TargetTcpProxy resource.
13942 pub fn get(&self) -> super::builder::region_target_tcp_proxies::Get {
13943 super::builder::region_target_tcp_proxies::Get::new(self.inner.clone())
13944 }
13945
13946 /// Creates a TargetTcpProxy resource in the specified project and region using
13947 /// the data included in the request.
13948 pub fn insert(&self) -> super::builder::region_target_tcp_proxies::Insert {
13949 super::builder::region_target_tcp_proxies::Insert::new(self.inner.clone())
13950 }
13951
13952 /// Retrieves a list of TargetTcpProxy resources
13953 /// available to the specified project in a given region.
13954 pub fn list(&self) -> super::builder::region_target_tcp_proxies::List {
13955 super::builder::region_target_tcp_proxies::List::new(self.inner.clone())
13956 }
13957
13958 /// Retrieves the specified region-specific Operations resource.
13959 pub fn get_operation(&self) -> super::builder::region_target_tcp_proxies::GetOperation {
13960 super::builder::region_target_tcp_proxies::GetOperation::new(self.inner.clone())
13961 }
13962}
13963
13964/// Implements a client for the Google Compute Engine API.
13965///
13966/// # Example
13967/// ```
13968/// # use google_cloud_compute_v1::client::RegionUrlMaps;
13969/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
13970/// let client = RegionUrlMaps::builder().build().await?;
13971/// // use `client` to make requests to the Google Compute Engine API.
13972/// # Ok(()) }
13973/// ```
13974///
13975/// # Service Description
13976///
13977/// Service for the `regionUrlMaps` resource.
13978///
13979/// # Configuration
13980///
13981/// To configure `RegionUrlMaps` use the `with_*` methods in the type returned
13982/// by [builder()][RegionUrlMaps::builder]. The default configuration should
13983/// work for most applications. Common configuration changes include
13984///
13985/// * [with_endpoint()]: by default this client uses the global default endpoint
13986/// (`https://compute.googleapis.com`). Applications using regional
13987/// endpoints or running in restricted networks (e.g. a network configured
13988// with [Private Google Access with VPC Service Controls]) may want to
13989/// override this default.
13990/// * [with_credentials()]: by default this client uses
13991/// [Application Default Credentials]. Applications using custom
13992/// authentication may need to override this default.
13993///
13994/// [with_endpoint()]: super::builder::region_url_maps::ClientBuilder::with_endpoint
13995/// [with_credentials()]: super::builder::region_url_maps::ClientBuilder::with_credentials
13996/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13997/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13998///
13999/// # Pooling and Cloning
14000///
14001/// `RegionUrlMaps` holds a connection pool internally, it is advised to
14002/// create one and reuse it. You do not need to wrap `RegionUrlMaps` in
14003/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14004/// already uses an `Arc` internally.
14005#[cfg(feature = "region-url-maps")]
14006#[cfg_attr(docsrs, doc(cfg(feature = "region-url-maps")))]
14007#[derive(Clone, Debug)]
14008pub struct RegionUrlMaps {
14009 inner: std::sync::Arc<dyn super::stub::dynamic::RegionUrlMaps>,
14010}
14011
14012#[cfg(feature = "region-url-maps")]
14013impl RegionUrlMaps {
14014 /// Returns a builder for [RegionUrlMaps].
14015 ///
14016 /// ```
14017 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14018 /// # use google_cloud_compute_v1::client::RegionUrlMaps;
14019 /// let client = RegionUrlMaps::builder().build().await?;
14020 /// # Ok(()) }
14021 /// ```
14022 pub fn builder() -> super::builder::region_url_maps::ClientBuilder {
14023 crate::new_client_builder(super::builder::region_url_maps::client::Factory)
14024 }
14025
14026 /// Creates a new client from the provided stub.
14027 ///
14028 /// The most common case for calling this function is in tests mocking the
14029 /// client's behavior.
14030 pub fn from_stub<T>(stub: T) -> Self
14031 where
14032 T: super::stub::RegionUrlMaps + 'static,
14033 {
14034 Self {
14035 inner: std::sync::Arc::new(stub),
14036 }
14037 }
14038
14039 pub(crate) async fn new(
14040 config: gaxi::options::ClientConfig,
14041 ) -> crate::ClientBuilderResult<Self> {
14042 let inner = Self::build_inner(config).await?;
14043 Ok(Self { inner })
14044 }
14045
14046 async fn build_inner(
14047 conf: gaxi::options::ClientConfig,
14048 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionUrlMaps>> {
14049 if gaxi::options::tracing_enabled(&conf) {
14050 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14051 }
14052 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14053 }
14054
14055 async fn build_transport(
14056 conf: gaxi::options::ClientConfig,
14057 ) -> crate::ClientBuilderResult<impl super::stub::RegionUrlMaps> {
14058 super::transport::RegionUrlMaps::new(conf).await
14059 }
14060
14061 async fn build_with_tracing(
14062 conf: gaxi::options::ClientConfig,
14063 ) -> crate::ClientBuilderResult<impl super::stub::RegionUrlMaps> {
14064 Self::build_transport(conf)
14065 .await
14066 .map(super::tracing::RegionUrlMaps::new)
14067 }
14068
14069 /// Deletes the specified UrlMap resource.
14070 pub fn delete(&self) -> super::builder::region_url_maps::Delete {
14071 super::builder::region_url_maps::Delete::new(self.inner.clone())
14072 }
14073
14074 /// Returns the specified UrlMap resource.
14075 pub fn get(&self) -> super::builder::region_url_maps::Get {
14076 super::builder::region_url_maps::Get::new(self.inner.clone())
14077 }
14078
14079 /// Creates a UrlMap resource in the specified project using
14080 /// the data included in the request.
14081 pub fn insert(&self) -> super::builder::region_url_maps::Insert {
14082 super::builder::region_url_maps::Insert::new(self.inner.clone())
14083 }
14084
14085 /// Retrieves the list of UrlMap resources available to the specified
14086 /// project in the specified region.
14087 pub fn list(&self) -> super::builder::region_url_maps::List {
14088 super::builder::region_url_maps::List::new(self.inner.clone())
14089 }
14090
14091 /// Patches the specified UrlMap resource with the data included in the
14092 /// request. This method supportsPATCH
14093 /// semantics and usesJSON merge
14094 /// patch format and processing rules.
14095 pub fn patch(&self) -> super::builder::region_url_maps::Patch {
14096 super::builder::region_url_maps::Patch::new(self.inner.clone())
14097 }
14098
14099 /// Updates the specified UrlMap resource with the data included in the
14100 /// request.
14101 pub fn update(&self) -> super::builder::region_url_maps::Update {
14102 super::builder::region_url_maps::Update::new(self.inner.clone())
14103 }
14104
14105 /// Runs static validation for the UrlMap. In particular, the tests of the
14106 /// provided UrlMap will be run. Calling this method does NOT create the
14107 /// UrlMap.
14108 pub fn validate(&self) -> super::builder::region_url_maps::Validate {
14109 super::builder::region_url_maps::Validate::new(self.inner.clone())
14110 }
14111
14112 /// Retrieves the specified region-specific Operations resource.
14113 pub fn get_operation(&self) -> super::builder::region_url_maps::GetOperation {
14114 super::builder::region_url_maps::GetOperation::new(self.inner.clone())
14115 }
14116}
14117
14118/// Implements a client for the Google Compute Engine API.
14119///
14120/// # Example
14121/// ```
14122/// # use google_cloud_compute_v1::client::RegionZones;
14123/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
14124/// let client = RegionZones::builder().build().await?;
14125/// // use `client` to make requests to the Google Compute Engine API.
14126/// # Ok(()) }
14127/// ```
14128///
14129/// # Service Description
14130///
14131/// Service for the `regionZones` resource.
14132///
14133/// # Configuration
14134///
14135/// To configure `RegionZones` use the `with_*` methods in the type returned
14136/// by [builder()][RegionZones::builder]. The default configuration should
14137/// work for most applications. Common configuration changes include
14138///
14139/// * [with_endpoint()]: by default this client uses the global default endpoint
14140/// (`https://compute.googleapis.com`). Applications using regional
14141/// endpoints or running in restricted networks (e.g. a network configured
14142// with [Private Google Access with VPC Service Controls]) may want to
14143/// override this default.
14144/// * [with_credentials()]: by default this client uses
14145/// [Application Default Credentials]. Applications using custom
14146/// authentication may need to override this default.
14147///
14148/// [with_endpoint()]: super::builder::region_zones::ClientBuilder::with_endpoint
14149/// [with_credentials()]: super::builder::region_zones::ClientBuilder::with_credentials
14150/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14151/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14152///
14153/// # Pooling and Cloning
14154///
14155/// `RegionZones` holds a connection pool internally, it is advised to
14156/// create one and reuse it. You do not need to wrap `RegionZones` in
14157/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14158/// already uses an `Arc` internally.
14159#[cfg(feature = "region-zones")]
14160#[cfg_attr(docsrs, doc(cfg(feature = "region-zones")))]
14161#[derive(Clone, Debug)]
14162pub struct RegionZones {
14163 inner: std::sync::Arc<dyn super::stub::dynamic::RegionZones>,
14164}
14165
14166#[cfg(feature = "region-zones")]
14167impl RegionZones {
14168 /// Returns a builder for [RegionZones].
14169 ///
14170 /// ```
14171 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14172 /// # use google_cloud_compute_v1::client::RegionZones;
14173 /// let client = RegionZones::builder().build().await?;
14174 /// # Ok(()) }
14175 /// ```
14176 pub fn builder() -> super::builder::region_zones::ClientBuilder {
14177 crate::new_client_builder(super::builder::region_zones::client::Factory)
14178 }
14179
14180 /// Creates a new client from the provided stub.
14181 ///
14182 /// The most common case for calling this function is in tests mocking the
14183 /// client's behavior.
14184 pub fn from_stub<T>(stub: T) -> Self
14185 where
14186 T: super::stub::RegionZones + 'static,
14187 {
14188 Self {
14189 inner: std::sync::Arc::new(stub),
14190 }
14191 }
14192
14193 pub(crate) async fn new(
14194 config: gaxi::options::ClientConfig,
14195 ) -> crate::ClientBuilderResult<Self> {
14196 let inner = Self::build_inner(config).await?;
14197 Ok(Self { inner })
14198 }
14199
14200 async fn build_inner(
14201 conf: gaxi::options::ClientConfig,
14202 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionZones>> {
14203 if gaxi::options::tracing_enabled(&conf) {
14204 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14205 }
14206 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14207 }
14208
14209 async fn build_transport(
14210 conf: gaxi::options::ClientConfig,
14211 ) -> crate::ClientBuilderResult<impl super::stub::RegionZones> {
14212 super::transport::RegionZones::new(conf).await
14213 }
14214
14215 async fn build_with_tracing(
14216 conf: gaxi::options::ClientConfig,
14217 ) -> crate::ClientBuilderResult<impl super::stub::RegionZones> {
14218 Self::build_transport(conf)
14219 .await
14220 .map(super::tracing::RegionZones::new)
14221 }
14222
14223 /// Retrieves the list of Zone resources under the specific region available to
14224 /// the specified project.
14225 pub fn list(&self) -> super::builder::region_zones::List {
14226 super::builder::region_zones::List::new(self.inner.clone())
14227 }
14228}
14229
14230/// Implements a client for the Google Compute Engine API.
14231///
14232/// # Example
14233/// ```
14234/// # use google_cloud_compute_v1::client::Regions;
14235/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
14236/// let client = Regions::builder().build().await?;
14237/// // use `client` to make requests to the Google Compute Engine API.
14238/// # Ok(()) }
14239/// ```
14240///
14241/// # Service Description
14242///
14243/// Service for the `regions` resource.
14244///
14245/// # Configuration
14246///
14247/// To configure `Regions` use the `with_*` methods in the type returned
14248/// by [builder()][Regions::builder]. The default configuration should
14249/// work for most applications. Common configuration changes include
14250///
14251/// * [with_endpoint()]: by default this client uses the global default endpoint
14252/// (`https://compute.googleapis.com`). Applications using regional
14253/// endpoints or running in restricted networks (e.g. a network configured
14254// with [Private Google Access with VPC Service Controls]) may want to
14255/// override this default.
14256/// * [with_credentials()]: by default this client uses
14257/// [Application Default Credentials]. Applications using custom
14258/// authentication may need to override this default.
14259///
14260/// [with_endpoint()]: super::builder::regions::ClientBuilder::with_endpoint
14261/// [with_credentials()]: super::builder::regions::ClientBuilder::with_credentials
14262/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14263/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14264///
14265/// # Pooling and Cloning
14266///
14267/// `Regions` holds a connection pool internally, it is advised to
14268/// create one and reuse it. You do not need to wrap `Regions` in
14269/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14270/// already uses an `Arc` internally.
14271#[cfg(feature = "regions")]
14272#[cfg_attr(docsrs, doc(cfg(feature = "regions")))]
14273#[derive(Clone, Debug)]
14274pub struct Regions {
14275 inner: std::sync::Arc<dyn super::stub::dynamic::Regions>,
14276}
14277
14278#[cfg(feature = "regions")]
14279impl Regions {
14280 /// Returns a builder for [Regions].
14281 ///
14282 /// ```
14283 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14284 /// # use google_cloud_compute_v1::client::Regions;
14285 /// let client = Regions::builder().build().await?;
14286 /// # Ok(()) }
14287 /// ```
14288 pub fn builder() -> super::builder::regions::ClientBuilder {
14289 crate::new_client_builder(super::builder::regions::client::Factory)
14290 }
14291
14292 /// Creates a new client from the provided stub.
14293 ///
14294 /// The most common case for calling this function is in tests mocking the
14295 /// client's behavior.
14296 pub fn from_stub<T>(stub: T) -> Self
14297 where
14298 T: super::stub::Regions + 'static,
14299 {
14300 Self {
14301 inner: std::sync::Arc::new(stub),
14302 }
14303 }
14304
14305 pub(crate) async fn new(
14306 config: gaxi::options::ClientConfig,
14307 ) -> crate::ClientBuilderResult<Self> {
14308 let inner = Self::build_inner(config).await?;
14309 Ok(Self { inner })
14310 }
14311
14312 async fn build_inner(
14313 conf: gaxi::options::ClientConfig,
14314 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Regions>> {
14315 if gaxi::options::tracing_enabled(&conf) {
14316 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14317 }
14318 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14319 }
14320
14321 async fn build_transport(
14322 conf: gaxi::options::ClientConfig,
14323 ) -> crate::ClientBuilderResult<impl super::stub::Regions> {
14324 super::transport::Regions::new(conf).await
14325 }
14326
14327 async fn build_with_tracing(
14328 conf: gaxi::options::ClientConfig,
14329 ) -> crate::ClientBuilderResult<impl super::stub::Regions> {
14330 Self::build_transport(conf)
14331 .await
14332 .map(super::tracing::Regions::new)
14333 }
14334
14335 /// Returns the specified Region resource.
14336 ///
14337 /// To decrease latency for this method, you can optionally omit any unneeded
14338 /// information from the response by using a field mask. This practice is
14339 /// especially recommended for unused quota information (the `quotas` field).
14340 /// To exclude one or more fields, set your request's `fields` query parameter
14341 /// to only include the fields you need. For example, to only include the `id`
14342 /// and `selfLink` fields, add the query parameter `?fields=id,selfLink` to
14343 /// your request.
14344 ///
14345 /// This method fails if the quota information is unavailable for the region
14346 /// and if the organization policy constraint
14347 /// compute.requireBasicQuotaInResponse is enforced. This
14348 /// constraint, when enforced, disables the fail-open behaviour when quota
14349 /// information (the `items.quotas` field) is unavailable for the region.
14350 /// It is recommended to use the default setting
14351 /// for the constraint unless your application requires the fail-closed
14352 /// behaviour for this method.
14353 pub fn get(&self) -> super::builder::regions::Get {
14354 super::builder::regions::Get::new(self.inner.clone())
14355 }
14356
14357 /// Retrieves the list of region resources available to the specified project.
14358 ///
14359 /// To decrease latency for this method, you can optionally omit any unneeded
14360 /// information from the response by using a field mask. This practice is
14361 /// especially recommended for unused quota information
14362 /// (the `items.quotas` field).
14363 /// To exclude one or more fields, set your request's `fields` query parameter
14364 /// to only include the fields you need. For example, to only include the `id`
14365 /// and `selfLink` fields, add the query parameter `?fields=id,selfLink` to
14366 /// your request.
14367 ///
14368 /// This method fails if the quota information is unavailable for the region
14369 /// and if the organization policy constraint
14370 /// compute.requireBasicQuotaInResponse is enforced. This
14371 /// constraint, when enforced, disables the fail-open behaviour when quota
14372 /// information (the `items.quotas` field) is unavailable for the region.
14373 /// It is recommended to use the default setting
14374 /// for the constraint unless your application requires the fail-closed
14375 /// behaviour for this method.
14376 pub fn list(&self) -> super::builder::regions::List {
14377 super::builder::regions::List::new(self.inner.clone())
14378 }
14379}
14380
14381/// Implements a client for the Google Compute Engine API.
14382///
14383/// # Example
14384/// ```
14385/// # use google_cloud_compute_v1::client::ReservationBlocks;
14386/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
14387/// let client = ReservationBlocks::builder().build().await?;
14388/// // use `client` to make requests to the Google Compute Engine API.
14389/// # Ok(()) }
14390/// ```
14391///
14392/// # Service Description
14393///
14394/// Service for the `reservationBlocks` resource.
14395///
14396/// # Configuration
14397///
14398/// To configure `ReservationBlocks` use the `with_*` methods in the type returned
14399/// by [builder()][ReservationBlocks::builder]. The default configuration should
14400/// work for most applications. Common configuration changes include
14401///
14402/// * [with_endpoint()]: by default this client uses the global default endpoint
14403/// (`https://compute.googleapis.com`). Applications using regional
14404/// endpoints or running in restricted networks (e.g. a network configured
14405// with [Private Google Access with VPC Service Controls]) may want to
14406/// override this default.
14407/// * [with_credentials()]: by default this client uses
14408/// [Application Default Credentials]. Applications using custom
14409/// authentication may need to override this default.
14410///
14411/// [with_endpoint()]: super::builder::reservation_blocks::ClientBuilder::with_endpoint
14412/// [with_credentials()]: super::builder::reservation_blocks::ClientBuilder::with_credentials
14413/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14414/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14415///
14416/// # Pooling and Cloning
14417///
14418/// `ReservationBlocks` holds a connection pool internally, it is advised to
14419/// create one and reuse it. You do not need to wrap `ReservationBlocks` in
14420/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14421/// already uses an `Arc` internally.
14422#[cfg(feature = "reservation-blocks")]
14423#[cfg_attr(docsrs, doc(cfg(feature = "reservation-blocks")))]
14424#[derive(Clone, Debug)]
14425pub struct ReservationBlocks {
14426 inner: std::sync::Arc<dyn super::stub::dynamic::ReservationBlocks>,
14427}
14428
14429#[cfg(feature = "reservation-blocks")]
14430impl ReservationBlocks {
14431 /// Returns a builder for [ReservationBlocks].
14432 ///
14433 /// ```
14434 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14435 /// # use google_cloud_compute_v1::client::ReservationBlocks;
14436 /// let client = ReservationBlocks::builder().build().await?;
14437 /// # Ok(()) }
14438 /// ```
14439 pub fn builder() -> super::builder::reservation_blocks::ClientBuilder {
14440 crate::new_client_builder(super::builder::reservation_blocks::client::Factory)
14441 }
14442
14443 /// Creates a new client from the provided stub.
14444 ///
14445 /// The most common case for calling this function is in tests mocking the
14446 /// client's behavior.
14447 pub fn from_stub<T>(stub: T) -> Self
14448 where
14449 T: super::stub::ReservationBlocks + 'static,
14450 {
14451 Self {
14452 inner: std::sync::Arc::new(stub),
14453 }
14454 }
14455
14456 pub(crate) async fn new(
14457 config: gaxi::options::ClientConfig,
14458 ) -> crate::ClientBuilderResult<Self> {
14459 let inner = Self::build_inner(config).await?;
14460 Ok(Self { inner })
14461 }
14462
14463 async fn build_inner(
14464 conf: gaxi::options::ClientConfig,
14465 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ReservationBlocks>>
14466 {
14467 if gaxi::options::tracing_enabled(&conf) {
14468 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14469 }
14470 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14471 }
14472
14473 async fn build_transport(
14474 conf: gaxi::options::ClientConfig,
14475 ) -> crate::ClientBuilderResult<impl super::stub::ReservationBlocks> {
14476 super::transport::ReservationBlocks::new(conf).await
14477 }
14478
14479 async fn build_with_tracing(
14480 conf: gaxi::options::ClientConfig,
14481 ) -> crate::ClientBuilderResult<impl super::stub::ReservationBlocks> {
14482 Self::build_transport(conf)
14483 .await
14484 .map(super::tracing::ReservationBlocks::new)
14485 }
14486
14487 /// Retrieves information about the specified reservation block.
14488 pub fn get(&self) -> super::builder::reservation_blocks::Get {
14489 super::builder::reservation_blocks::Get::new(self.inner.clone())
14490 }
14491
14492 /// Gets the access control policy for a resource. May be empty if no such
14493 /// policy or resource exists.
14494 pub fn get_iam_policy(&self) -> super::builder::reservation_blocks::GetIamPolicy {
14495 super::builder::reservation_blocks::GetIamPolicy::new(self.inner.clone())
14496 }
14497
14498 /// Retrieves a list of reservation blocks under a single reservation.
14499 pub fn list(&self) -> super::builder::reservation_blocks::List {
14500 super::builder::reservation_blocks::List::new(self.inner.clone())
14501 }
14502
14503 /// Allows customers to perform maintenance on a reservation block
14504 pub fn perform_maintenance(&self) -> super::builder::reservation_blocks::PerformMaintenance {
14505 super::builder::reservation_blocks::PerformMaintenance::new(self.inner.clone())
14506 }
14507
14508 /// Sets the access control policy on the specified resource.
14509 /// Replaces any existing policy.
14510 pub fn set_iam_policy(&self) -> super::builder::reservation_blocks::SetIamPolicy {
14511 super::builder::reservation_blocks::SetIamPolicy::new(self.inner.clone())
14512 }
14513
14514 /// Returns permissions that a caller has on the specified resource.
14515 pub fn test_iam_permissions(&self) -> super::builder::reservation_blocks::TestIamPermissions {
14516 super::builder::reservation_blocks::TestIamPermissions::new(self.inner.clone())
14517 }
14518
14519 /// Retrieves the specified zone-specific Operations resource.
14520 pub fn get_operation(&self) -> super::builder::reservation_blocks::GetOperation {
14521 super::builder::reservation_blocks::GetOperation::new(self.inner.clone())
14522 }
14523}
14524
14525/// Implements a client for the Google Compute Engine API.
14526///
14527/// # Example
14528/// ```
14529/// # use google_cloud_compute_v1::client::ReservationSlots;
14530/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
14531/// let client = ReservationSlots::builder().build().await?;
14532/// // use `client` to make requests to the Google Compute Engine API.
14533/// # Ok(()) }
14534/// ```
14535///
14536/// # Service Description
14537///
14538/// Service for the `reservationSlots` resource.
14539///
14540/// # Configuration
14541///
14542/// To configure `ReservationSlots` use the `with_*` methods in the type returned
14543/// by [builder()][ReservationSlots::builder]. The default configuration should
14544/// work for most applications. Common configuration changes include
14545///
14546/// * [with_endpoint()]: by default this client uses the global default endpoint
14547/// (`https://compute.googleapis.com`). Applications using regional
14548/// endpoints or running in restricted networks (e.g. a network configured
14549// with [Private Google Access with VPC Service Controls]) may want to
14550/// override this default.
14551/// * [with_credentials()]: by default this client uses
14552/// [Application Default Credentials]. Applications using custom
14553/// authentication may need to override this default.
14554///
14555/// [with_endpoint()]: super::builder::reservation_slots::ClientBuilder::with_endpoint
14556/// [with_credentials()]: super::builder::reservation_slots::ClientBuilder::with_credentials
14557/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14558/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14559///
14560/// # Pooling and Cloning
14561///
14562/// `ReservationSlots` holds a connection pool internally, it is advised to
14563/// create one and reuse it. You do not need to wrap `ReservationSlots` in
14564/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14565/// already uses an `Arc` internally.
14566#[cfg(feature = "reservation-slots")]
14567#[cfg_attr(docsrs, doc(cfg(feature = "reservation-slots")))]
14568#[derive(Clone, Debug)]
14569pub struct ReservationSlots {
14570 inner: std::sync::Arc<dyn super::stub::dynamic::ReservationSlots>,
14571}
14572
14573#[cfg(feature = "reservation-slots")]
14574impl ReservationSlots {
14575 /// Returns a builder for [ReservationSlots].
14576 ///
14577 /// ```
14578 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14579 /// # use google_cloud_compute_v1::client::ReservationSlots;
14580 /// let client = ReservationSlots::builder().build().await?;
14581 /// # Ok(()) }
14582 /// ```
14583 pub fn builder() -> super::builder::reservation_slots::ClientBuilder {
14584 crate::new_client_builder(super::builder::reservation_slots::client::Factory)
14585 }
14586
14587 /// Creates a new client from the provided stub.
14588 ///
14589 /// The most common case for calling this function is in tests mocking the
14590 /// client's behavior.
14591 pub fn from_stub<T>(stub: T) -> Self
14592 where
14593 T: super::stub::ReservationSlots + 'static,
14594 {
14595 Self {
14596 inner: std::sync::Arc::new(stub),
14597 }
14598 }
14599
14600 pub(crate) async fn new(
14601 config: gaxi::options::ClientConfig,
14602 ) -> crate::ClientBuilderResult<Self> {
14603 let inner = Self::build_inner(config).await?;
14604 Ok(Self { inner })
14605 }
14606
14607 async fn build_inner(
14608 conf: gaxi::options::ClientConfig,
14609 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ReservationSlots>>
14610 {
14611 if gaxi::options::tracing_enabled(&conf) {
14612 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14613 }
14614 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14615 }
14616
14617 async fn build_transport(
14618 conf: gaxi::options::ClientConfig,
14619 ) -> crate::ClientBuilderResult<impl super::stub::ReservationSlots> {
14620 super::transport::ReservationSlots::new(conf).await
14621 }
14622
14623 async fn build_with_tracing(
14624 conf: gaxi::options::ClientConfig,
14625 ) -> crate::ClientBuilderResult<impl super::stub::ReservationSlots> {
14626 Self::build_transport(conf)
14627 .await
14628 .map(super::tracing::ReservationSlots::new)
14629 }
14630
14631 /// Retrieves information about the specified reservation slot.
14632 pub fn get(&self) -> super::builder::reservation_slots::Get {
14633 super::builder::reservation_slots::Get::new(self.inner.clone())
14634 }
14635
14636 /// Allows customers to get SBOM versions of a reservation slot.
14637 pub fn get_version(&self) -> super::builder::reservation_slots::GetVersion {
14638 super::builder::reservation_slots::GetVersion::new(self.inner.clone())
14639 }
14640
14641 /// Retrieves a list of reservation slots under a single reservation.
14642 pub fn list(&self) -> super::builder::reservation_slots::List {
14643 super::builder::reservation_slots::List::new(self.inner.clone())
14644 }
14645
14646 /// Update a reservation slot in the specified sub-block.
14647 pub fn update(&self) -> super::builder::reservation_slots::Update {
14648 super::builder::reservation_slots::Update::new(self.inner.clone())
14649 }
14650
14651 /// Retrieves the specified zone-specific Operations resource.
14652 pub fn get_operation(&self) -> super::builder::reservation_slots::GetOperation {
14653 super::builder::reservation_slots::GetOperation::new(self.inner.clone())
14654 }
14655}
14656
14657/// Implements a client for the Google Compute Engine API.
14658///
14659/// # Example
14660/// ```
14661/// # use google_cloud_compute_v1::client::ReservationSubBlocks;
14662/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
14663/// let client = ReservationSubBlocks::builder().build().await?;
14664/// // use `client` to make requests to the Google Compute Engine API.
14665/// # Ok(()) }
14666/// ```
14667///
14668/// # Service Description
14669///
14670/// Service for the `reservationSubBlocks` resource.
14671///
14672/// # Configuration
14673///
14674/// To configure `ReservationSubBlocks` use the `with_*` methods in the type returned
14675/// by [builder()][ReservationSubBlocks::builder]. The default configuration should
14676/// work for most applications. Common configuration changes include
14677///
14678/// * [with_endpoint()]: by default this client uses the global default endpoint
14679/// (`https://compute.googleapis.com`). Applications using regional
14680/// endpoints or running in restricted networks (e.g. a network configured
14681// with [Private Google Access with VPC Service Controls]) may want to
14682/// override this default.
14683/// * [with_credentials()]: by default this client uses
14684/// [Application Default Credentials]. Applications using custom
14685/// authentication may need to override this default.
14686///
14687/// [with_endpoint()]: super::builder::reservation_sub_blocks::ClientBuilder::with_endpoint
14688/// [with_credentials()]: super::builder::reservation_sub_blocks::ClientBuilder::with_credentials
14689/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14690/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14691///
14692/// # Pooling and Cloning
14693///
14694/// `ReservationSubBlocks` holds a connection pool internally, it is advised to
14695/// create one and reuse it. You do not need to wrap `ReservationSubBlocks` in
14696/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14697/// already uses an `Arc` internally.
14698#[cfg(feature = "reservation-sub-blocks")]
14699#[cfg_attr(docsrs, doc(cfg(feature = "reservation-sub-blocks")))]
14700#[derive(Clone, Debug)]
14701pub struct ReservationSubBlocks {
14702 inner: std::sync::Arc<dyn super::stub::dynamic::ReservationSubBlocks>,
14703}
14704
14705#[cfg(feature = "reservation-sub-blocks")]
14706impl ReservationSubBlocks {
14707 /// Returns a builder for [ReservationSubBlocks].
14708 ///
14709 /// ```
14710 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14711 /// # use google_cloud_compute_v1::client::ReservationSubBlocks;
14712 /// let client = ReservationSubBlocks::builder().build().await?;
14713 /// # Ok(()) }
14714 /// ```
14715 pub fn builder() -> super::builder::reservation_sub_blocks::ClientBuilder {
14716 crate::new_client_builder(super::builder::reservation_sub_blocks::client::Factory)
14717 }
14718
14719 /// Creates a new client from the provided stub.
14720 ///
14721 /// The most common case for calling this function is in tests mocking the
14722 /// client's behavior.
14723 pub fn from_stub<T>(stub: T) -> Self
14724 where
14725 T: super::stub::ReservationSubBlocks + 'static,
14726 {
14727 Self {
14728 inner: std::sync::Arc::new(stub),
14729 }
14730 }
14731
14732 pub(crate) async fn new(
14733 config: gaxi::options::ClientConfig,
14734 ) -> crate::ClientBuilderResult<Self> {
14735 let inner = Self::build_inner(config).await?;
14736 Ok(Self { inner })
14737 }
14738
14739 async fn build_inner(
14740 conf: gaxi::options::ClientConfig,
14741 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ReservationSubBlocks>>
14742 {
14743 if gaxi::options::tracing_enabled(&conf) {
14744 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14745 }
14746 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14747 }
14748
14749 async fn build_transport(
14750 conf: gaxi::options::ClientConfig,
14751 ) -> crate::ClientBuilderResult<impl super::stub::ReservationSubBlocks> {
14752 super::transport::ReservationSubBlocks::new(conf).await
14753 }
14754
14755 async fn build_with_tracing(
14756 conf: gaxi::options::ClientConfig,
14757 ) -> crate::ClientBuilderResult<impl super::stub::ReservationSubBlocks> {
14758 Self::build_transport(conf)
14759 .await
14760 .map(super::tracing::ReservationSubBlocks::new)
14761 }
14762
14763 /// Retrieves information about the specified reservation subBlock.
14764 pub fn get(&self) -> super::builder::reservation_sub_blocks::Get {
14765 super::builder::reservation_sub_blocks::Get::new(self.inner.clone())
14766 }
14767
14768 /// Gets the access control policy for a resource. May be empty if no such
14769 /// policy or resource exists.
14770 pub fn get_iam_policy(&self) -> super::builder::reservation_sub_blocks::GetIamPolicy {
14771 super::builder::reservation_sub_blocks::GetIamPolicy::new(self.inner.clone())
14772 }
14773
14774 /// Allows customers to get SBOM versions of a reservation subBlock.
14775 pub fn get_version(&self) -> super::builder::reservation_sub_blocks::GetVersion {
14776 super::builder::reservation_sub_blocks::GetVersion::new(self.inner.clone())
14777 }
14778
14779 /// Retrieves a list of reservation subBlocks under a single reservation.
14780 pub fn list(&self) -> super::builder::reservation_sub_blocks::List {
14781 super::builder::reservation_sub_blocks::List::new(self.inner.clone())
14782 }
14783
14784 /// Allows customers to perform maintenance on a reservation subBlock
14785 pub fn perform_maintenance(
14786 &self,
14787 ) -> super::builder::reservation_sub_blocks::PerformMaintenance {
14788 super::builder::reservation_sub_blocks::PerformMaintenance::new(self.inner.clone())
14789 }
14790
14791 /// Allows customers to report a faulty subBlock.
14792 pub fn report_faulty(&self) -> super::builder::reservation_sub_blocks::ReportFaulty {
14793 super::builder::reservation_sub_blocks::ReportFaulty::new(self.inner.clone())
14794 }
14795
14796 /// Sets the access control policy on the specified resource.
14797 /// Replaces any existing policy.
14798 pub fn set_iam_policy(&self) -> super::builder::reservation_sub_blocks::SetIamPolicy {
14799 super::builder::reservation_sub_blocks::SetIamPolicy::new(self.inner.clone())
14800 }
14801
14802 /// Returns permissions that a caller has on the specified resource.
14803 pub fn test_iam_permissions(
14804 &self,
14805 ) -> super::builder::reservation_sub_blocks::TestIamPermissions {
14806 super::builder::reservation_sub_blocks::TestIamPermissions::new(self.inner.clone())
14807 }
14808
14809 /// Retrieves the specified zone-specific Operations resource.
14810 pub fn get_operation(&self) -> super::builder::reservation_sub_blocks::GetOperation {
14811 super::builder::reservation_sub_blocks::GetOperation::new(self.inner.clone())
14812 }
14813}
14814
14815/// Implements a client for the Google Compute Engine API.
14816///
14817/// # Example
14818/// ```
14819/// # use google_cloud_compute_v1::client::Reservations;
14820/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
14821/// let client = Reservations::builder().build().await?;
14822/// // use `client` to make requests to the Google Compute Engine API.
14823/// # Ok(()) }
14824/// ```
14825///
14826/// # Service Description
14827///
14828/// Service for the `reservations` resource.
14829///
14830/// # Configuration
14831///
14832/// To configure `Reservations` use the `with_*` methods in the type returned
14833/// by [builder()][Reservations::builder]. The default configuration should
14834/// work for most applications. Common configuration changes include
14835///
14836/// * [with_endpoint()]: by default this client uses the global default endpoint
14837/// (`https://compute.googleapis.com`). Applications using regional
14838/// endpoints or running in restricted networks (e.g. a network configured
14839// with [Private Google Access with VPC Service Controls]) may want to
14840/// override this default.
14841/// * [with_credentials()]: by default this client uses
14842/// [Application Default Credentials]. Applications using custom
14843/// authentication may need to override this default.
14844///
14845/// [with_endpoint()]: super::builder::reservations::ClientBuilder::with_endpoint
14846/// [with_credentials()]: super::builder::reservations::ClientBuilder::with_credentials
14847/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14848/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14849///
14850/// # Pooling and Cloning
14851///
14852/// `Reservations` holds a connection pool internally, it is advised to
14853/// create one and reuse it. You do not need to wrap `Reservations` in
14854/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14855/// already uses an `Arc` internally.
14856#[cfg(feature = "reservations")]
14857#[cfg_attr(docsrs, doc(cfg(feature = "reservations")))]
14858#[derive(Clone, Debug)]
14859pub struct Reservations {
14860 inner: std::sync::Arc<dyn super::stub::dynamic::Reservations>,
14861}
14862
14863#[cfg(feature = "reservations")]
14864impl Reservations {
14865 /// Returns a builder for [Reservations].
14866 ///
14867 /// ```
14868 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14869 /// # use google_cloud_compute_v1::client::Reservations;
14870 /// let client = Reservations::builder().build().await?;
14871 /// # Ok(()) }
14872 /// ```
14873 pub fn builder() -> super::builder::reservations::ClientBuilder {
14874 crate::new_client_builder(super::builder::reservations::client::Factory)
14875 }
14876
14877 /// Creates a new client from the provided stub.
14878 ///
14879 /// The most common case for calling this function is in tests mocking the
14880 /// client's behavior.
14881 pub fn from_stub<T>(stub: T) -> Self
14882 where
14883 T: super::stub::Reservations + 'static,
14884 {
14885 Self {
14886 inner: std::sync::Arc::new(stub),
14887 }
14888 }
14889
14890 pub(crate) async fn new(
14891 config: gaxi::options::ClientConfig,
14892 ) -> crate::ClientBuilderResult<Self> {
14893 let inner = Self::build_inner(config).await?;
14894 Ok(Self { inner })
14895 }
14896
14897 async fn build_inner(
14898 conf: gaxi::options::ClientConfig,
14899 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Reservations>> {
14900 if gaxi::options::tracing_enabled(&conf) {
14901 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14902 }
14903 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14904 }
14905
14906 async fn build_transport(
14907 conf: gaxi::options::ClientConfig,
14908 ) -> crate::ClientBuilderResult<impl super::stub::Reservations> {
14909 super::transport::Reservations::new(conf).await
14910 }
14911
14912 async fn build_with_tracing(
14913 conf: gaxi::options::ClientConfig,
14914 ) -> crate::ClientBuilderResult<impl super::stub::Reservations> {
14915 Self::build_transport(conf)
14916 .await
14917 .map(super::tracing::Reservations::new)
14918 }
14919
14920 /// Retrieves an aggregated list of reservations.
14921 ///
14922 /// To prevent failure, it is recommended that you set the
14923 /// `returnPartialSuccess` parameter to `true`.
14924 pub fn aggregated_list(&self) -> super::builder::reservations::AggregatedList {
14925 super::builder::reservations::AggregatedList::new(self.inner.clone())
14926 }
14927
14928 /// Deletes the specified reservation.
14929 pub fn delete(&self) -> super::builder::reservations::Delete {
14930 super::builder::reservations::Delete::new(self.inner.clone())
14931 }
14932
14933 /// Retrieves information about the specified reservation.
14934 pub fn get(&self) -> super::builder::reservations::Get {
14935 super::builder::reservations::Get::new(self.inner.clone())
14936 }
14937
14938 /// Gets the access control policy for a resource. May be empty if no such
14939 /// policy or resource exists.
14940 pub fn get_iam_policy(&self) -> super::builder::reservations::GetIamPolicy {
14941 super::builder::reservations::GetIamPolicy::new(self.inner.clone())
14942 }
14943
14944 /// Creates a new reservation. For more information, readReserving zonal
14945 /// resources.
14946 pub fn insert(&self) -> super::builder::reservations::Insert {
14947 super::builder::reservations::Insert::new(self.inner.clone())
14948 }
14949
14950 /// A list of all the reservations that have been configured for the
14951 /// specified project in specified zone.
14952 pub fn list(&self) -> super::builder::reservations::List {
14953 super::builder::reservations::List::new(self.inner.clone())
14954 }
14955
14956 /// Perform maintenance on an extended reservation
14957 pub fn perform_maintenance(&self) -> super::builder::reservations::PerformMaintenance {
14958 super::builder::reservations::PerformMaintenance::new(self.inner.clone())
14959 }
14960
14961 /// Resizes the reservation (applicable to standalone reservations only). For
14962 /// more information, readModifying
14963 /// reservations.
14964 pub fn resize(&self) -> super::builder::reservations::Resize {
14965 super::builder::reservations::Resize::new(self.inner.clone())
14966 }
14967
14968 /// Sets the access control policy on the specified resource.
14969 /// Replaces any existing policy.
14970 pub fn set_iam_policy(&self) -> super::builder::reservations::SetIamPolicy {
14971 super::builder::reservations::SetIamPolicy::new(self.inner.clone())
14972 }
14973
14974 /// Returns permissions that a caller has on the specified resource.
14975 pub fn test_iam_permissions(&self) -> super::builder::reservations::TestIamPermissions {
14976 super::builder::reservations::TestIamPermissions::new(self.inner.clone())
14977 }
14978
14979 /// Update share settings of the reservation.
14980 pub fn update(&self) -> super::builder::reservations::Update {
14981 super::builder::reservations::Update::new(self.inner.clone())
14982 }
14983
14984 /// Retrieves the specified zone-specific Operations resource.
14985 pub fn get_operation(&self) -> super::builder::reservations::GetOperation {
14986 super::builder::reservations::GetOperation::new(self.inner.clone())
14987 }
14988}
14989
14990/// Implements a client for the Google Compute Engine API.
14991///
14992/// # Example
14993/// ```
14994/// # use google_cloud_compute_v1::client::ResourcePolicies;
14995/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
14996/// let client = ResourcePolicies::builder().build().await?;
14997/// // use `client` to make requests to the Google Compute Engine API.
14998/// # Ok(()) }
14999/// ```
15000///
15001/// # Service Description
15002///
15003/// Service for the `resourcePolicies` resource.
15004///
15005/// # Configuration
15006///
15007/// To configure `ResourcePolicies` use the `with_*` methods in the type returned
15008/// by [builder()][ResourcePolicies::builder]. The default configuration should
15009/// work for most applications. Common configuration changes include
15010///
15011/// * [with_endpoint()]: by default this client uses the global default endpoint
15012/// (`https://compute.googleapis.com`). Applications using regional
15013/// endpoints or running in restricted networks (e.g. a network configured
15014// with [Private Google Access with VPC Service Controls]) may want to
15015/// override this default.
15016/// * [with_credentials()]: by default this client uses
15017/// [Application Default Credentials]. Applications using custom
15018/// authentication may need to override this default.
15019///
15020/// [with_endpoint()]: super::builder::resource_policies::ClientBuilder::with_endpoint
15021/// [with_credentials()]: super::builder::resource_policies::ClientBuilder::with_credentials
15022/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15023/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15024///
15025/// # Pooling and Cloning
15026///
15027/// `ResourcePolicies` holds a connection pool internally, it is advised to
15028/// create one and reuse it. You do not need to wrap `ResourcePolicies` in
15029/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15030/// already uses an `Arc` internally.
15031#[cfg(feature = "resource-policies")]
15032#[cfg_attr(docsrs, doc(cfg(feature = "resource-policies")))]
15033#[derive(Clone, Debug)]
15034pub struct ResourcePolicies {
15035 inner: std::sync::Arc<dyn super::stub::dynamic::ResourcePolicies>,
15036}
15037
15038#[cfg(feature = "resource-policies")]
15039impl ResourcePolicies {
15040 /// Returns a builder for [ResourcePolicies].
15041 ///
15042 /// ```
15043 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15044 /// # use google_cloud_compute_v1::client::ResourcePolicies;
15045 /// let client = ResourcePolicies::builder().build().await?;
15046 /// # Ok(()) }
15047 /// ```
15048 pub fn builder() -> super::builder::resource_policies::ClientBuilder {
15049 crate::new_client_builder(super::builder::resource_policies::client::Factory)
15050 }
15051
15052 /// Creates a new client from the provided stub.
15053 ///
15054 /// The most common case for calling this function is in tests mocking the
15055 /// client's behavior.
15056 pub fn from_stub<T>(stub: T) -> Self
15057 where
15058 T: super::stub::ResourcePolicies + 'static,
15059 {
15060 Self {
15061 inner: std::sync::Arc::new(stub),
15062 }
15063 }
15064
15065 pub(crate) async fn new(
15066 config: gaxi::options::ClientConfig,
15067 ) -> crate::ClientBuilderResult<Self> {
15068 let inner = Self::build_inner(config).await?;
15069 Ok(Self { inner })
15070 }
15071
15072 async fn build_inner(
15073 conf: gaxi::options::ClientConfig,
15074 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ResourcePolicies>>
15075 {
15076 if gaxi::options::tracing_enabled(&conf) {
15077 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15078 }
15079 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15080 }
15081
15082 async fn build_transport(
15083 conf: gaxi::options::ClientConfig,
15084 ) -> crate::ClientBuilderResult<impl super::stub::ResourcePolicies> {
15085 super::transport::ResourcePolicies::new(conf).await
15086 }
15087
15088 async fn build_with_tracing(
15089 conf: gaxi::options::ClientConfig,
15090 ) -> crate::ClientBuilderResult<impl super::stub::ResourcePolicies> {
15091 Self::build_transport(conf)
15092 .await
15093 .map(super::tracing::ResourcePolicies::new)
15094 }
15095
15096 /// Retrieves an aggregated list of resource policies.
15097 ///
15098 /// To prevent failure, Google recommends that you set the
15099 /// `returnPartialSuccess` parameter to `true`.
15100 pub fn aggregated_list(&self) -> super::builder::resource_policies::AggregatedList {
15101 super::builder::resource_policies::AggregatedList::new(self.inner.clone())
15102 }
15103
15104 /// Deletes the specified resource policy.
15105 pub fn delete(&self) -> super::builder::resource_policies::Delete {
15106 super::builder::resource_policies::Delete::new(self.inner.clone())
15107 }
15108
15109 /// Retrieves all information of the specified resource policy.
15110 pub fn get(&self) -> super::builder::resource_policies::Get {
15111 super::builder::resource_policies::Get::new(self.inner.clone())
15112 }
15113
15114 /// Gets the access control policy for a resource. May be empty if no such
15115 /// policy or resource exists.
15116 pub fn get_iam_policy(&self) -> super::builder::resource_policies::GetIamPolicy {
15117 super::builder::resource_policies::GetIamPolicy::new(self.inner.clone())
15118 }
15119
15120 /// Creates a new resource policy.
15121 pub fn insert(&self) -> super::builder::resource_policies::Insert {
15122 super::builder::resource_policies::Insert::new(self.inner.clone())
15123 }
15124
15125 /// A list all the resource policies that have been configured for the
15126 /// specified project in specified region.
15127 pub fn list(&self) -> super::builder::resource_policies::List {
15128 super::builder::resource_policies::List::new(self.inner.clone())
15129 }
15130
15131 /// Modify the specified resource policy.
15132 pub fn patch(&self) -> super::builder::resource_policies::Patch {
15133 super::builder::resource_policies::Patch::new(self.inner.clone())
15134 }
15135
15136 /// Sets the access control policy on the specified resource.
15137 /// Replaces any existing policy.
15138 pub fn set_iam_policy(&self) -> super::builder::resource_policies::SetIamPolicy {
15139 super::builder::resource_policies::SetIamPolicy::new(self.inner.clone())
15140 }
15141
15142 /// Returns permissions that a caller has on the specified resource.
15143 pub fn test_iam_permissions(&self) -> super::builder::resource_policies::TestIamPermissions {
15144 super::builder::resource_policies::TestIamPermissions::new(self.inner.clone())
15145 }
15146
15147 /// Retrieves the specified region-specific Operations resource.
15148 pub fn get_operation(&self) -> super::builder::resource_policies::GetOperation {
15149 super::builder::resource_policies::GetOperation::new(self.inner.clone())
15150 }
15151}
15152
15153/// Implements a client for the Google Compute Engine API.
15154///
15155/// # Example
15156/// ```
15157/// # use google_cloud_compute_v1::client::Routers;
15158/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
15159/// let client = Routers::builder().build().await?;
15160/// // use `client` to make requests to the Google Compute Engine API.
15161/// # Ok(()) }
15162/// ```
15163///
15164/// # Service Description
15165///
15166/// Service for the `routers` resource.
15167///
15168/// # Configuration
15169///
15170/// To configure `Routers` use the `with_*` methods in the type returned
15171/// by [builder()][Routers::builder]. The default configuration should
15172/// work for most applications. Common configuration changes include
15173///
15174/// * [with_endpoint()]: by default this client uses the global default endpoint
15175/// (`https://compute.googleapis.com`). Applications using regional
15176/// endpoints or running in restricted networks (e.g. a network configured
15177// with [Private Google Access with VPC Service Controls]) may want to
15178/// override this default.
15179/// * [with_credentials()]: by default this client uses
15180/// [Application Default Credentials]. Applications using custom
15181/// authentication may need to override this default.
15182///
15183/// [with_endpoint()]: super::builder::routers::ClientBuilder::with_endpoint
15184/// [with_credentials()]: super::builder::routers::ClientBuilder::with_credentials
15185/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15186/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15187///
15188/// # Pooling and Cloning
15189///
15190/// `Routers` holds a connection pool internally, it is advised to
15191/// create one and reuse it. You do not need to wrap `Routers` in
15192/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15193/// already uses an `Arc` internally.
15194#[cfg(feature = "routers")]
15195#[cfg_attr(docsrs, doc(cfg(feature = "routers")))]
15196#[derive(Clone, Debug)]
15197pub struct Routers {
15198 inner: std::sync::Arc<dyn super::stub::dynamic::Routers>,
15199}
15200
15201#[cfg(feature = "routers")]
15202impl Routers {
15203 /// Returns a builder for [Routers].
15204 ///
15205 /// ```
15206 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15207 /// # use google_cloud_compute_v1::client::Routers;
15208 /// let client = Routers::builder().build().await?;
15209 /// # Ok(()) }
15210 /// ```
15211 pub fn builder() -> super::builder::routers::ClientBuilder {
15212 crate::new_client_builder(super::builder::routers::client::Factory)
15213 }
15214
15215 /// Creates a new client from the provided stub.
15216 ///
15217 /// The most common case for calling this function is in tests mocking the
15218 /// client's behavior.
15219 pub fn from_stub<T>(stub: T) -> Self
15220 where
15221 T: super::stub::Routers + 'static,
15222 {
15223 Self {
15224 inner: std::sync::Arc::new(stub),
15225 }
15226 }
15227
15228 pub(crate) async fn new(
15229 config: gaxi::options::ClientConfig,
15230 ) -> crate::ClientBuilderResult<Self> {
15231 let inner = Self::build_inner(config).await?;
15232 Ok(Self { inner })
15233 }
15234
15235 async fn build_inner(
15236 conf: gaxi::options::ClientConfig,
15237 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Routers>> {
15238 if gaxi::options::tracing_enabled(&conf) {
15239 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15240 }
15241 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15242 }
15243
15244 async fn build_transport(
15245 conf: gaxi::options::ClientConfig,
15246 ) -> crate::ClientBuilderResult<impl super::stub::Routers> {
15247 super::transport::Routers::new(conf).await
15248 }
15249
15250 async fn build_with_tracing(
15251 conf: gaxi::options::ClientConfig,
15252 ) -> crate::ClientBuilderResult<impl super::stub::Routers> {
15253 Self::build_transport(conf)
15254 .await
15255 .map(super::tracing::Routers::new)
15256 }
15257
15258 /// Retrieves an aggregated list of routers.
15259 ///
15260 /// To prevent failure, Google recommends that you set the
15261 /// `returnPartialSuccess` parameter to `true`.
15262 pub fn aggregated_list(&self) -> super::builder::routers::AggregatedList {
15263 super::builder::routers::AggregatedList::new(self.inner.clone())
15264 }
15265
15266 /// Deletes the specified Router resource.
15267 pub fn delete(&self) -> super::builder::routers::Delete {
15268 super::builder::routers::Delete::new(self.inner.clone())
15269 }
15270
15271 /// Deletes Route Policy
15272 pub fn delete_route_policy(&self) -> super::builder::routers::DeleteRoutePolicy {
15273 super::builder::routers::DeleteRoutePolicy::new(self.inner.clone())
15274 }
15275
15276 /// Returns the specified Router resource.
15277 pub fn get(&self) -> super::builder::routers::Get {
15278 super::builder::routers::Get::new(self.inner.clone())
15279 }
15280
15281 /// Retrieves runtime NAT IP information.
15282 pub fn get_nat_ip_info(&self) -> super::builder::routers::GetNatIpInfo {
15283 super::builder::routers::GetNatIpInfo::new(self.inner.clone())
15284 }
15285
15286 /// Retrieves runtime Nat mapping information of VM endpoints.
15287 pub fn get_nat_mapping_info(&self) -> super::builder::routers::GetNatMappingInfo {
15288 super::builder::routers::GetNatMappingInfo::new(self.inner.clone())
15289 }
15290
15291 /// Returns specified Route Policy
15292 pub fn get_route_policy(&self) -> super::builder::routers::GetRoutePolicy {
15293 super::builder::routers::GetRoutePolicy::new(self.inner.clone())
15294 }
15295
15296 /// Retrieves runtime information of the specified router.
15297 pub fn get_router_status(&self) -> super::builder::routers::GetRouterStatus {
15298 super::builder::routers::GetRouterStatus::new(self.inner.clone())
15299 }
15300
15301 /// Creates a Router resource in the specified project and region using
15302 /// the data included in the request.
15303 pub fn insert(&self) -> super::builder::routers::Insert {
15304 super::builder::routers::Insert::new(self.inner.clone())
15305 }
15306
15307 /// Retrieves a list of Router resources available to the specified project.
15308 pub fn list(&self) -> super::builder::routers::List {
15309 super::builder::routers::List::new(self.inner.clone())
15310 }
15311
15312 /// Retrieves a list of router bgp routes available to the specified project.
15313 pub fn list_bgp_routes(&self) -> super::builder::routers::ListBgpRoutes {
15314 super::builder::routers::ListBgpRoutes::new(self.inner.clone())
15315 }
15316
15317 /// Retrieves a list of router route policy subresources available to the
15318 /// specified project.
15319 pub fn list_route_policies(&self) -> super::builder::routers::ListRoutePolicies {
15320 super::builder::routers::ListRoutePolicies::new(self.inner.clone())
15321 }
15322
15323 /// Patches the specified Router resource with the data included in the
15324 /// request. This method supportsPATCH
15325 /// semantics and usesJSON merge
15326 /// patch format and processing rules.
15327 pub fn patch(&self) -> super::builder::routers::Patch {
15328 super::builder::routers::Patch::new(self.inner.clone())
15329 }
15330
15331 /// Patches Route Policy
15332 pub fn patch_route_policy(&self) -> super::builder::routers::PatchRoutePolicy {
15333 super::builder::routers::PatchRoutePolicy::new(self.inner.clone())
15334 }
15335
15336 /// Preview fields auto-generated during router create andupdate operations.
15337 /// Calling this method does NOT create or update the router.
15338 pub fn preview(&self) -> super::builder::routers::Preview {
15339 super::builder::routers::Preview::new(self.inner.clone())
15340 }
15341
15342 /// Updates the specified Router resource with the data included in the
15343 /// request. This method conforms toPUT semantics, which requests that the state of the
15344 /// target resource be created or replaced with the state defined by the
15345 /// representation enclosed in the request message payload.
15346 pub fn update(&self) -> super::builder::routers::Update {
15347 super::builder::routers::Update::new(self.inner.clone())
15348 }
15349
15350 /// Updates or creates new Route Policy
15351 pub fn update_route_policy(&self) -> super::builder::routers::UpdateRoutePolicy {
15352 super::builder::routers::UpdateRoutePolicy::new(self.inner.clone())
15353 }
15354
15355 /// Retrieves the specified region-specific Operations resource.
15356 pub fn get_operation(&self) -> super::builder::routers::GetOperation {
15357 super::builder::routers::GetOperation::new(self.inner.clone())
15358 }
15359}
15360
15361/// Implements a client for the Google Compute Engine API.
15362///
15363/// # Example
15364/// ```
15365/// # use google_cloud_compute_v1::client::Routes;
15366/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
15367/// let client = Routes::builder().build().await?;
15368/// // use `client` to make requests to the Google Compute Engine API.
15369/// # Ok(()) }
15370/// ```
15371///
15372/// # Service Description
15373///
15374/// Service for the `routes` resource.
15375///
15376/// # Configuration
15377///
15378/// To configure `Routes` use the `with_*` methods in the type returned
15379/// by [builder()][Routes::builder]. The default configuration should
15380/// work for most applications. Common configuration changes include
15381///
15382/// * [with_endpoint()]: by default this client uses the global default endpoint
15383/// (`https://compute.googleapis.com`). Applications using regional
15384/// endpoints or running in restricted networks (e.g. a network configured
15385// with [Private Google Access with VPC Service Controls]) may want to
15386/// override this default.
15387/// * [with_credentials()]: by default this client uses
15388/// [Application Default Credentials]. Applications using custom
15389/// authentication may need to override this default.
15390///
15391/// [with_endpoint()]: super::builder::routes::ClientBuilder::with_endpoint
15392/// [with_credentials()]: super::builder::routes::ClientBuilder::with_credentials
15393/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15394/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15395///
15396/// # Pooling and Cloning
15397///
15398/// `Routes` holds a connection pool internally, it is advised to
15399/// create one and reuse it. You do not need to wrap `Routes` in
15400/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15401/// already uses an `Arc` internally.
15402#[cfg(feature = "routes")]
15403#[cfg_attr(docsrs, doc(cfg(feature = "routes")))]
15404#[derive(Clone, Debug)]
15405pub struct Routes {
15406 inner: std::sync::Arc<dyn super::stub::dynamic::Routes>,
15407}
15408
15409#[cfg(feature = "routes")]
15410impl Routes {
15411 /// Returns a builder for [Routes].
15412 ///
15413 /// ```
15414 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15415 /// # use google_cloud_compute_v1::client::Routes;
15416 /// let client = Routes::builder().build().await?;
15417 /// # Ok(()) }
15418 /// ```
15419 pub fn builder() -> super::builder::routes::ClientBuilder {
15420 crate::new_client_builder(super::builder::routes::client::Factory)
15421 }
15422
15423 /// Creates a new client from the provided stub.
15424 ///
15425 /// The most common case for calling this function is in tests mocking the
15426 /// client's behavior.
15427 pub fn from_stub<T>(stub: T) -> Self
15428 where
15429 T: super::stub::Routes + 'static,
15430 {
15431 Self {
15432 inner: std::sync::Arc::new(stub),
15433 }
15434 }
15435
15436 pub(crate) async fn new(
15437 config: gaxi::options::ClientConfig,
15438 ) -> crate::ClientBuilderResult<Self> {
15439 let inner = Self::build_inner(config).await?;
15440 Ok(Self { inner })
15441 }
15442
15443 async fn build_inner(
15444 conf: gaxi::options::ClientConfig,
15445 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Routes>> {
15446 if gaxi::options::tracing_enabled(&conf) {
15447 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15448 }
15449 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15450 }
15451
15452 async fn build_transport(
15453 conf: gaxi::options::ClientConfig,
15454 ) -> crate::ClientBuilderResult<impl super::stub::Routes> {
15455 super::transport::Routes::new(conf).await
15456 }
15457
15458 async fn build_with_tracing(
15459 conf: gaxi::options::ClientConfig,
15460 ) -> crate::ClientBuilderResult<impl super::stub::Routes> {
15461 Self::build_transport(conf)
15462 .await
15463 .map(super::tracing::Routes::new)
15464 }
15465
15466 /// Deletes the specified Route resource.
15467 pub fn delete(&self) -> super::builder::routes::Delete {
15468 super::builder::routes::Delete::new(self.inner.clone())
15469 }
15470
15471 /// Returns the specified Route resource.
15472 pub fn get(&self) -> super::builder::routes::Get {
15473 super::builder::routes::Get::new(self.inner.clone())
15474 }
15475
15476 /// Creates a Route resource in the specified project using the data included
15477 /// in the request.
15478 pub fn insert(&self) -> super::builder::routes::Insert {
15479 super::builder::routes::Insert::new(self.inner.clone())
15480 }
15481
15482 /// Retrieves the list of Route resources available to the specified project.
15483 pub fn list(&self) -> super::builder::routes::List {
15484 super::builder::routes::List::new(self.inner.clone())
15485 }
15486
15487 /// Returns permissions that a caller has on the specified resource.
15488 pub fn test_iam_permissions(&self) -> super::builder::routes::TestIamPermissions {
15489 super::builder::routes::TestIamPermissions::new(self.inner.clone())
15490 }
15491
15492 /// Retrieves the specified Operations resource.
15493 pub fn get_operation(&self) -> super::builder::routes::GetOperation {
15494 super::builder::routes::GetOperation::new(self.inner.clone())
15495 }
15496}
15497
15498/// Implements a client for the Google Compute Engine API.
15499///
15500/// # Example
15501/// ```
15502/// # use google_cloud_compute_v1::client::SecurityPolicies;
15503/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
15504/// let client = SecurityPolicies::builder().build().await?;
15505/// // use `client` to make requests to the Google Compute Engine API.
15506/// # Ok(()) }
15507/// ```
15508///
15509/// # Service Description
15510///
15511/// Service for the `securityPolicies` resource.
15512///
15513/// # Configuration
15514///
15515/// To configure `SecurityPolicies` use the `with_*` methods in the type returned
15516/// by [builder()][SecurityPolicies::builder]. The default configuration should
15517/// work for most applications. Common configuration changes include
15518///
15519/// * [with_endpoint()]: by default this client uses the global default endpoint
15520/// (`https://compute.googleapis.com`). Applications using regional
15521/// endpoints or running in restricted networks (e.g. a network configured
15522// with [Private Google Access with VPC Service Controls]) may want to
15523/// override this default.
15524/// * [with_credentials()]: by default this client uses
15525/// [Application Default Credentials]. Applications using custom
15526/// authentication may need to override this default.
15527///
15528/// [with_endpoint()]: super::builder::security_policies::ClientBuilder::with_endpoint
15529/// [with_credentials()]: super::builder::security_policies::ClientBuilder::with_credentials
15530/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15531/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15532///
15533/// # Pooling and Cloning
15534///
15535/// `SecurityPolicies` holds a connection pool internally, it is advised to
15536/// create one and reuse it. You do not need to wrap `SecurityPolicies` in
15537/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15538/// already uses an `Arc` internally.
15539#[cfg(feature = "security-policies")]
15540#[cfg_attr(docsrs, doc(cfg(feature = "security-policies")))]
15541#[derive(Clone, Debug)]
15542pub struct SecurityPolicies {
15543 inner: std::sync::Arc<dyn super::stub::dynamic::SecurityPolicies>,
15544}
15545
15546#[cfg(feature = "security-policies")]
15547impl SecurityPolicies {
15548 /// Returns a builder for [SecurityPolicies].
15549 ///
15550 /// ```
15551 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15552 /// # use google_cloud_compute_v1::client::SecurityPolicies;
15553 /// let client = SecurityPolicies::builder().build().await?;
15554 /// # Ok(()) }
15555 /// ```
15556 pub fn builder() -> super::builder::security_policies::ClientBuilder {
15557 crate::new_client_builder(super::builder::security_policies::client::Factory)
15558 }
15559
15560 /// Creates a new client from the provided stub.
15561 ///
15562 /// The most common case for calling this function is in tests mocking the
15563 /// client's behavior.
15564 pub fn from_stub<T>(stub: T) -> Self
15565 where
15566 T: super::stub::SecurityPolicies + 'static,
15567 {
15568 Self {
15569 inner: std::sync::Arc::new(stub),
15570 }
15571 }
15572
15573 pub(crate) async fn new(
15574 config: gaxi::options::ClientConfig,
15575 ) -> crate::ClientBuilderResult<Self> {
15576 let inner = Self::build_inner(config).await?;
15577 Ok(Self { inner })
15578 }
15579
15580 async fn build_inner(
15581 conf: gaxi::options::ClientConfig,
15582 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SecurityPolicies>>
15583 {
15584 if gaxi::options::tracing_enabled(&conf) {
15585 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15586 }
15587 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15588 }
15589
15590 async fn build_transport(
15591 conf: gaxi::options::ClientConfig,
15592 ) -> crate::ClientBuilderResult<impl super::stub::SecurityPolicies> {
15593 super::transport::SecurityPolicies::new(conf).await
15594 }
15595
15596 async fn build_with_tracing(
15597 conf: gaxi::options::ClientConfig,
15598 ) -> crate::ClientBuilderResult<impl super::stub::SecurityPolicies> {
15599 Self::build_transport(conf)
15600 .await
15601 .map(super::tracing::SecurityPolicies::new)
15602 }
15603
15604 /// Inserts a rule into a security policy.
15605 pub fn add_rule(&self) -> super::builder::security_policies::AddRule {
15606 super::builder::security_policies::AddRule::new(self.inner.clone())
15607 }
15608
15609 /// Retrieves the list of all SecurityPolicy resources, regional and global,
15610 /// available to the specified project.
15611 ///
15612 /// To prevent failure, Google recommends that you set the
15613 /// `returnPartialSuccess` parameter to `true`.
15614 pub fn aggregated_list(&self) -> super::builder::security_policies::AggregatedList {
15615 super::builder::security_policies::AggregatedList::new(self.inner.clone())
15616 }
15617
15618 /// Deletes the specified policy.
15619 pub fn delete(&self) -> super::builder::security_policies::Delete {
15620 super::builder::security_policies::Delete::new(self.inner.clone())
15621 }
15622
15623 /// List all of the ordered rules present in a single specified policy.
15624 pub fn get(&self) -> super::builder::security_policies::Get {
15625 super::builder::security_policies::Get::new(self.inner.clone())
15626 }
15627
15628 /// Gets a rule at the specified priority.
15629 pub fn get_rule(&self) -> super::builder::security_policies::GetRule {
15630 super::builder::security_policies::GetRule::new(self.inner.clone())
15631 }
15632
15633 /// Creates a new policy in the specified project using the data included in
15634 /// the request.
15635 pub fn insert(&self) -> super::builder::security_policies::Insert {
15636 super::builder::security_policies::Insert::new(self.inner.clone())
15637 }
15638
15639 /// List all the policies that have been configured for the specified project.
15640 pub fn list(&self) -> super::builder::security_policies::List {
15641 super::builder::security_policies::List::new(self.inner.clone())
15642 }
15643
15644 /// Gets the current list of preconfigured Web Application Firewall (WAF)
15645 /// expressions.
15646 pub fn list_preconfigured_expression_sets(
15647 &self,
15648 ) -> super::builder::security_policies::ListPreconfiguredExpressionSets {
15649 super::builder::security_policies::ListPreconfiguredExpressionSets::new(self.inner.clone())
15650 }
15651
15652 /// Patches the specified policy with the data included in the request. To
15653 /// clear fields in the policy, leave the fields empty and specify them in the
15654 /// updateMask. This cannot be used to be update the rules in the policy.
15655 /// Please use the per rule methods like addRule, patchRule, and removeRule
15656 /// instead.
15657 pub fn patch(&self) -> super::builder::security_policies::Patch {
15658 super::builder::security_policies::Patch::new(self.inner.clone())
15659 }
15660
15661 /// Patches a rule at the specified priority. To clear fields in the rule,
15662 /// leave the fields empty and specify them in the updateMask.
15663 pub fn patch_rule(&self) -> super::builder::security_policies::PatchRule {
15664 super::builder::security_policies::PatchRule::new(self.inner.clone())
15665 }
15666
15667 /// Deletes a rule at the specified priority.
15668 pub fn remove_rule(&self) -> super::builder::security_policies::RemoveRule {
15669 super::builder::security_policies::RemoveRule::new(self.inner.clone())
15670 }
15671
15672 /// Sets the labels on a security policy. To learn more about labels,
15673 /// read the Labeling Resources
15674 /// documentation.
15675 pub fn set_labels(&self) -> super::builder::security_policies::SetLabels {
15676 super::builder::security_policies::SetLabels::new(self.inner.clone())
15677 }
15678
15679 /// Retrieves the specified Operations resource.
15680 pub fn get_operation(&self) -> super::builder::security_policies::GetOperation {
15681 super::builder::security_policies::GetOperation::new(self.inner.clone())
15682 }
15683}
15684
15685/// Implements a client for the Google Compute Engine API.
15686///
15687/// # Example
15688/// ```
15689/// # use google_cloud_compute_v1::client::ServiceAttachments;
15690/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
15691/// let client = ServiceAttachments::builder().build().await?;
15692/// // use `client` to make requests to the Google Compute Engine API.
15693/// # Ok(()) }
15694/// ```
15695///
15696/// # Service Description
15697///
15698/// Service for the `serviceAttachments` resource.
15699///
15700/// # Configuration
15701///
15702/// To configure `ServiceAttachments` use the `with_*` methods in the type returned
15703/// by [builder()][ServiceAttachments::builder]. The default configuration should
15704/// work for most applications. Common configuration changes include
15705///
15706/// * [with_endpoint()]: by default this client uses the global default endpoint
15707/// (`https://compute.googleapis.com`). Applications using regional
15708/// endpoints or running in restricted networks (e.g. a network configured
15709// with [Private Google Access with VPC Service Controls]) may want to
15710/// override this default.
15711/// * [with_credentials()]: by default this client uses
15712/// [Application Default Credentials]. Applications using custom
15713/// authentication may need to override this default.
15714///
15715/// [with_endpoint()]: super::builder::service_attachments::ClientBuilder::with_endpoint
15716/// [with_credentials()]: super::builder::service_attachments::ClientBuilder::with_credentials
15717/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15718/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15719///
15720/// # Pooling and Cloning
15721///
15722/// `ServiceAttachments` holds a connection pool internally, it is advised to
15723/// create one and reuse it. You do not need to wrap `ServiceAttachments` in
15724/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15725/// already uses an `Arc` internally.
15726#[cfg(feature = "service-attachments")]
15727#[cfg_attr(docsrs, doc(cfg(feature = "service-attachments")))]
15728#[derive(Clone, Debug)]
15729pub struct ServiceAttachments {
15730 inner: std::sync::Arc<dyn super::stub::dynamic::ServiceAttachments>,
15731}
15732
15733#[cfg(feature = "service-attachments")]
15734impl ServiceAttachments {
15735 /// Returns a builder for [ServiceAttachments].
15736 ///
15737 /// ```
15738 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15739 /// # use google_cloud_compute_v1::client::ServiceAttachments;
15740 /// let client = ServiceAttachments::builder().build().await?;
15741 /// # Ok(()) }
15742 /// ```
15743 pub fn builder() -> super::builder::service_attachments::ClientBuilder {
15744 crate::new_client_builder(super::builder::service_attachments::client::Factory)
15745 }
15746
15747 /// Creates a new client from the provided stub.
15748 ///
15749 /// The most common case for calling this function is in tests mocking the
15750 /// client's behavior.
15751 pub fn from_stub<T>(stub: T) -> Self
15752 where
15753 T: super::stub::ServiceAttachments + 'static,
15754 {
15755 Self {
15756 inner: std::sync::Arc::new(stub),
15757 }
15758 }
15759
15760 pub(crate) async fn new(
15761 config: gaxi::options::ClientConfig,
15762 ) -> crate::ClientBuilderResult<Self> {
15763 let inner = Self::build_inner(config).await?;
15764 Ok(Self { inner })
15765 }
15766
15767 async fn build_inner(
15768 conf: gaxi::options::ClientConfig,
15769 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ServiceAttachments>>
15770 {
15771 if gaxi::options::tracing_enabled(&conf) {
15772 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15773 }
15774 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15775 }
15776
15777 async fn build_transport(
15778 conf: gaxi::options::ClientConfig,
15779 ) -> crate::ClientBuilderResult<impl super::stub::ServiceAttachments> {
15780 super::transport::ServiceAttachments::new(conf).await
15781 }
15782
15783 async fn build_with_tracing(
15784 conf: gaxi::options::ClientConfig,
15785 ) -> crate::ClientBuilderResult<impl super::stub::ServiceAttachments> {
15786 Self::build_transport(conf)
15787 .await
15788 .map(super::tracing::ServiceAttachments::new)
15789 }
15790
15791 /// Retrieves the list of all ServiceAttachment resources,
15792 /// regional and global, available to the specified project.
15793 ///
15794 /// To prevent failure, Google recommends that you set the
15795 /// `returnPartialSuccess` parameter to `true`.
15796 pub fn aggregated_list(&self) -> super::builder::service_attachments::AggregatedList {
15797 super::builder::service_attachments::AggregatedList::new(self.inner.clone())
15798 }
15799
15800 /// Deletes the specified ServiceAttachment in the given scope
15801 pub fn delete(&self) -> super::builder::service_attachments::Delete {
15802 super::builder::service_attachments::Delete::new(self.inner.clone())
15803 }
15804
15805 /// Returns the specified ServiceAttachment resource in the given scope.
15806 pub fn get(&self) -> super::builder::service_attachments::Get {
15807 super::builder::service_attachments::Get::new(self.inner.clone())
15808 }
15809
15810 /// Gets the access control policy for a resource. May be empty if no such
15811 /// policy or resource exists.
15812 pub fn get_iam_policy(&self) -> super::builder::service_attachments::GetIamPolicy {
15813 super::builder::service_attachments::GetIamPolicy::new(self.inner.clone())
15814 }
15815
15816 /// Creates a ServiceAttachment in the specified project in the given scope
15817 /// using the parameters that are included in the request.
15818 pub fn insert(&self) -> super::builder::service_attachments::Insert {
15819 super::builder::service_attachments::Insert::new(self.inner.clone())
15820 }
15821
15822 /// Lists the ServiceAttachments for a project in the given scope.
15823 pub fn list(&self) -> super::builder::service_attachments::List {
15824 super::builder::service_attachments::List::new(self.inner.clone())
15825 }
15826
15827 /// Patches the specified ServiceAttachment resource with the data included in
15828 /// the request. This method supports PATCH
15829 /// semantics and usesJSON merge
15830 /// patch format and processing rules.
15831 pub fn patch(&self) -> super::builder::service_attachments::Patch {
15832 super::builder::service_attachments::Patch::new(self.inner.clone())
15833 }
15834
15835 /// Sets the access control policy on the specified resource.
15836 /// Replaces any existing policy.
15837 pub fn set_iam_policy(&self) -> super::builder::service_attachments::SetIamPolicy {
15838 super::builder::service_attachments::SetIamPolicy::new(self.inner.clone())
15839 }
15840
15841 /// Returns permissions that a caller has on the specified resource.
15842 pub fn test_iam_permissions(&self) -> super::builder::service_attachments::TestIamPermissions {
15843 super::builder::service_attachments::TestIamPermissions::new(self.inner.clone())
15844 }
15845
15846 /// Retrieves the specified region-specific Operations resource.
15847 pub fn get_operation(&self) -> super::builder::service_attachments::GetOperation {
15848 super::builder::service_attachments::GetOperation::new(self.inner.clone())
15849 }
15850}
15851
15852/// Implements a client for the Google Compute Engine API.
15853///
15854/// # Example
15855/// ```
15856/// # use google_cloud_compute_v1::client::SnapshotSettings;
15857/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
15858/// let client = SnapshotSettings::builder().build().await?;
15859/// // use `client` to make requests to the Google Compute Engine API.
15860/// # Ok(()) }
15861/// ```
15862///
15863/// # Service Description
15864///
15865/// Service for the `snapshotSettings` resource.
15866///
15867/// # Configuration
15868///
15869/// To configure `SnapshotSettings` use the `with_*` methods in the type returned
15870/// by [builder()][SnapshotSettings::builder]. The default configuration should
15871/// work for most applications. Common configuration changes include
15872///
15873/// * [with_endpoint()]: by default this client uses the global default endpoint
15874/// (`https://compute.googleapis.com`). Applications using regional
15875/// endpoints or running in restricted networks (e.g. a network configured
15876// with [Private Google Access with VPC Service Controls]) may want to
15877/// override this default.
15878/// * [with_credentials()]: by default this client uses
15879/// [Application Default Credentials]. Applications using custom
15880/// authentication may need to override this default.
15881///
15882/// [with_endpoint()]: super::builder::snapshot_settings::ClientBuilder::with_endpoint
15883/// [with_credentials()]: super::builder::snapshot_settings::ClientBuilder::with_credentials
15884/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15885/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15886///
15887/// # Pooling and Cloning
15888///
15889/// `SnapshotSettings` holds a connection pool internally, it is advised to
15890/// create one and reuse it. You do not need to wrap `SnapshotSettings` in
15891/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15892/// already uses an `Arc` internally.
15893#[cfg(feature = "snapshot-settings")]
15894#[cfg_attr(docsrs, doc(cfg(feature = "snapshot-settings")))]
15895#[derive(Clone, Debug)]
15896pub struct SnapshotSettings {
15897 inner: std::sync::Arc<dyn super::stub::dynamic::SnapshotSettings>,
15898}
15899
15900#[cfg(feature = "snapshot-settings")]
15901impl SnapshotSettings {
15902 /// Returns a builder for [SnapshotSettings].
15903 ///
15904 /// ```
15905 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15906 /// # use google_cloud_compute_v1::client::SnapshotSettings;
15907 /// let client = SnapshotSettings::builder().build().await?;
15908 /// # Ok(()) }
15909 /// ```
15910 pub fn builder() -> super::builder::snapshot_settings::ClientBuilder {
15911 crate::new_client_builder(super::builder::snapshot_settings::client::Factory)
15912 }
15913
15914 /// Creates a new client from the provided stub.
15915 ///
15916 /// The most common case for calling this function is in tests mocking the
15917 /// client's behavior.
15918 pub fn from_stub<T>(stub: T) -> Self
15919 where
15920 T: super::stub::SnapshotSettings + 'static,
15921 {
15922 Self {
15923 inner: std::sync::Arc::new(stub),
15924 }
15925 }
15926
15927 pub(crate) async fn new(
15928 config: gaxi::options::ClientConfig,
15929 ) -> crate::ClientBuilderResult<Self> {
15930 let inner = Self::build_inner(config).await?;
15931 Ok(Self { inner })
15932 }
15933
15934 async fn build_inner(
15935 conf: gaxi::options::ClientConfig,
15936 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SnapshotSettings>>
15937 {
15938 if gaxi::options::tracing_enabled(&conf) {
15939 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15940 }
15941 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15942 }
15943
15944 async fn build_transport(
15945 conf: gaxi::options::ClientConfig,
15946 ) -> crate::ClientBuilderResult<impl super::stub::SnapshotSettings> {
15947 super::transport::SnapshotSettings::new(conf).await
15948 }
15949
15950 async fn build_with_tracing(
15951 conf: gaxi::options::ClientConfig,
15952 ) -> crate::ClientBuilderResult<impl super::stub::SnapshotSettings> {
15953 Self::build_transport(conf)
15954 .await
15955 .map(super::tracing::SnapshotSettings::new)
15956 }
15957
15958 /// Get snapshot settings.
15959 pub fn get(&self) -> super::builder::snapshot_settings::Get {
15960 super::builder::snapshot_settings::Get::new(self.inner.clone())
15961 }
15962
15963 /// Patch snapshot settings.
15964 pub fn patch(&self) -> super::builder::snapshot_settings::Patch {
15965 super::builder::snapshot_settings::Patch::new(self.inner.clone())
15966 }
15967
15968 /// Retrieves the specified Operations resource.
15969 pub fn get_operation(&self) -> super::builder::snapshot_settings::GetOperation {
15970 super::builder::snapshot_settings::GetOperation::new(self.inner.clone())
15971 }
15972}
15973
15974/// Implements a client for the Google Compute Engine API.
15975///
15976/// # Example
15977/// ```
15978/// # use google_cloud_compute_v1::client::Snapshots;
15979/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
15980/// let client = Snapshots::builder().build().await?;
15981/// // use `client` to make requests to the Google Compute Engine API.
15982/// # Ok(()) }
15983/// ```
15984///
15985/// # Service Description
15986///
15987/// Service for the `snapshots` resource.
15988///
15989/// # Configuration
15990///
15991/// To configure `Snapshots` use the `with_*` methods in the type returned
15992/// by [builder()][Snapshots::builder]. The default configuration should
15993/// work for most applications. Common configuration changes include
15994///
15995/// * [with_endpoint()]: by default this client uses the global default endpoint
15996/// (`https://compute.googleapis.com`). Applications using regional
15997/// endpoints or running in restricted networks (e.g. a network configured
15998// with [Private Google Access with VPC Service Controls]) may want to
15999/// override this default.
16000/// * [with_credentials()]: by default this client uses
16001/// [Application Default Credentials]. Applications using custom
16002/// authentication may need to override this default.
16003///
16004/// [with_endpoint()]: super::builder::snapshots::ClientBuilder::with_endpoint
16005/// [with_credentials()]: super::builder::snapshots::ClientBuilder::with_credentials
16006/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16007/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16008///
16009/// # Pooling and Cloning
16010///
16011/// `Snapshots` holds a connection pool internally, it is advised to
16012/// create one and reuse it. You do not need to wrap `Snapshots` in
16013/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16014/// already uses an `Arc` internally.
16015#[cfg(feature = "snapshots")]
16016#[cfg_attr(docsrs, doc(cfg(feature = "snapshots")))]
16017#[derive(Clone, Debug)]
16018pub struct Snapshots {
16019 inner: std::sync::Arc<dyn super::stub::dynamic::Snapshots>,
16020}
16021
16022#[cfg(feature = "snapshots")]
16023impl Snapshots {
16024 /// Returns a builder for [Snapshots].
16025 ///
16026 /// ```
16027 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16028 /// # use google_cloud_compute_v1::client::Snapshots;
16029 /// let client = Snapshots::builder().build().await?;
16030 /// # Ok(()) }
16031 /// ```
16032 pub fn builder() -> super::builder::snapshots::ClientBuilder {
16033 crate::new_client_builder(super::builder::snapshots::client::Factory)
16034 }
16035
16036 /// Creates a new client from the provided stub.
16037 ///
16038 /// The most common case for calling this function is in tests mocking the
16039 /// client's behavior.
16040 pub fn from_stub<T>(stub: T) -> Self
16041 where
16042 T: super::stub::Snapshots + 'static,
16043 {
16044 Self {
16045 inner: std::sync::Arc::new(stub),
16046 }
16047 }
16048
16049 pub(crate) async fn new(
16050 config: gaxi::options::ClientConfig,
16051 ) -> crate::ClientBuilderResult<Self> {
16052 let inner = Self::build_inner(config).await?;
16053 Ok(Self { inner })
16054 }
16055
16056 async fn build_inner(
16057 conf: gaxi::options::ClientConfig,
16058 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Snapshots>> {
16059 if gaxi::options::tracing_enabled(&conf) {
16060 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16061 }
16062 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16063 }
16064
16065 async fn build_transport(
16066 conf: gaxi::options::ClientConfig,
16067 ) -> crate::ClientBuilderResult<impl super::stub::Snapshots> {
16068 super::transport::Snapshots::new(conf).await
16069 }
16070
16071 async fn build_with_tracing(
16072 conf: gaxi::options::ClientConfig,
16073 ) -> crate::ClientBuilderResult<impl super::stub::Snapshots> {
16074 Self::build_transport(conf)
16075 .await
16076 .map(super::tracing::Snapshots::new)
16077 }
16078
16079 /// Deletes the specified Snapshot resource. Keep in mind that deleting
16080 /// a single snapshot might not necessarily delete all the data on that
16081 /// snapshot. If any data on the snapshot that is marked for deletion is
16082 /// needed for subsequent snapshots, the data will be moved to the next
16083 /// corresponding snapshot.
16084 ///
16085 /// For more information, seeDeleting
16086 /// snapshots.
16087 pub fn delete(&self) -> super::builder::snapshots::Delete {
16088 super::builder::snapshots::Delete::new(self.inner.clone())
16089 }
16090
16091 /// Returns the specified Snapshot resource.
16092 pub fn get(&self) -> super::builder::snapshots::Get {
16093 super::builder::snapshots::Get::new(self.inner.clone())
16094 }
16095
16096 /// Gets the access control policy for a resource. May be empty if no such
16097 /// policy or resource exists.
16098 pub fn get_iam_policy(&self) -> super::builder::snapshots::GetIamPolicy {
16099 super::builder::snapshots::GetIamPolicy::new(self.inner.clone())
16100 }
16101
16102 /// Creates a snapshot in the specified project using the data included
16103 /// in the request. For regular snapshot creation, consider using this method
16104 /// instead of disks.createSnapshot,
16105 /// as this method supports more features, such as creating snapshots in a
16106 /// project different from the source disk project.
16107 pub fn insert(&self) -> super::builder::snapshots::Insert {
16108 super::builder::snapshots::Insert::new(self.inner.clone())
16109 }
16110
16111 /// Retrieves the list of Snapshot resources contained within
16112 /// the specified project.
16113 pub fn list(&self) -> super::builder::snapshots::List {
16114 super::builder::snapshots::List::new(self.inner.clone())
16115 }
16116
16117 /// Sets the access control policy on the specified resource.
16118 /// Replaces any existing policy.
16119 pub fn set_iam_policy(&self) -> super::builder::snapshots::SetIamPolicy {
16120 super::builder::snapshots::SetIamPolicy::new(self.inner.clone())
16121 }
16122
16123 /// Sets the labels on a snapshot. To learn more about labels, read theLabeling
16124 /// Resources documentation.
16125 pub fn set_labels(&self) -> super::builder::snapshots::SetLabels {
16126 super::builder::snapshots::SetLabels::new(self.inner.clone())
16127 }
16128
16129 /// Returns permissions that a caller has on the specified resource.
16130 pub fn test_iam_permissions(&self) -> super::builder::snapshots::TestIamPermissions {
16131 super::builder::snapshots::TestIamPermissions::new(self.inner.clone())
16132 }
16133
16134 /// Retrieves the specified Operations resource.
16135 pub fn get_operation(&self) -> super::builder::snapshots::GetOperation {
16136 super::builder::snapshots::GetOperation::new(self.inner.clone())
16137 }
16138}
16139
16140/// Implements a client for the Google Compute Engine API.
16141///
16142/// # Example
16143/// ```
16144/// # use google_cloud_compute_v1::client::SslCertificates;
16145/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
16146/// let client = SslCertificates::builder().build().await?;
16147/// // use `client` to make requests to the Google Compute Engine API.
16148/// # Ok(()) }
16149/// ```
16150///
16151/// # Service Description
16152///
16153/// Service for the `sslCertificates` resource.
16154///
16155/// # Configuration
16156///
16157/// To configure `SslCertificates` use the `with_*` methods in the type returned
16158/// by [builder()][SslCertificates::builder]. The default configuration should
16159/// work for most applications. Common configuration changes include
16160///
16161/// * [with_endpoint()]: by default this client uses the global default endpoint
16162/// (`https://compute.googleapis.com`). Applications using regional
16163/// endpoints or running in restricted networks (e.g. a network configured
16164// with [Private Google Access with VPC Service Controls]) may want to
16165/// override this default.
16166/// * [with_credentials()]: by default this client uses
16167/// [Application Default Credentials]. Applications using custom
16168/// authentication may need to override this default.
16169///
16170/// [with_endpoint()]: super::builder::ssl_certificates::ClientBuilder::with_endpoint
16171/// [with_credentials()]: super::builder::ssl_certificates::ClientBuilder::with_credentials
16172/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16173/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16174///
16175/// # Pooling and Cloning
16176///
16177/// `SslCertificates` holds a connection pool internally, it is advised to
16178/// create one and reuse it. You do not need to wrap `SslCertificates` in
16179/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16180/// already uses an `Arc` internally.
16181#[cfg(feature = "ssl-certificates")]
16182#[cfg_attr(docsrs, doc(cfg(feature = "ssl-certificates")))]
16183#[derive(Clone, Debug)]
16184pub struct SslCertificates {
16185 inner: std::sync::Arc<dyn super::stub::dynamic::SslCertificates>,
16186}
16187
16188#[cfg(feature = "ssl-certificates")]
16189impl SslCertificates {
16190 /// Returns a builder for [SslCertificates].
16191 ///
16192 /// ```
16193 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16194 /// # use google_cloud_compute_v1::client::SslCertificates;
16195 /// let client = SslCertificates::builder().build().await?;
16196 /// # Ok(()) }
16197 /// ```
16198 pub fn builder() -> super::builder::ssl_certificates::ClientBuilder {
16199 crate::new_client_builder(super::builder::ssl_certificates::client::Factory)
16200 }
16201
16202 /// Creates a new client from the provided stub.
16203 ///
16204 /// The most common case for calling this function is in tests mocking the
16205 /// client's behavior.
16206 pub fn from_stub<T>(stub: T) -> Self
16207 where
16208 T: super::stub::SslCertificates + 'static,
16209 {
16210 Self {
16211 inner: std::sync::Arc::new(stub),
16212 }
16213 }
16214
16215 pub(crate) async fn new(
16216 config: gaxi::options::ClientConfig,
16217 ) -> crate::ClientBuilderResult<Self> {
16218 let inner = Self::build_inner(config).await?;
16219 Ok(Self { inner })
16220 }
16221
16222 async fn build_inner(
16223 conf: gaxi::options::ClientConfig,
16224 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SslCertificates>> {
16225 if gaxi::options::tracing_enabled(&conf) {
16226 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16227 }
16228 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16229 }
16230
16231 async fn build_transport(
16232 conf: gaxi::options::ClientConfig,
16233 ) -> crate::ClientBuilderResult<impl super::stub::SslCertificates> {
16234 super::transport::SslCertificates::new(conf).await
16235 }
16236
16237 async fn build_with_tracing(
16238 conf: gaxi::options::ClientConfig,
16239 ) -> crate::ClientBuilderResult<impl super::stub::SslCertificates> {
16240 Self::build_transport(conf)
16241 .await
16242 .map(super::tracing::SslCertificates::new)
16243 }
16244
16245 /// Retrieves the list of all SslCertificate resources, regional and global,
16246 /// available to the specified project.
16247 ///
16248 /// To prevent failure, Google recommends that you set the
16249 /// `returnPartialSuccess` parameter to `true`.
16250 pub fn aggregated_list(&self) -> super::builder::ssl_certificates::AggregatedList {
16251 super::builder::ssl_certificates::AggregatedList::new(self.inner.clone())
16252 }
16253
16254 /// Deletes the specified SslCertificate resource.
16255 pub fn delete(&self) -> super::builder::ssl_certificates::Delete {
16256 super::builder::ssl_certificates::Delete::new(self.inner.clone())
16257 }
16258
16259 /// Returns the specified SslCertificate resource.
16260 pub fn get(&self) -> super::builder::ssl_certificates::Get {
16261 super::builder::ssl_certificates::Get::new(self.inner.clone())
16262 }
16263
16264 /// Creates a SslCertificate resource in the specified project using the data
16265 /// included in the request.
16266 pub fn insert(&self) -> super::builder::ssl_certificates::Insert {
16267 super::builder::ssl_certificates::Insert::new(self.inner.clone())
16268 }
16269
16270 /// Retrieves the list of SslCertificate resources available to the specified
16271 /// project.
16272 pub fn list(&self) -> super::builder::ssl_certificates::List {
16273 super::builder::ssl_certificates::List::new(self.inner.clone())
16274 }
16275
16276 /// Retrieves the specified Operations resource.
16277 pub fn get_operation(&self) -> super::builder::ssl_certificates::GetOperation {
16278 super::builder::ssl_certificates::GetOperation::new(self.inner.clone())
16279 }
16280}
16281
16282/// Implements a client for the Google Compute Engine API.
16283///
16284/// # Example
16285/// ```
16286/// # use google_cloud_compute_v1::client::SslPolicies;
16287/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
16288/// let client = SslPolicies::builder().build().await?;
16289/// // use `client` to make requests to the Google Compute Engine API.
16290/// # Ok(()) }
16291/// ```
16292///
16293/// # Service Description
16294///
16295/// Service for the `sslPolicies` resource.
16296///
16297/// # Configuration
16298///
16299/// To configure `SslPolicies` use the `with_*` methods in the type returned
16300/// by [builder()][SslPolicies::builder]. The default configuration should
16301/// work for most applications. Common configuration changes include
16302///
16303/// * [with_endpoint()]: by default this client uses the global default endpoint
16304/// (`https://compute.googleapis.com`). Applications using regional
16305/// endpoints or running in restricted networks (e.g. a network configured
16306// with [Private Google Access with VPC Service Controls]) may want to
16307/// override this default.
16308/// * [with_credentials()]: by default this client uses
16309/// [Application Default Credentials]. Applications using custom
16310/// authentication may need to override this default.
16311///
16312/// [with_endpoint()]: super::builder::ssl_policies::ClientBuilder::with_endpoint
16313/// [with_credentials()]: super::builder::ssl_policies::ClientBuilder::with_credentials
16314/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16315/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16316///
16317/// # Pooling and Cloning
16318///
16319/// `SslPolicies` holds a connection pool internally, it is advised to
16320/// create one and reuse it. You do not need to wrap `SslPolicies` in
16321/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16322/// already uses an `Arc` internally.
16323#[cfg(feature = "ssl-policies")]
16324#[cfg_attr(docsrs, doc(cfg(feature = "ssl-policies")))]
16325#[derive(Clone, Debug)]
16326pub struct SslPolicies {
16327 inner: std::sync::Arc<dyn super::stub::dynamic::SslPolicies>,
16328}
16329
16330#[cfg(feature = "ssl-policies")]
16331impl SslPolicies {
16332 /// Returns a builder for [SslPolicies].
16333 ///
16334 /// ```
16335 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16336 /// # use google_cloud_compute_v1::client::SslPolicies;
16337 /// let client = SslPolicies::builder().build().await?;
16338 /// # Ok(()) }
16339 /// ```
16340 pub fn builder() -> super::builder::ssl_policies::ClientBuilder {
16341 crate::new_client_builder(super::builder::ssl_policies::client::Factory)
16342 }
16343
16344 /// Creates a new client from the provided stub.
16345 ///
16346 /// The most common case for calling this function is in tests mocking the
16347 /// client's behavior.
16348 pub fn from_stub<T>(stub: T) -> Self
16349 where
16350 T: super::stub::SslPolicies + 'static,
16351 {
16352 Self {
16353 inner: std::sync::Arc::new(stub),
16354 }
16355 }
16356
16357 pub(crate) async fn new(
16358 config: gaxi::options::ClientConfig,
16359 ) -> crate::ClientBuilderResult<Self> {
16360 let inner = Self::build_inner(config).await?;
16361 Ok(Self { inner })
16362 }
16363
16364 async fn build_inner(
16365 conf: gaxi::options::ClientConfig,
16366 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SslPolicies>> {
16367 if gaxi::options::tracing_enabled(&conf) {
16368 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16369 }
16370 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16371 }
16372
16373 async fn build_transport(
16374 conf: gaxi::options::ClientConfig,
16375 ) -> crate::ClientBuilderResult<impl super::stub::SslPolicies> {
16376 super::transport::SslPolicies::new(conf).await
16377 }
16378
16379 async fn build_with_tracing(
16380 conf: gaxi::options::ClientConfig,
16381 ) -> crate::ClientBuilderResult<impl super::stub::SslPolicies> {
16382 Self::build_transport(conf)
16383 .await
16384 .map(super::tracing::SslPolicies::new)
16385 }
16386
16387 /// Retrieves the list of all SslPolicy resources, regional and global,
16388 /// available to the specified project.
16389 ///
16390 /// To prevent failure, Google recommends that you set the
16391 /// `returnPartialSuccess` parameter to `true`.
16392 pub fn aggregated_list(&self) -> super::builder::ssl_policies::AggregatedList {
16393 super::builder::ssl_policies::AggregatedList::new(self.inner.clone())
16394 }
16395
16396 /// Deletes the specified SSL policy. The SSL policy resource can be deleted
16397 /// only if it is not in use by any TargetHttpsProxy or TargetSslProxy
16398 /// resources.
16399 pub fn delete(&self) -> super::builder::ssl_policies::Delete {
16400 super::builder::ssl_policies::Delete::new(self.inner.clone())
16401 }
16402
16403 /// Lists all of the ordered rules present in a single specified policy.
16404 pub fn get(&self) -> super::builder::ssl_policies::Get {
16405 super::builder::ssl_policies::Get::new(self.inner.clone())
16406 }
16407
16408 /// Returns the specified SSL policy resource.
16409 pub fn insert(&self) -> super::builder::ssl_policies::Insert {
16410 super::builder::ssl_policies::Insert::new(self.inner.clone())
16411 }
16412
16413 /// Lists all the SSL policies that have been configured for the specified
16414 /// project.
16415 pub fn list(&self) -> super::builder::ssl_policies::List {
16416 super::builder::ssl_policies::List::new(self.inner.clone())
16417 }
16418
16419 /// Lists all features that can be specified in the SSL policy when using
16420 /// custom profile.
16421 pub fn list_available_features(&self) -> super::builder::ssl_policies::ListAvailableFeatures {
16422 super::builder::ssl_policies::ListAvailableFeatures::new(self.inner.clone())
16423 }
16424
16425 /// Patches the specified SSL policy with the data included in the request.
16426 pub fn patch(&self) -> super::builder::ssl_policies::Patch {
16427 super::builder::ssl_policies::Patch::new(self.inner.clone())
16428 }
16429
16430 /// Retrieves the specified Operations resource.
16431 pub fn get_operation(&self) -> super::builder::ssl_policies::GetOperation {
16432 super::builder::ssl_policies::GetOperation::new(self.inner.clone())
16433 }
16434}
16435
16436/// Implements a client for the Google Compute Engine API.
16437///
16438/// # Example
16439/// ```
16440/// # use google_cloud_compute_v1::client::StoragePoolTypes;
16441/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
16442/// let client = StoragePoolTypes::builder().build().await?;
16443/// // use `client` to make requests to the Google Compute Engine API.
16444/// # Ok(()) }
16445/// ```
16446///
16447/// # Service Description
16448///
16449/// Service for the `storagePoolTypes` resource.
16450///
16451/// # Configuration
16452///
16453/// To configure `StoragePoolTypes` use the `with_*` methods in the type returned
16454/// by [builder()][StoragePoolTypes::builder]. The default configuration should
16455/// work for most applications. Common configuration changes include
16456///
16457/// * [with_endpoint()]: by default this client uses the global default endpoint
16458/// (`https://compute.googleapis.com`). Applications using regional
16459/// endpoints or running in restricted networks (e.g. a network configured
16460// with [Private Google Access with VPC Service Controls]) may want to
16461/// override this default.
16462/// * [with_credentials()]: by default this client uses
16463/// [Application Default Credentials]. Applications using custom
16464/// authentication may need to override this default.
16465///
16466/// [with_endpoint()]: super::builder::storage_pool_types::ClientBuilder::with_endpoint
16467/// [with_credentials()]: super::builder::storage_pool_types::ClientBuilder::with_credentials
16468/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16469/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16470///
16471/// # Pooling and Cloning
16472///
16473/// `StoragePoolTypes` holds a connection pool internally, it is advised to
16474/// create one and reuse it. You do not need to wrap `StoragePoolTypes` in
16475/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16476/// already uses an `Arc` internally.
16477#[cfg(feature = "storage-pool-types")]
16478#[cfg_attr(docsrs, doc(cfg(feature = "storage-pool-types")))]
16479#[derive(Clone, Debug)]
16480pub struct StoragePoolTypes {
16481 inner: std::sync::Arc<dyn super::stub::dynamic::StoragePoolTypes>,
16482}
16483
16484#[cfg(feature = "storage-pool-types")]
16485impl StoragePoolTypes {
16486 /// Returns a builder for [StoragePoolTypes].
16487 ///
16488 /// ```
16489 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16490 /// # use google_cloud_compute_v1::client::StoragePoolTypes;
16491 /// let client = StoragePoolTypes::builder().build().await?;
16492 /// # Ok(()) }
16493 /// ```
16494 pub fn builder() -> super::builder::storage_pool_types::ClientBuilder {
16495 crate::new_client_builder(super::builder::storage_pool_types::client::Factory)
16496 }
16497
16498 /// Creates a new client from the provided stub.
16499 ///
16500 /// The most common case for calling this function is in tests mocking the
16501 /// client's behavior.
16502 pub fn from_stub<T>(stub: T) -> Self
16503 where
16504 T: super::stub::StoragePoolTypes + 'static,
16505 {
16506 Self {
16507 inner: std::sync::Arc::new(stub),
16508 }
16509 }
16510
16511 pub(crate) async fn new(
16512 config: gaxi::options::ClientConfig,
16513 ) -> crate::ClientBuilderResult<Self> {
16514 let inner = Self::build_inner(config).await?;
16515 Ok(Self { inner })
16516 }
16517
16518 async fn build_inner(
16519 conf: gaxi::options::ClientConfig,
16520 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::StoragePoolTypes>>
16521 {
16522 if gaxi::options::tracing_enabled(&conf) {
16523 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16524 }
16525 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16526 }
16527
16528 async fn build_transport(
16529 conf: gaxi::options::ClientConfig,
16530 ) -> crate::ClientBuilderResult<impl super::stub::StoragePoolTypes> {
16531 super::transport::StoragePoolTypes::new(conf).await
16532 }
16533
16534 async fn build_with_tracing(
16535 conf: gaxi::options::ClientConfig,
16536 ) -> crate::ClientBuilderResult<impl super::stub::StoragePoolTypes> {
16537 Self::build_transport(conf)
16538 .await
16539 .map(super::tracing::StoragePoolTypes::new)
16540 }
16541
16542 /// Retrieves an aggregated list of storage pool types.
16543 ///
16544 /// To prevent failure, Google recommends that you set the
16545 /// `returnPartialSuccess` parameter to `true`.
16546 pub fn aggregated_list(&self) -> super::builder::storage_pool_types::AggregatedList {
16547 super::builder::storage_pool_types::AggregatedList::new(self.inner.clone())
16548 }
16549
16550 /// Returns the specified storage pool type.
16551 pub fn get(&self) -> super::builder::storage_pool_types::Get {
16552 super::builder::storage_pool_types::Get::new(self.inner.clone())
16553 }
16554
16555 /// Retrieves a list of storage pool types available to the specified
16556 /// project.
16557 pub fn list(&self) -> super::builder::storage_pool_types::List {
16558 super::builder::storage_pool_types::List::new(self.inner.clone())
16559 }
16560}
16561
16562/// Implements a client for the Google Compute Engine API.
16563///
16564/// # Example
16565/// ```
16566/// # use google_cloud_compute_v1::client::StoragePools;
16567/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
16568/// let client = StoragePools::builder().build().await?;
16569/// // use `client` to make requests to the Google Compute Engine API.
16570/// # Ok(()) }
16571/// ```
16572///
16573/// # Service Description
16574///
16575/// Service for the `storagePools` resource.
16576///
16577/// # Configuration
16578///
16579/// To configure `StoragePools` use the `with_*` methods in the type returned
16580/// by [builder()][StoragePools::builder]. The default configuration should
16581/// work for most applications. Common configuration changes include
16582///
16583/// * [with_endpoint()]: by default this client uses the global default endpoint
16584/// (`https://compute.googleapis.com`). Applications using regional
16585/// endpoints or running in restricted networks (e.g. a network configured
16586// with [Private Google Access with VPC Service Controls]) may want to
16587/// override this default.
16588/// * [with_credentials()]: by default this client uses
16589/// [Application Default Credentials]. Applications using custom
16590/// authentication may need to override this default.
16591///
16592/// [with_endpoint()]: super::builder::storage_pools::ClientBuilder::with_endpoint
16593/// [with_credentials()]: super::builder::storage_pools::ClientBuilder::with_credentials
16594/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16595/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16596///
16597/// # Pooling and Cloning
16598///
16599/// `StoragePools` holds a connection pool internally, it is advised to
16600/// create one and reuse it. You do not need to wrap `StoragePools` in
16601/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16602/// already uses an `Arc` internally.
16603#[cfg(feature = "storage-pools")]
16604#[cfg_attr(docsrs, doc(cfg(feature = "storage-pools")))]
16605#[derive(Clone, Debug)]
16606pub struct StoragePools {
16607 inner: std::sync::Arc<dyn super::stub::dynamic::StoragePools>,
16608}
16609
16610#[cfg(feature = "storage-pools")]
16611impl StoragePools {
16612 /// Returns a builder for [StoragePools].
16613 ///
16614 /// ```
16615 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16616 /// # use google_cloud_compute_v1::client::StoragePools;
16617 /// let client = StoragePools::builder().build().await?;
16618 /// # Ok(()) }
16619 /// ```
16620 pub fn builder() -> super::builder::storage_pools::ClientBuilder {
16621 crate::new_client_builder(super::builder::storage_pools::client::Factory)
16622 }
16623
16624 /// Creates a new client from the provided stub.
16625 ///
16626 /// The most common case for calling this function is in tests mocking the
16627 /// client's behavior.
16628 pub fn from_stub<T>(stub: T) -> Self
16629 where
16630 T: super::stub::StoragePools + 'static,
16631 {
16632 Self {
16633 inner: std::sync::Arc::new(stub),
16634 }
16635 }
16636
16637 pub(crate) async fn new(
16638 config: gaxi::options::ClientConfig,
16639 ) -> crate::ClientBuilderResult<Self> {
16640 let inner = Self::build_inner(config).await?;
16641 Ok(Self { inner })
16642 }
16643
16644 async fn build_inner(
16645 conf: gaxi::options::ClientConfig,
16646 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::StoragePools>> {
16647 if gaxi::options::tracing_enabled(&conf) {
16648 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16649 }
16650 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16651 }
16652
16653 async fn build_transport(
16654 conf: gaxi::options::ClientConfig,
16655 ) -> crate::ClientBuilderResult<impl super::stub::StoragePools> {
16656 super::transport::StoragePools::new(conf).await
16657 }
16658
16659 async fn build_with_tracing(
16660 conf: gaxi::options::ClientConfig,
16661 ) -> crate::ClientBuilderResult<impl super::stub::StoragePools> {
16662 Self::build_transport(conf)
16663 .await
16664 .map(super::tracing::StoragePools::new)
16665 }
16666
16667 /// Retrieves an aggregated list of storage pools.
16668 ///
16669 /// To prevent failure, Google recommends that you set the
16670 /// `returnPartialSuccess` parameter to `true`.
16671 pub fn aggregated_list(&self) -> super::builder::storage_pools::AggregatedList {
16672 super::builder::storage_pools::AggregatedList::new(self.inner.clone())
16673 }
16674
16675 /// Deletes the specified storage pool. Deleting a storagePool
16676 /// removes its data permanently and is irreversible. However, deleting a
16677 /// storagePool does not delete any snapshots previously
16678 /// made from the storagePool. You must separately delete
16679 /// snapshots.
16680 pub fn delete(&self) -> super::builder::storage_pools::Delete {
16681 super::builder::storage_pools::Delete::new(self.inner.clone())
16682 }
16683
16684 /// Returns a specified storage pool. Gets a list of available
16685 /// storage pools by making a list() request.
16686 pub fn get(&self) -> super::builder::storage_pools::Get {
16687 super::builder::storage_pools::Get::new(self.inner.clone())
16688 }
16689
16690 /// Gets the access control policy for a resource. May be empty if no such
16691 /// policy or resource exists.
16692 pub fn get_iam_policy(&self) -> super::builder::storage_pools::GetIamPolicy {
16693 super::builder::storage_pools::GetIamPolicy::new(self.inner.clone())
16694 }
16695
16696 /// Creates a storage pool in the specified project using the data
16697 /// in the request.
16698 pub fn insert(&self) -> super::builder::storage_pools::Insert {
16699 super::builder::storage_pools::Insert::new(self.inner.clone())
16700 }
16701
16702 /// Retrieves a list of storage pools contained within
16703 /// the specified zone.
16704 pub fn list(&self) -> super::builder::storage_pools::List {
16705 super::builder::storage_pools::List::new(self.inner.clone())
16706 }
16707
16708 /// Lists the disks in a specified storage pool.
16709 pub fn list_disks(&self) -> super::builder::storage_pools::ListDisks {
16710 super::builder::storage_pools::ListDisks::new(self.inner.clone())
16711 }
16712
16713 /// Sets the access control policy on the specified resource.
16714 /// Replaces any existing policy.
16715 pub fn set_iam_policy(&self) -> super::builder::storage_pools::SetIamPolicy {
16716 super::builder::storage_pools::SetIamPolicy::new(self.inner.clone())
16717 }
16718
16719 /// Returns permissions that a caller has on the specified resource.
16720 pub fn test_iam_permissions(&self) -> super::builder::storage_pools::TestIamPermissions {
16721 super::builder::storage_pools::TestIamPermissions::new(self.inner.clone())
16722 }
16723
16724 /// Updates the specified storagePool with the data included in the request.
16725 /// The update is performed only on selected fields included as part
16726 /// of update-mask. Only the following fields can be modified:
16727 /// pool_provisioned_capacity_gb, pool_provisioned_iops and
16728 /// pool_provisioned_throughput.
16729 pub fn update(&self) -> super::builder::storage_pools::Update {
16730 super::builder::storage_pools::Update::new(self.inner.clone())
16731 }
16732
16733 /// Retrieves the specified zone-specific Operations resource.
16734 pub fn get_operation(&self) -> super::builder::storage_pools::GetOperation {
16735 super::builder::storage_pools::GetOperation::new(self.inner.clone())
16736 }
16737}
16738
16739/// Implements a client for the Google Compute Engine API.
16740///
16741/// # Example
16742/// ```
16743/// # use google_cloud_compute_v1::client::Subnetworks;
16744/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
16745/// let client = Subnetworks::builder().build().await?;
16746/// // use `client` to make requests to the Google Compute Engine API.
16747/// # Ok(()) }
16748/// ```
16749///
16750/// # Service Description
16751///
16752/// Service for the `subnetworks` resource.
16753///
16754/// # Configuration
16755///
16756/// To configure `Subnetworks` use the `with_*` methods in the type returned
16757/// by [builder()][Subnetworks::builder]. The default configuration should
16758/// work for most applications. Common configuration changes include
16759///
16760/// * [with_endpoint()]: by default this client uses the global default endpoint
16761/// (`https://compute.googleapis.com`). Applications using regional
16762/// endpoints or running in restricted networks (e.g. a network configured
16763// with [Private Google Access with VPC Service Controls]) may want to
16764/// override this default.
16765/// * [with_credentials()]: by default this client uses
16766/// [Application Default Credentials]. Applications using custom
16767/// authentication may need to override this default.
16768///
16769/// [with_endpoint()]: super::builder::subnetworks::ClientBuilder::with_endpoint
16770/// [with_credentials()]: super::builder::subnetworks::ClientBuilder::with_credentials
16771/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16772/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16773///
16774/// # Pooling and Cloning
16775///
16776/// `Subnetworks` holds a connection pool internally, it is advised to
16777/// create one and reuse it. You do not need to wrap `Subnetworks` in
16778/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16779/// already uses an `Arc` internally.
16780#[cfg(feature = "subnetworks")]
16781#[cfg_attr(docsrs, doc(cfg(feature = "subnetworks")))]
16782#[derive(Clone, Debug)]
16783pub struct Subnetworks {
16784 inner: std::sync::Arc<dyn super::stub::dynamic::Subnetworks>,
16785}
16786
16787#[cfg(feature = "subnetworks")]
16788impl Subnetworks {
16789 /// Returns a builder for [Subnetworks].
16790 ///
16791 /// ```
16792 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16793 /// # use google_cloud_compute_v1::client::Subnetworks;
16794 /// let client = Subnetworks::builder().build().await?;
16795 /// # Ok(()) }
16796 /// ```
16797 pub fn builder() -> super::builder::subnetworks::ClientBuilder {
16798 crate::new_client_builder(super::builder::subnetworks::client::Factory)
16799 }
16800
16801 /// Creates a new client from the provided stub.
16802 ///
16803 /// The most common case for calling this function is in tests mocking the
16804 /// client's behavior.
16805 pub fn from_stub<T>(stub: T) -> Self
16806 where
16807 T: super::stub::Subnetworks + 'static,
16808 {
16809 Self {
16810 inner: std::sync::Arc::new(stub),
16811 }
16812 }
16813
16814 pub(crate) async fn new(
16815 config: gaxi::options::ClientConfig,
16816 ) -> crate::ClientBuilderResult<Self> {
16817 let inner = Self::build_inner(config).await?;
16818 Ok(Self { inner })
16819 }
16820
16821 async fn build_inner(
16822 conf: gaxi::options::ClientConfig,
16823 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Subnetworks>> {
16824 if gaxi::options::tracing_enabled(&conf) {
16825 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16826 }
16827 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16828 }
16829
16830 async fn build_transport(
16831 conf: gaxi::options::ClientConfig,
16832 ) -> crate::ClientBuilderResult<impl super::stub::Subnetworks> {
16833 super::transport::Subnetworks::new(conf).await
16834 }
16835
16836 async fn build_with_tracing(
16837 conf: gaxi::options::ClientConfig,
16838 ) -> crate::ClientBuilderResult<impl super::stub::Subnetworks> {
16839 Self::build_transport(conf)
16840 .await
16841 .map(super::tracing::Subnetworks::new)
16842 }
16843
16844 /// Retrieves an aggregated list of subnetworks.
16845 ///
16846 /// To prevent failure, Google recommends that you set the
16847 /// `returnPartialSuccess` parameter to `true`.
16848 pub fn aggregated_list(&self) -> super::builder::subnetworks::AggregatedList {
16849 super::builder::subnetworks::AggregatedList::new(self.inner.clone())
16850 }
16851
16852 /// Deletes the specified subnetwork.
16853 pub fn delete(&self) -> super::builder::subnetworks::Delete {
16854 super::builder::subnetworks::Delete::new(self.inner.clone())
16855 }
16856
16857 /// Expands the IP CIDR range of the subnetwork to a specified value.
16858 pub fn expand_ip_cidr_range(&self) -> super::builder::subnetworks::ExpandIpCidrRange {
16859 super::builder::subnetworks::ExpandIpCidrRange::new(self.inner.clone())
16860 }
16861
16862 /// Returns the specified subnetwork.
16863 pub fn get(&self) -> super::builder::subnetworks::Get {
16864 super::builder::subnetworks::Get::new(self.inner.clone())
16865 }
16866
16867 /// Gets the access control policy for a resource. May be empty if no such
16868 /// policy or resource exists.
16869 pub fn get_iam_policy(&self) -> super::builder::subnetworks::GetIamPolicy {
16870 super::builder::subnetworks::GetIamPolicy::new(self.inner.clone())
16871 }
16872
16873 /// Creates a subnetwork in the specified project using the data
16874 /// included in the request.
16875 pub fn insert(&self) -> super::builder::subnetworks::Insert {
16876 super::builder::subnetworks::Insert::new(self.inner.clone())
16877 }
16878
16879 /// Retrieves a list of subnetworks available to the specified
16880 /// project.
16881 pub fn list(&self) -> super::builder::subnetworks::List {
16882 super::builder::subnetworks::List::new(self.inner.clone())
16883 }
16884
16885 /// Retrieves an aggregated list of all usable subnetworks in the project.
16886 pub fn list_usable(&self) -> super::builder::subnetworks::ListUsable {
16887 super::builder::subnetworks::ListUsable::new(self.inner.clone())
16888 }
16889
16890 /// Patches the specified subnetwork with the data included in the request.
16891 /// Only certain fields can be updated with a patch request
16892 /// as indicated in the field descriptions.
16893 /// You must specify the current fingerprint of the
16894 /// subnetwork resource being patched.
16895 pub fn patch(&self) -> super::builder::subnetworks::Patch {
16896 super::builder::subnetworks::Patch::new(self.inner.clone())
16897 }
16898
16899 /// Sets the access control policy on the specified resource.
16900 /// Replaces any existing policy.
16901 pub fn set_iam_policy(&self) -> super::builder::subnetworks::SetIamPolicy {
16902 super::builder::subnetworks::SetIamPolicy::new(self.inner.clone())
16903 }
16904
16905 /// Set whether VMs in this subnet can access Google services without assigning
16906 /// external IP addresses through Private Google Access.
16907 pub fn set_private_ip_google_access(
16908 &self,
16909 ) -> super::builder::subnetworks::SetPrivateIpGoogleAccess {
16910 super::builder::subnetworks::SetPrivateIpGoogleAccess::new(self.inner.clone())
16911 }
16912
16913 /// Returns permissions that a caller has on the specified resource.
16914 pub fn test_iam_permissions(&self) -> super::builder::subnetworks::TestIamPermissions {
16915 super::builder::subnetworks::TestIamPermissions::new(self.inner.clone())
16916 }
16917
16918 /// Retrieves the specified region-specific Operations resource.
16919 pub fn get_operation(&self) -> super::builder::subnetworks::GetOperation {
16920 super::builder::subnetworks::GetOperation::new(self.inner.clone())
16921 }
16922}
16923
16924/// Implements a client for the Google Compute Engine API.
16925///
16926/// # Example
16927/// ```
16928/// # use google_cloud_compute_v1::client::TargetGrpcProxies;
16929/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
16930/// let client = TargetGrpcProxies::builder().build().await?;
16931/// // use `client` to make requests to the Google Compute Engine API.
16932/// # Ok(()) }
16933/// ```
16934///
16935/// # Service Description
16936///
16937/// Service for the `targetGrpcProxies` resource.
16938///
16939/// # Configuration
16940///
16941/// To configure `TargetGrpcProxies` use the `with_*` methods in the type returned
16942/// by [builder()][TargetGrpcProxies::builder]. The default configuration should
16943/// work for most applications. Common configuration changes include
16944///
16945/// * [with_endpoint()]: by default this client uses the global default endpoint
16946/// (`https://compute.googleapis.com`). Applications using regional
16947/// endpoints or running in restricted networks (e.g. a network configured
16948// with [Private Google Access with VPC Service Controls]) may want to
16949/// override this default.
16950/// * [with_credentials()]: by default this client uses
16951/// [Application Default Credentials]. Applications using custom
16952/// authentication may need to override this default.
16953///
16954/// [with_endpoint()]: super::builder::target_grpc_proxies::ClientBuilder::with_endpoint
16955/// [with_credentials()]: super::builder::target_grpc_proxies::ClientBuilder::with_credentials
16956/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16957/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16958///
16959/// # Pooling and Cloning
16960///
16961/// `TargetGrpcProxies` holds a connection pool internally, it is advised to
16962/// create one and reuse it. You do not need to wrap `TargetGrpcProxies` in
16963/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16964/// already uses an `Arc` internally.
16965#[cfg(feature = "target-grpc-proxies")]
16966#[cfg_attr(docsrs, doc(cfg(feature = "target-grpc-proxies")))]
16967#[derive(Clone, Debug)]
16968pub struct TargetGrpcProxies {
16969 inner: std::sync::Arc<dyn super::stub::dynamic::TargetGrpcProxies>,
16970}
16971
16972#[cfg(feature = "target-grpc-proxies")]
16973impl TargetGrpcProxies {
16974 /// Returns a builder for [TargetGrpcProxies].
16975 ///
16976 /// ```
16977 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16978 /// # use google_cloud_compute_v1::client::TargetGrpcProxies;
16979 /// let client = TargetGrpcProxies::builder().build().await?;
16980 /// # Ok(()) }
16981 /// ```
16982 pub fn builder() -> super::builder::target_grpc_proxies::ClientBuilder {
16983 crate::new_client_builder(super::builder::target_grpc_proxies::client::Factory)
16984 }
16985
16986 /// Creates a new client from the provided stub.
16987 ///
16988 /// The most common case for calling this function is in tests mocking the
16989 /// client's behavior.
16990 pub fn from_stub<T>(stub: T) -> Self
16991 where
16992 T: super::stub::TargetGrpcProxies + 'static,
16993 {
16994 Self {
16995 inner: std::sync::Arc::new(stub),
16996 }
16997 }
16998
16999 pub(crate) async fn new(
17000 config: gaxi::options::ClientConfig,
17001 ) -> crate::ClientBuilderResult<Self> {
17002 let inner = Self::build_inner(config).await?;
17003 Ok(Self { inner })
17004 }
17005
17006 async fn build_inner(
17007 conf: gaxi::options::ClientConfig,
17008 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetGrpcProxies>>
17009 {
17010 if gaxi::options::tracing_enabled(&conf) {
17011 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17012 }
17013 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17014 }
17015
17016 async fn build_transport(
17017 conf: gaxi::options::ClientConfig,
17018 ) -> crate::ClientBuilderResult<impl super::stub::TargetGrpcProxies> {
17019 super::transport::TargetGrpcProxies::new(conf).await
17020 }
17021
17022 async fn build_with_tracing(
17023 conf: gaxi::options::ClientConfig,
17024 ) -> crate::ClientBuilderResult<impl super::stub::TargetGrpcProxies> {
17025 Self::build_transport(conf)
17026 .await
17027 .map(super::tracing::TargetGrpcProxies::new)
17028 }
17029
17030 /// Deletes the specified TargetGrpcProxy in the given scope
17031 pub fn delete(&self) -> super::builder::target_grpc_proxies::Delete {
17032 super::builder::target_grpc_proxies::Delete::new(self.inner.clone())
17033 }
17034
17035 /// Returns the specified TargetGrpcProxy resource in the given scope.
17036 pub fn get(&self) -> super::builder::target_grpc_proxies::Get {
17037 super::builder::target_grpc_proxies::Get::new(self.inner.clone())
17038 }
17039
17040 /// Creates a TargetGrpcProxy in the specified project in the given scope
17041 /// using the parameters that are included in the request.
17042 pub fn insert(&self) -> super::builder::target_grpc_proxies::Insert {
17043 super::builder::target_grpc_proxies::Insert::new(self.inner.clone())
17044 }
17045
17046 /// Lists the TargetGrpcProxies for a project in the given scope.
17047 pub fn list(&self) -> super::builder::target_grpc_proxies::List {
17048 super::builder::target_grpc_proxies::List::new(self.inner.clone())
17049 }
17050
17051 /// Patches the specified TargetGrpcProxy resource with the data included in
17052 /// the request. This method supports PATCH
17053 /// semantics and usesJSON merge
17054 /// patch format and processing rules.
17055 pub fn patch(&self) -> super::builder::target_grpc_proxies::Patch {
17056 super::builder::target_grpc_proxies::Patch::new(self.inner.clone())
17057 }
17058
17059 /// Retrieves the specified Operations resource.
17060 pub fn get_operation(&self) -> super::builder::target_grpc_proxies::GetOperation {
17061 super::builder::target_grpc_proxies::GetOperation::new(self.inner.clone())
17062 }
17063}
17064
17065/// Implements a client for the Google Compute Engine API.
17066///
17067/// # Example
17068/// ```
17069/// # use google_cloud_compute_v1::client::TargetHttpProxies;
17070/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
17071/// let client = TargetHttpProxies::builder().build().await?;
17072/// // use `client` to make requests to the Google Compute Engine API.
17073/// # Ok(()) }
17074/// ```
17075///
17076/// # Service Description
17077///
17078/// Service for the `targetHttpProxies` resource.
17079///
17080/// # Configuration
17081///
17082/// To configure `TargetHttpProxies` use the `with_*` methods in the type returned
17083/// by [builder()][TargetHttpProxies::builder]. The default configuration should
17084/// work for most applications. Common configuration changes include
17085///
17086/// * [with_endpoint()]: by default this client uses the global default endpoint
17087/// (`https://compute.googleapis.com`). Applications using regional
17088/// endpoints or running in restricted networks (e.g. a network configured
17089// with [Private Google Access with VPC Service Controls]) may want to
17090/// override this default.
17091/// * [with_credentials()]: by default this client uses
17092/// [Application Default Credentials]. Applications using custom
17093/// authentication may need to override this default.
17094///
17095/// [with_endpoint()]: super::builder::target_http_proxies::ClientBuilder::with_endpoint
17096/// [with_credentials()]: super::builder::target_http_proxies::ClientBuilder::with_credentials
17097/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17098/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17099///
17100/// # Pooling and Cloning
17101///
17102/// `TargetHttpProxies` holds a connection pool internally, it is advised to
17103/// create one and reuse it. You do not need to wrap `TargetHttpProxies` in
17104/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17105/// already uses an `Arc` internally.
17106#[cfg(feature = "target-http-proxies")]
17107#[cfg_attr(docsrs, doc(cfg(feature = "target-http-proxies")))]
17108#[derive(Clone, Debug)]
17109pub struct TargetHttpProxies {
17110 inner: std::sync::Arc<dyn super::stub::dynamic::TargetHttpProxies>,
17111}
17112
17113#[cfg(feature = "target-http-proxies")]
17114impl TargetHttpProxies {
17115 /// Returns a builder for [TargetHttpProxies].
17116 ///
17117 /// ```
17118 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17119 /// # use google_cloud_compute_v1::client::TargetHttpProxies;
17120 /// let client = TargetHttpProxies::builder().build().await?;
17121 /// # Ok(()) }
17122 /// ```
17123 pub fn builder() -> super::builder::target_http_proxies::ClientBuilder {
17124 crate::new_client_builder(super::builder::target_http_proxies::client::Factory)
17125 }
17126
17127 /// Creates a new client from the provided stub.
17128 ///
17129 /// The most common case for calling this function is in tests mocking the
17130 /// client's behavior.
17131 pub fn from_stub<T>(stub: T) -> Self
17132 where
17133 T: super::stub::TargetHttpProxies + 'static,
17134 {
17135 Self {
17136 inner: std::sync::Arc::new(stub),
17137 }
17138 }
17139
17140 pub(crate) async fn new(
17141 config: gaxi::options::ClientConfig,
17142 ) -> crate::ClientBuilderResult<Self> {
17143 let inner = Self::build_inner(config).await?;
17144 Ok(Self { inner })
17145 }
17146
17147 async fn build_inner(
17148 conf: gaxi::options::ClientConfig,
17149 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetHttpProxies>>
17150 {
17151 if gaxi::options::tracing_enabled(&conf) {
17152 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17153 }
17154 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17155 }
17156
17157 async fn build_transport(
17158 conf: gaxi::options::ClientConfig,
17159 ) -> crate::ClientBuilderResult<impl super::stub::TargetHttpProxies> {
17160 super::transport::TargetHttpProxies::new(conf).await
17161 }
17162
17163 async fn build_with_tracing(
17164 conf: gaxi::options::ClientConfig,
17165 ) -> crate::ClientBuilderResult<impl super::stub::TargetHttpProxies> {
17166 Self::build_transport(conf)
17167 .await
17168 .map(super::tracing::TargetHttpProxies::new)
17169 }
17170
17171 /// Retrieves the list of all TargetHttpProxy resources, regional and global,
17172 /// available to the specified project.
17173 ///
17174 /// To prevent failure, Google recommends that you set the
17175 /// `returnPartialSuccess` parameter to `true`.
17176 pub fn aggregated_list(&self) -> super::builder::target_http_proxies::AggregatedList {
17177 super::builder::target_http_proxies::AggregatedList::new(self.inner.clone())
17178 }
17179
17180 /// Deletes the specified TargetHttpProxy resource.
17181 pub fn delete(&self) -> super::builder::target_http_proxies::Delete {
17182 super::builder::target_http_proxies::Delete::new(self.inner.clone())
17183 }
17184
17185 /// Returns the specified TargetHttpProxy resource.
17186 pub fn get(&self) -> super::builder::target_http_proxies::Get {
17187 super::builder::target_http_proxies::Get::new(self.inner.clone())
17188 }
17189
17190 /// Creates a TargetHttpProxy resource in the specified
17191 /// project using the data included in the request.
17192 pub fn insert(&self) -> super::builder::target_http_proxies::Insert {
17193 super::builder::target_http_proxies::Insert::new(self.inner.clone())
17194 }
17195
17196 /// Retrieves the list of TargetHttpProxy resources available
17197 /// to the specified project.
17198 pub fn list(&self) -> super::builder::target_http_proxies::List {
17199 super::builder::target_http_proxies::List::new(self.inner.clone())
17200 }
17201
17202 /// Patches the specified TargetHttpProxy resource with the data included in
17203 /// the request. This method supports PATCH
17204 /// semantics and usesJSON merge
17205 /// patch format and processing rules.
17206 pub fn patch(&self) -> super::builder::target_http_proxies::Patch {
17207 super::builder::target_http_proxies::Patch::new(self.inner.clone())
17208 }
17209
17210 /// Changes the URL map for TargetHttpProxy.
17211 pub fn set_url_map(&self) -> super::builder::target_http_proxies::SetUrlMap {
17212 super::builder::target_http_proxies::SetUrlMap::new(self.inner.clone())
17213 }
17214
17215 /// Retrieves the specified Operations resource.
17216 pub fn get_operation(&self) -> super::builder::target_http_proxies::GetOperation {
17217 super::builder::target_http_proxies::GetOperation::new(self.inner.clone())
17218 }
17219}
17220
17221/// Implements a client for the Google Compute Engine API.
17222///
17223/// # Example
17224/// ```
17225/// # use google_cloud_compute_v1::client::TargetHttpsProxies;
17226/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
17227/// let client = TargetHttpsProxies::builder().build().await?;
17228/// // use `client` to make requests to the Google Compute Engine API.
17229/// # Ok(()) }
17230/// ```
17231///
17232/// # Service Description
17233///
17234/// Service for the `targetHttpsProxies` resource.
17235///
17236/// # Configuration
17237///
17238/// To configure `TargetHttpsProxies` use the `with_*` methods in the type returned
17239/// by [builder()][TargetHttpsProxies::builder]. The default configuration should
17240/// work for most applications. Common configuration changes include
17241///
17242/// * [with_endpoint()]: by default this client uses the global default endpoint
17243/// (`https://compute.googleapis.com`). Applications using regional
17244/// endpoints or running in restricted networks (e.g. a network configured
17245// with [Private Google Access with VPC Service Controls]) may want to
17246/// override this default.
17247/// * [with_credentials()]: by default this client uses
17248/// [Application Default Credentials]. Applications using custom
17249/// authentication may need to override this default.
17250///
17251/// [with_endpoint()]: super::builder::target_https_proxies::ClientBuilder::with_endpoint
17252/// [with_credentials()]: super::builder::target_https_proxies::ClientBuilder::with_credentials
17253/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17254/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17255///
17256/// # Pooling and Cloning
17257///
17258/// `TargetHttpsProxies` holds a connection pool internally, it is advised to
17259/// create one and reuse it. You do not need to wrap `TargetHttpsProxies` in
17260/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17261/// already uses an `Arc` internally.
17262#[cfg(feature = "target-https-proxies")]
17263#[cfg_attr(docsrs, doc(cfg(feature = "target-https-proxies")))]
17264#[derive(Clone, Debug)]
17265pub struct TargetHttpsProxies {
17266 inner: std::sync::Arc<dyn super::stub::dynamic::TargetHttpsProxies>,
17267}
17268
17269#[cfg(feature = "target-https-proxies")]
17270impl TargetHttpsProxies {
17271 /// Returns a builder for [TargetHttpsProxies].
17272 ///
17273 /// ```
17274 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17275 /// # use google_cloud_compute_v1::client::TargetHttpsProxies;
17276 /// let client = TargetHttpsProxies::builder().build().await?;
17277 /// # Ok(()) }
17278 /// ```
17279 pub fn builder() -> super::builder::target_https_proxies::ClientBuilder {
17280 crate::new_client_builder(super::builder::target_https_proxies::client::Factory)
17281 }
17282
17283 /// Creates a new client from the provided stub.
17284 ///
17285 /// The most common case for calling this function is in tests mocking the
17286 /// client's behavior.
17287 pub fn from_stub<T>(stub: T) -> Self
17288 where
17289 T: super::stub::TargetHttpsProxies + 'static,
17290 {
17291 Self {
17292 inner: std::sync::Arc::new(stub),
17293 }
17294 }
17295
17296 pub(crate) async fn new(
17297 config: gaxi::options::ClientConfig,
17298 ) -> crate::ClientBuilderResult<Self> {
17299 let inner = Self::build_inner(config).await?;
17300 Ok(Self { inner })
17301 }
17302
17303 async fn build_inner(
17304 conf: gaxi::options::ClientConfig,
17305 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetHttpsProxies>>
17306 {
17307 if gaxi::options::tracing_enabled(&conf) {
17308 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17309 }
17310 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17311 }
17312
17313 async fn build_transport(
17314 conf: gaxi::options::ClientConfig,
17315 ) -> crate::ClientBuilderResult<impl super::stub::TargetHttpsProxies> {
17316 super::transport::TargetHttpsProxies::new(conf).await
17317 }
17318
17319 async fn build_with_tracing(
17320 conf: gaxi::options::ClientConfig,
17321 ) -> crate::ClientBuilderResult<impl super::stub::TargetHttpsProxies> {
17322 Self::build_transport(conf)
17323 .await
17324 .map(super::tracing::TargetHttpsProxies::new)
17325 }
17326
17327 /// Retrieves the list of all TargetHttpsProxy resources, regional and global,
17328 /// available to the specified project.
17329 ///
17330 /// To prevent failure, Google recommends that you set the
17331 /// `returnPartialSuccess` parameter to `true`.
17332 pub fn aggregated_list(&self) -> super::builder::target_https_proxies::AggregatedList {
17333 super::builder::target_https_proxies::AggregatedList::new(self.inner.clone())
17334 }
17335
17336 /// Deletes the specified TargetHttpsProxy resource.
17337 pub fn delete(&self) -> super::builder::target_https_proxies::Delete {
17338 super::builder::target_https_proxies::Delete::new(self.inner.clone())
17339 }
17340
17341 /// Returns the specified TargetHttpsProxy resource.
17342 pub fn get(&self) -> super::builder::target_https_proxies::Get {
17343 super::builder::target_https_proxies::Get::new(self.inner.clone())
17344 }
17345
17346 /// Creates a TargetHttpsProxy resource in the specified
17347 /// project using the data included in the request.
17348 pub fn insert(&self) -> super::builder::target_https_proxies::Insert {
17349 super::builder::target_https_proxies::Insert::new(self.inner.clone())
17350 }
17351
17352 /// Retrieves the list of TargetHttpsProxy resources
17353 /// available to the specified project.
17354 pub fn list(&self) -> super::builder::target_https_proxies::List {
17355 super::builder::target_https_proxies::List::new(self.inner.clone())
17356 }
17357
17358 /// Patches the specified TargetHttpsProxy resource with the data included in
17359 /// the request. This method supports PATCH
17360 /// semantics and usesJSON merge
17361 /// patch format and processing rules.
17362 pub fn patch(&self) -> super::builder::target_https_proxies::Patch {
17363 super::builder::target_https_proxies::Patch::new(self.inner.clone())
17364 }
17365
17366 /// Changes the Certificate Map for TargetHttpsProxy.
17367 pub fn set_certificate_map(&self) -> super::builder::target_https_proxies::SetCertificateMap {
17368 super::builder::target_https_proxies::SetCertificateMap::new(self.inner.clone())
17369 }
17370
17371 /// Sets the QUIC override policy for TargetHttpsProxy.
17372 pub fn set_quic_override(&self) -> super::builder::target_https_proxies::SetQuicOverride {
17373 super::builder::target_https_proxies::SetQuicOverride::new(self.inner.clone())
17374 }
17375
17376 /// Replaces SslCertificates for TargetHttpsProxy.
17377 pub fn set_ssl_certificates(&self) -> super::builder::target_https_proxies::SetSslCertificates {
17378 super::builder::target_https_proxies::SetSslCertificates::new(self.inner.clone())
17379 }
17380
17381 /// Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies the
17382 /// server-side support for SSL features. This affects connections between
17383 /// clients and the HTTPS proxy load balancer. They do not affect the
17384 /// connection between the load balancer and the backends.
17385 pub fn set_ssl_policy(&self) -> super::builder::target_https_proxies::SetSslPolicy {
17386 super::builder::target_https_proxies::SetSslPolicy::new(self.inner.clone())
17387 }
17388
17389 /// Changes the URL map for TargetHttpsProxy.
17390 pub fn set_url_map(&self) -> super::builder::target_https_proxies::SetUrlMap {
17391 super::builder::target_https_proxies::SetUrlMap::new(self.inner.clone())
17392 }
17393
17394 /// Retrieves the specified Operations resource.
17395 pub fn get_operation(&self) -> super::builder::target_https_proxies::GetOperation {
17396 super::builder::target_https_proxies::GetOperation::new(self.inner.clone())
17397 }
17398}
17399
17400/// Implements a client for the Google Compute Engine API.
17401///
17402/// # Example
17403/// ```
17404/// # use google_cloud_compute_v1::client::TargetInstances;
17405/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
17406/// let client = TargetInstances::builder().build().await?;
17407/// // use `client` to make requests to the Google Compute Engine API.
17408/// # Ok(()) }
17409/// ```
17410///
17411/// # Service Description
17412///
17413/// Service for the `targetInstances` resource.
17414///
17415/// # Configuration
17416///
17417/// To configure `TargetInstances` use the `with_*` methods in the type returned
17418/// by [builder()][TargetInstances::builder]. The default configuration should
17419/// work for most applications. Common configuration changes include
17420///
17421/// * [with_endpoint()]: by default this client uses the global default endpoint
17422/// (`https://compute.googleapis.com`). Applications using regional
17423/// endpoints or running in restricted networks (e.g. a network configured
17424// with [Private Google Access with VPC Service Controls]) may want to
17425/// override this default.
17426/// * [with_credentials()]: by default this client uses
17427/// [Application Default Credentials]. Applications using custom
17428/// authentication may need to override this default.
17429///
17430/// [with_endpoint()]: super::builder::target_instances::ClientBuilder::with_endpoint
17431/// [with_credentials()]: super::builder::target_instances::ClientBuilder::with_credentials
17432/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17433/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17434///
17435/// # Pooling and Cloning
17436///
17437/// `TargetInstances` holds a connection pool internally, it is advised to
17438/// create one and reuse it. You do not need to wrap `TargetInstances` in
17439/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17440/// already uses an `Arc` internally.
17441#[cfg(feature = "target-instances")]
17442#[cfg_attr(docsrs, doc(cfg(feature = "target-instances")))]
17443#[derive(Clone, Debug)]
17444pub struct TargetInstances {
17445 inner: std::sync::Arc<dyn super::stub::dynamic::TargetInstances>,
17446}
17447
17448#[cfg(feature = "target-instances")]
17449impl TargetInstances {
17450 /// Returns a builder for [TargetInstances].
17451 ///
17452 /// ```
17453 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17454 /// # use google_cloud_compute_v1::client::TargetInstances;
17455 /// let client = TargetInstances::builder().build().await?;
17456 /// # Ok(()) }
17457 /// ```
17458 pub fn builder() -> super::builder::target_instances::ClientBuilder {
17459 crate::new_client_builder(super::builder::target_instances::client::Factory)
17460 }
17461
17462 /// Creates a new client from the provided stub.
17463 ///
17464 /// The most common case for calling this function is in tests mocking the
17465 /// client's behavior.
17466 pub fn from_stub<T>(stub: T) -> Self
17467 where
17468 T: super::stub::TargetInstances + 'static,
17469 {
17470 Self {
17471 inner: std::sync::Arc::new(stub),
17472 }
17473 }
17474
17475 pub(crate) async fn new(
17476 config: gaxi::options::ClientConfig,
17477 ) -> crate::ClientBuilderResult<Self> {
17478 let inner = Self::build_inner(config).await?;
17479 Ok(Self { inner })
17480 }
17481
17482 async fn build_inner(
17483 conf: gaxi::options::ClientConfig,
17484 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetInstances>> {
17485 if gaxi::options::tracing_enabled(&conf) {
17486 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17487 }
17488 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17489 }
17490
17491 async fn build_transport(
17492 conf: gaxi::options::ClientConfig,
17493 ) -> crate::ClientBuilderResult<impl super::stub::TargetInstances> {
17494 super::transport::TargetInstances::new(conf).await
17495 }
17496
17497 async fn build_with_tracing(
17498 conf: gaxi::options::ClientConfig,
17499 ) -> crate::ClientBuilderResult<impl super::stub::TargetInstances> {
17500 Self::build_transport(conf)
17501 .await
17502 .map(super::tracing::TargetInstances::new)
17503 }
17504
17505 /// Retrieves an aggregated list of target instances.
17506 ///
17507 /// To prevent failure, Google recommends that you set the
17508 /// `returnPartialSuccess` parameter to `true`.
17509 pub fn aggregated_list(&self) -> super::builder::target_instances::AggregatedList {
17510 super::builder::target_instances::AggregatedList::new(self.inner.clone())
17511 }
17512
17513 /// Deletes the specified TargetInstance resource.
17514 pub fn delete(&self) -> super::builder::target_instances::Delete {
17515 super::builder::target_instances::Delete::new(self.inner.clone())
17516 }
17517
17518 /// Returns the specified TargetInstance resource.
17519 pub fn get(&self) -> super::builder::target_instances::Get {
17520 super::builder::target_instances::Get::new(self.inner.clone())
17521 }
17522
17523 /// Creates a TargetInstance resource in the specified project and zone using
17524 /// the data included in the request.
17525 pub fn insert(&self) -> super::builder::target_instances::Insert {
17526 super::builder::target_instances::Insert::new(self.inner.clone())
17527 }
17528
17529 /// Retrieves a list of TargetInstance resources available to the specified
17530 /// project and zone.
17531 pub fn list(&self) -> super::builder::target_instances::List {
17532 super::builder::target_instances::List::new(self.inner.clone())
17533 }
17534
17535 /// Sets the Google Cloud Armor security policy for the specified target
17536 /// instance. For more information, seeGoogle
17537 /// Cloud Armor Overview
17538 pub fn set_security_policy(&self) -> super::builder::target_instances::SetSecurityPolicy {
17539 super::builder::target_instances::SetSecurityPolicy::new(self.inner.clone())
17540 }
17541
17542 /// Returns permissions that a caller has on the specified resource.
17543 pub fn test_iam_permissions(&self) -> super::builder::target_instances::TestIamPermissions {
17544 super::builder::target_instances::TestIamPermissions::new(self.inner.clone())
17545 }
17546
17547 /// Retrieves the specified zone-specific Operations resource.
17548 pub fn get_operation(&self) -> super::builder::target_instances::GetOperation {
17549 super::builder::target_instances::GetOperation::new(self.inner.clone())
17550 }
17551}
17552
17553/// Implements a client for the Google Compute Engine API.
17554///
17555/// # Example
17556/// ```
17557/// # use google_cloud_compute_v1::client::TargetPools;
17558/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
17559/// let client = TargetPools::builder().build().await?;
17560/// // use `client` to make requests to the Google Compute Engine API.
17561/// # Ok(()) }
17562/// ```
17563///
17564/// # Service Description
17565///
17566/// Service for the `targetPools` resource.
17567///
17568/// # Configuration
17569///
17570/// To configure `TargetPools` use the `with_*` methods in the type returned
17571/// by [builder()][TargetPools::builder]. The default configuration should
17572/// work for most applications. Common configuration changes include
17573///
17574/// * [with_endpoint()]: by default this client uses the global default endpoint
17575/// (`https://compute.googleapis.com`). Applications using regional
17576/// endpoints or running in restricted networks (e.g. a network configured
17577// with [Private Google Access with VPC Service Controls]) may want to
17578/// override this default.
17579/// * [with_credentials()]: by default this client uses
17580/// [Application Default Credentials]. Applications using custom
17581/// authentication may need to override this default.
17582///
17583/// [with_endpoint()]: super::builder::target_pools::ClientBuilder::with_endpoint
17584/// [with_credentials()]: super::builder::target_pools::ClientBuilder::with_credentials
17585/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17586/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17587///
17588/// # Pooling and Cloning
17589///
17590/// `TargetPools` holds a connection pool internally, it is advised to
17591/// create one and reuse it. You do not need to wrap `TargetPools` in
17592/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17593/// already uses an `Arc` internally.
17594#[cfg(feature = "target-pools")]
17595#[cfg_attr(docsrs, doc(cfg(feature = "target-pools")))]
17596#[derive(Clone, Debug)]
17597pub struct TargetPools {
17598 inner: std::sync::Arc<dyn super::stub::dynamic::TargetPools>,
17599}
17600
17601#[cfg(feature = "target-pools")]
17602impl TargetPools {
17603 /// Returns a builder for [TargetPools].
17604 ///
17605 /// ```
17606 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17607 /// # use google_cloud_compute_v1::client::TargetPools;
17608 /// let client = TargetPools::builder().build().await?;
17609 /// # Ok(()) }
17610 /// ```
17611 pub fn builder() -> super::builder::target_pools::ClientBuilder {
17612 crate::new_client_builder(super::builder::target_pools::client::Factory)
17613 }
17614
17615 /// Creates a new client from the provided stub.
17616 ///
17617 /// The most common case for calling this function is in tests mocking the
17618 /// client's behavior.
17619 pub fn from_stub<T>(stub: T) -> Self
17620 where
17621 T: super::stub::TargetPools + 'static,
17622 {
17623 Self {
17624 inner: std::sync::Arc::new(stub),
17625 }
17626 }
17627
17628 pub(crate) async fn new(
17629 config: gaxi::options::ClientConfig,
17630 ) -> crate::ClientBuilderResult<Self> {
17631 let inner = Self::build_inner(config).await?;
17632 Ok(Self { inner })
17633 }
17634
17635 async fn build_inner(
17636 conf: gaxi::options::ClientConfig,
17637 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetPools>> {
17638 if gaxi::options::tracing_enabled(&conf) {
17639 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17640 }
17641 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17642 }
17643
17644 async fn build_transport(
17645 conf: gaxi::options::ClientConfig,
17646 ) -> crate::ClientBuilderResult<impl super::stub::TargetPools> {
17647 super::transport::TargetPools::new(conf).await
17648 }
17649
17650 async fn build_with_tracing(
17651 conf: gaxi::options::ClientConfig,
17652 ) -> crate::ClientBuilderResult<impl super::stub::TargetPools> {
17653 Self::build_transport(conf)
17654 .await
17655 .map(super::tracing::TargetPools::new)
17656 }
17657
17658 /// Adds health check URLs to a target pool.
17659 pub fn add_health_check(&self) -> super::builder::target_pools::AddHealthCheck {
17660 super::builder::target_pools::AddHealthCheck::new(self.inner.clone())
17661 }
17662
17663 /// Adds an instance to a target pool.
17664 pub fn add_instance(&self) -> super::builder::target_pools::AddInstance {
17665 super::builder::target_pools::AddInstance::new(self.inner.clone())
17666 }
17667
17668 /// Retrieves an aggregated list of target pools.
17669 ///
17670 /// To prevent failure, Google recommends that you set the
17671 /// `returnPartialSuccess` parameter to `true`.
17672 pub fn aggregated_list(&self) -> super::builder::target_pools::AggregatedList {
17673 super::builder::target_pools::AggregatedList::new(self.inner.clone())
17674 }
17675
17676 /// Deletes the specified target pool.
17677 pub fn delete(&self) -> super::builder::target_pools::Delete {
17678 super::builder::target_pools::Delete::new(self.inner.clone())
17679 }
17680
17681 /// Returns the specified target pool.
17682 pub fn get(&self) -> super::builder::target_pools::Get {
17683 super::builder::target_pools::Get::new(self.inner.clone())
17684 }
17685
17686 /// Gets the most recent health check results for each IP for the
17687 /// instance that is referenced by the given target pool.
17688 pub fn get_health(&self) -> super::builder::target_pools::GetHealth {
17689 super::builder::target_pools::GetHealth::new(self.inner.clone())
17690 }
17691
17692 /// Creates a target pool in the specified project and region using
17693 /// the data included in the request.
17694 pub fn insert(&self) -> super::builder::target_pools::Insert {
17695 super::builder::target_pools::Insert::new(self.inner.clone())
17696 }
17697
17698 /// Retrieves a list of target pools available to the specified
17699 /// project and region.
17700 pub fn list(&self) -> super::builder::target_pools::List {
17701 super::builder::target_pools::List::new(self.inner.clone())
17702 }
17703
17704 /// Removes health check URL from a target pool.
17705 pub fn remove_health_check(&self) -> super::builder::target_pools::RemoveHealthCheck {
17706 super::builder::target_pools::RemoveHealthCheck::new(self.inner.clone())
17707 }
17708
17709 /// Removes instance URL from a target pool.
17710 pub fn remove_instance(&self) -> super::builder::target_pools::RemoveInstance {
17711 super::builder::target_pools::RemoveInstance::new(self.inner.clone())
17712 }
17713
17714 /// Changes a backup target pool's configurations.
17715 pub fn set_backup(&self) -> super::builder::target_pools::SetBackup {
17716 super::builder::target_pools::SetBackup::new(self.inner.clone())
17717 }
17718
17719 /// Sets the Google Cloud Armor security policy for the specified target pool.
17720 /// For more information, seeGoogle
17721 /// Cloud Armor Overview
17722 pub fn set_security_policy(&self) -> super::builder::target_pools::SetSecurityPolicy {
17723 super::builder::target_pools::SetSecurityPolicy::new(self.inner.clone())
17724 }
17725
17726 /// Returns permissions that a caller has on the specified resource.
17727 pub fn test_iam_permissions(&self) -> super::builder::target_pools::TestIamPermissions {
17728 super::builder::target_pools::TestIamPermissions::new(self.inner.clone())
17729 }
17730
17731 /// Retrieves the specified region-specific Operations resource.
17732 pub fn get_operation(&self) -> super::builder::target_pools::GetOperation {
17733 super::builder::target_pools::GetOperation::new(self.inner.clone())
17734 }
17735}
17736
17737/// Implements a client for the Google Compute Engine API.
17738///
17739/// # Example
17740/// ```
17741/// # use google_cloud_compute_v1::client::TargetSslProxies;
17742/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
17743/// let client = TargetSslProxies::builder().build().await?;
17744/// // use `client` to make requests to the Google Compute Engine API.
17745/// # Ok(()) }
17746/// ```
17747///
17748/// # Service Description
17749///
17750/// Service for the `targetSslProxies` resource.
17751///
17752/// # Configuration
17753///
17754/// To configure `TargetSslProxies` use the `with_*` methods in the type returned
17755/// by [builder()][TargetSslProxies::builder]. The default configuration should
17756/// work for most applications. Common configuration changes include
17757///
17758/// * [with_endpoint()]: by default this client uses the global default endpoint
17759/// (`https://compute.googleapis.com`). Applications using regional
17760/// endpoints or running in restricted networks (e.g. a network configured
17761// with [Private Google Access with VPC Service Controls]) may want to
17762/// override this default.
17763/// * [with_credentials()]: by default this client uses
17764/// [Application Default Credentials]. Applications using custom
17765/// authentication may need to override this default.
17766///
17767/// [with_endpoint()]: super::builder::target_ssl_proxies::ClientBuilder::with_endpoint
17768/// [with_credentials()]: super::builder::target_ssl_proxies::ClientBuilder::with_credentials
17769/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17770/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17771///
17772/// # Pooling and Cloning
17773///
17774/// `TargetSslProxies` holds a connection pool internally, it is advised to
17775/// create one and reuse it. You do not need to wrap `TargetSslProxies` in
17776/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17777/// already uses an `Arc` internally.
17778#[cfg(feature = "target-ssl-proxies")]
17779#[cfg_attr(docsrs, doc(cfg(feature = "target-ssl-proxies")))]
17780#[derive(Clone, Debug)]
17781pub struct TargetSslProxies {
17782 inner: std::sync::Arc<dyn super::stub::dynamic::TargetSslProxies>,
17783}
17784
17785#[cfg(feature = "target-ssl-proxies")]
17786impl TargetSslProxies {
17787 /// Returns a builder for [TargetSslProxies].
17788 ///
17789 /// ```
17790 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17791 /// # use google_cloud_compute_v1::client::TargetSslProxies;
17792 /// let client = TargetSslProxies::builder().build().await?;
17793 /// # Ok(()) }
17794 /// ```
17795 pub fn builder() -> super::builder::target_ssl_proxies::ClientBuilder {
17796 crate::new_client_builder(super::builder::target_ssl_proxies::client::Factory)
17797 }
17798
17799 /// Creates a new client from the provided stub.
17800 ///
17801 /// The most common case for calling this function is in tests mocking the
17802 /// client's behavior.
17803 pub fn from_stub<T>(stub: T) -> Self
17804 where
17805 T: super::stub::TargetSslProxies + 'static,
17806 {
17807 Self {
17808 inner: std::sync::Arc::new(stub),
17809 }
17810 }
17811
17812 pub(crate) async fn new(
17813 config: gaxi::options::ClientConfig,
17814 ) -> crate::ClientBuilderResult<Self> {
17815 let inner = Self::build_inner(config).await?;
17816 Ok(Self { inner })
17817 }
17818
17819 async fn build_inner(
17820 conf: gaxi::options::ClientConfig,
17821 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetSslProxies>>
17822 {
17823 if gaxi::options::tracing_enabled(&conf) {
17824 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17825 }
17826 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17827 }
17828
17829 async fn build_transport(
17830 conf: gaxi::options::ClientConfig,
17831 ) -> crate::ClientBuilderResult<impl super::stub::TargetSslProxies> {
17832 super::transport::TargetSslProxies::new(conf).await
17833 }
17834
17835 async fn build_with_tracing(
17836 conf: gaxi::options::ClientConfig,
17837 ) -> crate::ClientBuilderResult<impl super::stub::TargetSslProxies> {
17838 Self::build_transport(conf)
17839 .await
17840 .map(super::tracing::TargetSslProxies::new)
17841 }
17842
17843 /// Deletes the specified TargetSslProxy resource.
17844 pub fn delete(&self) -> super::builder::target_ssl_proxies::Delete {
17845 super::builder::target_ssl_proxies::Delete::new(self.inner.clone())
17846 }
17847
17848 /// Returns the specified TargetSslProxy resource.
17849 pub fn get(&self) -> super::builder::target_ssl_proxies::Get {
17850 super::builder::target_ssl_proxies::Get::new(self.inner.clone())
17851 }
17852
17853 /// Creates a TargetSslProxy resource in the specified project using
17854 /// the data included in the request.
17855 pub fn insert(&self) -> super::builder::target_ssl_proxies::Insert {
17856 super::builder::target_ssl_proxies::Insert::new(self.inner.clone())
17857 }
17858
17859 /// Retrieves the list of TargetSslProxy resources
17860 /// available to the specified project.
17861 pub fn list(&self) -> super::builder::target_ssl_proxies::List {
17862 super::builder::target_ssl_proxies::List::new(self.inner.clone())
17863 }
17864
17865 /// Changes the BackendService for TargetSslProxy.
17866 pub fn set_backend_service(&self) -> super::builder::target_ssl_proxies::SetBackendService {
17867 super::builder::target_ssl_proxies::SetBackendService::new(self.inner.clone())
17868 }
17869
17870 /// Changes the Certificate Map for TargetSslProxy.
17871 pub fn set_certificate_map(&self) -> super::builder::target_ssl_proxies::SetCertificateMap {
17872 super::builder::target_ssl_proxies::SetCertificateMap::new(self.inner.clone())
17873 }
17874
17875 /// Changes the ProxyHeaderType for TargetSslProxy.
17876 pub fn set_proxy_header(&self) -> super::builder::target_ssl_proxies::SetProxyHeader {
17877 super::builder::target_ssl_proxies::SetProxyHeader::new(self.inner.clone())
17878 }
17879
17880 /// Changes SslCertificates for TargetSslProxy.
17881 pub fn set_ssl_certificates(&self) -> super::builder::target_ssl_proxies::SetSslCertificates {
17882 super::builder::target_ssl_proxies::SetSslCertificates::new(self.inner.clone())
17883 }
17884
17885 /// Sets the SSL policy for TargetSslProxy. The SSL policy specifies the
17886 /// server-side support for SSL features. This affects connections between
17887 /// clients and the load balancer. They do not affect the
17888 /// connection between the load balancer and the backends.
17889 pub fn set_ssl_policy(&self) -> super::builder::target_ssl_proxies::SetSslPolicy {
17890 super::builder::target_ssl_proxies::SetSslPolicy::new(self.inner.clone())
17891 }
17892
17893 /// Returns permissions that a caller has on the specified resource.
17894 pub fn test_iam_permissions(&self) -> super::builder::target_ssl_proxies::TestIamPermissions {
17895 super::builder::target_ssl_proxies::TestIamPermissions::new(self.inner.clone())
17896 }
17897
17898 /// Retrieves the specified Operations resource.
17899 pub fn get_operation(&self) -> super::builder::target_ssl_proxies::GetOperation {
17900 super::builder::target_ssl_proxies::GetOperation::new(self.inner.clone())
17901 }
17902}
17903
17904/// Implements a client for the Google Compute Engine API.
17905///
17906/// # Example
17907/// ```
17908/// # use google_cloud_compute_v1::client::TargetTcpProxies;
17909/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
17910/// let client = TargetTcpProxies::builder().build().await?;
17911/// // use `client` to make requests to the Google Compute Engine API.
17912/// # Ok(()) }
17913/// ```
17914///
17915/// # Service Description
17916///
17917/// Service for the `targetTcpProxies` resource.
17918///
17919/// # Configuration
17920///
17921/// To configure `TargetTcpProxies` use the `with_*` methods in the type returned
17922/// by [builder()][TargetTcpProxies::builder]. The default configuration should
17923/// work for most applications. Common configuration changes include
17924///
17925/// * [with_endpoint()]: by default this client uses the global default endpoint
17926/// (`https://compute.googleapis.com`). Applications using regional
17927/// endpoints or running in restricted networks (e.g. a network configured
17928// with [Private Google Access with VPC Service Controls]) may want to
17929/// override this default.
17930/// * [with_credentials()]: by default this client uses
17931/// [Application Default Credentials]. Applications using custom
17932/// authentication may need to override this default.
17933///
17934/// [with_endpoint()]: super::builder::target_tcp_proxies::ClientBuilder::with_endpoint
17935/// [with_credentials()]: super::builder::target_tcp_proxies::ClientBuilder::with_credentials
17936/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17937/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17938///
17939/// # Pooling and Cloning
17940///
17941/// `TargetTcpProxies` holds a connection pool internally, it is advised to
17942/// create one and reuse it. You do not need to wrap `TargetTcpProxies` in
17943/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17944/// already uses an `Arc` internally.
17945#[cfg(feature = "target-tcp-proxies")]
17946#[cfg_attr(docsrs, doc(cfg(feature = "target-tcp-proxies")))]
17947#[derive(Clone, Debug)]
17948pub struct TargetTcpProxies {
17949 inner: std::sync::Arc<dyn super::stub::dynamic::TargetTcpProxies>,
17950}
17951
17952#[cfg(feature = "target-tcp-proxies")]
17953impl TargetTcpProxies {
17954 /// Returns a builder for [TargetTcpProxies].
17955 ///
17956 /// ```
17957 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17958 /// # use google_cloud_compute_v1::client::TargetTcpProxies;
17959 /// let client = TargetTcpProxies::builder().build().await?;
17960 /// # Ok(()) }
17961 /// ```
17962 pub fn builder() -> super::builder::target_tcp_proxies::ClientBuilder {
17963 crate::new_client_builder(super::builder::target_tcp_proxies::client::Factory)
17964 }
17965
17966 /// Creates a new client from the provided stub.
17967 ///
17968 /// The most common case for calling this function is in tests mocking the
17969 /// client's behavior.
17970 pub fn from_stub<T>(stub: T) -> Self
17971 where
17972 T: super::stub::TargetTcpProxies + 'static,
17973 {
17974 Self {
17975 inner: std::sync::Arc::new(stub),
17976 }
17977 }
17978
17979 pub(crate) async fn new(
17980 config: gaxi::options::ClientConfig,
17981 ) -> crate::ClientBuilderResult<Self> {
17982 let inner = Self::build_inner(config).await?;
17983 Ok(Self { inner })
17984 }
17985
17986 async fn build_inner(
17987 conf: gaxi::options::ClientConfig,
17988 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetTcpProxies>>
17989 {
17990 if gaxi::options::tracing_enabled(&conf) {
17991 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17992 }
17993 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17994 }
17995
17996 async fn build_transport(
17997 conf: gaxi::options::ClientConfig,
17998 ) -> crate::ClientBuilderResult<impl super::stub::TargetTcpProxies> {
17999 super::transport::TargetTcpProxies::new(conf).await
18000 }
18001
18002 async fn build_with_tracing(
18003 conf: gaxi::options::ClientConfig,
18004 ) -> crate::ClientBuilderResult<impl super::stub::TargetTcpProxies> {
18005 Self::build_transport(conf)
18006 .await
18007 .map(super::tracing::TargetTcpProxies::new)
18008 }
18009
18010 /// Retrieves the list of all TargetTcpProxy resources, regional and global,
18011 /// available to the specified project.
18012 ///
18013 /// To prevent failure, Google recommends that you set the
18014 /// `returnPartialSuccess` parameter to `true`.
18015 pub fn aggregated_list(&self) -> super::builder::target_tcp_proxies::AggregatedList {
18016 super::builder::target_tcp_proxies::AggregatedList::new(self.inner.clone())
18017 }
18018
18019 /// Deletes the specified TargetTcpProxy resource.
18020 pub fn delete(&self) -> super::builder::target_tcp_proxies::Delete {
18021 super::builder::target_tcp_proxies::Delete::new(self.inner.clone())
18022 }
18023
18024 /// Returns the specified TargetTcpProxy resource.
18025 pub fn get(&self) -> super::builder::target_tcp_proxies::Get {
18026 super::builder::target_tcp_proxies::Get::new(self.inner.clone())
18027 }
18028
18029 /// Creates a TargetTcpProxy resource in the specified project using
18030 /// the data included in the request.
18031 pub fn insert(&self) -> super::builder::target_tcp_proxies::Insert {
18032 super::builder::target_tcp_proxies::Insert::new(self.inner.clone())
18033 }
18034
18035 /// Retrieves the list of TargetTcpProxy resources
18036 /// available to the specified project.
18037 pub fn list(&self) -> super::builder::target_tcp_proxies::List {
18038 super::builder::target_tcp_proxies::List::new(self.inner.clone())
18039 }
18040
18041 /// Changes the BackendService for TargetTcpProxy.
18042 pub fn set_backend_service(&self) -> super::builder::target_tcp_proxies::SetBackendService {
18043 super::builder::target_tcp_proxies::SetBackendService::new(self.inner.clone())
18044 }
18045
18046 /// Changes the ProxyHeaderType for TargetTcpProxy.
18047 pub fn set_proxy_header(&self) -> super::builder::target_tcp_proxies::SetProxyHeader {
18048 super::builder::target_tcp_proxies::SetProxyHeader::new(self.inner.clone())
18049 }
18050
18051 /// Returns permissions that a caller has on the specified resource.
18052 pub fn test_iam_permissions(&self) -> super::builder::target_tcp_proxies::TestIamPermissions {
18053 super::builder::target_tcp_proxies::TestIamPermissions::new(self.inner.clone())
18054 }
18055
18056 /// Retrieves the specified Operations resource.
18057 pub fn get_operation(&self) -> super::builder::target_tcp_proxies::GetOperation {
18058 super::builder::target_tcp_proxies::GetOperation::new(self.inner.clone())
18059 }
18060}
18061
18062/// Implements a client for the Google Compute Engine API.
18063///
18064/// # Example
18065/// ```
18066/// # use google_cloud_compute_v1::client::TargetVpnGateways;
18067/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
18068/// let client = TargetVpnGateways::builder().build().await?;
18069/// // use `client` to make requests to the Google Compute Engine API.
18070/// # Ok(()) }
18071/// ```
18072///
18073/// # Service Description
18074///
18075/// Service for the `targetVpnGateways` resource.
18076///
18077/// # Configuration
18078///
18079/// To configure `TargetVpnGateways` use the `with_*` methods in the type returned
18080/// by [builder()][TargetVpnGateways::builder]. The default configuration should
18081/// work for most applications. Common configuration changes include
18082///
18083/// * [with_endpoint()]: by default this client uses the global default endpoint
18084/// (`https://compute.googleapis.com`). Applications using regional
18085/// endpoints or running in restricted networks (e.g. a network configured
18086// with [Private Google Access with VPC Service Controls]) may want to
18087/// override this default.
18088/// * [with_credentials()]: by default this client uses
18089/// [Application Default Credentials]. Applications using custom
18090/// authentication may need to override this default.
18091///
18092/// [with_endpoint()]: super::builder::target_vpn_gateways::ClientBuilder::with_endpoint
18093/// [with_credentials()]: super::builder::target_vpn_gateways::ClientBuilder::with_credentials
18094/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18095/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18096///
18097/// # Pooling and Cloning
18098///
18099/// `TargetVpnGateways` holds a connection pool internally, it is advised to
18100/// create one and reuse it. You do not need to wrap `TargetVpnGateways` in
18101/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18102/// already uses an `Arc` internally.
18103#[cfg(feature = "target-vpn-gateways")]
18104#[cfg_attr(docsrs, doc(cfg(feature = "target-vpn-gateways")))]
18105#[derive(Clone, Debug)]
18106pub struct TargetVpnGateways {
18107 inner: std::sync::Arc<dyn super::stub::dynamic::TargetVpnGateways>,
18108}
18109
18110#[cfg(feature = "target-vpn-gateways")]
18111impl TargetVpnGateways {
18112 /// Returns a builder for [TargetVpnGateways].
18113 ///
18114 /// ```
18115 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18116 /// # use google_cloud_compute_v1::client::TargetVpnGateways;
18117 /// let client = TargetVpnGateways::builder().build().await?;
18118 /// # Ok(()) }
18119 /// ```
18120 pub fn builder() -> super::builder::target_vpn_gateways::ClientBuilder {
18121 crate::new_client_builder(super::builder::target_vpn_gateways::client::Factory)
18122 }
18123
18124 /// Creates a new client from the provided stub.
18125 ///
18126 /// The most common case for calling this function is in tests mocking the
18127 /// client's behavior.
18128 pub fn from_stub<T>(stub: T) -> Self
18129 where
18130 T: super::stub::TargetVpnGateways + 'static,
18131 {
18132 Self {
18133 inner: std::sync::Arc::new(stub),
18134 }
18135 }
18136
18137 pub(crate) async fn new(
18138 config: gaxi::options::ClientConfig,
18139 ) -> crate::ClientBuilderResult<Self> {
18140 let inner = Self::build_inner(config).await?;
18141 Ok(Self { inner })
18142 }
18143
18144 async fn build_inner(
18145 conf: gaxi::options::ClientConfig,
18146 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetVpnGateways>>
18147 {
18148 if gaxi::options::tracing_enabled(&conf) {
18149 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18150 }
18151 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18152 }
18153
18154 async fn build_transport(
18155 conf: gaxi::options::ClientConfig,
18156 ) -> crate::ClientBuilderResult<impl super::stub::TargetVpnGateways> {
18157 super::transport::TargetVpnGateways::new(conf).await
18158 }
18159
18160 async fn build_with_tracing(
18161 conf: gaxi::options::ClientConfig,
18162 ) -> crate::ClientBuilderResult<impl super::stub::TargetVpnGateways> {
18163 Self::build_transport(conf)
18164 .await
18165 .map(super::tracing::TargetVpnGateways::new)
18166 }
18167
18168 /// Retrieves an aggregated list of target VPN gateways.
18169 ///
18170 /// To prevent failure, Google recommends that you set the
18171 /// `returnPartialSuccess` parameter to `true`.
18172 pub fn aggregated_list(&self) -> super::builder::target_vpn_gateways::AggregatedList {
18173 super::builder::target_vpn_gateways::AggregatedList::new(self.inner.clone())
18174 }
18175
18176 /// Deletes the specified target VPN gateway.
18177 pub fn delete(&self) -> super::builder::target_vpn_gateways::Delete {
18178 super::builder::target_vpn_gateways::Delete::new(self.inner.clone())
18179 }
18180
18181 /// Returns the specified target VPN gateway.
18182 pub fn get(&self) -> super::builder::target_vpn_gateways::Get {
18183 super::builder::target_vpn_gateways::Get::new(self.inner.clone())
18184 }
18185
18186 /// Creates a target VPN gateway in the specified project and region using
18187 /// the data included in the request.
18188 pub fn insert(&self) -> super::builder::target_vpn_gateways::Insert {
18189 super::builder::target_vpn_gateways::Insert::new(self.inner.clone())
18190 }
18191
18192 /// Retrieves a list of target VPN gateways available to the specified
18193 /// project and region.
18194 pub fn list(&self) -> super::builder::target_vpn_gateways::List {
18195 super::builder::target_vpn_gateways::List::new(self.inner.clone())
18196 }
18197
18198 /// Sets the labels on a TargetVpnGateway. To learn more about labels, read theLabeling
18199 /// Resources documentation.
18200 pub fn set_labels(&self) -> super::builder::target_vpn_gateways::SetLabels {
18201 super::builder::target_vpn_gateways::SetLabels::new(self.inner.clone())
18202 }
18203
18204 /// Retrieves the specified region-specific Operations resource.
18205 pub fn get_operation(&self) -> super::builder::target_vpn_gateways::GetOperation {
18206 super::builder::target_vpn_gateways::GetOperation::new(self.inner.clone())
18207 }
18208}
18209
18210/// Implements a client for the Google Compute Engine API.
18211///
18212/// # Example
18213/// ```
18214/// # use google_cloud_compute_v1::client::UrlMaps;
18215/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
18216/// let client = UrlMaps::builder().build().await?;
18217/// // use `client` to make requests to the Google Compute Engine API.
18218/// # Ok(()) }
18219/// ```
18220///
18221/// # Service Description
18222///
18223/// Service for the `urlMaps` resource.
18224///
18225/// # Configuration
18226///
18227/// To configure `UrlMaps` use the `with_*` methods in the type returned
18228/// by [builder()][UrlMaps::builder]. The default configuration should
18229/// work for most applications. Common configuration changes include
18230///
18231/// * [with_endpoint()]: by default this client uses the global default endpoint
18232/// (`https://compute.googleapis.com`). Applications using regional
18233/// endpoints or running in restricted networks (e.g. a network configured
18234// with [Private Google Access with VPC Service Controls]) may want to
18235/// override this default.
18236/// * [with_credentials()]: by default this client uses
18237/// [Application Default Credentials]. Applications using custom
18238/// authentication may need to override this default.
18239///
18240/// [with_endpoint()]: super::builder::url_maps::ClientBuilder::with_endpoint
18241/// [with_credentials()]: super::builder::url_maps::ClientBuilder::with_credentials
18242/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18243/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18244///
18245/// # Pooling and Cloning
18246///
18247/// `UrlMaps` holds a connection pool internally, it is advised to
18248/// create one and reuse it. You do not need to wrap `UrlMaps` in
18249/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18250/// already uses an `Arc` internally.
18251#[cfg(feature = "url-maps")]
18252#[cfg_attr(docsrs, doc(cfg(feature = "url-maps")))]
18253#[derive(Clone, Debug)]
18254pub struct UrlMaps {
18255 inner: std::sync::Arc<dyn super::stub::dynamic::UrlMaps>,
18256}
18257
18258#[cfg(feature = "url-maps")]
18259impl UrlMaps {
18260 /// Returns a builder for [UrlMaps].
18261 ///
18262 /// ```
18263 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18264 /// # use google_cloud_compute_v1::client::UrlMaps;
18265 /// let client = UrlMaps::builder().build().await?;
18266 /// # Ok(()) }
18267 /// ```
18268 pub fn builder() -> super::builder::url_maps::ClientBuilder {
18269 crate::new_client_builder(super::builder::url_maps::client::Factory)
18270 }
18271
18272 /// Creates a new client from the provided stub.
18273 ///
18274 /// The most common case for calling this function is in tests mocking the
18275 /// client's behavior.
18276 pub fn from_stub<T>(stub: T) -> Self
18277 where
18278 T: super::stub::UrlMaps + 'static,
18279 {
18280 Self {
18281 inner: std::sync::Arc::new(stub),
18282 }
18283 }
18284
18285 pub(crate) async fn new(
18286 config: gaxi::options::ClientConfig,
18287 ) -> crate::ClientBuilderResult<Self> {
18288 let inner = Self::build_inner(config).await?;
18289 Ok(Self { inner })
18290 }
18291
18292 async fn build_inner(
18293 conf: gaxi::options::ClientConfig,
18294 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::UrlMaps>> {
18295 if gaxi::options::tracing_enabled(&conf) {
18296 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18297 }
18298 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18299 }
18300
18301 async fn build_transport(
18302 conf: gaxi::options::ClientConfig,
18303 ) -> crate::ClientBuilderResult<impl super::stub::UrlMaps> {
18304 super::transport::UrlMaps::new(conf).await
18305 }
18306
18307 async fn build_with_tracing(
18308 conf: gaxi::options::ClientConfig,
18309 ) -> crate::ClientBuilderResult<impl super::stub::UrlMaps> {
18310 Self::build_transport(conf)
18311 .await
18312 .map(super::tracing::UrlMaps::new)
18313 }
18314
18315 /// Retrieves the list of all UrlMap resources, regional and global,
18316 /// available to the specified project.
18317 ///
18318 /// To prevent failure, Google recommends that you set the
18319 /// `returnPartialSuccess` parameter to `true`.
18320 pub fn aggregated_list(&self) -> super::builder::url_maps::AggregatedList {
18321 super::builder::url_maps::AggregatedList::new(self.inner.clone())
18322 }
18323
18324 /// Deletes the specified UrlMap resource.
18325 pub fn delete(&self) -> super::builder::url_maps::Delete {
18326 super::builder::url_maps::Delete::new(self.inner.clone())
18327 }
18328
18329 /// Returns the specified UrlMap resource.
18330 pub fn get(&self) -> super::builder::url_maps::Get {
18331 super::builder::url_maps::Get::new(self.inner.clone())
18332 }
18333
18334 /// Creates a UrlMap resource in the specified project using
18335 /// the data included in the request.
18336 pub fn insert(&self) -> super::builder::url_maps::Insert {
18337 super::builder::url_maps::Insert::new(self.inner.clone())
18338 }
18339
18340 /// Initiates a cache invalidation operation, invalidating the specified path,
18341 /// scoped to the specified UrlMap.
18342 ///
18343 /// For more information, see [Invalidating cached
18344 /// content](/cdn/docs/invalidating-cached-content).
18345 pub fn invalidate_cache(&self) -> super::builder::url_maps::InvalidateCache {
18346 super::builder::url_maps::InvalidateCache::new(self.inner.clone())
18347 }
18348
18349 /// Retrieves the list of UrlMap resources available to the specified
18350 /// project.
18351 pub fn list(&self) -> super::builder::url_maps::List {
18352 super::builder::url_maps::List::new(self.inner.clone())
18353 }
18354
18355 /// Patches the specified UrlMap resource with the data included in the
18356 /// request. This method supportsPATCH
18357 /// semantics and uses theJSON merge
18358 /// patch format and processing rules.
18359 pub fn patch(&self) -> super::builder::url_maps::Patch {
18360 super::builder::url_maps::Patch::new(self.inner.clone())
18361 }
18362
18363 /// Returns permissions that a caller has on the specified resource.
18364 pub fn test_iam_permissions(&self) -> super::builder::url_maps::TestIamPermissions {
18365 super::builder::url_maps::TestIamPermissions::new(self.inner.clone())
18366 }
18367
18368 /// Updates the specified UrlMap resource with the data included in the
18369 /// request.
18370 pub fn update(&self) -> super::builder::url_maps::Update {
18371 super::builder::url_maps::Update::new(self.inner.clone())
18372 }
18373
18374 /// Runs static validation for the UrlMap. In particular, the tests of the
18375 /// provided UrlMap will be run. Calling this method does NOT create the
18376 /// UrlMap.
18377 pub fn validate(&self) -> super::builder::url_maps::Validate {
18378 super::builder::url_maps::Validate::new(self.inner.clone())
18379 }
18380
18381 /// Retrieves the specified Operations resource.
18382 pub fn get_operation(&self) -> super::builder::url_maps::GetOperation {
18383 super::builder::url_maps::GetOperation::new(self.inner.clone())
18384 }
18385}
18386
18387/// Implements a client for the Google Compute Engine API.
18388///
18389/// # Example
18390/// ```
18391/// # use google_cloud_compute_v1::client::VpnGateways;
18392/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
18393/// let client = VpnGateways::builder().build().await?;
18394/// // use `client` to make requests to the Google Compute Engine API.
18395/// # Ok(()) }
18396/// ```
18397///
18398/// # Service Description
18399///
18400/// Service for the `vpnGateways` resource.
18401///
18402/// # Configuration
18403///
18404/// To configure `VpnGateways` use the `with_*` methods in the type returned
18405/// by [builder()][VpnGateways::builder]. The default configuration should
18406/// work for most applications. Common configuration changes include
18407///
18408/// * [with_endpoint()]: by default this client uses the global default endpoint
18409/// (`https://compute.googleapis.com`). Applications using regional
18410/// endpoints or running in restricted networks (e.g. a network configured
18411// with [Private Google Access with VPC Service Controls]) may want to
18412/// override this default.
18413/// * [with_credentials()]: by default this client uses
18414/// [Application Default Credentials]. Applications using custom
18415/// authentication may need to override this default.
18416///
18417/// [with_endpoint()]: super::builder::vpn_gateways::ClientBuilder::with_endpoint
18418/// [with_credentials()]: super::builder::vpn_gateways::ClientBuilder::with_credentials
18419/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18420/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18421///
18422/// # Pooling and Cloning
18423///
18424/// `VpnGateways` holds a connection pool internally, it is advised to
18425/// create one and reuse it. You do not need to wrap `VpnGateways` in
18426/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18427/// already uses an `Arc` internally.
18428#[cfg(feature = "vpn-gateways")]
18429#[cfg_attr(docsrs, doc(cfg(feature = "vpn-gateways")))]
18430#[derive(Clone, Debug)]
18431pub struct VpnGateways {
18432 inner: std::sync::Arc<dyn super::stub::dynamic::VpnGateways>,
18433}
18434
18435#[cfg(feature = "vpn-gateways")]
18436impl VpnGateways {
18437 /// Returns a builder for [VpnGateways].
18438 ///
18439 /// ```
18440 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18441 /// # use google_cloud_compute_v1::client::VpnGateways;
18442 /// let client = VpnGateways::builder().build().await?;
18443 /// # Ok(()) }
18444 /// ```
18445 pub fn builder() -> super::builder::vpn_gateways::ClientBuilder {
18446 crate::new_client_builder(super::builder::vpn_gateways::client::Factory)
18447 }
18448
18449 /// Creates a new client from the provided stub.
18450 ///
18451 /// The most common case for calling this function is in tests mocking the
18452 /// client's behavior.
18453 pub fn from_stub<T>(stub: T) -> Self
18454 where
18455 T: super::stub::VpnGateways + 'static,
18456 {
18457 Self {
18458 inner: std::sync::Arc::new(stub),
18459 }
18460 }
18461
18462 pub(crate) async fn new(
18463 config: gaxi::options::ClientConfig,
18464 ) -> crate::ClientBuilderResult<Self> {
18465 let inner = Self::build_inner(config).await?;
18466 Ok(Self { inner })
18467 }
18468
18469 async fn build_inner(
18470 conf: gaxi::options::ClientConfig,
18471 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::VpnGateways>> {
18472 if gaxi::options::tracing_enabled(&conf) {
18473 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18474 }
18475 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18476 }
18477
18478 async fn build_transport(
18479 conf: gaxi::options::ClientConfig,
18480 ) -> crate::ClientBuilderResult<impl super::stub::VpnGateways> {
18481 super::transport::VpnGateways::new(conf).await
18482 }
18483
18484 async fn build_with_tracing(
18485 conf: gaxi::options::ClientConfig,
18486 ) -> crate::ClientBuilderResult<impl super::stub::VpnGateways> {
18487 Self::build_transport(conf)
18488 .await
18489 .map(super::tracing::VpnGateways::new)
18490 }
18491
18492 /// Retrieves an aggregated list of VPN gateways.
18493 ///
18494 /// To prevent failure, Google recommends that you set the
18495 /// `returnPartialSuccess` parameter to `true`.
18496 pub fn aggregated_list(&self) -> super::builder::vpn_gateways::AggregatedList {
18497 super::builder::vpn_gateways::AggregatedList::new(self.inner.clone())
18498 }
18499
18500 /// Deletes the specified VPN gateway.
18501 pub fn delete(&self) -> super::builder::vpn_gateways::Delete {
18502 super::builder::vpn_gateways::Delete::new(self.inner.clone())
18503 }
18504
18505 /// Returns the specified VPN gateway.
18506 pub fn get(&self) -> super::builder::vpn_gateways::Get {
18507 super::builder::vpn_gateways::Get::new(self.inner.clone())
18508 }
18509
18510 /// Returns the status for the specified VPN gateway.
18511 pub fn get_status(&self) -> super::builder::vpn_gateways::GetStatus {
18512 super::builder::vpn_gateways::GetStatus::new(self.inner.clone())
18513 }
18514
18515 /// Creates a VPN gateway in the specified project and region using
18516 /// the data included in the request.
18517 pub fn insert(&self) -> super::builder::vpn_gateways::Insert {
18518 super::builder::vpn_gateways::Insert::new(self.inner.clone())
18519 }
18520
18521 /// Retrieves a list of VPN gateways available to the specified
18522 /// project and region.
18523 pub fn list(&self) -> super::builder::vpn_gateways::List {
18524 super::builder::vpn_gateways::List::new(self.inner.clone())
18525 }
18526
18527 /// Sets the labels on a VpnGateway. To learn more about labels, read theLabeling
18528 /// Resources documentation.
18529 pub fn set_labels(&self) -> super::builder::vpn_gateways::SetLabels {
18530 super::builder::vpn_gateways::SetLabels::new(self.inner.clone())
18531 }
18532
18533 /// Returns permissions that a caller has on the specified resource.
18534 pub fn test_iam_permissions(&self) -> super::builder::vpn_gateways::TestIamPermissions {
18535 super::builder::vpn_gateways::TestIamPermissions::new(self.inner.clone())
18536 }
18537
18538 /// Retrieves the specified region-specific Operations resource.
18539 pub fn get_operation(&self) -> super::builder::vpn_gateways::GetOperation {
18540 super::builder::vpn_gateways::GetOperation::new(self.inner.clone())
18541 }
18542}
18543
18544/// Implements a client for the Google Compute Engine API.
18545///
18546/// # Example
18547/// ```
18548/// # use google_cloud_compute_v1::client::VpnTunnels;
18549/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
18550/// let client = VpnTunnels::builder().build().await?;
18551/// // use `client` to make requests to the Google Compute Engine API.
18552/// # Ok(()) }
18553/// ```
18554///
18555/// # Service Description
18556///
18557/// Service for the `vpnTunnels` resource.
18558///
18559/// # Configuration
18560///
18561/// To configure `VpnTunnels` use the `with_*` methods in the type returned
18562/// by [builder()][VpnTunnels::builder]. The default configuration should
18563/// work for most applications. Common configuration changes include
18564///
18565/// * [with_endpoint()]: by default this client uses the global default endpoint
18566/// (`https://compute.googleapis.com`). Applications using regional
18567/// endpoints or running in restricted networks (e.g. a network configured
18568// with [Private Google Access with VPC Service Controls]) may want to
18569/// override this default.
18570/// * [with_credentials()]: by default this client uses
18571/// [Application Default Credentials]. Applications using custom
18572/// authentication may need to override this default.
18573///
18574/// [with_endpoint()]: super::builder::vpn_tunnels::ClientBuilder::with_endpoint
18575/// [with_credentials()]: super::builder::vpn_tunnels::ClientBuilder::with_credentials
18576/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18577/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18578///
18579/// # Pooling and Cloning
18580///
18581/// `VpnTunnels` holds a connection pool internally, it is advised to
18582/// create one and reuse it. You do not need to wrap `VpnTunnels` in
18583/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18584/// already uses an `Arc` internally.
18585#[cfg(feature = "vpn-tunnels")]
18586#[cfg_attr(docsrs, doc(cfg(feature = "vpn-tunnels")))]
18587#[derive(Clone, Debug)]
18588pub struct VpnTunnels {
18589 inner: std::sync::Arc<dyn super::stub::dynamic::VpnTunnels>,
18590}
18591
18592#[cfg(feature = "vpn-tunnels")]
18593impl VpnTunnels {
18594 /// Returns a builder for [VpnTunnels].
18595 ///
18596 /// ```
18597 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18598 /// # use google_cloud_compute_v1::client::VpnTunnels;
18599 /// let client = VpnTunnels::builder().build().await?;
18600 /// # Ok(()) }
18601 /// ```
18602 pub fn builder() -> super::builder::vpn_tunnels::ClientBuilder {
18603 crate::new_client_builder(super::builder::vpn_tunnels::client::Factory)
18604 }
18605
18606 /// Creates a new client from the provided stub.
18607 ///
18608 /// The most common case for calling this function is in tests mocking the
18609 /// client's behavior.
18610 pub fn from_stub<T>(stub: T) -> Self
18611 where
18612 T: super::stub::VpnTunnels + 'static,
18613 {
18614 Self {
18615 inner: std::sync::Arc::new(stub),
18616 }
18617 }
18618
18619 pub(crate) async fn new(
18620 config: gaxi::options::ClientConfig,
18621 ) -> crate::ClientBuilderResult<Self> {
18622 let inner = Self::build_inner(config).await?;
18623 Ok(Self { inner })
18624 }
18625
18626 async fn build_inner(
18627 conf: gaxi::options::ClientConfig,
18628 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::VpnTunnels>> {
18629 if gaxi::options::tracing_enabled(&conf) {
18630 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18631 }
18632 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18633 }
18634
18635 async fn build_transport(
18636 conf: gaxi::options::ClientConfig,
18637 ) -> crate::ClientBuilderResult<impl super::stub::VpnTunnels> {
18638 super::transport::VpnTunnels::new(conf).await
18639 }
18640
18641 async fn build_with_tracing(
18642 conf: gaxi::options::ClientConfig,
18643 ) -> crate::ClientBuilderResult<impl super::stub::VpnTunnels> {
18644 Self::build_transport(conf)
18645 .await
18646 .map(super::tracing::VpnTunnels::new)
18647 }
18648
18649 /// Retrieves an aggregated list of VPN tunnels.
18650 ///
18651 /// To prevent failure, Google recommends that you set the
18652 /// `returnPartialSuccess` parameter to `true`.
18653 pub fn aggregated_list(&self) -> super::builder::vpn_tunnels::AggregatedList {
18654 super::builder::vpn_tunnels::AggregatedList::new(self.inner.clone())
18655 }
18656
18657 /// Deletes the specified VpnTunnel resource.
18658 pub fn delete(&self) -> super::builder::vpn_tunnels::Delete {
18659 super::builder::vpn_tunnels::Delete::new(self.inner.clone())
18660 }
18661
18662 /// Returns the specified VpnTunnel resource.
18663 pub fn get(&self) -> super::builder::vpn_tunnels::Get {
18664 super::builder::vpn_tunnels::Get::new(self.inner.clone())
18665 }
18666
18667 /// Creates a VpnTunnel resource in the specified project and region using
18668 /// the data included in the request.
18669 pub fn insert(&self) -> super::builder::vpn_tunnels::Insert {
18670 super::builder::vpn_tunnels::Insert::new(self.inner.clone())
18671 }
18672
18673 /// Retrieves a list of VpnTunnel resources contained in the specified
18674 /// project and region.
18675 pub fn list(&self) -> super::builder::vpn_tunnels::List {
18676 super::builder::vpn_tunnels::List::new(self.inner.clone())
18677 }
18678
18679 /// Sets the labels on a VpnTunnel. To learn more about labels, read theLabeling
18680 /// Resources documentation.
18681 pub fn set_labels(&self) -> super::builder::vpn_tunnels::SetLabels {
18682 super::builder::vpn_tunnels::SetLabels::new(self.inner.clone())
18683 }
18684
18685 /// Retrieves the specified region-specific Operations resource.
18686 pub fn get_operation(&self) -> super::builder::vpn_tunnels::GetOperation {
18687 super::builder::vpn_tunnels::GetOperation::new(self.inner.clone())
18688 }
18689}
18690
18691/// Implements a client for the Google Compute Engine API.
18692///
18693/// # Example
18694/// ```
18695/// # use google_cloud_compute_v1::client::WireGroups;
18696/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
18697/// let client = WireGroups::builder().build().await?;
18698/// // use `client` to make requests to the Google Compute Engine API.
18699/// # Ok(()) }
18700/// ```
18701///
18702/// # Service Description
18703///
18704/// Service for the `wireGroups` resource.
18705///
18706/// # Configuration
18707///
18708/// To configure `WireGroups` use the `with_*` methods in the type returned
18709/// by [builder()][WireGroups::builder]. The default configuration should
18710/// work for most applications. Common configuration changes include
18711///
18712/// * [with_endpoint()]: by default this client uses the global default endpoint
18713/// (`https://compute.googleapis.com`). Applications using regional
18714/// endpoints or running in restricted networks (e.g. a network configured
18715// with [Private Google Access with VPC Service Controls]) may want to
18716/// override this default.
18717/// * [with_credentials()]: by default this client uses
18718/// [Application Default Credentials]. Applications using custom
18719/// authentication may need to override this default.
18720///
18721/// [with_endpoint()]: super::builder::wire_groups::ClientBuilder::with_endpoint
18722/// [with_credentials()]: super::builder::wire_groups::ClientBuilder::with_credentials
18723/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18724/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18725///
18726/// # Pooling and Cloning
18727///
18728/// `WireGroups` holds a connection pool internally, it is advised to
18729/// create one and reuse it. You do not need to wrap `WireGroups` in
18730/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18731/// already uses an `Arc` internally.
18732#[cfg(feature = "wire-groups")]
18733#[cfg_attr(docsrs, doc(cfg(feature = "wire-groups")))]
18734#[derive(Clone, Debug)]
18735pub struct WireGroups {
18736 inner: std::sync::Arc<dyn super::stub::dynamic::WireGroups>,
18737}
18738
18739#[cfg(feature = "wire-groups")]
18740impl WireGroups {
18741 /// Returns a builder for [WireGroups].
18742 ///
18743 /// ```
18744 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18745 /// # use google_cloud_compute_v1::client::WireGroups;
18746 /// let client = WireGroups::builder().build().await?;
18747 /// # Ok(()) }
18748 /// ```
18749 pub fn builder() -> super::builder::wire_groups::ClientBuilder {
18750 crate::new_client_builder(super::builder::wire_groups::client::Factory)
18751 }
18752
18753 /// Creates a new client from the provided stub.
18754 ///
18755 /// The most common case for calling this function is in tests mocking the
18756 /// client's behavior.
18757 pub fn from_stub<T>(stub: T) -> Self
18758 where
18759 T: super::stub::WireGroups + 'static,
18760 {
18761 Self {
18762 inner: std::sync::Arc::new(stub),
18763 }
18764 }
18765
18766 pub(crate) async fn new(
18767 config: gaxi::options::ClientConfig,
18768 ) -> crate::ClientBuilderResult<Self> {
18769 let inner = Self::build_inner(config).await?;
18770 Ok(Self { inner })
18771 }
18772
18773 async fn build_inner(
18774 conf: gaxi::options::ClientConfig,
18775 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::WireGroups>> {
18776 if gaxi::options::tracing_enabled(&conf) {
18777 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18778 }
18779 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18780 }
18781
18782 async fn build_transport(
18783 conf: gaxi::options::ClientConfig,
18784 ) -> crate::ClientBuilderResult<impl super::stub::WireGroups> {
18785 super::transport::WireGroups::new(conf).await
18786 }
18787
18788 async fn build_with_tracing(
18789 conf: gaxi::options::ClientConfig,
18790 ) -> crate::ClientBuilderResult<impl super::stub::WireGroups> {
18791 Self::build_transport(conf)
18792 .await
18793 .map(super::tracing::WireGroups::new)
18794 }
18795
18796 /// Deletes the specified wire group in the given scope.
18797 pub fn delete(&self) -> super::builder::wire_groups::Delete {
18798 super::builder::wire_groups::Delete::new(self.inner.clone())
18799 }
18800
18801 /// Gets the specified wire group resource in the given scope.
18802 pub fn get(&self) -> super::builder::wire_groups::Get {
18803 super::builder::wire_groups::Get::new(self.inner.clone())
18804 }
18805
18806 /// Creates a wire group in the specified project in the given scope
18807 /// using the parameters that are included in the request.
18808 pub fn insert(&self) -> super::builder::wire_groups::Insert {
18809 super::builder::wire_groups::Insert::new(self.inner.clone())
18810 }
18811
18812 /// Lists the wire groups for a project in the given scope.
18813 pub fn list(&self) -> super::builder::wire_groups::List {
18814 super::builder::wire_groups::List::new(self.inner.clone())
18815 }
18816
18817 /// Updates the specified wire group resource with the data included in the
18818 /// request. This method supportsPATCH
18819 /// semantics and usesJSON merge
18820 /// patch format and processing rules.
18821 pub fn patch(&self) -> super::builder::wire_groups::Patch {
18822 super::builder::wire_groups::Patch::new(self.inner.clone())
18823 }
18824
18825 /// Retrieves the specified Operations resource.
18826 pub fn get_operation(&self) -> super::builder::wire_groups::GetOperation {
18827 super::builder::wire_groups::GetOperation::new(self.inner.clone())
18828 }
18829}
18830
18831/// Implements a client for the Google Compute Engine API.
18832///
18833/// # Example
18834/// ```
18835/// # use google_cloud_compute_v1::client::ZoneOperations;
18836/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
18837/// let client = ZoneOperations::builder().build().await?;
18838/// // use `client` to make requests to the Google Compute Engine API.
18839/// # Ok(()) }
18840/// ```
18841///
18842/// # Service Description
18843///
18844/// Service for the `zoneOperations` resource.
18845///
18846/// # Configuration
18847///
18848/// To configure `ZoneOperations` use the `with_*` methods in the type returned
18849/// by [builder()][ZoneOperations::builder]. The default configuration should
18850/// work for most applications. Common configuration changes include
18851///
18852/// * [with_endpoint()]: by default this client uses the global default endpoint
18853/// (`https://compute.googleapis.com`). Applications using regional
18854/// endpoints or running in restricted networks (e.g. a network configured
18855// with [Private Google Access with VPC Service Controls]) may want to
18856/// override this default.
18857/// * [with_credentials()]: by default this client uses
18858/// [Application Default Credentials]. Applications using custom
18859/// authentication may need to override this default.
18860///
18861/// [with_endpoint()]: super::builder::zone_operations::ClientBuilder::with_endpoint
18862/// [with_credentials()]: super::builder::zone_operations::ClientBuilder::with_credentials
18863/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18864/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18865///
18866/// # Pooling and Cloning
18867///
18868/// `ZoneOperations` holds a connection pool internally, it is advised to
18869/// create one and reuse it. You do not need to wrap `ZoneOperations` in
18870/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18871/// already uses an `Arc` internally.
18872#[cfg(feature = "zone-operations")]
18873#[cfg_attr(docsrs, doc(cfg(feature = "zone-operations")))]
18874#[derive(Clone, Debug)]
18875pub struct ZoneOperations {
18876 inner: std::sync::Arc<dyn super::stub::dynamic::ZoneOperations>,
18877}
18878
18879#[cfg(feature = "zone-operations")]
18880impl ZoneOperations {
18881 /// Returns a builder for [ZoneOperations].
18882 ///
18883 /// ```
18884 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18885 /// # use google_cloud_compute_v1::client::ZoneOperations;
18886 /// let client = ZoneOperations::builder().build().await?;
18887 /// # Ok(()) }
18888 /// ```
18889 pub fn builder() -> super::builder::zone_operations::ClientBuilder {
18890 crate::new_client_builder(super::builder::zone_operations::client::Factory)
18891 }
18892
18893 /// Creates a new client from the provided stub.
18894 ///
18895 /// The most common case for calling this function is in tests mocking the
18896 /// client's behavior.
18897 pub fn from_stub<T>(stub: T) -> Self
18898 where
18899 T: super::stub::ZoneOperations + 'static,
18900 {
18901 Self {
18902 inner: std::sync::Arc::new(stub),
18903 }
18904 }
18905
18906 pub(crate) async fn new(
18907 config: gaxi::options::ClientConfig,
18908 ) -> crate::ClientBuilderResult<Self> {
18909 let inner = Self::build_inner(config).await?;
18910 Ok(Self { inner })
18911 }
18912
18913 async fn build_inner(
18914 conf: gaxi::options::ClientConfig,
18915 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ZoneOperations>> {
18916 if gaxi::options::tracing_enabled(&conf) {
18917 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18918 }
18919 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18920 }
18921
18922 async fn build_transport(
18923 conf: gaxi::options::ClientConfig,
18924 ) -> crate::ClientBuilderResult<impl super::stub::ZoneOperations> {
18925 super::transport::ZoneOperations::new(conf).await
18926 }
18927
18928 async fn build_with_tracing(
18929 conf: gaxi::options::ClientConfig,
18930 ) -> crate::ClientBuilderResult<impl super::stub::ZoneOperations> {
18931 Self::build_transport(conf)
18932 .await
18933 .map(super::tracing::ZoneOperations::new)
18934 }
18935
18936 /// Deletes the specified zone-specific Operations resource.
18937 pub fn delete(&self) -> super::builder::zone_operations::Delete {
18938 super::builder::zone_operations::Delete::new(self.inner.clone())
18939 }
18940
18941 /// Retrieves the specified zone-specific Operations resource.
18942 pub fn get(&self) -> super::builder::zone_operations::Get {
18943 super::builder::zone_operations::Get::new(self.inner.clone())
18944 }
18945
18946 /// Retrieves a list of Operation resources contained within
18947 /// the specified zone.
18948 pub fn list(&self) -> super::builder::zone_operations::List {
18949 super::builder::zone_operations::List::new(self.inner.clone())
18950 }
18951
18952 /// Waits for the specified Operation resource to return as `DONE`
18953 /// or for the request to approach the 2 minute deadline, and retrieves the
18954 /// specified Operation resource. This method waits for no more than the
18955 /// 2 minutes and then returns the current state of the
18956 /// operation, which might be `DONE` or still in progress.
18957 ///
18958 /// This method is called on a best-effort basis. Specifically:
18959 ///
18960 /// ```norust
18961 /// - In uncommon cases, when the server is overloaded, the request might
18962 /// return before the default deadline is reached, or might return after zero
18963 /// seconds.
18964 /// ```
18965 ///
18966 /// - If the default deadline is reached, there is no guarantee that the
18967 /// operation is actually done when the method returns. Be prepared to retry
18968 /// if the operation is not `DONE`.
18969 pub fn wait(&self) -> super::builder::zone_operations::Wait {
18970 super::builder::zone_operations::Wait::new(self.inner.clone())
18971 }
18972}
18973
18974/// Implements a client for the Google Compute Engine API.
18975///
18976/// # Example
18977/// ```
18978/// # use google_cloud_compute_v1::client::Zones;
18979/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
18980/// let client = Zones::builder().build().await?;
18981/// // use `client` to make requests to the Google Compute Engine API.
18982/// # Ok(()) }
18983/// ```
18984///
18985/// # Service Description
18986///
18987/// Service for the `zones` resource.
18988///
18989/// # Configuration
18990///
18991/// To configure `Zones` use the `with_*` methods in the type returned
18992/// by [builder()][Zones::builder]. The default configuration should
18993/// work for most applications. Common configuration changes include
18994///
18995/// * [with_endpoint()]: by default this client uses the global default endpoint
18996/// (`https://compute.googleapis.com`). Applications using regional
18997/// endpoints or running in restricted networks (e.g. a network configured
18998// with [Private Google Access with VPC Service Controls]) may want to
18999/// override this default.
19000/// * [with_credentials()]: by default this client uses
19001/// [Application Default Credentials]. Applications using custom
19002/// authentication may need to override this default.
19003///
19004/// [with_endpoint()]: super::builder::zones::ClientBuilder::with_endpoint
19005/// [with_credentials()]: super::builder::zones::ClientBuilder::with_credentials
19006/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
19007/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
19008///
19009/// # Pooling and Cloning
19010///
19011/// `Zones` holds a connection pool internally, it is advised to
19012/// create one and reuse it. You do not need to wrap `Zones` in
19013/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
19014/// already uses an `Arc` internally.
19015#[cfg(feature = "zones")]
19016#[cfg_attr(docsrs, doc(cfg(feature = "zones")))]
19017#[derive(Clone, Debug)]
19018pub struct Zones {
19019 inner: std::sync::Arc<dyn super::stub::dynamic::Zones>,
19020}
19021
19022#[cfg(feature = "zones")]
19023impl Zones {
19024 /// Returns a builder for [Zones].
19025 ///
19026 /// ```
19027 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19028 /// # use google_cloud_compute_v1::client::Zones;
19029 /// let client = Zones::builder().build().await?;
19030 /// # Ok(()) }
19031 /// ```
19032 pub fn builder() -> super::builder::zones::ClientBuilder {
19033 crate::new_client_builder(super::builder::zones::client::Factory)
19034 }
19035
19036 /// Creates a new client from the provided stub.
19037 ///
19038 /// The most common case for calling this function is in tests mocking the
19039 /// client's behavior.
19040 pub fn from_stub<T>(stub: T) -> Self
19041 where
19042 T: super::stub::Zones + 'static,
19043 {
19044 Self {
19045 inner: std::sync::Arc::new(stub),
19046 }
19047 }
19048
19049 pub(crate) async fn new(
19050 config: gaxi::options::ClientConfig,
19051 ) -> crate::ClientBuilderResult<Self> {
19052 let inner = Self::build_inner(config).await?;
19053 Ok(Self { inner })
19054 }
19055
19056 async fn build_inner(
19057 conf: gaxi::options::ClientConfig,
19058 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Zones>> {
19059 if gaxi::options::tracing_enabled(&conf) {
19060 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
19061 }
19062 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
19063 }
19064
19065 async fn build_transport(
19066 conf: gaxi::options::ClientConfig,
19067 ) -> crate::ClientBuilderResult<impl super::stub::Zones> {
19068 super::transport::Zones::new(conf).await
19069 }
19070
19071 async fn build_with_tracing(
19072 conf: gaxi::options::ClientConfig,
19073 ) -> crate::ClientBuilderResult<impl super::stub::Zones> {
19074 Self::build_transport(conf)
19075 .await
19076 .map(super::tracing::Zones::new)
19077 }
19078
19079 /// Returns the specified Zone resource.
19080 pub fn get(&self) -> super::builder::zones::Get {
19081 super::builder::zones::Get::new(self.inner.clone())
19082 }
19083
19084 /// Retrieves the list of Zone resources available to the specified project.
19085 pub fn list(&self) -> super::builder::zones::List {
19086 super::builder::zones::List::new(self.inner.clone())
19087 }
19088}