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 /// Gets partner metadata of the specified instance and namespaces.
5239 pub fn get_partner_metadata(&self) -> super::builder::instances::GetPartnerMetadata {
5240 super::builder::instances::GetPartnerMetadata::new(self.inner.clone())
5241 }
5242
5243 /// Returns the screenshot from the specified instance.
5244 pub fn get_screenshot(&self) -> super::builder::instances::GetScreenshot {
5245 super::builder::instances::GetScreenshot::new(self.inner.clone())
5246 }
5247
5248 /// Returns the last 1 MB of serial port output from the specified instance.
5249 pub fn get_serial_port_output(&self) -> super::builder::instances::GetSerialPortOutput {
5250 super::builder::instances::GetSerialPortOutput::new(self.inner.clone())
5251 }
5252
5253 /// Returns the Shielded Instance Identity of an instance
5254 pub fn get_shielded_instance_identity(
5255 &self,
5256 ) -> super::builder::instances::GetShieldedInstanceIdentity {
5257 super::builder::instances::GetShieldedInstanceIdentity::new(self.inner.clone())
5258 }
5259
5260 /// Creates an instance resource in the specified project using the data
5261 /// included in the request.
5262 pub fn insert(&self) -> super::builder::instances::Insert {
5263 super::builder::instances::Insert::new(self.inner.clone())
5264 }
5265
5266 /// Retrieves the list of instances contained within
5267 /// the specified zone.
5268 pub fn list(&self) -> super::builder::instances::List {
5269 super::builder::instances::List::new(self.inner.clone())
5270 }
5271
5272 /// Retrieves a list of resources that refer to the VM instance specified in
5273 /// the request. For example, if the VM instance is part of a managed or
5274 /// unmanaged instance group, the referrers list includes the instance group.
5275 /// For more information, readViewing
5276 /// referrers to VM instances.
5277 pub fn list_referrers(&self) -> super::builder::instances::ListReferrers {
5278 super::builder::instances::ListReferrers::new(self.inner.clone())
5279 }
5280
5281 /// Patches partner metadata of the specified instance.
5282 pub fn patch_partner_metadata(&self) -> super::builder::instances::PatchPartnerMetadata {
5283 super::builder::instances::PatchPartnerMetadata::new(self.inner.clone())
5284 }
5285
5286 /// Perform a manual maintenance on the instance.
5287 pub fn perform_maintenance(&self) -> super::builder::instances::PerformMaintenance {
5288 super::builder::instances::PerformMaintenance::new(self.inner.clone())
5289 }
5290
5291 /// Removes resource policies from an instance.
5292 pub fn remove_resource_policies(&self) -> super::builder::instances::RemoveResourcePolicies {
5293 super::builder::instances::RemoveResourcePolicies::new(self.inner.clone())
5294 }
5295
5296 /// Mark the host as faulty and try to restart the instance on a new host.
5297 pub fn report_host_as_faulty(&self) -> super::builder::instances::ReportHostAsFaulty {
5298 super::builder::instances::ReportHostAsFaulty::new(self.inner.clone())
5299 }
5300
5301 /// Performs a reset on the instance. This is a hard reset. The VM
5302 /// does not do a graceful shutdown. For more information, seeResetting
5303 /// an instance.
5304 pub fn reset(&self) -> super::builder::instances::Reset {
5305 super::builder::instances::Reset::new(self.inner.clone())
5306 }
5307
5308 /// Resumes an instance that was suspended using theinstances().suspend
5309 /// method.
5310 pub fn resume(&self) -> super::builder::instances::Resume {
5311 super::builder::instances::Resume::new(self.inner.clone())
5312 }
5313
5314 /// Sends diagnostic interrupt to the instance.
5315 pub fn send_diagnostic_interrupt(&self) -> super::builder::instances::SendDiagnosticInterrupt {
5316 super::builder::instances::SendDiagnosticInterrupt::new(self.inner.clone())
5317 }
5318
5319 /// Sets deletion protection on the instance.
5320 pub fn set_deletion_protection(&self) -> super::builder::instances::SetDeletionProtection {
5321 super::builder::instances::SetDeletionProtection::new(self.inner.clone())
5322 }
5323
5324 /// Sets the auto-delete flag for a disk attached to an instance.
5325 pub fn set_disk_auto_delete(&self) -> super::builder::instances::SetDiskAutoDelete {
5326 super::builder::instances::SetDiskAutoDelete::new(self.inner.clone())
5327 }
5328
5329 /// Sets the access control policy on the specified resource.
5330 /// Replaces any existing policy.
5331 pub fn set_iam_policy(&self) -> super::builder::instances::SetIamPolicy {
5332 super::builder::instances::SetIamPolicy::new(self.inner.clone())
5333 }
5334
5335 /// Sets labels on an instance. To learn more about labels, read theLabeling
5336 /// Resources documentation.
5337 pub fn set_labels(&self) -> super::builder::instances::SetLabels {
5338 super::builder::instances::SetLabels::new(self.inner.clone())
5339 }
5340
5341 /// Changes the number and/or type of accelerator for a stopped instance to the
5342 /// values specified in the request.
5343 pub fn set_machine_resources(&self) -> super::builder::instances::SetMachineResources {
5344 super::builder::instances::SetMachineResources::new(self.inner.clone())
5345 }
5346
5347 /// Changes the machine type for a stopped instance to the machine
5348 /// type specified in the request.
5349 pub fn set_machine_type(&self) -> super::builder::instances::SetMachineType {
5350 super::builder::instances::SetMachineType::new(self.inner.clone())
5351 }
5352
5353 /// Sets metadata for the specified instance to the data included
5354 /// in the request.
5355 pub fn set_metadata(&self) -> super::builder::instances::SetMetadata {
5356 super::builder::instances::SetMetadata::new(self.inner.clone())
5357 }
5358
5359 /// Changes the minimum CPU platform that this instance should use.
5360 /// This method can only
5361 /// be called on a stopped instance. For more information, readSpecifying a
5362 /// Minimum CPU Platform.
5363 pub fn set_min_cpu_platform(&self) -> super::builder::instances::SetMinCpuPlatform {
5364 super::builder::instances::SetMinCpuPlatform::new(self.inner.clone())
5365 }
5366
5367 /// Sets name of an instance.
5368 pub fn set_name(&self) -> super::builder::instances::SetName {
5369 super::builder::instances::SetName::new(self.inner.clone())
5370 }
5371
5372 /// Sets an instance's scheduling options. You can only call this method on astopped instance,
5373 /// that is, a VM instance that is in a `TERMINATED` state. SeeInstance Life
5374 /// Cycle for more information on the possible instance states.
5375 /// For more information about setting scheduling options for a VM, seeSet
5376 /// VM host maintenance policy.
5377 pub fn set_scheduling(&self) -> super::builder::instances::SetScheduling {
5378 super::builder::instances::SetScheduling::new(self.inner.clone())
5379 }
5380
5381 /// Sets the Google Cloud Armor security policy for the specified instance.
5382 /// For more information, seeGoogle
5383 /// Cloud Armor Overview
5384 pub fn set_security_policy(&self) -> super::builder::instances::SetSecurityPolicy {
5385 super::builder::instances::SetSecurityPolicy::new(self.inner.clone())
5386 }
5387
5388 /// Sets the service account on the instance. For more information,
5389 /// readChanging
5390 /// the service account and access scopes for an instance.
5391 pub fn set_service_account(&self) -> super::builder::instances::SetServiceAccount {
5392 super::builder::instances::SetServiceAccount::new(self.inner.clone())
5393 }
5394
5395 /// Sets the Shielded Instance integrity policy for an instance. You can
5396 /// only use this method on a running instance. This method
5397 /// supports PATCH semantics and uses the JSON merge
5398 /// patch format and processing rules.
5399 pub fn set_shielded_instance_integrity_policy(
5400 &self,
5401 ) -> super::builder::instances::SetShieldedInstanceIntegrityPolicy {
5402 super::builder::instances::SetShieldedInstanceIntegrityPolicy::new(self.inner.clone())
5403 }
5404
5405 /// Sets network tags
5406 /// for the specified instance to the data included in the request.
5407 pub fn set_tags(&self) -> super::builder::instances::SetTags {
5408 super::builder::instances::SetTags::new(self.inner.clone())
5409 }
5410
5411 /// Simulates a host maintenance event on a VM. For more information, see
5412 /// Simulate a host maintenance event.
5413 pub fn simulate_maintenance_event(
5414 &self,
5415 ) -> super::builder::instances::SimulateMaintenanceEvent {
5416 super::builder::instances::SimulateMaintenanceEvent::new(self.inner.clone())
5417 }
5418
5419 /// Starts an instance that was stopped using theinstances().stop
5420 /// method. For more information, seeRestart an
5421 /// instance.
5422 pub fn start(&self) -> super::builder::instances::Start {
5423 super::builder::instances::Start::new(self.inner.clone())
5424 }
5425
5426 /// Starts an instance that was stopped using theinstances().stop
5427 /// method. For more information, seeRestart an
5428 /// instance.
5429 pub fn start_with_encryption_key(&self) -> super::builder::instances::StartWithEncryptionKey {
5430 super::builder::instances::StartWithEncryptionKey::new(self.inner.clone())
5431 }
5432
5433 /// Stops a running instance, shutting it down cleanly, and allows
5434 /// you to restart the instance at a later time. Stopped instances do not incur
5435 /// VM usage charges while they are stopped. However, resources that the VM is
5436 /// using, such as persistent disks and static IP addresses, will continue to
5437 /// be charged until they are deleted. For more information, seeStopping
5438 /// an instance.
5439 pub fn stop(&self) -> super::builder::instances::Stop {
5440 super::builder::instances::Stop::new(self.inner.clone())
5441 }
5442
5443 /// This method suspends a running instance, saving its state to persistent
5444 /// storage, and allows you to resume the instance at a later time. Suspended
5445 /// instances have no compute costs (cores or RAM), and incur only storage
5446 /// charges for the saved VM memory and localSSD data. Any charged resources
5447 /// the virtual machine was using, such as persistent disks and static IP
5448 /// addresses, will continue to be charged while the instance is suspended.
5449 /// For more information, see
5450 /// Suspending and resuming an instance.
5451 pub fn suspend(&self) -> super::builder::instances::Suspend {
5452 super::builder::instances::Suspend::new(self.inner.clone())
5453 }
5454
5455 /// Returns permissions that a caller has on the specified resource.
5456 pub fn test_iam_permissions(&self) -> super::builder::instances::TestIamPermissions {
5457 super::builder::instances::TestIamPermissions::new(self.inner.clone())
5458 }
5459
5460 /// Updates an instance only if the necessary resources are available. This
5461 /// method can update only a specific set of instance properties. See
5462 /// Updating a running instance for a list of updatable instance
5463 /// properties.
5464 pub fn update(&self) -> super::builder::instances::Update {
5465 super::builder::instances::Update::new(self.inner.clone())
5466 }
5467
5468 /// Updates the specified access config from an instance's network interface
5469 /// with the data included in the request. This method supportsPATCH
5470 /// semantics and uses theJSON merge
5471 /// patch format and processing rules.
5472 pub fn update_access_config(&self) -> super::builder::instances::UpdateAccessConfig {
5473 super::builder::instances::UpdateAccessConfig::new(self.inner.clone())
5474 }
5475
5476 /// Updates the Display config for a VM instance. You can
5477 /// only use this method on a stopped VM instance. This method supportsPATCH
5478 /// semantics and uses theJSON merge
5479 /// patch format and processing rules.
5480 pub fn update_display_device(&self) -> super::builder::instances::UpdateDisplayDevice {
5481 super::builder::instances::UpdateDisplayDevice::new(self.inner.clone())
5482 }
5483
5484 /// Updates an instance's network interface. This method can only update an
5485 /// interface's alias IP range and attached network. See Modifying
5486 /// alias IP ranges for an existing instance for instructions on
5487 /// changing alias IP ranges. See Migrating
5488 /// a VM between networks for instructions on migrating an interface.
5489 /// This method follows PATCH semantics.
5490 pub fn update_network_interface(&self) -> super::builder::instances::UpdateNetworkInterface {
5491 super::builder::instances::UpdateNetworkInterface::new(self.inner.clone())
5492 }
5493
5494 /// Updates the Shielded Instance config for an instance. You can
5495 /// only use this method on a stopped instance. This method supportsPATCH
5496 /// semantics and uses theJSON merge
5497 /// patch format and processing rules.
5498 pub fn update_shielded_instance_config(
5499 &self,
5500 ) -> super::builder::instances::UpdateShieldedInstanceConfig {
5501 super::builder::instances::UpdateShieldedInstanceConfig::new(self.inner.clone())
5502 }
5503
5504 /// Retrieves the specified zone-specific Operations resource.
5505 pub fn get_operation(&self) -> super::builder::instances::GetOperation {
5506 super::builder::instances::GetOperation::new(self.inner.clone())
5507 }
5508}
5509
5510/// Implements a client for the Google Compute Engine API.
5511///
5512/// # Example
5513/// ```
5514/// # use google_cloud_compute_v1::client::InstantSnapshots;
5515/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
5516/// let client = InstantSnapshots::builder().build().await?;
5517/// // use `client` to make requests to the Google Compute Engine API.
5518/// # Ok(()) }
5519/// ```
5520///
5521/// # Service Description
5522///
5523/// Service for the `instantSnapshots` resource.
5524///
5525/// # Configuration
5526///
5527/// To configure `InstantSnapshots` use the `with_*` methods in the type returned
5528/// by [builder()][InstantSnapshots::builder]. The default configuration should
5529/// work for most applications. Common configuration changes include
5530///
5531/// * [with_endpoint()]: by default this client uses the global default endpoint
5532/// (`https://compute.googleapis.com`). Applications using regional
5533/// endpoints or running in restricted networks (e.g. a network configured
5534// with [Private Google Access with VPC Service Controls]) may want to
5535/// override this default.
5536/// * [with_credentials()]: by default this client uses
5537/// [Application Default Credentials]. Applications using custom
5538/// authentication may need to override this default.
5539///
5540/// [with_endpoint()]: super::builder::instant_snapshots::ClientBuilder::with_endpoint
5541/// [with_credentials()]: super::builder::instant_snapshots::ClientBuilder::with_credentials
5542/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5543/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5544///
5545/// # Pooling and Cloning
5546///
5547/// `InstantSnapshots` holds a connection pool internally, it is advised to
5548/// create one and reuse it. You do not need to wrap `InstantSnapshots` in
5549/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5550/// already uses an `Arc` internally.
5551#[cfg(feature = "instant-snapshots")]
5552#[cfg_attr(docsrs, doc(cfg(feature = "instant-snapshots")))]
5553#[derive(Clone, Debug)]
5554pub struct InstantSnapshots {
5555 inner: std::sync::Arc<dyn super::stub::dynamic::InstantSnapshots>,
5556}
5557
5558#[cfg(feature = "instant-snapshots")]
5559impl InstantSnapshots {
5560 /// Returns a builder for [InstantSnapshots].
5561 ///
5562 /// ```
5563 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5564 /// # use google_cloud_compute_v1::client::InstantSnapshots;
5565 /// let client = InstantSnapshots::builder().build().await?;
5566 /// # Ok(()) }
5567 /// ```
5568 pub fn builder() -> super::builder::instant_snapshots::ClientBuilder {
5569 crate::new_client_builder(super::builder::instant_snapshots::client::Factory)
5570 }
5571
5572 /// Creates a new client from the provided stub.
5573 ///
5574 /// The most common case for calling this function is in tests mocking the
5575 /// client's behavior.
5576 pub fn from_stub<T>(stub: T) -> Self
5577 where
5578 T: super::stub::InstantSnapshots + 'static,
5579 {
5580 Self {
5581 inner: std::sync::Arc::new(stub),
5582 }
5583 }
5584
5585 pub(crate) async fn new(
5586 config: gaxi::options::ClientConfig,
5587 ) -> crate::ClientBuilderResult<Self> {
5588 let inner = Self::build_inner(config).await?;
5589 Ok(Self { inner })
5590 }
5591
5592 async fn build_inner(
5593 conf: gaxi::options::ClientConfig,
5594 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InstantSnapshots>>
5595 {
5596 if gaxi::options::tracing_enabled(&conf) {
5597 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5598 }
5599 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5600 }
5601
5602 async fn build_transport(
5603 conf: gaxi::options::ClientConfig,
5604 ) -> crate::ClientBuilderResult<impl super::stub::InstantSnapshots> {
5605 super::transport::InstantSnapshots::new(conf).await
5606 }
5607
5608 async fn build_with_tracing(
5609 conf: gaxi::options::ClientConfig,
5610 ) -> crate::ClientBuilderResult<impl super::stub::InstantSnapshots> {
5611 Self::build_transport(conf)
5612 .await
5613 .map(super::tracing::InstantSnapshots::new)
5614 }
5615
5616 /// Retrieves an aggregated list of instantSnapshots.
5617 ///
5618 /// To prevent failure, Google recommends that you set the
5619 /// `returnPartialSuccess` parameter to `true`.
5620 pub fn aggregated_list(&self) -> super::builder::instant_snapshots::AggregatedList {
5621 super::builder::instant_snapshots::AggregatedList::new(self.inner.clone())
5622 }
5623
5624 /// Deletes the specified InstantSnapshot resource. Keep in mind that deleting
5625 /// a single instantSnapshot might not necessarily delete all the data on that
5626 /// instantSnapshot. If any data on the instantSnapshot that is marked for
5627 /// deletion is needed for subsequent instantSnapshots, the data will be moved
5628 /// to the next corresponding instantSnapshot.
5629 ///
5630 /// For more information, seeDeleting
5631 /// instantSnapshots.
5632 pub fn delete(&self) -> super::builder::instant_snapshots::Delete {
5633 super::builder::instant_snapshots::Delete::new(self.inner.clone())
5634 }
5635
5636 /// Returns the specified InstantSnapshot resource in the specified zone.
5637 pub fn get(&self) -> super::builder::instant_snapshots::Get {
5638 super::builder::instant_snapshots::Get::new(self.inner.clone())
5639 }
5640
5641 /// Gets the access control policy for a resource. May be empty if no such
5642 /// policy or resource exists.
5643 pub fn get_iam_policy(&self) -> super::builder::instant_snapshots::GetIamPolicy {
5644 super::builder::instant_snapshots::GetIamPolicy::new(self.inner.clone())
5645 }
5646
5647 /// Creates an instant snapshot in the specified zone.
5648 pub fn insert(&self) -> super::builder::instant_snapshots::Insert {
5649 super::builder::instant_snapshots::Insert::new(self.inner.clone())
5650 }
5651
5652 /// Retrieves the list of InstantSnapshot resources contained within
5653 /// the specified zone.
5654 pub fn list(&self) -> super::builder::instant_snapshots::List {
5655 super::builder::instant_snapshots::List::new(self.inner.clone())
5656 }
5657
5658 /// Sets the access control policy on the specified resource.
5659 /// Replaces any existing policy.
5660 pub fn set_iam_policy(&self) -> super::builder::instant_snapshots::SetIamPolicy {
5661 super::builder::instant_snapshots::SetIamPolicy::new(self.inner.clone())
5662 }
5663
5664 /// Sets the labels on a instantSnapshot in the given zone. To learn more about
5665 /// labels, read the Labeling
5666 /// Resources documentation.
5667 pub fn set_labels(&self) -> super::builder::instant_snapshots::SetLabels {
5668 super::builder::instant_snapshots::SetLabels::new(self.inner.clone())
5669 }
5670
5671 /// Returns permissions that a caller has on the specified resource.
5672 pub fn test_iam_permissions(&self) -> super::builder::instant_snapshots::TestIamPermissions {
5673 super::builder::instant_snapshots::TestIamPermissions::new(self.inner.clone())
5674 }
5675
5676 /// Retrieves the specified zone-specific Operations resource.
5677 pub fn get_operation(&self) -> super::builder::instant_snapshots::GetOperation {
5678 super::builder::instant_snapshots::GetOperation::new(self.inner.clone())
5679 }
5680}
5681
5682/// Implements a client for the Google Compute Engine API.
5683///
5684/// # Example
5685/// ```
5686/// # use google_cloud_compute_v1::client::InterconnectAttachmentGroups;
5687/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
5688/// let client = InterconnectAttachmentGroups::builder().build().await?;
5689/// // use `client` to make requests to the Google Compute Engine API.
5690/// # Ok(()) }
5691/// ```
5692///
5693/// # Service Description
5694///
5695/// Service for the `interconnectAttachmentGroups` resource.
5696///
5697/// # Configuration
5698///
5699/// To configure `InterconnectAttachmentGroups` use the `with_*` methods in the type returned
5700/// by [builder()][InterconnectAttachmentGroups::builder]. The default configuration should
5701/// work for most applications. Common configuration changes include
5702///
5703/// * [with_endpoint()]: by default this client uses the global default endpoint
5704/// (`https://compute.googleapis.com`). Applications using regional
5705/// endpoints or running in restricted networks (e.g. a network configured
5706// with [Private Google Access with VPC Service Controls]) may want to
5707/// override this default.
5708/// * [with_credentials()]: by default this client uses
5709/// [Application Default Credentials]. Applications using custom
5710/// authentication may need to override this default.
5711///
5712/// [with_endpoint()]: super::builder::interconnect_attachment_groups::ClientBuilder::with_endpoint
5713/// [with_credentials()]: super::builder::interconnect_attachment_groups::ClientBuilder::with_credentials
5714/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5715/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5716///
5717/// # Pooling and Cloning
5718///
5719/// `InterconnectAttachmentGroups` holds a connection pool internally, it is advised to
5720/// create one and reuse it. You do not need to wrap `InterconnectAttachmentGroups` in
5721/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5722/// already uses an `Arc` internally.
5723#[cfg(feature = "interconnect-attachment-groups")]
5724#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-attachment-groups")))]
5725#[derive(Clone, Debug)]
5726pub struct InterconnectAttachmentGroups {
5727 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachmentGroups>,
5728}
5729
5730#[cfg(feature = "interconnect-attachment-groups")]
5731impl InterconnectAttachmentGroups {
5732 /// Returns a builder for [InterconnectAttachmentGroups].
5733 ///
5734 /// ```
5735 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5736 /// # use google_cloud_compute_v1::client::InterconnectAttachmentGroups;
5737 /// let client = InterconnectAttachmentGroups::builder().build().await?;
5738 /// # Ok(()) }
5739 /// ```
5740 pub fn builder() -> super::builder::interconnect_attachment_groups::ClientBuilder {
5741 crate::new_client_builder(super::builder::interconnect_attachment_groups::client::Factory)
5742 }
5743
5744 /// Creates a new client from the provided stub.
5745 ///
5746 /// The most common case for calling this function is in tests mocking the
5747 /// client's behavior.
5748 pub fn from_stub<T>(stub: T) -> Self
5749 where
5750 T: super::stub::InterconnectAttachmentGroups + 'static,
5751 {
5752 Self {
5753 inner: std::sync::Arc::new(stub),
5754 }
5755 }
5756
5757 pub(crate) async fn new(
5758 config: gaxi::options::ClientConfig,
5759 ) -> crate::ClientBuilderResult<Self> {
5760 let inner = Self::build_inner(config).await?;
5761 Ok(Self { inner })
5762 }
5763
5764 async fn build_inner(
5765 conf: gaxi::options::ClientConfig,
5766 ) -> crate::ClientBuilderResult<
5767 std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachmentGroups>,
5768 > {
5769 if gaxi::options::tracing_enabled(&conf) {
5770 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5771 }
5772 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5773 }
5774
5775 async fn build_transport(
5776 conf: gaxi::options::ClientConfig,
5777 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectAttachmentGroups> {
5778 super::transport::InterconnectAttachmentGroups::new(conf).await
5779 }
5780
5781 async fn build_with_tracing(
5782 conf: gaxi::options::ClientConfig,
5783 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectAttachmentGroups> {
5784 Self::build_transport(conf)
5785 .await
5786 .map(super::tracing::InterconnectAttachmentGroups::new)
5787 }
5788
5789 /// Deletes the specified InterconnectAttachmentGroup in the given scope
5790 pub fn delete(&self) -> super::builder::interconnect_attachment_groups::Delete {
5791 super::builder::interconnect_attachment_groups::Delete::new(self.inner.clone())
5792 }
5793
5794 /// Returns the specified InterconnectAttachmentGroup resource in the given
5795 /// scope.
5796 pub fn get(&self) -> super::builder::interconnect_attachment_groups::Get {
5797 super::builder::interconnect_attachment_groups::Get::new(self.inner.clone())
5798 }
5799
5800 /// Gets the access control policy for a resource. May be empty if no such
5801 /// policy or resource exists.
5802 pub fn get_iam_policy(&self) -> super::builder::interconnect_attachment_groups::GetIamPolicy {
5803 super::builder::interconnect_attachment_groups::GetIamPolicy::new(self.inner.clone())
5804 }
5805
5806 /// Returns the InterconnectAttachmentStatuses for the specified
5807 /// InterconnectAttachmentGroup resource.
5808 pub fn get_operational_status(
5809 &self,
5810 ) -> super::builder::interconnect_attachment_groups::GetOperationalStatus {
5811 super::builder::interconnect_attachment_groups::GetOperationalStatus::new(
5812 self.inner.clone(),
5813 )
5814 }
5815
5816 /// Creates a InterconnectAttachmentGroup in the specified project in the given
5817 /// scope using the parameters that are included in the request.
5818 pub fn insert(&self) -> super::builder::interconnect_attachment_groups::Insert {
5819 super::builder::interconnect_attachment_groups::Insert::new(self.inner.clone())
5820 }
5821
5822 /// Lists the InterconnectAttachmentGroups for a project in the given scope.
5823 pub fn list(&self) -> super::builder::interconnect_attachment_groups::List {
5824 super::builder::interconnect_attachment_groups::List::new(self.inner.clone())
5825 }
5826
5827 /// Patches the specified InterconnectAttachmentGroup resource with the data
5828 /// included in the request. This method supports PATCH
5829 /// semantics and usesJSON merge
5830 /// patch format and processing rules.
5831 pub fn patch(&self) -> super::builder::interconnect_attachment_groups::Patch {
5832 super::builder::interconnect_attachment_groups::Patch::new(self.inner.clone())
5833 }
5834
5835 /// Sets the access control policy on the specified resource.
5836 /// Replaces any existing policy.
5837 pub fn set_iam_policy(&self) -> super::builder::interconnect_attachment_groups::SetIamPolicy {
5838 super::builder::interconnect_attachment_groups::SetIamPolicy::new(self.inner.clone())
5839 }
5840
5841 /// Returns permissions that a caller has on the specified resource.
5842 pub fn test_iam_permissions(
5843 &self,
5844 ) -> super::builder::interconnect_attachment_groups::TestIamPermissions {
5845 super::builder::interconnect_attachment_groups::TestIamPermissions::new(self.inner.clone())
5846 }
5847
5848 /// Retrieves the specified Operations resource.
5849 pub fn get_operation(&self) -> super::builder::interconnect_attachment_groups::GetOperation {
5850 super::builder::interconnect_attachment_groups::GetOperation::new(self.inner.clone())
5851 }
5852}
5853
5854/// Implements a client for the Google Compute Engine API.
5855///
5856/// # Example
5857/// ```
5858/// # use google_cloud_compute_v1::client::InterconnectAttachments;
5859/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
5860/// let client = InterconnectAttachments::builder().build().await?;
5861/// // use `client` to make requests to the Google Compute Engine API.
5862/// # Ok(()) }
5863/// ```
5864///
5865/// # Service Description
5866///
5867/// Service for the `interconnectAttachments` resource.
5868///
5869/// # Configuration
5870///
5871/// To configure `InterconnectAttachments` use the `with_*` methods in the type returned
5872/// by [builder()][InterconnectAttachments::builder]. The default configuration should
5873/// work for most applications. Common configuration changes include
5874///
5875/// * [with_endpoint()]: by default this client uses the global default endpoint
5876/// (`https://compute.googleapis.com`). Applications using regional
5877/// endpoints or running in restricted networks (e.g. a network configured
5878// with [Private Google Access with VPC Service Controls]) may want to
5879/// override this default.
5880/// * [with_credentials()]: by default this client uses
5881/// [Application Default Credentials]. Applications using custom
5882/// authentication may need to override this default.
5883///
5884/// [with_endpoint()]: super::builder::interconnect_attachments::ClientBuilder::with_endpoint
5885/// [with_credentials()]: super::builder::interconnect_attachments::ClientBuilder::with_credentials
5886/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5887/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5888///
5889/// # Pooling and Cloning
5890///
5891/// `InterconnectAttachments` holds a connection pool internally, it is advised to
5892/// create one and reuse it. You do not need to wrap `InterconnectAttachments` in
5893/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5894/// already uses an `Arc` internally.
5895#[cfg(feature = "interconnect-attachments")]
5896#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-attachments")))]
5897#[derive(Clone, Debug)]
5898pub struct InterconnectAttachments {
5899 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachments>,
5900}
5901
5902#[cfg(feature = "interconnect-attachments")]
5903impl InterconnectAttachments {
5904 /// Returns a builder for [InterconnectAttachments].
5905 ///
5906 /// ```
5907 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5908 /// # use google_cloud_compute_v1::client::InterconnectAttachments;
5909 /// let client = InterconnectAttachments::builder().build().await?;
5910 /// # Ok(()) }
5911 /// ```
5912 pub fn builder() -> super::builder::interconnect_attachments::ClientBuilder {
5913 crate::new_client_builder(super::builder::interconnect_attachments::client::Factory)
5914 }
5915
5916 /// Creates a new client from the provided stub.
5917 ///
5918 /// The most common case for calling this function is in tests mocking the
5919 /// client's behavior.
5920 pub fn from_stub<T>(stub: T) -> Self
5921 where
5922 T: super::stub::InterconnectAttachments + 'static,
5923 {
5924 Self {
5925 inner: std::sync::Arc::new(stub),
5926 }
5927 }
5928
5929 pub(crate) async fn new(
5930 config: gaxi::options::ClientConfig,
5931 ) -> crate::ClientBuilderResult<Self> {
5932 let inner = Self::build_inner(config).await?;
5933 Ok(Self { inner })
5934 }
5935
5936 async fn build_inner(
5937 conf: gaxi::options::ClientConfig,
5938 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachments>>
5939 {
5940 if gaxi::options::tracing_enabled(&conf) {
5941 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5942 }
5943 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5944 }
5945
5946 async fn build_transport(
5947 conf: gaxi::options::ClientConfig,
5948 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectAttachments> {
5949 super::transport::InterconnectAttachments::new(conf).await
5950 }
5951
5952 async fn build_with_tracing(
5953 conf: gaxi::options::ClientConfig,
5954 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectAttachments> {
5955 Self::build_transport(conf)
5956 .await
5957 .map(super::tracing::InterconnectAttachments::new)
5958 }
5959
5960 /// Retrieves an aggregated list of interconnect attachments.
5961 ///
5962 /// To prevent failure, Google recommends that you set the
5963 /// `returnPartialSuccess` parameter to `true`.
5964 pub fn aggregated_list(&self) -> super::builder::interconnect_attachments::AggregatedList {
5965 super::builder::interconnect_attachments::AggregatedList::new(self.inner.clone())
5966 }
5967
5968 /// Deletes the specified interconnect attachment.
5969 pub fn delete(&self) -> super::builder::interconnect_attachments::Delete {
5970 super::builder::interconnect_attachments::Delete::new(self.inner.clone())
5971 }
5972
5973 /// Returns the specified interconnect attachment.
5974 pub fn get(&self) -> super::builder::interconnect_attachments::Get {
5975 super::builder::interconnect_attachments::Get::new(self.inner.clone())
5976 }
5977
5978 /// Creates an InterconnectAttachment in the specified project using the data
5979 /// included in the request.
5980 pub fn insert(&self) -> super::builder::interconnect_attachments::Insert {
5981 super::builder::interconnect_attachments::Insert::new(self.inner.clone())
5982 }
5983
5984 /// Retrieves the list of interconnect attachments contained within
5985 /// the specified region.
5986 pub fn list(&self) -> super::builder::interconnect_attachments::List {
5987 super::builder::interconnect_attachments::List::new(self.inner.clone())
5988 }
5989
5990 /// Updates the specified interconnect attachment with the data included in the
5991 /// request. This method supportsPATCH
5992 /// semantics and uses theJSON merge
5993 /// patch format and processing rules.
5994 pub fn patch(&self) -> super::builder::interconnect_attachments::Patch {
5995 super::builder::interconnect_attachments::Patch::new(self.inner.clone())
5996 }
5997
5998 /// Sets the labels on an InterconnectAttachment. To learn more about labels,
5999 /// read the Labeling
6000 /// Resources documentation.
6001 pub fn set_labels(&self) -> super::builder::interconnect_attachments::SetLabels {
6002 super::builder::interconnect_attachments::SetLabels::new(self.inner.clone())
6003 }
6004
6005 /// Retrieves the specified region-specific Operations resource.
6006 pub fn get_operation(&self) -> super::builder::interconnect_attachments::GetOperation {
6007 super::builder::interconnect_attachments::GetOperation::new(self.inner.clone())
6008 }
6009}
6010
6011/// Implements a client for the Google Compute Engine API.
6012///
6013/// # Example
6014/// ```
6015/// # use google_cloud_compute_v1::client::InterconnectGroups;
6016/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
6017/// let client = InterconnectGroups::builder().build().await?;
6018/// // use `client` to make requests to the Google Compute Engine API.
6019/// # Ok(()) }
6020/// ```
6021///
6022/// # Service Description
6023///
6024/// Service for the `interconnectGroups` resource.
6025///
6026/// # Configuration
6027///
6028/// To configure `InterconnectGroups` use the `with_*` methods in the type returned
6029/// by [builder()][InterconnectGroups::builder]. The default configuration should
6030/// work for most applications. Common configuration changes include
6031///
6032/// * [with_endpoint()]: by default this client uses the global default endpoint
6033/// (`https://compute.googleapis.com`). Applications using regional
6034/// endpoints or running in restricted networks (e.g. a network configured
6035// with [Private Google Access with VPC Service Controls]) may want to
6036/// override this default.
6037/// * [with_credentials()]: by default this client uses
6038/// [Application Default Credentials]. Applications using custom
6039/// authentication may need to override this default.
6040///
6041/// [with_endpoint()]: super::builder::interconnect_groups::ClientBuilder::with_endpoint
6042/// [with_credentials()]: super::builder::interconnect_groups::ClientBuilder::with_credentials
6043/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6044/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6045///
6046/// # Pooling and Cloning
6047///
6048/// `InterconnectGroups` holds a connection pool internally, it is advised to
6049/// create one and reuse it. You do not need to wrap `InterconnectGroups` in
6050/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6051/// already uses an `Arc` internally.
6052#[cfg(feature = "interconnect-groups")]
6053#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-groups")))]
6054#[derive(Clone, Debug)]
6055pub struct InterconnectGroups {
6056 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectGroups>,
6057}
6058
6059#[cfg(feature = "interconnect-groups")]
6060impl InterconnectGroups {
6061 /// Returns a builder for [InterconnectGroups].
6062 ///
6063 /// ```
6064 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6065 /// # use google_cloud_compute_v1::client::InterconnectGroups;
6066 /// let client = InterconnectGroups::builder().build().await?;
6067 /// # Ok(()) }
6068 /// ```
6069 pub fn builder() -> super::builder::interconnect_groups::ClientBuilder {
6070 crate::new_client_builder(super::builder::interconnect_groups::client::Factory)
6071 }
6072
6073 /// Creates a new client from the provided stub.
6074 ///
6075 /// The most common case for calling this function is in tests mocking the
6076 /// client's behavior.
6077 pub fn from_stub<T>(stub: T) -> Self
6078 where
6079 T: super::stub::InterconnectGroups + 'static,
6080 {
6081 Self {
6082 inner: std::sync::Arc::new(stub),
6083 }
6084 }
6085
6086 pub(crate) async fn new(
6087 config: gaxi::options::ClientConfig,
6088 ) -> crate::ClientBuilderResult<Self> {
6089 let inner = Self::build_inner(config).await?;
6090 Ok(Self { inner })
6091 }
6092
6093 async fn build_inner(
6094 conf: gaxi::options::ClientConfig,
6095 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InterconnectGroups>>
6096 {
6097 if gaxi::options::tracing_enabled(&conf) {
6098 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6099 }
6100 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6101 }
6102
6103 async fn build_transport(
6104 conf: gaxi::options::ClientConfig,
6105 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectGroups> {
6106 super::transport::InterconnectGroups::new(conf).await
6107 }
6108
6109 async fn build_with_tracing(
6110 conf: gaxi::options::ClientConfig,
6111 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectGroups> {
6112 Self::build_transport(conf)
6113 .await
6114 .map(super::tracing::InterconnectGroups::new)
6115 }
6116
6117 /// Create Interconnects with redundancy by creating them in a specified
6118 /// interconnect group.
6119 pub fn create_members(&self) -> super::builder::interconnect_groups::CreateMembers {
6120 super::builder::interconnect_groups::CreateMembers::new(self.inner.clone())
6121 }
6122
6123 /// Deletes the specified InterconnectGroup in the given scope
6124 pub fn delete(&self) -> super::builder::interconnect_groups::Delete {
6125 super::builder::interconnect_groups::Delete::new(self.inner.clone())
6126 }
6127
6128 /// Returns the specified InterconnectGroup resource in the given scope.
6129 pub fn get(&self) -> super::builder::interconnect_groups::Get {
6130 super::builder::interconnect_groups::Get::new(self.inner.clone())
6131 }
6132
6133 /// Gets the access control policy for a resource. May be empty if no such
6134 /// policy or resource exists.
6135 pub fn get_iam_policy(&self) -> super::builder::interconnect_groups::GetIamPolicy {
6136 super::builder::interconnect_groups::GetIamPolicy::new(self.inner.clone())
6137 }
6138
6139 /// Returns the interconnectStatuses for the specified
6140 /// InterconnectGroup.
6141 pub fn get_operational_status(
6142 &self,
6143 ) -> super::builder::interconnect_groups::GetOperationalStatus {
6144 super::builder::interconnect_groups::GetOperationalStatus::new(self.inner.clone())
6145 }
6146
6147 /// Creates a InterconnectGroup in the specified project in the given scope
6148 /// using the parameters that are included in the request.
6149 pub fn insert(&self) -> super::builder::interconnect_groups::Insert {
6150 super::builder::interconnect_groups::Insert::new(self.inner.clone())
6151 }
6152
6153 /// Lists the InterconnectGroups for a project in the given scope.
6154 pub fn list(&self) -> super::builder::interconnect_groups::List {
6155 super::builder::interconnect_groups::List::new(self.inner.clone())
6156 }
6157
6158 /// Patches the specified InterconnectGroup resource with the data included in
6159 /// the request. This method supports PATCH
6160 /// semantics and usesJSON merge
6161 /// patch format and processing rules.
6162 pub fn patch(&self) -> super::builder::interconnect_groups::Patch {
6163 super::builder::interconnect_groups::Patch::new(self.inner.clone())
6164 }
6165
6166 /// Sets the access control policy on the specified resource.
6167 /// Replaces any existing policy.
6168 pub fn set_iam_policy(&self) -> super::builder::interconnect_groups::SetIamPolicy {
6169 super::builder::interconnect_groups::SetIamPolicy::new(self.inner.clone())
6170 }
6171
6172 /// Returns permissions that a caller has on the specified resource.
6173 pub fn test_iam_permissions(&self) -> super::builder::interconnect_groups::TestIamPermissions {
6174 super::builder::interconnect_groups::TestIamPermissions::new(self.inner.clone())
6175 }
6176
6177 /// Retrieves the specified Operations resource.
6178 pub fn get_operation(&self) -> super::builder::interconnect_groups::GetOperation {
6179 super::builder::interconnect_groups::GetOperation::new(self.inner.clone())
6180 }
6181}
6182
6183/// Implements a client for the Google Compute Engine API.
6184///
6185/// # Example
6186/// ```
6187/// # use google_cloud_compute_v1::client::InterconnectLocations;
6188/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
6189/// let client = InterconnectLocations::builder().build().await?;
6190/// // use `client` to make requests to the Google Compute Engine API.
6191/// # Ok(()) }
6192/// ```
6193///
6194/// # Service Description
6195///
6196/// Service for the `interconnectLocations` resource.
6197///
6198/// # Configuration
6199///
6200/// To configure `InterconnectLocations` use the `with_*` methods in the type returned
6201/// by [builder()][InterconnectLocations::builder]. The default configuration should
6202/// work for most applications. Common configuration changes include
6203///
6204/// * [with_endpoint()]: by default this client uses the global default endpoint
6205/// (`https://compute.googleapis.com`). Applications using regional
6206/// endpoints or running in restricted networks (e.g. a network configured
6207// with [Private Google Access with VPC Service Controls]) may want to
6208/// override this default.
6209/// * [with_credentials()]: by default this client uses
6210/// [Application Default Credentials]. Applications using custom
6211/// authentication may need to override this default.
6212///
6213/// [with_endpoint()]: super::builder::interconnect_locations::ClientBuilder::with_endpoint
6214/// [with_credentials()]: super::builder::interconnect_locations::ClientBuilder::with_credentials
6215/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6216/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6217///
6218/// # Pooling and Cloning
6219///
6220/// `InterconnectLocations` holds a connection pool internally, it is advised to
6221/// create one and reuse it. You do not need to wrap `InterconnectLocations` in
6222/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6223/// already uses an `Arc` internally.
6224#[cfg(feature = "interconnect-locations")]
6225#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-locations")))]
6226#[derive(Clone, Debug)]
6227pub struct InterconnectLocations {
6228 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectLocations>,
6229}
6230
6231#[cfg(feature = "interconnect-locations")]
6232impl InterconnectLocations {
6233 /// Returns a builder for [InterconnectLocations].
6234 ///
6235 /// ```
6236 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6237 /// # use google_cloud_compute_v1::client::InterconnectLocations;
6238 /// let client = InterconnectLocations::builder().build().await?;
6239 /// # Ok(()) }
6240 /// ```
6241 pub fn builder() -> super::builder::interconnect_locations::ClientBuilder {
6242 crate::new_client_builder(super::builder::interconnect_locations::client::Factory)
6243 }
6244
6245 /// Creates a new client from the provided stub.
6246 ///
6247 /// The most common case for calling this function is in tests mocking the
6248 /// client's behavior.
6249 pub fn from_stub<T>(stub: T) -> Self
6250 where
6251 T: super::stub::InterconnectLocations + 'static,
6252 {
6253 Self {
6254 inner: std::sync::Arc::new(stub),
6255 }
6256 }
6257
6258 pub(crate) async fn new(
6259 config: gaxi::options::ClientConfig,
6260 ) -> crate::ClientBuilderResult<Self> {
6261 let inner = Self::build_inner(config).await?;
6262 Ok(Self { inner })
6263 }
6264
6265 async fn build_inner(
6266 conf: gaxi::options::ClientConfig,
6267 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InterconnectLocations>>
6268 {
6269 if gaxi::options::tracing_enabled(&conf) {
6270 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6271 }
6272 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6273 }
6274
6275 async fn build_transport(
6276 conf: gaxi::options::ClientConfig,
6277 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectLocations> {
6278 super::transport::InterconnectLocations::new(conf).await
6279 }
6280
6281 async fn build_with_tracing(
6282 conf: gaxi::options::ClientConfig,
6283 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectLocations> {
6284 Self::build_transport(conf)
6285 .await
6286 .map(super::tracing::InterconnectLocations::new)
6287 }
6288
6289 /// Returns the details for the specified interconnect location. Gets a list of
6290 /// available interconnect locations by making a list() request.
6291 pub fn get(&self) -> super::builder::interconnect_locations::Get {
6292 super::builder::interconnect_locations::Get::new(self.inner.clone())
6293 }
6294
6295 /// Retrieves the list of interconnect locations available to the specified
6296 /// project.
6297 pub fn list(&self) -> super::builder::interconnect_locations::List {
6298 super::builder::interconnect_locations::List::new(self.inner.clone())
6299 }
6300}
6301
6302/// Implements a client for the Google Compute Engine API.
6303///
6304/// # Example
6305/// ```
6306/// # use google_cloud_compute_v1::client::InterconnectRemoteLocations;
6307/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
6308/// let client = InterconnectRemoteLocations::builder().build().await?;
6309/// // use `client` to make requests to the Google Compute Engine API.
6310/// # Ok(()) }
6311/// ```
6312///
6313/// # Service Description
6314///
6315/// Service for the `interconnectRemoteLocations` resource.
6316///
6317/// # Configuration
6318///
6319/// To configure `InterconnectRemoteLocations` use the `with_*` methods in the type returned
6320/// by [builder()][InterconnectRemoteLocations::builder]. The default configuration should
6321/// work for most applications. Common configuration changes include
6322///
6323/// * [with_endpoint()]: by default this client uses the global default endpoint
6324/// (`https://compute.googleapis.com`). Applications using regional
6325/// endpoints or running in restricted networks (e.g. a network configured
6326// with [Private Google Access with VPC Service Controls]) may want to
6327/// override this default.
6328/// * [with_credentials()]: by default this client uses
6329/// [Application Default Credentials]. Applications using custom
6330/// authentication may need to override this default.
6331///
6332/// [with_endpoint()]: super::builder::interconnect_remote_locations::ClientBuilder::with_endpoint
6333/// [with_credentials()]: super::builder::interconnect_remote_locations::ClientBuilder::with_credentials
6334/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6335/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6336///
6337/// # Pooling and Cloning
6338///
6339/// `InterconnectRemoteLocations` holds a connection pool internally, it is advised to
6340/// create one and reuse it. You do not need to wrap `InterconnectRemoteLocations` in
6341/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6342/// already uses an `Arc` internally.
6343#[cfg(feature = "interconnect-remote-locations")]
6344#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-remote-locations")))]
6345#[derive(Clone, Debug)]
6346pub struct InterconnectRemoteLocations {
6347 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectRemoteLocations>,
6348}
6349
6350#[cfg(feature = "interconnect-remote-locations")]
6351impl InterconnectRemoteLocations {
6352 /// Returns a builder for [InterconnectRemoteLocations].
6353 ///
6354 /// ```
6355 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6356 /// # use google_cloud_compute_v1::client::InterconnectRemoteLocations;
6357 /// let client = InterconnectRemoteLocations::builder().build().await?;
6358 /// # Ok(()) }
6359 /// ```
6360 pub fn builder() -> super::builder::interconnect_remote_locations::ClientBuilder {
6361 crate::new_client_builder(super::builder::interconnect_remote_locations::client::Factory)
6362 }
6363
6364 /// Creates a new client from the provided stub.
6365 ///
6366 /// The most common case for calling this function is in tests mocking the
6367 /// client's behavior.
6368 pub fn from_stub<T>(stub: T) -> Self
6369 where
6370 T: super::stub::InterconnectRemoteLocations + 'static,
6371 {
6372 Self {
6373 inner: std::sync::Arc::new(stub),
6374 }
6375 }
6376
6377 pub(crate) async fn new(
6378 config: gaxi::options::ClientConfig,
6379 ) -> crate::ClientBuilderResult<Self> {
6380 let inner = Self::build_inner(config).await?;
6381 Ok(Self { inner })
6382 }
6383
6384 async fn build_inner(
6385 conf: gaxi::options::ClientConfig,
6386 ) -> crate::ClientBuilderResult<
6387 std::sync::Arc<dyn super::stub::dynamic::InterconnectRemoteLocations>,
6388 > {
6389 if gaxi::options::tracing_enabled(&conf) {
6390 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6391 }
6392 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6393 }
6394
6395 async fn build_transport(
6396 conf: gaxi::options::ClientConfig,
6397 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectRemoteLocations> {
6398 super::transport::InterconnectRemoteLocations::new(conf).await
6399 }
6400
6401 async fn build_with_tracing(
6402 conf: gaxi::options::ClientConfig,
6403 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectRemoteLocations> {
6404 Self::build_transport(conf)
6405 .await
6406 .map(super::tracing::InterconnectRemoteLocations::new)
6407 }
6408
6409 /// Returns the details for the specified interconnect remote location. Gets a
6410 /// list of available interconnect remote locations by making alist() request.
6411 pub fn get(&self) -> super::builder::interconnect_remote_locations::Get {
6412 super::builder::interconnect_remote_locations::Get::new(self.inner.clone())
6413 }
6414
6415 /// Retrieves the list of interconnect remote locations available to the
6416 /// specified project.
6417 pub fn list(&self) -> super::builder::interconnect_remote_locations::List {
6418 super::builder::interconnect_remote_locations::List::new(self.inner.clone())
6419 }
6420}
6421
6422/// Implements a client for the Google Compute Engine API.
6423///
6424/// # Example
6425/// ```
6426/// # use google_cloud_compute_v1::client::Interconnects;
6427/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
6428/// let client = Interconnects::builder().build().await?;
6429/// // use `client` to make requests to the Google Compute Engine API.
6430/// # Ok(()) }
6431/// ```
6432///
6433/// # Service Description
6434///
6435/// Service for the `interconnects` resource.
6436///
6437/// # Configuration
6438///
6439/// To configure `Interconnects` use the `with_*` methods in the type returned
6440/// by [builder()][Interconnects::builder]. The default configuration should
6441/// work for most applications. Common configuration changes include
6442///
6443/// * [with_endpoint()]: by default this client uses the global default endpoint
6444/// (`https://compute.googleapis.com`). Applications using regional
6445/// endpoints or running in restricted networks (e.g. a network configured
6446// with [Private Google Access with VPC Service Controls]) may want to
6447/// override this default.
6448/// * [with_credentials()]: by default this client uses
6449/// [Application Default Credentials]. Applications using custom
6450/// authentication may need to override this default.
6451///
6452/// [with_endpoint()]: super::builder::interconnects::ClientBuilder::with_endpoint
6453/// [with_credentials()]: super::builder::interconnects::ClientBuilder::with_credentials
6454/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6455/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6456///
6457/// # Pooling and Cloning
6458///
6459/// `Interconnects` holds a connection pool internally, it is advised to
6460/// create one and reuse it. You do not need to wrap `Interconnects` in
6461/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6462/// already uses an `Arc` internally.
6463#[cfg(feature = "interconnects")]
6464#[cfg_attr(docsrs, doc(cfg(feature = "interconnects")))]
6465#[derive(Clone, Debug)]
6466pub struct Interconnects {
6467 inner: std::sync::Arc<dyn super::stub::dynamic::Interconnects>,
6468}
6469
6470#[cfg(feature = "interconnects")]
6471impl Interconnects {
6472 /// Returns a builder for [Interconnects].
6473 ///
6474 /// ```
6475 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6476 /// # use google_cloud_compute_v1::client::Interconnects;
6477 /// let client = Interconnects::builder().build().await?;
6478 /// # Ok(()) }
6479 /// ```
6480 pub fn builder() -> super::builder::interconnects::ClientBuilder {
6481 crate::new_client_builder(super::builder::interconnects::client::Factory)
6482 }
6483
6484 /// Creates a new client from the provided stub.
6485 ///
6486 /// The most common case for calling this function is in tests mocking the
6487 /// client's behavior.
6488 pub fn from_stub<T>(stub: T) -> Self
6489 where
6490 T: super::stub::Interconnects + 'static,
6491 {
6492 Self {
6493 inner: std::sync::Arc::new(stub),
6494 }
6495 }
6496
6497 pub(crate) async fn new(
6498 config: gaxi::options::ClientConfig,
6499 ) -> crate::ClientBuilderResult<Self> {
6500 let inner = Self::build_inner(config).await?;
6501 Ok(Self { inner })
6502 }
6503
6504 async fn build_inner(
6505 conf: gaxi::options::ClientConfig,
6506 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Interconnects>> {
6507 if gaxi::options::tracing_enabled(&conf) {
6508 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6509 }
6510 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6511 }
6512
6513 async fn build_transport(
6514 conf: gaxi::options::ClientConfig,
6515 ) -> crate::ClientBuilderResult<impl super::stub::Interconnects> {
6516 super::transport::Interconnects::new(conf).await
6517 }
6518
6519 async fn build_with_tracing(
6520 conf: gaxi::options::ClientConfig,
6521 ) -> crate::ClientBuilderResult<impl super::stub::Interconnects> {
6522 Self::build_transport(conf)
6523 .await
6524 .map(super::tracing::Interconnects::new)
6525 }
6526
6527 /// Deletes the specified Interconnect.
6528 pub fn delete(&self) -> super::builder::interconnects::Delete {
6529 super::builder::interconnects::Delete::new(self.inner.clone())
6530 }
6531
6532 /// Returns the specified Interconnect. Get a list of available Interconnects
6533 /// by making a list() request.
6534 pub fn get(&self) -> super::builder::interconnects::Get {
6535 super::builder::interconnects::Get::new(self.inner.clone())
6536 }
6537
6538 /// Returns the interconnectDiagnostics for the specified
6539 /// Interconnect.
6540 ///
6541 /// In the event of a
6542 /// global outage, do not use this API to make decisions about where to
6543 /// redirect your network traffic.
6544 ///
6545 /// Unlike a VLAN attachment, which is regional, a Cloud Interconnect
6546 /// connection is a global resource. A global outage can prevent this
6547 /// API from functioning properly.
6548 pub fn get_diagnostics(&self) -> super::builder::interconnects::GetDiagnostics {
6549 super::builder::interconnects::GetDiagnostics::new(self.inner.clone())
6550 }
6551
6552 /// Returns the interconnectMacsecConfig for the specified
6553 /// Interconnect.
6554 pub fn get_macsec_config(&self) -> super::builder::interconnects::GetMacsecConfig {
6555 super::builder::interconnects::GetMacsecConfig::new(self.inner.clone())
6556 }
6557
6558 /// Creates an Interconnect in the specified project using
6559 /// the data included in the request.
6560 pub fn insert(&self) -> super::builder::interconnects::Insert {
6561 super::builder::interconnects::Insert::new(self.inner.clone())
6562 }
6563
6564 /// Retrieves the list of Interconnects available to the specified project.
6565 pub fn list(&self) -> super::builder::interconnects::List {
6566 super::builder::interconnects::List::new(self.inner.clone())
6567 }
6568
6569 /// Updates the specified Interconnect with the data included in the request.
6570 /// This method supportsPATCH
6571 /// semantics and uses theJSON merge
6572 /// patch format and processing rules.
6573 pub fn patch(&self) -> super::builder::interconnects::Patch {
6574 super::builder::interconnects::Patch::new(self.inner.clone())
6575 }
6576
6577 /// Sets the labels on an Interconnect. To learn more about labels,
6578 /// read the Labeling
6579 /// Resources documentation.
6580 pub fn set_labels(&self) -> super::builder::interconnects::SetLabels {
6581 super::builder::interconnects::SetLabels::new(self.inner.clone())
6582 }
6583
6584 /// Retrieves the specified Operations resource.
6585 pub fn get_operation(&self) -> super::builder::interconnects::GetOperation {
6586 super::builder::interconnects::GetOperation::new(self.inner.clone())
6587 }
6588}
6589
6590/// Implements a client for the Google Compute Engine API.
6591///
6592/// # Example
6593/// ```
6594/// # use google_cloud_compute_v1::client::LicenseCodes;
6595/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
6596/// let client = LicenseCodes::builder().build().await?;
6597/// // use `client` to make requests to the Google Compute Engine API.
6598/// # Ok(()) }
6599/// ```
6600///
6601/// # Service Description
6602///
6603/// Service for the `licenseCodes` resource.
6604///
6605/// # Configuration
6606///
6607/// To configure `LicenseCodes` use the `with_*` methods in the type returned
6608/// by [builder()][LicenseCodes::builder]. The default configuration should
6609/// work for most applications. Common configuration changes include
6610///
6611/// * [with_endpoint()]: by default this client uses the global default endpoint
6612/// (`https://compute.googleapis.com`). Applications using regional
6613/// endpoints or running in restricted networks (e.g. a network configured
6614// with [Private Google Access with VPC Service Controls]) may want to
6615/// override this default.
6616/// * [with_credentials()]: by default this client uses
6617/// [Application Default Credentials]. Applications using custom
6618/// authentication may need to override this default.
6619///
6620/// [with_endpoint()]: super::builder::license_codes::ClientBuilder::with_endpoint
6621/// [with_credentials()]: super::builder::license_codes::ClientBuilder::with_credentials
6622/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6623/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6624///
6625/// # Pooling and Cloning
6626///
6627/// `LicenseCodes` holds a connection pool internally, it is advised to
6628/// create one and reuse it. You do not need to wrap `LicenseCodes` in
6629/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6630/// already uses an `Arc` internally.
6631#[cfg(feature = "license-codes")]
6632#[cfg_attr(docsrs, doc(cfg(feature = "license-codes")))]
6633#[derive(Clone, Debug)]
6634pub struct LicenseCodes {
6635 inner: std::sync::Arc<dyn super::stub::dynamic::LicenseCodes>,
6636}
6637
6638#[cfg(feature = "license-codes")]
6639impl LicenseCodes {
6640 /// Returns a builder for [LicenseCodes].
6641 ///
6642 /// ```
6643 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6644 /// # use google_cloud_compute_v1::client::LicenseCodes;
6645 /// let client = LicenseCodes::builder().build().await?;
6646 /// # Ok(()) }
6647 /// ```
6648 pub fn builder() -> super::builder::license_codes::ClientBuilder {
6649 crate::new_client_builder(super::builder::license_codes::client::Factory)
6650 }
6651
6652 /// Creates a new client from the provided stub.
6653 ///
6654 /// The most common case for calling this function is in tests mocking the
6655 /// client's behavior.
6656 pub fn from_stub<T>(stub: T) -> Self
6657 where
6658 T: super::stub::LicenseCodes + 'static,
6659 {
6660 Self {
6661 inner: std::sync::Arc::new(stub),
6662 }
6663 }
6664
6665 pub(crate) async fn new(
6666 config: gaxi::options::ClientConfig,
6667 ) -> crate::ClientBuilderResult<Self> {
6668 let inner = Self::build_inner(config).await?;
6669 Ok(Self { inner })
6670 }
6671
6672 async fn build_inner(
6673 conf: gaxi::options::ClientConfig,
6674 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::LicenseCodes>> {
6675 if gaxi::options::tracing_enabled(&conf) {
6676 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6677 }
6678 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6679 }
6680
6681 async fn build_transport(
6682 conf: gaxi::options::ClientConfig,
6683 ) -> crate::ClientBuilderResult<impl super::stub::LicenseCodes> {
6684 super::transport::LicenseCodes::new(conf).await
6685 }
6686
6687 async fn build_with_tracing(
6688 conf: gaxi::options::ClientConfig,
6689 ) -> crate::ClientBuilderResult<impl super::stub::LicenseCodes> {
6690 Self::build_transport(conf)
6691 .await
6692 .map(super::tracing::LicenseCodes::new)
6693 }
6694
6695 /// Return a specified license code. License codes are mirrored across
6696 /// all projects that have permissions to read the License Code.
6697 /// *Caution* This resource is intended
6698 /// for use only by third-party partners who are creatingCloud Marketplace
6699 /// images.
6700 pub fn get(&self) -> super::builder::license_codes::Get {
6701 super::builder::license_codes::Get::new(self.inner.clone())
6702 }
6703
6704 /// Returns permissions that a caller has on the specified resource.
6705 /// *Caution* This resource is intended
6706 /// for use only by third-party partners who are creatingCloud Marketplace
6707 /// images.
6708 pub fn test_iam_permissions(&self) -> super::builder::license_codes::TestIamPermissions {
6709 super::builder::license_codes::TestIamPermissions::new(self.inner.clone())
6710 }
6711}
6712
6713/// Implements a client for the Google Compute Engine API.
6714///
6715/// # Example
6716/// ```
6717/// # use google_cloud_compute_v1::client::Licenses;
6718/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
6719/// let client = Licenses::builder().build().await?;
6720/// // use `client` to make requests to the Google Compute Engine API.
6721/// # Ok(()) }
6722/// ```
6723///
6724/// # Service Description
6725///
6726/// Service for the `licenses` resource.
6727///
6728/// # Configuration
6729///
6730/// To configure `Licenses` use the `with_*` methods in the type returned
6731/// by [builder()][Licenses::builder]. The default configuration should
6732/// work for most applications. Common configuration changes include
6733///
6734/// * [with_endpoint()]: by default this client uses the global default endpoint
6735/// (`https://compute.googleapis.com`). Applications using regional
6736/// endpoints or running in restricted networks (e.g. a network configured
6737// with [Private Google Access with VPC Service Controls]) may want to
6738/// override this default.
6739/// * [with_credentials()]: by default this client uses
6740/// [Application Default Credentials]. Applications using custom
6741/// authentication may need to override this default.
6742///
6743/// [with_endpoint()]: super::builder::licenses::ClientBuilder::with_endpoint
6744/// [with_credentials()]: super::builder::licenses::ClientBuilder::with_credentials
6745/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6746/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6747///
6748/// # Pooling and Cloning
6749///
6750/// `Licenses` holds a connection pool internally, it is advised to
6751/// create one and reuse it. You do not need to wrap `Licenses` in
6752/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6753/// already uses an `Arc` internally.
6754#[cfg(feature = "licenses")]
6755#[cfg_attr(docsrs, doc(cfg(feature = "licenses")))]
6756#[derive(Clone, Debug)]
6757pub struct Licenses {
6758 inner: std::sync::Arc<dyn super::stub::dynamic::Licenses>,
6759}
6760
6761#[cfg(feature = "licenses")]
6762impl Licenses {
6763 /// Returns a builder for [Licenses].
6764 ///
6765 /// ```
6766 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6767 /// # use google_cloud_compute_v1::client::Licenses;
6768 /// let client = Licenses::builder().build().await?;
6769 /// # Ok(()) }
6770 /// ```
6771 pub fn builder() -> super::builder::licenses::ClientBuilder {
6772 crate::new_client_builder(super::builder::licenses::client::Factory)
6773 }
6774
6775 /// Creates a new client from the provided stub.
6776 ///
6777 /// The most common case for calling this function is in tests mocking the
6778 /// client's behavior.
6779 pub fn from_stub<T>(stub: T) -> Self
6780 where
6781 T: super::stub::Licenses + 'static,
6782 {
6783 Self {
6784 inner: std::sync::Arc::new(stub),
6785 }
6786 }
6787
6788 pub(crate) async fn new(
6789 config: gaxi::options::ClientConfig,
6790 ) -> crate::ClientBuilderResult<Self> {
6791 let inner = Self::build_inner(config).await?;
6792 Ok(Self { inner })
6793 }
6794
6795 async fn build_inner(
6796 conf: gaxi::options::ClientConfig,
6797 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Licenses>> {
6798 if gaxi::options::tracing_enabled(&conf) {
6799 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6800 }
6801 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6802 }
6803
6804 async fn build_transport(
6805 conf: gaxi::options::ClientConfig,
6806 ) -> crate::ClientBuilderResult<impl super::stub::Licenses> {
6807 super::transport::Licenses::new(conf).await
6808 }
6809
6810 async fn build_with_tracing(
6811 conf: gaxi::options::ClientConfig,
6812 ) -> crate::ClientBuilderResult<impl super::stub::Licenses> {
6813 Self::build_transport(conf)
6814 .await
6815 .map(super::tracing::Licenses::new)
6816 }
6817
6818 /// Deletes the specified license.
6819 /// *Caution* This resource is intended
6820 /// for use only by third-party partners who are creatingCloud Marketplace
6821 /// images.
6822 pub fn delete(&self) -> super::builder::licenses::Delete {
6823 super::builder::licenses::Delete::new(self.inner.clone())
6824 }
6825
6826 /// Returns the specified License resource.
6827 /// *Caution* This resource is intended
6828 /// for use only by third-party partners who are creatingCloud Marketplace
6829 /// images.
6830 pub fn get(&self) -> super::builder::licenses::Get {
6831 super::builder::licenses::Get::new(self.inner.clone())
6832 }
6833
6834 /// Gets the access control policy for a resource. May be empty if no such
6835 /// policy or resource exists.
6836 /// *Caution* This resource is intended
6837 /// for use only by third-party partners who are creatingCloud Marketplace
6838 /// images.
6839 pub fn get_iam_policy(&self) -> super::builder::licenses::GetIamPolicy {
6840 super::builder::licenses::GetIamPolicy::new(self.inner.clone())
6841 }
6842
6843 /// Create a License resource in the specified project.
6844 /// *Caution* This resource is intended
6845 /// for use only by third-party partners who are creatingCloud Marketplace
6846 /// images.
6847 pub fn insert(&self) -> super::builder::licenses::Insert {
6848 super::builder::licenses::Insert::new(self.inner.clone())
6849 }
6850
6851 /// Retrieves the list of licenses
6852 /// available in the specified project. This method does not
6853 /// get any licenses that belong to other projects, including licenses attached
6854 /// to publicly-available images, like Debian 9. If you want to get a list of
6855 /// publicly-available licenses, use this method to make a request to the
6856 /// respective image project, such as debian-cloud orwindows-cloud.
6857 /// *Caution* This resource is intended
6858 /// for use only by third-party partners who are creatingCloud Marketplace
6859 /// images.
6860 pub fn list(&self) -> super::builder::licenses::List {
6861 super::builder::licenses::List::new(self.inner.clone())
6862 }
6863
6864 /// Sets the access control policy on the specified resource.
6865 /// Replaces any existing policy.
6866 /// *Caution* This resource is intended
6867 /// for use only by third-party partners who are creatingCloud Marketplace
6868 /// images.
6869 pub fn set_iam_policy(&self) -> super::builder::licenses::SetIamPolicy {
6870 super::builder::licenses::SetIamPolicy::new(self.inner.clone())
6871 }
6872
6873 /// Returns permissions that a caller has on the specified resource.
6874 /// *Caution* This resource is intended
6875 /// for use only by third-party partners who are creatingCloud Marketplace
6876 /// images.
6877 pub fn test_iam_permissions(&self) -> super::builder::licenses::TestIamPermissions {
6878 super::builder::licenses::TestIamPermissions::new(self.inner.clone())
6879 }
6880
6881 /// Updates a License resource in the specified project.
6882 /// *Caution* This resource is intended
6883 /// for use only by third-party partners who are creatingCloud Marketplace
6884 /// images.
6885 pub fn update(&self) -> super::builder::licenses::Update {
6886 super::builder::licenses::Update::new(self.inner.clone())
6887 }
6888
6889 /// Retrieves the specified Operations resource.
6890 pub fn get_operation(&self) -> super::builder::licenses::GetOperation {
6891 super::builder::licenses::GetOperation::new(self.inner.clone())
6892 }
6893}
6894
6895/// Implements a client for the Google Compute Engine API.
6896///
6897/// # Example
6898/// ```
6899/// # use google_cloud_compute_v1::client::MachineImages;
6900/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
6901/// let client = MachineImages::builder().build().await?;
6902/// // use `client` to make requests to the Google Compute Engine API.
6903/// # Ok(()) }
6904/// ```
6905///
6906/// # Service Description
6907///
6908/// Service for the `machineImages` resource.
6909///
6910/// # Configuration
6911///
6912/// To configure `MachineImages` use the `with_*` methods in the type returned
6913/// by [builder()][MachineImages::builder]. The default configuration should
6914/// work for most applications. Common configuration changes include
6915///
6916/// * [with_endpoint()]: by default this client uses the global default endpoint
6917/// (`https://compute.googleapis.com`). Applications using regional
6918/// endpoints or running in restricted networks (e.g. a network configured
6919// with [Private Google Access with VPC Service Controls]) may want to
6920/// override this default.
6921/// * [with_credentials()]: by default this client uses
6922/// [Application Default Credentials]. Applications using custom
6923/// authentication may need to override this default.
6924///
6925/// [with_endpoint()]: super::builder::machine_images::ClientBuilder::with_endpoint
6926/// [with_credentials()]: super::builder::machine_images::ClientBuilder::with_credentials
6927/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6928/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6929///
6930/// # Pooling and Cloning
6931///
6932/// `MachineImages` holds a connection pool internally, it is advised to
6933/// create one and reuse it. You do not need to wrap `MachineImages` in
6934/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6935/// already uses an `Arc` internally.
6936#[cfg(feature = "machine-images")]
6937#[cfg_attr(docsrs, doc(cfg(feature = "machine-images")))]
6938#[derive(Clone, Debug)]
6939pub struct MachineImages {
6940 inner: std::sync::Arc<dyn super::stub::dynamic::MachineImages>,
6941}
6942
6943#[cfg(feature = "machine-images")]
6944impl MachineImages {
6945 /// Returns a builder for [MachineImages].
6946 ///
6947 /// ```
6948 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6949 /// # use google_cloud_compute_v1::client::MachineImages;
6950 /// let client = MachineImages::builder().build().await?;
6951 /// # Ok(()) }
6952 /// ```
6953 pub fn builder() -> super::builder::machine_images::ClientBuilder {
6954 crate::new_client_builder(super::builder::machine_images::client::Factory)
6955 }
6956
6957 /// Creates a new client from the provided stub.
6958 ///
6959 /// The most common case for calling this function is in tests mocking the
6960 /// client's behavior.
6961 pub fn from_stub<T>(stub: T) -> Self
6962 where
6963 T: super::stub::MachineImages + 'static,
6964 {
6965 Self {
6966 inner: std::sync::Arc::new(stub),
6967 }
6968 }
6969
6970 pub(crate) async fn new(
6971 config: gaxi::options::ClientConfig,
6972 ) -> crate::ClientBuilderResult<Self> {
6973 let inner = Self::build_inner(config).await?;
6974 Ok(Self { inner })
6975 }
6976
6977 async fn build_inner(
6978 conf: gaxi::options::ClientConfig,
6979 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::MachineImages>> {
6980 if gaxi::options::tracing_enabled(&conf) {
6981 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6982 }
6983 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6984 }
6985
6986 async fn build_transport(
6987 conf: gaxi::options::ClientConfig,
6988 ) -> crate::ClientBuilderResult<impl super::stub::MachineImages> {
6989 super::transport::MachineImages::new(conf).await
6990 }
6991
6992 async fn build_with_tracing(
6993 conf: gaxi::options::ClientConfig,
6994 ) -> crate::ClientBuilderResult<impl super::stub::MachineImages> {
6995 Self::build_transport(conf)
6996 .await
6997 .map(super::tracing::MachineImages::new)
6998 }
6999
7000 /// Deletes the specified machine image. Deleting a machine image is permanent
7001 /// and cannot be undone.
7002 pub fn delete(&self) -> super::builder::machine_images::Delete {
7003 super::builder::machine_images::Delete::new(self.inner.clone())
7004 }
7005
7006 /// Returns the specified machine image.
7007 pub fn get(&self) -> super::builder::machine_images::Get {
7008 super::builder::machine_images::Get::new(self.inner.clone())
7009 }
7010
7011 /// Gets the access control policy for a resource. May be empty if no such
7012 /// policy or resource exists.
7013 pub fn get_iam_policy(&self) -> super::builder::machine_images::GetIamPolicy {
7014 super::builder::machine_images::GetIamPolicy::new(self.inner.clone())
7015 }
7016
7017 /// Creates a machine image in the specified project using the
7018 /// data that is included in the request. If you are creating a new machine
7019 /// image to update an existing instance, your new machine image should use the
7020 /// same network or, if applicable, the same subnetwork as the original
7021 /// instance.
7022 pub fn insert(&self) -> super::builder::machine_images::Insert {
7023 super::builder::machine_images::Insert::new(self.inner.clone())
7024 }
7025
7026 /// Retrieves a list of machine images that are contained within
7027 /// the specified project.
7028 pub fn list(&self) -> super::builder::machine_images::List {
7029 super::builder::machine_images::List::new(self.inner.clone())
7030 }
7031
7032 /// Sets the access control policy on the specified resource.
7033 /// Replaces any existing policy.
7034 pub fn set_iam_policy(&self) -> super::builder::machine_images::SetIamPolicy {
7035 super::builder::machine_images::SetIamPolicy::new(self.inner.clone())
7036 }
7037
7038 /// Sets the labels on a machine image. To learn more about labels, read theLabeling
7039 /// Resources documentation.
7040 pub fn set_labels(&self) -> super::builder::machine_images::SetLabels {
7041 super::builder::machine_images::SetLabels::new(self.inner.clone())
7042 }
7043
7044 /// Returns permissions that a caller has on the specified resource.
7045 pub fn test_iam_permissions(&self) -> super::builder::machine_images::TestIamPermissions {
7046 super::builder::machine_images::TestIamPermissions::new(self.inner.clone())
7047 }
7048
7049 /// Retrieves the specified Operations resource.
7050 pub fn get_operation(&self) -> super::builder::machine_images::GetOperation {
7051 super::builder::machine_images::GetOperation::new(self.inner.clone())
7052 }
7053}
7054
7055/// Implements a client for the Google Compute Engine API.
7056///
7057/// # Example
7058/// ```
7059/// # use google_cloud_compute_v1::client::MachineTypes;
7060/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
7061/// let client = MachineTypes::builder().build().await?;
7062/// // use `client` to make requests to the Google Compute Engine API.
7063/// # Ok(()) }
7064/// ```
7065///
7066/// # Service Description
7067///
7068/// Service for the `machineTypes` resource.
7069///
7070/// # Configuration
7071///
7072/// To configure `MachineTypes` use the `with_*` methods in the type returned
7073/// by [builder()][MachineTypes::builder]. The default configuration should
7074/// work for most applications. Common configuration changes include
7075///
7076/// * [with_endpoint()]: by default this client uses the global default endpoint
7077/// (`https://compute.googleapis.com`). Applications using regional
7078/// endpoints or running in restricted networks (e.g. a network configured
7079// with [Private Google Access with VPC Service Controls]) may want to
7080/// override this default.
7081/// * [with_credentials()]: by default this client uses
7082/// [Application Default Credentials]. Applications using custom
7083/// authentication may need to override this default.
7084///
7085/// [with_endpoint()]: super::builder::machine_types::ClientBuilder::with_endpoint
7086/// [with_credentials()]: super::builder::machine_types::ClientBuilder::with_credentials
7087/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7088/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7089///
7090/// # Pooling and Cloning
7091///
7092/// `MachineTypes` holds a connection pool internally, it is advised to
7093/// create one and reuse it. You do not need to wrap `MachineTypes` in
7094/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7095/// already uses an `Arc` internally.
7096#[cfg(feature = "machine-types")]
7097#[cfg_attr(docsrs, doc(cfg(feature = "machine-types")))]
7098#[derive(Clone, Debug)]
7099pub struct MachineTypes {
7100 inner: std::sync::Arc<dyn super::stub::dynamic::MachineTypes>,
7101}
7102
7103#[cfg(feature = "machine-types")]
7104impl MachineTypes {
7105 /// Returns a builder for [MachineTypes].
7106 ///
7107 /// ```
7108 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7109 /// # use google_cloud_compute_v1::client::MachineTypes;
7110 /// let client = MachineTypes::builder().build().await?;
7111 /// # Ok(()) }
7112 /// ```
7113 pub fn builder() -> super::builder::machine_types::ClientBuilder {
7114 crate::new_client_builder(super::builder::machine_types::client::Factory)
7115 }
7116
7117 /// Creates a new client from the provided stub.
7118 ///
7119 /// The most common case for calling this function is in tests mocking the
7120 /// client's behavior.
7121 pub fn from_stub<T>(stub: T) -> Self
7122 where
7123 T: super::stub::MachineTypes + 'static,
7124 {
7125 Self {
7126 inner: std::sync::Arc::new(stub),
7127 }
7128 }
7129
7130 pub(crate) async fn new(
7131 config: gaxi::options::ClientConfig,
7132 ) -> crate::ClientBuilderResult<Self> {
7133 let inner = Self::build_inner(config).await?;
7134 Ok(Self { inner })
7135 }
7136
7137 async fn build_inner(
7138 conf: gaxi::options::ClientConfig,
7139 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::MachineTypes>> {
7140 if gaxi::options::tracing_enabled(&conf) {
7141 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7142 }
7143 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7144 }
7145
7146 async fn build_transport(
7147 conf: gaxi::options::ClientConfig,
7148 ) -> crate::ClientBuilderResult<impl super::stub::MachineTypes> {
7149 super::transport::MachineTypes::new(conf).await
7150 }
7151
7152 async fn build_with_tracing(
7153 conf: gaxi::options::ClientConfig,
7154 ) -> crate::ClientBuilderResult<impl super::stub::MachineTypes> {
7155 Self::build_transport(conf)
7156 .await
7157 .map(super::tracing::MachineTypes::new)
7158 }
7159
7160 /// Retrieves an aggregated list of machine types.
7161 ///
7162 /// To prevent failure, Google recommends that you set the
7163 /// `returnPartialSuccess` parameter to `true`.
7164 pub fn aggregated_list(&self) -> super::builder::machine_types::AggregatedList {
7165 super::builder::machine_types::AggregatedList::new(self.inner.clone())
7166 }
7167
7168 /// Returns the specified machine type.
7169 pub fn get(&self) -> super::builder::machine_types::Get {
7170 super::builder::machine_types::Get::new(self.inner.clone())
7171 }
7172
7173 /// Retrieves a list of machine types available to the specified
7174 /// project.
7175 pub fn list(&self) -> super::builder::machine_types::List {
7176 super::builder::machine_types::List::new(self.inner.clone())
7177 }
7178}
7179
7180/// Implements a client for the Google Compute Engine API.
7181///
7182/// # Example
7183/// ```
7184/// # use google_cloud_compute_v1::client::NetworkAttachments;
7185/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
7186/// let client = NetworkAttachments::builder().build().await?;
7187/// // use `client` to make requests to the Google Compute Engine API.
7188/// # Ok(()) }
7189/// ```
7190///
7191/// # Service Description
7192///
7193/// Service for the `networkAttachments` resource.
7194///
7195/// # Configuration
7196///
7197/// To configure `NetworkAttachments` use the `with_*` methods in the type returned
7198/// by [builder()][NetworkAttachments::builder]. The default configuration should
7199/// work for most applications. Common configuration changes include
7200///
7201/// * [with_endpoint()]: by default this client uses the global default endpoint
7202/// (`https://compute.googleapis.com`). Applications using regional
7203/// endpoints or running in restricted networks (e.g. a network configured
7204// with [Private Google Access with VPC Service Controls]) may want to
7205/// override this default.
7206/// * [with_credentials()]: by default this client uses
7207/// [Application Default Credentials]. Applications using custom
7208/// authentication may need to override this default.
7209///
7210/// [with_endpoint()]: super::builder::network_attachments::ClientBuilder::with_endpoint
7211/// [with_credentials()]: super::builder::network_attachments::ClientBuilder::with_credentials
7212/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7213/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7214///
7215/// # Pooling and Cloning
7216///
7217/// `NetworkAttachments` holds a connection pool internally, it is advised to
7218/// create one and reuse it. You do not need to wrap `NetworkAttachments` in
7219/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7220/// already uses an `Arc` internally.
7221#[cfg(feature = "network-attachments")]
7222#[cfg_attr(docsrs, doc(cfg(feature = "network-attachments")))]
7223#[derive(Clone, Debug)]
7224pub struct NetworkAttachments {
7225 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkAttachments>,
7226}
7227
7228#[cfg(feature = "network-attachments")]
7229impl NetworkAttachments {
7230 /// Returns a builder for [NetworkAttachments].
7231 ///
7232 /// ```
7233 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7234 /// # use google_cloud_compute_v1::client::NetworkAttachments;
7235 /// let client = NetworkAttachments::builder().build().await?;
7236 /// # Ok(()) }
7237 /// ```
7238 pub fn builder() -> super::builder::network_attachments::ClientBuilder {
7239 crate::new_client_builder(super::builder::network_attachments::client::Factory)
7240 }
7241
7242 /// Creates a new client from the provided stub.
7243 ///
7244 /// The most common case for calling this function is in tests mocking the
7245 /// client's behavior.
7246 pub fn from_stub<T>(stub: T) -> Self
7247 where
7248 T: super::stub::NetworkAttachments + 'static,
7249 {
7250 Self {
7251 inner: std::sync::Arc::new(stub),
7252 }
7253 }
7254
7255 pub(crate) async fn new(
7256 config: gaxi::options::ClientConfig,
7257 ) -> crate::ClientBuilderResult<Self> {
7258 let inner = Self::build_inner(config).await?;
7259 Ok(Self { inner })
7260 }
7261
7262 async fn build_inner(
7263 conf: gaxi::options::ClientConfig,
7264 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NetworkAttachments>>
7265 {
7266 if gaxi::options::tracing_enabled(&conf) {
7267 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7268 }
7269 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7270 }
7271
7272 async fn build_transport(
7273 conf: gaxi::options::ClientConfig,
7274 ) -> crate::ClientBuilderResult<impl super::stub::NetworkAttachments> {
7275 super::transport::NetworkAttachments::new(conf).await
7276 }
7277
7278 async fn build_with_tracing(
7279 conf: gaxi::options::ClientConfig,
7280 ) -> crate::ClientBuilderResult<impl super::stub::NetworkAttachments> {
7281 Self::build_transport(conf)
7282 .await
7283 .map(super::tracing::NetworkAttachments::new)
7284 }
7285
7286 /// Retrieves the list of all NetworkAttachment resources,
7287 /// regional and global, available to the specified project.
7288 ///
7289 /// To prevent failure, Google recommends that you set the
7290 /// `returnPartialSuccess` parameter to `true`.
7291 pub fn aggregated_list(&self) -> super::builder::network_attachments::AggregatedList {
7292 super::builder::network_attachments::AggregatedList::new(self.inner.clone())
7293 }
7294
7295 /// Deletes the specified NetworkAttachment in the given scope
7296 pub fn delete(&self) -> super::builder::network_attachments::Delete {
7297 super::builder::network_attachments::Delete::new(self.inner.clone())
7298 }
7299
7300 /// Returns the specified NetworkAttachment resource in the given scope.
7301 pub fn get(&self) -> super::builder::network_attachments::Get {
7302 super::builder::network_attachments::Get::new(self.inner.clone())
7303 }
7304
7305 /// Gets the access control policy for a resource. May be empty if no such
7306 /// policy or resource exists.
7307 pub fn get_iam_policy(&self) -> super::builder::network_attachments::GetIamPolicy {
7308 super::builder::network_attachments::GetIamPolicy::new(self.inner.clone())
7309 }
7310
7311 /// Creates a NetworkAttachment in the specified project in the given scope
7312 /// using the parameters that are included in the request.
7313 pub fn insert(&self) -> super::builder::network_attachments::Insert {
7314 super::builder::network_attachments::Insert::new(self.inner.clone())
7315 }
7316
7317 /// Lists the NetworkAttachments for a project in the given scope.
7318 pub fn list(&self) -> super::builder::network_attachments::List {
7319 super::builder::network_attachments::List::new(self.inner.clone())
7320 }
7321
7322 /// Patches the specified NetworkAttachment resource with the data included in
7323 /// the request. This method supports PATCH
7324 /// semantics and usesJSON merge
7325 /// patch format and processing rules.
7326 pub fn patch(&self) -> super::builder::network_attachments::Patch {
7327 super::builder::network_attachments::Patch::new(self.inner.clone())
7328 }
7329
7330 /// Sets the access control policy on the specified resource.
7331 /// Replaces any existing policy.
7332 pub fn set_iam_policy(&self) -> super::builder::network_attachments::SetIamPolicy {
7333 super::builder::network_attachments::SetIamPolicy::new(self.inner.clone())
7334 }
7335
7336 /// Returns permissions that a caller has on the specified resource.
7337 pub fn test_iam_permissions(&self) -> super::builder::network_attachments::TestIamPermissions {
7338 super::builder::network_attachments::TestIamPermissions::new(self.inner.clone())
7339 }
7340
7341 /// Retrieves the specified region-specific Operations resource.
7342 pub fn get_operation(&self) -> super::builder::network_attachments::GetOperation {
7343 super::builder::network_attachments::GetOperation::new(self.inner.clone())
7344 }
7345}
7346
7347/// Implements a client for the Google Compute Engine API.
7348///
7349/// # Example
7350/// ```
7351/// # use google_cloud_compute_v1::client::NetworkEdgeSecurityServices;
7352/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
7353/// let client = NetworkEdgeSecurityServices::builder().build().await?;
7354/// // use `client` to make requests to the Google Compute Engine API.
7355/// # Ok(()) }
7356/// ```
7357///
7358/// # Service Description
7359///
7360/// Service for the `networkEdgeSecurityServices` resource.
7361///
7362/// # Configuration
7363///
7364/// To configure `NetworkEdgeSecurityServices` use the `with_*` methods in the type returned
7365/// by [builder()][NetworkEdgeSecurityServices::builder]. The default configuration should
7366/// work for most applications. Common configuration changes include
7367///
7368/// * [with_endpoint()]: by default this client uses the global default endpoint
7369/// (`https://compute.googleapis.com`). Applications using regional
7370/// endpoints or running in restricted networks (e.g. a network configured
7371// with [Private Google Access with VPC Service Controls]) may want to
7372/// override this default.
7373/// * [with_credentials()]: by default this client uses
7374/// [Application Default Credentials]. Applications using custom
7375/// authentication may need to override this default.
7376///
7377/// [with_endpoint()]: super::builder::network_edge_security_services::ClientBuilder::with_endpoint
7378/// [with_credentials()]: super::builder::network_edge_security_services::ClientBuilder::with_credentials
7379/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7380/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7381///
7382/// # Pooling and Cloning
7383///
7384/// `NetworkEdgeSecurityServices` holds a connection pool internally, it is advised to
7385/// create one and reuse it. You do not need to wrap `NetworkEdgeSecurityServices` in
7386/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7387/// already uses an `Arc` internally.
7388#[cfg(feature = "network-edge-security-services")]
7389#[cfg_attr(docsrs, doc(cfg(feature = "network-edge-security-services")))]
7390#[derive(Clone, Debug)]
7391pub struct NetworkEdgeSecurityServices {
7392 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkEdgeSecurityServices>,
7393}
7394
7395#[cfg(feature = "network-edge-security-services")]
7396impl NetworkEdgeSecurityServices {
7397 /// Returns a builder for [NetworkEdgeSecurityServices].
7398 ///
7399 /// ```
7400 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7401 /// # use google_cloud_compute_v1::client::NetworkEdgeSecurityServices;
7402 /// let client = NetworkEdgeSecurityServices::builder().build().await?;
7403 /// # Ok(()) }
7404 /// ```
7405 pub fn builder() -> super::builder::network_edge_security_services::ClientBuilder {
7406 crate::new_client_builder(super::builder::network_edge_security_services::client::Factory)
7407 }
7408
7409 /// Creates a new client from the provided stub.
7410 ///
7411 /// The most common case for calling this function is in tests mocking the
7412 /// client's behavior.
7413 pub fn from_stub<T>(stub: T) -> Self
7414 where
7415 T: super::stub::NetworkEdgeSecurityServices + 'static,
7416 {
7417 Self {
7418 inner: std::sync::Arc::new(stub),
7419 }
7420 }
7421
7422 pub(crate) async fn new(
7423 config: gaxi::options::ClientConfig,
7424 ) -> crate::ClientBuilderResult<Self> {
7425 let inner = Self::build_inner(config).await?;
7426 Ok(Self { inner })
7427 }
7428
7429 async fn build_inner(
7430 conf: gaxi::options::ClientConfig,
7431 ) -> crate::ClientBuilderResult<
7432 std::sync::Arc<dyn super::stub::dynamic::NetworkEdgeSecurityServices>,
7433 > {
7434 if gaxi::options::tracing_enabled(&conf) {
7435 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7436 }
7437 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7438 }
7439
7440 async fn build_transport(
7441 conf: gaxi::options::ClientConfig,
7442 ) -> crate::ClientBuilderResult<impl super::stub::NetworkEdgeSecurityServices> {
7443 super::transport::NetworkEdgeSecurityServices::new(conf).await
7444 }
7445
7446 async fn build_with_tracing(
7447 conf: gaxi::options::ClientConfig,
7448 ) -> crate::ClientBuilderResult<impl super::stub::NetworkEdgeSecurityServices> {
7449 Self::build_transport(conf)
7450 .await
7451 .map(super::tracing::NetworkEdgeSecurityServices::new)
7452 }
7453
7454 /// Retrieves the list of all NetworkEdgeSecurityService resources available to
7455 /// the specified project.
7456 ///
7457 /// To prevent failure, Google recommends that you set the
7458 /// `returnPartialSuccess` parameter to `true`.
7459 pub fn aggregated_list(
7460 &self,
7461 ) -> super::builder::network_edge_security_services::AggregatedList {
7462 super::builder::network_edge_security_services::AggregatedList::new(self.inner.clone())
7463 }
7464
7465 /// Deletes the specified service.
7466 pub fn delete(&self) -> super::builder::network_edge_security_services::Delete {
7467 super::builder::network_edge_security_services::Delete::new(self.inner.clone())
7468 }
7469
7470 /// Gets a specified NetworkEdgeSecurityService.
7471 pub fn get(&self) -> super::builder::network_edge_security_services::Get {
7472 super::builder::network_edge_security_services::Get::new(self.inner.clone())
7473 }
7474
7475 /// Creates a new service in the specified project using the data included in
7476 /// the request.
7477 pub fn insert(&self) -> super::builder::network_edge_security_services::Insert {
7478 super::builder::network_edge_security_services::Insert::new(self.inner.clone())
7479 }
7480
7481 /// Patches the specified policy with the data included in the request.
7482 pub fn patch(&self) -> super::builder::network_edge_security_services::Patch {
7483 super::builder::network_edge_security_services::Patch::new(self.inner.clone())
7484 }
7485
7486 /// Retrieves the specified region-specific Operations resource.
7487 pub fn get_operation(&self) -> super::builder::network_edge_security_services::GetOperation {
7488 super::builder::network_edge_security_services::GetOperation::new(self.inner.clone())
7489 }
7490}
7491
7492/// Implements a client for the Google Compute Engine API.
7493///
7494/// # Example
7495/// ```
7496/// # use google_cloud_compute_v1::client::NetworkEndpointGroups;
7497/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
7498/// let client = NetworkEndpointGroups::builder().build().await?;
7499/// // use `client` to make requests to the Google Compute Engine API.
7500/// # Ok(()) }
7501/// ```
7502///
7503/// # Service Description
7504///
7505/// Service for the `networkEndpointGroups` resource.
7506///
7507/// # Configuration
7508///
7509/// To configure `NetworkEndpointGroups` use the `with_*` methods in the type returned
7510/// by [builder()][NetworkEndpointGroups::builder]. The default configuration should
7511/// work for most applications. Common configuration changes include
7512///
7513/// * [with_endpoint()]: by default this client uses the global default endpoint
7514/// (`https://compute.googleapis.com`). Applications using regional
7515/// endpoints or running in restricted networks (e.g. a network configured
7516// with [Private Google Access with VPC Service Controls]) may want to
7517/// override this default.
7518/// * [with_credentials()]: by default this client uses
7519/// [Application Default Credentials]. Applications using custom
7520/// authentication may need to override this default.
7521///
7522/// [with_endpoint()]: super::builder::network_endpoint_groups::ClientBuilder::with_endpoint
7523/// [with_credentials()]: super::builder::network_endpoint_groups::ClientBuilder::with_credentials
7524/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7525/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7526///
7527/// # Pooling and Cloning
7528///
7529/// `NetworkEndpointGroups` holds a connection pool internally, it is advised to
7530/// create one and reuse it. You do not need to wrap `NetworkEndpointGroups` in
7531/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7532/// already uses an `Arc` internally.
7533#[cfg(feature = "network-endpoint-groups")]
7534#[cfg_attr(docsrs, doc(cfg(feature = "network-endpoint-groups")))]
7535#[derive(Clone, Debug)]
7536pub struct NetworkEndpointGroups {
7537 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkEndpointGroups>,
7538}
7539
7540#[cfg(feature = "network-endpoint-groups")]
7541impl NetworkEndpointGroups {
7542 /// Returns a builder for [NetworkEndpointGroups].
7543 ///
7544 /// ```
7545 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7546 /// # use google_cloud_compute_v1::client::NetworkEndpointGroups;
7547 /// let client = NetworkEndpointGroups::builder().build().await?;
7548 /// # Ok(()) }
7549 /// ```
7550 pub fn builder() -> super::builder::network_endpoint_groups::ClientBuilder {
7551 crate::new_client_builder(super::builder::network_endpoint_groups::client::Factory)
7552 }
7553
7554 /// Creates a new client from the provided stub.
7555 ///
7556 /// The most common case for calling this function is in tests mocking the
7557 /// client's behavior.
7558 pub fn from_stub<T>(stub: T) -> Self
7559 where
7560 T: super::stub::NetworkEndpointGroups + 'static,
7561 {
7562 Self {
7563 inner: std::sync::Arc::new(stub),
7564 }
7565 }
7566
7567 pub(crate) async fn new(
7568 config: gaxi::options::ClientConfig,
7569 ) -> crate::ClientBuilderResult<Self> {
7570 let inner = Self::build_inner(config).await?;
7571 Ok(Self { inner })
7572 }
7573
7574 async fn build_inner(
7575 conf: gaxi::options::ClientConfig,
7576 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NetworkEndpointGroups>>
7577 {
7578 if gaxi::options::tracing_enabled(&conf) {
7579 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7580 }
7581 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7582 }
7583
7584 async fn build_transport(
7585 conf: gaxi::options::ClientConfig,
7586 ) -> crate::ClientBuilderResult<impl super::stub::NetworkEndpointGroups> {
7587 super::transport::NetworkEndpointGroups::new(conf).await
7588 }
7589
7590 async fn build_with_tracing(
7591 conf: gaxi::options::ClientConfig,
7592 ) -> crate::ClientBuilderResult<impl super::stub::NetworkEndpointGroups> {
7593 Self::build_transport(conf)
7594 .await
7595 .map(super::tracing::NetworkEndpointGroups::new)
7596 }
7597
7598 /// Retrieves the list of network endpoint groups and sorts them by zone.
7599 ///
7600 /// To prevent failure, Google recommends that you set the
7601 /// `returnPartialSuccess` parameter to `true`.
7602 pub fn aggregated_list(&self) -> super::builder::network_endpoint_groups::AggregatedList {
7603 super::builder::network_endpoint_groups::AggregatedList::new(self.inner.clone())
7604 }
7605
7606 /// Attach a list of network endpoints to the specified network endpoint group.
7607 pub fn attach_network_endpoints(
7608 &self,
7609 ) -> super::builder::network_endpoint_groups::AttachNetworkEndpoints {
7610 super::builder::network_endpoint_groups::AttachNetworkEndpoints::new(self.inner.clone())
7611 }
7612
7613 /// Deletes the specified network endpoint group. The network endpoints in the
7614 /// NEG and the VM instances they belong to are not terminated when the NEG is
7615 /// deleted. Note that the NEG cannot be deleted if there are backend services
7616 /// referencing it.
7617 pub fn delete(&self) -> super::builder::network_endpoint_groups::Delete {
7618 super::builder::network_endpoint_groups::Delete::new(self.inner.clone())
7619 }
7620
7621 /// Detach a list of network endpoints from the specified network endpoint
7622 /// group.
7623 pub fn detach_network_endpoints(
7624 &self,
7625 ) -> super::builder::network_endpoint_groups::DetachNetworkEndpoints {
7626 super::builder::network_endpoint_groups::DetachNetworkEndpoints::new(self.inner.clone())
7627 }
7628
7629 /// Returns the specified network endpoint group.
7630 pub fn get(&self) -> super::builder::network_endpoint_groups::Get {
7631 super::builder::network_endpoint_groups::Get::new(self.inner.clone())
7632 }
7633
7634 /// Creates a network endpoint group in the specified project using the
7635 /// parameters that are included in the request.
7636 ///
7637 /// Note: Use the following APIs to manage network endpoint groups:
7638 ///
7639 /// - To manage NEGs with zonal scope (such as zonal NEGs, hybrid connectivity
7640 /// NEGs): zonal
7641 /// API
7642 /// - To manage NEGs with regional scope (such as regional internet NEGs,
7643 /// serverless NEGs, Private Service Connect NEGs): regional
7644 /// API
7645 /// - To manage NEGs with global scope (such as global internet NEGs):global
7646 /// API
7647 pub fn insert(&self) -> super::builder::network_endpoint_groups::Insert {
7648 super::builder::network_endpoint_groups::Insert::new(self.inner.clone())
7649 }
7650
7651 /// Retrieves the list of network endpoint groups that are located in the
7652 /// specified project and zone.
7653 pub fn list(&self) -> super::builder::network_endpoint_groups::List {
7654 super::builder::network_endpoint_groups::List::new(self.inner.clone())
7655 }
7656
7657 /// Lists the network endpoints in the specified network endpoint group.
7658 pub fn list_network_endpoints(
7659 &self,
7660 ) -> super::builder::network_endpoint_groups::ListNetworkEndpoints {
7661 super::builder::network_endpoint_groups::ListNetworkEndpoints::new(self.inner.clone())
7662 }
7663
7664 /// Returns permissions that a caller has on the specified resource.
7665 pub fn test_iam_permissions(
7666 &self,
7667 ) -> super::builder::network_endpoint_groups::TestIamPermissions {
7668 super::builder::network_endpoint_groups::TestIamPermissions::new(self.inner.clone())
7669 }
7670
7671 /// Retrieves the specified zone-specific Operations resource.
7672 pub fn get_operation(&self) -> super::builder::network_endpoint_groups::GetOperation {
7673 super::builder::network_endpoint_groups::GetOperation::new(self.inner.clone())
7674 }
7675}
7676
7677/// Implements a client for the Google Compute Engine API.
7678///
7679/// # Example
7680/// ```
7681/// # use google_cloud_compute_v1::client::NetworkFirewallPolicies;
7682/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
7683/// let client = NetworkFirewallPolicies::builder().build().await?;
7684/// // use `client` to make requests to the Google Compute Engine API.
7685/// # Ok(()) }
7686/// ```
7687///
7688/// # Service Description
7689///
7690/// Service for the `networkFirewallPolicies` resource.
7691///
7692/// # Configuration
7693///
7694/// To configure `NetworkFirewallPolicies` use the `with_*` methods in the type returned
7695/// by [builder()][NetworkFirewallPolicies::builder]. The default configuration should
7696/// work for most applications. Common configuration changes include
7697///
7698/// * [with_endpoint()]: by default this client uses the global default endpoint
7699/// (`https://compute.googleapis.com`). Applications using regional
7700/// endpoints or running in restricted networks (e.g. a network configured
7701// with [Private Google Access with VPC Service Controls]) may want to
7702/// override this default.
7703/// * [with_credentials()]: by default this client uses
7704/// [Application Default Credentials]. Applications using custom
7705/// authentication may need to override this default.
7706///
7707/// [with_endpoint()]: super::builder::network_firewall_policies::ClientBuilder::with_endpoint
7708/// [with_credentials()]: super::builder::network_firewall_policies::ClientBuilder::with_credentials
7709/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7710/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7711///
7712/// # Pooling and Cloning
7713///
7714/// `NetworkFirewallPolicies` holds a connection pool internally, it is advised to
7715/// create one and reuse it. You do not need to wrap `NetworkFirewallPolicies` in
7716/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7717/// already uses an `Arc` internally.
7718#[cfg(feature = "network-firewall-policies")]
7719#[cfg_attr(docsrs, doc(cfg(feature = "network-firewall-policies")))]
7720#[derive(Clone, Debug)]
7721pub struct NetworkFirewallPolicies {
7722 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkFirewallPolicies>,
7723}
7724
7725#[cfg(feature = "network-firewall-policies")]
7726impl NetworkFirewallPolicies {
7727 /// Returns a builder for [NetworkFirewallPolicies].
7728 ///
7729 /// ```
7730 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7731 /// # use google_cloud_compute_v1::client::NetworkFirewallPolicies;
7732 /// let client = NetworkFirewallPolicies::builder().build().await?;
7733 /// # Ok(()) }
7734 /// ```
7735 pub fn builder() -> super::builder::network_firewall_policies::ClientBuilder {
7736 crate::new_client_builder(super::builder::network_firewall_policies::client::Factory)
7737 }
7738
7739 /// Creates a new client from the provided stub.
7740 ///
7741 /// The most common case for calling this function is in tests mocking the
7742 /// client's behavior.
7743 pub fn from_stub<T>(stub: T) -> Self
7744 where
7745 T: super::stub::NetworkFirewallPolicies + 'static,
7746 {
7747 Self {
7748 inner: std::sync::Arc::new(stub),
7749 }
7750 }
7751
7752 pub(crate) async fn new(
7753 config: gaxi::options::ClientConfig,
7754 ) -> crate::ClientBuilderResult<Self> {
7755 let inner = Self::build_inner(config).await?;
7756 Ok(Self { inner })
7757 }
7758
7759 async fn build_inner(
7760 conf: gaxi::options::ClientConfig,
7761 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NetworkFirewallPolicies>>
7762 {
7763 if gaxi::options::tracing_enabled(&conf) {
7764 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7765 }
7766 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7767 }
7768
7769 async fn build_transport(
7770 conf: gaxi::options::ClientConfig,
7771 ) -> crate::ClientBuilderResult<impl super::stub::NetworkFirewallPolicies> {
7772 super::transport::NetworkFirewallPolicies::new(conf).await
7773 }
7774
7775 async fn build_with_tracing(
7776 conf: gaxi::options::ClientConfig,
7777 ) -> crate::ClientBuilderResult<impl super::stub::NetworkFirewallPolicies> {
7778 Self::build_transport(conf)
7779 .await
7780 .map(super::tracing::NetworkFirewallPolicies::new)
7781 }
7782
7783 /// Inserts an association for the specified firewall policy.
7784 pub fn add_association(&self) -> super::builder::network_firewall_policies::AddAssociation {
7785 super::builder::network_firewall_policies::AddAssociation::new(self.inner.clone())
7786 }
7787
7788 /// Inserts a packet mirroring rule into a firewall policy.
7789 pub fn add_packet_mirroring_rule(
7790 &self,
7791 ) -> super::builder::network_firewall_policies::AddPacketMirroringRule {
7792 super::builder::network_firewall_policies::AddPacketMirroringRule::new(self.inner.clone())
7793 }
7794
7795 /// Inserts a rule into a firewall policy.
7796 pub fn add_rule(&self) -> super::builder::network_firewall_policies::AddRule {
7797 super::builder::network_firewall_policies::AddRule::new(self.inner.clone())
7798 }
7799
7800 /// Retrieves an aggregated list of network firewall policies, listing network
7801 /// firewall policies from all applicable scopes (global and regional) and
7802 /// grouping the results per scope.
7803 ///
7804 /// To prevent failure, it is recommended that you set the
7805 /// `returnPartialSuccess` parameter to `true`.
7806 pub fn aggregated_list(&self) -> super::builder::network_firewall_policies::AggregatedList {
7807 super::builder::network_firewall_policies::AggregatedList::new(self.inner.clone())
7808 }
7809
7810 /// Copies rules to the specified firewall policy.
7811 pub fn clone_rules(&self) -> super::builder::network_firewall_policies::CloneRules {
7812 super::builder::network_firewall_policies::CloneRules::new(self.inner.clone())
7813 }
7814
7815 /// Deletes the specified policy.
7816 pub fn delete(&self) -> super::builder::network_firewall_policies::Delete {
7817 super::builder::network_firewall_policies::Delete::new(self.inner.clone())
7818 }
7819
7820 /// Returns the specified network firewall policy.
7821 pub fn get(&self) -> super::builder::network_firewall_policies::Get {
7822 super::builder::network_firewall_policies::Get::new(self.inner.clone())
7823 }
7824
7825 /// Gets an association with the specified name.
7826 pub fn get_association(&self) -> super::builder::network_firewall_policies::GetAssociation {
7827 super::builder::network_firewall_policies::GetAssociation::new(self.inner.clone())
7828 }
7829
7830 /// Gets the access control policy for a resource. May be empty if no such
7831 /// policy or resource exists.
7832 pub fn get_iam_policy(&self) -> super::builder::network_firewall_policies::GetIamPolicy {
7833 super::builder::network_firewall_policies::GetIamPolicy::new(self.inner.clone())
7834 }
7835
7836 /// Gets a packet mirroring rule of the specified priority.
7837 pub fn get_packet_mirroring_rule(
7838 &self,
7839 ) -> super::builder::network_firewall_policies::GetPacketMirroringRule {
7840 super::builder::network_firewall_policies::GetPacketMirroringRule::new(self.inner.clone())
7841 }
7842
7843 /// Gets a rule of the specified priority.
7844 pub fn get_rule(&self) -> super::builder::network_firewall_policies::GetRule {
7845 super::builder::network_firewall_policies::GetRule::new(self.inner.clone())
7846 }
7847
7848 /// Creates a new policy in the specified project using the data included in
7849 /// the request.
7850 pub fn insert(&self) -> super::builder::network_firewall_policies::Insert {
7851 super::builder::network_firewall_policies::Insert::new(self.inner.clone())
7852 }
7853
7854 /// Lists all the policies that have been configured for the specified project.
7855 pub fn list(&self) -> super::builder::network_firewall_policies::List {
7856 super::builder::network_firewall_policies::List::new(self.inner.clone())
7857 }
7858
7859 /// Patches the specified policy with the data included in the request.
7860 pub fn patch(&self) -> super::builder::network_firewall_policies::Patch {
7861 super::builder::network_firewall_policies::Patch::new(self.inner.clone())
7862 }
7863
7864 /// Patches a packet mirroring rule of the specified priority.
7865 pub fn patch_packet_mirroring_rule(
7866 &self,
7867 ) -> super::builder::network_firewall_policies::PatchPacketMirroringRule {
7868 super::builder::network_firewall_policies::PatchPacketMirroringRule::new(self.inner.clone())
7869 }
7870
7871 /// Patches a rule of the specified priority.
7872 pub fn patch_rule(&self) -> super::builder::network_firewall_policies::PatchRule {
7873 super::builder::network_firewall_policies::PatchRule::new(self.inner.clone())
7874 }
7875
7876 /// Removes an association for the specified firewall policy.
7877 pub fn remove_association(
7878 &self,
7879 ) -> super::builder::network_firewall_policies::RemoveAssociation {
7880 super::builder::network_firewall_policies::RemoveAssociation::new(self.inner.clone())
7881 }
7882
7883 /// Deletes a packet mirroring rule of the specified priority.
7884 pub fn remove_packet_mirroring_rule(
7885 &self,
7886 ) -> super::builder::network_firewall_policies::RemovePacketMirroringRule {
7887 super::builder::network_firewall_policies::RemovePacketMirroringRule::new(
7888 self.inner.clone(),
7889 )
7890 }
7891
7892 /// Deletes a rule of the specified priority.
7893 pub fn remove_rule(&self) -> super::builder::network_firewall_policies::RemoveRule {
7894 super::builder::network_firewall_policies::RemoveRule::new(self.inner.clone())
7895 }
7896
7897 /// Sets the access control policy on the specified resource.
7898 /// Replaces any existing policy.
7899 pub fn set_iam_policy(&self) -> super::builder::network_firewall_policies::SetIamPolicy {
7900 super::builder::network_firewall_policies::SetIamPolicy::new(self.inner.clone())
7901 }
7902
7903 /// Returns permissions that a caller has on the specified resource.
7904 pub fn test_iam_permissions(
7905 &self,
7906 ) -> super::builder::network_firewall_policies::TestIamPermissions {
7907 super::builder::network_firewall_policies::TestIamPermissions::new(self.inner.clone())
7908 }
7909
7910 /// Retrieves the specified Operations resource.
7911 pub fn get_operation(&self) -> super::builder::network_firewall_policies::GetOperation {
7912 super::builder::network_firewall_policies::GetOperation::new(self.inner.clone())
7913 }
7914}
7915
7916/// Implements a client for the Google Compute Engine API.
7917///
7918/// # Example
7919/// ```
7920/// # use google_cloud_compute_v1::client::NetworkProfiles;
7921/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
7922/// let client = NetworkProfiles::builder().build().await?;
7923/// // use `client` to make requests to the Google Compute Engine API.
7924/// # Ok(()) }
7925/// ```
7926///
7927/// # Service Description
7928///
7929/// Service for the `networkProfiles` resource.
7930///
7931/// # Configuration
7932///
7933/// To configure `NetworkProfiles` use the `with_*` methods in the type returned
7934/// by [builder()][NetworkProfiles::builder]. The default configuration should
7935/// work for most applications. Common configuration changes include
7936///
7937/// * [with_endpoint()]: by default this client uses the global default endpoint
7938/// (`https://compute.googleapis.com`). Applications using regional
7939/// endpoints or running in restricted networks (e.g. a network configured
7940// with [Private Google Access with VPC Service Controls]) may want to
7941/// override this default.
7942/// * [with_credentials()]: by default this client uses
7943/// [Application Default Credentials]. Applications using custom
7944/// authentication may need to override this default.
7945///
7946/// [with_endpoint()]: super::builder::network_profiles::ClientBuilder::with_endpoint
7947/// [with_credentials()]: super::builder::network_profiles::ClientBuilder::with_credentials
7948/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7949/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7950///
7951/// # Pooling and Cloning
7952///
7953/// `NetworkProfiles` holds a connection pool internally, it is advised to
7954/// create one and reuse it. You do not need to wrap `NetworkProfiles` in
7955/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7956/// already uses an `Arc` internally.
7957#[cfg(feature = "network-profiles")]
7958#[cfg_attr(docsrs, doc(cfg(feature = "network-profiles")))]
7959#[derive(Clone, Debug)]
7960pub struct NetworkProfiles {
7961 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkProfiles>,
7962}
7963
7964#[cfg(feature = "network-profiles")]
7965impl NetworkProfiles {
7966 /// Returns a builder for [NetworkProfiles].
7967 ///
7968 /// ```
7969 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7970 /// # use google_cloud_compute_v1::client::NetworkProfiles;
7971 /// let client = NetworkProfiles::builder().build().await?;
7972 /// # Ok(()) }
7973 /// ```
7974 pub fn builder() -> super::builder::network_profiles::ClientBuilder {
7975 crate::new_client_builder(super::builder::network_profiles::client::Factory)
7976 }
7977
7978 /// Creates a new client from the provided stub.
7979 ///
7980 /// The most common case for calling this function is in tests mocking the
7981 /// client's behavior.
7982 pub fn from_stub<T>(stub: T) -> Self
7983 where
7984 T: super::stub::NetworkProfiles + 'static,
7985 {
7986 Self {
7987 inner: std::sync::Arc::new(stub),
7988 }
7989 }
7990
7991 pub(crate) async fn new(
7992 config: gaxi::options::ClientConfig,
7993 ) -> crate::ClientBuilderResult<Self> {
7994 let inner = Self::build_inner(config).await?;
7995 Ok(Self { inner })
7996 }
7997
7998 async fn build_inner(
7999 conf: gaxi::options::ClientConfig,
8000 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NetworkProfiles>> {
8001 if gaxi::options::tracing_enabled(&conf) {
8002 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8003 }
8004 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8005 }
8006
8007 async fn build_transport(
8008 conf: gaxi::options::ClientConfig,
8009 ) -> crate::ClientBuilderResult<impl super::stub::NetworkProfiles> {
8010 super::transport::NetworkProfiles::new(conf).await
8011 }
8012
8013 async fn build_with_tracing(
8014 conf: gaxi::options::ClientConfig,
8015 ) -> crate::ClientBuilderResult<impl super::stub::NetworkProfiles> {
8016 Self::build_transport(conf)
8017 .await
8018 .map(super::tracing::NetworkProfiles::new)
8019 }
8020
8021 /// Returns the specified network profile.
8022 pub fn get(&self) -> super::builder::network_profiles::Get {
8023 super::builder::network_profiles::Get::new(self.inner.clone())
8024 }
8025
8026 /// Retrieves a list of network profiles available to the specified
8027 /// project.
8028 pub fn list(&self) -> super::builder::network_profiles::List {
8029 super::builder::network_profiles::List::new(self.inner.clone())
8030 }
8031}
8032
8033/// Implements a client for the Google Compute Engine API.
8034///
8035/// # Example
8036/// ```
8037/// # use google_cloud_compute_v1::client::Networks;
8038/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
8039/// let client = Networks::builder().build().await?;
8040/// // use `client` to make requests to the Google Compute Engine API.
8041/// # Ok(()) }
8042/// ```
8043///
8044/// # Service Description
8045///
8046/// Service for the `networks` resource.
8047///
8048/// # Configuration
8049///
8050/// To configure `Networks` use the `with_*` methods in the type returned
8051/// by [builder()][Networks::builder]. The default configuration should
8052/// work for most applications. Common configuration changes include
8053///
8054/// * [with_endpoint()]: by default this client uses the global default endpoint
8055/// (`https://compute.googleapis.com`). Applications using regional
8056/// endpoints or running in restricted networks (e.g. a network configured
8057// with [Private Google Access with VPC Service Controls]) may want to
8058/// override this default.
8059/// * [with_credentials()]: by default this client uses
8060/// [Application Default Credentials]. Applications using custom
8061/// authentication may need to override this default.
8062///
8063/// [with_endpoint()]: super::builder::networks::ClientBuilder::with_endpoint
8064/// [with_credentials()]: super::builder::networks::ClientBuilder::with_credentials
8065/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8066/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8067///
8068/// # Pooling and Cloning
8069///
8070/// `Networks` holds a connection pool internally, it is advised to
8071/// create one and reuse it. You do not need to wrap `Networks` in
8072/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8073/// already uses an `Arc` internally.
8074#[cfg(feature = "networks")]
8075#[cfg_attr(docsrs, doc(cfg(feature = "networks")))]
8076#[derive(Clone, Debug)]
8077pub struct Networks {
8078 inner: std::sync::Arc<dyn super::stub::dynamic::Networks>,
8079}
8080
8081#[cfg(feature = "networks")]
8082impl Networks {
8083 /// Returns a builder for [Networks].
8084 ///
8085 /// ```
8086 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8087 /// # use google_cloud_compute_v1::client::Networks;
8088 /// let client = Networks::builder().build().await?;
8089 /// # Ok(()) }
8090 /// ```
8091 pub fn builder() -> super::builder::networks::ClientBuilder {
8092 crate::new_client_builder(super::builder::networks::client::Factory)
8093 }
8094
8095 /// Creates a new client from the provided stub.
8096 ///
8097 /// The most common case for calling this function is in tests mocking the
8098 /// client's behavior.
8099 pub fn from_stub<T>(stub: T) -> Self
8100 where
8101 T: super::stub::Networks + 'static,
8102 {
8103 Self {
8104 inner: std::sync::Arc::new(stub),
8105 }
8106 }
8107
8108 pub(crate) async fn new(
8109 config: gaxi::options::ClientConfig,
8110 ) -> crate::ClientBuilderResult<Self> {
8111 let inner = Self::build_inner(config).await?;
8112 Ok(Self { inner })
8113 }
8114
8115 async fn build_inner(
8116 conf: gaxi::options::ClientConfig,
8117 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Networks>> {
8118 if gaxi::options::tracing_enabled(&conf) {
8119 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8120 }
8121 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8122 }
8123
8124 async fn build_transport(
8125 conf: gaxi::options::ClientConfig,
8126 ) -> crate::ClientBuilderResult<impl super::stub::Networks> {
8127 super::transport::Networks::new(conf).await
8128 }
8129
8130 async fn build_with_tracing(
8131 conf: gaxi::options::ClientConfig,
8132 ) -> crate::ClientBuilderResult<impl super::stub::Networks> {
8133 Self::build_transport(conf)
8134 .await
8135 .map(super::tracing::Networks::new)
8136 }
8137
8138 /// Adds a peering to the specified network.
8139 pub fn add_peering(&self) -> super::builder::networks::AddPeering {
8140 super::builder::networks::AddPeering::new(self.inner.clone())
8141 }
8142
8143 /// Deletes the specified network.
8144 pub fn delete(&self) -> super::builder::networks::Delete {
8145 super::builder::networks::Delete::new(self.inner.clone())
8146 }
8147
8148 /// Returns the specified network.
8149 pub fn get(&self) -> super::builder::networks::Get {
8150 super::builder::networks::Get::new(self.inner.clone())
8151 }
8152
8153 /// Returns the effective firewalls on a given network.
8154 pub fn get_effective_firewalls(&self) -> super::builder::networks::GetEffectiveFirewalls {
8155 super::builder::networks::GetEffectiveFirewalls::new(self.inner.clone())
8156 }
8157
8158 /// Creates a network in the specified project using the data included
8159 /// in the request.
8160 pub fn insert(&self) -> super::builder::networks::Insert {
8161 super::builder::networks::Insert::new(self.inner.clone())
8162 }
8163
8164 /// Retrieves the list of networks available to the specified project.
8165 pub fn list(&self) -> super::builder::networks::List {
8166 super::builder::networks::List::new(self.inner.clone())
8167 }
8168
8169 /// Lists the peering routes exchanged over peering connection.
8170 pub fn list_peering_routes(&self) -> super::builder::networks::ListPeeringRoutes {
8171 super::builder::networks::ListPeeringRoutes::new(self.inner.clone())
8172 }
8173
8174 /// Patches the specified network with the data included in the request.
8175 /// Only routingConfig can be modified.
8176 pub fn patch(&self) -> super::builder::networks::Patch {
8177 super::builder::networks::Patch::new(self.inner.clone())
8178 }
8179
8180 /// Removes a peering from the specified network.
8181 pub fn remove_peering(&self) -> super::builder::networks::RemovePeering {
8182 super::builder::networks::RemovePeering::new(self.inner.clone())
8183 }
8184
8185 /// Requests to remove a peering from the specified network. Applicable only
8186 /// for PeeringConnection with update_strategy=CONSENSUS.
8187 pub fn request_remove_peering(&self) -> super::builder::networks::RequestRemovePeering {
8188 super::builder::networks::RequestRemovePeering::new(self.inner.clone())
8189 }
8190
8191 /// Switches the network mode from auto subnet mode to custom subnet mode.
8192 pub fn switch_to_custom_mode(&self) -> super::builder::networks::SwitchToCustomMode {
8193 super::builder::networks::SwitchToCustomMode::new(self.inner.clone())
8194 }
8195
8196 /// Updates the specified network peering with the data included in the
8197 /// request. You can only modify the NetworkPeering.export_custom_routes field
8198 /// and the NetworkPeering.import_custom_routes field.
8199 pub fn update_peering(&self) -> super::builder::networks::UpdatePeering {
8200 super::builder::networks::UpdatePeering::new(self.inner.clone())
8201 }
8202
8203 /// Retrieves the specified Operations resource.
8204 pub fn get_operation(&self) -> super::builder::networks::GetOperation {
8205 super::builder::networks::GetOperation::new(self.inner.clone())
8206 }
8207}
8208
8209/// Implements a client for the Google Compute Engine API.
8210///
8211/// # Example
8212/// ```
8213/// # use google_cloud_compute_v1::client::NodeGroups;
8214/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
8215/// let client = NodeGroups::builder().build().await?;
8216/// // use `client` to make requests to the Google Compute Engine API.
8217/// # Ok(()) }
8218/// ```
8219///
8220/// # Service Description
8221///
8222/// Service for the `nodeGroups` resource.
8223///
8224/// # Configuration
8225///
8226/// To configure `NodeGroups` use the `with_*` methods in the type returned
8227/// by [builder()][NodeGroups::builder]. The default configuration should
8228/// work for most applications. Common configuration changes include
8229///
8230/// * [with_endpoint()]: by default this client uses the global default endpoint
8231/// (`https://compute.googleapis.com`). Applications using regional
8232/// endpoints or running in restricted networks (e.g. a network configured
8233// with [Private Google Access with VPC Service Controls]) may want to
8234/// override this default.
8235/// * [with_credentials()]: by default this client uses
8236/// [Application Default Credentials]. Applications using custom
8237/// authentication may need to override this default.
8238///
8239/// [with_endpoint()]: super::builder::node_groups::ClientBuilder::with_endpoint
8240/// [with_credentials()]: super::builder::node_groups::ClientBuilder::with_credentials
8241/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8242/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8243///
8244/// # Pooling and Cloning
8245///
8246/// `NodeGroups` holds a connection pool internally, it is advised to
8247/// create one and reuse it. You do not need to wrap `NodeGroups` in
8248/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8249/// already uses an `Arc` internally.
8250#[cfg(feature = "node-groups")]
8251#[cfg_attr(docsrs, doc(cfg(feature = "node-groups")))]
8252#[derive(Clone, Debug)]
8253pub struct NodeGroups {
8254 inner: std::sync::Arc<dyn super::stub::dynamic::NodeGroups>,
8255}
8256
8257#[cfg(feature = "node-groups")]
8258impl NodeGroups {
8259 /// Returns a builder for [NodeGroups].
8260 ///
8261 /// ```
8262 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8263 /// # use google_cloud_compute_v1::client::NodeGroups;
8264 /// let client = NodeGroups::builder().build().await?;
8265 /// # Ok(()) }
8266 /// ```
8267 pub fn builder() -> super::builder::node_groups::ClientBuilder {
8268 crate::new_client_builder(super::builder::node_groups::client::Factory)
8269 }
8270
8271 /// Creates a new client from the provided stub.
8272 ///
8273 /// The most common case for calling this function is in tests mocking the
8274 /// client's behavior.
8275 pub fn from_stub<T>(stub: T) -> Self
8276 where
8277 T: super::stub::NodeGroups + 'static,
8278 {
8279 Self {
8280 inner: std::sync::Arc::new(stub),
8281 }
8282 }
8283
8284 pub(crate) async fn new(
8285 config: gaxi::options::ClientConfig,
8286 ) -> crate::ClientBuilderResult<Self> {
8287 let inner = Self::build_inner(config).await?;
8288 Ok(Self { inner })
8289 }
8290
8291 async fn build_inner(
8292 conf: gaxi::options::ClientConfig,
8293 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NodeGroups>> {
8294 if gaxi::options::tracing_enabled(&conf) {
8295 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8296 }
8297 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8298 }
8299
8300 async fn build_transport(
8301 conf: gaxi::options::ClientConfig,
8302 ) -> crate::ClientBuilderResult<impl super::stub::NodeGroups> {
8303 super::transport::NodeGroups::new(conf).await
8304 }
8305
8306 async fn build_with_tracing(
8307 conf: gaxi::options::ClientConfig,
8308 ) -> crate::ClientBuilderResult<impl super::stub::NodeGroups> {
8309 Self::build_transport(conf)
8310 .await
8311 .map(super::tracing::NodeGroups::new)
8312 }
8313
8314 /// Adds specified number of nodes to the node group.
8315 pub fn add_nodes(&self) -> super::builder::node_groups::AddNodes {
8316 super::builder::node_groups::AddNodes::new(self.inner.clone())
8317 }
8318
8319 /// Retrieves an aggregated list of node groups.
8320 /// Note: use nodeGroups.listNodes for more details about each group.
8321 ///
8322 /// To prevent failure, Google recommends that you set the
8323 /// `returnPartialSuccess` parameter to `true`.
8324 pub fn aggregated_list(&self) -> super::builder::node_groups::AggregatedList {
8325 super::builder::node_groups::AggregatedList::new(self.inner.clone())
8326 }
8327
8328 /// Deletes the specified NodeGroup resource.
8329 pub fn delete(&self) -> super::builder::node_groups::Delete {
8330 super::builder::node_groups::Delete::new(self.inner.clone())
8331 }
8332
8333 /// Deletes specified nodes from the node group.
8334 pub fn delete_nodes(&self) -> super::builder::node_groups::DeleteNodes {
8335 super::builder::node_groups::DeleteNodes::new(self.inner.clone())
8336 }
8337
8338 /// Returns the specified NodeGroup. Get a list of available NodeGroups
8339 /// by making a list() request.
8340 /// Note: the "nodes" field should not be used. Use nodeGroups.listNodes
8341 /// instead.
8342 pub fn get(&self) -> super::builder::node_groups::Get {
8343 super::builder::node_groups::Get::new(self.inner.clone())
8344 }
8345
8346 /// Gets the access control policy for a resource. May be empty if no such
8347 /// policy or resource exists.
8348 pub fn get_iam_policy(&self) -> super::builder::node_groups::GetIamPolicy {
8349 super::builder::node_groups::GetIamPolicy::new(self.inner.clone())
8350 }
8351
8352 /// Creates a NodeGroup resource in the specified project using the data
8353 /// included in the request.
8354 pub fn insert(&self) -> super::builder::node_groups::Insert {
8355 super::builder::node_groups::Insert::new(self.inner.clone())
8356 }
8357
8358 /// Retrieves a list of node groups available to the specified project.
8359 /// Note: use nodeGroups.listNodes for more details about each group.
8360 pub fn list(&self) -> super::builder::node_groups::List {
8361 super::builder::node_groups::List::new(self.inner.clone())
8362 }
8363
8364 /// Lists nodes in the node group.
8365 pub fn list_nodes(&self) -> super::builder::node_groups::ListNodes {
8366 super::builder::node_groups::ListNodes::new(self.inner.clone())
8367 }
8368
8369 /// Updates the specified node group.
8370 pub fn patch(&self) -> super::builder::node_groups::Patch {
8371 super::builder::node_groups::Patch::new(self.inner.clone())
8372 }
8373
8374 /// Perform maintenance on a subset of nodes in the node group.
8375 pub fn perform_maintenance(&self) -> super::builder::node_groups::PerformMaintenance {
8376 super::builder::node_groups::PerformMaintenance::new(self.inner.clone())
8377 }
8378
8379 /// Sets the access control policy on the specified resource.
8380 /// Replaces any existing policy.
8381 pub fn set_iam_policy(&self) -> super::builder::node_groups::SetIamPolicy {
8382 super::builder::node_groups::SetIamPolicy::new(self.inner.clone())
8383 }
8384
8385 /// Updates the node template of the node group.
8386 pub fn set_node_template(&self) -> super::builder::node_groups::SetNodeTemplate {
8387 super::builder::node_groups::SetNodeTemplate::new(self.inner.clone())
8388 }
8389
8390 /// Simulates maintenance event on specified nodes from the node group.
8391 pub fn simulate_maintenance_event(
8392 &self,
8393 ) -> super::builder::node_groups::SimulateMaintenanceEvent {
8394 super::builder::node_groups::SimulateMaintenanceEvent::new(self.inner.clone())
8395 }
8396
8397 /// Returns permissions that a caller has on the specified resource.
8398 pub fn test_iam_permissions(&self) -> super::builder::node_groups::TestIamPermissions {
8399 super::builder::node_groups::TestIamPermissions::new(self.inner.clone())
8400 }
8401
8402 /// Retrieves the specified zone-specific Operations resource.
8403 pub fn get_operation(&self) -> super::builder::node_groups::GetOperation {
8404 super::builder::node_groups::GetOperation::new(self.inner.clone())
8405 }
8406}
8407
8408/// Implements a client for the Google Compute Engine API.
8409///
8410/// # Example
8411/// ```
8412/// # use google_cloud_compute_v1::client::NodeTemplates;
8413/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
8414/// let client = NodeTemplates::builder().build().await?;
8415/// // use `client` to make requests to the Google Compute Engine API.
8416/// # Ok(()) }
8417/// ```
8418///
8419/// # Service Description
8420///
8421/// Service for the `nodeTemplates` resource.
8422///
8423/// # Configuration
8424///
8425/// To configure `NodeTemplates` use the `with_*` methods in the type returned
8426/// by [builder()][NodeTemplates::builder]. The default configuration should
8427/// work for most applications. Common configuration changes include
8428///
8429/// * [with_endpoint()]: by default this client uses the global default endpoint
8430/// (`https://compute.googleapis.com`). Applications using regional
8431/// endpoints or running in restricted networks (e.g. a network configured
8432// with [Private Google Access with VPC Service Controls]) may want to
8433/// override this default.
8434/// * [with_credentials()]: by default this client uses
8435/// [Application Default Credentials]. Applications using custom
8436/// authentication may need to override this default.
8437///
8438/// [with_endpoint()]: super::builder::node_templates::ClientBuilder::with_endpoint
8439/// [with_credentials()]: super::builder::node_templates::ClientBuilder::with_credentials
8440/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8441/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8442///
8443/// # Pooling and Cloning
8444///
8445/// `NodeTemplates` holds a connection pool internally, it is advised to
8446/// create one and reuse it. You do not need to wrap `NodeTemplates` in
8447/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8448/// already uses an `Arc` internally.
8449#[cfg(feature = "node-templates")]
8450#[cfg_attr(docsrs, doc(cfg(feature = "node-templates")))]
8451#[derive(Clone, Debug)]
8452pub struct NodeTemplates {
8453 inner: std::sync::Arc<dyn super::stub::dynamic::NodeTemplates>,
8454}
8455
8456#[cfg(feature = "node-templates")]
8457impl NodeTemplates {
8458 /// Returns a builder for [NodeTemplates].
8459 ///
8460 /// ```
8461 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8462 /// # use google_cloud_compute_v1::client::NodeTemplates;
8463 /// let client = NodeTemplates::builder().build().await?;
8464 /// # Ok(()) }
8465 /// ```
8466 pub fn builder() -> super::builder::node_templates::ClientBuilder {
8467 crate::new_client_builder(super::builder::node_templates::client::Factory)
8468 }
8469
8470 /// Creates a new client from the provided stub.
8471 ///
8472 /// The most common case for calling this function is in tests mocking the
8473 /// client's behavior.
8474 pub fn from_stub<T>(stub: T) -> Self
8475 where
8476 T: super::stub::NodeTemplates + 'static,
8477 {
8478 Self {
8479 inner: std::sync::Arc::new(stub),
8480 }
8481 }
8482
8483 pub(crate) async fn new(
8484 config: gaxi::options::ClientConfig,
8485 ) -> crate::ClientBuilderResult<Self> {
8486 let inner = Self::build_inner(config).await?;
8487 Ok(Self { inner })
8488 }
8489
8490 async fn build_inner(
8491 conf: gaxi::options::ClientConfig,
8492 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NodeTemplates>> {
8493 if gaxi::options::tracing_enabled(&conf) {
8494 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8495 }
8496 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8497 }
8498
8499 async fn build_transport(
8500 conf: gaxi::options::ClientConfig,
8501 ) -> crate::ClientBuilderResult<impl super::stub::NodeTemplates> {
8502 super::transport::NodeTemplates::new(conf).await
8503 }
8504
8505 async fn build_with_tracing(
8506 conf: gaxi::options::ClientConfig,
8507 ) -> crate::ClientBuilderResult<impl super::stub::NodeTemplates> {
8508 Self::build_transport(conf)
8509 .await
8510 .map(super::tracing::NodeTemplates::new)
8511 }
8512
8513 /// Retrieves an aggregated list of node templates.
8514 ///
8515 /// To prevent failure, Google recommends that you set the
8516 /// `returnPartialSuccess` parameter to `true`.
8517 pub fn aggregated_list(&self) -> super::builder::node_templates::AggregatedList {
8518 super::builder::node_templates::AggregatedList::new(self.inner.clone())
8519 }
8520
8521 /// Deletes the specified NodeTemplate resource.
8522 pub fn delete(&self) -> super::builder::node_templates::Delete {
8523 super::builder::node_templates::Delete::new(self.inner.clone())
8524 }
8525
8526 /// Returns the specified node template.
8527 pub fn get(&self) -> super::builder::node_templates::Get {
8528 super::builder::node_templates::Get::new(self.inner.clone())
8529 }
8530
8531 /// Gets the access control policy for a resource. May be empty if no such
8532 /// policy or resource exists.
8533 pub fn get_iam_policy(&self) -> super::builder::node_templates::GetIamPolicy {
8534 super::builder::node_templates::GetIamPolicy::new(self.inner.clone())
8535 }
8536
8537 /// Creates a NodeTemplate resource in the specified project using the data
8538 /// included in the request.
8539 pub fn insert(&self) -> super::builder::node_templates::Insert {
8540 super::builder::node_templates::Insert::new(self.inner.clone())
8541 }
8542
8543 /// Retrieves a list of node templates available to the specified
8544 /// project.
8545 pub fn list(&self) -> super::builder::node_templates::List {
8546 super::builder::node_templates::List::new(self.inner.clone())
8547 }
8548
8549 /// Sets the access control policy on the specified resource.
8550 /// Replaces any existing policy.
8551 pub fn set_iam_policy(&self) -> super::builder::node_templates::SetIamPolicy {
8552 super::builder::node_templates::SetIamPolicy::new(self.inner.clone())
8553 }
8554
8555 /// Returns permissions that a caller has on the specified resource.
8556 pub fn test_iam_permissions(&self) -> super::builder::node_templates::TestIamPermissions {
8557 super::builder::node_templates::TestIamPermissions::new(self.inner.clone())
8558 }
8559
8560 /// Retrieves the specified region-specific Operations resource.
8561 pub fn get_operation(&self) -> super::builder::node_templates::GetOperation {
8562 super::builder::node_templates::GetOperation::new(self.inner.clone())
8563 }
8564}
8565
8566/// Implements a client for the Google Compute Engine API.
8567///
8568/// # Example
8569/// ```
8570/// # use google_cloud_compute_v1::client::NodeTypes;
8571/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
8572/// let client = NodeTypes::builder().build().await?;
8573/// // use `client` to make requests to the Google Compute Engine API.
8574/// # Ok(()) }
8575/// ```
8576///
8577/// # Service Description
8578///
8579/// Service for the `nodeTypes` resource.
8580///
8581/// # Configuration
8582///
8583/// To configure `NodeTypes` use the `with_*` methods in the type returned
8584/// by [builder()][NodeTypes::builder]. The default configuration should
8585/// work for most applications. Common configuration changes include
8586///
8587/// * [with_endpoint()]: by default this client uses the global default endpoint
8588/// (`https://compute.googleapis.com`). Applications using regional
8589/// endpoints or running in restricted networks (e.g. a network configured
8590// with [Private Google Access with VPC Service Controls]) may want to
8591/// override this default.
8592/// * [with_credentials()]: by default this client uses
8593/// [Application Default Credentials]. Applications using custom
8594/// authentication may need to override this default.
8595///
8596/// [with_endpoint()]: super::builder::node_types::ClientBuilder::with_endpoint
8597/// [with_credentials()]: super::builder::node_types::ClientBuilder::with_credentials
8598/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8599/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8600///
8601/// # Pooling and Cloning
8602///
8603/// `NodeTypes` holds a connection pool internally, it is advised to
8604/// create one and reuse it. You do not need to wrap `NodeTypes` in
8605/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8606/// already uses an `Arc` internally.
8607#[cfg(feature = "node-types")]
8608#[cfg_attr(docsrs, doc(cfg(feature = "node-types")))]
8609#[derive(Clone, Debug)]
8610pub struct NodeTypes {
8611 inner: std::sync::Arc<dyn super::stub::dynamic::NodeTypes>,
8612}
8613
8614#[cfg(feature = "node-types")]
8615impl NodeTypes {
8616 /// Returns a builder for [NodeTypes].
8617 ///
8618 /// ```
8619 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8620 /// # use google_cloud_compute_v1::client::NodeTypes;
8621 /// let client = NodeTypes::builder().build().await?;
8622 /// # Ok(()) }
8623 /// ```
8624 pub fn builder() -> super::builder::node_types::ClientBuilder {
8625 crate::new_client_builder(super::builder::node_types::client::Factory)
8626 }
8627
8628 /// Creates a new client from the provided stub.
8629 ///
8630 /// The most common case for calling this function is in tests mocking the
8631 /// client's behavior.
8632 pub fn from_stub<T>(stub: T) -> Self
8633 where
8634 T: super::stub::NodeTypes + 'static,
8635 {
8636 Self {
8637 inner: std::sync::Arc::new(stub),
8638 }
8639 }
8640
8641 pub(crate) async fn new(
8642 config: gaxi::options::ClientConfig,
8643 ) -> crate::ClientBuilderResult<Self> {
8644 let inner = Self::build_inner(config).await?;
8645 Ok(Self { inner })
8646 }
8647
8648 async fn build_inner(
8649 conf: gaxi::options::ClientConfig,
8650 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NodeTypes>> {
8651 if gaxi::options::tracing_enabled(&conf) {
8652 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8653 }
8654 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8655 }
8656
8657 async fn build_transport(
8658 conf: gaxi::options::ClientConfig,
8659 ) -> crate::ClientBuilderResult<impl super::stub::NodeTypes> {
8660 super::transport::NodeTypes::new(conf).await
8661 }
8662
8663 async fn build_with_tracing(
8664 conf: gaxi::options::ClientConfig,
8665 ) -> crate::ClientBuilderResult<impl super::stub::NodeTypes> {
8666 Self::build_transport(conf)
8667 .await
8668 .map(super::tracing::NodeTypes::new)
8669 }
8670
8671 /// Retrieves an aggregated list of node types.
8672 ///
8673 /// To prevent failure, Google recommends that you set the
8674 /// `returnPartialSuccess` parameter to `true`.
8675 pub fn aggregated_list(&self) -> super::builder::node_types::AggregatedList {
8676 super::builder::node_types::AggregatedList::new(self.inner.clone())
8677 }
8678
8679 /// Returns the specified node type.
8680 pub fn get(&self) -> super::builder::node_types::Get {
8681 super::builder::node_types::Get::new(self.inner.clone())
8682 }
8683
8684 /// Retrieves a list of node types available to the specified
8685 /// project.
8686 pub fn list(&self) -> super::builder::node_types::List {
8687 super::builder::node_types::List::new(self.inner.clone())
8688 }
8689}
8690
8691/// Implements a client for the Google Compute Engine API.
8692///
8693/// # Example
8694/// ```
8695/// # use google_cloud_compute_v1::client::OrganizationSecurityPolicies;
8696/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
8697/// let client = OrganizationSecurityPolicies::builder().build().await?;
8698/// // use `client` to make requests to the Google Compute Engine API.
8699/// # Ok(()) }
8700/// ```
8701///
8702/// # Service Description
8703///
8704/// Service for the `organizationSecurityPolicies` resource.
8705///
8706/// # Configuration
8707///
8708/// To configure `OrganizationSecurityPolicies` use the `with_*` methods in the type returned
8709/// by [builder()][OrganizationSecurityPolicies::builder]. The default configuration should
8710/// work for most applications. Common configuration changes include
8711///
8712/// * [with_endpoint()]: by default this client uses the global default endpoint
8713/// (`https://compute.googleapis.com`). Applications using regional
8714/// endpoints or running in restricted networks (e.g. a network configured
8715// with [Private Google Access with VPC Service Controls]) may want to
8716/// override this default.
8717/// * [with_credentials()]: by default this client uses
8718/// [Application Default Credentials]. Applications using custom
8719/// authentication may need to override this default.
8720///
8721/// [with_endpoint()]: super::builder::organization_security_policies::ClientBuilder::with_endpoint
8722/// [with_credentials()]: super::builder::organization_security_policies::ClientBuilder::with_credentials
8723/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8724/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8725///
8726/// # Pooling and Cloning
8727///
8728/// `OrganizationSecurityPolicies` holds a connection pool internally, it is advised to
8729/// create one and reuse it. You do not need to wrap `OrganizationSecurityPolicies` in
8730/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8731/// already uses an `Arc` internally.
8732#[cfg(feature = "organization-security-policies")]
8733#[cfg_attr(docsrs, doc(cfg(feature = "organization-security-policies")))]
8734#[derive(Clone, Debug)]
8735pub struct OrganizationSecurityPolicies {
8736 inner: std::sync::Arc<dyn super::stub::dynamic::OrganizationSecurityPolicies>,
8737}
8738
8739#[cfg(feature = "organization-security-policies")]
8740impl OrganizationSecurityPolicies {
8741 /// Returns a builder for [OrganizationSecurityPolicies].
8742 ///
8743 /// ```
8744 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8745 /// # use google_cloud_compute_v1::client::OrganizationSecurityPolicies;
8746 /// let client = OrganizationSecurityPolicies::builder().build().await?;
8747 /// # Ok(()) }
8748 /// ```
8749 pub fn builder() -> super::builder::organization_security_policies::ClientBuilder {
8750 crate::new_client_builder(super::builder::organization_security_policies::client::Factory)
8751 }
8752
8753 /// Creates a new client from the provided stub.
8754 ///
8755 /// The most common case for calling this function is in tests mocking the
8756 /// client's behavior.
8757 pub fn from_stub<T>(stub: T) -> Self
8758 where
8759 T: super::stub::OrganizationSecurityPolicies + 'static,
8760 {
8761 Self {
8762 inner: std::sync::Arc::new(stub),
8763 }
8764 }
8765
8766 pub(crate) async fn new(
8767 config: gaxi::options::ClientConfig,
8768 ) -> crate::ClientBuilderResult<Self> {
8769 let inner = Self::build_inner(config).await?;
8770 Ok(Self { inner })
8771 }
8772
8773 async fn build_inner(
8774 conf: gaxi::options::ClientConfig,
8775 ) -> crate::ClientBuilderResult<
8776 std::sync::Arc<dyn super::stub::dynamic::OrganizationSecurityPolicies>,
8777 > {
8778 if gaxi::options::tracing_enabled(&conf) {
8779 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8780 }
8781 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8782 }
8783
8784 async fn build_transport(
8785 conf: gaxi::options::ClientConfig,
8786 ) -> crate::ClientBuilderResult<impl super::stub::OrganizationSecurityPolicies> {
8787 super::transport::OrganizationSecurityPolicies::new(conf).await
8788 }
8789
8790 async fn build_with_tracing(
8791 conf: gaxi::options::ClientConfig,
8792 ) -> crate::ClientBuilderResult<impl super::stub::OrganizationSecurityPolicies> {
8793 Self::build_transport(conf)
8794 .await
8795 .map(super::tracing::OrganizationSecurityPolicies::new)
8796 }
8797
8798 /// Inserts an association for the specified security policy.
8799 ///
8800 /// This has billing implications. Projects in the hierarchy with effective
8801 /// hierarchical security policies will be automatically enrolled into Cloud
8802 /// Armor Enterprise if not already enrolled.
8803 ///
8804 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8805 /// versions of this API were used to modify firewall policies. This usage is
8806 /// now disabled for most organizations. Use firewallPolicies.addAssociation
8807 /// instead.
8808 pub fn add_association(
8809 &self,
8810 ) -> super::builder::organization_security_policies::AddAssociation {
8811 super::builder::organization_security_policies::AddAssociation::new(self.inner.clone())
8812 }
8813
8814 /// Inserts a rule into a security policy.
8815 ///
8816 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8817 /// versions of this API were used to modify firewall policies. This usage is
8818 /// now disabled for most organizations. Use firewallPolicies.addRule instead.
8819 pub fn add_rule(&self) -> super::builder::organization_security_policies::AddRule {
8820 super::builder::organization_security_policies::AddRule::new(self.inner.clone())
8821 }
8822
8823 /// Copies rules to the specified security policy.
8824 ///
8825 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8826 /// versions of this API were used to modify firewall policies. This usage is
8827 /// now disabled for most organizations. Use firewallPolicies.cloneRules
8828 /// instead.
8829 pub fn copy_rules(&self) -> super::builder::organization_security_policies::CopyRules {
8830 super::builder::organization_security_policies::CopyRules::new(self.inner.clone())
8831 }
8832
8833 /// Deletes the specified policy.
8834 ///
8835 /// Use this API to remove Cloud Armor policies. Previously, alpha and beta
8836 /// versions of this API were used to remove firewall policies. This usage is
8837 /// now disabled for most organizations. Use firewallPolicies.delete instead.
8838 pub fn delete(&self) -> super::builder::organization_security_policies::Delete {
8839 super::builder::organization_security_policies::Delete::new(self.inner.clone())
8840 }
8841
8842 /// List all of the ordered rules present in a single specified policy.
8843 ///
8844 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
8845 /// versions of this API were used to read firewall policies. This usage is now
8846 /// disabled for most organizations. Use firewallPolicies.get instead.
8847 pub fn get(&self) -> super::builder::organization_security_policies::Get {
8848 super::builder::organization_security_policies::Get::new(self.inner.clone())
8849 }
8850
8851 /// Gets an association with the specified name.
8852 ///
8853 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
8854 /// versions of this API were used to read firewall policies. This usage is
8855 /// now disabled for most organizations. Use firewallPolicies.getAssociation
8856 /// instead.
8857 pub fn get_association(
8858 &self,
8859 ) -> super::builder::organization_security_policies::GetAssociation {
8860 super::builder::organization_security_policies::GetAssociation::new(self.inner.clone())
8861 }
8862
8863 /// Gets a rule at the specified priority.
8864 ///
8865 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
8866 /// versions of this API were used to read firewall policies. This usage is now
8867 /// disabled for most organizations. Use firewallPolicies.getRule instead.
8868 pub fn get_rule(&self) -> super::builder::organization_security_policies::GetRule {
8869 super::builder::organization_security_policies::GetRule::new(self.inner.clone())
8870 }
8871
8872 /// Creates a new policy in the specified organization using the data included
8873 /// in the request.
8874 ///
8875 /// Use this API to add Cloud Armor policies. Previously, alpha and beta
8876 /// versions of this API were used to add firewall policies. This usage is now
8877 /// disabled for most organizations. Use firewallPolicies.insert instead.
8878 pub fn insert(&self) -> super::builder::organization_security_policies::Insert {
8879 super::builder::organization_security_policies::Insert::new(self.inner.clone())
8880 }
8881
8882 /// List all the policies that have been configured for the specified
8883 /// organization.
8884 ///
8885 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
8886 /// versions of this API were used to read firewall policies. This usage is now
8887 /// disabled for most organizations. Use firewallPolicies.list instead.
8888 pub fn list(&self) -> super::builder::organization_security_policies::List {
8889 super::builder::organization_security_policies::List::new(self.inner.clone())
8890 }
8891
8892 /// Lists associations of a specified target, i.e., organization or folder.
8893 ///
8894 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
8895 /// versions of this API were used to read firewall policies. This usage is
8896 /// now disabled for most organizations. Use firewallPolicies.listAssociations
8897 /// instead.
8898 pub fn list_associations(
8899 &self,
8900 ) -> super::builder::organization_security_policies::ListAssociations {
8901 super::builder::organization_security_policies::ListAssociations::new(self.inner.clone())
8902 }
8903
8904 /// Gets the current list of preconfigured Web Application Firewall (WAF)
8905 /// expressions.
8906 pub fn list_preconfigured_expression_sets(
8907 &self,
8908 ) -> super::builder::organization_security_policies::ListPreconfiguredExpressionSets {
8909 super::builder::organization_security_policies::ListPreconfiguredExpressionSets::new(
8910 self.inner.clone(),
8911 )
8912 }
8913
8914 /// Moves the specified security policy.
8915 ///
8916 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8917 /// versions of this API were used to modify firewall policies. This usage is
8918 /// now disabled for most organizations. Use firewallPolicies.move instead.
8919 pub fn r#move(&self) -> super::builder::organization_security_policies::Move {
8920 super::builder::organization_security_policies::Move::new(self.inner.clone())
8921 }
8922
8923 /// Patches the specified policy with the data included in the request.
8924 ///
8925 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8926 /// versions of this API were used to modify firewall policies. This usage is
8927 /// now disabled for most organizations. Use firewallPolicies.patch instead.
8928 pub fn patch(&self) -> super::builder::organization_security_policies::Patch {
8929 super::builder::organization_security_policies::Patch::new(self.inner.clone())
8930 }
8931
8932 /// Patches a rule at the specified priority.
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.patchRule
8937 /// instead.
8938 pub fn patch_rule(&self) -> super::builder::organization_security_policies::PatchRule {
8939 super::builder::organization_security_policies::PatchRule::new(self.inner.clone())
8940 }
8941
8942 /// Removes an association for the specified security policy.
8943 ///
8944 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8945 /// versions of this API were used to modify firewall policies. This usage is
8946 /// now disabled for most organizations. Use firewallPolicies.removeAssociation
8947 /// instead.
8948 pub fn remove_association(
8949 &self,
8950 ) -> super::builder::organization_security_policies::RemoveAssociation {
8951 super::builder::organization_security_policies::RemoveAssociation::new(self.inner.clone())
8952 }
8953
8954 /// Deletes a rule at the specified priority.
8955 ///
8956 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8957 /// versions of this API were used to modify firewall policies. This usage is
8958 /// now disabled for most organizations. Use firewallPolicies.removeRule
8959 /// instead.
8960 pub fn remove_rule(&self) -> super::builder::organization_security_policies::RemoveRule {
8961 super::builder::organization_security_policies::RemoveRule::new(self.inner.clone())
8962 }
8963
8964 /// Retrieves the specified Operations resource. Gets a list of operations
8965 /// by making a `list()` request.
8966 pub fn get_operation(&self) -> super::builder::organization_security_policies::GetOperation {
8967 super::builder::organization_security_policies::GetOperation::new(self.inner.clone())
8968 }
8969}
8970
8971/// Implements a client for the Google Compute Engine API.
8972///
8973/// # Example
8974/// ```
8975/// # use google_cloud_compute_v1::client::PacketMirrorings;
8976/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
8977/// let client = PacketMirrorings::builder().build().await?;
8978/// // use `client` to make requests to the Google Compute Engine API.
8979/// # Ok(()) }
8980/// ```
8981///
8982/// # Service Description
8983///
8984/// Service for the `packetMirrorings` resource.
8985///
8986/// # Configuration
8987///
8988/// To configure `PacketMirrorings` use the `with_*` methods in the type returned
8989/// by [builder()][PacketMirrorings::builder]. The default configuration should
8990/// work for most applications. Common configuration changes include
8991///
8992/// * [with_endpoint()]: by default this client uses the global default endpoint
8993/// (`https://compute.googleapis.com`). Applications using regional
8994/// endpoints or running in restricted networks (e.g. a network configured
8995// with [Private Google Access with VPC Service Controls]) may want to
8996/// override this default.
8997/// * [with_credentials()]: by default this client uses
8998/// [Application Default Credentials]. Applications using custom
8999/// authentication may need to override this default.
9000///
9001/// [with_endpoint()]: super::builder::packet_mirrorings::ClientBuilder::with_endpoint
9002/// [with_credentials()]: super::builder::packet_mirrorings::ClientBuilder::with_credentials
9003/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9004/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9005///
9006/// # Pooling and Cloning
9007///
9008/// `PacketMirrorings` holds a connection pool internally, it is advised to
9009/// create one and reuse it. You do not need to wrap `PacketMirrorings` in
9010/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9011/// already uses an `Arc` internally.
9012#[cfg(feature = "packet-mirrorings")]
9013#[cfg_attr(docsrs, doc(cfg(feature = "packet-mirrorings")))]
9014#[derive(Clone, Debug)]
9015pub struct PacketMirrorings {
9016 inner: std::sync::Arc<dyn super::stub::dynamic::PacketMirrorings>,
9017}
9018
9019#[cfg(feature = "packet-mirrorings")]
9020impl PacketMirrorings {
9021 /// Returns a builder for [PacketMirrorings].
9022 ///
9023 /// ```
9024 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9025 /// # use google_cloud_compute_v1::client::PacketMirrorings;
9026 /// let client = PacketMirrorings::builder().build().await?;
9027 /// # Ok(()) }
9028 /// ```
9029 pub fn builder() -> super::builder::packet_mirrorings::ClientBuilder {
9030 crate::new_client_builder(super::builder::packet_mirrorings::client::Factory)
9031 }
9032
9033 /// Creates a new client from the provided stub.
9034 ///
9035 /// The most common case for calling this function is in tests mocking the
9036 /// client's behavior.
9037 pub fn from_stub<T>(stub: T) -> Self
9038 where
9039 T: super::stub::PacketMirrorings + 'static,
9040 {
9041 Self {
9042 inner: std::sync::Arc::new(stub),
9043 }
9044 }
9045
9046 pub(crate) async fn new(
9047 config: gaxi::options::ClientConfig,
9048 ) -> crate::ClientBuilderResult<Self> {
9049 let inner = Self::build_inner(config).await?;
9050 Ok(Self { inner })
9051 }
9052
9053 async fn build_inner(
9054 conf: gaxi::options::ClientConfig,
9055 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::PacketMirrorings>>
9056 {
9057 if gaxi::options::tracing_enabled(&conf) {
9058 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9059 }
9060 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9061 }
9062
9063 async fn build_transport(
9064 conf: gaxi::options::ClientConfig,
9065 ) -> crate::ClientBuilderResult<impl super::stub::PacketMirrorings> {
9066 super::transport::PacketMirrorings::new(conf).await
9067 }
9068
9069 async fn build_with_tracing(
9070 conf: gaxi::options::ClientConfig,
9071 ) -> crate::ClientBuilderResult<impl super::stub::PacketMirrorings> {
9072 Self::build_transport(conf)
9073 .await
9074 .map(super::tracing::PacketMirrorings::new)
9075 }
9076
9077 /// Retrieves an aggregated list of packetMirrorings.
9078 ///
9079 /// To prevent failure, Google recommends that you set the
9080 /// `returnPartialSuccess` parameter to `true`.
9081 pub fn aggregated_list(&self) -> super::builder::packet_mirrorings::AggregatedList {
9082 super::builder::packet_mirrorings::AggregatedList::new(self.inner.clone())
9083 }
9084
9085 /// Deletes the specified PacketMirroring resource.
9086 pub fn delete(&self) -> super::builder::packet_mirrorings::Delete {
9087 super::builder::packet_mirrorings::Delete::new(self.inner.clone())
9088 }
9089
9090 /// Returns the specified PacketMirroring resource.
9091 pub fn get(&self) -> super::builder::packet_mirrorings::Get {
9092 super::builder::packet_mirrorings::Get::new(self.inner.clone())
9093 }
9094
9095 /// Creates a PacketMirroring resource in the specified project and region
9096 /// using the data included in the request.
9097 pub fn insert(&self) -> super::builder::packet_mirrorings::Insert {
9098 super::builder::packet_mirrorings::Insert::new(self.inner.clone())
9099 }
9100
9101 /// Retrieves a list of PacketMirroring resources available to the specified
9102 /// project and region.
9103 pub fn list(&self) -> super::builder::packet_mirrorings::List {
9104 super::builder::packet_mirrorings::List::new(self.inner.clone())
9105 }
9106
9107 /// Patches the specified PacketMirroring resource with the data included in
9108 /// the request. This method supportsPATCH
9109 /// semantics and usesJSON merge
9110 /// patch format and processing rules.
9111 pub fn patch(&self) -> super::builder::packet_mirrorings::Patch {
9112 super::builder::packet_mirrorings::Patch::new(self.inner.clone())
9113 }
9114
9115 /// Returns permissions that a caller has on the specified resource.
9116 pub fn test_iam_permissions(&self) -> super::builder::packet_mirrorings::TestIamPermissions {
9117 super::builder::packet_mirrorings::TestIamPermissions::new(self.inner.clone())
9118 }
9119
9120 /// Retrieves the specified region-specific Operations resource.
9121 pub fn get_operation(&self) -> super::builder::packet_mirrorings::GetOperation {
9122 super::builder::packet_mirrorings::GetOperation::new(self.inner.clone())
9123 }
9124}
9125
9126/// Implements a client for the Google Compute Engine API.
9127///
9128/// # Example
9129/// ```
9130/// # use google_cloud_compute_v1::client::PreviewFeatures;
9131/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
9132/// let client = PreviewFeatures::builder().build().await?;
9133/// // use `client` to make requests to the Google Compute Engine API.
9134/// # Ok(()) }
9135/// ```
9136///
9137/// # Service Description
9138///
9139/// Service for the `previewFeatures` resource.
9140///
9141/// # Configuration
9142///
9143/// To configure `PreviewFeatures` use the `with_*` methods in the type returned
9144/// by [builder()][PreviewFeatures::builder]. The default configuration should
9145/// work for most applications. Common configuration changes include
9146///
9147/// * [with_endpoint()]: by default this client uses the global default endpoint
9148/// (`https://compute.googleapis.com`). Applications using regional
9149/// endpoints or running in restricted networks (e.g. a network configured
9150// with [Private Google Access with VPC Service Controls]) may want to
9151/// override this default.
9152/// * [with_credentials()]: by default this client uses
9153/// [Application Default Credentials]. Applications using custom
9154/// authentication may need to override this default.
9155///
9156/// [with_endpoint()]: super::builder::preview_features::ClientBuilder::with_endpoint
9157/// [with_credentials()]: super::builder::preview_features::ClientBuilder::with_credentials
9158/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9159/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9160///
9161/// # Pooling and Cloning
9162///
9163/// `PreviewFeatures` holds a connection pool internally, it is advised to
9164/// create one and reuse it. You do not need to wrap `PreviewFeatures` in
9165/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9166/// already uses an `Arc` internally.
9167#[cfg(feature = "preview-features")]
9168#[cfg_attr(docsrs, doc(cfg(feature = "preview-features")))]
9169#[derive(Clone, Debug)]
9170pub struct PreviewFeatures {
9171 inner: std::sync::Arc<dyn super::stub::dynamic::PreviewFeatures>,
9172}
9173
9174#[cfg(feature = "preview-features")]
9175impl PreviewFeatures {
9176 /// Returns a builder for [PreviewFeatures].
9177 ///
9178 /// ```
9179 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9180 /// # use google_cloud_compute_v1::client::PreviewFeatures;
9181 /// let client = PreviewFeatures::builder().build().await?;
9182 /// # Ok(()) }
9183 /// ```
9184 pub fn builder() -> super::builder::preview_features::ClientBuilder {
9185 crate::new_client_builder(super::builder::preview_features::client::Factory)
9186 }
9187
9188 /// Creates a new client from the provided stub.
9189 ///
9190 /// The most common case for calling this function is in tests mocking the
9191 /// client's behavior.
9192 pub fn from_stub<T>(stub: T) -> Self
9193 where
9194 T: super::stub::PreviewFeatures + 'static,
9195 {
9196 Self {
9197 inner: std::sync::Arc::new(stub),
9198 }
9199 }
9200
9201 pub(crate) async fn new(
9202 config: gaxi::options::ClientConfig,
9203 ) -> crate::ClientBuilderResult<Self> {
9204 let inner = Self::build_inner(config).await?;
9205 Ok(Self { inner })
9206 }
9207
9208 async fn build_inner(
9209 conf: gaxi::options::ClientConfig,
9210 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::PreviewFeatures>> {
9211 if gaxi::options::tracing_enabled(&conf) {
9212 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9213 }
9214 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9215 }
9216
9217 async fn build_transport(
9218 conf: gaxi::options::ClientConfig,
9219 ) -> crate::ClientBuilderResult<impl super::stub::PreviewFeatures> {
9220 super::transport::PreviewFeatures::new(conf).await
9221 }
9222
9223 async fn build_with_tracing(
9224 conf: gaxi::options::ClientConfig,
9225 ) -> crate::ClientBuilderResult<impl super::stub::PreviewFeatures> {
9226 Self::build_transport(conf)
9227 .await
9228 .map(super::tracing::PreviewFeatures::new)
9229 }
9230
9231 /// Returns the details of the given PreviewFeature.
9232 pub fn get(&self) -> super::builder::preview_features::Get {
9233 super::builder::preview_features::Get::new(self.inner.clone())
9234 }
9235
9236 /// Returns the details of the given PreviewFeature.
9237 pub fn list(&self) -> super::builder::preview_features::List {
9238 super::builder::preview_features::List::new(self.inner.clone())
9239 }
9240
9241 /// Patches the given PreviewFeature. This method is used to enable or disable
9242 /// a PreviewFeature.
9243 pub fn update(&self) -> super::builder::preview_features::Update {
9244 super::builder::preview_features::Update::new(self.inner.clone())
9245 }
9246
9247 /// Retrieves the specified Operations resource.
9248 pub fn get_operation(&self) -> super::builder::preview_features::GetOperation {
9249 super::builder::preview_features::GetOperation::new(self.inner.clone())
9250 }
9251}
9252
9253/// Implements a client for the Google Compute Engine API.
9254///
9255/// # Example
9256/// ```
9257/// # use google_cloud_compute_v1::client::Projects;
9258/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
9259/// let client = Projects::builder().build().await?;
9260/// // use `client` to make requests to the Google Compute Engine API.
9261/// # Ok(()) }
9262/// ```
9263///
9264/// # Service Description
9265///
9266/// Service for the `projects` resource.
9267///
9268/// # Configuration
9269///
9270/// To configure `Projects` use the `with_*` methods in the type returned
9271/// by [builder()][Projects::builder]. The default configuration should
9272/// work for most applications. Common configuration changes include
9273///
9274/// * [with_endpoint()]: by default this client uses the global default endpoint
9275/// (`https://compute.googleapis.com`). Applications using regional
9276/// endpoints or running in restricted networks (e.g. a network configured
9277// with [Private Google Access with VPC Service Controls]) may want to
9278/// override this default.
9279/// * [with_credentials()]: by default this client uses
9280/// [Application Default Credentials]. Applications using custom
9281/// authentication may need to override this default.
9282///
9283/// [with_endpoint()]: super::builder::projects::ClientBuilder::with_endpoint
9284/// [with_credentials()]: super::builder::projects::ClientBuilder::with_credentials
9285/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9286/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9287///
9288/// # Pooling and Cloning
9289///
9290/// `Projects` holds a connection pool internally, it is advised to
9291/// create one and reuse it. You do not need to wrap `Projects` in
9292/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9293/// already uses an `Arc` internally.
9294#[cfg(feature = "projects")]
9295#[cfg_attr(docsrs, doc(cfg(feature = "projects")))]
9296#[derive(Clone, Debug)]
9297pub struct Projects {
9298 inner: std::sync::Arc<dyn super::stub::dynamic::Projects>,
9299}
9300
9301#[cfg(feature = "projects")]
9302impl Projects {
9303 /// Returns a builder for [Projects].
9304 ///
9305 /// ```
9306 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9307 /// # use google_cloud_compute_v1::client::Projects;
9308 /// let client = Projects::builder().build().await?;
9309 /// # Ok(()) }
9310 /// ```
9311 pub fn builder() -> super::builder::projects::ClientBuilder {
9312 crate::new_client_builder(super::builder::projects::client::Factory)
9313 }
9314
9315 /// Creates a new client from the provided stub.
9316 ///
9317 /// The most common case for calling this function is in tests mocking the
9318 /// client's behavior.
9319 pub fn from_stub<T>(stub: T) -> Self
9320 where
9321 T: super::stub::Projects + 'static,
9322 {
9323 Self {
9324 inner: std::sync::Arc::new(stub),
9325 }
9326 }
9327
9328 pub(crate) async fn new(
9329 config: gaxi::options::ClientConfig,
9330 ) -> crate::ClientBuilderResult<Self> {
9331 let inner = Self::build_inner(config).await?;
9332 Ok(Self { inner })
9333 }
9334
9335 async fn build_inner(
9336 conf: gaxi::options::ClientConfig,
9337 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Projects>> {
9338 if gaxi::options::tracing_enabled(&conf) {
9339 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9340 }
9341 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9342 }
9343
9344 async fn build_transport(
9345 conf: gaxi::options::ClientConfig,
9346 ) -> crate::ClientBuilderResult<impl super::stub::Projects> {
9347 super::transport::Projects::new(conf).await
9348 }
9349
9350 async fn build_with_tracing(
9351 conf: gaxi::options::ClientConfig,
9352 ) -> crate::ClientBuilderResult<impl super::stub::Projects> {
9353 Self::build_transport(conf)
9354 .await
9355 .map(super::tracing::Projects::new)
9356 }
9357
9358 /// Disable this project as a shared VPC host project.
9359 pub fn disable_xpn_host(&self) -> super::builder::projects::DisableXpnHost {
9360 super::builder::projects::DisableXpnHost::new(self.inner.clone())
9361 }
9362
9363 /// Disable a service resource (also known as service project) associated with
9364 /// this host project.
9365 pub fn disable_xpn_resource(&self) -> super::builder::projects::DisableXpnResource {
9366 super::builder::projects::DisableXpnResource::new(self.inner.clone())
9367 }
9368
9369 /// Enable this project as a shared VPC host project.
9370 pub fn enable_xpn_host(&self) -> super::builder::projects::EnableXpnHost {
9371 super::builder::projects::EnableXpnHost::new(self.inner.clone())
9372 }
9373
9374 /// Enable service resource (a.k.a service project) for a host project, so that
9375 /// subnets in the host project can be used by instances in the service
9376 /// project.
9377 pub fn enable_xpn_resource(&self) -> super::builder::projects::EnableXpnResource {
9378 super::builder::projects::EnableXpnResource::new(self.inner.clone())
9379 }
9380
9381 /// Returns the specified Project resource.
9382 ///
9383 /// To decrease latency for this method, you can optionally omit any unneeded
9384 /// information from the response by using a field mask. This practice is
9385 /// especially recommended for unused quota information (the `quotas` field).
9386 /// To exclude one or more fields, set your request's `fields` query parameter
9387 /// to only include the fields you need. For example, to only include the `id`
9388 /// and `selfLink` fields, add the query parameter `?fields=id,selfLink` to
9389 /// your request.
9390 pub fn get(&self) -> super::builder::projects::Get {
9391 super::builder::projects::Get::new(self.inner.clone())
9392 }
9393
9394 /// Gets the shared VPC host project that this project links to. May be empty
9395 /// if no link exists.
9396 pub fn get_xpn_host(&self) -> super::builder::projects::GetXpnHost {
9397 super::builder::projects::GetXpnHost::new(self.inner.clone())
9398 }
9399
9400 /// Gets service resources (a.k.a service project) associated with this host
9401 /// project.
9402 pub fn get_xpn_resources(&self) -> super::builder::projects::GetXpnResources {
9403 super::builder::projects::GetXpnResources::new(self.inner.clone())
9404 }
9405
9406 /// Lists all shared VPC host projects visible to the user in an organization.
9407 pub fn list_xpn_hosts(&self) -> super::builder::projects::ListXpnHosts {
9408 super::builder::projects::ListXpnHosts::new(self.inner.clone())
9409 }
9410
9411 /// Moves a persistent disk from one zone to another.
9412 /// *Note*: The moveDisk API will be deprecated on September 29, 2026.
9413 ///
9414 /// Starting September 29, 2025, you can't use the moveDisk API on new
9415 /// projects. To move a disk to a different region or zone, follow the steps in
9416 /// [Change the location of a
9417 /// disk](https://cloud.google.com/compute/docs/disks/migrate-to-hyperdisk#migrate-to-hd).
9418 ///
9419 /// Projects that already use the moveDisk API can continue usage until
9420 /// September 29, 2026.
9421 ///
9422 /// Starting November 1, 2025, API responses will include a warning message in
9423 /// the response body about the upcoming deprecation. You can skip the message
9424 /// to continue using the service without interruption.
9425 #[deprecated]
9426 pub fn move_disk(&self) -> super::builder::projects::MoveDisk {
9427 super::builder::projects::MoveDisk::new(self.inner.clone())
9428 }
9429
9430 /// Moves an instance and its attached persistent disks from one zone to
9431 /// another.
9432 /// *Note*: Moving VMs or disks by using this method might
9433 /// cause unexpected behavior. For more information, see the [known
9434 /// issue](/compute/docs/troubleshooting/known-issues#moving_vms_or_disks_using_the_moveinstance_api_or_the_causes_unexpected_behavior).
9435 /// [Deprecated] This method is deprecated. See [moving instance across
9436 /// zones](/compute/docs/instances/moving-instance-across-zones) instead.
9437 #[deprecated]
9438 pub fn move_instance(&self) -> super::builder::projects::MoveInstance {
9439 super::builder::projects::MoveInstance::new(self.inner.clone())
9440 }
9441
9442 /// Sets the Cloud Armor tier of the project. To set ENTERPRISE or above the
9443 /// billing account of the project must be subscribed to Cloud Armor
9444 /// Enterprise. See Subscribing
9445 /// to Cloud Armor Enterprise for more information.
9446 pub fn set_cloud_armor_tier(&self) -> super::builder::projects::SetCloudArmorTier {
9447 super::builder::projects::SetCloudArmorTier::new(self.inner.clone())
9448 }
9449
9450 /// Sets metadata common to all instances within the specified project using
9451 /// the data included in the request.
9452 pub fn set_common_instance_metadata(
9453 &self,
9454 ) -> super::builder::projects::SetCommonInstanceMetadata {
9455 super::builder::projects::SetCommonInstanceMetadata::new(self.inner.clone())
9456 }
9457
9458 /// Sets the default network tier of the project. The default network tier is
9459 /// used when an address/forwardingRule/instance is created without specifying
9460 /// the network tier field.
9461 pub fn set_default_network_tier(&self) -> super::builder::projects::SetDefaultNetworkTier {
9462 super::builder::projects::SetDefaultNetworkTier::new(self.inner.clone())
9463 }
9464
9465 /// Enables the usage export feature and sets theusage export bucket
9466 /// where reports are stored. If you provide an empty request body using this
9467 /// method, the usage export feature will be disabled.
9468 pub fn set_usage_export_bucket(&self) -> super::builder::projects::SetUsageExportBucket {
9469 super::builder::projects::SetUsageExportBucket::new(self.inner.clone())
9470 }
9471
9472 /// Retrieves the specified Operations resource.
9473 pub fn get_operation(&self) -> super::builder::projects::GetOperation {
9474 super::builder::projects::GetOperation::new(self.inner.clone())
9475 }
9476}
9477
9478/// Implements a client for the Google Compute Engine API.
9479///
9480/// # Example
9481/// ```
9482/// # use google_cloud_compute_v1::client::PublicAdvertisedPrefixes;
9483/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
9484/// let client = PublicAdvertisedPrefixes::builder().build().await?;
9485/// // use `client` to make requests to the Google Compute Engine API.
9486/// # Ok(()) }
9487/// ```
9488///
9489/// # Service Description
9490///
9491/// Service for the `publicAdvertisedPrefixes` resource.
9492///
9493/// # Configuration
9494///
9495/// To configure `PublicAdvertisedPrefixes` use the `with_*` methods in the type returned
9496/// by [builder()][PublicAdvertisedPrefixes::builder]. The default configuration should
9497/// work for most applications. Common configuration changes include
9498///
9499/// * [with_endpoint()]: by default this client uses the global default endpoint
9500/// (`https://compute.googleapis.com`). Applications using regional
9501/// endpoints or running in restricted networks (e.g. a network configured
9502// with [Private Google Access with VPC Service Controls]) may want to
9503/// override this default.
9504/// * [with_credentials()]: by default this client uses
9505/// [Application Default Credentials]. Applications using custom
9506/// authentication may need to override this default.
9507///
9508/// [with_endpoint()]: super::builder::public_advertised_prefixes::ClientBuilder::with_endpoint
9509/// [with_credentials()]: super::builder::public_advertised_prefixes::ClientBuilder::with_credentials
9510/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9511/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9512///
9513/// # Pooling and Cloning
9514///
9515/// `PublicAdvertisedPrefixes` holds a connection pool internally, it is advised to
9516/// create one and reuse it. You do not need to wrap `PublicAdvertisedPrefixes` in
9517/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9518/// already uses an `Arc` internally.
9519#[cfg(feature = "public-advertised-prefixes")]
9520#[cfg_attr(docsrs, doc(cfg(feature = "public-advertised-prefixes")))]
9521#[derive(Clone, Debug)]
9522pub struct PublicAdvertisedPrefixes {
9523 inner: std::sync::Arc<dyn super::stub::dynamic::PublicAdvertisedPrefixes>,
9524}
9525
9526#[cfg(feature = "public-advertised-prefixes")]
9527impl PublicAdvertisedPrefixes {
9528 /// Returns a builder for [PublicAdvertisedPrefixes].
9529 ///
9530 /// ```
9531 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9532 /// # use google_cloud_compute_v1::client::PublicAdvertisedPrefixes;
9533 /// let client = PublicAdvertisedPrefixes::builder().build().await?;
9534 /// # Ok(()) }
9535 /// ```
9536 pub fn builder() -> super::builder::public_advertised_prefixes::ClientBuilder {
9537 crate::new_client_builder(super::builder::public_advertised_prefixes::client::Factory)
9538 }
9539
9540 /// Creates a new client from the provided stub.
9541 ///
9542 /// The most common case for calling this function is in tests mocking the
9543 /// client's behavior.
9544 pub fn from_stub<T>(stub: T) -> Self
9545 where
9546 T: super::stub::PublicAdvertisedPrefixes + 'static,
9547 {
9548 Self {
9549 inner: std::sync::Arc::new(stub),
9550 }
9551 }
9552
9553 pub(crate) async fn new(
9554 config: gaxi::options::ClientConfig,
9555 ) -> crate::ClientBuilderResult<Self> {
9556 let inner = Self::build_inner(config).await?;
9557 Ok(Self { inner })
9558 }
9559
9560 async fn build_inner(
9561 conf: gaxi::options::ClientConfig,
9562 ) -> crate::ClientBuilderResult<
9563 std::sync::Arc<dyn super::stub::dynamic::PublicAdvertisedPrefixes>,
9564 > {
9565 if gaxi::options::tracing_enabled(&conf) {
9566 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9567 }
9568 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9569 }
9570
9571 async fn build_transport(
9572 conf: gaxi::options::ClientConfig,
9573 ) -> crate::ClientBuilderResult<impl super::stub::PublicAdvertisedPrefixes> {
9574 super::transport::PublicAdvertisedPrefixes::new(conf).await
9575 }
9576
9577 async fn build_with_tracing(
9578 conf: gaxi::options::ClientConfig,
9579 ) -> crate::ClientBuilderResult<impl super::stub::PublicAdvertisedPrefixes> {
9580 Self::build_transport(conf)
9581 .await
9582 .map(super::tracing::PublicAdvertisedPrefixes::new)
9583 }
9584
9585 /// Announces the specified PublicAdvertisedPrefix
9586 pub fn announce(&self) -> super::builder::public_advertised_prefixes::Announce {
9587 super::builder::public_advertised_prefixes::Announce::new(self.inner.clone())
9588 }
9589
9590 /// Deletes the specified PublicAdvertisedPrefix
9591 pub fn delete(&self) -> super::builder::public_advertised_prefixes::Delete {
9592 super::builder::public_advertised_prefixes::Delete::new(self.inner.clone())
9593 }
9594
9595 /// Returns the specified PublicAdvertisedPrefix resource.
9596 pub fn get(&self) -> super::builder::public_advertised_prefixes::Get {
9597 super::builder::public_advertised_prefixes::Get::new(self.inner.clone())
9598 }
9599
9600 /// Creates a PublicAdvertisedPrefix in the specified project
9601 /// using the parameters that are included in the request.
9602 pub fn insert(&self) -> super::builder::public_advertised_prefixes::Insert {
9603 super::builder::public_advertised_prefixes::Insert::new(self.inner.clone())
9604 }
9605
9606 /// Lists the PublicAdvertisedPrefixes for a project.
9607 pub fn list(&self) -> super::builder::public_advertised_prefixes::List {
9608 super::builder::public_advertised_prefixes::List::new(self.inner.clone())
9609 }
9610
9611 /// Patches the specified Router resource with the data included in the
9612 /// request. This method supportsPATCH
9613 /// semantics and usesJSON merge
9614 /// patch format and processing rules.
9615 pub fn patch(&self) -> super::builder::public_advertised_prefixes::Patch {
9616 super::builder::public_advertised_prefixes::Patch::new(self.inner.clone())
9617 }
9618
9619 /// Withdraws the specified PublicAdvertisedPrefix
9620 pub fn withdraw(&self) -> super::builder::public_advertised_prefixes::Withdraw {
9621 super::builder::public_advertised_prefixes::Withdraw::new(self.inner.clone())
9622 }
9623
9624 /// Retrieves the specified Operations resource.
9625 pub fn get_operation(&self) -> super::builder::public_advertised_prefixes::GetOperation {
9626 super::builder::public_advertised_prefixes::GetOperation::new(self.inner.clone())
9627 }
9628}
9629
9630/// Implements a client for the Google Compute Engine API.
9631///
9632/// # Example
9633/// ```
9634/// # use google_cloud_compute_v1::client::PublicDelegatedPrefixes;
9635/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
9636/// let client = PublicDelegatedPrefixes::builder().build().await?;
9637/// // use `client` to make requests to the Google Compute Engine API.
9638/// # Ok(()) }
9639/// ```
9640///
9641/// # Service Description
9642///
9643/// Service for the `publicDelegatedPrefixes` resource.
9644///
9645/// # Configuration
9646///
9647/// To configure `PublicDelegatedPrefixes` use the `with_*` methods in the type returned
9648/// by [builder()][PublicDelegatedPrefixes::builder]. The default configuration should
9649/// work for most applications. Common configuration changes include
9650///
9651/// * [with_endpoint()]: by default this client uses the global default endpoint
9652/// (`https://compute.googleapis.com`). Applications using regional
9653/// endpoints or running in restricted networks (e.g. a network configured
9654// with [Private Google Access with VPC Service Controls]) may want to
9655/// override this default.
9656/// * [with_credentials()]: by default this client uses
9657/// [Application Default Credentials]. Applications using custom
9658/// authentication may need to override this default.
9659///
9660/// [with_endpoint()]: super::builder::public_delegated_prefixes::ClientBuilder::with_endpoint
9661/// [with_credentials()]: super::builder::public_delegated_prefixes::ClientBuilder::with_credentials
9662/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9663/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9664///
9665/// # Pooling and Cloning
9666///
9667/// `PublicDelegatedPrefixes` holds a connection pool internally, it is advised to
9668/// create one and reuse it. You do not need to wrap `PublicDelegatedPrefixes` in
9669/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9670/// already uses an `Arc` internally.
9671#[cfg(feature = "public-delegated-prefixes")]
9672#[cfg_attr(docsrs, doc(cfg(feature = "public-delegated-prefixes")))]
9673#[derive(Clone, Debug)]
9674pub struct PublicDelegatedPrefixes {
9675 inner: std::sync::Arc<dyn super::stub::dynamic::PublicDelegatedPrefixes>,
9676}
9677
9678#[cfg(feature = "public-delegated-prefixes")]
9679impl PublicDelegatedPrefixes {
9680 /// Returns a builder for [PublicDelegatedPrefixes].
9681 ///
9682 /// ```
9683 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9684 /// # use google_cloud_compute_v1::client::PublicDelegatedPrefixes;
9685 /// let client = PublicDelegatedPrefixes::builder().build().await?;
9686 /// # Ok(()) }
9687 /// ```
9688 pub fn builder() -> super::builder::public_delegated_prefixes::ClientBuilder {
9689 crate::new_client_builder(super::builder::public_delegated_prefixes::client::Factory)
9690 }
9691
9692 /// Creates a new client from the provided stub.
9693 ///
9694 /// The most common case for calling this function is in tests mocking the
9695 /// client's behavior.
9696 pub fn from_stub<T>(stub: T) -> Self
9697 where
9698 T: super::stub::PublicDelegatedPrefixes + 'static,
9699 {
9700 Self {
9701 inner: std::sync::Arc::new(stub),
9702 }
9703 }
9704
9705 pub(crate) async fn new(
9706 config: gaxi::options::ClientConfig,
9707 ) -> crate::ClientBuilderResult<Self> {
9708 let inner = Self::build_inner(config).await?;
9709 Ok(Self { inner })
9710 }
9711
9712 async fn build_inner(
9713 conf: gaxi::options::ClientConfig,
9714 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::PublicDelegatedPrefixes>>
9715 {
9716 if gaxi::options::tracing_enabled(&conf) {
9717 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9718 }
9719 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9720 }
9721
9722 async fn build_transport(
9723 conf: gaxi::options::ClientConfig,
9724 ) -> crate::ClientBuilderResult<impl super::stub::PublicDelegatedPrefixes> {
9725 super::transport::PublicDelegatedPrefixes::new(conf).await
9726 }
9727
9728 async fn build_with_tracing(
9729 conf: gaxi::options::ClientConfig,
9730 ) -> crate::ClientBuilderResult<impl super::stub::PublicDelegatedPrefixes> {
9731 Self::build_transport(conf)
9732 .await
9733 .map(super::tracing::PublicDelegatedPrefixes::new)
9734 }
9735
9736 /// Lists all PublicDelegatedPrefix resources owned by the specific project
9737 /// across all scopes.
9738 ///
9739 /// To prevent failure, Google recommends that you set the
9740 /// `returnPartialSuccess` parameter to `true`.
9741 pub fn aggregated_list(&self) -> super::builder::public_delegated_prefixes::AggregatedList {
9742 super::builder::public_delegated_prefixes::AggregatedList::new(self.inner.clone())
9743 }
9744
9745 /// Announces the specified PublicDelegatedPrefix in the given region.
9746 pub fn announce(&self) -> super::builder::public_delegated_prefixes::Announce {
9747 super::builder::public_delegated_prefixes::Announce::new(self.inner.clone())
9748 }
9749
9750 /// Deletes the specified PublicDelegatedPrefix in the given region.
9751 pub fn delete(&self) -> super::builder::public_delegated_prefixes::Delete {
9752 super::builder::public_delegated_prefixes::Delete::new(self.inner.clone())
9753 }
9754
9755 /// Returns the specified PublicDelegatedPrefix resource in the given region.
9756 pub fn get(&self) -> super::builder::public_delegated_prefixes::Get {
9757 super::builder::public_delegated_prefixes::Get::new(self.inner.clone())
9758 }
9759
9760 /// Creates a PublicDelegatedPrefix in the specified project in the given
9761 /// region using the parameters that are included in the request.
9762 pub fn insert(&self) -> super::builder::public_delegated_prefixes::Insert {
9763 super::builder::public_delegated_prefixes::Insert::new(self.inner.clone())
9764 }
9765
9766 /// Lists the PublicDelegatedPrefixes for a project in the given region.
9767 pub fn list(&self) -> super::builder::public_delegated_prefixes::List {
9768 super::builder::public_delegated_prefixes::List::new(self.inner.clone())
9769 }
9770
9771 /// Patches the specified PublicDelegatedPrefix resource with the data included
9772 /// in the request. This method supportsPATCH
9773 /// semantics and usesJSON merge
9774 /// patch format and processing rules.
9775 pub fn patch(&self) -> super::builder::public_delegated_prefixes::Patch {
9776 super::builder::public_delegated_prefixes::Patch::new(self.inner.clone())
9777 }
9778
9779 /// Withdraws the specified PublicDelegatedPrefix in the given region.
9780 pub fn withdraw(&self) -> super::builder::public_delegated_prefixes::Withdraw {
9781 super::builder::public_delegated_prefixes::Withdraw::new(self.inner.clone())
9782 }
9783
9784 /// Retrieves the specified region-specific Operations resource.
9785 pub fn get_operation(&self) -> super::builder::public_delegated_prefixes::GetOperation {
9786 super::builder::public_delegated_prefixes::GetOperation::new(self.inner.clone())
9787 }
9788}
9789
9790/// Implements a client for the Google Compute Engine API.
9791///
9792/// # Example
9793/// ```
9794/// # use google_cloud_compute_v1::client::RegionAutoscalers;
9795/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
9796/// let client = RegionAutoscalers::builder().build().await?;
9797/// // use `client` to make requests to the Google Compute Engine API.
9798/// # Ok(()) }
9799/// ```
9800///
9801/// # Service Description
9802///
9803/// Service for the `regionAutoscalers` resource.
9804///
9805/// # Configuration
9806///
9807/// To configure `RegionAutoscalers` use the `with_*` methods in the type returned
9808/// by [builder()][RegionAutoscalers::builder]. The default configuration should
9809/// work for most applications. Common configuration changes include
9810///
9811/// * [with_endpoint()]: by default this client uses the global default endpoint
9812/// (`https://compute.googleapis.com`). Applications using regional
9813/// endpoints or running in restricted networks (e.g. a network configured
9814// with [Private Google Access with VPC Service Controls]) may want to
9815/// override this default.
9816/// * [with_credentials()]: by default this client uses
9817/// [Application Default Credentials]. Applications using custom
9818/// authentication may need to override this default.
9819///
9820/// [with_endpoint()]: super::builder::region_autoscalers::ClientBuilder::with_endpoint
9821/// [with_credentials()]: super::builder::region_autoscalers::ClientBuilder::with_credentials
9822/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9823/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9824///
9825/// # Pooling and Cloning
9826///
9827/// `RegionAutoscalers` holds a connection pool internally, it is advised to
9828/// create one and reuse it. You do not need to wrap `RegionAutoscalers` in
9829/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9830/// already uses an `Arc` internally.
9831#[cfg(feature = "region-autoscalers")]
9832#[cfg_attr(docsrs, doc(cfg(feature = "region-autoscalers")))]
9833#[derive(Clone, Debug)]
9834pub struct RegionAutoscalers {
9835 inner: std::sync::Arc<dyn super::stub::dynamic::RegionAutoscalers>,
9836}
9837
9838#[cfg(feature = "region-autoscalers")]
9839impl RegionAutoscalers {
9840 /// Returns a builder for [RegionAutoscalers].
9841 ///
9842 /// ```
9843 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9844 /// # use google_cloud_compute_v1::client::RegionAutoscalers;
9845 /// let client = RegionAutoscalers::builder().build().await?;
9846 /// # Ok(()) }
9847 /// ```
9848 pub fn builder() -> super::builder::region_autoscalers::ClientBuilder {
9849 crate::new_client_builder(super::builder::region_autoscalers::client::Factory)
9850 }
9851
9852 /// Creates a new client from the provided stub.
9853 ///
9854 /// The most common case for calling this function is in tests mocking the
9855 /// client's behavior.
9856 pub fn from_stub<T>(stub: T) -> Self
9857 where
9858 T: super::stub::RegionAutoscalers + 'static,
9859 {
9860 Self {
9861 inner: std::sync::Arc::new(stub),
9862 }
9863 }
9864
9865 pub(crate) async fn new(
9866 config: gaxi::options::ClientConfig,
9867 ) -> crate::ClientBuilderResult<Self> {
9868 let inner = Self::build_inner(config).await?;
9869 Ok(Self { inner })
9870 }
9871
9872 async fn build_inner(
9873 conf: gaxi::options::ClientConfig,
9874 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionAutoscalers>>
9875 {
9876 if gaxi::options::tracing_enabled(&conf) {
9877 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9878 }
9879 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9880 }
9881
9882 async fn build_transport(
9883 conf: gaxi::options::ClientConfig,
9884 ) -> crate::ClientBuilderResult<impl super::stub::RegionAutoscalers> {
9885 super::transport::RegionAutoscalers::new(conf).await
9886 }
9887
9888 async fn build_with_tracing(
9889 conf: gaxi::options::ClientConfig,
9890 ) -> crate::ClientBuilderResult<impl super::stub::RegionAutoscalers> {
9891 Self::build_transport(conf)
9892 .await
9893 .map(super::tracing::RegionAutoscalers::new)
9894 }
9895
9896 /// Deletes the specified autoscaler.
9897 pub fn delete(&self) -> super::builder::region_autoscalers::Delete {
9898 super::builder::region_autoscalers::Delete::new(self.inner.clone())
9899 }
9900
9901 /// Returns the specified autoscaler.
9902 pub fn get(&self) -> super::builder::region_autoscalers::Get {
9903 super::builder::region_autoscalers::Get::new(self.inner.clone())
9904 }
9905
9906 /// Creates an autoscaler in the specified project using
9907 /// the data included in the request.
9908 pub fn insert(&self) -> super::builder::region_autoscalers::Insert {
9909 super::builder::region_autoscalers::Insert::new(self.inner.clone())
9910 }
9911
9912 /// Retrieves a list of autoscalers contained within
9913 /// the specified region.
9914 pub fn list(&self) -> super::builder::region_autoscalers::List {
9915 super::builder::region_autoscalers::List::new(self.inner.clone())
9916 }
9917
9918 /// Updates an autoscaler in the specified project using
9919 /// the data included in the request. This method supportsPATCH
9920 /// semantics and uses theJSON merge
9921 /// patch format and processing rules.
9922 pub fn patch(&self) -> super::builder::region_autoscalers::Patch {
9923 super::builder::region_autoscalers::Patch::new(self.inner.clone())
9924 }
9925
9926 /// Returns permissions that a caller has on the specified resource.
9927 pub fn test_iam_permissions(&self) -> super::builder::region_autoscalers::TestIamPermissions {
9928 super::builder::region_autoscalers::TestIamPermissions::new(self.inner.clone())
9929 }
9930
9931 /// Updates an autoscaler in the specified project using
9932 /// the data included in the request.
9933 pub fn update(&self) -> super::builder::region_autoscalers::Update {
9934 super::builder::region_autoscalers::Update::new(self.inner.clone())
9935 }
9936
9937 /// Retrieves the specified region-specific Operations resource.
9938 pub fn get_operation(&self) -> super::builder::region_autoscalers::GetOperation {
9939 super::builder::region_autoscalers::GetOperation::new(self.inner.clone())
9940 }
9941}
9942
9943/// Implements a client for the Google Compute Engine API.
9944///
9945/// # Example
9946/// ```
9947/// # use google_cloud_compute_v1::client::RegionBackendServices;
9948/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
9949/// let client = RegionBackendServices::builder().build().await?;
9950/// // use `client` to make requests to the Google Compute Engine API.
9951/// # Ok(()) }
9952/// ```
9953///
9954/// # Service Description
9955///
9956/// Service for the `regionBackendServices` resource.
9957///
9958/// # Configuration
9959///
9960/// To configure `RegionBackendServices` use the `with_*` methods in the type returned
9961/// by [builder()][RegionBackendServices::builder]. The default configuration should
9962/// work for most applications. Common configuration changes include
9963///
9964/// * [with_endpoint()]: by default this client uses the global default endpoint
9965/// (`https://compute.googleapis.com`). Applications using regional
9966/// endpoints or running in restricted networks (e.g. a network configured
9967// with [Private Google Access with VPC Service Controls]) may want to
9968/// override this default.
9969/// * [with_credentials()]: by default this client uses
9970/// [Application Default Credentials]. Applications using custom
9971/// authentication may need to override this default.
9972///
9973/// [with_endpoint()]: super::builder::region_backend_services::ClientBuilder::with_endpoint
9974/// [with_credentials()]: super::builder::region_backend_services::ClientBuilder::with_credentials
9975/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9976/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9977///
9978/// # Pooling and Cloning
9979///
9980/// `RegionBackendServices` holds a connection pool internally, it is advised to
9981/// create one and reuse it. You do not need to wrap `RegionBackendServices` in
9982/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9983/// already uses an `Arc` internally.
9984#[cfg(feature = "region-backend-services")]
9985#[cfg_attr(docsrs, doc(cfg(feature = "region-backend-services")))]
9986#[derive(Clone, Debug)]
9987pub struct RegionBackendServices {
9988 inner: std::sync::Arc<dyn super::stub::dynamic::RegionBackendServices>,
9989}
9990
9991#[cfg(feature = "region-backend-services")]
9992impl RegionBackendServices {
9993 /// Returns a builder for [RegionBackendServices].
9994 ///
9995 /// ```
9996 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9997 /// # use google_cloud_compute_v1::client::RegionBackendServices;
9998 /// let client = RegionBackendServices::builder().build().await?;
9999 /// # Ok(()) }
10000 /// ```
10001 pub fn builder() -> super::builder::region_backend_services::ClientBuilder {
10002 crate::new_client_builder(super::builder::region_backend_services::client::Factory)
10003 }
10004
10005 /// Creates a new client from the provided stub.
10006 ///
10007 /// The most common case for calling this function is in tests mocking the
10008 /// client's behavior.
10009 pub fn from_stub<T>(stub: T) -> Self
10010 where
10011 T: super::stub::RegionBackendServices + 'static,
10012 {
10013 Self {
10014 inner: std::sync::Arc::new(stub),
10015 }
10016 }
10017
10018 pub(crate) async fn new(
10019 config: gaxi::options::ClientConfig,
10020 ) -> crate::ClientBuilderResult<Self> {
10021 let inner = Self::build_inner(config).await?;
10022 Ok(Self { inner })
10023 }
10024
10025 async fn build_inner(
10026 conf: gaxi::options::ClientConfig,
10027 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionBackendServices>>
10028 {
10029 if gaxi::options::tracing_enabled(&conf) {
10030 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10031 }
10032 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10033 }
10034
10035 async fn build_transport(
10036 conf: gaxi::options::ClientConfig,
10037 ) -> crate::ClientBuilderResult<impl super::stub::RegionBackendServices> {
10038 super::transport::RegionBackendServices::new(conf).await
10039 }
10040
10041 async fn build_with_tracing(
10042 conf: gaxi::options::ClientConfig,
10043 ) -> crate::ClientBuilderResult<impl super::stub::RegionBackendServices> {
10044 Self::build_transport(conf)
10045 .await
10046 .map(super::tracing::RegionBackendServices::new)
10047 }
10048
10049 /// Deletes the specified regional BackendService resource.
10050 pub fn delete(&self) -> super::builder::region_backend_services::Delete {
10051 super::builder::region_backend_services::Delete::new(self.inner.clone())
10052 }
10053
10054 /// Returns the specified regional BackendService resource.
10055 pub fn get(&self) -> super::builder::region_backend_services::Get {
10056 super::builder::region_backend_services::Get::new(self.inner.clone())
10057 }
10058
10059 /// Gets the most recent health check results for this
10060 /// regional BackendService.
10061 pub fn get_health(&self) -> super::builder::region_backend_services::GetHealth {
10062 super::builder::region_backend_services::GetHealth::new(self.inner.clone())
10063 }
10064
10065 /// Gets the access control policy for a resource. May be empty if no such
10066 /// policy or resource exists.
10067 pub fn get_iam_policy(&self) -> super::builder::region_backend_services::GetIamPolicy {
10068 super::builder::region_backend_services::GetIamPolicy::new(self.inner.clone())
10069 }
10070
10071 /// Creates a regional BackendService resource in the specified project using
10072 /// the data included in the request. For more information, see
10073 /// Backend services overview.
10074 pub fn insert(&self) -> super::builder::region_backend_services::Insert {
10075 super::builder::region_backend_services::Insert::new(self.inner.clone())
10076 }
10077
10078 /// Retrieves the list of regional BackendService resources available to the
10079 /// specified project in the given region.
10080 pub fn list(&self) -> super::builder::region_backend_services::List {
10081 super::builder::region_backend_services::List::new(self.inner.clone())
10082 }
10083
10084 /// Retrieves a list of all usable backend services in the specified project in
10085 /// the given region.
10086 pub fn list_usable(&self) -> super::builder::region_backend_services::ListUsable {
10087 super::builder::region_backend_services::ListUsable::new(self.inner.clone())
10088 }
10089
10090 /// Updates the specified regional BackendService resource with the data
10091 /// included in the request. For more information, see
10092 /// Understanding backend services This method
10093 /// supports PATCH semantics and uses the JSON merge
10094 /// patch format and processing rules.
10095 pub fn patch(&self) -> super::builder::region_backend_services::Patch {
10096 super::builder::region_backend_services::Patch::new(self.inner.clone())
10097 }
10098
10099 /// Sets the access control policy on the specified resource.
10100 /// Replaces any existing policy.
10101 pub fn set_iam_policy(&self) -> super::builder::region_backend_services::SetIamPolicy {
10102 super::builder::region_backend_services::SetIamPolicy::new(self.inner.clone())
10103 }
10104
10105 /// Sets the Google Cloud Armor security policy for the specified backend
10106 /// service. For more information, seeGoogle
10107 /// Cloud Armor Overview
10108 pub fn set_security_policy(
10109 &self,
10110 ) -> super::builder::region_backend_services::SetSecurityPolicy {
10111 super::builder::region_backend_services::SetSecurityPolicy::new(self.inner.clone())
10112 }
10113
10114 /// Returns permissions that a caller has on the specified resource.
10115 pub fn test_iam_permissions(
10116 &self,
10117 ) -> super::builder::region_backend_services::TestIamPermissions {
10118 super::builder::region_backend_services::TestIamPermissions::new(self.inner.clone())
10119 }
10120
10121 /// Updates the specified regional BackendService resource with the data
10122 /// included in the request. For more information,
10123 /// see
10124 /// Backend services overview.
10125 pub fn update(&self) -> super::builder::region_backend_services::Update {
10126 super::builder::region_backend_services::Update::new(self.inner.clone())
10127 }
10128
10129 /// Retrieves the specified region-specific Operations resource.
10130 pub fn get_operation(&self) -> super::builder::region_backend_services::GetOperation {
10131 super::builder::region_backend_services::GetOperation::new(self.inner.clone())
10132 }
10133}
10134
10135/// Implements a client for the Google Compute Engine API.
10136///
10137/// # Example
10138/// ```
10139/// # use google_cloud_compute_v1::client::RegionCommitments;
10140/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
10141/// let client = RegionCommitments::builder().build().await?;
10142/// // use `client` to make requests to the Google Compute Engine API.
10143/// # Ok(()) }
10144/// ```
10145///
10146/// # Service Description
10147///
10148/// Service for the `regionCommitments` resource.
10149///
10150/// # Configuration
10151///
10152/// To configure `RegionCommitments` use the `with_*` methods in the type returned
10153/// by [builder()][RegionCommitments::builder]. The default configuration should
10154/// work for most applications. Common configuration changes include
10155///
10156/// * [with_endpoint()]: by default this client uses the global default endpoint
10157/// (`https://compute.googleapis.com`). Applications using regional
10158/// endpoints or running in restricted networks (e.g. a network configured
10159// with [Private Google Access with VPC Service Controls]) may want to
10160/// override this default.
10161/// * [with_credentials()]: by default this client uses
10162/// [Application Default Credentials]. Applications using custom
10163/// authentication may need to override this default.
10164///
10165/// [with_endpoint()]: super::builder::region_commitments::ClientBuilder::with_endpoint
10166/// [with_credentials()]: super::builder::region_commitments::ClientBuilder::with_credentials
10167/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10168/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10169///
10170/// # Pooling and Cloning
10171///
10172/// `RegionCommitments` holds a connection pool internally, it is advised to
10173/// create one and reuse it. You do not need to wrap `RegionCommitments` in
10174/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10175/// already uses an `Arc` internally.
10176#[cfg(feature = "region-commitments")]
10177#[cfg_attr(docsrs, doc(cfg(feature = "region-commitments")))]
10178#[derive(Clone, Debug)]
10179pub struct RegionCommitments {
10180 inner: std::sync::Arc<dyn super::stub::dynamic::RegionCommitments>,
10181}
10182
10183#[cfg(feature = "region-commitments")]
10184impl RegionCommitments {
10185 /// Returns a builder for [RegionCommitments].
10186 ///
10187 /// ```
10188 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10189 /// # use google_cloud_compute_v1::client::RegionCommitments;
10190 /// let client = RegionCommitments::builder().build().await?;
10191 /// # Ok(()) }
10192 /// ```
10193 pub fn builder() -> super::builder::region_commitments::ClientBuilder {
10194 crate::new_client_builder(super::builder::region_commitments::client::Factory)
10195 }
10196
10197 /// Creates a new client from the provided stub.
10198 ///
10199 /// The most common case for calling this function is in tests mocking the
10200 /// client's behavior.
10201 pub fn from_stub<T>(stub: T) -> Self
10202 where
10203 T: super::stub::RegionCommitments + 'static,
10204 {
10205 Self {
10206 inner: std::sync::Arc::new(stub),
10207 }
10208 }
10209
10210 pub(crate) async fn new(
10211 config: gaxi::options::ClientConfig,
10212 ) -> crate::ClientBuilderResult<Self> {
10213 let inner = Self::build_inner(config).await?;
10214 Ok(Self { inner })
10215 }
10216
10217 async fn build_inner(
10218 conf: gaxi::options::ClientConfig,
10219 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionCommitments>>
10220 {
10221 if gaxi::options::tracing_enabled(&conf) {
10222 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10223 }
10224 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10225 }
10226
10227 async fn build_transport(
10228 conf: gaxi::options::ClientConfig,
10229 ) -> crate::ClientBuilderResult<impl super::stub::RegionCommitments> {
10230 super::transport::RegionCommitments::new(conf).await
10231 }
10232
10233 async fn build_with_tracing(
10234 conf: gaxi::options::ClientConfig,
10235 ) -> crate::ClientBuilderResult<impl super::stub::RegionCommitments> {
10236 Self::build_transport(conf)
10237 .await
10238 .map(super::tracing::RegionCommitments::new)
10239 }
10240
10241 /// Retrieves an aggregated list of commitments by region.
10242 ///
10243 /// To prevent failure, it is recommended that you set the
10244 /// `returnPartialSuccess` parameter to `true`.
10245 pub fn aggregated_list(&self) -> super::builder::region_commitments::AggregatedList {
10246 super::builder::region_commitments::AggregatedList::new(self.inner.clone())
10247 }
10248
10249 /// Returns the specified commitment resource.
10250 pub fn get(&self) -> super::builder::region_commitments::Get {
10251 super::builder::region_commitments::Get::new(self.inner.clone())
10252 }
10253
10254 /// Creates a commitment in the specified project using the data
10255 /// included in the request.
10256 pub fn insert(&self) -> super::builder::region_commitments::Insert {
10257 super::builder::region_commitments::Insert::new(self.inner.clone())
10258 }
10259
10260 /// Retrieves a list of commitments contained within
10261 /// the specified region.
10262 pub fn list(&self) -> super::builder::region_commitments::List {
10263 super::builder::region_commitments::List::new(self.inner.clone())
10264 }
10265
10266 /// Updates the specified commitment with the data included in the request.
10267 /// Update is performed only on selected fields included as part of
10268 /// update-mask. Only the following fields can be updated: auto_renew and plan.
10269 pub fn update(&self) -> super::builder::region_commitments::Update {
10270 super::builder::region_commitments::Update::new(self.inner.clone())
10271 }
10272
10273 /// Retrieves the specified region-specific Operations resource.
10274 pub fn get_operation(&self) -> super::builder::region_commitments::GetOperation {
10275 super::builder::region_commitments::GetOperation::new(self.inner.clone())
10276 }
10277}
10278
10279/// Implements a client for the Google Compute Engine API.
10280///
10281/// # Example
10282/// ```
10283/// # use google_cloud_compute_v1::client::RegionCompositeHealthChecks;
10284/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
10285/// let client = RegionCompositeHealthChecks::builder().build().await?;
10286/// // use `client` to make requests to the Google Compute Engine API.
10287/// # Ok(()) }
10288/// ```
10289///
10290/// # Service Description
10291///
10292/// Service for the `regionCompositeHealthChecks` resource.
10293///
10294/// # Configuration
10295///
10296/// To configure `RegionCompositeHealthChecks` use the `with_*` methods in the type returned
10297/// by [builder()][RegionCompositeHealthChecks::builder]. The default configuration should
10298/// work for most applications. Common configuration changes include
10299///
10300/// * [with_endpoint()]: by default this client uses the global default endpoint
10301/// (`https://compute.googleapis.com`). Applications using regional
10302/// endpoints or running in restricted networks (e.g. a network configured
10303// with [Private Google Access with VPC Service Controls]) may want to
10304/// override this default.
10305/// * [with_credentials()]: by default this client uses
10306/// [Application Default Credentials]. Applications using custom
10307/// authentication may need to override this default.
10308///
10309/// [with_endpoint()]: super::builder::region_composite_health_checks::ClientBuilder::with_endpoint
10310/// [with_credentials()]: super::builder::region_composite_health_checks::ClientBuilder::with_credentials
10311/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10312/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10313///
10314/// # Pooling and Cloning
10315///
10316/// `RegionCompositeHealthChecks` holds a connection pool internally, it is advised to
10317/// create one and reuse it. You do not need to wrap `RegionCompositeHealthChecks` in
10318/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10319/// already uses an `Arc` internally.
10320#[cfg(feature = "region-composite-health-checks")]
10321#[cfg_attr(docsrs, doc(cfg(feature = "region-composite-health-checks")))]
10322#[derive(Clone, Debug)]
10323pub struct RegionCompositeHealthChecks {
10324 inner: std::sync::Arc<dyn super::stub::dynamic::RegionCompositeHealthChecks>,
10325}
10326
10327#[cfg(feature = "region-composite-health-checks")]
10328impl RegionCompositeHealthChecks {
10329 /// Returns a builder for [RegionCompositeHealthChecks].
10330 ///
10331 /// ```
10332 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10333 /// # use google_cloud_compute_v1::client::RegionCompositeHealthChecks;
10334 /// let client = RegionCompositeHealthChecks::builder().build().await?;
10335 /// # Ok(()) }
10336 /// ```
10337 pub fn builder() -> super::builder::region_composite_health_checks::ClientBuilder {
10338 crate::new_client_builder(super::builder::region_composite_health_checks::client::Factory)
10339 }
10340
10341 /// Creates a new client from the provided stub.
10342 ///
10343 /// The most common case for calling this function is in tests mocking the
10344 /// client's behavior.
10345 pub fn from_stub<T>(stub: T) -> Self
10346 where
10347 T: super::stub::RegionCompositeHealthChecks + 'static,
10348 {
10349 Self {
10350 inner: std::sync::Arc::new(stub),
10351 }
10352 }
10353
10354 pub(crate) async fn new(
10355 config: gaxi::options::ClientConfig,
10356 ) -> crate::ClientBuilderResult<Self> {
10357 let inner = Self::build_inner(config).await?;
10358 Ok(Self { inner })
10359 }
10360
10361 async fn build_inner(
10362 conf: gaxi::options::ClientConfig,
10363 ) -> crate::ClientBuilderResult<
10364 std::sync::Arc<dyn super::stub::dynamic::RegionCompositeHealthChecks>,
10365 > {
10366 if gaxi::options::tracing_enabled(&conf) {
10367 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10368 }
10369 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10370 }
10371
10372 async fn build_transport(
10373 conf: gaxi::options::ClientConfig,
10374 ) -> crate::ClientBuilderResult<impl super::stub::RegionCompositeHealthChecks> {
10375 super::transport::RegionCompositeHealthChecks::new(conf).await
10376 }
10377
10378 async fn build_with_tracing(
10379 conf: gaxi::options::ClientConfig,
10380 ) -> crate::ClientBuilderResult<impl super::stub::RegionCompositeHealthChecks> {
10381 Self::build_transport(conf)
10382 .await
10383 .map(super::tracing::RegionCompositeHealthChecks::new)
10384 }
10385
10386 /// Retrieves the list of all CompositeHealthCheck resources (all
10387 /// regional) available to the specified project.
10388 ///
10389 /// To prevent failure, it is recommended that you set the
10390 /// `returnPartialSuccess` parameter to `true`.
10391 pub fn aggregated_list(
10392 &self,
10393 ) -> super::builder::region_composite_health_checks::AggregatedList {
10394 super::builder::region_composite_health_checks::AggregatedList::new(self.inner.clone())
10395 }
10396
10397 /// Deletes the specified CompositeHealthCheck in the given region
10398 pub fn delete(&self) -> super::builder::region_composite_health_checks::Delete {
10399 super::builder::region_composite_health_checks::Delete::new(self.inner.clone())
10400 }
10401
10402 /// Returns the specified CompositeHealthCheck resource in the given region.
10403 pub fn get(&self) -> super::builder::region_composite_health_checks::Get {
10404 super::builder::region_composite_health_checks::Get::new(self.inner.clone())
10405 }
10406
10407 /// Create a CompositeHealthCheck in the specified project in the given region
10408 /// using the parameters that are included in the request.
10409 pub fn insert(&self) -> super::builder::region_composite_health_checks::Insert {
10410 super::builder::region_composite_health_checks::Insert::new(self.inner.clone())
10411 }
10412
10413 /// Lists the CompositeHealthChecks for a project in the given region.
10414 pub fn list(&self) -> super::builder::region_composite_health_checks::List {
10415 super::builder::region_composite_health_checks::List::new(self.inner.clone())
10416 }
10417
10418 /// Updates the specified regional CompositeHealthCheck resource
10419 /// with the data included in the request. This method supportsPATCH
10420 /// semantics and uses theJSON merge
10421 /// patch format and processing rules.
10422 pub fn patch(&self) -> super::builder::region_composite_health_checks::Patch {
10423 super::builder::region_composite_health_checks::Patch::new(self.inner.clone())
10424 }
10425
10426 /// Returns permissions that a caller has on the specified resource.
10427 pub fn test_iam_permissions(
10428 &self,
10429 ) -> super::builder::region_composite_health_checks::TestIamPermissions {
10430 super::builder::region_composite_health_checks::TestIamPermissions::new(self.inner.clone())
10431 }
10432
10433 /// Retrieves the specified region-specific Operations resource.
10434 pub fn get_operation(&self) -> super::builder::region_composite_health_checks::GetOperation {
10435 super::builder::region_composite_health_checks::GetOperation::new(self.inner.clone())
10436 }
10437}
10438
10439/// Implements a client for the Google Compute Engine API.
10440///
10441/// # Example
10442/// ```
10443/// # use google_cloud_compute_v1::client::RegionDiskTypes;
10444/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
10445/// let client = RegionDiskTypes::builder().build().await?;
10446/// // use `client` to make requests to the Google Compute Engine API.
10447/// # Ok(()) }
10448/// ```
10449///
10450/// # Service Description
10451///
10452/// Service for the `regionDiskTypes` resource.
10453///
10454/// # Configuration
10455///
10456/// To configure `RegionDiskTypes` use the `with_*` methods in the type returned
10457/// by [builder()][RegionDiskTypes::builder]. The default configuration should
10458/// work for most applications. Common configuration changes include
10459///
10460/// * [with_endpoint()]: by default this client uses the global default endpoint
10461/// (`https://compute.googleapis.com`). Applications using regional
10462/// endpoints or running in restricted networks (e.g. a network configured
10463// with [Private Google Access with VPC Service Controls]) may want to
10464/// override this default.
10465/// * [with_credentials()]: by default this client uses
10466/// [Application Default Credentials]. Applications using custom
10467/// authentication may need to override this default.
10468///
10469/// [with_endpoint()]: super::builder::region_disk_types::ClientBuilder::with_endpoint
10470/// [with_credentials()]: super::builder::region_disk_types::ClientBuilder::with_credentials
10471/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10472/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10473///
10474/// # Pooling and Cloning
10475///
10476/// `RegionDiskTypes` holds a connection pool internally, it is advised to
10477/// create one and reuse it. You do not need to wrap `RegionDiskTypes` in
10478/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10479/// already uses an `Arc` internally.
10480#[cfg(feature = "region-disk-types")]
10481#[cfg_attr(docsrs, doc(cfg(feature = "region-disk-types")))]
10482#[derive(Clone, Debug)]
10483pub struct RegionDiskTypes {
10484 inner: std::sync::Arc<dyn super::stub::dynamic::RegionDiskTypes>,
10485}
10486
10487#[cfg(feature = "region-disk-types")]
10488impl RegionDiskTypes {
10489 /// Returns a builder for [RegionDiskTypes].
10490 ///
10491 /// ```
10492 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10493 /// # use google_cloud_compute_v1::client::RegionDiskTypes;
10494 /// let client = RegionDiskTypes::builder().build().await?;
10495 /// # Ok(()) }
10496 /// ```
10497 pub fn builder() -> super::builder::region_disk_types::ClientBuilder {
10498 crate::new_client_builder(super::builder::region_disk_types::client::Factory)
10499 }
10500
10501 /// Creates a new client from the provided stub.
10502 ///
10503 /// The most common case for calling this function is in tests mocking the
10504 /// client's behavior.
10505 pub fn from_stub<T>(stub: T) -> Self
10506 where
10507 T: super::stub::RegionDiskTypes + 'static,
10508 {
10509 Self {
10510 inner: std::sync::Arc::new(stub),
10511 }
10512 }
10513
10514 pub(crate) async fn new(
10515 config: gaxi::options::ClientConfig,
10516 ) -> crate::ClientBuilderResult<Self> {
10517 let inner = Self::build_inner(config).await?;
10518 Ok(Self { inner })
10519 }
10520
10521 async fn build_inner(
10522 conf: gaxi::options::ClientConfig,
10523 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionDiskTypes>> {
10524 if gaxi::options::tracing_enabled(&conf) {
10525 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10526 }
10527 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10528 }
10529
10530 async fn build_transport(
10531 conf: gaxi::options::ClientConfig,
10532 ) -> crate::ClientBuilderResult<impl super::stub::RegionDiskTypes> {
10533 super::transport::RegionDiskTypes::new(conf).await
10534 }
10535
10536 async fn build_with_tracing(
10537 conf: gaxi::options::ClientConfig,
10538 ) -> crate::ClientBuilderResult<impl super::stub::RegionDiskTypes> {
10539 Self::build_transport(conf)
10540 .await
10541 .map(super::tracing::RegionDiskTypes::new)
10542 }
10543
10544 /// Returns the specified regional disk type.
10545 pub fn get(&self) -> super::builder::region_disk_types::Get {
10546 super::builder::region_disk_types::Get::new(self.inner.clone())
10547 }
10548
10549 /// Retrieves a list of regional disk types available to the specified project.
10550 pub fn list(&self) -> super::builder::region_disk_types::List {
10551 super::builder::region_disk_types::List::new(self.inner.clone())
10552 }
10553}
10554
10555/// Implements a client for the Google Compute Engine API.
10556///
10557/// # Example
10558/// ```
10559/// # use google_cloud_compute_v1::client::RegionDisks;
10560/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
10561/// let client = RegionDisks::builder().build().await?;
10562/// // use `client` to make requests to the Google Compute Engine API.
10563/// # Ok(()) }
10564/// ```
10565///
10566/// # Service Description
10567///
10568/// Service for the `regionDisks` resource.
10569///
10570/// # Configuration
10571///
10572/// To configure `RegionDisks` use the `with_*` methods in the type returned
10573/// by [builder()][RegionDisks::builder]. The default configuration should
10574/// work for most applications. Common configuration changes include
10575///
10576/// * [with_endpoint()]: by default this client uses the global default endpoint
10577/// (`https://compute.googleapis.com`). Applications using regional
10578/// endpoints or running in restricted networks (e.g. a network configured
10579// with [Private Google Access with VPC Service Controls]) may want to
10580/// override this default.
10581/// * [with_credentials()]: by default this client uses
10582/// [Application Default Credentials]. Applications using custom
10583/// authentication may need to override this default.
10584///
10585/// [with_endpoint()]: super::builder::region_disks::ClientBuilder::with_endpoint
10586/// [with_credentials()]: super::builder::region_disks::ClientBuilder::with_credentials
10587/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10588/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10589///
10590/// # Pooling and Cloning
10591///
10592/// `RegionDisks` holds a connection pool internally, it is advised to
10593/// create one and reuse it. You do not need to wrap `RegionDisks` in
10594/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10595/// already uses an `Arc` internally.
10596#[cfg(feature = "region-disks")]
10597#[cfg_attr(docsrs, doc(cfg(feature = "region-disks")))]
10598#[derive(Clone, Debug)]
10599pub struct RegionDisks {
10600 inner: std::sync::Arc<dyn super::stub::dynamic::RegionDisks>,
10601}
10602
10603#[cfg(feature = "region-disks")]
10604impl RegionDisks {
10605 /// Returns a builder for [RegionDisks].
10606 ///
10607 /// ```
10608 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10609 /// # use google_cloud_compute_v1::client::RegionDisks;
10610 /// let client = RegionDisks::builder().build().await?;
10611 /// # Ok(()) }
10612 /// ```
10613 pub fn builder() -> super::builder::region_disks::ClientBuilder {
10614 crate::new_client_builder(super::builder::region_disks::client::Factory)
10615 }
10616
10617 /// Creates a new client from the provided stub.
10618 ///
10619 /// The most common case for calling this function is in tests mocking the
10620 /// client's behavior.
10621 pub fn from_stub<T>(stub: T) -> Self
10622 where
10623 T: super::stub::RegionDisks + 'static,
10624 {
10625 Self {
10626 inner: std::sync::Arc::new(stub),
10627 }
10628 }
10629
10630 pub(crate) async fn new(
10631 config: gaxi::options::ClientConfig,
10632 ) -> crate::ClientBuilderResult<Self> {
10633 let inner = Self::build_inner(config).await?;
10634 Ok(Self { inner })
10635 }
10636
10637 async fn build_inner(
10638 conf: gaxi::options::ClientConfig,
10639 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionDisks>> {
10640 if gaxi::options::tracing_enabled(&conf) {
10641 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10642 }
10643 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10644 }
10645
10646 async fn build_transport(
10647 conf: gaxi::options::ClientConfig,
10648 ) -> crate::ClientBuilderResult<impl super::stub::RegionDisks> {
10649 super::transport::RegionDisks::new(conf).await
10650 }
10651
10652 async fn build_with_tracing(
10653 conf: gaxi::options::ClientConfig,
10654 ) -> crate::ClientBuilderResult<impl super::stub::RegionDisks> {
10655 Self::build_transport(conf)
10656 .await
10657 .map(super::tracing::RegionDisks::new)
10658 }
10659
10660 /// Adds existing resource policies to a regional disk. You can only add one
10661 /// policy which will be applied to this disk for scheduling snapshot
10662 /// creation.
10663 pub fn add_resource_policies(&self) -> super::builder::region_disks::AddResourcePolicies {
10664 super::builder::region_disks::AddResourcePolicies::new(self.inner.clone())
10665 }
10666
10667 /// Bulk create a set of disks.
10668 pub fn bulk_insert(&self) -> super::builder::region_disks::BulkInsert {
10669 super::builder::region_disks::BulkInsert::new(self.inner.clone())
10670 }
10671
10672 /// Creates a snapshot of a specified persistent disk. For regular snapshot
10673 /// creation, consider using snapshots.insert
10674 /// instead, as that method supports more features, such as creating snapshots
10675 /// in a project different from the source disk project.
10676 pub fn create_snapshot(&self) -> super::builder::region_disks::CreateSnapshot {
10677 super::builder::region_disks::CreateSnapshot::new(self.inner.clone())
10678 }
10679
10680 /// Deletes the specified regional persistent disk. Deleting a regional disk
10681 /// removes all the replicas of its data permanently and is irreversible.
10682 /// However, deleting a disk does not delete anysnapshots
10683 /// previously made from the disk. You must separatelydelete
10684 /// snapshots.
10685 pub fn delete(&self) -> super::builder::region_disks::Delete {
10686 super::builder::region_disks::Delete::new(self.inner.clone())
10687 }
10688
10689 /// Returns a specified regional persistent disk.
10690 pub fn get(&self) -> super::builder::region_disks::Get {
10691 super::builder::region_disks::Get::new(self.inner.clone())
10692 }
10693
10694 /// Gets the access control policy for a resource. May be empty if no such
10695 /// policy or resource exists.
10696 pub fn get_iam_policy(&self) -> super::builder::region_disks::GetIamPolicy {
10697 super::builder::region_disks::GetIamPolicy::new(self.inner.clone())
10698 }
10699
10700 /// Creates a persistent regional disk in the specified project using the data
10701 /// included in the request.
10702 pub fn insert(&self) -> super::builder::region_disks::Insert {
10703 super::builder::region_disks::Insert::new(self.inner.clone())
10704 }
10705
10706 /// Retrieves the list of persistent disks contained within
10707 /// the specified region.
10708 pub fn list(&self) -> super::builder::region_disks::List {
10709 super::builder::region_disks::List::new(self.inner.clone())
10710 }
10711
10712 /// Removes resource policies from a regional disk.
10713 pub fn remove_resource_policies(&self) -> super::builder::region_disks::RemoveResourcePolicies {
10714 super::builder::region_disks::RemoveResourcePolicies::new(self.inner.clone())
10715 }
10716
10717 /// Resizes the specified regional persistent disk.
10718 pub fn resize(&self) -> super::builder::region_disks::Resize {
10719 super::builder::region_disks::Resize::new(self.inner.clone())
10720 }
10721
10722 /// Sets the access control policy on the specified resource.
10723 /// Replaces any existing policy.
10724 pub fn set_iam_policy(&self) -> super::builder::region_disks::SetIamPolicy {
10725 super::builder::region_disks::SetIamPolicy::new(self.inner.clone())
10726 }
10727
10728 /// Sets the labels on the target regional disk.
10729 pub fn set_labels(&self) -> super::builder::region_disks::SetLabels {
10730 super::builder::region_disks::SetLabels::new(self.inner.clone())
10731 }
10732
10733 /// Starts asynchronous replication.
10734 /// Must be invoked on the primary disk.
10735 pub fn start_async_replication(&self) -> super::builder::region_disks::StartAsyncReplication {
10736 super::builder::region_disks::StartAsyncReplication::new(self.inner.clone())
10737 }
10738
10739 /// Stops asynchronous replication.
10740 /// Can be invoked either on the primary or on the secondary disk.
10741 pub fn stop_async_replication(&self) -> super::builder::region_disks::StopAsyncReplication {
10742 super::builder::region_disks::StopAsyncReplication::new(self.inner.clone())
10743 }
10744
10745 /// Stops asynchronous replication for a consistency group of disks.
10746 /// Can be invoked either in the primary or secondary scope.
10747 pub fn stop_group_async_replication(
10748 &self,
10749 ) -> super::builder::region_disks::StopGroupAsyncReplication {
10750 super::builder::region_disks::StopGroupAsyncReplication::new(self.inner.clone())
10751 }
10752
10753 /// Returns permissions that a caller has on the specified resource.
10754 pub fn test_iam_permissions(&self) -> super::builder::region_disks::TestIamPermissions {
10755 super::builder::region_disks::TestIamPermissions::new(self.inner.clone())
10756 }
10757
10758 /// Update the specified disk with the data included in the request. Update is
10759 /// performed only on selected fields included as part of update-mask.
10760 pub fn update(&self) -> super::builder::region_disks::Update {
10761 super::builder::region_disks::Update::new(self.inner.clone())
10762 }
10763
10764 /// Retrieves the specified region-specific Operations resource.
10765 pub fn get_operation(&self) -> super::builder::region_disks::GetOperation {
10766 super::builder::region_disks::GetOperation::new(self.inner.clone())
10767 }
10768}
10769
10770/// Implements a client for the Google Compute Engine API.
10771///
10772/// # Example
10773/// ```
10774/// # use google_cloud_compute_v1::client::RegionHealthAggregationPolicies;
10775/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
10776/// let client = RegionHealthAggregationPolicies::builder().build().await?;
10777/// // use `client` to make requests to the Google Compute Engine API.
10778/// # Ok(()) }
10779/// ```
10780///
10781/// # Service Description
10782///
10783/// Service for the `regionHealthAggregationPolicies` resource.
10784///
10785/// # Configuration
10786///
10787/// To configure `RegionHealthAggregationPolicies` use the `with_*` methods in the type returned
10788/// by [builder()][RegionHealthAggregationPolicies::builder]. The default configuration should
10789/// work for most applications. Common configuration changes include
10790///
10791/// * [with_endpoint()]: by default this client uses the global default endpoint
10792/// (`https://compute.googleapis.com`). Applications using regional
10793/// endpoints or running in restricted networks (e.g. a network configured
10794// with [Private Google Access with VPC Service Controls]) may want to
10795/// override this default.
10796/// * [with_credentials()]: by default this client uses
10797/// [Application Default Credentials]. Applications using custom
10798/// authentication may need to override this default.
10799///
10800/// [with_endpoint()]: super::builder::region_health_aggregation_policies::ClientBuilder::with_endpoint
10801/// [with_credentials()]: super::builder::region_health_aggregation_policies::ClientBuilder::with_credentials
10802/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10803/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10804///
10805/// # Pooling and Cloning
10806///
10807/// `RegionHealthAggregationPolicies` holds a connection pool internally, it is advised to
10808/// create one and reuse it. You do not need to wrap `RegionHealthAggregationPolicies` in
10809/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10810/// already uses an `Arc` internally.
10811#[cfg(feature = "region-health-aggregation-policies")]
10812#[cfg_attr(docsrs, doc(cfg(feature = "region-health-aggregation-policies")))]
10813#[derive(Clone, Debug)]
10814pub struct RegionHealthAggregationPolicies {
10815 inner: std::sync::Arc<dyn super::stub::dynamic::RegionHealthAggregationPolicies>,
10816}
10817
10818#[cfg(feature = "region-health-aggregation-policies")]
10819impl RegionHealthAggregationPolicies {
10820 /// Returns a builder for [RegionHealthAggregationPolicies].
10821 ///
10822 /// ```
10823 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10824 /// # use google_cloud_compute_v1::client::RegionHealthAggregationPolicies;
10825 /// let client = RegionHealthAggregationPolicies::builder().build().await?;
10826 /// # Ok(()) }
10827 /// ```
10828 pub fn builder() -> super::builder::region_health_aggregation_policies::ClientBuilder {
10829 crate::new_client_builder(
10830 super::builder::region_health_aggregation_policies::client::Factory,
10831 )
10832 }
10833
10834 /// Creates a new client from the provided stub.
10835 ///
10836 /// The most common case for calling this function is in tests mocking the
10837 /// client's behavior.
10838 pub fn from_stub<T>(stub: T) -> Self
10839 where
10840 T: super::stub::RegionHealthAggregationPolicies + 'static,
10841 {
10842 Self {
10843 inner: std::sync::Arc::new(stub),
10844 }
10845 }
10846
10847 pub(crate) async fn new(
10848 config: gaxi::options::ClientConfig,
10849 ) -> crate::ClientBuilderResult<Self> {
10850 let inner = Self::build_inner(config).await?;
10851 Ok(Self { inner })
10852 }
10853
10854 async fn build_inner(
10855 conf: gaxi::options::ClientConfig,
10856 ) -> crate::ClientBuilderResult<
10857 std::sync::Arc<dyn super::stub::dynamic::RegionHealthAggregationPolicies>,
10858 > {
10859 if gaxi::options::tracing_enabled(&conf) {
10860 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10861 }
10862 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10863 }
10864
10865 async fn build_transport(
10866 conf: gaxi::options::ClientConfig,
10867 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthAggregationPolicies> {
10868 super::transport::RegionHealthAggregationPolicies::new(conf).await
10869 }
10870
10871 async fn build_with_tracing(
10872 conf: gaxi::options::ClientConfig,
10873 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthAggregationPolicies> {
10874 Self::build_transport(conf)
10875 .await
10876 .map(super::tracing::RegionHealthAggregationPolicies::new)
10877 }
10878
10879 /// Retrieves the list of all HealthAggregationPolicy resources,
10880 /// regional and global, available to the specified project.
10881 ///
10882 /// To prevent failure, it is recommended that you set the
10883 /// `returnPartialSuccess` parameter to `true`.
10884 pub fn aggregated_list(
10885 &self,
10886 ) -> super::builder::region_health_aggregation_policies::AggregatedList {
10887 super::builder::region_health_aggregation_policies::AggregatedList::new(self.inner.clone())
10888 }
10889
10890 /// Deletes the specified HealthAggregationPolicy in the given region.
10891 pub fn delete(&self) -> super::builder::region_health_aggregation_policies::Delete {
10892 super::builder::region_health_aggregation_policies::Delete::new(self.inner.clone())
10893 }
10894
10895 /// Returns the specified HealthAggregationPolicy resource in the given region.
10896 pub fn get(&self) -> super::builder::region_health_aggregation_policies::Get {
10897 super::builder::region_health_aggregation_policies::Get::new(self.inner.clone())
10898 }
10899
10900 /// Create a HealthAggregationPolicy in the specified project in the given
10901 /// region using the parameters that are included in the request.
10902 pub fn insert(&self) -> super::builder::region_health_aggregation_policies::Insert {
10903 super::builder::region_health_aggregation_policies::Insert::new(self.inner.clone())
10904 }
10905
10906 /// Lists the HealthAggregationPolicies for a project in the given region.
10907 pub fn list(&self) -> super::builder::region_health_aggregation_policies::List {
10908 super::builder::region_health_aggregation_policies::List::new(self.inner.clone())
10909 }
10910
10911 /// Updates the specified regional HealthAggregationPolicy
10912 /// resource with the data included in the request. This method supportsPATCH
10913 /// semantics and uses theJSON merge
10914 /// patch format and processing rules.
10915 pub fn patch(&self) -> super::builder::region_health_aggregation_policies::Patch {
10916 super::builder::region_health_aggregation_policies::Patch::new(self.inner.clone())
10917 }
10918
10919 /// Returns permissions that a caller has on the specified resource.
10920 pub fn test_iam_permissions(
10921 &self,
10922 ) -> super::builder::region_health_aggregation_policies::TestIamPermissions {
10923 super::builder::region_health_aggregation_policies::TestIamPermissions::new(
10924 self.inner.clone(),
10925 )
10926 }
10927
10928 /// Retrieves the specified region-specific Operations resource.
10929 pub fn get_operation(
10930 &self,
10931 ) -> super::builder::region_health_aggregation_policies::GetOperation {
10932 super::builder::region_health_aggregation_policies::GetOperation::new(self.inner.clone())
10933 }
10934}
10935
10936/// Implements a client for the Google Compute Engine API.
10937///
10938/// # Example
10939/// ```
10940/// # use google_cloud_compute_v1::client::RegionHealthCheckServices;
10941/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
10942/// let client = RegionHealthCheckServices::builder().build().await?;
10943/// // use `client` to make requests to the Google Compute Engine API.
10944/// # Ok(()) }
10945/// ```
10946///
10947/// # Service Description
10948///
10949/// Service for the `regionHealthCheckServices` resource.
10950///
10951/// # Configuration
10952///
10953/// To configure `RegionHealthCheckServices` use the `with_*` methods in the type returned
10954/// by [builder()][RegionHealthCheckServices::builder]. The default configuration should
10955/// work for most applications. Common configuration changes include
10956///
10957/// * [with_endpoint()]: by default this client uses the global default endpoint
10958/// (`https://compute.googleapis.com`). Applications using regional
10959/// endpoints or running in restricted networks (e.g. a network configured
10960// with [Private Google Access with VPC Service Controls]) may want to
10961/// override this default.
10962/// * [with_credentials()]: by default this client uses
10963/// [Application Default Credentials]. Applications using custom
10964/// authentication may need to override this default.
10965///
10966/// [with_endpoint()]: super::builder::region_health_check_services::ClientBuilder::with_endpoint
10967/// [with_credentials()]: super::builder::region_health_check_services::ClientBuilder::with_credentials
10968/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10969/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10970///
10971/// # Pooling and Cloning
10972///
10973/// `RegionHealthCheckServices` holds a connection pool internally, it is advised to
10974/// create one and reuse it. You do not need to wrap `RegionHealthCheckServices` in
10975/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10976/// already uses an `Arc` internally.
10977#[cfg(feature = "region-health-check-services")]
10978#[cfg_attr(docsrs, doc(cfg(feature = "region-health-check-services")))]
10979#[derive(Clone, Debug)]
10980pub struct RegionHealthCheckServices {
10981 inner: std::sync::Arc<dyn super::stub::dynamic::RegionHealthCheckServices>,
10982}
10983
10984#[cfg(feature = "region-health-check-services")]
10985impl RegionHealthCheckServices {
10986 /// Returns a builder for [RegionHealthCheckServices].
10987 ///
10988 /// ```
10989 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10990 /// # use google_cloud_compute_v1::client::RegionHealthCheckServices;
10991 /// let client = RegionHealthCheckServices::builder().build().await?;
10992 /// # Ok(()) }
10993 /// ```
10994 pub fn builder() -> super::builder::region_health_check_services::ClientBuilder {
10995 crate::new_client_builder(super::builder::region_health_check_services::client::Factory)
10996 }
10997
10998 /// Creates a new client from the provided stub.
10999 ///
11000 /// The most common case for calling this function is in tests mocking the
11001 /// client's behavior.
11002 pub fn from_stub<T>(stub: T) -> Self
11003 where
11004 T: super::stub::RegionHealthCheckServices + 'static,
11005 {
11006 Self {
11007 inner: std::sync::Arc::new(stub),
11008 }
11009 }
11010
11011 pub(crate) async fn new(
11012 config: gaxi::options::ClientConfig,
11013 ) -> crate::ClientBuilderResult<Self> {
11014 let inner = Self::build_inner(config).await?;
11015 Ok(Self { inner })
11016 }
11017
11018 async fn build_inner(
11019 conf: gaxi::options::ClientConfig,
11020 ) -> crate::ClientBuilderResult<
11021 std::sync::Arc<dyn super::stub::dynamic::RegionHealthCheckServices>,
11022 > {
11023 if gaxi::options::tracing_enabled(&conf) {
11024 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11025 }
11026 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11027 }
11028
11029 async fn build_transport(
11030 conf: gaxi::options::ClientConfig,
11031 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthCheckServices> {
11032 super::transport::RegionHealthCheckServices::new(conf).await
11033 }
11034
11035 async fn build_with_tracing(
11036 conf: gaxi::options::ClientConfig,
11037 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthCheckServices> {
11038 Self::build_transport(conf)
11039 .await
11040 .map(super::tracing::RegionHealthCheckServices::new)
11041 }
11042
11043 /// Retrieves the list of all HealthCheckService resources,
11044 /// regional and global, available to the specified project.
11045 ///
11046 /// To prevent failure, it is recommended that you set the
11047 /// `returnPartialSuccess` parameter to `true`.
11048 pub fn aggregated_list(&self) -> super::builder::region_health_check_services::AggregatedList {
11049 super::builder::region_health_check_services::AggregatedList::new(self.inner.clone())
11050 }
11051
11052 /// Deletes the specified regional HealthCheckService.
11053 pub fn delete(&self) -> super::builder::region_health_check_services::Delete {
11054 super::builder::region_health_check_services::Delete::new(self.inner.clone())
11055 }
11056
11057 /// Returns the specified regional HealthCheckService resource.
11058 pub fn get(&self) -> super::builder::region_health_check_services::Get {
11059 super::builder::region_health_check_services::Get::new(self.inner.clone())
11060 }
11061
11062 /// Creates a regional HealthCheckService resource in the
11063 /// specified project and region using the data included in the request.
11064 pub fn insert(&self) -> super::builder::region_health_check_services::Insert {
11065 super::builder::region_health_check_services::Insert::new(self.inner.clone())
11066 }
11067
11068 /// Lists all the HealthCheckService resources that have been
11069 /// configured for the specified project in the given region.
11070 pub fn list(&self) -> super::builder::region_health_check_services::List {
11071 super::builder::region_health_check_services::List::new(self.inner.clone())
11072 }
11073
11074 /// Updates the specified regional HealthCheckService resource
11075 /// with the data included in the request. This method supportsPATCH
11076 /// semantics and uses theJSON merge
11077 /// patch format and processing rules.
11078 pub fn patch(&self) -> super::builder::region_health_check_services::Patch {
11079 super::builder::region_health_check_services::Patch::new(self.inner.clone())
11080 }
11081
11082 /// Returns permissions that a caller has on the specified resource.
11083 pub fn test_iam_permissions(
11084 &self,
11085 ) -> super::builder::region_health_check_services::TestIamPermissions {
11086 super::builder::region_health_check_services::TestIamPermissions::new(self.inner.clone())
11087 }
11088
11089 /// Retrieves the specified region-specific Operations resource.
11090 pub fn get_operation(&self) -> super::builder::region_health_check_services::GetOperation {
11091 super::builder::region_health_check_services::GetOperation::new(self.inner.clone())
11092 }
11093}
11094
11095/// Implements a client for the Google Compute Engine API.
11096///
11097/// # Example
11098/// ```
11099/// # use google_cloud_compute_v1::client::RegionHealthChecks;
11100/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
11101/// let client = RegionHealthChecks::builder().build().await?;
11102/// // use `client` to make requests to the Google Compute Engine API.
11103/// # Ok(()) }
11104/// ```
11105///
11106/// # Service Description
11107///
11108/// Service for the `regionHealthChecks` resource.
11109///
11110/// # Configuration
11111///
11112/// To configure `RegionHealthChecks` use the `with_*` methods in the type returned
11113/// by [builder()][RegionHealthChecks::builder]. The default configuration should
11114/// work for most applications. Common configuration changes include
11115///
11116/// * [with_endpoint()]: by default this client uses the global default endpoint
11117/// (`https://compute.googleapis.com`). Applications using regional
11118/// endpoints or running in restricted networks (e.g. a network configured
11119// with [Private Google Access with VPC Service Controls]) may want to
11120/// override this default.
11121/// * [with_credentials()]: by default this client uses
11122/// [Application Default Credentials]. Applications using custom
11123/// authentication may need to override this default.
11124///
11125/// [with_endpoint()]: super::builder::region_health_checks::ClientBuilder::with_endpoint
11126/// [with_credentials()]: super::builder::region_health_checks::ClientBuilder::with_credentials
11127/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11128/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11129///
11130/// # Pooling and Cloning
11131///
11132/// `RegionHealthChecks` holds a connection pool internally, it is advised to
11133/// create one and reuse it. You do not need to wrap `RegionHealthChecks` in
11134/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11135/// already uses an `Arc` internally.
11136#[cfg(feature = "region-health-checks")]
11137#[cfg_attr(docsrs, doc(cfg(feature = "region-health-checks")))]
11138#[derive(Clone, Debug)]
11139pub struct RegionHealthChecks {
11140 inner: std::sync::Arc<dyn super::stub::dynamic::RegionHealthChecks>,
11141}
11142
11143#[cfg(feature = "region-health-checks")]
11144impl RegionHealthChecks {
11145 /// Returns a builder for [RegionHealthChecks].
11146 ///
11147 /// ```
11148 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11149 /// # use google_cloud_compute_v1::client::RegionHealthChecks;
11150 /// let client = RegionHealthChecks::builder().build().await?;
11151 /// # Ok(()) }
11152 /// ```
11153 pub fn builder() -> super::builder::region_health_checks::ClientBuilder {
11154 crate::new_client_builder(super::builder::region_health_checks::client::Factory)
11155 }
11156
11157 /// Creates a new client from the provided stub.
11158 ///
11159 /// The most common case for calling this function is in tests mocking the
11160 /// client's behavior.
11161 pub fn from_stub<T>(stub: T) -> Self
11162 where
11163 T: super::stub::RegionHealthChecks + 'static,
11164 {
11165 Self {
11166 inner: std::sync::Arc::new(stub),
11167 }
11168 }
11169
11170 pub(crate) async fn new(
11171 config: gaxi::options::ClientConfig,
11172 ) -> crate::ClientBuilderResult<Self> {
11173 let inner = Self::build_inner(config).await?;
11174 Ok(Self { inner })
11175 }
11176
11177 async fn build_inner(
11178 conf: gaxi::options::ClientConfig,
11179 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionHealthChecks>>
11180 {
11181 if gaxi::options::tracing_enabled(&conf) {
11182 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11183 }
11184 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11185 }
11186
11187 async fn build_transport(
11188 conf: gaxi::options::ClientConfig,
11189 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthChecks> {
11190 super::transport::RegionHealthChecks::new(conf).await
11191 }
11192
11193 async fn build_with_tracing(
11194 conf: gaxi::options::ClientConfig,
11195 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthChecks> {
11196 Self::build_transport(conf)
11197 .await
11198 .map(super::tracing::RegionHealthChecks::new)
11199 }
11200
11201 /// Deletes the specified HealthCheck resource.
11202 pub fn delete(&self) -> super::builder::region_health_checks::Delete {
11203 super::builder::region_health_checks::Delete::new(self.inner.clone())
11204 }
11205
11206 /// Returns the specified HealthCheck resource.
11207 pub fn get(&self) -> super::builder::region_health_checks::Get {
11208 super::builder::region_health_checks::Get::new(self.inner.clone())
11209 }
11210
11211 /// Creates a HealthCheck resource in the specified project using the data
11212 /// included in the request.
11213 pub fn insert(&self) -> super::builder::region_health_checks::Insert {
11214 super::builder::region_health_checks::Insert::new(self.inner.clone())
11215 }
11216
11217 /// Retrieves the list of HealthCheck resources available to the specified
11218 /// project.
11219 pub fn list(&self) -> super::builder::region_health_checks::List {
11220 super::builder::region_health_checks::List::new(self.inner.clone())
11221 }
11222
11223 /// Updates a HealthCheck resource in the specified project using the data
11224 /// included in the request. This method supportsPATCH
11225 /// semantics and uses theJSON merge
11226 /// patch format and processing rules.
11227 pub fn patch(&self) -> super::builder::region_health_checks::Patch {
11228 super::builder::region_health_checks::Patch::new(self.inner.clone())
11229 }
11230
11231 /// Returns permissions that a caller has on the specified resource.
11232 pub fn test_iam_permissions(&self) -> super::builder::region_health_checks::TestIamPermissions {
11233 super::builder::region_health_checks::TestIamPermissions::new(self.inner.clone())
11234 }
11235
11236 /// Updates a HealthCheck resource in the specified project using the data
11237 /// included in the request.
11238 pub fn update(&self) -> super::builder::region_health_checks::Update {
11239 super::builder::region_health_checks::Update::new(self.inner.clone())
11240 }
11241
11242 /// Retrieves the specified region-specific Operations resource.
11243 pub fn get_operation(&self) -> super::builder::region_health_checks::GetOperation {
11244 super::builder::region_health_checks::GetOperation::new(self.inner.clone())
11245 }
11246}
11247
11248/// Implements a client for the Google Compute Engine API.
11249///
11250/// # Example
11251/// ```
11252/// # use google_cloud_compute_v1::client::RegionHealthSources;
11253/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
11254/// let client = RegionHealthSources::builder().build().await?;
11255/// // use `client` to make requests to the Google Compute Engine API.
11256/// # Ok(()) }
11257/// ```
11258///
11259/// # Service Description
11260///
11261/// Service for the `regionHealthSources` resource.
11262///
11263/// # Configuration
11264///
11265/// To configure `RegionHealthSources` use the `with_*` methods in the type returned
11266/// by [builder()][RegionHealthSources::builder]. The default configuration should
11267/// work for most applications. Common configuration changes include
11268///
11269/// * [with_endpoint()]: by default this client uses the global default endpoint
11270/// (`https://compute.googleapis.com`). Applications using regional
11271/// endpoints or running in restricted networks (e.g. a network configured
11272// with [Private Google Access with VPC Service Controls]) may want to
11273/// override this default.
11274/// * [with_credentials()]: by default this client uses
11275/// [Application Default Credentials]. Applications using custom
11276/// authentication may need to override this default.
11277///
11278/// [with_endpoint()]: super::builder::region_health_sources::ClientBuilder::with_endpoint
11279/// [with_credentials()]: super::builder::region_health_sources::ClientBuilder::with_credentials
11280/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11281/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11282///
11283/// # Pooling and Cloning
11284///
11285/// `RegionHealthSources` holds a connection pool internally, it is advised to
11286/// create one and reuse it. You do not need to wrap `RegionHealthSources` in
11287/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11288/// already uses an `Arc` internally.
11289#[cfg(feature = "region-health-sources")]
11290#[cfg_attr(docsrs, doc(cfg(feature = "region-health-sources")))]
11291#[derive(Clone, Debug)]
11292pub struct RegionHealthSources {
11293 inner: std::sync::Arc<dyn super::stub::dynamic::RegionHealthSources>,
11294}
11295
11296#[cfg(feature = "region-health-sources")]
11297impl RegionHealthSources {
11298 /// Returns a builder for [RegionHealthSources].
11299 ///
11300 /// ```
11301 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11302 /// # use google_cloud_compute_v1::client::RegionHealthSources;
11303 /// let client = RegionHealthSources::builder().build().await?;
11304 /// # Ok(()) }
11305 /// ```
11306 pub fn builder() -> super::builder::region_health_sources::ClientBuilder {
11307 crate::new_client_builder(super::builder::region_health_sources::client::Factory)
11308 }
11309
11310 /// Creates a new client from the provided stub.
11311 ///
11312 /// The most common case for calling this function is in tests mocking the
11313 /// client's behavior.
11314 pub fn from_stub<T>(stub: T) -> Self
11315 where
11316 T: super::stub::RegionHealthSources + 'static,
11317 {
11318 Self {
11319 inner: std::sync::Arc::new(stub),
11320 }
11321 }
11322
11323 pub(crate) async fn new(
11324 config: gaxi::options::ClientConfig,
11325 ) -> crate::ClientBuilderResult<Self> {
11326 let inner = Self::build_inner(config).await?;
11327 Ok(Self { inner })
11328 }
11329
11330 async fn build_inner(
11331 conf: gaxi::options::ClientConfig,
11332 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionHealthSources>>
11333 {
11334 if gaxi::options::tracing_enabled(&conf) {
11335 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11336 }
11337 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11338 }
11339
11340 async fn build_transport(
11341 conf: gaxi::options::ClientConfig,
11342 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthSources> {
11343 super::transport::RegionHealthSources::new(conf).await
11344 }
11345
11346 async fn build_with_tracing(
11347 conf: gaxi::options::ClientConfig,
11348 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthSources> {
11349 Self::build_transport(conf)
11350 .await
11351 .map(super::tracing::RegionHealthSources::new)
11352 }
11353
11354 /// Retrieves the list of all HealthSource resources (all
11355 /// regional) available to the specified project.
11356 ///
11357 /// To prevent failure, Google recommends that you set the
11358 /// `returnPartialSuccess` parameter to `true`.
11359 pub fn aggregated_list(&self) -> super::builder::region_health_sources::AggregatedList {
11360 super::builder::region_health_sources::AggregatedList::new(self.inner.clone())
11361 }
11362
11363 /// Deletes the specified HealthSource in the given region
11364 pub fn delete(&self) -> super::builder::region_health_sources::Delete {
11365 super::builder::region_health_sources::Delete::new(self.inner.clone())
11366 }
11367
11368 /// Returns the specified HealthSource resource in the given region.
11369 pub fn get(&self) -> super::builder::region_health_sources::Get {
11370 super::builder::region_health_sources::Get::new(self.inner.clone())
11371 }
11372
11373 /// Create a HealthSource in the specified project in the given region
11374 /// using the parameters that are included in the request.
11375 pub fn insert(&self) -> super::builder::region_health_sources::Insert {
11376 super::builder::region_health_sources::Insert::new(self.inner.clone())
11377 }
11378
11379 /// Lists the HealthSources for a project in the given region.
11380 pub fn list(&self) -> super::builder::region_health_sources::List {
11381 super::builder::region_health_sources::List::new(self.inner.clone())
11382 }
11383
11384 /// Updates the specified regional HealthSource resource
11385 /// with the data included in the request. This method supportsPATCH
11386 /// semantics and uses theJSON merge
11387 /// patch format and processing rules.
11388 pub fn patch(&self) -> super::builder::region_health_sources::Patch {
11389 super::builder::region_health_sources::Patch::new(self.inner.clone())
11390 }
11391
11392 /// Returns permissions that a caller has on the specified resource.
11393 pub fn test_iam_permissions(
11394 &self,
11395 ) -> super::builder::region_health_sources::TestIamPermissions {
11396 super::builder::region_health_sources::TestIamPermissions::new(self.inner.clone())
11397 }
11398
11399 /// Retrieves the specified region-specific Operations resource.
11400 pub fn get_operation(&self) -> super::builder::region_health_sources::GetOperation {
11401 super::builder::region_health_sources::GetOperation::new(self.inner.clone())
11402 }
11403}
11404
11405/// Implements a client for the Google Compute Engine API.
11406///
11407/// # Example
11408/// ```
11409/// # use google_cloud_compute_v1::client::RegionInstanceGroupManagerResizeRequests;
11410/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
11411/// let client = RegionInstanceGroupManagerResizeRequests::builder().build().await?;
11412/// // use `client` to make requests to the Google Compute Engine API.
11413/// # Ok(()) }
11414/// ```
11415///
11416/// # Service Description
11417///
11418/// Service for the `regionInstanceGroupManagerResizeRequests` resource.
11419///
11420/// # Configuration
11421///
11422/// To configure `RegionInstanceGroupManagerResizeRequests` use the `with_*` methods in the type returned
11423/// by [builder()][RegionInstanceGroupManagerResizeRequests::builder]. The default configuration should
11424/// work for most applications. Common configuration changes include
11425///
11426/// * [with_endpoint()]: by default this client uses the global default endpoint
11427/// (`https://compute.googleapis.com`). Applications using regional
11428/// endpoints or running in restricted networks (e.g. a network configured
11429// with [Private Google Access with VPC Service Controls]) may want to
11430/// override this default.
11431/// * [with_credentials()]: by default this client uses
11432/// [Application Default Credentials]. Applications using custom
11433/// authentication may need to override this default.
11434///
11435/// [with_endpoint()]: super::builder::region_instance_group_manager_resize_requests::ClientBuilder::with_endpoint
11436/// [with_credentials()]: super::builder::region_instance_group_manager_resize_requests::ClientBuilder::with_credentials
11437/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11438/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11439///
11440/// # Pooling and Cloning
11441///
11442/// `RegionInstanceGroupManagerResizeRequests` holds a connection pool internally, it is advised to
11443/// create one and reuse it. You do not need to wrap `RegionInstanceGroupManagerResizeRequests` in
11444/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11445/// already uses an `Arc` internally.
11446#[cfg(feature = "region-instance-group-manager-resize-requests")]
11447#[cfg_attr(
11448 docsrs,
11449 doc(cfg(feature = "region-instance-group-manager-resize-requests"))
11450)]
11451#[derive(Clone, Debug)]
11452pub struct RegionInstanceGroupManagerResizeRequests {
11453 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroupManagerResizeRequests>,
11454}
11455
11456#[cfg(feature = "region-instance-group-manager-resize-requests")]
11457impl RegionInstanceGroupManagerResizeRequests {
11458 /// Returns a builder for [RegionInstanceGroupManagerResizeRequests].
11459 ///
11460 /// ```
11461 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11462 /// # use google_cloud_compute_v1::client::RegionInstanceGroupManagerResizeRequests;
11463 /// let client = RegionInstanceGroupManagerResizeRequests::builder().build().await?;
11464 /// # Ok(()) }
11465 /// ```
11466 pub fn builder() -> super::builder::region_instance_group_manager_resize_requests::ClientBuilder
11467 {
11468 crate::new_client_builder(
11469 super::builder::region_instance_group_manager_resize_requests::client::Factory,
11470 )
11471 }
11472
11473 /// Creates a new client from the provided stub.
11474 ///
11475 /// The most common case for calling this function is in tests mocking the
11476 /// client's behavior.
11477 pub fn from_stub<T>(stub: T) -> Self
11478 where
11479 T: super::stub::RegionInstanceGroupManagerResizeRequests + 'static,
11480 {
11481 Self {
11482 inner: std::sync::Arc::new(stub),
11483 }
11484 }
11485
11486 pub(crate) async fn new(
11487 config: gaxi::options::ClientConfig,
11488 ) -> crate::ClientBuilderResult<Self> {
11489 let inner = Self::build_inner(config).await?;
11490 Ok(Self { inner })
11491 }
11492
11493 async fn build_inner(
11494 conf: gaxi::options::ClientConfig,
11495 ) -> crate::ClientBuilderResult<
11496 std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroupManagerResizeRequests>,
11497 > {
11498 if gaxi::options::tracing_enabled(&conf) {
11499 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11500 }
11501 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11502 }
11503
11504 async fn build_transport(
11505 conf: gaxi::options::ClientConfig,
11506 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroupManagerResizeRequests>
11507 {
11508 super::transport::RegionInstanceGroupManagerResizeRequests::new(conf).await
11509 }
11510
11511 async fn build_with_tracing(
11512 conf: gaxi::options::ClientConfig,
11513 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroupManagerResizeRequests>
11514 {
11515 Self::build_transport(conf)
11516 .await
11517 .map(super::tracing::RegionInstanceGroupManagerResizeRequests::new)
11518 }
11519
11520 /// Cancels the specified resize request.
11521 /// Cancelled resize request no longer waits for the resources to be
11522 /// provisioned. Cancel is only possible for requests that are in accepted
11523 /// state.
11524 pub fn cancel(&self) -> super::builder::region_instance_group_manager_resize_requests::Cancel {
11525 super::builder::region_instance_group_manager_resize_requests::Cancel::new(
11526 self.inner.clone(),
11527 )
11528 }
11529
11530 /// Deletes the specified, inactive resize request. Requests that are still
11531 /// active cannot be deleted. Deleting request does not delete instances that
11532 /// were provisioned previously.
11533 pub fn delete(&self) -> super::builder::region_instance_group_manager_resize_requests::Delete {
11534 super::builder::region_instance_group_manager_resize_requests::Delete::new(
11535 self.inner.clone(),
11536 )
11537 }
11538
11539 /// Returns all of the details about the specified resize request.
11540 pub fn get(&self) -> super::builder::region_instance_group_manager_resize_requests::Get {
11541 super::builder::region_instance_group_manager_resize_requests::Get::new(self.inner.clone())
11542 }
11543
11544 /// Creates a new Resize Request that starts provisioning VMs immediately
11545 /// or queues VM creation.
11546 pub fn insert(&self) -> super::builder::region_instance_group_manager_resize_requests::Insert {
11547 super::builder::region_instance_group_manager_resize_requests::Insert::new(
11548 self.inner.clone(),
11549 )
11550 }
11551
11552 /// Retrieves a list of Resize Requests that are contained in the
11553 /// managed instance group.
11554 pub fn list(&self) -> super::builder::region_instance_group_manager_resize_requests::List {
11555 super::builder::region_instance_group_manager_resize_requests::List::new(self.inner.clone())
11556 }
11557
11558 /// Retrieves the specified region-specific Operations resource.
11559 pub fn get_operation(
11560 &self,
11561 ) -> super::builder::region_instance_group_manager_resize_requests::GetOperation {
11562 super::builder::region_instance_group_manager_resize_requests::GetOperation::new(
11563 self.inner.clone(),
11564 )
11565 }
11566}
11567
11568/// Implements a client for the Google Compute Engine API.
11569///
11570/// # Example
11571/// ```
11572/// # use google_cloud_compute_v1::client::RegionInstanceGroupManagers;
11573/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
11574/// let client = RegionInstanceGroupManagers::builder().build().await?;
11575/// // use `client` to make requests to the Google Compute Engine API.
11576/// # Ok(()) }
11577/// ```
11578///
11579/// # Service Description
11580///
11581/// Service for the `regionInstanceGroupManagers` resource.
11582///
11583/// # Configuration
11584///
11585/// To configure `RegionInstanceGroupManagers` use the `with_*` methods in the type returned
11586/// by [builder()][RegionInstanceGroupManagers::builder]. The default configuration should
11587/// work for most applications. Common configuration changes include
11588///
11589/// * [with_endpoint()]: by default this client uses the global default endpoint
11590/// (`https://compute.googleapis.com`). Applications using regional
11591/// endpoints or running in restricted networks (e.g. a network configured
11592// with [Private Google Access with VPC Service Controls]) may want to
11593/// override this default.
11594/// * [with_credentials()]: by default this client uses
11595/// [Application Default Credentials]. Applications using custom
11596/// authentication may need to override this default.
11597///
11598/// [with_endpoint()]: super::builder::region_instance_group_managers::ClientBuilder::with_endpoint
11599/// [with_credentials()]: super::builder::region_instance_group_managers::ClientBuilder::with_credentials
11600/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11601/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11602///
11603/// # Pooling and Cloning
11604///
11605/// `RegionInstanceGroupManagers` holds a connection pool internally, it is advised to
11606/// create one and reuse it. You do not need to wrap `RegionInstanceGroupManagers` in
11607/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11608/// already uses an `Arc` internally.
11609#[cfg(feature = "region-instance-group-managers")]
11610#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-group-managers")))]
11611#[derive(Clone, Debug)]
11612pub struct RegionInstanceGroupManagers {
11613 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroupManagers>,
11614}
11615
11616#[cfg(feature = "region-instance-group-managers")]
11617impl RegionInstanceGroupManagers {
11618 /// Returns a builder for [RegionInstanceGroupManagers].
11619 ///
11620 /// ```
11621 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11622 /// # use google_cloud_compute_v1::client::RegionInstanceGroupManagers;
11623 /// let client = RegionInstanceGroupManagers::builder().build().await?;
11624 /// # Ok(()) }
11625 /// ```
11626 pub fn builder() -> super::builder::region_instance_group_managers::ClientBuilder {
11627 crate::new_client_builder(super::builder::region_instance_group_managers::client::Factory)
11628 }
11629
11630 /// Creates a new client from the provided stub.
11631 ///
11632 /// The most common case for calling this function is in tests mocking the
11633 /// client's behavior.
11634 pub fn from_stub<T>(stub: T) -> Self
11635 where
11636 T: super::stub::RegionInstanceGroupManagers + 'static,
11637 {
11638 Self {
11639 inner: std::sync::Arc::new(stub),
11640 }
11641 }
11642
11643 pub(crate) async fn new(
11644 config: gaxi::options::ClientConfig,
11645 ) -> crate::ClientBuilderResult<Self> {
11646 let inner = Self::build_inner(config).await?;
11647 Ok(Self { inner })
11648 }
11649
11650 async fn build_inner(
11651 conf: gaxi::options::ClientConfig,
11652 ) -> crate::ClientBuilderResult<
11653 std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroupManagers>,
11654 > {
11655 if gaxi::options::tracing_enabled(&conf) {
11656 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11657 }
11658 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11659 }
11660
11661 async fn build_transport(
11662 conf: gaxi::options::ClientConfig,
11663 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroupManagers> {
11664 super::transport::RegionInstanceGroupManagers::new(conf).await
11665 }
11666
11667 async fn build_with_tracing(
11668 conf: gaxi::options::ClientConfig,
11669 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroupManagers> {
11670 Self::build_transport(conf)
11671 .await
11672 .map(super::tracing::RegionInstanceGroupManagers::new)
11673 }
11674
11675 /// Flags the specified instances to be immediately removed from the managed
11676 /// instance group. Abandoning an instance does not delete the
11677 /// instance, but it does remove the instance from any target pools that are
11678 /// applied by the managed instance group. This method reduces thetargetSize of the managed instance group by the
11679 /// number of instances that you abandon. This operation is marked asDONE when the action is scheduled even if the instances have
11680 /// not yet been removed from the group. You must separately verify the
11681 /// status of the abandoning action with thelistmanagedinstances
11682 /// method.
11683 ///
11684 /// If the group is part of a backend
11685 /// service that has enabled
11686 /// connection draining, it can take up to 60 seconds after the connection
11687 /// draining duration has elapsed before the VM instance is removed or deleted.
11688 ///
11689 /// You can specify a maximum of 1000 instances with this method per request.
11690 pub fn abandon_instances(
11691 &self,
11692 ) -> super::builder::region_instance_group_managers::AbandonInstances {
11693 super::builder::region_instance_group_managers::AbandonInstances::new(self.inner.clone())
11694 }
11695
11696 /// Apply updates to selected instances the managed instance group.
11697 pub fn apply_updates_to_instances(
11698 &self,
11699 ) -> super::builder::region_instance_group_managers::ApplyUpdatesToInstances {
11700 super::builder::region_instance_group_managers::ApplyUpdatesToInstances::new(
11701 self.inner.clone(),
11702 )
11703 }
11704
11705 /// Creates instances with per-instance configurations in this regional managed
11706 /// instance group. Instances are created using the current instance template.
11707 /// The create instances operation is marked DONE if
11708 /// the createInstances request is successful. The underlying
11709 /// actions take additional time. You must separately verify the status of thecreating or actions with the listmanagedinstances
11710 /// method.
11711 pub fn create_instances(
11712 &self,
11713 ) -> super::builder::region_instance_group_managers::CreateInstances {
11714 super::builder::region_instance_group_managers::CreateInstances::new(self.inner.clone())
11715 }
11716
11717 /// Deletes the specified managed instance group and all of the instances
11718 /// in that group.
11719 pub fn delete(&self) -> super::builder::region_instance_group_managers::Delete {
11720 super::builder::region_instance_group_managers::Delete::new(self.inner.clone())
11721 }
11722
11723 /// Flags the specified instances in the managed instance group to be
11724 /// immediately deleted. The instances are also removed from any target
11725 /// pools of which they were a member. This method reduces thetargetSize of the managed instance group by the number of
11726 /// instances that you delete.
11727 /// The deleteInstances operation is marked DONE if
11728 /// the deleteInstances request is successful. The underlying
11729 /// actions take additional time. You must separately verify the status of thedeleting action with thelistmanagedinstances
11730 /// method.
11731 ///
11732 /// If the group is part of a backend
11733 /// service that has enabled
11734 /// connection draining, it can take up to 60 seconds after the connection
11735 /// draining duration has elapsed before the VM instance is removed or deleted.
11736 ///
11737 /// You can specify a maximum of 1000 instances with this method per request.
11738 pub fn delete_instances(
11739 &self,
11740 ) -> super::builder::region_instance_group_managers::DeleteInstances {
11741 super::builder::region_instance_group_managers::DeleteInstances::new(self.inner.clone())
11742 }
11743
11744 /// Deletes selected per-instance configurations for the managed instance
11745 /// group.
11746 pub fn delete_per_instance_configs(
11747 &self,
11748 ) -> super::builder::region_instance_group_managers::DeletePerInstanceConfigs {
11749 super::builder::region_instance_group_managers::DeletePerInstanceConfigs::new(
11750 self.inner.clone(),
11751 )
11752 }
11753
11754 /// Returns all of the details about the specified managed instance group.
11755 pub fn get(&self) -> super::builder::region_instance_group_managers::Get {
11756 super::builder::region_instance_group_managers::Get::new(self.inner.clone())
11757 }
11758
11759 /// Creates a managed instance group using the information that you specify
11760 /// in the request. After the group is created, instances in the group are
11761 /// created using the specified instance template.
11762 /// This operation is marked as DONE when the group is created
11763 /// even if the instances in the group have not yet been created. You must
11764 /// separately verify the status of the individual instances with thelistmanagedinstances
11765 /// method.
11766 ///
11767 /// A regional managed instance group can contain up to 2000 instances.
11768 pub fn insert(&self) -> super::builder::region_instance_group_managers::Insert {
11769 super::builder::region_instance_group_managers::Insert::new(self.inner.clone())
11770 }
11771
11772 /// Retrieves the list of managed instance groups that are contained
11773 /// within the specified region.
11774 pub fn list(&self) -> super::builder::region_instance_group_managers::List {
11775 super::builder::region_instance_group_managers::List::new(self.inner.clone())
11776 }
11777
11778 /// Lists all errors thrown by actions on instances for a given regional
11779 /// managed instance group. The filter andorderBy query parameters are not supported.
11780 pub fn list_errors(&self) -> super::builder::region_instance_group_managers::ListErrors {
11781 super::builder::region_instance_group_managers::ListErrors::new(self.inner.clone())
11782 }
11783
11784 /// Lists the instances in the managed instance group and instances that are
11785 /// scheduled to be created. The list includes any current actions
11786 /// that the group has scheduled for its instances. The orderBy
11787 /// query parameter is not supported. The `pageToken` query parameter is
11788 /// supported only if the group's `listManagedInstancesResults` field is set
11789 /// to `PAGINATED`.
11790 pub fn list_managed_instances(
11791 &self,
11792 ) -> super::builder::region_instance_group_managers::ListManagedInstances {
11793 super::builder::region_instance_group_managers::ListManagedInstances::new(
11794 self.inner.clone(),
11795 )
11796 }
11797
11798 /// Lists all of the per-instance configurations defined for the managed
11799 /// instance group. The orderBy query parameter is not supported.
11800 pub fn list_per_instance_configs(
11801 &self,
11802 ) -> super::builder::region_instance_group_managers::ListPerInstanceConfigs {
11803 super::builder::region_instance_group_managers::ListPerInstanceConfigs::new(
11804 self.inner.clone(),
11805 )
11806 }
11807
11808 /// Updates a managed instance group using the information that you specify
11809 /// in the request.
11810 /// This operation is marked as DONE when the group is patched
11811 /// even if the instances in the group are still in the process of being
11812 /// patched. You must separately verify the status of the individual instances
11813 /// with the listmanagedinstances
11814 /// method. This method supportsPATCH
11815 /// semantics and uses theJSON merge
11816 /// patch format and processing rules.
11817 ///
11818 /// If you update your group to specify a new template or instance
11819 /// configuration, it's possible that your intended specification for each VM
11820 /// in the group is different from the current state of that VM. To learn how
11821 /// to apply an updated configuration to the VMs in a MIG, seeUpdating instances in
11822 /// a MIG.
11823 pub fn patch(&self) -> super::builder::region_instance_group_managers::Patch {
11824 super::builder::region_instance_group_managers::Patch::new(self.inner.clone())
11825 }
11826
11827 /// Inserts or patches per-instance configurations for the managed instance
11828 /// group. perInstanceConfig.name serves as a key used to
11829 /// distinguish whether to perform insert or patch.
11830 pub fn patch_per_instance_configs(
11831 &self,
11832 ) -> super::builder::region_instance_group_managers::PatchPerInstanceConfigs {
11833 super::builder::region_instance_group_managers::PatchPerInstanceConfigs::new(
11834 self.inner.clone(),
11835 )
11836 }
11837
11838 /// Flags the specified VM instances in the managed instance group to be
11839 /// immediately recreated. Each instance is recreated using the group's current
11840 /// configuration. This operation is marked as DONE when the flag
11841 /// is set even if the instances have not yet been recreated. You must
11842 /// separately verify the status of each instance by checking itscurrentAction field; for more information, see Checking
11843 /// the status of managed instances.
11844 ///
11845 /// If the group is part of a backend
11846 /// service that has enabled
11847 /// connection draining, it can take up to 60 seconds after the connection
11848 /// draining duration has elapsed before the VM instance is removed or deleted.
11849 ///
11850 /// You can specify a maximum of 1000 instances with this method per request.
11851 pub fn recreate_instances(
11852 &self,
11853 ) -> super::builder::region_instance_group_managers::RecreateInstances {
11854 super::builder::region_instance_group_managers::RecreateInstances::new(self.inner.clone())
11855 }
11856
11857 /// Changes the intended size of the managed instance group. If you increase
11858 /// the size, the group creates new instances using the current instance
11859 /// template. If you decrease the size, the group deletes one or more
11860 /// instances.
11861 ///
11862 /// The resize operation is marked DONE if theresize request is successful. The underlying actions take
11863 /// additional time. You must separately verify the status of thecreating or deleting actions with thelistmanagedinstances
11864 /// method.
11865 ///
11866 /// If the group is part of a backend
11867 /// service that has enabled
11868 /// connection draining, it can take up to 60 seconds after the connection
11869 /// draining duration has elapsed before the VM instance is removed or deleted.
11870 pub fn resize(&self) -> super::builder::region_instance_group_managers::Resize {
11871 super::builder::region_instance_group_managers::Resize::new(self.inner.clone())
11872 }
11873
11874 /// Flags the specified instances in the managed instance group to be
11875 /// resumed. This method increases thetargetSize and decreases the targetSuspendedSize
11876 /// of the managed instance group by the number of instances that you resume.
11877 /// The resumeInstances operation is marked DONE if
11878 /// the resumeInstances request is successful. The underlying
11879 /// actions take additional time. You must separately verify the status of theRESUMING action with thelistmanagedinstances
11880 /// method.
11881 ///
11882 /// In this request, you can only specify instances that are suspended. For
11883 /// example, if an instance was previously suspended using the suspendInstances
11884 /// method, it can be resumed using the resumeInstances method.
11885 ///
11886 /// If a health check is attached to the managed instance group, the specified
11887 /// instances will be verified as healthy after they are resumed.
11888 ///
11889 /// You can specify a maximum of 1000 instances with this method per request.
11890 pub fn resume_instances(
11891 &self,
11892 ) -> super::builder::region_instance_group_managers::ResumeInstances {
11893 super::builder::region_instance_group_managers::ResumeInstances::new(self.inner.clone())
11894 }
11895
11896 /// Sets the instance template to use when creating new instances or recreating
11897 /// instances in this group. Existing instances are not affected.
11898 pub fn set_instance_template(
11899 &self,
11900 ) -> super::builder::region_instance_group_managers::SetInstanceTemplate {
11901 super::builder::region_instance_group_managers::SetInstanceTemplate::new(self.inner.clone())
11902 }
11903
11904 /// Modifies the target pools to which all new instances in this group are
11905 /// assigned. Existing instances in the group are not affected.
11906 pub fn set_target_pools(
11907 &self,
11908 ) -> super::builder::region_instance_group_managers::SetTargetPools {
11909 super::builder::region_instance_group_managers::SetTargetPools::new(self.inner.clone())
11910 }
11911
11912 /// Flags the specified instances in the managed instance group to be
11913 /// started. This method increases thetargetSize and decreases the targetStoppedSize
11914 /// of the managed instance group by the number of instances that you start.
11915 /// The startInstances operation is marked DONE if
11916 /// the startInstances request is successful. The underlying
11917 /// actions take additional time. You must separately verify the status of theSTARTING action with thelistmanagedinstances
11918 /// method.
11919 ///
11920 /// In this request, you can only specify instances that are stopped. For
11921 /// example, if an instance was previously stopped using the stopInstances
11922 /// method, it can be started using the startInstances method.
11923 ///
11924 /// If a health check is attached to the managed instance group, the specified
11925 /// instances will be verified as healthy after they are started.
11926 ///
11927 /// You can specify a maximum of 1000 instances with this method per request.
11928 pub fn start_instances(
11929 &self,
11930 ) -> super::builder::region_instance_group_managers::StartInstances {
11931 super::builder::region_instance_group_managers::StartInstances::new(self.inner.clone())
11932 }
11933
11934 /// Flags the specified instances in the managed instance group to be
11935 /// immediately stopped. You can only specify instances that are running in
11936 /// this request. This method reduces thetargetSize and increases the targetStoppedSize
11937 /// of the managed instance group by the number of instances that you stop.
11938 /// The stopInstances operation is marked DONE if
11939 /// the stopInstances request is successful. The underlying
11940 /// actions take additional time. You must separately verify the status of theSTOPPING action with thelistmanagedinstances
11941 /// method.
11942 ///
11943 /// If the standbyPolicy.initialDelaySec field is set, the group
11944 /// delays stopping the instances until initialDelaySec have
11945 /// passed from instance.creationTimestamp (that is, when the
11946 /// instance was created). This delay gives your application time to
11947 /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
11948 /// will be zero delay.
11949 ///
11950 /// If the group is part of a backend
11951 /// service that has enabled
11952 /// connection draining, it can take up to 60 seconds after the connection
11953 /// draining duration has elapsed before the VM instance is stopped.
11954 ///
11955 /// Stopped instances can be started using the startInstances
11956 /// method.
11957 ///
11958 /// You can specify a maximum of 1000 instances with this method per request.
11959 pub fn stop_instances(&self) -> super::builder::region_instance_group_managers::StopInstances {
11960 super::builder::region_instance_group_managers::StopInstances::new(self.inner.clone())
11961 }
11962
11963 /// Flags the specified instances in the managed instance group to be
11964 /// immediately suspended. You can only specify instances that are running in
11965 /// this request. This method reduces thetargetSize and increases the targetSuspendedSize
11966 /// of the managed instance group by the number of instances that you suspend.
11967 /// The suspendInstances operation is marked DONE if
11968 /// the suspendInstances request is successful. The underlying
11969 /// actions take additional time. You must separately verify the status of theSUSPENDING action with thelistmanagedinstances
11970 /// method.
11971 ///
11972 /// If the standbyPolicy.initialDelaySec field is set, the group
11973 /// delays suspension of the instances until initialDelaySec have
11974 /// passed from instance.creationTimestamp (that is, when the
11975 /// instance was created). This delay gives your application time to
11976 /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
11977 /// will be zero delay.
11978 ///
11979 /// If the group is part of a backend
11980 /// service that has enabled
11981 /// connection draining, it can take up to 60 seconds after the connection
11982 /// draining duration has elapsed before the VM instance is suspended.
11983 ///
11984 /// Suspended instances can be resumed using the resumeInstances
11985 /// method.
11986 ///
11987 /// You can specify a maximum of 1000 instances with this method per request.
11988 pub fn suspend_instances(
11989 &self,
11990 ) -> super::builder::region_instance_group_managers::SuspendInstances {
11991 super::builder::region_instance_group_managers::SuspendInstances::new(self.inner.clone())
11992 }
11993
11994 /// Inserts or updates per-instance configurations for the managed instance
11995 /// group. perInstanceConfig.name serves as a key used to
11996 /// distinguish whether to perform insert or patch.
11997 pub fn update_per_instance_configs(
11998 &self,
11999 ) -> super::builder::region_instance_group_managers::UpdatePerInstanceConfigs {
12000 super::builder::region_instance_group_managers::UpdatePerInstanceConfigs::new(
12001 self.inner.clone(),
12002 )
12003 }
12004
12005 /// Retrieves the specified region-specific Operations resource.
12006 pub fn get_operation(&self) -> super::builder::region_instance_group_managers::GetOperation {
12007 super::builder::region_instance_group_managers::GetOperation::new(self.inner.clone())
12008 }
12009}
12010
12011/// Implements a client for the Google Compute Engine API.
12012///
12013/// # Example
12014/// ```
12015/// # use google_cloud_compute_v1::client::RegionInstanceGroups;
12016/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
12017/// let client = RegionInstanceGroups::builder().build().await?;
12018/// // use `client` to make requests to the Google Compute Engine API.
12019/// # Ok(()) }
12020/// ```
12021///
12022/// # Service Description
12023///
12024/// Service for the `regionInstanceGroups` resource.
12025///
12026/// # Configuration
12027///
12028/// To configure `RegionInstanceGroups` use the `with_*` methods in the type returned
12029/// by [builder()][RegionInstanceGroups::builder]. The default configuration should
12030/// work for most applications. Common configuration changes include
12031///
12032/// * [with_endpoint()]: by default this client uses the global default endpoint
12033/// (`https://compute.googleapis.com`). Applications using regional
12034/// endpoints or running in restricted networks (e.g. a network configured
12035// with [Private Google Access with VPC Service Controls]) may want to
12036/// override this default.
12037/// * [with_credentials()]: by default this client uses
12038/// [Application Default Credentials]. Applications using custom
12039/// authentication may need to override this default.
12040///
12041/// [with_endpoint()]: super::builder::region_instance_groups::ClientBuilder::with_endpoint
12042/// [with_credentials()]: super::builder::region_instance_groups::ClientBuilder::with_credentials
12043/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12044/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12045///
12046/// # Pooling and Cloning
12047///
12048/// `RegionInstanceGroups` holds a connection pool internally, it is advised to
12049/// create one and reuse it. You do not need to wrap `RegionInstanceGroups` in
12050/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12051/// already uses an `Arc` internally.
12052#[cfg(feature = "region-instance-groups")]
12053#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-groups")))]
12054#[derive(Clone, Debug)]
12055pub struct RegionInstanceGroups {
12056 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroups>,
12057}
12058
12059#[cfg(feature = "region-instance-groups")]
12060impl RegionInstanceGroups {
12061 /// Returns a builder for [RegionInstanceGroups].
12062 ///
12063 /// ```
12064 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12065 /// # use google_cloud_compute_v1::client::RegionInstanceGroups;
12066 /// let client = RegionInstanceGroups::builder().build().await?;
12067 /// # Ok(()) }
12068 /// ```
12069 pub fn builder() -> super::builder::region_instance_groups::ClientBuilder {
12070 crate::new_client_builder(super::builder::region_instance_groups::client::Factory)
12071 }
12072
12073 /// Creates a new client from the provided stub.
12074 ///
12075 /// The most common case for calling this function is in tests mocking the
12076 /// client's behavior.
12077 pub fn from_stub<T>(stub: T) -> Self
12078 where
12079 T: super::stub::RegionInstanceGroups + 'static,
12080 {
12081 Self {
12082 inner: std::sync::Arc::new(stub),
12083 }
12084 }
12085
12086 pub(crate) async fn new(
12087 config: gaxi::options::ClientConfig,
12088 ) -> crate::ClientBuilderResult<Self> {
12089 let inner = Self::build_inner(config).await?;
12090 Ok(Self { inner })
12091 }
12092
12093 async fn build_inner(
12094 conf: gaxi::options::ClientConfig,
12095 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroups>>
12096 {
12097 if gaxi::options::tracing_enabled(&conf) {
12098 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12099 }
12100 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12101 }
12102
12103 async fn build_transport(
12104 conf: gaxi::options::ClientConfig,
12105 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroups> {
12106 super::transport::RegionInstanceGroups::new(conf).await
12107 }
12108
12109 async fn build_with_tracing(
12110 conf: gaxi::options::ClientConfig,
12111 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroups> {
12112 Self::build_transport(conf)
12113 .await
12114 .map(super::tracing::RegionInstanceGroups::new)
12115 }
12116
12117 /// Returns the specified instance group resource.
12118 pub fn get(&self) -> super::builder::region_instance_groups::Get {
12119 super::builder::region_instance_groups::Get::new(self.inner.clone())
12120 }
12121
12122 /// Retrieves the list of instance group resources contained within
12123 /// the specified region.
12124 pub fn list(&self) -> super::builder::region_instance_groups::List {
12125 super::builder::region_instance_groups::List::new(self.inner.clone())
12126 }
12127
12128 /// Lists the instances in the specified instance group and displays
12129 /// information about the named ports. Depending on the specified options, this
12130 /// method can list all instances or only the instances that are running.
12131 /// The orderBy query parameter is not supported.
12132 pub fn list_instances(&self) -> super::builder::region_instance_groups::ListInstances {
12133 super::builder::region_instance_groups::ListInstances::new(self.inner.clone())
12134 }
12135
12136 /// Sets the named ports for the specified regional instance group.
12137 pub fn set_named_ports(&self) -> super::builder::region_instance_groups::SetNamedPorts {
12138 super::builder::region_instance_groups::SetNamedPorts::new(self.inner.clone())
12139 }
12140
12141 /// Returns permissions that a caller has on the specified resource.
12142 pub fn test_iam_permissions(
12143 &self,
12144 ) -> super::builder::region_instance_groups::TestIamPermissions {
12145 super::builder::region_instance_groups::TestIamPermissions::new(self.inner.clone())
12146 }
12147
12148 /// Retrieves the specified region-specific Operations resource.
12149 pub fn get_operation(&self) -> super::builder::region_instance_groups::GetOperation {
12150 super::builder::region_instance_groups::GetOperation::new(self.inner.clone())
12151 }
12152}
12153
12154/// Implements a client for the Google Compute Engine API.
12155///
12156/// # Example
12157/// ```
12158/// # use google_cloud_compute_v1::client::RegionInstanceTemplates;
12159/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
12160/// let client = RegionInstanceTemplates::builder().build().await?;
12161/// // use `client` to make requests to the Google Compute Engine API.
12162/// # Ok(()) }
12163/// ```
12164///
12165/// # Service Description
12166///
12167/// Service for the `regionInstanceTemplates` resource.
12168///
12169/// # Configuration
12170///
12171/// To configure `RegionInstanceTemplates` use the `with_*` methods in the type returned
12172/// by [builder()][RegionInstanceTemplates::builder]. The default configuration should
12173/// work for most applications. Common configuration changes include
12174///
12175/// * [with_endpoint()]: by default this client uses the global default endpoint
12176/// (`https://compute.googleapis.com`). Applications using regional
12177/// endpoints or running in restricted networks (e.g. a network configured
12178// with [Private Google Access with VPC Service Controls]) may want to
12179/// override this default.
12180/// * [with_credentials()]: by default this client uses
12181/// [Application Default Credentials]. Applications using custom
12182/// authentication may need to override this default.
12183///
12184/// [with_endpoint()]: super::builder::region_instance_templates::ClientBuilder::with_endpoint
12185/// [with_credentials()]: super::builder::region_instance_templates::ClientBuilder::with_credentials
12186/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12187/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12188///
12189/// # Pooling and Cloning
12190///
12191/// `RegionInstanceTemplates` holds a connection pool internally, it is advised to
12192/// create one and reuse it. You do not need to wrap `RegionInstanceTemplates` in
12193/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12194/// already uses an `Arc` internally.
12195#[cfg(feature = "region-instance-templates")]
12196#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-templates")))]
12197#[derive(Clone, Debug)]
12198pub struct RegionInstanceTemplates {
12199 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceTemplates>,
12200}
12201
12202#[cfg(feature = "region-instance-templates")]
12203impl RegionInstanceTemplates {
12204 /// Returns a builder for [RegionInstanceTemplates].
12205 ///
12206 /// ```
12207 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12208 /// # use google_cloud_compute_v1::client::RegionInstanceTemplates;
12209 /// let client = RegionInstanceTemplates::builder().build().await?;
12210 /// # Ok(()) }
12211 /// ```
12212 pub fn builder() -> super::builder::region_instance_templates::ClientBuilder {
12213 crate::new_client_builder(super::builder::region_instance_templates::client::Factory)
12214 }
12215
12216 /// Creates a new client from the provided stub.
12217 ///
12218 /// The most common case for calling this function is in tests mocking the
12219 /// client's behavior.
12220 pub fn from_stub<T>(stub: T) -> Self
12221 where
12222 T: super::stub::RegionInstanceTemplates + 'static,
12223 {
12224 Self {
12225 inner: std::sync::Arc::new(stub),
12226 }
12227 }
12228
12229 pub(crate) async fn new(
12230 config: gaxi::options::ClientConfig,
12231 ) -> crate::ClientBuilderResult<Self> {
12232 let inner = Self::build_inner(config).await?;
12233 Ok(Self { inner })
12234 }
12235
12236 async fn build_inner(
12237 conf: gaxi::options::ClientConfig,
12238 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionInstanceTemplates>>
12239 {
12240 if gaxi::options::tracing_enabled(&conf) {
12241 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12242 }
12243 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12244 }
12245
12246 async fn build_transport(
12247 conf: gaxi::options::ClientConfig,
12248 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceTemplates> {
12249 super::transport::RegionInstanceTemplates::new(conf).await
12250 }
12251
12252 async fn build_with_tracing(
12253 conf: gaxi::options::ClientConfig,
12254 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceTemplates> {
12255 Self::build_transport(conf)
12256 .await
12257 .map(super::tracing::RegionInstanceTemplates::new)
12258 }
12259
12260 /// Deletes the specified instance template. Deleting an instance template is
12261 /// permanent and cannot be undone.
12262 pub fn delete(&self) -> super::builder::region_instance_templates::Delete {
12263 super::builder::region_instance_templates::Delete::new(self.inner.clone())
12264 }
12265
12266 /// Returns the specified instance template.
12267 pub fn get(&self) -> super::builder::region_instance_templates::Get {
12268 super::builder::region_instance_templates::Get::new(self.inner.clone())
12269 }
12270
12271 /// Creates an instance template in the specified project and region using the
12272 /// global instance template whose URL is included in the request.
12273 pub fn insert(&self) -> super::builder::region_instance_templates::Insert {
12274 super::builder::region_instance_templates::Insert::new(self.inner.clone())
12275 }
12276
12277 /// Retrieves a list of instance templates that are contained within the
12278 /// specified project and region.
12279 pub fn list(&self) -> super::builder::region_instance_templates::List {
12280 super::builder::region_instance_templates::List::new(self.inner.clone())
12281 }
12282
12283 /// Retrieves the specified region-specific Operations resource.
12284 pub fn get_operation(&self) -> super::builder::region_instance_templates::GetOperation {
12285 super::builder::region_instance_templates::GetOperation::new(self.inner.clone())
12286 }
12287}
12288
12289/// Implements a client for the Google Compute Engine API.
12290///
12291/// # Example
12292/// ```
12293/// # use google_cloud_compute_v1::client::RegionInstances;
12294/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
12295/// let client = RegionInstances::builder().build().await?;
12296/// // use `client` to make requests to the Google Compute Engine API.
12297/// # Ok(()) }
12298/// ```
12299///
12300/// # Service Description
12301///
12302/// Service for the `regionInstances` resource.
12303///
12304/// # Configuration
12305///
12306/// To configure `RegionInstances` use the `with_*` methods in the type returned
12307/// by [builder()][RegionInstances::builder]. The default configuration should
12308/// work for most applications. Common configuration changes include
12309///
12310/// * [with_endpoint()]: by default this client uses the global default endpoint
12311/// (`https://compute.googleapis.com`). Applications using regional
12312/// endpoints or running in restricted networks (e.g. a network configured
12313// with [Private Google Access with VPC Service Controls]) may want to
12314/// override this default.
12315/// * [with_credentials()]: by default this client uses
12316/// [Application Default Credentials]. Applications using custom
12317/// authentication may need to override this default.
12318///
12319/// [with_endpoint()]: super::builder::region_instances::ClientBuilder::with_endpoint
12320/// [with_credentials()]: super::builder::region_instances::ClientBuilder::with_credentials
12321/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12322/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12323///
12324/// # Pooling and Cloning
12325///
12326/// `RegionInstances` holds a connection pool internally, it is advised to
12327/// create one and reuse it. You do not need to wrap `RegionInstances` in
12328/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12329/// already uses an `Arc` internally.
12330#[cfg(feature = "region-instances")]
12331#[cfg_attr(docsrs, doc(cfg(feature = "region-instances")))]
12332#[derive(Clone, Debug)]
12333pub struct RegionInstances {
12334 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstances>,
12335}
12336
12337#[cfg(feature = "region-instances")]
12338impl RegionInstances {
12339 /// Returns a builder for [RegionInstances].
12340 ///
12341 /// ```
12342 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12343 /// # use google_cloud_compute_v1::client::RegionInstances;
12344 /// let client = RegionInstances::builder().build().await?;
12345 /// # Ok(()) }
12346 /// ```
12347 pub fn builder() -> super::builder::region_instances::ClientBuilder {
12348 crate::new_client_builder(super::builder::region_instances::client::Factory)
12349 }
12350
12351 /// Creates a new client from the provided stub.
12352 ///
12353 /// The most common case for calling this function is in tests mocking the
12354 /// client's behavior.
12355 pub fn from_stub<T>(stub: T) -> Self
12356 where
12357 T: super::stub::RegionInstances + 'static,
12358 {
12359 Self {
12360 inner: std::sync::Arc::new(stub),
12361 }
12362 }
12363
12364 pub(crate) async fn new(
12365 config: gaxi::options::ClientConfig,
12366 ) -> crate::ClientBuilderResult<Self> {
12367 let inner = Self::build_inner(config).await?;
12368 Ok(Self { inner })
12369 }
12370
12371 async fn build_inner(
12372 conf: gaxi::options::ClientConfig,
12373 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionInstances>> {
12374 if gaxi::options::tracing_enabled(&conf) {
12375 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12376 }
12377 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12378 }
12379
12380 async fn build_transport(
12381 conf: gaxi::options::ClientConfig,
12382 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstances> {
12383 super::transport::RegionInstances::new(conf).await
12384 }
12385
12386 async fn build_with_tracing(
12387 conf: gaxi::options::ClientConfig,
12388 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstances> {
12389 Self::build_transport(conf)
12390 .await
12391 .map(super::tracing::RegionInstances::new)
12392 }
12393
12394 /// Creates multiple instances in a given region. Count specifies the number of
12395 /// instances to create.
12396 pub fn bulk_insert(&self) -> super::builder::region_instances::BulkInsert {
12397 super::builder::region_instances::BulkInsert::new(self.inner.clone())
12398 }
12399
12400 /// Retrieves the specified region-specific Operations resource.
12401 pub fn get_operation(&self) -> super::builder::region_instances::GetOperation {
12402 super::builder::region_instances::GetOperation::new(self.inner.clone())
12403 }
12404}
12405
12406/// Implements a client for the Google Compute Engine API.
12407///
12408/// # Example
12409/// ```
12410/// # use google_cloud_compute_v1::client::RegionInstantSnapshots;
12411/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
12412/// let client = RegionInstantSnapshots::builder().build().await?;
12413/// // use `client` to make requests to the Google Compute Engine API.
12414/// # Ok(()) }
12415/// ```
12416///
12417/// # Service Description
12418///
12419/// Service for the `regionInstantSnapshots` resource.
12420///
12421/// # Configuration
12422///
12423/// To configure `RegionInstantSnapshots` use the `with_*` methods in the type returned
12424/// by [builder()][RegionInstantSnapshots::builder]. The default configuration should
12425/// work for most applications. Common configuration changes include
12426///
12427/// * [with_endpoint()]: by default this client uses the global default endpoint
12428/// (`https://compute.googleapis.com`). Applications using regional
12429/// endpoints or running in restricted networks (e.g. a network configured
12430// with [Private Google Access with VPC Service Controls]) may want to
12431/// override this default.
12432/// * [with_credentials()]: by default this client uses
12433/// [Application Default Credentials]. Applications using custom
12434/// authentication may need to override this default.
12435///
12436/// [with_endpoint()]: super::builder::region_instant_snapshots::ClientBuilder::with_endpoint
12437/// [with_credentials()]: super::builder::region_instant_snapshots::ClientBuilder::with_credentials
12438/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12439/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12440///
12441/// # Pooling and Cloning
12442///
12443/// `RegionInstantSnapshots` holds a connection pool internally, it is advised to
12444/// create one and reuse it. You do not need to wrap `RegionInstantSnapshots` in
12445/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12446/// already uses an `Arc` internally.
12447#[cfg(feature = "region-instant-snapshots")]
12448#[cfg_attr(docsrs, doc(cfg(feature = "region-instant-snapshots")))]
12449#[derive(Clone, Debug)]
12450pub struct RegionInstantSnapshots {
12451 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstantSnapshots>,
12452}
12453
12454#[cfg(feature = "region-instant-snapshots")]
12455impl RegionInstantSnapshots {
12456 /// Returns a builder for [RegionInstantSnapshots].
12457 ///
12458 /// ```
12459 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12460 /// # use google_cloud_compute_v1::client::RegionInstantSnapshots;
12461 /// let client = RegionInstantSnapshots::builder().build().await?;
12462 /// # Ok(()) }
12463 /// ```
12464 pub fn builder() -> super::builder::region_instant_snapshots::ClientBuilder {
12465 crate::new_client_builder(super::builder::region_instant_snapshots::client::Factory)
12466 }
12467
12468 /// Creates a new client from the provided stub.
12469 ///
12470 /// The most common case for calling this function is in tests mocking the
12471 /// client's behavior.
12472 pub fn from_stub<T>(stub: T) -> Self
12473 where
12474 T: super::stub::RegionInstantSnapshots + 'static,
12475 {
12476 Self {
12477 inner: std::sync::Arc::new(stub),
12478 }
12479 }
12480
12481 pub(crate) async fn new(
12482 config: gaxi::options::ClientConfig,
12483 ) -> crate::ClientBuilderResult<Self> {
12484 let inner = Self::build_inner(config).await?;
12485 Ok(Self { inner })
12486 }
12487
12488 async fn build_inner(
12489 conf: gaxi::options::ClientConfig,
12490 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionInstantSnapshots>>
12491 {
12492 if gaxi::options::tracing_enabled(&conf) {
12493 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12494 }
12495 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12496 }
12497
12498 async fn build_transport(
12499 conf: gaxi::options::ClientConfig,
12500 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstantSnapshots> {
12501 super::transport::RegionInstantSnapshots::new(conf).await
12502 }
12503
12504 async fn build_with_tracing(
12505 conf: gaxi::options::ClientConfig,
12506 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstantSnapshots> {
12507 Self::build_transport(conf)
12508 .await
12509 .map(super::tracing::RegionInstantSnapshots::new)
12510 }
12511
12512 /// Deletes the specified InstantSnapshot resource. Keep in mind that deleting
12513 /// a single instantSnapshot might not necessarily delete all the data on that
12514 /// instantSnapshot. If any data on the instantSnapshot that is marked for
12515 /// deletion is needed for subsequent instantSnapshots, the data will be moved
12516 /// to the next corresponding instantSnapshot.
12517 ///
12518 /// For more information, seeDeleting
12519 /// instantSnapshots.
12520 pub fn delete(&self) -> super::builder::region_instant_snapshots::Delete {
12521 super::builder::region_instant_snapshots::Delete::new(self.inner.clone())
12522 }
12523
12524 /// Returns the specified InstantSnapshot resource in the specified region.
12525 pub fn get(&self) -> super::builder::region_instant_snapshots::Get {
12526 super::builder::region_instant_snapshots::Get::new(self.inner.clone())
12527 }
12528
12529 /// Gets the access control policy for a resource. May be empty if no such
12530 /// policy or resource exists.
12531 pub fn get_iam_policy(&self) -> super::builder::region_instant_snapshots::GetIamPolicy {
12532 super::builder::region_instant_snapshots::GetIamPolicy::new(self.inner.clone())
12533 }
12534
12535 /// Creates an instant snapshot in the specified region.
12536 pub fn insert(&self) -> super::builder::region_instant_snapshots::Insert {
12537 super::builder::region_instant_snapshots::Insert::new(self.inner.clone())
12538 }
12539
12540 /// Retrieves the list of InstantSnapshot resources contained within
12541 /// the specified region.
12542 pub fn list(&self) -> super::builder::region_instant_snapshots::List {
12543 super::builder::region_instant_snapshots::List::new(self.inner.clone())
12544 }
12545
12546 /// Sets the access control policy on the specified resource.
12547 /// Replaces any existing policy.
12548 pub fn set_iam_policy(&self) -> super::builder::region_instant_snapshots::SetIamPolicy {
12549 super::builder::region_instant_snapshots::SetIamPolicy::new(self.inner.clone())
12550 }
12551
12552 /// Sets the labels on a instantSnapshot in the given region. To learn more
12553 /// about labels, read the Labeling
12554 /// Resources documentation.
12555 pub fn set_labels(&self) -> super::builder::region_instant_snapshots::SetLabels {
12556 super::builder::region_instant_snapshots::SetLabels::new(self.inner.clone())
12557 }
12558
12559 /// Returns permissions that a caller has on the specified resource.
12560 pub fn test_iam_permissions(
12561 &self,
12562 ) -> super::builder::region_instant_snapshots::TestIamPermissions {
12563 super::builder::region_instant_snapshots::TestIamPermissions::new(self.inner.clone())
12564 }
12565
12566 /// Retrieves the specified region-specific Operations resource.
12567 pub fn get_operation(&self) -> super::builder::region_instant_snapshots::GetOperation {
12568 super::builder::region_instant_snapshots::GetOperation::new(self.inner.clone())
12569 }
12570}
12571
12572/// Implements a client for the Google Compute Engine API.
12573///
12574/// # Example
12575/// ```
12576/// # use google_cloud_compute_v1::client::RegionNetworkEndpointGroups;
12577/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
12578/// let client = RegionNetworkEndpointGroups::builder().build().await?;
12579/// // use `client` to make requests to the Google Compute Engine API.
12580/// # Ok(()) }
12581/// ```
12582///
12583/// # Service Description
12584///
12585/// Service for the `regionNetworkEndpointGroups` resource.
12586///
12587/// # Configuration
12588///
12589/// To configure `RegionNetworkEndpointGroups` use the `with_*` methods in the type returned
12590/// by [builder()][RegionNetworkEndpointGroups::builder]. The default configuration should
12591/// work for most applications. Common configuration changes include
12592///
12593/// * [with_endpoint()]: by default this client uses the global default endpoint
12594/// (`https://compute.googleapis.com`). Applications using regional
12595/// endpoints or running in restricted networks (e.g. a network configured
12596// with [Private Google Access with VPC Service Controls]) may want to
12597/// override this default.
12598/// * [with_credentials()]: by default this client uses
12599/// [Application Default Credentials]. Applications using custom
12600/// authentication may need to override this default.
12601///
12602/// [with_endpoint()]: super::builder::region_network_endpoint_groups::ClientBuilder::with_endpoint
12603/// [with_credentials()]: super::builder::region_network_endpoint_groups::ClientBuilder::with_credentials
12604/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12605/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12606///
12607/// # Pooling and Cloning
12608///
12609/// `RegionNetworkEndpointGroups` holds a connection pool internally, it is advised to
12610/// create one and reuse it. You do not need to wrap `RegionNetworkEndpointGroups` in
12611/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12612/// already uses an `Arc` internally.
12613#[cfg(feature = "region-network-endpoint-groups")]
12614#[cfg_attr(docsrs, doc(cfg(feature = "region-network-endpoint-groups")))]
12615#[derive(Clone, Debug)]
12616pub struct RegionNetworkEndpointGroups {
12617 inner: std::sync::Arc<dyn super::stub::dynamic::RegionNetworkEndpointGroups>,
12618}
12619
12620#[cfg(feature = "region-network-endpoint-groups")]
12621impl RegionNetworkEndpointGroups {
12622 /// Returns a builder for [RegionNetworkEndpointGroups].
12623 ///
12624 /// ```
12625 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12626 /// # use google_cloud_compute_v1::client::RegionNetworkEndpointGroups;
12627 /// let client = RegionNetworkEndpointGroups::builder().build().await?;
12628 /// # Ok(()) }
12629 /// ```
12630 pub fn builder() -> super::builder::region_network_endpoint_groups::ClientBuilder {
12631 crate::new_client_builder(super::builder::region_network_endpoint_groups::client::Factory)
12632 }
12633
12634 /// Creates a new client from the provided stub.
12635 ///
12636 /// The most common case for calling this function is in tests mocking the
12637 /// client's behavior.
12638 pub fn from_stub<T>(stub: T) -> Self
12639 where
12640 T: super::stub::RegionNetworkEndpointGroups + 'static,
12641 {
12642 Self {
12643 inner: std::sync::Arc::new(stub),
12644 }
12645 }
12646
12647 pub(crate) async fn new(
12648 config: gaxi::options::ClientConfig,
12649 ) -> crate::ClientBuilderResult<Self> {
12650 let inner = Self::build_inner(config).await?;
12651 Ok(Self { inner })
12652 }
12653
12654 async fn build_inner(
12655 conf: gaxi::options::ClientConfig,
12656 ) -> crate::ClientBuilderResult<
12657 std::sync::Arc<dyn super::stub::dynamic::RegionNetworkEndpointGroups>,
12658 > {
12659 if gaxi::options::tracing_enabled(&conf) {
12660 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12661 }
12662 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12663 }
12664
12665 async fn build_transport(
12666 conf: gaxi::options::ClientConfig,
12667 ) -> crate::ClientBuilderResult<impl super::stub::RegionNetworkEndpointGroups> {
12668 super::transport::RegionNetworkEndpointGroups::new(conf).await
12669 }
12670
12671 async fn build_with_tracing(
12672 conf: gaxi::options::ClientConfig,
12673 ) -> crate::ClientBuilderResult<impl super::stub::RegionNetworkEndpointGroups> {
12674 Self::build_transport(conf)
12675 .await
12676 .map(super::tracing::RegionNetworkEndpointGroups::new)
12677 }
12678
12679 /// Attach a list of network endpoints to the specified network endpoint group.
12680 pub fn attach_network_endpoints(
12681 &self,
12682 ) -> super::builder::region_network_endpoint_groups::AttachNetworkEndpoints {
12683 super::builder::region_network_endpoint_groups::AttachNetworkEndpoints::new(
12684 self.inner.clone(),
12685 )
12686 }
12687
12688 /// Deletes the specified network endpoint group. Note that the NEG cannot be
12689 /// deleted if it is configured as a backend of a backend service.
12690 pub fn delete(&self) -> super::builder::region_network_endpoint_groups::Delete {
12691 super::builder::region_network_endpoint_groups::Delete::new(self.inner.clone())
12692 }
12693
12694 /// Detach the network endpoint from the specified network endpoint group.
12695 pub fn detach_network_endpoints(
12696 &self,
12697 ) -> super::builder::region_network_endpoint_groups::DetachNetworkEndpoints {
12698 super::builder::region_network_endpoint_groups::DetachNetworkEndpoints::new(
12699 self.inner.clone(),
12700 )
12701 }
12702
12703 /// Returns the specified network endpoint group.
12704 pub fn get(&self) -> super::builder::region_network_endpoint_groups::Get {
12705 super::builder::region_network_endpoint_groups::Get::new(self.inner.clone())
12706 }
12707
12708 /// Creates a network endpoint group in the specified project using the
12709 /// parameters that are included in the request.
12710 ///
12711 /// Note: Use the following APIs to manage network endpoint groups:
12712 ///
12713 /// - To manage NEGs with zonal scope (such as zonal NEGs, hybrid connectivity
12714 /// NEGs): zonal
12715 /// API
12716 /// - To manage NEGs with regional scope (such as regional internet NEGs,
12717 /// serverless NEGs, Private Service Connect NEGs): regional
12718 /// API
12719 /// - To manage NEGs with global scope (such as global internet NEGs):global
12720 /// API
12721 pub fn insert(&self) -> super::builder::region_network_endpoint_groups::Insert {
12722 super::builder::region_network_endpoint_groups::Insert::new(self.inner.clone())
12723 }
12724
12725 /// Retrieves the list of regional network endpoint groups available to the
12726 /// specified project in the given region.
12727 pub fn list(&self) -> super::builder::region_network_endpoint_groups::List {
12728 super::builder::region_network_endpoint_groups::List::new(self.inner.clone())
12729 }
12730
12731 /// Lists the network endpoints in the specified network endpoint group.
12732 pub fn list_network_endpoints(
12733 &self,
12734 ) -> super::builder::region_network_endpoint_groups::ListNetworkEndpoints {
12735 super::builder::region_network_endpoint_groups::ListNetworkEndpoints::new(
12736 self.inner.clone(),
12737 )
12738 }
12739
12740 /// Retrieves the specified region-specific Operations resource.
12741 pub fn get_operation(&self) -> super::builder::region_network_endpoint_groups::GetOperation {
12742 super::builder::region_network_endpoint_groups::GetOperation::new(self.inner.clone())
12743 }
12744}
12745
12746/// Implements a client for the Google Compute Engine API.
12747///
12748/// # Example
12749/// ```
12750/// # use google_cloud_compute_v1::client::RegionNetworkFirewallPolicies;
12751/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
12752/// let client = RegionNetworkFirewallPolicies::builder().build().await?;
12753/// // use `client` to make requests to the Google Compute Engine API.
12754/// # Ok(()) }
12755/// ```
12756///
12757/// # Service Description
12758///
12759/// Service for the `regionNetworkFirewallPolicies` resource.
12760///
12761/// # Configuration
12762///
12763/// To configure `RegionNetworkFirewallPolicies` use the `with_*` methods in the type returned
12764/// by [builder()][RegionNetworkFirewallPolicies::builder]. The default configuration should
12765/// work for most applications. Common configuration changes include
12766///
12767/// * [with_endpoint()]: by default this client uses the global default endpoint
12768/// (`https://compute.googleapis.com`). Applications using regional
12769/// endpoints or running in restricted networks (e.g. a network configured
12770// with [Private Google Access with VPC Service Controls]) may want to
12771/// override this default.
12772/// * [with_credentials()]: by default this client uses
12773/// [Application Default Credentials]. Applications using custom
12774/// authentication may need to override this default.
12775///
12776/// [with_endpoint()]: super::builder::region_network_firewall_policies::ClientBuilder::with_endpoint
12777/// [with_credentials()]: super::builder::region_network_firewall_policies::ClientBuilder::with_credentials
12778/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12779/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12780///
12781/// # Pooling and Cloning
12782///
12783/// `RegionNetworkFirewallPolicies` holds a connection pool internally, it is advised to
12784/// create one and reuse it. You do not need to wrap `RegionNetworkFirewallPolicies` in
12785/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12786/// already uses an `Arc` internally.
12787#[cfg(feature = "region-network-firewall-policies")]
12788#[cfg_attr(docsrs, doc(cfg(feature = "region-network-firewall-policies")))]
12789#[derive(Clone, Debug)]
12790pub struct RegionNetworkFirewallPolicies {
12791 inner: std::sync::Arc<dyn super::stub::dynamic::RegionNetworkFirewallPolicies>,
12792}
12793
12794#[cfg(feature = "region-network-firewall-policies")]
12795impl RegionNetworkFirewallPolicies {
12796 /// Returns a builder for [RegionNetworkFirewallPolicies].
12797 ///
12798 /// ```
12799 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12800 /// # use google_cloud_compute_v1::client::RegionNetworkFirewallPolicies;
12801 /// let client = RegionNetworkFirewallPolicies::builder().build().await?;
12802 /// # Ok(()) }
12803 /// ```
12804 pub fn builder() -> super::builder::region_network_firewall_policies::ClientBuilder {
12805 crate::new_client_builder(super::builder::region_network_firewall_policies::client::Factory)
12806 }
12807
12808 /// Creates a new client from the provided stub.
12809 ///
12810 /// The most common case for calling this function is in tests mocking the
12811 /// client's behavior.
12812 pub fn from_stub<T>(stub: T) -> Self
12813 where
12814 T: super::stub::RegionNetworkFirewallPolicies + 'static,
12815 {
12816 Self {
12817 inner: std::sync::Arc::new(stub),
12818 }
12819 }
12820
12821 pub(crate) async fn new(
12822 config: gaxi::options::ClientConfig,
12823 ) -> crate::ClientBuilderResult<Self> {
12824 let inner = Self::build_inner(config).await?;
12825 Ok(Self { inner })
12826 }
12827
12828 async fn build_inner(
12829 conf: gaxi::options::ClientConfig,
12830 ) -> crate::ClientBuilderResult<
12831 std::sync::Arc<dyn super::stub::dynamic::RegionNetworkFirewallPolicies>,
12832 > {
12833 if gaxi::options::tracing_enabled(&conf) {
12834 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12835 }
12836 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12837 }
12838
12839 async fn build_transport(
12840 conf: gaxi::options::ClientConfig,
12841 ) -> crate::ClientBuilderResult<impl super::stub::RegionNetworkFirewallPolicies> {
12842 super::transport::RegionNetworkFirewallPolicies::new(conf).await
12843 }
12844
12845 async fn build_with_tracing(
12846 conf: gaxi::options::ClientConfig,
12847 ) -> crate::ClientBuilderResult<impl super::stub::RegionNetworkFirewallPolicies> {
12848 Self::build_transport(conf)
12849 .await
12850 .map(super::tracing::RegionNetworkFirewallPolicies::new)
12851 }
12852
12853 /// Inserts an association for the specified network firewall policy.
12854 pub fn add_association(
12855 &self,
12856 ) -> super::builder::region_network_firewall_policies::AddAssociation {
12857 super::builder::region_network_firewall_policies::AddAssociation::new(self.inner.clone())
12858 }
12859
12860 /// Inserts a rule into a network firewall policy.
12861 pub fn add_rule(&self) -> super::builder::region_network_firewall_policies::AddRule {
12862 super::builder::region_network_firewall_policies::AddRule::new(self.inner.clone())
12863 }
12864
12865 /// Copies rules to the specified network firewall policy.
12866 pub fn clone_rules(&self) -> super::builder::region_network_firewall_policies::CloneRules {
12867 super::builder::region_network_firewall_policies::CloneRules::new(self.inner.clone())
12868 }
12869
12870 /// Deletes the specified network firewall policy.
12871 pub fn delete(&self) -> super::builder::region_network_firewall_policies::Delete {
12872 super::builder::region_network_firewall_policies::Delete::new(self.inner.clone())
12873 }
12874
12875 /// Returns the specified network firewall policy.
12876 pub fn get(&self) -> super::builder::region_network_firewall_policies::Get {
12877 super::builder::region_network_firewall_policies::Get::new(self.inner.clone())
12878 }
12879
12880 /// Gets an association with the specified name.
12881 pub fn get_association(
12882 &self,
12883 ) -> super::builder::region_network_firewall_policies::GetAssociation {
12884 super::builder::region_network_firewall_policies::GetAssociation::new(self.inner.clone())
12885 }
12886
12887 /// Returns the effective firewalls on a given network.
12888 pub fn get_effective_firewalls(
12889 &self,
12890 ) -> super::builder::region_network_firewall_policies::GetEffectiveFirewalls {
12891 super::builder::region_network_firewall_policies::GetEffectiveFirewalls::new(
12892 self.inner.clone(),
12893 )
12894 }
12895
12896 /// Gets the access control policy for a resource. May be empty if no such
12897 /// policy or resource exists.
12898 pub fn get_iam_policy(&self) -> super::builder::region_network_firewall_policies::GetIamPolicy {
12899 super::builder::region_network_firewall_policies::GetIamPolicy::new(self.inner.clone())
12900 }
12901
12902 /// Gets a rule of the specified priority.
12903 pub fn get_rule(&self) -> super::builder::region_network_firewall_policies::GetRule {
12904 super::builder::region_network_firewall_policies::GetRule::new(self.inner.clone())
12905 }
12906
12907 /// Creates a new network firewall policy in the specified project and region.
12908 pub fn insert(&self) -> super::builder::region_network_firewall_policies::Insert {
12909 super::builder::region_network_firewall_policies::Insert::new(self.inner.clone())
12910 }
12911
12912 /// Lists all the network firewall policies that have been configured
12913 /// for the specified project in the given region.
12914 pub fn list(&self) -> super::builder::region_network_firewall_policies::List {
12915 super::builder::region_network_firewall_policies::List::new(self.inner.clone())
12916 }
12917
12918 /// Patches the specified network firewall policy.
12919 pub fn patch(&self) -> super::builder::region_network_firewall_policies::Patch {
12920 super::builder::region_network_firewall_policies::Patch::new(self.inner.clone())
12921 }
12922
12923 /// Patches a rule of the specified priority.
12924 pub fn patch_rule(&self) -> super::builder::region_network_firewall_policies::PatchRule {
12925 super::builder::region_network_firewall_policies::PatchRule::new(self.inner.clone())
12926 }
12927
12928 /// Removes an association for the specified network firewall policy.
12929 pub fn remove_association(
12930 &self,
12931 ) -> super::builder::region_network_firewall_policies::RemoveAssociation {
12932 super::builder::region_network_firewall_policies::RemoveAssociation::new(self.inner.clone())
12933 }
12934
12935 /// Deletes a rule of the specified priority.
12936 pub fn remove_rule(&self) -> super::builder::region_network_firewall_policies::RemoveRule {
12937 super::builder::region_network_firewall_policies::RemoveRule::new(self.inner.clone())
12938 }
12939
12940 /// Sets the access control policy on the specified resource.
12941 /// Replaces any existing policy.
12942 pub fn set_iam_policy(&self) -> super::builder::region_network_firewall_policies::SetIamPolicy {
12943 super::builder::region_network_firewall_policies::SetIamPolicy::new(self.inner.clone())
12944 }
12945
12946 /// Returns permissions that a caller has on the specified resource.
12947 pub fn test_iam_permissions(
12948 &self,
12949 ) -> super::builder::region_network_firewall_policies::TestIamPermissions {
12950 super::builder::region_network_firewall_policies::TestIamPermissions::new(
12951 self.inner.clone(),
12952 )
12953 }
12954
12955 /// Retrieves the specified region-specific Operations resource.
12956 pub fn get_operation(&self) -> super::builder::region_network_firewall_policies::GetOperation {
12957 super::builder::region_network_firewall_policies::GetOperation::new(self.inner.clone())
12958 }
12959}
12960
12961/// Implements a client for the Google Compute Engine API.
12962///
12963/// # Example
12964/// ```
12965/// # use google_cloud_compute_v1::client::RegionNotificationEndpoints;
12966/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
12967/// let client = RegionNotificationEndpoints::builder().build().await?;
12968/// // use `client` to make requests to the Google Compute Engine API.
12969/// # Ok(()) }
12970/// ```
12971///
12972/// # Service Description
12973///
12974/// Service for the `regionNotificationEndpoints` resource.
12975///
12976/// # Configuration
12977///
12978/// To configure `RegionNotificationEndpoints` use the `with_*` methods in the type returned
12979/// by [builder()][RegionNotificationEndpoints::builder]. The default configuration should
12980/// work for most applications. Common configuration changes include
12981///
12982/// * [with_endpoint()]: by default this client uses the global default endpoint
12983/// (`https://compute.googleapis.com`). Applications using regional
12984/// endpoints or running in restricted networks (e.g. a network configured
12985// with [Private Google Access with VPC Service Controls]) may want to
12986/// override this default.
12987/// * [with_credentials()]: by default this client uses
12988/// [Application Default Credentials]. Applications using custom
12989/// authentication may need to override this default.
12990///
12991/// [with_endpoint()]: super::builder::region_notification_endpoints::ClientBuilder::with_endpoint
12992/// [with_credentials()]: super::builder::region_notification_endpoints::ClientBuilder::with_credentials
12993/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12994/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12995///
12996/// # Pooling and Cloning
12997///
12998/// `RegionNotificationEndpoints` holds a connection pool internally, it is advised to
12999/// create one and reuse it. You do not need to wrap `RegionNotificationEndpoints` in
13000/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13001/// already uses an `Arc` internally.
13002#[cfg(feature = "region-notification-endpoints")]
13003#[cfg_attr(docsrs, doc(cfg(feature = "region-notification-endpoints")))]
13004#[derive(Clone, Debug)]
13005pub struct RegionNotificationEndpoints {
13006 inner: std::sync::Arc<dyn super::stub::dynamic::RegionNotificationEndpoints>,
13007}
13008
13009#[cfg(feature = "region-notification-endpoints")]
13010impl RegionNotificationEndpoints {
13011 /// Returns a builder for [RegionNotificationEndpoints].
13012 ///
13013 /// ```
13014 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13015 /// # use google_cloud_compute_v1::client::RegionNotificationEndpoints;
13016 /// let client = RegionNotificationEndpoints::builder().build().await?;
13017 /// # Ok(()) }
13018 /// ```
13019 pub fn builder() -> super::builder::region_notification_endpoints::ClientBuilder {
13020 crate::new_client_builder(super::builder::region_notification_endpoints::client::Factory)
13021 }
13022
13023 /// Creates a new client from the provided stub.
13024 ///
13025 /// The most common case for calling this function is in tests mocking the
13026 /// client's behavior.
13027 pub fn from_stub<T>(stub: T) -> Self
13028 where
13029 T: super::stub::RegionNotificationEndpoints + 'static,
13030 {
13031 Self {
13032 inner: std::sync::Arc::new(stub),
13033 }
13034 }
13035
13036 pub(crate) async fn new(
13037 config: gaxi::options::ClientConfig,
13038 ) -> crate::ClientBuilderResult<Self> {
13039 let inner = Self::build_inner(config).await?;
13040 Ok(Self { inner })
13041 }
13042
13043 async fn build_inner(
13044 conf: gaxi::options::ClientConfig,
13045 ) -> crate::ClientBuilderResult<
13046 std::sync::Arc<dyn super::stub::dynamic::RegionNotificationEndpoints>,
13047 > {
13048 if gaxi::options::tracing_enabled(&conf) {
13049 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13050 }
13051 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13052 }
13053
13054 async fn build_transport(
13055 conf: gaxi::options::ClientConfig,
13056 ) -> crate::ClientBuilderResult<impl super::stub::RegionNotificationEndpoints> {
13057 super::transport::RegionNotificationEndpoints::new(conf).await
13058 }
13059
13060 async fn build_with_tracing(
13061 conf: gaxi::options::ClientConfig,
13062 ) -> crate::ClientBuilderResult<impl super::stub::RegionNotificationEndpoints> {
13063 Self::build_transport(conf)
13064 .await
13065 .map(super::tracing::RegionNotificationEndpoints::new)
13066 }
13067
13068 /// Retrieves the list of all NotificationEndpoint resources,
13069 /// regional and global, available to the specified project.
13070 pub fn aggregated_list(&self) -> super::builder::region_notification_endpoints::AggregatedList {
13071 super::builder::region_notification_endpoints::AggregatedList::new(self.inner.clone())
13072 }
13073
13074 /// Deletes the specified NotificationEndpoint in the given region
13075 pub fn delete(&self) -> super::builder::region_notification_endpoints::Delete {
13076 super::builder::region_notification_endpoints::Delete::new(self.inner.clone())
13077 }
13078
13079 /// Returns the specified NotificationEndpoint resource in the given region.
13080 pub fn get(&self) -> super::builder::region_notification_endpoints::Get {
13081 super::builder::region_notification_endpoints::Get::new(self.inner.clone())
13082 }
13083
13084 /// Create a NotificationEndpoint in the specified project in the given region
13085 /// using the parameters that are included in the request.
13086 pub fn insert(&self) -> super::builder::region_notification_endpoints::Insert {
13087 super::builder::region_notification_endpoints::Insert::new(self.inner.clone())
13088 }
13089
13090 /// Lists the NotificationEndpoints for a project in the given region.
13091 pub fn list(&self) -> super::builder::region_notification_endpoints::List {
13092 super::builder::region_notification_endpoints::List::new(self.inner.clone())
13093 }
13094
13095 /// Returns permissions that a caller has on the specified resource.
13096 pub fn test_iam_permissions(
13097 &self,
13098 ) -> super::builder::region_notification_endpoints::TestIamPermissions {
13099 super::builder::region_notification_endpoints::TestIamPermissions::new(self.inner.clone())
13100 }
13101
13102 /// Retrieves the specified region-specific Operations resource.
13103 pub fn get_operation(&self) -> super::builder::region_notification_endpoints::GetOperation {
13104 super::builder::region_notification_endpoints::GetOperation::new(self.inner.clone())
13105 }
13106}
13107
13108/// Implements a client for the Google Compute Engine API.
13109///
13110/// # Example
13111/// ```
13112/// # use google_cloud_compute_v1::client::RegionOperations;
13113/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
13114/// let client = RegionOperations::builder().build().await?;
13115/// // use `client` to make requests to the Google Compute Engine API.
13116/// # Ok(()) }
13117/// ```
13118///
13119/// # Service Description
13120///
13121/// Service for the `regionOperations` resource.
13122///
13123/// # Configuration
13124///
13125/// To configure `RegionOperations` use the `with_*` methods in the type returned
13126/// by [builder()][RegionOperations::builder]. The default configuration should
13127/// work for most applications. Common configuration changes include
13128///
13129/// * [with_endpoint()]: by default this client uses the global default endpoint
13130/// (`https://compute.googleapis.com`). Applications using regional
13131/// endpoints or running in restricted networks (e.g. a network configured
13132// with [Private Google Access with VPC Service Controls]) may want to
13133/// override this default.
13134/// * [with_credentials()]: by default this client uses
13135/// [Application Default Credentials]. Applications using custom
13136/// authentication may need to override this default.
13137///
13138/// [with_endpoint()]: super::builder::region_operations::ClientBuilder::with_endpoint
13139/// [with_credentials()]: super::builder::region_operations::ClientBuilder::with_credentials
13140/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13141/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13142///
13143/// # Pooling and Cloning
13144///
13145/// `RegionOperations` holds a connection pool internally, it is advised to
13146/// create one and reuse it. You do not need to wrap `RegionOperations` in
13147/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13148/// already uses an `Arc` internally.
13149#[cfg(feature = "region-operations")]
13150#[cfg_attr(docsrs, doc(cfg(feature = "region-operations")))]
13151#[derive(Clone, Debug)]
13152pub struct RegionOperations {
13153 inner: std::sync::Arc<dyn super::stub::dynamic::RegionOperations>,
13154}
13155
13156#[cfg(feature = "region-operations")]
13157impl RegionOperations {
13158 /// Returns a builder for [RegionOperations].
13159 ///
13160 /// ```
13161 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13162 /// # use google_cloud_compute_v1::client::RegionOperations;
13163 /// let client = RegionOperations::builder().build().await?;
13164 /// # Ok(()) }
13165 /// ```
13166 pub fn builder() -> super::builder::region_operations::ClientBuilder {
13167 crate::new_client_builder(super::builder::region_operations::client::Factory)
13168 }
13169
13170 /// Creates a new client from the provided stub.
13171 ///
13172 /// The most common case for calling this function is in tests mocking the
13173 /// client's behavior.
13174 pub fn from_stub<T>(stub: T) -> Self
13175 where
13176 T: super::stub::RegionOperations + 'static,
13177 {
13178 Self {
13179 inner: std::sync::Arc::new(stub),
13180 }
13181 }
13182
13183 pub(crate) async fn new(
13184 config: gaxi::options::ClientConfig,
13185 ) -> crate::ClientBuilderResult<Self> {
13186 let inner = Self::build_inner(config).await?;
13187 Ok(Self { inner })
13188 }
13189
13190 async fn build_inner(
13191 conf: gaxi::options::ClientConfig,
13192 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionOperations>>
13193 {
13194 if gaxi::options::tracing_enabled(&conf) {
13195 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13196 }
13197 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13198 }
13199
13200 async fn build_transport(
13201 conf: gaxi::options::ClientConfig,
13202 ) -> crate::ClientBuilderResult<impl super::stub::RegionOperations> {
13203 super::transport::RegionOperations::new(conf).await
13204 }
13205
13206 async fn build_with_tracing(
13207 conf: gaxi::options::ClientConfig,
13208 ) -> crate::ClientBuilderResult<impl super::stub::RegionOperations> {
13209 Self::build_transport(conf)
13210 .await
13211 .map(super::tracing::RegionOperations::new)
13212 }
13213
13214 /// Deletes the specified region-specific Operations resource.
13215 pub fn delete(&self) -> super::builder::region_operations::Delete {
13216 super::builder::region_operations::Delete::new(self.inner.clone())
13217 }
13218
13219 /// Retrieves the specified region-specific Operations resource.
13220 pub fn get(&self) -> super::builder::region_operations::Get {
13221 super::builder::region_operations::Get::new(self.inner.clone())
13222 }
13223
13224 /// Retrieves a list of Operation resources contained within
13225 /// the specified region.
13226 pub fn list(&self) -> super::builder::region_operations::List {
13227 super::builder::region_operations::List::new(self.inner.clone())
13228 }
13229
13230 /// Waits for the specified Operation resource to return as `DONE`
13231 /// or for the request to approach the 2 minute deadline, and retrieves the
13232 /// specified Operation resource. This method differs from the
13233 /// `GET` method in that it waits for no more than the default
13234 /// deadline (2 minutes) and then returns the current state of the operation,
13235 /// which might be `DONE` or still in progress.
13236 ///
13237 /// This method is called on a best-effort basis. Specifically:
13238 ///
13239 /// ```norust
13240 /// - In uncommon cases, when the server is overloaded, the request might
13241 /// return before the default deadline is reached, or might return after zero
13242 /// seconds.
13243 /// ```
13244 ///
13245 /// - If the default deadline is reached, there is no guarantee that the
13246 /// operation is actually done when the method returns. Be prepared to retry
13247 /// if the operation is not `DONE`.
13248 pub fn wait(&self) -> super::builder::region_operations::Wait {
13249 super::builder::region_operations::Wait::new(self.inner.clone())
13250 }
13251}
13252
13253/// Implements a client for the Google Compute Engine API.
13254///
13255/// # Example
13256/// ```
13257/// # use google_cloud_compute_v1::client::RegionSecurityPolicies;
13258/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
13259/// let client = RegionSecurityPolicies::builder().build().await?;
13260/// // use `client` to make requests to the Google Compute Engine API.
13261/// # Ok(()) }
13262/// ```
13263///
13264/// # Service Description
13265///
13266/// Service for the `regionSecurityPolicies` resource.
13267///
13268/// # Configuration
13269///
13270/// To configure `RegionSecurityPolicies` use the `with_*` methods in the type returned
13271/// by [builder()][RegionSecurityPolicies::builder]. The default configuration should
13272/// work for most applications. Common configuration changes include
13273///
13274/// * [with_endpoint()]: by default this client uses the global default endpoint
13275/// (`https://compute.googleapis.com`). Applications using regional
13276/// endpoints or running in restricted networks (e.g. a network configured
13277// with [Private Google Access with VPC Service Controls]) may want to
13278/// override this default.
13279/// * [with_credentials()]: by default this client uses
13280/// [Application Default Credentials]. Applications using custom
13281/// authentication may need to override this default.
13282///
13283/// [with_endpoint()]: super::builder::region_security_policies::ClientBuilder::with_endpoint
13284/// [with_credentials()]: super::builder::region_security_policies::ClientBuilder::with_credentials
13285/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13286/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13287///
13288/// # Pooling and Cloning
13289///
13290/// `RegionSecurityPolicies` holds a connection pool internally, it is advised to
13291/// create one and reuse it. You do not need to wrap `RegionSecurityPolicies` in
13292/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13293/// already uses an `Arc` internally.
13294#[cfg(feature = "region-security-policies")]
13295#[cfg_attr(docsrs, doc(cfg(feature = "region-security-policies")))]
13296#[derive(Clone, Debug)]
13297pub struct RegionSecurityPolicies {
13298 inner: std::sync::Arc<dyn super::stub::dynamic::RegionSecurityPolicies>,
13299}
13300
13301#[cfg(feature = "region-security-policies")]
13302impl RegionSecurityPolicies {
13303 /// Returns a builder for [RegionSecurityPolicies].
13304 ///
13305 /// ```
13306 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13307 /// # use google_cloud_compute_v1::client::RegionSecurityPolicies;
13308 /// let client = RegionSecurityPolicies::builder().build().await?;
13309 /// # Ok(()) }
13310 /// ```
13311 pub fn builder() -> super::builder::region_security_policies::ClientBuilder {
13312 crate::new_client_builder(super::builder::region_security_policies::client::Factory)
13313 }
13314
13315 /// Creates a new client from the provided stub.
13316 ///
13317 /// The most common case for calling this function is in tests mocking the
13318 /// client's behavior.
13319 pub fn from_stub<T>(stub: T) -> Self
13320 where
13321 T: super::stub::RegionSecurityPolicies + 'static,
13322 {
13323 Self {
13324 inner: std::sync::Arc::new(stub),
13325 }
13326 }
13327
13328 pub(crate) async fn new(
13329 config: gaxi::options::ClientConfig,
13330 ) -> crate::ClientBuilderResult<Self> {
13331 let inner = Self::build_inner(config).await?;
13332 Ok(Self { inner })
13333 }
13334
13335 async fn build_inner(
13336 conf: gaxi::options::ClientConfig,
13337 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionSecurityPolicies>>
13338 {
13339 if gaxi::options::tracing_enabled(&conf) {
13340 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13341 }
13342 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13343 }
13344
13345 async fn build_transport(
13346 conf: gaxi::options::ClientConfig,
13347 ) -> crate::ClientBuilderResult<impl super::stub::RegionSecurityPolicies> {
13348 super::transport::RegionSecurityPolicies::new(conf).await
13349 }
13350
13351 async fn build_with_tracing(
13352 conf: gaxi::options::ClientConfig,
13353 ) -> crate::ClientBuilderResult<impl super::stub::RegionSecurityPolicies> {
13354 Self::build_transport(conf)
13355 .await
13356 .map(super::tracing::RegionSecurityPolicies::new)
13357 }
13358
13359 /// Inserts a rule into a security policy.
13360 pub fn add_rule(&self) -> super::builder::region_security_policies::AddRule {
13361 super::builder::region_security_policies::AddRule::new(self.inner.clone())
13362 }
13363
13364 /// Deletes the specified policy.
13365 pub fn delete(&self) -> super::builder::region_security_policies::Delete {
13366 super::builder::region_security_policies::Delete::new(self.inner.clone())
13367 }
13368
13369 /// List all of the ordered rules present in a single specified policy.
13370 pub fn get(&self) -> super::builder::region_security_policies::Get {
13371 super::builder::region_security_policies::Get::new(self.inner.clone())
13372 }
13373
13374 /// Gets a rule at the specified priority.
13375 pub fn get_rule(&self) -> super::builder::region_security_policies::GetRule {
13376 super::builder::region_security_policies::GetRule::new(self.inner.clone())
13377 }
13378
13379 /// Creates a new policy in the specified project using the data included in
13380 /// the request.
13381 pub fn insert(&self) -> super::builder::region_security_policies::Insert {
13382 super::builder::region_security_policies::Insert::new(self.inner.clone())
13383 }
13384
13385 /// List all the policies that have been configured for the specified project
13386 /// and region.
13387 pub fn list(&self) -> super::builder::region_security_policies::List {
13388 super::builder::region_security_policies::List::new(self.inner.clone())
13389 }
13390
13391 /// Patches the specified policy with the data included in the request. To
13392 /// clear fields in the policy, leave the fields empty and specify them in the
13393 /// updateMask. This cannot be used to be update the rules in the policy.
13394 /// Please use the per rule methods like addRule, patchRule, and removeRule
13395 /// instead.
13396 pub fn patch(&self) -> super::builder::region_security_policies::Patch {
13397 super::builder::region_security_policies::Patch::new(self.inner.clone())
13398 }
13399
13400 /// Patches a rule at the specified priority. To clear fields in the rule,
13401 /// leave the fields empty and specify them in the updateMask.
13402 pub fn patch_rule(&self) -> super::builder::region_security_policies::PatchRule {
13403 super::builder::region_security_policies::PatchRule::new(self.inner.clone())
13404 }
13405
13406 /// Deletes a rule at the specified priority.
13407 pub fn remove_rule(&self) -> super::builder::region_security_policies::RemoveRule {
13408 super::builder::region_security_policies::RemoveRule::new(self.inner.clone())
13409 }
13410
13411 /// Sets the labels on a security policy. To learn more about labels,
13412 /// read the Labeling Resources
13413 /// documentation.
13414 pub fn set_labels(&self) -> super::builder::region_security_policies::SetLabels {
13415 super::builder::region_security_policies::SetLabels::new(self.inner.clone())
13416 }
13417
13418 /// Retrieves the specified region-specific Operations resource.
13419 pub fn get_operation(&self) -> super::builder::region_security_policies::GetOperation {
13420 super::builder::region_security_policies::GetOperation::new(self.inner.clone())
13421 }
13422}
13423
13424/// Implements a client for the Google Compute Engine API.
13425///
13426/// # Example
13427/// ```
13428/// # use google_cloud_compute_v1::client::RegionSslCertificates;
13429/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
13430/// let client = RegionSslCertificates::builder().build().await?;
13431/// // use `client` to make requests to the Google Compute Engine API.
13432/// # Ok(()) }
13433/// ```
13434///
13435/// # Service Description
13436///
13437/// Service for the `regionSslCertificates` resource.
13438///
13439/// # Configuration
13440///
13441/// To configure `RegionSslCertificates` use the `with_*` methods in the type returned
13442/// by [builder()][RegionSslCertificates::builder]. The default configuration should
13443/// work for most applications. Common configuration changes include
13444///
13445/// * [with_endpoint()]: by default this client uses the global default endpoint
13446/// (`https://compute.googleapis.com`). Applications using regional
13447/// endpoints or running in restricted networks (e.g. a network configured
13448// with [Private Google Access with VPC Service Controls]) may want to
13449/// override this default.
13450/// * [with_credentials()]: by default this client uses
13451/// [Application Default Credentials]. Applications using custom
13452/// authentication may need to override this default.
13453///
13454/// [with_endpoint()]: super::builder::region_ssl_certificates::ClientBuilder::with_endpoint
13455/// [with_credentials()]: super::builder::region_ssl_certificates::ClientBuilder::with_credentials
13456/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13457/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13458///
13459/// # Pooling and Cloning
13460///
13461/// `RegionSslCertificates` holds a connection pool internally, it is advised to
13462/// create one and reuse it. You do not need to wrap `RegionSslCertificates` in
13463/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13464/// already uses an `Arc` internally.
13465#[cfg(feature = "region-ssl-certificates")]
13466#[cfg_attr(docsrs, doc(cfg(feature = "region-ssl-certificates")))]
13467#[derive(Clone, Debug)]
13468pub struct RegionSslCertificates {
13469 inner: std::sync::Arc<dyn super::stub::dynamic::RegionSslCertificates>,
13470}
13471
13472#[cfg(feature = "region-ssl-certificates")]
13473impl RegionSslCertificates {
13474 /// Returns a builder for [RegionSslCertificates].
13475 ///
13476 /// ```
13477 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13478 /// # use google_cloud_compute_v1::client::RegionSslCertificates;
13479 /// let client = RegionSslCertificates::builder().build().await?;
13480 /// # Ok(()) }
13481 /// ```
13482 pub fn builder() -> super::builder::region_ssl_certificates::ClientBuilder {
13483 crate::new_client_builder(super::builder::region_ssl_certificates::client::Factory)
13484 }
13485
13486 /// Creates a new client from the provided stub.
13487 ///
13488 /// The most common case for calling this function is in tests mocking the
13489 /// client's behavior.
13490 pub fn from_stub<T>(stub: T) -> Self
13491 where
13492 T: super::stub::RegionSslCertificates + 'static,
13493 {
13494 Self {
13495 inner: std::sync::Arc::new(stub),
13496 }
13497 }
13498
13499 pub(crate) async fn new(
13500 config: gaxi::options::ClientConfig,
13501 ) -> crate::ClientBuilderResult<Self> {
13502 let inner = Self::build_inner(config).await?;
13503 Ok(Self { inner })
13504 }
13505
13506 async fn build_inner(
13507 conf: gaxi::options::ClientConfig,
13508 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionSslCertificates>>
13509 {
13510 if gaxi::options::tracing_enabled(&conf) {
13511 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13512 }
13513 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13514 }
13515
13516 async fn build_transport(
13517 conf: gaxi::options::ClientConfig,
13518 ) -> crate::ClientBuilderResult<impl super::stub::RegionSslCertificates> {
13519 super::transport::RegionSslCertificates::new(conf).await
13520 }
13521
13522 async fn build_with_tracing(
13523 conf: gaxi::options::ClientConfig,
13524 ) -> crate::ClientBuilderResult<impl super::stub::RegionSslCertificates> {
13525 Self::build_transport(conf)
13526 .await
13527 .map(super::tracing::RegionSslCertificates::new)
13528 }
13529
13530 /// Deletes the specified SslCertificate resource in the region.
13531 pub fn delete(&self) -> super::builder::region_ssl_certificates::Delete {
13532 super::builder::region_ssl_certificates::Delete::new(self.inner.clone())
13533 }
13534
13535 /// Returns the specified SslCertificate resource in the specified region. Get
13536 /// a list of available SSL certificates by making a list()
13537 /// request.
13538 pub fn get(&self) -> super::builder::region_ssl_certificates::Get {
13539 super::builder::region_ssl_certificates::Get::new(self.inner.clone())
13540 }
13541
13542 /// Creates a SslCertificate resource in the specified project and region using
13543 /// the data included in the request
13544 pub fn insert(&self) -> super::builder::region_ssl_certificates::Insert {
13545 super::builder::region_ssl_certificates::Insert::new(self.inner.clone())
13546 }
13547
13548 /// Retrieves the list of SslCertificate resources available to the specified
13549 /// project in the specified region.
13550 pub fn list(&self) -> super::builder::region_ssl_certificates::List {
13551 super::builder::region_ssl_certificates::List::new(self.inner.clone())
13552 }
13553
13554 /// Retrieves the specified region-specific Operations resource.
13555 pub fn get_operation(&self) -> super::builder::region_ssl_certificates::GetOperation {
13556 super::builder::region_ssl_certificates::GetOperation::new(self.inner.clone())
13557 }
13558}
13559
13560/// Implements a client for the Google Compute Engine API.
13561///
13562/// # Example
13563/// ```
13564/// # use google_cloud_compute_v1::client::RegionSslPolicies;
13565/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
13566/// let client = RegionSslPolicies::builder().build().await?;
13567/// // use `client` to make requests to the Google Compute Engine API.
13568/// # Ok(()) }
13569/// ```
13570///
13571/// # Service Description
13572///
13573/// Service for the `regionSslPolicies` resource.
13574///
13575/// # Configuration
13576///
13577/// To configure `RegionSslPolicies` use the `with_*` methods in the type returned
13578/// by [builder()][RegionSslPolicies::builder]. The default configuration should
13579/// work for most applications. Common configuration changes include
13580///
13581/// * [with_endpoint()]: by default this client uses the global default endpoint
13582/// (`https://compute.googleapis.com`). Applications using regional
13583/// endpoints or running in restricted networks (e.g. a network configured
13584// with [Private Google Access with VPC Service Controls]) may want to
13585/// override this default.
13586/// * [with_credentials()]: by default this client uses
13587/// [Application Default Credentials]. Applications using custom
13588/// authentication may need to override this default.
13589///
13590/// [with_endpoint()]: super::builder::region_ssl_policies::ClientBuilder::with_endpoint
13591/// [with_credentials()]: super::builder::region_ssl_policies::ClientBuilder::with_credentials
13592/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13593/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13594///
13595/// # Pooling and Cloning
13596///
13597/// `RegionSslPolicies` holds a connection pool internally, it is advised to
13598/// create one and reuse it. You do not need to wrap `RegionSslPolicies` in
13599/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13600/// already uses an `Arc` internally.
13601#[cfg(feature = "region-ssl-policies")]
13602#[cfg_attr(docsrs, doc(cfg(feature = "region-ssl-policies")))]
13603#[derive(Clone, Debug)]
13604pub struct RegionSslPolicies {
13605 inner: std::sync::Arc<dyn super::stub::dynamic::RegionSslPolicies>,
13606}
13607
13608#[cfg(feature = "region-ssl-policies")]
13609impl RegionSslPolicies {
13610 /// Returns a builder for [RegionSslPolicies].
13611 ///
13612 /// ```
13613 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13614 /// # use google_cloud_compute_v1::client::RegionSslPolicies;
13615 /// let client = RegionSslPolicies::builder().build().await?;
13616 /// # Ok(()) }
13617 /// ```
13618 pub fn builder() -> super::builder::region_ssl_policies::ClientBuilder {
13619 crate::new_client_builder(super::builder::region_ssl_policies::client::Factory)
13620 }
13621
13622 /// Creates a new client from the provided stub.
13623 ///
13624 /// The most common case for calling this function is in tests mocking the
13625 /// client's behavior.
13626 pub fn from_stub<T>(stub: T) -> Self
13627 where
13628 T: super::stub::RegionSslPolicies + 'static,
13629 {
13630 Self {
13631 inner: std::sync::Arc::new(stub),
13632 }
13633 }
13634
13635 pub(crate) async fn new(
13636 config: gaxi::options::ClientConfig,
13637 ) -> crate::ClientBuilderResult<Self> {
13638 let inner = Self::build_inner(config).await?;
13639 Ok(Self { inner })
13640 }
13641
13642 async fn build_inner(
13643 conf: gaxi::options::ClientConfig,
13644 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionSslPolicies>>
13645 {
13646 if gaxi::options::tracing_enabled(&conf) {
13647 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13648 }
13649 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13650 }
13651
13652 async fn build_transport(
13653 conf: gaxi::options::ClientConfig,
13654 ) -> crate::ClientBuilderResult<impl super::stub::RegionSslPolicies> {
13655 super::transport::RegionSslPolicies::new(conf).await
13656 }
13657
13658 async fn build_with_tracing(
13659 conf: gaxi::options::ClientConfig,
13660 ) -> crate::ClientBuilderResult<impl super::stub::RegionSslPolicies> {
13661 Self::build_transport(conf)
13662 .await
13663 .map(super::tracing::RegionSslPolicies::new)
13664 }
13665
13666 /// Deletes the specified SSL policy. The SSL policy resource can be deleted
13667 /// only if it is not in use by any TargetHttpsProxy or TargetSslProxy
13668 /// resources.
13669 pub fn delete(&self) -> super::builder::region_ssl_policies::Delete {
13670 super::builder::region_ssl_policies::Delete::new(self.inner.clone())
13671 }
13672
13673 /// Lists all of the ordered rules present in a single specified policy.
13674 pub fn get(&self) -> super::builder::region_ssl_policies::Get {
13675 super::builder::region_ssl_policies::Get::new(self.inner.clone())
13676 }
13677
13678 /// Creates a new policy in the specified project and region using the data
13679 /// included in the request.
13680 pub fn insert(&self) -> super::builder::region_ssl_policies::Insert {
13681 super::builder::region_ssl_policies::Insert::new(self.inner.clone())
13682 }
13683
13684 /// Lists all the SSL policies that have been configured for the specified
13685 /// project and region.
13686 pub fn list(&self) -> super::builder::region_ssl_policies::List {
13687 super::builder::region_ssl_policies::List::new(self.inner.clone())
13688 }
13689
13690 /// Lists all features that can be specified in the SSL policy when using
13691 /// custom profile.
13692 pub fn list_available_features(
13693 &self,
13694 ) -> super::builder::region_ssl_policies::ListAvailableFeatures {
13695 super::builder::region_ssl_policies::ListAvailableFeatures::new(self.inner.clone())
13696 }
13697
13698 /// Patches the specified SSL policy with the data included in the request.
13699 pub fn patch(&self) -> super::builder::region_ssl_policies::Patch {
13700 super::builder::region_ssl_policies::Patch::new(self.inner.clone())
13701 }
13702
13703 /// Retrieves the specified region-specific Operations resource.
13704 pub fn get_operation(&self) -> super::builder::region_ssl_policies::GetOperation {
13705 super::builder::region_ssl_policies::GetOperation::new(self.inner.clone())
13706 }
13707}
13708
13709/// Implements a client for the Google Compute Engine API.
13710///
13711/// # Example
13712/// ```
13713/// # use google_cloud_compute_v1::client::RegionTargetHttpProxies;
13714/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
13715/// let client = RegionTargetHttpProxies::builder().build().await?;
13716/// // use `client` to make requests to the Google Compute Engine API.
13717/// # Ok(()) }
13718/// ```
13719///
13720/// # Service Description
13721///
13722/// Service for the `regionTargetHttpProxies` resource.
13723///
13724/// # Configuration
13725///
13726/// To configure `RegionTargetHttpProxies` use the `with_*` methods in the type returned
13727/// by [builder()][RegionTargetHttpProxies::builder]. The default configuration should
13728/// work for most applications. Common configuration changes include
13729///
13730/// * [with_endpoint()]: by default this client uses the global default endpoint
13731/// (`https://compute.googleapis.com`). Applications using regional
13732/// endpoints or running in restricted networks (e.g. a network configured
13733// with [Private Google Access with VPC Service Controls]) may want to
13734/// override this default.
13735/// * [with_credentials()]: by default this client uses
13736/// [Application Default Credentials]. Applications using custom
13737/// authentication may need to override this default.
13738///
13739/// [with_endpoint()]: super::builder::region_target_http_proxies::ClientBuilder::with_endpoint
13740/// [with_credentials()]: super::builder::region_target_http_proxies::ClientBuilder::with_credentials
13741/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13742/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13743///
13744/// # Pooling and Cloning
13745///
13746/// `RegionTargetHttpProxies` holds a connection pool internally, it is advised to
13747/// create one and reuse it. You do not need to wrap `RegionTargetHttpProxies` in
13748/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13749/// already uses an `Arc` internally.
13750#[cfg(feature = "region-target-http-proxies")]
13751#[cfg_attr(docsrs, doc(cfg(feature = "region-target-http-proxies")))]
13752#[derive(Clone, Debug)]
13753pub struct RegionTargetHttpProxies {
13754 inner: std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpProxies>,
13755}
13756
13757#[cfg(feature = "region-target-http-proxies")]
13758impl RegionTargetHttpProxies {
13759 /// Returns a builder for [RegionTargetHttpProxies].
13760 ///
13761 /// ```
13762 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13763 /// # use google_cloud_compute_v1::client::RegionTargetHttpProxies;
13764 /// let client = RegionTargetHttpProxies::builder().build().await?;
13765 /// # Ok(()) }
13766 /// ```
13767 pub fn builder() -> super::builder::region_target_http_proxies::ClientBuilder {
13768 crate::new_client_builder(super::builder::region_target_http_proxies::client::Factory)
13769 }
13770
13771 /// Creates a new client from the provided stub.
13772 ///
13773 /// The most common case for calling this function is in tests mocking the
13774 /// client's behavior.
13775 pub fn from_stub<T>(stub: T) -> Self
13776 where
13777 T: super::stub::RegionTargetHttpProxies + 'static,
13778 {
13779 Self {
13780 inner: std::sync::Arc::new(stub),
13781 }
13782 }
13783
13784 pub(crate) async fn new(
13785 config: gaxi::options::ClientConfig,
13786 ) -> crate::ClientBuilderResult<Self> {
13787 let inner = Self::build_inner(config).await?;
13788 Ok(Self { inner })
13789 }
13790
13791 async fn build_inner(
13792 conf: gaxi::options::ClientConfig,
13793 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpProxies>>
13794 {
13795 if gaxi::options::tracing_enabled(&conf) {
13796 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13797 }
13798 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13799 }
13800
13801 async fn build_transport(
13802 conf: gaxi::options::ClientConfig,
13803 ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetHttpProxies> {
13804 super::transport::RegionTargetHttpProxies::new(conf).await
13805 }
13806
13807 async fn build_with_tracing(
13808 conf: gaxi::options::ClientConfig,
13809 ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetHttpProxies> {
13810 Self::build_transport(conf)
13811 .await
13812 .map(super::tracing::RegionTargetHttpProxies::new)
13813 }
13814
13815 /// Deletes the specified TargetHttpProxy resource.
13816 pub fn delete(&self) -> super::builder::region_target_http_proxies::Delete {
13817 super::builder::region_target_http_proxies::Delete::new(self.inner.clone())
13818 }
13819
13820 /// Returns the specified TargetHttpProxy resource in the specified region.
13821 pub fn get(&self) -> super::builder::region_target_http_proxies::Get {
13822 super::builder::region_target_http_proxies::Get::new(self.inner.clone())
13823 }
13824
13825 /// Creates a TargetHttpProxy resource in the specified project and region
13826 /// using the data included in the request.
13827 pub fn insert(&self) -> super::builder::region_target_http_proxies::Insert {
13828 super::builder::region_target_http_proxies::Insert::new(self.inner.clone())
13829 }
13830
13831 /// Retrieves the list of TargetHttpProxy resources available
13832 /// to the specified project in the specified region.
13833 pub fn list(&self) -> super::builder::region_target_http_proxies::List {
13834 super::builder::region_target_http_proxies::List::new(self.inner.clone())
13835 }
13836
13837 /// Changes the URL map for TargetHttpProxy.
13838 pub fn set_url_map(&self) -> super::builder::region_target_http_proxies::SetUrlMap {
13839 super::builder::region_target_http_proxies::SetUrlMap::new(self.inner.clone())
13840 }
13841
13842 /// Retrieves the specified region-specific Operations resource.
13843 pub fn get_operation(&self) -> super::builder::region_target_http_proxies::GetOperation {
13844 super::builder::region_target_http_proxies::GetOperation::new(self.inner.clone())
13845 }
13846}
13847
13848/// Implements a client for the Google Compute Engine API.
13849///
13850/// # Example
13851/// ```
13852/// # use google_cloud_compute_v1::client::RegionTargetHttpsProxies;
13853/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
13854/// let client = RegionTargetHttpsProxies::builder().build().await?;
13855/// // use `client` to make requests to the Google Compute Engine API.
13856/// # Ok(()) }
13857/// ```
13858///
13859/// # Service Description
13860///
13861/// Service for the `regionTargetHttpsProxies` resource.
13862///
13863/// # Configuration
13864///
13865/// To configure `RegionTargetHttpsProxies` use the `with_*` methods in the type returned
13866/// by [builder()][RegionTargetHttpsProxies::builder]. The default configuration should
13867/// work for most applications. Common configuration changes include
13868///
13869/// * [with_endpoint()]: by default this client uses the global default endpoint
13870/// (`https://compute.googleapis.com`). Applications using regional
13871/// endpoints or running in restricted networks (e.g. a network configured
13872// with [Private Google Access with VPC Service Controls]) may want to
13873/// override this default.
13874/// * [with_credentials()]: by default this client uses
13875/// [Application Default Credentials]. Applications using custom
13876/// authentication may need to override this default.
13877///
13878/// [with_endpoint()]: super::builder::region_target_https_proxies::ClientBuilder::with_endpoint
13879/// [with_credentials()]: super::builder::region_target_https_proxies::ClientBuilder::with_credentials
13880/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13881/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13882///
13883/// # Pooling and Cloning
13884///
13885/// `RegionTargetHttpsProxies` holds a connection pool internally, it is advised to
13886/// create one and reuse it. You do not need to wrap `RegionTargetHttpsProxies` in
13887/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13888/// already uses an `Arc` internally.
13889#[cfg(feature = "region-target-https-proxies")]
13890#[cfg_attr(docsrs, doc(cfg(feature = "region-target-https-proxies")))]
13891#[derive(Clone, Debug)]
13892pub struct RegionTargetHttpsProxies {
13893 inner: std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpsProxies>,
13894}
13895
13896#[cfg(feature = "region-target-https-proxies")]
13897impl RegionTargetHttpsProxies {
13898 /// Returns a builder for [RegionTargetHttpsProxies].
13899 ///
13900 /// ```
13901 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13902 /// # use google_cloud_compute_v1::client::RegionTargetHttpsProxies;
13903 /// let client = RegionTargetHttpsProxies::builder().build().await?;
13904 /// # Ok(()) }
13905 /// ```
13906 pub fn builder() -> super::builder::region_target_https_proxies::ClientBuilder {
13907 crate::new_client_builder(super::builder::region_target_https_proxies::client::Factory)
13908 }
13909
13910 /// Creates a new client from the provided stub.
13911 ///
13912 /// The most common case for calling this function is in tests mocking the
13913 /// client's behavior.
13914 pub fn from_stub<T>(stub: T) -> Self
13915 where
13916 T: super::stub::RegionTargetHttpsProxies + 'static,
13917 {
13918 Self {
13919 inner: std::sync::Arc::new(stub),
13920 }
13921 }
13922
13923 pub(crate) async fn new(
13924 config: gaxi::options::ClientConfig,
13925 ) -> crate::ClientBuilderResult<Self> {
13926 let inner = Self::build_inner(config).await?;
13927 Ok(Self { inner })
13928 }
13929
13930 async fn build_inner(
13931 conf: gaxi::options::ClientConfig,
13932 ) -> crate::ClientBuilderResult<
13933 std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpsProxies>,
13934 > {
13935 if gaxi::options::tracing_enabled(&conf) {
13936 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13937 }
13938 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13939 }
13940
13941 async fn build_transport(
13942 conf: gaxi::options::ClientConfig,
13943 ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetHttpsProxies> {
13944 super::transport::RegionTargetHttpsProxies::new(conf).await
13945 }
13946
13947 async fn build_with_tracing(
13948 conf: gaxi::options::ClientConfig,
13949 ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetHttpsProxies> {
13950 Self::build_transport(conf)
13951 .await
13952 .map(super::tracing::RegionTargetHttpsProxies::new)
13953 }
13954
13955 /// Deletes the specified TargetHttpsProxy resource.
13956 pub fn delete(&self) -> super::builder::region_target_https_proxies::Delete {
13957 super::builder::region_target_https_proxies::Delete::new(self.inner.clone())
13958 }
13959
13960 /// Returns the specified TargetHttpsProxy resource in the specified region.
13961 pub fn get(&self) -> super::builder::region_target_https_proxies::Get {
13962 super::builder::region_target_https_proxies::Get::new(self.inner.clone())
13963 }
13964
13965 /// Creates a TargetHttpsProxy resource in the specified project and region
13966 /// using the data included in the request.
13967 pub fn insert(&self) -> super::builder::region_target_https_proxies::Insert {
13968 super::builder::region_target_https_proxies::Insert::new(self.inner.clone())
13969 }
13970
13971 /// Retrieves the list of TargetHttpsProxy resources available
13972 /// to the specified project in the specified region.
13973 pub fn list(&self) -> super::builder::region_target_https_proxies::List {
13974 super::builder::region_target_https_proxies::List::new(self.inner.clone())
13975 }
13976
13977 /// Patches the specified regional TargetHttpsProxy resource with the data
13978 /// included in the request. This method supports PATCH
13979 /// semantics and usesJSON merge
13980 /// patch format and processing rules.
13981 pub fn patch(&self) -> super::builder::region_target_https_proxies::Patch {
13982 super::builder::region_target_https_proxies::Patch::new(self.inner.clone())
13983 }
13984
13985 /// Replaces SslCertificates for TargetHttpsProxy.
13986 pub fn set_ssl_certificates(
13987 &self,
13988 ) -> super::builder::region_target_https_proxies::SetSslCertificates {
13989 super::builder::region_target_https_proxies::SetSslCertificates::new(self.inner.clone())
13990 }
13991
13992 /// Changes the URL map for TargetHttpsProxy.
13993 pub fn set_url_map(&self) -> super::builder::region_target_https_proxies::SetUrlMap {
13994 super::builder::region_target_https_proxies::SetUrlMap::new(self.inner.clone())
13995 }
13996
13997 /// Retrieves the specified region-specific Operations resource.
13998 pub fn get_operation(&self) -> super::builder::region_target_https_proxies::GetOperation {
13999 super::builder::region_target_https_proxies::GetOperation::new(self.inner.clone())
14000 }
14001}
14002
14003/// Implements a client for the Google Compute Engine API.
14004///
14005/// # Example
14006/// ```
14007/// # use google_cloud_compute_v1::client::RegionTargetTcpProxies;
14008/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
14009/// let client = RegionTargetTcpProxies::builder().build().await?;
14010/// // use `client` to make requests to the Google Compute Engine API.
14011/// # Ok(()) }
14012/// ```
14013///
14014/// # Service Description
14015///
14016/// Service for the `regionTargetTcpProxies` resource.
14017///
14018/// # Configuration
14019///
14020/// To configure `RegionTargetTcpProxies` use the `with_*` methods in the type returned
14021/// by [builder()][RegionTargetTcpProxies::builder]. The default configuration should
14022/// work for most applications. Common configuration changes include
14023///
14024/// * [with_endpoint()]: by default this client uses the global default endpoint
14025/// (`https://compute.googleapis.com`). Applications using regional
14026/// endpoints or running in restricted networks (e.g. a network configured
14027// with [Private Google Access with VPC Service Controls]) may want to
14028/// override this default.
14029/// * [with_credentials()]: by default this client uses
14030/// [Application Default Credentials]. Applications using custom
14031/// authentication may need to override this default.
14032///
14033/// [with_endpoint()]: super::builder::region_target_tcp_proxies::ClientBuilder::with_endpoint
14034/// [with_credentials()]: super::builder::region_target_tcp_proxies::ClientBuilder::with_credentials
14035/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14036/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14037///
14038/// # Pooling and Cloning
14039///
14040/// `RegionTargetTcpProxies` holds a connection pool internally, it is advised to
14041/// create one and reuse it. You do not need to wrap `RegionTargetTcpProxies` in
14042/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14043/// already uses an `Arc` internally.
14044#[cfg(feature = "region-target-tcp-proxies")]
14045#[cfg_attr(docsrs, doc(cfg(feature = "region-target-tcp-proxies")))]
14046#[derive(Clone, Debug)]
14047pub struct RegionTargetTcpProxies {
14048 inner: std::sync::Arc<dyn super::stub::dynamic::RegionTargetTcpProxies>,
14049}
14050
14051#[cfg(feature = "region-target-tcp-proxies")]
14052impl RegionTargetTcpProxies {
14053 /// Returns a builder for [RegionTargetTcpProxies].
14054 ///
14055 /// ```
14056 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14057 /// # use google_cloud_compute_v1::client::RegionTargetTcpProxies;
14058 /// let client = RegionTargetTcpProxies::builder().build().await?;
14059 /// # Ok(()) }
14060 /// ```
14061 pub fn builder() -> super::builder::region_target_tcp_proxies::ClientBuilder {
14062 crate::new_client_builder(super::builder::region_target_tcp_proxies::client::Factory)
14063 }
14064
14065 /// Creates a new client from the provided stub.
14066 ///
14067 /// The most common case for calling this function is in tests mocking the
14068 /// client's behavior.
14069 pub fn from_stub<T>(stub: T) -> Self
14070 where
14071 T: super::stub::RegionTargetTcpProxies + 'static,
14072 {
14073 Self {
14074 inner: std::sync::Arc::new(stub),
14075 }
14076 }
14077
14078 pub(crate) async fn new(
14079 config: gaxi::options::ClientConfig,
14080 ) -> crate::ClientBuilderResult<Self> {
14081 let inner = Self::build_inner(config).await?;
14082 Ok(Self { inner })
14083 }
14084
14085 async fn build_inner(
14086 conf: gaxi::options::ClientConfig,
14087 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionTargetTcpProxies>>
14088 {
14089 if gaxi::options::tracing_enabled(&conf) {
14090 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14091 }
14092 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14093 }
14094
14095 async fn build_transport(
14096 conf: gaxi::options::ClientConfig,
14097 ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetTcpProxies> {
14098 super::transport::RegionTargetTcpProxies::new(conf).await
14099 }
14100
14101 async fn build_with_tracing(
14102 conf: gaxi::options::ClientConfig,
14103 ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetTcpProxies> {
14104 Self::build_transport(conf)
14105 .await
14106 .map(super::tracing::RegionTargetTcpProxies::new)
14107 }
14108
14109 /// Deletes the specified TargetTcpProxy resource.
14110 pub fn delete(&self) -> super::builder::region_target_tcp_proxies::Delete {
14111 super::builder::region_target_tcp_proxies::Delete::new(self.inner.clone())
14112 }
14113
14114 /// Returns the specified TargetTcpProxy resource.
14115 pub fn get(&self) -> super::builder::region_target_tcp_proxies::Get {
14116 super::builder::region_target_tcp_proxies::Get::new(self.inner.clone())
14117 }
14118
14119 /// Creates a TargetTcpProxy resource in the specified project and region using
14120 /// the data included in the request.
14121 pub fn insert(&self) -> super::builder::region_target_tcp_proxies::Insert {
14122 super::builder::region_target_tcp_proxies::Insert::new(self.inner.clone())
14123 }
14124
14125 /// Retrieves a list of TargetTcpProxy resources
14126 /// available to the specified project in a given region.
14127 pub fn list(&self) -> super::builder::region_target_tcp_proxies::List {
14128 super::builder::region_target_tcp_proxies::List::new(self.inner.clone())
14129 }
14130
14131 /// Retrieves the specified region-specific Operations resource.
14132 pub fn get_operation(&self) -> super::builder::region_target_tcp_proxies::GetOperation {
14133 super::builder::region_target_tcp_proxies::GetOperation::new(self.inner.clone())
14134 }
14135}
14136
14137/// Implements a client for the Google Compute Engine API.
14138///
14139/// # Example
14140/// ```
14141/// # use google_cloud_compute_v1::client::RegionUrlMaps;
14142/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
14143/// let client = RegionUrlMaps::builder().build().await?;
14144/// // use `client` to make requests to the Google Compute Engine API.
14145/// # Ok(()) }
14146/// ```
14147///
14148/// # Service Description
14149///
14150/// Service for the `regionUrlMaps` resource.
14151///
14152/// # Configuration
14153///
14154/// To configure `RegionUrlMaps` use the `with_*` methods in the type returned
14155/// by [builder()][RegionUrlMaps::builder]. The default configuration should
14156/// work for most applications. Common configuration changes include
14157///
14158/// * [with_endpoint()]: by default this client uses the global default endpoint
14159/// (`https://compute.googleapis.com`). Applications using regional
14160/// endpoints or running in restricted networks (e.g. a network configured
14161// with [Private Google Access with VPC Service Controls]) may want to
14162/// override this default.
14163/// * [with_credentials()]: by default this client uses
14164/// [Application Default Credentials]. Applications using custom
14165/// authentication may need to override this default.
14166///
14167/// [with_endpoint()]: super::builder::region_url_maps::ClientBuilder::with_endpoint
14168/// [with_credentials()]: super::builder::region_url_maps::ClientBuilder::with_credentials
14169/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14170/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14171///
14172/// # Pooling and Cloning
14173///
14174/// `RegionUrlMaps` holds a connection pool internally, it is advised to
14175/// create one and reuse it. You do not need to wrap `RegionUrlMaps` in
14176/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14177/// already uses an `Arc` internally.
14178#[cfg(feature = "region-url-maps")]
14179#[cfg_attr(docsrs, doc(cfg(feature = "region-url-maps")))]
14180#[derive(Clone, Debug)]
14181pub struct RegionUrlMaps {
14182 inner: std::sync::Arc<dyn super::stub::dynamic::RegionUrlMaps>,
14183}
14184
14185#[cfg(feature = "region-url-maps")]
14186impl RegionUrlMaps {
14187 /// Returns a builder for [RegionUrlMaps].
14188 ///
14189 /// ```
14190 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14191 /// # use google_cloud_compute_v1::client::RegionUrlMaps;
14192 /// let client = RegionUrlMaps::builder().build().await?;
14193 /// # Ok(()) }
14194 /// ```
14195 pub fn builder() -> super::builder::region_url_maps::ClientBuilder {
14196 crate::new_client_builder(super::builder::region_url_maps::client::Factory)
14197 }
14198
14199 /// Creates a new client from the provided stub.
14200 ///
14201 /// The most common case for calling this function is in tests mocking the
14202 /// client's behavior.
14203 pub fn from_stub<T>(stub: T) -> Self
14204 where
14205 T: super::stub::RegionUrlMaps + 'static,
14206 {
14207 Self {
14208 inner: std::sync::Arc::new(stub),
14209 }
14210 }
14211
14212 pub(crate) async fn new(
14213 config: gaxi::options::ClientConfig,
14214 ) -> crate::ClientBuilderResult<Self> {
14215 let inner = Self::build_inner(config).await?;
14216 Ok(Self { inner })
14217 }
14218
14219 async fn build_inner(
14220 conf: gaxi::options::ClientConfig,
14221 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionUrlMaps>> {
14222 if gaxi::options::tracing_enabled(&conf) {
14223 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14224 }
14225 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14226 }
14227
14228 async fn build_transport(
14229 conf: gaxi::options::ClientConfig,
14230 ) -> crate::ClientBuilderResult<impl super::stub::RegionUrlMaps> {
14231 super::transport::RegionUrlMaps::new(conf).await
14232 }
14233
14234 async fn build_with_tracing(
14235 conf: gaxi::options::ClientConfig,
14236 ) -> crate::ClientBuilderResult<impl super::stub::RegionUrlMaps> {
14237 Self::build_transport(conf)
14238 .await
14239 .map(super::tracing::RegionUrlMaps::new)
14240 }
14241
14242 /// Deletes the specified UrlMap resource.
14243 pub fn delete(&self) -> super::builder::region_url_maps::Delete {
14244 super::builder::region_url_maps::Delete::new(self.inner.clone())
14245 }
14246
14247 /// Returns the specified UrlMap resource.
14248 pub fn get(&self) -> super::builder::region_url_maps::Get {
14249 super::builder::region_url_maps::Get::new(self.inner.clone())
14250 }
14251
14252 /// Creates a UrlMap resource in the specified project using
14253 /// the data included in the request.
14254 pub fn insert(&self) -> super::builder::region_url_maps::Insert {
14255 super::builder::region_url_maps::Insert::new(self.inner.clone())
14256 }
14257
14258 /// Retrieves the list of UrlMap resources available to the specified
14259 /// project in the specified region.
14260 pub fn list(&self) -> super::builder::region_url_maps::List {
14261 super::builder::region_url_maps::List::new(self.inner.clone())
14262 }
14263
14264 /// Patches the specified UrlMap resource with the data included in the
14265 /// request. This method supportsPATCH
14266 /// semantics and usesJSON merge
14267 /// patch format and processing rules.
14268 pub fn patch(&self) -> super::builder::region_url_maps::Patch {
14269 super::builder::region_url_maps::Patch::new(self.inner.clone())
14270 }
14271
14272 /// Updates the specified UrlMap resource with the data included in the
14273 /// request.
14274 pub fn update(&self) -> super::builder::region_url_maps::Update {
14275 super::builder::region_url_maps::Update::new(self.inner.clone())
14276 }
14277
14278 /// Runs static validation for the UrlMap. In particular, the tests of the
14279 /// provided UrlMap will be run. Calling this method does NOT create the
14280 /// UrlMap.
14281 pub fn validate(&self) -> super::builder::region_url_maps::Validate {
14282 super::builder::region_url_maps::Validate::new(self.inner.clone())
14283 }
14284
14285 /// Retrieves the specified region-specific Operations resource.
14286 pub fn get_operation(&self) -> super::builder::region_url_maps::GetOperation {
14287 super::builder::region_url_maps::GetOperation::new(self.inner.clone())
14288 }
14289}
14290
14291/// Implements a client for the Google Compute Engine API.
14292///
14293/// # Example
14294/// ```
14295/// # use google_cloud_compute_v1::client::RegionZones;
14296/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
14297/// let client = RegionZones::builder().build().await?;
14298/// // use `client` to make requests to the Google Compute Engine API.
14299/// # Ok(()) }
14300/// ```
14301///
14302/// # Service Description
14303///
14304/// Service for the `regionZones` resource.
14305///
14306/// # Configuration
14307///
14308/// To configure `RegionZones` use the `with_*` methods in the type returned
14309/// by [builder()][RegionZones::builder]. The default configuration should
14310/// work for most applications. Common configuration changes include
14311///
14312/// * [with_endpoint()]: by default this client uses the global default endpoint
14313/// (`https://compute.googleapis.com`). Applications using regional
14314/// endpoints or running in restricted networks (e.g. a network configured
14315// with [Private Google Access with VPC Service Controls]) may want to
14316/// override this default.
14317/// * [with_credentials()]: by default this client uses
14318/// [Application Default Credentials]. Applications using custom
14319/// authentication may need to override this default.
14320///
14321/// [with_endpoint()]: super::builder::region_zones::ClientBuilder::with_endpoint
14322/// [with_credentials()]: super::builder::region_zones::ClientBuilder::with_credentials
14323/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14324/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14325///
14326/// # Pooling and Cloning
14327///
14328/// `RegionZones` holds a connection pool internally, it is advised to
14329/// create one and reuse it. You do not need to wrap `RegionZones` in
14330/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14331/// already uses an `Arc` internally.
14332#[cfg(feature = "region-zones")]
14333#[cfg_attr(docsrs, doc(cfg(feature = "region-zones")))]
14334#[derive(Clone, Debug)]
14335pub struct RegionZones {
14336 inner: std::sync::Arc<dyn super::stub::dynamic::RegionZones>,
14337}
14338
14339#[cfg(feature = "region-zones")]
14340impl RegionZones {
14341 /// Returns a builder for [RegionZones].
14342 ///
14343 /// ```
14344 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14345 /// # use google_cloud_compute_v1::client::RegionZones;
14346 /// let client = RegionZones::builder().build().await?;
14347 /// # Ok(()) }
14348 /// ```
14349 pub fn builder() -> super::builder::region_zones::ClientBuilder {
14350 crate::new_client_builder(super::builder::region_zones::client::Factory)
14351 }
14352
14353 /// Creates a new client from the provided stub.
14354 ///
14355 /// The most common case for calling this function is in tests mocking the
14356 /// client's behavior.
14357 pub fn from_stub<T>(stub: T) -> Self
14358 where
14359 T: super::stub::RegionZones + 'static,
14360 {
14361 Self {
14362 inner: std::sync::Arc::new(stub),
14363 }
14364 }
14365
14366 pub(crate) async fn new(
14367 config: gaxi::options::ClientConfig,
14368 ) -> crate::ClientBuilderResult<Self> {
14369 let inner = Self::build_inner(config).await?;
14370 Ok(Self { inner })
14371 }
14372
14373 async fn build_inner(
14374 conf: gaxi::options::ClientConfig,
14375 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionZones>> {
14376 if gaxi::options::tracing_enabled(&conf) {
14377 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14378 }
14379 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14380 }
14381
14382 async fn build_transport(
14383 conf: gaxi::options::ClientConfig,
14384 ) -> crate::ClientBuilderResult<impl super::stub::RegionZones> {
14385 super::transport::RegionZones::new(conf).await
14386 }
14387
14388 async fn build_with_tracing(
14389 conf: gaxi::options::ClientConfig,
14390 ) -> crate::ClientBuilderResult<impl super::stub::RegionZones> {
14391 Self::build_transport(conf)
14392 .await
14393 .map(super::tracing::RegionZones::new)
14394 }
14395
14396 /// Retrieves the list of Zone resources under the specific region available to
14397 /// the specified project.
14398 pub fn list(&self) -> super::builder::region_zones::List {
14399 super::builder::region_zones::List::new(self.inner.clone())
14400 }
14401}
14402
14403/// Implements a client for the Google Compute Engine API.
14404///
14405/// # Example
14406/// ```
14407/// # use google_cloud_compute_v1::client::Regions;
14408/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
14409/// let client = Regions::builder().build().await?;
14410/// // use `client` to make requests to the Google Compute Engine API.
14411/// # Ok(()) }
14412/// ```
14413///
14414/// # Service Description
14415///
14416/// Service for the `regions` resource.
14417///
14418/// # Configuration
14419///
14420/// To configure `Regions` use the `with_*` methods in the type returned
14421/// by [builder()][Regions::builder]. The default configuration should
14422/// work for most applications. Common configuration changes include
14423///
14424/// * [with_endpoint()]: by default this client uses the global default endpoint
14425/// (`https://compute.googleapis.com`). Applications using regional
14426/// endpoints or running in restricted networks (e.g. a network configured
14427// with [Private Google Access with VPC Service Controls]) may want to
14428/// override this default.
14429/// * [with_credentials()]: by default this client uses
14430/// [Application Default Credentials]. Applications using custom
14431/// authentication may need to override this default.
14432///
14433/// [with_endpoint()]: super::builder::regions::ClientBuilder::with_endpoint
14434/// [with_credentials()]: super::builder::regions::ClientBuilder::with_credentials
14435/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14436/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14437///
14438/// # Pooling and Cloning
14439///
14440/// `Regions` holds a connection pool internally, it is advised to
14441/// create one and reuse it. You do not need to wrap `Regions` in
14442/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14443/// already uses an `Arc` internally.
14444#[cfg(feature = "regions")]
14445#[cfg_attr(docsrs, doc(cfg(feature = "regions")))]
14446#[derive(Clone, Debug)]
14447pub struct Regions {
14448 inner: std::sync::Arc<dyn super::stub::dynamic::Regions>,
14449}
14450
14451#[cfg(feature = "regions")]
14452impl Regions {
14453 /// Returns a builder for [Regions].
14454 ///
14455 /// ```
14456 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14457 /// # use google_cloud_compute_v1::client::Regions;
14458 /// let client = Regions::builder().build().await?;
14459 /// # Ok(()) }
14460 /// ```
14461 pub fn builder() -> super::builder::regions::ClientBuilder {
14462 crate::new_client_builder(super::builder::regions::client::Factory)
14463 }
14464
14465 /// Creates a new client from the provided stub.
14466 ///
14467 /// The most common case for calling this function is in tests mocking the
14468 /// client's behavior.
14469 pub fn from_stub<T>(stub: T) -> Self
14470 where
14471 T: super::stub::Regions + 'static,
14472 {
14473 Self {
14474 inner: std::sync::Arc::new(stub),
14475 }
14476 }
14477
14478 pub(crate) async fn new(
14479 config: gaxi::options::ClientConfig,
14480 ) -> crate::ClientBuilderResult<Self> {
14481 let inner = Self::build_inner(config).await?;
14482 Ok(Self { inner })
14483 }
14484
14485 async fn build_inner(
14486 conf: gaxi::options::ClientConfig,
14487 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Regions>> {
14488 if gaxi::options::tracing_enabled(&conf) {
14489 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14490 }
14491 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14492 }
14493
14494 async fn build_transport(
14495 conf: gaxi::options::ClientConfig,
14496 ) -> crate::ClientBuilderResult<impl super::stub::Regions> {
14497 super::transport::Regions::new(conf).await
14498 }
14499
14500 async fn build_with_tracing(
14501 conf: gaxi::options::ClientConfig,
14502 ) -> crate::ClientBuilderResult<impl super::stub::Regions> {
14503 Self::build_transport(conf)
14504 .await
14505 .map(super::tracing::Regions::new)
14506 }
14507
14508 /// Returns the specified Region resource.
14509 ///
14510 /// To decrease latency for this method, you can optionally omit any unneeded
14511 /// information from the response by using a field mask. This practice is
14512 /// especially recommended for unused quota information (the `quotas` field).
14513 /// To exclude one or more fields, set your request's `fields` query parameter
14514 /// to only include the fields you need. For example, to only include the `id`
14515 /// and `selfLink` fields, add the query parameter `?fields=id,selfLink` to
14516 /// your request.
14517 ///
14518 /// This method fails if the quota information is unavailable for the region
14519 /// and if the organization policy constraint
14520 /// compute.requireBasicQuotaInResponse is enforced. This
14521 /// constraint, when enforced, disables the fail-open behaviour when quota
14522 /// information (the `items.quotas` field) is unavailable for the region.
14523 /// It is recommended to use the default setting
14524 /// for the constraint unless your application requires the fail-closed
14525 /// behaviour for this method.
14526 pub fn get(&self) -> super::builder::regions::Get {
14527 super::builder::regions::Get::new(self.inner.clone())
14528 }
14529
14530 /// Retrieves the list of region resources available to the specified project.
14531 ///
14532 /// To decrease latency for this method, you can optionally omit any unneeded
14533 /// information from the response by using a field mask. This practice is
14534 /// especially recommended for unused quota information
14535 /// (the `items.quotas` field).
14536 /// To exclude one or more fields, set your request's `fields` query parameter
14537 /// to only include the fields you need. For example, to only include the `id`
14538 /// and `selfLink` fields, add the query parameter `?fields=id,selfLink` to
14539 /// your request.
14540 ///
14541 /// This method fails if the quota information is unavailable for the region
14542 /// and if the organization policy constraint
14543 /// compute.requireBasicQuotaInResponse is enforced. This
14544 /// constraint, when enforced, disables the fail-open behaviour when quota
14545 /// information (the `items.quotas` field) is unavailable for the region.
14546 /// It is recommended to use the default setting
14547 /// for the constraint unless your application requires the fail-closed
14548 /// behaviour for this method.
14549 pub fn list(&self) -> super::builder::regions::List {
14550 super::builder::regions::List::new(self.inner.clone())
14551 }
14552}
14553
14554/// Implements a client for the Google Compute Engine API.
14555///
14556/// # Example
14557/// ```
14558/// # use google_cloud_compute_v1::client::ReservationBlocks;
14559/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
14560/// let client = ReservationBlocks::builder().build().await?;
14561/// // use `client` to make requests to the Google Compute Engine API.
14562/// # Ok(()) }
14563/// ```
14564///
14565/// # Service Description
14566///
14567/// Service for the `reservationBlocks` resource.
14568///
14569/// # Configuration
14570///
14571/// To configure `ReservationBlocks` use the `with_*` methods in the type returned
14572/// by [builder()][ReservationBlocks::builder]. The default configuration should
14573/// work for most applications. Common configuration changes include
14574///
14575/// * [with_endpoint()]: by default this client uses the global default endpoint
14576/// (`https://compute.googleapis.com`). Applications using regional
14577/// endpoints or running in restricted networks (e.g. a network configured
14578// with [Private Google Access with VPC Service Controls]) may want to
14579/// override this default.
14580/// * [with_credentials()]: by default this client uses
14581/// [Application Default Credentials]. Applications using custom
14582/// authentication may need to override this default.
14583///
14584/// [with_endpoint()]: super::builder::reservation_blocks::ClientBuilder::with_endpoint
14585/// [with_credentials()]: super::builder::reservation_blocks::ClientBuilder::with_credentials
14586/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14587/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14588///
14589/// # Pooling and Cloning
14590///
14591/// `ReservationBlocks` holds a connection pool internally, it is advised to
14592/// create one and reuse it. You do not need to wrap `ReservationBlocks` in
14593/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14594/// already uses an `Arc` internally.
14595#[cfg(feature = "reservation-blocks")]
14596#[cfg_attr(docsrs, doc(cfg(feature = "reservation-blocks")))]
14597#[derive(Clone, Debug)]
14598pub struct ReservationBlocks {
14599 inner: std::sync::Arc<dyn super::stub::dynamic::ReservationBlocks>,
14600}
14601
14602#[cfg(feature = "reservation-blocks")]
14603impl ReservationBlocks {
14604 /// Returns a builder for [ReservationBlocks].
14605 ///
14606 /// ```
14607 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14608 /// # use google_cloud_compute_v1::client::ReservationBlocks;
14609 /// let client = ReservationBlocks::builder().build().await?;
14610 /// # Ok(()) }
14611 /// ```
14612 pub fn builder() -> super::builder::reservation_blocks::ClientBuilder {
14613 crate::new_client_builder(super::builder::reservation_blocks::client::Factory)
14614 }
14615
14616 /// Creates a new client from the provided stub.
14617 ///
14618 /// The most common case for calling this function is in tests mocking the
14619 /// client's behavior.
14620 pub fn from_stub<T>(stub: T) -> Self
14621 where
14622 T: super::stub::ReservationBlocks + 'static,
14623 {
14624 Self {
14625 inner: std::sync::Arc::new(stub),
14626 }
14627 }
14628
14629 pub(crate) async fn new(
14630 config: gaxi::options::ClientConfig,
14631 ) -> crate::ClientBuilderResult<Self> {
14632 let inner = Self::build_inner(config).await?;
14633 Ok(Self { inner })
14634 }
14635
14636 async fn build_inner(
14637 conf: gaxi::options::ClientConfig,
14638 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ReservationBlocks>>
14639 {
14640 if gaxi::options::tracing_enabled(&conf) {
14641 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14642 }
14643 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14644 }
14645
14646 async fn build_transport(
14647 conf: gaxi::options::ClientConfig,
14648 ) -> crate::ClientBuilderResult<impl super::stub::ReservationBlocks> {
14649 super::transport::ReservationBlocks::new(conf).await
14650 }
14651
14652 async fn build_with_tracing(
14653 conf: gaxi::options::ClientConfig,
14654 ) -> crate::ClientBuilderResult<impl super::stub::ReservationBlocks> {
14655 Self::build_transport(conf)
14656 .await
14657 .map(super::tracing::ReservationBlocks::new)
14658 }
14659
14660 /// Retrieves information about the specified reservation block.
14661 pub fn get(&self) -> super::builder::reservation_blocks::Get {
14662 super::builder::reservation_blocks::Get::new(self.inner.clone())
14663 }
14664
14665 /// Gets the access control policy for a resource. May be empty if no such
14666 /// policy or resource exists.
14667 pub fn get_iam_policy(&self) -> super::builder::reservation_blocks::GetIamPolicy {
14668 super::builder::reservation_blocks::GetIamPolicy::new(self.inner.clone())
14669 }
14670
14671 /// Retrieves a list of reservation blocks under a single reservation.
14672 pub fn list(&self) -> super::builder::reservation_blocks::List {
14673 super::builder::reservation_blocks::List::new(self.inner.clone())
14674 }
14675
14676 /// Allows customers to perform maintenance on a reservation block
14677 pub fn perform_maintenance(&self) -> super::builder::reservation_blocks::PerformMaintenance {
14678 super::builder::reservation_blocks::PerformMaintenance::new(self.inner.clone())
14679 }
14680
14681 /// Sets the access control policy on the specified resource.
14682 /// Replaces any existing policy.
14683 pub fn set_iam_policy(&self) -> super::builder::reservation_blocks::SetIamPolicy {
14684 super::builder::reservation_blocks::SetIamPolicy::new(self.inner.clone())
14685 }
14686
14687 /// Returns permissions that a caller has on the specified resource.
14688 pub fn test_iam_permissions(&self) -> super::builder::reservation_blocks::TestIamPermissions {
14689 super::builder::reservation_blocks::TestIamPermissions::new(self.inner.clone())
14690 }
14691
14692 /// Retrieves the specified zone-specific Operations resource.
14693 pub fn get_operation(&self) -> super::builder::reservation_blocks::GetOperation {
14694 super::builder::reservation_blocks::GetOperation::new(self.inner.clone())
14695 }
14696}
14697
14698/// Implements a client for the Google Compute Engine API.
14699///
14700/// # Example
14701/// ```
14702/// # use google_cloud_compute_v1::client::ReservationSlots;
14703/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
14704/// let client = ReservationSlots::builder().build().await?;
14705/// // use `client` to make requests to the Google Compute Engine API.
14706/// # Ok(()) }
14707/// ```
14708///
14709/// # Service Description
14710///
14711/// Service for the `reservationSlots` resource.
14712///
14713/// # Configuration
14714///
14715/// To configure `ReservationSlots` use the `with_*` methods in the type returned
14716/// by [builder()][ReservationSlots::builder]. The default configuration should
14717/// work for most applications. Common configuration changes include
14718///
14719/// * [with_endpoint()]: by default this client uses the global default endpoint
14720/// (`https://compute.googleapis.com`). Applications using regional
14721/// endpoints or running in restricted networks (e.g. a network configured
14722// with [Private Google Access with VPC Service Controls]) may want to
14723/// override this default.
14724/// * [with_credentials()]: by default this client uses
14725/// [Application Default Credentials]. Applications using custom
14726/// authentication may need to override this default.
14727///
14728/// [with_endpoint()]: super::builder::reservation_slots::ClientBuilder::with_endpoint
14729/// [with_credentials()]: super::builder::reservation_slots::ClientBuilder::with_credentials
14730/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14731/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14732///
14733/// # Pooling and Cloning
14734///
14735/// `ReservationSlots` holds a connection pool internally, it is advised to
14736/// create one and reuse it. You do not need to wrap `ReservationSlots` in
14737/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14738/// already uses an `Arc` internally.
14739#[cfg(feature = "reservation-slots")]
14740#[cfg_attr(docsrs, doc(cfg(feature = "reservation-slots")))]
14741#[derive(Clone, Debug)]
14742pub struct ReservationSlots {
14743 inner: std::sync::Arc<dyn super::stub::dynamic::ReservationSlots>,
14744}
14745
14746#[cfg(feature = "reservation-slots")]
14747impl ReservationSlots {
14748 /// Returns a builder for [ReservationSlots].
14749 ///
14750 /// ```
14751 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14752 /// # use google_cloud_compute_v1::client::ReservationSlots;
14753 /// let client = ReservationSlots::builder().build().await?;
14754 /// # Ok(()) }
14755 /// ```
14756 pub fn builder() -> super::builder::reservation_slots::ClientBuilder {
14757 crate::new_client_builder(super::builder::reservation_slots::client::Factory)
14758 }
14759
14760 /// Creates a new client from the provided stub.
14761 ///
14762 /// The most common case for calling this function is in tests mocking the
14763 /// client's behavior.
14764 pub fn from_stub<T>(stub: T) -> Self
14765 where
14766 T: super::stub::ReservationSlots + 'static,
14767 {
14768 Self {
14769 inner: std::sync::Arc::new(stub),
14770 }
14771 }
14772
14773 pub(crate) async fn new(
14774 config: gaxi::options::ClientConfig,
14775 ) -> crate::ClientBuilderResult<Self> {
14776 let inner = Self::build_inner(config).await?;
14777 Ok(Self { inner })
14778 }
14779
14780 async fn build_inner(
14781 conf: gaxi::options::ClientConfig,
14782 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ReservationSlots>>
14783 {
14784 if gaxi::options::tracing_enabled(&conf) {
14785 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14786 }
14787 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14788 }
14789
14790 async fn build_transport(
14791 conf: gaxi::options::ClientConfig,
14792 ) -> crate::ClientBuilderResult<impl super::stub::ReservationSlots> {
14793 super::transport::ReservationSlots::new(conf).await
14794 }
14795
14796 async fn build_with_tracing(
14797 conf: gaxi::options::ClientConfig,
14798 ) -> crate::ClientBuilderResult<impl super::stub::ReservationSlots> {
14799 Self::build_transport(conf)
14800 .await
14801 .map(super::tracing::ReservationSlots::new)
14802 }
14803
14804 /// Retrieves information about the specified reservation slot.
14805 pub fn get(&self) -> super::builder::reservation_slots::Get {
14806 super::builder::reservation_slots::Get::new(self.inner.clone())
14807 }
14808
14809 /// Allows customers to get SBOM versions of a reservation slot.
14810 pub fn get_version(&self) -> super::builder::reservation_slots::GetVersion {
14811 super::builder::reservation_slots::GetVersion::new(self.inner.clone())
14812 }
14813
14814 /// Retrieves a list of reservation slots under a single reservation.
14815 pub fn list(&self) -> super::builder::reservation_slots::List {
14816 super::builder::reservation_slots::List::new(self.inner.clone())
14817 }
14818
14819 /// Update a reservation slot in the specified sub-block.
14820 pub fn update(&self) -> super::builder::reservation_slots::Update {
14821 super::builder::reservation_slots::Update::new(self.inner.clone())
14822 }
14823
14824 /// Retrieves the specified zone-specific Operations resource.
14825 pub fn get_operation(&self) -> super::builder::reservation_slots::GetOperation {
14826 super::builder::reservation_slots::GetOperation::new(self.inner.clone())
14827 }
14828}
14829
14830/// Implements a client for the Google Compute Engine API.
14831///
14832/// # Example
14833/// ```
14834/// # use google_cloud_compute_v1::client::ReservationSubBlocks;
14835/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
14836/// let client = ReservationSubBlocks::builder().build().await?;
14837/// // use `client` to make requests to the Google Compute Engine API.
14838/// # Ok(()) }
14839/// ```
14840///
14841/// # Service Description
14842///
14843/// Service for the `reservationSubBlocks` resource.
14844///
14845/// # Configuration
14846///
14847/// To configure `ReservationSubBlocks` use the `with_*` methods in the type returned
14848/// by [builder()][ReservationSubBlocks::builder]. The default configuration should
14849/// work for most applications. Common configuration changes include
14850///
14851/// * [with_endpoint()]: by default this client uses the global default endpoint
14852/// (`https://compute.googleapis.com`). Applications using regional
14853/// endpoints or running in restricted networks (e.g. a network configured
14854// with [Private Google Access with VPC Service Controls]) may want to
14855/// override this default.
14856/// * [with_credentials()]: by default this client uses
14857/// [Application Default Credentials]. Applications using custom
14858/// authentication may need to override this default.
14859///
14860/// [with_endpoint()]: super::builder::reservation_sub_blocks::ClientBuilder::with_endpoint
14861/// [with_credentials()]: super::builder::reservation_sub_blocks::ClientBuilder::with_credentials
14862/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14863/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14864///
14865/// # Pooling and Cloning
14866///
14867/// `ReservationSubBlocks` holds a connection pool internally, it is advised to
14868/// create one and reuse it. You do not need to wrap `ReservationSubBlocks` in
14869/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14870/// already uses an `Arc` internally.
14871#[cfg(feature = "reservation-sub-blocks")]
14872#[cfg_attr(docsrs, doc(cfg(feature = "reservation-sub-blocks")))]
14873#[derive(Clone, Debug)]
14874pub struct ReservationSubBlocks {
14875 inner: std::sync::Arc<dyn super::stub::dynamic::ReservationSubBlocks>,
14876}
14877
14878#[cfg(feature = "reservation-sub-blocks")]
14879impl ReservationSubBlocks {
14880 /// Returns a builder for [ReservationSubBlocks].
14881 ///
14882 /// ```
14883 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14884 /// # use google_cloud_compute_v1::client::ReservationSubBlocks;
14885 /// let client = ReservationSubBlocks::builder().build().await?;
14886 /// # Ok(()) }
14887 /// ```
14888 pub fn builder() -> super::builder::reservation_sub_blocks::ClientBuilder {
14889 crate::new_client_builder(super::builder::reservation_sub_blocks::client::Factory)
14890 }
14891
14892 /// Creates a new client from the provided stub.
14893 ///
14894 /// The most common case for calling this function is in tests mocking the
14895 /// client's behavior.
14896 pub fn from_stub<T>(stub: T) -> Self
14897 where
14898 T: super::stub::ReservationSubBlocks + 'static,
14899 {
14900 Self {
14901 inner: std::sync::Arc::new(stub),
14902 }
14903 }
14904
14905 pub(crate) async fn new(
14906 config: gaxi::options::ClientConfig,
14907 ) -> crate::ClientBuilderResult<Self> {
14908 let inner = Self::build_inner(config).await?;
14909 Ok(Self { inner })
14910 }
14911
14912 async fn build_inner(
14913 conf: gaxi::options::ClientConfig,
14914 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ReservationSubBlocks>>
14915 {
14916 if gaxi::options::tracing_enabled(&conf) {
14917 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14918 }
14919 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14920 }
14921
14922 async fn build_transport(
14923 conf: gaxi::options::ClientConfig,
14924 ) -> crate::ClientBuilderResult<impl super::stub::ReservationSubBlocks> {
14925 super::transport::ReservationSubBlocks::new(conf).await
14926 }
14927
14928 async fn build_with_tracing(
14929 conf: gaxi::options::ClientConfig,
14930 ) -> crate::ClientBuilderResult<impl super::stub::ReservationSubBlocks> {
14931 Self::build_transport(conf)
14932 .await
14933 .map(super::tracing::ReservationSubBlocks::new)
14934 }
14935
14936 /// Retrieves information about the specified reservation subBlock.
14937 pub fn get(&self) -> super::builder::reservation_sub_blocks::Get {
14938 super::builder::reservation_sub_blocks::Get::new(self.inner.clone())
14939 }
14940
14941 /// Gets the access control policy for a resource. May be empty if no such
14942 /// policy or resource exists.
14943 pub fn get_iam_policy(&self) -> super::builder::reservation_sub_blocks::GetIamPolicy {
14944 super::builder::reservation_sub_blocks::GetIamPolicy::new(self.inner.clone())
14945 }
14946
14947 /// Allows customers to get SBOM versions of a reservation subBlock.
14948 pub fn get_version(&self) -> super::builder::reservation_sub_blocks::GetVersion {
14949 super::builder::reservation_sub_blocks::GetVersion::new(self.inner.clone())
14950 }
14951
14952 /// Retrieves a list of reservation subBlocks under a single reservation.
14953 pub fn list(&self) -> super::builder::reservation_sub_blocks::List {
14954 super::builder::reservation_sub_blocks::List::new(self.inner.clone())
14955 }
14956
14957 /// Allows customers to perform maintenance on a reservation subBlock
14958 pub fn perform_maintenance(
14959 &self,
14960 ) -> super::builder::reservation_sub_blocks::PerformMaintenance {
14961 super::builder::reservation_sub_blocks::PerformMaintenance::new(self.inner.clone())
14962 }
14963
14964 /// Allows customers to report a faulty subBlock.
14965 pub fn report_faulty(&self) -> super::builder::reservation_sub_blocks::ReportFaulty {
14966 super::builder::reservation_sub_blocks::ReportFaulty::new(self.inner.clone())
14967 }
14968
14969 /// Sets the access control policy on the specified resource.
14970 /// Replaces any existing policy.
14971 pub fn set_iam_policy(&self) -> super::builder::reservation_sub_blocks::SetIamPolicy {
14972 super::builder::reservation_sub_blocks::SetIamPolicy::new(self.inner.clone())
14973 }
14974
14975 /// Returns permissions that a caller has on the specified resource.
14976 pub fn test_iam_permissions(
14977 &self,
14978 ) -> super::builder::reservation_sub_blocks::TestIamPermissions {
14979 super::builder::reservation_sub_blocks::TestIamPermissions::new(self.inner.clone())
14980 }
14981
14982 /// Retrieves the specified zone-specific Operations resource.
14983 pub fn get_operation(&self) -> super::builder::reservation_sub_blocks::GetOperation {
14984 super::builder::reservation_sub_blocks::GetOperation::new(self.inner.clone())
14985 }
14986}
14987
14988/// Implements a client for the Google Compute Engine API.
14989///
14990/// # Example
14991/// ```
14992/// # use google_cloud_compute_v1::client::Reservations;
14993/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
14994/// let client = Reservations::builder().build().await?;
14995/// // use `client` to make requests to the Google Compute Engine API.
14996/// # Ok(()) }
14997/// ```
14998///
14999/// # Service Description
15000///
15001/// Service for the `reservations` resource.
15002///
15003/// # Configuration
15004///
15005/// To configure `Reservations` use the `with_*` methods in the type returned
15006/// by [builder()][Reservations::builder]. The default configuration should
15007/// work for most applications. Common configuration changes include
15008///
15009/// * [with_endpoint()]: by default this client uses the global default endpoint
15010/// (`https://compute.googleapis.com`). Applications using regional
15011/// endpoints or running in restricted networks (e.g. a network configured
15012// with [Private Google Access with VPC Service Controls]) may want to
15013/// override this default.
15014/// * [with_credentials()]: by default this client uses
15015/// [Application Default Credentials]. Applications using custom
15016/// authentication may need to override this default.
15017///
15018/// [with_endpoint()]: super::builder::reservations::ClientBuilder::with_endpoint
15019/// [with_credentials()]: super::builder::reservations::ClientBuilder::with_credentials
15020/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15021/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15022///
15023/// # Pooling and Cloning
15024///
15025/// `Reservations` holds a connection pool internally, it is advised to
15026/// create one and reuse it. You do not need to wrap `Reservations` in
15027/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15028/// already uses an `Arc` internally.
15029#[cfg(feature = "reservations")]
15030#[cfg_attr(docsrs, doc(cfg(feature = "reservations")))]
15031#[derive(Clone, Debug)]
15032pub struct Reservations {
15033 inner: std::sync::Arc<dyn super::stub::dynamic::Reservations>,
15034}
15035
15036#[cfg(feature = "reservations")]
15037impl Reservations {
15038 /// Returns a builder for [Reservations].
15039 ///
15040 /// ```
15041 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15042 /// # use google_cloud_compute_v1::client::Reservations;
15043 /// let client = Reservations::builder().build().await?;
15044 /// # Ok(()) }
15045 /// ```
15046 pub fn builder() -> super::builder::reservations::ClientBuilder {
15047 crate::new_client_builder(super::builder::reservations::client::Factory)
15048 }
15049
15050 /// Creates a new client from the provided stub.
15051 ///
15052 /// The most common case for calling this function is in tests mocking the
15053 /// client's behavior.
15054 pub fn from_stub<T>(stub: T) -> Self
15055 where
15056 T: super::stub::Reservations + 'static,
15057 {
15058 Self {
15059 inner: std::sync::Arc::new(stub),
15060 }
15061 }
15062
15063 pub(crate) async fn new(
15064 config: gaxi::options::ClientConfig,
15065 ) -> crate::ClientBuilderResult<Self> {
15066 let inner = Self::build_inner(config).await?;
15067 Ok(Self { inner })
15068 }
15069
15070 async fn build_inner(
15071 conf: gaxi::options::ClientConfig,
15072 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Reservations>> {
15073 if gaxi::options::tracing_enabled(&conf) {
15074 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15075 }
15076 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15077 }
15078
15079 async fn build_transport(
15080 conf: gaxi::options::ClientConfig,
15081 ) -> crate::ClientBuilderResult<impl super::stub::Reservations> {
15082 super::transport::Reservations::new(conf).await
15083 }
15084
15085 async fn build_with_tracing(
15086 conf: gaxi::options::ClientConfig,
15087 ) -> crate::ClientBuilderResult<impl super::stub::Reservations> {
15088 Self::build_transport(conf)
15089 .await
15090 .map(super::tracing::Reservations::new)
15091 }
15092
15093 /// Retrieves an aggregated list of reservations.
15094 ///
15095 /// To prevent failure, it is recommended that you set the
15096 /// `returnPartialSuccess` parameter to `true`.
15097 pub fn aggregated_list(&self) -> super::builder::reservations::AggregatedList {
15098 super::builder::reservations::AggregatedList::new(self.inner.clone())
15099 }
15100
15101 /// Deletes the specified reservation.
15102 pub fn delete(&self) -> super::builder::reservations::Delete {
15103 super::builder::reservations::Delete::new(self.inner.clone())
15104 }
15105
15106 /// Retrieves information about the specified reservation.
15107 pub fn get(&self) -> super::builder::reservations::Get {
15108 super::builder::reservations::Get::new(self.inner.clone())
15109 }
15110
15111 /// Gets the access control policy for a resource. May be empty if no such
15112 /// policy or resource exists.
15113 pub fn get_iam_policy(&self) -> super::builder::reservations::GetIamPolicy {
15114 super::builder::reservations::GetIamPolicy::new(self.inner.clone())
15115 }
15116
15117 /// Creates a new reservation. For more information, readReserving zonal
15118 /// resources.
15119 pub fn insert(&self) -> super::builder::reservations::Insert {
15120 super::builder::reservations::Insert::new(self.inner.clone())
15121 }
15122
15123 /// A list of all the reservations that have been configured for the
15124 /// specified project in specified zone.
15125 pub fn list(&self) -> super::builder::reservations::List {
15126 super::builder::reservations::List::new(self.inner.clone())
15127 }
15128
15129 /// Perform maintenance on an extended reservation
15130 pub fn perform_maintenance(&self) -> super::builder::reservations::PerformMaintenance {
15131 super::builder::reservations::PerformMaintenance::new(self.inner.clone())
15132 }
15133
15134 /// Resizes the reservation (applicable to standalone reservations only). For
15135 /// more information, readModifying
15136 /// reservations.
15137 pub fn resize(&self) -> super::builder::reservations::Resize {
15138 super::builder::reservations::Resize::new(self.inner.clone())
15139 }
15140
15141 /// Sets the access control policy on the specified resource.
15142 /// Replaces any existing policy.
15143 pub fn set_iam_policy(&self) -> super::builder::reservations::SetIamPolicy {
15144 super::builder::reservations::SetIamPolicy::new(self.inner.clone())
15145 }
15146
15147 /// Returns permissions that a caller has on the specified resource.
15148 pub fn test_iam_permissions(&self) -> super::builder::reservations::TestIamPermissions {
15149 super::builder::reservations::TestIamPermissions::new(self.inner.clone())
15150 }
15151
15152 /// Update share settings of the reservation.
15153 pub fn update(&self) -> super::builder::reservations::Update {
15154 super::builder::reservations::Update::new(self.inner.clone())
15155 }
15156
15157 /// Retrieves the specified zone-specific Operations resource.
15158 pub fn get_operation(&self) -> super::builder::reservations::GetOperation {
15159 super::builder::reservations::GetOperation::new(self.inner.clone())
15160 }
15161}
15162
15163/// Implements a client for the Google Compute Engine API.
15164///
15165/// # Example
15166/// ```
15167/// # use google_cloud_compute_v1::client::ResourcePolicies;
15168/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
15169/// let client = ResourcePolicies::builder().build().await?;
15170/// // use `client` to make requests to the Google Compute Engine API.
15171/// # Ok(()) }
15172/// ```
15173///
15174/// # Service Description
15175///
15176/// Service for the `resourcePolicies` resource.
15177///
15178/// # Configuration
15179///
15180/// To configure `ResourcePolicies` use the `with_*` methods in the type returned
15181/// by [builder()][ResourcePolicies::builder]. The default configuration should
15182/// work for most applications. Common configuration changes include
15183///
15184/// * [with_endpoint()]: by default this client uses the global default endpoint
15185/// (`https://compute.googleapis.com`). Applications using regional
15186/// endpoints or running in restricted networks (e.g. a network configured
15187// with [Private Google Access with VPC Service Controls]) may want to
15188/// override this default.
15189/// * [with_credentials()]: by default this client uses
15190/// [Application Default Credentials]. Applications using custom
15191/// authentication may need to override this default.
15192///
15193/// [with_endpoint()]: super::builder::resource_policies::ClientBuilder::with_endpoint
15194/// [with_credentials()]: super::builder::resource_policies::ClientBuilder::with_credentials
15195/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15196/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15197///
15198/// # Pooling and Cloning
15199///
15200/// `ResourcePolicies` holds a connection pool internally, it is advised to
15201/// create one and reuse it. You do not need to wrap `ResourcePolicies` in
15202/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15203/// already uses an `Arc` internally.
15204#[cfg(feature = "resource-policies")]
15205#[cfg_attr(docsrs, doc(cfg(feature = "resource-policies")))]
15206#[derive(Clone, Debug)]
15207pub struct ResourcePolicies {
15208 inner: std::sync::Arc<dyn super::stub::dynamic::ResourcePolicies>,
15209}
15210
15211#[cfg(feature = "resource-policies")]
15212impl ResourcePolicies {
15213 /// Returns a builder for [ResourcePolicies].
15214 ///
15215 /// ```
15216 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15217 /// # use google_cloud_compute_v1::client::ResourcePolicies;
15218 /// let client = ResourcePolicies::builder().build().await?;
15219 /// # Ok(()) }
15220 /// ```
15221 pub fn builder() -> super::builder::resource_policies::ClientBuilder {
15222 crate::new_client_builder(super::builder::resource_policies::client::Factory)
15223 }
15224
15225 /// Creates a new client from the provided stub.
15226 ///
15227 /// The most common case for calling this function is in tests mocking the
15228 /// client's behavior.
15229 pub fn from_stub<T>(stub: T) -> Self
15230 where
15231 T: super::stub::ResourcePolicies + 'static,
15232 {
15233 Self {
15234 inner: std::sync::Arc::new(stub),
15235 }
15236 }
15237
15238 pub(crate) async fn new(
15239 config: gaxi::options::ClientConfig,
15240 ) -> crate::ClientBuilderResult<Self> {
15241 let inner = Self::build_inner(config).await?;
15242 Ok(Self { inner })
15243 }
15244
15245 async fn build_inner(
15246 conf: gaxi::options::ClientConfig,
15247 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ResourcePolicies>>
15248 {
15249 if gaxi::options::tracing_enabled(&conf) {
15250 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15251 }
15252 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15253 }
15254
15255 async fn build_transport(
15256 conf: gaxi::options::ClientConfig,
15257 ) -> crate::ClientBuilderResult<impl super::stub::ResourcePolicies> {
15258 super::transport::ResourcePolicies::new(conf).await
15259 }
15260
15261 async fn build_with_tracing(
15262 conf: gaxi::options::ClientConfig,
15263 ) -> crate::ClientBuilderResult<impl super::stub::ResourcePolicies> {
15264 Self::build_transport(conf)
15265 .await
15266 .map(super::tracing::ResourcePolicies::new)
15267 }
15268
15269 /// Retrieves an aggregated list of resource policies.
15270 ///
15271 /// To prevent failure, Google recommends that you set the
15272 /// `returnPartialSuccess` parameter to `true`.
15273 pub fn aggregated_list(&self) -> super::builder::resource_policies::AggregatedList {
15274 super::builder::resource_policies::AggregatedList::new(self.inner.clone())
15275 }
15276
15277 /// Deletes the specified resource policy.
15278 pub fn delete(&self) -> super::builder::resource_policies::Delete {
15279 super::builder::resource_policies::Delete::new(self.inner.clone())
15280 }
15281
15282 /// Retrieves all information of the specified resource policy.
15283 pub fn get(&self) -> super::builder::resource_policies::Get {
15284 super::builder::resource_policies::Get::new(self.inner.clone())
15285 }
15286
15287 /// Gets the access control policy for a resource. May be empty if no such
15288 /// policy or resource exists.
15289 pub fn get_iam_policy(&self) -> super::builder::resource_policies::GetIamPolicy {
15290 super::builder::resource_policies::GetIamPolicy::new(self.inner.clone())
15291 }
15292
15293 /// Creates a new resource policy.
15294 pub fn insert(&self) -> super::builder::resource_policies::Insert {
15295 super::builder::resource_policies::Insert::new(self.inner.clone())
15296 }
15297
15298 /// A list all the resource policies that have been configured for the
15299 /// specified project in specified region.
15300 pub fn list(&self) -> super::builder::resource_policies::List {
15301 super::builder::resource_policies::List::new(self.inner.clone())
15302 }
15303
15304 /// Modify the specified resource policy.
15305 pub fn patch(&self) -> super::builder::resource_policies::Patch {
15306 super::builder::resource_policies::Patch::new(self.inner.clone())
15307 }
15308
15309 /// Sets the access control policy on the specified resource.
15310 /// Replaces any existing policy.
15311 pub fn set_iam_policy(&self) -> super::builder::resource_policies::SetIamPolicy {
15312 super::builder::resource_policies::SetIamPolicy::new(self.inner.clone())
15313 }
15314
15315 /// Returns permissions that a caller has on the specified resource.
15316 pub fn test_iam_permissions(&self) -> super::builder::resource_policies::TestIamPermissions {
15317 super::builder::resource_policies::TestIamPermissions::new(self.inner.clone())
15318 }
15319
15320 /// Retrieves the specified region-specific Operations resource.
15321 pub fn get_operation(&self) -> super::builder::resource_policies::GetOperation {
15322 super::builder::resource_policies::GetOperation::new(self.inner.clone())
15323 }
15324}
15325
15326/// Implements a client for the Google Compute Engine API.
15327///
15328/// # Example
15329/// ```
15330/// # use google_cloud_compute_v1::client::Routers;
15331/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
15332/// let client = Routers::builder().build().await?;
15333/// // use `client` to make requests to the Google Compute Engine API.
15334/// # Ok(()) }
15335/// ```
15336///
15337/// # Service Description
15338///
15339/// Service for the `routers` resource.
15340///
15341/// # Configuration
15342///
15343/// To configure `Routers` use the `with_*` methods in the type returned
15344/// by [builder()][Routers::builder]. The default configuration should
15345/// work for most applications. Common configuration changes include
15346///
15347/// * [with_endpoint()]: by default this client uses the global default endpoint
15348/// (`https://compute.googleapis.com`). Applications using regional
15349/// endpoints or running in restricted networks (e.g. a network configured
15350// with [Private Google Access with VPC Service Controls]) may want to
15351/// override this default.
15352/// * [with_credentials()]: by default this client uses
15353/// [Application Default Credentials]. Applications using custom
15354/// authentication may need to override this default.
15355///
15356/// [with_endpoint()]: super::builder::routers::ClientBuilder::with_endpoint
15357/// [with_credentials()]: super::builder::routers::ClientBuilder::with_credentials
15358/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15359/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15360///
15361/// # Pooling and Cloning
15362///
15363/// `Routers` holds a connection pool internally, it is advised to
15364/// create one and reuse it. You do not need to wrap `Routers` in
15365/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15366/// already uses an `Arc` internally.
15367#[cfg(feature = "routers")]
15368#[cfg_attr(docsrs, doc(cfg(feature = "routers")))]
15369#[derive(Clone, Debug)]
15370pub struct Routers {
15371 inner: std::sync::Arc<dyn super::stub::dynamic::Routers>,
15372}
15373
15374#[cfg(feature = "routers")]
15375impl Routers {
15376 /// Returns a builder for [Routers].
15377 ///
15378 /// ```
15379 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15380 /// # use google_cloud_compute_v1::client::Routers;
15381 /// let client = Routers::builder().build().await?;
15382 /// # Ok(()) }
15383 /// ```
15384 pub fn builder() -> super::builder::routers::ClientBuilder {
15385 crate::new_client_builder(super::builder::routers::client::Factory)
15386 }
15387
15388 /// Creates a new client from the provided stub.
15389 ///
15390 /// The most common case for calling this function is in tests mocking the
15391 /// client's behavior.
15392 pub fn from_stub<T>(stub: T) -> Self
15393 where
15394 T: super::stub::Routers + 'static,
15395 {
15396 Self {
15397 inner: std::sync::Arc::new(stub),
15398 }
15399 }
15400
15401 pub(crate) async fn new(
15402 config: gaxi::options::ClientConfig,
15403 ) -> crate::ClientBuilderResult<Self> {
15404 let inner = Self::build_inner(config).await?;
15405 Ok(Self { inner })
15406 }
15407
15408 async fn build_inner(
15409 conf: gaxi::options::ClientConfig,
15410 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Routers>> {
15411 if gaxi::options::tracing_enabled(&conf) {
15412 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15413 }
15414 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15415 }
15416
15417 async fn build_transport(
15418 conf: gaxi::options::ClientConfig,
15419 ) -> crate::ClientBuilderResult<impl super::stub::Routers> {
15420 super::transport::Routers::new(conf).await
15421 }
15422
15423 async fn build_with_tracing(
15424 conf: gaxi::options::ClientConfig,
15425 ) -> crate::ClientBuilderResult<impl super::stub::Routers> {
15426 Self::build_transport(conf)
15427 .await
15428 .map(super::tracing::Routers::new)
15429 }
15430
15431 /// Retrieves an aggregated list of routers.
15432 ///
15433 /// To prevent failure, Google recommends that you set the
15434 /// `returnPartialSuccess` parameter to `true`.
15435 pub fn aggregated_list(&self) -> super::builder::routers::AggregatedList {
15436 super::builder::routers::AggregatedList::new(self.inner.clone())
15437 }
15438
15439 /// Deletes the specified Router resource.
15440 pub fn delete(&self) -> super::builder::routers::Delete {
15441 super::builder::routers::Delete::new(self.inner.clone())
15442 }
15443
15444 /// Deletes Route Policy
15445 pub fn delete_route_policy(&self) -> super::builder::routers::DeleteRoutePolicy {
15446 super::builder::routers::DeleteRoutePolicy::new(self.inner.clone())
15447 }
15448
15449 /// Returns the specified Router resource.
15450 pub fn get(&self) -> super::builder::routers::Get {
15451 super::builder::routers::Get::new(self.inner.clone())
15452 }
15453
15454 /// Retrieves runtime NAT IP information.
15455 pub fn get_nat_ip_info(&self) -> super::builder::routers::GetNatIpInfo {
15456 super::builder::routers::GetNatIpInfo::new(self.inner.clone())
15457 }
15458
15459 /// Retrieves runtime Nat mapping information of VM endpoints.
15460 pub fn get_nat_mapping_info(&self) -> super::builder::routers::GetNatMappingInfo {
15461 super::builder::routers::GetNatMappingInfo::new(self.inner.clone())
15462 }
15463
15464 /// Returns specified Route Policy
15465 pub fn get_route_policy(&self) -> super::builder::routers::GetRoutePolicy {
15466 super::builder::routers::GetRoutePolicy::new(self.inner.clone())
15467 }
15468
15469 /// Retrieves runtime information of the specified router.
15470 pub fn get_router_status(&self) -> super::builder::routers::GetRouterStatus {
15471 super::builder::routers::GetRouterStatus::new(self.inner.clone())
15472 }
15473
15474 /// Creates a Router resource in the specified project and region using
15475 /// the data included in the request.
15476 pub fn insert(&self) -> super::builder::routers::Insert {
15477 super::builder::routers::Insert::new(self.inner.clone())
15478 }
15479
15480 /// Retrieves a list of Router resources available to the specified project.
15481 pub fn list(&self) -> super::builder::routers::List {
15482 super::builder::routers::List::new(self.inner.clone())
15483 }
15484
15485 /// Retrieves a list of router bgp routes available to the specified project.
15486 pub fn list_bgp_routes(&self) -> super::builder::routers::ListBgpRoutes {
15487 super::builder::routers::ListBgpRoutes::new(self.inner.clone())
15488 }
15489
15490 /// Retrieves a list of router route policy subresources available to the
15491 /// specified project.
15492 pub fn list_route_policies(&self) -> super::builder::routers::ListRoutePolicies {
15493 super::builder::routers::ListRoutePolicies::new(self.inner.clone())
15494 }
15495
15496 /// Patches the specified Router resource with the data included in the
15497 /// request. This method supportsPATCH
15498 /// semantics and usesJSON merge
15499 /// patch format and processing rules.
15500 pub fn patch(&self) -> super::builder::routers::Patch {
15501 super::builder::routers::Patch::new(self.inner.clone())
15502 }
15503
15504 /// Patches Route Policy
15505 pub fn patch_route_policy(&self) -> super::builder::routers::PatchRoutePolicy {
15506 super::builder::routers::PatchRoutePolicy::new(self.inner.clone())
15507 }
15508
15509 /// Preview fields auto-generated during router create andupdate operations.
15510 /// Calling this method does NOT create or update the router.
15511 pub fn preview(&self) -> super::builder::routers::Preview {
15512 super::builder::routers::Preview::new(self.inner.clone())
15513 }
15514
15515 /// Updates the specified Router resource with the data included in the
15516 /// request. This method conforms toPUT semantics, which requests that the state of the
15517 /// target resource be created or replaced with the state defined by the
15518 /// representation enclosed in the request message payload.
15519 pub fn update(&self) -> super::builder::routers::Update {
15520 super::builder::routers::Update::new(self.inner.clone())
15521 }
15522
15523 /// Updates or creates new Route Policy
15524 pub fn update_route_policy(&self) -> super::builder::routers::UpdateRoutePolicy {
15525 super::builder::routers::UpdateRoutePolicy::new(self.inner.clone())
15526 }
15527
15528 /// Retrieves the specified region-specific Operations resource.
15529 pub fn get_operation(&self) -> super::builder::routers::GetOperation {
15530 super::builder::routers::GetOperation::new(self.inner.clone())
15531 }
15532}
15533
15534/// Implements a client for the Google Compute Engine API.
15535///
15536/// # Example
15537/// ```
15538/// # use google_cloud_compute_v1::client::Routes;
15539/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
15540/// let client = Routes::builder().build().await?;
15541/// // use `client` to make requests to the Google Compute Engine API.
15542/// # Ok(()) }
15543/// ```
15544///
15545/// # Service Description
15546///
15547/// Service for the `routes` resource.
15548///
15549/// # Configuration
15550///
15551/// To configure `Routes` use the `with_*` methods in the type returned
15552/// by [builder()][Routes::builder]. The default configuration should
15553/// work for most applications. Common configuration changes include
15554///
15555/// * [with_endpoint()]: by default this client uses the global default endpoint
15556/// (`https://compute.googleapis.com`). Applications using regional
15557/// endpoints or running in restricted networks (e.g. a network configured
15558// with [Private Google Access with VPC Service Controls]) may want to
15559/// override this default.
15560/// * [with_credentials()]: by default this client uses
15561/// [Application Default Credentials]. Applications using custom
15562/// authentication may need to override this default.
15563///
15564/// [with_endpoint()]: super::builder::routes::ClientBuilder::with_endpoint
15565/// [with_credentials()]: super::builder::routes::ClientBuilder::with_credentials
15566/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15567/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15568///
15569/// # Pooling and Cloning
15570///
15571/// `Routes` holds a connection pool internally, it is advised to
15572/// create one and reuse it. You do not need to wrap `Routes` in
15573/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15574/// already uses an `Arc` internally.
15575#[cfg(feature = "routes")]
15576#[cfg_attr(docsrs, doc(cfg(feature = "routes")))]
15577#[derive(Clone, Debug)]
15578pub struct Routes {
15579 inner: std::sync::Arc<dyn super::stub::dynamic::Routes>,
15580}
15581
15582#[cfg(feature = "routes")]
15583impl Routes {
15584 /// Returns a builder for [Routes].
15585 ///
15586 /// ```
15587 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15588 /// # use google_cloud_compute_v1::client::Routes;
15589 /// let client = Routes::builder().build().await?;
15590 /// # Ok(()) }
15591 /// ```
15592 pub fn builder() -> super::builder::routes::ClientBuilder {
15593 crate::new_client_builder(super::builder::routes::client::Factory)
15594 }
15595
15596 /// Creates a new client from the provided stub.
15597 ///
15598 /// The most common case for calling this function is in tests mocking the
15599 /// client's behavior.
15600 pub fn from_stub<T>(stub: T) -> Self
15601 where
15602 T: super::stub::Routes + 'static,
15603 {
15604 Self {
15605 inner: std::sync::Arc::new(stub),
15606 }
15607 }
15608
15609 pub(crate) async fn new(
15610 config: gaxi::options::ClientConfig,
15611 ) -> crate::ClientBuilderResult<Self> {
15612 let inner = Self::build_inner(config).await?;
15613 Ok(Self { inner })
15614 }
15615
15616 async fn build_inner(
15617 conf: gaxi::options::ClientConfig,
15618 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Routes>> {
15619 if gaxi::options::tracing_enabled(&conf) {
15620 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15621 }
15622 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15623 }
15624
15625 async fn build_transport(
15626 conf: gaxi::options::ClientConfig,
15627 ) -> crate::ClientBuilderResult<impl super::stub::Routes> {
15628 super::transport::Routes::new(conf).await
15629 }
15630
15631 async fn build_with_tracing(
15632 conf: gaxi::options::ClientConfig,
15633 ) -> crate::ClientBuilderResult<impl super::stub::Routes> {
15634 Self::build_transport(conf)
15635 .await
15636 .map(super::tracing::Routes::new)
15637 }
15638
15639 /// Deletes the specified Route resource.
15640 pub fn delete(&self) -> super::builder::routes::Delete {
15641 super::builder::routes::Delete::new(self.inner.clone())
15642 }
15643
15644 /// Returns the specified Route resource.
15645 pub fn get(&self) -> super::builder::routes::Get {
15646 super::builder::routes::Get::new(self.inner.clone())
15647 }
15648
15649 /// Creates a Route resource in the specified project using the data included
15650 /// in the request.
15651 pub fn insert(&self) -> super::builder::routes::Insert {
15652 super::builder::routes::Insert::new(self.inner.clone())
15653 }
15654
15655 /// Retrieves the list of Route resources available to the specified project.
15656 pub fn list(&self) -> super::builder::routes::List {
15657 super::builder::routes::List::new(self.inner.clone())
15658 }
15659
15660 /// Returns permissions that a caller has on the specified resource.
15661 pub fn test_iam_permissions(&self) -> super::builder::routes::TestIamPermissions {
15662 super::builder::routes::TestIamPermissions::new(self.inner.clone())
15663 }
15664
15665 /// Retrieves the specified Operations resource.
15666 pub fn get_operation(&self) -> super::builder::routes::GetOperation {
15667 super::builder::routes::GetOperation::new(self.inner.clone())
15668 }
15669}
15670
15671/// Implements a client for the Google Compute Engine API.
15672///
15673/// # Example
15674/// ```
15675/// # use google_cloud_compute_v1::client::SecurityPolicies;
15676/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
15677/// let client = SecurityPolicies::builder().build().await?;
15678/// // use `client` to make requests to the Google Compute Engine API.
15679/// # Ok(()) }
15680/// ```
15681///
15682/// # Service Description
15683///
15684/// Service for the `securityPolicies` resource.
15685///
15686/// # Configuration
15687///
15688/// To configure `SecurityPolicies` use the `with_*` methods in the type returned
15689/// by [builder()][SecurityPolicies::builder]. The default configuration should
15690/// work for most applications. Common configuration changes include
15691///
15692/// * [with_endpoint()]: by default this client uses the global default endpoint
15693/// (`https://compute.googleapis.com`). Applications using regional
15694/// endpoints or running in restricted networks (e.g. a network configured
15695// with [Private Google Access with VPC Service Controls]) may want to
15696/// override this default.
15697/// * [with_credentials()]: by default this client uses
15698/// [Application Default Credentials]. Applications using custom
15699/// authentication may need to override this default.
15700///
15701/// [with_endpoint()]: super::builder::security_policies::ClientBuilder::with_endpoint
15702/// [with_credentials()]: super::builder::security_policies::ClientBuilder::with_credentials
15703/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15704/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15705///
15706/// # Pooling and Cloning
15707///
15708/// `SecurityPolicies` holds a connection pool internally, it is advised to
15709/// create one and reuse it. You do not need to wrap `SecurityPolicies` in
15710/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15711/// already uses an `Arc` internally.
15712#[cfg(feature = "security-policies")]
15713#[cfg_attr(docsrs, doc(cfg(feature = "security-policies")))]
15714#[derive(Clone, Debug)]
15715pub struct SecurityPolicies {
15716 inner: std::sync::Arc<dyn super::stub::dynamic::SecurityPolicies>,
15717}
15718
15719#[cfg(feature = "security-policies")]
15720impl SecurityPolicies {
15721 /// Returns a builder for [SecurityPolicies].
15722 ///
15723 /// ```
15724 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15725 /// # use google_cloud_compute_v1::client::SecurityPolicies;
15726 /// let client = SecurityPolicies::builder().build().await?;
15727 /// # Ok(()) }
15728 /// ```
15729 pub fn builder() -> super::builder::security_policies::ClientBuilder {
15730 crate::new_client_builder(super::builder::security_policies::client::Factory)
15731 }
15732
15733 /// Creates a new client from the provided stub.
15734 ///
15735 /// The most common case for calling this function is in tests mocking the
15736 /// client's behavior.
15737 pub fn from_stub<T>(stub: T) -> Self
15738 where
15739 T: super::stub::SecurityPolicies + 'static,
15740 {
15741 Self {
15742 inner: std::sync::Arc::new(stub),
15743 }
15744 }
15745
15746 pub(crate) async fn new(
15747 config: gaxi::options::ClientConfig,
15748 ) -> crate::ClientBuilderResult<Self> {
15749 let inner = Self::build_inner(config).await?;
15750 Ok(Self { inner })
15751 }
15752
15753 async fn build_inner(
15754 conf: gaxi::options::ClientConfig,
15755 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SecurityPolicies>>
15756 {
15757 if gaxi::options::tracing_enabled(&conf) {
15758 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15759 }
15760 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15761 }
15762
15763 async fn build_transport(
15764 conf: gaxi::options::ClientConfig,
15765 ) -> crate::ClientBuilderResult<impl super::stub::SecurityPolicies> {
15766 super::transport::SecurityPolicies::new(conf).await
15767 }
15768
15769 async fn build_with_tracing(
15770 conf: gaxi::options::ClientConfig,
15771 ) -> crate::ClientBuilderResult<impl super::stub::SecurityPolicies> {
15772 Self::build_transport(conf)
15773 .await
15774 .map(super::tracing::SecurityPolicies::new)
15775 }
15776
15777 /// Inserts a rule into a security policy.
15778 pub fn add_rule(&self) -> super::builder::security_policies::AddRule {
15779 super::builder::security_policies::AddRule::new(self.inner.clone())
15780 }
15781
15782 /// Retrieves the list of all SecurityPolicy resources, regional and global,
15783 /// available to the specified project.
15784 ///
15785 /// To prevent failure, Google recommends that you set the
15786 /// `returnPartialSuccess` parameter to `true`.
15787 pub fn aggregated_list(&self) -> super::builder::security_policies::AggregatedList {
15788 super::builder::security_policies::AggregatedList::new(self.inner.clone())
15789 }
15790
15791 /// Deletes the specified policy.
15792 pub fn delete(&self) -> super::builder::security_policies::Delete {
15793 super::builder::security_policies::Delete::new(self.inner.clone())
15794 }
15795
15796 /// List all of the ordered rules present in a single specified policy.
15797 pub fn get(&self) -> super::builder::security_policies::Get {
15798 super::builder::security_policies::Get::new(self.inner.clone())
15799 }
15800
15801 /// Gets a rule at the specified priority.
15802 pub fn get_rule(&self) -> super::builder::security_policies::GetRule {
15803 super::builder::security_policies::GetRule::new(self.inner.clone())
15804 }
15805
15806 /// Creates a new policy in the specified project using the data included in
15807 /// the request.
15808 pub fn insert(&self) -> super::builder::security_policies::Insert {
15809 super::builder::security_policies::Insert::new(self.inner.clone())
15810 }
15811
15812 /// List all the policies that have been configured for the specified project.
15813 pub fn list(&self) -> super::builder::security_policies::List {
15814 super::builder::security_policies::List::new(self.inner.clone())
15815 }
15816
15817 /// Gets the current list of preconfigured Web Application Firewall (WAF)
15818 /// expressions.
15819 pub fn list_preconfigured_expression_sets(
15820 &self,
15821 ) -> super::builder::security_policies::ListPreconfiguredExpressionSets {
15822 super::builder::security_policies::ListPreconfiguredExpressionSets::new(self.inner.clone())
15823 }
15824
15825 /// Patches the specified policy with the data included in the request. To
15826 /// clear fields in the policy, leave the fields empty and specify them in the
15827 /// updateMask. This cannot be used to be update the rules in the policy.
15828 /// Please use the per rule methods like addRule, patchRule, and removeRule
15829 /// instead.
15830 pub fn patch(&self) -> super::builder::security_policies::Patch {
15831 super::builder::security_policies::Patch::new(self.inner.clone())
15832 }
15833
15834 /// Patches a rule at the specified priority. To clear fields in the rule,
15835 /// leave the fields empty and specify them in the updateMask.
15836 pub fn patch_rule(&self) -> super::builder::security_policies::PatchRule {
15837 super::builder::security_policies::PatchRule::new(self.inner.clone())
15838 }
15839
15840 /// Deletes a rule at the specified priority.
15841 pub fn remove_rule(&self) -> super::builder::security_policies::RemoveRule {
15842 super::builder::security_policies::RemoveRule::new(self.inner.clone())
15843 }
15844
15845 /// Sets the labels on a security policy. To learn more about labels,
15846 /// read the Labeling Resources
15847 /// documentation.
15848 pub fn set_labels(&self) -> super::builder::security_policies::SetLabels {
15849 super::builder::security_policies::SetLabels::new(self.inner.clone())
15850 }
15851
15852 /// Retrieves the specified Operations resource.
15853 pub fn get_operation(&self) -> super::builder::security_policies::GetOperation {
15854 super::builder::security_policies::GetOperation::new(self.inner.clone())
15855 }
15856}
15857
15858/// Implements a client for the Google Compute Engine API.
15859///
15860/// # Example
15861/// ```
15862/// # use google_cloud_compute_v1::client::ServiceAttachments;
15863/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
15864/// let client = ServiceAttachments::builder().build().await?;
15865/// // use `client` to make requests to the Google Compute Engine API.
15866/// # Ok(()) }
15867/// ```
15868///
15869/// # Service Description
15870///
15871/// Service for the `serviceAttachments` resource.
15872///
15873/// # Configuration
15874///
15875/// To configure `ServiceAttachments` use the `with_*` methods in the type returned
15876/// by [builder()][ServiceAttachments::builder]. The default configuration should
15877/// work for most applications. Common configuration changes include
15878///
15879/// * [with_endpoint()]: by default this client uses the global default endpoint
15880/// (`https://compute.googleapis.com`). Applications using regional
15881/// endpoints or running in restricted networks (e.g. a network configured
15882// with [Private Google Access with VPC Service Controls]) may want to
15883/// override this default.
15884/// * [with_credentials()]: by default this client uses
15885/// [Application Default Credentials]. Applications using custom
15886/// authentication may need to override this default.
15887///
15888/// [with_endpoint()]: super::builder::service_attachments::ClientBuilder::with_endpoint
15889/// [with_credentials()]: super::builder::service_attachments::ClientBuilder::with_credentials
15890/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15891/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15892///
15893/// # Pooling and Cloning
15894///
15895/// `ServiceAttachments` holds a connection pool internally, it is advised to
15896/// create one and reuse it. You do not need to wrap `ServiceAttachments` in
15897/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15898/// already uses an `Arc` internally.
15899#[cfg(feature = "service-attachments")]
15900#[cfg_attr(docsrs, doc(cfg(feature = "service-attachments")))]
15901#[derive(Clone, Debug)]
15902pub struct ServiceAttachments {
15903 inner: std::sync::Arc<dyn super::stub::dynamic::ServiceAttachments>,
15904}
15905
15906#[cfg(feature = "service-attachments")]
15907impl ServiceAttachments {
15908 /// Returns a builder for [ServiceAttachments].
15909 ///
15910 /// ```
15911 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15912 /// # use google_cloud_compute_v1::client::ServiceAttachments;
15913 /// let client = ServiceAttachments::builder().build().await?;
15914 /// # Ok(()) }
15915 /// ```
15916 pub fn builder() -> super::builder::service_attachments::ClientBuilder {
15917 crate::new_client_builder(super::builder::service_attachments::client::Factory)
15918 }
15919
15920 /// Creates a new client from the provided stub.
15921 ///
15922 /// The most common case for calling this function is in tests mocking the
15923 /// client's behavior.
15924 pub fn from_stub<T>(stub: T) -> Self
15925 where
15926 T: super::stub::ServiceAttachments + 'static,
15927 {
15928 Self {
15929 inner: std::sync::Arc::new(stub),
15930 }
15931 }
15932
15933 pub(crate) async fn new(
15934 config: gaxi::options::ClientConfig,
15935 ) -> crate::ClientBuilderResult<Self> {
15936 let inner = Self::build_inner(config).await?;
15937 Ok(Self { inner })
15938 }
15939
15940 async fn build_inner(
15941 conf: gaxi::options::ClientConfig,
15942 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ServiceAttachments>>
15943 {
15944 if gaxi::options::tracing_enabled(&conf) {
15945 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15946 }
15947 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15948 }
15949
15950 async fn build_transport(
15951 conf: gaxi::options::ClientConfig,
15952 ) -> crate::ClientBuilderResult<impl super::stub::ServiceAttachments> {
15953 super::transport::ServiceAttachments::new(conf).await
15954 }
15955
15956 async fn build_with_tracing(
15957 conf: gaxi::options::ClientConfig,
15958 ) -> crate::ClientBuilderResult<impl super::stub::ServiceAttachments> {
15959 Self::build_transport(conf)
15960 .await
15961 .map(super::tracing::ServiceAttachments::new)
15962 }
15963
15964 /// Retrieves the list of all ServiceAttachment resources,
15965 /// regional and global, available to the specified project.
15966 ///
15967 /// To prevent failure, Google recommends that you set the
15968 /// `returnPartialSuccess` parameter to `true`.
15969 pub fn aggregated_list(&self) -> super::builder::service_attachments::AggregatedList {
15970 super::builder::service_attachments::AggregatedList::new(self.inner.clone())
15971 }
15972
15973 /// Deletes the specified ServiceAttachment in the given scope
15974 pub fn delete(&self) -> super::builder::service_attachments::Delete {
15975 super::builder::service_attachments::Delete::new(self.inner.clone())
15976 }
15977
15978 /// Returns the specified ServiceAttachment resource in the given scope.
15979 pub fn get(&self) -> super::builder::service_attachments::Get {
15980 super::builder::service_attachments::Get::new(self.inner.clone())
15981 }
15982
15983 /// Gets the access control policy for a resource. May be empty if no such
15984 /// policy or resource exists.
15985 pub fn get_iam_policy(&self) -> super::builder::service_attachments::GetIamPolicy {
15986 super::builder::service_attachments::GetIamPolicy::new(self.inner.clone())
15987 }
15988
15989 /// Creates a ServiceAttachment in the specified project in the given scope
15990 /// using the parameters that are included in the request.
15991 pub fn insert(&self) -> super::builder::service_attachments::Insert {
15992 super::builder::service_attachments::Insert::new(self.inner.clone())
15993 }
15994
15995 /// Lists the ServiceAttachments for a project in the given scope.
15996 pub fn list(&self) -> super::builder::service_attachments::List {
15997 super::builder::service_attachments::List::new(self.inner.clone())
15998 }
15999
16000 /// Patches the specified ServiceAttachment resource with the data included in
16001 /// the request. This method supports PATCH
16002 /// semantics and usesJSON merge
16003 /// patch format and processing rules.
16004 pub fn patch(&self) -> super::builder::service_attachments::Patch {
16005 super::builder::service_attachments::Patch::new(self.inner.clone())
16006 }
16007
16008 /// Sets the access control policy on the specified resource.
16009 /// Replaces any existing policy.
16010 pub fn set_iam_policy(&self) -> super::builder::service_attachments::SetIamPolicy {
16011 super::builder::service_attachments::SetIamPolicy::new(self.inner.clone())
16012 }
16013
16014 /// Returns permissions that a caller has on the specified resource.
16015 pub fn test_iam_permissions(&self) -> super::builder::service_attachments::TestIamPermissions {
16016 super::builder::service_attachments::TestIamPermissions::new(self.inner.clone())
16017 }
16018
16019 /// Retrieves the specified region-specific Operations resource.
16020 pub fn get_operation(&self) -> super::builder::service_attachments::GetOperation {
16021 super::builder::service_attachments::GetOperation::new(self.inner.clone())
16022 }
16023}
16024
16025/// Implements a client for the Google Compute Engine API.
16026///
16027/// # Example
16028/// ```
16029/// # use google_cloud_compute_v1::client::SnapshotSettings;
16030/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
16031/// let client = SnapshotSettings::builder().build().await?;
16032/// // use `client` to make requests to the Google Compute Engine API.
16033/// # Ok(()) }
16034/// ```
16035///
16036/// # Service Description
16037///
16038/// Service for the `snapshotSettings` resource.
16039///
16040/// # Configuration
16041///
16042/// To configure `SnapshotSettings` use the `with_*` methods in the type returned
16043/// by [builder()][SnapshotSettings::builder]. The default configuration should
16044/// work for most applications. Common configuration changes include
16045///
16046/// * [with_endpoint()]: by default this client uses the global default endpoint
16047/// (`https://compute.googleapis.com`). Applications using regional
16048/// endpoints or running in restricted networks (e.g. a network configured
16049// with [Private Google Access with VPC Service Controls]) may want to
16050/// override this default.
16051/// * [with_credentials()]: by default this client uses
16052/// [Application Default Credentials]. Applications using custom
16053/// authentication may need to override this default.
16054///
16055/// [with_endpoint()]: super::builder::snapshot_settings::ClientBuilder::with_endpoint
16056/// [with_credentials()]: super::builder::snapshot_settings::ClientBuilder::with_credentials
16057/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16058/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16059///
16060/// # Pooling and Cloning
16061///
16062/// `SnapshotSettings` holds a connection pool internally, it is advised to
16063/// create one and reuse it. You do not need to wrap `SnapshotSettings` in
16064/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16065/// already uses an `Arc` internally.
16066#[cfg(feature = "snapshot-settings")]
16067#[cfg_attr(docsrs, doc(cfg(feature = "snapshot-settings")))]
16068#[derive(Clone, Debug)]
16069pub struct SnapshotSettings {
16070 inner: std::sync::Arc<dyn super::stub::dynamic::SnapshotSettings>,
16071}
16072
16073#[cfg(feature = "snapshot-settings")]
16074impl SnapshotSettings {
16075 /// Returns a builder for [SnapshotSettings].
16076 ///
16077 /// ```
16078 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16079 /// # use google_cloud_compute_v1::client::SnapshotSettings;
16080 /// let client = SnapshotSettings::builder().build().await?;
16081 /// # Ok(()) }
16082 /// ```
16083 pub fn builder() -> super::builder::snapshot_settings::ClientBuilder {
16084 crate::new_client_builder(super::builder::snapshot_settings::client::Factory)
16085 }
16086
16087 /// Creates a new client from the provided stub.
16088 ///
16089 /// The most common case for calling this function is in tests mocking the
16090 /// client's behavior.
16091 pub fn from_stub<T>(stub: T) -> Self
16092 where
16093 T: super::stub::SnapshotSettings + 'static,
16094 {
16095 Self {
16096 inner: std::sync::Arc::new(stub),
16097 }
16098 }
16099
16100 pub(crate) async fn new(
16101 config: gaxi::options::ClientConfig,
16102 ) -> crate::ClientBuilderResult<Self> {
16103 let inner = Self::build_inner(config).await?;
16104 Ok(Self { inner })
16105 }
16106
16107 async fn build_inner(
16108 conf: gaxi::options::ClientConfig,
16109 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SnapshotSettings>>
16110 {
16111 if gaxi::options::tracing_enabled(&conf) {
16112 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16113 }
16114 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16115 }
16116
16117 async fn build_transport(
16118 conf: gaxi::options::ClientConfig,
16119 ) -> crate::ClientBuilderResult<impl super::stub::SnapshotSettings> {
16120 super::transport::SnapshotSettings::new(conf).await
16121 }
16122
16123 async fn build_with_tracing(
16124 conf: gaxi::options::ClientConfig,
16125 ) -> crate::ClientBuilderResult<impl super::stub::SnapshotSettings> {
16126 Self::build_transport(conf)
16127 .await
16128 .map(super::tracing::SnapshotSettings::new)
16129 }
16130
16131 /// Get snapshot settings.
16132 pub fn get(&self) -> super::builder::snapshot_settings::Get {
16133 super::builder::snapshot_settings::Get::new(self.inner.clone())
16134 }
16135
16136 /// Patch snapshot settings.
16137 pub fn patch(&self) -> super::builder::snapshot_settings::Patch {
16138 super::builder::snapshot_settings::Patch::new(self.inner.clone())
16139 }
16140
16141 /// Retrieves the specified Operations resource.
16142 pub fn get_operation(&self) -> super::builder::snapshot_settings::GetOperation {
16143 super::builder::snapshot_settings::GetOperation::new(self.inner.clone())
16144 }
16145}
16146
16147/// Implements a client for the Google Compute Engine API.
16148///
16149/// # Example
16150/// ```
16151/// # use google_cloud_compute_v1::client::Snapshots;
16152/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
16153/// let client = Snapshots::builder().build().await?;
16154/// // use `client` to make requests to the Google Compute Engine API.
16155/// # Ok(()) }
16156/// ```
16157///
16158/// # Service Description
16159///
16160/// Service for the `snapshots` resource.
16161///
16162/// # Configuration
16163///
16164/// To configure `Snapshots` use the `with_*` methods in the type returned
16165/// by [builder()][Snapshots::builder]. The default configuration should
16166/// work for most applications. Common configuration changes include
16167///
16168/// * [with_endpoint()]: by default this client uses the global default endpoint
16169/// (`https://compute.googleapis.com`). Applications using regional
16170/// endpoints or running in restricted networks (e.g. a network configured
16171// with [Private Google Access with VPC Service Controls]) may want to
16172/// override this default.
16173/// * [with_credentials()]: by default this client uses
16174/// [Application Default Credentials]. Applications using custom
16175/// authentication may need to override this default.
16176///
16177/// [with_endpoint()]: super::builder::snapshots::ClientBuilder::with_endpoint
16178/// [with_credentials()]: super::builder::snapshots::ClientBuilder::with_credentials
16179/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16180/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16181///
16182/// # Pooling and Cloning
16183///
16184/// `Snapshots` holds a connection pool internally, it is advised to
16185/// create one and reuse it. You do not need to wrap `Snapshots` in
16186/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16187/// already uses an `Arc` internally.
16188#[cfg(feature = "snapshots")]
16189#[cfg_attr(docsrs, doc(cfg(feature = "snapshots")))]
16190#[derive(Clone, Debug)]
16191pub struct Snapshots {
16192 inner: std::sync::Arc<dyn super::stub::dynamic::Snapshots>,
16193}
16194
16195#[cfg(feature = "snapshots")]
16196impl Snapshots {
16197 /// Returns a builder for [Snapshots].
16198 ///
16199 /// ```
16200 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16201 /// # use google_cloud_compute_v1::client::Snapshots;
16202 /// let client = Snapshots::builder().build().await?;
16203 /// # Ok(()) }
16204 /// ```
16205 pub fn builder() -> super::builder::snapshots::ClientBuilder {
16206 crate::new_client_builder(super::builder::snapshots::client::Factory)
16207 }
16208
16209 /// Creates a new client from the provided stub.
16210 ///
16211 /// The most common case for calling this function is in tests mocking the
16212 /// client's behavior.
16213 pub fn from_stub<T>(stub: T) -> Self
16214 where
16215 T: super::stub::Snapshots + 'static,
16216 {
16217 Self {
16218 inner: std::sync::Arc::new(stub),
16219 }
16220 }
16221
16222 pub(crate) async fn new(
16223 config: gaxi::options::ClientConfig,
16224 ) -> crate::ClientBuilderResult<Self> {
16225 let inner = Self::build_inner(config).await?;
16226 Ok(Self { inner })
16227 }
16228
16229 async fn build_inner(
16230 conf: gaxi::options::ClientConfig,
16231 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Snapshots>> {
16232 if gaxi::options::tracing_enabled(&conf) {
16233 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16234 }
16235 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16236 }
16237
16238 async fn build_transport(
16239 conf: gaxi::options::ClientConfig,
16240 ) -> crate::ClientBuilderResult<impl super::stub::Snapshots> {
16241 super::transport::Snapshots::new(conf).await
16242 }
16243
16244 async fn build_with_tracing(
16245 conf: gaxi::options::ClientConfig,
16246 ) -> crate::ClientBuilderResult<impl super::stub::Snapshots> {
16247 Self::build_transport(conf)
16248 .await
16249 .map(super::tracing::Snapshots::new)
16250 }
16251
16252 /// Deletes the specified Snapshot resource. Keep in mind that deleting
16253 /// a single snapshot might not necessarily delete all the data on that
16254 /// snapshot. If any data on the snapshot that is marked for deletion is
16255 /// needed for subsequent snapshots, the data will be moved to the next
16256 /// corresponding snapshot.
16257 ///
16258 /// For more information, seeDeleting
16259 /// snapshots.
16260 pub fn delete(&self) -> super::builder::snapshots::Delete {
16261 super::builder::snapshots::Delete::new(self.inner.clone())
16262 }
16263
16264 /// Returns the specified Snapshot resource.
16265 pub fn get(&self) -> super::builder::snapshots::Get {
16266 super::builder::snapshots::Get::new(self.inner.clone())
16267 }
16268
16269 /// Gets the access control policy for a resource. May be empty if no such
16270 /// policy or resource exists.
16271 pub fn get_iam_policy(&self) -> super::builder::snapshots::GetIamPolicy {
16272 super::builder::snapshots::GetIamPolicy::new(self.inner.clone())
16273 }
16274
16275 /// Creates a snapshot in the specified project using the data included
16276 /// in the request. For regular snapshot creation, consider using this method
16277 /// instead of disks.createSnapshot,
16278 /// as this method supports more features, such as creating snapshots in a
16279 /// project different from the source disk project.
16280 pub fn insert(&self) -> super::builder::snapshots::Insert {
16281 super::builder::snapshots::Insert::new(self.inner.clone())
16282 }
16283
16284 /// Retrieves the list of Snapshot resources contained within
16285 /// the specified project.
16286 pub fn list(&self) -> super::builder::snapshots::List {
16287 super::builder::snapshots::List::new(self.inner.clone())
16288 }
16289
16290 /// Sets the access control policy on the specified resource.
16291 /// Replaces any existing policy.
16292 pub fn set_iam_policy(&self) -> super::builder::snapshots::SetIamPolicy {
16293 super::builder::snapshots::SetIamPolicy::new(self.inner.clone())
16294 }
16295
16296 /// Sets the labels on a snapshot. To learn more about labels, read theLabeling
16297 /// Resources documentation.
16298 pub fn set_labels(&self) -> super::builder::snapshots::SetLabels {
16299 super::builder::snapshots::SetLabels::new(self.inner.clone())
16300 }
16301
16302 /// Returns permissions that a caller has on the specified resource.
16303 pub fn test_iam_permissions(&self) -> super::builder::snapshots::TestIamPermissions {
16304 super::builder::snapshots::TestIamPermissions::new(self.inner.clone())
16305 }
16306
16307 /// Retrieves the specified Operations resource.
16308 pub fn get_operation(&self) -> super::builder::snapshots::GetOperation {
16309 super::builder::snapshots::GetOperation::new(self.inner.clone())
16310 }
16311}
16312
16313/// Implements a client for the Google Compute Engine API.
16314///
16315/// # Example
16316/// ```
16317/// # use google_cloud_compute_v1::client::SslCertificates;
16318/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
16319/// let client = SslCertificates::builder().build().await?;
16320/// // use `client` to make requests to the Google Compute Engine API.
16321/// # Ok(()) }
16322/// ```
16323///
16324/// # Service Description
16325///
16326/// Service for the `sslCertificates` resource.
16327///
16328/// # Configuration
16329///
16330/// To configure `SslCertificates` use the `with_*` methods in the type returned
16331/// by [builder()][SslCertificates::builder]. The default configuration should
16332/// work for most applications. Common configuration changes include
16333///
16334/// * [with_endpoint()]: by default this client uses the global default endpoint
16335/// (`https://compute.googleapis.com`). Applications using regional
16336/// endpoints or running in restricted networks (e.g. a network configured
16337// with [Private Google Access with VPC Service Controls]) may want to
16338/// override this default.
16339/// * [with_credentials()]: by default this client uses
16340/// [Application Default Credentials]. Applications using custom
16341/// authentication may need to override this default.
16342///
16343/// [with_endpoint()]: super::builder::ssl_certificates::ClientBuilder::with_endpoint
16344/// [with_credentials()]: super::builder::ssl_certificates::ClientBuilder::with_credentials
16345/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16346/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16347///
16348/// # Pooling and Cloning
16349///
16350/// `SslCertificates` holds a connection pool internally, it is advised to
16351/// create one and reuse it. You do not need to wrap `SslCertificates` in
16352/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16353/// already uses an `Arc` internally.
16354#[cfg(feature = "ssl-certificates")]
16355#[cfg_attr(docsrs, doc(cfg(feature = "ssl-certificates")))]
16356#[derive(Clone, Debug)]
16357pub struct SslCertificates {
16358 inner: std::sync::Arc<dyn super::stub::dynamic::SslCertificates>,
16359}
16360
16361#[cfg(feature = "ssl-certificates")]
16362impl SslCertificates {
16363 /// Returns a builder for [SslCertificates].
16364 ///
16365 /// ```
16366 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16367 /// # use google_cloud_compute_v1::client::SslCertificates;
16368 /// let client = SslCertificates::builder().build().await?;
16369 /// # Ok(()) }
16370 /// ```
16371 pub fn builder() -> super::builder::ssl_certificates::ClientBuilder {
16372 crate::new_client_builder(super::builder::ssl_certificates::client::Factory)
16373 }
16374
16375 /// Creates a new client from the provided stub.
16376 ///
16377 /// The most common case for calling this function is in tests mocking the
16378 /// client's behavior.
16379 pub fn from_stub<T>(stub: T) -> Self
16380 where
16381 T: super::stub::SslCertificates + 'static,
16382 {
16383 Self {
16384 inner: std::sync::Arc::new(stub),
16385 }
16386 }
16387
16388 pub(crate) async fn new(
16389 config: gaxi::options::ClientConfig,
16390 ) -> crate::ClientBuilderResult<Self> {
16391 let inner = Self::build_inner(config).await?;
16392 Ok(Self { inner })
16393 }
16394
16395 async fn build_inner(
16396 conf: gaxi::options::ClientConfig,
16397 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SslCertificates>> {
16398 if gaxi::options::tracing_enabled(&conf) {
16399 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16400 }
16401 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16402 }
16403
16404 async fn build_transport(
16405 conf: gaxi::options::ClientConfig,
16406 ) -> crate::ClientBuilderResult<impl super::stub::SslCertificates> {
16407 super::transport::SslCertificates::new(conf).await
16408 }
16409
16410 async fn build_with_tracing(
16411 conf: gaxi::options::ClientConfig,
16412 ) -> crate::ClientBuilderResult<impl super::stub::SslCertificates> {
16413 Self::build_transport(conf)
16414 .await
16415 .map(super::tracing::SslCertificates::new)
16416 }
16417
16418 /// Retrieves the list of all SslCertificate resources, regional and global,
16419 /// available to the specified project.
16420 ///
16421 /// To prevent failure, Google recommends that you set the
16422 /// `returnPartialSuccess` parameter to `true`.
16423 pub fn aggregated_list(&self) -> super::builder::ssl_certificates::AggregatedList {
16424 super::builder::ssl_certificates::AggregatedList::new(self.inner.clone())
16425 }
16426
16427 /// Deletes the specified SslCertificate resource.
16428 pub fn delete(&self) -> super::builder::ssl_certificates::Delete {
16429 super::builder::ssl_certificates::Delete::new(self.inner.clone())
16430 }
16431
16432 /// Returns the specified SslCertificate resource.
16433 pub fn get(&self) -> super::builder::ssl_certificates::Get {
16434 super::builder::ssl_certificates::Get::new(self.inner.clone())
16435 }
16436
16437 /// Creates a SslCertificate resource in the specified project using the data
16438 /// included in the request.
16439 pub fn insert(&self) -> super::builder::ssl_certificates::Insert {
16440 super::builder::ssl_certificates::Insert::new(self.inner.clone())
16441 }
16442
16443 /// Retrieves the list of SslCertificate resources available to the specified
16444 /// project.
16445 pub fn list(&self) -> super::builder::ssl_certificates::List {
16446 super::builder::ssl_certificates::List::new(self.inner.clone())
16447 }
16448
16449 /// Retrieves the specified Operations resource.
16450 pub fn get_operation(&self) -> super::builder::ssl_certificates::GetOperation {
16451 super::builder::ssl_certificates::GetOperation::new(self.inner.clone())
16452 }
16453}
16454
16455/// Implements a client for the Google Compute Engine API.
16456///
16457/// # Example
16458/// ```
16459/// # use google_cloud_compute_v1::client::SslPolicies;
16460/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
16461/// let client = SslPolicies::builder().build().await?;
16462/// // use `client` to make requests to the Google Compute Engine API.
16463/// # Ok(()) }
16464/// ```
16465///
16466/// # Service Description
16467///
16468/// Service for the `sslPolicies` resource.
16469///
16470/// # Configuration
16471///
16472/// To configure `SslPolicies` use the `with_*` methods in the type returned
16473/// by [builder()][SslPolicies::builder]. The default configuration should
16474/// work for most applications. Common configuration changes include
16475///
16476/// * [with_endpoint()]: by default this client uses the global default endpoint
16477/// (`https://compute.googleapis.com`). Applications using regional
16478/// endpoints or running in restricted networks (e.g. a network configured
16479// with [Private Google Access with VPC Service Controls]) may want to
16480/// override this default.
16481/// * [with_credentials()]: by default this client uses
16482/// [Application Default Credentials]. Applications using custom
16483/// authentication may need to override this default.
16484///
16485/// [with_endpoint()]: super::builder::ssl_policies::ClientBuilder::with_endpoint
16486/// [with_credentials()]: super::builder::ssl_policies::ClientBuilder::with_credentials
16487/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16488/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16489///
16490/// # Pooling and Cloning
16491///
16492/// `SslPolicies` holds a connection pool internally, it is advised to
16493/// create one and reuse it. You do not need to wrap `SslPolicies` in
16494/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16495/// already uses an `Arc` internally.
16496#[cfg(feature = "ssl-policies")]
16497#[cfg_attr(docsrs, doc(cfg(feature = "ssl-policies")))]
16498#[derive(Clone, Debug)]
16499pub struct SslPolicies {
16500 inner: std::sync::Arc<dyn super::stub::dynamic::SslPolicies>,
16501}
16502
16503#[cfg(feature = "ssl-policies")]
16504impl SslPolicies {
16505 /// Returns a builder for [SslPolicies].
16506 ///
16507 /// ```
16508 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16509 /// # use google_cloud_compute_v1::client::SslPolicies;
16510 /// let client = SslPolicies::builder().build().await?;
16511 /// # Ok(()) }
16512 /// ```
16513 pub fn builder() -> super::builder::ssl_policies::ClientBuilder {
16514 crate::new_client_builder(super::builder::ssl_policies::client::Factory)
16515 }
16516
16517 /// Creates a new client from the provided stub.
16518 ///
16519 /// The most common case for calling this function is in tests mocking the
16520 /// client's behavior.
16521 pub fn from_stub<T>(stub: T) -> Self
16522 where
16523 T: super::stub::SslPolicies + 'static,
16524 {
16525 Self {
16526 inner: std::sync::Arc::new(stub),
16527 }
16528 }
16529
16530 pub(crate) async fn new(
16531 config: gaxi::options::ClientConfig,
16532 ) -> crate::ClientBuilderResult<Self> {
16533 let inner = Self::build_inner(config).await?;
16534 Ok(Self { inner })
16535 }
16536
16537 async fn build_inner(
16538 conf: gaxi::options::ClientConfig,
16539 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SslPolicies>> {
16540 if gaxi::options::tracing_enabled(&conf) {
16541 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16542 }
16543 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16544 }
16545
16546 async fn build_transport(
16547 conf: gaxi::options::ClientConfig,
16548 ) -> crate::ClientBuilderResult<impl super::stub::SslPolicies> {
16549 super::transport::SslPolicies::new(conf).await
16550 }
16551
16552 async fn build_with_tracing(
16553 conf: gaxi::options::ClientConfig,
16554 ) -> crate::ClientBuilderResult<impl super::stub::SslPolicies> {
16555 Self::build_transport(conf)
16556 .await
16557 .map(super::tracing::SslPolicies::new)
16558 }
16559
16560 /// Retrieves the list of all SslPolicy resources, regional and global,
16561 /// available to the specified project.
16562 ///
16563 /// To prevent failure, Google recommends that you set the
16564 /// `returnPartialSuccess` parameter to `true`.
16565 pub fn aggregated_list(&self) -> super::builder::ssl_policies::AggregatedList {
16566 super::builder::ssl_policies::AggregatedList::new(self.inner.clone())
16567 }
16568
16569 /// Deletes the specified SSL policy. The SSL policy resource can be deleted
16570 /// only if it is not in use by any TargetHttpsProxy or TargetSslProxy
16571 /// resources.
16572 pub fn delete(&self) -> super::builder::ssl_policies::Delete {
16573 super::builder::ssl_policies::Delete::new(self.inner.clone())
16574 }
16575
16576 /// Lists all of the ordered rules present in a single specified policy.
16577 pub fn get(&self) -> super::builder::ssl_policies::Get {
16578 super::builder::ssl_policies::Get::new(self.inner.clone())
16579 }
16580
16581 /// Returns the specified SSL policy resource.
16582 pub fn insert(&self) -> super::builder::ssl_policies::Insert {
16583 super::builder::ssl_policies::Insert::new(self.inner.clone())
16584 }
16585
16586 /// Lists all the SSL policies that have been configured for the specified
16587 /// project.
16588 pub fn list(&self) -> super::builder::ssl_policies::List {
16589 super::builder::ssl_policies::List::new(self.inner.clone())
16590 }
16591
16592 /// Lists all features that can be specified in the SSL policy when using
16593 /// custom profile.
16594 pub fn list_available_features(&self) -> super::builder::ssl_policies::ListAvailableFeatures {
16595 super::builder::ssl_policies::ListAvailableFeatures::new(self.inner.clone())
16596 }
16597
16598 /// Patches the specified SSL policy with the data included in the request.
16599 pub fn patch(&self) -> super::builder::ssl_policies::Patch {
16600 super::builder::ssl_policies::Patch::new(self.inner.clone())
16601 }
16602
16603 /// Retrieves the specified Operations resource.
16604 pub fn get_operation(&self) -> super::builder::ssl_policies::GetOperation {
16605 super::builder::ssl_policies::GetOperation::new(self.inner.clone())
16606 }
16607}
16608
16609/// Implements a client for the Google Compute Engine API.
16610///
16611/// # Example
16612/// ```
16613/// # use google_cloud_compute_v1::client::StoragePoolTypes;
16614/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
16615/// let client = StoragePoolTypes::builder().build().await?;
16616/// // use `client` to make requests to the Google Compute Engine API.
16617/// # Ok(()) }
16618/// ```
16619///
16620/// # Service Description
16621///
16622/// Service for the `storagePoolTypes` resource.
16623///
16624/// # Configuration
16625///
16626/// To configure `StoragePoolTypes` use the `with_*` methods in the type returned
16627/// by [builder()][StoragePoolTypes::builder]. The default configuration should
16628/// work for most applications. Common configuration changes include
16629///
16630/// * [with_endpoint()]: by default this client uses the global default endpoint
16631/// (`https://compute.googleapis.com`). Applications using regional
16632/// endpoints or running in restricted networks (e.g. a network configured
16633// with [Private Google Access with VPC Service Controls]) may want to
16634/// override this default.
16635/// * [with_credentials()]: by default this client uses
16636/// [Application Default Credentials]. Applications using custom
16637/// authentication may need to override this default.
16638///
16639/// [with_endpoint()]: super::builder::storage_pool_types::ClientBuilder::with_endpoint
16640/// [with_credentials()]: super::builder::storage_pool_types::ClientBuilder::with_credentials
16641/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16642/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16643///
16644/// # Pooling and Cloning
16645///
16646/// `StoragePoolTypes` holds a connection pool internally, it is advised to
16647/// create one and reuse it. You do not need to wrap `StoragePoolTypes` in
16648/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16649/// already uses an `Arc` internally.
16650#[cfg(feature = "storage-pool-types")]
16651#[cfg_attr(docsrs, doc(cfg(feature = "storage-pool-types")))]
16652#[derive(Clone, Debug)]
16653pub struct StoragePoolTypes {
16654 inner: std::sync::Arc<dyn super::stub::dynamic::StoragePoolTypes>,
16655}
16656
16657#[cfg(feature = "storage-pool-types")]
16658impl StoragePoolTypes {
16659 /// Returns a builder for [StoragePoolTypes].
16660 ///
16661 /// ```
16662 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16663 /// # use google_cloud_compute_v1::client::StoragePoolTypes;
16664 /// let client = StoragePoolTypes::builder().build().await?;
16665 /// # Ok(()) }
16666 /// ```
16667 pub fn builder() -> super::builder::storage_pool_types::ClientBuilder {
16668 crate::new_client_builder(super::builder::storage_pool_types::client::Factory)
16669 }
16670
16671 /// Creates a new client from the provided stub.
16672 ///
16673 /// The most common case for calling this function is in tests mocking the
16674 /// client's behavior.
16675 pub fn from_stub<T>(stub: T) -> Self
16676 where
16677 T: super::stub::StoragePoolTypes + 'static,
16678 {
16679 Self {
16680 inner: std::sync::Arc::new(stub),
16681 }
16682 }
16683
16684 pub(crate) async fn new(
16685 config: gaxi::options::ClientConfig,
16686 ) -> crate::ClientBuilderResult<Self> {
16687 let inner = Self::build_inner(config).await?;
16688 Ok(Self { inner })
16689 }
16690
16691 async fn build_inner(
16692 conf: gaxi::options::ClientConfig,
16693 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::StoragePoolTypes>>
16694 {
16695 if gaxi::options::tracing_enabled(&conf) {
16696 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16697 }
16698 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16699 }
16700
16701 async fn build_transport(
16702 conf: gaxi::options::ClientConfig,
16703 ) -> crate::ClientBuilderResult<impl super::stub::StoragePoolTypes> {
16704 super::transport::StoragePoolTypes::new(conf).await
16705 }
16706
16707 async fn build_with_tracing(
16708 conf: gaxi::options::ClientConfig,
16709 ) -> crate::ClientBuilderResult<impl super::stub::StoragePoolTypes> {
16710 Self::build_transport(conf)
16711 .await
16712 .map(super::tracing::StoragePoolTypes::new)
16713 }
16714
16715 /// Retrieves an aggregated list of storage pool types.
16716 ///
16717 /// To prevent failure, Google recommends that you set the
16718 /// `returnPartialSuccess` parameter to `true`.
16719 pub fn aggregated_list(&self) -> super::builder::storage_pool_types::AggregatedList {
16720 super::builder::storage_pool_types::AggregatedList::new(self.inner.clone())
16721 }
16722
16723 /// Returns the specified storage pool type.
16724 pub fn get(&self) -> super::builder::storage_pool_types::Get {
16725 super::builder::storage_pool_types::Get::new(self.inner.clone())
16726 }
16727
16728 /// Retrieves a list of storage pool types available to the specified
16729 /// project.
16730 pub fn list(&self) -> super::builder::storage_pool_types::List {
16731 super::builder::storage_pool_types::List::new(self.inner.clone())
16732 }
16733}
16734
16735/// Implements a client for the Google Compute Engine API.
16736///
16737/// # Example
16738/// ```
16739/// # use google_cloud_compute_v1::client::StoragePools;
16740/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
16741/// let client = StoragePools::builder().build().await?;
16742/// // use `client` to make requests to the Google Compute Engine API.
16743/// # Ok(()) }
16744/// ```
16745///
16746/// # Service Description
16747///
16748/// Service for the `storagePools` resource.
16749///
16750/// # Configuration
16751///
16752/// To configure `StoragePools` use the `with_*` methods in the type returned
16753/// by [builder()][StoragePools::builder]. The default configuration should
16754/// work for most applications. Common configuration changes include
16755///
16756/// * [with_endpoint()]: by default this client uses the global default endpoint
16757/// (`https://compute.googleapis.com`). Applications using regional
16758/// endpoints or running in restricted networks (e.g. a network configured
16759// with [Private Google Access with VPC Service Controls]) may want to
16760/// override this default.
16761/// * [with_credentials()]: by default this client uses
16762/// [Application Default Credentials]. Applications using custom
16763/// authentication may need to override this default.
16764///
16765/// [with_endpoint()]: super::builder::storage_pools::ClientBuilder::with_endpoint
16766/// [with_credentials()]: super::builder::storage_pools::ClientBuilder::with_credentials
16767/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16768/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16769///
16770/// # Pooling and Cloning
16771///
16772/// `StoragePools` holds a connection pool internally, it is advised to
16773/// create one and reuse it. You do not need to wrap `StoragePools` in
16774/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16775/// already uses an `Arc` internally.
16776#[cfg(feature = "storage-pools")]
16777#[cfg_attr(docsrs, doc(cfg(feature = "storage-pools")))]
16778#[derive(Clone, Debug)]
16779pub struct StoragePools {
16780 inner: std::sync::Arc<dyn super::stub::dynamic::StoragePools>,
16781}
16782
16783#[cfg(feature = "storage-pools")]
16784impl StoragePools {
16785 /// Returns a builder for [StoragePools].
16786 ///
16787 /// ```
16788 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16789 /// # use google_cloud_compute_v1::client::StoragePools;
16790 /// let client = StoragePools::builder().build().await?;
16791 /// # Ok(()) }
16792 /// ```
16793 pub fn builder() -> super::builder::storage_pools::ClientBuilder {
16794 crate::new_client_builder(super::builder::storage_pools::client::Factory)
16795 }
16796
16797 /// Creates a new client from the provided stub.
16798 ///
16799 /// The most common case for calling this function is in tests mocking the
16800 /// client's behavior.
16801 pub fn from_stub<T>(stub: T) -> Self
16802 where
16803 T: super::stub::StoragePools + 'static,
16804 {
16805 Self {
16806 inner: std::sync::Arc::new(stub),
16807 }
16808 }
16809
16810 pub(crate) async fn new(
16811 config: gaxi::options::ClientConfig,
16812 ) -> crate::ClientBuilderResult<Self> {
16813 let inner = Self::build_inner(config).await?;
16814 Ok(Self { inner })
16815 }
16816
16817 async fn build_inner(
16818 conf: gaxi::options::ClientConfig,
16819 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::StoragePools>> {
16820 if gaxi::options::tracing_enabled(&conf) {
16821 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16822 }
16823 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16824 }
16825
16826 async fn build_transport(
16827 conf: gaxi::options::ClientConfig,
16828 ) -> crate::ClientBuilderResult<impl super::stub::StoragePools> {
16829 super::transport::StoragePools::new(conf).await
16830 }
16831
16832 async fn build_with_tracing(
16833 conf: gaxi::options::ClientConfig,
16834 ) -> crate::ClientBuilderResult<impl super::stub::StoragePools> {
16835 Self::build_transport(conf)
16836 .await
16837 .map(super::tracing::StoragePools::new)
16838 }
16839
16840 /// Retrieves an aggregated list of storage pools.
16841 ///
16842 /// To prevent failure, Google recommends that you set the
16843 /// `returnPartialSuccess` parameter to `true`.
16844 pub fn aggregated_list(&self) -> super::builder::storage_pools::AggregatedList {
16845 super::builder::storage_pools::AggregatedList::new(self.inner.clone())
16846 }
16847
16848 /// Deletes the specified storage pool. Deleting a storagePool
16849 /// removes its data permanently and is irreversible. However, deleting a
16850 /// storagePool does not delete any snapshots previously
16851 /// made from the storagePool. You must separately delete
16852 /// snapshots.
16853 pub fn delete(&self) -> super::builder::storage_pools::Delete {
16854 super::builder::storage_pools::Delete::new(self.inner.clone())
16855 }
16856
16857 /// Returns a specified storage pool. Gets a list of available
16858 /// storage pools by making a list() request.
16859 pub fn get(&self) -> super::builder::storage_pools::Get {
16860 super::builder::storage_pools::Get::new(self.inner.clone())
16861 }
16862
16863 /// Gets the access control policy for a resource. May be empty if no such
16864 /// policy or resource exists.
16865 pub fn get_iam_policy(&self) -> super::builder::storage_pools::GetIamPolicy {
16866 super::builder::storage_pools::GetIamPolicy::new(self.inner.clone())
16867 }
16868
16869 /// Creates a storage pool in the specified project using the data
16870 /// in the request.
16871 pub fn insert(&self) -> super::builder::storage_pools::Insert {
16872 super::builder::storage_pools::Insert::new(self.inner.clone())
16873 }
16874
16875 /// Retrieves a list of storage pools contained within
16876 /// the specified zone.
16877 pub fn list(&self) -> super::builder::storage_pools::List {
16878 super::builder::storage_pools::List::new(self.inner.clone())
16879 }
16880
16881 /// Lists the disks in a specified storage pool.
16882 pub fn list_disks(&self) -> super::builder::storage_pools::ListDisks {
16883 super::builder::storage_pools::ListDisks::new(self.inner.clone())
16884 }
16885
16886 /// Sets the access control policy on the specified resource.
16887 /// Replaces any existing policy.
16888 pub fn set_iam_policy(&self) -> super::builder::storage_pools::SetIamPolicy {
16889 super::builder::storage_pools::SetIamPolicy::new(self.inner.clone())
16890 }
16891
16892 /// Returns permissions that a caller has on the specified resource.
16893 pub fn test_iam_permissions(&self) -> super::builder::storage_pools::TestIamPermissions {
16894 super::builder::storage_pools::TestIamPermissions::new(self.inner.clone())
16895 }
16896
16897 /// Updates the specified storagePool with the data included in the request.
16898 /// The update is performed only on selected fields included as part
16899 /// of update-mask. Only the following fields can be modified:
16900 /// pool_provisioned_capacity_gb, pool_provisioned_iops and
16901 /// pool_provisioned_throughput.
16902 pub fn update(&self) -> super::builder::storage_pools::Update {
16903 super::builder::storage_pools::Update::new(self.inner.clone())
16904 }
16905
16906 /// Retrieves the specified zone-specific Operations resource.
16907 pub fn get_operation(&self) -> super::builder::storage_pools::GetOperation {
16908 super::builder::storage_pools::GetOperation::new(self.inner.clone())
16909 }
16910}
16911
16912/// Implements a client for the Google Compute Engine API.
16913///
16914/// # Example
16915/// ```
16916/// # use google_cloud_compute_v1::client::Subnetworks;
16917/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
16918/// let client = Subnetworks::builder().build().await?;
16919/// // use `client` to make requests to the Google Compute Engine API.
16920/// # Ok(()) }
16921/// ```
16922///
16923/// # Service Description
16924///
16925/// Service for the `subnetworks` resource.
16926///
16927/// # Configuration
16928///
16929/// To configure `Subnetworks` use the `with_*` methods in the type returned
16930/// by [builder()][Subnetworks::builder]. The default configuration should
16931/// work for most applications. Common configuration changes include
16932///
16933/// * [with_endpoint()]: by default this client uses the global default endpoint
16934/// (`https://compute.googleapis.com`). Applications using regional
16935/// endpoints or running in restricted networks (e.g. a network configured
16936// with [Private Google Access with VPC Service Controls]) may want to
16937/// override this default.
16938/// * [with_credentials()]: by default this client uses
16939/// [Application Default Credentials]. Applications using custom
16940/// authentication may need to override this default.
16941///
16942/// [with_endpoint()]: super::builder::subnetworks::ClientBuilder::with_endpoint
16943/// [with_credentials()]: super::builder::subnetworks::ClientBuilder::with_credentials
16944/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16945/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16946///
16947/// # Pooling and Cloning
16948///
16949/// `Subnetworks` holds a connection pool internally, it is advised to
16950/// create one and reuse it. You do not need to wrap `Subnetworks` in
16951/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16952/// already uses an `Arc` internally.
16953#[cfg(feature = "subnetworks")]
16954#[cfg_attr(docsrs, doc(cfg(feature = "subnetworks")))]
16955#[derive(Clone, Debug)]
16956pub struct Subnetworks {
16957 inner: std::sync::Arc<dyn super::stub::dynamic::Subnetworks>,
16958}
16959
16960#[cfg(feature = "subnetworks")]
16961impl Subnetworks {
16962 /// Returns a builder for [Subnetworks].
16963 ///
16964 /// ```
16965 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16966 /// # use google_cloud_compute_v1::client::Subnetworks;
16967 /// let client = Subnetworks::builder().build().await?;
16968 /// # Ok(()) }
16969 /// ```
16970 pub fn builder() -> super::builder::subnetworks::ClientBuilder {
16971 crate::new_client_builder(super::builder::subnetworks::client::Factory)
16972 }
16973
16974 /// Creates a new client from the provided stub.
16975 ///
16976 /// The most common case for calling this function is in tests mocking the
16977 /// client's behavior.
16978 pub fn from_stub<T>(stub: T) -> Self
16979 where
16980 T: super::stub::Subnetworks + 'static,
16981 {
16982 Self {
16983 inner: std::sync::Arc::new(stub),
16984 }
16985 }
16986
16987 pub(crate) async fn new(
16988 config: gaxi::options::ClientConfig,
16989 ) -> crate::ClientBuilderResult<Self> {
16990 let inner = Self::build_inner(config).await?;
16991 Ok(Self { inner })
16992 }
16993
16994 async fn build_inner(
16995 conf: gaxi::options::ClientConfig,
16996 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Subnetworks>> {
16997 if gaxi::options::tracing_enabled(&conf) {
16998 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16999 }
17000 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17001 }
17002
17003 async fn build_transport(
17004 conf: gaxi::options::ClientConfig,
17005 ) -> crate::ClientBuilderResult<impl super::stub::Subnetworks> {
17006 super::transport::Subnetworks::new(conf).await
17007 }
17008
17009 async fn build_with_tracing(
17010 conf: gaxi::options::ClientConfig,
17011 ) -> crate::ClientBuilderResult<impl super::stub::Subnetworks> {
17012 Self::build_transport(conf)
17013 .await
17014 .map(super::tracing::Subnetworks::new)
17015 }
17016
17017 /// Retrieves an aggregated list of subnetworks.
17018 ///
17019 /// To prevent failure, Google recommends that you set the
17020 /// `returnPartialSuccess` parameter to `true`.
17021 pub fn aggregated_list(&self) -> super::builder::subnetworks::AggregatedList {
17022 super::builder::subnetworks::AggregatedList::new(self.inner.clone())
17023 }
17024
17025 /// Deletes the specified subnetwork.
17026 pub fn delete(&self) -> super::builder::subnetworks::Delete {
17027 super::builder::subnetworks::Delete::new(self.inner.clone())
17028 }
17029
17030 /// Expands the IP CIDR range of the subnetwork to a specified value.
17031 pub fn expand_ip_cidr_range(&self) -> super::builder::subnetworks::ExpandIpCidrRange {
17032 super::builder::subnetworks::ExpandIpCidrRange::new(self.inner.clone())
17033 }
17034
17035 /// Returns the specified subnetwork.
17036 pub fn get(&self) -> super::builder::subnetworks::Get {
17037 super::builder::subnetworks::Get::new(self.inner.clone())
17038 }
17039
17040 /// Gets the access control policy for a resource. May be empty if no such
17041 /// policy or resource exists.
17042 pub fn get_iam_policy(&self) -> super::builder::subnetworks::GetIamPolicy {
17043 super::builder::subnetworks::GetIamPolicy::new(self.inner.clone())
17044 }
17045
17046 /// Creates a subnetwork in the specified project using the data
17047 /// included in the request.
17048 pub fn insert(&self) -> super::builder::subnetworks::Insert {
17049 super::builder::subnetworks::Insert::new(self.inner.clone())
17050 }
17051
17052 /// Retrieves a list of subnetworks available to the specified
17053 /// project.
17054 pub fn list(&self) -> super::builder::subnetworks::List {
17055 super::builder::subnetworks::List::new(self.inner.clone())
17056 }
17057
17058 /// Retrieves an aggregated list of all usable subnetworks in the project.
17059 pub fn list_usable(&self) -> super::builder::subnetworks::ListUsable {
17060 super::builder::subnetworks::ListUsable::new(self.inner.clone())
17061 }
17062
17063 /// Patches the specified subnetwork with the data included in the request.
17064 /// Only certain fields can be updated with a patch request
17065 /// as indicated in the field descriptions.
17066 /// You must specify the current fingerprint of the
17067 /// subnetwork resource being patched.
17068 pub fn patch(&self) -> super::builder::subnetworks::Patch {
17069 super::builder::subnetworks::Patch::new(self.inner.clone())
17070 }
17071
17072 /// Sets the access control policy on the specified resource.
17073 /// Replaces any existing policy.
17074 pub fn set_iam_policy(&self) -> super::builder::subnetworks::SetIamPolicy {
17075 super::builder::subnetworks::SetIamPolicy::new(self.inner.clone())
17076 }
17077
17078 /// Set whether VMs in this subnet can access Google services without assigning
17079 /// external IP addresses through Private Google Access.
17080 pub fn set_private_ip_google_access(
17081 &self,
17082 ) -> super::builder::subnetworks::SetPrivateIpGoogleAccess {
17083 super::builder::subnetworks::SetPrivateIpGoogleAccess::new(self.inner.clone())
17084 }
17085
17086 /// Returns permissions that a caller has on the specified resource.
17087 pub fn test_iam_permissions(&self) -> super::builder::subnetworks::TestIamPermissions {
17088 super::builder::subnetworks::TestIamPermissions::new(self.inner.clone())
17089 }
17090
17091 /// Retrieves the specified region-specific Operations resource.
17092 pub fn get_operation(&self) -> super::builder::subnetworks::GetOperation {
17093 super::builder::subnetworks::GetOperation::new(self.inner.clone())
17094 }
17095}
17096
17097/// Implements a client for the Google Compute Engine API.
17098///
17099/// # Example
17100/// ```
17101/// # use google_cloud_compute_v1::client::TargetGrpcProxies;
17102/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
17103/// let client = TargetGrpcProxies::builder().build().await?;
17104/// // use `client` to make requests to the Google Compute Engine API.
17105/// # Ok(()) }
17106/// ```
17107///
17108/// # Service Description
17109///
17110/// Service for the `targetGrpcProxies` resource.
17111///
17112/// # Configuration
17113///
17114/// To configure `TargetGrpcProxies` use the `with_*` methods in the type returned
17115/// by [builder()][TargetGrpcProxies::builder]. The default configuration should
17116/// work for most applications. Common configuration changes include
17117///
17118/// * [with_endpoint()]: by default this client uses the global default endpoint
17119/// (`https://compute.googleapis.com`). Applications using regional
17120/// endpoints or running in restricted networks (e.g. a network configured
17121// with [Private Google Access with VPC Service Controls]) may want to
17122/// override this default.
17123/// * [with_credentials()]: by default this client uses
17124/// [Application Default Credentials]. Applications using custom
17125/// authentication may need to override this default.
17126///
17127/// [with_endpoint()]: super::builder::target_grpc_proxies::ClientBuilder::with_endpoint
17128/// [with_credentials()]: super::builder::target_grpc_proxies::ClientBuilder::with_credentials
17129/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17130/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17131///
17132/// # Pooling and Cloning
17133///
17134/// `TargetGrpcProxies` holds a connection pool internally, it is advised to
17135/// create one and reuse it. You do not need to wrap `TargetGrpcProxies` in
17136/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17137/// already uses an `Arc` internally.
17138#[cfg(feature = "target-grpc-proxies")]
17139#[cfg_attr(docsrs, doc(cfg(feature = "target-grpc-proxies")))]
17140#[derive(Clone, Debug)]
17141pub struct TargetGrpcProxies {
17142 inner: std::sync::Arc<dyn super::stub::dynamic::TargetGrpcProxies>,
17143}
17144
17145#[cfg(feature = "target-grpc-proxies")]
17146impl TargetGrpcProxies {
17147 /// Returns a builder for [TargetGrpcProxies].
17148 ///
17149 /// ```
17150 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17151 /// # use google_cloud_compute_v1::client::TargetGrpcProxies;
17152 /// let client = TargetGrpcProxies::builder().build().await?;
17153 /// # Ok(()) }
17154 /// ```
17155 pub fn builder() -> super::builder::target_grpc_proxies::ClientBuilder {
17156 crate::new_client_builder(super::builder::target_grpc_proxies::client::Factory)
17157 }
17158
17159 /// Creates a new client from the provided stub.
17160 ///
17161 /// The most common case for calling this function is in tests mocking the
17162 /// client's behavior.
17163 pub fn from_stub<T>(stub: T) -> Self
17164 where
17165 T: super::stub::TargetGrpcProxies + 'static,
17166 {
17167 Self {
17168 inner: std::sync::Arc::new(stub),
17169 }
17170 }
17171
17172 pub(crate) async fn new(
17173 config: gaxi::options::ClientConfig,
17174 ) -> crate::ClientBuilderResult<Self> {
17175 let inner = Self::build_inner(config).await?;
17176 Ok(Self { inner })
17177 }
17178
17179 async fn build_inner(
17180 conf: gaxi::options::ClientConfig,
17181 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetGrpcProxies>>
17182 {
17183 if gaxi::options::tracing_enabled(&conf) {
17184 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17185 }
17186 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17187 }
17188
17189 async fn build_transport(
17190 conf: gaxi::options::ClientConfig,
17191 ) -> crate::ClientBuilderResult<impl super::stub::TargetGrpcProxies> {
17192 super::transport::TargetGrpcProxies::new(conf).await
17193 }
17194
17195 async fn build_with_tracing(
17196 conf: gaxi::options::ClientConfig,
17197 ) -> crate::ClientBuilderResult<impl super::stub::TargetGrpcProxies> {
17198 Self::build_transport(conf)
17199 .await
17200 .map(super::tracing::TargetGrpcProxies::new)
17201 }
17202
17203 /// Deletes the specified TargetGrpcProxy in the given scope
17204 pub fn delete(&self) -> super::builder::target_grpc_proxies::Delete {
17205 super::builder::target_grpc_proxies::Delete::new(self.inner.clone())
17206 }
17207
17208 /// Returns the specified TargetGrpcProxy resource in the given scope.
17209 pub fn get(&self) -> super::builder::target_grpc_proxies::Get {
17210 super::builder::target_grpc_proxies::Get::new(self.inner.clone())
17211 }
17212
17213 /// Creates a TargetGrpcProxy in the specified project in the given scope
17214 /// using the parameters that are included in the request.
17215 pub fn insert(&self) -> super::builder::target_grpc_proxies::Insert {
17216 super::builder::target_grpc_proxies::Insert::new(self.inner.clone())
17217 }
17218
17219 /// Lists the TargetGrpcProxies for a project in the given scope.
17220 pub fn list(&self) -> super::builder::target_grpc_proxies::List {
17221 super::builder::target_grpc_proxies::List::new(self.inner.clone())
17222 }
17223
17224 /// Patches the specified TargetGrpcProxy resource with the data included in
17225 /// the request. This method supports PATCH
17226 /// semantics and usesJSON merge
17227 /// patch format and processing rules.
17228 pub fn patch(&self) -> super::builder::target_grpc_proxies::Patch {
17229 super::builder::target_grpc_proxies::Patch::new(self.inner.clone())
17230 }
17231
17232 /// Retrieves the specified Operations resource.
17233 pub fn get_operation(&self) -> super::builder::target_grpc_proxies::GetOperation {
17234 super::builder::target_grpc_proxies::GetOperation::new(self.inner.clone())
17235 }
17236}
17237
17238/// Implements a client for the Google Compute Engine API.
17239///
17240/// # Example
17241/// ```
17242/// # use google_cloud_compute_v1::client::TargetHttpProxies;
17243/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
17244/// let client = TargetHttpProxies::builder().build().await?;
17245/// // use `client` to make requests to the Google Compute Engine API.
17246/// # Ok(()) }
17247/// ```
17248///
17249/// # Service Description
17250///
17251/// Service for the `targetHttpProxies` resource.
17252///
17253/// # Configuration
17254///
17255/// To configure `TargetHttpProxies` use the `with_*` methods in the type returned
17256/// by [builder()][TargetHttpProxies::builder]. The default configuration should
17257/// work for most applications. Common configuration changes include
17258///
17259/// * [with_endpoint()]: by default this client uses the global default endpoint
17260/// (`https://compute.googleapis.com`). Applications using regional
17261/// endpoints or running in restricted networks (e.g. a network configured
17262// with [Private Google Access with VPC Service Controls]) may want to
17263/// override this default.
17264/// * [with_credentials()]: by default this client uses
17265/// [Application Default Credentials]. Applications using custom
17266/// authentication may need to override this default.
17267///
17268/// [with_endpoint()]: super::builder::target_http_proxies::ClientBuilder::with_endpoint
17269/// [with_credentials()]: super::builder::target_http_proxies::ClientBuilder::with_credentials
17270/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17271/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17272///
17273/// # Pooling and Cloning
17274///
17275/// `TargetHttpProxies` holds a connection pool internally, it is advised to
17276/// create one and reuse it. You do not need to wrap `TargetHttpProxies` in
17277/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17278/// already uses an `Arc` internally.
17279#[cfg(feature = "target-http-proxies")]
17280#[cfg_attr(docsrs, doc(cfg(feature = "target-http-proxies")))]
17281#[derive(Clone, Debug)]
17282pub struct TargetHttpProxies {
17283 inner: std::sync::Arc<dyn super::stub::dynamic::TargetHttpProxies>,
17284}
17285
17286#[cfg(feature = "target-http-proxies")]
17287impl TargetHttpProxies {
17288 /// Returns a builder for [TargetHttpProxies].
17289 ///
17290 /// ```
17291 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17292 /// # use google_cloud_compute_v1::client::TargetHttpProxies;
17293 /// let client = TargetHttpProxies::builder().build().await?;
17294 /// # Ok(()) }
17295 /// ```
17296 pub fn builder() -> super::builder::target_http_proxies::ClientBuilder {
17297 crate::new_client_builder(super::builder::target_http_proxies::client::Factory)
17298 }
17299
17300 /// Creates a new client from the provided stub.
17301 ///
17302 /// The most common case for calling this function is in tests mocking the
17303 /// client's behavior.
17304 pub fn from_stub<T>(stub: T) -> Self
17305 where
17306 T: super::stub::TargetHttpProxies + 'static,
17307 {
17308 Self {
17309 inner: std::sync::Arc::new(stub),
17310 }
17311 }
17312
17313 pub(crate) async fn new(
17314 config: gaxi::options::ClientConfig,
17315 ) -> crate::ClientBuilderResult<Self> {
17316 let inner = Self::build_inner(config).await?;
17317 Ok(Self { inner })
17318 }
17319
17320 async fn build_inner(
17321 conf: gaxi::options::ClientConfig,
17322 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetHttpProxies>>
17323 {
17324 if gaxi::options::tracing_enabled(&conf) {
17325 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17326 }
17327 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17328 }
17329
17330 async fn build_transport(
17331 conf: gaxi::options::ClientConfig,
17332 ) -> crate::ClientBuilderResult<impl super::stub::TargetHttpProxies> {
17333 super::transport::TargetHttpProxies::new(conf).await
17334 }
17335
17336 async fn build_with_tracing(
17337 conf: gaxi::options::ClientConfig,
17338 ) -> crate::ClientBuilderResult<impl super::stub::TargetHttpProxies> {
17339 Self::build_transport(conf)
17340 .await
17341 .map(super::tracing::TargetHttpProxies::new)
17342 }
17343
17344 /// Retrieves the list of all TargetHttpProxy resources, regional and global,
17345 /// available to the specified project.
17346 ///
17347 /// To prevent failure, Google recommends that you set the
17348 /// `returnPartialSuccess` parameter to `true`.
17349 pub fn aggregated_list(&self) -> super::builder::target_http_proxies::AggregatedList {
17350 super::builder::target_http_proxies::AggregatedList::new(self.inner.clone())
17351 }
17352
17353 /// Deletes the specified TargetHttpProxy resource.
17354 pub fn delete(&self) -> super::builder::target_http_proxies::Delete {
17355 super::builder::target_http_proxies::Delete::new(self.inner.clone())
17356 }
17357
17358 /// Returns the specified TargetHttpProxy resource.
17359 pub fn get(&self) -> super::builder::target_http_proxies::Get {
17360 super::builder::target_http_proxies::Get::new(self.inner.clone())
17361 }
17362
17363 /// Creates a TargetHttpProxy resource in the specified
17364 /// project using the data included in the request.
17365 pub fn insert(&self) -> super::builder::target_http_proxies::Insert {
17366 super::builder::target_http_proxies::Insert::new(self.inner.clone())
17367 }
17368
17369 /// Retrieves the list of TargetHttpProxy resources available
17370 /// to the specified project.
17371 pub fn list(&self) -> super::builder::target_http_proxies::List {
17372 super::builder::target_http_proxies::List::new(self.inner.clone())
17373 }
17374
17375 /// Patches the specified TargetHttpProxy resource with the data included in
17376 /// the request. This method supports PATCH
17377 /// semantics and usesJSON merge
17378 /// patch format and processing rules.
17379 pub fn patch(&self) -> super::builder::target_http_proxies::Patch {
17380 super::builder::target_http_proxies::Patch::new(self.inner.clone())
17381 }
17382
17383 /// Changes the URL map for TargetHttpProxy.
17384 pub fn set_url_map(&self) -> super::builder::target_http_proxies::SetUrlMap {
17385 super::builder::target_http_proxies::SetUrlMap::new(self.inner.clone())
17386 }
17387
17388 /// Retrieves the specified Operations resource.
17389 pub fn get_operation(&self) -> super::builder::target_http_proxies::GetOperation {
17390 super::builder::target_http_proxies::GetOperation::new(self.inner.clone())
17391 }
17392}
17393
17394/// Implements a client for the Google Compute Engine API.
17395///
17396/// # Example
17397/// ```
17398/// # use google_cloud_compute_v1::client::TargetHttpsProxies;
17399/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
17400/// let client = TargetHttpsProxies::builder().build().await?;
17401/// // use `client` to make requests to the Google Compute Engine API.
17402/// # Ok(()) }
17403/// ```
17404///
17405/// # Service Description
17406///
17407/// Service for the `targetHttpsProxies` resource.
17408///
17409/// # Configuration
17410///
17411/// To configure `TargetHttpsProxies` use the `with_*` methods in the type returned
17412/// by [builder()][TargetHttpsProxies::builder]. The default configuration should
17413/// work for most applications. Common configuration changes include
17414///
17415/// * [with_endpoint()]: by default this client uses the global default endpoint
17416/// (`https://compute.googleapis.com`). Applications using regional
17417/// endpoints or running in restricted networks (e.g. a network configured
17418// with [Private Google Access with VPC Service Controls]) may want to
17419/// override this default.
17420/// * [with_credentials()]: by default this client uses
17421/// [Application Default Credentials]. Applications using custom
17422/// authentication may need to override this default.
17423///
17424/// [with_endpoint()]: super::builder::target_https_proxies::ClientBuilder::with_endpoint
17425/// [with_credentials()]: super::builder::target_https_proxies::ClientBuilder::with_credentials
17426/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17427/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17428///
17429/// # Pooling and Cloning
17430///
17431/// `TargetHttpsProxies` holds a connection pool internally, it is advised to
17432/// create one and reuse it. You do not need to wrap `TargetHttpsProxies` in
17433/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17434/// already uses an `Arc` internally.
17435#[cfg(feature = "target-https-proxies")]
17436#[cfg_attr(docsrs, doc(cfg(feature = "target-https-proxies")))]
17437#[derive(Clone, Debug)]
17438pub struct TargetHttpsProxies {
17439 inner: std::sync::Arc<dyn super::stub::dynamic::TargetHttpsProxies>,
17440}
17441
17442#[cfg(feature = "target-https-proxies")]
17443impl TargetHttpsProxies {
17444 /// Returns a builder for [TargetHttpsProxies].
17445 ///
17446 /// ```
17447 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17448 /// # use google_cloud_compute_v1::client::TargetHttpsProxies;
17449 /// let client = TargetHttpsProxies::builder().build().await?;
17450 /// # Ok(()) }
17451 /// ```
17452 pub fn builder() -> super::builder::target_https_proxies::ClientBuilder {
17453 crate::new_client_builder(super::builder::target_https_proxies::client::Factory)
17454 }
17455
17456 /// Creates a new client from the provided stub.
17457 ///
17458 /// The most common case for calling this function is in tests mocking the
17459 /// client's behavior.
17460 pub fn from_stub<T>(stub: T) -> Self
17461 where
17462 T: super::stub::TargetHttpsProxies + 'static,
17463 {
17464 Self {
17465 inner: std::sync::Arc::new(stub),
17466 }
17467 }
17468
17469 pub(crate) async fn new(
17470 config: gaxi::options::ClientConfig,
17471 ) -> crate::ClientBuilderResult<Self> {
17472 let inner = Self::build_inner(config).await?;
17473 Ok(Self { inner })
17474 }
17475
17476 async fn build_inner(
17477 conf: gaxi::options::ClientConfig,
17478 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetHttpsProxies>>
17479 {
17480 if gaxi::options::tracing_enabled(&conf) {
17481 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17482 }
17483 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17484 }
17485
17486 async fn build_transport(
17487 conf: gaxi::options::ClientConfig,
17488 ) -> crate::ClientBuilderResult<impl super::stub::TargetHttpsProxies> {
17489 super::transport::TargetHttpsProxies::new(conf).await
17490 }
17491
17492 async fn build_with_tracing(
17493 conf: gaxi::options::ClientConfig,
17494 ) -> crate::ClientBuilderResult<impl super::stub::TargetHttpsProxies> {
17495 Self::build_transport(conf)
17496 .await
17497 .map(super::tracing::TargetHttpsProxies::new)
17498 }
17499
17500 /// Retrieves the list of all TargetHttpsProxy resources, regional and global,
17501 /// available to the specified project.
17502 ///
17503 /// To prevent failure, Google recommends that you set the
17504 /// `returnPartialSuccess` parameter to `true`.
17505 pub fn aggregated_list(&self) -> super::builder::target_https_proxies::AggregatedList {
17506 super::builder::target_https_proxies::AggregatedList::new(self.inner.clone())
17507 }
17508
17509 /// Deletes the specified TargetHttpsProxy resource.
17510 pub fn delete(&self) -> super::builder::target_https_proxies::Delete {
17511 super::builder::target_https_proxies::Delete::new(self.inner.clone())
17512 }
17513
17514 /// Returns the specified TargetHttpsProxy resource.
17515 pub fn get(&self) -> super::builder::target_https_proxies::Get {
17516 super::builder::target_https_proxies::Get::new(self.inner.clone())
17517 }
17518
17519 /// Creates a TargetHttpsProxy resource in the specified
17520 /// project using the data included in the request.
17521 pub fn insert(&self) -> super::builder::target_https_proxies::Insert {
17522 super::builder::target_https_proxies::Insert::new(self.inner.clone())
17523 }
17524
17525 /// Retrieves the list of TargetHttpsProxy resources
17526 /// available to the specified project.
17527 pub fn list(&self) -> super::builder::target_https_proxies::List {
17528 super::builder::target_https_proxies::List::new(self.inner.clone())
17529 }
17530
17531 /// Patches the specified TargetHttpsProxy resource with the data included in
17532 /// the request. This method supports PATCH
17533 /// semantics and usesJSON merge
17534 /// patch format and processing rules.
17535 pub fn patch(&self) -> super::builder::target_https_proxies::Patch {
17536 super::builder::target_https_proxies::Patch::new(self.inner.clone())
17537 }
17538
17539 /// Changes the Certificate Map for TargetHttpsProxy.
17540 pub fn set_certificate_map(&self) -> super::builder::target_https_proxies::SetCertificateMap {
17541 super::builder::target_https_proxies::SetCertificateMap::new(self.inner.clone())
17542 }
17543
17544 /// Sets the QUIC override policy for TargetHttpsProxy.
17545 pub fn set_quic_override(&self) -> super::builder::target_https_proxies::SetQuicOverride {
17546 super::builder::target_https_proxies::SetQuicOverride::new(self.inner.clone())
17547 }
17548
17549 /// Replaces SslCertificates for TargetHttpsProxy.
17550 pub fn set_ssl_certificates(&self) -> super::builder::target_https_proxies::SetSslCertificates {
17551 super::builder::target_https_proxies::SetSslCertificates::new(self.inner.clone())
17552 }
17553
17554 /// Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies the
17555 /// server-side support for SSL features. This affects connections between
17556 /// clients and the HTTPS proxy load balancer. They do not affect the
17557 /// connection between the load balancer and the backends.
17558 pub fn set_ssl_policy(&self) -> super::builder::target_https_proxies::SetSslPolicy {
17559 super::builder::target_https_proxies::SetSslPolicy::new(self.inner.clone())
17560 }
17561
17562 /// Changes the URL map for TargetHttpsProxy.
17563 pub fn set_url_map(&self) -> super::builder::target_https_proxies::SetUrlMap {
17564 super::builder::target_https_proxies::SetUrlMap::new(self.inner.clone())
17565 }
17566
17567 /// Retrieves the specified Operations resource.
17568 pub fn get_operation(&self) -> super::builder::target_https_proxies::GetOperation {
17569 super::builder::target_https_proxies::GetOperation::new(self.inner.clone())
17570 }
17571}
17572
17573/// Implements a client for the Google Compute Engine API.
17574///
17575/// # Example
17576/// ```
17577/// # use google_cloud_compute_v1::client::TargetInstances;
17578/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
17579/// let client = TargetInstances::builder().build().await?;
17580/// // use `client` to make requests to the Google Compute Engine API.
17581/// # Ok(()) }
17582/// ```
17583///
17584/// # Service Description
17585///
17586/// Service for the `targetInstances` resource.
17587///
17588/// # Configuration
17589///
17590/// To configure `TargetInstances` use the `with_*` methods in the type returned
17591/// by [builder()][TargetInstances::builder]. The default configuration should
17592/// work for most applications. Common configuration changes include
17593///
17594/// * [with_endpoint()]: by default this client uses the global default endpoint
17595/// (`https://compute.googleapis.com`). Applications using regional
17596/// endpoints or running in restricted networks (e.g. a network configured
17597// with [Private Google Access with VPC Service Controls]) may want to
17598/// override this default.
17599/// * [with_credentials()]: by default this client uses
17600/// [Application Default Credentials]. Applications using custom
17601/// authentication may need to override this default.
17602///
17603/// [with_endpoint()]: super::builder::target_instances::ClientBuilder::with_endpoint
17604/// [with_credentials()]: super::builder::target_instances::ClientBuilder::with_credentials
17605/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17606/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17607///
17608/// # Pooling and Cloning
17609///
17610/// `TargetInstances` holds a connection pool internally, it is advised to
17611/// create one and reuse it. You do not need to wrap `TargetInstances` in
17612/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17613/// already uses an `Arc` internally.
17614#[cfg(feature = "target-instances")]
17615#[cfg_attr(docsrs, doc(cfg(feature = "target-instances")))]
17616#[derive(Clone, Debug)]
17617pub struct TargetInstances {
17618 inner: std::sync::Arc<dyn super::stub::dynamic::TargetInstances>,
17619}
17620
17621#[cfg(feature = "target-instances")]
17622impl TargetInstances {
17623 /// Returns a builder for [TargetInstances].
17624 ///
17625 /// ```
17626 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17627 /// # use google_cloud_compute_v1::client::TargetInstances;
17628 /// let client = TargetInstances::builder().build().await?;
17629 /// # Ok(()) }
17630 /// ```
17631 pub fn builder() -> super::builder::target_instances::ClientBuilder {
17632 crate::new_client_builder(super::builder::target_instances::client::Factory)
17633 }
17634
17635 /// Creates a new client from the provided stub.
17636 ///
17637 /// The most common case for calling this function is in tests mocking the
17638 /// client's behavior.
17639 pub fn from_stub<T>(stub: T) -> Self
17640 where
17641 T: super::stub::TargetInstances + 'static,
17642 {
17643 Self {
17644 inner: std::sync::Arc::new(stub),
17645 }
17646 }
17647
17648 pub(crate) async fn new(
17649 config: gaxi::options::ClientConfig,
17650 ) -> crate::ClientBuilderResult<Self> {
17651 let inner = Self::build_inner(config).await?;
17652 Ok(Self { inner })
17653 }
17654
17655 async fn build_inner(
17656 conf: gaxi::options::ClientConfig,
17657 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetInstances>> {
17658 if gaxi::options::tracing_enabled(&conf) {
17659 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17660 }
17661 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17662 }
17663
17664 async fn build_transport(
17665 conf: gaxi::options::ClientConfig,
17666 ) -> crate::ClientBuilderResult<impl super::stub::TargetInstances> {
17667 super::transport::TargetInstances::new(conf).await
17668 }
17669
17670 async fn build_with_tracing(
17671 conf: gaxi::options::ClientConfig,
17672 ) -> crate::ClientBuilderResult<impl super::stub::TargetInstances> {
17673 Self::build_transport(conf)
17674 .await
17675 .map(super::tracing::TargetInstances::new)
17676 }
17677
17678 /// Retrieves an aggregated list of target instances.
17679 ///
17680 /// To prevent failure, Google recommends that you set the
17681 /// `returnPartialSuccess` parameter to `true`.
17682 pub fn aggregated_list(&self) -> super::builder::target_instances::AggregatedList {
17683 super::builder::target_instances::AggregatedList::new(self.inner.clone())
17684 }
17685
17686 /// Deletes the specified TargetInstance resource.
17687 pub fn delete(&self) -> super::builder::target_instances::Delete {
17688 super::builder::target_instances::Delete::new(self.inner.clone())
17689 }
17690
17691 /// Returns the specified TargetInstance resource.
17692 pub fn get(&self) -> super::builder::target_instances::Get {
17693 super::builder::target_instances::Get::new(self.inner.clone())
17694 }
17695
17696 /// Creates a TargetInstance resource in the specified project and zone using
17697 /// the data included in the request.
17698 pub fn insert(&self) -> super::builder::target_instances::Insert {
17699 super::builder::target_instances::Insert::new(self.inner.clone())
17700 }
17701
17702 /// Retrieves a list of TargetInstance resources available to the specified
17703 /// project and zone.
17704 pub fn list(&self) -> super::builder::target_instances::List {
17705 super::builder::target_instances::List::new(self.inner.clone())
17706 }
17707
17708 /// Sets the Google Cloud Armor security policy for the specified target
17709 /// instance. For more information, seeGoogle
17710 /// Cloud Armor Overview
17711 pub fn set_security_policy(&self) -> super::builder::target_instances::SetSecurityPolicy {
17712 super::builder::target_instances::SetSecurityPolicy::new(self.inner.clone())
17713 }
17714
17715 /// Returns permissions that a caller has on the specified resource.
17716 pub fn test_iam_permissions(&self) -> super::builder::target_instances::TestIamPermissions {
17717 super::builder::target_instances::TestIamPermissions::new(self.inner.clone())
17718 }
17719
17720 /// Retrieves the specified zone-specific Operations resource.
17721 pub fn get_operation(&self) -> super::builder::target_instances::GetOperation {
17722 super::builder::target_instances::GetOperation::new(self.inner.clone())
17723 }
17724}
17725
17726/// Implements a client for the Google Compute Engine API.
17727///
17728/// # Example
17729/// ```
17730/// # use google_cloud_compute_v1::client::TargetPools;
17731/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
17732/// let client = TargetPools::builder().build().await?;
17733/// // use `client` to make requests to the Google Compute Engine API.
17734/// # Ok(()) }
17735/// ```
17736///
17737/// # Service Description
17738///
17739/// Service for the `targetPools` resource.
17740///
17741/// # Configuration
17742///
17743/// To configure `TargetPools` use the `with_*` methods in the type returned
17744/// by [builder()][TargetPools::builder]. The default configuration should
17745/// work for most applications. Common configuration changes include
17746///
17747/// * [with_endpoint()]: by default this client uses the global default endpoint
17748/// (`https://compute.googleapis.com`). Applications using regional
17749/// endpoints or running in restricted networks (e.g. a network configured
17750// with [Private Google Access with VPC Service Controls]) may want to
17751/// override this default.
17752/// * [with_credentials()]: by default this client uses
17753/// [Application Default Credentials]. Applications using custom
17754/// authentication may need to override this default.
17755///
17756/// [with_endpoint()]: super::builder::target_pools::ClientBuilder::with_endpoint
17757/// [with_credentials()]: super::builder::target_pools::ClientBuilder::with_credentials
17758/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17759/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17760///
17761/// # Pooling and Cloning
17762///
17763/// `TargetPools` holds a connection pool internally, it is advised to
17764/// create one and reuse it. You do not need to wrap `TargetPools` in
17765/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17766/// already uses an `Arc` internally.
17767#[cfg(feature = "target-pools")]
17768#[cfg_attr(docsrs, doc(cfg(feature = "target-pools")))]
17769#[derive(Clone, Debug)]
17770pub struct TargetPools {
17771 inner: std::sync::Arc<dyn super::stub::dynamic::TargetPools>,
17772}
17773
17774#[cfg(feature = "target-pools")]
17775impl TargetPools {
17776 /// Returns a builder for [TargetPools].
17777 ///
17778 /// ```
17779 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17780 /// # use google_cloud_compute_v1::client::TargetPools;
17781 /// let client = TargetPools::builder().build().await?;
17782 /// # Ok(()) }
17783 /// ```
17784 pub fn builder() -> super::builder::target_pools::ClientBuilder {
17785 crate::new_client_builder(super::builder::target_pools::client::Factory)
17786 }
17787
17788 /// Creates a new client from the provided stub.
17789 ///
17790 /// The most common case for calling this function is in tests mocking the
17791 /// client's behavior.
17792 pub fn from_stub<T>(stub: T) -> Self
17793 where
17794 T: super::stub::TargetPools + 'static,
17795 {
17796 Self {
17797 inner: std::sync::Arc::new(stub),
17798 }
17799 }
17800
17801 pub(crate) async fn new(
17802 config: gaxi::options::ClientConfig,
17803 ) -> crate::ClientBuilderResult<Self> {
17804 let inner = Self::build_inner(config).await?;
17805 Ok(Self { inner })
17806 }
17807
17808 async fn build_inner(
17809 conf: gaxi::options::ClientConfig,
17810 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetPools>> {
17811 if gaxi::options::tracing_enabled(&conf) {
17812 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17813 }
17814 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17815 }
17816
17817 async fn build_transport(
17818 conf: gaxi::options::ClientConfig,
17819 ) -> crate::ClientBuilderResult<impl super::stub::TargetPools> {
17820 super::transport::TargetPools::new(conf).await
17821 }
17822
17823 async fn build_with_tracing(
17824 conf: gaxi::options::ClientConfig,
17825 ) -> crate::ClientBuilderResult<impl super::stub::TargetPools> {
17826 Self::build_transport(conf)
17827 .await
17828 .map(super::tracing::TargetPools::new)
17829 }
17830
17831 /// Adds health check URLs to a target pool.
17832 pub fn add_health_check(&self) -> super::builder::target_pools::AddHealthCheck {
17833 super::builder::target_pools::AddHealthCheck::new(self.inner.clone())
17834 }
17835
17836 /// Adds an instance to a target pool.
17837 pub fn add_instance(&self) -> super::builder::target_pools::AddInstance {
17838 super::builder::target_pools::AddInstance::new(self.inner.clone())
17839 }
17840
17841 /// Retrieves an aggregated list of target pools.
17842 ///
17843 /// To prevent failure, Google recommends that you set the
17844 /// `returnPartialSuccess` parameter to `true`.
17845 pub fn aggregated_list(&self) -> super::builder::target_pools::AggregatedList {
17846 super::builder::target_pools::AggregatedList::new(self.inner.clone())
17847 }
17848
17849 /// Deletes the specified target pool.
17850 pub fn delete(&self) -> super::builder::target_pools::Delete {
17851 super::builder::target_pools::Delete::new(self.inner.clone())
17852 }
17853
17854 /// Returns the specified target pool.
17855 pub fn get(&self) -> super::builder::target_pools::Get {
17856 super::builder::target_pools::Get::new(self.inner.clone())
17857 }
17858
17859 /// Gets the most recent health check results for each IP for the
17860 /// instance that is referenced by the given target pool.
17861 pub fn get_health(&self) -> super::builder::target_pools::GetHealth {
17862 super::builder::target_pools::GetHealth::new(self.inner.clone())
17863 }
17864
17865 /// Creates a target pool in the specified project and region using
17866 /// the data included in the request.
17867 pub fn insert(&self) -> super::builder::target_pools::Insert {
17868 super::builder::target_pools::Insert::new(self.inner.clone())
17869 }
17870
17871 /// Retrieves a list of target pools available to the specified
17872 /// project and region.
17873 pub fn list(&self) -> super::builder::target_pools::List {
17874 super::builder::target_pools::List::new(self.inner.clone())
17875 }
17876
17877 /// Removes health check URL from a target pool.
17878 pub fn remove_health_check(&self) -> super::builder::target_pools::RemoveHealthCheck {
17879 super::builder::target_pools::RemoveHealthCheck::new(self.inner.clone())
17880 }
17881
17882 /// Removes instance URL from a target pool.
17883 pub fn remove_instance(&self) -> super::builder::target_pools::RemoveInstance {
17884 super::builder::target_pools::RemoveInstance::new(self.inner.clone())
17885 }
17886
17887 /// Changes a backup target pool's configurations.
17888 pub fn set_backup(&self) -> super::builder::target_pools::SetBackup {
17889 super::builder::target_pools::SetBackup::new(self.inner.clone())
17890 }
17891
17892 /// Sets the Google Cloud Armor security policy for the specified target pool.
17893 /// For more information, seeGoogle
17894 /// Cloud Armor Overview
17895 pub fn set_security_policy(&self) -> super::builder::target_pools::SetSecurityPolicy {
17896 super::builder::target_pools::SetSecurityPolicy::new(self.inner.clone())
17897 }
17898
17899 /// Returns permissions that a caller has on the specified resource.
17900 pub fn test_iam_permissions(&self) -> super::builder::target_pools::TestIamPermissions {
17901 super::builder::target_pools::TestIamPermissions::new(self.inner.clone())
17902 }
17903
17904 /// Retrieves the specified region-specific Operations resource.
17905 pub fn get_operation(&self) -> super::builder::target_pools::GetOperation {
17906 super::builder::target_pools::GetOperation::new(self.inner.clone())
17907 }
17908}
17909
17910/// Implements a client for the Google Compute Engine API.
17911///
17912/// # Example
17913/// ```
17914/// # use google_cloud_compute_v1::client::TargetSslProxies;
17915/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
17916/// let client = TargetSslProxies::builder().build().await?;
17917/// // use `client` to make requests to the Google Compute Engine API.
17918/// # Ok(()) }
17919/// ```
17920///
17921/// # Service Description
17922///
17923/// Service for the `targetSslProxies` resource.
17924///
17925/// # Configuration
17926///
17927/// To configure `TargetSslProxies` use the `with_*` methods in the type returned
17928/// by [builder()][TargetSslProxies::builder]. The default configuration should
17929/// work for most applications. Common configuration changes include
17930///
17931/// * [with_endpoint()]: by default this client uses the global default endpoint
17932/// (`https://compute.googleapis.com`). Applications using regional
17933/// endpoints or running in restricted networks (e.g. a network configured
17934// with [Private Google Access with VPC Service Controls]) may want to
17935/// override this default.
17936/// * [with_credentials()]: by default this client uses
17937/// [Application Default Credentials]. Applications using custom
17938/// authentication may need to override this default.
17939///
17940/// [with_endpoint()]: super::builder::target_ssl_proxies::ClientBuilder::with_endpoint
17941/// [with_credentials()]: super::builder::target_ssl_proxies::ClientBuilder::with_credentials
17942/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17943/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17944///
17945/// # Pooling and Cloning
17946///
17947/// `TargetSslProxies` holds a connection pool internally, it is advised to
17948/// create one and reuse it. You do not need to wrap `TargetSslProxies` in
17949/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17950/// already uses an `Arc` internally.
17951#[cfg(feature = "target-ssl-proxies")]
17952#[cfg_attr(docsrs, doc(cfg(feature = "target-ssl-proxies")))]
17953#[derive(Clone, Debug)]
17954pub struct TargetSslProxies {
17955 inner: std::sync::Arc<dyn super::stub::dynamic::TargetSslProxies>,
17956}
17957
17958#[cfg(feature = "target-ssl-proxies")]
17959impl TargetSslProxies {
17960 /// Returns a builder for [TargetSslProxies].
17961 ///
17962 /// ```
17963 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17964 /// # use google_cloud_compute_v1::client::TargetSslProxies;
17965 /// let client = TargetSslProxies::builder().build().await?;
17966 /// # Ok(()) }
17967 /// ```
17968 pub fn builder() -> super::builder::target_ssl_proxies::ClientBuilder {
17969 crate::new_client_builder(super::builder::target_ssl_proxies::client::Factory)
17970 }
17971
17972 /// Creates a new client from the provided stub.
17973 ///
17974 /// The most common case for calling this function is in tests mocking the
17975 /// client's behavior.
17976 pub fn from_stub<T>(stub: T) -> Self
17977 where
17978 T: super::stub::TargetSslProxies + 'static,
17979 {
17980 Self {
17981 inner: std::sync::Arc::new(stub),
17982 }
17983 }
17984
17985 pub(crate) async fn new(
17986 config: gaxi::options::ClientConfig,
17987 ) -> crate::ClientBuilderResult<Self> {
17988 let inner = Self::build_inner(config).await?;
17989 Ok(Self { inner })
17990 }
17991
17992 async fn build_inner(
17993 conf: gaxi::options::ClientConfig,
17994 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetSslProxies>>
17995 {
17996 if gaxi::options::tracing_enabled(&conf) {
17997 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17998 }
17999 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18000 }
18001
18002 async fn build_transport(
18003 conf: gaxi::options::ClientConfig,
18004 ) -> crate::ClientBuilderResult<impl super::stub::TargetSslProxies> {
18005 super::transport::TargetSslProxies::new(conf).await
18006 }
18007
18008 async fn build_with_tracing(
18009 conf: gaxi::options::ClientConfig,
18010 ) -> crate::ClientBuilderResult<impl super::stub::TargetSslProxies> {
18011 Self::build_transport(conf)
18012 .await
18013 .map(super::tracing::TargetSslProxies::new)
18014 }
18015
18016 /// Deletes the specified TargetSslProxy resource.
18017 pub fn delete(&self) -> super::builder::target_ssl_proxies::Delete {
18018 super::builder::target_ssl_proxies::Delete::new(self.inner.clone())
18019 }
18020
18021 /// Returns the specified TargetSslProxy resource.
18022 pub fn get(&self) -> super::builder::target_ssl_proxies::Get {
18023 super::builder::target_ssl_proxies::Get::new(self.inner.clone())
18024 }
18025
18026 /// Creates a TargetSslProxy resource in the specified project using
18027 /// the data included in the request.
18028 pub fn insert(&self) -> super::builder::target_ssl_proxies::Insert {
18029 super::builder::target_ssl_proxies::Insert::new(self.inner.clone())
18030 }
18031
18032 /// Retrieves the list of TargetSslProxy resources
18033 /// available to the specified project.
18034 pub fn list(&self) -> super::builder::target_ssl_proxies::List {
18035 super::builder::target_ssl_proxies::List::new(self.inner.clone())
18036 }
18037
18038 /// Changes the BackendService for TargetSslProxy.
18039 pub fn set_backend_service(&self) -> super::builder::target_ssl_proxies::SetBackendService {
18040 super::builder::target_ssl_proxies::SetBackendService::new(self.inner.clone())
18041 }
18042
18043 /// Changes the Certificate Map for TargetSslProxy.
18044 pub fn set_certificate_map(&self) -> super::builder::target_ssl_proxies::SetCertificateMap {
18045 super::builder::target_ssl_proxies::SetCertificateMap::new(self.inner.clone())
18046 }
18047
18048 /// Changes the ProxyHeaderType for TargetSslProxy.
18049 pub fn set_proxy_header(&self) -> super::builder::target_ssl_proxies::SetProxyHeader {
18050 super::builder::target_ssl_proxies::SetProxyHeader::new(self.inner.clone())
18051 }
18052
18053 /// Changes SslCertificates for TargetSslProxy.
18054 pub fn set_ssl_certificates(&self) -> super::builder::target_ssl_proxies::SetSslCertificates {
18055 super::builder::target_ssl_proxies::SetSslCertificates::new(self.inner.clone())
18056 }
18057
18058 /// Sets the SSL policy for TargetSslProxy. The SSL policy specifies the
18059 /// server-side support for SSL features. This affects connections between
18060 /// clients and the load balancer. They do not affect the
18061 /// connection between the load balancer and the backends.
18062 pub fn set_ssl_policy(&self) -> super::builder::target_ssl_proxies::SetSslPolicy {
18063 super::builder::target_ssl_proxies::SetSslPolicy::new(self.inner.clone())
18064 }
18065
18066 /// Returns permissions that a caller has on the specified resource.
18067 pub fn test_iam_permissions(&self) -> super::builder::target_ssl_proxies::TestIamPermissions {
18068 super::builder::target_ssl_proxies::TestIamPermissions::new(self.inner.clone())
18069 }
18070
18071 /// Retrieves the specified Operations resource.
18072 pub fn get_operation(&self) -> super::builder::target_ssl_proxies::GetOperation {
18073 super::builder::target_ssl_proxies::GetOperation::new(self.inner.clone())
18074 }
18075}
18076
18077/// Implements a client for the Google Compute Engine API.
18078///
18079/// # Example
18080/// ```
18081/// # use google_cloud_compute_v1::client::TargetTcpProxies;
18082/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
18083/// let client = TargetTcpProxies::builder().build().await?;
18084/// // use `client` to make requests to the Google Compute Engine API.
18085/// # Ok(()) }
18086/// ```
18087///
18088/// # Service Description
18089///
18090/// Service for the `targetTcpProxies` resource.
18091///
18092/// # Configuration
18093///
18094/// To configure `TargetTcpProxies` use the `with_*` methods in the type returned
18095/// by [builder()][TargetTcpProxies::builder]. The default configuration should
18096/// work for most applications. Common configuration changes include
18097///
18098/// * [with_endpoint()]: by default this client uses the global default endpoint
18099/// (`https://compute.googleapis.com`). Applications using regional
18100/// endpoints or running in restricted networks (e.g. a network configured
18101// with [Private Google Access with VPC Service Controls]) may want to
18102/// override this default.
18103/// * [with_credentials()]: by default this client uses
18104/// [Application Default Credentials]. Applications using custom
18105/// authentication may need to override this default.
18106///
18107/// [with_endpoint()]: super::builder::target_tcp_proxies::ClientBuilder::with_endpoint
18108/// [with_credentials()]: super::builder::target_tcp_proxies::ClientBuilder::with_credentials
18109/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18110/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18111///
18112/// # Pooling and Cloning
18113///
18114/// `TargetTcpProxies` holds a connection pool internally, it is advised to
18115/// create one and reuse it. You do not need to wrap `TargetTcpProxies` in
18116/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18117/// already uses an `Arc` internally.
18118#[cfg(feature = "target-tcp-proxies")]
18119#[cfg_attr(docsrs, doc(cfg(feature = "target-tcp-proxies")))]
18120#[derive(Clone, Debug)]
18121pub struct TargetTcpProxies {
18122 inner: std::sync::Arc<dyn super::stub::dynamic::TargetTcpProxies>,
18123}
18124
18125#[cfg(feature = "target-tcp-proxies")]
18126impl TargetTcpProxies {
18127 /// Returns a builder for [TargetTcpProxies].
18128 ///
18129 /// ```
18130 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18131 /// # use google_cloud_compute_v1::client::TargetTcpProxies;
18132 /// let client = TargetTcpProxies::builder().build().await?;
18133 /// # Ok(()) }
18134 /// ```
18135 pub fn builder() -> super::builder::target_tcp_proxies::ClientBuilder {
18136 crate::new_client_builder(super::builder::target_tcp_proxies::client::Factory)
18137 }
18138
18139 /// Creates a new client from the provided stub.
18140 ///
18141 /// The most common case for calling this function is in tests mocking the
18142 /// client's behavior.
18143 pub fn from_stub<T>(stub: T) -> Self
18144 where
18145 T: super::stub::TargetTcpProxies + 'static,
18146 {
18147 Self {
18148 inner: std::sync::Arc::new(stub),
18149 }
18150 }
18151
18152 pub(crate) async fn new(
18153 config: gaxi::options::ClientConfig,
18154 ) -> crate::ClientBuilderResult<Self> {
18155 let inner = Self::build_inner(config).await?;
18156 Ok(Self { inner })
18157 }
18158
18159 async fn build_inner(
18160 conf: gaxi::options::ClientConfig,
18161 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetTcpProxies>>
18162 {
18163 if gaxi::options::tracing_enabled(&conf) {
18164 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18165 }
18166 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18167 }
18168
18169 async fn build_transport(
18170 conf: gaxi::options::ClientConfig,
18171 ) -> crate::ClientBuilderResult<impl super::stub::TargetTcpProxies> {
18172 super::transport::TargetTcpProxies::new(conf).await
18173 }
18174
18175 async fn build_with_tracing(
18176 conf: gaxi::options::ClientConfig,
18177 ) -> crate::ClientBuilderResult<impl super::stub::TargetTcpProxies> {
18178 Self::build_transport(conf)
18179 .await
18180 .map(super::tracing::TargetTcpProxies::new)
18181 }
18182
18183 /// Retrieves the list of all TargetTcpProxy resources, regional and global,
18184 /// available to the specified project.
18185 ///
18186 /// To prevent failure, Google recommends that you set the
18187 /// `returnPartialSuccess` parameter to `true`.
18188 pub fn aggregated_list(&self) -> super::builder::target_tcp_proxies::AggregatedList {
18189 super::builder::target_tcp_proxies::AggregatedList::new(self.inner.clone())
18190 }
18191
18192 /// Deletes the specified TargetTcpProxy resource.
18193 pub fn delete(&self) -> super::builder::target_tcp_proxies::Delete {
18194 super::builder::target_tcp_proxies::Delete::new(self.inner.clone())
18195 }
18196
18197 /// Returns the specified TargetTcpProxy resource.
18198 pub fn get(&self) -> super::builder::target_tcp_proxies::Get {
18199 super::builder::target_tcp_proxies::Get::new(self.inner.clone())
18200 }
18201
18202 /// Creates a TargetTcpProxy resource in the specified project using
18203 /// the data included in the request.
18204 pub fn insert(&self) -> super::builder::target_tcp_proxies::Insert {
18205 super::builder::target_tcp_proxies::Insert::new(self.inner.clone())
18206 }
18207
18208 /// Retrieves the list of TargetTcpProxy resources
18209 /// available to the specified project.
18210 pub fn list(&self) -> super::builder::target_tcp_proxies::List {
18211 super::builder::target_tcp_proxies::List::new(self.inner.clone())
18212 }
18213
18214 /// Changes the BackendService for TargetTcpProxy.
18215 pub fn set_backend_service(&self) -> super::builder::target_tcp_proxies::SetBackendService {
18216 super::builder::target_tcp_proxies::SetBackendService::new(self.inner.clone())
18217 }
18218
18219 /// Changes the ProxyHeaderType for TargetTcpProxy.
18220 pub fn set_proxy_header(&self) -> super::builder::target_tcp_proxies::SetProxyHeader {
18221 super::builder::target_tcp_proxies::SetProxyHeader::new(self.inner.clone())
18222 }
18223
18224 /// Returns permissions that a caller has on the specified resource.
18225 pub fn test_iam_permissions(&self) -> super::builder::target_tcp_proxies::TestIamPermissions {
18226 super::builder::target_tcp_proxies::TestIamPermissions::new(self.inner.clone())
18227 }
18228
18229 /// Retrieves the specified Operations resource.
18230 pub fn get_operation(&self) -> super::builder::target_tcp_proxies::GetOperation {
18231 super::builder::target_tcp_proxies::GetOperation::new(self.inner.clone())
18232 }
18233}
18234
18235/// Implements a client for the Google Compute Engine API.
18236///
18237/// # Example
18238/// ```
18239/// # use google_cloud_compute_v1::client::TargetVpnGateways;
18240/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
18241/// let client = TargetVpnGateways::builder().build().await?;
18242/// // use `client` to make requests to the Google Compute Engine API.
18243/// # Ok(()) }
18244/// ```
18245///
18246/// # Service Description
18247///
18248/// Service for the `targetVpnGateways` resource.
18249///
18250/// # Configuration
18251///
18252/// To configure `TargetVpnGateways` use the `with_*` methods in the type returned
18253/// by [builder()][TargetVpnGateways::builder]. The default configuration should
18254/// work for most applications. Common configuration changes include
18255///
18256/// * [with_endpoint()]: by default this client uses the global default endpoint
18257/// (`https://compute.googleapis.com`). Applications using regional
18258/// endpoints or running in restricted networks (e.g. a network configured
18259// with [Private Google Access with VPC Service Controls]) may want to
18260/// override this default.
18261/// * [with_credentials()]: by default this client uses
18262/// [Application Default Credentials]. Applications using custom
18263/// authentication may need to override this default.
18264///
18265/// [with_endpoint()]: super::builder::target_vpn_gateways::ClientBuilder::with_endpoint
18266/// [with_credentials()]: super::builder::target_vpn_gateways::ClientBuilder::with_credentials
18267/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18268/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18269///
18270/// # Pooling and Cloning
18271///
18272/// `TargetVpnGateways` holds a connection pool internally, it is advised to
18273/// create one and reuse it. You do not need to wrap `TargetVpnGateways` in
18274/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18275/// already uses an `Arc` internally.
18276#[cfg(feature = "target-vpn-gateways")]
18277#[cfg_attr(docsrs, doc(cfg(feature = "target-vpn-gateways")))]
18278#[derive(Clone, Debug)]
18279pub struct TargetVpnGateways {
18280 inner: std::sync::Arc<dyn super::stub::dynamic::TargetVpnGateways>,
18281}
18282
18283#[cfg(feature = "target-vpn-gateways")]
18284impl TargetVpnGateways {
18285 /// Returns a builder for [TargetVpnGateways].
18286 ///
18287 /// ```
18288 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18289 /// # use google_cloud_compute_v1::client::TargetVpnGateways;
18290 /// let client = TargetVpnGateways::builder().build().await?;
18291 /// # Ok(()) }
18292 /// ```
18293 pub fn builder() -> super::builder::target_vpn_gateways::ClientBuilder {
18294 crate::new_client_builder(super::builder::target_vpn_gateways::client::Factory)
18295 }
18296
18297 /// Creates a new client from the provided stub.
18298 ///
18299 /// The most common case for calling this function is in tests mocking the
18300 /// client's behavior.
18301 pub fn from_stub<T>(stub: T) -> Self
18302 where
18303 T: super::stub::TargetVpnGateways + 'static,
18304 {
18305 Self {
18306 inner: std::sync::Arc::new(stub),
18307 }
18308 }
18309
18310 pub(crate) async fn new(
18311 config: gaxi::options::ClientConfig,
18312 ) -> crate::ClientBuilderResult<Self> {
18313 let inner = Self::build_inner(config).await?;
18314 Ok(Self { inner })
18315 }
18316
18317 async fn build_inner(
18318 conf: gaxi::options::ClientConfig,
18319 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetVpnGateways>>
18320 {
18321 if gaxi::options::tracing_enabled(&conf) {
18322 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18323 }
18324 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18325 }
18326
18327 async fn build_transport(
18328 conf: gaxi::options::ClientConfig,
18329 ) -> crate::ClientBuilderResult<impl super::stub::TargetVpnGateways> {
18330 super::transport::TargetVpnGateways::new(conf).await
18331 }
18332
18333 async fn build_with_tracing(
18334 conf: gaxi::options::ClientConfig,
18335 ) -> crate::ClientBuilderResult<impl super::stub::TargetVpnGateways> {
18336 Self::build_transport(conf)
18337 .await
18338 .map(super::tracing::TargetVpnGateways::new)
18339 }
18340
18341 /// Retrieves an aggregated list of target VPN gateways.
18342 ///
18343 /// To prevent failure, Google recommends that you set the
18344 /// `returnPartialSuccess` parameter to `true`.
18345 pub fn aggregated_list(&self) -> super::builder::target_vpn_gateways::AggregatedList {
18346 super::builder::target_vpn_gateways::AggregatedList::new(self.inner.clone())
18347 }
18348
18349 /// Deletes the specified target VPN gateway.
18350 pub fn delete(&self) -> super::builder::target_vpn_gateways::Delete {
18351 super::builder::target_vpn_gateways::Delete::new(self.inner.clone())
18352 }
18353
18354 /// Returns the specified target VPN gateway.
18355 pub fn get(&self) -> super::builder::target_vpn_gateways::Get {
18356 super::builder::target_vpn_gateways::Get::new(self.inner.clone())
18357 }
18358
18359 /// Creates a target VPN gateway in the specified project and region using
18360 /// the data included in the request.
18361 pub fn insert(&self) -> super::builder::target_vpn_gateways::Insert {
18362 super::builder::target_vpn_gateways::Insert::new(self.inner.clone())
18363 }
18364
18365 /// Retrieves a list of target VPN gateways available to the specified
18366 /// project and region.
18367 pub fn list(&self) -> super::builder::target_vpn_gateways::List {
18368 super::builder::target_vpn_gateways::List::new(self.inner.clone())
18369 }
18370
18371 /// Sets the labels on a TargetVpnGateway. To learn more about labels, read theLabeling
18372 /// Resources documentation.
18373 pub fn set_labels(&self) -> super::builder::target_vpn_gateways::SetLabels {
18374 super::builder::target_vpn_gateways::SetLabels::new(self.inner.clone())
18375 }
18376
18377 /// Retrieves the specified region-specific Operations resource.
18378 pub fn get_operation(&self) -> super::builder::target_vpn_gateways::GetOperation {
18379 super::builder::target_vpn_gateways::GetOperation::new(self.inner.clone())
18380 }
18381}
18382
18383/// Implements a client for the Google Compute Engine API.
18384///
18385/// # Example
18386/// ```
18387/// # use google_cloud_compute_v1::client::UrlMaps;
18388/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
18389/// let client = UrlMaps::builder().build().await?;
18390/// // use `client` to make requests to the Google Compute Engine API.
18391/// # Ok(()) }
18392/// ```
18393///
18394/// # Service Description
18395///
18396/// Service for the `urlMaps` resource.
18397///
18398/// # Configuration
18399///
18400/// To configure `UrlMaps` use the `with_*` methods in the type returned
18401/// by [builder()][UrlMaps::builder]. The default configuration should
18402/// work for most applications. Common configuration changes include
18403///
18404/// * [with_endpoint()]: by default this client uses the global default endpoint
18405/// (`https://compute.googleapis.com`). Applications using regional
18406/// endpoints or running in restricted networks (e.g. a network configured
18407// with [Private Google Access with VPC Service Controls]) may want to
18408/// override this default.
18409/// * [with_credentials()]: by default this client uses
18410/// [Application Default Credentials]. Applications using custom
18411/// authentication may need to override this default.
18412///
18413/// [with_endpoint()]: super::builder::url_maps::ClientBuilder::with_endpoint
18414/// [with_credentials()]: super::builder::url_maps::ClientBuilder::with_credentials
18415/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18416/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18417///
18418/// # Pooling and Cloning
18419///
18420/// `UrlMaps` holds a connection pool internally, it is advised to
18421/// create one and reuse it. You do not need to wrap `UrlMaps` in
18422/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18423/// already uses an `Arc` internally.
18424#[cfg(feature = "url-maps")]
18425#[cfg_attr(docsrs, doc(cfg(feature = "url-maps")))]
18426#[derive(Clone, Debug)]
18427pub struct UrlMaps {
18428 inner: std::sync::Arc<dyn super::stub::dynamic::UrlMaps>,
18429}
18430
18431#[cfg(feature = "url-maps")]
18432impl UrlMaps {
18433 /// Returns a builder for [UrlMaps].
18434 ///
18435 /// ```
18436 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18437 /// # use google_cloud_compute_v1::client::UrlMaps;
18438 /// let client = UrlMaps::builder().build().await?;
18439 /// # Ok(()) }
18440 /// ```
18441 pub fn builder() -> super::builder::url_maps::ClientBuilder {
18442 crate::new_client_builder(super::builder::url_maps::client::Factory)
18443 }
18444
18445 /// Creates a new client from the provided stub.
18446 ///
18447 /// The most common case for calling this function is in tests mocking the
18448 /// client's behavior.
18449 pub fn from_stub<T>(stub: T) -> Self
18450 where
18451 T: super::stub::UrlMaps + 'static,
18452 {
18453 Self {
18454 inner: std::sync::Arc::new(stub),
18455 }
18456 }
18457
18458 pub(crate) async fn new(
18459 config: gaxi::options::ClientConfig,
18460 ) -> crate::ClientBuilderResult<Self> {
18461 let inner = Self::build_inner(config).await?;
18462 Ok(Self { inner })
18463 }
18464
18465 async fn build_inner(
18466 conf: gaxi::options::ClientConfig,
18467 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::UrlMaps>> {
18468 if gaxi::options::tracing_enabled(&conf) {
18469 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18470 }
18471 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18472 }
18473
18474 async fn build_transport(
18475 conf: gaxi::options::ClientConfig,
18476 ) -> crate::ClientBuilderResult<impl super::stub::UrlMaps> {
18477 super::transport::UrlMaps::new(conf).await
18478 }
18479
18480 async fn build_with_tracing(
18481 conf: gaxi::options::ClientConfig,
18482 ) -> crate::ClientBuilderResult<impl super::stub::UrlMaps> {
18483 Self::build_transport(conf)
18484 .await
18485 .map(super::tracing::UrlMaps::new)
18486 }
18487
18488 /// Retrieves the list of all UrlMap resources, regional and global,
18489 /// available to the specified project.
18490 ///
18491 /// To prevent failure, Google recommends that you set the
18492 /// `returnPartialSuccess` parameter to `true`.
18493 pub fn aggregated_list(&self) -> super::builder::url_maps::AggregatedList {
18494 super::builder::url_maps::AggregatedList::new(self.inner.clone())
18495 }
18496
18497 /// Deletes the specified UrlMap resource.
18498 pub fn delete(&self) -> super::builder::url_maps::Delete {
18499 super::builder::url_maps::Delete::new(self.inner.clone())
18500 }
18501
18502 /// Returns the specified UrlMap resource.
18503 pub fn get(&self) -> super::builder::url_maps::Get {
18504 super::builder::url_maps::Get::new(self.inner.clone())
18505 }
18506
18507 /// Creates a UrlMap resource in the specified project using
18508 /// the data included in the request.
18509 pub fn insert(&self) -> super::builder::url_maps::Insert {
18510 super::builder::url_maps::Insert::new(self.inner.clone())
18511 }
18512
18513 /// Initiates a cache invalidation operation, invalidating the specified path,
18514 /// scoped to the specified UrlMap.
18515 ///
18516 /// For more information, see [Invalidating cached
18517 /// content](/cdn/docs/invalidating-cached-content).
18518 pub fn invalidate_cache(&self) -> super::builder::url_maps::InvalidateCache {
18519 super::builder::url_maps::InvalidateCache::new(self.inner.clone())
18520 }
18521
18522 /// Retrieves the list of UrlMap resources available to the specified
18523 /// project.
18524 pub fn list(&self) -> super::builder::url_maps::List {
18525 super::builder::url_maps::List::new(self.inner.clone())
18526 }
18527
18528 /// Patches the specified UrlMap resource with the data included in the
18529 /// request. This method supportsPATCH
18530 /// semantics and uses theJSON merge
18531 /// patch format and processing rules.
18532 pub fn patch(&self) -> super::builder::url_maps::Patch {
18533 super::builder::url_maps::Patch::new(self.inner.clone())
18534 }
18535
18536 /// Returns permissions that a caller has on the specified resource.
18537 pub fn test_iam_permissions(&self) -> super::builder::url_maps::TestIamPermissions {
18538 super::builder::url_maps::TestIamPermissions::new(self.inner.clone())
18539 }
18540
18541 /// Updates the specified UrlMap resource with the data included in the
18542 /// request.
18543 pub fn update(&self) -> super::builder::url_maps::Update {
18544 super::builder::url_maps::Update::new(self.inner.clone())
18545 }
18546
18547 /// Runs static validation for the UrlMap. In particular, the tests of the
18548 /// provided UrlMap will be run. Calling this method does NOT create the
18549 /// UrlMap.
18550 pub fn validate(&self) -> super::builder::url_maps::Validate {
18551 super::builder::url_maps::Validate::new(self.inner.clone())
18552 }
18553
18554 /// Retrieves the specified Operations resource.
18555 pub fn get_operation(&self) -> super::builder::url_maps::GetOperation {
18556 super::builder::url_maps::GetOperation::new(self.inner.clone())
18557 }
18558}
18559
18560/// Implements a client for the Google Compute Engine API.
18561///
18562/// # Example
18563/// ```
18564/// # use google_cloud_compute_v1::client::VpnGateways;
18565/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
18566/// let client = VpnGateways::builder().build().await?;
18567/// // use `client` to make requests to the Google Compute Engine API.
18568/// # Ok(()) }
18569/// ```
18570///
18571/// # Service Description
18572///
18573/// Service for the `vpnGateways` resource.
18574///
18575/// # Configuration
18576///
18577/// To configure `VpnGateways` use the `with_*` methods in the type returned
18578/// by [builder()][VpnGateways::builder]. The default configuration should
18579/// work for most applications. Common configuration changes include
18580///
18581/// * [with_endpoint()]: by default this client uses the global default endpoint
18582/// (`https://compute.googleapis.com`). Applications using regional
18583/// endpoints or running in restricted networks (e.g. a network configured
18584// with [Private Google Access with VPC Service Controls]) may want to
18585/// override this default.
18586/// * [with_credentials()]: by default this client uses
18587/// [Application Default Credentials]. Applications using custom
18588/// authentication may need to override this default.
18589///
18590/// [with_endpoint()]: super::builder::vpn_gateways::ClientBuilder::with_endpoint
18591/// [with_credentials()]: super::builder::vpn_gateways::ClientBuilder::with_credentials
18592/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18593/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18594///
18595/// # Pooling and Cloning
18596///
18597/// `VpnGateways` holds a connection pool internally, it is advised to
18598/// create one and reuse it. You do not need to wrap `VpnGateways` in
18599/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18600/// already uses an `Arc` internally.
18601#[cfg(feature = "vpn-gateways")]
18602#[cfg_attr(docsrs, doc(cfg(feature = "vpn-gateways")))]
18603#[derive(Clone, Debug)]
18604pub struct VpnGateways {
18605 inner: std::sync::Arc<dyn super::stub::dynamic::VpnGateways>,
18606}
18607
18608#[cfg(feature = "vpn-gateways")]
18609impl VpnGateways {
18610 /// Returns a builder for [VpnGateways].
18611 ///
18612 /// ```
18613 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18614 /// # use google_cloud_compute_v1::client::VpnGateways;
18615 /// let client = VpnGateways::builder().build().await?;
18616 /// # Ok(()) }
18617 /// ```
18618 pub fn builder() -> super::builder::vpn_gateways::ClientBuilder {
18619 crate::new_client_builder(super::builder::vpn_gateways::client::Factory)
18620 }
18621
18622 /// Creates a new client from the provided stub.
18623 ///
18624 /// The most common case for calling this function is in tests mocking the
18625 /// client's behavior.
18626 pub fn from_stub<T>(stub: T) -> Self
18627 where
18628 T: super::stub::VpnGateways + 'static,
18629 {
18630 Self {
18631 inner: std::sync::Arc::new(stub),
18632 }
18633 }
18634
18635 pub(crate) async fn new(
18636 config: gaxi::options::ClientConfig,
18637 ) -> crate::ClientBuilderResult<Self> {
18638 let inner = Self::build_inner(config).await?;
18639 Ok(Self { inner })
18640 }
18641
18642 async fn build_inner(
18643 conf: gaxi::options::ClientConfig,
18644 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::VpnGateways>> {
18645 if gaxi::options::tracing_enabled(&conf) {
18646 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18647 }
18648 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18649 }
18650
18651 async fn build_transport(
18652 conf: gaxi::options::ClientConfig,
18653 ) -> crate::ClientBuilderResult<impl super::stub::VpnGateways> {
18654 super::transport::VpnGateways::new(conf).await
18655 }
18656
18657 async fn build_with_tracing(
18658 conf: gaxi::options::ClientConfig,
18659 ) -> crate::ClientBuilderResult<impl super::stub::VpnGateways> {
18660 Self::build_transport(conf)
18661 .await
18662 .map(super::tracing::VpnGateways::new)
18663 }
18664
18665 /// Retrieves an aggregated list of VPN gateways.
18666 ///
18667 /// To prevent failure, Google recommends that you set the
18668 /// `returnPartialSuccess` parameter to `true`.
18669 pub fn aggregated_list(&self) -> super::builder::vpn_gateways::AggregatedList {
18670 super::builder::vpn_gateways::AggregatedList::new(self.inner.clone())
18671 }
18672
18673 /// Deletes the specified VPN gateway.
18674 pub fn delete(&self) -> super::builder::vpn_gateways::Delete {
18675 super::builder::vpn_gateways::Delete::new(self.inner.clone())
18676 }
18677
18678 /// Returns the specified VPN gateway.
18679 pub fn get(&self) -> super::builder::vpn_gateways::Get {
18680 super::builder::vpn_gateways::Get::new(self.inner.clone())
18681 }
18682
18683 /// Returns the status for the specified VPN gateway.
18684 pub fn get_status(&self) -> super::builder::vpn_gateways::GetStatus {
18685 super::builder::vpn_gateways::GetStatus::new(self.inner.clone())
18686 }
18687
18688 /// Creates a VPN gateway in the specified project and region using
18689 /// the data included in the request.
18690 pub fn insert(&self) -> super::builder::vpn_gateways::Insert {
18691 super::builder::vpn_gateways::Insert::new(self.inner.clone())
18692 }
18693
18694 /// Retrieves a list of VPN gateways available to the specified
18695 /// project and region.
18696 pub fn list(&self) -> super::builder::vpn_gateways::List {
18697 super::builder::vpn_gateways::List::new(self.inner.clone())
18698 }
18699
18700 /// Sets the labels on a VpnGateway. To learn more about labels, read theLabeling
18701 /// Resources documentation.
18702 pub fn set_labels(&self) -> super::builder::vpn_gateways::SetLabels {
18703 super::builder::vpn_gateways::SetLabels::new(self.inner.clone())
18704 }
18705
18706 /// Returns permissions that a caller has on the specified resource.
18707 pub fn test_iam_permissions(&self) -> super::builder::vpn_gateways::TestIamPermissions {
18708 super::builder::vpn_gateways::TestIamPermissions::new(self.inner.clone())
18709 }
18710
18711 /// Retrieves the specified region-specific Operations resource.
18712 pub fn get_operation(&self) -> super::builder::vpn_gateways::GetOperation {
18713 super::builder::vpn_gateways::GetOperation::new(self.inner.clone())
18714 }
18715}
18716
18717/// Implements a client for the Google Compute Engine API.
18718///
18719/// # Example
18720/// ```
18721/// # use google_cloud_compute_v1::client::VpnTunnels;
18722/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
18723/// let client = VpnTunnels::builder().build().await?;
18724/// // use `client` to make requests to the Google Compute Engine API.
18725/// # Ok(()) }
18726/// ```
18727///
18728/// # Service Description
18729///
18730/// Service for the `vpnTunnels` resource.
18731///
18732/// # Configuration
18733///
18734/// To configure `VpnTunnels` use the `with_*` methods in the type returned
18735/// by [builder()][VpnTunnels::builder]. The default configuration should
18736/// work for most applications. Common configuration changes include
18737///
18738/// * [with_endpoint()]: by default this client uses the global default endpoint
18739/// (`https://compute.googleapis.com`). Applications using regional
18740/// endpoints or running in restricted networks (e.g. a network configured
18741// with [Private Google Access with VPC Service Controls]) may want to
18742/// override this default.
18743/// * [with_credentials()]: by default this client uses
18744/// [Application Default Credentials]. Applications using custom
18745/// authentication may need to override this default.
18746///
18747/// [with_endpoint()]: super::builder::vpn_tunnels::ClientBuilder::with_endpoint
18748/// [with_credentials()]: super::builder::vpn_tunnels::ClientBuilder::with_credentials
18749/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18750/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18751///
18752/// # Pooling and Cloning
18753///
18754/// `VpnTunnels` holds a connection pool internally, it is advised to
18755/// create one and reuse it. You do not need to wrap `VpnTunnels` in
18756/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18757/// already uses an `Arc` internally.
18758#[cfg(feature = "vpn-tunnels")]
18759#[cfg_attr(docsrs, doc(cfg(feature = "vpn-tunnels")))]
18760#[derive(Clone, Debug)]
18761pub struct VpnTunnels {
18762 inner: std::sync::Arc<dyn super::stub::dynamic::VpnTunnels>,
18763}
18764
18765#[cfg(feature = "vpn-tunnels")]
18766impl VpnTunnels {
18767 /// Returns a builder for [VpnTunnels].
18768 ///
18769 /// ```
18770 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18771 /// # use google_cloud_compute_v1::client::VpnTunnels;
18772 /// let client = VpnTunnels::builder().build().await?;
18773 /// # Ok(()) }
18774 /// ```
18775 pub fn builder() -> super::builder::vpn_tunnels::ClientBuilder {
18776 crate::new_client_builder(super::builder::vpn_tunnels::client::Factory)
18777 }
18778
18779 /// Creates a new client from the provided stub.
18780 ///
18781 /// The most common case for calling this function is in tests mocking the
18782 /// client's behavior.
18783 pub fn from_stub<T>(stub: T) -> Self
18784 where
18785 T: super::stub::VpnTunnels + 'static,
18786 {
18787 Self {
18788 inner: std::sync::Arc::new(stub),
18789 }
18790 }
18791
18792 pub(crate) async fn new(
18793 config: gaxi::options::ClientConfig,
18794 ) -> crate::ClientBuilderResult<Self> {
18795 let inner = Self::build_inner(config).await?;
18796 Ok(Self { inner })
18797 }
18798
18799 async fn build_inner(
18800 conf: gaxi::options::ClientConfig,
18801 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::VpnTunnels>> {
18802 if gaxi::options::tracing_enabled(&conf) {
18803 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18804 }
18805 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18806 }
18807
18808 async fn build_transport(
18809 conf: gaxi::options::ClientConfig,
18810 ) -> crate::ClientBuilderResult<impl super::stub::VpnTunnels> {
18811 super::transport::VpnTunnels::new(conf).await
18812 }
18813
18814 async fn build_with_tracing(
18815 conf: gaxi::options::ClientConfig,
18816 ) -> crate::ClientBuilderResult<impl super::stub::VpnTunnels> {
18817 Self::build_transport(conf)
18818 .await
18819 .map(super::tracing::VpnTunnels::new)
18820 }
18821
18822 /// Retrieves an aggregated list of VPN tunnels.
18823 ///
18824 /// To prevent failure, Google recommends that you set the
18825 /// `returnPartialSuccess` parameter to `true`.
18826 pub fn aggregated_list(&self) -> super::builder::vpn_tunnels::AggregatedList {
18827 super::builder::vpn_tunnels::AggregatedList::new(self.inner.clone())
18828 }
18829
18830 /// Deletes the specified VpnTunnel resource.
18831 pub fn delete(&self) -> super::builder::vpn_tunnels::Delete {
18832 super::builder::vpn_tunnels::Delete::new(self.inner.clone())
18833 }
18834
18835 /// Returns the specified VpnTunnel resource.
18836 pub fn get(&self) -> super::builder::vpn_tunnels::Get {
18837 super::builder::vpn_tunnels::Get::new(self.inner.clone())
18838 }
18839
18840 /// Creates a VpnTunnel resource in the specified project and region using
18841 /// the data included in the request.
18842 pub fn insert(&self) -> super::builder::vpn_tunnels::Insert {
18843 super::builder::vpn_tunnels::Insert::new(self.inner.clone())
18844 }
18845
18846 /// Retrieves a list of VpnTunnel resources contained in the specified
18847 /// project and region.
18848 pub fn list(&self) -> super::builder::vpn_tunnels::List {
18849 super::builder::vpn_tunnels::List::new(self.inner.clone())
18850 }
18851
18852 /// Sets the labels on a VpnTunnel. To learn more about labels, read theLabeling
18853 /// Resources documentation.
18854 pub fn set_labels(&self) -> super::builder::vpn_tunnels::SetLabels {
18855 super::builder::vpn_tunnels::SetLabels::new(self.inner.clone())
18856 }
18857
18858 /// Retrieves the specified region-specific Operations resource.
18859 pub fn get_operation(&self) -> super::builder::vpn_tunnels::GetOperation {
18860 super::builder::vpn_tunnels::GetOperation::new(self.inner.clone())
18861 }
18862}
18863
18864/// Implements a client for the Google Compute Engine API.
18865///
18866/// # Example
18867/// ```
18868/// # use google_cloud_compute_v1::client::WireGroups;
18869/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
18870/// let client = WireGroups::builder().build().await?;
18871/// // use `client` to make requests to the Google Compute Engine API.
18872/// # Ok(()) }
18873/// ```
18874///
18875/// # Service Description
18876///
18877/// Service for the `wireGroups` resource.
18878///
18879/// # Configuration
18880///
18881/// To configure `WireGroups` use the `with_*` methods in the type returned
18882/// by [builder()][WireGroups::builder]. The default configuration should
18883/// work for most applications. Common configuration changes include
18884///
18885/// * [with_endpoint()]: by default this client uses the global default endpoint
18886/// (`https://compute.googleapis.com`). Applications using regional
18887/// endpoints or running in restricted networks (e.g. a network configured
18888// with [Private Google Access with VPC Service Controls]) may want to
18889/// override this default.
18890/// * [with_credentials()]: by default this client uses
18891/// [Application Default Credentials]. Applications using custom
18892/// authentication may need to override this default.
18893///
18894/// [with_endpoint()]: super::builder::wire_groups::ClientBuilder::with_endpoint
18895/// [with_credentials()]: super::builder::wire_groups::ClientBuilder::with_credentials
18896/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18897/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18898///
18899/// # Pooling and Cloning
18900///
18901/// `WireGroups` holds a connection pool internally, it is advised to
18902/// create one and reuse it. You do not need to wrap `WireGroups` in
18903/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18904/// already uses an `Arc` internally.
18905#[cfg(feature = "wire-groups")]
18906#[cfg_attr(docsrs, doc(cfg(feature = "wire-groups")))]
18907#[derive(Clone, Debug)]
18908pub struct WireGroups {
18909 inner: std::sync::Arc<dyn super::stub::dynamic::WireGroups>,
18910}
18911
18912#[cfg(feature = "wire-groups")]
18913impl WireGroups {
18914 /// Returns a builder for [WireGroups].
18915 ///
18916 /// ```
18917 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18918 /// # use google_cloud_compute_v1::client::WireGroups;
18919 /// let client = WireGroups::builder().build().await?;
18920 /// # Ok(()) }
18921 /// ```
18922 pub fn builder() -> super::builder::wire_groups::ClientBuilder {
18923 crate::new_client_builder(super::builder::wire_groups::client::Factory)
18924 }
18925
18926 /// Creates a new client from the provided stub.
18927 ///
18928 /// The most common case for calling this function is in tests mocking the
18929 /// client's behavior.
18930 pub fn from_stub<T>(stub: T) -> Self
18931 where
18932 T: super::stub::WireGroups + 'static,
18933 {
18934 Self {
18935 inner: std::sync::Arc::new(stub),
18936 }
18937 }
18938
18939 pub(crate) async fn new(
18940 config: gaxi::options::ClientConfig,
18941 ) -> crate::ClientBuilderResult<Self> {
18942 let inner = Self::build_inner(config).await?;
18943 Ok(Self { inner })
18944 }
18945
18946 async fn build_inner(
18947 conf: gaxi::options::ClientConfig,
18948 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::WireGroups>> {
18949 if gaxi::options::tracing_enabled(&conf) {
18950 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18951 }
18952 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18953 }
18954
18955 async fn build_transport(
18956 conf: gaxi::options::ClientConfig,
18957 ) -> crate::ClientBuilderResult<impl super::stub::WireGroups> {
18958 super::transport::WireGroups::new(conf).await
18959 }
18960
18961 async fn build_with_tracing(
18962 conf: gaxi::options::ClientConfig,
18963 ) -> crate::ClientBuilderResult<impl super::stub::WireGroups> {
18964 Self::build_transport(conf)
18965 .await
18966 .map(super::tracing::WireGroups::new)
18967 }
18968
18969 /// Deletes the specified wire group in the given scope.
18970 pub fn delete(&self) -> super::builder::wire_groups::Delete {
18971 super::builder::wire_groups::Delete::new(self.inner.clone())
18972 }
18973
18974 /// Gets the specified wire group resource in the given scope.
18975 pub fn get(&self) -> super::builder::wire_groups::Get {
18976 super::builder::wire_groups::Get::new(self.inner.clone())
18977 }
18978
18979 /// Creates a wire group in the specified project in the given scope
18980 /// using the parameters that are included in the request.
18981 pub fn insert(&self) -> super::builder::wire_groups::Insert {
18982 super::builder::wire_groups::Insert::new(self.inner.clone())
18983 }
18984
18985 /// Lists the wire groups for a project in the given scope.
18986 pub fn list(&self) -> super::builder::wire_groups::List {
18987 super::builder::wire_groups::List::new(self.inner.clone())
18988 }
18989
18990 /// Updates the specified wire group resource with the data included in the
18991 /// request. This method supportsPATCH
18992 /// semantics and usesJSON merge
18993 /// patch format and processing rules.
18994 pub fn patch(&self) -> super::builder::wire_groups::Patch {
18995 super::builder::wire_groups::Patch::new(self.inner.clone())
18996 }
18997
18998 /// Retrieves the specified Operations resource.
18999 pub fn get_operation(&self) -> super::builder::wire_groups::GetOperation {
19000 super::builder::wire_groups::GetOperation::new(self.inner.clone())
19001 }
19002}
19003
19004/// Implements a client for the Google Compute Engine API.
19005///
19006/// # Example
19007/// ```
19008/// # use google_cloud_compute_v1::client::ZoneOperations;
19009/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
19010/// let client = ZoneOperations::builder().build().await?;
19011/// // use `client` to make requests to the Google Compute Engine API.
19012/// # Ok(()) }
19013/// ```
19014///
19015/// # Service Description
19016///
19017/// Service for the `zoneOperations` resource.
19018///
19019/// # Configuration
19020///
19021/// To configure `ZoneOperations` use the `with_*` methods in the type returned
19022/// by [builder()][ZoneOperations::builder]. The default configuration should
19023/// work for most applications. Common configuration changes include
19024///
19025/// * [with_endpoint()]: by default this client uses the global default endpoint
19026/// (`https://compute.googleapis.com`). Applications using regional
19027/// endpoints or running in restricted networks (e.g. a network configured
19028// with [Private Google Access with VPC Service Controls]) may want to
19029/// override this default.
19030/// * [with_credentials()]: by default this client uses
19031/// [Application Default Credentials]. Applications using custom
19032/// authentication may need to override this default.
19033///
19034/// [with_endpoint()]: super::builder::zone_operations::ClientBuilder::with_endpoint
19035/// [with_credentials()]: super::builder::zone_operations::ClientBuilder::with_credentials
19036/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
19037/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
19038///
19039/// # Pooling and Cloning
19040///
19041/// `ZoneOperations` holds a connection pool internally, it is advised to
19042/// create one and reuse it. You do not need to wrap `ZoneOperations` in
19043/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
19044/// already uses an `Arc` internally.
19045#[cfg(feature = "zone-operations")]
19046#[cfg_attr(docsrs, doc(cfg(feature = "zone-operations")))]
19047#[derive(Clone, Debug)]
19048pub struct ZoneOperations {
19049 inner: std::sync::Arc<dyn super::stub::dynamic::ZoneOperations>,
19050}
19051
19052#[cfg(feature = "zone-operations")]
19053impl ZoneOperations {
19054 /// Returns a builder for [ZoneOperations].
19055 ///
19056 /// ```
19057 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19058 /// # use google_cloud_compute_v1::client::ZoneOperations;
19059 /// let client = ZoneOperations::builder().build().await?;
19060 /// # Ok(()) }
19061 /// ```
19062 pub fn builder() -> super::builder::zone_operations::ClientBuilder {
19063 crate::new_client_builder(super::builder::zone_operations::client::Factory)
19064 }
19065
19066 /// Creates a new client from the provided stub.
19067 ///
19068 /// The most common case for calling this function is in tests mocking the
19069 /// client's behavior.
19070 pub fn from_stub<T>(stub: T) -> Self
19071 where
19072 T: super::stub::ZoneOperations + 'static,
19073 {
19074 Self {
19075 inner: std::sync::Arc::new(stub),
19076 }
19077 }
19078
19079 pub(crate) async fn new(
19080 config: gaxi::options::ClientConfig,
19081 ) -> crate::ClientBuilderResult<Self> {
19082 let inner = Self::build_inner(config).await?;
19083 Ok(Self { inner })
19084 }
19085
19086 async fn build_inner(
19087 conf: gaxi::options::ClientConfig,
19088 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ZoneOperations>> {
19089 if gaxi::options::tracing_enabled(&conf) {
19090 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
19091 }
19092 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
19093 }
19094
19095 async fn build_transport(
19096 conf: gaxi::options::ClientConfig,
19097 ) -> crate::ClientBuilderResult<impl super::stub::ZoneOperations> {
19098 super::transport::ZoneOperations::new(conf).await
19099 }
19100
19101 async fn build_with_tracing(
19102 conf: gaxi::options::ClientConfig,
19103 ) -> crate::ClientBuilderResult<impl super::stub::ZoneOperations> {
19104 Self::build_transport(conf)
19105 .await
19106 .map(super::tracing::ZoneOperations::new)
19107 }
19108
19109 /// Deletes the specified zone-specific Operations resource.
19110 pub fn delete(&self) -> super::builder::zone_operations::Delete {
19111 super::builder::zone_operations::Delete::new(self.inner.clone())
19112 }
19113
19114 /// Retrieves the specified zone-specific Operations resource.
19115 pub fn get(&self) -> super::builder::zone_operations::Get {
19116 super::builder::zone_operations::Get::new(self.inner.clone())
19117 }
19118
19119 /// Retrieves a list of Operation resources contained within
19120 /// the specified zone.
19121 pub fn list(&self) -> super::builder::zone_operations::List {
19122 super::builder::zone_operations::List::new(self.inner.clone())
19123 }
19124
19125 /// Waits for the specified Operation resource to return as `DONE`
19126 /// or for the request to approach the 2 minute deadline, and retrieves the
19127 /// specified Operation resource. This method waits for no more than the
19128 /// 2 minutes and then returns the current state of the
19129 /// operation, which might be `DONE` or still in progress.
19130 ///
19131 /// This method is called on a best-effort basis. Specifically:
19132 ///
19133 /// ```norust
19134 /// - In uncommon cases, when the server is overloaded, the request might
19135 /// return before the default deadline is reached, or might return after zero
19136 /// seconds.
19137 /// ```
19138 ///
19139 /// - If the default deadline is reached, there is no guarantee that the
19140 /// operation is actually done when the method returns. Be prepared to retry
19141 /// if the operation is not `DONE`.
19142 pub fn wait(&self) -> super::builder::zone_operations::Wait {
19143 super::builder::zone_operations::Wait::new(self.inner.clone())
19144 }
19145}
19146
19147/// Implements a client for the Google Compute Engine API.
19148///
19149/// # Example
19150/// ```
19151/// # use google_cloud_compute_v1::client::ZoneVmExtensionPolicies;
19152/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
19153/// let client = ZoneVmExtensionPolicies::builder().build().await?;
19154/// // use `client` to make requests to the Google Compute Engine API.
19155/// # Ok(()) }
19156/// ```
19157///
19158/// # Service Description
19159///
19160/// Service for the `zoneVmExtensionPolicies` resource.
19161///
19162/// # Configuration
19163///
19164/// To configure `ZoneVmExtensionPolicies` use the `with_*` methods in the type returned
19165/// by [builder()][ZoneVmExtensionPolicies::builder]. The default configuration should
19166/// work for most applications. Common configuration changes include
19167///
19168/// * [with_endpoint()]: by default this client uses the global default endpoint
19169/// (`https://compute.googleapis.com`). Applications using regional
19170/// endpoints or running in restricted networks (e.g. a network configured
19171// with [Private Google Access with VPC Service Controls]) may want to
19172/// override this default.
19173/// * [with_credentials()]: by default this client uses
19174/// [Application Default Credentials]. Applications using custom
19175/// authentication may need to override this default.
19176///
19177/// [with_endpoint()]: super::builder::zone_vm_extension_policies::ClientBuilder::with_endpoint
19178/// [with_credentials()]: super::builder::zone_vm_extension_policies::ClientBuilder::with_credentials
19179/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
19180/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
19181///
19182/// # Pooling and Cloning
19183///
19184/// `ZoneVmExtensionPolicies` holds a connection pool internally, it is advised to
19185/// create one and reuse it. You do not need to wrap `ZoneVmExtensionPolicies` in
19186/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
19187/// already uses an `Arc` internally.
19188#[cfg(feature = "zone-vm-extension-policies")]
19189#[cfg_attr(docsrs, doc(cfg(feature = "zone-vm-extension-policies")))]
19190#[derive(Clone, Debug)]
19191pub struct ZoneVmExtensionPolicies {
19192 inner: std::sync::Arc<dyn super::stub::dynamic::ZoneVmExtensionPolicies>,
19193}
19194
19195#[cfg(feature = "zone-vm-extension-policies")]
19196impl ZoneVmExtensionPolicies {
19197 /// Returns a builder for [ZoneVmExtensionPolicies].
19198 ///
19199 /// ```
19200 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19201 /// # use google_cloud_compute_v1::client::ZoneVmExtensionPolicies;
19202 /// let client = ZoneVmExtensionPolicies::builder().build().await?;
19203 /// # Ok(()) }
19204 /// ```
19205 pub fn builder() -> super::builder::zone_vm_extension_policies::ClientBuilder {
19206 crate::new_client_builder(super::builder::zone_vm_extension_policies::client::Factory)
19207 }
19208
19209 /// Creates a new client from the provided stub.
19210 ///
19211 /// The most common case for calling this function is in tests mocking the
19212 /// client's behavior.
19213 pub fn from_stub<T>(stub: T) -> Self
19214 where
19215 T: super::stub::ZoneVmExtensionPolicies + 'static,
19216 {
19217 Self {
19218 inner: std::sync::Arc::new(stub),
19219 }
19220 }
19221
19222 pub(crate) async fn new(
19223 config: gaxi::options::ClientConfig,
19224 ) -> crate::ClientBuilderResult<Self> {
19225 let inner = Self::build_inner(config).await?;
19226 Ok(Self { inner })
19227 }
19228
19229 async fn build_inner(
19230 conf: gaxi::options::ClientConfig,
19231 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ZoneVmExtensionPolicies>>
19232 {
19233 if gaxi::options::tracing_enabled(&conf) {
19234 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
19235 }
19236 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
19237 }
19238
19239 async fn build_transport(
19240 conf: gaxi::options::ClientConfig,
19241 ) -> crate::ClientBuilderResult<impl super::stub::ZoneVmExtensionPolicies> {
19242 super::transport::ZoneVmExtensionPolicies::new(conf).await
19243 }
19244
19245 async fn build_with_tracing(
19246 conf: gaxi::options::ClientConfig,
19247 ) -> crate::ClientBuilderResult<impl super::stub::ZoneVmExtensionPolicies> {
19248 Self::build_transport(conf)
19249 .await
19250 .map(super::tracing::ZoneVmExtensionPolicies::new)
19251 }
19252
19253 /// Deletes a specified zone VM extension policy.
19254 pub fn delete(&self) -> super::builder::zone_vm_extension_policies::Delete {
19255 super::builder::zone_vm_extension_policies::Delete::new(self.inner.clone())
19256 }
19257
19258 /// Retrieves details of a specific zone VM extension policy.
19259 pub fn get(&self) -> super::builder::zone_vm_extension_policies::Get {
19260 super::builder::zone_vm_extension_policies::Get::new(self.inner.clone())
19261 }
19262
19263 /// Creates a new zone-level VM extension policy within a project.
19264 pub fn insert(&self) -> super::builder::zone_vm_extension_policies::Insert {
19265 super::builder::zone_vm_extension_policies::Insert::new(self.inner.clone())
19266 }
19267
19268 /// Lists all VM extension policies within a specific zone for a project.
19269 pub fn list(&self) -> super::builder::zone_vm_extension_policies::List {
19270 super::builder::zone_vm_extension_policies::List::new(self.inner.clone())
19271 }
19272
19273 /// Modifies an existing zone VM extension policy.
19274 pub fn update(&self) -> super::builder::zone_vm_extension_policies::Update {
19275 super::builder::zone_vm_extension_policies::Update::new(self.inner.clone())
19276 }
19277
19278 /// Retrieves the specified zone-specific Operations resource.
19279 pub fn get_operation(&self) -> super::builder::zone_vm_extension_policies::GetOperation {
19280 super::builder::zone_vm_extension_policies::GetOperation::new(self.inner.clone())
19281 }
19282}
19283
19284/// Implements a client for the Google Compute Engine API.
19285///
19286/// # Example
19287/// ```
19288/// # use google_cloud_compute_v1::client::Zones;
19289/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
19290/// let client = Zones::builder().build().await?;
19291/// // use `client` to make requests to the Google Compute Engine API.
19292/// # Ok(()) }
19293/// ```
19294///
19295/// # Service Description
19296///
19297/// Service for the `zones` resource.
19298///
19299/// # Configuration
19300///
19301/// To configure `Zones` use the `with_*` methods in the type returned
19302/// by [builder()][Zones::builder]. The default configuration should
19303/// work for most applications. Common configuration changes include
19304///
19305/// * [with_endpoint()]: by default this client uses the global default endpoint
19306/// (`https://compute.googleapis.com`). Applications using regional
19307/// endpoints or running in restricted networks (e.g. a network configured
19308// with [Private Google Access with VPC Service Controls]) may want to
19309/// override this default.
19310/// * [with_credentials()]: by default this client uses
19311/// [Application Default Credentials]. Applications using custom
19312/// authentication may need to override this default.
19313///
19314/// [with_endpoint()]: super::builder::zones::ClientBuilder::with_endpoint
19315/// [with_credentials()]: super::builder::zones::ClientBuilder::with_credentials
19316/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
19317/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
19318///
19319/// # Pooling and Cloning
19320///
19321/// `Zones` holds a connection pool internally, it is advised to
19322/// create one and reuse it. You do not need to wrap `Zones` in
19323/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
19324/// already uses an `Arc` internally.
19325#[cfg(feature = "zones")]
19326#[cfg_attr(docsrs, doc(cfg(feature = "zones")))]
19327#[derive(Clone, Debug)]
19328pub struct Zones {
19329 inner: std::sync::Arc<dyn super::stub::dynamic::Zones>,
19330}
19331
19332#[cfg(feature = "zones")]
19333impl Zones {
19334 /// Returns a builder for [Zones].
19335 ///
19336 /// ```
19337 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19338 /// # use google_cloud_compute_v1::client::Zones;
19339 /// let client = Zones::builder().build().await?;
19340 /// # Ok(()) }
19341 /// ```
19342 pub fn builder() -> super::builder::zones::ClientBuilder {
19343 crate::new_client_builder(super::builder::zones::client::Factory)
19344 }
19345
19346 /// Creates a new client from the provided stub.
19347 ///
19348 /// The most common case for calling this function is in tests mocking the
19349 /// client's behavior.
19350 pub fn from_stub<T>(stub: T) -> Self
19351 where
19352 T: super::stub::Zones + 'static,
19353 {
19354 Self {
19355 inner: std::sync::Arc::new(stub),
19356 }
19357 }
19358
19359 pub(crate) async fn new(
19360 config: gaxi::options::ClientConfig,
19361 ) -> crate::ClientBuilderResult<Self> {
19362 let inner = Self::build_inner(config).await?;
19363 Ok(Self { inner })
19364 }
19365
19366 async fn build_inner(
19367 conf: gaxi::options::ClientConfig,
19368 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Zones>> {
19369 if gaxi::options::tracing_enabled(&conf) {
19370 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
19371 }
19372 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
19373 }
19374
19375 async fn build_transport(
19376 conf: gaxi::options::ClientConfig,
19377 ) -> crate::ClientBuilderResult<impl super::stub::Zones> {
19378 super::transport::Zones::new(conf).await
19379 }
19380
19381 async fn build_with_tracing(
19382 conf: gaxi::options::ClientConfig,
19383 ) -> crate::ClientBuilderResult<impl super::stub::Zones> {
19384 Self::build_transport(conf)
19385 .await
19386 .map(super::tracing::Zones::new)
19387 }
19388
19389 /// Returns the specified Zone resource.
19390 pub fn get(&self) -> super::builder::zones::Get {
19391 super::builder::zones::Get::new(self.inner.clone())
19392 }
19393
19394 /// Retrieves the list of Zone resources available to the specified project.
19395 pub fn list(&self) -> super::builder::zones::List {
19396 super::builder::zones::List::new(self.inner.clone())
19397 }
19398}