google_cloud_compute_v1/client.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16#![allow(rustdoc::bare_urls)]
17#![allow(rustdoc::broken_intra_doc_links)]
18#![allow(rustdoc::redundant_explicit_links)]
19
20/// Implements a client for the Google Compute Engine API.
21///
22/// # Example
23/// ```
24/// # tokio_test::block_on(async {
25/// # use google_cloud_compute_v1::client::AcceleratorTypes;
26/// let client = AcceleratorTypes::builder().build().await?;
27/// // use `client` to make requests to the Google Compute Engine API.
28/// # gax::client_builder::Result::<()>::Ok(()) });
29/// ```
30///
31/// # Service Description
32///
33/// Service for the `acceleratorTypes` resource.
34///
35/// # Configuration
36///
37/// To configure `AcceleratorTypes` use the `with_*` methods in the type returned
38/// by [builder()][AcceleratorTypes::builder]. The default configuration should
39/// work for most applications. Common configuration changes include
40///
41/// * [with_endpoint()]: by default this client uses the global default endpoint
42/// (`https://compute.googleapis.com`). Applications using regional
43/// endpoints or running in restricted networks (e.g. a network configured
44// with [Private Google Access with VPC Service Controls]) may want to
45/// override this default.
46/// * [with_credentials()]: by default this client uses
47/// [Application Default Credentials]. Applications using custom
48/// authentication may need to override this default.
49///
50/// [with_endpoint()]: super::builder::accelerator_types::ClientBuilder::with_endpoint
51/// [with_credentials()]: super::builder::accelerator_types::ClientBuilder::credentials
52/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
53/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
54///
55/// # Pooling and Cloning
56///
57/// `AcceleratorTypes` holds a connection pool internally, it is advised to
58/// create one and the reuse it. You do not need to wrap `AcceleratorTypes` in
59/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
60/// already uses an `Arc` internally.
61#[cfg(feature = "accelerator-types")]
62#[cfg_attr(docsrs, doc(cfg(feature = "accelerator-types")))]
63#[derive(Clone, Debug)]
64pub struct AcceleratorTypes {
65 inner: std::sync::Arc<dyn super::stub::dynamic::AcceleratorTypes>,
66}
67
68#[cfg(feature = "accelerator-types")]
69impl AcceleratorTypes {
70 /// Returns a builder for [AcceleratorTypes].
71 ///
72 /// ```
73 /// # tokio_test::block_on(async {
74 /// # use google_cloud_compute_v1::client::AcceleratorTypes;
75 /// let client = AcceleratorTypes::builder().build().await?;
76 /// # gax::client_builder::Result::<()>::Ok(()) });
77 /// ```
78 pub fn builder() -> super::builder::accelerator_types::ClientBuilder {
79 gax::client_builder::internal::new_builder(
80 super::builder::accelerator_types::client::Factory,
81 )
82 }
83
84 /// Creates a new client from the provided stub.
85 ///
86 /// The most common case for calling this function is in tests mocking the
87 /// client's behavior.
88 pub fn from_stub<T>(stub: T) -> Self
89 where
90 T: super::stub::AcceleratorTypes + 'static,
91 {
92 Self {
93 inner: std::sync::Arc::new(stub),
94 }
95 }
96
97 pub(crate) async fn new(
98 config: gaxi::options::ClientConfig,
99 ) -> gax::client_builder::Result<Self> {
100 let inner = Self::build_inner(config).await?;
101 Ok(Self { inner })
102 }
103
104 async fn build_inner(
105 conf: gaxi::options::ClientConfig,
106 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::AcceleratorTypes>>
107 {
108 if gaxi::options::tracing_enabled(&conf) {
109 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
110 }
111 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
112 }
113
114 async fn build_transport(
115 conf: gaxi::options::ClientConfig,
116 ) -> gax::client_builder::Result<impl super::stub::AcceleratorTypes> {
117 super::transport::AcceleratorTypes::new(conf).await
118 }
119
120 async fn build_with_tracing(
121 conf: gaxi::options::ClientConfig,
122 ) -> gax::client_builder::Result<impl super::stub::AcceleratorTypes> {
123 Self::build_transport(conf)
124 .await
125 .map(super::tracing::AcceleratorTypes::new)
126 }
127
128 /// Retrieves an aggregated list of accelerator types.
129 ///
130 /// To prevent failure, it is recommended that you set the
131 /// `returnPartialSuccess` parameter to `true`.
132 pub fn aggregated_list(&self) -> super::builder::accelerator_types::AggregatedList {
133 super::builder::accelerator_types::AggregatedList::new(self.inner.clone())
134 }
135
136 /// Returns the specified accelerator type.
137 pub fn get(&self) -> super::builder::accelerator_types::Get {
138 super::builder::accelerator_types::Get::new(self.inner.clone())
139 }
140
141 /// Retrieves a list of accelerator types that are available to the specified
142 /// project.
143 pub fn list(&self) -> super::builder::accelerator_types::List {
144 super::builder::accelerator_types::List::new(self.inner.clone())
145 }
146}
147
148/// Implements a client for the Google Compute Engine API.
149///
150/// # Example
151/// ```
152/// # tokio_test::block_on(async {
153/// # use google_cloud_compute_v1::client::Addresses;
154/// let client = Addresses::builder().build().await?;
155/// // use `client` to make requests to the Google Compute Engine API.
156/// # gax::client_builder::Result::<()>::Ok(()) });
157/// ```
158///
159/// # Service Description
160///
161/// Service for the `addresses` resource.
162///
163/// # Configuration
164///
165/// To configure `Addresses` use the `with_*` methods in the type returned
166/// by [builder()][Addresses::builder]. The default configuration should
167/// work for most applications. Common configuration changes include
168///
169/// * [with_endpoint()]: by default this client uses the global default endpoint
170/// (`https://compute.googleapis.com`). Applications using regional
171/// endpoints or running in restricted networks (e.g. a network configured
172// with [Private Google Access with VPC Service Controls]) may want to
173/// override this default.
174/// * [with_credentials()]: by default this client uses
175/// [Application Default Credentials]. Applications using custom
176/// authentication may need to override this default.
177///
178/// [with_endpoint()]: super::builder::addresses::ClientBuilder::with_endpoint
179/// [with_credentials()]: super::builder::addresses::ClientBuilder::credentials
180/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
181/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
182///
183/// # Pooling and Cloning
184///
185/// `Addresses` holds a connection pool internally, it is advised to
186/// create one and the reuse it. You do not need to wrap `Addresses` in
187/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
188/// already uses an `Arc` internally.
189#[cfg(feature = "addresses")]
190#[cfg_attr(docsrs, doc(cfg(feature = "addresses")))]
191#[derive(Clone, Debug)]
192pub struct Addresses {
193 inner: std::sync::Arc<dyn super::stub::dynamic::Addresses>,
194}
195
196#[cfg(feature = "addresses")]
197impl Addresses {
198 /// Returns a builder for [Addresses].
199 ///
200 /// ```
201 /// # tokio_test::block_on(async {
202 /// # use google_cloud_compute_v1::client::Addresses;
203 /// let client = Addresses::builder().build().await?;
204 /// # gax::client_builder::Result::<()>::Ok(()) });
205 /// ```
206 pub fn builder() -> super::builder::addresses::ClientBuilder {
207 gax::client_builder::internal::new_builder(super::builder::addresses::client::Factory)
208 }
209
210 /// Creates a new client from the provided stub.
211 ///
212 /// The most common case for calling this function is in tests mocking the
213 /// client's behavior.
214 pub fn from_stub<T>(stub: T) -> Self
215 where
216 T: super::stub::Addresses + 'static,
217 {
218 Self {
219 inner: std::sync::Arc::new(stub),
220 }
221 }
222
223 pub(crate) async fn new(
224 config: gaxi::options::ClientConfig,
225 ) -> gax::client_builder::Result<Self> {
226 let inner = Self::build_inner(config).await?;
227 Ok(Self { inner })
228 }
229
230 async fn build_inner(
231 conf: gaxi::options::ClientConfig,
232 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Addresses>> {
233 if gaxi::options::tracing_enabled(&conf) {
234 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
235 }
236 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
237 }
238
239 async fn build_transport(
240 conf: gaxi::options::ClientConfig,
241 ) -> gax::client_builder::Result<impl super::stub::Addresses> {
242 super::transport::Addresses::new(conf).await
243 }
244
245 async fn build_with_tracing(
246 conf: gaxi::options::ClientConfig,
247 ) -> gax::client_builder::Result<impl super::stub::Addresses> {
248 Self::build_transport(conf)
249 .await
250 .map(super::tracing::Addresses::new)
251 }
252
253 /// Retrieves an aggregated list of addresses.
254 ///
255 /// To prevent failure, it is recommended that you set the
256 /// `returnPartialSuccess` parameter to `true`.
257 pub fn aggregated_list(&self) -> super::builder::addresses::AggregatedList {
258 super::builder::addresses::AggregatedList::new(self.inner.clone())
259 }
260
261 /// Deletes the specified address resource.
262 pub fn delete(&self) -> super::builder::addresses::Delete {
263 super::builder::addresses::Delete::new(self.inner.clone())
264 }
265
266 /// Returns the specified address resource.
267 pub fn get(&self) -> super::builder::addresses::Get {
268 super::builder::addresses::Get::new(self.inner.clone())
269 }
270
271 /// Creates an address resource in the specified project by using the data
272 /// included in the request.
273 pub fn insert(&self) -> super::builder::addresses::Insert {
274 super::builder::addresses::Insert::new(self.inner.clone())
275 }
276
277 /// Retrieves a list of addresses contained within
278 /// the specified region.
279 pub fn list(&self) -> super::builder::addresses::List {
280 super::builder::addresses::List::new(self.inner.clone())
281 }
282
283 /// Moves the specified address resource.
284 pub fn r#move(&self) -> super::builder::addresses::Move {
285 super::builder::addresses::Move::new(self.inner.clone())
286 }
287
288 /// Sets the labels on an Address. To learn more about labels, read theLabeling
289 /// Resources documentation.
290 pub fn set_labels(&self) -> super::builder::addresses::SetLabels {
291 super::builder::addresses::SetLabels::new(self.inner.clone())
292 }
293
294 /// Returns permissions that a caller has on the specified resource.
295 pub fn test_iam_permissions(&self) -> super::builder::addresses::TestIamPermissions {
296 super::builder::addresses::TestIamPermissions::new(self.inner.clone())
297 }
298
299 /// Retrieves the specified region-specific Operations resource.
300 pub fn get_operation(&self) -> super::builder::addresses::GetOperation {
301 super::builder::addresses::GetOperation::new(self.inner.clone())
302 }
303}
304
305/// Implements a client for the Google Compute Engine API.
306///
307/// # Example
308/// ```
309/// # tokio_test::block_on(async {
310/// # use google_cloud_compute_v1::client::Autoscalers;
311/// let client = Autoscalers::builder().build().await?;
312/// // use `client` to make requests to the Google Compute Engine API.
313/// # gax::client_builder::Result::<()>::Ok(()) });
314/// ```
315///
316/// # Service Description
317///
318/// Service for the `autoscalers` resource.
319///
320/// # Configuration
321///
322/// To configure `Autoscalers` use the `with_*` methods in the type returned
323/// by [builder()][Autoscalers::builder]. The default configuration should
324/// work for most applications. Common configuration changes include
325///
326/// * [with_endpoint()]: by default this client uses the global default endpoint
327/// (`https://compute.googleapis.com`). Applications using regional
328/// endpoints or running in restricted networks (e.g. a network configured
329// with [Private Google Access with VPC Service Controls]) may want to
330/// override this default.
331/// * [with_credentials()]: by default this client uses
332/// [Application Default Credentials]. Applications using custom
333/// authentication may need to override this default.
334///
335/// [with_endpoint()]: super::builder::autoscalers::ClientBuilder::with_endpoint
336/// [with_credentials()]: super::builder::autoscalers::ClientBuilder::credentials
337/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
338/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
339///
340/// # Pooling and Cloning
341///
342/// `Autoscalers` holds a connection pool internally, it is advised to
343/// create one and the reuse it. You do not need to wrap `Autoscalers` in
344/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
345/// already uses an `Arc` internally.
346#[cfg(feature = "autoscalers")]
347#[cfg_attr(docsrs, doc(cfg(feature = "autoscalers")))]
348#[derive(Clone, Debug)]
349pub struct Autoscalers {
350 inner: std::sync::Arc<dyn super::stub::dynamic::Autoscalers>,
351}
352
353#[cfg(feature = "autoscalers")]
354impl Autoscalers {
355 /// Returns a builder for [Autoscalers].
356 ///
357 /// ```
358 /// # tokio_test::block_on(async {
359 /// # use google_cloud_compute_v1::client::Autoscalers;
360 /// let client = Autoscalers::builder().build().await?;
361 /// # gax::client_builder::Result::<()>::Ok(()) });
362 /// ```
363 pub fn builder() -> super::builder::autoscalers::ClientBuilder {
364 gax::client_builder::internal::new_builder(super::builder::autoscalers::client::Factory)
365 }
366
367 /// Creates a new client from the provided stub.
368 ///
369 /// The most common case for calling this function is in tests mocking the
370 /// client's behavior.
371 pub fn from_stub<T>(stub: T) -> Self
372 where
373 T: super::stub::Autoscalers + 'static,
374 {
375 Self {
376 inner: std::sync::Arc::new(stub),
377 }
378 }
379
380 pub(crate) async fn new(
381 config: gaxi::options::ClientConfig,
382 ) -> gax::client_builder::Result<Self> {
383 let inner = Self::build_inner(config).await?;
384 Ok(Self { inner })
385 }
386
387 async fn build_inner(
388 conf: gaxi::options::ClientConfig,
389 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Autoscalers>> {
390 if gaxi::options::tracing_enabled(&conf) {
391 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
392 }
393 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
394 }
395
396 async fn build_transport(
397 conf: gaxi::options::ClientConfig,
398 ) -> gax::client_builder::Result<impl super::stub::Autoscalers> {
399 super::transport::Autoscalers::new(conf).await
400 }
401
402 async fn build_with_tracing(
403 conf: gaxi::options::ClientConfig,
404 ) -> gax::client_builder::Result<impl super::stub::Autoscalers> {
405 Self::build_transport(conf)
406 .await
407 .map(super::tracing::Autoscalers::new)
408 }
409
410 /// Retrieves an aggregated list of autoscalers.
411 ///
412 /// To prevent failure, it is recommended that you set the
413 /// `returnPartialSuccess` parameter to `true`.
414 pub fn aggregated_list(&self) -> super::builder::autoscalers::AggregatedList {
415 super::builder::autoscalers::AggregatedList::new(self.inner.clone())
416 }
417
418 /// Deletes the specified autoscaler.
419 pub fn delete(&self) -> super::builder::autoscalers::Delete {
420 super::builder::autoscalers::Delete::new(self.inner.clone())
421 }
422
423 /// Returns the specified autoscaler resource.
424 pub fn get(&self) -> super::builder::autoscalers::Get {
425 super::builder::autoscalers::Get::new(self.inner.clone())
426 }
427
428 /// Creates an autoscaler in the specified project using the data
429 /// included in the request.
430 pub fn insert(&self) -> super::builder::autoscalers::Insert {
431 super::builder::autoscalers::Insert::new(self.inner.clone())
432 }
433
434 /// Retrieves a list of autoscalers contained within
435 /// the specified zone.
436 pub fn list(&self) -> super::builder::autoscalers::List {
437 super::builder::autoscalers::List::new(self.inner.clone())
438 }
439
440 /// Updates an autoscaler in the specified project using the data
441 /// included in the request. This method supportsPATCH
442 /// semantics and uses theJSON merge
443 /// patch format and processing rules.
444 pub fn patch(&self) -> super::builder::autoscalers::Patch {
445 super::builder::autoscalers::Patch::new(self.inner.clone())
446 }
447
448 /// Updates an autoscaler in the specified project using the data
449 /// included in the request.
450 pub fn update(&self) -> super::builder::autoscalers::Update {
451 super::builder::autoscalers::Update::new(self.inner.clone())
452 }
453
454 /// Retrieves the specified zone-specific Operations resource.
455 pub fn get_operation(&self) -> super::builder::autoscalers::GetOperation {
456 super::builder::autoscalers::GetOperation::new(self.inner.clone())
457 }
458}
459
460/// Implements a client for the Google Compute Engine API.
461///
462/// # Example
463/// ```
464/// # tokio_test::block_on(async {
465/// # use google_cloud_compute_v1::client::BackendBuckets;
466/// let client = BackendBuckets::builder().build().await?;
467/// // use `client` to make requests to the Google Compute Engine API.
468/// # gax::client_builder::Result::<()>::Ok(()) });
469/// ```
470///
471/// # Service Description
472///
473/// Service for the `backendBuckets` resource.
474///
475/// # Configuration
476///
477/// To configure `BackendBuckets` use the `with_*` methods in the type returned
478/// by [builder()][BackendBuckets::builder]. The default configuration should
479/// work for most applications. Common configuration changes include
480///
481/// * [with_endpoint()]: by default this client uses the global default endpoint
482/// (`https://compute.googleapis.com`). Applications using regional
483/// endpoints or running in restricted networks (e.g. a network configured
484// with [Private Google Access with VPC Service Controls]) may want to
485/// override this default.
486/// * [with_credentials()]: by default this client uses
487/// [Application Default Credentials]. Applications using custom
488/// authentication may need to override this default.
489///
490/// [with_endpoint()]: super::builder::backend_buckets::ClientBuilder::with_endpoint
491/// [with_credentials()]: super::builder::backend_buckets::ClientBuilder::credentials
492/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
493/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
494///
495/// # Pooling and Cloning
496///
497/// `BackendBuckets` holds a connection pool internally, it is advised to
498/// create one and the reuse it. You do not need to wrap `BackendBuckets` in
499/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
500/// already uses an `Arc` internally.
501#[cfg(feature = "backend-buckets")]
502#[cfg_attr(docsrs, doc(cfg(feature = "backend-buckets")))]
503#[derive(Clone, Debug)]
504pub struct BackendBuckets {
505 inner: std::sync::Arc<dyn super::stub::dynamic::BackendBuckets>,
506}
507
508#[cfg(feature = "backend-buckets")]
509impl BackendBuckets {
510 /// Returns a builder for [BackendBuckets].
511 ///
512 /// ```
513 /// # tokio_test::block_on(async {
514 /// # use google_cloud_compute_v1::client::BackendBuckets;
515 /// let client = BackendBuckets::builder().build().await?;
516 /// # gax::client_builder::Result::<()>::Ok(()) });
517 /// ```
518 pub fn builder() -> super::builder::backend_buckets::ClientBuilder {
519 gax::client_builder::internal::new_builder(super::builder::backend_buckets::client::Factory)
520 }
521
522 /// Creates a new client from the provided stub.
523 ///
524 /// The most common case for calling this function is in tests mocking the
525 /// client's behavior.
526 pub fn from_stub<T>(stub: T) -> Self
527 where
528 T: super::stub::BackendBuckets + 'static,
529 {
530 Self {
531 inner: std::sync::Arc::new(stub),
532 }
533 }
534
535 pub(crate) async fn new(
536 config: gaxi::options::ClientConfig,
537 ) -> gax::client_builder::Result<Self> {
538 let inner = Self::build_inner(config).await?;
539 Ok(Self { inner })
540 }
541
542 async fn build_inner(
543 conf: gaxi::options::ClientConfig,
544 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::BackendBuckets>> {
545 if gaxi::options::tracing_enabled(&conf) {
546 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
547 }
548 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
549 }
550
551 async fn build_transport(
552 conf: gaxi::options::ClientConfig,
553 ) -> gax::client_builder::Result<impl super::stub::BackendBuckets> {
554 super::transport::BackendBuckets::new(conf).await
555 }
556
557 async fn build_with_tracing(
558 conf: gaxi::options::ClientConfig,
559 ) -> gax::client_builder::Result<impl super::stub::BackendBuckets> {
560 Self::build_transport(conf)
561 .await
562 .map(super::tracing::BackendBuckets::new)
563 }
564
565 /// Adds a key for validating requests with signed URLs for this backend
566 /// bucket.
567 pub fn add_signed_url_key(&self) -> super::builder::backend_buckets::AddSignedUrlKey {
568 super::builder::backend_buckets::AddSignedUrlKey::new(self.inner.clone())
569 }
570
571 /// Deletes the specified BackendBucket resource.
572 pub fn delete(&self) -> super::builder::backend_buckets::Delete {
573 super::builder::backend_buckets::Delete::new(self.inner.clone())
574 }
575
576 /// Deletes a key for validating requests with signed URLs for this backend
577 /// bucket.
578 pub fn delete_signed_url_key(&self) -> super::builder::backend_buckets::DeleteSignedUrlKey {
579 super::builder::backend_buckets::DeleteSignedUrlKey::new(self.inner.clone())
580 }
581
582 /// Returns the specified BackendBucket resource.
583 pub fn get(&self) -> super::builder::backend_buckets::Get {
584 super::builder::backend_buckets::Get::new(self.inner.clone())
585 }
586
587 /// Gets the access control policy for a resource. May be empty if no such
588 /// policy or resource exists.
589 pub fn get_iam_policy(&self) -> super::builder::backend_buckets::GetIamPolicy {
590 super::builder::backend_buckets::GetIamPolicy::new(self.inner.clone())
591 }
592
593 /// Creates a BackendBucket resource in the specified project using
594 /// the data included in the request.
595 pub fn insert(&self) -> super::builder::backend_buckets::Insert {
596 super::builder::backend_buckets::Insert::new(self.inner.clone())
597 }
598
599 /// Retrieves the list of BackendBucket resources available to the specified
600 /// project.
601 pub fn list(&self) -> super::builder::backend_buckets::List {
602 super::builder::backend_buckets::List::new(self.inner.clone())
603 }
604
605 /// Updates the specified BackendBucket resource with the data included in the
606 /// request. This method supportsPATCH
607 /// semantics and uses theJSON merge
608 /// patch format and processing rules.
609 pub fn patch(&self) -> super::builder::backend_buckets::Patch {
610 super::builder::backend_buckets::Patch::new(self.inner.clone())
611 }
612
613 /// Sets the edge security policy for the specified backend bucket.
614 pub fn set_edge_security_policy(
615 &self,
616 ) -> super::builder::backend_buckets::SetEdgeSecurityPolicy {
617 super::builder::backend_buckets::SetEdgeSecurityPolicy::new(self.inner.clone())
618 }
619
620 /// Sets the access control policy on the specified resource.
621 /// Replaces any existing policy.
622 pub fn set_iam_policy(&self) -> super::builder::backend_buckets::SetIamPolicy {
623 super::builder::backend_buckets::SetIamPolicy::new(self.inner.clone())
624 }
625
626 /// Returns permissions that a caller has on the specified resource.
627 pub fn test_iam_permissions(&self) -> super::builder::backend_buckets::TestIamPermissions {
628 super::builder::backend_buckets::TestIamPermissions::new(self.inner.clone())
629 }
630
631 /// Updates the specified BackendBucket resource with the data included in the
632 /// request.
633 pub fn update(&self) -> super::builder::backend_buckets::Update {
634 super::builder::backend_buckets::Update::new(self.inner.clone())
635 }
636
637 /// Retrieves the specified Operations resource.
638 pub fn get_operation(&self) -> super::builder::backend_buckets::GetOperation {
639 super::builder::backend_buckets::GetOperation::new(self.inner.clone())
640 }
641}
642
643/// Implements a client for the Google Compute Engine API.
644///
645/// # Example
646/// ```
647/// # tokio_test::block_on(async {
648/// # use google_cloud_compute_v1::client::BackendServices;
649/// let client = BackendServices::builder().build().await?;
650/// // use `client` to make requests to the Google Compute Engine API.
651/// # gax::client_builder::Result::<()>::Ok(()) });
652/// ```
653///
654/// # Service Description
655///
656/// Service for the `backendServices` resource.
657///
658/// # Configuration
659///
660/// To configure `BackendServices` use the `with_*` methods in the type returned
661/// by [builder()][BackendServices::builder]. The default configuration should
662/// work for most applications. Common configuration changes include
663///
664/// * [with_endpoint()]: by default this client uses the global default endpoint
665/// (`https://compute.googleapis.com`). Applications using regional
666/// endpoints or running in restricted networks (e.g. a network configured
667// with [Private Google Access with VPC Service Controls]) may want to
668/// override this default.
669/// * [with_credentials()]: by default this client uses
670/// [Application Default Credentials]. Applications using custom
671/// authentication may need to override this default.
672///
673/// [with_endpoint()]: super::builder::backend_services::ClientBuilder::with_endpoint
674/// [with_credentials()]: super::builder::backend_services::ClientBuilder::credentials
675/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
676/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
677///
678/// # Pooling and Cloning
679///
680/// `BackendServices` holds a connection pool internally, it is advised to
681/// create one and the reuse it. You do not need to wrap `BackendServices` in
682/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
683/// already uses an `Arc` internally.
684#[cfg(feature = "backend-services")]
685#[cfg_attr(docsrs, doc(cfg(feature = "backend-services")))]
686#[derive(Clone, Debug)]
687pub struct BackendServices {
688 inner: std::sync::Arc<dyn super::stub::dynamic::BackendServices>,
689}
690
691#[cfg(feature = "backend-services")]
692impl BackendServices {
693 /// Returns a builder for [BackendServices].
694 ///
695 /// ```
696 /// # tokio_test::block_on(async {
697 /// # use google_cloud_compute_v1::client::BackendServices;
698 /// let client = BackendServices::builder().build().await?;
699 /// # gax::client_builder::Result::<()>::Ok(()) });
700 /// ```
701 pub fn builder() -> super::builder::backend_services::ClientBuilder {
702 gax::client_builder::internal::new_builder(
703 super::builder::backend_services::client::Factory,
704 )
705 }
706
707 /// Creates a new client from the provided stub.
708 ///
709 /// The most common case for calling this function is in tests mocking the
710 /// client's behavior.
711 pub fn from_stub<T>(stub: T) -> Self
712 where
713 T: super::stub::BackendServices + 'static,
714 {
715 Self {
716 inner: std::sync::Arc::new(stub),
717 }
718 }
719
720 pub(crate) async fn new(
721 config: gaxi::options::ClientConfig,
722 ) -> gax::client_builder::Result<Self> {
723 let inner = Self::build_inner(config).await?;
724 Ok(Self { inner })
725 }
726
727 async fn build_inner(
728 conf: gaxi::options::ClientConfig,
729 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::BackendServices>>
730 {
731 if gaxi::options::tracing_enabled(&conf) {
732 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
733 }
734 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
735 }
736
737 async fn build_transport(
738 conf: gaxi::options::ClientConfig,
739 ) -> gax::client_builder::Result<impl super::stub::BackendServices> {
740 super::transport::BackendServices::new(conf).await
741 }
742
743 async fn build_with_tracing(
744 conf: gaxi::options::ClientConfig,
745 ) -> gax::client_builder::Result<impl super::stub::BackendServices> {
746 Self::build_transport(conf)
747 .await
748 .map(super::tracing::BackendServices::new)
749 }
750
751 /// Adds a key for validating requests with signed URLs for this backend
752 /// service.
753 pub fn add_signed_url_key(&self) -> super::builder::backend_services::AddSignedUrlKey {
754 super::builder::backend_services::AddSignedUrlKey::new(self.inner.clone())
755 }
756
757 /// Retrieves the list of all BackendService resources, regional and global,
758 /// available to the specified project.
759 ///
760 /// To prevent failure, it is recommended that you set the
761 /// `returnPartialSuccess` parameter to `true`.
762 pub fn aggregated_list(&self) -> super::builder::backend_services::AggregatedList {
763 super::builder::backend_services::AggregatedList::new(self.inner.clone())
764 }
765
766 /// Deletes the specified BackendService resource.
767 pub fn delete(&self) -> super::builder::backend_services::Delete {
768 super::builder::backend_services::Delete::new(self.inner.clone())
769 }
770
771 /// Deletes a key for validating requests with signed URLs for this backend
772 /// service.
773 pub fn delete_signed_url_key(&self) -> super::builder::backend_services::DeleteSignedUrlKey {
774 super::builder::backend_services::DeleteSignedUrlKey::new(self.inner.clone())
775 }
776
777 /// Returns the specified BackendService resource.
778 pub fn get(&self) -> super::builder::backend_services::Get {
779 super::builder::backend_services::Get::new(self.inner.clone())
780 }
781
782 /// Returns effective security policies applied to this backend service.
783 pub fn get_effective_security_policies(
784 &self,
785 ) -> super::builder::backend_services::GetEffectiveSecurityPolicies {
786 super::builder::backend_services::GetEffectiveSecurityPolicies::new(self.inner.clone())
787 }
788
789 /// Gets the most recent health check results for this
790 /// BackendService.
791 ///
792 /// Example request body:
793 ///
794 /// {
795 /// "group": "/zones/us-east1-b/instanceGroups/lb-backend-example"
796 /// }
797 pub fn get_health(&self) -> super::builder::backend_services::GetHealth {
798 super::builder::backend_services::GetHealth::new(self.inner.clone())
799 }
800
801 /// Gets the access control policy for a resource. May be empty if no such
802 /// policy or resource exists.
803 pub fn get_iam_policy(&self) -> super::builder::backend_services::GetIamPolicy {
804 super::builder::backend_services::GetIamPolicy::new(self.inner.clone())
805 }
806
807 /// Creates a BackendService resource in the specified project using
808 /// the data included in the request. For more information, see
809 /// Backend services overview.
810 pub fn insert(&self) -> super::builder::backend_services::Insert {
811 super::builder::backend_services::Insert::new(self.inner.clone())
812 }
813
814 /// Retrieves the list of BackendService resources available to the specified
815 /// project.
816 pub fn list(&self) -> super::builder::backend_services::List {
817 super::builder::backend_services::List::new(self.inner.clone())
818 }
819
820 /// Retrieves a list of all usable backend services in the specified project.
821 pub fn list_usable(&self) -> super::builder::backend_services::ListUsable {
822 super::builder::backend_services::ListUsable::new(self.inner.clone())
823 }
824
825 /// Patches the specified BackendService resource with the data included in the
826 /// request. For more information, see
827 /// Backend services overview. This method
828 /// supports PATCH semantics and uses the JSON merge
829 /// patch format and processing rules.
830 pub fn patch(&self) -> super::builder::backend_services::Patch {
831 super::builder::backend_services::Patch::new(self.inner.clone())
832 }
833
834 /// Sets the edge security policy for the specified backend service.
835 pub fn set_edge_security_policy(
836 &self,
837 ) -> super::builder::backend_services::SetEdgeSecurityPolicy {
838 super::builder::backend_services::SetEdgeSecurityPolicy::new(self.inner.clone())
839 }
840
841 /// Sets the access control policy on the specified resource.
842 /// Replaces any existing policy.
843 pub fn set_iam_policy(&self) -> super::builder::backend_services::SetIamPolicy {
844 super::builder::backend_services::SetIamPolicy::new(self.inner.clone())
845 }
846
847 /// Sets the Google Cloud Armor security policy for the specified backend
848 /// service. For more information, seeGoogle
849 /// Cloud Armor Overview
850 pub fn set_security_policy(&self) -> super::builder::backend_services::SetSecurityPolicy {
851 super::builder::backend_services::SetSecurityPolicy::new(self.inner.clone())
852 }
853
854 /// Returns permissions that a caller has on the specified resource.
855 pub fn test_iam_permissions(&self) -> super::builder::backend_services::TestIamPermissions {
856 super::builder::backend_services::TestIamPermissions::new(self.inner.clone())
857 }
858
859 /// Updates the specified BackendService resource with the data included in the
860 /// request. For more information, seeBackend
861 /// services overview.
862 pub fn update(&self) -> super::builder::backend_services::Update {
863 super::builder::backend_services::Update::new(self.inner.clone())
864 }
865
866 /// Retrieves the specified Operations resource.
867 pub fn get_operation(&self) -> super::builder::backend_services::GetOperation {
868 super::builder::backend_services::GetOperation::new(self.inner.clone())
869 }
870}
871
872/// Implements a client for the Google Compute Engine API.
873///
874/// # Example
875/// ```
876/// # tokio_test::block_on(async {
877/// # use google_cloud_compute_v1::client::CrossSiteNetworks;
878/// let client = CrossSiteNetworks::builder().build().await?;
879/// // use `client` to make requests to the Google Compute Engine API.
880/// # gax::client_builder::Result::<()>::Ok(()) });
881/// ```
882///
883/// # Service Description
884///
885/// Service for the `crossSiteNetworks` resource.
886///
887/// # Configuration
888///
889/// To configure `CrossSiteNetworks` use the `with_*` methods in the type returned
890/// by [builder()][CrossSiteNetworks::builder]. The default configuration should
891/// work for most applications. Common configuration changes include
892///
893/// * [with_endpoint()]: by default this client uses the global default endpoint
894/// (`https://compute.googleapis.com`). Applications using regional
895/// endpoints or running in restricted networks (e.g. a network configured
896// with [Private Google Access with VPC Service Controls]) may want to
897/// override this default.
898/// * [with_credentials()]: by default this client uses
899/// [Application Default Credentials]. Applications using custom
900/// authentication may need to override this default.
901///
902/// [with_endpoint()]: super::builder::cross_site_networks::ClientBuilder::with_endpoint
903/// [with_credentials()]: super::builder::cross_site_networks::ClientBuilder::credentials
904/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
905/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
906///
907/// # Pooling and Cloning
908///
909/// `CrossSiteNetworks` holds a connection pool internally, it is advised to
910/// create one and the reuse it. You do not need to wrap `CrossSiteNetworks` in
911/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
912/// already uses an `Arc` internally.
913#[cfg(feature = "cross-site-networks")]
914#[cfg_attr(docsrs, doc(cfg(feature = "cross-site-networks")))]
915#[derive(Clone, Debug)]
916pub struct CrossSiteNetworks {
917 inner: std::sync::Arc<dyn super::stub::dynamic::CrossSiteNetworks>,
918}
919
920#[cfg(feature = "cross-site-networks")]
921impl CrossSiteNetworks {
922 /// Returns a builder for [CrossSiteNetworks].
923 ///
924 /// ```
925 /// # tokio_test::block_on(async {
926 /// # use google_cloud_compute_v1::client::CrossSiteNetworks;
927 /// let client = CrossSiteNetworks::builder().build().await?;
928 /// # gax::client_builder::Result::<()>::Ok(()) });
929 /// ```
930 pub fn builder() -> super::builder::cross_site_networks::ClientBuilder {
931 gax::client_builder::internal::new_builder(
932 super::builder::cross_site_networks::client::Factory,
933 )
934 }
935
936 /// Creates a new client from the provided stub.
937 ///
938 /// The most common case for calling this function is in tests mocking the
939 /// client's behavior.
940 pub fn from_stub<T>(stub: T) -> Self
941 where
942 T: super::stub::CrossSiteNetworks + 'static,
943 {
944 Self {
945 inner: std::sync::Arc::new(stub),
946 }
947 }
948
949 pub(crate) async fn new(
950 config: gaxi::options::ClientConfig,
951 ) -> gax::client_builder::Result<Self> {
952 let inner = Self::build_inner(config).await?;
953 Ok(Self { inner })
954 }
955
956 async fn build_inner(
957 conf: gaxi::options::ClientConfig,
958 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::CrossSiteNetworks>>
959 {
960 if gaxi::options::tracing_enabled(&conf) {
961 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
962 }
963 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
964 }
965
966 async fn build_transport(
967 conf: gaxi::options::ClientConfig,
968 ) -> gax::client_builder::Result<impl super::stub::CrossSiteNetworks> {
969 super::transport::CrossSiteNetworks::new(conf).await
970 }
971
972 async fn build_with_tracing(
973 conf: gaxi::options::ClientConfig,
974 ) -> gax::client_builder::Result<impl super::stub::CrossSiteNetworks> {
975 Self::build_transport(conf)
976 .await
977 .map(super::tracing::CrossSiteNetworks::new)
978 }
979
980 /// Deletes the specified cross-site network in the given scope.
981 pub fn delete(&self) -> super::builder::cross_site_networks::Delete {
982 super::builder::cross_site_networks::Delete::new(self.inner.clone())
983 }
984
985 /// Returns the specified cross-site network in the given scope.
986 pub fn get(&self) -> super::builder::cross_site_networks::Get {
987 super::builder::cross_site_networks::Get::new(self.inner.clone())
988 }
989
990 /// Creates a cross-site network in the specified project in the given scope
991 /// using the parameters that are included in the request.
992 pub fn insert(&self) -> super::builder::cross_site_networks::Insert {
993 super::builder::cross_site_networks::Insert::new(self.inner.clone())
994 }
995
996 /// Lists the cross-site networks for a project in the given scope.
997 pub fn list(&self) -> super::builder::cross_site_networks::List {
998 super::builder::cross_site_networks::List::new(self.inner.clone())
999 }
1000
1001 /// Updates the specified cross-site network with the data included in
1002 /// the request. This method supportsPATCH
1003 /// semantics and uses theJSON merge
1004 /// patch format and processing rules.
1005 pub fn patch(&self) -> super::builder::cross_site_networks::Patch {
1006 super::builder::cross_site_networks::Patch::new(self.inner.clone())
1007 }
1008
1009 /// Retrieves the specified Operations resource.
1010 pub fn get_operation(&self) -> super::builder::cross_site_networks::GetOperation {
1011 super::builder::cross_site_networks::GetOperation::new(self.inner.clone())
1012 }
1013}
1014
1015/// Implements a client for the Google Compute Engine API.
1016///
1017/// # Example
1018/// ```
1019/// # tokio_test::block_on(async {
1020/// # use google_cloud_compute_v1::client::DiskTypes;
1021/// let client = DiskTypes::builder().build().await?;
1022/// // use `client` to make requests to the Google Compute Engine API.
1023/// # gax::client_builder::Result::<()>::Ok(()) });
1024/// ```
1025///
1026/// # Service Description
1027///
1028/// Service for the `diskTypes` resource.
1029///
1030/// # Configuration
1031///
1032/// To configure `DiskTypes` use the `with_*` methods in the type returned
1033/// by [builder()][DiskTypes::builder]. The default configuration should
1034/// work for most applications. Common configuration changes include
1035///
1036/// * [with_endpoint()]: by default this client uses the global default endpoint
1037/// (`https://compute.googleapis.com`). Applications using regional
1038/// endpoints or running in restricted networks (e.g. a network configured
1039// with [Private Google Access with VPC Service Controls]) may want to
1040/// override this default.
1041/// * [with_credentials()]: by default this client uses
1042/// [Application Default Credentials]. Applications using custom
1043/// authentication may need to override this default.
1044///
1045/// [with_endpoint()]: super::builder::disk_types::ClientBuilder::with_endpoint
1046/// [with_credentials()]: super::builder::disk_types::ClientBuilder::credentials
1047/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1048/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1049///
1050/// # Pooling and Cloning
1051///
1052/// `DiskTypes` holds a connection pool internally, it is advised to
1053/// create one and the reuse it. You do not need to wrap `DiskTypes` in
1054/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1055/// already uses an `Arc` internally.
1056#[cfg(feature = "disk-types")]
1057#[cfg_attr(docsrs, doc(cfg(feature = "disk-types")))]
1058#[derive(Clone, Debug)]
1059pub struct DiskTypes {
1060 inner: std::sync::Arc<dyn super::stub::dynamic::DiskTypes>,
1061}
1062
1063#[cfg(feature = "disk-types")]
1064impl DiskTypes {
1065 /// Returns a builder for [DiskTypes].
1066 ///
1067 /// ```
1068 /// # tokio_test::block_on(async {
1069 /// # use google_cloud_compute_v1::client::DiskTypes;
1070 /// let client = DiskTypes::builder().build().await?;
1071 /// # gax::client_builder::Result::<()>::Ok(()) });
1072 /// ```
1073 pub fn builder() -> super::builder::disk_types::ClientBuilder {
1074 gax::client_builder::internal::new_builder(super::builder::disk_types::client::Factory)
1075 }
1076
1077 /// Creates a new client from the provided stub.
1078 ///
1079 /// The most common case for calling this function is in tests mocking the
1080 /// client's behavior.
1081 pub fn from_stub<T>(stub: T) -> Self
1082 where
1083 T: super::stub::DiskTypes + 'static,
1084 {
1085 Self {
1086 inner: std::sync::Arc::new(stub),
1087 }
1088 }
1089
1090 pub(crate) async fn new(
1091 config: gaxi::options::ClientConfig,
1092 ) -> gax::client_builder::Result<Self> {
1093 let inner = Self::build_inner(config).await?;
1094 Ok(Self { inner })
1095 }
1096
1097 async fn build_inner(
1098 conf: gaxi::options::ClientConfig,
1099 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::DiskTypes>> {
1100 if gaxi::options::tracing_enabled(&conf) {
1101 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1102 }
1103 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1104 }
1105
1106 async fn build_transport(
1107 conf: gaxi::options::ClientConfig,
1108 ) -> gax::client_builder::Result<impl super::stub::DiskTypes> {
1109 super::transport::DiskTypes::new(conf).await
1110 }
1111
1112 async fn build_with_tracing(
1113 conf: gaxi::options::ClientConfig,
1114 ) -> gax::client_builder::Result<impl super::stub::DiskTypes> {
1115 Self::build_transport(conf)
1116 .await
1117 .map(super::tracing::DiskTypes::new)
1118 }
1119
1120 /// Retrieves an aggregated list of disk types.
1121 ///
1122 /// To prevent failure, it is recommended that you set the
1123 /// `returnPartialSuccess` parameter to `true`.
1124 pub fn aggregated_list(&self) -> super::builder::disk_types::AggregatedList {
1125 super::builder::disk_types::AggregatedList::new(self.inner.clone())
1126 }
1127
1128 /// Returns the specified disk type.
1129 pub fn get(&self) -> super::builder::disk_types::Get {
1130 super::builder::disk_types::Get::new(self.inner.clone())
1131 }
1132
1133 /// Retrieves a list of disk types available to the specified
1134 /// project.
1135 pub fn list(&self) -> super::builder::disk_types::List {
1136 super::builder::disk_types::List::new(self.inner.clone())
1137 }
1138}
1139
1140/// Implements a client for the Google Compute Engine API.
1141///
1142/// # Example
1143/// ```
1144/// # tokio_test::block_on(async {
1145/// # use google_cloud_compute_v1::client::Disks;
1146/// let client = Disks::builder().build().await?;
1147/// // use `client` to make requests to the Google Compute Engine API.
1148/// # gax::client_builder::Result::<()>::Ok(()) });
1149/// ```
1150///
1151/// # Service Description
1152///
1153/// Service for the `disks` resource.
1154///
1155/// # Configuration
1156///
1157/// To configure `Disks` use the `with_*` methods in the type returned
1158/// by [builder()][Disks::builder]. The default configuration should
1159/// work for most applications. Common configuration changes include
1160///
1161/// * [with_endpoint()]: by default this client uses the global default endpoint
1162/// (`https://compute.googleapis.com`). Applications using regional
1163/// endpoints or running in restricted networks (e.g. a network configured
1164// with [Private Google Access with VPC Service Controls]) may want to
1165/// override this default.
1166/// * [with_credentials()]: by default this client uses
1167/// [Application Default Credentials]. Applications using custom
1168/// authentication may need to override this default.
1169///
1170/// [with_endpoint()]: super::builder::disks::ClientBuilder::with_endpoint
1171/// [with_credentials()]: super::builder::disks::ClientBuilder::credentials
1172/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1173/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1174///
1175/// # Pooling and Cloning
1176///
1177/// `Disks` holds a connection pool internally, it is advised to
1178/// create one and the reuse it. You do not need to wrap `Disks` in
1179/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1180/// already uses an `Arc` internally.
1181#[cfg(feature = "disks")]
1182#[cfg_attr(docsrs, doc(cfg(feature = "disks")))]
1183#[derive(Clone, Debug)]
1184pub struct Disks {
1185 inner: std::sync::Arc<dyn super::stub::dynamic::Disks>,
1186}
1187
1188#[cfg(feature = "disks")]
1189impl Disks {
1190 /// Returns a builder for [Disks].
1191 ///
1192 /// ```
1193 /// # tokio_test::block_on(async {
1194 /// # use google_cloud_compute_v1::client::Disks;
1195 /// let client = Disks::builder().build().await?;
1196 /// # gax::client_builder::Result::<()>::Ok(()) });
1197 /// ```
1198 pub fn builder() -> super::builder::disks::ClientBuilder {
1199 gax::client_builder::internal::new_builder(super::builder::disks::client::Factory)
1200 }
1201
1202 /// Creates a new client from the provided stub.
1203 ///
1204 /// The most common case for calling this function is in tests mocking the
1205 /// client's behavior.
1206 pub fn from_stub<T>(stub: T) -> Self
1207 where
1208 T: super::stub::Disks + 'static,
1209 {
1210 Self {
1211 inner: std::sync::Arc::new(stub),
1212 }
1213 }
1214
1215 pub(crate) async fn new(
1216 config: gaxi::options::ClientConfig,
1217 ) -> gax::client_builder::Result<Self> {
1218 let inner = Self::build_inner(config).await?;
1219 Ok(Self { inner })
1220 }
1221
1222 async fn build_inner(
1223 conf: gaxi::options::ClientConfig,
1224 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Disks>> {
1225 if gaxi::options::tracing_enabled(&conf) {
1226 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1227 }
1228 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1229 }
1230
1231 async fn build_transport(
1232 conf: gaxi::options::ClientConfig,
1233 ) -> gax::client_builder::Result<impl super::stub::Disks> {
1234 super::transport::Disks::new(conf).await
1235 }
1236
1237 async fn build_with_tracing(
1238 conf: gaxi::options::ClientConfig,
1239 ) -> gax::client_builder::Result<impl super::stub::Disks> {
1240 Self::build_transport(conf)
1241 .await
1242 .map(super::tracing::Disks::new)
1243 }
1244
1245 /// Adds existing resource policies to a disk. You can only add one
1246 /// policy which will be applied to this disk for scheduling snapshot
1247 /// creation.
1248 pub fn add_resource_policies(&self) -> super::builder::disks::AddResourcePolicies {
1249 super::builder::disks::AddResourcePolicies::new(self.inner.clone())
1250 }
1251
1252 /// Retrieves an aggregated list of persistent disks.
1253 ///
1254 /// To prevent failure, it is recommended that you set the
1255 /// `returnPartialSuccess` parameter to `true`.
1256 pub fn aggregated_list(&self) -> super::builder::disks::AggregatedList {
1257 super::builder::disks::AggregatedList::new(self.inner.clone())
1258 }
1259
1260 /// Bulk create a set of disks.
1261 pub fn bulk_insert(&self) -> super::builder::disks::BulkInsert {
1262 super::builder::disks::BulkInsert::new(self.inner.clone())
1263 }
1264
1265 /// Sets the labels on many disks at once. To learn more about labels, read theLabeling
1266 /// Resources documentation.
1267 pub fn bulk_set_labels(&self) -> super::builder::disks::BulkSetLabels {
1268 super::builder::disks::BulkSetLabels::new(self.inner.clone())
1269 }
1270
1271 /// Creates a snapshot of a specified persistent disk. For regular snapshot
1272 /// creation, consider using snapshots.insert
1273 /// instead, as that method supports more features, such as creating snapshots
1274 /// in a project different from the source disk project.
1275 pub fn create_snapshot(&self) -> super::builder::disks::CreateSnapshot {
1276 super::builder::disks::CreateSnapshot::new(self.inner.clone())
1277 }
1278
1279 /// Deletes the specified persistent disk. Deleting a disk removes its data
1280 /// permanently and is irreversible. However, deleting a disk does not
1281 /// delete any snapshots
1282 /// previously made from the disk. You must separatelydelete
1283 /// snapshots.
1284 pub fn delete(&self) -> super::builder::disks::Delete {
1285 super::builder::disks::Delete::new(self.inner.clone())
1286 }
1287
1288 /// Returns the specified persistent disk.
1289 pub fn get(&self) -> super::builder::disks::Get {
1290 super::builder::disks::Get::new(self.inner.clone())
1291 }
1292
1293 /// Gets the access control policy for a resource. May be empty if no such
1294 /// policy or resource exists.
1295 pub fn get_iam_policy(&self) -> super::builder::disks::GetIamPolicy {
1296 super::builder::disks::GetIamPolicy::new(self.inner.clone())
1297 }
1298
1299 /// Creates a persistent disk in the specified project using the data
1300 /// in the request. You can create a disk from a source
1301 /// (sourceImage, sourceSnapshot, orsourceDisk) or create an empty 500 GB data disk by
1302 /// omitting all properties. You can also create a disk that is larger than
1303 /// the default size by specifying the sizeGb property.
1304 pub fn insert(&self) -> super::builder::disks::Insert {
1305 super::builder::disks::Insert::new(self.inner.clone())
1306 }
1307
1308 /// Retrieves a list of persistent disks contained within
1309 /// the specified zone.
1310 pub fn list(&self) -> super::builder::disks::List {
1311 super::builder::disks::List::new(self.inner.clone())
1312 }
1313
1314 /// Removes resource policies from a disk.
1315 pub fn remove_resource_policies(&self) -> super::builder::disks::RemoveResourcePolicies {
1316 super::builder::disks::RemoveResourcePolicies::new(self.inner.clone())
1317 }
1318
1319 /// Resizes the specified persistent disk.
1320 /// You can only increase the size of the disk.
1321 pub fn resize(&self) -> super::builder::disks::Resize {
1322 super::builder::disks::Resize::new(self.inner.clone())
1323 }
1324
1325 /// Sets the access control policy on the specified resource.
1326 /// Replaces any existing policy.
1327 pub fn set_iam_policy(&self) -> super::builder::disks::SetIamPolicy {
1328 super::builder::disks::SetIamPolicy::new(self.inner.clone())
1329 }
1330
1331 /// Sets the labels on a disk. To learn more about labels, read theLabeling
1332 /// Resources documentation.
1333 pub fn set_labels(&self) -> super::builder::disks::SetLabels {
1334 super::builder::disks::SetLabels::new(self.inner.clone())
1335 }
1336
1337 /// Starts asynchronous replication.
1338 /// Must be invoked on the primary disk.
1339 pub fn start_async_replication(&self) -> super::builder::disks::StartAsyncReplication {
1340 super::builder::disks::StartAsyncReplication::new(self.inner.clone())
1341 }
1342
1343 /// Stops asynchronous replication.
1344 /// Can be invoked either on the primary or on the secondary disk.
1345 pub fn stop_async_replication(&self) -> super::builder::disks::StopAsyncReplication {
1346 super::builder::disks::StopAsyncReplication::new(self.inner.clone())
1347 }
1348
1349 /// Stops asynchronous replication for a consistency group of disks.
1350 /// Can be invoked either in the primary or secondary scope.
1351 pub fn stop_group_async_replication(&self) -> super::builder::disks::StopGroupAsyncReplication {
1352 super::builder::disks::StopGroupAsyncReplication::new(self.inner.clone())
1353 }
1354
1355 /// Returns permissions that a caller has on the specified resource.
1356 pub fn test_iam_permissions(&self) -> super::builder::disks::TestIamPermissions {
1357 super::builder::disks::TestIamPermissions::new(self.inner.clone())
1358 }
1359
1360 /// Updates the specified disk with the data included in the request.
1361 /// The update is performed only on selected fields included as part
1362 /// of update-mask. Only the following fields can be modified: user_license.
1363 pub fn update(&self) -> super::builder::disks::Update {
1364 super::builder::disks::Update::new(self.inner.clone())
1365 }
1366
1367 /// Retrieves the specified zone-specific Operations resource.
1368 pub fn get_operation(&self) -> super::builder::disks::GetOperation {
1369 super::builder::disks::GetOperation::new(self.inner.clone())
1370 }
1371}
1372
1373/// Implements a client for the Google Compute Engine API.
1374///
1375/// # Example
1376/// ```
1377/// # tokio_test::block_on(async {
1378/// # use google_cloud_compute_v1::client::ExternalVpnGateways;
1379/// let client = ExternalVpnGateways::builder().build().await?;
1380/// // use `client` to make requests to the Google Compute Engine API.
1381/// # gax::client_builder::Result::<()>::Ok(()) });
1382/// ```
1383///
1384/// # Service Description
1385///
1386/// Service for the `externalVpnGateways` resource.
1387///
1388/// # Configuration
1389///
1390/// To configure `ExternalVpnGateways` use the `with_*` methods in the type returned
1391/// by [builder()][ExternalVpnGateways::builder]. The default configuration should
1392/// work for most applications. Common configuration changes include
1393///
1394/// * [with_endpoint()]: by default this client uses the global default endpoint
1395/// (`https://compute.googleapis.com`). Applications using regional
1396/// endpoints or running in restricted networks (e.g. a network configured
1397// with [Private Google Access with VPC Service Controls]) may want to
1398/// override this default.
1399/// * [with_credentials()]: by default this client uses
1400/// [Application Default Credentials]. Applications using custom
1401/// authentication may need to override this default.
1402///
1403/// [with_endpoint()]: super::builder::external_vpn_gateways::ClientBuilder::with_endpoint
1404/// [with_credentials()]: super::builder::external_vpn_gateways::ClientBuilder::credentials
1405/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1406/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1407///
1408/// # Pooling and Cloning
1409///
1410/// `ExternalVpnGateways` holds a connection pool internally, it is advised to
1411/// create one and the reuse it. You do not need to wrap `ExternalVpnGateways` in
1412/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1413/// already uses an `Arc` internally.
1414#[cfg(feature = "external-vpn-gateways")]
1415#[cfg_attr(docsrs, doc(cfg(feature = "external-vpn-gateways")))]
1416#[derive(Clone, Debug)]
1417pub struct ExternalVpnGateways {
1418 inner: std::sync::Arc<dyn super::stub::dynamic::ExternalVpnGateways>,
1419}
1420
1421#[cfg(feature = "external-vpn-gateways")]
1422impl ExternalVpnGateways {
1423 /// Returns a builder for [ExternalVpnGateways].
1424 ///
1425 /// ```
1426 /// # tokio_test::block_on(async {
1427 /// # use google_cloud_compute_v1::client::ExternalVpnGateways;
1428 /// let client = ExternalVpnGateways::builder().build().await?;
1429 /// # gax::client_builder::Result::<()>::Ok(()) });
1430 /// ```
1431 pub fn builder() -> super::builder::external_vpn_gateways::ClientBuilder {
1432 gax::client_builder::internal::new_builder(
1433 super::builder::external_vpn_gateways::client::Factory,
1434 )
1435 }
1436
1437 /// Creates a new client from the provided stub.
1438 ///
1439 /// The most common case for calling this function is in tests mocking the
1440 /// client's behavior.
1441 pub fn from_stub<T>(stub: T) -> Self
1442 where
1443 T: super::stub::ExternalVpnGateways + 'static,
1444 {
1445 Self {
1446 inner: std::sync::Arc::new(stub),
1447 }
1448 }
1449
1450 pub(crate) async fn new(
1451 config: gaxi::options::ClientConfig,
1452 ) -> gax::client_builder::Result<Self> {
1453 let inner = Self::build_inner(config).await?;
1454 Ok(Self { inner })
1455 }
1456
1457 async fn build_inner(
1458 conf: gaxi::options::ClientConfig,
1459 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::ExternalVpnGateways>>
1460 {
1461 if gaxi::options::tracing_enabled(&conf) {
1462 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1463 }
1464 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1465 }
1466
1467 async fn build_transport(
1468 conf: gaxi::options::ClientConfig,
1469 ) -> gax::client_builder::Result<impl super::stub::ExternalVpnGateways> {
1470 super::transport::ExternalVpnGateways::new(conf).await
1471 }
1472
1473 async fn build_with_tracing(
1474 conf: gaxi::options::ClientConfig,
1475 ) -> gax::client_builder::Result<impl super::stub::ExternalVpnGateways> {
1476 Self::build_transport(conf)
1477 .await
1478 .map(super::tracing::ExternalVpnGateways::new)
1479 }
1480
1481 /// Deletes the specified externalVpnGateway.
1482 pub fn delete(&self) -> super::builder::external_vpn_gateways::Delete {
1483 super::builder::external_vpn_gateways::Delete::new(self.inner.clone())
1484 }
1485
1486 /// Returns the specified externalVpnGateway. Get a list of available
1487 /// externalVpnGateways by making a list() request.
1488 pub fn get(&self) -> super::builder::external_vpn_gateways::Get {
1489 super::builder::external_vpn_gateways::Get::new(self.inner.clone())
1490 }
1491
1492 /// Creates a ExternalVpnGateway in the specified project using
1493 /// the data included in the request.
1494 pub fn insert(&self) -> super::builder::external_vpn_gateways::Insert {
1495 super::builder::external_vpn_gateways::Insert::new(self.inner.clone())
1496 }
1497
1498 /// Retrieves the list of ExternalVpnGateway available to the specified
1499 /// project.
1500 pub fn list(&self) -> super::builder::external_vpn_gateways::List {
1501 super::builder::external_vpn_gateways::List::new(self.inner.clone())
1502 }
1503
1504 /// Sets the labels on an ExternalVpnGateway. To learn more about labels,
1505 /// read the Labeling
1506 /// Resources documentation.
1507 pub fn set_labels(&self) -> super::builder::external_vpn_gateways::SetLabels {
1508 super::builder::external_vpn_gateways::SetLabels::new(self.inner.clone())
1509 }
1510
1511 /// Returns permissions that a caller has on the specified resource.
1512 pub fn test_iam_permissions(
1513 &self,
1514 ) -> super::builder::external_vpn_gateways::TestIamPermissions {
1515 super::builder::external_vpn_gateways::TestIamPermissions::new(self.inner.clone())
1516 }
1517
1518 /// Retrieves the specified Operations resource.
1519 pub fn get_operation(&self) -> super::builder::external_vpn_gateways::GetOperation {
1520 super::builder::external_vpn_gateways::GetOperation::new(self.inner.clone())
1521 }
1522}
1523
1524/// Implements a client for the Google Compute Engine API.
1525///
1526/// # Example
1527/// ```
1528/// # tokio_test::block_on(async {
1529/// # use google_cloud_compute_v1::client::FirewallPolicies;
1530/// let client = FirewallPolicies::builder().build().await?;
1531/// // use `client` to make requests to the Google Compute Engine API.
1532/// # gax::client_builder::Result::<()>::Ok(()) });
1533/// ```
1534///
1535/// # Service Description
1536///
1537/// Service for the `firewallPolicies` resource.
1538///
1539/// # Configuration
1540///
1541/// To configure `FirewallPolicies` use the `with_*` methods in the type returned
1542/// by [builder()][FirewallPolicies::builder]. The default configuration should
1543/// work for most applications. Common configuration changes include
1544///
1545/// * [with_endpoint()]: by default this client uses the global default endpoint
1546/// (`https://compute.googleapis.com`). Applications using regional
1547/// endpoints or running in restricted networks (e.g. a network configured
1548// with [Private Google Access with VPC Service Controls]) may want to
1549/// override this default.
1550/// * [with_credentials()]: by default this client uses
1551/// [Application Default Credentials]. Applications using custom
1552/// authentication may need to override this default.
1553///
1554/// [with_endpoint()]: super::builder::firewall_policies::ClientBuilder::with_endpoint
1555/// [with_credentials()]: super::builder::firewall_policies::ClientBuilder::credentials
1556/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1557/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1558///
1559/// # Pooling and Cloning
1560///
1561/// `FirewallPolicies` holds a connection pool internally, it is advised to
1562/// create one and the reuse it. You do not need to wrap `FirewallPolicies` in
1563/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1564/// already uses an `Arc` internally.
1565#[cfg(feature = "firewall-policies")]
1566#[cfg_attr(docsrs, doc(cfg(feature = "firewall-policies")))]
1567#[derive(Clone, Debug)]
1568pub struct FirewallPolicies {
1569 inner: std::sync::Arc<dyn super::stub::dynamic::FirewallPolicies>,
1570}
1571
1572#[cfg(feature = "firewall-policies")]
1573impl FirewallPolicies {
1574 /// Returns a builder for [FirewallPolicies].
1575 ///
1576 /// ```
1577 /// # tokio_test::block_on(async {
1578 /// # use google_cloud_compute_v1::client::FirewallPolicies;
1579 /// let client = FirewallPolicies::builder().build().await?;
1580 /// # gax::client_builder::Result::<()>::Ok(()) });
1581 /// ```
1582 pub fn builder() -> super::builder::firewall_policies::ClientBuilder {
1583 gax::client_builder::internal::new_builder(
1584 super::builder::firewall_policies::client::Factory,
1585 )
1586 }
1587
1588 /// Creates a new client from the provided stub.
1589 ///
1590 /// The most common case for calling this function is in tests mocking the
1591 /// client's behavior.
1592 pub fn from_stub<T>(stub: T) -> Self
1593 where
1594 T: super::stub::FirewallPolicies + 'static,
1595 {
1596 Self {
1597 inner: std::sync::Arc::new(stub),
1598 }
1599 }
1600
1601 pub(crate) async fn new(
1602 config: gaxi::options::ClientConfig,
1603 ) -> gax::client_builder::Result<Self> {
1604 let inner = Self::build_inner(config).await?;
1605 Ok(Self { inner })
1606 }
1607
1608 async fn build_inner(
1609 conf: gaxi::options::ClientConfig,
1610 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::FirewallPolicies>>
1611 {
1612 if gaxi::options::tracing_enabled(&conf) {
1613 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1614 }
1615 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1616 }
1617
1618 async fn build_transport(
1619 conf: gaxi::options::ClientConfig,
1620 ) -> gax::client_builder::Result<impl super::stub::FirewallPolicies> {
1621 super::transport::FirewallPolicies::new(conf).await
1622 }
1623
1624 async fn build_with_tracing(
1625 conf: gaxi::options::ClientConfig,
1626 ) -> gax::client_builder::Result<impl super::stub::FirewallPolicies> {
1627 Self::build_transport(conf)
1628 .await
1629 .map(super::tracing::FirewallPolicies::new)
1630 }
1631
1632 /// Inserts an association for the specified firewall policy.
1633 pub fn add_association(&self) -> super::builder::firewall_policies::AddAssociation {
1634 super::builder::firewall_policies::AddAssociation::new(self.inner.clone())
1635 }
1636
1637 /// Inserts a rule into a firewall policy.
1638 pub fn add_rule(&self) -> super::builder::firewall_policies::AddRule {
1639 super::builder::firewall_policies::AddRule::new(self.inner.clone())
1640 }
1641
1642 /// Copies rules to the specified firewall policy.
1643 pub fn clone_rules(&self) -> super::builder::firewall_policies::CloneRules {
1644 super::builder::firewall_policies::CloneRules::new(self.inner.clone())
1645 }
1646
1647 /// Deletes the specified policy.
1648 pub fn delete(&self) -> super::builder::firewall_policies::Delete {
1649 super::builder::firewall_policies::Delete::new(self.inner.clone())
1650 }
1651
1652 /// Returns the specified firewall policy.
1653 pub fn get(&self) -> super::builder::firewall_policies::Get {
1654 super::builder::firewall_policies::Get::new(self.inner.clone())
1655 }
1656
1657 /// Gets an association with the specified name.
1658 pub fn get_association(&self) -> super::builder::firewall_policies::GetAssociation {
1659 super::builder::firewall_policies::GetAssociation::new(self.inner.clone())
1660 }
1661
1662 /// Gets the access control policy for a resource. May be empty if no such
1663 /// policy or resource exists.
1664 pub fn get_iam_policy(&self) -> super::builder::firewall_policies::GetIamPolicy {
1665 super::builder::firewall_policies::GetIamPolicy::new(self.inner.clone())
1666 }
1667
1668 /// Gets a rule of the specified priority.
1669 pub fn get_rule(&self) -> super::builder::firewall_policies::GetRule {
1670 super::builder::firewall_policies::GetRule::new(self.inner.clone())
1671 }
1672
1673 /// Creates a new policy in the specified project using the data included in
1674 /// the request.
1675 pub fn insert(&self) -> super::builder::firewall_policies::Insert {
1676 super::builder::firewall_policies::Insert::new(self.inner.clone())
1677 }
1678
1679 /// Lists all the policies that have been configured for the specified
1680 /// folder or organization.
1681 pub fn list(&self) -> super::builder::firewall_policies::List {
1682 super::builder::firewall_policies::List::new(self.inner.clone())
1683 }
1684
1685 /// Lists associations of a specified target, i.e., organization or folder.
1686 pub fn list_associations(&self) -> super::builder::firewall_policies::ListAssociations {
1687 super::builder::firewall_policies::ListAssociations::new(self.inner.clone())
1688 }
1689
1690 /// Moves the specified firewall policy.
1691 pub fn r#move(&self) -> super::builder::firewall_policies::Move {
1692 super::builder::firewall_policies::Move::new(self.inner.clone())
1693 }
1694
1695 /// Patches the specified policy with the data included in the request.
1696 pub fn patch(&self) -> super::builder::firewall_policies::Patch {
1697 super::builder::firewall_policies::Patch::new(self.inner.clone())
1698 }
1699
1700 /// Patches a rule of the specified priority.
1701 pub fn patch_rule(&self) -> super::builder::firewall_policies::PatchRule {
1702 super::builder::firewall_policies::PatchRule::new(self.inner.clone())
1703 }
1704
1705 /// Removes an association for the specified firewall policy.
1706 pub fn remove_association(&self) -> super::builder::firewall_policies::RemoveAssociation {
1707 super::builder::firewall_policies::RemoveAssociation::new(self.inner.clone())
1708 }
1709
1710 /// Deletes a rule of the specified priority.
1711 pub fn remove_rule(&self) -> super::builder::firewall_policies::RemoveRule {
1712 super::builder::firewall_policies::RemoveRule::new(self.inner.clone())
1713 }
1714
1715 /// Sets the access control policy on the specified resource.
1716 /// Replaces any existing policy.
1717 pub fn set_iam_policy(&self) -> super::builder::firewall_policies::SetIamPolicy {
1718 super::builder::firewall_policies::SetIamPolicy::new(self.inner.clone())
1719 }
1720
1721 /// Returns permissions that a caller has on the specified resource.
1722 pub fn test_iam_permissions(&self) -> super::builder::firewall_policies::TestIamPermissions {
1723 super::builder::firewall_policies::TestIamPermissions::new(self.inner.clone())
1724 }
1725
1726 /// Retrieves the specified Operations resource. Gets a list of operations
1727 /// by making a `list()` request.
1728 pub fn get_operation(&self) -> super::builder::firewall_policies::GetOperation {
1729 super::builder::firewall_policies::GetOperation::new(self.inner.clone())
1730 }
1731}
1732
1733/// Implements a client for the Google Compute Engine API.
1734///
1735/// # Example
1736/// ```
1737/// # tokio_test::block_on(async {
1738/// # use google_cloud_compute_v1::client::Firewalls;
1739/// let client = Firewalls::builder().build().await?;
1740/// // use `client` to make requests to the Google Compute Engine API.
1741/// # gax::client_builder::Result::<()>::Ok(()) });
1742/// ```
1743///
1744/// # Service Description
1745///
1746/// Service for the `firewalls` resource.
1747///
1748/// # Configuration
1749///
1750/// To configure `Firewalls` use the `with_*` methods in the type returned
1751/// by [builder()][Firewalls::builder]. The default configuration should
1752/// work for most applications. Common configuration changes include
1753///
1754/// * [with_endpoint()]: by default this client uses the global default endpoint
1755/// (`https://compute.googleapis.com`). Applications using regional
1756/// endpoints or running in restricted networks (e.g. a network configured
1757// with [Private Google Access with VPC Service Controls]) may want to
1758/// override this default.
1759/// * [with_credentials()]: by default this client uses
1760/// [Application Default Credentials]. Applications using custom
1761/// authentication may need to override this default.
1762///
1763/// [with_endpoint()]: super::builder::firewalls::ClientBuilder::with_endpoint
1764/// [with_credentials()]: super::builder::firewalls::ClientBuilder::credentials
1765/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1766/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1767///
1768/// # Pooling and Cloning
1769///
1770/// `Firewalls` holds a connection pool internally, it is advised to
1771/// create one and the reuse it. You do not need to wrap `Firewalls` in
1772/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1773/// already uses an `Arc` internally.
1774#[cfg(feature = "firewalls")]
1775#[cfg_attr(docsrs, doc(cfg(feature = "firewalls")))]
1776#[derive(Clone, Debug)]
1777pub struct Firewalls {
1778 inner: std::sync::Arc<dyn super::stub::dynamic::Firewalls>,
1779}
1780
1781#[cfg(feature = "firewalls")]
1782impl Firewalls {
1783 /// Returns a builder for [Firewalls].
1784 ///
1785 /// ```
1786 /// # tokio_test::block_on(async {
1787 /// # use google_cloud_compute_v1::client::Firewalls;
1788 /// let client = Firewalls::builder().build().await?;
1789 /// # gax::client_builder::Result::<()>::Ok(()) });
1790 /// ```
1791 pub fn builder() -> super::builder::firewalls::ClientBuilder {
1792 gax::client_builder::internal::new_builder(super::builder::firewalls::client::Factory)
1793 }
1794
1795 /// Creates a new client from the provided stub.
1796 ///
1797 /// The most common case for calling this function is in tests mocking the
1798 /// client's behavior.
1799 pub fn from_stub<T>(stub: T) -> Self
1800 where
1801 T: super::stub::Firewalls + 'static,
1802 {
1803 Self {
1804 inner: std::sync::Arc::new(stub),
1805 }
1806 }
1807
1808 pub(crate) async fn new(
1809 config: gaxi::options::ClientConfig,
1810 ) -> gax::client_builder::Result<Self> {
1811 let inner = Self::build_inner(config).await?;
1812 Ok(Self { inner })
1813 }
1814
1815 async fn build_inner(
1816 conf: gaxi::options::ClientConfig,
1817 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Firewalls>> {
1818 if gaxi::options::tracing_enabled(&conf) {
1819 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1820 }
1821 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1822 }
1823
1824 async fn build_transport(
1825 conf: gaxi::options::ClientConfig,
1826 ) -> gax::client_builder::Result<impl super::stub::Firewalls> {
1827 super::transport::Firewalls::new(conf).await
1828 }
1829
1830 async fn build_with_tracing(
1831 conf: gaxi::options::ClientConfig,
1832 ) -> gax::client_builder::Result<impl super::stub::Firewalls> {
1833 Self::build_transport(conf)
1834 .await
1835 .map(super::tracing::Firewalls::new)
1836 }
1837
1838 /// Deletes the specified firewall.
1839 pub fn delete(&self) -> super::builder::firewalls::Delete {
1840 super::builder::firewalls::Delete::new(self.inner.clone())
1841 }
1842
1843 /// Returns the specified firewall.
1844 pub fn get(&self) -> super::builder::firewalls::Get {
1845 super::builder::firewalls::Get::new(self.inner.clone())
1846 }
1847
1848 /// Creates a firewall rule in the specified project using the data
1849 /// included in the request.
1850 pub fn insert(&self) -> super::builder::firewalls::Insert {
1851 super::builder::firewalls::Insert::new(self.inner.clone())
1852 }
1853
1854 /// Retrieves the list of firewall rules available to the specified
1855 /// project.
1856 pub fn list(&self) -> super::builder::firewalls::List {
1857 super::builder::firewalls::List::new(self.inner.clone())
1858 }
1859
1860 /// Updates the specified firewall rule with the data included in the
1861 /// request. This method supportsPATCH
1862 /// semantics and uses theJSON merge
1863 /// patch format and processing rules.
1864 pub fn patch(&self) -> super::builder::firewalls::Patch {
1865 super::builder::firewalls::Patch::new(self.inner.clone())
1866 }
1867
1868 /// Returns permissions that a caller has on the specified resource.
1869 pub fn test_iam_permissions(&self) -> super::builder::firewalls::TestIamPermissions {
1870 super::builder::firewalls::TestIamPermissions::new(self.inner.clone())
1871 }
1872
1873 /// Updates the specified firewall rule with the data included in the
1874 /// request.
1875 /// Note that all fields will be updated if using PUT, even fields that are not
1876 /// specified. To update individual fields, please use PATCH instead.
1877 pub fn update(&self) -> super::builder::firewalls::Update {
1878 super::builder::firewalls::Update::new(self.inner.clone())
1879 }
1880
1881 /// Retrieves the specified Operations resource.
1882 pub fn get_operation(&self) -> super::builder::firewalls::GetOperation {
1883 super::builder::firewalls::GetOperation::new(self.inner.clone())
1884 }
1885}
1886
1887/// Implements a client for the Google Compute Engine API.
1888///
1889/// # Example
1890/// ```
1891/// # tokio_test::block_on(async {
1892/// # use google_cloud_compute_v1::client::ForwardingRules;
1893/// let client = ForwardingRules::builder().build().await?;
1894/// // use `client` to make requests to the Google Compute Engine API.
1895/// # gax::client_builder::Result::<()>::Ok(()) });
1896/// ```
1897///
1898/// # Service Description
1899///
1900/// Service for the `forwardingRules` resource.
1901///
1902/// # Configuration
1903///
1904/// To configure `ForwardingRules` use the `with_*` methods in the type returned
1905/// by [builder()][ForwardingRules::builder]. The default configuration should
1906/// work for most applications. Common configuration changes include
1907///
1908/// * [with_endpoint()]: by default this client uses the global default endpoint
1909/// (`https://compute.googleapis.com`). Applications using regional
1910/// endpoints or running in restricted networks (e.g. a network configured
1911// with [Private Google Access with VPC Service Controls]) may want to
1912/// override this default.
1913/// * [with_credentials()]: by default this client uses
1914/// [Application Default Credentials]. Applications using custom
1915/// authentication may need to override this default.
1916///
1917/// [with_endpoint()]: super::builder::forwarding_rules::ClientBuilder::with_endpoint
1918/// [with_credentials()]: super::builder::forwarding_rules::ClientBuilder::credentials
1919/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1920/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1921///
1922/// # Pooling and Cloning
1923///
1924/// `ForwardingRules` holds a connection pool internally, it is advised to
1925/// create one and the reuse it. You do not need to wrap `ForwardingRules` in
1926/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1927/// already uses an `Arc` internally.
1928#[cfg(feature = "forwarding-rules")]
1929#[cfg_attr(docsrs, doc(cfg(feature = "forwarding-rules")))]
1930#[derive(Clone, Debug)]
1931pub struct ForwardingRules {
1932 inner: std::sync::Arc<dyn super::stub::dynamic::ForwardingRules>,
1933}
1934
1935#[cfg(feature = "forwarding-rules")]
1936impl ForwardingRules {
1937 /// Returns a builder for [ForwardingRules].
1938 ///
1939 /// ```
1940 /// # tokio_test::block_on(async {
1941 /// # use google_cloud_compute_v1::client::ForwardingRules;
1942 /// let client = ForwardingRules::builder().build().await?;
1943 /// # gax::client_builder::Result::<()>::Ok(()) });
1944 /// ```
1945 pub fn builder() -> super::builder::forwarding_rules::ClientBuilder {
1946 gax::client_builder::internal::new_builder(
1947 super::builder::forwarding_rules::client::Factory,
1948 )
1949 }
1950
1951 /// Creates a new client from the provided stub.
1952 ///
1953 /// The most common case for calling this function is in tests mocking the
1954 /// client's behavior.
1955 pub fn from_stub<T>(stub: T) -> Self
1956 where
1957 T: super::stub::ForwardingRules + 'static,
1958 {
1959 Self {
1960 inner: std::sync::Arc::new(stub),
1961 }
1962 }
1963
1964 pub(crate) async fn new(
1965 config: gaxi::options::ClientConfig,
1966 ) -> gax::client_builder::Result<Self> {
1967 let inner = Self::build_inner(config).await?;
1968 Ok(Self { inner })
1969 }
1970
1971 async fn build_inner(
1972 conf: gaxi::options::ClientConfig,
1973 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::ForwardingRules>>
1974 {
1975 if gaxi::options::tracing_enabled(&conf) {
1976 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1977 }
1978 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1979 }
1980
1981 async fn build_transport(
1982 conf: gaxi::options::ClientConfig,
1983 ) -> gax::client_builder::Result<impl super::stub::ForwardingRules> {
1984 super::transport::ForwardingRules::new(conf).await
1985 }
1986
1987 async fn build_with_tracing(
1988 conf: gaxi::options::ClientConfig,
1989 ) -> gax::client_builder::Result<impl super::stub::ForwardingRules> {
1990 Self::build_transport(conf)
1991 .await
1992 .map(super::tracing::ForwardingRules::new)
1993 }
1994
1995 /// Retrieves an aggregated list of forwarding rules.
1996 ///
1997 /// To prevent failure, it is recommended that you set the
1998 /// `returnPartialSuccess` parameter to `true`.
1999 pub fn aggregated_list(&self) -> super::builder::forwarding_rules::AggregatedList {
2000 super::builder::forwarding_rules::AggregatedList::new(self.inner.clone())
2001 }
2002
2003 /// Deletes the specified ForwardingRule resource.
2004 pub fn delete(&self) -> super::builder::forwarding_rules::Delete {
2005 super::builder::forwarding_rules::Delete::new(self.inner.clone())
2006 }
2007
2008 /// Returns the specified ForwardingRule resource.
2009 pub fn get(&self) -> super::builder::forwarding_rules::Get {
2010 super::builder::forwarding_rules::Get::new(self.inner.clone())
2011 }
2012
2013 /// Creates a ForwardingRule resource in the specified project and region using
2014 /// the data included in the request.
2015 pub fn insert(&self) -> super::builder::forwarding_rules::Insert {
2016 super::builder::forwarding_rules::Insert::new(self.inner.clone())
2017 }
2018
2019 /// Retrieves a list of ForwardingRule resources available to the specified
2020 /// project and region.
2021 pub fn list(&self) -> super::builder::forwarding_rules::List {
2022 super::builder::forwarding_rules::List::new(self.inner.clone())
2023 }
2024
2025 /// Updates the specified forwarding rule with the data included in the
2026 /// request. This method supportsPATCH
2027 /// semantics and uses theJSON merge
2028 /// patch format and processing rules. Currently, you can only
2029 /// patch the network_tier field.
2030 pub fn patch(&self) -> super::builder::forwarding_rules::Patch {
2031 super::builder::forwarding_rules::Patch::new(self.inner.clone())
2032 }
2033
2034 /// Sets the labels on the specified resource. To learn more about labels,
2035 /// read the
2036 /// Labeling Resources documentation.
2037 pub fn set_labels(&self) -> super::builder::forwarding_rules::SetLabels {
2038 super::builder::forwarding_rules::SetLabels::new(self.inner.clone())
2039 }
2040
2041 /// Changes target URL for forwarding rule. The new target should be of the
2042 /// same type as the old target.
2043 pub fn set_target(&self) -> super::builder::forwarding_rules::SetTarget {
2044 super::builder::forwarding_rules::SetTarget::new(self.inner.clone())
2045 }
2046
2047 /// Retrieves the specified region-specific Operations resource.
2048 pub fn get_operation(&self) -> super::builder::forwarding_rules::GetOperation {
2049 super::builder::forwarding_rules::GetOperation::new(self.inner.clone())
2050 }
2051}
2052
2053/// Implements a client for the Google Compute Engine API.
2054///
2055/// # Example
2056/// ```
2057/// # tokio_test::block_on(async {
2058/// # use google_cloud_compute_v1::client::FutureReservations;
2059/// let client = FutureReservations::builder().build().await?;
2060/// // use `client` to make requests to the Google Compute Engine API.
2061/// # gax::client_builder::Result::<()>::Ok(()) });
2062/// ```
2063///
2064/// # Service Description
2065///
2066/// Service for the `futureReservations` resource.
2067///
2068/// # Configuration
2069///
2070/// To configure `FutureReservations` use the `with_*` methods in the type returned
2071/// by [builder()][FutureReservations::builder]. The default configuration should
2072/// work for most applications. Common configuration changes include
2073///
2074/// * [with_endpoint()]: by default this client uses the global default endpoint
2075/// (`https://compute.googleapis.com`). Applications using regional
2076/// endpoints or running in restricted networks (e.g. a network configured
2077// with [Private Google Access with VPC Service Controls]) may want to
2078/// override this default.
2079/// * [with_credentials()]: by default this client uses
2080/// [Application Default Credentials]. Applications using custom
2081/// authentication may need to override this default.
2082///
2083/// [with_endpoint()]: super::builder::future_reservations::ClientBuilder::with_endpoint
2084/// [with_credentials()]: super::builder::future_reservations::ClientBuilder::credentials
2085/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2086/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2087///
2088/// # Pooling and Cloning
2089///
2090/// `FutureReservations` holds a connection pool internally, it is advised to
2091/// create one and the reuse it. You do not need to wrap `FutureReservations` in
2092/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2093/// already uses an `Arc` internally.
2094#[cfg(feature = "future-reservations")]
2095#[cfg_attr(docsrs, doc(cfg(feature = "future-reservations")))]
2096#[derive(Clone, Debug)]
2097pub struct FutureReservations {
2098 inner: std::sync::Arc<dyn super::stub::dynamic::FutureReservations>,
2099}
2100
2101#[cfg(feature = "future-reservations")]
2102impl FutureReservations {
2103 /// Returns a builder for [FutureReservations].
2104 ///
2105 /// ```
2106 /// # tokio_test::block_on(async {
2107 /// # use google_cloud_compute_v1::client::FutureReservations;
2108 /// let client = FutureReservations::builder().build().await?;
2109 /// # gax::client_builder::Result::<()>::Ok(()) });
2110 /// ```
2111 pub fn builder() -> super::builder::future_reservations::ClientBuilder {
2112 gax::client_builder::internal::new_builder(
2113 super::builder::future_reservations::client::Factory,
2114 )
2115 }
2116
2117 /// Creates a new client from the provided stub.
2118 ///
2119 /// The most common case for calling this function is in tests mocking the
2120 /// client's behavior.
2121 pub fn from_stub<T>(stub: T) -> Self
2122 where
2123 T: super::stub::FutureReservations + 'static,
2124 {
2125 Self {
2126 inner: std::sync::Arc::new(stub),
2127 }
2128 }
2129
2130 pub(crate) async fn new(
2131 config: gaxi::options::ClientConfig,
2132 ) -> gax::client_builder::Result<Self> {
2133 let inner = Self::build_inner(config).await?;
2134 Ok(Self { inner })
2135 }
2136
2137 async fn build_inner(
2138 conf: gaxi::options::ClientConfig,
2139 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::FutureReservations>>
2140 {
2141 if gaxi::options::tracing_enabled(&conf) {
2142 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2143 }
2144 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2145 }
2146
2147 async fn build_transport(
2148 conf: gaxi::options::ClientConfig,
2149 ) -> gax::client_builder::Result<impl super::stub::FutureReservations> {
2150 super::transport::FutureReservations::new(conf).await
2151 }
2152
2153 async fn build_with_tracing(
2154 conf: gaxi::options::ClientConfig,
2155 ) -> gax::client_builder::Result<impl super::stub::FutureReservations> {
2156 Self::build_transport(conf)
2157 .await
2158 .map(super::tracing::FutureReservations::new)
2159 }
2160
2161 /// Retrieves an aggregated list of future reservations.
2162 ///
2163 /// To prevent failure, it is recommended that you set the
2164 /// `returnPartialSuccess` parameter to `true`.
2165 pub fn aggregated_list(&self) -> super::builder::future_reservations::AggregatedList {
2166 super::builder::future_reservations::AggregatedList::new(self.inner.clone())
2167 }
2168
2169 /// Cancel the specified future reservation.
2170 pub fn cancel(&self) -> super::builder::future_reservations::Cancel {
2171 super::builder::future_reservations::Cancel::new(self.inner.clone())
2172 }
2173
2174 /// Deletes the specified future reservation.
2175 pub fn delete(&self) -> super::builder::future_reservations::Delete {
2176 super::builder::future_reservations::Delete::new(self.inner.clone())
2177 }
2178
2179 /// Retrieves information about the specified future reservation.
2180 pub fn get(&self) -> super::builder::future_reservations::Get {
2181 super::builder::future_reservations::Get::new(self.inner.clone())
2182 }
2183
2184 /// Creates a new Future Reservation.
2185 pub fn insert(&self) -> super::builder::future_reservations::Insert {
2186 super::builder::future_reservations::Insert::new(self.inner.clone())
2187 }
2188
2189 /// A list of all the future reservations that have been configured for the
2190 /// specified project in specified zone.
2191 pub fn list(&self) -> super::builder::future_reservations::List {
2192 super::builder::future_reservations::List::new(self.inner.clone())
2193 }
2194
2195 /// Updates the specified future reservation.
2196 pub fn update(&self) -> super::builder::future_reservations::Update {
2197 super::builder::future_reservations::Update::new(self.inner.clone())
2198 }
2199
2200 /// Retrieves the specified zone-specific Operations resource.
2201 pub fn get_operation(&self) -> super::builder::future_reservations::GetOperation {
2202 super::builder::future_reservations::GetOperation::new(self.inner.clone())
2203 }
2204}
2205
2206/// Implements a client for the Google Compute Engine API.
2207///
2208/// # Example
2209/// ```
2210/// # tokio_test::block_on(async {
2211/// # use google_cloud_compute_v1::client::GlobalAddresses;
2212/// let client = GlobalAddresses::builder().build().await?;
2213/// // use `client` to make requests to the Google Compute Engine API.
2214/// # gax::client_builder::Result::<()>::Ok(()) });
2215/// ```
2216///
2217/// # Service Description
2218///
2219/// Service for the `globalAddresses` resource.
2220///
2221/// # Configuration
2222///
2223/// To configure `GlobalAddresses` use the `with_*` methods in the type returned
2224/// by [builder()][GlobalAddresses::builder]. The default configuration should
2225/// work for most applications. Common configuration changes include
2226///
2227/// * [with_endpoint()]: by default this client uses the global default endpoint
2228/// (`https://compute.googleapis.com`). Applications using regional
2229/// endpoints or running in restricted networks (e.g. a network configured
2230// with [Private Google Access with VPC Service Controls]) may want to
2231/// override this default.
2232/// * [with_credentials()]: by default this client uses
2233/// [Application Default Credentials]. Applications using custom
2234/// authentication may need to override this default.
2235///
2236/// [with_endpoint()]: super::builder::global_addresses::ClientBuilder::with_endpoint
2237/// [with_credentials()]: super::builder::global_addresses::ClientBuilder::credentials
2238/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2239/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2240///
2241/// # Pooling and Cloning
2242///
2243/// `GlobalAddresses` holds a connection pool internally, it is advised to
2244/// create one and the reuse it. You do not need to wrap `GlobalAddresses` in
2245/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2246/// already uses an `Arc` internally.
2247#[cfg(feature = "global-addresses")]
2248#[cfg_attr(docsrs, doc(cfg(feature = "global-addresses")))]
2249#[derive(Clone, Debug)]
2250pub struct GlobalAddresses {
2251 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalAddresses>,
2252}
2253
2254#[cfg(feature = "global-addresses")]
2255impl GlobalAddresses {
2256 /// Returns a builder for [GlobalAddresses].
2257 ///
2258 /// ```
2259 /// # tokio_test::block_on(async {
2260 /// # use google_cloud_compute_v1::client::GlobalAddresses;
2261 /// let client = GlobalAddresses::builder().build().await?;
2262 /// # gax::client_builder::Result::<()>::Ok(()) });
2263 /// ```
2264 pub fn builder() -> super::builder::global_addresses::ClientBuilder {
2265 gax::client_builder::internal::new_builder(
2266 super::builder::global_addresses::client::Factory,
2267 )
2268 }
2269
2270 /// Creates a new client from the provided stub.
2271 ///
2272 /// The most common case for calling this function is in tests mocking the
2273 /// client's behavior.
2274 pub fn from_stub<T>(stub: T) -> Self
2275 where
2276 T: super::stub::GlobalAddresses + 'static,
2277 {
2278 Self {
2279 inner: std::sync::Arc::new(stub),
2280 }
2281 }
2282
2283 pub(crate) async fn new(
2284 config: gaxi::options::ClientConfig,
2285 ) -> gax::client_builder::Result<Self> {
2286 let inner = Self::build_inner(config).await?;
2287 Ok(Self { inner })
2288 }
2289
2290 async fn build_inner(
2291 conf: gaxi::options::ClientConfig,
2292 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::GlobalAddresses>>
2293 {
2294 if gaxi::options::tracing_enabled(&conf) {
2295 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2296 }
2297 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2298 }
2299
2300 async fn build_transport(
2301 conf: gaxi::options::ClientConfig,
2302 ) -> gax::client_builder::Result<impl super::stub::GlobalAddresses> {
2303 super::transport::GlobalAddresses::new(conf).await
2304 }
2305
2306 async fn build_with_tracing(
2307 conf: gaxi::options::ClientConfig,
2308 ) -> gax::client_builder::Result<impl super::stub::GlobalAddresses> {
2309 Self::build_transport(conf)
2310 .await
2311 .map(super::tracing::GlobalAddresses::new)
2312 }
2313
2314 /// Deletes the specified address resource.
2315 pub fn delete(&self) -> super::builder::global_addresses::Delete {
2316 super::builder::global_addresses::Delete::new(self.inner.clone())
2317 }
2318
2319 /// Returns the specified address resource.
2320 pub fn get(&self) -> super::builder::global_addresses::Get {
2321 super::builder::global_addresses::Get::new(self.inner.clone())
2322 }
2323
2324 /// Creates an address resource in the specified project by using the data
2325 /// included in the request.
2326 pub fn insert(&self) -> super::builder::global_addresses::Insert {
2327 super::builder::global_addresses::Insert::new(self.inner.clone())
2328 }
2329
2330 /// Retrieves a list of global addresses.
2331 pub fn list(&self) -> super::builder::global_addresses::List {
2332 super::builder::global_addresses::List::new(self.inner.clone())
2333 }
2334
2335 /// Moves the specified address resource from one project to another project.
2336 pub fn r#move(&self) -> super::builder::global_addresses::Move {
2337 super::builder::global_addresses::Move::new(self.inner.clone())
2338 }
2339
2340 /// Sets the labels on a GlobalAddress. To learn more about labels, read theLabeling
2341 /// Resources documentation.
2342 pub fn set_labels(&self) -> super::builder::global_addresses::SetLabels {
2343 super::builder::global_addresses::SetLabels::new(self.inner.clone())
2344 }
2345
2346 /// Returns permissions that a caller has on the specified resource.
2347 pub fn test_iam_permissions(&self) -> super::builder::global_addresses::TestIamPermissions {
2348 super::builder::global_addresses::TestIamPermissions::new(self.inner.clone())
2349 }
2350
2351 /// Retrieves the specified Operations resource.
2352 pub fn get_operation(&self) -> super::builder::global_addresses::GetOperation {
2353 super::builder::global_addresses::GetOperation::new(self.inner.clone())
2354 }
2355}
2356
2357/// Implements a client for the Google Compute Engine API.
2358///
2359/// # Example
2360/// ```
2361/// # tokio_test::block_on(async {
2362/// # use google_cloud_compute_v1::client::GlobalForwardingRules;
2363/// let client = GlobalForwardingRules::builder().build().await?;
2364/// // use `client` to make requests to the Google Compute Engine API.
2365/// # gax::client_builder::Result::<()>::Ok(()) });
2366/// ```
2367///
2368/// # Service Description
2369///
2370/// Service for the `globalForwardingRules` resource.
2371///
2372/// # Configuration
2373///
2374/// To configure `GlobalForwardingRules` use the `with_*` methods in the type returned
2375/// by [builder()][GlobalForwardingRules::builder]. The default configuration should
2376/// work for most applications. Common configuration changes include
2377///
2378/// * [with_endpoint()]: by default this client uses the global default endpoint
2379/// (`https://compute.googleapis.com`). Applications using regional
2380/// endpoints or running in restricted networks (e.g. a network configured
2381// with [Private Google Access with VPC Service Controls]) may want to
2382/// override this default.
2383/// * [with_credentials()]: by default this client uses
2384/// [Application Default Credentials]. Applications using custom
2385/// authentication may need to override this default.
2386///
2387/// [with_endpoint()]: super::builder::global_forwarding_rules::ClientBuilder::with_endpoint
2388/// [with_credentials()]: super::builder::global_forwarding_rules::ClientBuilder::credentials
2389/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2390/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2391///
2392/// # Pooling and Cloning
2393///
2394/// `GlobalForwardingRules` holds a connection pool internally, it is advised to
2395/// create one and the reuse it. You do not need to wrap `GlobalForwardingRules` in
2396/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2397/// already uses an `Arc` internally.
2398#[cfg(feature = "global-forwarding-rules")]
2399#[cfg_attr(docsrs, doc(cfg(feature = "global-forwarding-rules")))]
2400#[derive(Clone, Debug)]
2401pub struct GlobalForwardingRules {
2402 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalForwardingRules>,
2403}
2404
2405#[cfg(feature = "global-forwarding-rules")]
2406impl GlobalForwardingRules {
2407 /// Returns a builder for [GlobalForwardingRules].
2408 ///
2409 /// ```
2410 /// # tokio_test::block_on(async {
2411 /// # use google_cloud_compute_v1::client::GlobalForwardingRules;
2412 /// let client = GlobalForwardingRules::builder().build().await?;
2413 /// # gax::client_builder::Result::<()>::Ok(()) });
2414 /// ```
2415 pub fn builder() -> super::builder::global_forwarding_rules::ClientBuilder {
2416 gax::client_builder::internal::new_builder(
2417 super::builder::global_forwarding_rules::client::Factory,
2418 )
2419 }
2420
2421 /// Creates a new client from the provided stub.
2422 ///
2423 /// The most common case for calling this function is in tests mocking the
2424 /// client's behavior.
2425 pub fn from_stub<T>(stub: T) -> Self
2426 where
2427 T: super::stub::GlobalForwardingRules + 'static,
2428 {
2429 Self {
2430 inner: std::sync::Arc::new(stub),
2431 }
2432 }
2433
2434 pub(crate) async fn new(
2435 config: gaxi::options::ClientConfig,
2436 ) -> gax::client_builder::Result<Self> {
2437 let inner = Self::build_inner(config).await?;
2438 Ok(Self { inner })
2439 }
2440
2441 async fn build_inner(
2442 conf: gaxi::options::ClientConfig,
2443 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::GlobalForwardingRules>>
2444 {
2445 if gaxi::options::tracing_enabled(&conf) {
2446 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2447 }
2448 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2449 }
2450
2451 async fn build_transport(
2452 conf: gaxi::options::ClientConfig,
2453 ) -> gax::client_builder::Result<impl super::stub::GlobalForwardingRules> {
2454 super::transport::GlobalForwardingRules::new(conf).await
2455 }
2456
2457 async fn build_with_tracing(
2458 conf: gaxi::options::ClientConfig,
2459 ) -> gax::client_builder::Result<impl super::stub::GlobalForwardingRules> {
2460 Self::build_transport(conf)
2461 .await
2462 .map(super::tracing::GlobalForwardingRules::new)
2463 }
2464
2465 /// Deletes the specified GlobalForwardingRule resource.
2466 pub fn delete(&self) -> super::builder::global_forwarding_rules::Delete {
2467 super::builder::global_forwarding_rules::Delete::new(self.inner.clone())
2468 }
2469
2470 /// Returns the specified GlobalForwardingRule resource. Gets a list of
2471 /// available forwarding rules by making a list() request.
2472 pub fn get(&self) -> super::builder::global_forwarding_rules::Get {
2473 super::builder::global_forwarding_rules::Get::new(self.inner.clone())
2474 }
2475
2476 /// Creates a GlobalForwardingRule resource in the specified project using
2477 /// the data included in the request.
2478 pub fn insert(&self) -> super::builder::global_forwarding_rules::Insert {
2479 super::builder::global_forwarding_rules::Insert::new(self.inner.clone())
2480 }
2481
2482 /// Retrieves a list of GlobalForwardingRule resources available to the
2483 /// specified project.
2484 pub fn list(&self) -> super::builder::global_forwarding_rules::List {
2485 super::builder::global_forwarding_rules::List::new(self.inner.clone())
2486 }
2487
2488 /// Updates the specified forwarding rule with the data included in the
2489 /// request. This method supportsPATCH
2490 /// semantics and uses theJSON merge
2491 /// patch format and processing rules. Currently, you can only
2492 /// patch the network_tier field.
2493 pub fn patch(&self) -> super::builder::global_forwarding_rules::Patch {
2494 super::builder::global_forwarding_rules::Patch::new(self.inner.clone())
2495 }
2496
2497 /// Sets the labels on the specified resource. To learn more about labels,
2498 /// read the
2499 /// Labeling resources documentation.
2500 pub fn set_labels(&self) -> super::builder::global_forwarding_rules::SetLabels {
2501 super::builder::global_forwarding_rules::SetLabels::new(self.inner.clone())
2502 }
2503
2504 /// Changes target URL for the GlobalForwardingRule resource. The new target
2505 /// should be of the same type as the old target.
2506 pub fn set_target(&self) -> super::builder::global_forwarding_rules::SetTarget {
2507 super::builder::global_forwarding_rules::SetTarget::new(self.inner.clone())
2508 }
2509
2510 /// Retrieves the specified Operations resource.
2511 pub fn get_operation(&self) -> super::builder::global_forwarding_rules::GetOperation {
2512 super::builder::global_forwarding_rules::GetOperation::new(self.inner.clone())
2513 }
2514}
2515
2516/// Implements a client for the Google Compute Engine API.
2517///
2518/// # Example
2519/// ```
2520/// # tokio_test::block_on(async {
2521/// # use google_cloud_compute_v1::client::GlobalNetworkEndpointGroups;
2522/// let client = GlobalNetworkEndpointGroups::builder().build().await?;
2523/// // use `client` to make requests to the Google Compute Engine API.
2524/// # gax::client_builder::Result::<()>::Ok(()) });
2525/// ```
2526///
2527/// # Service Description
2528///
2529/// Service for the `globalNetworkEndpointGroups` resource.
2530///
2531/// # Configuration
2532///
2533/// To configure `GlobalNetworkEndpointGroups` use the `with_*` methods in the type returned
2534/// by [builder()][GlobalNetworkEndpointGroups::builder]. The default configuration should
2535/// work for most applications. Common configuration changes include
2536///
2537/// * [with_endpoint()]: by default this client uses the global default endpoint
2538/// (`https://compute.googleapis.com`). Applications using regional
2539/// endpoints or running in restricted networks (e.g. a network configured
2540// with [Private Google Access with VPC Service Controls]) may want to
2541/// override this default.
2542/// * [with_credentials()]: by default this client uses
2543/// [Application Default Credentials]. Applications using custom
2544/// authentication may need to override this default.
2545///
2546/// [with_endpoint()]: super::builder::global_network_endpoint_groups::ClientBuilder::with_endpoint
2547/// [with_credentials()]: super::builder::global_network_endpoint_groups::ClientBuilder::credentials
2548/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2549/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2550///
2551/// # Pooling and Cloning
2552///
2553/// `GlobalNetworkEndpointGroups` holds a connection pool internally, it is advised to
2554/// create one and the reuse it. You do not need to wrap `GlobalNetworkEndpointGroups` in
2555/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2556/// already uses an `Arc` internally.
2557#[cfg(feature = "global-network-endpoint-groups")]
2558#[cfg_attr(docsrs, doc(cfg(feature = "global-network-endpoint-groups")))]
2559#[derive(Clone, Debug)]
2560pub struct GlobalNetworkEndpointGroups {
2561 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalNetworkEndpointGroups>,
2562}
2563
2564#[cfg(feature = "global-network-endpoint-groups")]
2565impl GlobalNetworkEndpointGroups {
2566 /// Returns a builder for [GlobalNetworkEndpointGroups].
2567 ///
2568 /// ```
2569 /// # tokio_test::block_on(async {
2570 /// # use google_cloud_compute_v1::client::GlobalNetworkEndpointGroups;
2571 /// let client = GlobalNetworkEndpointGroups::builder().build().await?;
2572 /// # gax::client_builder::Result::<()>::Ok(()) });
2573 /// ```
2574 pub fn builder() -> super::builder::global_network_endpoint_groups::ClientBuilder {
2575 gax::client_builder::internal::new_builder(
2576 super::builder::global_network_endpoint_groups::client::Factory,
2577 )
2578 }
2579
2580 /// Creates a new client from the provided stub.
2581 ///
2582 /// The most common case for calling this function is in tests mocking the
2583 /// client's behavior.
2584 pub fn from_stub<T>(stub: T) -> Self
2585 where
2586 T: super::stub::GlobalNetworkEndpointGroups + 'static,
2587 {
2588 Self {
2589 inner: std::sync::Arc::new(stub),
2590 }
2591 }
2592
2593 pub(crate) async fn new(
2594 config: gaxi::options::ClientConfig,
2595 ) -> gax::client_builder::Result<Self> {
2596 let inner = Self::build_inner(config).await?;
2597 Ok(Self { inner })
2598 }
2599
2600 async fn build_inner(
2601 conf: gaxi::options::ClientConfig,
2602 ) -> gax::client_builder::Result<
2603 std::sync::Arc<dyn super::stub::dynamic::GlobalNetworkEndpointGroups>,
2604 > {
2605 if gaxi::options::tracing_enabled(&conf) {
2606 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2607 }
2608 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2609 }
2610
2611 async fn build_transport(
2612 conf: gaxi::options::ClientConfig,
2613 ) -> gax::client_builder::Result<impl super::stub::GlobalNetworkEndpointGroups> {
2614 super::transport::GlobalNetworkEndpointGroups::new(conf).await
2615 }
2616
2617 async fn build_with_tracing(
2618 conf: gaxi::options::ClientConfig,
2619 ) -> gax::client_builder::Result<impl super::stub::GlobalNetworkEndpointGroups> {
2620 Self::build_transport(conf)
2621 .await
2622 .map(super::tracing::GlobalNetworkEndpointGroups::new)
2623 }
2624
2625 /// Attach a network endpoint to the specified network endpoint group.
2626 pub fn attach_network_endpoints(
2627 &self,
2628 ) -> super::builder::global_network_endpoint_groups::AttachNetworkEndpoints {
2629 super::builder::global_network_endpoint_groups::AttachNetworkEndpoints::new(
2630 self.inner.clone(),
2631 )
2632 }
2633
2634 /// Deletes the specified network endpoint group.Note that the NEG cannot be
2635 /// deleted if there are backend services referencing it.
2636 pub fn delete(&self) -> super::builder::global_network_endpoint_groups::Delete {
2637 super::builder::global_network_endpoint_groups::Delete::new(self.inner.clone())
2638 }
2639
2640 /// Detach the network endpoint from the specified network endpoint group.
2641 pub fn detach_network_endpoints(
2642 &self,
2643 ) -> super::builder::global_network_endpoint_groups::DetachNetworkEndpoints {
2644 super::builder::global_network_endpoint_groups::DetachNetworkEndpoints::new(
2645 self.inner.clone(),
2646 )
2647 }
2648
2649 /// Returns the specified network endpoint group.
2650 pub fn get(&self) -> super::builder::global_network_endpoint_groups::Get {
2651 super::builder::global_network_endpoint_groups::Get::new(self.inner.clone())
2652 }
2653
2654 /// Creates a network endpoint group in the specified project using the
2655 /// parameters that are included in the request.
2656 pub fn insert(&self) -> super::builder::global_network_endpoint_groups::Insert {
2657 super::builder::global_network_endpoint_groups::Insert::new(self.inner.clone())
2658 }
2659
2660 /// Retrieves the list of network endpoint groups that are located in the
2661 /// specified project.
2662 pub fn list(&self) -> super::builder::global_network_endpoint_groups::List {
2663 super::builder::global_network_endpoint_groups::List::new(self.inner.clone())
2664 }
2665
2666 /// Lists the network endpoints in the specified network endpoint group.
2667 pub fn list_network_endpoints(
2668 &self,
2669 ) -> super::builder::global_network_endpoint_groups::ListNetworkEndpoints {
2670 super::builder::global_network_endpoint_groups::ListNetworkEndpoints::new(
2671 self.inner.clone(),
2672 )
2673 }
2674
2675 /// Retrieves the specified Operations resource.
2676 pub fn get_operation(&self) -> super::builder::global_network_endpoint_groups::GetOperation {
2677 super::builder::global_network_endpoint_groups::GetOperation::new(self.inner.clone())
2678 }
2679}
2680
2681/// Implements a client for the Google Compute Engine API.
2682///
2683/// # Example
2684/// ```
2685/// # tokio_test::block_on(async {
2686/// # use google_cloud_compute_v1::client::GlobalOperations;
2687/// let client = GlobalOperations::builder().build().await?;
2688/// // use `client` to make requests to the Google Compute Engine API.
2689/// # gax::client_builder::Result::<()>::Ok(()) });
2690/// ```
2691///
2692/// # Service Description
2693///
2694/// Service for the `globalOperations` resource.
2695///
2696/// # Configuration
2697///
2698/// To configure `GlobalOperations` use the `with_*` methods in the type returned
2699/// by [builder()][GlobalOperations::builder]. The default configuration should
2700/// work for most applications. Common configuration changes include
2701///
2702/// * [with_endpoint()]: by default this client uses the global default endpoint
2703/// (`https://compute.googleapis.com`). Applications using regional
2704/// endpoints or running in restricted networks (e.g. a network configured
2705// with [Private Google Access with VPC Service Controls]) may want to
2706/// override this default.
2707/// * [with_credentials()]: by default this client uses
2708/// [Application Default Credentials]. Applications using custom
2709/// authentication may need to override this default.
2710///
2711/// [with_endpoint()]: super::builder::global_operations::ClientBuilder::with_endpoint
2712/// [with_credentials()]: super::builder::global_operations::ClientBuilder::credentials
2713/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2714/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2715///
2716/// # Pooling and Cloning
2717///
2718/// `GlobalOperations` holds a connection pool internally, it is advised to
2719/// create one and the reuse it. You do not need to wrap `GlobalOperations` in
2720/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2721/// already uses an `Arc` internally.
2722#[cfg(feature = "global-operations")]
2723#[cfg_attr(docsrs, doc(cfg(feature = "global-operations")))]
2724#[derive(Clone, Debug)]
2725pub struct GlobalOperations {
2726 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalOperations>,
2727}
2728
2729#[cfg(feature = "global-operations")]
2730impl GlobalOperations {
2731 /// Returns a builder for [GlobalOperations].
2732 ///
2733 /// ```
2734 /// # tokio_test::block_on(async {
2735 /// # use google_cloud_compute_v1::client::GlobalOperations;
2736 /// let client = GlobalOperations::builder().build().await?;
2737 /// # gax::client_builder::Result::<()>::Ok(()) });
2738 /// ```
2739 pub fn builder() -> super::builder::global_operations::ClientBuilder {
2740 gax::client_builder::internal::new_builder(
2741 super::builder::global_operations::client::Factory,
2742 )
2743 }
2744
2745 /// Creates a new client from the provided stub.
2746 ///
2747 /// The most common case for calling this function is in tests mocking the
2748 /// client's behavior.
2749 pub fn from_stub<T>(stub: T) -> Self
2750 where
2751 T: super::stub::GlobalOperations + 'static,
2752 {
2753 Self {
2754 inner: std::sync::Arc::new(stub),
2755 }
2756 }
2757
2758 pub(crate) async fn new(
2759 config: gaxi::options::ClientConfig,
2760 ) -> gax::client_builder::Result<Self> {
2761 let inner = Self::build_inner(config).await?;
2762 Ok(Self { inner })
2763 }
2764
2765 async fn build_inner(
2766 conf: gaxi::options::ClientConfig,
2767 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::GlobalOperations>>
2768 {
2769 if gaxi::options::tracing_enabled(&conf) {
2770 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2771 }
2772 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2773 }
2774
2775 async fn build_transport(
2776 conf: gaxi::options::ClientConfig,
2777 ) -> gax::client_builder::Result<impl super::stub::GlobalOperations> {
2778 super::transport::GlobalOperations::new(conf).await
2779 }
2780
2781 async fn build_with_tracing(
2782 conf: gaxi::options::ClientConfig,
2783 ) -> gax::client_builder::Result<impl super::stub::GlobalOperations> {
2784 Self::build_transport(conf)
2785 .await
2786 .map(super::tracing::GlobalOperations::new)
2787 }
2788
2789 /// Retrieves an aggregated list of all operations.
2790 ///
2791 /// To prevent failure, Google recommends that you set the
2792 /// `returnPartialSuccess` parameter to `true`.
2793 pub fn aggregated_list(&self) -> super::builder::global_operations::AggregatedList {
2794 super::builder::global_operations::AggregatedList::new(self.inner.clone())
2795 }
2796
2797 /// Deletes the specified Operations resource.
2798 pub fn delete(&self) -> super::builder::global_operations::Delete {
2799 super::builder::global_operations::Delete::new(self.inner.clone())
2800 }
2801
2802 /// Retrieves the specified Operations resource.
2803 pub fn get(&self) -> super::builder::global_operations::Get {
2804 super::builder::global_operations::Get::new(self.inner.clone())
2805 }
2806
2807 /// Retrieves a list of Operation resources contained within the specified
2808 /// project.
2809 pub fn list(&self) -> super::builder::global_operations::List {
2810 super::builder::global_operations::List::new(self.inner.clone())
2811 }
2812
2813 /// Waits for the specified Operation resource to return as `DONE`
2814 /// or for the request to approach the 2 minute deadline, and retrieves the
2815 /// specified Operation resource. This method differs from the
2816 /// `GET` method in that it waits for no more than the default
2817 /// deadline (2 minutes) and then returns the current state of the operation,
2818 /// which might be `DONE` or still in progress.
2819 ///
2820 /// This method is called on a best-effort basis. Specifically:
2821 ///
2822 /// ```norust
2823 /// - In uncommon cases, when the server is overloaded, the request might
2824 /// return before the default deadline is reached, or might return after zero
2825 /// seconds.
2826 /// ```
2827 ///
2828 /// - If the default deadline is reached, there is no guarantee that the
2829 /// operation is actually done when the method returns. Be prepared to retry
2830 /// if the operation is not `DONE`.
2831 pub fn wait(&self) -> super::builder::global_operations::Wait {
2832 super::builder::global_operations::Wait::new(self.inner.clone())
2833 }
2834}
2835
2836/// Implements a client for the Google Compute Engine API.
2837///
2838/// # Example
2839/// ```
2840/// # tokio_test::block_on(async {
2841/// # use google_cloud_compute_v1::client::GlobalOrganizationOperations;
2842/// let client = GlobalOrganizationOperations::builder().build().await?;
2843/// // use `client` to make requests to the Google Compute Engine API.
2844/// # gax::client_builder::Result::<()>::Ok(()) });
2845/// ```
2846///
2847/// # Service Description
2848///
2849/// Service for the `globalOrganizationOperations` resource.
2850///
2851/// # Configuration
2852///
2853/// To configure `GlobalOrganizationOperations` use the `with_*` methods in the type returned
2854/// by [builder()][GlobalOrganizationOperations::builder]. The default configuration should
2855/// work for most applications. Common configuration changes include
2856///
2857/// * [with_endpoint()]: by default this client uses the global default endpoint
2858/// (`https://compute.googleapis.com`). Applications using regional
2859/// endpoints or running in restricted networks (e.g. a network configured
2860// with [Private Google Access with VPC Service Controls]) may want to
2861/// override this default.
2862/// * [with_credentials()]: by default this client uses
2863/// [Application Default Credentials]. Applications using custom
2864/// authentication may need to override this default.
2865///
2866/// [with_endpoint()]: super::builder::global_organization_operations::ClientBuilder::with_endpoint
2867/// [with_credentials()]: super::builder::global_organization_operations::ClientBuilder::credentials
2868/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2869/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2870///
2871/// # Pooling and Cloning
2872///
2873/// `GlobalOrganizationOperations` holds a connection pool internally, it is advised to
2874/// create one and the reuse it. You do not need to wrap `GlobalOrganizationOperations` in
2875/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2876/// already uses an `Arc` internally.
2877#[cfg(feature = "global-organization-operations")]
2878#[cfg_attr(docsrs, doc(cfg(feature = "global-organization-operations")))]
2879#[derive(Clone, Debug)]
2880pub struct GlobalOrganizationOperations {
2881 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalOrganizationOperations>,
2882}
2883
2884#[cfg(feature = "global-organization-operations")]
2885impl GlobalOrganizationOperations {
2886 /// Returns a builder for [GlobalOrganizationOperations].
2887 ///
2888 /// ```
2889 /// # tokio_test::block_on(async {
2890 /// # use google_cloud_compute_v1::client::GlobalOrganizationOperations;
2891 /// let client = GlobalOrganizationOperations::builder().build().await?;
2892 /// # gax::client_builder::Result::<()>::Ok(()) });
2893 /// ```
2894 pub fn builder() -> super::builder::global_organization_operations::ClientBuilder {
2895 gax::client_builder::internal::new_builder(
2896 super::builder::global_organization_operations::client::Factory,
2897 )
2898 }
2899
2900 /// Creates a new client from the provided stub.
2901 ///
2902 /// The most common case for calling this function is in tests mocking the
2903 /// client's behavior.
2904 pub fn from_stub<T>(stub: T) -> Self
2905 where
2906 T: super::stub::GlobalOrganizationOperations + 'static,
2907 {
2908 Self {
2909 inner: std::sync::Arc::new(stub),
2910 }
2911 }
2912
2913 pub(crate) async fn new(
2914 config: gaxi::options::ClientConfig,
2915 ) -> gax::client_builder::Result<Self> {
2916 let inner = Self::build_inner(config).await?;
2917 Ok(Self { inner })
2918 }
2919
2920 async fn build_inner(
2921 conf: gaxi::options::ClientConfig,
2922 ) -> gax::client_builder::Result<
2923 std::sync::Arc<dyn super::stub::dynamic::GlobalOrganizationOperations>,
2924 > {
2925 if gaxi::options::tracing_enabled(&conf) {
2926 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2927 }
2928 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2929 }
2930
2931 async fn build_transport(
2932 conf: gaxi::options::ClientConfig,
2933 ) -> gax::client_builder::Result<impl super::stub::GlobalOrganizationOperations> {
2934 super::transport::GlobalOrganizationOperations::new(conf).await
2935 }
2936
2937 async fn build_with_tracing(
2938 conf: gaxi::options::ClientConfig,
2939 ) -> gax::client_builder::Result<impl super::stub::GlobalOrganizationOperations> {
2940 Self::build_transport(conf)
2941 .await
2942 .map(super::tracing::GlobalOrganizationOperations::new)
2943 }
2944
2945 /// Deletes the specified Operations resource.
2946 pub fn delete(&self) -> super::builder::global_organization_operations::Delete {
2947 super::builder::global_organization_operations::Delete::new(self.inner.clone())
2948 }
2949
2950 /// Retrieves the specified Operations resource. Gets a list of operations
2951 /// by making a `list()` request.
2952 pub fn get(&self) -> super::builder::global_organization_operations::Get {
2953 super::builder::global_organization_operations::Get::new(self.inner.clone())
2954 }
2955
2956 /// Retrieves a list of Operation resources contained within the specified
2957 /// organization.
2958 pub fn list(&self) -> super::builder::global_organization_operations::List {
2959 super::builder::global_organization_operations::List::new(self.inner.clone())
2960 }
2961}
2962
2963/// Implements a client for the Google Compute Engine API.
2964///
2965/// # Example
2966/// ```
2967/// # tokio_test::block_on(async {
2968/// # use google_cloud_compute_v1::client::GlobalPublicDelegatedPrefixes;
2969/// let client = GlobalPublicDelegatedPrefixes::builder().build().await?;
2970/// // use `client` to make requests to the Google Compute Engine API.
2971/// # gax::client_builder::Result::<()>::Ok(()) });
2972/// ```
2973///
2974/// # Service Description
2975///
2976/// Service for the `globalPublicDelegatedPrefixes` resource.
2977///
2978/// # Configuration
2979///
2980/// To configure `GlobalPublicDelegatedPrefixes` use the `with_*` methods in the type returned
2981/// by [builder()][GlobalPublicDelegatedPrefixes::builder]. The default configuration should
2982/// work for most applications. Common configuration changes include
2983///
2984/// * [with_endpoint()]: by default this client uses the global default endpoint
2985/// (`https://compute.googleapis.com`). Applications using regional
2986/// endpoints or running in restricted networks (e.g. a network configured
2987// with [Private Google Access with VPC Service Controls]) may want to
2988/// override this default.
2989/// * [with_credentials()]: by default this client uses
2990/// [Application Default Credentials]. Applications using custom
2991/// authentication may need to override this default.
2992///
2993/// [with_endpoint()]: super::builder::global_public_delegated_prefixes::ClientBuilder::with_endpoint
2994/// [with_credentials()]: super::builder::global_public_delegated_prefixes::ClientBuilder::credentials
2995/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2996/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2997///
2998/// # Pooling and Cloning
2999///
3000/// `GlobalPublicDelegatedPrefixes` holds a connection pool internally, it is advised to
3001/// create one and the reuse it. You do not need to wrap `GlobalPublicDelegatedPrefixes` in
3002/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3003/// already uses an `Arc` internally.
3004#[cfg(feature = "global-public-delegated-prefixes")]
3005#[cfg_attr(docsrs, doc(cfg(feature = "global-public-delegated-prefixes")))]
3006#[derive(Clone, Debug)]
3007pub struct GlobalPublicDelegatedPrefixes {
3008 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalPublicDelegatedPrefixes>,
3009}
3010
3011#[cfg(feature = "global-public-delegated-prefixes")]
3012impl GlobalPublicDelegatedPrefixes {
3013 /// Returns a builder for [GlobalPublicDelegatedPrefixes].
3014 ///
3015 /// ```
3016 /// # tokio_test::block_on(async {
3017 /// # use google_cloud_compute_v1::client::GlobalPublicDelegatedPrefixes;
3018 /// let client = GlobalPublicDelegatedPrefixes::builder().build().await?;
3019 /// # gax::client_builder::Result::<()>::Ok(()) });
3020 /// ```
3021 pub fn builder() -> super::builder::global_public_delegated_prefixes::ClientBuilder {
3022 gax::client_builder::internal::new_builder(
3023 super::builder::global_public_delegated_prefixes::client::Factory,
3024 )
3025 }
3026
3027 /// Creates a new client from the provided stub.
3028 ///
3029 /// The most common case for calling this function is in tests mocking the
3030 /// client's behavior.
3031 pub fn from_stub<T>(stub: T) -> Self
3032 where
3033 T: super::stub::GlobalPublicDelegatedPrefixes + 'static,
3034 {
3035 Self {
3036 inner: std::sync::Arc::new(stub),
3037 }
3038 }
3039
3040 pub(crate) async fn new(
3041 config: gaxi::options::ClientConfig,
3042 ) -> gax::client_builder::Result<Self> {
3043 let inner = Self::build_inner(config).await?;
3044 Ok(Self { inner })
3045 }
3046
3047 async fn build_inner(
3048 conf: gaxi::options::ClientConfig,
3049 ) -> gax::client_builder::Result<
3050 std::sync::Arc<dyn super::stub::dynamic::GlobalPublicDelegatedPrefixes>,
3051 > {
3052 if gaxi::options::tracing_enabled(&conf) {
3053 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3054 }
3055 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3056 }
3057
3058 async fn build_transport(
3059 conf: gaxi::options::ClientConfig,
3060 ) -> gax::client_builder::Result<impl super::stub::GlobalPublicDelegatedPrefixes> {
3061 super::transport::GlobalPublicDelegatedPrefixes::new(conf).await
3062 }
3063
3064 async fn build_with_tracing(
3065 conf: gaxi::options::ClientConfig,
3066 ) -> gax::client_builder::Result<impl super::stub::GlobalPublicDelegatedPrefixes> {
3067 Self::build_transport(conf)
3068 .await
3069 .map(super::tracing::GlobalPublicDelegatedPrefixes::new)
3070 }
3071
3072 /// Deletes the specified global PublicDelegatedPrefix.
3073 pub fn delete(&self) -> super::builder::global_public_delegated_prefixes::Delete {
3074 super::builder::global_public_delegated_prefixes::Delete::new(self.inner.clone())
3075 }
3076
3077 /// Returns the specified global PublicDelegatedPrefix resource.
3078 pub fn get(&self) -> super::builder::global_public_delegated_prefixes::Get {
3079 super::builder::global_public_delegated_prefixes::Get::new(self.inner.clone())
3080 }
3081
3082 /// Creates a global PublicDelegatedPrefix in the specified project using the
3083 /// parameters that are included in the request.
3084 pub fn insert(&self) -> super::builder::global_public_delegated_prefixes::Insert {
3085 super::builder::global_public_delegated_prefixes::Insert::new(self.inner.clone())
3086 }
3087
3088 /// Lists the global PublicDelegatedPrefixes for a project.
3089 pub fn list(&self) -> super::builder::global_public_delegated_prefixes::List {
3090 super::builder::global_public_delegated_prefixes::List::new(self.inner.clone())
3091 }
3092
3093 /// Patches the specified global PublicDelegatedPrefix resource with the data
3094 /// included in the request. This method supportsPATCH
3095 /// semantics and usesJSON merge
3096 /// patch format and processing rules.
3097 pub fn patch(&self) -> super::builder::global_public_delegated_prefixes::Patch {
3098 super::builder::global_public_delegated_prefixes::Patch::new(self.inner.clone())
3099 }
3100
3101 /// Retrieves the specified Operations resource.
3102 pub fn get_operation(&self) -> super::builder::global_public_delegated_prefixes::GetOperation {
3103 super::builder::global_public_delegated_prefixes::GetOperation::new(self.inner.clone())
3104 }
3105}
3106
3107/// Implements a client for the Google Compute Engine API.
3108///
3109/// # Example
3110/// ```
3111/// # tokio_test::block_on(async {
3112/// # use google_cloud_compute_v1::client::HealthChecks;
3113/// let client = HealthChecks::builder().build().await?;
3114/// // use `client` to make requests to the Google Compute Engine API.
3115/// # gax::client_builder::Result::<()>::Ok(()) });
3116/// ```
3117///
3118/// # Service Description
3119///
3120/// Service for the `healthChecks` resource.
3121///
3122/// # Configuration
3123///
3124/// To configure `HealthChecks` use the `with_*` methods in the type returned
3125/// by [builder()][HealthChecks::builder]. The default configuration should
3126/// work for most applications. Common configuration changes include
3127///
3128/// * [with_endpoint()]: by default this client uses the global default endpoint
3129/// (`https://compute.googleapis.com`). Applications using regional
3130/// endpoints or running in restricted networks (e.g. a network configured
3131// with [Private Google Access with VPC Service Controls]) may want to
3132/// override this default.
3133/// * [with_credentials()]: by default this client uses
3134/// [Application Default Credentials]. Applications using custom
3135/// authentication may need to override this default.
3136///
3137/// [with_endpoint()]: super::builder::health_checks::ClientBuilder::with_endpoint
3138/// [with_credentials()]: super::builder::health_checks::ClientBuilder::credentials
3139/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3140/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3141///
3142/// # Pooling and Cloning
3143///
3144/// `HealthChecks` holds a connection pool internally, it is advised to
3145/// create one and the reuse it. You do not need to wrap `HealthChecks` in
3146/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3147/// already uses an `Arc` internally.
3148#[cfg(feature = "health-checks")]
3149#[cfg_attr(docsrs, doc(cfg(feature = "health-checks")))]
3150#[derive(Clone, Debug)]
3151pub struct HealthChecks {
3152 inner: std::sync::Arc<dyn super::stub::dynamic::HealthChecks>,
3153}
3154
3155#[cfg(feature = "health-checks")]
3156impl HealthChecks {
3157 /// Returns a builder for [HealthChecks].
3158 ///
3159 /// ```
3160 /// # tokio_test::block_on(async {
3161 /// # use google_cloud_compute_v1::client::HealthChecks;
3162 /// let client = HealthChecks::builder().build().await?;
3163 /// # gax::client_builder::Result::<()>::Ok(()) });
3164 /// ```
3165 pub fn builder() -> super::builder::health_checks::ClientBuilder {
3166 gax::client_builder::internal::new_builder(super::builder::health_checks::client::Factory)
3167 }
3168
3169 /// Creates a new client from the provided stub.
3170 ///
3171 /// The most common case for calling this function is in tests mocking the
3172 /// client's behavior.
3173 pub fn from_stub<T>(stub: T) -> Self
3174 where
3175 T: super::stub::HealthChecks + 'static,
3176 {
3177 Self {
3178 inner: std::sync::Arc::new(stub),
3179 }
3180 }
3181
3182 pub(crate) async fn new(
3183 config: gaxi::options::ClientConfig,
3184 ) -> gax::client_builder::Result<Self> {
3185 let inner = Self::build_inner(config).await?;
3186 Ok(Self { inner })
3187 }
3188
3189 async fn build_inner(
3190 conf: gaxi::options::ClientConfig,
3191 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::HealthChecks>> {
3192 if gaxi::options::tracing_enabled(&conf) {
3193 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3194 }
3195 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3196 }
3197
3198 async fn build_transport(
3199 conf: gaxi::options::ClientConfig,
3200 ) -> gax::client_builder::Result<impl super::stub::HealthChecks> {
3201 super::transport::HealthChecks::new(conf).await
3202 }
3203
3204 async fn build_with_tracing(
3205 conf: gaxi::options::ClientConfig,
3206 ) -> gax::client_builder::Result<impl super::stub::HealthChecks> {
3207 Self::build_transport(conf)
3208 .await
3209 .map(super::tracing::HealthChecks::new)
3210 }
3211
3212 /// Retrieves the list of all HealthCheck resources, regional and global,
3213 /// available to the specified project.
3214 ///
3215 /// To prevent failure, Google recommends that you set the
3216 /// `returnPartialSuccess` parameter to `true`.
3217 pub fn aggregated_list(&self) -> super::builder::health_checks::AggregatedList {
3218 super::builder::health_checks::AggregatedList::new(self.inner.clone())
3219 }
3220
3221 /// Deletes the specified HealthCheck resource.
3222 pub fn delete(&self) -> super::builder::health_checks::Delete {
3223 super::builder::health_checks::Delete::new(self.inner.clone())
3224 }
3225
3226 /// Returns the specified HealthCheck resource.
3227 pub fn get(&self) -> super::builder::health_checks::Get {
3228 super::builder::health_checks::Get::new(self.inner.clone())
3229 }
3230
3231 /// Creates a HealthCheck resource in the specified project using the data
3232 /// included in the request.
3233 pub fn insert(&self) -> super::builder::health_checks::Insert {
3234 super::builder::health_checks::Insert::new(self.inner.clone())
3235 }
3236
3237 /// Retrieves the list of HealthCheck resources available to the specified
3238 /// project.
3239 pub fn list(&self) -> super::builder::health_checks::List {
3240 super::builder::health_checks::List::new(self.inner.clone())
3241 }
3242
3243 /// Updates a HealthCheck resource in the specified project using the data
3244 /// included in the request. This method supportsPATCH
3245 /// semantics and uses theJSON merge
3246 /// patch format and processing rules.
3247 pub fn patch(&self) -> super::builder::health_checks::Patch {
3248 super::builder::health_checks::Patch::new(self.inner.clone())
3249 }
3250
3251 /// Updates a HealthCheck resource in the specified project using the data
3252 /// included in the request.
3253 pub fn update(&self) -> super::builder::health_checks::Update {
3254 super::builder::health_checks::Update::new(self.inner.clone())
3255 }
3256
3257 /// Retrieves the specified Operations resource.
3258 pub fn get_operation(&self) -> super::builder::health_checks::GetOperation {
3259 super::builder::health_checks::GetOperation::new(self.inner.clone())
3260 }
3261}
3262
3263/// Implements a client for the Google Compute Engine API.
3264///
3265/// # Example
3266/// ```
3267/// # tokio_test::block_on(async {
3268/// # use google_cloud_compute_v1::client::HttpHealthChecks;
3269/// let client = HttpHealthChecks::builder().build().await?;
3270/// // use `client` to make requests to the Google Compute Engine API.
3271/// # gax::client_builder::Result::<()>::Ok(()) });
3272/// ```
3273///
3274/// # Service Description
3275///
3276/// Service for the `httpHealthChecks` resource.
3277///
3278/// # Configuration
3279///
3280/// To configure `HttpHealthChecks` use the `with_*` methods in the type returned
3281/// by [builder()][HttpHealthChecks::builder]. The default configuration should
3282/// work for most applications. Common configuration changes include
3283///
3284/// * [with_endpoint()]: by default this client uses the global default endpoint
3285/// (`https://compute.googleapis.com`). Applications using regional
3286/// endpoints or running in restricted networks (e.g. a network configured
3287// with [Private Google Access with VPC Service Controls]) may want to
3288/// override this default.
3289/// * [with_credentials()]: by default this client uses
3290/// [Application Default Credentials]. Applications using custom
3291/// authentication may need to override this default.
3292///
3293/// [with_endpoint()]: super::builder::http_health_checks::ClientBuilder::with_endpoint
3294/// [with_credentials()]: super::builder::http_health_checks::ClientBuilder::credentials
3295/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3296/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3297///
3298/// # Pooling and Cloning
3299///
3300/// `HttpHealthChecks` holds a connection pool internally, it is advised to
3301/// create one and the reuse it. You do not need to wrap `HttpHealthChecks` in
3302/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3303/// already uses an `Arc` internally.
3304#[cfg(feature = "http-health-checks")]
3305#[cfg_attr(docsrs, doc(cfg(feature = "http-health-checks")))]
3306#[derive(Clone, Debug)]
3307pub struct HttpHealthChecks {
3308 inner: std::sync::Arc<dyn super::stub::dynamic::HttpHealthChecks>,
3309}
3310
3311#[cfg(feature = "http-health-checks")]
3312impl HttpHealthChecks {
3313 /// Returns a builder for [HttpHealthChecks].
3314 ///
3315 /// ```
3316 /// # tokio_test::block_on(async {
3317 /// # use google_cloud_compute_v1::client::HttpHealthChecks;
3318 /// let client = HttpHealthChecks::builder().build().await?;
3319 /// # gax::client_builder::Result::<()>::Ok(()) });
3320 /// ```
3321 pub fn builder() -> super::builder::http_health_checks::ClientBuilder {
3322 gax::client_builder::internal::new_builder(
3323 super::builder::http_health_checks::client::Factory,
3324 )
3325 }
3326
3327 /// Creates a new client from the provided stub.
3328 ///
3329 /// The most common case for calling this function is in tests mocking the
3330 /// client's behavior.
3331 pub fn from_stub<T>(stub: T) -> Self
3332 where
3333 T: super::stub::HttpHealthChecks + 'static,
3334 {
3335 Self {
3336 inner: std::sync::Arc::new(stub),
3337 }
3338 }
3339
3340 pub(crate) async fn new(
3341 config: gaxi::options::ClientConfig,
3342 ) -> gax::client_builder::Result<Self> {
3343 let inner = Self::build_inner(config).await?;
3344 Ok(Self { inner })
3345 }
3346
3347 async fn build_inner(
3348 conf: gaxi::options::ClientConfig,
3349 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::HttpHealthChecks>>
3350 {
3351 if gaxi::options::tracing_enabled(&conf) {
3352 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3353 }
3354 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3355 }
3356
3357 async fn build_transport(
3358 conf: gaxi::options::ClientConfig,
3359 ) -> gax::client_builder::Result<impl super::stub::HttpHealthChecks> {
3360 super::transport::HttpHealthChecks::new(conf).await
3361 }
3362
3363 async fn build_with_tracing(
3364 conf: gaxi::options::ClientConfig,
3365 ) -> gax::client_builder::Result<impl super::stub::HttpHealthChecks> {
3366 Self::build_transport(conf)
3367 .await
3368 .map(super::tracing::HttpHealthChecks::new)
3369 }
3370
3371 /// Deletes the specified HttpHealthCheck resource.
3372 pub fn delete(&self) -> super::builder::http_health_checks::Delete {
3373 super::builder::http_health_checks::Delete::new(self.inner.clone())
3374 }
3375
3376 /// Returns the specified HttpHealthCheck resource.
3377 pub fn get(&self) -> super::builder::http_health_checks::Get {
3378 super::builder::http_health_checks::Get::new(self.inner.clone())
3379 }
3380
3381 /// Creates a HttpHealthCheck resource in the specified project using the data
3382 /// included in the request.
3383 pub fn insert(&self) -> super::builder::http_health_checks::Insert {
3384 super::builder::http_health_checks::Insert::new(self.inner.clone())
3385 }
3386
3387 /// Retrieves the list of HttpHealthCheck resources available to the specified
3388 /// project.
3389 pub fn list(&self) -> super::builder::http_health_checks::List {
3390 super::builder::http_health_checks::List::new(self.inner.clone())
3391 }
3392
3393 /// Updates a HttpHealthCheck resource in the specified project using the data
3394 /// included in the request. This method supportsPATCH
3395 /// semantics and uses theJSON merge
3396 /// patch format and processing rules.
3397 pub fn patch(&self) -> super::builder::http_health_checks::Patch {
3398 super::builder::http_health_checks::Patch::new(self.inner.clone())
3399 }
3400
3401 /// Updates a HttpHealthCheck resource in the specified project using the data
3402 /// included in the request.
3403 pub fn update(&self) -> super::builder::http_health_checks::Update {
3404 super::builder::http_health_checks::Update::new(self.inner.clone())
3405 }
3406
3407 /// Retrieves the specified Operations resource.
3408 pub fn get_operation(&self) -> super::builder::http_health_checks::GetOperation {
3409 super::builder::http_health_checks::GetOperation::new(self.inner.clone())
3410 }
3411}
3412
3413/// Implements a client for the Google Compute Engine API.
3414///
3415/// # Example
3416/// ```
3417/// # tokio_test::block_on(async {
3418/// # use google_cloud_compute_v1::client::HttpsHealthChecks;
3419/// let client = HttpsHealthChecks::builder().build().await?;
3420/// // use `client` to make requests to the Google Compute Engine API.
3421/// # gax::client_builder::Result::<()>::Ok(()) });
3422/// ```
3423///
3424/// # Service Description
3425///
3426/// Service for the `httpsHealthChecks` resource.
3427///
3428/// # Configuration
3429///
3430/// To configure `HttpsHealthChecks` use the `with_*` methods in the type returned
3431/// by [builder()][HttpsHealthChecks::builder]. The default configuration should
3432/// work for most applications. Common configuration changes include
3433///
3434/// * [with_endpoint()]: by default this client uses the global default endpoint
3435/// (`https://compute.googleapis.com`). Applications using regional
3436/// endpoints or running in restricted networks (e.g. a network configured
3437// with [Private Google Access with VPC Service Controls]) may want to
3438/// override this default.
3439/// * [with_credentials()]: by default this client uses
3440/// [Application Default Credentials]. Applications using custom
3441/// authentication may need to override this default.
3442///
3443/// [with_endpoint()]: super::builder::https_health_checks::ClientBuilder::with_endpoint
3444/// [with_credentials()]: super::builder::https_health_checks::ClientBuilder::credentials
3445/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3446/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3447///
3448/// # Pooling and Cloning
3449///
3450/// `HttpsHealthChecks` holds a connection pool internally, it is advised to
3451/// create one and the reuse it. You do not need to wrap `HttpsHealthChecks` in
3452/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3453/// already uses an `Arc` internally.
3454#[cfg(feature = "https-health-checks")]
3455#[cfg_attr(docsrs, doc(cfg(feature = "https-health-checks")))]
3456#[derive(Clone, Debug)]
3457pub struct HttpsHealthChecks {
3458 inner: std::sync::Arc<dyn super::stub::dynamic::HttpsHealthChecks>,
3459}
3460
3461#[cfg(feature = "https-health-checks")]
3462impl HttpsHealthChecks {
3463 /// Returns a builder for [HttpsHealthChecks].
3464 ///
3465 /// ```
3466 /// # tokio_test::block_on(async {
3467 /// # use google_cloud_compute_v1::client::HttpsHealthChecks;
3468 /// let client = HttpsHealthChecks::builder().build().await?;
3469 /// # gax::client_builder::Result::<()>::Ok(()) });
3470 /// ```
3471 pub fn builder() -> super::builder::https_health_checks::ClientBuilder {
3472 gax::client_builder::internal::new_builder(
3473 super::builder::https_health_checks::client::Factory,
3474 )
3475 }
3476
3477 /// Creates a new client from the provided stub.
3478 ///
3479 /// The most common case for calling this function is in tests mocking the
3480 /// client's behavior.
3481 pub fn from_stub<T>(stub: T) -> Self
3482 where
3483 T: super::stub::HttpsHealthChecks + 'static,
3484 {
3485 Self {
3486 inner: std::sync::Arc::new(stub),
3487 }
3488 }
3489
3490 pub(crate) async fn new(
3491 config: gaxi::options::ClientConfig,
3492 ) -> gax::client_builder::Result<Self> {
3493 let inner = Self::build_inner(config).await?;
3494 Ok(Self { inner })
3495 }
3496
3497 async fn build_inner(
3498 conf: gaxi::options::ClientConfig,
3499 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::HttpsHealthChecks>>
3500 {
3501 if gaxi::options::tracing_enabled(&conf) {
3502 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3503 }
3504 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3505 }
3506
3507 async fn build_transport(
3508 conf: gaxi::options::ClientConfig,
3509 ) -> gax::client_builder::Result<impl super::stub::HttpsHealthChecks> {
3510 super::transport::HttpsHealthChecks::new(conf).await
3511 }
3512
3513 async fn build_with_tracing(
3514 conf: gaxi::options::ClientConfig,
3515 ) -> gax::client_builder::Result<impl super::stub::HttpsHealthChecks> {
3516 Self::build_transport(conf)
3517 .await
3518 .map(super::tracing::HttpsHealthChecks::new)
3519 }
3520
3521 /// Deletes the specified HttpsHealthCheck resource.
3522 pub fn delete(&self) -> super::builder::https_health_checks::Delete {
3523 super::builder::https_health_checks::Delete::new(self.inner.clone())
3524 }
3525
3526 /// Returns the specified HttpsHealthCheck resource.
3527 pub fn get(&self) -> super::builder::https_health_checks::Get {
3528 super::builder::https_health_checks::Get::new(self.inner.clone())
3529 }
3530
3531 /// Creates a HttpsHealthCheck resource in the specified project using the data
3532 /// included in the request.
3533 pub fn insert(&self) -> super::builder::https_health_checks::Insert {
3534 super::builder::https_health_checks::Insert::new(self.inner.clone())
3535 }
3536
3537 /// Retrieves the list of HttpsHealthCheck resources available to the specified
3538 /// project.
3539 pub fn list(&self) -> super::builder::https_health_checks::List {
3540 super::builder::https_health_checks::List::new(self.inner.clone())
3541 }
3542
3543 /// Updates a HttpsHealthCheck resource in the specified project using the data
3544 /// included in the request. This method supportsPATCH
3545 /// semantics and uses theJSON merge
3546 /// patch format and processing rules.
3547 pub fn patch(&self) -> super::builder::https_health_checks::Patch {
3548 super::builder::https_health_checks::Patch::new(self.inner.clone())
3549 }
3550
3551 /// Updates a HttpsHealthCheck resource in the specified project using the data
3552 /// included in the request.
3553 pub fn update(&self) -> super::builder::https_health_checks::Update {
3554 super::builder::https_health_checks::Update::new(self.inner.clone())
3555 }
3556
3557 /// Retrieves the specified Operations resource.
3558 pub fn get_operation(&self) -> super::builder::https_health_checks::GetOperation {
3559 super::builder::https_health_checks::GetOperation::new(self.inner.clone())
3560 }
3561}
3562
3563/// Implements a client for the Google Compute Engine API.
3564///
3565/// # Example
3566/// ```
3567/// # tokio_test::block_on(async {
3568/// # use google_cloud_compute_v1::client::ImageFamilyViews;
3569/// let client = ImageFamilyViews::builder().build().await?;
3570/// // use `client` to make requests to the Google Compute Engine API.
3571/// # gax::client_builder::Result::<()>::Ok(()) });
3572/// ```
3573///
3574/// # Service Description
3575///
3576/// Service for the `imageFamilyViews` resource.
3577///
3578/// # Configuration
3579///
3580/// To configure `ImageFamilyViews` use the `with_*` methods in the type returned
3581/// by [builder()][ImageFamilyViews::builder]. The default configuration should
3582/// work for most applications. Common configuration changes include
3583///
3584/// * [with_endpoint()]: by default this client uses the global default endpoint
3585/// (`https://compute.googleapis.com`). Applications using regional
3586/// endpoints or running in restricted networks (e.g. a network configured
3587// with [Private Google Access with VPC Service Controls]) may want to
3588/// override this default.
3589/// * [with_credentials()]: by default this client uses
3590/// [Application Default Credentials]. Applications using custom
3591/// authentication may need to override this default.
3592///
3593/// [with_endpoint()]: super::builder::image_family_views::ClientBuilder::with_endpoint
3594/// [with_credentials()]: super::builder::image_family_views::ClientBuilder::credentials
3595/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3596/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3597///
3598/// # Pooling and Cloning
3599///
3600/// `ImageFamilyViews` holds a connection pool internally, it is advised to
3601/// create one and the reuse it. You do not need to wrap `ImageFamilyViews` in
3602/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3603/// already uses an `Arc` internally.
3604#[cfg(feature = "image-family-views")]
3605#[cfg_attr(docsrs, doc(cfg(feature = "image-family-views")))]
3606#[derive(Clone, Debug)]
3607pub struct ImageFamilyViews {
3608 inner: std::sync::Arc<dyn super::stub::dynamic::ImageFamilyViews>,
3609}
3610
3611#[cfg(feature = "image-family-views")]
3612impl ImageFamilyViews {
3613 /// Returns a builder for [ImageFamilyViews].
3614 ///
3615 /// ```
3616 /// # tokio_test::block_on(async {
3617 /// # use google_cloud_compute_v1::client::ImageFamilyViews;
3618 /// let client = ImageFamilyViews::builder().build().await?;
3619 /// # gax::client_builder::Result::<()>::Ok(()) });
3620 /// ```
3621 pub fn builder() -> super::builder::image_family_views::ClientBuilder {
3622 gax::client_builder::internal::new_builder(
3623 super::builder::image_family_views::client::Factory,
3624 )
3625 }
3626
3627 /// Creates a new client from the provided stub.
3628 ///
3629 /// The most common case for calling this function is in tests mocking the
3630 /// client's behavior.
3631 pub fn from_stub<T>(stub: T) -> Self
3632 where
3633 T: super::stub::ImageFamilyViews + 'static,
3634 {
3635 Self {
3636 inner: std::sync::Arc::new(stub),
3637 }
3638 }
3639
3640 pub(crate) async fn new(
3641 config: gaxi::options::ClientConfig,
3642 ) -> gax::client_builder::Result<Self> {
3643 let inner = Self::build_inner(config).await?;
3644 Ok(Self { inner })
3645 }
3646
3647 async fn build_inner(
3648 conf: gaxi::options::ClientConfig,
3649 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::ImageFamilyViews>>
3650 {
3651 if gaxi::options::tracing_enabled(&conf) {
3652 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3653 }
3654 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3655 }
3656
3657 async fn build_transport(
3658 conf: gaxi::options::ClientConfig,
3659 ) -> gax::client_builder::Result<impl super::stub::ImageFamilyViews> {
3660 super::transport::ImageFamilyViews::new(conf).await
3661 }
3662
3663 async fn build_with_tracing(
3664 conf: gaxi::options::ClientConfig,
3665 ) -> gax::client_builder::Result<impl super::stub::ImageFamilyViews> {
3666 Self::build_transport(conf)
3667 .await
3668 .map(super::tracing::ImageFamilyViews::new)
3669 }
3670
3671 /// Returns the latest image that is part of an image family, is not
3672 /// deprecated and is rolled out in the specified zone.
3673 pub fn get(&self) -> super::builder::image_family_views::Get {
3674 super::builder::image_family_views::Get::new(self.inner.clone())
3675 }
3676}
3677
3678/// Implements a client for the Google Compute Engine API.
3679///
3680/// # Example
3681/// ```
3682/// # tokio_test::block_on(async {
3683/// # use google_cloud_compute_v1::client::Images;
3684/// let client = Images::builder().build().await?;
3685/// // use `client` to make requests to the Google Compute Engine API.
3686/// # gax::client_builder::Result::<()>::Ok(()) });
3687/// ```
3688///
3689/// # Service Description
3690///
3691/// Service for the `images` resource.
3692///
3693/// # Configuration
3694///
3695/// To configure `Images` use the `with_*` methods in the type returned
3696/// by [builder()][Images::builder]. The default configuration should
3697/// work for most applications. Common configuration changes include
3698///
3699/// * [with_endpoint()]: by default this client uses the global default endpoint
3700/// (`https://compute.googleapis.com`). Applications using regional
3701/// endpoints or running in restricted networks (e.g. a network configured
3702// with [Private Google Access with VPC Service Controls]) may want to
3703/// override this default.
3704/// * [with_credentials()]: by default this client uses
3705/// [Application Default Credentials]. Applications using custom
3706/// authentication may need to override this default.
3707///
3708/// [with_endpoint()]: super::builder::images::ClientBuilder::with_endpoint
3709/// [with_credentials()]: super::builder::images::ClientBuilder::credentials
3710/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3711/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3712///
3713/// # Pooling and Cloning
3714///
3715/// `Images` holds a connection pool internally, it is advised to
3716/// create one and the reuse it. You do not need to wrap `Images` in
3717/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3718/// already uses an `Arc` internally.
3719#[cfg(feature = "images")]
3720#[cfg_attr(docsrs, doc(cfg(feature = "images")))]
3721#[derive(Clone, Debug)]
3722pub struct Images {
3723 inner: std::sync::Arc<dyn super::stub::dynamic::Images>,
3724}
3725
3726#[cfg(feature = "images")]
3727impl Images {
3728 /// Returns a builder for [Images].
3729 ///
3730 /// ```
3731 /// # tokio_test::block_on(async {
3732 /// # use google_cloud_compute_v1::client::Images;
3733 /// let client = Images::builder().build().await?;
3734 /// # gax::client_builder::Result::<()>::Ok(()) });
3735 /// ```
3736 pub fn builder() -> super::builder::images::ClientBuilder {
3737 gax::client_builder::internal::new_builder(super::builder::images::client::Factory)
3738 }
3739
3740 /// Creates a new client from the provided stub.
3741 ///
3742 /// The most common case for calling this function is in tests mocking the
3743 /// client's behavior.
3744 pub fn from_stub<T>(stub: T) -> Self
3745 where
3746 T: super::stub::Images + 'static,
3747 {
3748 Self {
3749 inner: std::sync::Arc::new(stub),
3750 }
3751 }
3752
3753 pub(crate) async fn new(
3754 config: gaxi::options::ClientConfig,
3755 ) -> gax::client_builder::Result<Self> {
3756 let inner = Self::build_inner(config).await?;
3757 Ok(Self { inner })
3758 }
3759
3760 async fn build_inner(
3761 conf: gaxi::options::ClientConfig,
3762 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Images>> {
3763 if gaxi::options::tracing_enabled(&conf) {
3764 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3765 }
3766 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3767 }
3768
3769 async fn build_transport(
3770 conf: gaxi::options::ClientConfig,
3771 ) -> gax::client_builder::Result<impl super::stub::Images> {
3772 super::transport::Images::new(conf).await
3773 }
3774
3775 async fn build_with_tracing(
3776 conf: gaxi::options::ClientConfig,
3777 ) -> gax::client_builder::Result<impl super::stub::Images> {
3778 Self::build_transport(conf)
3779 .await
3780 .map(super::tracing::Images::new)
3781 }
3782
3783 /// Deletes the specified image.
3784 pub fn delete(&self) -> super::builder::images::Delete {
3785 super::builder::images::Delete::new(self.inner.clone())
3786 }
3787
3788 /// Sets the deprecation status of an image.
3789 ///
3790 /// If an empty request body is given, clears the deprecation status instead.
3791 pub fn deprecate(&self) -> super::builder::images::Deprecate {
3792 super::builder::images::Deprecate::new(self.inner.clone())
3793 }
3794
3795 /// Returns the specified image.
3796 pub fn get(&self) -> super::builder::images::Get {
3797 super::builder::images::Get::new(self.inner.clone())
3798 }
3799
3800 /// Returns the latest image that is part of an image family and is not
3801 /// deprecated. For more information on image families, seePublic
3802 /// image families documentation.
3803 pub fn get_from_family(&self) -> super::builder::images::GetFromFamily {
3804 super::builder::images::GetFromFamily::new(self.inner.clone())
3805 }
3806
3807 /// Gets the access control policy for a resource. May be empty if no such
3808 /// policy or resource exists.
3809 pub fn get_iam_policy(&self) -> super::builder::images::GetIamPolicy {
3810 super::builder::images::GetIamPolicy::new(self.inner.clone())
3811 }
3812
3813 /// Creates an image in the specified project using the data included
3814 /// in the request.
3815 pub fn insert(&self) -> super::builder::images::Insert {
3816 super::builder::images::Insert::new(self.inner.clone())
3817 }
3818
3819 /// Retrieves the list of custom images
3820 /// available to the specified project. Custom images are images you
3821 /// create that belong to your project. This method does not
3822 /// get any images that belong to other projects, including publicly-available
3823 /// images, like Debian 8. If you want to get a list of publicly-available
3824 /// images, use this method to make a request to the respective image project,
3825 /// such as debian-cloud or windows-cloud.
3826 pub fn list(&self) -> super::builder::images::List {
3827 super::builder::images::List::new(self.inner.clone())
3828 }
3829
3830 /// Patches the specified image with the data included in the request.
3831 /// Only the following fields can be modified: family, description,
3832 /// deprecation status.
3833 pub fn patch(&self) -> super::builder::images::Patch {
3834 super::builder::images::Patch::new(self.inner.clone())
3835 }
3836
3837 /// Sets the access control policy on the specified resource.
3838 /// Replaces any existing policy.
3839 pub fn set_iam_policy(&self) -> super::builder::images::SetIamPolicy {
3840 super::builder::images::SetIamPolicy::new(self.inner.clone())
3841 }
3842
3843 /// Sets the labels on an image. To learn more about labels, read theLabeling
3844 /// Resources documentation.
3845 pub fn set_labels(&self) -> super::builder::images::SetLabels {
3846 super::builder::images::SetLabels::new(self.inner.clone())
3847 }
3848
3849 /// Returns permissions that a caller has on the specified resource.
3850 pub fn test_iam_permissions(&self) -> super::builder::images::TestIamPermissions {
3851 super::builder::images::TestIamPermissions::new(self.inner.clone())
3852 }
3853
3854 /// Retrieves the specified Operations resource.
3855 pub fn get_operation(&self) -> super::builder::images::GetOperation {
3856 super::builder::images::GetOperation::new(self.inner.clone())
3857 }
3858}
3859
3860/// Implements a client for the Google Compute Engine API.
3861///
3862/// # Example
3863/// ```
3864/// # tokio_test::block_on(async {
3865/// # use google_cloud_compute_v1::client::InstanceGroupManagerResizeRequests;
3866/// let client = InstanceGroupManagerResizeRequests::builder().build().await?;
3867/// // use `client` to make requests to the Google Compute Engine API.
3868/// # gax::client_builder::Result::<()>::Ok(()) });
3869/// ```
3870///
3871/// # Service Description
3872///
3873/// Service for the `instanceGroupManagerResizeRequests` resource.
3874///
3875/// # Configuration
3876///
3877/// To configure `InstanceGroupManagerResizeRequests` use the `with_*` methods in the type returned
3878/// by [builder()][InstanceGroupManagerResizeRequests::builder]. The default configuration should
3879/// work for most applications. Common configuration changes include
3880///
3881/// * [with_endpoint()]: by default this client uses the global default endpoint
3882/// (`https://compute.googleapis.com`). Applications using regional
3883/// endpoints or running in restricted networks (e.g. a network configured
3884// with [Private Google Access with VPC Service Controls]) may want to
3885/// override this default.
3886/// * [with_credentials()]: by default this client uses
3887/// [Application Default Credentials]. Applications using custom
3888/// authentication may need to override this default.
3889///
3890/// [with_endpoint()]: super::builder::instance_group_manager_resize_requests::ClientBuilder::with_endpoint
3891/// [with_credentials()]: super::builder::instance_group_manager_resize_requests::ClientBuilder::credentials
3892/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3893/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3894///
3895/// # Pooling and Cloning
3896///
3897/// `InstanceGroupManagerResizeRequests` holds a connection pool internally, it is advised to
3898/// create one and the reuse it. You do not need to wrap `InstanceGroupManagerResizeRequests` in
3899/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3900/// already uses an `Arc` internally.
3901#[cfg(feature = "instance-group-manager-resize-requests")]
3902#[cfg_attr(docsrs, doc(cfg(feature = "instance-group-manager-resize-requests")))]
3903#[derive(Clone, Debug)]
3904pub struct InstanceGroupManagerResizeRequests {
3905 inner: std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagerResizeRequests>,
3906}
3907
3908#[cfg(feature = "instance-group-manager-resize-requests")]
3909impl InstanceGroupManagerResizeRequests {
3910 /// Returns a builder for [InstanceGroupManagerResizeRequests].
3911 ///
3912 /// ```
3913 /// # tokio_test::block_on(async {
3914 /// # use google_cloud_compute_v1::client::InstanceGroupManagerResizeRequests;
3915 /// let client = InstanceGroupManagerResizeRequests::builder().build().await?;
3916 /// # gax::client_builder::Result::<()>::Ok(()) });
3917 /// ```
3918 pub fn builder() -> super::builder::instance_group_manager_resize_requests::ClientBuilder {
3919 gax::client_builder::internal::new_builder(
3920 super::builder::instance_group_manager_resize_requests::client::Factory,
3921 )
3922 }
3923
3924 /// Creates a new client from the provided stub.
3925 ///
3926 /// The most common case for calling this function is in tests mocking the
3927 /// client's behavior.
3928 pub fn from_stub<T>(stub: T) -> Self
3929 where
3930 T: super::stub::InstanceGroupManagerResizeRequests + 'static,
3931 {
3932 Self {
3933 inner: std::sync::Arc::new(stub),
3934 }
3935 }
3936
3937 pub(crate) async fn new(
3938 config: gaxi::options::ClientConfig,
3939 ) -> gax::client_builder::Result<Self> {
3940 let inner = Self::build_inner(config).await?;
3941 Ok(Self { inner })
3942 }
3943
3944 async fn build_inner(
3945 conf: gaxi::options::ClientConfig,
3946 ) -> gax::client_builder::Result<
3947 std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagerResizeRequests>,
3948 > {
3949 if gaxi::options::tracing_enabled(&conf) {
3950 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3951 }
3952 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3953 }
3954
3955 async fn build_transport(
3956 conf: gaxi::options::ClientConfig,
3957 ) -> gax::client_builder::Result<impl super::stub::InstanceGroupManagerResizeRequests> {
3958 super::transport::InstanceGroupManagerResizeRequests::new(conf).await
3959 }
3960
3961 async fn build_with_tracing(
3962 conf: gaxi::options::ClientConfig,
3963 ) -> gax::client_builder::Result<impl super::stub::InstanceGroupManagerResizeRequests> {
3964 Self::build_transport(conf)
3965 .await
3966 .map(super::tracing::InstanceGroupManagerResizeRequests::new)
3967 }
3968
3969 /// Cancels the specified resize request and removes it from the queue.
3970 /// Cancelled resize request does no longer wait for the resources to be
3971 /// provisioned. Cancel is only possible for requests that are accepted in the
3972 /// queue.
3973 pub fn cancel(&self) -> super::builder::instance_group_manager_resize_requests::Cancel {
3974 super::builder::instance_group_manager_resize_requests::Cancel::new(self.inner.clone())
3975 }
3976
3977 /// Deletes the specified, inactive resize request. Requests that are still
3978 /// active cannot be deleted. Deleting request does not delete instances that
3979 /// were provisioned previously.
3980 pub fn delete(&self) -> super::builder::instance_group_manager_resize_requests::Delete {
3981 super::builder::instance_group_manager_resize_requests::Delete::new(self.inner.clone())
3982 }
3983
3984 /// Returns all of the details about the specified resize request.
3985 pub fn get(&self) -> super::builder::instance_group_manager_resize_requests::Get {
3986 super::builder::instance_group_manager_resize_requests::Get::new(self.inner.clone())
3987 }
3988
3989 /// Creates a new resize request that starts provisioning VMs immediately
3990 /// or queues VM creation.
3991 pub fn insert(&self) -> super::builder::instance_group_manager_resize_requests::Insert {
3992 super::builder::instance_group_manager_resize_requests::Insert::new(self.inner.clone())
3993 }
3994
3995 /// Retrieves a list of resize requests that are contained in the
3996 /// managed instance group.
3997 pub fn list(&self) -> super::builder::instance_group_manager_resize_requests::List {
3998 super::builder::instance_group_manager_resize_requests::List::new(self.inner.clone())
3999 }
4000
4001 /// Retrieves the specified zone-specific Operations resource.
4002 pub fn get_operation(
4003 &self,
4004 ) -> super::builder::instance_group_manager_resize_requests::GetOperation {
4005 super::builder::instance_group_manager_resize_requests::GetOperation::new(
4006 self.inner.clone(),
4007 )
4008 }
4009}
4010
4011/// Implements a client for the Google Compute Engine API.
4012///
4013/// # Example
4014/// ```
4015/// # tokio_test::block_on(async {
4016/// # use google_cloud_compute_v1::client::InstanceGroupManagers;
4017/// let client = InstanceGroupManagers::builder().build().await?;
4018/// // use `client` to make requests to the Google Compute Engine API.
4019/// # gax::client_builder::Result::<()>::Ok(()) });
4020/// ```
4021///
4022/// # Service Description
4023///
4024/// Service for the `instanceGroupManagers` resource.
4025///
4026/// # Configuration
4027///
4028/// To configure `InstanceGroupManagers` use the `with_*` methods in the type returned
4029/// by [builder()][InstanceGroupManagers::builder]. The default configuration should
4030/// work for most applications. Common configuration changes include
4031///
4032/// * [with_endpoint()]: by default this client uses the global default endpoint
4033/// (`https://compute.googleapis.com`). Applications using regional
4034/// endpoints or running in restricted networks (e.g. a network configured
4035// with [Private Google Access with VPC Service Controls]) may want to
4036/// override this default.
4037/// * [with_credentials()]: by default this client uses
4038/// [Application Default Credentials]. Applications using custom
4039/// authentication may need to override this default.
4040///
4041/// [with_endpoint()]: super::builder::instance_group_managers::ClientBuilder::with_endpoint
4042/// [with_credentials()]: super::builder::instance_group_managers::ClientBuilder::credentials
4043/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4044/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4045///
4046/// # Pooling and Cloning
4047///
4048/// `InstanceGroupManagers` holds a connection pool internally, it is advised to
4049/// create one and the reuse it. You do not need to wrap `InstanceGroupManagers` in
4050/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4051/// already uses an `Arc` internally.
4052#[cfg(feature = "instance-group-managers")]
4053#[cfg_attr(docsrs, doc(cfg(feature = "instance-group-managers")))]
4054#[derive(Clone, Debug)]
4055pub struct InstanceGroupManagers {
4056 inner: std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagers>,
4057}
4058
4059#[cfg(feature = "instance-group-managers")]
4060impl InstanceGroupManagers {
4061 /// Returns a builder for [InstanceGroupManagers].
4062 ///
4063 /// ```
4064 /// # tokio_test::block_on(async {
4065 /// # use google_cloud_compute_v1::client::InstanceGroupManagers;
4066 /// let client = InstanceGroupManagers::builder().build().await?;
4067 /// # gax::client_builder::Result::<()>::Ok(()) });
4068 /// ```
4069 pub fn builder() -> super::builder::instance_group_managers::ClientBuilder {
4070 gax::client_builder::internal::new_builder(
4071 super::builder::instance_group_managers::client::Factory,
4072 )
4073 }
4074
4075 /// Creates a new client from the provided stub.
4076 ///
4077 /// The most common case for calling this function is in tests mocking the
4078 /// client's behavior.
4079 pub fn from_stub<T>(stub: T) -> Self
4080 where
4081 T: super::stub::InstanceGroupManagers + 'static,
4082 {
4083 Self {
4084 inner: std::sync::Arc::new(stub),
4085 }
4086 }
4087
4088 pub(crate) async fn new(
4089 config: gaxi::options::ClientConfig,
4090 ) -> gax::client_builder::Result<Self> {
4091 let inner = Self::build_inner(config).await?;
4092 Ok(Self { inner })
4093 }
4094
4095 async fn build_inner(
4096 conf: gaxi::options::ClientConfig,
4097 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagers>>
4098 {
4099 if gaxi::options::tracing_enabled(&conf) {
4100 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4101 }
4102 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4103 }
4104
4105 async fn build_transport(
4106 conf: gaxi::options::ClientConfig,
4107 ) -> gax::client_builder::Result<impl super::stub::InstanceGroupManagers> {
4108 super::transport::InstanceGroupManagers::new(conf).await
4109 }
4110
4111 async fn build_with_tracing(
4112 conf: gaxi::options::ClientConfig,
4113 ) -> gax::client_builder::Result<impl super::stub::InstanceGroupManagers> {
4114 Self::build_transport(conf)
4115 .await
4116 .map(super::tracing::InstanceGroupManagers::new)
4117 }
4118
4119 /// Flags the specified instances to be removed from the
4120 /// managed instance group. Abandoning an instance does not delete the
4121 /// instance, but it does remove the instance from any target pools that are
4122 /// applied by the managed instance group. This method reduces thetargetSize of the managed instance group by the
4123 /// number of instances that you abandon. This operation is marked asDONE when the action is scheduled even if the instances have
4124 /// not yet been removed from the group. You must separately verify the
4125 /// status of the abandoning action with thelistmanagedinstances
4126 /// method.
4127 ///
4128 /// If the group is part of a backend
4129 /// service that has enabled
4130 /// connection draining, it can take up to 60 seconds after the connection
4131 /// draining duration has elapsed before the VM instance is removed or deleted.
4132 ///
4133 /// You can specify a maximum of 1000 instances with this method per request.
4134 pub fn abandon_instances(&self) -> super::builder::instance_group_managers::AbandonInstances {
4135 super::builder::instance_group_managers::AbandonInstances::new(self.inner.clone())
4136 }
4137
4138 /// Retrieves the list of managed instance groups and groups them by zone.
4139 ///
4140 /// To prevent failure, Google recommends that you set the
4141 /// `returnPartialSuccess` parameter to `true`.
4142 pub fn aggregated_list(&self) -> super::builder::instance_group_managers::AggregatedList {
4143 super::builder::instance_group_managers::AggregatedList::new(self.inner.clone())
4144 }
4145
4146 /// Applies changes to selected instances on the managed instance group.
4147 /// This method can be used to apply new overrides and/or new versions.
4148 pub fn apply_updates_to_instances(
4149 &self,
4150 ) -> super::builder::instance_group_managers::ApplyUpdatesToInstances {
4151 super::builder::instance_group_managers::ApplyUpdatesToInstances::new(self.inner.clone())
4152 }
4153
4154 /// Creates instances with per-instance configurations in this managed instance
4155 /// group. Instances are created using the current instance template. Thecreate instances operation is marked DONE if thecreateInstances request is successful. The underlying actions
4156 /// take additional time. You must separately verify the status of thecreating or actions with the listmanagedinstances
4157 /// method.
4158 pub fn create_instances(&self) -> super::builder::instance_group_managers::CreateInstances {
4159 super::builder::instance_group_managers::CreateInstances::new(self.inner.clone())
4160 }
4161
4162 /// Deletes the specified managed instance group and all of the instances
4163 /// in that group. Note that the instance group must not belong to a
4164 /// backend service. Read
4165 /// Deleting an instance group for more information.
4166 pub fn delete(&self) -> super::builder::instance_group_managers::Delete {
4167 super::builder::instance_group_managers::Delete::new(self.inner.clone())
4168 }
4169
4170 /// Flags the specified instances in the managed instance group for immediate
4171 /// deletion. The instances are also removed from any target
4172 /// pools of which they were a member. This method reduces thetargetSize of the managed instance group by the number of
4173 /// instances that you delete. This operation is marked as DONE
4174 /// when the action is scheduled even if the instances are still being deleted.
4175 /// You must separately verify the status of the deleting action
4176 /// with thelistmanagedinstances
4177 /// method.
4178 ///
4179 /// If the group is part of a backend
4180 /// service that has enabled
4181 /// connection draining, it can take up to 60 seconds after the connection
4182 /// draining duration has elapsed before the VM instance is removed or deleted.
4183 ///
4184 /// You can specify a maximum of 1000 instances with this method per request.
4185 pub fn delete_instances(&self) -> super::builder::instance_group_managers::DeleteInstances {
4186 super::builder::instance_group_managers::DeleteInstances::new(self.inner.clone())
4187 }
4188
4189 /// Deletes selected per-instance configurations for the managed instance
4190 /// group.
4191 pub fn delete_per_instance_configs(
4192 &self,
4193 ) -> super::builder::instance_group_managers::DeletePerInstanceConfigs {
4194 super::builder::instance_group_managers::DeletePerInstanceConfigs::new(self.inner.clone())
4195 }
4196
4197 /// Returns all of the details about the specified managed instance group.
4198 pub fn get(&self) -> super::builder::instance_group_managers::Get {
4199 super::builder::instance_group_managers::Get::new(self.inner.clone())
4200 }
4201
4202 /// Creates a managed instance group using the information that you specify
4203 /// in the request. After the group is created, instances in the group are
4204 /// created using the specified instance template.
4205 /// This operation is marked as DONE when the group is created
4206 /// even if the instances in the group have not yet been created. You
4207 /// must separately verify the status of the individual instances with thelistmanagedinstances
4208 /// method.
4209 ///
4210 /// A managed instance group can have up to 1000 VM instances per group. Please
4211 /// contact Cloud Support if you need an increase in
4212 /// this limit.
4213 pub fn insert(&self) -> super::builder::instance_group_managers::Insert {
4214 super::builder::instance_group_managers::Insert::new(self.inner.clone())
4215 }
4216
4217 /// Retrieves a list of managed instance groups that are contained within the
4218 /// specified project and zone.
4219 pub fn list(&self) -> super::builder::instance_group_managers::List {
4220 super::builder::instance_group_managers::List::new(self.inner.clone())
4221 }
4222
4223 /// Lists all errors thrown by actions on instances for a given managed
4224 /// instance group. The filter and orderBy query
4225 /// parameters are not supported.
4226 pub fn list_errors(&self) -> super::builder::instance_group_managers::ListErrors {
4227 super::builder::instance_group_managers::ListErrors::new(self.inner.clone())
4228 }
4229
4230 /// Lists all of the instances in the managed instance group. Each instance
4231 /// in the list has a currentAction, which indicates the action
4232 /// that the managed instance group is performing on the instance. For example,
4233 /// if the group is still creating an instance, the currentAction
4234 /// is CREATING. If a previous action failed, the
4235 /// list displays the errors for that failed action. The orderBy
4236 /// query parameter is not supported. The `pageToken` query parameter is
4237 /// supported only if the group's `listManagedInstancesResults` field is set
4238 /// to `PAGINATED`.
4239 pub fn list_managed_instances(
4240 &self,
4241 ) -> super::builder::instance_group_managers::ListManagedInstances {
4242 super::builder::instance_group_managers::ListManagedInstances::new(self.inner.clone())
4243 }
4244
4245 /// Lists all of the per-instance configurations defined for the managed
4246 /// instance group. The orderBy query parameter is not supported.
4247 pub fn list_per_instance_configs(
4248 &self,
4249 ) -> super::builder::instance_group_managers::ListPerInstanceConfigs {
4250 super::builder::instance_group_managers::ListPerInstanceConfigs::new(self.inner.clone())
4251 }
4252
4253 /// Updates a managed instance group using the information that you specify
4254 /// in the request.
4255 /// This operation is marked as DONE when the group is patched
4256 /// even if the instances in the group are still in the process of being
4257 /// patched. You must separately verify the status of the individual instances
4258 /// with thelistManagedInstances
4259 /// method. This method supportsPATCH
4260 /// semantics and uses theJSON merge
4261 /// patch format and processing rules.
4262 ///
4263 /// If you update your group to specify a new template or instance
4264 /// configuration, it's possible that your intended specification for each VM
4265 /// in the group is different from the current state of that VM. To learn how
4266 /// to apply an updated configuration to the VMs in a MIG, seeUpdating instances in
4267 /// a MIG.
4268 pub fn patch(&self) -> super::builder::instance_group_managers::Patch {
4269 super::builder::instance_group_managers::Patch::new(self.inner.clone())
4270 }
4271
4272 /// Inserts or patches per-instance configurations for the managed instance
4273 /// group. perInstanceConfig.name serves as a key used to
4274 /// distinguish whether to perform insert or patch.
4275 pub fn patch_per_instance_configs(
4276 &self,
4277 ) -> super::builder::instance_group_managers::PatchPerInstanceConfigs {
4278 super::builder::instance_group_managers::PatchPerInstanceConfigs::new(self.inner.clone())
4279 }
4280
4281 /// Flags the specified VM instances in the managed instance group to be
4282 /// immediately recreated. Each instance is recreated using the group's current
4283 /// configuration. This operation is marked as DONE when the flag
4284 /// is set even if the instances have not yet been recreated. You must
4285 /// separately verify the status of each instance by checking itscurrentAction field; for more information, see Checking
4286 /// the status of managed instances.
4287 ///
4288 /// If the group is part of a backend
4289 /// service that has enabled
4290 /// connection draining, it can take up to 60 seconds after the connection
4291 /// draining duration has elapsed before the VM instance is removed or deleted.
4292 ///
4293 /// You can specify a maximum of 1000 instances with this method per request.
4294 pub fn recreate_instances(&self) -> super::builder::instance_group_managers::RecreateInstances {
4295 super::builder::instance_group_managers::RecreateInstances::new(self.inner.clone())
4296 }
4297
4298 /// Resizes the managed instance group. If you increase the size, the group
4299 /// creates new instances using the current instance template. If you decrease
4300 /// the size, the group deletes instances. The resize operation is markedDONE when the resize actions are scheduled even if the group
4301 /// has not yet added or deleted any instances. You must separately
4302 /// verify the status of the creating or deleting
4303 /// actions with thelistmanagedinstances
4304 /// method.
4305 ///
4306 /// When resizing down, the instance group arbitrarily chooses the order in
4307 /// which VMs are deleted. The group takes into account some VM attributes when
4308 /// making the selection including:
4309 ///
4310 /// + The status of the VM instance.
4311 /// + The health of the VM instance.
4312 /// + The instance template version the VM is based on.
4313 /// + For regional managed instance groups, the location of the VM instance.
4314 ///
4315 /// This list is subject to change.
4316 ///
4317 /// If the group is part of a backend
4318 /// service that has enabled
4319 /// connection draining, it can take up to 60 seconds after the connection
4320 /// draining duration has elapsed before the VM instance is removed or deleted.
4321 pub fn resize(&self) -> super::builder::instance_group_managers::Resize {
4322 super::builder::instance_group_managers::Resize::new(self.inner.clone())
4323 }
4324
4325 /// Flags the specified instances in the managed instance group to be
4326 /// resumed. This method increases thetargetSize and decreases the targetSuspendedSize
4327 /// of the managed instance group by the number of instances that you resume.
4328 /// The resumeInstances operation is marked DONE if
4329 /// the resumeInstances request is successful. The underlying
4330 /// actions take additional time. You must separately verify the status of theRESUMING action with thelistmanagedinstances
4331 /// method.
4332 ///
4333 /// In this request, you can only specify instances that are suspended. For
4334 /// example, if an instance was previously suspended using the suspendInstances
4335 /// method, it can be resumed using the resumeInstances method.
4336 ///
4337 /// If a health check is attached to the managed instance group, the specified
4338 /// instances will be verified as healthy after they are resumed.
4339 ///
4340 /// You can specify a maximum of 1000 instances with this method per request.
4341 pub fn resume_instances(&self) -> super::builder::instance_group_managers::ResumeInstances {
4342 super::builder::instance_group_managers::ResumeInstances::new(self.inner.clone())
4343 }
4344
4345 /// Specifies the instance template to use when creating new instances in this
4346 /// group. The templates for existing instances in the group do not change
4347 /// unless you run recreateInstances, runapplyUpdatesToInstances, or set the group'supdatePolicy.type to PROACTIVE.
4348 pub fn set_instance_template(
4349 &self,
4350 ) -> super::builder::instance_group_managers::SetInstanceTemplate {
4351 super::builder::instance_group_managers::SetInstanceTemplate::new(self.inner.clone())
4352 }
4353
4354 /// Modifies the target pools to which all instances in this managed instance
4355 /// group are assigned. The target pools automatically apply to all of the
4356 /// instances in the managed instance group. This operation is markedDONE when you make the request even if the instances have not
4357 /// yet been added to their target pools. The change might take some time to
4358 /// apply to all of the instances in the group depending on the size of the
4359 /// group.
4360 pub fn set_target_pools(&self) -> super::builder::instance_group_managers::SetTargetPools {
4361 super::builder::instance_group_managers::SetTargetPools::new(self.inner.clone())
4362 }
4363
4364 /// Flags the specified instances in the managed instance group to be
4365 /// started. This method increases thetargetSize and decreases the targetStoppedSize
4366 /// of the managed instance group by the number of instances that you start.
4367 /// The startInstances operation is marked DONE if
4368 /// the startInstances request is successful. The underlying
4369 /// actions take additional time. You must separately verify the status of theSTARTING action with thelistmanagedinstances
4370 /// method.
4371 ///
4372 /// In this request, you can only specify instances that are stopped. For
4373 /// example, if an instance was previously stopped using the stopInstances
4374 /// method, it can be started using the startInstances method.
4375 ///
4376 /// If a health check is attached to the managed instance group, the specified
4377 /// instances will be verified as healthy after they are started.
4378 ///
4379 /// You can specify a maximum of 1000 instances with this method per request.
4380 pub fn start_instances(&self) -> super::builder::instance_group_managers::StartInstances {
4381 super::builder::instance_group_managers::StartInstances::new(self.inner.clone())
4382 }
4383
4384 /// Flags the specified instances in the managed instance group to be
4385 /// immediately stopped. You can only specify instances that are running in
4386 /// this request. This method reduces thetargetSize and increases the targetStoppedSize
4387 /// of the managed instance group by the number of instances that you stop.
4388 /// The stopInstances operation is marked DONE if
4389 /// the stopInstances request is successful. The underlying
4390 /// actions take additional time. You must separately verify the status of theSTOPPING action with thelistmanagedinstances
4391 /// method.
4392 ///
4393 /// If the standbyPolicy.initialDelaySec field is set, the group
4394 /// delays stopping the instances until initialDelaySec have
4395 /// passed from instance.creationTimestamp (that is, when the
4396 /// instance was created). This delay gives your application time to
4397 /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
4398 /// will be zero delay.
4399 ///
4400 /// If the group is part of a backend
4401 /// service that has enabled
4402 /// connection draining, it can take up to 60 seconds after the connection
4403 /// draining duration has elapsed before the VM instance is stopped.
4404 ///
4405 /// Stopped instances can be started using the startInstances
4406 /// method.
4407 ///
4408 /// You can specify a maximum of 1000 instances with this method per request.
4409 pub fn stop_instances(&self) -> super::builder::instance_group_managers::StopInstances {
4410 super::builder::instance_group_managers::StopInstances::new(self.inner.clone())
4411 }
4412
4413 /// Flags the specified instances in the managed instance group to be
4414 /// immediately suspended. You can only specify instances that are running in
4415 /// this request. This method reduces thetargetSize and increases the targetSuspendedSize
4416 /// of the managed instance group by the number of instances that you suspend.
4417 /// The suspendInstances operation is marked DONE if
4418 /// the suspendInstances request is successful. The underlying
4419 /// actions take additional time. You must separately verify the status of theSUSPENDING action with thelistmanagedinstances
4420 /// method.
4421 ///
4422 /// If the standbyPolicy.initialDelaySec field is set, the group
4423 /// delays suspension of the instances until initialDelaySec have
4424 /// passed from instance.creationTimestamp (that is, when the
4425 /// instance was created). This delay gives your application time to
4426 /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
4427 /// will be zero delay.
4428 ///
4429 /// If the group is part of a backend
4430 /// service that has enabled
4431 /// connection draining, it can take up to 60 seconds after the connection
4432 /// draining duration has elapsed before the VM instance is suspended.
4433 ///
4434 /// Suspended instances can be resumed using the resumeInstances
4435 /// method.
4436 ///
4437 /// You can specify a maximum of 1000 instances with this method per request.
4438 pub fn suspend_instances(&self) -> super::builder::instance_group_managers::SuspendInstances {
4439 super::builder::instance_group_managers::SuspendInstances::new(self.inner.clone())
4440 }
4441
4442 /// Inserts or updates per-instance configurations for the managed instance
4443 /// group. perInstanceConfig.name serves as a key used to
4444 /// distinguish whether to perform insert or patch.
4445 pub fn update_per_instance_configs(
4446 &self,
4447 ) -> super::builder::instance_group_managers::UpdatePerInstanceConfigs {
4448 super::builder::instance_group_managers::UpdatePerInstanceConfigs::new(self.inner.clone())
4449 }
4450
4451 /// Retrieves the specified zone-specific Operations resource.
4452 pub fn get_operation(&self) -> super::builder::instance_group_managers::GetOperation {
4453 super::builder::instance_group_managers::GetOperation::new(self.inner.clone())
4454 }
4455}
4456
4457/// Implements a client for the Google Compute Engine API.
4458///
4459/// # Example
4460/// ```
4461/// # tokio_test::block_on(async {
4462/// # use google_cloud_compute_v1::client::InstanceGroups;
4463/// let client = InstanceGroups::builder().build().await?;
4464/// // use `client` to make requests to the Google Compute Engine API.
4465/// # gax::client_builder::Result::<()>::Ok(()) });
4466/// ```
4467///
4468/// # Service Description
4469///
4470/// Service for the `instanceGroups` resource.
4471///
4472/// # Configuration
4473///
4474/// To configure `InstanceGroups` use the `with_*` methods in the type returned
4475/// by [builder()][InstanceGroups::builder]. The default configuration should
4476/// work for most applications. Common configuration changes include
4477///
4478/// * [with_endpoint()]: by default this client uses the global default endpoint
4479/// (`https://compute.googleapis.com`). Applications using regional
4480/// endpoints or running in restricted networks (e.g. a network configured
4481// with [Private Google Access with VPC Service Controls]) may want to
4482/// override this default.
4483/// * [with_credentials()]: by default this client uses
4484/// [Application Default Credentials]. Applications using custom
4485/// authentication may need to override this default.
4486///
4487/// [with_endpoint()]: super::builder::instance_groups::ClientBuilder::with_endpoint
4488/// [with_credentials()]: super::builder::instance_groups::ClientBuilder::credentials
4489/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4490/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4491///
4492/// # Pooling and Cloning
4493///
4494/// `InstanceGroups` holds a connection pool internally, it is advised to
4495/// create one and the reuse it. You do not need to wrap `InstanceGroups` in
4496/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4497/// already uses an `Arc` internally.
4498#[cfg(feature = "instance-groups")]
4499#[cfg_attr(docsrs, doc(cfg(feature = "instance-groups")))]
4500#[derive(Clone, Debug)]
4501pub struct InstanceGroups {
4502 inner: std::sync::Arc<dyn super::stub::dynamic::InstanceGroups>,
4503}
4504
4505#[cfg(feature = "instance-groups")]
4506impl InstanceGroups {
4507 /// Returns a builder for [InstanceGroups].
4508 ///
4509 /// ```
4510 /// # tokio_test::block_on(async {
4511 /// # use google_cloud_compute_v1::client::InstanceGroups;
4512 /// let client = InstanceGroups::builder().build().await?;
4513 /// # gax::client_builder::Result::<()>::Ok(()) });
4514 /// ```
4515 pub fn builder() -> super::builder::instance_groups::ClientBuilder {
4516 gax::client_builder::internal::new_builder(super::builder::instance_groups::client::Factory)
4517 }
4518
4519 /// Creates a new client from the provided stub.
4520 ///
4521 /// The most common case for calling this function is in tests mocking the
4522 /// client's behavior.
4523 pub fn from_stub<T>(stub: T) -> Self
4524 where
4525 T: super::stub::InstanceGroups + 'static,
4526 {
4527 Self {
4528 inner: std::sync::Arc::new(stub),
4529 }
4530 }
4531
4532 pub(crate) async fn new(
4533 config: gaxi::options::ClientConfig,
4534 ) -> gax::client_builder::Result<Self> {
4535 let inner = Self::build_inner(config).await?;
4536 Ok(Self { inner })
4537 }
4538
4539 async fn build_inner(
4540 conf: gaxi::options::ClientConfig,
4541 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::InstanceGroups>> {
4542 if gaxi::options::tracing_enabled(&conf) {
4543 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4544 }
4545 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4546 }
4547
4548 async fn build_transport(
4549 conf: gaxi::options::ClientConfig,
4550 ) -> gax::client_builder::Result<impl super::stub::InstanceGroups> {
4551 super::transport::InstanceGroups::new(conf).await
4552 }
4553
4554 async fn build_with_tracing(
4555 conf: gaxi::options::ClientConfig,
4556 ) -> gax::client_builder::Result<impl super::stub::InstanceGroups> {
4557 Self::build_transport(conf)
4558 .await
4559 .map(super::tracing::InstanceGroups::new)
4560 }
4561
4562 /// Adds a list of instances to the specified instance group. All of the
4563 /// instances in the instance group must be in the same network/subnetwork.
4564 /// Read
4565 /// Adding instances for more information.
4566 pub fn add_instances(&self) -> super::builder::instance_groups::AddInstances {
4567 super::builder::instance_groups::AddInstances::new(self.inner.clone())
4568 }
4569
4570 /// Retrieves the list of instance groups and sorts them by zone.
4571 ///
4572 /// To prevent failure, Google recommends that you set the
4573 /// `returnPartialSuccess` parameter to `true`.
4574 pub fn aggregated_list(&self) -> super::builder::instance_groups::AggregatedList {
4575 super::builder::instance_groups::AggregatedList::new(self.inner.clone())
4576 }
4577
4578 /// Deletes the specified instance group. The instances in the group are not
4579 /// deleted. Note that instance group must not belong to a backend service.
4580 /// Read
4581 /// Deleting an instance group for more information.
4582 pub fn delete(&self) -> super::builder::instance_groups::Delete {
4583 super::builder::instance_groups::Delete::new(self.inner.clone())
4584 }
4585
4586 /// Returns the specified zonal instance group. Get a list of available zonal
4587 /// instance groups by making a list() request.
4588 ///
4589 /// For managed instance groups, use theinstanceGroupManagers
4590 /// or regionInstanceGroupManagers
4591 /// methods instead.
4592 pub fn get(&self) -> super::builder::instance_groups::Get {
4593 super::builder::instance_groups::Get::new(self.inner.clone())
4594 }
4595
4596 /// Creates an instance group in the specified project using the
4597 /// parameters that are included in the request.
4598 pub fn insert(&self) -> super::builder::instance_groups::Insert {
4599 super::builder::instance_groups::Insert::new(self.inner.clone())
4600 }
4601
4602 /// Retrieves the list of zonal instance group resources contained within the
4603 /// specified zone.
4604 ///
4605 /// For managed instance groups, use theinstanceGroupManagers
4606 /// or regionInstanceGroupManagers
4607 /// methods instead.
4608 pub fn list(&self) -> super::builder::instance_groups::List {
4609 super::builder::instance_groups::List::new(self.inner.clone())
4610 }
4611
4612 /// Lists the instances in the specified instance group.
4613 /// The orderBy query parameter is not supported.
4614 /// The filter query parameter is supported, but only for
4615 /// expressions that use `eq` (equal) or `ne` (not equal) operators.
4616 pub fn list_instances(&self) -> super::builder::instance_groups::ListInstances {
4617 super::builder::instance_groups::ListInstances::new(self.inner.clone())
4618 }
4619
4620 /// Removes one or more instances from the specified instance group, but does
4621 /// not delete those instances.
4622 ///
4623 /// If the group is part of a backend
4624 /// service that has enabled
4625 /// connection draining, it can take up to 60 seconds after the connection
4626 /// draining duration before the VM instance is removed or deleted.
4627 pub fn remove_instances(&self) -> super::builder::instance_groups::RemoveInstances {
4628 super::builder::instance_groups::RemoveInstances::new(self.inner.clone())
4629 }
4630
4631 /// Sets the named ports for the specified instance group.
4632 pub fn set_named_ports(&self) -> super::builder::instance_groups::SetNamedPorts {
4633 super::builder::instance_groups::SetNamedPorts::new(self.inner.clone())
4634 }
4635
4636 /// Returns permissions that a caller has on the specified resource.
4637 pub fn test_iam_permissions(&self) -> super::builder::instance_groups::TestIamPermissions {
4638 super::builder::instance_groups::TestIamPermissions::new(self.inner.clone())
4639 }
4640
4641 /// Retrieves the specified zone-specific Operations resource.
4642 pub fn get_operation(&self) -> super::builder::instance_groups::GetOperation {
4643 super::builder::instance_groups::GetOperation::new(self.inner.clone())
4644 }
4645}
4646
4647/// Implements a client for the Google Compute Engine API.
4648///
4649/// # Example
4650/// ```
4651/// # tokio_test::block_on(async {
4652/// # use google_cloud_compute_v1::client::InstanceSettings;
4653/// let client = InstanceSettings::builder().build().await?;
4654/// // use `client` to make requests to the Google Compute Engine API.
4655/// # gax::client_builder::Result::<()>::Ok(()) });
4656/// ```
4657///
4658/// # Service Description
4659///
4660/// Service for the `instanceSettings` resource.
4661///
4662/// # Configuration
4663///
4664/// To configure `InstanceSettings` use the `with_*` methods in the type returned
4665/// by [builder()][InstanceSettings::builder]. The default configuration should
4666/// work for most applications. Common configuration changes include
4667///
4668/// * [with_endpoint()]: by default this client uses the global default endpoint
4669/// (`https://compute.googleapis.com`). Applications using regional
4670/// endpoints or running in restricted networks (e.g. a network configured
4671// with [Private Google Access with VPC Service Controls]) may want to
4672/// override this default.
4673/// * [with_credentials()]: by default this client uses
4674/// [Application Default Credentials]. Applications using custom
4675/// authentication may need to override this default.
4676///
4677/// [with_endpoint()]: super::builder::instance_settings::ClientBuilder::with_endpoint
4678/// [with_credentials()]: super::builder::instance_settings::ClientBuilder::credentials
4679/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4680/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4681///
4682/// # Pooling and Cloning
4683///
4684/// `InstanceSettings` holds a connection pool internally, it is advised to
4685/// create one and the reuse it. You do not need to wrap `InstanceSettings` in
4686/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4687/// already uses an `Arc` internally.
4688#[cfg(feature = "instance-settings")]
4689#[cfg_attr(docsrs, doc(cfg(feature = "instance-settings")))]
4690#[derive(Clone, Debug)]
4691pub struct InstanceSettings {
4692 inner: std::sync::Arc<dyn super::stub::dynamic::InstanceSettings>,
4693}
4694
4695#[cfg(feature = "instance-settings")]
4696impl InstanceSettings {
4697 /// Returns a builder for [InstanceSettings].
4698 ///
4699 /// ```
4700 /// # tokio_test::block_on(async {
4701 /// # use google_cloud_compute_v1::client::InstanceSettings;
4702 /// let client = InstanceSettings::builder().build().await?;
4703 /// # gax::client_builder::Result::<()>::Ok(()) });
4704 /// ```
4705 pub fn builder() -> super::builder::instance_settings::ClientBuilder {
4706 gax::client_builder::internal::new_builder(
4707 super::builder::instance_settings::client::Factory,
4708 )
4709 }
4710
4711 /// Creates a new client from the provided stub.
4712 ///
4713 /// The most common case for calling this function is in tests mocking the
4714 /// client's behavior.
4715 pub fn from_stub<T>(stub: T) -> Self
4716 where
4717 T: super::stub::InstanceSettings + 'static,
4718 {
4719 Self {
4720 inner: std::sync::Arc::new(stub),
4721 }
4722 }
4723
4724 pub(crate) async fn new(
4725 config: gaxi::options::ClientConfig,
4726 ) -> gax::client_builder::Result<Self> {
4727 let inner = Self::build_inner(config).await?;
4728 Ok(Self { inner })
4729 }
4730
4731 async fn build_inner(
4732 conf: gaxi::options::ClientConfig,
4733 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::InstanceSettings>>
4734 {
4735 if gaxi::options::tracing_enabled(&conf) {
4736 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4737 }
4738 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4739 }
4740
4741 async fn build_transport(
4742 conf: gaxi::options::ClientConfig,
4743 ) -> gax::client_builder::Result<impl super::stub::InstanceSettings> {
4744 super::transport::InstanceSettings::new(conf).await
4745 }
4746
4747 async fn build_with_tracing(
4748 conf: gaxi::options::ClientConfig,
4749 ) -> gax::client_builder::Result<impl super::stub::InstanceSettings> {
4750 Self::build_transport(conf)
4751 .await
4752 .map(super::tracing::InstanceSettings::new)
4753 }
4754
4755 /// Get Instance settings.
4756 pub fn get(&self) -> super::builder::instance_settings::Get {
4757 super::builder::instance_settings::Get::new(self.inner.clone())
4758 }
4759
4760 /// Patch Instance settings
4761 pub fn patch(&self) -> super::builder::instance_settings::Patch {
4762 super::builder::instance_settings::Patch::new(self.inner.clone())
4763 }
4764
4765 /// Retrieves the specified zone-specific Operations resource.
4766 pub fn get_operation(&self) -> super::builder::instance_settings::GetOperation {
4767 super::builder::instance_settings::GetOperation::new(self.inner.clone())
4768 }
4769}
4770
4771/// Implements a client for the Google Compute Engine API.
4772///
4773/// # Example
4774/// ```
4775/// # tokio_test::block_on(async {
4776/// # use google_cloud_compute_v1::client::InstanceTemplates;
4777/// let client = InstanceTemplates::builder().build().await?;
4778/// // use `client` to make requests to the Google Compute Engine API.
4779/// # gax::client_builder::Result::<()>::Ok(()) });
4780/// ```
4781///
4782/// # Service Description
4783///
4784/// Service for the `instanceTemplates` resource.
4785///
4786/// # Configuration
4787///
4788/// To configure `InstanceTemplates` use the `with_*` methods in the type returned
4789/// by [builder()][InstanceTemplates::builder]. The default configuration should
4790/// work for most applications. Common configuration changes include
4791///
4792/// * [with_endpoint()]: by default this client uses the global default endpoint
4793/// (`https://compute.googleapis.com`). Applications using regional
4794/// endpoints or running in restricted networks (e.g. a network configured
4795// with [Private Google Access with VPC Service Controls]) may want to
4796/// override this default.
4797/// * [with_credentials()]: by default this client uses
4798/// [Application Default Credentials]. Applications using custom
4799/// authentication may need to override this default.
4800///
4801/// [with_endpoint()]: super::builder::instance_templates::ClientBuilder::with_endpoint
4802/// [with_credentials()]: super::builder::instance_templates::ClientBuilder::credentials
4803/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4804/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4805///
4806/// # Pooling and Cloning
4807///
4808/// `InstanceTemplates` holds a connection pool internally, it is advised to
4809/// create one and the reuse it. You do not need to wrap `InstanceTemplates` in
4810/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4811/// already uses an `Arc` internally.
4812#[cfg(feature = "instance-templates")]
4813#[cfg_attr(docsrs, doc(cfg(feature = "instance-templates")))]
4814#[derive(Clone, Debug)]
4815pub struct InstanceTemplates {
4816 inner: std::sync::Arc<dyn super::stub::dynamic::InstanceTemplates>,
4817}
4818
4819#[cfg(feature = "instance-templates")]
4820impl InstanceTemplates {
4821 /// Returns a builder for [InstanceTemplates].
4822 ///
4823 /// ```
4824 /// # tokio_test::block_on(async {
4825 /// # use google_cloud_compute_v1::client::InstanceTemplates;
4826 /// let client = InstanceTemplates::builder().build().await?;
4827 /// # gax::client_builder::Result::<()>::Ok(()) });
4828 /// ```
4829 pub fn builder() -> super::builder::instance_templates::ClientBuilder {
4830 gax::client_builder::internal::new_builder(
4831 super::builder::instance_templates::client::Factory,
4832 )
4833 }
4834
4835 /// Creates a new client from the provided stub.
4836 ///
4837 /// The most common case for calling this function is in tests mocking the
4838 /// client's behavior.
4839 pub fn from_stub<T>(stub: T) -> Self
4840 where
4841 T: super::stub::InstanceTemplates + 'static,
4842 {
4843 Self {
4844 inner: std::sync::Arc::new(stub),
4845 }
4846 }
4847
4848 pub(crate) async fn new(
4849 config: gaxi::options::ClientConfig,
4850 ) -> gax::client_builder::Result<Self> {
4851 let inner = Self::build_inner(config).await?;
4852 Ok(Self { inner })
4853 }
4854
4855 async fn build_inner(
4856 conf: gaxi::options::ClientConfig,
4857 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::InstanceTemplates>>
4858 {
4859 if gaxi::options::tracing_enabled(&conf) {
4860 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4861 }
4862 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4863 }
4864
4865 async fn build_transport(
4866 conf: gaxi::options::ClientConfig,
4867 ) -> gax::client_builder::Result<impl super::stub::InstanceTemplates> {
4868 super::transport::InstanceTemplates::new(conf).await
4869 }
4870
4871 async fn build_with_tracing(
4872 conf: gaxi::options::ClientConfig,
4873 ) -> gax::client_builder::Result<impl super::stub::InstanceTemplates> {
4874 Self::build_transport(conf)
4875 .await
4876 .map(super::tracing::InstanceTemplates::new)
4877 }
4878
4879 /// Retrieves the list of all InstanceTemplates resources, regional and global,
4880 /// available to the specified project.
4881 ///
4882 /// To prevent failure, Google recommends that you set the
4883 /// `returnPartialSuccess` parameter to `true`.
4884 pub fn aggregated_list(&self) -> super::builder::instance_templates::AggregatedList {
4885 super::builder::instance_templates::AggregatedList::new(self.inner.clone())
4886 }
4887
4888 /// Deletes the specified instance template. Deleting an instance template is
4889 /// permanent and cannot be undone. It is not possible to delete templates
4890 /// that are already in use by a managed instance group.
4891 pub fn delete(&self) -> super::builder::instance_templates::Delete {
4892 super::builder::instance_templates::Delete::new(self.inner.clone())
4893 }
4894
4895 /// Returns the specified instance template.
4896 pub fn get(&self) -> super::builder::instance_templates::Get {
4897 super::builder::instance_templates::Get::new(self.inner.clone())
4898 }
4899
4900 /// Gets the access control policy for a resource. May be empty if no such
4901 /// policy or resource exists.
4902 pub fn get_iam_policy(&self) -> super::builder::instance_templates::GetIamPolicy {
4903 super::builder::instance_templates::GetIamPolicy::new(self.inner.clone())
4904 }
4905
4906 /// Creates an instance template in the specified project using the
4907 /// data that is included in the request. If you are creating a new template to
4908 /// update an existing instance group, your new instance template must use the
4909 /// same network or, if applicable, the same subnetwork as the original
4910 /// template.
4911 pub fn insert(&self) -> super::builder::instance_templates::Insert {
4912 super::builder::instance_templates::Insert::new(self.inner.clone())
4913 }
4914
4915 /// Retrieves a list of instance templates that are contained within
4916 /// the specified project.
4917 pub fn list(&self) -> super::builder::instance_templates::List {
4918 super::builder::instance_templates::List::new(self.inner.clone())
4919 }
4920
4921 /// Sets the access control policy on the specified resource.
4922 /// Replaces any existing policy.
4923 pub fn set_iam_policy(&self) -> super::builder::instance_templates::SetIamPolicy {
4924 super::builder::instance_templates::SetIamPolicy::new(self.inner.clone())
4925 }
4926
4927 /// Returns permissions that a caller has on the specified resource.
4928 pub fn test_iam_permissions(&self) -> super::builder::instance_templates::TestIamPermissions {
4929 super::builder::instance_templates::TestIamPermissions::new(self.inner.clone())
4930 }
4931
4932 /// Retrieves the specified Operations resource.
4933 pub fn get_operation(&self) -> super::builder::instance_templates::GetOperation {
4934 super::builder::instance_templates::GetOperation::new(self.inner.clone())
4935 }
4936}
4937
4938/// Implements a client for the Google Compute Engine API.
4939///
4940/// # Example
4941/// ```
4942/// # tokio_test::block_on(async {
4943/// # use google_cloud_compute_v1::client::Instances;
4944/// let client = Instances::builder().build().await?;
4945/// // use `client` to make requests to the Google Compute Engine API.
4946/// # gax::client_builder::Result::<()>::Ok(()) });
4947/// ```
4948///
4949/// # Service Description
4950///
4951/// Service for the `instances` resource.
4952///
4953/// # Configuration
4954///
4955/// To configure `Instances` use the `with_*` methods in the type returned
4956/// by [builder()][Instances::builder]. The default configuration should
4957/// work for most applications. Common configuration changes include
4958///
4959/// * [with_endpoint()]: by default this client uses the global default endpoint
4960/// (`https://compute.googleapis.com`). Applications using regional
4961/// endpoints or running in restricted networks (e.g. a network configured
4962// with [Private Google Access with VPC Service Controls]) may want to
4963/// override this default.
4964/// * [with_credentials()]: by default this client uses
4965/// [Application Default Credentials]. Applications using custom
4966/// authentication may need to override this default.
4967///
4968/// [with_endpoint()]: super::builder::instances::ClientBuilder::with_endpoint
4969/// [with_credentials()]: super::builder::instances::ClientBuilder::credentials
4970/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4971/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4972///
4973/// # Pooling and Cloning
4974///
4975/// `Instances` holds a connection pool internally, it is advised to
4976/// create one and the reuse it. You do not need to wrap `Instances` in
4977/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4978/// already uses an `Arc` internally.
4979#[cfg(feature = "instances")]
4980#[cfg_attr(docsrs, doc(cfg(feature = "instances")))]
4981#[derive(Clone, Debug)]
4982pub struct Instances {
4983 inner: std::sync::Arc<dyn super::stub::dynamic::Instances>,
4984}
4985
4986#[cfg(feature = "instances")]
4987impl Instances {
4988 /// Returns a builder for [Instances].
4989 ///
4990 /// ```
4991 /// # tokio_test::block_on(async {
4992 /// # use google_cloud_compute_v1::client::Instances;
4993 /// let client = Instances::builder().build().await?;
4994 /// # gax::client_builder::Result::<()>::Ok(()) });
4995 /// ```
4996 pub fn builder() -> super::builder::instances::ClientBuilder {
4997 gax::client_builder::internal::new_builder(super::builder::instances::client::Factory)
4998 }
4999
5000 /// Creates a new client from the provided stub.
5001 ///
5002 /// The most common case for calling this function is in tests mocking the
5003 /// client's behavior.
5004 pub fn from_stub<T>(stub: T) -> Self
5005 where
5006 T: super::stub::Instances + 'static,
5007 {
5008 Self {
5009 inner: std::sync::Arc::new(stub),
5010 }
5011 }
5012
5013 pub(crate) async fn new(
5014 config: gaxi::options::ClientConfig,
5015 ) -> gax::client_builder::Result<Self> {
5016 let inner = Self::build_inner(config).await?;
5017 Ok(Self { inner })
5018 }
5019
5020 async fn build_inner(
5021 conf: gaxi::options::ClientConfig,
5022 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Instances>> {
5023 if gaxi::options::tracing_enabled(&conf) {
5024 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5025 }
5026 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5027 }
5028
5029 async fn build_transport(
5030 conf: gaxi::options::ClientConfig,
5031 ) -> gax::client_builder::Result<impl super::stub::Instances> {
5032 super::transport::Instances::new(conf).await
5033 }
5034
5035 async fn build_with_tracing(
5036 conf: gaxi::options::ClientConfig,
5037 ) -> gax::client_builder::Result<impl super::stub::Instances> {
5038 Self::build_transport(conf)
5039 .await
5040 .map(super::tracing::Instances::new)
5041 }
5042
5043 /// Adds an access config to an instance's network interface.
5044 pub fn add_access_config(&self) -> super::builder::instances::AddAccessConfig {
5045 super::builder::instances::AddAccessConfig::new(self.inner.clone())
5046 }
5047
5048 /// Adds one dynamic network interface to an active instance.
5049 pub fn add_network_interface(&self) -> super::builder::instances::AddNetworkInterface {
5050 super::builder::instances::AddNetworkInterface::new(self.inner.clone())
5051 }
5052
5053 /// Adds existing resource policies to an instance. You can only add one
5054 /// policy right now which will be applied to this instance for scheduling live
5055 /// migrations.
5056 pub fn add_resource_policies(&self) -> super::builder::instances::AddResourcePolicies {
5057 super::builder::instances::AddResourcePolicies::new(self.inner.clone())
5058 }
5059
5060 /// Retrieves an aggregated list of all of the instances in your project
5061 /// across all regions and zones.
5062 ///
5063 /// The performance of this method degrades when a filter is specified on a
5064 /// project that has a very large number of instances.
5065 ///
5066 /// To prevent failure, Google recommends that you set the
5067 /// `returnPartialSuccess` parameter to `true`.
5068 pub fn aggregated_list(&self) -> super::builder::instances::AggregatedList {
5069 super::builder::instances::AggregatedList::new(self.inner.clone())
5070 }
5071
5072 /// Attaches an existing Disk resource to an instance. You must first
5073 /// create the disk before you can attach it. It is not possible to create
5074 /// and attach a disk at the same time. For more information, readAdding a
5075 /// persistent disk to your instance.
5076 pub fn attach_disk(&self) -> super::builder::instances::AttachDisk {
5077 super::builder::instances::AttachDisk::new(self.inner.clone())
5078 }
5079
5080 /// Creates multiple instances. Count specifies the number of instances to
5081 /// create. For more information, seeAbout bulk
5082 /// creation of VMs.
5083 pub fn bulk_insert(&self) -> super::builder::instances::BulkInsert {
5084 super::builder::instances::BulkInsert::new(self.inner.clone())
5085 }
5086
5087 /// Deletes the specified Instance resource. For more information, seeDeleting
5088 /// an instance.
5089 pub fn delete(&self) -> super::builder::instances::Delete {
5090 super::builder::instances::Delete::new(self.inner.clone())
5091 }
5092
5093 /// Deletes an access config from an instance's network interface.
5094 pub fn delete_access_config(&self) -> super::builder::instances::DeleteAccessConfig {
5095 super::builder::instances::DeleteAccessConfig::new(self.inner.clone())
5096 }
5097
5098 /// Deletes one dynamic network interface from an active instance.
5099 /// InstancesDeleteNetworkInterfaceRequest indicates:
5100 ///
5101 /// - instance from which to delete, using project+zone+resource_id fields;
5102 /// - dynamic network interface to be deleted, using network_interface_name
5103 /// field;
5104 pub fn delete_network_interface(&self) -> super::builder::instances::DeleteNetworkInterface {
5105 super::builder::instances::DeleteNetworkInterface::new(self.inner.clone())
5106 }
5107
5108 /// Detaches a disk from an instance.
5109 pub fn detach_disk(&self) -> super::builder::instances::DetachDisk {
5110 super::builder::instances::DetachDisk::new(self.inner.clone())
5111 }
5112
5113 /// Returns the specified Instance resource.
5114 pub fn get(&self) -> super::builder::instances::Get {
5115 super::builder::instances::Get::new(self.inner.clone())
5116 }
5117
5118 /// Returns effective firewalls applied to an interface of the instance.
5119 pub fn get_effective_firewalls(&self) -> super::builder::instances::GetEffectiveFirewalls {
5120 super::builder::instances::GetEffectiveFirewalls::new(self.inner.clone())
5121 }
5122
5123 /// Returns the specified guest attributes entry.
5124 pub fn get_guest_attributes(&self) -> super::builder::instances::GetGuestAttributes {
5125 super::builder::instances::GetGuestAttributes::new(self.inner.clone())
5126 }
5127
5128 /// Gets the access control policy for a resource. May be empty if no such
5129 /// policy or resource exists.
5130 pub fn get_iam_policy(&self) -> super::builder::instances::GetIamPolicy {
5131 super::builder::instances::GetIamPolicy::new(self.inner.clone())
5132 }
5133
5134 /// Returns the screenshot from the specified instance.
5135 pub fn get_screenshot(&self) -> super::builder::instances::GetScreenshot {
5136 super::builder::instances::GetScreenshot::new(self.inner.clone())
5137 }
5138
5139 /// Returns the last 1 MB of serial port output from the specified instance.
5140 pub fn get_serial_port_output(&self) -> super::builder::instances::GetSerialPortOutput {
5141 super::builder::instances::GetSerialPortOutput::new(self.inner.clone())
5142 }
5143
5144 /// Returns the Shielded Instance Identity of an instance
5145 pub fn get_shielded_instance_identity(
5146 &self,
5147 ) -> super::builder::instances::GetShieldedInstanceIdentity {
5148 super::builder::instances::GetShieldedInstanceIdentity::new(self.inner.clone())
5149 }
5150
5151 /// Creates an instance resource in the specified project using the data
5152 /// included in the request.
5153 pub fn insert(&self) -> super::builder::instances::Insert {
5154 super::builder::instances::Insert::new(self.inner.clone())
5155 }
5156
5157 /// Retrieves the list of instances contained within
5158 /// the specified zone.
5159 pub fn list(&self) -> super::builder::instances::List {
5160 super::builder::instances::List::new(self.inner.clone())
5161 }
5162
5163 /// Retrieves a list of resources that refer to the VM instance specified in
5164 /// the request. For example, if the VM instance is part of a managed or
5165 /// unmanaged instance group, the referrers list includes the instance group.
5166 /// For more information, readViewing
5167 /// referrers to VM instances.
5168 pub fn list_referrers(&self) -> super::builder::instances::ListReferrers {
5169 super::builder::instances::ListReferrers::new(self.inner.clone())
5170 }
5171
5172 /// Perform a manual maintenance on the instance.
5173 pub fn perform_maintenance(&self) -> super::builder::instances::PerformMaintenance {
5174 super::builder::instances::PerformMaintenance::new(self.inner.clone())
5175 }
5176
5177 /// Removes resource policies from an instance.
5178 pub fn remove_resource_policies(&self) -> super::builder::instances::RemoveResourcePolicies {
5179 super::builder::instances::RemoveResourcePolicies::new(self.inner.clone())
5180 }
5181
5182 /// Mark the host as faulty and try to restart the instance on a new host.
5183 pub fn report_host_as_faulty(&self) -> super::builder::instances::ReportHostAsFaulty {
5184 super::builder::instances::ReportHostAsFaulty::new(self.inner.clone())
5185 }
5186
5187 /// Performs a reset on the instance. This is a hard reset. The VM
5188 /// does not do a graceful shutdown. For more information, seeResetting
5189 /// an instance.
5190 pub fn reset(&self) -> super::builder::instances::Reset {
5191 super::builder::instances::Reset::new(self.inner.clone())
5192 }
5193
5194 /// Resumes an instance that was suspended using theinstances().suspend
5195 /// method.
5196 pub fn resume(&self) -> super::builder::instances::Resume {
5197 super::builder::instances::Resume::new(self.inner.clone())
5198 }
5199
5200 /// Sends diagnostic interrupt to the instance.
5201 pub fn send_diagnostic_interrupt(&self) -> super::builder::instances::SendDiagnosticInterrupt {
5202 super::builder::instances::SendDiagnosticInterrupt::new(self.inner.clone())
5203 }
5204
5205 /// Sets deletion protection on the instance.
5206 pub fn set_deletion_protection(&self) -> super::builder::instances::SetDeletionProtection {
5207 super::builder::instances::SetDeletionProtection::new(self.inner.clone())
5208 }
5209
5210 /// Sets the auto-delete flag for a disk attached to an instance.
5211 pub fn set_disk_auto_delete(&self) -> super::builder::instances::SetDiskAutoDelete {
5212 super::builder::instances::SetDiskAutoDelete::new(self.inner.clone())
5213 }
5214
5215 /// Sets the access control policy on the specified resource.
5216 /// Replaces any existing policy.
5217 pub fn set_iam_policy(&self) -> super::builder::instances::SetIamPolicy {
5218 super::builder::instances::SetIamPolicy::new(self.inner.clone())
5219 }
5220
5221 /// Sets labels on an instance. To learn more about labels, read theLabeling
5222 /// Resources documentation.
5223 pub fn set_labels(&self) -> super::builder::instances::SetLabels {
5224 super::builder::instances::SetLabels::new(self.inner.clone())
5225 }
5226
5227 /// Changes the number and/or type of accelerator for a stopped instance to the
5228 /// values specified in the request.
5229 pub fn set_machine_resources(&self) -> super::builder::instances::SetMachineResources {
5230 super::builder::instances::SetMachineResources::new(self.inner.clone())
5231 }
5232
5233 /// Changes the machine type for a stopped instance to the machine
5234 /// type specified in the request.
5235 pub fn set_machine_type(&self) -> super::builder::instances::SetMachineType {
5236 super::builder::instances::SetMachineType::new(self.inner.clone())
5237 }
5238
5239 /// Sets metadata for the specified instance to the data included
5240 /// in the request.
5241 pub fn set_metadata(&self) -> super::builder::instances::SetMetadata {
5242 super::builder::instances::SetMetadata::new(self.inner.clone())
5243 }
5244
5245 /// Changes the minimum CPU platform that this instance should use.
5246 /// This method can only
5247 /// be called on a stopped instance. For more information, readSpecifying a
5248 /// Minimum CPU Platform.
5249 pub fn set_min_cpu_platform(&self) -> super::builder::instances::SetMinCpuPlatform {
5250 super::builder::instances::SetMinCpuPlatform::new(self.inner.clone())
5251 }
5252
5253 /// Sets name of an instance.
5254 pub fn set_name(&self) -> super::builder::instances::SetName {
5255 super::builder::instances::SetName::new(self.inner.clone())
5256 }
5257
5258 /// Sets an instance's scheduling options. You can only call this method on astopped instance,
5259 /// that is, a VM instance that is in a `TERMINATED` state. SeeInstance Life
5260 /// Cycle for more information on the possible instance states.
5261 /// For more information about setting scheduling options for a VM, seeSet
5262 /// VM host maintenance policy.
5263 pub fn set_scheduling(&self) -> super::builder::instances::SetScheduling {
5264 super::builder::instances::SetScheduling::new(self.inner.clone())
5265 }
5266
5267 /// Sets the Google Cloud Armor security policy for the specified instance.
5268 /// For more information, seeGoogle
5269 /// Cloud Armor Overview
5270 pub fn set_security_policy(&self) -> super::builder::instances::SetSecurityPolicy {
5271 super::builder::instances::SetSecurityPolicy::new(self.inner.clone())
5272 }
5273
5274 /// Sets the service account on the instance. For more information,
5275 /// readChanging
5276 /// the service account and access scopes for an instance.
5277 pub fn set_service_account(&self) -> super::builder::instances::SetServiceAccount {
5278 super::builder::instances::SetServiceAccount::new(self.inner.clone())
5279 }
5280
5281 /// Sets the Shielded Instance integrity policy for an instance. You can
5282 /// only use this method on a running instance. This method
5283 /// supports PATCH semantics and uses the JSON merge
5284 /// patch format and processing rules.
5285 pub fn set_shielded_instance_integrity_policy(
5286 &self,
5287 ) -> super::builder::instances::SetShieldedInstanceIntegrityPolicy {
5288 super::builder::instances::SetShieldedInstanceIntegrityPolicy::new(self.inner.clone())
5289 }
5290
5291 /// Sets network tags
5292 /// for the specified instance to the data included in the request.
5293 pub fn set_tags(&self) -> super::builder::instances::SetTags {
5294 super::builder::instances::SetTags::new(self.inner.clone())
5295 }
5296
5297 /// Simulates a host maintenance event on a VM. For more information, see
5298 /// Simulate a host maintenance event.
5299 pub fn simulate_maintenance_event(
5300 &self,
5301 ) -> super::builder::instances::SimulateMaintenanceEvent {
5302 super::builder::instances::SimulateMaintenanceEvent::new(self.inner.clone())
5303 }
5304
5305 /// Starts an instance that was stopped using theinstances().stop
5306 /// method. For more information, seeRestart an
5307 /// instance.
5308 pub fn start(&self) -> super::builder::instances::Start {
5309 super::builder::instances::Start::new(self.inner.clone())
5310 }
5311
5312 /// Starts an instance that was stopped using theinstances().stop
5313 /// method. For more information, seeRestart an
5314 /// instance.
5315 pub fn start_with_encryption_key(&self) -> super::builder::instances::StartWithEncryptionKey {
5316 super::builder::instances::StartWithEncryptionKey::new(self.inner.clone())
5317 }
5318
5319 /// Stops a running instance, shutting it down cleanly, and allows
5320 /// you to restart the instance at a later time. Stopped instances do not incur
5321 /// VM usage charges while they are stopped. However, resources that the VM is
5322 /// using, such as persistent disks and static IP addresses, will continue to
5323 /// be charged until they are deleted. For more information, seeStopping
5324 /// an instance.
5325 pub fn stop(&self) -> super::builder::instances::Stop {
5326 super::builder::instances::Stop::new(self.inner.clone())
5327 }
5328
5329 /// This method suspends a running instance, saving its state to persistent
5330 /// storage, and allows you to resume the instance at a later time. Suspended
5331 /// instances have no compute costs (cores or RAM), and incur only storage
5332 /// charges for the saved VM memory and localSSD data. Any charged resources
5333 /// the virtual machine was using, such as persistent disks and static IP
5334 /// addresses, will continue to be charged while the instance is suspended.
5335 /// For more information, see
5336 /// Suspending and resuming an instance.
5337 pub fn suspend(&self) -> super::builder::instances::Suspend {
5338 super::builder::instances::Suspend::new(self.inner.clone())
5339 }
5340
5341 /// Returns permissions that a caller has on the specified resource.
5342 pub fn test_iam_permissions(&self) -> super::builder::instances::TestIamPermissions {
5343 super::builder::instances::TestIamPermissions::new(self.inner.clone())
5344 }
5345
5346 /// Updates an instance only if the necessary resources are available. This
5347 /// method can update only a specific set of instance properties. See
5348 /// Updating a running instance for a list of updatable instance
5349 /// properties.
5350 pub fn update(&self) -> super::builder::instances::Update {
5351 super::builder::instances::Update::new(self.inner.clone())
5352 }
5353
5354 /// Updates the specified access config from an instance's network interface
5355 /// with the data included in the request. This method supportsPATCH
5356 /// semantics and uses theJSON merge
5357 /// patch format and processing rules.
5358 pub fn update_access_config(&self) -> super::builder::instances::UpdateAccessConfig {
5359 super::builder::instances::UpdateAccessConfig::new(self.inner.clone())
5360 }
5361
5362 /// Updates the Display config for a VM instance. You can
5363 /// only use this method on a stopped VM instance. This method supportsPATCH
5364 /// semantics and uses theJSON merge
5365 /// patch format and processing rules.
5366 pub fn update_display_device(&self) -> super::builder::instances::UpdateDisplayDevice {
5367 super::builder::instances::UpdateDisplayDevice::new(self.inner.clone())
5368 }
5369
5370 /// Updates an instance's network interface. This method can only update an
5371 /// interface's alias IP range and attached network. See Modifying
5372 /// alias IP ranges for an existing instance for instructions on
5373 /// changing alias IP ranges. See Migrating
5374 /// a VM between networks for instructions on migrating an interface.
5375 /// This method follows PATCH semantics.
5376 pub fn update_network_interface(&self) -> super::builder::instances::UpdateNetworkInterface {
5377 super::builder::instances::UpdateNetworkInterface::new(self.inner.clone())
5378 }
5379
5380 /// Updates the Shielded Instance config for an instance. You can
5381 /// only use this method on a stopped instance. This method supportsPATCH
5382 /// semantics and uses theJSON merge
5383 /// patch format and processing rules.
5384 pub fn update_shielded_instance_config(
5385 &self,
5386 ) -> super::builder::instances::UpdateShieldedInstanceConfig {
5387 super::builder::instances::UpdateShieldedInstanceConfig::new(self.inner.clone())
5388 }
5389
5390 /// Retrieves the specified zone-specific Operations resource.
5391 pub fn get_operation(&self) -> super::builder::instances::GetOperation {
5392 super::builder::instances::GetOperation::new(self.inner.clone())
5393 }
5394}
5395
5396/// Implements a client for the Google Compute Engine API.
5397///
5398/// # Example
5399/// ```
5400/// # tokio_test::block_on(async {
5401/// # use google_cloud_compute_v1::client::InstantSnapshots;
5402/// let client = InstantSnapshots::builder().build().await?;
5403/// // use `client` to make requests to the Google Compute Engine API.
5404/// # gax::client_builder::Result::<()>::Ok(()) });
5405/// ```
5406///
5407/// # Service Description
5408///
5409/// Service for the `instantSnapshots` resource.
5410///
5411/// # Configuration
5412///
5413/// To configure `InstantSnapshots` use the `with_*` methods in the type returned
5414/// by [builder()][InstantSnapshots::builder]. The default configuration should
5415/// work for most applications. Common configuration changes include
5416///
5417/// * [with_endpoint()]: by default this client uses the global default endpoint
5418/// (`https://compute.googleapis.com`). Applications using regional
5419/// endpoints or running in restricted networks (e.g. a network configured
5420// with [Private Google Access with VPC Service Controls]) may want to
5421/// override this default.
5422/// * [with_credentials()]: by default this client uses
5423/// [Application Default Credentials]. Applications using custom
5424/// authentication may need to override this default.
5425///
5426/// [with_endpoint()]: super::builder::instant_snapshots::ClientBuilder::with_endpoint
5427/// [with_credentials()]: super::builder::instant_snapshots::ClientBuilder::credentials
5428/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5429/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5430///
5431/// # Pooling and Cloning
5432///
5433/// `InstantSnapshots` holds a connection pool internally, it is advised to
5434/// create one and the reuse it. You do not need to wrap `InstantSnapshots` in
5435/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5436/// already uses an `Arc` internally.
5437#[cfg(feature = "instant-snapshots")]
5438#[cfg_attr(docsrs, doc(cfg(feature = "instant-snapshots")))]
5439#[derive(Clone, Debug)]
5440pub struct InstantSnapshots {
5441 inner: std::sync::Arc<dyn super::stub::dynamic::InstantSnapshots>,
5442}
5443
5444#[cfg(feature = "instant-snapshots")]
5445impl InstantSnapshots {
5446 /// Returns a builder for [InstantSnapshots].
5447 ///
5448 /// ```
5449 /// # tokio_test::block_on(async {
5450 /// # use google_cloud_compute_v1::client::InstantSnapshots;
5451 /// let client = InstantSnapshots::builder().build().await?;
5452 /// # gax::client_builder::Result::<()>::Ok(()) });
5453 /// ```
5454 pub fn builder() -> super::builder::instant_snapshots::ClientBuilder {
5455 gax::client_builder::internal::new_builder(
5456 super::builder::instant_snapshots::client::Factory,
5457 )
5458 }
5459
5460 /// Creates a new client from the provided stub.
5461 ///
5462 /// The most common case for calling this function is in tests mocking the
5463 /// client's behavior.
5464 pub fn from_stub<T>(stub: T) -> Self
5465 where
5466 T: super::stub::InstantSnapshots + 'static,
5467 {
5468 Self {
5469 inner: std::sync::Arc::new(stub),
5470 }
5471 }
5472
5473 pub(crate) async fn new(
5474 config: gaxi::options::ClientConfig,
5475 ) -> gax::client_builder::Result<Self> {
5476 let inner = Self::build_inner(config).await?;
5477 Ok(Self { inner })
5478 }
5479
5480 async fn build_inner(
5481 conf: gaxi::options::ClientConfig,
5482 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::InstantSnapshots>>
5483 {
5484 if gaxi::options::tracing_enabled(&conf) {
5485 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5486 }
5487 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5488 }
5489
5490 async fn build_transport(
5491 conf: gaxi::options::ClientConfig,
5492 ) -> gax::client_builder::Result<impl super::stub::InstantSnapshots> {
5493 super::transport::InstantSnapshots::new(conf).await
5494 }
5495
5496 async fn build_with_tracing(
5497 conf: gaxi::options::ClientConfig,
5498 ) -> gax::client_builder::Result<impl super::stub::InstantSnapshots> {
5499 Self::build_transport(conf)
5500 .await
5501 .map(super::tracing::InstantSnapshots::new)
5502 }
5503
5504 /// Retrieves an aggregated list of instantSnapshots.
5505 ///
5506 /// To prevent failure, Google recommends that you set the
5507 /// `returnPartialSuccess` parameter to `true`.
5508 pub fn aggregated_list(&self) -> super::builder::instant_snapshots::AggregatedList {
5509 super::builder::instant_snapshots::AggregatedList::new(self.inner.clone())
5510 }
5511
5512 /// Deletes the specified InstantSnapshot resource. Keep in mind that deleting
5513 /// a single instantSnapshot might not necessarily delete all the data on that
5514 /// instantSnapshot. If any data on the instantSnapshot that is marked for
5515 /// deletion is needed for subsequent instantSnapshots, the data will be moved
5516 /// to the next corresponding instantSnapshot.
5517 ///
5518 /// For more information, seeDeleting
5519 /// instantSnapshots.
5520 pub fn delete(&self) -> super::builder::instant_snapshots::Delete {
5521 super::builder::instant_snapshots::Delete::new(self.inner.clone())
5522 }
5523
5524 /// Returns the specified InstantSnapshot resource in the specified zone.
5525 pub fn get(&self) -> super::builder::instant_snapshots::Get {
5526 super::builder::instant_snapshots::Get::new(self.inner.clone())
5527 }
5528
5529 /// Gets the access control policy for a resource. May be empty if no such
5530 /// policy or resource exists.
5531 pub fn get_iam_policy(&self) -> super::builder::instant_snapshots::GetIamPolicy {
5532 super::builder::instant_snapshots::GetIamPolicy::new(self.inner.clone())
5533 }
5534
5535 /// Creates an instant snapshot in the specified zone.
5536 pub fn insert(&self) -> super::builder::instant_snapshots::Insert {
5537 super::builder::instant_snapshots::Insert::new(self.inner.clone())
5538 }
5539
5540 /// Retrieves the list of InstantSnapshot resources contained within
5541 /// the specified zone.
5542 pub fn list(&self) -> super::builder::instant_snapshots::List {
5543 super::builder::instant_snapshots::List::new(self.inner.clone())
5544 }
5545
5546 /// Sets the access control policy on the specified resource.
5547 /// Replaces any existing policy.
5548 pub fn set_iam_policy(&self) -> super::builder::instant_snapshots::SetIamPolicy {
5549 super::builder::instant_snapshots::SetIamPolicy::new(self.inner.clone())
5550 }
5551
5552 /// Sets the labels on a instantSnapshot in the given zone. To learn more about
5553 /// labels, read the Labeling
5554 /// Resources documentation.
5555 pub fn set_labels(&self) -> super::builder::instant_snapshots::SetLabels {
5556 super::builder::instant_snapshots::SetLabels::new(self.inner.clone())
5557 }
5558
5559 /// Returns permissions that a caller has on the specified resource.
5560 pub fn test_iam_permissions(&self) -> super::builder::instant_snapshots::TestIamPermissions {
5561 super::builder::instant_snapshots::TestIamPermissions::new(self.inner.clone())
5562 }
5563
5564 /// Retrieves the specified zone-specific Operations resource.
5565 pub fn get_operation(&self) -> super::builder::instant_snapshots::GetOperation {
5566 super::builder::instant_snapshots::GetOperation::new(self.inner.clone())
5567 }
5568}
5569
5570/// Implements a client for the Google Compute Engine API.
5571///
5572/// # Example
5573/// ```
5574/// # tokio_test::block_on(async {
5575/// # use google_cloud_compute_v1::client::InterconnectAttachmentGroups;
5576/// let client = InterconnectAttachmentGroups::builder().build().await?;
5577/// // use `client` to make requests to the Google Compute Engine API.
5578/// # gax::client_builder::Result::<()>::Ok(()) });
5579/// ```
5580///
5581/// # Service Description
5582///
5583/// Service for the `interconnectAttachmentGroups` resource.
5584///
5585/// # Configuration
5586///
5587/// To configure `InterconnectAttachmentGroups` use the `with_*` methods in the type returned
5588/// by [builder()][InterconnectAttachmentGroups::builder]. The default configuration should
5589/// work for most applications. Common configuration changes include
5590///
5591/// * [with_endpoint()]: by default this client uses the global default endpoint
5592/// (`https://compute.googleapis.com`). Applications using regional
5593/// endpoints or running in restricted networks (e.g. a network configured
5594// with [Private Google Access with VPC Service Controls]) may want to
5595/// override this default.
5596/// * [with_credentials()]: by default this client uses
5597/// [Application Default Credentials]. Applications using custom
5598/// authentication may need to override this default.
5599///
5600/// [with_endpoint()]: super::builder::interconnect_attachment_groups::ClientBuilder::with_endpoint
5601/// [with_credentials()]: super::builder::interconnect_attachment_groups::ClientBuilder::credentials
5602/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5603/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5604///
5605/// # Pooling and Cloning
5606///
5607/// `InterconnectAttachmentGroups` holds a connection pool internally, it is advised to
5608/// create one and the reuse it. You do not need to wrap `InterconnectAttachmentGroups` in
5609/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5610/// already uses an `Arc` internally.
5611#[cfg(feature = "interconnect-attachment-groups")]
5612#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-attachment-groups")))]
5613#[derive(Clone, Debug)]
5614pub struct InterconnectAttachmentGroups {
5615 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachmentGroups>,
5616}
5617
5618#[cfg(feature = "interconnect-attachment-groups")]
5619impl InterconnectAttachmentGroups {
5620 /// Returns a builder for [InterconnectAttachmentGroups].
5621 ///
5622 /// ```
5623 /// # tokio_test::block_on(async {
5624 /// # use google_cloud_compute_v1::client::InterconnectAttachmentGroups;
5625 /// let client = InterconnectAttachmentGroups::builder().build().await?;
5626 /// # gax::client_builder::Result::<()>::Ok(()) });
5627 /// ```
5628 pub fn builder() -> super::builder::interconnect_attachment_groups::ClientBuilder {
5629 gax::client_builder::internal::new_builder(
5630 super::builder::interconnect_attachment_groups::client::Factory,
5631 )
5632 }
5633
5634 /// Creates a new client from the provided stub.
5635 ///
5636 /// The most common case for calling this function is in tests mocking the
5637 /// client's behavior.
5638 pub fn from_stub<T>(stub: T) -> Self
5639 where
5640 T: super::stub::InterconnectAttachmentGroups + 'static,
5641 {
5642 Self {
5643 inner: std::sync::Arc::new(stub),
5644 }
5645 }
5646
5647 pub(crate) async fn new(
5648 config: gaxi::options::ClientConfig,
5649 ) -> gax::client_builder::Result<Self> {
5650 let inner = Self::build_inner(config).await?;
5651 Ok(Self { inner })
5652 }
5653
5654 async fn build_inner(
5655 conf: gaxi::options::ClientConfig,
5656 ) -> gax::client_builder::Result<
5657 std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachmentGroups>,
5658 > {
5659 if gaxi::options::tracing_enabled(&conf) {
5660 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5661 }
5662 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5663 }
5664
5665 async fn build_transport(
5666 conf: gaxi::options::ClientConfig,
5667 ) -> gax::client_builder::Result<impl super::stub::InterconnectAttachmentGroups> {
5668 super::transport::InterconnectAttachmentGroups::new(conf).await
5669 }
5670
5671 async fn build_with_tracing(
5672 conf: gaxi::options::ClientConfig,
5673 ) -> gax::client_builder::Result<impl super::stub::InterconnectAttachmentGroups> {
5674 Self::build_transport(conf)
5675 .await
5676 .map(super::tracing::InterconnectAttachmentGroups::new)
5677 }
5678
5679 /// Deletes the specified InterconnectAttachmentGroup in the given scope
5680 pub fn delete(&self) -> super::builder::interconnect_attachment_groups::Delete {
5681 super::builder::interconnect_attachment_groups::Delete::new(self.inner.clone())
5682 }
5683
5684 /// Returns the specified InterconnectAttachmentGroup resource in the given
5685 /// scope.
5686 pub fn get(&self) -> super::builder::interconnect_attachment_groups::Get {
5687 super::builder::interconnect_attachment_groups::Get::new(self.inner.clone())
5688 }
5689
5690 /// Gets the access control policy for a resource. May be empty if no such
5691 /// policy or resource exists.
5692 pub fn get_iam_policy(&self) -> super::builder::interconnect_attachment_groups::GetIamPolicy {
5693 super::builder::interconnect_attachment_groups::GetIamPolicy::new(self.inner.clone())
5694 }
5695
5696 /// Returns the InterconnectAttachmentStatuses for the specified
5697 /// InterconnectAttachmentGroup resource.
5698 pub fn get_operational_status(
5699 &self,
5700 ) -> super::builder::interconnect_attachment_groups::GetOperationalStatus {
5701 super::builder::interconnect_attachment_groups::GetOperationalStatus::new(
5702 self.inner.clone(),
5703 )
5704 }
5705
5706 /// Creates a InterconnectAttachmentGroup in the specified project in the given
5707 /// scope using the parameters that are included in the request.
5708 pub fn insert(&self) -> super::builder::interconnect_attachment_groups::Insert {
5709 super::builder::interconnect_attachment_groups::Insert::new(self.inner.clone())
5710 }
5711
5712 /// Lists the InterconnectAttachmentGroups for a project in the given scope.
5713 pub fn list(&self) -> super::builder::interconnect_attachment_groups::List {
5714 super::builder::interconnect_attachment_groups::List::new(self.inner.clone())
5715 }
5716
5717 /// Patches the specified InterconnectAttachmentGroup resource with the data
5718 /// included in the request. This method supports PATCH
5719 /// semantics and usesJSON merge
5720 /// patch format and processing rules.
5721 pub fn patch(&self) -> super::builder::interconnect_attachment_groups::Patch {
5722 super::builder::interconnect_attachment_groups::Patch::new(self.inner.clone())
5723 }
5724
5725 /// Sets the access control policy on the specified resource.
5726 /// Replaces any existing policy.
5727 pub fn set_iam_policy(&self) -> super::builder::interconnect_attachment_groups::SetIamPolicy {
5728 super::builder::interconnect_attachment_groups::SetIamPolicy::new(self.inner.clone())
5729 }
5730
5731 /// Returns permissions that a caller has on the specified resource.
5732 pub fn test_iam_permissions(
5733 &self,
5734 ) -> super::builder::interconnect_attachment_groups::TestIamPermissions {
5735 super::builder::interconnect_attachment_groups::TestIamPermissions::new(self.inner.clone())
5736 }
5737
5738 /// Retrieves the specified Operations resource.
5739 pub fn get_operation(&self) -> super::builder::interconnect_attachment_groups::GetOperation {
5740 super::builder::interconnect_attachment_groups::GetOperation::new(self.inner.clone())
5741 }
5742}
5743
5744/// Implements a client for the Google Compute Engine API.
5745///
5746/// # Example
5747/// ```
5748/// # tokio_test::block_on(async {
5749/// # use google_cloud_compute_v1::client::InterconnectAttachments;
5750/// let client = InterconnectAttachments::builder().build().await?;
5751/// // use `client` to make requests to the Google Compute Engine API.
5752/// # gax::client_builder::Result::<()>::Ok(()) });
5753/// ```
5754///
5755/// # Service Description
5756///
5757/// Service for the `interconnectAttachments` resource.
5758///
5759/// # Configuration
5760///
5761/// To configure `InterconnectAttachments` use the `with_*` methods in the type returned
5762/// by [builder()][InterconnectAttachments::builder]. The default configuration should
5763/// work for most applications. Common configuration changes include
5764///
5765/// * [with_endpoint()]: by default this client uses the global default endpoint
5766/// (`https://compute.googleapis.com`). Applications using regional
5767/// endpoints or running in restricted networks (e.g. a network configured
5768// with [Private Google Access with VPC Service Controls]) may want to
5769/// override this default.
5770/// * [with_credentials()]: by default this client uses
5771/// [Application Default Credentials]. Applications using custom
5772/// authentication may need to override this default.
5773///
5774/// [with_endpoint()]: super::builder::interconnect_attachments::ClientBuilder::with_endpoint
5775/// [with_credentials()]: super::builder::interconnect_attachments::ClientBuilder::credentials
5776/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5777/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5778///
5779/// # Pooling and Cloning
5780///
5781/// `InterconnectAttachments` holds a connection pool internally, it is advised to
5782/// create one and the reuse it. You do not need to wrap `InterconnectAttachments` in
5783/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5784/// already uses an `Arc` internally.
5785#[cfg(feature = "interconnect-attachments")]
5786#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-attachments")))]
5787#[derive(Clone, Debug)]
5788pub struct InterconnectAttachments {
5789 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachments>,
5790}
5791
5792#[cfg(feature = "interconnect-attachments")]
5793impl InterconnectAttachments {
5794 /// Returns a builder for [InterconnectAttachments].
5795 ///
5796 /// ```
5797 /// # tokio_test::block_on(async {
5798 /// # use google_cloud_compute_v1::client::InterconnectAttachments;
5799 /// let client = InterconnectAttachments::builder().build().await?;
5800 /// # gax::client_builder::Result::<()>::Ok(()) });
5801 /// ```
5802 pub fn builder() -> super::builder::interconnect_attachments::ClientBuilder {
5803 gax::client_builder::internal::new_builder(
5804 super::builder::interconnect_attachments::client::Factory,
5805 )
5806 }
5807
5808 /// Creates a new client from the provided stub.
5809 ///
5810 /// The most common case for calling this function is in tests mocking the
5811 /// client's behavior.
5812 pub fn from_stub<T>(stub: T) -> Self
5813 where
5814 T: super::stub::InterconnectAttachments + 'static,
5815 {
5816 Self {
5817 inner: std::sync::Arc::new(stub),
5818 }
5819 }
5820
5821 pub(crate) async fn new(
5822 config: gaxi::options::ClientConfig,
5823 ) -> gax::client_builder::Result<Self> {
5824 let inner = Self::build_inner(config).await?;
5825 Ok(Self { inner })
5826 }
5827
5828 async fn build_inner(
5829 conf: gaxi::options::ClientConfig,
5830 ) -> gax::client_builder::Result<
5831 std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachments>,
5832 > {
5833 if gaxi::options::tracing_enabled(&conf) {
5834 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5835 }
5836 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5837 }
5838
5839 async fn build_transport(
5840 conf: gaxi::options::ClientConfig,
5841 ) -> gax::client_builder::Result<impl super::stub::InterconnectAttachments> {
5842 super::transport::InterconnectAttachments::new(conf).await
5843 }
5844
5845 async fn build_with_tracing(
5846 conf: gaxi::options::ClientConfig,
5847 ) -> gax::client_builder::Result<impl super::stub::InterconnectAttachments> {
5848 Self::build_transport(conf)
5849 .await
5850 .map(super::tracing::InterconnectAttachments::new)
5851 }
5852
5853 /// Retrieves an aggregated list of interconnect attachments.
5854 ///
5855 /// To prevent failure, Google recommends that you set the
5856 /// `returnPartialSuccess` parameter to `true`.
5857 pub fn aggregated_list(&self) -> super::builder::interconnect_attachments::AggregatedList {
5858 super::builder::interconnect_attachments::AggregatedList::new(self.inner.clone())
5859 }
5860
5861 /// Deletes the specified interconnect attachment.
5862 pub fn delete(&self) -> super::builder::interconnect_attachments::Delete {
5863 super::builder::interconnect_attachments::Delete::new(self.inner.clone())
5864 }
5865
5866 /// Returns the specified interconnect attachment.
5867 pub fn get(&self) -> super::builder::interconnect_attachments::Get {
5868 super::builder::interconnect_attachments::Get::new(self.inner.clone())
5869 }
5870
5871 /// Creates an InterconnectAttachment in the specified project using the data
5872 /// included in the request.
5873 pub fn insert(&self) -> super::builder::interconnect_attachments::Insert {
5874 super::builder::interconnect_attachments::Insert::new(self.inner.clone())
5875 }
5876
5877 /// Retrieves the list of interconnect attachments contained within
5878 /// the specified region.
5879 pub fn list(&self) -> super::builder::interconnect_attachments::List {
5880 super::builder::interconnect_attachments::List::new(self.inner.clone())
5881 }
5882
5883 /// Updates the specified interconnect attachment with the data included in the
5884 /// request. This method supportsPATCH
5885 /// semantics and uses theJSON merge
5886 /// patch format and processing rules.
5887 pub fn patch(&self) -> super::builder::interconnect_attachments::Patch {
5888 super::builder::interconnect_attachments::Patch::new(self.inner.clone())
5889 }
5890
5891 /// Sets the labels on an InterconnectAttachment. To learn more about labels,
5892 /// read the Labeling
5893 /// Resources documentation.
5894 pub fn set_labels(&self) -> super::builder::interconnect_attachments::SetLabels {
5895 super::builder::interconnect_attachments::SetLabels::new(self.inner.clone())
5896 }
5897
5898 /// Retrieves the specified region-specific Operations resource.
5899 pub fn get_operation(&self) -> super::builder::interconnect_attachments::GetOperation {
5900 super::builder::interconnect_attachments::GetOperation::new(self.inner.clone())
5901 }
5902}
5903
5904/// Implements a client for the Google Compute Engine API.
5905///
5906/// # Example
5907/// ```
5908/// # tokio_test::block_on(async {
5909/// # use google_cloud_compute_v1::client::InterconnectGroups;
5910/// let client = InterconnectGroups::builder().build().await?;
5911/// // use `client` to make requests to the Google Compute Engine API.
5912/// # gax::client_builder::Result::<()>::Ok(()) });
5913/// ```
5914///
5915/// # Service Description
5916///
5917/// Service for the `interconnectGroups` resource.
5918///
5919/// # Configuration
5920///
5921/// To configure `InterconnectGroups` use the `with_*` methods in the type returned
5922/// by [builder()][InterconnectGroups::builder]. The default configuration should
5923/// work for most applications. Common configuration changes include
5924///
5925/// * [with_endpoint()]: by default this client uses the global default endpoint
5926/// (`https://compute.googleapis.com`). Applications using regional
5927/// endpoints or running in restricted networks (e.g. a network configured
5928// with [Private Google Access with VPC Service Controls]) may want to
5929/// override this default.
5930/// * [with_credentials()]: by default this client uses
5931/// [Application Default Credentials]. Applications using custom
5932/// authentication may need to override this default.
5933///
5934/// [with_endpoint()]: super::builder::interconnect_groups::ClientBuilder::with_endpoint
5935/// [with_credentials()]: super::builder::interconnect_groups::ClientBuilder::credentials
5936/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5937/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5938///
5939/// # Pooling and Cloning
5940///
5941/// `InterconnectGroups` holds a connection pool internally, it is advised to
5942/// create one and the reuse it. You do not need to wrap `InterconnectGroups` in
5943/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5944/// already uses an `Arc` internally.
5945#[cfg(feature = "interconnect-groups")]
5946#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-groups")))]
5947#[derive(Clone, Debug)]
5948pub struct InterconnectGroups {
5949 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectGroups>,
5950}
5951
5952#[cfg(feature = "interconnect-groups")]
5953impl InterconnectGroups {
5954 /// Returns a builder for [InterconnectGroups].
5955 ///
5956 /// ```
5957 /// # tokio_test::block_on(async {
5958 /// # use google_cloud_compute_v1::client::InterconnectGroups;
5959 /// let client = InterconnectGroups::builder().build().await?;
5960 /// # gax::client_builder::Result::<()>::Ok(()) });
5961 /// ```
5962 pub fn builder() -> super::builder::interconnect_groups::ClientBuilder {
5963 gax::client_builder::internal::new_builder(
5964 super::builder::interconnect_groups::client::Factory,
5965 )
5966 }
5967
5968 /// Creates a new client from the provided stub.
5969 ///
5970 /// The most common case for calling this function is in tests mocking the
5971 /// client's behavior.
5972 pub fn from_stub<T>(stub: T) -> Self
5973 where
5974 T: super::stub::InterconnectGroups + 'static,
5975 {
5976 Self {
5977 inner: std::sync::Arc::new(stub),
5978 }
5979 }
5980
5981 pub(crate) async fn new(
5982 config: gaxi::options::ClientConfig,
5983 ) -> gax::client_builder::Result<Self> {
5984 let inner = Self::build_inner(config).await?;
5985 Ok(Self { inner })
5986 }
5987
5988 async fn build_inner(
5989 conf: gaxi::options::ClientConfig,
5990 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::InterconnectGroups>>
5991 {
5992 if gaxi::options::tracing_enabled(&conf) {
5993 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5994 }
5995 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5996 }
5997
5998 async fn build_transport(
5999 conf: gaxi::options::ClientConfig,
6000 ) -> gax::client_builder::Result<impl super::stub::InterconnectGroups> {
6001 super::transport::InterconnectGroups::new(conf).await
6002 }
6003
6004 async fn build_with_tracing(
6005 conf: gaxi::options::ClientConfig,
6006 ) -> gax::client_builder::Result<impl super::stub::InterconnectGroups> {
6007 Self::build_transport(conf)
6008 .await
6009 .map(super::tracing::InterconnectGroups::new)
6010 }
6011
6012 /// Create Interconnects with redundancy by creating them in a specified
6013 /// interconnect group.
6014 pub fn create_members(&self) -> super::builder::interconnect_groups::CreateMembers {
6015 super::builder::interconnect_groups::CreateMembers::new(self.inner.clone())
6016 }
6017
6018 /// Deletes the specified InterconnectGroup in the given scope
6019 pub fn delete(&self) -> super::builder::interconnect_groups::Delete {
6020 super::builder::interconnect_groups::Delete::new(self.inner.clone())
6021 }
6022
6023 /// Returns the specified InterconnectGroup resource in the given scope.
6024 pub fn get(&self) -> super::builder::interconnect_groups::Get {
6025 super::builder::interconnect_groups::Get::new(self.inner.clone())
6026 }
6027
6028 /// Gets the access control policy for a resource. May be empty if no such
6029 /// policy or resource exists.
6030 pub fn get_iam_policy(&self) -> super::builder::interconnect_groups::GetIamPolicy {
6031 super::builder::interconnect_groups::GetIamPolicy::new(self.inner.clone())
6032 }
6033
6034 /// Returns the interconnectStatuses for the specified
6035 /// InterconnectGroup.
6036 pub fn get_operational_status(
6037 &self,
6038 ) -> super::builder::interconnect_groups::GetOperationalStatus {
6039 super::builder::interconnect_groups::GetOperationalStatus::new(self.inner.clone())
6040 }
6041
6042 /// Creates a InterconnectGroup in the specified project in the given scope
6043 /// using the parameters that are included in the request.
6044 pub fn insert(&self) -> super::builder::interconnect_groups::Insert {
6045 super::builder::interconnect_groups::Insert::new(self.inner.clone())
6046 }
6047
6048 /// Lists the InterconnectGroups for a project in the given scope.
6049 pub fn list(&self) -> super::builder::interconnect_groups::List {
6050 super::builder::interconnect_groups::List::new(self.inner.clone())
6051 }
6052
6053 /// Patches the specified InterconnectGroup resource with the data included in
6054 /// the request. This method supports PATCH
6055 /// semantics and usesJSON merge
6056 /// patch format and processing rules.
6057 pub fn patch(&self) -> super::builder::interconnect_groups::Patch {
6058 super::builder::interconnect_groups::Patch::new(self.inner.clone())
6059 }
6060
6061 /// Sets the access control policy on the specified resource.
6062 /// Replaces any existing policy.
6063 pub fn set_iam_policy(&self) -> super::builder::interconnect_groups::SetIamPolicy {
6064 super::builder::interconnect_groups::SetIamPolicy::new(self.inner.clone())
6065 }
6066
6067 /// Returns permissions that a caller has on the specified resource.
6068 pub fn test_iam_permissions(&self) -> super::builder::interconnect_groups::TestIamPermissions {
6069 super::builder::interconnect_groups::TestIamPermissions::new(self.inner.clone())
6070 }
6071
6072 /// Retrieves the specified Operations resource.
6073 pub fn get_operation(&self) -> super::builder::interconnect_groups::GetOperation {
6074 super::builder::interconnect_groups::GetOperation::new(self.inner.clone())
6075 }
6076}
6077
6078/// Implements a client for the Google Compute Engine API.
6079///
6080/// # Example
6081/// ```
6082/// # tokio_test::block_on(async {
6083/// # use google_cloud_compute_v1::client::InterconnectLocations;
6084/// let client = InterconnectLocations::builder().build().await?;
6085/// // use `client` to make requests to the Google Compute Engine API.
6086/// # gax::client_builder::Result::<()>::Ok(()) });
6087/// ```
6088///
6089/// # Service Description
6090///
6091/// Service for the `interconnectLocations` resource.
6092///
6093/// # Configuration
6094///
6095/// To configure `InterconnectLocations` use the `with_*` methods in the type returned
6096/// by [builder()][InterconnectLocations::builder]. The default configuration should
6097/// work for most applications. Common configuration changes include
6098///
6099/// * [with_endpoint()]: by default this client uses the global default endpoint
6100/// (`https://compute.googleapis.com`). Applications using regional
6101/// endpoints or running in restricted networks (e.g. a network configured
6102// with [Private Google Access with VPC Service Controls]) may want to
6103/// override this default.
6104/// * [with_credentials()]: by default this client uses
6105/// [Application Default Credentials]. Applications using custom
6106/// authentication may need to override this default.
6107///
6108/// [with_endpoint()]: super::builder::interconnect_locations::ClientBuilder::with_endpoint
6109/// [with_credentials()]: super::builder::interconnect_locations::ClientBuilder::credentials
6110/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6111/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6112///
6113/// # Pooling and Cloning
6114///
6115/// `InterconnectLocations` holds a connection pool internally, it is advised to
6116/// create one and the reuse it. You do not need to wrap `InterconnectLocations` in
6117/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6118/// already uses an `Arc` internally.
6119#[cfg(feature = "interconnect-locations")]
6120#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-locations")))]
6121#[derive(Clone, Debug)]
6122pub struct InterconnectLocations {
6123 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectLocations>,
6124}
6125
6126#[cfg(feature = "interconnect-locations")]
6127impl InterconnectLocations {
6128 /// Returns a builder for [InterconnectLocations].
6129 ///
6130 /// ```
6131 /// # tokio_test::block_on(async {
6132 /// # use google_cloud_compute_v1::client::InterconnectLocations;
6133 /// let client = InterconnectLocations::builder().build().await?;
6134 /// # gax::client_builder::Result::<()>::Ok(()) });
6135 /// ```
6136 pub fn builder() -> super::builder::interconnect_locations::ClientBuilder {
6137 gax::client_builder::internal::new_builder(
6138 super::builder::interconnect_locations::client::Factory,
6139 )
6140 }
6141
6142 /// Creates a new client from the provided stub.
6143 ///
6144 /// The most common case for calling this function is in tests mocking the
6145 /// client's behavior.
6146 pub fn from_stub<T>(stub: T) -> Self
6147 where
6148 T: super::stub::InterconnectLocations + 'static,
6149 {
6150 Self {
6151 inner: std::sync::Arc::new(stub),
6152 }
6153 }
6154
6155 pub(crate) async fn new(
6156 config: gaxi::options::ClientConfig,
6157 ) -> gax::client_builder::Result<Self> {
6158 let inner = Self::build_inner(config).await?;
6159 Ok(Self { inner })
6160 }
6161
6162 async fn build_inner(
6163 conf: gaxi::options::ClientConfig,
6164 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::InterconnectLocations>>
6165 {
6166 if gaxi::options::tracing_enabled(&conf) {
6167 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6168 }
6169 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6170 }
6171
6172 async fn build_transport(
6173 conf: gaxi::options::ClientConfig,
6174 ) -> gax::client_builder::Result<impl super::stub::InterconnectLocations> {
6175 super::transport::InterconnectLocations::new(conf).await
6176 }
6177
6178 async fn build_with_tracing(
6179 conf: gaxi::options::ClientConfig,
6180 ) -> gax::client_builder::Result<impl super::stub::InterconnectLocations> {
6181 Self::build_transport(conf)
6182 .await
6183 .map(super::tracing::InterconnectLocations::new)
6184 }
6185
6186 /// Returns the details for the specified interconnect location. Gets a list of
6187 /// available interconnect locations by making a list() request.
6188 pub fn get(&self) -> super::builder::interconnect_locations::Get {
6189 super::builder::interconnect_locations::Get::new(self.inner.clone())
6190 }
6191
6192 /// Retrieves the list of interconnect locations available to the specified
6193 /// project.
6194 pub fn list(&self) -> super::builder::interconnect_locations::List {
6195 super::builder::interconnect_locations::List::new(self.inner.clone())
6196 }
6197}
6198
6199/// Implements a client for the Google Compute Engine API.
6200///
6201/// # Example
6202/// ```
6203/// # tokio_test::block_on(async {
6204/// # use google_cloud_compute_v1::client::InterconnectRemoteLocations;
6205/// let client = InterconnectRemoteLocations::builder().build().await?;
6206/// // use `client` to make requests to the Google Compute Engine API.
6207/// # gax::client_builder::Result::<()>::Ok(()) });
6208/// ```
6209///
6210/// # Service Description
6211///
6212/// Service for the `interconnectRemoteLocations` resource.
6213///
6214/// # Configuration
6215///
6216/// To configure `InterconnectRemoteLocations` use the `with_*` methods in the type returned
6217/// by [builder()][InterconnectRemoteLocations::builder]. The default configuration should
6218/// work for most applications. Common configuration changes include
6219///
6220/// * [with_endpoint()]: by default this client uses the global default endpoint
6221/// (`https://compute.googleapis.com`). Applications using regional
6222/// endpoints or running in restricted networks (e.g. a network configured
6223// with [Private Google Access with VPC Service Controls]) may want to
6224/// override this default.
6225/// * [with_credentials()]: by default this client uses
6226/// [Application Default Credentials]. Applications using custom
6227/// authentication may need to override this default.
6228///
6229/// [with_endpoint()]: super::builder::interconnect_remote_locations::ClientBuilder::with_endpoint
6230/// [with_credentials()]: super::builder::interconnect_remote_locations::ClientBuilder::credentials
6231/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6232/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6233///
6234/// # Pooling and Cloning
6235///
6236/// `InterconnectRemoteLocations` holds a connection pool internally, it is advised to
6237/// create one and the reuse it. You do not need to wrap `InterconnectRemoteLocations` in
6238/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6239/// already uses an `Arc` internally.
6240#[cfg(feature = "interconnect-remote-locations")]
6241#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-remote-locations")))]
6242#[derive(Clone, Debug)]
6243pub struct InterconnectRemoteLocations {
6244 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectRemoteLocations>,
6245}
6246
6247#[cfg(feature = "interconnect-remote-locations")]
6248impl InterconnectRemoteLocations {
6249 /// Returns a builder for [InterconnectRemoteLocations].
6250 ///
6251 /// ```
6252 /// # tokio_test::block_on(async {
6253 /// # use google_cloud_compute_v1::client::InterconnectRemoteLocations;
6254 /// let client = InterconnectRemoteLocations::builder().build().await?;
6255 /// # gax::client_builder::Result::<()>::Ok(()) });
6256 /// ```
6257 pub fn builder() -> super::builder::interconnect_remote_locations::ClientBuilder {
6258 gax::client_builder::internal::new_builder(
6259 super::builder::interconnect_remote_locations::client::Factory,
6260 )
6261 }
6262
6263 /// Creates a new client from the provided stub.
6264 ///
6265 /// The most common case for calling this function is in tests mocking the
6266 /// client's behavior.
6267 pub fn from_stub<T>(stub: T) -> Self
6268 where
6269 T: super::stub::InterconnectRemoteLocations + 'static,
6270 {
6271 Self {
6272 inner: std::sync::Arc::new(stub),
6273 }
6274 }
6275
6276 pub(crate) async fn new(
6277 config: gaxi::options::ClientConfig,
6278 ) -> gax::client_builder::Result<Self> {
6279 let inner = Self::build_inner(config).await?;
6280 Ok(Self { inner })
6281 }
6282
6283 async fn build_inner(
6284 conf: gaxi::options::ClientConfig,
6285 ) -> gax::client_builder::Result<
6286 std::sync::Arc<dyn super::stub::dynamic::InterconnectRemoteLocations>,
6287 > {
6288 if gaxi::options::tracing_enabled(&conf) {
6289 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6290 }
6291 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6292 }
6293
6294 async fn build_transport(
6295 conf: gaxi::options::ClientConfig,
6296 ) -> gax::client_builder::Result<impl super::stub::InterconnectRemoteLocations> {
6297 super::transport::InterconnectRemoteLocations::new(conf).await
6298 }
6299
6300 async fn build_with_tracing(
6301 conf: gaxi::options::ClientConfig,
6302 ) -> gax::client_builder::Result<impl super::stub::InterconnectRemoteLocations> {
6303 Self::build_transport(conf)
6304 .await
6305 .map(super::tracing::InterconnectRemoteLocations::new)
6306 }
6307
6308 /// Returns the details for the specified interconnect remote location. Gets a
6309 /// list of available interconnect remote locations by making alist() request.
6310 pub fn get(&self) -> super::builder::interconnect_remote_locations::Get {
6311 super::builder::interconnect_remote_locations::Get::new(self.inner.clone())
6312 }
6313
6314 /// Retrieves the list of interconnect remote locations available to the
6315 /// specified project.
6316 pub fn list(&self) -> super::builder::interconnect_remote_locations::List {
6317 super::builder::interconnect_remote_locations::List::new(self.inner.clone())
6318 }
6319}
6320
6321/// Implements a client for the Google Compute Engine API.
6322///
6323/// # Example
6324/// ```
6325/// # tokio_test::block_on(async {
6326/// # use google_cloud_compute_v1::client::Interconnects;
6327/// let client = Interconnects::builder().build().await?;
6328/// // use `client` to make requests to the Google Compute Engine API.
6329/// # gax::client_builder::Result::<()>::Ok(()) });
6330/// ```
6331///
6332/// # Service Description
6333///
6334/// Service for the `interconnects` resource.
6335///
6336/// # Configuration
6337///
6338/// To configure `Interconnects` use the `with_*` methods in the type returned
6339/// by [builder()][Interconnects::builder]. The default configuration should
6340/// work for most applications. Common configuration changes include
6341///
6342/// * [with_endpoint()]: by default this client uses the global default endpoint
6343/// (`https://compute.googleapis.com`). Applications using regional
6344/// endpoints or running in restricted networks (e.g. a network configured
6345// with [Private Google Access with VPC Service Controls]) may want to
6346/// override this default.
6347/// * [with_credentials()]: by default this client uses
6348/// [Application Default Credentials]. Applications using custom
6349/// authentication may need to override this default.
6350///
6351/// [with_endpoint()]: super::builder::interconnects::ClientBuilder::with_endpoint
6352/// [with_credentials()]: super::builder::interconnects::ClientBuilder::credentials
6353/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6354/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6355///
6356/// # Pooling and Cloning
6357///
6358/// `Interconnects` holds a connection pool internally, it is advised to
6359/// create one and the reuse it. You do not need to wrap `Interconnects` in
6360/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6361/// already uses an `Arc` internally.
6362#[cfg(feature = "interconnects")]
6363#[cfg_attr(docsrs, doc(cfg(feature = "interconnects")))]
6364#[derive(Clone, Debug)]
6365pub struct Interconnects {
6366 inner: std::sync::Arc<dyn super::stub::dynamic::Interconnects>,
6367}
6368
6369#[cfg(feature = "interconnects")]
6370impl Interconnects {
6371 /// Returns a builder for [Interconnects].
6372 ///
6373 /// ```
6374 /// # tokio_test::block_on(async {
6375 /// # use google_cloud_compute_v1::client::Interconnects;
6376 /// let client = Interconnects::builder().build().await?;
6377 /// # gax::client_builder::Result::<()>::Ok(()) });
6378 /// ```
6379 pub fn builder() -> super::builder::interconnects::ClientBuilder {
6380 gax::client_builder::internal::new_builder(super::builder::interconnects::client::Factory)
6381 }
6382
6383 /// Creates a new client from the provided stub.
6384 ///
6385 /// The most common case for calling this function is in tests mocking the
6386 /// client's behavior.
6387 pub fn from_stub<T>(stub: T) -> Self
6388 where
6389 T: super::stub::Interconnects + 'static,
6390 {
6391 Self {
6392 inner: std::sync::Arc::new(stub),
6393 }
6394 }
6395
6396 pub(crate) async fn new(
6397 config: gaxi::options::ClientConfig,
6398 ) -> gax::client_builder::Result<Self> {
6399 let inner = Self::build_inner(config).await?;
6400 Ok(Self { inner })
6401 }
6402
6403 async fn build_inner(
6404 conf: gaxi::options::ClientConfig,
6405 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Interconnects>> {
6406 if gaxi::options::tracing_enabled(&conf) {
6407 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6408 }
6409 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6410 }
6411
6412 async fn build_transport(
6413 conf: gaxi::options::ClientConfig,
6414 ) -> gax::client_builder::Result<impl super::stub::Interconnects> {
6415 super::transport::Interconnects::new(conf).await
6416 }
6417
6418 async fn build_with_tracing(
6419 conf: gaxi::options::ClientConfig,
6420 ) -> gax::client_builder::Result<impl super::stub::Interconnects> {
6421 Self::build_transport(conf)
6422 .await
6423 .map(super::tracing::Interconnects::new)
6424 }
6425
6426 /// Deletes the specified Interconnect.
6427 pub fn delete(&self) -> super::builder::interconnects::Delete {
6428 super::builder::interconnects::Delete::new(self.inner.clone())
6429 }
6430
6431 /// Returns the specified Interconnect. Get a list of available Interconnects
6432 /// by making a list() request.
6433 pub fn get(&self) -> super::builder::interconnects::Get {
6434 super::builder::interconnects::Get::new(self.inner.clone())
6435 }
6436
6437 /// Returns the interconnectDiagnostics for the specified
6438 /// Interconnect.
6439 ///
6440 /// In the event of a
6441 /// global outage, do not use this API to make decisions about where to
6442 /// redirect your network traffic.
6443 ///
6444 /// Unlike a VLAN attachment, which is regional, a Cloud Interconnect
6445 /// connection is a global resource. A global outage can prevent this
6446 /// API from functioning properly.
6447 pub fn get_diagnostics(&self) -> super::builder::interconnects::GetDiagnostics {
6448 super::builder::interconnects::GetDiagnostics::new(self.inner.clone())
6449 }
6450
6451 /// Returns the interconnectMacsecConfig for the specified
6452 /// Interconnect.
6453 pub fn get_macsec_config(&self) -> super::builder::interconnects::GetMacsecConfig {
6454 super::builder::interconnects::GetMacsecConfig::new(self.inner.clone())
6455 }
6456
6457 /// Creates an Interconnect in the specified project using
6458 /// the data included in the request.
6459 pub fn insert(&self) -> super::builder::interconnects::Insert {
6460 super::builder::interconnects::Insert::new(self.inner.clone())
6461 }
6462
6463 /// Retrieves the list of Interconnects available to the specified project.
6464 pub fn list(&self) -> super::builder::interconnects::List {
6465 super::builder::interconnects::List::new(self.inner.clone())
6466 }
6467
6468 /// Updates the specified Interconnect with the data included in the request.
6469 /// This method supportsPATCH
6470 /// semantics and uses theJSON merge
6471 /// patch format and processing rules.
6472 pub fn patch(&self) -> super::builder::interconnects::Patch {
6473 super::builder::interconnects::Patch::new(self.inner.clone())
6474 }
6475
6476 /// Sets the labels on an Interconnect. To learn more about labels,
6477 /// read the Labeling
6478 /// Resources documentation.
6479 pub fn set_labels(&self) -> super::builder::interconnects::SetLabels {
6480 super::builder::interconnects::SetLabels::new(self.inner.clone())
6481 }
6482
6483 /// Retrieves the specified Operations resource.
6484 pub fn get_operation(&self) -> super::builder::interconnects::GetOperation {
6485 super::builder::interconnects::GetOperation::new(self.inner.clone())
6486 }
6487}
6488
6489/// Implements a client for the Google Compute Engine API.
6490///
6491/// # Example
6492/// ```
6493/// # tokio_test::block_on(async {
6494/// # use google_cloud_compute_v1::client::LicenseCodes;
6495/// let client = LicenseCodes::builder().build().await?;
6496/// // use `client` to make requests to the Google Compute Engine API.
6497/// # gax::client_builder::Result::<()>::Ok(()) });
6498/// ```
6499///
6500/// # Service Description
6501///
6502/// Service for the `licenseCodes` resource.
6503///
6504/// # Configuration
6505///
6506/// To configure `LicenseCodes` use the `with_*` methods in the type returned
6507/// by [builder()][LicenseCodes::builder]. The default configuration should
6508/// work for most applications. Common configuration changes include
6509///
6510/// * [with_endpoint()]: by default this client uses the global default endpoint
6511/// (`https://compute.googleapis.com`). Applications using regional
6512/// endpoints or running in restricted networks (e.g. a network configured
6513// with [Private Google Access with VPC Service Controls]) may want to
6514/// override this default.
6515/// * [with_credentials()]: by default this client uses
6516/// [Application Default Credentials]. Applications using custom
6517/// authentication may need to override this default.
6518///
6519/// [with_endpoint()]: super::builder::license_codes::ClientBuilder::with_endpoint
6520/// [with_credentials()]: super::builder::license_codes::ClientBuilder::credentials
6521/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6522/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6523///
6524/// # Pooling and Cloning
6525///
6526/// `LicenseCodes` holds a connection pool internally, it is advised to
6527/// create one and the reuse it. You do not need to wrap `LicenseCodes` in
6528/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6529/// already uses an `Arc` internally.
6530#[cfg(feature = "license-codes")]
6531#[cfg_attr(docsrs, doc(cfg(feature = "license-codes")))]
6532#[derive(Clone, Debug)]
6533pub struct LicenseCodes {
6534 inner: std::sync::Arc<dyn super::stub::dynamic::LicenseCodes>,
6535}
6536
6537#[cfg(feature = "license-codes")]
6538impl LicenseCodes {
6539 /// Returns a builder for [LicenseCodes].
6540 ///
6541 /// ```
6542 /// # tokio_test::block_on(async {
6543 /// # use google_cloud_compute_v1::client::LicenseCodes;
6544 /// let client = LicenseCodes::builder().build().await?;
6545 /// # gax::client_builder::Result::<()>::Ok(()) });
6546 /// ```
6547 pub fn builder() -> super::builder::license_codes::ClientBuilder {
6548 gax::client_builder::internal::new_builder(super::builder::license_codes::client::Factory)
6549 }
6550
6551 /// Creates a new client from the provided stub.
6552 ///
6553 /// The most common case for calling this function is in tests mocking the
6554 /// client's behavior.
6555 pub fn from_stub<T>(stub: T) -> Self
6556 where
6557 T: super::stub::LicenseCodes + 'static,
6558 {
6559 Self {
6560 inner: std::sync::Arc::new(stub),
6561 }
6562 }
6563
6564 pub(crate) async fn new(
6565 config: gaxi::options::ClientConfig,
6566 ) -> gax::client_builder::Result<Self> {
6567 let inner = Self::build_inner(config).await?;
6568 Ok(Self { inner })
6569 }
6570
6571 async fn build_inner(
6572 conf: gaxi::options::ClientConfig,
6573 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::LicenseCodes>> {
6574 if gaxi::options::tracing_enabled(&conf) {
6575 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6576 }
6577 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6578 }
6579
6580 async fn build_transport(
6581 conf: gaxi::options::ClientConfig,
6582 ) -> gax::client_builder::Result<impl super::stub::LicenseCodes> {
6583 super::transport::LicenseCodes::new(conf).await
6584 }
6585
6586 async fn build_with_tracing(
6587 conf: gaxi::options::ClientConfig,
6588 ) -> gax::client_builder::Result<impl super::stub::LicenseCodes> {
6589 Self::build_transport(conf)
6590 .await
6591 .map(super::tracing::LicenseCodes::new)
6592 }
6593
6594 /// Return a specified license code. License codes are mirrored across
6595 /// all projects that have permissions to read the License Code.
6596 /// *Caution* This resource is intended
6597 /// for use only by third-party partners who are creatingCloud Marketplace
6598 /// images.
6599 pub fn get(&self) -> super::builder::license_codes::Get {
6600 super::builder::license_codes::Get::new(self.inner.clone())
6601 }
6602
6603 /// Returns permissions that a caller has on the specified resource.
6604 /// *Caution* This resource is intended
6605 /// for use only by third-party partners who are creatingCloud Marketplace
6606 /// images.
6607 pub fn test_iam_permissions(&self) -> super::builder::license_codes::TestIamPermissions {
6608 super::builder::license_codes::TestIamPermissions::new(self.inner.clone())
6609 }
6610}
6611
6612/// Implements a client for the Google Compute Engine API.
6613///
6614/// # Example
6615/// ```
6616/// # tokio_test::block_on(async {
6617/// # use google_cloud_compute_v1::client::Licenses;
6618/// let client = Licenses::builder().build().await?;
6619/// // use `client` to make requests to the Google Compute Engine API.
6620/// # gax::client_builder::Result::<()>::Ok(()) });
6621/// ```
6622///
6623/// # Service Description
6624///
6625/// Service for the `licenses` resource.
6626///
6627/// # Configuration
6628///
6629/// To configure `Licenses` use the `with_*` methods in the type returned
6630/// by [builder()][Licenses::builder]. The default configuration should
6631/// work for most applications. Common configuration changes include
6632///
6633/// * [with_endpoint()]: by default this client uses the global default endpoint
6634/// (`https://compute.googleapis.com`). Applications using regional
6635/// endpoints or running in restricted networks (e.g. a network configured
6636// with [Private Google Access with VPC Service Controls]) may want to
6637/// override this default.
6638/// * [with_credentials()]: by default this client uses
6639/// [Application Default Credentials]. Applications using custom
6640/// authentication may need to override this default.
6641///
6642/// [with_endpoint()]: super::builder::licenses::ClientBuilder::with_endpoint
6643/// [with_credentials()]: super::builder::licenses::ClientBuilder::credentials
6644/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6645/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6646///
6647/// # Pooling and Cloning
6648///
6649/// `Licenses` holds a connection pool internally, it is advised to
6650/// create one and the reuse it. You do not need to wrap `Licenses` in
6651/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6652/// already uses an `Arc` internally.
6653#[cfg(feature = "licenses")]
6654#[cfg_attr(docsrs, doc(cfg(feature = "licenses")))]
6655#[derive(Clone, Debug)]
6656pub struct Licenses {
6657 inner: std::sync::Arc<dyn super::stub::dynamic::Licenses>,
6658}
6659
6660#[cfg(feature = "licenses")]
6661impl Licenses {
6662 /// Returns a builder for [Licenses].
6663 ///
6664 /// ```
6665 /// # tokio_test::block_on(async {
6666 /// # use google_cloud_compute_v1::client::Licenses;
6667 /// let client = Licenses::builder().build().await?;
6668 /// # gax::client_builder::Result::<()>::Ok(()) });
6669 /// ```
6670 pub fn builder() -> super::builder::licenses::ClientBuilder {
6671 gax::client_builder::internal::new_builder(super::builder::licenses::client::Factory)
6672 }
6673
6674 /// Creates a new client from the provided stub.
6675 ///
6676 /// The most common case for calling this function is in tests mocking the
6677 /// client's behavior.
6678 pub fn from_stub<T>(stub: T) -> Self
6679 where
6680 T: super::stub::Licenses + 'static,
6681 {
6682 Self {
6683 inner: std::sync::Arc::new(stub),
6684 }
6685 }
6686
6687 pub(crate) async fn new(
6688 config: gaxi::options::ClientConfig,
6689 ) -> gax::client_builder::Result<Self> {
6690 let inner = Self::build_inner(config).await?;
6691 Ok(Self { inner })
6692 }
6693
6694 async fn build_inner(
6695 conf: gaxi::options::ClientConfig,
6696 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Licenses>> {
6697 if gaxi::options::tracing_enabled(&conf) {
6698 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6699 }
6700 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6701 }
6702
6703 async fn build_transport(
6704 conf: gaxi::options::ClientConfig,
6705 ) -> gax::client_builder::Result<impl super::stub::Licenses> {
6706 super::transport::Licenses::new(conf).await
6707 }
6708
6709 async fn build_with_tracing(
6710 conf: gaxi::options::ClientConfig,
6711 ) -> gax::client_builder::Result<impl super::stub::Licenses> {
6712 Self::build_transport(conf)
6713 .await
6714 .map(super::tracing::Licenses::new)
6715 }
6716
6717 /// Deletes the specified license.
6718 /// *Caution* This resource is intended
6719 /// for use only by third-party partners who are creatingCloud Marketplace
6720 /// images.
6721 pub fn delete(&self) -> super::builder::licenses::Delete {
6722 super::builder::licenses::Delete::new(self.inner.clone())
6723 }
6724
6725 /// Returns the specified License resource.
6726 /// *Caution* This resource is intended
6727 /// for use only by third-party partners who are creatingCloud Marketplace
6728 /// images.
6729 pub fn get(&self) -> super::builder::licenses::Get {
6730 super::builder::licenses::Get::new(self.inner.clone())
6731 }
6732
6733 /// Gets the access control policy for a resource. May be empty if no such
6734 /// policy or resource exists.
6735 /// *Caution* This resource is intended
6736 /// for use only by third-party partners who are creatingCloud Marketplace
6737 /// images.
6738 pub fn get_iam_policy(&self) -> super::builder::licenses::GetIamPolicy {
6739 super::builder::licenses::GetIamPolicy::new(self.inner.clone())
6740 }
6741
6742 /// Create a License resource in the specified project.
6743 /// *Caution* This resource is intended
6744 /// for use only by third-party partners who are creatingCloud Marketplace
6745 /// images.
6746 pub fn insert(&self) -> super::builder::licenses::Insert {
6747 super::builder::licenses::Insert::new(self.inner.clone())
6748 }
6749
6750 /// Retrieves the list of licenses
6751 /// available in the specified project. This method does not
6752 /// get any licenses that belong to other projects, including licenses attached
6753 /// to publicly-available images, like Debian 9. If you want to get a list of
6754 /// publicly-available licenses, use this method to make a request to the
6755 /// respective image project, such as debian-cloud orwindows-cloud.
6756 /// *Caution* This resource is intended
6757 /// for use only by third-party partners who are creatingCloud Marketplace
6758 /// images.
6759 pub fn list(&self) -> super::builder::licenses::List {
6760 super::builder::licenses::List::new(self.inner.clone())
6761 }
6762
6763 /// Sets the access control policy on the specified resource.
6764 /// Replaces any existing policy.
6765 /// *Caution* This resource is intended
6766 /// for use only by third-party partners who are creatingCloud Marketplace
6767 /// images.
6768 pub fn set_iam_policy(&self) -> super::builder::licenses::SetIamPolicy {
6769 super::builder::licenses::SetIamPolicy::new(self.inner.clone())
6770 }
6771
6772 /// Returns permissions that a caller has on the specified resource.
6773 /// *Caution* This resource is intended
6774 /// for use only by third-party partners who are creatingCloud Marketplace
6775 /// images.
6776 pub fn test_iam_permissions(&self) -> super::builder::licenses::TestIamPermissions {
6777 super::builder::licenses::TestIamPermissions::new(self.inner.clone())
6778 }
6779
6780 /// Updates a License resource in the specified project.
6781 /// *Caution* This resource is intended
6782 /// for use only by third-party partners who are creatingCloud Marketplace
6783 /// images.
6784 pub fn update(&self) -> super::builder::licenses::Update {
6785 super::builder::licenses::Update::new(self.inner.clone())
6786 }
6787
6788 /// Retrieves the specified Operations resource.
6789 pub fn get_operation(&self) -> super::builder::licenses::GetOperation {
6790 super::builder::licenses::GetOperation::new(self.inner.clone())
6791 }
6792}
6793
6794/// Implements a client for the Google Compute Engine API.
6795///
6796/// # Example
6797/// ```
6798/// # tokio_test::block_on(async {
6799/// # use google_cloud_compute_v1::client::MachineImages;
6800/// let client = MachineImages::builder().build().await?;
6801/// // use `client` to make requests to the Google Compute Engine API.
6802/// # gax::client_builder::Result::<()>::Ok(()) });
6803/// ```
6804///
6805/// # Service Description
6806///
6807/// Service for the `machineImages` resource.
6808///
6809/// # Configuration
6810///
6811/// To configure `MachineImages` use the `with_*` methods in the type returned
6812/// by [builder()][MachineImages::builder]. The default configuration should
6813/// work for most applications. Common configuration changes include
6814///
6815/// * [with_endpoint()]: by default this client uses the global default endpoint
6816/// (`https://compute.googleapis.com`). Applications using regional
6817/// endpoints or running in restricted networks (e.g. a network configured
6818// with [Private Google Access with VPC Service Controls]) may want to
6819/// override this default.
6820/// * [with_credentials()]: by default this client uses
6821/// [Application Default Credentials]. Applications using custom
6822/// authentication may need to override this default.
6823///
6824/// [with_endpoint()]: super::builder::machine_images::ClientBuilder::with_endpoint
6825/// [with_credentials()]: super::builder::machine_images::ClientBuilder::credentials
6826/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6827/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6828///
6829/// # Pooling and Cloning
6830///
6831/// `MachineImages` holds a connection pool internally, it is advised to
6832/// create one and the reuse it. You do not need to wrap `MachineImages` in
6833/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6834/// already uses an `Arc` internally.
6835#[cfg(feature = "machine-images")]
6836#[cfg_attr(docsrs, doc(cfg(feature = "machine-images")))]
6837#[derive(Clone, Debug)]
6838pub struct MachineImages {
6839 inner: std::sync::Arc<dyn super::stub::dynamic::MachineImages>,
6840}
6841
6842#[cfg(feature = "machine-images")]
6843impl MachineImages {
6844 /// Returns a builder for [MachineImages].
6845 ///
6846 /// ```
6847 /// # tokio_test::block_on(async {
6848 /// # use google_cloud_compute_v1::client::MachineImages;
6849 /// let client = MachineImages::builder().build().await?;
6850 /// # gax::client_builder::Result::<()>::Ok(()) });
6851 /// ```
6852 pub fn builder() -> super::builder::machine_images::ClientBuilder {
6853 gax::client_builder::internal::new_builder(super::builder::machine_images::client::Factory)
6854 }
6855
6856 /// Creates a new client from the provided stub.
6857 ///
6858 /// The most common case for calling this function is in tests mocking the
6859 /// client's behavior.
6860 pub fn from_stub<T>(stub: T) -> Self
6861 where
6862 T: super::stub::MachineImages + 'static,
6863 {
6864 Self {
6865 inner: std::sync::Arc::new(stub),
6866 }
6867 }
6868
6869 pub(crate) async fn new(
6870 config: gaxi::options::ClientConfig,
6871 ) -> gax::client_builder::Result<Self> {
6872 let inner = Self::build_inner(config).await?;
6873 Ok(Self { inner })
6874 }
6875
6876 async fn build_inner(
6877 conf: gaxi::options::ClientConfig,
6878 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::MachineImages>> {
6879 if gaxi::options::tracing_enabled(&conf) {
6880 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6881 }
6882 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6883 }
6884
6885 async fn build_transport(
6886 conf: gaxi::options::ClientConfig,
6887 ) -> gax::client_builder::Result<impl super::stub::MachineImages> {
6888 super::transport::MachineImages::new(conf).await
6889 }
6890
6891 async fn build_with_tracing(
6892 conf: gaxi::options::ClientConfig,
6893 ) -> gax::client_builder::Result<impl super::stub::MachineImages> {
6894 Self::build_transport(conf)
6895 .await
6896 .map(super::tracing::MachineImages::new)
6897 }
6898
6899 /// Deletes the specified machine image. Deleting a machine image is permanent
6900 /// and cannot be undone.
6901 pub fn delete(&self) -> super::builder::machine_images::Delete {
6902 super::builder::machine_images::Delete::new(self.inner.clone())
6903 }
6904
6905 /// Returns the specified machine image.
6906 pub fn get(&self) -> super::builder::machine_images::Get {
6907 super::builder::machine_images::Get::new(self.inner.clone())
6908 }
6909
6910 /// Gets the access control policy for a resource. May be empty if no such
6911 /// policy or resource exists.
6912 pub fn get_iam_policy(&self) -> super::builder::machine_images::GetIamPolicy {
6913 super::builder::machine_images::GetIamPolicy::new(self.inner.clone())
6914 }
6915
6916 /// Creates a machine image in the specified project using the
6917 /// data that is included in the request. If you are creating a new machine
6918 /// image to update an existing instance, your new machine image should use the
6919 /// same network or, if applicable, the same subnetwork as the original
6920 /// instance.
6921 pub fn insert(&self) -> super::builder::machine_images::Insert {
6922 super::builder::machine_images::Insert::new(self.inner.clone())
6923 }
6924
6925 /// Retrieves a list of machine images that are contained within
6926 /// the specified project.
6927 pub fn list(&self) -> super::builder::machine_images::List {
6928 super::builder::machine_images::List::new(self.inner.clone())
6929 }
6930
6931 /// Sets the access control policy on the specified resource.
6932 /// Replaces any existing policy.
6933 pub fn set_iam_policy(&self) -> super::builder::machine_images::SetIamPolicy {
6934 super::builder::machine_images::SetIamPolicy::new(self.inner.clone())
6935 }
6936
6937 /// Sets the labels on a machine image. To learn more about labels, read theLabeling
6938 /// Resources documentation.
6939 pub fn set_labels(&self) -> super::builder::machine_images::SetLabels {
6940 super::builder::machine_images::SetLabels::new(self.inner.clone())
6941 }
6942
6943 /// Returns permissions that a caller has on the specified resource.
6944 pub fn test_iam_permissions(&self) -> super::builder::machine_images::TestIamPermissions {
6945 super::builder::machine_images::TestIamPermissions::new(self.inner.clone())
6946 }
6947
6948 /// Retrieves the specified Operations resource.
6949 pub fn get_operation(&self) -> super::builder::machine_images::GetOperation {
6950 super::builder::machine_images::GetOperation::new(self.inner.clone())
6951 }
6952}
6953
6954/// Implements a client for the Google Compute Engine API.
6955///
6956/// # Example
6957/// ```
6958/// # tokio_test::block_on(async {
6959/// # use google_cloud_compute_v1::client::MachineTypes;
6960/// let client = MachineTypes::builder().build().await?;
6961/// // use `client` to make requests to the Google Compute Engine API.
6962/// # gax::client_builder::Result::<()>::Ok(()) });
6963/// ```
6964///
6965/// # Service Description
6966///
6967/// Service for the `machineTypes` resource.
6968///
6969/// # Configuration
6970///
6971/// To configure `MachineTypes` use the `with_*` methods in the type returned
6972/// by [builder()][MachineTypes::builder]. The default configuration should
6973/// work for most applications. Common configuration changes include
6974///
6975/// * [with_endpoint()]: by default this client uses the global default endpoint
6976/// (`https://compute.googleapis.com`). Applications using regional
6977/// endpoints or running in restricted networks (e.g. a network configured
6978// with [Private Google Access with VPC Service Controls]) may want to
6979/// override this default.
6980/// * [with_credentials()]: by default this client uses
6981/// [Application Default Credentials]. Applications using custom
6982/// authentication may need to override this default.
6983///
6984/// [with_endpoint()]: super::builder::machine_types::ClientBuilder::with_endpoint
6985/// [with_credentials()]: super::builder::machine_types::ClientBuilder::credentials
6986/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6987/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6988///
6989/// # Pooling and Cloning
6990///
6991/// `MachineTypes` holds a connection pool internally, it is advised to
6992/// create one and the reuse it. You do not need to wrap `MachineTypes` in
6993/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6994/// already uses an `Arc` internally.
6995#[cfg(feature = "machine-types")]
6996#[cfg_attr(docsrs, doc(cfg(feature = "machine-types")))]
6997#[derive(Clone, Debug)]
6998pub struct MachineTypes {
6999 inner: std::sync::Arc<dyn super::stub::dynamic::MachineTypes>,
7000}
7001
7002#[cfg(feature = "machine-types")]
7003impl MachineTypes {
7004 /// Returns a builder for [MachineTypes].
7005 ///
7006 /// ```
7007 /// # tokio_test::block_on(async {
7008 /// # use google_cloud_compute_v1::client::MachineTypes;
7009 /// let client = MachineTypes::builder().build().await?;
7010 /// # gax::client_builder::Result::<()>::Ok(()) });
7011 /// ```
7012 pub fn builder() -> super::builder::machine_types::ClientBuilder {
7013 gax::client_builder::internal::new_builder(super::builder::machine_types::client::Factory)
7014 }
7015
7016 /// Creates a new client from the provided stub.
7017 ///
7018 /// The most common case for calling this function is in tests mocking the
7019 /// client's behavior.
7020 pub fn from_stub<T>(stub: T) -> Self
7021 where
7022 T: super::stub::MachineTypes + 'static,
7023 {
7024 Self {
7025 inner: std::sync::Arc::new(stub),
7026 }
7027 }
7028
7029 pub(crate) async fn new(
7030 config: gaxi::options::ClientConfig,
7031 ) -> gax::client_builder::Result<Self> {
7032 let inner = Self::build_inner(config).await?;
7033 Ok(Self { inner })
7034 }
7035
7036 async fn build_inner(
7037 conf: gaxi::options::ClientConfig,
7038 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::MachineTypes>> {
7039 if gaxi::options::tracing_enabled(&conf) {
7040 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7041 }
7042 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7043 }
7044
7045 async fn build_transport(
7046 conf: gaxi::options::ClientConfig,
7047 ) -> gax::client_builder::Result<impl super::stub::MachineTypes> {
7048 super::transport::MachineTypes::new(conf).await
7049 }
7050
7051 async fn build_with_tracing(
7052 conf: gaxi::options::ClientConfig,
7053 ) -> gax::client_builder::Result<impl super::stub::MachineTypes> {
7054 Self::build_transport(conf)
7055 .await
7056 .map(super::tracing::MachineTypes::new)
7057 }
7058
7059 /// Retrieves an aggregated list of machine types.
7060 ///
7061 /// To prevent failure, Google recommends that you set the
7062 /// `returnPartialSuccess` parameter to `true`.
7063 pub fn aggregated_list(&self) -> super::builder::machine_types::AggregatedList {
7064 super::builder::machine_types::AggregatedList::new(self.inner.clone())
7065 }
7066
7067 /// Returns the specified machine type.
7068 pub fn get(&self) -> super::builder::machine_types::Get {
7069 super::builder::machine_types::Get::new(self.inner.clone())
7070 }
7071
7072 /// Retrieves a list of machine types available to the specified
7073 /// project.
7074 pub fn list(&self) -> super::builder::machine_types::List {
7075 super::builder::machine_types::List::new(self.inner.clone())
7076 }
7077}
7078
7079/// Implements a client for the Google Compute Engine API.
7080///
7081/// # Example
7082/// ```
7083/// # tokio_test::block_on(async {
7084/// # use google_cloud_compute_v1::client::NetworkAttachments;
7085/// let client = NetworkAttachments::builder().build().await?;
7086/// // use `client` to make requests to the Google Compute Engine API.
7087/// # gax::client_builder::Result::<()>::Ok(()) });
7088/// ```
7089///
7090/// # Service Description
7091///
7092/// Service for the `networkAttachments` resource.
7093///
7094/// # Configuration
7095///
7096/// To configure `NetworkAttachments` use the `with_*` methods in the type returned
7097/// by [builder()][NetworkAttachments::builder]. The default configuration should
7098/// work for most applications. Common configuration changes include
7099///
7100/// * [with_endpoint()]: by default this client uses the global default endpoint
7101/// (`https://compute.googleapis.com`). Applications using regional
7102/// endpoints or running in restricted networks (e.g. a network configured
7103// with [Private Google Access with VPC Service Controls]) may want to
7104/// override this default.
7105/// * [with_credentials()]: by default this client uses
7106/// [Application Default Credentials]. Applications using custom
7107/// authentication may need to override this default.
7108///
7109/// [with_endpoint()]: super::builder::network_attachments::ClientBuilder::with_endpoint
7110/// [with_credentials()]: super::builder::network_attachments::ClientBuilder::credentials
7111/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7112/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7113///
7114/// # Pooling and Cloning
7115///
7116/// `NetworkAttachments` holds a connection pool internally, it is advised to
7117/// create one and the reuse it. You do not need to wrap `NetworkAttachments` in
7118/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7119/// already uses an `Arc` internally.
7120#[cfg(feature = "network-attachments")]
7121#[cfg_attr(docsrs, doc(cfg(feature = "network-attachments")))]
7122#[derive(Clone, Debug)]
7123pub struct NetworkAttachments {
7124 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkAttachments>,
7125}
7126
7127#[cfg(feature = "network-attachments")]
7128impl NetworkAttachments {
7129 /// Returns a builder for [NetworkAttachments].
7130 ///
7131 /// ```
7132 /// # tokio_test::block_on(async {
7133 /// # use google_cloud_compute_v1::client::NetworkAttachments;
7134 /// let client = NetworkAttachments::builder().build().await?;
7135 /// # gax::client_builder::Result::<()>::Ok(()) });
7136 /// ```
7137 pub fn builder() -> super::builder::network_attachments::ClientBuilder {
7138 gax::client_builder::internal::new_builder(
7139 super::builder::network_attachments::client::Factory,
7140 )
7141 }
7142
7143 /// Creates a new client from the provided stub.
7144 ///
7145 /// The most common case for calling this function is in tests mocking the
7146 /// client's behavior.
7147 pub fn from_stub<T>(stub: T) -> Self
7148 where
7149 T: super::stub::NetworkAttachments + 'static,
7150 {
7151 Self {
7152 inner: std::sync::Arc::new(stub),
7153 }
7154 }
7155
7156 pub(crate) async fn new(
7157 config: gaxi::options::ClientConfig,
7158 ) -> gax::client_builder::Result<Self> {
7159 let inner = Self::build_inner(config).await?;
7160 Ok(Self { inner })
7161 }
7162
7163 async fn build_inner(
7164 conf: gaxi::options::ClientConfig,
7165 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::NetworkAttachments>>
7166 {
7167 if gaxi::options::tracing_enabled(&conf) {
7168 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7169 }
7170 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7171 }
7172
7173 async fn build_transport(
7174 conf: gaxi::options::ClientConfig,
7175 ) -> gax::client_builder::Result<impl super::stub::NetworkAttachments> {
7176 super::transport::NetworkAttachments::new(conf).await
7177 }
7178
7179 async fn build_with_tracing(
7180 conf: gaxi::options::ClientConfig,
7181 ) -> gax::client_builder::Result<impl super::stub::NetworkAttachments> {
7182 Self::build_transport(conf)
7183 .await
7184 .map(super::tracing::NetworkAttachments::new)
7185 }
7186
7187 /// Retrieves the list of all NetworkAttachment resources,
7188 /// regional and global, available to the specified project.
7189 ///
7190 /// To prevent failure, Google recommends that you set the
7191 /// `returnPartialSuccess` parameter to `true`.
7192 pub fn aggregated_list(&self) -> super::builder::network_attachments::AggregatedList {
7193 super::builder::network_attachments::AggregatedList::new(self.inner.clone())
7194 }
7195
7196 /// Deletes the specified NetworkAttachment in the given scope
7197 pub fn delete(&self) -> super::builder::network_attachments::Delete {
7198 super::builder::network_attachments::Delete::new(self.inner.clone())
7199 }
7200
7201 /// Returns the specified NetworkAttachment resource in the given scope.
7202 pub fn get(&self) -> super::builder::network_attachments::Get {
7203 super::builder::network_attachments::Get::new(self.inner.clone())
7204 }
7205
7206 /// Gets the access control policy for a resource. May be empty if no such
7207 /// policy or resource exists.
7208 pub fn get_iam_policy(&self) -> super::builder::network_attachments::GetIamPolicy {
7209 super::builder::network_attachments::GetIamPolicy::new(self.inner.clone())
7210 }
7211
7212 /// Creates a NetworkAttachment in the specified project in the given scope
7213 /// using the parameters that are included in the request.
7214 pub fn insert(&self) -> super::builder::network_attachments::Insert {
7215 super::builder::network_attachments::Insert::new(self.inner.clone())
7216 }
7217
7218 /// Lists the NetworkAttachments for a project in the given scope.
7219 pub fn list(&self) -> super::builder::network_attachments::List {
7220 super::builder::network_attachments::List::new(self.inner.clone())
7221 }
7222
7223 /// Patches the specified NetworkAttachment resource with the data included in
7224 /// the request. This method supports PATCH
7225 /// semantics and usesJSON merge
7226 /// patch format and processing rules.
7227 pub fn patch(&self) -> super::builder::network_attachments::Patch {
7228 super::builder::network_attachments::Patch::new(self.inner.clone())
7229 }
7230
7231 /// Sets the access control policy on the specified resource.
7232 /// Replaces any existing policy.
7233 pub fn set_iam_policy(&self) -> super::builder::network_attachments::SetIamPolicy {
7234 super::builder::network_attachments::SetIamPolicy::new(self.inner.clone())
7235 }
7236
7237 /// Returns permissions that a caller has on the specified resource.
7238 pub fn test_iam_permissions(&self) -> super::builder::network_attachments::TestIamPermissions {
7239 super::builder::network_attachments::TestIamPermissions::new(self.inner.clone())
7240 }
7241
7242 /// Retrieves the specified region-specific Operations resource.
7243 pub fn get_operation(&self) -> super::builder::network_attachments::GetOperation {
7244 super::builder::network_attachments::GetOperation::new(self.inner.clone())
7245 }
7246}
7247
7248/// Implements a client for the Google Compute Engine API.
7249///
7250/// # Example
7251/// ```
7252/// # tokio_test::block_on(async {
7253/// # use google_cloud_compute_v1::client::NetworkEdgeSecurityServices;
7254/// let client = NetworkEdgeSecurityServices::builder().build().await?;
7255/// // use `client` to make requests to the Google Compute Engine API.
7256/// # gax::client_builder::Result::<()>::Ok(()) });
7257/// ```
7258///
7259/// # Service Description
7260///
7261/// Service for the `networkEdgeSecurityServices` resource.
7262///
7263/// # Configuration
7264///
7265/// To configure `NetworkEdgeSecurityServices` use the `with_*` methods in the type returned
7266/// by [builder()][NetworkEdgeSecurityServices::builder]. The default configuration should
7267/// work for most applications. Common configuration changes include
7268///
7269/// * [with_endpoint()]: by default this client uses the global default endpoint
7270/// (`https://compute.googleapis.com`). Applications using regional
7271/// endpoints or running in restricted networks (e.g. a network configured
7272// with [Private Google Access with VPC Service Controls]) may want to
7273/// override this default.
7274/// * [with_credentials()]: by default this client uses
7275/// [Application Default Credentials]. Applications using custom
7276/// authentication may need to override this default.
7277///
7278/// [with_endpoint()]: super::builder::network_edge_security_services::ClientBuilder::with_endpoint
7279/// [with_credentials()]: super::builder::network_edge_security_services::ClientBuilder::credentials
7280/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7281/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7282///
7283/// # Pooling and Cloning
7284///
7285/// `NetworkEdgeSecurityServices` holds a connection pool internally, it is advised to
7286/// create one and the reuse it. You do not need to wrap `NetworkEdgeSecurityServices` in
7287/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7288/// already uses an `Arc` internally.
7289#[cfg(feature = "network-edge-security-services")]
7290#[cfg_attr(docsrs, doc(cfg(feature = "network-edge-security-services")))]
7291#[derive(Clone, Debug)]
7292pub struct NetworkEdgeSecurityServices {
7293 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkEdgeSecurityServices>,
7294}
7295
7296#[cfg(feature = "network-edge-security-services")]
7297impl NetworkEdgeSecurityServices {
7298 /// Returns a builder for [NetworkEdgeSecurityServices].
7299 ///
7300 /// ```
7301 /// # tokio_test::block_on(async {
7302 /// # use google_cloud_compute_v1::client::NetworkEdgeSecurityServices;
7303 /// let client = NetworkEdgeSecurityServices::builder().build().await?;
7304 /// # gax::client_builder::Result::<()>::Ok(()) });
7305 /// ```
7306 pub fn builder() -> super::builder::network_edge_security_services::ClientBuilder {
7307 gax::client_builder::internal::new_builder(
7308 super::builder::network_edge_security_services::client::Factory,
7309 )
7310 }
7311
7312 /// Creates a new client from the provided stub.
7313 ///
7314 /// The most common case for calling this function is in tests mocking the
7315 /// client's behavior.
7316 pub fn from_stub<T>(stub: T) -> Self
7317 where
7318 T: super::stub::NetworkEdgeSecurityServices + 'static,
7319 {
7320 Self {
7321 inner: std::sync::Arc::new(stub),
7322 }
7323 }
7324
7325 pub(crate) async fn new(
7326 config: gaxi::options::ClientConfig,
7327 ) -> gax::client_builder::Result<Self> {
7328 let inner = Self::build_inner(config).await?;
7329 Ok(Self { inner })
7330 }
7331
7332 async fn build_inner(
7333 conf: gaxi::options::ClientConfig,
7334 ) -> gax::client_builder::Result<
7335 std::sync::Arc<dyn super::stub::dynamic::NetworkEdgeSecurityServices>,
7336 > {
7337 if gaxi::options::tracing_enabled(&conf) {
7338 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7339 }
7340 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7341 }
7342
7343 async fn build_transport(
7344 conf: gaxi::options::ClientConfig,
7345 ) -> gax::client_builder::Result<impl super::stub::NetworkEdgeSecurityServices> {
7346 super::transport::NetworkEdgeSecurityServices::new(conf).await
7347 }
7348
7349 async fn build_with_tracing(
7350 conf: gaxi::options::ClientConfig,
7351 ) -> gax::client_builder::Result<impl super::stub::NetworkEdgeSecurityServices> {
7352 Self::build_transport(conf)
7353 .await
7354 .map(super::tracing::NetworkEdgeSecurityServices::new)
7355 }
7356
7357 /// Retrieves the list of all NetworkEdgeSecurityService resources available to
7358 /// the specified project.
7359 ///
7360 /// To prevent failure, Google recommends that you set the
7361 /// `returnPartialSuccess` parameter to `true`.
7362 pub fn aggregated_list(
7363 &self,
7364 ) -> super::builder::network_edge_security_services::AggregatedList {
7365 super::builder::network_edge_security_services::AggregatedList::new(self.inner.clone())
7366 }
7367
7368 /// Deletes the specified service.
7369 pub fn delete(&self) -> super::builder::network_edge_security_services::Delete {
7370 super::builder::network_edge_security_services::Delete::new(self.inner.clone())
7371 }
7372
7373 /// Gets a specified NetworkEdgeSecurityService.
7374 pub fn get(&self) -> super::builder::network_edge_security_services::Get {
7375 super::builder::network_edge_security_services::Get::new(self.inner.clone())
7376 }
7377
7378 /// Creates a new service in the specified project using the data included in
7379 /// the request.
7380 pub fn insert(&self) -> super::builder::network_edge_security_services::Insert {
7381 super::builder::network_edge_security_services::Insert::new(self.inner.clone())
7382 }
7383
7384 /// Patches the specified policy with the data included in the request.
7385 pub fn patch(&self) -> super::builder::network_edge_security_services::Patch {
7386 super::builder::network_edge_security_services::Patch::new(self.inner.clone())
7387 }
7388
7389 /// Retrieves the specified region-specific Operations resource.
7390 pub fn get_operation(&self) -> super::builder::network_edge_security_services::GetOperation {
7391 super::builder::network_edge_security_services::GetOperation::new(self.inner.clone())
7392 }
7393}
7394
7395/// Implements a client for the Google Compute Engine API.
7396///
7397/// # Example
7398/// ```
7399/// # tokio_test::block_on(async {
7400/// # use google_cloud_compute_v1::client::NetworkEndpointGroups;
7401/// let client = NetworkEndpointGroups::builder().build().await?;
7402/// // use `client` to make requests to the Google Compute Engine API.
7403/// # gax::client_builder::Result::<()>::Ok(()) });
7404/// ```
7405///
7406/// # Service Description
7407///
7408/// Service for the `networkEndpointGroups` resource.
7409///
7410/// # Configuration
7411///
7412/// To configure `NetworkEndpointGroups` use the `with_*` methods in the type returned
7413/// by [builder()][NetworkEndpointGroups::builder]. The default configuration should
7414/// work for most applications. Common configuration changes include
7415///
7416/// * [with_endpoint()]: by default this client uses the global default endpoint
7417/// (`https://compute.googleapis.com`). Applications using regional
7418/// endpoints or running in restricted networks (e.g. a network configured
7419// with [Private Google Access with VPC Service Controls]) may want to
7420/// override this default.
7421/// * [with_credentials()]: by default this client uses
7422/// [Application Default Credentials]. Applications using custom
7423/// authentication may need to override this default.
7424///
7425/// [with_endpoint()]: super::builder::network_endpoint_groups::ClientBuilder::with_endpoint
7426/// [with_credentials()]: super::builder::network_endpoint_groups::ClientBuilder::credentials
7427/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7428/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7429///
7430/// # Pooling and Cloning
7431///
7432/// `NetworkEndpointGroups` holds a connection pool internally, it is advised to
7433/// create one and the reuse it. You do not need to wrap `NetworkEndpointGroups` in
7434/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7435/// already uses an `Arc` internally.
7436#[cfg(feature = "network-endpoint-groups")]
7437#[cfg_attr(docsrs, doc(cfg(feature = "network-endpoint-groups")))]
7438#[derive(Clone, Debug)]
7439pub struct NetworkEndpointGroups {
7440 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkEndpointGroups>,
7441}
7442
7443#[cfg(feature = "network-endpoint-groups")]
7444impl NetworkEndpointGroups {
7445 /// Returns a builder for [NetworkEndpointGroups].
7446 ///
7447 /// ```
7448 /// # tokio_test::block_on(async {
7449 /// # use google_cloud_compute_v1::client::NetworkEndpointGroups;
7450 /// let client = NetworkEndpointGroups::builder().build().await?;
7451 /// # gax::client_builder::Result::<()>::Ok(()) });
7452 /// ```
7453 pub fn builder() -> super::builder::network_endpoint_groups::ClientBuilder {
7454 gax::client_builder::internal::new_builder(
7455 super::builder::network_endpoint_groups::client::Factory,
7456 )
7457 }
7458
7459 /// Creates a new client from the provided stub.
7460 ///
7461 /// The most common case for calling this function is in tests mocking the
7462 /// client's behavior.
7463 pub fn from_stub<T>(stub: T) -> Self
7464 where
7465 T: super::stub::NetworkEndpointGroups + 'static,
7466 {
7467 Self {
7468 inner: std::sync::Arc::new(stub),
7469 }
7470 }
7471
7472 pub(crate) async fn new(
7473 config: gaxi::options::ClientConfig,
7474 ) -> gax::client_builder::Result<Self> {
7475 let inner = Self::build_inner(config).await?;
7476 Ok(Self { inner })
7477 }
7478
7479 async fn build_inner(
7480 conf: gaxi::options::ClientConfig,
7481 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::NetworkEndpointGroups>>
7482 {
7483 if gaxi::options::tracing_enabled(&conf) {
7484 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7485 }
7486 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7487 }
7488
7489 async fn build_transport(
7490 conf: gaxi::options::ClientConfig,
7491 ) -> gax::client_builder::Result<impl super::stub::NetworkEndpointGroups> {
7492 super::transport::NetworkEndpointGroups::new(conf).await
7493 }
7494
7495 async fn build_with_tracing(
7496 conf: gaxi::options::ClientConfig,
7497 ) -> gax::client_builder::Result<impl super::stub::NetworkEndpointGroups> {
7498 Self::build_transport(conf)
7499 .await
7500 .map(super::tracing::NetworkEndpointGroups::new)
7501 }
7502
7503 /// Retrieves the list of network endpoint groups and sorts them by zone.
7504 ///
7505 /// To prevent failure, Google recommends that you set the
7506 /// `returnPartialSuccess` parameter to `true`.
7507 pub fn aggregated_list(&self) -> super::builder::network_endpoint_groups::AggregatedList {
7508 super::builder::network_endpoint_groups::AggregatedList::new(self.inner.clone())
7509 }
7510
7511 /// Attach a list of network endpoints to the specified network endpoint group.
7512 pub fn attach_network_endpoints(
7513 &self,
7514 ) -> super::builder::network_endpoint_groups::AttachNetworkEndpoints {
7515 super::builder::network_endpoint_groups::AttachNetworkEndpoints::new(self.inner.clone())
7516 }
7517
7518 /// Deletes the specified network endpoint group. The network endpoints in the
7519 /// NEG and the VM instances they belong to are not terminated when the NEG is
7520 /// deleted. Note that the NEG cannot be deleted if there are backend services
7521 /// referencing it.
7522 pub fn delete(&self) -> super::builder::network_endpoint_groups::Delete {
7523 super::builder::network_endpoint_groups::Delete::new(self.inner.clone())
7524 }
7525
7526 /// Detach a list of network endpoints from the specified network endpoint
7527 /// group.
7528 pub fn detach_network_endpoints(
7529 &self,
7530 ) -> super::builder::network_endpoint_groups::DetachNetworkEndpoints {
7531 super::builder::network_endpoint_groups::DetachNetworkEndpoints::new(self.inner.clone())
7532 }
7533
7534 /// Returns the specified network endpoint group.
7535 pub fn get(&self) -> super::builder::network_endpoint_groups::Get {
7536 super::builder::network_endpoint_groups::Get::new(self.inner.clone())
7537 }
7538
7539 /// Creates a network endpoint group in the specified project using the
7540 /// parameters that are included in the request.
7541 pub fn insert(&self) -> super::builder::network_endpoint_groups::Insert {
7542 super::builder::network_endpoint_groups::Insert::new(self.inner.clone())
7543 }
7544
7545 /// Retrieves the list of network endpoint groups that are located in the
7546 /// specified project and zone.
7547 pub fn list(&self) -> super::builder::network_endpoint_groups::List {
7548 super::builder::network_endpoint_groups::List::new(self.inner.clone())
7549 }
7550
7551 /// Lists the network endpoints in the specified network endpoint group.
7552 pub fn list_network_endpoints(
7553 &self,
7554 ) -> super::builder::network_endpoint_groups::ListNetworkEndpoints {
7555 super::builder::network_endpoint_groups::ListNetworkEndpoints::new(self.inner.clone())
7556 }
7557
7558 /// Returns permissions that a caller has on the specified resource.
7559 pub fn test_iam_permissions(
7560 &self,
7561 ) -> super::builder::network_endpoint_groups::TestIamPermissions {
7562 super::builder::network_endpoint_groups::TestIamPermissions::new(self.inner.clone())
7563 }
7564
7565 /// Retrieves the specified zone-specific Operations resource.
7566 pub fn get_operation(&self) -> super::builder::network_endpoint_groups::GetOperation {
7567 super::builder::network_endpoint_groups::GetOperation::new(self.inner.clone())
7568 }
7569}
7570
7571/// Implements a client for the Google Compute Engine API.
7572///
7573/// # Example
7574/// ```
7575/// # tokio_test::block_on(async {
7576/// # use google_cloud_compute_v1::client::NetworkFirewallPolicies;
7577/// let client = NetworkFirewallPolicies::builder().build().await?;
7578/// // use `client` to make requests to the Google Compute Engine API.
7579/// # gax::client_builder::Result::<()>::Ok(()) });
7580/// ```
7581///
7582/// # Service Description
7583///
7584/// Service for the `networkFirewallPolicies` resource.
7585///
7586/// # Configuration
7587///
7588/// To configure `NetworkFirewallPolicies` use the `with_*` methods in the type returned
7589/// by [builder()][NetworkFirewallPolicies::builder]. The default configuration should
7590/// work for most applications. Common configuration changes include
7591///
7592/// * [with_endpoint()]: by default this client uses the global default endpoint
7593/// (`https://compute.googleapis.com`). Applications using regional
7594/// endpoints or running in restricted networks (e.g. a network configured
7595// with [Private Google Access with VPC Service Controls]) may want to
7596/// override this default.
7597/// * [with_credentials()]: by default this client uses
7598/// [Application Default Credentials]. Applications using custom
7599/// authentication may need to override this default.
7600///
7601/// [with_endpoint()]: super::builder::network_firewall_policies::ClientBuilder::with_endpoint
7602/// [with_credentials()]: super::builder::network_firewall_policies::ClientBuilder::credentials
7603/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7604/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7605///
7606/// # Pooling and Cloning
7607///
7608/// `NetworkFirewallPolicies` holds a connection pool internally, it is advised to
7609/// create one and the reuse it. You do not need to wrap `NetworkFirewallPolicies` in
7610/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7611/// already uses an `Arc` internally.
7612#[cfg(feature = "network-firewall-policies")]
7613#[cfg_attr(docsrs, doc(cfg(feature = "network-firewall-policies")))]
7614#[derive(Clone, Debug)]
7615pub struct NetworkFirewallPolicies {
7616 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkFirewallPolicies>,
7617}
7618
7619#[cfg(feature = "network-firewall-policies")]
7620impl NetworkFirewallPolicies {
7621 /// Returns a builder for [NetworkFirewallPolicies].
7622 ///
7623 /// ```
7624 /// # tokio_test::block_on(async {
7625 /// # use google_cloud_compute_v1::client::NetworkFirewallPolicies;
7626 /// let client = NetworkFirewallPolicies::builder().build().await?;
7627 /// # gax::client_builder::Result::<()>::Ok(()) });
7628 /// ```
7629 pub fn builder() -> super::builder::network_firewall_policies::ClientBuilder {
7630 gax::client_builder::internal::new_builder(
7631 super::builder::network_firewall_policies::client::Factory,
7632 )
7633 }
7634
7635 /// Creates a new client from the provided stub.
7636 ///
7637 /// The most common case for calling this function is in tests mocking the
7638 /// client's behavior.
7639 pub fn from_stub<T>(stub: T) -> Self
7640 where
7641 T: super::stub::NetworkFirewallPolicies + 'static,
7642 {
7643 Self {
7644 inner: std::sync::Arc::new(stub),
7645 }
7646 }
7647
7648 pub(crate) async fn new(
7649 config: gaxi::options::ClientConfig,
7650 ) -> gax::client_builder::Result<Self> {
7651 let inner = Self::build_inner(config).await?;
7652 Ok(Self { inner })
7653 }
7654
7655 async fn build_inner(
7656 conf: gaxi::options::ClientConfig,
7657 ) -> gax::client_builder::Result<
7658 std::sync::Arc<dyn super::stub::dynamic::NetworkFirewallPolicies>,
7659 > {
7660 if gaxi::options::tracing_enabled(&conf) {
7661 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7662 }
7663 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7664 }
7665
7666 async fn build_transport(
7667 conf: gaxi::options::ClientConfig,
7668 ) -> gax::client_builder::Result<impl super::stub::NetworkFirewallPolicies> {
7669 super::transport::NetworkFirewallPolicies::new(conf).await
7670 }
7671
7672 async fn build_with_tracing(
7673 conf: gaxi::options::ClientConfig,
7674 ) -> gax::client_builder::Result<impl super::stub::NetworkFirewallPolicies> {
7675 Self::build_transport(conf)
7676 .await
7677 .map(super::tracing::NetworkFirewallPolicies::new)
7678 }
7679
7680 /// Inserts an association for the specified firewall policy.
7681 pub fn add_association(&self) -> super::builder::network_firewall_policies::AddAssociation {
7682 super::builder::network_firewall_policies::AddAssociation::new(self.inner.clone())
7683 }
7684
7685 /// Inserts a packet mirroring rule into a firewall policy.
7686 pub fn add_packet_mirroring_rule(
7687 &self,
7688 ) -> super::builder::network_firewall_policies::AddPacketMirroringRule {
7689 super::builder::network_firewall_policies::AddPacketMirroringRule::new(self.inner.clone())
7690 }
7691
7692 /// Inserts a rule into a firewall policy.
7693 pub fn add_rule(&self) -> super::builder::network_firewall_policies::AddRule {
7694 super::builder::network_firewall_policies::AddRule::new(self.inner.clone())
7695 }
7696
7697 /// Retrieves an aggregated list of network firewall policies, listing network
7698 /// firewall policies from all applicable scopes (global and regional) and
7699 /// grouping the results per scope.
7700 ///
7701 /// To prevent failure, it is recommended that you set the
7702 /// `returnPartialSuccess` parameter to `true`.
7703 pub fn aggregated_list(&self) -> super::builder::network_firewall_policies::AggregatedList {
7704 super::builder::network_firewall_policies::AggregatedList::new(self.inner.clone())
7705 }
7706
7707 /// Copies rules to the specified firewall policy.
7708 pub fn clone_rules(&self) -> super::builder::network_firewall_policies::CloneRules {
7709 super::builder::network_firewall_policies::CloneRules::new(self.inner.clone())
7710 }
7711
7712 /// Deletes the specified policy.
7713 pub fn delete(&self) -> super::builder::network_firewall_policies::Delete {
7714 super::builder::network_firewall_policies::Delete::new(self.inner.clone())
7715 }
7716
7717 /// Returns the specified network firewall policy.
7718 pub fn get(&self) -> super::builder::network_firewall_policies::Get {
7719 super::builder::network_firewall_policies::Get::new(self.inner.clone())
7720 }
7721
7722 /// Gets an association with the specified name.
7723 pub fn get_association(&self) -> super::builder::network_firewall_policies::GetAssociation {
7724 super::builder::network_firewall_policies::GetAssociation::new(self.inner.clone())
7725 }
7726
7727 /// Gets the access control policy for a resource. May be empty if no such
7728 /// policy or resource exists.
7729 pub fn get_iam_policy(&self) -> super::builder::network_firewall_policies::GetIamPolicy {
7730 super::builder::network_firewall_policies::GetIamPolicy::new(self.inner.clone())
7731 }
7732
7733 /// Gets a packet mirroring rule of the specified priority.
7734 pub fn get_packet_mirroring_rule(
7735 &self,
7736 ) -> super::builder::network_firewall_policies::GetPacketMirroringRule {
7737 super::builder::network_firewall_policies::GetPacketMirroringRule::new(self.inner.clone())
7738 }
7739
7740 /// Gets a rule of the specified priority.
7741 pub fn get_rule(&self) -> super::builder::network_firewall_policies::GetRule {
7742 super::builder::network_firewall_policies::GetRule::new(self.inner.clone())
7743 }
7744
7745 /// Creates a new policy in the specified project using the data included in
7746 /// the request.
7747 pub fn insert(&self) -> super::builder::network_firewall_policies::Insert {
7748 super::builder::network_firewall_policies::Insert::new(self.inner.clone())
7749 }
7750
7751 /// Lists all the policies that have been configured for the specified project.
7752 pub fn list(&self) -> super::builder::network_firewall_policies::List {
7753 super::builder::network_firewall_policies::List::new(self.inner.clone())
7754 }
7755
7756 /// Patches the specified policy with the data included in the request.
7757 pub fn patch(&self) -> super::builder::network_firewall_policies::Patch {
7758 super::builder::network_firewall_policies::Patch::new(self.inner.clone())
7759 }
7760
7761 /// Patches a packet mirroring rule of the specified priority.
7762 pub fn patch_packet_mirroring_rule(
7763 &self,
7764 ) -> super::builder::network_firewall_policies::PatchPacketMirroringRule {
7765 super::builder::network_firewall_policies::PatchPacketMirroringRule::new(self.inner.clone())
7766 }
7767
7768 /// Patches a rule of the specified priority.
7769 pub fn patch_rule(&self) -> super::builder::network_firewall_policies::PatchRule {
7770 super::builder::network_firewall_policies::PatchRule::new(self.inner.clone())
7771 }
7772
7773 /// Removes an association for the specified firewall policy.
7774 pub fn remove_association(
7775 &self,
7776 ) -> super::builder::network_firewall_policies::RemoveAssociation {
7777 super::builder::network_firewall_policies::RemoveAssociation::new(self.inner.clone())
7778 }
7779
7780 /// Deletes a packet mirroring rule of the specified priority.
7781 pub fn remove_packet_mirroring_rule(
7782 &self,
7783 ) -> super::builder::network_firewall_policies::RemovePacketMirroringRule {
7784 super::builder::network_firewall_policies::RemovePacketMirroringRule::new(
7785 self.inner.clone(),
7786 )
7787 }
7788
7789 /// Deletes a rule of the specified priority.
7790 pub fn remove_rule(&self) -> super::builder::network_firewall_policies::RemoveRule {
7791 super::builder::network_firewall_policies::RemoveRule::new(self.inner.clone())
7792 }
7793
7794 /// Sets the access control policy on the specified resource.
7795 /// Replaces any existing policy.
7796 pub fn set_iam_policy(&self) -> super::builder::network_firewall_policies::SetIamPolicy {
7797 super::builder::network_firewall_policies::SetIamPolicy::new(self.inner.clone())
7798 }
7799
7800 /// Returns permissions that a caller has on the specified resource.
7801 pub fn test_iam_permissions(
7802 &self,
7803 ) -> super::builder::network_firewall_policies::TestIamPermissions {
7804 super::builder::network_firewall_policies::TestIamPermissions::new(self.inner.clone())
7805 }
7806
7807 /// Retrieves the specified Operations resource.
7808 pub fn get_operation(&self) -> super::builder::network_firewall_policies::GetOperation {
7809 super::builder::network_firewall_policies::GetOperation::new(self.inner.clone())
7810 }
7811}
7812
7813/// Implements a client for the Google Compute Engine API.
7814///
7815/// # Example
7816/// ```
7817/// # tokio_test::block_on(async {
7818/// # use google_cloud_compute_v1::client::NetworkProfiles;
7819/// let client = NetworkProfiles::builder().build().await?;
7820/// // use `client` to make requests to the Google Compute Engine API.
7821/// # gax::client_builder::Result::<()>::Ok(()) });
7822/// ```
7823///
7824/// # Service Description
7825///
7826/// Service for the `networkProfiles` resource.
7827///
7828/// # Configuration
7829///
7830/// To configure `NetworkProfiles` use the `with_*` methods in the type returned
7831/// by [builder()][NetworkProfiles::builder]. The default configuration should
7832/// work for most applications. Common configuration changes include
7833///
7834/// * [with_endpoint()]: by default this client uses the global default endpoint
7835/// (`https://compute.googleapis.com`). Applications using regional
7836/// endpoints or running in restricted networks (e.g. a network configured
7837// with [Private Google Access with VPC Service Controls]) may want to
7838/// override this default.
7839/// * [with_credentials()]: by default this client uses
7840/// [Application Default Credentials]. Applications using custom
7841/// authentication may need to override this default.
7842///
7843/// [with_endpoint()]: super::builder::network_profiles::ClientBuilder::with_endpoint
7844/// [with_credentials()]: super::builder::network_profiles::ClientBuilder::credentials
7845/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7846/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7847///
7848/// # Pooling and Cloning
7849///
7850/// `NetworkProfiles` holds a connection pool internally, it is advised to
7851/// create one and the reuse it. You do not need to wrap `NetworkProfiles` in
7852/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7853/// already uses an `Arc` internally.
7854#[cfg(feature = "network-profiles")]
7855#[cfg_attr(docsrs, doc(cfg(feature = "network-profiles")))]
7856#[derive(Clone, Debug)]
7857pub struct NetworkProfiles {
7858 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkProfiles>,
7859}
7860
7861#[cfg(feature = "network-profiles")]
7862impl NetworkProfiles {
7863 /// Returns a builder for [NetworkProfiles].
7864 ///
7865 /// ```
7866 /// # tokio_test::block_on(async {
7867 /// # use google_cloud_compute_v1::client::NetworkProfiles;
7868 /// let client = NetworkProfiles::builder().build().await?;
7869 /// # gax::client_builder::Result::<()>::Ok(()) });
7870 /// ```
7871 pub fn builder() -> super::builder::network_profiles::ClientBuilder {
7872 gax::client_builder::internal::new_builder(
7873 super::builder::network_profiles::client::Factory,
7874 )
7875 }
7876
7877 /// Creates a new client from the provided stub.
7878 ///
7879 /// The most common case for calling this function is in tests mocking the
7880 /// client's behavior.
7881 pub fn from_stub<T>(stub: T) -> Self
7882 where
7883 T: super::stub::NetworkProfiles + 'static,
7884 {
7885 Self {
7886 inner: std::sync::Arc::new(stub),
7887 }
7888 }
7889
7890 pub(crate) async fn new(
7891 config: gaxi::options::ClientConfig,
7892 ) -> gax::client_builder::Result<Self> {
7893 let inner = Self::build_inner(config).await?;
7894 Ok(Self { inner })
7895 }
7896
7897 async fn build_inner(
7898 conf: gaxi::options::ClientConfig,
7899 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::NetworkProfiles>>
7900 {
7901 if gaxi::options::tracing_enabled(&conf) {
7902 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7903 }
7904 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7905 }
7906
7907 async fn build_transport(
7908 conf: gaxi::options::ClientConfig,
7909 ) -> gax::client_builder::Result<impl super::stub::NetworkProfiles> {
7910 super::transport::NetworkProfiles::new(conf).await
7911 }
7912
7913 async fn build_with_tracing(
7914 conf: gaxi::options::ClientConfig,
7915 ) -> gax::client_builder::Result<impl super::stub::NetworkProfiles> {
7916 Self::build_transport(conf)
7917 .await
7918 .map(super::tracing::NetworkProfiles::new)
7919 }
7920
7921 /// Returns the specified network profile.
7922 pub fn get(&self) -> super::builder::network_profiles::Get {
7923 super::builder::network_profiles::Get::new(self.inner.clone())
7924 }
7925
7926 /// Retrieves a list of network profiles available to the specified
7927 /// project.
7928 pub fn list(&self) -> super::builder::network_profiles::List {
7929 super::builder::network_profiles::List::new(self.inner.clone())
7930 }
7931}
7932
7933/// Implements a client for the Google Compute Engine API.
7934///
7935/// # Example
7936/// ```
7937/// # tokio_test::block_on(async {
7938/// # use google_cloud_compute_v1::client::Networks;
7939/// let client = Networks::builder().build().await?;
7940/// // use `client` to make requests to the Google Compute Engine API.
7941/// # gax::client_builder::Result::<()>::Ok(()) });
7942/// ```
7943///
7944/// # Service Description
7945///
7946/// Service for the `networks` resource.
7947///
7948/// # Configuration
7949///
7950/// To configure `Networks` use the `with_*` methods in the type returned
7951/// by [builder()][Networks::builder]. The default configuration should
7952/// work for most applications. Common configuration changes include
7953///
7954/// * [with_endpoint()]: by default this client uses the global default endpoint
7955/// (`https://compute.googleapis.com`). Applications using regional
7956/// endpoints or running in restricted networks (e.g. a network configured
7957// with [Private Google Access with VPC Service Controls]) may want to
7958/// override this default.
7959/// * [with_credentials()]: by default this client uses
7960/// [Application Default Credentials]. Applications using custom
7961/// authentication may need to override this default.
7962///
7963/// [with_endpoint()]: super::builder::networks::ClientBuilder::with_endpoint
7964/// [with_credentials()]: super::builder::networks::ClientBuilder::credentials
7965/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7966/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7967///
7968/// # Pooling and Cloning
7969///
7970/// `Networks` holds a connection pool internally, it is advised to
7971/// create one and the reuse it. You do not need to wrap `Networks` in
7972/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7973/// already uses an `Arc` internally.
7974#[cfg(feature = "networks")]
7975#[cfg_attr(docsrs, doc(cfg(feature = "networks")))]
7976#[derive(Clone, Debug)]
7977pub struct Networks {
7978 inner: std::sync::Arc<dyn super::stub::dynamic::Networks>,
7979}
7980
7981#[cfg(feature = "networks")]
7982impl Networks {
7983 /// Returns a builder for [Networks].
7984 ///
7985 /// ```
7986 /// # tokio_test::block_on(async {
7987 /// # use google_cloud_compute_v1::client::Networks;
7988 /// let client = Networks::builder().build().await?;
7989 /// # gax::client_builder::Result::<()>::Ok(()) });
7990 /// ```
7991 pub fn builder() -> super::builder::networks::ClientBuilder {
7992 gax::client_builder::internal::new_builder(super::builder::networks::client::Factory)
7993 }
7994
7995 /// Creates a new client from the provided stub.
7996 ///
7997 /// The most common case for calling this function is in tests mocking the
7998 /// client's behavior.
7999 pub fn from_stub<T>(stub: T) -> Self
8000 where
8001 T: super::stub::Networks + 'static,
8002 {
8003 Self {
8004 inner: std::sync::Arc::new(stub),
8005 }
8006 }
8007
8008 pub(crate) async fn new(
8009 config: gaxi::options::ClientConfig,
8010 ) -> gax::client_builder::Result<Self> {
8011 let inner = Self::build_inner(config).await?;
8012 Ok(Self { inner })
8013 }
8014
8015 async fn build_inner(
8016 conf: gaxi::options::ClientConfig,
8017 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Networks>> {
8018 if gaxi::options::tracing_enabled(&conf) {
8019 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8020 }
8021 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8022 }
8023
8024 async fn build_transport(
8025 conf: gaxi::options::ClientConfig,
8026 ) -> gax::client_builder::Result<impl super::stub::Networks> {
8027 super::transport::Networks::new(conf).await
8028 }
8029
8030 async fn build_with_tracing(
8031 conf: gaxi::options::ClientConfig,
8032 ) -> gax::client_builder::Result<impl super::stub::Networks> {
8033 Self::build_transport(conf)
8034 .await
8035 .map(super::tracing::Networks::new)
8036 }
8037
8038 /// Adds a peering to the specified network.
8039 pub fn add_peering(&self) -> super::builder::networks::AddPeering {
8040 super::builder::networks::AddPeering::new(self.inner.clone())
8041 }
8042
8043 /// Deletes the specified network.
8044 pub fn delete(&self) -> super::builder::networks::Delete {
8045 super::builder::networks::Delete::new(self.inner.clone())
8046 }
8047
8048 /// Returns the specified network.
8049 pub fn get(&self) -> super::builder::networks::Get {
8050 super::builder::networks::Get::new(self.inner.clone())
8051 }
8052
8053 /// Returns the effective firewalls on a given network.
8054 pub fn get_effective_firewalls(&self) -> super::builder::networks::GetEffectiveFirewalls {
8055 super::builder::networks::GetEffectiveFirewalls::new(self.inner.clone())
8056 }
8057
8058 /// Creates a network in the specified project using the data included
8059 /// in the request.
8060 pub fn insert(&self) -> super::builder::networks::Insert {
8061 super::builder::networks::Insert::new(self.inner.clone())
8062 }
8063
8064 /// Retrieves the list of networks available to the specified project.
8065 pub fn list(&self) -> super::builder::networks::List {
8066 super::builder::networks::List::new(self.inner.clone())
8067 }
8068
8069 /// Lists the peering routes exchanged over peering connection.
8070 pub fn list_peering_routes(&self) -> super::builder::networks::ListPeeringRoutes {
8071 super::builder::networks::ListPeeringRoutes::new(self.inner.clone())
8072 }
8073
8074 /// Patches the specified network with the data included in the request.
8075 /// Only routingConfig can be modified.
8076 pub fn patch(&self) -> super::builder::networks::Patch {
8077 super::builder::networks::Patch::new(self.inner.clone())
8078 }
8079
8080 /// Removes a peering from the specified network.
8081 pub fn remove_peering(&self) -> super::builder::networks::RemovePeering {
8082 super::builder::networks::RemovePeering::new(self.inner.clone())
8083 }
8084
8085 /// Requests to remove a peering from the specified network. Applicable only
8086 /// for PeeringConnection with update_strategy=CONSENSUS.
8087 pub fn request_remove_peering(&self) -> super::builder::networks::RequestRemovePeering {
8088 super::builder::networks::RequestRemovePeering::new(self.inner.clone())
8089 }
8090
8091 /// Switches the network mode from auto subnet mode to custom subnet mode.
8092 pub fn switch_to_custom_mode(&self) -> super::builder::networks::SwitchToCustomMode {
8093 super::builder::networks::SwitchToCustomMode::new(self.inner.clone())
8094 }
8095
8096 /// Updates the specified network peering with the data included in the
8097 /// request. You can only modify the NetworkPeering.export_custom_routes field
8098 /// and the NetworkPeering.import_custom_routes field.
8099 pub fn update_peering(&self) -> super::builder::networks::UpdatePeering {
8100 super::builder::networks::UpdatePeering::new(self.inner.clone())
8101 }
8102
8103 /// Retrieves the specified Operations resource.
8104 pub fn get_operation(&self) -> super::builder::networks::GetOperation {
8105 super::builder::networks::GetOperation::new(self.inner.clone())
8106 }
8107}
8108
8109/// Implements a client for the Google Compute Engine API.
8110///
8111/// # Example
8112/// ```
8113/// # tokio_test::block_on(async {
8114/// # use google_cloud_compute_v1::client::NodeGroups;
8115/// let client = NodeGroups::builder().build().await?;
8116/// // use `client` to make requests to the Google Compute Engine API.
8117/// # gax::client_builder::Result::<()>::Ok(()) });
8118/// ```
8119///
8120/// # Service Description
8121///
8122/// Service for the `nodeGroups` resource.
8123///
8124/// # Configuration
8125///
8126/// To configure `NodeGroups` use the `with_*` methods in the type returned
8127/// by [builder()][NodeGroups::builder]. The default configuration should
8128/// work for most applications. Common configuration changes include
8129///
8130/// * [with_endpoint()]: by default this client uses the global default endpoint
8131/// (`https://compute.googleapis.com`). Applications using regional
8132/// endpoints or running in restricted networks (e.g. a network configured
8133// with [Private Google Access with VPC Service Controls]) may want to
8134/// override this default.
8135/// * [with_credentials()]: by default this client uses
8136/// [Application Default Credentials]. Applications using custom
8137/// authentication may need to override this default.
8138///
8139/// [with_endpoint()]: super::builder::node_groups::ClientBuilder::with_endpoint
8140/// [with_credentials()]: super::builder::node_groups::ClientBuilder::credentials
8141/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8142/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8143///
8144/// # Pooling and Cloning
8145///
8146/// `NodeGroups` holds a connection pool internally, it is advised to
8147/// create one and the reuse it. You do not need to wrap `NodeGroups` in
8148/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8149/// already uses an `Arc` internally.
8150#[cfg(feature = "node-groups")]
8151#[cfg_attr(docsrs, doc(cfg(feature = "node-groups")))]
8152#[derive(Clone, Debug)]
8153pub struct NodeGroups {
8154 inner: std::sync::Arc<dyn super::stub::dynamic::NodeGroups>,
8155}
8156
8157#[cfg(feature = "node-groups")]
8158impl NodeGroups {
8159 /// Returns a builder for [NodeGroups].
8160 ///
8161 /// ```
8162 /// # tokio_test::block_on(async {
8163 /// # use google_cloud_compute_v1::client::NodeGroups;
8164 /// let client = NodeGroups::builder().build().await?;
8165 /// # gax::client_builder::Result::<()>::Ok(()) });
8166 /// ```
8167 pub fn builder() -> super::builder::node_groups::ClientBuilder {
8168 gax::client_builder::internal::new_builder(super::builder::node_groups::client::Factory)
8169 }
8170
8171 /// Creates a new client from the provided stub.
8172 ///
8173 /// The most common case for calling this function is in tests mocking the
8174 /// client's behavior.
8175 pub fn from_stub<T>(stub: T) -> Self
8176 where
8177 T: super::stub::NodeGroups + 'static,
8178 {
8179 Self {
8180 inner: std::sync::Arc::new(stub),
8181 }
8182 }
8183
8184 pub(crate) async fn new(
8185 config: gaxi::options::ClientConfig,
8186 ) -> gax::client_builder::Result<Self> {
8187 let inner = Self::build_inner(config).await?;
8188 Ok(Self { inner })
8189 }
8190
8191 async fn build_inner(
8192 conf: gaxi::options::ClientConfig,
8193 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::NodeGroups>> {
8194 if gaxi::options::tracing_enabled(&conf) {
8195 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8196 }
8197 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8198 }
8199
8200 async fn build_transport(
8201 conf: gaxi::options::ClientConfig,
8202 ) -> gax::client_builder::Result<impl super::stub::NodeGroups> {
8203 super::transport::NodeGroups::new(conf).await
8204 }
8205
8206 async fn build_with_tracing(
8207 conf: gaxi::options::ClientConfig,
8208 ) -> gax::client_builder::Result<impl super::stub::NodeGroups> {
8209 Self::build_transport(conf)
8210 .await
8211 .map(super::tracing::NodeGroups::new)
8212 }
8213
8214 /// Adds specified number of nodes to the node group.
8215 pub fn add_nodes(&self) -> super::builder::node_groups::AddNodes {
8216 super::builder::node_groups::AddNodes::new(self.inner.clone())
8217 }
8218
8219 /// Retrieves an aggregated list of node groups.
8220 /// Note: use nodeGroups.listNodes for more details about each group.
8221 ///
8222 /// To prevent failure, Google recommends that you set the
8223 /// `returnPartialSuccess` parameter to `true`.
8224 pub fn aggregated_list(&self) -> super::builder::node_groups::AggregatedList {
8225 super::builder::node_groups::AggregatedList::new(self.inner.clone())
8226 }
8227
8228 /// Deletes the specified NodeGroup resource.
8229 pub fn delete(&self) -> super::builder::node_groups::Delete {
8230 super::builder::node_groups::Delete::new(self.inner.clone())
8231 }
8232
8233 /// Deletes specified nodes from the node group.
8234 pub fn delete_nodes(&self) -> super::builder::node_groups::DeleteNodes {
8235 super::builder::node_groups::DeleteNodes::new(self.inner.clone())
8236 }
8237
8238 /// Returns the specified NodeGroup. Get a list of available NodeGroups
8239 /// by making a list() request.
8240 /// Note: the "nodes" field should not be used. Use nodeGroups.listNodes
8241 /// instead.
8242 pub fn get(&self) -> super::builder::node_groups::Get {
8243 super::builder::node_groups::Get::new(self.inner.clone())
8244 }
8245
8246 /// Gets the access control policy for a resource. May be empty if no such
8247 /// policy or resource exists.
8248 pub fn get_iam_policy(&self) -> super::builder::node_groups::GetIamPolicy {
8249 super::builder::node_groups::GetIamPolicy::new(self.inner.clone())
8250 }
8251
8252 /// Creates a NodeGroup resource in the specified project using the data
8253 /// included in the request.
8254 pub fn insert(&self) -> super::builder::node_groups::Insert {
8255 super::builder::node_groups::Insert::new(self.inner.clone())
8256 }
8257
8258 /// Retrieves a list of node groups available to the specified project.
8259 /// Note: use nodeGroups.listNodes for more details about each group.
8260 pub fn list(&self) -> super::builder::node_groups::List {
8261 super::builder::node_groups::List::new(self.inner.clone())
8262 }
8263
8264 /// Lists nodes in the node group.
8265 pub fn list_nodes(&self) -> super::builder::node_groups::ListNodes {
8266 super::builder::node_groups::ListNodes::new(self.inner.clone())
8267 }
8268
8269 /// Updates the specified node group.
8270 pub fn patch(&self) -> super::builder::node_groups::Patch {
8271 super::builder::node_groups::Patch::new(self.inner.clone())
8272 }
8273
8274 /// Perform maintenance on a subset of nodes in the node group.
8275 pub fn perform_maintenance(&self) -> super::builder::node_groups::PerformMaintenance {
8276 super::builder::node_groups::PerformMaintenance::new(self.inner.clone())
8277 }
8278
8279 /// Sets the access control policy on the specified resource.
8280 /// Replaces any existing policy.
8281 pub fn set_iam_policy(&self) -> super::builder::node_groups::SetIamPolicy {
8282 super::builder::node_groups::SetIamPolicy::new(self.inner.clone())
8283 }
8284
8285 /// Updates the node template of the node group.
8286 pub fn set_node_template(&self) -> super::builder::node_groups::SetNodeTemplate {
8287 super::builder::node_groups::SetNodeTemplate::new(self.inner.clone())
8288 }
8289
8290 /// Simulates maintenance event on specified nodes from the node group.
8291 pub fn simulate_maintenance_event(
8292 &self,
8293 ) -> super::builder::node_groups::SimulateMaintenanceEvent {
8294 super::builder::node_groups::SimulateMaintenanceEvent::new(self.inner.clone())
8295 }
8296
8297 /// Returns permissions that a caller has on the specified resource.
8298 pub fn test_iam_permissions(&self) -> super::builder::node_groups::TestIamPermissions {
8299 super::builder::node_groups::TestIamPermissions::new(self.inner.clone())
8300 }
8301
8302 /// Retrieves the specified zone-specific Operations resource.
8303 pub fn get_operation(&self) -> super::builder::node_groups::GetOperation {
8304 super::builder::node_groups::GetOperation::new(self.inner.clone())
8305 }
8306}
8307
8308/// Implements a client for the Google Compute Engine API.
8309///
8310/// # Example
8311/// ```
8312/// # tokio_test::block_on(async {
8313/// # use google_cloud_compute_v1::client::NodeTemplates;
8314/// let client = NodeTemplates::builder().build().await?;
8315/// // use `client` to make requests to the Google Compute Engine API.
8316/// # gax::client_builder::Result::<()>::Ok(()) });
8317/// ```
8318///
8319/// # Service Description
8320///
8321/// Service for the `nodeTemplates` resource.
8322///
8323/// # Configuration
8324///
8325/// To configure `NodeTemplates` use the `with_*` methods in the type returned
8326/// by [builder()][NodeTemplates::builder]. The default configuration should
8327/// work for most applications. Common configuration changes include
8328///
8329/// * [with_endpoint()]: by default this client uses the global default endpoint
8330/// (`https://compute.googleapis.com`). Applications using regional
8331/// endpoints or running in restricted networks (e.g. a network configured
8332// with [Private Google Access with VPC Service Controls]) may want to
8333/// override this default.
8334/// * [with_credentials()]: by default this client uses
8335/// [Application Default Credentials]. Applications using custom
8336/// authentication may need to override this default.
8337///
8338/// [with_endpoint()]: super::builder::node_templates::ClientBuilder::with_endpoint
8339/// [with_credentials()]: super::builder::node_templates::ClientBuilder::credentials
8340/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8341/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8342///
8343/// # Pooling and Cloning
8344///
8345/// `NodeTemplates` holds a connection pool internally, it is advised to
8346/// create one and the reuse it. You do not need to wrap `NodeTemplates` in
8347/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8348/// already uses an `Arc` internally.
8349#[cfg(feature = "node-templates")]
8350#[cfg_attr(docsrs, doc(cfg(feature = "node-templates")))]
8351#[derive(Clone, Debug)]
8352pub struct NodeTemplates {
8353 inner: std::sync::Arc<dyn super::stub::dynamic::NodeTemplates>,
8354}
8355
8356#[cfg(feature = "node-templates")]
8357impl NodeTemplates {
8358 /// Returns a builder for [NodeTemplates].
8359 ///
8360 /// ```
8361 /// # tokio_test::block_on(async {
8362 /// # use google_cloud_compute_v1::client::NodeTemplates;
8363 /// let client = NodeTemplates::builder().build().await?;
8364 /// # gax::client_builder::Result::<()>::Ok(()) });
8365 /// ```
8366 pub fn builder() -> super::builder::node_templates::ClientBuilder {
8367 gax::client_builder::internal::new_builder(super::builder::node_templates::client::Factory)
8368 }
8369
8370 /// Creates a new client from the provided stub.
8371 ///
8372 /// The most common case for calling this function is in tests mocking the
8373 /// client's behavior.
8374 pub fn from_stub<T>(stub: T) -> Self
8375 where
8376 T: super::stub::NodeTemplates + 'static,
8377 {
8378 Self {
8379 inner: std::sync::Arc::new(stub),
8380 }
8381 }
8382
8383 pub(crate) async fn new(
8384 config: gaxi::options::ClientConfig,
8385 ) -> gax::client_builder::Result<Self> {
8386 let inner = Self::build_inner(config).await?;
8387 Ok(Self { inner })
8388 }
8389
8390 async fn build_inner(
8391 conf: gaxi::options::ClientConfig,
8392 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::NodeTemplates>> {
8393 if gaxi::options::tracing_enabled(&conf) {
8394 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8395 }
8396 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8397 }
8398
8399 async fn build_transport(
8400 conf: gaxi::options::ClientConfig,
8401 ) -> gax::client_builder::Result<impl super::stub::NodeTemplates> {
8402 super::transport::NodeTemplates::new(conf).await
8403 }
8404
8405 async fn build_with_tracing(
8406 conf: gaxi::options::ClientConfig,
8407 ) -> gax::client_builder::Result<impl super::stub::NodeTemplates> {
8408 Self::build_transport(conf)
8409 .await
8410 .map(super::tracing::NodeTemplates::new)
8411 }
8412
8413 /// Retrieves an aggregated list of node templates.
8414 ///
8415 /// To prevent failure, Google recommends that you set the
8416 /// `returnPartialSuccess` parameter to `true`.
8417 pub fn aggregated_list(&self) -> super::builder::node_templates::AggregatedList {
8418 super::builder::node_templates::AggregatedList::new(self.inner.clone())
8419 }
8420
8421 /// Deletes the specified NodeTemplate resource.
8422 pub fn delete(&self) -> super::builder::node_templates::Delete {
8423 super::builder::node_templates::Delete::new(self.inner.clone())
8424 }
8425
8426 /// Returns the specified node template.
8427 pub fn get(&self) -> super::builder::node_templates::Get {
8428 super::builder::node_templates::Get::new(self.inner.clone())
8429 }
8430
8431 /// Gets the access control policy for a resource. May be empty if no such
8432 /// policy or resource exists.
8433 pub fn get_iam_policy(&self) -> super::builder::node_templates::GetIamPolicy {
8434 super::builder::node_templates::GetIamPolicy::new(self.inner.clone())
8435 }
8436
8437 /// Creates a NodeTemplate resource in the specified project using the data
8438 /// included in the request.
8439 pub fn insert(&self) -> super::builder::node_templates::Insert {
8440 super::builder::node_templates::Insert::new(self.inner.clone())
8441 }
8442
8443 /// Retrieves a list of node templates available to the specified
8444 /// project.
8445 pub fn list(&self) -> super::builder::node_templates::List {
8446 super::builder::node_templates::List::new(self.inner.clone())
8447 }
8448
8449 /// Sets the access control policy on the specified resource.
8450 /// Replaces any existing policy.
8451 pub fn set_iam_policy(&self) -> super::builder::node_templates::SetIamPolicy {
8452 super::builder::node_templates::SetIamPolicy::new(self.inner.clone())
8453 }
8454
8455 /// Returns permissions that a caller has on the specified resource.
8456 pub fn test_iam_permissions(&self) -> super::builder::node_templates::TestIamPermissions {
8457 super::builder::node_templates::TestIamPermissions::new(self.inner.clone())
8458 }
8459
8460 /// Retrieves the specified region-specific Operations resource.
8461 pub fn get_operation(&self) -> super::builder::node_templates::GetOperation {
8462 super::builder::node_templates::GetOperation::new(self.inner.clone())
8463 }
8464}
8465
8466/// Implements a client for the Google Compute Engine API.
8467///
8468/// # Example
8469/// ```
8470/// # tokio_test::block_on(async {
8471/// # use google_cloud_compute_v1::client::NodeTypes;
8472/// let client = NodeTypes::builder().build().await?;
8473/// // use `client` to make requests to the Google Compute Engine API.
8474/// # gax::client_builder::Result::<()>::Ok(()) });
8475/// ```
8476///
8477/// # Service Description
8478///
8479/// Service for the `nodeTypes` resource.
8480///
8481/// # Configuration
8482///
8483/// To configure `NodeTypes` use the `with_*` methods in the type returned
8484/// by [builder()][NodeTypes::builder]. The default configuration should
8485/// work for most applications. Common configuration changes include
8486///
8487/// * [with_endpoint()]: by default this client uses the global default endpoint
8488/// (`https://compute.googleapis.com`). Applications using regional
8489/// endpoints or running in restricted networks (e.g. a network configured
8490// with [Private Google Access with VPC Service Controls]) may want to
8491/// override this default.
8492/// * [with_credentials()]: by default this client uses
8493/// [Application Default Credentials]. Applications using custom
8494/// authentication may need to override this default.
8495///
8496/// [with_endpoint()]: super::builder::node_types::ClientBuilder::with_endpoint
8497/// [with_credentials()]: super::builder::node_types::ClientBuilder::credentials
8498/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8499/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8500///
8501/// # Pooling and Cloning
8502///
8503/// `NodeTypes` holds a connection pool internally, it is advised to
8504/// create one and the reuse it. You do not need to wrap `NodeTypes` in
8505/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8506/// already uses an `Arc` internally.
8507#[cfg(feature = "node-types")]
8508#[cfg_attr(docsrs, doc(cfg(feature = "node-types")))]
8509#[derive(Clone, Debug)]
8510pub struct NodeTypes {
8511 inner: std::sync::Arc<dyn super::stub::dynamic::NodeTypes>,
8512}
8513
8514#[cfg(feature = "node-types")]
8515impl NodeTypes {
8516 /// Returns a builder for [NodeTypes].
8517 ///
8518 /// ```
8519 /// # tokio_test::block_on(async {
8520 /// # use google_cloud_compute_v1::client::NodeTypes;
8521 /// let client = NodeTypes::builder().build().await?;
8522 /// # gax::client_builder::Result::<()>::Ok(()) });
8523 /// ```
8524 pub fn builder() -> super::builder::node_types::ClientBuilder {
8525 gax::client_builder::internal::new_builder(super::builder::node_types::client::Factory)
8526 }
8527
8528 /// Creates a new client from the provided stub.
8529 ///
8530 /// The most common case for calling this function is in tests mocking the
8531 /// client's behavior.
8532 pub fn from_stub<T>(stub: T) -> Self
8533 where
8534 T: super::stub::NodeTypes + 'static,
8535 {
8536 Self {
8537 inner: std::sync::Arc::new(stub),
8538 }
8539 }
8540
8541 pub(crate) async fn new(
8542 config: gaxi::options::ClientConfig,
8543 ) -> gax::client_builder::Result<Self> {
8544 let inner = Self::build_inner(config).await?;
8545 Ok(Self { inner })
8546 }
8547
8548 async fn build_inner(
8549 conf: gaxi::options::ClientConfig,
8550 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::NodeTypes>> {
8551 if gaxi::options::tracing_enabled(&conf) {
8552 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8553 }
8554 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8555 }
8556
8557 async fn build_transport(
8558 conf: gaxi::options::ClientConfig,
8559 ) -> gax::client_builder::Result<impl super::stub::NodeTypes> {
8560 super::transport::NodeTypes::new(conf).await
8561 }
8562
8563 async fn build_with_tracing(
8564 conf: gaxi::options::ClientConfig,
8565 ) -> gax::client_builder::Result<impl super::stub::NodeTypes> {
8566 Self::build_transport(conf)
8567 .await
8568 .map(super::tracing::NodeTypes::new)
8569 }
8570
8571 /// Retrieves an aggregated list of node types.
8572 ///
8573 /// To prevent failure, Google recommends that you set the
8574 /// `returnPartialSuccess` parameter to `true`.
8575 pub fn aggregated_list(&self) -> super::builder::node_types::AggregatedList {
8576 super::builder::node_types::AggregatedList::new(self.inner.clone())
8577 }
8578
8579 /// Returns the specified node type.
8580 pub fn get(&self) -> super::builder::node_types::Get {
8581 super::builder::node_types::Get::new(self.inner.clone())
8582 }
8583
8584 /// Retrieves a list of node types available to the specified
8585 /// project.
8586 pub fn list(&self) -> super::builder::node_types::List {
8587 super::builder::node_types::List::new(self.inner.clone())
8588 }
8589}
8590
8591/// Implements a client for the Google Compute Engine API.
8592///
8593/// # Example
8594/// ```
8595/// # tokio_test::block_on(async {
8596/// # use google_cloud_compute_v1::client::OrganizationSecurityPolicies;
8597/// let client = OrganizationSecurityPolicies::builder().build().await?;
8598/// // use `client` to make requests to the Google Compute Engine API.
8599/// # gax::client_builder::Result::<()>::Ok(()) });
8600/// ```
8601///
8602/// # Service Description
8603///
8604/// Service for the `organizationSecurityPolicies` resource.
8605///
8606/// # Configuration
8607///
8608/// To configure `OrganizationSecurityPolicies` use the `with_*` methods in the type returned
8609/// by [builder()][OrganizationSecurityPolicies::builder]. The default configuration should
8610/// work for most applications. Common configuration changes include
8611///
8612/// * [with_endpoint()]: by default this client uses the global default endpoint
8613/// (`https://compute.googleapis.com`). Applications using regional
8614/// endpoints or running in restricted networks (e.g. a network configured
8615// with [Private Google Access with VPC Service Controls]) may want to
8616/// override this default.
8617/// * [with_credentials()]: by default this client uses
8618/// [Application Default Credentials]. Applications using custom
8619/// authentication may need to override this default.
8620///
8621/// [with_endpoint()]: super::builder::organization_security_policies::ClientBuilder::with_endpoint
8622/// [with_credentials()]: super::builder::organization_security_policies::ClientBuilder::credentials
8623/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8624/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8625///
8626/// # Pooling and Cloning
8627///
8628/// `OrganizationSecurityPolicies` holds a connection pool internally, it is advised to
8629/// create one and the reuse it. You do not need to wrap `OrganizationSecurityPolicies` in
8630/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8631/// already uses an `Arc` internally.
8632#[cfg(feature = "organization-security-policies")]
8633#[cfg_attr(docsrs, doc(cfg(feature = "organization-security-policies")))]
8634#[derive(Clone, Debug)]
8635pub struct OrganizationSecurityPolicies {
8636 inner: std::sync::Arc<dyn super::stub::dynamic::OrganizationSecurityPolicies>,
8637}
8638
8639#[cfg(feature = "organization-security-policies")]
8640impl OrganizationSecurityPolicies {
8641 /// Returns a builder for [OrganizationSecurityPolicies].
8642 ///
8643 /// ```
8644 /// # tokio_test::block_on(async {
8645 /// # use google_cloud_compute_v1::client::OrganizationSecurityPolicies;
8646 /// let client = OrganizationSecurityPolicies::builder().build().await?;
8647 /// # gax::client_builder::Result::<()>::Ok(()) });
8648 /// ```
8649 pub fn builder() -> super::builder::organization_security_policies::ClientBuilder {
8650 gax::client_builder::internal::new_builder(
8651 super::builder::organization_security_policies::client::Factory,
8652 )
8653 }
8654
8655 /// Creates a new client from the provided stub.
8656 ///
8657 /// The most common case for calling this function is in tests mocking the
8658 /// client's behavior.
8659 pub fn from_stub<T>(stub: T) -> Self
8660 where
8661 T: super::stub::OrganizationSecurityPolicies + 'static,
8662 {
8663 Self {
8664 inner: std::sync::Arc::new(stub),
8665 }
8666 }
8667
8668 pub(crate) async fn new(
8669 config: gaxi::options::ClientConfig,
8670 ) -> gax::client_builder::Result<Self> {
8671 let inner = Self::build_inner(config).await?;
8672 Ok(Self { inner })
8673 }
8674
8675 async fn build_inner(
8676 conf: gaxi::options::ClientConfig,
8677 ) -> gax::client_builder::Result<
8678 std::sync::Arc<dyn super::stub::dynamic::OrganizationSecurityPolicies>,
8679 > {
8680 if gaxi::options::tracing_enabled(&conf) {
8681 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8682 }
8683 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8684 }
8685
8686 async fn build_transport(
8687 conf: gaxi::options::ClientConfig,
8688 ) -> gax::client_builder::Result<impl super::stub::OrganizationSecurityPolicies> {
8689 super::transport::OrganizationSecurityPolicies::new(conf).await
8690 }
8691
8692 async fn build_with_tracing(
8693 conf: gaxi::options::ClientConfig,
8694 ) -> gax::client_builder::Result<impl super::stub::OrganizationSecurityPolicies> {
8695 Self::build_transport(conf)
8696 .await
8697 .map(super::tracing::OrganizationSecurityPolicies::new)
8698 }
8699
8700 /// Inserts an association for the specified security policy.
8701 ///
8702 /// This has billing implications. Projects in the hierarchy with effective
8703 /// hierarchical security policies will be automatically enrolled into Cloud
8704 /// Armor Enterprise if not already enrolled.
8705 ///
8706 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8707 /// versions of this API were used to modify firewall policies. This usage is
8708 /// now disabled for most organizations. Use firewallPolicies.addAssociation
8709 /// instead.
8710 pub fn add_association(
8711 &self,
8712 ) -> super::builder::organization_security_policies::AddAssociation {
8713 super::builder::organization_security_policies::AddAssociation::new(self.inner.clone())
8714 }
8715
8716 /// Inserts a rule into a security policy.
8717 ///
8718 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8719 /// versions of this API were used to modify firewall policies. This usage is
8720 /// now disabled for most organizations. Use firewallPolicies.addRule instead.
8721 pub fn add_rule(&self) -> super::builder::organization_security_policies::AddRule {
8722 super::builder::organization_security_policies::AddRule::new(self.inner.clone())
8723 }
8724
8725 /// Copies rules to the specified security policy.
8726 ///
8727 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8728 /// versions of this API were used to modify firewall policies. This usage is
8729 /// now disabled for most organizations. Use firewallPolicies.cloneRules
8730 /// instead.
8731 pub fn copy_rules(&self) -> super::builder::organization_security_policies::CopyRules {
8732 super::builder::organization_security_policies::CopyRules::new(self.inner.clone())
8733 }
8734
8735 /// Deletes the specified policy.
8736 ///
8737 /// Use this API to remove Cloud Armor policies. Previously, alpha and beta
8738 /// versions of this API were used to remove firewall policies. This usage is
8739 /// now disabled for most organizations. Use firewallPolicies.delete instead.
8740 pub fn delete(&self) -> super::builder::organization_security_policies::Delete {
8741 super::builder::organization_security_policies::Delete::new(self.inner.clone())
8742 }
8743
8744 /// List all of the ordered rules present in a single specified policy.
8745 ///
8746 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
8747 /// versions of this API were used to read firewall policies. This usage is now
8748 /// disabled for most organizations. Use firewallPolicies.get instead.
8749 pub fn get(&self) -> super::builder::organization_security_policies::Get {
8750 super::builder::organization_security_policies::Get::new(self.inner.clone())
8751 }
8752
8753 /// Gets an association with the specified name.
8754 ///
8755 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
8756 /// versions of this API were used to read firewall policies. This usage is
8757 /// now disabled for most organizations. Use firewallPolicies.getAssociation
8758 /// instead.
8759 pub fn get_association(
8760 &self,
8761 ) -> super::builder::organization_security_policies::GetAssociation {
8762 super::builder::organization_security_policies::GetAssociation::new(self.inner.clone())
8763 }
8764
8765 /// Gets a rule at the specified priority.
8766 ///
8767 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
8768 /// versions of this API were used to read firewall policies. This usage is now
8769 /// disabled for most organizations. Use firewallPolicies.getRule instead.
8770 pub fn get_rule(&self) -> super::builder::organization_security_policies::GetRule {
8771 super::builder::organization_security_policies::GetRule::new(self.inner.clone())
8772 }
8773
8774 /// Creates a new policy in the specified organization using the data included
8775 /// in the request.
8776 ///
8777 /// Use this API to add Cloud Armor policies. Previously, alpha and beta
8778 /// versions of this API were used to add firewall policies. This usage is now
8779 /// disabled for most organizations. Use firewallPolicies.insert instead.
8780 pub fn insert(&self) -> super::builder::organization_security_policies::Insert {
8781 super::builder::organization_security_policies::Insert::new(self.inner.clone())
8782 }
8783
8784 /// List all the policies that have been configured for the specified
8785 /// organization.
8786 ///
8787 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
8788 /// versions of this API were used to read firewall policies. This usage is now
8789 /// disabled for most organizations. Use firewallPolicies.list instead.
8790 pub fn list(&self) -> super::builder::organization_security_policies::List {
8791 super::builder::organization_security_policies::List::new(self.inner.clone())
8792 }
8793
8794 /// Lists associations of a specified target, i.e., organization or folder.
8795 ///
8796 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
8797 /// versions of this API were used to read firewall policies. This usage is
8798 /// now disabled for most organizations. Use firewallPolicies.listAssociations
8799 /// instead.
8800 pub fn list_associations(
8801 &self,
8802 ) -> super::builder::organization_security_policies::ListAssociations {
8803 super::builder::organization_security_policies::ListAssociations::new(self.inner.clone())
8804 }
8805
8806 /// Gets the current list of preconfigured Web Application Firewall (WAF)
8807 /// expressions.
8808 pub fn list_preconfigured_expression_sets(
8809 &self,
8810 ) -> super::builder::organization_security_policies::ListPreconfiguredExpressionSets {
8811 super::builder::organization_security_policies::ListPreconfiguredExpressionSets::new(
8812 self.inner.clone(),
8813 )
8814 }
8815
8816 /// Moves the specified security policy.
8817 ///
8818 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8819 /// versions of this API were used to modify firewall policies. This usage is
8820 /// now disabled for most organizations. Use firewallPolicies.move instead.
8821 pub fn r#move(&self) -> super::builder::organization_security_policies::Move {
8822 super::builder::organization_security_policies::Move::new(self.inner.clone())
8823 }
8824
8825 /// Patches the specified policy with the data included in the request.
8826 ///
8827 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8828 /// versions of this API were used to modify firewall policies. This usage is
8829 /// now disabled for most organizations. Use firewallPolicies.patch instead.
8830 pub fn patch(&self) -> super::builder::organization_security_policies::Patch {
8831 super::builder::organization_security_policies::Patch::new(self.inner.clone())
8832 }
8833
8834 /// Patches a rule at the specified priority.
8835 ///
8836 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8837 /// versions of this API were used to modify firewall policies. This usage is
8838 /// now disabled for most organizations. Use firewallPolicies.patchRule
8839 /// instead.
8840 pub fn patch_rule(&self) -> super::builder::organization_security_policies::PatchRule {
8841 super::builder::organization_security_policies::PatchRule::new(self.inner.clone())
8842 }
8843
8844 /// Removes an association for the specified security policy.
8845 ///
8846 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8847 /// versions of this API were used to modify firewall policies. This usage is
8848 /// now disabled for most organizations. Use firewallPolicies.removeAssociation
8849 /// instead.
8850 pub fn remove_association(
8851 &self,
8852 ) -> super::builder::organization_security_policies::RemoveAssociation {
8853 super::builder::organization_security_policies::RemoveAssociation::new(self.inner.clone())
8854 }
8855
8856 /// Deletes a rule at the specified priority.
8857 ///
8858 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
8859 /// versions of this API were used to modify firewall policies. This usage is
8860 /// now disabled for most organizations. Use firewallPolicies.removeRule
8861 /// instead.
8862 pub fn remove_rule(&self) -> super::builder::organization_security_policies::RemoveRule {
8863 super::builder::organization_security_policies::RemoveRule::new(self.inner.clone())
8864 }
8865
8866 /// Retrieves the specified Operations resource. Gets a list of operations
8867 /// by making a `list()` request.
8868 pub fn get_operation(&self) -> super::builder::organization_security_policies::GetOperation {
8869 super::builder::organization_security_policies::GetOperation::new(self.inner.clone())
8870 }
8871}
8872
8873/// Implements a client for the Google Compute Engine API.
8874///
8875/// # Example
8876/// ```
8877/// # tokio_test::block_on(async {
8878/// # use google_cloud_compute_v1::client::PacketMirrorings;
8879/// let client = PacketMirrorings::builder().build().await?;
8880/// // use `client` to make requests to the Google Compute Engine API.
8881/// # gax::client_builder::Result::<()>::Ok(()) });
8882/// ```
8883///
8884/// # Service Description
8885///
8886/// Service for the `packetMirrorings` resource.
8887///
8888/// # Configuration
8889///
8890/// To configure `PacketMirrorings` use the `with_*` methods in the type returned
8891/// by [builder()][PacketMirrorings::builder]. The default configuration should
8892/// work for most applications. Common configuration changes include
8893///
8894/// * [with_endpoint()]: by default this client uses the global default endpoint
8895/// (`https://compute.googleapis.com`). Applications using regional
8896/// endpoints or running in restricted networks (e.g. a network configured
8897// with [Private Google Access with VPC Service Controls]) may want to
8898/// override this default.
8899/// * [with_credentials()]: by default this client uses
8900/// [Application Default Credentials]. Applications using custom
8901/// authentication may need to override this default.
8902///
8903/// [with_endpoint()]: super::builder::packet_mirrorings::ClientBuilder::with_endpoint
8904/// [with_credentials()]: super::builder::packet_mirrorings::ClientBuilder::credentials
8905/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8906/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8907///
8908/// # Pooling and Cloning
8909///
8910/// `PacketMirrorings` holds a connection pool internally, it is advised to
8911/// create one and the reuse it. You do not need to wrap `PacketMirrorings` in
8912/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8913/// already uses an `Arc` internally.
8914#[cfg(feature = "packet-mirrorings")]
8915#[cfg_attr(docsrs, doc(cfg(feature = "packet-mirrorings")))]
8916#[derive(Clone, Debug)]
8917pub struct PacketMirrorings {
8918 inner: std::sync::Arc<dyn super::stub::dynamic::PacketMirrorings>,
8919}
8920
8921#[cfg(feature = "packet-mirrorings")]
8922impl PacketMirrorings {
8923 /// Returns a builder for [PacketMirrorings].
8924 ///
8925 /// ```
8926 /// # tokio_test::block_on(async {
8927 /// # use google_cloud_compute_v1::client::PacketMirrorings;
8928 /// let client = PacketMirrorings::builder().build().await?;
8929 /// # gax::client_builder::Result::<()>::Ok(()) });
8930 /// ```
8931 pub fn builder() -> super::builder::packet_mirrorings::ClientBuilder {
8932 gax::client_builder::internal::new_builder(
8933 super::builder::packet_mirrorings::client::Factory,
8934 )
8935 }
8936
8937 /// Creates a new client from the provided stub.
8938 ///
8939 /// The most common case for calling this function is in tests mocking the
8940 /// client's behavior.
8941 pub fn from_stub<T>(stub: T) -> Self
8942 where
8943 T: super::stub::PacketMirrorings + 'static,
8944 {
8945 Self {
8946 inner: std::sync::Arc::new(stub),
8947 }
8948 }
8949
8950 pub(crate) async fn new(
8951 config: gaxi::options::ClientConfig,
8952 ) -> gax::client_builder::Result<Self> {
8953 let inner = Self::build_inner(config).await?;
8954 Ok(Self { inner })
8955 }
8956
8957 async fn build_inner(
8958 conf: gaxi::options::ClientConfig,
8959 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::PacketMirrorings>>
8960 {
8961 if gaxi::options::tracing_enabled(&conf) {
8962 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8963 }
8964 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8965 }
8966
8967 async fn build_transport(
8968 conf: gaxi::options::ClientConfig,
8969 ) -> gax::client_builder::Result<impl super::stub::PacketMirrorings> {
8970 super::transport::PacketMirrorings::new(conf).await
8971 }
8972
8973 async fn build_with_tracing(
8974 conf: gaxi::options::ClientConfig,
8975 ) -> gax::client_builder::Result<impl super::stub::PacketMirrorings> {
8976 Self::build_transport(conf)
8977 .await
8978 .map(super::tracing::PacketMirrorings::new)
8979 }
8980
8981 /// Retrieves an aggregated list of packetMirrorings.
8982 ///
8983 /// To prevent failure, Google recommends that you set the
8984 /// `returnPartialSuccess` parameter to `true`.
8985 pub fn aggregated_list(&self) -> super::builder::packet_mirrorings::AggregatedList {
8986 super::builder::packet_mirrorings::AggregatedList::new(self.inner.clone())
8987 }
8988
8989 /// Deletes the specified PacketMirroring resource.
8990 pub fn delete(&self) -> super::builder::packet_mirrorings::Delete {
8991 super::builder::packet_mirrorings::Delete::new(self.inner.clone())
8992 }
8993
8994 /// Returns the specified PacketMirroring resource.
8995 pub fn get(&self) -> super::builder::packet_mirrorings::Get {
8996 super::builder::packet_mirrorings::Get::new(self.inner.clone())
8997 }
8998
8999 /// Creates a PacketMirroring resource in the specified project and region
9000 /// using the data included in the request.
9001 pub fn insert(&self) -> super::builder::packet_mirrorings::Insert {
9002 super::builder::packet_mirrorings::Insert::new(self.inner.clone())
9003 }
9004
9005 /// Retrieves a list of PacketMirroring resources available to the specified
9006 /// project and region.
9007 pub fn list(&self) -> super::builder::packet_mirrorings::List {
9008 super::builder::packet_mirrorings::List::new(self.inner.clone())
9009 }
9010
9011 /// Patches the specified PacketMirroring resource with the data included in
9012 /// the request. This method supportsPATCH
9013 /// semantics and usesJSON merge
9014 /// patch format and processing rules.
9015 pub fn patch(&self) -> super::builder::packet_mirrorings::Patch {
9016 super::builder::packet_mirrorings::Patch::new(self.inner.clone())
9017 }
9018
9019 /// Returns permissions that a caller has on the specified resource.
9020 pub fn test_iam_permissions(&self) -> super::builder::packet_mirrorings::TestIamPermissions {
9021 super::builder::packet_mirrorings::TestIamPermissions::new(self.inner.clone())
9022 }
9023
9024 /// Retrieves the specified region-specific Operations resource.
9025 pub fn get_operation(&self) -> super::builder::packet_mirrorings::GetOperation {
9026 super::builder::packet_mirrorings::GetOperation::new(self.inner.clone())
9027 }
9028}
9029
9030/// Implements a client for the Google Compute Engine API.
9031///
9032/// # Example
9033/// ```
9034/// # tokio_test::block_on(async {
9035/// # use google_cloud_compute_v1::client::PreviewFeatures;
9036/// let client = PreviewFeatures::builder().build().await?;
9037/// // use `client` to make requests to the Google Compute Engine API.
9038/// # gax::client_builder::Result::<()>::Ok(()) });
9039/// ```
9040///
9041/// # Service Description
9042///
9043/// Service for the `previewFeatures` resource.
9044///
9045/// # Configuration
9046///
9047/// To configure `PreviewFeatures` use the `with_*` methods in the type returned
9048/// by [builder()][PreviewFeatures::builder]. The default configuration should
9049/// work for most applications. Common configuration changes include
9050///
9051/// * [with_endpoint()]: by default this client uses the global default endpoint
9052/// (`https://compute.googleapis.com`). Applications using regional
9053/// endpoints or running in restricted networks (e.g. a network configured
9054// with [Private Google Access with VPC Service Controls]) may want to
9055/// override this default.
9056/// * [with_credentials()]: by default this client uses
9057/// [Application Default Credentials]. Applications using custom
9058/// authentication may need to override this default.
9059///
9060/// [with_endpoint()]: super::builder::preview_features::ClientBuilder::with_endpoint
9061/// [with_credentials()]: super::builder::preview_features::ClientBuilder::credentials
9062/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9063/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9064///
9065/// # Pooling and Cloning
9066///
9067/// `PreviewFeatures` holds a connection pool internally, it is advised to
9068/// create one and the reuse it. You do not need to wrap `PreviewFeatures` in
9069/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9070/// already uses an `Arc` internally.
9071#[cfg(feature = "preview-features")]
9072#[cfg_attr(docsrs, doc(cfg(feature = "preview-features")))]
9073#[derive(Clone, Debug)]
9074pub struct PreviewFeatures {
9075 inner: std::sync::Arc<dyn super::stub::dynamic::PreviewFeatures>,
9076}
9077
9078#[cfg(feature = "preview-features")]
9079impl PreviewFeatures {
9080 /// Returns a builder for [PreviewFeatures].
9081 ///
9082 /// ```
9083 /// # tokio_test::block_on(async {
9084 /// # use google_cloud_compute_v1::client::PreviewFeatures;
9085 /// let client = PreviewFeatures::builder().build().await?;
9086 /// # gax::client_builder::Result::<()>::Ok(()) });
9087 /// ```
9088 pub fn builder() -> super::builder::preview_features::ClientBuilder {
9089 gax::client_builder::internal::new_builder(
9090 super::builder::preview_features::client::Factory,
9091 )
9092 }
9093
9094 /// Creates a new client from the provided stub.
9095 ///
9096 /// The most common case for calling this function is in tests mocking the
9097 /// client's behavior.
9098 pub fn from_stub<T>(stub: T) -> Self
9099 where
9100 T: super::stub::PreviewFeatures + 'static,
9101 {
9102 Self {
9103 inner: std::sync::Arc::new(stub),
9104 }
9105 }
9106
9107 pub(crate) async fn new(
9108 config: gaxi::options::ClientConfig,
9109 ) -> gax::client_builder::Result<Self> {
9110 let inner = Self::build_inner(config).await?;
9111 Ok(Self { inner })
9112 }
9113
9114 async fn build_inner(
9115 conf: gaxi::options::ClientConfig,
9116 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::PreviewFeatures>>
9117 {
9118 if gaxi::options::tracing_enabled(&conf) {
9119 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9120 }
9121 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9122 }
9123
9124 async fn build_transport(
9125 conf: gaxi::options::ClientConfig,
9126 ) -> gax::client_builder::Result<impl super::stub::PreviewFeatures> {
9127 super::transport::PreviewFeatures::new(conf).await
9128 }
9129
9130 async fn build_with_tracing(
9131 conf: gaxi::options::ClientConfig,
9132 ) -> gax::client_builder::Result<impl super::stub::PreviewFeatures> {
9133 Self::build_transport(conf)
9134 .await
9135 .map(super::tracing::PreviewFeatures::new)
9136 }
9137
9138 /// Returns the details of the given PreviewFeature.
9139 pub fn get(&self) -> super::builder::preview_features::Get {
9140 super::builder::preview_features::Get::new(self.inner.clone())
9141 }
9142
9143 /// Returns the details of the given PreviewFeature.
9144 pub fn list(&self) -> super::builder::preview_features::List {
9145 super::builder::preview_features::List::new(self.inner.clone())
9146 }
9147
9148 /// Patches the given PreviewFeature. This method is used to enable or disable
9149 /// a PreviewFeature.
9150 pub fn update(&self) -> super::builder::preview_features::Update {
9151 super::builder::preview_features::Update::new(self.inner.clone())
9152 }
9153
9154 /// Retrieves the specified Operations resource.
9155 pub fn get_operation(&self) -> super::builder::preview_features::GetOperation {
9156 super::builder::preview_features::GetOperation::new(self.inner.clone())
9157 }
9158}
9159
9160/// Implements a client for the Google Compute Engine API.
9161///
9162/// # Example
9163/// ```
9164/// # tokio_test::block_on(async {
9165/// # use google_cloud_compute_v1::client::Projects;
9166/// let client = Projects::builder().build().await?;
9167/// // use `client` to make requests to the Google Compute Engine API.
9168/// # gax::client_builder::Result::<()>::Ok(()) });
9169/// ```
9170///
9171/// # Service Description
9172///
9173/// Service for the `projects` resource.
9174///
9175/// # Configuration
9176///
9177/// To configure `Projects` use the `with_*` methods in the type returned
9178/// by [builder()][Projects::builder]. The default configuration should
9179/// work for most applications. Common configuration changes include
9180///
9181/// * [with_endpoint()]: by default this client uses the global default endpoint
9182/// (`https://compute.googleapis.com`). Applications using regional
9183/// endpoints or running in restricted networks (e.g. a network configured
9184// with [Private Google Access with VPC Service Controls]) may want to
9185/// override this default.
9186/// * [with_credentials()]: by default this client uses
9187/// [Application Default Credentials]. Applications using custom
9188/// authentication may need to override this default.
9189///
9190/// [with_endpoint()]: super::builder::projects::ClientBuilder::with_endpoint
9191/// [with_credentials()]: super::builder::projects::ClientBuilder::credentials
9192/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9193/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9194///
9195/// # Pooling and Cloning
9196///
9197/// `Projects` holds a connection pool internally, it is advised to
9198/// create one and the reuse it. You do not need to wrap `Projects` in
9199/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9200/// already uses an `Arc` internally.
9201#[cfg(feature = "projects")]
9202#[cfg_attr(docsrs, doc(cfg(feature = "projects")))]
9203#[derive(Clone, Debug)]
9204pub struct Projects {
9205 inner: std::sync::Arc<dyn super::stub::dynamic::Projects>,
9206}
9207
9208#[cfg(feature = "projects")]
9209impl Projects {
9210 /// Returns a builder for [Projects].
9211 ///
9212 /// ```
9213 /// # tokio_test::block_on(async {
9214 /// # use google_cloud_compute_v1::client::Projects;
9215 /// let client = Projects::builder().build().await?;
9216 /// # gax::client_builder::Result::<()>::Ok(()) });
9217 /// ```
9218 pub fn builder() -> super::builder::projects::ClientBuilder {
9219 gax::client_builder::internal::new_builder(super::builder::projects::client::Factory)
9220 }
9221
9222 /// Creates a new client from the provided stub.
9223 ///
9224 /// The most common case for calling this function is in tests mocking the
9225 /// client's behavior.
9226 pub fn from_stub<T>(stub: T) -> Self
9227 where
9228 T: super::stub::Projects + 'static,
9229 {
9230 Self {
9231 inner: std::sync::Arc::new(stub),
9232 }
9233 }
9234
9235 pub(crate) async fn new(
9236 config: gaxi::options::ClientConfig,
9237 ) -> gax::client_builder::Result<Self> {
9238 let inner = Self::build_inner(config).await?;
9239 Ok(Self { inner })
9240 }
9241
9242 async fn build_inner(
9243 conf: gaxi::options::ClientConfig,
9244 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Projects>> {
9245 if gaxi::options::tracing_enabled(&conf) {
9246 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9247 }
9248 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9249 }
9250
9251 async fn build_transport(
9252 conf: gaxi::options::ClientConfig,
9253 ) -> gax::client_builder::Result<impl super::stub::Projects> {
9254 super::transport::Projects::new(conf).await
9255 }
9256
9257 async fn build_with_tracing(
9258 conf: gaxi::options::ClientConfig,
9259 ) -> gax::client_builder::Result<impl super::stub::Projects> {
9260 Self::build_transport(conf)
9261 .await
9262 .map(super::tracing::Projects::new)
9263 }
9264
9265 /// Disable this project as a shared VPC host project.
9266 pub fn disable_xpn_host(&self) -> super::builder::projects::DisableXpnHost {
9267 super::builder::projects::DisableXpnHost::new(self.inner.clone())
9268 }
9269
9270 /// Disable a service resource (also known as service project) associated with
9271 /// this host project.
9272 pub fn disable_xpn_resource(&self) -> super::builder::projects::DisableXpnResource {
9273 super::builder::projects::DisableXpnResource::new(self.inner.clone())
9274 }
9275
9276 /// Enable this project as a shared VPC host project.
9277 pub fn enable_xpn_host(&self) -> super::builder::projects::EnableXpnHost {
9278 super::builder::projects::EnableXpnHost::new(self.inner.clone())
9279 }
9280
9281 /// Enable service resource (a.k.a service project) for a host project, so that
9282 /// subnets in the host project can be used by instances in the service
9283 /// project.
9284 pub fn enable_xpn_resource(&self) -> super::builder::projects::EnableXpnResource {
9285 super::builder::projects::EnableXpnResource::new(self.inner.clone())
9286 }
9287
9288 /// Returns the specified Project resource.
9289 ///
9290 /// To decrease latency for this method, you can optionally omit any unneeded
9291 /// information from the response by using a field mask. This practice is
9292 /// especially recommended for unused quota information (the `quotas` field).
9293 /// To exclude one or more fields, set your request's `fields` query parameter
9294 /// to only include the fields you need. For example, to only include the `id`
9295 /// and `selfLink` fields, add the query parameter `?fields=id,selfLink` to
9296 /// your request.
9297 pub fn get(&self) -> super::builder::projects::Get {
9298 super::builder::projects::Get::new(self.inner.clone())
9299 }
9300
9301 /// Gets the shared VPC host project that this project links to. May be empty
9302 /// if no link exists.
9303 pub fn get_xpn_host(&self) -> super::builder::projects::GetXpnHost {
9304 super::builder::projects::GetXpnHost::new(self.inner.clone())
9305 }
9306
9307 /// Gets service resources (a.k.a service project) associated with this host
9308 /// project.
9309 pub fn get_xpn_resources(&self) -> super::builder::projects::GetXpnResources {
9310 super::builder::projects::GetXpnResources::new(self.inner.clone())
9311 }
9312
9313 /// Lists all shared VPC host projects visible to the user in an organization.
9314 pub fn list_xpn_hosts(&self) -> super::builder::projects::ListXpnHosts {
9315 super::builder::projects::ListXpnHosts::new(self.inner.clone())
9316 }
9317
9318 /// Moves a persistent disk from one zone to another.
9319 /// *Note*: The moveDisk API will be deprecated on September 29, 2026.
9320 ///
9321 /// Starting September 29, 2025, you can't use the moveDisk API on new
9322 /// projects. To move a disk to a different region or zone, follow the steps in
9323 /// [Change the location of a
9324 /// disk](https://cloud.google.com/compute/docs/disks/migrate-to-hyperdisk#migrate-to-hd).
9325 ///
9326 /// Projects that already use the moveDisk API can continue usage until
9327 /// September 29, 2026.
9328 ///
9329 /// Starting November 1, 2025, API responses will include a warning message in
9330 /// the response body about the upcoming deprecation. You can skip the message
9331 /// to continue using the service without interruption.
9332 #[deprecated]
9333 pub fn move_disk(&self) -> super::builder::projects::MoveDisk {
9334 super::builder::projects::MoveDisk::new(self.inner.clone())
9335 }
9336
9337 /// Moves an instance and its attached persistent disks from one zone to
9338 /// another.
9339 /// *Note*: Moving VMs or disks by using this method might
9340 /// cause unexpected behavior. For more information, see the [known
9341 /// issue](/compute/docs/troubleshooting/known-issues#moving_vms_or_disks_using_the_moveinstance_api_or_the_causes_unexpected_behavior).
9342 /// [Deprecated] This method is deprecated. See [moving instance across
9343 /// zones](/compute/docs/instances/moving-instance-across-zones) instead.
9344 #[deprecated]
9345 pub fn move_instance(&self) -> super::builder::projects::MoveInstance {
9346 super::builder::projects::MoveInstance::new(self.inner.clone())
9347 }
9348
9349 /// Sets the Cloud Armor tier of the project. To set ENTERPRISE or above the
9350 /// billing account of the project must be subscribed to Cloud Armor
9351 /// Enterprise. See Subscribing
9352 /// to Cloud Armor Enterprise for more information.
9353 pub fn set_cloud_armor_tier(&self) -> super::builder::projects::SetCloudArmorTier {
9354 super::builder::projects::SetCloudArmorTier::new(self.inner.clone())
9355 }
9356
9357 /// Sets metadata common to all instances within the specified project using
9358 /// the data included in the request.
9359 pub fn set_common_instance_metadata(
9360 &self,
9361 ) -> super::builder::projects::SetCommonInstanceMetadata {
9362 super::builder::projects::SetCommonInstanceMetadata::new(self.inner.clone())
9363 }
9364
9365 /// Sets the default network tier of the project. The default network tier is
9366 /// used when an address/forwardingRule/instance is created without specifying
9367 /// the network tier field.
9368 pub fn set_default_network_tier(&self) -> super::builder::projects::SetDefaultNetworkTier {
9369 super::builder::projects::SetDefaultNetworkTier::new(self.inner.clone())
9370 }
9371
9372 /// Enables the usage export feature and sets theusage export bucket
9373 /// where reports are stored. If you provide an empty request body using this
9374 /// method, the usage export feature will be disabled.
9375 pub fn set_usage_export_bucket(&self) -> super::builder::projects::SetUsageExportBucket {
9376 super::builder::projects::SetUsageExportBucket::new(self.inner.clone())
9377 }
9378
9379 /// Retrieves the specified Operations resource.
9380 pub fn get_operation(&self) -> super::builder::projects::GetOperation {
9381 super::builder::projects::GetOperation::new(self.inner.clone())
9382 }
9383}
9384
9385/// Implements a client for the Google Compute Engine API.
9386///
9387/// # Example
9388/// ```
9389/// # tokio_test::block_on(async {
9390/// # use google_cloud_compute_v1::client::PublicAdvertisedPrefixes;
9391/// let client = PublicAdvertisedPrefixes::builder().build().await?;
9392/// // use `client` to make requests to the Google Compute Engine API.
9393/// # gax::client_builder::Result::<()>::Ok(()) });
9394/// ```
9395///
9396/// # Service Description
9397///
9398/// Service for the `publicAdvertisedPrefixes` resource.
9399///
9400/// # Configuration
9401///
9402/// To configure `PublicAdvertisedPrefixes` use the `with_*` methods in the type returned
9403/// by [builder()][PublicAdvertisedPrefixes::builder]. The default configuration should
9404/// work for most applications. Common configuration changes include
9405///
9406/// * [with_endpoint()]: by default this client uses the global default endpoint
9407/// (`https://compute.googleapis.com`). Applications using regional
9408/// endpoints or running in restricted networks (e.g. a network configured
9409// with [Private Google Access with VPC Service Controls]) may want to
9410/// override this default.
9411/// * [with_credentials()]: by default this client uses
9412/// [Application Default Credentials]. Applications using custom
9413/// authentication may need to override this default.
9414///
9415/// [with_endpoint()]: super::builder::public_advertised_prefixes::ClientBuilder::with_endpoint
9416/// [with_credentials()]: super::builder::public_advertised_prefixes::ClientBuilder::credentials
9417/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9418/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9419///
9420/// # Pooling and Cloning
9421///
9422/// `PublicAdvertisedPrefixes` holds a connection pool internally, it is advised to
9423/// create one and the reuse it. You do not need to wrap `PublicAdvertisedPrefixes` in
9424/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9425/// already uses an `Arc` internally.
9426#[cfg(feature = "public-advertised-prefixes")]
9427#[cfg_attr(docsrs, doc(cfg(feature = "public-advertised-prefixes")))]
9428#[derive(Clone, Debug)]
9429pub struct PublicAdvertisedPrefixes {
9430 inner: std::sync::Arc<dyn super::stub::dynamic::PublicAdvertisedPrefixes>,
9431}
9432
9433#[cfg(feature = "public-advertised-prefixes")]
9434impl PublicAdvertisedPrefixes {
9435 /// Returns a builder for [PublicAdvertisedPrefixes].
9436 ///
9437 /// ```
9438 /// # tokio_test::block_on(async {
9439 /// # use google_cloud_compute_v1::client::PublicAdvertisedPrefixes;
9440 /// let client = PublicAdvertisedPrefixes::builder().build().await?;
9441 /// # gax::client_builder::Result::<()>::Ok(()) });
9442 /// ```
9443 pub fn builder() -> super::builder::public_advertised_prefixes::ClientBuilder {
9444 gax::client_builder::internal::new_builder(
9445 super::builder::public_advertised_prefixes::client::Factory,
9446 )
9447 }
9448
9449 /// Creates a new client from the provided stub.
9450 ///
9451 /// The most common case for calling this function is in tests mocking the
9452 /// client's behavior.
9453 pub fn from_stub<T>(stub: T) -> Self
9454 where
9455 T: super::stub::PublicAdvertisedPrefixes + 'static,
9456 {
9457 Self {
9458 inner: std::sync::Arc::new(stub),
9459 }
9460 }
9461
9462 pub(crate) async fn new(
9463 config: gaxi::options::ClientConfig,
9464 ) -> gax::client_builder::Result<Self> {
9465 let inner = Self::build_inner(config).await?;
9466 Ok(Self { inner })
9467 }
9468
9469 async fn build_inner(
9470 conf: gaxi::options::ClientConfig,
9471 ) -> gax::client_builder::Result<
9472 std::sync::Arc<dyn super::stub::dynamic::PublicAdvertisedPrefixes>,
9473 > {
9474 if gaxi::options::tracing_enabled(&conf) {
9475 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9476 }
9477 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9478 }
9479
9480 async fn build_transport(
9481 conf: gaxi::options::ClientConfig,
9482 ) -> gax::client_builder::Result<impl super::stub::PublicAdvertisedPrefixes> {
9483 super::transport::PublicAdvertisedPrefixes::new(conf).await
9484 }
9485
9486 async fn build_with_tracing(
9487 conf: gaxi::options::ClientConfig,
9488 ) -> gax::client_builder::Result<impl super::stub::PublicAdvertisedPrefixes> {
9489 Self::build_transport(conf)
9490 .await
9491 .map(super::tracing::PublicAdvertisedPrefixes::new)
9492 }
9493
9494 /// Announces the specified PublicAdvertisedPrefix
9495 pub fn announce(&self) -> super::builder::public_advertised_prefixes::Announce {
9496 super::builder::public_advertised_prefixes::Announce::new(self.inner.clone())
9497 }
9498
9499 /// Deletes the specified PublicAdvertisedPrefix
9500 pub fn delete(&self) -> super::builder::public_advertised_prefixes::Delete {
9501 super::builder::public_advertised_prefixes::Delete::new(self.inner.clone())
9502 }
9503
9504 /// Returns the specified PublicAdvertisedPrefix resource.
9505 pub fn get(&self) -> super::builder::public_advertised_prefixes::Get {
9506 super::builder::public_advertised_prefixes::Get::new(self.inner.clone())
9507 }
9508
9509 /// Creates a PublicAdvertisedPrefix in the specified project
9510 /// using the parameters that are included in the request.
9511 pub fn insert(&self) -> super::builder::public_advertised_prefixes::Insert {
9512 super::builder::public_advertised_prefixes::Insert::new(self.inner.clone())
9513 }
9514
9515 /// Lists the PublicAdvertisedPrefixes for a project.
9516 pub fn list(&self) -> super::builder::public_advertised_prefixes::List {
9517 super::builder::public_advertised_prefixes::List::new(self.inner.clone())
9518 }
9519
9520 /// Patches the specified Router resource with the data included in the
9521 /// request. This method supportsPATCH
9522 /// semantics and usesJSON merge
9523 /// patch format and processing rules.
9524 pub fn patch(&self) -> super::builder::public_advertised_prefixes::Patch {
9525 super::builder::public_advertised_prefixes::Patch::new(self.inner.clone())
9526 }
9527
9528 /// Withdraws the specified PublicAdvertisedPrefix
9529 pub fn withdraw(&self) -> super::builder::public_advertised_prefixes::Withdraw {
9530 super::builder::public_advertised_prefixes::Withdraw::new(self.inner.clone())
9531 }
9532
9533 /// Retrieves the specified Operations resource.
9534 pub fn get_operation(&self) -> super::builder::public_advertised_prefixes::GetOperation {
9535 super::builder::public_advertised_prefixes::GetOperation::new(self.inner.clone())
9536 }
9537}
9538
9539/// Implements a client for the Google Compute Engine API.
9540///
9541/// # Example
9542/// ```
9543/// # tokio_test::block_on(async {
9544/// # use google_cloud_compute_v1::client::PublicDelegatedPrefixes;
9545/// let client = PublicDelegatedPrefixes::builder().build().await?;
9546/// // use `client` to make requests to the Google Compute Engine API.
9547/// # gax::client_builder::Result::<()>::Ok(()) });
9548/// ```
9549///
9550/// # Service Description
9551///
9552/// Service for the `publicDelegatedPrefixes` resource.
9553///
9554/// # Configuration
9555///
9556/// To configure `PublicDelegatedPrefixes` use the `with_*` methods in the type returned
9557/// by [builder()][PublicDelegatedPrefixes::builder]. The default configuration should
9558/// work for most applications. Common configuration changes include
9559///
9560/// * [with_endpoint()]: by default this client uses the global default endpoint
9561/// (`https://compute.googleapis.com`). Applications using regional
9562/// endpoints or running in restricted networks (e.g. a network configured
9563// with [Private Google Access with VPC Service Controls]) may want to
9564/// override this default.
9565/// * [with_credentials()]: by default this client uses
9566/// [Application Default Credentials]. Applications using custom
9567/// authentication may need to override this default.
9568///
9569/// [with_endpoint()]: super::builder::public_delegated_prefixes::ClientBuilder::with_endpoint
9570/// [with_credentials()]: super::builder::public_delegated_prefixes::ClientBuilder::credentials
9571/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9572/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9573///
9574/// # Pooling and Cloning
9575///
9576/// `PublicDelegatedPrefixes` holds a connection pool internally, it is advised to
9577/// create one and the reuse it. You do not need to wrap `PublicDelegatedPrefixes` in
9578/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9579/// already uses an `Arc` internally.
9580#[cfg(feature = "public-delegated-prefixes")]
9581#[cfg_attr(docsrs, doc(cfg(feature = "public-delegated-prefixes")))]
9582#[derive(Clone, Debug)]
9583pub struct PublicDelegatedPrefixes {
9584 inner: std::sync::Arc<dyn super::stub::dynamic::PublicDelegatedPrefixes>,
9585}
9586
9587#[cfg(feature = "public-delegated-prefixes")]
9588impl PublicDelegatedPrefixes {
9589 /// Returns a builder for [PublicDelegatedPrefixes].
9590 ///
9591 /// ```
9592 /// # tokio_test::block_on(async {
9593 /// # use google_cloud_compute_v1::client::PublicDelegatedPrefixes;
9594 /// let client = PublicDelegatedPrefixes::builder().build().await?;
9595 /// # gax::client_builder::Result::<()>::Ok(()) });
9596 /// ```
9597 pub fn builder() -> super::builder::public_delegated_prefixes::ClientBuilder {
9598 gax::client_builder::internal::new_builder(
9599 super::builder::public_delegated_prefixes::client::Factory,
9600 )
9601 }
9602
9603 /// Creates a new client from the provided stub.
9604 ///
9605 /// The most common case for calling this function is in tests mocking the
9606 /// client's behavior.
9607 pub fn from_stub<T>(stub: T) -> Self
9608 where
9609 T: super::stub::PublicDelegatedPrefixes + 'static,
9610 {
9611 Self {
9612 inner: std::sync::Arc::new(stub),
9613 }
9614 }
9615
9616 pub(crate) async fn new(
9617 config: gaxi::options::ClientConfig,
9618 ) -> gax::client_builder::Result<Self> {
9619 let inner = Self::build_inner(config).await?;
9620 Ok(Self { inner })
9621 }
9622
9623 async fn build_inner(
9624 conf: gaxi::options::ClientConfig,
9625 ) -> gax::client_builder::Result<
9626 std::sync::Arc<dyn super::stub::dynamic::PublicDelegatedPrefixes>,
9627 > {
9628 if gaxi::options::tracing_enabled(&conf) {
9629 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9630 }
9631 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9632 }
9633
9634 async fn build_transport(
9635 conf: gaxi::options::ClientConfig,
9636 ) -> gax::client_builder::Result<impl super::stub::PublicDelegatedPrefixes> {
9637 super::transport::PublicDelegatedPrefixes::new(conf).await
9638 }
9639
9640 async fn build_with_tracing(
9641 conf: gaxi::options::ClientConfig,
9642 ) -> gax::client_builder::Result<impl super::stub::PublicDelegatedPrefixes> {
9643 Self::build_transport(conf)
9644 .await
9645 .map(super::tracing::PublicDelegatedPrefixes::new)
9646 }
9647
9648 /// Lists all PublicDelegatedPrefix resources owned by the specific project
9649 /// across all scopes.
9650 ///
9651 /// To prevent failure, Google recommends that you set the
9652 /// `returnPartialSuccess` parameter to `true`.
9653 pub fn aggregated_list(&self) -> super::builder::public_delegated_prefixes::AggregatedList {
9654 super::builder::public_delegated_prefixes::AggregatedList::new(self.inner.clone())
9655 }
9656
9657 /// Announces the specified PublicDelegatedPrefix in the given region.
9658 pub fn announce(&self) -> super::builder::public_delegated_prefixes::Announce {
9659 super::builder::public_delegated_prefixes::Announce::new(self.inner.clone())
9660 }
9661
9662 /// Deletes the specified PublicDelegatedPrefix in the given region.
9663 pub fn delete(&self) -> super::builder::public_delegated_prefixes::Delete {
9664 super::builder::public_delegated_prefixes::Delete::new(self.inner.clone())
9665 }
9666
9667 /// Returns the specified PublicDelegatedPrefix resource in the given region.
9668 pub fn get(&self) -> super::builder::public_delegated_prefixes::Get {
9669 super::builder::public_delegated_prefixes::Get::new(self.inner.clone())
9670 }
9671
9672 /// Creates a PublicDelegatedPrefix in the specified project in the given
9673 /// region using the parameters that are included in the request.
9674 pub fn insert(&self) -> super::builder::public_delegated_prefixes::Insert {
9675 super::builder::public_delegated_prefixes::Insert::new(self.inner.clone())
9676 }
9677
9678 /// Lists the PublicDelegatedPrefixes for a project in the given region.
9679 pub fn list(&self) -> super::builder::public_delegated_prefixes::List {
9680 super::builder::public_delegated_prefixes::List::new(self.inner.clone())
9681 }
9682
9683 /// Patches the specified PublicDelegatedPrefix resource with the data included
9684 /// in the request. This method supportsPATCH
9685 /// semantics and usesJSON merge
9686 /// patch format and processing rules.
9687 pub fn patch(&self) -> super::builder::public_delegated_prefixes::Patch {
9688 super::builder::public_delegated_prefixes::Patch::new(self.inner.clone())
9689 }
9690
9691 /// Withdraws the specified PublicDelegatedPrefix in the given region.
9692 pub fn withdraw(&self) -> super::builder::public_delegated_prefixes::Withdraw {
9693 super::builder::public_delegated_prefixes::Withdraw::new(self.inner.clone())
9694 }
9695
9696 /// Retrieves the specified region-specific Operations resource.
9697 pub fn get_operation(&self) -> super::builder::public_delegated_prefixes::GetOperation {
9698 super::builder::public_delegated_prefixes::GetOperation::new(self.inner.clone())
9699 }
9700}
9701
9702/// Implements a client for the Google Compute Engine API.
9703///
9704/// # Example
9705/// ```
9706/// # tokio_test::block_on(async {
9707/// # use google_cloud_compute_v1::client::RegionAutoscalers;
9708/// let client = RegionAutoscalers::builder().build().await?;
9709/// // use `client` to make requests to the Google Compute Engine API.
9710/// # gax::client_builder::Result::<()>::Ok(()) });
9711/// ```
9712///
9713/// # Service Description
9714///
9715/// Service for the `regionAutoscalers` resource.
9716///
9717/// # Configuration
9718///
9719/// To configure `RegionAutoscalers` use the `with_*` methods in the type returned
9720/// by [builder()][RegionAutoscalers::builder]. The default configuration should
9721/// work for most applications. Common configuration changes include
9722///
9723/// * [with_endpoint()]: by default this client uses the global default endpoint
9724/// (`https://compute.googleapis.com`). Applications using regional
9725/// endpoints or running in restricted networks (e.g. a network configured
9726// with [Private Google Access with VPC Service Controls]) may want to
9727/// override this default.
9728/// * [with_credentials()]: by default this client uses
9729/// [Application Default Credentials]. Applications using custom
9730/// authentication may need to override this default.
9731///
9732/// [with_endpoint()]: super::builder::region_autoscalers::ClientBuilder::with_endpoint
9733/// [with_credentials()]: super::builder::region_autoscalers::ClientBuilder::credentials
9734/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9735/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9736///
9737/// # Pooling and Cloning
9738///
9739/// `RegionAutoscalers` holds a connection pool internally, it is advised to
9740/// create one and the reuse it. You do not need to wrap `RegionAutoscalers` in
9741/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9742/// already uses an `Arc` internally.
9743#[cfg(feature = "region-autoscalers")]
9744#[cfg_attr(docsrs, doc(cfg(feature = "region-autoscalers")))]
9745#[derive(Clone, Debug)]
9746pub struct RegionAutoscalers {
9747 inner: std::sync::Arc<dyn super::stub::dynamic::RegionAutoscalers>,
9748}
9749
9750#[cfg(feature = "region-autoscalers")]
9751impl RegionAutoscalers {
9752 /// Returns a builder for [RegionAutoscalers].
9753 ///
9754 /// ```
9755 /// # tokio_test::block_on(async {
9756 /// # use google_cloud_compute_v1::client::RegionAutoscalers;
9757 /// let client = RegionAutoscalers::builder().build().await?;
9758 /// # gax::client_builder::Result::<()>::Ok(()) });
9759 /// ```
9760 pub fn builder() -> super::builder::region_autoscalers::ClientBuilder {
9761 gax::client_builder::internal::new_builder(
9762 super::builder::region_autoscalers::client::Factory,
9763 )
9764 }
9765
9766 /// Creates a new client from the provided stub.
9767 ///
9768 /// The most common case for calling this function is in tests mocking the
9769 /// client's behavior.
9770 pub fn from_stub<T>(stub: T) -> Self
9771 where
9772 T: super::stub::RegionAutoscalers + 'static,
9773 {
9774 Self {
9775 inner: std::sync::Arc::new(stub),
9776 }
9777 }
9778
9779 pub(crate) async fn new(
9780 config: gaxi::options::ClientConfig,
9781 ) -> gax::client_builder::Result<Self> {
9782 let inner = Self::build_inner(config).await?;
9783 Ok(Self { inner })
9784 }
9785
9786 async fn build_inner(
9787 conf: gaxi::options::ClientConfig,
9788 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionAutoscalers>>
9789 {
9790 if gaxi::options::tracing_enabled(&conf) {
9791 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9792 }
9793 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9794 }
9795
9796 async fn build_transport(
9797 conf: gaxi::options::ClientConfig,
9798 ) -> gax::client_builder::Result<impl super::stub::RegionAutoscalers> {
9799 super::transport::RegionAutoscalers::new(conf).await
9800 }
9801
9802 async fn build_with_tracing(
9803 conf: gaxi::options::ClientConfig,
9804 ) -> gax::client_builder::Result<impl super::stub::RegionAutoscalers> {
9805 Self::build_transport(conf)
9806 .await
9807 .map(super::tracing::RegionAutoscalers::new)
9808 }
9809
9810 /// Deletes the specified autoscaler.
9811 pub fn delete(&self) -> super::builder::region_autoscalers::Delete {
9812 super::builder::region_autoscalers::Delete::new(self.inner.clone())
9813 }
9814
9815 /// Returns the specified autoscaler.
9816 pub fn get(&self) -> super::builder::region_autoscalers::Get {
9817 super::builder::region_autoscalers::Get::new(self.inner.clone())
9818 }
9819
9820 /// Creates an autoscaler in the specified project using
9821 /// the data included in the request.
9822 pub fn insert(&self) -> super::builder::region_autoscalers::Insert {
9823 super::builder::region_autoscalers::Insert::new(self.inner.clone())
9824 }
9825
9826 /// Retrieves a list of autoscalers contained within
9827 /// the specified region.
9828 pub fn list(&self) -> super::builder::region_autoscalers::List {
9829 super::builder::region_autoscalers::List::new(self.inner.clone())
9830 }
9831
9832 /// Updates an autoscaler in the specified project using
9833 /// the data included in the request. This method supportsPATCH
9834 /// semantics and uses theJSON merge
9835 /// patch format and processing rules.
9836 pub fn patch(&self) -> super::builder::region_autoscalers::Patch {
9837 super::builder::region_autoscalers::Patch::new(self.inner.clone())
9838 }
9839
9840 /// Updates an autoscaler in the specified project using
9841 /// the data included in the request.
9842 pub fn update(&self) -> super::builder::region_autoscalers::Update {
9843 super::builder::region_autoscalers::Update::new(self.inner.clone())
9844 }
9845
9846 /// Retrieves the specified region-specific Operations resource.
9847 pub fn get_operation(&self) -> super::builder::region_autoscalers::GetOperation {
9848 super::builder::region_autoscalers::GetOperation::new(self.inner.clone())
9849 }
9850}
9851
9852/// Implements a client for the Google Compute Engine API.
9853///
9854/// # Example
9855/// ```
9856/// # tokio_test::block_on(async {
9857/// # use google_cloud_compute_v1::client::RegionBackendServices;
9858/// let client = RegionBackendServices::builder().build().await?;
9859/// // use `client` to make requests to the Google Compute Engine API.
9860/// # gax::client_builder::Result::<()>::Ok(()) });
9861/// ```
9862///
9863/// # Service Description
9864///
9865/// Service for the `regionBackendServices` resource.
9866///
9867/// # Configuration
9868///
9869/// To configure `RegionBackendServices` use the `with_*` methods in the type returned
9870/// by [builder()][RegionBackendServices::builder]. The default configuration should
9871/// work for most applications. Common configuration changes include
9872///
9873/// * [with_endpoint()]: by default this client uses the global default endpoint
9874/// (`https://compute.googleapis.com`). Applications using regional
9875/// endpoints or running in restricted networks (e.g. a network configured
9876// with [Private Google Access with VPC Service Controls]) may want to
9877/// override this default.
9878/// * [with_credentials()]: by default this client uses
9879/// [Application Default Credentials]. Applications using custom
9880/// authentication may need to override this default.
9881///
9882/// [with_endpoint()]: super::builder::region_backend_services::ClientBuilder::with_endpoint
9883/// [with_credentials()]: super::builder::region_backend_services::ClientBuilder::credentials
9884/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9885/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9886///
9887/// # Pooling and Cloning
9888///
9889/// `RegionBackendServices` holds a connection pool internally, it is advised to
9890/// create one and the reuse it. You do not need to wrap `RegionBackendServices` in
9891/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9892/// already uses an `Arc` internally.
9893#[cfg(feature = "region-backend-services")]
9894#[cfg_attr(docsrs, doc(cfg(feature = "region-backend-services")))]
9895#[derive(Clone, Debug)]
9896pub struct RegionBackendServices {
9897 inner: std::sync::Arc<dyn super::stub::dynamic::RegionBackendServices>,
9898}
9899
9900#[cfg(feature = "region-backend-services")]
9901impl RegionBackendServices {
9902 /// Returns a builder for [RegionBackendServices].
9903 ///
9904 /// ```
9905 /// # tokio_test::block_on(async {
9906 /// # use google_cloud_compute_v1::client::RegionBackendServices;
9907 /// let client = RegionBackendServices::builder().build().await?;
9908 /// # gax::client_builder::Result::<()>::Ok(()) });
9909 /// ```
9910 pub fn builder() -> super::builder::region_backend_services::ClientBuilder {
9911 gax::client_builder::internal::new_builder(
9912 super::builder::region_backend_services::client::Factory,
9913 )
9914 }
9915
9916 /// Creates a new client from the provided stub.
9917 ///
9918 /// The most common case for calling this function is in tests mocking the
9919 /// client's behavior.
9920 pub fn from_stub<T>(stub: T) -> Self
9921 where
9922 T: super::stub::RegionBackendServices + 'static,
9923 {
9924 Self {
9925 inner: std::sync::Arc::new(stub),
9926 }
9927 }
9928
9929 pub(crate) async fn new(
9930 config: gaxi::options::ClientConfig,
9931 ) -> gax::client_builder::Result<Self> {
9932 let inner = Self::build_inner(config).await?;
9933 Ok(Self { inner })
9934 }
9935
9936 async fn build_inner(
9937 conf: gaxi::options::ClientConfig,
9938 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionBackendServices>>
9939 {
9940 if gaxi::options::tracing_enabled(&conf) {
9941 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9942 }
9943 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9944 }
9945
9946 async fn build_transport(
9947 conf: gaxi::options::ClientConfig,
9948 ) -> gax::client_builder::Result<impl super::stub::RegionBackendServices> {
9949 super::transport::RegionBackendServices::new(conf).await
9950 }
9951
9952 async fn build_with_tracing(
9953 conf: gaxi::options::ClientConfig,
9954 ) -> gax::client_builder::Result<impl super::stub::RegionBackendServices> {
9955 Self::build_transport(conf)
9956 .await
9957 .map(super::tracing::RegionBackendServices::new)
9958 }
9959
9960 /// Deletes the specified regional BackendService resource.
9961 pub fn delete(&self) -> super::builder::region_backend_services::Delete {
9962 super::builder::region_backend_services::Delete::new(self.inner.clone())
9963 }
9964
9965 /// Returns the specified regional BackendService resource.
9966 pub fn get(&self) -> super::builder::region_backend_services::Get {
9967 super::builder::region_backend_services::Get::new(self.inner.clone())
9968 }
9969
9970 /// Gets the most recent health check results for this
9971 /// regional BackendService.
9972 pub fn get_health(&self) -> super::builder::region_backend_services::GetHealth {
9973 super::builder::region_backend_services::GetHealth::new(self.inner.clone())
9974 }
9975
9976 /// Gets the access control policy for a resource. May be empty if no such
9977 /// policy or resource exists.
9978 pub fn get_iam_policy(&self) -> super::builder::region_backend_services::GetIamPolicy {
9979 super::builder::region_backend_services::GetIamPolicy::new(self.inner.clone())
9980 }
9981
9982 /// Creates a regional BackendService resource in the specified project using
9983 /// the data included in the request. For more information, see
9984 /// Backend services overview.
9985 pub fn insert(&self) -> super::builder::region_backend_services::Insert {
9986 super::builder::region_backend_services::Insert::new(self.inner.clone())
9987 }
9988
9989 /// Retrieves the list of regional BackendService resources available to the
9990 /// specified project in the given region.
9991 pub fn list(&self) -> super::builder::region_backend_services::List {
9992 super::builder::region_backend_services::List::new(self.inner.clone())
9993 }
9994
9995 /// Retrieves a list of all usable backend services in the specified project in
9996 /// the given region.
9997 pub fn list_usable(&self) -> super::builder::region_backend_services::ListUsable {
9998 super::builder::region_backend_services::ListUsable::new(self.inner.clone())
9999 }
10000
10001 /// Updates the specified regional BackendService resource with the data
10002 /// included in the request. For more information, see
10003 /// Understanding backend services This method
10004 /// supports PATCH semantics and uses the JSON merge
10005 /// patch format and processing rules.
10006 pub fn patch(&self) -> super::builder::region_backend_services::Patch {
10007 super::builder::region_backend_services::Patch::new(self.inner.clone())
10008 }
10009
10010 /// Sets the access control policy on the specified resource.
10011 /// Replaces any existing policy.
10012 pub fn set_iam_policy(&self) -> super::builder::region_backend_services::SetIamPolicy {
10013 super::builder::region_backend_services::SetIamPolicy::new(self.inner.clone())
10014 }
10015
10016 /// Sets the Google Cloud Armor security policy for the specified backend
10017 /// service. For more information, seeGoogle
10018 /// Cloud Armor Overview
10019 pub fn set_security_policy(
10020 &self,
10021 ) -> super::builder::region_backend_services::SetSecurityPolicy {
10022 super::builder::region_backend_services::SetSecurityPolicy::new(self.inner.clone())
10023 }
10024
10025 /// Returns permissions that a caller has on the specified resource.
10026 pub fn test_iam_permissions(
10027 &self,
10028 ) -> super::builder::region_backend_services::TestIamPermissions {
10029 super::builder::region_backend_services::TestIamPermissions::new(self.inner.clone())
10030 }
10031
10032 /// Updates the specified regional BackendService resource with the data
10033 /// included in the request. For more information,
10034 /// see
10035 /// Backend services overview.
10036 pub fn update(&self) -> super::builder::region_backend_services::Update {
10037 super::builder::region_backend_services::Update::new(self.inner.clone())
10038 }
10039
10040 /// Retrieves the specified region-specific Operations resource.
10041 pub fn get_operation(&self) -> super::builder::region_backend_services::GetOperation {
10042 super::builder::region_backend_services::GetOperation::new(self.inner.clone())
10043 }
10044}
10045
10046/// Implements a client for the Google Compute Engine API.
10047///
10048/// # Example
10049/// ```
10050/// # tokio_test::block_on(async {
10051/// # use google_cloud_compute_v1::client::RegionCommitments;
10052/// let client = RegionCommitments::builder().build().await?;
10053/// // use `client` to make requests to the Google Compute Engine API.
10054/// # gax::client_builder::Result::<()>::Ok(()) });
10055/// ```
10056///
10057/// # Service Description
10058///
10059/// Service for the `regionCommitments` resource.
10060///
10061/// # Configuration
10062///
10063/// To configure `RegionCommitments` use the `with_*` methods in the type returned
10064/// by [builder()][RegionCommitments::builder]. The default configuration should
10065/// work for most applications. Common configuration changes include
10066///
10067/// * [with_endpoint()]: by default this client uses the global default endpoint
10068/// (`https://compute.googleapis.com`). Applications using regional
10069/// endpoints or running in restricted networks (e.g. a network configured
10070// with [Private Google Access with VPC Service Controls]) may want to
10071/// override this default.
10072/// * [with_credentials()]: by default this client uses
10073/// [Application Default Credentials]. Applications using custom
10074/// authentication may need to override this default.
10075///
10076/// [with_endpoint()]: super::builder::region_commitments::ClientBuilder::with_endpoint
10077/// [with_credentials()]: super::builder::region_commitments::ClientBuilder::credentials
10078/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10079/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10080///
10081/// # Pooling and Cloning
10082///
10083/// `RegionCommitments` holds a connection pool internally, it is advised to
10084/// create one and the reuse it. You do not need to wrap `RegionCommitments` in
10085/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10086/// already uses an `Arc` internally.
10087#[cfg(feature = "region-commitments")]
10088#[cfg_attr(docsrs, doc(cfg(feature = "region-commitments")))]
10089#[derive(Clone, Debug)]
10090pub struct RegionCommitments {
10091 inner: std::sync::Arc<dyn super::stub::dynamic::RegionCommitments>,
10092}
10093
10094#[cfg(feature = "region-commitments")]
10095impl RegionCommitments {
10096 /// Returns a builder for [RegionCommitments].
10097 ///
10098 /// ```
10099 /// # tokio_test::block_on(async {
10100 /// # use google_cloud_compute_v1::client::RegionCommitments;
10101 /// let client = RegionCommitments::builder().build().await?;
10102 /// # gax::client_builder::Result::<()>::Ok(()) });
10103 /// ```
10104 pub fn builder() -> super::builder::region_commitments::ClientBuilder {
10105 gax::client_builder::internal::new_builder(
10106 super::builder::region_commitments::client::Factory,
10107 )
10108 }
10109
10110 /// Creates a new client from the provided stub.
10111 ///
10112 /// The most common case for calling this function is in tests mocking the
10113 /// client's behavior.
10114 pub fn from_stub<T>(stub: T) -> Self
10115 where
10116 T: super::stub::RegionCommitments + 'static,
10117 {
10118 Self {
10119 inner: std::sync::Arc::new(stub),
10120 }
10121 }
10122
10123 pub(crate) async fn new(
10124 config: gaxi::options::ClientConfig,
10125 ) -> gax::client_builder::Result<Self> {
10126 let inner = Self::build_inner(config).await?;
10127 Ok(Self { inner })
10128 }
10129
10130 async fn build_inner(
10131 conf: gaxi::options::ClientConfig,
10132 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionCommitments>>
10133 {
10134 if gaxi::options::tracing_enabled(&conf) {
10135 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10136 }
10137 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10138 }
10139
10140 async fn build_transport(
10141 conf: gaxi::options::ClientConfig,
10142 ) -> gax::client_builder::Result<impl super::stub::RegionCommitments> {
10143 super::transport::RegionCommitments::new(conf).await
10144 }
10145
10146 async fn build_with_tracing(
10147 conf: gaxi::options::ClientConfig,
10148 ) -> gax::client_builder::Result<impl super::stub::RegionCommitments> {
10149 Self::build_transport(conf)
10150 .await
10151 .map(super::tracing::RegionCommitments::new)
10152 }
10153
10154 /// Retrieves an aggregated list of commitments by region.
10155 ///
10156 /// To prevent failure, it is recommended that you set the
10157 /// `returnPartialSuccess` parameter to `true`.
10158 pub fn aggregated_list(&self) -> super::builder::region_commitments::AggregatedList {
10159 super::builder::region_commitments::AggregatedList::new(self.inner.clone())
10160 }
10161
10162 /// Returns the specified commitment resource.
10163 pub fn get(&self) -> super::builder::region_commitments::Get {
10164 super::builder::region_commitments::Get::new(self.inner.clone())
10165 }
10166
10167 /// Creates a commitment in the specified project using the data
10168 /// included in the request.
10169 pub fn insert(&self) -> super::builder::region_commitments::Insert {
10170 super::builder::region_commitments::Insert::new(self.inner.clone())
10171 }
10172
10173 /// Retrieves a list of commitments contained within
10174 /// the specified region.
10175 pub fn list(&self) -> super::builder::region_commitments::List {
10176 super::builder::region_commitments::List::new(self.inner.clone())
10177 }
10178
10179 /// Updates the specified commitment with the data included in the request.
10180 /// Update is performed only on selected fields included as part of
10181 /// update-mask. Only the following fields can be updated: auto_renew and plan.
10182 pub fn update(&self) -> super::builder::region_commitments::Update {
10183 super::builder::region_commitments::Update::new(self.inner.clone())
10184 }
10185
10186 /// Retrieves the specified region-specific Operations resource.
10187 pub fn get_operation(&self) -> super::builder::region_commitments::GetOperation {
10188 super::builder::region_commitments::GetOperation::new(self.inner.clone())
10189 }
10190}
10191
10192/// Implements a client for the Google Compute Engine API.
10193///
10194/// # Example
10195/// ```
10196/// # tokio_test::block_on(async {
10197/// # use google_cloud_compute_v1::client::RegionDiskTypes;
10198/// let client = RegionDiskTypes::builder().build().await?;
10199/// // use `client` to make requests to the Google Compute Engine API.
10200/// # gax::client_builder::Result::<()>::Ok(()) });
10201/// ```
10202///
10203/// # Service Description
10204///
10205/// Service for the `regionDiskTypes` resource.
10206///
10207/// # Configuration
10208///
10209/// To configure `RegionDiskTypes` use the `with_*` methods in the type returned
10210/// by [builder()][RegionDiskTypes::builder]. The default configuration should
10211/// work for most applications. Common configuration changes include
10212///
10213/// * [with_endpoint()]: by default this client uses the global default endpoint
10214/// (`https://compute.googleapis.com`). Applications using regional
10215/// endpoints or running in restricted networks (e.g. a network configured
10216// with [Private Google Access with VPC Service Controls]) may want to
10217/// override this default.
10218/// * [with_credentials()]: by default this client uses
10219/// [Application Default Credentials]. Applications using custom
10220/// authentication may need to override this default.
10221///
10222/// [with_endpoint()]: super::builder::region_disk_types::ClientBuilder::with_endpoint
10223/// [with_credentials()]: super::builder::region_disk_types::ClientBuilder::credentials
10224/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10225/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10226///
10227/// # Pooling and Cloning
10228///
10229/// `RegionDiskTypes` holds a connection pool internally, it is advised to
10230/// create one and the reuse it. You do not need to wrap `RegionDiskTypes` in
10231/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10232/// already uses an `Arc` internally.
10233#[cfg(feature = "region-disk-types")]
10234#[cfg_attr(docsrs, doc(cfg(feature = "region-disk-types")))]
10235#[derive(Clone, Debug)]
10236pub struct RegionDiskTypes {
10237 inner: std::sync::Arc<dyn super::stub::dynamic::RegionDiskTypes>,
10238}
10239
10240#[cfg(feature = "region-disk-types")]
10241impl RegionDiskTypes {
10242 /// Returns a builder for [RegionDiskTypes].
10243 ///
10244 /// ```
10245 /// # tokio_test::block_on(async {
10246 /// # use google_cloud_compute_v1::client::RegionDiskTypes;
10247 /// let client = RegionDiskTypes::builder().build().await?;
10248 /// # gax::client_builder::Result::<()>::Ok(()) });
10249 /// ```
10250 pub fn builder() -> super::builder::region_disk_types::ClientBuilder {
10251 gax::client_builder::internal::new_builder(
10252 super::builder::region_disk_types::client::Factory,
10253 )
10254 }
10255
10256 /// Creates a new client from the provided stub.
10257 ///
10258 /// The most common case for calling this function is in tests mocking the
10259 /// client's behavior.
10260 pub fn from_stub<T>(stub: T) -> Self
10261 where
10262 T: super::stub::RegionDiskTypes + 'static,
10263 {
10264 Self {
10265 inner: std::sync::Arc::new(stub),
10266 }
10267 }
10268
10269 pub(crate) async fn new(
10270 config: gaxi::options::ClientConfig,
10271 ) -> gax::client_builder::Result<Self> {
10272 let inner = Self::build_inner(config).await?;
10273 Ok(Self { inner })
10274 }
10275
10276 async fn build_inner(
10277 conf: gaxi::options::ClientConfig,
10278 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionDiskTypes>>
10279 {
10280 if gaxi::options::tracing_enabled(&conf) {
10281 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10282 }
10283 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10284 }
10285
10286 async fn build_transport(
10287 conf: gaxi::options::ClientConfig,
10288 ) -> gax::client_builder::Result<impl super::stub::RegionDiskTypes> {
10289 super::transport::RegionDiskTypes::new(conf).await
10290 }
10291
10292 async fn build_with_tracing(
10293 conf: gaxi::options::ClientConfig,
10294 ) -> gax::client_builder::Result<impl super::stub::RegionDiskTypes> {
10295 Self::build_transport(conf)
10296 .await
10297 .map(super::tracing::RegionDiskTypes::new)
10298 }
10299
10300 /// Returns the specified regional disk type.
10301 pub fn get(&self) -> super::builder::region_disk_types::Get {
10302 super::builder::region_disk_types::Get::new(self.inner.clone())
10303 }
10304
10305 /// Retrieves a list of regional disk types available to the specified project.
10306 pub fn list(&self) -> super::builder::region_disk_types::List {
10307 super::builder::region_disk_types::List::new(self.inner.clone())
10308 }
10309}
10310
10311/// Implements a client for the Google Compute Engine API.
10312///
10313/// # Example
10314/// ```
10315/// # tokio_test::block_on(async {
10316/// # use google_cloud_compute_v1::client::RegionDisks;
10317/// let client = RegionDisks::builder().build().await?;
10318/// // use `client` to make requests to the Google Compute Engine API.
10319/// # gax::client_builder::Result::<()>::Ok(()) });
10320/// ```
10321///
10322/// # Service Description
10323///
10324/// Service for the `regionDisks` resource.
10325///
10326/// # Configuration
10327///
10328/// To configure `RegionDisks` use the `with_*` methods in the type returned
10329/// by [builder()][RegionDisks::builder]. The default configuration should
10330/// work for most applications. Common configuration changes include
10331///
10332/// * [with_endpoint()]: by default this client uses the global default endpoint
10333/// (`https://compute.googleapis.com`). Applications using regional
10334/// endpoints or running in restricted networks (e.g. a network configured
10335// with [Private Google Access with VPC Service Controls]) may want to
10336/// override this default.
10337/// * [with_credentials()]: by default this client uses
10338/// [Application Default Credentials]. Applications using custom
10339/// authentication may need to override this default.
10340///
10341/// [with_endpoint()]: super::builder::region_disks::ClientBuilder::with_endpoint
10342/// [with_credentials()]: super::builder::region_disks::ClientBuilder::credentials
10343/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10344/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10345///
10346/// # Pooling and Cloning
10347///
10348/// `RegionDisks` holds a connection pool internally, it is advised to
10349/// create one and the reuse it. You do not need to wrap `RegionDisks` in
10350/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10351/// already uses an `Arc` internally.
10352#[cfg(feature = "region-disks")]
10353#[cfg_attr(docsrs, doc(cfg(feature = "region-disks")))]
10354#[derive(Clone, Debug)]
10355pub struct RegionDisks {
10356 inner: std::sync::Arc<dyn super::stub::dynamic::RegionDisks>,
10357}
10358
10359#[cfg(feature = "region-disks")]
10360impl RegionDisks {
10361 /// Returns a builder for [RegionDisks].
10362 ///
10363 /// ```
10364 /// # tokio_test::block_on(async {
10365 /// # use google_cloud_compute_v1::client::RegionDisks;
10366 /// let client = RegionDisks::builder().build().await?;
10367 /// # gax::client_builder::Result::<()>::Ok(()) });
10368 /// ```
10369 pub fn builder() -> super::builder::region_disks::ClientBuilder {
10370 gax::client_builder::internal::new_builder(super::builder::region_disks::client::Factory)
10371 }
10372
10373 /// Creates a new client from the provided stub.
10374 ///
10375 /// The most common case for calling this function is in tests mocking the
10376 /// client's behavior.
10377 pub fn from_stub<T>(stub: T) -> Self
10378 where
10379 T: super::stub::RegionDisks + 'static,
10380 {
10381 Self {
10382 inner: std::sync::Arc::new(stub),
10383 }
10384 }
10385
10386 pub(crate) async fn new(
10387 config: gaxi::options::ClientConfig,
10388 ) -> gax::client_builder::Result<Self> {
10389 let inner = Self::build_inner(config).await?;
10390 Ok(Self { inner })
10391 }
10392
10393 async fn build_inner(
10394 conf: gaxi::options::ClientConfig,
10395 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionDisks>> {
10396 if gaxi::options::tracing_enabled(&conf) {
10397 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10398 }
10399 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10400 }
10401
10402 async fn build_transport(
10403 conf: gaxi::options::ClientConfig,
10404 ) -> gax::client_builder::Result<impl super::stub::RegionDisks> {
10405 super::transport::RegionDisks::new(conf).await
10406 }
10407
10408 async fn build_with_tracing(
10409 conf: gaxi::options::ClientConfig,
10410 ) -> gax::client_builder::Result<impl super::stub::RegionDisks> {
10411 Self::build_transport(conf)
10412 .await
10413 .map(super::tracing::RegionDisks::new)
10414 }
10415
10416 /// Adds existing resource policies to a regional disk. You can only add one
10417 /// policy which will be applied to this disk for scheduling snapshot
10418 /// creation.
10419 pub fn add_resource_policies(&self) -> super::builder::region_disks::AddResourcePolicies {
10420 super::builder::region_disks::AddResourcePolicies::new(self.inner.clone())
10421 }
10422
10423 /// Bulk create a set of disks.
10424 pub fn bulk_insert(&self) -> super::builder::region_disks::BulkInsert {
10425 super::builder::region_disks::BulkInsert::new(self.inner.clone())
10426 }
10427
10428 /// Creates a snapshot of a specified persistent disk. For regular snapshot
10429 /// creation, consider using snapshots.insert
10430 /// instead, as that method supports more features, such as creating snapshots
10431 /// in a project different from the source disk project.
10432 pub fn create_snapshot(&self) -> super::builder::region_disks::CreateSnapshot {
10433 super::builder::region_disks::CreateSnapshot::new(self.inner.clone())
10434 }
10435
10436 /// Deletes the specified regional persistent disk. Deleting a regional disk
10437 /// removes all the replicas of its data permanently and is irreversible.
10438 /// However, deleting a disk does not delete anysnapshots
10439 /// previously made from the disk. You must separatelydelete
10440 /// snapshots.
10441 pub fn delete(&self) -> super::builder::region_disks::Delete {
10442 super::builder::region_disks::Delete::new(self.inner.clone())
10443 }
10444
10445 /// Returns a specified regional persistent disk.
10446 pub fn get(&self) -> super::builder::region_disks::Get {
10447 super::builder::region_disks::Get::new(self.inner.clone())
10448 }
10449
10450 /// Gets the access control policy for a resource. May be empty if no such
10451 /// policy or resource exists.
10452 pub fn get_iam_policy(&self) -> super::builder::region_disks::GetIamPolicy {
10453 super::builder::region_disks::GetIamPolicy::new(self.inner.clone())
10454 }
10455
10456 /// Creates a persistent regional disk in the specified project using the data
10457 /// included in the request.
10458 pub fn insert(&self) -> super::builder::region_disks::Insert {
10459 super::builder::region_disks::Insert::new(self.inner.clone())
10460 }
10461
10462 /// Retrieves the list of persistent disks contained within
10463 /// the specified region.
10464 pub fn list(&self) -> super::builder::region_disks::List {
10465 super::builder::region_disks::List::new(self.inner.clone())
10466 }
10467
10468 /// Removes resource policies from a regional disk.
10469 pub fn remove_resource_policies(&self) -> super::builder::region_disks::RemoveResourcePolicies {
10470 super::builder::region_disks::RemoveResourcePolicies::new(self.inner.clone())
10471 }
10472
10473 /// Resizes the specified regional persistent disk.
10474 pub fn resize(&self) -> super::builder::region_disks::Resize {
10475 super::builder::region_disks::Resize::new(self.inner.clone())
10476 }
10477
10478 /// Sets the access control policy on the specified resource.
10479 /// Replaces any existing policy.
10480 pub fn set_iam_policy(&self) -> super::builder::region_disks::SetIamPolicy {
10481 super::builder::region_disks::SetIamPolicy::new(self.inner.clone())
10482 }
10483
10484 /// Sets the labels on the target regional disk.
10485 pub fn set_labels(&self) -> super::builder::region_disks::SetLabels {
10486 super::builder::region_disks::SetLabels::new(self.inner.clone())
10487 }
10488
10489 /// Starts asynchronous replication.
10490 /// Must be invoked on the primary disk.
10491 pub fn start_async_replication(&self) -> super::builder::region_disks::StartAsyncReplication {
10492 super::builder::region_disks::StartAsyncReplication::new(self.inner.clone())
10493 }
10494
10495 /// Stops asynchronous replication.
10496 /// Can be invoked either on the primary or on the secondary disk.
10497 pub fn stop_async_replication(&self) -> super::builder::region_disks::StopAsyncReplication {
10498 super::builder::region_disks::StopAsyncReplication::new(self.inner.clone())
10499 }
10500
10501 /// Stops asynchronous replication for a consistency group of disks.
10502 /// Can be invoked either in the primary or secondary scope.
10503 pub fn stop_group_async_replication(
10504 &self,
10505 ) -> super::builder::region_disks::StopGroupAsyncReplication {
10506 super::builder::region_disks::StopGroupAsyncReplication::new(self.inner.clone())
10507 }
10508
10509 /// Returns permissions that a caller has on the specified resource.
10510 pub fn test_iam_permissions(&self) -> super::builder::region_disks::TestIamPermissions {
10511 super::builder::region_disks::TestIamPermissions::new(self.inner.clone())
10512 }
10513
10514 /// Update the specified disk with the data included in the request. Update is
10515 /// performed only on selected fields included as part of update-mask. Only the
10516 /// following fields can be modified: user_license.
10517 pub fn update(&self) -> super::builder::region_disks::Update {
10518 super::builder::region_disks::Update::new(self.inner.clone())
10519 }
10520
10521 /// Retrieves the specified region-specific Operations resource.
10522 pub fn get_operation(&self) -> super::builder::region_disks::GetOperation {
10523 super::builder::region_disks::GetOperation::new(self.inner.clone())
10524 }
10525}
10526
10527/// Implements a client for the Google Compute Engine API.
10528///
10529/// # Example
10530/// ```
10531/// # tokio_test::block_on(async {
10532/// # use google_cloud_compute_v1::client::RegionHealthCheckServices;
10533/// let client = RegionHealthCheckServices::builder().build().await?;
10534/// // use `client` to make requests to the Google Compute Engine API.
10535/// # gax::client_builder::Result::<()>::Ok(()) });
10536/// ```
10537///
10538/// # Service Description
10539///
10540/// Service for the `regionHealthCheckServices` resource.
10541///
10542/// # Configuration
10543///
10544/// To configure `RegionHealthCheckServices` use the `with_*` methods in the type returned
10545/// by [builder()][RegionHealthCheckServices::builder]. The default configuration should
10546/// work for most applications. Common configuration changes include
10547///
10548/// * [with_endpoint()]: by default this client uses the global default endpoint
10549/// (`https://compute.googleapis.com`). Applications using regional
10550/// endpoints or running in restricted networks (e.g. a network configured
10551// with [Private Google Access with VPC Service Controls]) may want to
10552/// override this default.
10553/// * [with_credentials()]: by default this client uses
10554/// [Application Default Credentials]. Applications using custom
10555/// authentication may need to override this default.
10556///
10557/// [with_endpoint()]: super::builder::region_health_check_services::ClientBuilder::with_endpoint
10558/// [with_credentials()]: super::builder::region_health_check_services::ClientBuilder::credentials
10559/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10560/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10561///
10562/// # Pooling and Cloning
10563///
10564/// `RegionHealthCheckServices` holds a connection pool internally, it is advised to
10565/// create one and the reuse it. You do not need to wrap `RegionHealthCheckServices` in
10566/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10567/// already uses an `Arc` internally.
10568#[cfg(feature = "region-health-check-services")]
10569#[cfg_attr(docsrs, doc(cfg(feature = "region-health-check-services")))]
10570#[derive(Clone, Debug)]
10571pub struct RegionHealthCheckServices {
10572 inner: std::sync::Arc<dyn super::stub::dynamic::RegionHealthCheckServices>,
10573}
10574
10575#[cfg(feature = "region-health-check-services")]
10576impl RegionHealthCheckServices {
10577 /// Returns a builder for [RegionHealthCheckServices].
10578 ///
10579 /// ```
10580 /// # tokio_test::block_on(async {
10581 /// # use google_cloud_compute_v1::client::RegionHealthCheckServices;
10582 /// let client = RegionHealthCheckServices::builder().build().await?;
10583 /// # gax::client_builder::Result::<()>::Ok(()) });
10584 /// ```
10585 pub fn builder() -> super::builder::region_health_check_services::ClientBuilder {
10586 gax::client_builder::internal::new_builder(
10587 super::builder::region_health_check_services::client::Factory,
10588 )
10589 }
10590
10591 /// Creates a new client from the provided stub.
10592 ///
10593 /// The most common case for calling this function is in tests mocking the
10594 /// client's behavior.
10595 pub fn from_stub<T>(stub: T) -> Self
10596 where
10597 T: super::stub::RegionHealthCheckServices + 'static,
10598 {
10599 Self {
10600 inner: std::sync::Arc::new(stub),
10601 }
10602 }
10603
10604 pub(crate) async fn new(
10605 config: gaxi::options::ClientConfig,
10606 ) -> gax::client_builder::Result<Self> {
10607 let inner = Self::build_inner(config).await?;
10608 Ok(Self { inner })
10609 }
10610
10611 async fn build_inner(
10612 conf: gaxi::options::ClientConfig,
10613 ) -> gax::client_builder::Result<
10614 std::sync::Arc<dyn super::stub::dynamic::RegionHealthCheckServices>,
10615 > {
10616 if gaxi::options::tracing_enabled(&conf) {
10617 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10618 }
10619 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10620 }
10621
10622 async fn build_transport(
10623 conf: gaxi::options::ClientConfig,
10624 ) -> gax::client_builder::Result<impl super::stub::RegionHealthCheckServices> {
10625 super::transport::RegionHealthCheckServices::new(conf).await
10626 }
10627
10628 async fn build_with_tracing(
10629 conf: gaxi::options::ClientConfig,
10630 ) -> gax::client_builder::Result<impl super::stub::RegionHealthCheckServices> {
10631 Self::build_transport(conf)
10632 .await
10633 .map(super::tracing::RegionHealthCheckServices::new)
10634 }
10635
10636 /// Deletes the specified regional HealthCheckService.
10637 pub fn delete(&self) -> super::builder::region_health_check_services::Delete {
10638 super::builder::region_health_check_services::Delete::new(self.inner.clone())
10639 }
10640
10641 /// Returns the specified regional HealthCheckService resource.
10642 pub fn get(&self) -> super::builder::region_health_check_services::Get {
10643 super::builder::region_health_check_services::Get::new(self.inner.clone())
10644 }
10645
10646 /// Creates a regional HealthCheckService resource in the
10647 /// specified project and region using the data included in the request.
10648 pub fn insert(&self) -> super::builder::region_health_check_services::Insert {
10649 super::builder::region_health_check_services::Insert::new(self.inner.clone())
10650 }
10651
10652 /// Lists all the HealthCheckService resources that have been
10653 /// configured for the specified project in the given region.
10654 pub fn list(&self) -> super::builder::region_health_check_services::List {
10655 super::builder::region_health_check_services::List::new(self.inner.clone())
10656 }
10657
10658 /// Updates the specified regional HealthCheckService resource
10659 /// with the data included in the request. This method supportsPATCH
10660 /// semantics and uses theJSON merge
10661 /// patch format and processing rules.
10662 pub fn patch(&self) -> super::builder::region_health_check_services::Patch {
10663 super::builder::region_health_check_services::Patch::new(self.inner.clone())
10664 }
10665
10666 /// Retrieves the specified region-specific Operations resource.
10667 pub fn get_operation(&self) -> super::builder::region_health_check_services::GetOperation {
10668 super::builder::region_health_check_services::GetOperation::new(self.inner.clone())
10669 }
10670}
10671
10672/// Implements a client for the Google Compute Engine API.
10673///
10674/// # Example
10675/// ```
10676/// # tokio_test::block_on(async {
10677/// # use google_cloud_compute_v1::client::RegionHealthChecks;
10678/// let client = RegionHealthChecks::builder().build().await?;
10679/// // use `client` to make requests to the Google Compute Engine API.
10680/// # gax::client_builder::Result::<()>::Ok(()) });
10681/// ```
10682///
10683/// # Service Description
10684///
10685/// Service for the `regionHealthChecks` resource.
10686///
10687/// # Configuration
10688///
10689/// To configure `RegionHealthChecks` use the `with_*` methods in the type returned
10690/// by [builder()][RegionHealthChecks::builder]. The default configuration should
10691/// work for most applications. Common configuration changes include
10692///
10693/// * [with_endpoint()]: by default this client uses the global default endpoint
10694/// (`https://compute.googleapis.com`). Applications using regional
10695/// endpoints or running in restricted networks (e.g. a network configured
10696// with [Private Google Access with VPC Service Controls]) may want to
10697/// override this default.
10698/// * [with_credentials()]: by default this client uses
10699/// [Application Default Credentials]. Applications using custom
10700/// authentication may need to override this default.
10701///
10702/// [with_endpoint()]: super::builder::region_health_checks::ClientBuilder::with_endpoint
10703/// [with_credentials()]: super::builder::region_health_checks::ClientBuilder::credentials
10704/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10705/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10706///
10707/// # Pooling and Cloning
10708///
10709/// `RegionHealthChecks` holds a connection pool internally, it is advised to
10710/// create one and the reuse it. You do not need to wrap `RegionHealthChecks` in
10711/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10712/// already uses an `Arc` internally.
10713#[cfg(feature = "region-health-checks")]
10714#[cfg_attr(docsrs, doc(cfg(feature = "region-health-checks")))]
10715#[derive(Clone, Debug)]
10716pub struct RegionHealthChecks {
10717 inner: std::sync::Arc<dyn super::stub::dynamic::RegionHealthChecks>,
10718}
10719
10720#[cfg(feature = "region-health-checks")]
10721impl RegionHealthChecks {
10722 /// Returns a builder for [RegionHealthChecks].
10723 ///
10724 /// ```
10725 /// # tokio_test::block_on(async {
10726 /// # use google_cloud_compute_v1::client::RegionHealthChecks;
10727 /// let client = RegionHealthChecks::builder().build().await?;
10728 /// # gax::client_builder::Result::<()>::Ok(()) });
10729 /// ```
10730 pub fn builder() -> super::builder::region_health_checks::ClientBuilder {
10731 gax::client_builder::internal::new_builder(
10732 super::builder::region_health_checks::client::Factory,
10733 )
10734 }
10735
10736 /// Creates a new client from the provided stub.
10737 ///
10738 /// The most common case for calling this function is in tests mocking the
10739 /// client's behavior.
10740 pub fn from_stub<T>(stub: T) -> Self
10741 where
10742 T: super::stub::RegionHealthChecks + 'static,
10743 {
10744 Self {
10745 inner: std::sync::Arc::new(stub),
10746 }
10747 }
10748
10749 pub(crate) async fn new(
10750 config: gaxi::options::ClientConfig,
10751 ) -> gax::client_builder::Result<Self> {
10752 let inner = Self::build_inner(config).await?;
10753 Ok(Self { inner })
10754 }
10755
10756 async fn build_inner(
10757 conf: gaxi::options::ClientConfig,
10758 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionHealthChecks>>
10759 {
10760 if gaxi::options::tracing_enabled(&conf) {
10761 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10762 }
10763 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10764 }
10765
10766 async fn build_transport(
10767 conf: gaxi::options::ClientConfig,
10768 ) -> gax::client_builder::Result<impl super::stub::RegionHealthChecks> {
10769 super::transport::RegionHealthChecks::new(conf).await
10770 }
10771
10772 async fn build_with_tracing(
10773 conf: gaxi::options::ClientConfig,
10774 ) -> gax::client_builder::Result<impl super::stub::RegionHealthChecks> {
10775 Self::build_transport(conf)
10776 .await
10777 .map(super::tracing::RegionHealthChecks::new)
10778 }
10779
10780 /// Deletes the specified HealthCheck resource.
10781 pub fn delete(&self) -> super::builder::region_health_checks::Delete {
10782 super::builder::region_health_checks::Delete::new(self.inner.clone())
10783 }
10784
10785 /// Returns the specified HealthCheck resource.
10786 pub fn get(&self) -> super::builder::region_health_checks::Get {
10787 super::builder::region_health_checks::Get::new(self.inner.clone())
10788 }
10789
10790 /// Creates a HealthCheck resource in the specified project using the data
10791 /// included in the request.
10792 pub fn insert(&self) -> super::builder::region_health_checks::Insert {
10793 super::builder::region_health_checks::Insert::new(self.inner.clone())
10794 }
10795
10796 /// Retrieves the list of HealthCheck resources available to the specified
10797 /// project.
10798 pub fn list(&self) -> super::builder::region_health_checks::List {
10799 super::builder::region_health_checks::List::new(self.inner.clone())
10800 }
10801
10802 /// Updates a HealthCheck resource in the specified project using the data
10803 /// included in the request. This method supportsPATCH
10804 /// semantics and uses theJSON merge
10805 /// patch format and processing rules.
10806 pub fn patch(&self) -> super::builder::region_health_checks::Patch {
10807 super::builder::region_health_checks::Patch::new(self.inner.clone())
10808 }
10809
10810 /// Updates a HealthCheck resource in the specified project using the data
10811 /// included in the request.
10812 pub fn update(&self) -> super::builder::region_health_checks::Update {
10813 super::builder::region_health_checks::Update::new(self.inner.clone())
10814 }
10815
10816 /// Retrieves the specified region-specific Operations resource.
10817 pub fn get_operation(&self) -> super::builder::region_health_checks::GetOperation {
10818 super::builder::region_health_checks::GetOperation::new(self.inner.clone())
10819 }
10820}
10821
10822/// Implements a client for the Google Compute Engine API.
10823///
10824/// # Example
10825/// ```
10826/// # tokio_test::block_on(async {
10827/// # use google_cloud_compute_v1::client::RegionInstanceGroupManagers;
10828/// let client = RegionInstanceGroupManagers::builder().build().await?;
10829/// // use `client` to make requests to the Google Compute Engine API.
10830/// # gax::client_builder::Result::<()>::Ok(()) });
10831/// ```
10832///
10833/// # Service Description
10834///
10835/// Service for the `regionInstanceGroupManagers` resource.
10836///
10837/// # Configuration
10838///
10839/// To configure `RegionInstanceGroupManagers` use the `with_*` methods in the type returned
10840/// by [builder()][RegionInstanceGroupManagers::builder]. The default configuration should
10841/// work for most applications. Common configuration changes include
10842///
10843/// * [with_endpoint()]: by default this client uses the global default endpoint
10844/// (`https://compute.googleapis.com`). Applications using regional
10845/// endpoints or running in restricted networks (e.g. a network configured
10846// with [Private Google Access with VPC Service Controls]) may want to
10847/// override this default.
10848/// * [with_credentials()]: by default this client uses
10849/// [Application Default Credentials]. Applications using custom
10850/// authentication may need to override this default.
10851///
10852/// [with_endpoint()]: super::builder::region_instance_group_managers::ClientBuilder::with_endpoint
10853/// [with_credentials()]: super::builder::region_instance_group_managers::ClientBuilder::credentials
10854/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10855/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10856///
10857/// # Pooling and Cloning
10858///
10859/// `RegionInstanceGroupManagers` holds a connection pool internally, it is advised to
10860/// create one and the reuse it. You do not need to wrap `RegionInstanceGroupManagers` in
10861/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10862/// already uses an `Arc` internally.
10863#[cfg(feature = "region-instance-group-managers")]
10864#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-group-managers")))]
10865#[derive(Clone, Debug)]
10866pub struct RegionInstanceGroupManagers {
10867 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroupManagers>,
10868}
10869
10870#[cfg(feature = "region-instance-group-managers")]
10871impl RegionInstanceGroupManagers {
10872 /// Returns a builder for [RegionInstanceGroupManagers].
10873 ///
10874 /// ```
10875 /// # tokio_test::block_on(async {
10876 /// # use google_cloud_compute_v1::client::RegionInstanceGroupManagers;
10877 /// let client = RegionInstanceGroupManagers::builder().build().await?;
10878 /// # gax::client_builder::Result::<()>::Ok(()) });
10879 /// ```
10880 pub fn builder() -> super::builder::region_instance_group_managers::ClientBuilder {
10881 gax::client_builder::internal::new_builder(
10882 super::builder::region_instance_group_managers::client::Factory,
10883 )
10884 }
10885
10886 /// Creates a new client from the provided stub.
10887 ///
10888 /// The most common case for calling this function is in tests mocking the
10889 /// client's behavior.
10890 pub fn from_stub<T>(stub: T) -> Self
10891 where
10892 T: super::stub::RegionInstanceGroupManagers + 'static,
10893 {
10894 Self {
10895 inner: std::sync::Arc::new(stub),
10896 }
10897 }
10898
10899 pub(crate) async fn new(
10900 config: gaxi::options::ClientConfig,
10901 ) -> gax::client_builder::Result<Self> {
10902 let inner = Self::build_inner(config).await?;
10903 Ok(Self { inner })
10904 }
10905
10906 async fn build_inner(
10907 conf: gaxi::options::ClientConfig,
10908 ) -> gax::client_builder::Result<
10909 std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroupManagers>,
10910 > {
10911 if gaxi::options::tracing_enabled(&conf) {
10912 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10913 }
10914 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10915 }
10916
10917 async fn build_transport(
10918 conf: gaxi::options::ClientConfig,
10919 ) -> gax::client_builder::Result<impl super::stub::RegionInstanceGroupManagers> {
10920 super::transport::RegionInstanceGroupManagers::new(conf).await
10921 }
10922
10923 async fn build_with_tracing(
10924 conf: gaxi::options::ClientConfig,
10925 ) -> gax::client_builder::Result<impl super::stub::RegionInstanceGroupManagers> {
10926 Self::build_transport(conf)
10927 .await
10928 .map(super::tracing::RegionInstanceGroupManagers::new)
10929 }
10930
10931 /// Flags the specified instances to be immediately removed from the managed
10932 /// instance group. Abandoning an instance does not delete the
10933 /// instance, but it does remove the instance from any target pools that are
10934 /// applied by the managed instance group. This method reduces thetargetSize of the managed instance group by the
10935 /// number of instances that you abandon. This operation is marked asDONE when the action is scheduled even if the instances have
10936 /// not yet been removed from the group. You must separately verify the
10937 /// status of the abandoning action with thelistmanagedinstances
10938 /// method.
10939 ///
10940 /// If the group is part of a backend
10941 /// service that has enabled
10942 /// connection draining, it can take up to 60 seconds after the connection
10943 /// draining duration has elapsed before the VM instance is removed or deleted.
10944 ///
10945 /// You can specify a maximum of 1000 instances with this method per request.
10946 pub fn abandon_instances(
10947 &self,
10948 ) -> super::builder::region_instance_group_managers::AbandonInstances {
10949 super::builder::region_instance_group_managers::AbandonInstances::new(self.inner.clone())
10950 }
10951
10952 /// Apply updates to selected instances the managed instance group.
10953 pub fn apply_updates_to_instances(
10954 &self,
10955 ) -> super::builder::region_instance_group_managers::ApplyUpdatesToInstances {
10956 super::builder::region_instance_group_managers::ApplyUpdatesToInstances::new(
10957 self.inner.clone(),
10958 )
10959 }
10960
10961 /// Creates instances with per-instance configurations in this regional managed
10962 /// instance group. Instances are created using the current instance template.
10963 /// The create instances operation is marked DONE if
10964 /// the createInstances request is successful. The underlying
10965 /// actions take additional time. You must separately verify the status of thecreating or actions with the listmanagedinstances
10966 /// method.
10967 pub fn create_instances(
10968 &self,
10969 ) -> super::builder::region_instance_group_managers::CreateInstances {
10970 super::builder::region_instance_group_managers::CreateInstances::new(self.inner.clone())
10971 }
10972
10973 /// Deletes the specified managed instance group and all of the instances
10974 /// in that group.
10975 pub fn delete(&self) -> super::builder::region_instance_group_managers::Delete {
10976 super::builder::region_instance_group_managers::Delete::new(self.inner.clone())
10977 }
10978
10979 /// Flags the specified instances in the managed instance group to be
10980 /// immediately deleted. The instances are also removed from any target
10981 /// pools of which they were a member. This method reduces thetargetSize of the managed instance group by the number of
10982 /// instances that you delete.
10983 /// The deleteInstances operation is marked DONE if
10984 /// the deleteInstances request is successful. The underlying
10985 /// actions take additional time. You must separately verify the status of thedeleting action with thelistmanagedinstances
10986 /// method.
10987 ///
10988 /// If the group is part of a backend
10989 /// service that has enabled
10990 /// connection draining, it can take up to 60 seconds after the connection
10991 /// draining duration has elapsed before the VM instance is removed or deleted.
10992 ///
10993 /// You can specify a maximum of 1000 instances with this method per request.
10994 pub fn delete_instances(
10995 &self,
10996 ) -> super::builder::region_instance_group_managers::DeleteInstances {
10997 super::builder::region_instance_group_managers::DeleteInstances::new(self.inner.clone())
10998 }
10999
11000 /// Deletes selected per-instance configurations for the managed instance
11001 /// group.
11002 pub fn delete_per_instance_configs(
11003 &self,
11004 ) -> super::builder::region_instance_group_managers::DeletePerInstanceConfigs {
11005 super::builder::region_instance_group_managers::DeletePerInstanceConfigs::new(
11006 self.inner.clone(),
11007 )
11008 }
11009
11010 /// Returns all of the details about the specified managed instance group.
11011 pub fn get(&self) -> super::builder::region_instance_group_managers::Get {
11012 super::builder::region_instance_group_managers::Get::new(self.inner.clone())
11013 }
11014
11015 /// Creates a managed instance group using the information that you specify
11016 /// in the request. After the group is created, instances in the group are
11017 /// created using the specified instance template.
11018 /// This operation is marked as DONE when the group is created
11019 /// even if the instances in the group have not yet been created. You must
11020 /// separately verify the status of the individual instances with thelistmanagedinstances
11021 /// method.
11022 ///
11023 /// A regional managed instance group can contain up to 2000 instances.
11024 pub fn insert(&self) -> super::builder::region_instance_group_managers::Insert {
11025 super::builder::region_instance_group_managers::Insert::new(self.inner.clone())
11026 }
11027
11028 /// Retrieves the list of managed instance groups that are contained
11029 /// within the specified region.
11030 pub fn list(&self) -> super::builder::region_instance_group_managers::List {
11031 super::builder::region_instance_group_managers::List::new(self.inner.clone())
11032 }
11033
11034 /// Lists all errors thrown by actions on instances for a given regional
11035 /// managed instance group. The filter andorderBy query parameters are not supported.
11036 pub fn list_errors(&self) -> super::builder::region_instance_group_managers::ListErrors {
11037 super::builder::region_instance_group_managers::ListErrors::new(self.inner.clone())
11038 }
11039
11040 /// Lists the instances in the managed instance group and instances that are
11041 /// scheduled to be created. The list includes any current actions
11042 /// that the group has scheduled for its instances. The orderBy
11043 /// query parameter is not supported. The `pageToken` query parameter is
11044 /// supported only if the group's `listManagedInstancesResults` field is set
11045 /// to `PAGINATED`.
11046 pub fn list_managed_instances(
11047 &self,
11048 ) -> super::builder::region_instance_group_managers::ListManagedInstances {
11049 super::builder::region_instance_group_managers::ListManagedInstances::new(
11050 self.inner.clone(),
11051 )
11052 }
11053
11054 /// Lists all of the per-instance configurations defined for the managed
11055 /// instance group. The orderBy query parameter is not supported.
11056 pub fn list_per_instance_configs(
11057 &self,
11058 ) -> super::builder::region_instance_group_managers::ListPerInstanceConfigs {
11059 super::builder::region_instance_group_managers::ListPerInstanceConfigs::new(
11060 self.inner.clone(),
11061 )
11062 }
11063
11064 /// Updates a managed instance group using the information that you specify
11065 /// in the request.
11066 /// This operation is marked as DONE when the group is patched
11067 /// even if the instances in the group are still in the process of being
11068 /// patched. You must separately verify the status of the individual instances
11069 /// with the listmanagedinstances
11070 /// method. This method supportsPATCH
11071 /// semantics and uses theJSON merge
11072 /// patch format and processing rules.
11073 ///
11074 /// If you update your group to specify a new template or instance
11075 /// configuration, it's possible that your intended specification for each VM
11076 /// in the group is different from the current state of that VM. To learn how
11077 /// to apply an updated configuration to the VMs in a MIG, seeUpdating instances in
11078 /// a MIG.
11079 pub fn patch(&self) -> super::builder::region_instance_group_managers::Patch {
11080 super::builder::region_instance_group_managers::Patch::new(self.inner.clone())
11081 }
11082
11083 /// Inserts or patches per-instance configurations for the managed instance
11084 /// group. perInstanceConfig.name serves as a key used to
11085 /// distinguish whether to perform insert or patch.
11086 pub fn patch_per_instance_configs(
11087 &self,
11088 ) -> super::builder::region_instance_group_managers::PatchPerInstanceConfigs {
11089 super::builder::region_instance_group_managers::PatchPerInstanceConfigs::new(
11090 self.inner.clone(),
11091 )
11092 }
11093
11094 /// Flags the specified VM instances in the managed instance group to be
11095 /// immediately recreated. Each instance is recreated using the group's current
11096 /// configuration. This operation is marked as DONE when the flag
11097 /// is set even if the instances have not yet been recreated. You must
11098 /// separately verify the status of each instance by checking itscurrentAction field; for more information, see Checking
11099 /// the status of managed instances.
11100 ///
11101 /// If the group is part of a backend
11102 /// service that has enabled
11103 /// connection draining, it can take up to 60 seconds after the connection
11104 /// draining duration has elapsed before the VM instance is removed or deleted.
11105 ///
11106 /// You can specify a maximum of 1000 instances with this method per request.
11107 pub fn recreate_instances(
11108 &self,
11109 ) -> super::builder::region_instance_group_managers::RecreateInstances {
11110 super::builder::region_instance_group_managers::RecreateInstances::new(self.inner.clone())
11111 }
11112
11113 /// Changes the intended size of the managed instance group. If you increase
11114 /// the size, the group creates new instances using the current instance
11115 /// template. If you decrease the size, the group deletes one or more
11116 /// instances.
11117 ///
11118 /// The resize operation is marked DONE if theresize request is successful. The underlying actions take
11119 /// additional time. You must separately verify the status of thecreating or deleting actions with thelistmanagedinstances
11120 /// method.
11121 ///
11122 /// If the group is part of a backend
11123 /// service that has enabled
11124 /// connection draining, it can take up to 60 seconds after the connection
11125 /// draining duration has elapsed before the VM instance is removed or deleted.
11126 pub fn resize(&self) -> super::builder::region_instance_group_managers::Resize {
11127 super::builder::region_instance_group_managers::Resize::new(self.inner.clone())
11128 }
11129
11130 /// Flags the specified instances in the managed instance group to be
11131 /// resumed. This method increases thetargetSize and decreases the targetSuspendedSize
11132 /// of the managed instance group by the number of instances that you resume.
11133 /// The resumeInstances operation is marked DONE if
11134 /// the resumeInstances request is successful. The underlying
11135 /// actions take additional time. You must separately verify the status of theRESUMING action with thelistmanagedinstances
11136 /// method.
11137 ///
11138 /// In this request, you can only specify instances that are suspended. For
11139 /// example, if an instance was previously suspended using the suspendInstances
11140 /// method, it can be resumed using the resumeInstances method.
11141 ///
11142 /// If a health check is attached to the managed instance group, the specified
11143 /// instances will be verified as healthy after they are resumed.
11144 ///
11145 /// You can specify a maximum of 1000 instances with this method per request.
11146 pub fn resume_instances(
11147 &self,
11148 ) -> super::builder::region_instance_group_managers::ResumeInstances {
11149 super::builder::region_instance_group_managers::ResumeInstances::new(self.inner.clone())
11150 }
11151
11152 /// Sets the instance template to use when creating new instances or recreating
11153 /// instances in this group. Existing instances are not affected.
11154 pub fn set_instance_template(
11155 &self,
11156 ) -> super::builder::region_instance_group_managers::SetInstanceTemplate {
11157 super::builder::region_instance_group_managers::SetInstanceTemplate::new(self.inner.clone())
11158 }
11159
11160 /// Modifies the target pools to which all new instances in this group are
11161 /// assigned. Existing instances in the group are not affected.
11162 pub fn set_target_pools(
11163 &self,
11164 ) -> super::builder::region_instance_group_managers::SetTargetPools {
11165 super::builder::region_instance_group_managers::SetTargetPools::new(self.inner.clone())
11166 }
11167
11168 /// Flags the specified instances in the managed instance group to be
11169 /// started. This method increases thetargetSize and decreases the targetStoppedSize
11170 /// of the managed instance group by the number of instances that you start.
11171 /// The startInstances operation is marked DONE if
11172 /// the startInstances request is successful. The underlying
11173 /// actions take additional time. You must separately verify the status of theSTARTING action with thelistmanagedinstances
11174 /// method.
11175 ///
11176 /// In this request, you can only specify instances that are stopped. For
11177 /// example, if an instance was previously stopped using the stopInstances
11178 /// method, it can be started using the startInstances method.
11179 ///
11180 /// If a health check is attached to the managed instance group, the specified
11181 /// instances will be verified as healthy after they are started.
11182 ///
11183 /// You can specify a maximum of 1000 instances with this method per request.
11184 pub fn start_instances(
11185 &self,
11186 ) -> super::builder::region_instance_group_managers::StartInstances {
11187 super::builder::region_instance_group_managers::StartInstances::new(self.inner.clone())
11188 }
11189
11190 /// Flags the specified instances in the managed instance group to be
11191 /// immediately stopped. You can only specify instances that are running in
11192 /// this request. This method reduces thetargetSize and increases the targetStoppedSize
11193 /// of the managed instance group by the number of instances that you stop.
11194 /// The stopInstances operation is marked DONE if
11195 /// the stopInstances request is successful. The underlying
11196 /// actions take additional time. You must separately verify the status of theSTOPPING action with thelistmanagedinstances
11197 /// method.
11198 ///
11199 /// If the standbyPolicy.initialDelaySec field is set, the group
11200 /// delays stopping the instances until initialDelaySec have
11201 /// passed from instance.creationTimestamp (that is, when the
11202 /// instance was created). This delay gives your application time to
11203 /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
11204 /// will be zero delay.
11205 ///
11206 /// If the group is part of a backend
11207 /// service that has enabled
11208 /// connection draining, it can take up to 60 seconds after the connection
11209 /// draining duration has elapsed before the VM instance is stopped.
11210 ///
11211 /// Stopped instances can be started using the startInstances
11212 /// method.
11213 ///
11214 /// You can specify a maximum of 1000 instances with this method per request.
11215 pub fn stop_instances(&self) -> super::builder::region_instance_group_managers::StopInstances {
11216 super::builder::region_instance_group_managers::StopInstances::new(self.inner.clone())
11217 }
11218
11219 /// Flags the specified instances in the managed instance group to be
11220 /// immediately suspended. You can only specify instances that are running in
11221 /// this request. This method reduces thetargetSize and increases the targetSuspendedSize
11222 /// of the managed instance group by the number of instances that you suspend.
11223 /// The suspendInstances operation is marked DONE if
11224 /// the suspendInstances request is successful. The underlying
11225 /// actions take additional time. You must separately verify the status of theSUSPENDING action with thelistmanagedinstances
11226 /// method.
11227 ///
11228 /// If the standbyPolicy.initialDelaySec field is set, the group
11229 /// delays suspension of the instances until initialDelaySec have
11230 /// passed from instance.creationTimestamp (that is, when the
11231 /// instance was created). This delay gives your application time to
11232 /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
11233 /// will be zero delay.
11234 ///
11235 /// If the group is part of a backend
11236 /// service that has enabled
11237 /// connection draining, it can take up to 60 seconds after the connection
11238 /// draining duration has elapsed before the VM instance is suspended.
11239 ///
11240 /// Suspended instances can be resumed using the resumeInstances
11241 /// method.
11242 ///
11243 /// You can specify a maximum of 1000 instances with this method per request.
11244 pub fn suspend_instances(
11245 &self,
11246 ) -> super::builder::region_instance_group_managers::SuspendInstances {
11247 super::builder::region_instance_group_managers::SuspendInstances::new(self.inner.clone())
11248 }
11249
11250 /// Inserts or updates per-instance configurations for the managed instance
11251 /// group. perInstanceConfig.name serves as a key used to
11252 /// distinguish whether to perform insert or patch.
11253 pub fn update_per_instance_configs(
11254 &self,
11255 ) -> super::builder::region_instance_group_managers::UpdatePerInstanceConfigs {
11256 super::builder::region_instance_group_managers::UpdatePerInstanceConfigs::new(
11257 self.inner.clone(),
11258 )
11259 }
11260
11261 /// Retrieves the specified region-specific Operations resource.
11262 pub fn get_operation(&self) -> super::builder::region_instance_group_managers::GetOperation {
11263 super::builder::region_instance_group_managers::GetOperation::new(self.inner.clone())
11264 }
11265}
11266
11267/// Implements a client for the Google Compute Engine API.
11268///
11269/// # Example
11270/// ```
11271/// # tokio_test::block_on(async {
11272/// # use google_cloud_compute_v1::client::RegionInstanceGroups;
11273/// let client = RegionInstanceGroups::builder().build().await?;
11274/// // use `client` to make requests to the Google Compute Engine API.
11275/// # gax::client_builder::Result::<()>::Ok(()) });
11276/// ```
11277///
11278/// # Service Description
11279///
11280/// Service for the `regionInstanceGroups` resource.
11281///
11282/// # Configuration
11283///
11284/// To configure `RegionInstanceGroups` use the `with_*` methods in the type returned
11285/// by [builder()][RegionInstanceGroups::builder]. The default configuration should
11286/// work for most applications. Common configuration changes include
11287///
11288/// * [with_endpoint()]: by default this client uses the global default endpoint
11289/// (`https://compute.googleapis.com`). Applications using regional
11290/// endpoints or running in restricted networks (e.g. a network configured
11291// with [Private Google Access with VPC Service Controls]) may want to
11292/// override this default.
11293/// * [with_credentials()]: by default this client uses
11294/// [Application Default Credentials]. Applications using custom
11295/// authentication may need to override this default.
11296///
11297/// [with_endpoint()]: super::builder::region_instance_groups::ClientBuilder::with_endpoint
11298/// [with_credentials()]: super::builder::region_instance_groups::ClientBuilder::credentials
11299/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11300/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11301///
11302/// # Pooling and Cloning
11303///
11304/// `RegionInstanceGroups` holds a connection pool internally, it is advised to
11305/// create one and the reuse it. You do not need to wrap `RegionInstanceGroups` in
11306/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11307/// already uses an `Arc` internally.
11308#[cfg(feature = "region-instance-groups")]
11309#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-groups")))]
11310#[derive(Clone, Debug)]
11311pub struct RegionInstanceGroups {
11312 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroups>,
11313}
11314
11315#[cfg(feature = "region-instance-groups")]
11316impl RegionInstanceGroups {
11317 /// Returns a builder for [RegionInstanceGroups].
11318 ///
11319 /// ```
11320 /// # tokio_test::block_on(async {
11321 /// # use google_cloud_compute_v1::client::RegionInstanceGroups;
11322 /// let client = RegionInstanceGroups::builder().build().await?;
11323 /// # gax::client_builder::Result::<()>::Ok(()) });
11324 /// ```
11325 pub fn builder() -> super::builder::region_instance_groups::ClientBuilder {
11326 gax::client_builder::internal::new_builder(
11327 super::builder::region_instance_groups::client::Factory,
11328 )
11329 }
11330
11331 /// Creates a new client from the provided stub.
11332 ///
11333 /// The most common case for calling this function is in tests mocking the
11334 /// client's behavior.
11335 pub fn from_stub<T>(stub: T) -> Self
11336 where
11337 T: super::stub::RegionInstanceGroups + 'static,
11338 {
11339 Self {
11340 inner: std::sync::Arc::new(stub),
11341 }
11342 }
11343
11344 pub(crate) async fn new(
11345 config: gaxi::options::ClientConfig,
11346 ) -> gax::client_builder::Result<Self> {
11347 let inner = Self::build_inner(config).await?;
11348 Ok(Self { inner })
11349 }
11350
11351 async fn build_inner(
11352 conf: gaxi::options::ClientConfig,
11353 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroups>>
11354 {
11355 if gaxi::options::tracing_enabled(&conf) {
11356 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11357 }
11358 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11359 }
11360
11361 async fn build_transport(
11362 conf: gaxi::options::ClientConfig,
11363 ) -> gax::client_builder::Result<impl super::stub::RegionInstanceGroups> {
11364 super::transport::RegionInstanceGroups::new(conf).await
11365 }
11366
11367 async fn build_with_tracing(
11368 conf: gaxi::options::ClientConfig,
11369 ) -> gax::client_builder::Result<impl super::stub::RegionInstanceGroups> {
11370 Self::build_transport(conf)
11371 .await
11372 .map(super::tracing::RegionInstanceGroups::new)
11373 }
11374
11375 /// Returns the specified instance group resource.
11376 pub fn get(&self) -> super::builder::region_instance_groups::Get {
11377 super::builder::region_instance_groups::Get::new(self.inner.clone())
11378 }
11379
11380 /// Retrieves the list of instance group resources contained within
11381 /// the specified region.
11382 pub fn list(&self) -> super::builder::region_instance_groups::List {
11383 super::builder::region_instance_groups::List::new(self.inner.clone())
11384 }
11385
11386 /// Lists the instances in the specified instance group and displays
11387 /// information about the named ports. Depending on the specified options, this
11388 /// method can list all instances or only the instances that are running.
11389 /// The orderBy query parameter is not supported.
11390 pub fn list_instances(&self) -> super::builder::region_instance_groups::ListInstances {
11391 super::builder::region_instance_groups::ListInstances::new(self.inner.clone())
11392 }
11393
11394 /// Sets the named ports for the specified regional instance group.
11395 pub fn set_named_ports(&self) -> super::builder::region_instance_groups::SetNamedPorts {
11396 super::builder::region_instance_groups::SetNamedPorts::new(self.inner.clone())
11397 }
11398
11399 /// Returns permissions that a caller has on the specified resource.
11400 pub fn test_iam_permissions(
11401 &self,
11402 ) -> super::builder::region_instance_groups::TestIamPermissions {
11403 super::builder::region_instance_groups::TestIamPermissions::new(self.inner.clone())
11404 }
11405
11406 /// Retrieves the specified region-specific Operations resource.
11407 pub fn get_operation(&self) -> super::builder::region_instance_groups::GetOperation {
11408 super::builder::region_instance_groups::GetOperation::new(self.inner.clone())
11409 }
11410}
11411
11412/// Implements a client for the Google Compute Engine API.
11413///
11414/// # Example
11415/// ```
11416/// # tokio_test::block_on(async {
11417/// # use google_cloud_compute_v1::client::RegionInstanceTemplates;
11418/// let client = RegionInstanceTemplates::builder().build().await?;
11419/// // use `client` to make requests to the Google Compute Engine API.
11420/// # gax::client_builder::Result::<()>::Ok(()) });
11421/// ```
11422///
11423/// # Service Description
11424///
11425/// Service for the `regionInstanceTemplates` resource.
11426///
11427/// # Configuration
11428///
11429/// To configure `RegionInstanceTemplates` use the `with_*` methods in the type returned
11430/// by [builder()][RegionInstanceTemplates::builder]. The default configuration should
11431/// work for most applications. Common configuration changes include
11432///
11433/// * [with_endpoint()]: by default this client uses the global default endpoint
11434/// (`https://compute.googleapis.com`). Applications using regional
11435/// endpoints or running in restricted networks (e.g. a network configured
11436// with [Private Google Access with VPC Service Controls]) may want to
11437/// override this default.
11438/// * [with_credentials()]: by default this client uses
11439/// [Application Default Credentials]. Applications using custom
11440/// authentication may need to override this default.
11441///
11442/// [with_endpoint()]: super::builder::region_instance_templates::ClientBuilder::with_endpoint
11443/// [with_credentials()]: super::builder::region_instance_templates::ClientBuilder::credentials
11444/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11445/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11446///
11447/// # Pooling and Cloning
11448///
11449/// `RegionInstanceTemplates` holds a connection pool internally, it is advised to
11450/// create one and the reuse it. You do not need to wrap `RegionInstanceTemplates` in
11451/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11452/// already uses an `Arc` internally.
11453#[cfg(feature = "region-instance-templates")]
11454#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-templates")))]
11455#[derive(Clone, Debug)]
11456pub struct RegionInstanceTemplates {
11457 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceTemplates>,
11458}
11459
11460#[cfg(feature = "region-instance-templates")]
11461impl RegionInstanceTemplates {
11462 /// Returns a builder for [RegionInstanceTemplates].
11463 ///
11464 /// ```
11465 /// # tokio_test::block_on(async {
11466 /// # use google_cloud_compute_v1::client::RegionInstanceTemplates;
11467 /// let client = RegionInstanceTemplates::builder().build().await?;
11468 /// # gax::client_builder::Result::<()>::Ok(()) });
11469 /// ```
11470 pub fn builder() -> super::builder::region_instance_templates::ClientBuilder {
11471 gax::client_builder::internal::new_builder(
11472 super::builder::region_instance_templates::client::Factory,
11473 )
11474 }
11475
11476 /// Creates a new client from the provided stub.
11477 ///
11478 /// The most common case for calling this function is in tests mocking the
11479 /// client's behavior.
11480 pub fn from_stub<T>(stub: T) -> Self
11481 where
11482 T: super::stub::RegionInstanceTemplates + 'static,
11483 {
11484 Self {
11485 inner: std::sync::Arc::new(stub),
11486 }
11487 }
11488
11489 pub(crate) async fn new(
11490 config: gaxi::options::ClientConfig,
11491 ) -> gax::client_builder::Result<Self> {
11492 let inner = Self::build_inner(config).await?;
11493 Ok(Self { inner })
11494 }
11495
11496 async fn build_inner(
11497 conf: gaxi::options::ClientConfig,
11498 ) -> gax::client_builder::Result<
11499 std::sync::Arc<dyn super::stub::dynamic::RegionInstanceTemplates>,
11500 > {
11501 if gaxi::options::tracing_enabled(&conf) {
11502 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11503 }
11504 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11505 }
11506
11507 async fn build_transport(
11508 conf: gaxi::options::ClientConfig,
11509 ) -> gax::client_builder::Result<impl super::stub::RegionInstanceTemplates> {
11510 super::transport::RegionInstanceTemplates::new(conf).await
11511 }
11512
11513 async fn build_with_tracing(
11514 conf: gaxi::options::ClientConfig,
11515 ) -> gax::client_builder::Result<impl super::stub::RegionInstanceTemplates> {
11516 Self::build_transport(conf)
11517 .await
11518 .map(super::tracing::RegionInstanceTemplates::new)
11519 }
11520
11521 /// Deletes the specified instance template. Deleting an instance template is
11522 /// permanent and cannot be undone.
11523 pub fn delete(&self) -> super::builder::region_instance_templates::Delete {
11524 super::builder::region_instance_templates::Delete::new(self.inner.clone())
11525 }
11526
11527 /// Returns the specified instance template.
11528 pub fn get(&self) -> super::builder::region_instance_templates::Get {
11529 super::builder::region_instance_templates::Get::new(self.inner.clone())
11530 }
11531
11532 /// Creates an instance template in the specified project and region using the
11533 /// global instance template whose URL is included in the request.
11534 pub fn insert(&self) -> super::builder::region_instance_templates::Insert {
11535 super::builder::region_instance_templates::Insert::new(self.inner.clone())
11536 }
11537
11538 /// Retrieves a list of instance templates that are contained within the
11539 /// specified project and region.
11540 pub fn list(&self) -> super::builder::region_instance_templates::List {
11541 super::builder::region_instance_templates::List::new(self.inner.clone())
11542 }
11543
11544 /// Retrieves the specified region-specific Operations resource.
11545 pub fn get_operation(&self) -> super::builder::region_instance_templates::GetOperation {
11546 super::builder::region_instance_templates::GetOperation::new(self.inner.clone())
11547 }
11548}
11549
11550/// Implements a client for the Google Compute Engine API.
11551///
11552/// # Example
11553/// ```
11554/// # tokio_test::block_on(async {
11555/// # use google_cloud_compute_v1::client::RegionInstances;
11556/// let client = RegionInstances::builder().build().await?;
11557/// // use `client` to make requests to the Google Compute Engine API.
11558/// # gax::client_builder::Result::<()>::Ok(()) });
11559/// ```
11560///
11561/// # Service Description
11562///
11563/// Service for the `regionInstances` resource.
11564///
11565/// # Configuration
11566///
11567/// To configure `RegionInstances` use the `with_*` methods in the type returned
11568/// by [builder()][RegionInstances::builder]. The default configuration should
11569/// work for most applications. Common configuration changes include
11570///
11571/// * [with_endpoint()]: by default this client uses the global default endpoint
11572/// (`https://compute.googleapis.com`). Applications using regional
11573/// endpoints or running in restricted networks (e.g. a network configured
11574// with [Private Google Access with VPC Service Controls]) may want to
11575/// override this default.
11576/// * [with_credentials()]: by default this client uses
11577/// [Application Default Credentials]. Applications using custom
11578/// authentication may need to override this default.
11579///
11580/// [with_endpoint()]: super::builder::region_instances::ClientBuilder::with_endpoint
11581/// [with_credentials()]: super::builder::region_instances::ClientBuilder::credentials
11582/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11583/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11584///
11585/// # Pooling and Cloning
11586///
11587/// `RegionInstances` holds a connection pool internally, it is advised to
11588/// create one and the reuse it. You do not need to wrap `RegionInstances` in
11589/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11590/// already uses an `Arc` internally.
11591#[cfg(feature = "region-instances")]
11592#[cfg_attr(docsrs, doc(cfg(feature = "region-instances")))]
11593#[derive(Clone, Debug)]
11594pub struct RegionInstances {
11595 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstances>,
11596}
11597
11598#[cfg(feature = "region-instances")]
11599impl RegionInstances {
11600 /// Returns a builder for [RegionInstances].
11601 ///
11602 /// ```
11603 /// # tokio_test::block_on(async {
11604 /// # use google_cloud_compute_v1::client::RegionInstances;
11605 /// let client = RegionInstances::builder().build().await?;
11606 /// # gax::client_builder::Result::<()>::Ok(()) });
11607 /// ```
11608 pub fn builder() -> super::builder::region_instances::ClientBuilder {
11609 gax::client_builder::internal::new_builder(
11610 super::builder::region_instances::client::Factory,
11611 )
11612 }
11613
11614 /// Creates a new client from the provided stub.
11615 ///
11616 /// The most common case for calling this function is in tests mocking the
11617 /// client's behavior.
11618 pub fn from_stub<T>(stub: T) -> Self
11619 where
11620 T: super::stub::RegionInstances + 'static,
11621 {
11622 Self {
11623 inner: std::sync::Arc::new(stub),
11624 }
11625 }
11626
11627 pub(crate) async fn new(
11628 config: gaxi::options::ClientConfig,
11629 ) -> gax::client_builder::Result<Self> {
11630 let inner = Self::build_inner(config).await?;
11631 Ok(Self { inner })
11632 }
11633
11634 async fn build_inner(
11635 conf: gaxi::options::ClientConfig,
11636 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionInstances>>
11637 {
11638 if gaxi::options::tracing_enabled(&conf) {
11639 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11640 }
11641 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11642 }
11643
11644 async fn build_transport(
11645 conf: gaxi::options::ClientConfig,
11646 ) -> gax::client_builder::Result<impl super::stub::RegionInstances> {
11647 super::transport::RegionInstances::new(conf).await
11648 }
11649
11650 async fn build_with_tracing(
11651 conf: gaxi::options::ClientConfig,
11652 ) -> gax::client_builder::Result<impl super::stub::RegionInstances> {
11653 Self::build_transport(conf)
11654 .await
11655 .map(super::tracing::RegionInstances::new)
11656 }
11657
11658 /// Creates multiple instances in a given region. Count specifies the number of
11659 /// instances to create.
11660 pub fn bulk_insert(&self) -> super::builder::region_instances::BulkInsert {
11661 super::builder::region_instances::BulkInsert::new(self.inner.clone())
11662 }
11663
11664 /// Retrieves the specified region-specific Operations resource.
11665 pub fn get_operation(&self) -> super::builder::region_instances::GetOperation {
11666 super::builder::region_instances::GetOperation::new(self.inner.clone())
11667 }
11668}
11669
11670/// Implements a client for the Google Compute Engine API.
11671///
11672/// # Example
11673/// ```
11674/// # tokio_test::block_on(async {
11675/// # use google_cloud_compute_v1::client::RegionInstantSnapshots;
11676/// let client = RegionInstantSnapshots::builder().build().await?;
11677/// // use `client` to make requests to the Google Compute Engine API.
11678/// # gax::client_builder::Result::<()>::Ok(()) });
11679/// ```
11680///
11681/// # Service Description
11682///
11683/// Service for the `regionInstantSnapshots` resource.
11684///
11685/// # Configuration
11686///
11687/// To configure `RegionInstantSnapshots` use the `with_*` methods in the type returned
11688/// by [builder()][RegionInstantSnapshots::builder]. The default configuration should
11689/// work for most applications. Common configuration changes include
11690///
11691/// * [with_endpoint()]: by default this client uses the global default endpoint
11692/// (`https://compute.googleapis.com`). Applications using regional
11693/// endpoints or running in restricted networks (e.g. a network configured
11694// with [Private Google Access with VPC Service Controls]) may want to
11695/// override this default.
11696/// * [with_credentials()]: by default this client uses
11697/// [Application Default Credentials]. Applications using custom
11698/// authentication may need to override this default.
11699///
11700/// [with_endpoint()]: super::builder::region_instant_snapshots::ClientBuilder::with_endpoint
11701/// [with_credentials()]: super::builder::region_instant_snapshots::ClientBuilder::credentials
11702/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11703/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11704///
11705/// # Pooling and Cloning
11706///
11707/// `RegionInstantSnapshots` holds a connection pool internally, it is advised to
11708/// create one and the reuse it. You do not need to wrap `RegionInstantSnapshots` in
11709/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11710/// already uses an `Arc` internally.
11711#[cfg(feature = "region-instant-snapshots")]
11712#[cfg_attr(docsrs, doc(cfg(feature = "region-instant-snapshots")))]
11713#[derive(Clone, Debug)]
11714pub struct RegionInstantSnapshots {
11715 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstantSnapshots>,
11716}
11717
11718#[cfg(feature = "region-instant-snapshots")]
11719impl RegionInstantSnapshots {
11720 /// Returns a builder for [RegionInstantSnapshots].
11721 ///
11722 /// ```
11723 /// # tokio_test::block_on(async {
11724 /// # use google_cloud_compute_v1::client::RegionInstantSnapshots;
11725 /// let client = RegionInstantSnapshots::builder().build().await?;
11726 /// # gax::client_builder::Result::<()>::Ok(()) });
11727 /// ```
11728 pub fn builder() -> super::builder::region_instant_snapshots::ClientBuilder {
11729 gax::client_builder::internal::new_builder(
11730 super::builder::region_instant_snapshots::client::Factory,
11731 )
11732 }
11733
11734 /// Creates a new client from the provided stub.
11735 ///
11736 /// The most common case for calling this function is in tests mocking the
11737 /// client's behavior.
11738 pub fn from_stub<T>(stub: T) -> Self
11739 where
11740 T: super::stub::RegionInstantSnapshots + 'static,
11741 {
11742 Self {
11743 inner: std::sync::Arc::new(stub),
11744 }
11745 }
11746
11747 pub(crate) async fn new(
11748 config: gaxi::options::ClientConfig,
11749 ) -> gax::client_builder::Result<Self> {
11750 let inner = Self::build_inner(config).await?;
11751 Ok(Self { inner })
11752 }
11753
11754 async fn build_inner(
11755 conf: gaxi::options::ClientConfig,
11756 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionInstantSnapshots>>
11757 {
11758 if gaxi::options::tracing_enabled(&conf) {
11759 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11760 }
11761 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11762 }
11763
11764 async fn build_transport(
11765 conf: gaxi::options::ClientConfig,
11766 ) -> gax::client_builder::Result<impl super::stub::RegionInstantSnapshots> {
11767 super::transport::RegionInstantSnapshots::new(conf).await
11768 }
11769
11770 async fn build_with_tracing(
11771 conf: gaxi::options::ClientConfig,
11772 ) -> gax::client_builder::Result<impl super::stub::RegionInstantSnapshots> {
11773 Self::build_transport(conf)
11774 .await
11775 .map(super::tracing::RegionInstantSnapshots::new)
11776 }
11777
11778 /// Deletes the specified InstantSnapshot resource. Keep in mind that deleting
11779 /// a single instantSnapshot might not necessarily delete all the data on that
11780 /// instantSnapshot. If any data on the instantSnapshot that is marked for
11781 /// deletion is needed for subsequent instantSnapshots, the data will be moved
11782 /// to the next corresponding instantSnapshot.
11783 ///
11784 /// For more information, seeDeleting
11785 /// instantSnapshots.
11786 pub fn delete(&self) -> super::builder::region_instant_snapshots::Delete {
11787 super::builder::region_instant_snapshots::Delete::new(self.inner.clone())
11788 }
11789
11790 /// Returns the specified InstantSnapshot resource in the specified region.
11791 pub fn get(&self) -> super::builder::region_instant_snapshots::Get {
11792 super::builder::region_instant_snapshots::Get::new(self.inner.clone())
11793 }
11794
11795 /// Gets the access control policy for a resource. May be empty if no such
11796 /// policy or resource exists.
11797 pub fn get_iam_policy(&self) -> super::builder::region_instant_snapshots::GetIamPolicy {
11798 super::builder::region_instant_snapshots::GetIamPolicy::new(self.inner.clone())
11799 }
11800
11801 /// Creates an instant snapshot in the specified region.
11802 pub fn insert(&self) -> super::builder::region_instant_snapshots::Insert {
11803 super::builder::region_instant_snapshots::Insert::new(self.inner.clone())
11804 }
11805
11806 /// Retrieves the list of InstantSnapshot resources contained within
11807 /// the specified region.
11808 pub fn list(&self) -> super::builder::region_instant_snapshots::List {
11809 super::builder::region_instant_snapshots::List::new(self.inner.clone())
11810 }
11811
11812 /// Sets the access control policy on the specified resource.
11813 /// Replaces any existing policy.
11814 pub fn set_iam_policy(&self) -> super::builder::region_instant_snapshots::SetIamPolicy {
11815 super::builder::region_instant_snapshots::SetIamPolicy::new(self.inner.clone())
11816 }
11817
11818 /// Sets the labels on a instantSnapshot in the given region. To learn more
11819 /// about labels, read the Labeling
11820 /// Resources documentation.
11821 pub fn set_labels(&self) -> super::builder::region_instant_snapshots::SetLabels {
11822 super::builder::region_instant_snapshots::SetLabels::new(self.inner.clone())
11823 }
11824
11825 /// Returns permissions that a caller has on the specified resource.
11826 pub fn test_iam_permissions(
11827 &self,
11828 ) -> super::builder::region_instant_snapshots::TestIamPermissions {
11829 super::builder::region_instant_snapshots::TestIamPermissions::new(self.inner.clone())
11830 }
11831
11832 /// Retrieves the specified region-specific Operations resource.
11833 pub fn get_operation(&self) -> super::builder::region_instant_snapshots::GetOperation {
11834 super::builder::region_instant_snapshots::GetOperation::new(self.inner.clone())
11835 }
11836}
11837
11838/// Implements a client for the Google Compute Engine API.
11839///
11840/// # Example
11841/// ```
11842/// # tokio_test::block_on(async {
11843/// # use google_cloud_compute_v1::client::RegionNetworkEndpointGroups;
11844/// let client = RegionNetworkEndpointGroups::builder().build().await?;
11845/// // use `client` to make requests to the Google Compute Engine API.
11846/// # gax::client_builder::Result::<()>::Ok(()) });
11847/// ```
11848///
11849/// # Service Description
11850///
11851/// Service for the `regionNetworkEndpointGroups` resource.
11852///
11853/// # Configuration
11854///
11855/// To configure `RegionNetworkEndpointGroups` use the `with_*` methods in the type returned
11856/// by [builder()][RegionNetworkEndpointGroups::builder]. The default configuration should
11857/// work for most applications. Common configuration changes include
11858///
11859/// * [with_endpoint()]: by default this client uses the global default endpoint
11860/// (`https://compute.googleapis.com`). Applications using regional
11861/// endpoints or running in restricted networks (e.g. a network configured
11862// with [Private Google Access with VPC Service Controls]) may want to
11863/// override this default.
11864/// * [with_credentials()]: by default this client uses
11865/// [Application Default Credentials]. Applications using custom
11866/// authentication may need to override this default.
11867///
11868/// [with_endpoint()]: super::builder::region_network_endpoint_groups::ClientBuilder::with_endpoint
11869/// [with_credentials()]: super::builder::region_network_endpoint_groups::ClientBuilder::credentials
11870/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11871/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11872///
11873/// # Pooling and Cloning
11874///
11875/// `RegionNetworkEndpointGroups` holds a connection pool internally, it is advised to
11876/// create one and the reuse it. You do not need to wrap `RegionNetworkEndpointGroups` in
11877/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11878/// already uses an `Arc` internally.
11879#[cfg(feature = "region-network-endpoint-groups")]
11880#[cfg_attr(docsrs, doc(cfg(feature = "region-network-endpoint-groups")))]
11881#[derive(Clone, Debug)]
11882pub struct RegionNetworkEndpointGroups {
11883 inner: std::sync::Arc<dyn super::stub::dynamic::RegionNetworkEndpointGroups>,
11884}
11885
11886#[cfg(feature = "region-network-endpoint-groups")]
11887impl RegionNetworkEndpointGroups {
11888 /// Returns a builder for [RegionNetworkEndpointGroups].
11889 ///
11890 /// ```
11891 /// # tokio_test::block_on(async {
11892 /// # use google_cloud_compute_v1::client::RegionNetworkEndpointGroups;
11893 /// let client = RegionNetworkEndpointGroups::builder().build().await?;
11894 /// # gax::client_builder::Result::<()>::Ok(()) });
11895 /// ```
11896 pub fn builder() -> super::builder::region_network_endpoint_groups::ClientBuilder {
11897 gax::client_builder::internal::new_builder(
11898 super::builder::region_network_endpoint_groups::client::Factory,
11899 )
11900 }
11901
11902 /// Creates a new client from the provided stub.
11903 ///
11904 /// The most common case for calling this function is in tests mocking the
11905 /// client's behavior.
11906 pub fn from_stub<T>(stub: T) -> Self
11907 where
11908 T: super::stub::RegionNetworkEndpointGroups + 'static,
11909 {
11910 Self {
11911 inner: std::sync::Arc::new(stub),
11912 }
11913 }
11914
11915 pub(crate) async fn new(
11916 config: gaxi::options::ClientConfig,
11917 ) -> gax::client_builder::Result<Self> {
11918 let inner = Self::build_inner(config).await?;
11919 Ok(Self { inner })
11920 }
11921
11922 async fn build_inner(
11923 conf: gaxi::options::ClientConfig,
11924 ) -> gax::client_builder::Result<
11925 std::sync::Arc<dyn super::stub::dynamic::RegionNetworkEndpointGroups>,
11926 > {
11927 if gaxi::options::tracing_enabled(&conf) {
11928 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11929 }
11930 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11931 }
11932
11933 async fn build_transport(
11934 conf: gaxi::options::ClientConfig,
11935 ) -> gax::client_builder::Result<impl super::stub::RegionNetworkEndpointGroups> {
11936 super::transport::RegionNetworkEndpointGroups::new(conf).await
11937 }
11938
11939 async fn build_with_tracing(
11940 conf: gaxi::options::ClientConfig,
11941 ) -> gax::client_builder::Result<impl super::stub::RegionNetworkEndpointGroups> {
11942 Self::build_transport(conf)
11943 .await
11944 .map(super::tracing::RegionNetworkEndpointGroups::new)
11945 }
11946
11947 /// Attach a list of network endpoints to the specified network endpoint group.
11948 pub fn attach_network_endpoints(
11949 &self,
11950 ) -> super::builder::region_network_endpoint_groups::AttachNetworkEndpoints {
11951 super::builder::region_network_endpoint_groups::AttachNetworkEndpoints::new(
11952 self.inner.clone(),
11953 )
11954 }
11955
11956 /// Deletes the specified network endpoint group. Note that the NEG cannot be
11957 /// deleted if it is configured as a backend of a backend service.
11958 pub fn delete(&self) -> super::builder::region_network_endpoint_groups::Delete {
11959 super::builder::region_network_endpoint_groups::Delete::new(self.inner.clone())
11960 }
11961
11962 /// Detach the network endpoint from the specified network endpoint group.
11963 pub fn detach_network_endpoints(
11964 &self,
11965 ) -> super::builder::region_network_endpoint_groups::DetachNetworkEndpoints {
11966 super::builder::region_network_endpoint_groups::DetachNetworkEndpoints::new(
11967 self.inner.clone(),
11968 )
11969 }
11970
11971 /// Returns the specified network endpoint group.
11972 pub fn get(&self) -> super::builder::region_network_endpoint_groups::Get {
11973 super::builder::region_network_endpoint_groups::Get::new(self.inner.clone())
11974 }
11975
11976 /// Creates a network endpoint group in the specified project using the
11977 /// parameters that are included in the request.
11978 pub fn insert(&self) -> super::builder::region_network_endpoint_groups::Insert {
11979 super::builder::region_network_endpoint_groups::Insert::new(self.inner.clone())
11980 }
11981
11982 /// Retrieves the list of regional network endpoint groups available to the
11983 /// specified project in the given region.
11984 pub fn list(&self) -> super::builder::region_network_endpoint_groups::List {
11985 super::builder::region_network_endpoint_groups::List::new(self.inner.clone())
11986 }
11987
11988 /// Lists the network endpoints in the specified network endpoint group.
11989 pub fn list_network_endpoints(
11990 &self,
11991 ) -> super::builder::region_network_endpoint_groups::ListNetworkEndpoints {
11992 super::builder::region_network_endpoint_groups::ListNetworkEndpoints::new(
11993 self.inner.clone(),
11994 )
11995 }
11996
11997 /// Retrieves the specified region-specific Operations resource.
11998 pub fn get_operation(&self) -> super::builder::region_network_endpoint_groups::GetOperation {
11999 super::builder::region_network_endpoint_groups::GetOperation::new(self.inner.clone())
12000 }
12001}
12002
12003/// Implements a client for the Google Compute Engine API.
12004///
12005/// # Example
12006/// ```
12007/// # tokio_test::block_on(async {
12008/// # use google_cloud_compute_v1::client::RegionNetworkFirewallPolicies;
12009/// let client = RegionNetworkFirewallPolicies::builder().build().await?;
12010/// // use `client` to make requests to the Google Compute Engine API.
12011/// # gax::client_builder::Result::<()>::Ok(()) });
12012/// ```
12013///
12014/// # Service Description
12015///
12016/// Service for the `regionNetworkFirewallPolicies` resource.
12017///
12018/// # Configuration
12019///
12020/// To configure `RegionNetworkFirewallPolicies` use the `with_*` methods in the type returned
12021/// by [builder()][RegionNetworkFirewallPolicies::builder]. The default configuration should
12022/// work for most applications. Common configuration changes include
12023///
12024/// * [with_endpoint()]: by default this client uses the global default endpoint
12025/// (`https://compute.googleapis.com`). Applications using regional
12026/// endpoints or running in restricted networks (e.g. a network configured
12027// with [Private Google Access with VPC Service Controls]) may want to
12028/// override this default.
12029/// * [with_credentials()]: by default this client uses
12030/// [Application Default Credentials]. Applications using custom
12031/// authentication may need to override this default.
12032///
12033/// [with_endpoint()]: super::builder::region_network_firewall_policies::ClientBuilder::with_endpoint
12034/// [with_credentials()]: super::builder::region_network_firewall_policies::ClientBuilder::credentials
12035/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12036/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12037///
12038/// # Pooling and Cloning
12039///
12040/// `RegionNetworkFirewallPolicies` holds a connection pool internally, it is advised to
12041/// create one and the reuse it. You do not need to wrap `RegionNetworkFirewallPolicies` in
12042/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12043/// already uses an `Arc` internally.
12044#[cfg(feature = "region-network-firewall-policies")]
12045#[cfg_attr(docsrs, doc(cfg(feature = "region-network-firewall-policies")))]
12046#[derive(Clone, Debug)]
12047pub struct RegionNetworkFirewallPolicies {
12048 inner: std::sync::Arc<dyn super::stub::dynamic::RegionNetworkFirewallPolicies>,
12049}
12050
12051#[cfg(feature = "region-network-firewall-policies")]
12052impl RegionNetworkFirewallPolicies {
12053 /// Returns a builder for [RegionNetworkFirewallPolicies].
12054 ///
12055 /// ```
12056 /// # tokio_test::block_on(async {
12057 /// # use google_cloud_compute_v1::client::RegionNetworkFirewallPolicies;
12058 /// let client = RegionNetworkFirewallPolicies::builder().build().await?;
12059 /// # gax::client_builder::Result::<()>::Ok(()) });
12060 /// ```
12061 pub fn builder() -> super::builder::region_network_firewall_policies::ClientBuilder {
12062 gax::client_builder::internal::new_builder(
12063 super::builder::region_network_firewall_policies::client::Factory,
12064 )
12065 }
12066
12067 /// Creates a new client from the provided stub.
12068 ///
12069 /// The most common case for calling this function is in tests mocking the
12070 /// client's behavior.
12071 pub fn from_stub<T>(stub: T) -> Self
12072 where
12073 T: super::stub::RegionNetworkFirewallPolicies + 'static,
12074 {
12075 Self {
12076 inner: std::sync::Arc::new(stub),
12077 }
12078 }
12079
12080 pub(crate) async fn new(
12081 config: gaxi::options::ClientConfig,
12082 ) -> gax::client_builder::Result<Self> {
12083 let inner = Self::build_inner(config).await?;
12084 Ok(Self { inner })
12085 }
12086
12087 async fn build_inner(
12088 conf: gaxi::options::ClientConfig,
12089 ) -> gax::client_builder::Result<
12090 std::sync::Arc<dyn super::stub::dynamic::RegionNetworkFirewallPolicies>,
12091 > {
12092 if gaxi::options::tracing_enabled(&conf) {
12093 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12094 }
12095 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12096 }
12097
12098 async fn build_transport(
12099 conf: gaxi::options::ClientConfig,
12100 ) -> gax::client_builder::Result<impl super::stub::RegionNetworkFirewallPolicies> {
12101 super::transport::RegionNetworkFirewallPolicies::new(conf).await
12102 }
12103
12104 async fn build_with_tracing(
12105 conf: gaxi::options::ClientConfig,
12106 ) -> gax::client_builder::Result<impl super::stub::RegionNetworkFirewallPolicies> {
12107 Self::build_transport(conf)
12108 .await
12109 .map(super::tracing::RegionNetworkFirewallPolicies::new)
12110 }
12111
12112 /// Inserts an association for the specified network firewall policy.
12113 pub fn add_association(
12114 &self,
12115 ) -> super::builder::region_network_firewall_policies::AddAssociation {
12116 super::builder::region_network_firewall_policies::AddAssociation::new(self.inner.clone())
12117 }
12118
12119 /// Inserts a rule into a network firewall policy.
12120 pub fn add_rule(&self) -> super::builder::region_network_firewall_policies::AddRule {
12121 super::builder::region_network_firewall_policies::AddRule::new(self.inner.clone())
12122 }
12123
12124 /// Copies rules to the specified network firewall policy.
12125 pub fn clone_rules(&self) -> super::builder::region_network_firewall_policies::CloneRules {
12126 super::builder::region_network_firewall_policies::CloneRules::new(self.inner.clone())
12127 }
12128
12129 /// Deletes the specified network firewall policy.
12130 pub fn delete(&self) -> super::builder::region_network_firewall_policies::Delete {
12131 super::builder::region_network_firewall_policies::Delete::new(self.inner.clone())
12132 }
12133
12134 /// Returns the specified network firewall policy.
12135 pub fn get(&self) -> super::builder::region_network_firewall_policies::Get {
12136 super::builder::region_network_firewall_policies::Get::new(self.inner.clone())
12137 }
12138
12139 /// Gets an association with the specified name.
12140 pub fn get_association(
12141 &self,
12142 ) -> super::builder::region_network_firewall_policies::GetAssociation {
12143 super::builder::region_network_firewall_policies::GetAssociation::new(self.inner.clone())
12144 }
12145
12146 /// Returns the effective firewalls on a given network.
12147 pub fn get_effective_firewalls(
12148 &self,
12149 ) -> super::builder::region_network_firewall_policies::GetEffectiveFirewalls {
12150 super::builder::region_network_firewall_policies::GetEffectiveFirewalls::new(
12151 self.inner.clone(),
12152 )
12153 }
12154
12155 /// Gets the access control policy for a resource. May be empty if no such
12156 /// policy or resource exists.
12157 pub fn get_iam_policy(&self) -> super::builder::region_network_firewall_policies::GetIamPolicy {
12158 super::builder::region_network_firewall_policies::GetIamPolicy::new(self.inner.clone())
12159 }
12160
12161 /// Gets a rule of the specified priority.
12162 pub fn get_rule(&self) -> super::builder::region_network_firewall_policies::GetRule {
12163 super::builder::region_network_firewall_policies::GetRule::new(self.inner.clone())
12164 }
12165
12166 /// Creates a new network firewall policy in the specified project and region.
12167 pub fn insert(&self) -> super::builder::region_network_firewall_policies::Insert {
12168 super::builder::region_network_firewall_policies::Insert::new(self.inner.clone())
12169 }
12170
12171 /// Lists all the network firewall policies that have been configured
12172 /// for the specified project in the given region.
12173 pub fn list(&self) -> super::builder::region_network_firewall_policies::List {
12174 super::builder::region_network_firewall_policies::List::new(self.inner.clone())
12175 }
12176
12177 /// Patches the specified network firewall policy.
12178 pub fn patch(&self) -> super::builder::region_network_firewall_policies::Patch {
12179 super::builder::region_network_firewall_policies::Patch::new(self.inner.clone())
12180 }
12181
12182 /// Patches a rule of the specified priority.
12183 pub fn patch_rule(&self) -> super::builder::region_network_firewall_policies::PatchRule {
12184 super::builder::region_network_firewall_policies::PatchRule::new(self.inner.clone())
12185 }
12186
12187 /// Removes an association for the specified network firewall policy.
12188 pub fn remove_association(
12189 &self,
12190 ) -> super::builder::region_network_firewall_policies::RemoveAssociation {
12191 super::builder::region_network_firewall_policies::RemoveAssociation::new(self.inner.clone())
12192 }
12193
12194 /// Deletes a rule of the specified priority.
12195 pub fn remove_rule(&self) -> super::builder::region_network_firewall_policies::RemoveRule {
12196 super::builder::region_network_firewall_policies::RemoveRule::new(self.inner.clone())
12197 }
12198
12199 /// Sets the access control policy on the specified resource.
12200 /// Replaces any existing policy.
12201 pub fn set_iam_policy(&self) -> super::builder::region_network_firewall_policies::SetIamPolicy {
12202 super::builder::region_network_firewall_policies::SetIamPolicy::new(self.inner.clone())
12203 }
12204
12205 /// Returns permissions that a caller has on the specified resource.
12206 pub fn test_iam_permissions(
12207 &self,
12208 ) -> super::builder::region_network_firewall_policies::TestIamPermissions {
12209 super::builder::region_network_firewall_policies::TestIamPermissions::new(
12210 self.inner.clone(),
12211 )
12212 }
12213
12214 /// Retrieves the specified region-specific Operations resource.
12215 pub fn get_operation(&self) -> super::builder::region_network_firewall_policies::GetOperation {
12216 super::builder::region_network_firewall_policies::GetOperation::new(self.inner.clone())
12217 }
12218}
12219
12220/// Implements a client for the Google Compute Engine API.
12221///
12222/// # Example
12223/// ```
12224/// # tokio_test::block_on(async {
12225/// # use google_cloud_compute_v1::client::RegionNotificationEndpoints;
12226/// let client = RegionNotificationEndpoints::builder().build().await?;
12227/// // use `client` to make requests to the Google Compute Engine API.
12228/// # gax::client_builder::Result::<()>::Ok(()) });
12229/// ```
12230///
12231/// # Service Description
12232///
12233/// Service for the `regionNotificationEndpoints` resource.
12234///
12235/// # Configuration
12236///
12237/// To configure `RegionNotificationEndpoints` use the `with_*` methods in the type returned
12238/// by [builder()][RegionNotificationEndpoints::builder]. The default configuration should
12239/// work for most applications. Common configuration changes include
12240///
12241/// * [with_endpoint()]: by default this client uses the global default endpoint
12242/// (`https://compute.googleapis.com`). Applications using regional
12243/// endpoints or running in restricted networks (e.g. a network configured
12244// with [Private Google Access with VPC Service Controls]) may want to
12245/// override this default.
12246/// * [with_credentials()]: by default this client uses
12247/// [Application Default Credentials]. Applications using custom
12248/// authentication may need to override this default.
12249///
12250/// [with_endpoint()]: super::builder::region_notification_endpoints::ClientBuilder::with_endpoint
12251/// [with_credentials()]: super::builder::region_notification_endpoints::ClientBuilder::credentials
12252/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12253/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12254///
12255/// # Pooling and Cloning
12256///
12257/// `RegionNotificationEndpoints` holds a connection pool internally, it is advised to
12258/// create one and the reuse it. You do not need to wrap `RegionNotificationEndpoints` in
12259/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12260/// already uses an `Arc` internally.
12261#[cfg(feature = "region-notification-endpoints")]
12262#[cfg_attr(docsrs, doc(cfg(feature = "region-notification-endpoints")))]
12263#[derive(Clone, Debug)]
12264pub struct RegionNotificationEndpoints {
12265 inner: std::sync::Arc<dyn super::stub::dynamic::RegionNotificationEndpoints>,
12266}
12267
12268#[cfg(feature = "region-notification-endpoints")]
12269impl RegionNotificationEndpoints {
12270 /// Returns a builder for [RegionNotificationEndpoints].
12271 ///
12272 /// ```
12273 /// # tokio_test::block_on(async {
12274 /// # use google_cloud_compute_v1::client::RegionNotificationEndpoints;
12275 /// let client = RegionNotificationEndpoints::builder().build().await?;
12276 /// # gax::client_builder::Result::<()>::Ok(()) });
12277 /// ```
12278 pub fn builder() -> super::builder::region_notification_endpoints::ClientBuilder {
12279 gax::client_builder::internal::new_builder(
12280 super::builder::region_notification_endpoints::client::Factory,
12281 )
12282 }
12283
12284 /// Creates a new client from the provided stub.
12285 ///
12286 /// The most common case for calling this function is in tests mocking the
12287 /// client's behavior.
12288 pub fn from_stub<T>(stub: T) -> Self
12289 where
12290 T: super::stub::RegionNotificationEndpoints + 'static,
12291 {
12292 Self {
12293 inner: std::sync::Arc::new(stub),
12294 }
12295 }
12296
12297 pub(crate) async fn new(
12298 config: gaxi::options::ClientConfig,
12299 ) -> gax::client_builder::Result<Self> {
12300 let inner = Self::build_inner(config).await?;
12301 Ok(Self { inner })
12302 }
12303
12304 async fn build_inner(
12305 conf: gaxi::options::ClientConfig,
12306 ) -> gax::client_builder::Result<
12307 std::sync::Arc<dyn super::stub::dynamic::RegionNotificationEndpoints>,
12308 > {
12309 if gaxi::options::tracing_enabled(&conf) {
12310 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12311 }
12312 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12313 }
12314
12315 async fn build_transport(
12316 conf: gaxi::options::ClientConfig,
12317 ) -> gax::client_builder::Result<impl super::stub::RegionNotificationEndpoints> {
12318 super::transport::RegionNotificationEndpoints::new(conf).await
12319 }
12320
12321 async fn build_with_tracing(
12322 conf: gaxi::options::ClientConfig,
12323 ) -> gax::client_builder::Result<impl super::stub::RegionNotificationEndpoints> {
12324 Self::build_transport(conf)
12325 .await
12326 .map(super::tracing::RegionNotificationEndpoints::new)
12327 }
12328
12329 /// Deletes the specified NotificationEndpoint in the given region
12330 pub fn delete(&self) -> super::builder::region_notification_endpoints::Delete {
12331 super::builder::region_notification_endpoints::Delete::new(self.inner.clone())
12332 }
12333
12334 /// Returns the specified NotificationEndpoint resource in the given region.
12335 pub fn get(&self) -> super::builder::region_notification_endpoints::Get {
12336 super::builder::region_notification_endpoints::Get::new(self.inner.clone())
12337 }
12338
12339 /// Create a NotificationEndpoint in the specified project in the given region
12340 /// using the parameters that are included in the request.
12341 pub fn insert(&self) -> super::builder::region_notification_endpoints::Insert {
12342 super::builder::region_notification_endpoints::Insert::new(self.inner.clone())
12343 }
12344
12345 /// Lists the NotificationEndpoints for a project in the given region.
12346 pub fn list(&self) -> super::builder::region_notification_endpoints::List {
12347 super::builder::region_notification_endpoints::List::new(self.inner.clone())
12348 }
12349
12350 /// Retrieves the specified region-specific Operations resource.
12351 pub fn get_operation(&self) -> super::builder::region_notification_endpoints::GetOperation {
12352 super::builder::region_notification_endpoints::GetOperation::new(self.inner.clone())
12353 }
12354}
12355
12356/// Implements a client for the Google Compute Engine API.
12357///
12358/// # Example
12359/// ```
12360/// # tokio_test::block_on(async {
12361/// # use google_cloud_compute_v1::client::RegionOperations;
12362/// let client = RegionOperations::builder().build().await?;
12363/// // use `client` to make requests to the Google Compute Engine API.
12364/// # gax::client_builder::Result::<()>::Ok(()) });
12365/// ```
12366///
12367/// # Service Description
12368///
12369/// Service for the `regionOperations` resource.
12370///
12371/// # Configuration
12372///
12373/// To configure `RegionOperations` use the `with_*` methods in the type returned
12374/// by [builder()][RegionOperations::builder]. The default configuration should
12375/// work for most applications. Common configuration changes include
12376///
12377/// * [with_endpoint()]: by default this client uses the global default endpoint
12378/// (`https://compute.googleapis.com`). Applications using regional
12379/// endpoints or running in restricted networks (e.g. a network configured
12380// with [Private Google Access with VPC Service Controls]) may want to
12381/// override this default.
12382/// * [with_credentials()]: by default this client uses
12383/// [Application Default Credentials]. Applications using custom
12384/// authentication may need to override this default.
12385///
12386/// [with_endpoint()]: super::builder::region_operations::ClientBuilder::with_endpoint
12387/// [with_credentials()]: super::builder::region_operations::ClientBuilder::credentials
12388/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12389/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12390///
12391/// # Pooling and Cloning
12392///
12393/// `RegionOperations` holds a connection pool internally, it is advised to
12394/// create one and the reuse it. You do not need to wrap `RegionOperations` in
12395/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12396/// already uses an `Arc` internally.
12397#[cfg(feature = "region-operations")]
12398#[cfg_attr(docsrs, doc(cfg(feature = "region-operations")))]
12399#[derive(Clone, Debug)]
12400pub struct RegionOperations {
12401 inner: std::sync::Arc<dyn super::stub::dynamic::RegionOperations>,
12402}
12403
12404#[cfg(feature = "region-operations")]
12405impl RegionOperations {
12406 /// Returns a builder for [RegionOperations].
12407 ///
12408 /// ```
12409 /// # tokio_test::block_on(async {
12410 /// # use google_cloud_compute_v1::client::RegionOperations;
12411 /// let client = RegionOperations::builder().build().await?;
12412 /// # gax::client_builder::Result::<()>::Ok(()) });
12413 /// ```
12414 pub fn builder() -> super::builder::region_operations::ClientBuilder {
12415 gax::client_builder::internal::new_builder(
12416 super::builder::region_operations::client::Factory,
12417 )
12418 }
12419
12420 /// Creates a new client from the provided stub.
12421 ///
12422 /// The most common case for calling this function is in tests mocking the
12423 /// client's behavior.
12424 pub fn from_stub<T>(stub: T) -> Self
12425 where
12426 T: super::stub::RegionOperations + 'static,
12427 {
12428 Self {
12429 inner: std::sync::Arc::new(stub),
12430 }
12431 }
12432
12433 pub(crate) async fn new(
12434 config: gaxi::options::ClientConfig,
12435 ) -> gax::client_builder::Result<Self> {
12436 let inner = Self::build_inner(config).await?;
12437 Ok(Self { inner })
12438 }
12439
12440 async fn build_inner(
12441 conf: gaxi::options::ClientConfig,
12442 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionOperations>>
12443 {
12444 if gaxi::options::tracing_enabled(&conf) {
12445 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12446 }
12447 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12448 }
12449
12450 async fn build_transport(
12451 conf: gaxi::options::ClientConfig,
12452 ) -> gax::client_builder::Result<impl super::stub::RegionOperations> {
12453 super::transport::RegionOperations::new(conf).await
12454 }
12455
12456 async fn build_with_tracing(
12457 conf: gaxi::options::ClientConfig,
12458 ) -> gax::client_builder::Result<impl super::stub::RegionOperations> {
12459 Self::build_transport(conf)
12460 .await
12461 .map(super::tracing::RegionOperations::new)
12462 }
12463
12464 /// Deletes the specified region-specific Operations resource.
12465 pub fn delete(&self) -> super::builder::region_operations::Delete {
12466 super::builder::region_operations::Delete::new(self.inner.clone())
12467 }
12468
12469 /// Retrieves the specified region-specific Operations resource.
12470 pub fn get(&self) -> super::builder::region_operations::Get {
12471 super::builder::region_operations::Get::new(self.inner.clone())
12472 }
12473
12474 /// Retrieves a list of Operation resources contained within
12475 /// the specified region.
12476 pub fn list(&self) -> super::builder::region_operations::List {
12477 super::builder::region_operations::List::new(self.inner.clone())
12478 }
12479
12480 /// Waits for the specified Operation resource to return as `DONE`
12481 /// or for the request to approach the 2 minute deadline, and retrieves the
12482 /// specified Operation resource. This method differs from the
12483 /// `GET` method in that it waits for no more than the default
12484 /// deadline (2 minutes) and then returns the current state of the operation,
12485 /// which might be `DONE` or still in progress.
12486 ///
12487 /// This method is called on a best-effort basis. Specifically:
12488 ///
12489 /// ```norust
12490 /// - In uncommon cases, when the server is overloaded, the request might
12491 /// return before the default deadline is reached, or might return after zero
12492 /// seconds.
12493 /// ```
12494 ///
12495 /// - If the default deadline is reached, there is no guarantee that the
12496 /// operation is actually done when the method returns. Be prepared to retry
12497 /// if the operation is not `DONE`.
12498 pub fn wait(&self) -> super::builder::region_operations::Wait {
12499 super::builder::region_operations::Wait::new(self.inner.clone())
12500 }
12501}
12502
12503/// Implements a client for the Google Compute Engine API.
12504///
12505/// # Example
12506/// ```
12507/// # tokio_test::block_on(async {
12508/// # use google_cloud_compute_v1::client::RegionSecurityPolicies;
12509/// let client = RegionSecurityPolicies::builder().build().await?;
12510/// // use `client` to make requests to the Google Compute Engine API.
12511/// # gax::client_builder::Result::<()>::Ok(()) });
12512/// ```
12513///
12514/// # Service Description
12515///
12516/// Service for the `regionSecurityPolicies` resource.
12517///
12518/// # Configuration
12519///
12520/// To configure `RegionSecurityPolicies` use the `with_*` methods in the type returned
12521/// by [builder()][RegionSecurityPolicies::builder]. The default configuration should
12522/// work for most applications. Common configuration changes include
12523///
12524/// * [with_endpoint()]: by default this client uses the global default endpoint
12525/// (`https://compute.googleapis.com`). Applications using regional
12526/// endpoints or running in restricted networks (e.g. a network configured
12527// with [Private Google Access with VPC Service Controls]) may want to
12528/// override this default.
12529/// * [with_credentials()]: by default this client uses
12530/// [Application Default Credentials]. Applications using custom
12531/// authentication may need to override this default.
12532///
12533/// [with_endpoint()]: super::builder::region_security_policies::ClientBuilder::with_endpoint
12534/// [with_credentials()]: super::builder::region_security_policies::ClientBuilder::credentials
12535/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12536/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12537///
12538/// # Pooling and Cloning
12539///
12540/// `RegionSecurityPolicies` holds a connection pool internally, it is advised to
12541/// create one and the reuse it. You do not need to wrap `RegionSecurityPolicies` in
12542/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12543/// already uses an `Arc` internally.
12544#[cfg(feature = "region-security-policies")]
12545#[cfg_attr(docsrs, doc(cfg(feature = "region-security-policies")))]
12546#[derive(Clone, Debug)]
12547pub struct RegionSecurityPolicies {
12548 inner: std::sync::Arc<dyn super::stub::dynamic::RegionSecurityPolicies>,
12549}
12550
12551#[cfg(feature = "region-security-policies")]
12552impl RegionSecurityPolicies {
12553 /// Returns a builder for [RegionSecurityPolicies].
12554 ///
12555 /// ```
12556 /// # tokio_test::block_on(async {
12557 /// # use google_cloud_compute_v1::client::RegionSecurityPolicies;
12558 /// let client = RegionSecurityPolicies::builder().build().await?;
12559 /// # gax::client_builder::Result::<()>::Ok(()) });
12560 /// ```
12561 pub fn builder() -> super::builder::region_security_policies::ClientBuilder {
12562 gax::client_builder::internal::new_builder(
12563 super::builder::region_security_policies::client::Factory,
12564 )
12565 }
12566
12567 /// Creates a new client from the provided stub.
12568 ///
12569 /// The most common case for calling this function is in tests mocking the
12570 /// client's behavior.
12571 pub fn from_stub<T>(stub: T) -> Self
12572 where
12573 T: super::stub::RegionSecurityPolicies + 'static,
12574 {
12575 Self {
12576 inner: std::sync::Arc::new(stub),
12577 }
12578 }
12579
12580 pub(crate) async fn new(
12581 config: gaxi::options::ClientConfig,
12582 ) -> gax::client_builder::Result<Self> {
12583 let inner = Self::build_inner(config).await?;
12584 Ok(Self { inner })
12585 }
12586
12587 async fn build_inner(
12588 conf: gaxi::options::ClientConfig,
12589 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionSecurityPolicies>>
12590 {
12591 if gaxi::options::tracing_enabled(&conf) {
12592 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12593 }
12594 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12595 }
12596
12597 async fn build_transport(
12598 conf: gaxi::options::ClientConfig,
12599 ) -> gax::client_builder::Result<impl super::stub::RegionSecurityPolicies> {
12600 super::transport::RegionSecurityPolicies::new(conf).await
12601 }
12602
12603 async fn build_with_tracing(
12604 conf: gaxi::options::ClientConfig,
12605 ) -> gax::client_builder::Result<impl super::stub::RegionSecurityPolicies> {
12606 Self::build_transport(conf)
12607 .await
12608 .map(super::tracing::RegionSecurityPolicies::new)
12609 }
12610
12611 /// Inserts a rule into a security policy.
12612 pub fn add_rule(&self) -> super::builder::region_security_policies::AddRule {
12613 super::builder::region_security_policies::AddRule::new(self.inner.clone())
12614 }
12615
12616 /// Deletes the specified policy.
12617 pub fn delete(&self) -> super::builder::region_security_policies::Delete {
12618 super::builder::region_security_policies::Delete::new(self.inner.clone())
12619 }
12620
12621 /// List all of the ordered rules present in a single specified policy.
12622 pub fn get(&self) -> super::builder::region_security_policies::Get {
12623 super::builder::region_security_policies::Get::new(self.inner.clone())
12624 }
12625
12626 /// Gets a rule at the specified priority.
12627 pub fn get_rule(&self) -> super::builder::region_security_policies::GetRule {
12628 super::builder::region_security_policies::GetRule::new(self.inner.clone())
12629 }
12630
12631 /// Creates a new policy in the specified project using the data included in
12632 /// the request.
12633 pub fn insert(&self) -> super::builder::region_security_policies::Insert {
12634 super::builder::region_security_policies::Insert::new(self.inner.clone())
12635 }
12636
12637 /// List all the policies that have been configured for the specified project
12638 /// and region.
12639 pub fn list(&self) -> super::builder::region_security_policies::List {
12640 super::builder::region_security_policies::List::new(self.inner.clone())
12641 }
12642
12643 /// Patches the specified policy with the data included in the request. To
12644 /// clear fields in the policy, leave the fields empty and specify them in the
12645 /// updateMask. This cannot be used to be update the rules in the policy.
12646 /// Please use the per rule methods like addRule, patchRule, and removeRule
12647 /// instead.
12648 pub fn patch(&self) -> super::builder::region_security_policies::Patch {
12649 super::builder::region_security_policies::Patch::new(self.inner.clone())
12650 }
12651
12652 /// Patches a rule at the specified priority. To clear fields in the rule,
12653 /// leave the fields empty and specify them in the updateMask.
12654 pub fn patch_rule(&self) -> super::builder::region_security_policies::PatchRule {
12655 super::builder::region_security_policies::PatchRule::new(self.inner.clone())
12656 }
12657
12658 /// Deletes a rule at the specified priority.
12659 pub fn remove_rule(&self) -> super::builder::region_security_policies::RemoveRule {
12660 super::builder::region_security_policies::RemoveRule::new(self.inner.clone())
12661 }
12662
12663 /// Sets the labels on a security policy. To learn more about labels,
12664 /// read the Labeling Resources
12665 /// documentation.
12666 pub fn set_labels(&self) -> super::builder::region_security_policies::SetLabels {
12667 super::builder::region_security_policies::SetLabels::new(self.inner.clone())
12668 }
12669
12670 /// Retrieves the specified region-specific Operations resource.
12671 pub fn get_operation(&self) -> super::builder::region_security_policies::GetOperation {
12672 super::builder::region_security_policies::GetOperation::new(self.inner.clone())
12673 }
12674}
12675
12676/// Implements a client for the Google Compute Engine API.
12677///
12678/// # Example
12679/// ```
12680/// # tokio_test::block_on(async {
12681/// # use google_cloud_compute_v1::client::RegionSslCertificates;
12682/// let client = RegionSslCertificates::builder().build().await?;
12683/// // use `client` to make requests to the Google Compute Engine API.
12684/// # gax::client_builder::Result::<()>::Ok(()) });
12685/// ```
12686///
12687/// # Service Description
12688///
12689/// Service for the `regionSslCertificates` resource.
12690///
12691/// # Configuration
12692///
12693/// To configure `RegionSslCertificates` use the `with_*` methods in the type returned
12694/// by [builder()][RegionSslCertificates::builder]. The default configuration should
12695/// work for most applications. Common configuration changes include
12696///
12697/// * [with_endpoint()]: by default this client uses the global default endpoint
12698/// (`https://compute.googleapis.com`). Applications using regional
12699/// endpoints or running in restricted networks (e.g. a network configured
12700// with [Private Google Access with VPC Service Controls]) may want to
12701/// override this default.
12702/// * [with_credentials()]: by default this client uses
12703/// [Application Default Credentials]. Applications using custom
12704/// authentication may need to override this default.
12705///
12706/// [with_endpoint()]: super::builder::region_ssl_certificates::ClientBuilder::with_endpoint
12707/// [with_credentials()]: super::builder::region_ssl_certificates::ClientBuilder::credentials
12708/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12709/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12710///
12711/// # Pooling and Cloning
12712///
12713/// `RegionSslCertificates` holds a connection pool internally, it is advised to
12714/// create one and the reuse it. You do not need to wrap `RegionSslCertificates` in
12715/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12716/// already uses an `Arc` internally.
12717#[cfg(feature = "region-ssl-certificates")]
12718#[cfg_attr(docsrs, doc(cfg(feature = "region-ssl-certificates")))]
12719#[derive(Clone, Debug)]
12720pub struct RegionSslCertificates {
12721 inner: std::sync::Arc<dyn super::stub::dynamic::RegionSslCertificates>,
12722}
12723
12724#[cfg(feature = "region-ssl-certificates")]
12725impl RegionSslCertificates {
12726 /// Returns a builder for [RegionSslCertificates].
12727 ///
12728 /// ```
12729 /// # tokio_test::block_on(async {
12730 /// # use google_cloud_compute_v1::client::RegionSslCertificates;
12731 /// let client = RegionSslCertificates::builder().build().await?;
12732 /// # gax::client_builder::Result::<()>::Ok(()) });
12733 /// ```
12734 pub fn builder() -> super::builder::region_ssl_certificates::ClientBuilder {
12735 gax::client_builder::internal::new_builder(
12736 super::builder::region_ssl_certificates::client::Factory,
12737 )
12738 }
12739
12740 /// Creates a new client from the provided stub.
12741 ///
12742 /// The most common case for calling this function is in tests mocking the
12743 /// client's behavior.
12744 pub fn from_stub<T>(stub: T) -> Self
12745 where
12746 T: super::stub::RegionSslCertificates + 'static,
12747 {
12748 Self {
12749 inner: std::sync::Arc::new(stub),
12750 }
12751 }
12752
12753 pub(crate) async fn new(
12754 config: gaxi::options::ClientConfig,
12755 ) -> gax::client_builder::Result<Self> {
12756 let inner = Self::build_inner(config).await?;
12757 Ok(Self { inner })
12758 }
12759
12760 async fn build_inner(
12761 conf: gaxi::options::ClientConfig,
12762 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionSslCertificates>>
12763 {
12764 if gaxi::options::tracing_enabled(&conf) {
12765 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12766 }
12767 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12768 }
12769
12770 async fn build_transport(
12771 conf: gaxi::options::ClientConfig,
12772 ) -> gax::client_builder::Result<impl super::stub::RegionSslCertificates> {
12773 super::transport::RegionSslCertificates::new(conf).await
12774 }
12775
12776 async fn build_with_tracing(
12777 conf: gaxi::options::ClientConfig,
12778 ) -> gax::client_builder::Result<impl super::stub::RegionSslCertificates> {
12779 Self::build_transport(conf)
12780 .await
12781 .map(super::tracing::RegionSslCertificates::new)
12782 }
12783
12784 /// Deletes the specified SslCertificate resource in the region.
12785 pub fn delete(&self) -> super::builder::region_ssl_certificates::Delete {
12786 super::builder::region_ssl_certificates::Delete::new(self.inner.clone())
12787 }
12788
12789 /// Returns the specified SslCertificate resource in the specified region. Get
12790 /// a list of available SSL certificates by making a list()
12791 /// request.
12792 pub fn get(&self) -> super::builder::region_ssl_certificates::Get {
12793 super::builder::region_ssl_certificates::Get::new(self.inner.clone())
12794 }
12795
12796 /// Creates a SslCertificate resource in the specified project and region using
12797 /// the data included in the request
12798 pub fn insert(&self) -> super::builder::region_ssl_certificates::Insert {
12799 super::builder::region_ssl_certificates::Insert::new(self.inner.clone())
12800 }
12801
12802 /// Retrieves the list of SslCertificate resources available to the specified
12803 /// project in the specified region.
12804 pub fn list(&self) -> super::builder::region_ssl_certificates::List {
12805 super::builder::region_ssl_certificates::List::new(self.inner.clone())
12806 }
12807
12808 /// Retrieves the specified region-specific Operations resource.
12809 pub fn get_operation(&self) -> super::builder::region_ssl_certificates::GetOperation {
12810 super::builder::region_ssl_certificates::GetOperation::new(self.inner.clone())
12811 }
12812}
12813
12814/// Implements a client for the Google Compute Engine API.
12815///
12816/// # Example
12817/// ```
12818/// # tokio_test::block_on(async {
12819/// # use google_cloud_compute_v1::client::RegionSslPolicies;
12820/// let client = RegionSslPolicies::builder().build().await?;
12821/// // use `client` to make requests to the Google Compute Engine API.
12822/// # gax::client_builder::Result::<()>::Ok(()) });
12823/// ```
12824///
12825/// # Service Description
12826///
12827/// Service for the `regionSslPolicies` resource.
12828///
12829/// # Configuration
12830///
12831/// To configure `RegionSslPolicies` use the `with_*` methods in the type returned
12832/// by [builder()][RegionSslPolicies::builder]. The default configuration should
12833/// work for most applications. Common configuration changes include
12834///
12835/// * [with_endpoint()]: by default this client uses the global default endpoint
12836/// (`https://compute.googleapis.com`). Applications using regional
12837/// endpoints or running in restricted networks (e.g. a network configured
12838// with [Private Google Access with VPC Service Controls]) may want to
12839/// override this default.
12840/// * [with_credentials()]: by default this client uses
12841/// [Application Default Credentials]. Applications using custom
12842/// authentication may need to override this default.
12843///
12844/// [with_endpoint()]: super::builder::region_ssl_policies::ClientBuilder::with_endpoint
12845/// [with_credentials()]: super::builder::region_ssl_policies::ClientBuilder::credentials
12846/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12847/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12848///
12849/// # Pooling and Cloning
12850///
12851/// `RegionSslPolicies` holds a connection pool internally, it is advised to
12852/// create one and the reuse it. You do not need to wrap `RegionSslPolicies` in
12853/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12854/// already uses an `Arc` internally.
12855#[cfg(feature = "region-ssl-policies")]
12856#[cfg_attr(docsrs, doc(cfg(feature = "region-ssl-policies")))]
12857#[derive(Clone, Debug)]
12858pub struct RegionSslPolicies {
12859 inner: std::sync::Arc<dyn super::stub::dynamic::RegionSslPolicies>,
12860}
12861
12862#[cfg(feature = "region-ssl-policies")]
12863impl RegionSslPolicies {
12864 /// Returns a builder for [RegionSslPolicies].
12865 ///
12866 /// ```
12867 /// # tokio_test::block_on(async {
12868 /// # use google_cloud_compute_v1::client::RegionSslPolicies;
12869 /// let client = RegionSslPolicies::builder().build().await?;
12870 /// # gax::client_builder::Result::<()>::Ok(()) });
12871 /// ```
12872 pub fn builder() -> super::builder::region_ssl_policies::ClientBuilder {
12873 gax::client_builder::internal::new_builder(
12874 super::builder::region_ssl_policies::client::Factory,
12875 )
12876 }
12877
12878 /// Creates a new client from the provided stub.
12879 ///
12880 /// The most common case for calling this function is in tests mocking the
12881 /// client's behavior.
12882 pub fn from_stub<T>(stub: T) -> Self
12883 where
12884 T: super::stub::RegionSslPolicies + 'static,
12885 {
12886 Self {
12887 inner: std::sync::Arc::new(stub),
12888 }
12889 }
12890
12891 pub(crate) async fn new(
12892 config: gaxi::options::ClientConfig,
12893 ) -> gax::client_builder::Result<Self> {
12894 let inner = Self::build_inner(config).await?;
12895 Ok(Self { inner })
12896 }
12897
12898 async fn build_inner(
12899 conf: gaxi::options::ClientConfig,
12900 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionSslPolicies>>
12901 {
12902 if gaxi::options::tracing_enabled(&conf) {
12903 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12904 }
12905 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12906 }
12907
12908 async fn build_transport(
12909 conf: gaxi::options::ClientConfig,
12910 ) -> gax::client_builder::Result<impl super::stub::RegionSslPolicies> {
12911 super::transport::RegionSslPolicies::new(conf).await
12912 }
12913
12914 async fn build_with_tracing(
12915 conf: gaxi::options::ClientConfig,
12916 ) -> gax::client_builder::Result<impl super::stub::RegionSslPolicies> {
12917 Self::build_transport(conf)
12918 .await
12919 .map(super::tracing::RegionSslPolicies::new)
12920 }
12921
12922 /// Deletes the specified SSL policy. The SSL policy resource can be deleted
12923 /// only if it is not in use by any TargetHttpsProxy or TargetSslProxy
12924 /// resources.
12925 pub fn delete(&self) -> super::builder::region_ssl_policies::Delete {
12926 super::builder::region_ssl_policies::Delete::new(self.inner.clone())
12927 }
12928
12929 /// Lists all of the ordered rules present in a single specified policy.
12930 pub fn get(&self) -> super::builder::region_ssl_policies::Get {
12931 super::builder::region_ssl_policies::Get::new(self.inner.clone())
12932 }
12933
12934 /// Creates a new policy in the specified project and region using the data
12935 /// included in the request.
12936 pub fn insert(&self) -> super::builder::region_ssl_policies::Insert {
12937 super::builder::region_ssl_policies::Insert::new(self.inner.clone())
12938 }
12939
12940 /// Lists all the SSL policies that have been configured for the specified
12941 /// project and region.
12942 pub fn list(&self) -> super::builder::region_ssl_policies::List {
12943 super::builder::region_ssl_policies::List::new(self.inner.clone())
12944 }
12945
12946 /// Lists all features that can be specified in the SSL policy when using
12947 /// custom profile.
12948 pub fn list_available_features(
12949 &self,
12950 ) -> super::builder::region_ssl_policies::ListAvailableFeatures {
12951 super::builder::region_ssl_policies::ListAvailableFeatures::new(self.inner.clone())
12952 }
12953
12954 /// Patches the specified SSL policy with the data included in the request.
12955 pub fn patch(&self) -> super::builder::region_ssl_policies::Patch {
12956 super::builder::region_ssl_policies::Patch::new(self.inner.clone())
12957 }
12958
12959 /// Retrieves the specified region-specific Operations resource.
12960 pub fn get_operation(&self) -> super::builder::region_ssl_policies::GetOperation {
12961 super::builder::region_ssl_policies::GetOperation::new(self.inner.clone())
12962 }
12963}
12964
12965/// Implements a client for the Google Compute Engine API.
12966///
12967/// # Example
12968/// ```
12969/// # tokio_test::block_on(async {
12970/// # use google_cloud_compute_v1::client::RegionTargetHttpProxies;
12971/// let client = RegionTargetHttpProxies::builder().build().await?;
12972/// // use `client` to make requests to the Google Compute Engine API.
12973/// # gax::client_builder::Result::<()>::Ok(()) });
12974/// ```
12975///
12976/// # Service Description
12977///
12978/// Service for the `regionTargetHttpProxies` resource.
12979///
12980/// # Configuration
12981///
12982/// To configure `RegionTargetHttpProxies` use the `with_*` methods in the type returned
12983/// by [builder()][RegionTargetHttpProxies::builder]. The default configuration should
12984/// work for most applications. Common configuration changes include
12985///
12986/// * [with_endpoint()]: by default this client uses the global default endpoint
12987/// (`https://compute.googleapis.com`). Applications using regional
12988/// endpoints or running in restricted networks (e.g. a network configured
12989// with [Private Google Access with VPC Service Controls]) may want to
12990/// override this default.
12991/// * [with_credentials()]: by default this client uses
12992/// [Application Default Credentials]. Applications using custom
12993/// authentication may need to override this default.
12994///
12995/// [with_endpoint()]: super::builder::region_target_http_proxies::ClientBuilder::with_endpoint
12996/// [with_credentials()]: super::builder::region_target_http_proxies::ClientBuilder::credentials
12997/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12998/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12999///
13000/// # Pooling and Cloning
13001///
13002/// `RegionTargetHttpProxies` holds a connection pool internally, it is advised to
13003/// create one and the reuse it. You do not need to wrap `RegionTargetHttpProxies` in
13004/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13005/// already uses an `Arc` internally.
13006#[cfg(feature = "region-target-http-proxies")]
13007#[cfg_attr(docsrs, doc(cfg(feature = "region-target-http-proxies")))]
13008#[derive(Clone, Debug)]
13009pub struct RegionTargetHttpProxies {
13010 inner: std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpProxies>,
13011}
13012
13013#[cfg(feature = "region-target-http-proxies")]
13014impl RegionTargetHttpProxies {
13015 /// Returns a builder for [RegionTargetHttpProxies].
13016 ///
13017 /// ```
13018 /// # tokio_test::block_on(async {
13019 /// # use google_cloud_compute_v1::client::RegionTargetHttpProxies;
13020 /// let client = RegionTargetHttpProxies::builder().build().await?;
13021 /// # gax::client_builder::Result::<()>::Ok(()) });
13022 /// ```
13023 pub fn builder() -> super::builder::region_target_http_proxies::ClientBuilder {
13024 gax::client_builder::internal::new_builder(
13025 super::builder::region_target_http_proxies::client::Factory,
13026 )
13027 }
13028
13029 /// Creates a new client from the provided stub.
13030 ///
13031 /// The most common case for calling this function is in tests mocking the
13032 /// client's behavior.
13033 pub fn from_stub<T>(stub: T) -> Self
13034 where
13035 T: super::stub::RegionTargetHttpProxies + 'static,
13036 {
13037 Self {
13038 inner: std::sync::Arc::new(stub),
13039 }
13040 }
13041
13042 pub(crate) async fn new(
13043 config: gaxi::options::ClientConfig,
13044 ) -> gax::client_builder::Result<Self> {
13045 let inner = Self::build_inner(config).await?;
13046 Ok(Self { inner })
13047 }
13048
13049 async fn build_inner(
13050 conf: gaxi::options::ClientConfig,
13051 ) -> gax::client_builder::Result<
13052 std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpProxies>,
13053 > {
13054 if gaxi::options::tracing_enabled(&conf) {
13055 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13056 }
13057 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13058 }
13059
13060 async fn build_transport(
13061 conf: gaxi::options::ClientConfig,
13062 ) -> gax::client_builder::Result<impl super::stub::RegionTargetHttpProxies> {
13063 super::transport::RegionTargetHttpProxies::new(conf).await
13064 }
13065
13066 async fn build_with_tracing(
13067 conf: gaxi::options::ClientConfig,
13068 ) -> gax::client_builder::Result<impl super::stub::RegionTargetHttpProxies> {
13069 Self::build_transport(conf)
13070 .await
13071 .map(super::tracing::RegionTargetHttpProxies::new)
13072 }
13073
13074 /// Deletes the specified TargetHttpProxy resource.
13075 pub fn delete(&self) -> super::builder::region_target_http_proxies::Delete {
13076 super::builder::region_target_http_proxies::Delete::new(self.inner.clone())
13077 }
13078
13079 /// Returns the specified TargetHttpProxy resource in the specified region.
13080 pub fn get(&self) -> super::builder::region_target_http_proxies::Get {
13081 super::builder::region_target_http_proxies::Get::new(self.inner.clone())
13082 }
13083
13084 /// Creates a TargetHttpProxy resource in the specified project and region
13085 /// using the data included in the request.
13086 pub fn insert(&self) -> super::builder::region_target_http_proxies::Insert {
13087 super::builder::region_target_http_proxies::Insert::new(self.inner.clone())
13088 }
13089
13090 /// Retrieves the list of TargetHttpProxy resources available
13091 /// to the specified project in the specified region.
13092 pub fn list(&self) -> super::builder::region_target_http_proxies::List {
13093 super::builder::region_target_http_proxies::List::new(self.inner.clone())
13094 }
13095
13096 /// Changes the URL map for TargetHttpProxy.
13097 pub fn set_url_map(&self) -> super::builder::region_target_http_proxies::SetUrlMap {
13098 super::builder::region_target_http_proxies::SetUrlMap::new(self.inner.clone())
13099 }
13100
13101 /// Retrieves the specified region-specific Operations resource.
13102 pub fn get_operation(&self) -> super::builder::region_target_http_proxies::GetOperation {
13103 super::builder::region_target_http_proxies::GetOperation::new(self.inner.clone())
13104 }
13105}
13106
13107/// Implements a client for the Google Compute Engine API.
13108///
13109/// # Example
13110/// ```
13111/// # tokio_test::block_on(async {
13112/// # use google_cloud_compute_v1::client::RegionTargetHttpsProxies;
13113/// let client = RegionTargetHttpsProxies::builder().build().await?;
13114/// // use `client` to make requests to the Google Compute Engine API.
13115/// # gax::client_builder::Result::<()>::Ok(()) });
13116/// ```
13117///
13118/// # Service Description
13119///
13120/// Service for the `regionTargetHttpsProxies` resource.
13121///
13122/// # Configuration
13123///
13124/// To configure `RegionTargetHttpsProxies` use the `with_*` methods in the type returned
13125/// by [builder()][RegionTargetHttpsProxies::builder]. The default configuration should
13126/// work for most applications. Common configuration changes include
13127///
13128/// * [with_endpoint()]: by default this client uses the global default endpoint
13129/// (`https://compute.googleapis.com`). Applications using regional
13130/// endpoints or running in restricted networks (e.g. a network configured
13131// with [Private Google Access with VPC Service Controls]) may want to
13132/// override this default.
13133/// * [with_credentials()]: by default this client uses
13134/// [Application Default Credentials]. Applications using custom
13135/// authentication may need to override this default.
13136///
13137/// [with_endpoint()]: super::builder::region_target_https_proxies::ClientBuilder::with_endpoint
13138/// [with_credentials()]: super::builder::region_target_https_proxies::ClientBuilder::credentials
13139/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13140/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13141///
13142/// # Pooling and Cloning
13143///
13144/// `RegionTargetHttpsProxies` holds a connection pool internally, it is advised to
13145/// create one and the reuse it. You do not need to wrap `RegionTargetHttpsProxies` in
13146/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13147/// already uses an `Arc` internally.
13148#[cfg(feature = "region-target-https-proxies")]
13149#[cfg_attr(docsrs, doc(cfg(feature = "region-target-https-proxies")))]
13150#[derive(Clone, Debug)]
13151pub struct RegionTargetHttpsProxies {
13152 inner: std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpsProxies>,
13153}
13154
13155#[cfg(feature = "region-target-https-proxies")]
13156impl RegionTargetHttpsProxies {
13157 /// Returns a builder for [RegionTargetHttpsProxies].
13158 ///
13159 /// ```
13160 /// # tokio_test::block_on(async {
13161 /// # use google_cloud_compute_v1::client::RegionTargetHttpsProxies;
13162 /// let client = RegionTargetHttpsProxies::builder().build().await?;
13163 /// # gax::client_builder::Result::<()>::Ok(()) });
13164 /// ```
13165 pub fn builder() -> super::builder::region_target_https_proxies::ClientBuilder {
13166 gax::client_builder::internal::new_builder(
13167 super::builder::region_target_https_proxies::client::Factory,
13168 )
13169 }
13170
13171 /// Creates a new client from the provided stub.
13172 ///
13173 /// The most common case for calling this function is in tests mocking the
13174 /// client's behavior.
13175 pub fn from_stub<T>(stub: T) -> Self
13176 where
13177 T: super::stub::RegionTargetHttpsProxies + 'static,
13178 {
13179 Self {
13180 inner: std::sync::Arc::new(stub),
13181 }
13182 }
13183
13184 pub(crate) async fn new(
13185 config: gaxi::options::ClientConfig,
13186 ) -> gax::client_builder::Result<Self> {
13187 let inner = Self::build_inner(config).await?;
13188 Ok(Self { inner })
13189 }
13190
13191 async fn build_inner(
13192 conf: gaxi::options::ClientConfig,
13193 ) -> gax::client_builder::Result<
13194 std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpsProxies>,
13195 > {
13196 if gaxi::options::tracing_enabled(&conf) {
13197 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13198 }
13199 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13200 }
13201
13202 async fn build_transport(
13203 conf: gaxi::options::ClientConfig,
13204 ) -> gax::client_builder::Result<impl super::stub::RegionTargetHttpsProxies> {
13205 super::transport::RegionTargetHttpsProxies::new(conf).await
13206 }
13207
13208 async fn build_with_tracing(
13209 conf: gaxi::options::ClientConfig,
13210 ) -> gax::client_builder::Result<impl super::stub::RegionTargetHttpsProxies> {
13211 Self::build_transport(conf)
13212 .await
13213 .map(super::tracing::RegionTargetHttpsProxies::new)
13214 }
13215
13216 /// Deletes the specified TargetHttpsProxy resource.
13217 pub fn delete(&self) -> super::builder::region_target_https_proxies::Delete {
13218 super::builder::region_target_https_proxies::Delete::new(self.inner.clone())
13219 }
13220
13221 /// Returns the specified TargetHttpsProxy resource in the specified region.
13222 pub fn get(&self) -> super::builder::region_target_https_proxies::Get {
13223 super::builder::region_target_https_proxies::Get::new(self.inner.clone())
13224 }
13225
13226 /// Creates a TargetHttpsProxy resource in the specified project and region
13227 /// using the data included in the request.
13228 pub fn insert(&self) -> super::builder::region_target_https_proxies::Insert {
13229 super::builder::region_target_https_proxies::Insert::new(self.inner.clone())
13230 }
13231
13232 /// Retrieves the list of TargetHttpsProxy resources available
13233 /// to the specified project in the specified region.
13234 pub fn list(&self) -> super::builder::region_target_https_proxies::List {
13235 super::builder::region_target_https_proxies::List::new(self.inner.clone())
13236 }
13237
13238 /// Patches the specified regional TargetHttpsProxy resource with the data
13239 /// included in the request. This method supports PATCH
13240 /// semantics and usesJSON merge
13241 /// patch format and processing rules.
13242 pub fn patch(&self) -> super::builder::region_target_https_proxies::Patch {
13243 super::builder::region_target_https_proxies::Patch::new(self.inner.clone())
13244 }
13245
13246 /// Replaces SslCertificates for TargetHttpsProxy.
13247 pub fn set_ssl_certificates(
13248 &self,
13249 ) -> super::builder::region_target_https_proxies::SetSslCertificates {
13250 super::builder::region_target_https_proxies::SetSslCertificates::new(self.inner.clone())
13251 }
13252
13253 /// Changes the URL map for TargetHttpsProxy.
13254 pub fn set_url_map(&self) -> super::builder::region_target_https_proxies::SetUrlMap {
13255 super::builder::region_target_https_proxies::SetUrlMap::new(self.inner.clone())
13256 }
13257
13258 /// Retrieves the specified region-specific Operations resource.
13259 pub fn get_operation(&self) -> super::builder::region_target_https_proxies::GetOperation {
13260 super::builder::region_target_https_proxies::GetOperation::new(self.inner.clone())
13261 }
13262}
13263
13264/// Implements a client for the Google Compute Engine API.
13265///
13266/// # Example
13267/// ```
13268/// # tokio_test::block_on(async {
13269/// # use google_cloud_compute_v1::client::RegionTargetTcpProxies;
13270/// let client = RegionTargetTcpProxies::builder().build().await?;
13271/// // use `client` to make requests to the Google Compute Engine API.
13272/// # gax::client_builder::Result::<()>::Ok(()) });
13273/// ```
13274///
13275/// # Service Description
13276///
13277/// Service for the `regionTargetTcpProxies` resource.
13278///
13279/// # Configuration
13280///
13281/// To configure `RegionTargetTcpProxies` use the `with_*` methods in the type returned
13282/// by [builder()][RegionTargetTcpProxies::builder]. The default configuration should
13283/// work for most applications. Common configuration changes include
13284///
13285/// * [with_endpoint()]: by default this client uses the global default endpoint
13286/// (`https://compute.googleapis.com`). Applications using regional
13287/// endpoints or running in restricted networks (e.g. a network configured
13288// with [Private Google Access with VPC Service Controls]) may want to
13289/// override this default.
13290/// * [with_credentials()]: by default this client uses
13291/// [Application Default Credentials]. Applications using custom
13292/// authentication may need to override this default.
13293///
13294/// [with_endpoint()]: super::builder::region_target_tcp_proxies::ClientBuilder::with_endpoint
13295/// [with_credentials()]: super::builder::region_target_tcp_proxies::ClientBuilder::credentials
13296/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13297/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13298///
13299/// # Pooling and Cloning
13300///
13301/// `RegionTargetTcpProxies` holds a connection pool internally, it is advised to
13302/// create one and the reuse it. You do not need to wrap `RegionTargetTcpProxies` in
13303/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13304/// already uses an `Arc` internally.
13305#[cfg(feature = "region-target-tcp-proxies")]
13306#[cfg_attr(docsrs, doc(cfg(feature = "region-target-tcp-proxies")))]
13307#[derive(Clone, Debug)]
13308pub struct RegionTargetTcpProxies {
13309 inner: std::sync::Arc<dyn super::stub::dynamic::RegionTargetTcpProxies>,
13310}
13311
13312#[cfg(feature = "region-target-tcp-proxies")]
13313impl RegionTargetTcpProxies {
13314 /// Returns a builder for [RegionTargetTcpProxies].
13315 ///
13316 /// ```
13317 /// # tokio_test::block_on(async {
13318 /// # use google_cloud_compute_v1::client::RegionTargetTcpProxies;
13319 /// let client = RegionTargetTcpProxies::builder().build().await?;
13320 /// # gax::client_builder::Result::<()>::Ok(()) });
13321 /// ```
13322 pub fn builder() -> super::builder::region_target_tcp_proxies::ClientBuilder {
13323 gax::client_builder::internal::new_builder(
13324 super::builder::region_target_tcp_proxies::client::Factory,
13325 )
13326 }
13327
13328 /// Creates a new client from the provided stub.
13329 ///
13330 /// The most common case for calling this function is in tests mocking the
13331 /// client's behavior.
13332 pub fn from_stub<T>(stub: T) -> Self
13333 where
13334 T: super::stub::RegionTargetTcpProxies + 'static,
13335 {
13336 Self {
13337 inner: std::sync::Arc::new(stub),
13338 }
13339 }
13340
13341 pub(crate) async fn new(
13342 config: gaxi::options::ClientConfig,
13343 ) -> gax::client_builder::Result<Self> {
13344 let inner = Self::build_inner(config).await?;
13345 Ok(Self { inner })
13346 }
13347
13348 async fn build_inner(
13349 conf: gaxi::options::ClientConfig,
13350 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionTargetTcpProxies>>
13351 {
13352 if gaxi::options::tracing_enabled(&conf) {
13353 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13354 }
13355 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13356 }
13357
13358 async fn build_transport(
13359 conf: gaxi::options::ClientConfig,
13360 ) -> gax::client_builder::Result<impl super::stub::RegionTargetTcpProxies> {
13361 super::transport::RegionTargetTcpProxies::new(conf).await
13362 }
13363
13364 async fn build_with_tracing(
13365 conf: gaxi::options::ClientConfig,
13366 ) -> gax::client_builder::Result<impl super::stub::RegionTargetTcpProxies> {
13367 Self::build_transport(conf)
13368 .await
13369 .map(super::tracing::RegionTargetTcpProxies::new)
13370 }
13371
13372 /// Deletes the specified TargetTcpProxy resource.
13373 pub fn delete(&self) -> super::builder::region_target_tcp_proxies::Delete {
13374 super::builder::region_target_tcp_proxies::Delete::new(self.inner.clone())
13375 }
13376
13377 /// Returns the specified TargetTcpProxy resource.
13378 pub fn get(&self) -> super::builder::region_target_tcp_proxies::Get {
13379 super::builder::region_target_tcp_proxies::Get::new(self.inner.clone())
13380 }
13381
13382 /// Creates a TargetTcpProxy resource in the specified project and region using
13383 /// the data included in the request.
13384 pub fn insert(&self) -> super::builder::region_target_tcp_proxies::Insert {
13385 super::builder::region_target_tcp_proxies::Insert::new(self.inner.clone())
13386 }
13387
13388 /// Retrieves a list of TargetTcpProxy resources
13389 /// available to the specified project in a given region.
13390 pub fn list(&self) -> super::builder::region_target_tcp_proxies::List {
13391 super::builder::region_target_tcp_proxies::List::new(self.inner.clone())
13392 }
13393
13394 /// Retrieves the specified region-specific Operations resource.
13395 pub fn get_operation(&self) -> super::builder::region_target_tcp_proxies::GetOperation {
13396 super::builder::region_target_tcp_proxies::GetOperation::new(self.inner.clone())
13397 }
13398}
13399
13400/// Implements a client for the Google Compute Engine API.
13401///
13402/// # Example
13403/// ```
13404/// # tokio_test::block_on(async {
13405/// # use google_cloud_compute_v1::client::RegionUrlMaps;
13406/// let client = RegionUrlMaps::builder().build().await?;
13407/// // use `client` to make requests to the Google Compute Engine API.
13408/// # gax::client_builder::Result::<()>::Ok(()) });
13409/// ```
13410///
13411/// # Service Description
13412///
13413/// Service for the `regionUrlMaps` resource.
13414///
13415/// # Configuration
13416///
13417/// To configure `RegionUrlMaps` use the `with_*` methods in the type returned
13418/// by [builder()][RegionUrlMaps::builder]. The default configuration should
13419/// work for most applications. Common configuration changes include
13420///
13421/// * [with_endpoint()]: by default this client uses the global default endpoint
13422/// (`https://compute.googleapis.com`). Applications using regional
13423/// endpoints or running in restricted networks (e.g. a network configured
13424// with [Private Google Access with VPC Service Controls]) may want to
13425/// override this default.
13426/// * [with_credentials()]: by default this client uses
13427/// [Application Default Credentials]. Applications using custom
13428/// authentication may need to override this default.
13429///
13430/// [with_endpoint()]: super::builder::region_url_maps::ClientBuilder::with_endpoint
13431/// [with_credentials()]: super::builder::region_url_maps::ClientBuilder::credentials
13432/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13433/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13434///
13435/// # Pooling and Cloning
13436///
13437/// `RegionUrlMaps` holds a connection pool internally, it is advised to
13438/// create one and the reuse it. You do not need to wrap `RegionUrlMaps` in
13439/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13440/// already uses an `Arc` internally.
13441#[cfg(feature = "region-url-maps")]
13442#[cfg_attr(docsrs, doc(cfg(feature = "region-url-maps")))]
13443#[derive(Clone, Debug)]
13444pub struct RegionUrlMaps {
13445 inner: std::sync::Arc<dyn super::stub::dynamic::RegionUrlMaps>,
13446}
13447
13448#[cfg(feature = "region-url-maps")]
13449impl RegionUrlMaps {
13450 /// Returns a builder for [RegionUrlMaps].
13451 ///
13452 /// ```
13453 /// # tokio_test::block_on(async {
13454 /// # use google_cloud_compute_v1::client::RegionUrlMaps;
13455 /// let client = RegionUrlMaps::builder().build().await?;
13456 /// # gax::client_builder::Result::<()>::Ok(()) });
13457 /// ```
13458 pub fn builder() -> super::builder::region_url_maps::ClientBuilder {
13459 gax::client_builder::internal::new_builder(super::builder::region_url_maps::client::Factory)
13460 }
13461
13462 /// Creates a new client from the provided stub.
13463 ///
13464 /// The most common case for calling this function is in tests mocking the
13465 /// client's behavior.
13466 pub fn from_stub<T>(stub: T) -> Self
13467 where
13468 T: super::stub::RegionUrlMaps + 'static,
13469 {
13470 Self {
13471 inner: std::sync::Arc::new(stub),
13472 }
13473 }
13474
13475 pub(crate) async fn new(
13476 config: gaxi::options::ClientConfig,
13477 ) -> gax::client_builder::Result<Self> {
13478 let inner = Self::build_inner(config).await?;
13479 Ok(Self { inner })
13480 }
13481
13482 async fn build_inner(
13483 conf: gaxi::options::ClientConfig,
13484 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionUrlMaps>> {
13485 if gaxi::options::tracing_enabled(&conf) {
13486 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13487 }
13488 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13489 }
13490
13491 async fn build_transport(
13492 conf: gaxi::options::ClientConfig,
13493 ) -> gax::client_builder::Result<impl super::stub::RegionUrlMaps> {
13494 super::transport::RegionUrlMaps::new(conf).await
13495 }
13496
13497 async fn build_with_tracing(
13498 conf: gaxi::options::ClientConfig,
13499 ) -> gax::client_builder::Result<impl super::stub::RegionUrlMaps> {
13500 Self::build_transport(conf)
13501 .await
13502 .map(super::tracing::RegionUrlMaps::new)
13503 }
13504
13505 /// Deletes the specified UrlMap resource.
13506 pub fn delete(&self) -> super::builder::region_url_maps::Delete {
13507 super::builder::region_url_maps::Delete::new(self.inner.clone())
13508 }
13509
13510 /// Returns the specified UrlMap resource.
13511 pub fn get(&self) -> super::builder::region_url_maps::Get {
13512 super::builder::region_url_maps::Get::new(self.inner.clone())
13513 }
13514
13515 /// Creates a UrlMap resource in the specified project using
13516 /// the data included in the request.
13517 pub fn insert(&self) -> super::builder::region_url_maps::Insert {
13518 super::builder::region_url_maps::Insert::new(self.inner.clone())
13519 }
13520
13521 /// Retrieves the list of UrlMap resources available to the specified
13522 /// project in the specified region.
13523 pub fn list(&self) -> super::builder::region_url_maps::List {
13524 super::builder::region_url_maps::List::new(self.inner.clone())
13525 }
13526
13527 /// Patches the specified UrlMap resource with the data included in the
13528 /// request. This method supportsPATCH
13529 /// semantics and usesJSON merge
13530 /// patch format and processing rules.
13531 pub fn patch(&self) -> super::builder::region_url_maps::Patch {
13532 super::builder::region_url_maps::Patch::new(self.inner.clone())
13533 }
13534
13535 /// Updates the specified UrlMap resource with the data included in the
13536 /// request.
13537 pub fn update(&self) -> super::builder::region_url_maps::Update {
13538 super::builder::region_url_maps::Update::new(self.inner.clone())
13539 }
13540
13541 /// Runs static validation for the UrlMap. In particular, the tests of the
13542 /// provided UrlMap will be run. Calling this method does NOT create the
13543 /// UrlMap.
13544 pub fn validate(&self) -> super::builder::region_url_maps::Validate {
13545 super::builder::region_url_maps::Validate::new(self.inner.clone())
13546 }
13547
13548 /// Retrieves the specified region-specific Operations resource.
13549 pub fn get_operation(&self) -> super::builder::region_url_maps::GetOperation {
13550 super::builder::region_url_maps::GetOperation::new(self.inner.clone())
13551 }
13552}
13553
13554/// Implements a client for the Google Compute Engine API.
13555///
13556/// # Example
13557/// ```
13558/// # tokio_test::block_on(async {
13559/// # use google_cloud_compute_v1::client::RegionZones;
13560/// let client = RegionZones::builder().build().await?;
13561/// // use `client` to make requests to the Google Compute Engine API.
13562/// # gax::client_builder::Result::<()>::Ok(()) });
13563/// ```
13564///
13565/// # Service Description
13566///
13567/// Service for the `regionZones` resource.
13568///
13569/// # Configuration
13570///
13571/// To configure `RegionZones` use the `with_*` methods in the type returned
13572/// by [builder()][RegionZones::builder]. The default configuration should
13573/// work for most applications. Common configuration changes include
13574///
13575/// * [with_endpoint()]: by default this client uses the global default endpoint
13576/// (`https://compute.googleapis.com`). Applications using regional
13577/// endpoints or running in restricted networks (e.g. a network configured
13578// with [Private Google Access with VPC Service Controls]) may want to
13579/// override this default.
13580/// * [with_credentials()]: by default this client uses
13581/// [Application Default Credentials]. Applications using custom
13582/// authentication may need to override this default.
13583///
13584/// [with_endpoint()]: super::builder::region_zones::ClientBuilder::with_endpoint
13585/// [with_credentials()]: super::builder::region_zones::ClientBuilder::credentials
13586/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13587/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13588///
13589/// # Pooling and Cloning
13590///
13591/// `RegionZones` holds a connection pool internally, it is advised to
13592/// create one and the reuse it. You do not need to wrap `RegionZones` in
13593/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13594/// already uses an `Arc` internally.
13595#[cfg(feature = "region-zones")]
13596#[cfg_attr(docsrs, doc(cfg(feature = "region-zones")))]
13597#[derive(Clone, Debug)]
13598pub struct RegionZones {
13599 inner: std::sync::Arc<dyn super::stub::dynamic::RegionZones>,
13600}
13601
13602#[cfg(feature = "region-zones")]
13603impl RegionZones {
13604 /// Returns a builder for [RegionZones].
13605 ///
13606 /// ```
13607 /// # tokio_test::block_on(async {
13608 /// # use google_cloud_compute_v1::client::RegionZones;
13609 /// let client = RegionZones::builder().build().await?;
13610 /// # gax::client_builder::Result::<()>::Ok(()) });
13611 /// ```
13612 pub fn builder() -> super::builder::region_zones::ClientBuilder {
13613 gax::client_builder::internal::new_builder(super::builder::region_zones::client::Factory)
13614 }
13615
13616 /// Creates a new client from the provided stub.
13617 ///
13618 /// The most common case for calling this function is in tests mocking the
13619 /// client's behavior.
13620 pub fn from_stub<T>(stub: T) -> Self
13621 where
13622 T: super::stub::RegionZones + 'static,
13623 {
13624 Self {
13625 inner: std::sync::Arc::new(stub),
13626 }
13627 }
13628
13629 pub(crate) async fn new(
13630 config: gaxi::options::ClientConfig,
13631 ) -> gax::client_builder::Result<Self> {
13632 let inner = Self::build_inner(config).await?;
13633 Ok(Self { inner })
13634 }
13635
13636 async fn build_inner(
13637 conf: gaxi::options::ClientConfig,
13638 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::RegionZones>> {
13639 if gaxi::options::tracing_enabled(&conf) {
13640 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13641 }
13642 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13643 }
13644
13645 async fn build_transport(
13646 conf: gaxi::options::ClientConfig,
13647 ) -> gax::client_builder::Result<impl super::stub::RegionZones> {
13648 super::transport::RegionZones::new(conf).await
13649 }
13650
13651 async fn build_with_tracing(
13652 conf: gaxi::options::ClientConfig,
13653 ) -> gax::client_builder::Result<impl super::stub::RegionZones> {
13654 Self::build_transport(conf)
13655 .await
13656 .map(super::tracing::RegionZones::new)
13657 }
13658
13659 /// Retrieves the list of Zone resources under the specific region available to
13660 /// the specified project.
13661 pub fn list(&self) -> super::builder::region_zones::List {
13662 super::builder::region_zones::List::new(self.inner.clone())
13663 }
13664}
13665
13666/// Implements a client for the Google Compute Engine API.
13667///
13668/// # Example
13669/// ```
13670/// # tokio_test::block_on(async {
13671/// # use google_cloud_compute_v1::client::Regions;
13672/// let client = Regions::builder().build().await?;
13673/// // use `client` to make requests to the Google Compute Engine API.
13674/// # gax::client_builder::Result::<()>::Ok(()) });
13675/// ```
13676///
13677/// # Service Description
13678///
13679/// Service for the `regions` resource.
13680///
13681/// # Configuration
13682///
13683/// To configure `Regions` use the `with_*` methods in the type returned
13684/// by [builder()][Regions::builder]. The default configuration should
13685/// work for most applications. Common configuration changes include
13686///
13687/// * [with_endpoint()]: by default this client uses the global default endpoint
13688/// (`https://compute.googleapis.com`). Applications using regional
13689/// endpoints or running in restricted networks (e.g. a network configured
13690// with [Private Google Access with VPC Service Controls]) may want to
13691/// override this default.
13692/// * [with_credentials()]: by default this client uses
13693/// [Application Default Credentials]. Applications using custom
13694/// authentication may need to override this default.
13695///
13696/// [with_endpoint()]: super::builder::regions::ClientBuilder::with_endpoint
13697/// [with_credentials()]: super::builder::regions::ClientBuilder::credentials
13698/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13699/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13700///
13701/// # Pooling and Cloning
13702///
13703/// `Regions` holds a connection pool internally, it is advised to
13704/// create one and the reuse it. You do not need to wrap `Regions` in
13705/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13706/// already uses an `Arc` internally.
13707#[cfg(feature = "regions")]
13708#[cfg_attr(docsrs, doc(cfg(feature = "regions")))]
13709#[derive(Clone, Debug)]
13710pub struct Regions {
13711 inner: std::sync::Arc<dyn super::stub::dynamic::Regions>,
13712}
13713
13714#[cfg(feature = "regions")]
13715impl Regions {
13716 /// Returns a builder for [Regions].
13717 ///
13718 /// ```
13719 /// # tokio_test::block_on(async {
13720 /// # use google_cloud_compute_v1::client::Regions;
13721 /// let client = Regions::builder().build().await?;
13722 /// # gax::client_builder::Result::<()>::Ok(()) });
13723 /// ```
13724 pub fn builder() -> super::builder::regions::ClientBuilder {
13725 gax::client_builder::internal::new_builder(super::builder::regions::client::Factory)
13726 }
13727
13728 /// Creates a new client from the provided stub.
13729 ///
13730 /// The most common case for calling this function is in tests mocking the
13731 /// client's behavior.
13732 pub fn from_stub<T>(stub: T) -> Self
13733 where
13734 T: super::stub::Regions + 'static,
13735 {
13736 Self {
13737 inner: std::sync::Arc::new(stub),
13738 }
13739 }
13740
13741 pub(crate) async fn new(
13742 config: gaxi::options::ClientConfig,
13743 ) -> gax::client_builder::Result<Self> {
13744 let inner = Self::build_inner(config).await?;
13745 Ok(Self { inner })
13746 }
13747
13748 async fn build_inner(
13749 conf: gaxi::options::ClientConfig,
13750 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Regions>> {
13751 if gaxi::options::tracing_enabled(&conf) {
13752 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13753 }
13754 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13755 }
13756
13757 async fn build_transport(
13758 conf: gaxi::options::ClientConfig,
13759 ) -> gax::client_builder::Result<impl super::stub::Regions> {
13760 super::transport::Regions::new(conf).await
13761 }
13762
13763 async fn build_with_tracing(
13764 conf: gaxi::options::ClientConfig,
13765 ) -> gax::client_builder::Result<impl super::stub::Regions> {
13766 Self::build_transport(conf)
13767 .await
13768 .map(super::tracing::Regions::new)
13769 }
13770
13771 /// Returns the specified Region resource.
13772 ///
13773 /// To decrease latency for this method, you can optionally omit any unneeded
13774 /// information from the response by using a field mask. This practice is
13775 /// especially recommended for unused quota information (the `quotas` field).
13776 /// To exclude one or more fields, set your request's `fields` query parameter
13777 /// to only include the fields you need. For example, to only include the `id`
13778 /// and `selfLink` fields, add the query parameter `?fields=id,selfLink` to
13779 /// your request.
13780 ///
13781 /// This method fails if the quota information is unavailable for the region
13782 /// and if the organization policy constraint
13783 /// compute.requireBasicQuotaInResponse is enforced. This
13784 /// constraint, when enforced, disables the fail-open behaviour when quota
13785 /// information (the `items.quotas` field) is unavailable for the region.
13786 /// It is recommended to use the default setting
13787 /// for the constraint unless your application requires the fail-closed
13788 /// behaviour for this method.
13789 pub fn get(&self) -> super::builder::regions::Get {
13790 super::builder::regions::Get::new(self.inner.clone())
13791 }
13792
13793 /// Retrieves the list of region resources available to the specified project.
13794 ///
13795 /// To decrease latency for this method, you can optionally omit any unneeded
13796 /// information from the response by using a field mask. This practice is
13797 /// especially recommended for unused quota information
13798 /// (the `items.quotas` field).
13799 /// To exclude one or more fields, set your request's `fields` query parameter
13800 /// to only include the fields you need. For example, to only include the `id`
13801 /// and `selfLink` fields, add the query parameter `?fields=id,selfLink` to
13802 /// your request.
13803 ///
13804 /// This method fails if the quota information is unavailable for the region
13805 /// and if the organization policy constraint
13806 /// compute.requireBasicQuotaInResponse is enforced. This
13807 /// constraint, when enforced, disables the fail-open behaviour when quota
13808 /// information (the `items.quotas` field) is unavailable for the region.
13809 /// It is recommended to use the default setting
13810 /// for the constraint unless your application requires the fail-closed
13811 /// behaviour for this method.
13812 pub fn list(&self) -> super::builder::regions::List {
13813 super::builder::regions::List::new(self.inner.clone())
13814 }
13815}
13816
13817/// Implements a client for the Google Compute Engine API.
13818///
13819/// # Example
13820/// ```
13821/// # tokio_test::block_on(async {
13822/// # use google_cloud_compute_v1::client::ReservationBlocks;
13823/// let client = ReservationBlocks::builder().build().await?;
13824/// // use `client` to make requests to the Google Compute Engine API.
13825/// # gax::client_builder::Result::<()>::Ok(()) });
13826/// ```
13827///
13828/// # Service Description
13829///
13830/// Service for the `reservationBlocks` resource.
13831///
13832/// # Configuration
13833///
13834/// To configure `ReservationBlocks` use the `with_*` methods in the type returned
13835/// by [builder()][ReservationBlocks::builder]. The default configuration should
13836/// work for most applications. Common configuration changes include
13837///
13838/// * [with_endpoint()]: by default this client uses the global default endpoint
13839/// (`https://compute.googleapis.com`). Applications using regional
13840/// endpoints or running in restricted networks (e.g. a network configured
13841// with [Private Google Access with VPC Service Controls]) may want to
13842/// override this default.
13843/// * [with_credentials()]: by default this client uses
13844/// [Application Default Credentials]. Applications using custom
13845/// authentication may need to override this default.
13846///
13847/// [with_endpoint()]: super::builder::reservation_blocks::ClientBuilder::with_endpoint
13848/// [with_credentials()]: super::builder::reservation_blocks::ClientBuilder::credentials
13849/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13850/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13851///
13852/// # Pooling and Cloning
13853///
13854/// `ReservationBlocks` holds a connection pool internally, it is advised to
13855/// create one and the reuse it. You do not need to wrap `ReservationBlocks` in
13856/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13857/// already uses an `Arc` internally.
13858#[cfg(feature = "reservation-blocks")]
13859#[cfg_attr(docsrs, doc(cfg(feature = "reservation-blocks")))]
13860#[derive(Clone, Debug)]
13861pub struct ReservationBlocks {
13862 inner: std::sync::Arc<dyn super::stub::dynamic::ReservationBlocks>,
13863}
13864
13865#[cfg(feature = "reservation-blocks")]
13866impl ReservationBlocks {
13867 /// Returns a builder for [ReservationBlocks].
13868 ///
13869 /// ```
13870 /// # tokio_test::block_on(async {
13871 /// # use google_cloud_compute_v1::client::ReservationBlocks;
13872 /// let client = ReservationBlocks::builder().build().await?;
13873 /// # gax::client_builder::Result::<()>::Ok(()) });
13874 /// ```
13875 pub fn builder() -> super::builder::reservation_blocks::ClientBuilder {
13876 gax::client_builder::internal::new_builder(
13877 super::builder::reservation_blocks::client::Factory,
13878 )
13879 }
13880
13881 /// Creates a new client from the provided stub.
13882 ///
13883 /// The most common case for calling this function is in tests mocking the
13884 /// client's behavior.
13885 pub fn from_stub<T>(stub: T) -> Self
13886 where
13887 T: super::stub::ReservationBlocks + 'static,
13888 {
13889 Self {
13890 inner: std::sync::Arc::new(stub),
13891 }
13892 }
13893
13894 pub(crate) async fn new(
13895 config: gaxi::options::ClientConfig,
13896 ) -> gax::client_builder::Result<Self> {
13897 let inner = Self::build_inner(config).await?;
13898 Ok(Self { inner })
13899 }
13900
13901 async fn build_inner(
13902 conf: gaxi::options::ClientConfig,
13903 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::ReservationBlocks>>
13904 {
13905 if gaxi::options::tracing_enabled(&conf) {
13906 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13907 }
13908 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13909 }
13910
13911 async fn build_transport(
13912 conf: gaxi::options::ClientConfig,
13913 ) -> gax::client_builder::Result<impl super::stub::ReservationBlocks> {
13914 super::transport::ReservationBlocks::new(conf).await
13915 }
13916
13917 async fn build_with_tracing(
13918 conf: gaxi::options::ClientConfig,
13919 ) -> gax::client_builder::Result<impl super::stub::ReservationBlocks> {
13920 Self::build_transport(conf)
13921 .await
13922 .map(super::tracing::ReservationBlocks::new)
13923 }
13924
13925 /// Retrieves information about the specified reservation block.
13926 pub fn get(&self) -> super::builder::reservation_blocks::Get {
13927 super::builder::reservation_blocks::Get::new(self.inner.clone())
13928 }
13929
13930 /// Gets the access control policy for a resource. May be empty if no such
13931 /// policy or resource exists.
13932 pub fn get_iam_policy(&self) -> super::builder::reservation_blocks::GetIamPolicy {
13933 super::builder::reservation_blocks::GetIamPolicy::new(self.inner.clone())
13934 }
13935
13936 /// Retrieves a list of reservation blocks under a single reservation.
13937 pub fn list(&self) -> super::builder::reservation_blocks::List {
13938 super::builder::reservation_blocks::List::new(self.inner.clone())
13939 }
13940
13941 /// Allows customers to perform maintenance on a reservation block
13942 pub fn perform_maintenance(&self) -> super::builder::reservation_blocks::PerformMaintenance {
13943 super::builder::reservation_blocks::PerformMaintenance::new(self.inner.clone())
13944 }
13945
13946 /// Sets the access control policy on the specified resource.
13947 /// Replaces any existing policy.
13948 pub fn set_iam_policy(&self) -> super::builder::reservation_blocks::SetIamPolicy {
13949 super::builder::reservation_blocks::SetIamPolicy::new(self.inner.clone())
13950 }
13951
13952 /// Returns permissions that a caller has on the specified resource.
13953 pub fn test_iam_permissions(&self) -> super::builder::reservation_blocks::TestIamPermissions {
13954 super::builder::reservation_blocks::TestIamPermissions::new(self.inner.clone())
13955 }
13956
13957 /// Retrieves the specified zone-specific Operations resource.
13958 pub fn get_operation(&self) -> super::builder::reservation_blocks::GetOperation {
13959 super::builder::reservation_blocks::GetOperation::new(self.inner.clone())
13960 }
13961}
13962
13963/// Implements a client for the Google Compute Engine API.
13964///
13965/// # Example
13966/// ```
13967/// # tokio_test::block_on(async {
13968/// # use google_cloud_compute_v1::client::ReservationSubBlocks;
13969/// let client = ReservationSubBlocks::builder().build().await?;
13970/// // use `client` to make requests to the Google Compute Engine API.
13971/// # gax::client_builder::Result::<()>::Ok(()) });
13972/// ```
13973///
13974/// # Service Description
13975///
13976/// Service for the `reservationSubBlocks` resource.
13977///
13978/// # Configuration
13979///
13980/// To configure `ReservationSubBlocks` use the `with_*` methods in the type returned
13981/// by [builder()][ReservationSubBlocks::builder]. The default configuration should
13982/// work for most applications. Common configuration changes include
13983///
13984/// * [with_endpoint()]: by default this client uses the global default endpoint
13985/// (`https://compute.googleapis.com`). Applications using regional
13986/// endpoints or running in restricted networks (e.g. a network configured
13987// with [Private Google Access with VPC Service Controls]) may want to
13988/// override this default.
13989/// * [with_credentials()]: by default this client uses
13990/// [Application Default Credentials]. Applications using custom
13991/// authentication may need to override this default.
13992///
13993/// [with_endpoint()]: super::builder::reservation_sub_blocks::ClientBuilder::with_endpoint
13994/// [with_credentials()]: super::builder::reservation_sub_blocks::ClientBuilder::credentials
13995/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13996/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13997///
13998/// # Pooling and Cloning
13999///
14000/// `ReservationSubBlocks` holds a connection pool internally, it is advised to
14001/// create one and the reuse it. You do not need to wrap `ReservationSubBlocks` in
14002/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14003/// already uses an `Arc` internally.
14004#[cfg(feature = "reservation-sub-blocks")]
14005#[cfg_attr(docsrs, doc(cfg(feature = "reservation-sub-blocks")))]
14006#[derive(Clone, Debug)]
14007pub struct ReservationSubBlocks {
14008 inner: std::sync::Arc<dyn super::stub::dynamic::ReservationSubBlocks>,
14009}
14010
14011#[cfg(feature = "reservation-sub-blocks")]
14012impl ReservationSubBlocks {
14013 /// Returns a builder for [ReservationSubBlocks].
14014 ///
14015 /// ```
14016 /// # tokio_test::block_on(async {
14017 /// # use google_cloud_compute_v1::client::ReservationSubBlocks;
14018 /// let client = ReservationSubBlocks::builder().build().await?;
14019 /// # gax::client_builder::Result::<()>::Ok(()) });
14020 /// ```
14021 pub fn builder() -> super::builder::reservation_sub_blocks::ClientBuilder {
14022 gax::client_builder::internal::new_builder(
14023 super::builder::reservation_sub_blocks::client::Factory,
14024 )
14025 }
14026
14027 /// Creates a new client from the provided stub.
14028 ///
14029 /// The most common case for calling this function is in tests mocking the
14030 /// client's behavior.
14031 pub fn from_stub<T>(stub: T) -> Self
14032 where
14033 T: super::stub::ReservationSubBlocks + 'static,
14034 {
14035 Self {
14036 inner: std::sync::Arc::new(stub),
14037 }
14038 }
14039
14040 pub(crate) async fn new(
14041 config: gaxi::options::ClientConfig,
14042 ) -> gax::client_builder::Result<Self> {
14043 let inner = Self::build_inner(config).await?;
14044 Ok(Self { inner })
14045 }
14046
14047 async fn build_inner(
14048 conf: gaxi::options::ClientConfig,
14049 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::ReservationSubBlocks>>
14050 {
14051 if gaxi::options::tracing_enabled(&conf) {
14052 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14053 }
14054 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14055 }
14056
14057 async fn build_transport(
14058 conf: gaxi::options::ClientConfig,
14059 ) -> gax::client_builder::Result<impl super::stub::ReservationSubBlocks> {
14060 super::transport::ReservationSubBlocks::new(conf).await
14061 }
14062
14063 async fn build_with_tracing(
14064 conf: gaxi::options::ClientConfig,
14065 ) -> gax::client_builder::Result<impl super::stub::ReservationSubBlocks> {
14066 Self::build_transport(conf)
14067 .await
14068 .map(super::tracing::ReservationSubBlocks::new)
14069 }
14070
14071 /// Retrieves information about the specified reservation subBlock.
14072 pub fn get(&self) -> super::builder::reservation_sub_blocks::Get {
14073 super::builder::reservation_sub_blocks::Get::new(self.inner.clone())
14074 }
14075
14076 /// Gets the access control policy for a resource. May be empty if no such
14077 /// policy or resource exists.
14078 pub fn get_iam_policy(&self) -> super::builder::reservation_sub_blocks::GetIamPolicy {
14079 super::builder::reservation_sub_blocks::GetIamPolicy::new(self.inner.clone())
14080 }
14081
14082 /// Retrieves a list of reservation subBlocks under a single reservation.
14083 pub fn list(&self) -> super::builder::reservation_sub_blocks::List {
14084 super::builder::reservation_sub_blocks::List::new(self.inner.clone())
14085 }
14086
14087 /// Allows customers to perform maintenance on a reservation subBlock
14088 pub fn perform_maintenance(
14089 &self,
14090 ) -> super::builder::reservation_sub_blocks::PerformMaintenance {
14091 super::builder::reservation_sub_blocks::PerformMaintenance::new(self.inner.clone())
14092 }
14093
14094 /// Allows customers to report a faulty subBlock.
14095 pub fn report_faulty(&self) -> super::builder::reservation_sub_blocks::ReportFaulty {
14096 super::builder::reservation_sub_blocks::ReportFaulty::new(self.inner.clone())
14097 }
14098
14099 /// Sets the access control policy on the specified resource.
14100 /// Replaces any existing policy.
14101 pub fn set_iam_policy(&self) -> super::builder::reservation_sub_blocks::SetIamPolicy {
14102 super::builder::reservation_sub_blocks::SetIamPolicy::new(self.inner.clone())
14103 }
14104
14105 /// Returns permissions that a caller has on the specified resource.
14106 pub fn test_iam_permissions(
14107 &self,
14108 ) -> super::builder::reservation_sub_blocks::TestIamPermissions {
14109 super::builder::reservation_sub_blocks::TestIamPermissions::new(self.inner.clone())
14110 }
14111
14112 /// Retrieves the specified zone-specific Operations resource.
14113 pub fn get_operation(&self) -> super::builder::reservation_sub_blocks::GetOperation {
14114 super::builder::reservation_sub_blocks::GetOperation::new(self.inner.clone())
14115 }
14116}
14117
14118/// Implements a client for the Google Compute Engine API.
14119///
14120/// # Example
14121/// ```
14122/// # tokio_test::block_on(async {
14123/// # use google_cloud_compute_v1::client::Reservations;
14124/// let client = Reservations::builder().build().await?;
14125/// // use `client` to make requests to the Google Compute Engine API.
14126/// # gax::client_builder::Result::<()>::Ok(()) });
14127/// ```
14128///
14129/// # Service Description
14130///
14131/// Service for the `reservations` resource.
14132///
14133/// # Configuration
14134///
14135/// To configure `Reservations` use the `with_*` methods in the type returned
14136/// by [builder()][Reservations::builder]. The default configuration should
14137/// work for most applications. Common configuration changes include
14138///
14139/// * [with_endpoint()]: by default this client uses the global default endpoint
14140/// (`https://compute.googleapis.com`). Applications using regional
14141/// endpoints or running in restricted networks (e.g. a network configured
14142// with [Private Google Access with VPC Service Controls]) may want to
14143/// override this default.
14144/// * [with_credentials()]: by default this client uses
14145/// [Application Default Credentials]. Applications using custom
14146/// authentication may need to override this default.
14147///
14148/// [with_endpoint()]: super::builder::reservations::ClientBuilder::with_endpoint
14149/// [with_credentials()]: super::builder::reservations::ClientBuilder::credentials
14150/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14151/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14152///
14153/// # Pooling and Cloning
14154///
14155/// `Reservations` holds a connection pool internally, it is advised to
14156/// create one and the reuse it. You do not need to wrap `Reservations` in
14157/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14158/// already uses an `Arc` internally.
14159#[cfg(feature = "reservations")]
14160#[cfg_attr(docsrs, doc(cfg(feature = "reservations")))]
14161#[derive(Clone, Debug)]
14162pub struct Reservations {
14163 inner: std::sync::Arc<dyn super::stub::dynamic::Reservations>,
14164}
14165
14166#[cfg(feature = "reservations")]
14167impl Reservations {
14168 /// Returns a builder for [Reservations].
14169 ///
14170 /// ```
14171 /// # tokio_test::block_on(async {
14172 /// # use google_cloud_compute_v1::client::Reservations;
14173 /// let client = Reservations::builder().build().await?;
14174 /// # gax::client_builder::Result::<()>::Ok(()) });
14175 /// ```
14176 pub fn builder() -> super::builder::reservations::ClientBuilder {
14177 gax::client_builder::internal::new_builder(super::builder::reservations::client::Factory)
14178 }
14179
14180 /// Creates a new client from the provided stub.
14181 ///
14182 /// The most common case for calling this function is in tests mocking the
14183 /// client's behavior.
14184 pub fn from_stub<T>(stub: T) -> Self
14185 where
14186 T: super::stub::Reservations + 'static,
14187 {
14188 Self {
14189 inner: std::sync::Arc::new(stub),
14190 }
14191 }
14192
14193 pub(crate) async fn new(
14194 config: gaxi::options::ClientConfig,
14195 ) -> gax::client_builder::Result<Self> {
14196 let inner = Self::build_inner(config).await?;
14197 Ok(Self { inner })
14198 }
14199
14200 async fn build_inner(
14201 conf: gaxi::options::ClientConfig,
14202 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Reservations>> {
14203 if gaxi::options::tracing_enabled(&conf) {
14204 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14205 }
14206 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14207 }
14208
14209 async fn build_transport(
14210 conf: gaxi::options::ClientConfig,
14211 ) -> gax::client_builder::Result<impl super::stub::Reservations> {
14212 super::transport::Reservations::new(conf).await
14213 }
14214
14215 async fn build_with_tracing(
14216 conf: gaxi::options::ClientConfig,
14217 ) -> gax::client_builder::Result<impl super::stub::Reservations> {
14218 Self::build_transport(conf)
14219 .await
14220 .map(super::tracing::Reservations::new)
14221 }
14222
14223 /// Retrieves an aggregated list of reservations.
14224 ///
14225 /// To prevent failure, it is recommended that you set the
14226 /// `returnPartialSuccess` parameter to `true`.
14227 pub fn aggregated_list(&self) -> super::builder::reservations::AggregatedList {
14228 super::builder::reservations::AggregatedList::new(self.inner.clone())
14229 }
14230
14231 /// Deletes the specified reservation.
14232 pub fn delete(&self) -> super::builder::reservations::Delete {
14233 super::builder::reservations::Delete::new(self.inner.clone())
14234 }
14235
14236 /// Retrieves information about the specified reservation.
14237 pub fn get(&self) -> super::builder::reservations::Get {
14238 super::builder::reservations::Get::new(self.inner.clone())
14239 }
14240
14241 /// Gets the access control policy for a resource. May be empty if no such
14242 /// policy or resource exists.
14243 pub fn get_iam_policy(&self) -> super::builder::reservations::GetIamPolicy {
14244 super::builder::reservations::GetIamPolicy::new(self.inner.clone())
14245 }
14246
14247 /// Creates a new reservation. For more information, readReserving zonal
14248 /// resources.
14249 pub fn insert(&self) -> super::builder::reservations::Insert {
14250 super::builder::reservations::Insert::new(self.inner.clone())
14251 }
14252
14253 /// A list of all the reservations that have been configured for the
14254 /// specified project in specified zone.
14255 pub fn list(&self) -> super::builder::reservations::List {
14256 super::builder::reservations::List::new(self.inner.clone())
14257 }
14258
14259 /// Perform maintenance on an extended reservation
14260 pub fn perform_maintenance(&self) -> super::builder::reservations::PerformMaintenance {
14261 super::builder::reservations::PerformMaintenance::new(self.inner.clone())
14262 }
14263
14264 /// Resizes the reservation (applicable to standalone reservations only). For
14265 /// more information, readModifying
14266 /// reservations.
14267 pub fn resize(&self) -> super::builder::reservations::Resize {
14268 super::builder::reservations::Resize::new(self.inner.clone())
14269 }
14270
14271 /// Sets the access control policy on the specified resource.
14272 /// Replaces any existing policy.
14273 pub fn set_iam_policy(&self) -> super::builder::reservations::SetIamPolicy {
14274 super::builder::reservations::SetIamPolicy::new(self.inner.clone())
14275 }
14276
14277 /// Returns permissions that a caller has on the specified resource.
14278 pub fn test_iam_permissions(&self) -> super::builder::reservations::TestIamPermissions {
14279 super::builder::reservations::TestIamPermissions::new(self.inner.clone())
14280 }
14281
14282 /// Update share settings of the reservation.
14283 pub fn update(&self) -> super::builder::reservations::Update {
14284 super::builder::reservations::Update::new(self.inner.clone())
14285 }
14286
14287 /// Retrieves the specified zone-specific Operations resource.
14288 pub fn get_operation(&self) -> super::builder::reservations::GetOperation {
14289 super::builder::reservations::GetOperation::new(self.inner.clone())
14290 }
14291}
14292
14293/// Implements a client for the Google Compute Engine API.
14294///
14295/// # Example
14296/// ```
14297/// # tokio_test::block_on(async {
14298/// # use google_cloud_compute_v1::client::ResourcePolicies;
14299/// let client = ResourcePolicies::builder().build().await?;
14300/// // use `client` to make requests to the Google Compute Engine API.
14301/// # gax::client_builder::Result::<()>::Ok(()) });
14302/// ```
14303///
14304/// # Service Description
14305///
14306/// Service for the `resourcePolicies` resource.
14307///
14308/// # Configuration
14309///
14310/// To configure `ResourcePolicies` use the `with_*` methods in the type returned
14311/// by [builder()][ResourcePolicies::builder]. The default configuration should
14312/// work for most applications. Common configuration changes include
14313///
14314/// * [with_endpoint()]: by default this client uses the global default endpoint
14315/// (`https://compute.googleapis.com`). Applications using regional
14316/// endpoints or running in restricted networks (e.g. a network configured
14317// with [Private Google Access with VPC Service Controls]) may want to
14318/// override this default.
14319/// * [with_credentials()]: by default this client uses
14320/// [Application Default Credentials]. Applications using custom
14321/// authentication may need to override this default.
14322///
14323/// [with_endpoint()]: super::builder::resource_policies::ClientBuilder::with_endpoint
14324/// [with_credentials()]: super::builder::resource_policies::ClientBuilder::credentials
14325/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14326/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14327///
14328/// # Pooling and Cloning
14329///
14330/// `ResourcePolicies` holds a connection pool internally, it is advised to
14331/// create one and the reuse it. You do not need to wrap `ResourcePolicies` in
14332/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14333/// already uses an `Arc` internally.
14334#[cfg(feature = "resource-policies")]
14335#[cfg_attr(docsrs, doc(cfg(feature = "resource-policies")))]
14336#[derive(Clone, Debug)]
14337pub struct ResourcePolicies {
14338 inner: std::sync::Arc<dyn super::stub::dynamic::ResourcePolicies>,
14339}
14340
14341#[cfg(feature = "resource-policies")]
14342impl ResourcePolicies {
14343 /// Returns a builder for [ResourcePolicies].
14344 ///
14345 /// ```
14346 /// # tokio_test::block_on(async {
14347 /// # use google_cloud_compute_v1::client::ResourcePolicies;
14348 /// let client = ResourcePolicies::builder().build().await?;
14349 /// # gax::client_builder::Result::<()>::Ok(()) });
14350 /// ```
14351 pub fn builder() -> super::builder::resource_policies::ClientBuilder {
14352 gax::client_builder::internal::new_builder(
14353 super::builder::resource_policies::client::Factory,
14354 )
14355 }
14356
14357 /// Creates a new client from the provided stub.
14358 ///
14359 /// The most common case for calling this function is in tests mocking the
14360 /// client's behavior.
14361 pub fn from_stub<T>(stub: T) -> Self
14362 where
14363 T: super::stub::ResourcePolicies + 'static,
14364 {
14365 Self {
14366 inner: std::sync::Arc::new(stub),
14367 }
14368 }
14369
14370 pub(crate) async fn new(
14371 config: gaxi::options::ClientConfig,
14372 ) -> gax::client_builder::Result<Self> {
14373 let inner = Self::build_inner(config).await?;
14374 Ok(Self { inner })
14375 }
14376
14377 async fn build_inner(
14378 conf: gaxi::options::ClientConfig,
14379 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::ResourcePolicies>>
14380 {
14381 if gaxi::options::tracing_enabled(&conf) {
14382 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14383 }
14384 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14385 }
14386
14387 async fn build_transport(
14388 conf: gaxi::options::ClientConfig,
14389 ) -> gax::client_builder::Result<impl super::stub::ResourcePolicies> {
14390 super::transport::ResourcePolicies::new(conf).await
14391 }
14392
14393 async fn build_with_tracing(
14394 conf: gaxi::options::ClientConfig,
14395 ) -> gax::client_builder::Result<impl super::stub::ResourcePolicies> {
14396 Self::build_transport(conf)
14397 .await
14398 .map(super::tracing::ResourcePolicies::new)
14399 }
14400
14401 /// Retrieves an aggregated list of resource policies.
14402 ///
14403 /// To prevent failure, Google recommends that you set the
14404 /// `returnPartialSuccess` parameter to `true`.
14405 pub fn aggregated_list(&self) -> super::builder::resource_policies::AggregatedList {
14406 super::builder::resource_policies::AggregatedList::new(self.inner.clone())
14407 }
14408
14409 /// Deletes the specified resource policy.
14410 pub fn delete(&self) -> super::builder::resource_policies::Delete {
14411 super::builder::resource_policies::Delete::new(self.inner.clone())
14412 }
14413
14414 /// Retrieves all information of the specified resource policy.
14415 pub fn get(&self) -> super::builder::resource_policies::Get {
14416 super::builder::resource_policies::Get::new(self.inner.clone())
14417 }
14418
14419 /// Gets the access control policy for a resource. May be empty if no such
14420 /// policy or resource exists.
14421 pub fn get_iam_policy(&self) -> super::builder::resource_policies::GetIamPolicy {
14422 super::builder::resource_policies::GetIamPolicy::new(self.inner.clone())
14423 }
14424
14425 /// Creates a new resource policy.
14426 pub fn insert(&self) -> super::builder::resource_policies::Insert {
14427 super::builder::resource_policies::Insert::new(self.inner.clone())
14428 }
14429
14430 /// A list all the resource policies that have been configured for the
14431 /// specified project in specified region.
14432 pub fn list(&self) -> super::builder::resource_policies::List {
14433 super::builder::resource_policies::List::new(self.inner.clone())
14434 }
14435
14436 /// Modify the specified resource policy.
14437 pub fn patch(&self) -> super::builder::resource_policies::Patch {
14438 super::builder::resource_policies::Patch::new(self.inner.clone())
14439 }
14440
14441 /// Sets the access control policy on the specified resource.
14442 /// Replaces any existing policy.
14443 pub fn set_iam_policy(&self) -> super::builder::resource_policies::SetIamPolicy {
14444 super::builder::resource_policies::SetIamPolicy::new(self.inner.clone())
14445 }
14446
14447 /// Returns permissions that a caller has on the specified resource.
14448 pub fn test_iam_permissions(&self) -> super::builder::resource_policies::TestIamPermissions {
14449 super::builder::resource_policies::TestIamPermissions::new(self.inner.clone())
14450 }
14451
14452 /// Retrieves the specified region-specific Operations resource.
14453 pub fn get_operation(&self) -> super::builder::resource_policies::GetOperation {
14454 super::builder::resource_policies::GetOperation::new(self.inner.clone())
14455 }
14456}
14457
14458/// Implements a client for the Google Compute Engine API.
14459///
14460/// # Example
14461/// ```
14462/// # tokio_test::block_on(async {
14463/// # use google_cloud_compute_v1::client::Routers;
14464/// let client = Routers::builder().build().await?;
14465/// // use `client` to make requests to the Google Compute Engine API.
14466/// # gax::client_builder::Result::<()>::Ok(()) });
14467/// ```
14468///
14469/// # Service Description
14470///
14471/// Service for the `routers` resource.
14472///
14473/// # Configuration
14474///
14475/// To configure `Routers` use the `with_*` methods in the type returned
14476/// by [builder()][Routers::builder]. The default configuration should
14477/// work for most applications. Common configuration changes include
14478///
14479/// * [with_endpoint()]: by default this client uses the global default endpoint
14480/// (`https://compute.googleapis.com`). Applications using regional
14481/// endpoints or running in restricted networks (e.g. a network configured
14482// with [Private Google Access with VPC Service Controls]) may want to
14483/// override this default.
14484/// * [with_credentials()]: by default this client uses
14485/// [Application Default Credentials]. Applications using custom
14486/// authentication may need to override this default.
14487///
14488/// [with_endpoint()]: super::builder::routers::ClientBuilder::with_endpoint
14489/// [with_credentials()]: super::builder::routers::ClientBuilder::credentials
14490/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14491/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14492///
14493/// # Pooling and Cloning
14494///
14495/// `Routers` holds a connection pool internally, it is advised to
14496/// create one and the reuse it. You do not need to wrap `Routers` in
14497/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14498/// already uses an `Arc` internally.
14499#[cfg(feature = "routers")]
14500#[cfg_attr(docsrs, doc(cfg(feature = "routers")))]
14501#[derive(Clone, Debug)]
14502pub struct Routers {
14503 inner: std::sync::Arc<dyn super::stub::dynamic::Routers>,
14504}
14505
14506#[cfg(feature = "routers")]
14507impl Routers {
14508 /// Returns a builder for [Routers].
14509 ///
14510 /// ```
14511 /// # tokio_test::block_on(async {
14512 /// # use google_cloud_compute_v1::client::Routers;
14513 /// let client = Routers::builder().build().await?;
14514 /// # gax::client_builder::Result::<()>::Ok(()) });
14515 /// ```
14516 pub fn builder() -> super::builder::routers::ClientBuilder {
14517 gax::client_builder::internal::new_builder(super::builder::routers::client::Factory)
14518 }
14519
14520 /// Creates a new client from the provided stub.
14521 ///
14522 /// The most common case for calling this function is in tests mocking the
14523 /// client's behavior.
14524 pub fn from_stub<T>(stub: T) -> Self
14525 where
14526 T: super::stub::Routers + 'static,
14527 {
14528 Self {
14529 inner: std::sync::Arc::new(stub),
14530 }
14531 }
14532
14533 pub(crate) async fn new(
14534 config: gaxi::options::ClientConfig,
14535 ) -> gax::client_builder::Result<Self> {
14536 let inner = Self::build_inner(config).await?;
14537 Ok(Self { inner })
14538 }
14539
14540 async fn build_inner(
14541 conf: gaxi::options::ClientConfig,
14542 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Routers>> {
14543 if gaxi::options::tracing_enabled(&conf) {
14544 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14545 }
14546 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14547 }
14548
14549 async fn build_transport(
14550 conf: gaxi::options::ClientConfig,
14551 ) -> gax::client_builder::Result<impl super::stub::Routers> {
14552 super::transport::Routers::new(conf).await
14553 }
14554
14555 async fn build_with_tracing(
14556 conf: gaxi::options::ClientConfig,
14557 ) -> gax::client_builder::Result<impl super::stub::Routers> {
14558 Self::build_transport(conf)
14559 .await
14560 .map(super::tracing::Routers::new)
14561 }
14562
14563 /// Retrieves an aggregated list of routers.
14564 ///
14565 /// To prevent failure, Google recommends that you set the
14566 /// `returnPartialSuccess` parameter to `true`.
14567 pub fn aggregated_list(&self) -> super::builder::routers::AggregatedList {
14568 super::builder::routers::AggregatedList::new(self.inner.clone())
14569 }
14570
14571 /// Deletes the specified Router resource.
14572 pub fn delete(&self) -> super::builder::routers::Delete {
14573 super::builder::routers::Delete::new(self.inner.clone())
14574 }
14575
14576 /// Deletes Route Policy
14577 pub fn delete_route_policy(&self) -> super::builder::routers::DeleteRoutePolicy {
14578 super::builder::routers::DeleteRoutePolicy::new(self.inner.clone())
14579 }
14580
14581 /// Returns the specified Router resource.
14582 pub fn get(&self) -> super::builder::routers::Get {
14583 super::builder::routers::Get::new(self.inner.clone())
14584 }
14585
14586 /// Retrieves runtime NAT IP information.
14587 pub fn get_nat_ip_info(&self) -> super::builder::routers::GetNatIpInfo {
14588 super::builder::routers::GetNatIpInfo::new(self.inner.clone())
14589 }
14590
14591 /// Retrieves runtime Nat mapping information of VM endpoints.
14592 pub fn get_nat_mapping_info(&self) -> super::builder::routers::GetNatMappingInfo {
14593 super::builder::routers::GetNatMappingInfo::new(self.inner.clone())
14594 }
14595
14596 /// Returns specified Route Policy
14597 pub fn get_route_policy(&self) -> super::builder::routers::GetRoutePolicy {
14598 super::builder::routers::GetRoutePolicy::new(self.inner.clone())
14599 }
14600
14601 /// Retrieves runtime information of the specified router.
14602 pub fn get_router_status(&self) -> super::builder::routers::GetRouterStatus {
14603 super::builder::routers::GetRouterStatus::new(self.inner.clone())
14604 }
14605
14606 /// Creates a Router resource in the specified project and region using
14607 /// the data included in the request.
14608 pub fn insert(&self) -> super::builder::routers::Insert {
14609 super::builder::routers::Insert::new(self.inner.clone())
14610 }
14611
14612 /// Retrieves a list of Router resources available to the specified project.
14613 pub fn list(&self) -> super::builder::routers::List {
14614 super::builder::routers::List::new(self.inner.clone())
14615 }
14616
14617 /// Retrieves a list of router bgp routes available to the specified project.
14618 pub fn list_bgp_routes(&self) -> super::builder::routers::ListBgpRoutes {
14619 super::builder::routers::ListBgpRoutes::new(self.inner.clone())
14620 }
14621
14622 /// Retrieves a list of router route policy subresources available to the
14623 /// specified project.
14624 pub fn list_route_policies(&self) -> super::builder::routers::ListRoutePolicies {
14625 super::builder::routers::ListRoutePolicies::new(self.inner.clone())
14626 }
14627
14628 /// Patches the specified Router resource with the data included in the
14629 /// request. This method supportsPATCH
14630 /// semantics and usesJSON merge
14631 /// patch format and processing rules.
14632 pub fn patch(&self) -> super::builder::routers::Patch {
14633 super::builder::routers::Patch::new(self.inner.clone())
14634 }
14635
14636 /// Patches Route Policy
14637 pub fn patch_route_policy(&self) -> super::builder::routers::PatchRoutePolicy {
14638 super::builder::routers::PatchRoutePolicy::new(self.inner.clone())
14639 }
14640
14641 /// Preview fields auto-generated during router create andupdate operations.
14642 /// Calling this method does NOT create or update the router.
14643 pub fn preview(&self) -> super::builder::routers::Preview {
14644 super::builder::routers::Preview::new(self.inner.clone())
14645 }
14646
14647 /// Updates the specified Router resource with the data included in the
14648 /// request. This method conforms toPUT semantics, which requests that the state of the
14649 /// target resource be created or replaced with the state defined by the
14650 /// representation enclosed in the request message payload.
14651 pub fn update(&self) -> super::builder::routers::Update {
14652 super::builder::routers::Update::new(self.inner.clone())
14653 }
14654
14655 /// Updates or creates new Route Policy
14656 pub fn update_route_policy(&self) -> super::builder::routers::UpdateRoutePolicy {
14657 super::builder::routers::UpdateRoutePolicy::new(self.inner.clone())
14658 }
14659
14660 /// Retrieves the specified region-specific Operations resource.
14661 pub fn get_operation(&self) -> super::builder::routers::GetOperation {
14662 super::builder::routers::GetOperation::new(self.inner.clone())
14663 }
14664}
14665
14666/// Implements a client for the Google Compute Engine API.
14667///
14668/// # Example
14669/// ```
14670/// # tokio_test::block_on(async {
14671/// # use google_cloud_compute_v1::client::Routes;
14672/// let client = Routes::builder().build().await?;
14673/// // use `client` to make requests to the Google Compute Engine API.
14674/// # gax::client_builder::Result::<()>::Ok(()) });
14675/// ```
14676///
14677/// # Service Description
14678///
14679/// Service for the `routes` resource.
14680///
14681/// # Configuration
14682///
14683/// To configure `Routes` use the `with_*` methods in the type returned
14684/// by [builder()][Routes::builder]. The default configuration should
14685/// work for most applications. Common configuration changes include
14686///
14687/// * [with_endpoint()]: by default this client uses the global default endpoint
14688/// (`https://compute.googleapis.com`). Applications using regional
14689/// endpoints or running in restricted networks (e.g. a network configured
14690// with [Private Google Access with VPC Service Controls]) may want to
14691/// override this default.
14692/// * [with_credentials()]: by default this client uses
14693/// [Application Default Credentials]. Applications using custom
14694/// authentication may need to override this default.
14695///
14696/// [with_endpoint()]: super::builder::routes::ClientBuilder::with_endpoint
14697/// [with_credentials()]: super::builder::routes::ClientBuilder::credentials
14698/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14699/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14700///
14701/// # Pooling and Cloning
14702///
14703/// `Routes` holds a connection pool internally, it is advised to
14704/// create one and the reuse it. You do not need to wrap `Routes` in
14705/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14706/// already uses an `Arc` internally.
14707#[cfg(feature = "routes")]
14708#[cfg_attr(docsrs, doc(cfg(feature = "routes")))]
14709#[derive(Clone, Debug)]
14710pub struct Routes {
14711 inner: std::sync::Arc<dyn super::stub::dynamic::Routes>,
14712}
14713
14714#[cfg(feature = "routes")]
14715impl Routes {
14716 /// Returns a builder for [Routes].
14717 ///
14718 /// ```
14719 /// # tokio_test::block_on(async {
14720 /// # use google_cloud_compute_v1::client::Routes;
14721 /// let client = Routes::builder().build().await?;
14722 /// # gax::client_builder::Result::<()>::Ok(()) });
14723 /// ```
14724 pub fn builder() -> super::builder::routes::ClientBuilder {
14725 gax::client_builder::internal::new_builder(super::builder::routes::client::Factory)
14726 }
14727
14728 /// Creates a new client from the provided stub.
14729 ///
14730 /// The most common case for calling this function is in tests mocking the
14731 /// client's behavior.
14732 pub fn from_stub<T>(stub: T) -> Self
14733 where
14734 T: super::stub::Routes + 'static,
14735 {
14736 Self {
14737 inner: std::sync::Arc::new(stub),
14738 }
14739 }
14740
14741 pub(crate) async fn new(
14742 config: gaxi::options::ClientConfig,
14743 ) -> gax::client_builder::Result<Self> {
14744 let inner = Self::build_inner(config).await?;
14745 Ok(Self { inner })
14746 }
14747
14748 async fn build_inner(
14749 conf: gaxi::options::ClientConfig,
14750 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Routes>> {
14751 if gaxi::options::tracing_enabled(&conf) {
14752 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14753 }
14754 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14755 }
14756
14757 async fn build_transport(
14758 conf: gaxi::options::ClientConfig,
14759 ) -> gax::client_builder::Result<impl super::stub::Routes> {
14760 super::transport::Routes::new(conf).await
14761 }
14762
14763 async fn build_with_tracing(
14764 conf: gaxi::options::ClientConfig,
14765 ) -> gax::client_builder::Result<impl super::stub::Routes> {
14766 Self::build_transport(conf)
14767 .await
14768 .map(super::tracing::Routes::new)
14769 }
14770
14771 /// Deletes the specified Route resource.
14772 pub fn delete(&self) -> super::builder::routes::Delete {
14773 super::builder::routes::Delete::new(self.inner.clone())
14774 }
14775
14776 /// Returns the specified Route resource.
14777 pub fn get(&self) -> super::builder::routes::Get {
14778 super::builder::routes::Get::new(self.inner.clone())
14779 }
14780
14781 /// Creates a Route resource in the specified project using the data included
14782 /// in the request.
14783 pub fn insert(&self) -> super::builder::routes::Insert {
14784 super::builder::routes::Insert::new(self.inner.clone())
14785 }
14786
14787 /// Retrieves the list of Route resources available to the specified project.
14788 pub fn list(&self) -> super::builder::routes::List {
14789 super::builder::routes::List::new(self.inner.clone())
14790 }
14791
14792 /// Retrieves the specified Operations resource.
14793 pub fn get_operation(&self) -> super::builder::routes::GetOperation {
14794 super::builder::routes::GetOperation::new(self.inner.clone())
14795 }
14796}
14797
14798/// Implements a client for the Google Compute Engine API.
14799///
14800/// # Example
14801/// ```
14802/// # tokio_test::block_on(async {
14803/// # use google_cloud_compute_v1::client::SecurityPolicies;
14804/// let client = SecurityPolicies::builder().build().await?;
14805/// // use `client` to make requests to the Google Compute Engine API.
14806/// # gax::client_builder::Result::<()>::Ok(()) });
14807/// ```
14808///
14809/// # Service Description
14810///
14811/// Service for the `securityPolicies` resource.
14812///
14813/// # Configuration
14814///
14815/// To configure `SecurityPolicies` use the `with_*` methods in the type returned
14816/// by [builder()][SecurityPolicies::builder]. The default configuration should
14817/// work for most applications. Common configuration changes include
14818///
14819/// * [with_endpoint()]: by default this client uses the global default endpoint
14820/// (`https://compute.googleapis.com`). Applications using regional
14821/// endpoints or running in restricted networks (e.g. a network configured
14822// with [Private Google Access with VPC Service Controls]) may want to
14823/// override this default.
14824/// * [with_credentials()]: by default this client uses
14825/// [Application Default Credentials]. Applications using custom
14826/// authentication may need to override this default.
14827///
14828/// [with_endpoint()]: super::builder::security_policies::ClientBuilder::with_endpoint
14829/// [with_credentials()]: super::builder::security_policies::ClientBuilder::credentials
14830/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14831/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14832///
14833/// # Pooling and Cloning
14834///
14835/// `SecurityPolicies` holds a connection pool internally, it is advised to
14836/// create one and the reuse it. You do not need to wrap `SecurityPolicies` in
14837/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14838/// already uses an `Arc` internally.
14839#[cfg(feature = "security-policies")]
14840#[cfg_attr(docsrs, doc(cfg(feature = "security-policies")))]
14841#[derive(Clone, Debug)]
14842pub struct SecurityPolicies {
14843 inner: std::sync::Arc<dyn super::stub::dynamic::SecurityPolicies>,
14844}
14845
14846#[cfg(feature = "security-policies")]
14847impl SecurityPolicies {
14848 /// Returns a builder for [SecurityPolicies].
14849 ///
14850 /// ```
14851 /// # tokio_test::block_on(async {
14852 /// # use google_cloud_compute_v1::client::SecurityPolicies;
14853 /// let client = SecurityPolicies::builder().build().await?;
14854 /// # gax::client_builder::Result::<()>::Ok(()) });
14855 /// ```
14856 pub fn builder() -> super::builder::security_policies::ClientBuilder {
14857 gax::client_builder::internal::new_builder(
14858 super::builder::security_policies::client::Factory,
14859 )
14860 }
14861
14862 /// Creates a new client from the provided stub.
14863 ///
14864 /// The most common case for calling this function is in tests mocking the
14865 /// client's behavior.
14866 pub fn from_stub<T>(stub: T) -> Self
14867 where
14868 T: super::stub::SecurityPolicies + 'static,
14869 {
14870 Self {
14871 inner: std::sync::Arc::new(stub),
14872 }
14873 }
14874
14875 pub(crate) async fn new(
14876 config: gaxi::options::ClientConfig,
14877 ) -> gax::client_builder::Result<Self> {
14878 let inner = Self::build_inner(config).await?;
14879 Ok(Self { inner })
14880 }
14881
14882 async fn build_inner(
14883 conf: gaxi::options::ClientConfig,
14884 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::SecurityPolicies>>
14885 {
14886 if gaxi::options::tracing_enabled(&conf) {
14887 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14888 }
14889 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14890 }
14891
14892 async fn build_transport(
14893 conf: gaxi::options::ClientConfig,
14894 ) -> gax::client_builder::Result<impl super::stub::SecurityPolicies> {
14895 super::transport::SecurityPolicies::new(conf).await
14896 }
14897
14898 async fn build_with_tracing(
14899 conf: gaxi::options::ClientConfig,
14900 ) -> gax::client_builder::Result<impl super::stub::SecurityPolicies> {
14901 Self::build_transport(conf)
14902 .await
14903 .map(super::tracing::SecurityPolicies::new)
14904 }
14905
14906 /// Inserts a rule into a security policy.
14907 pub fn add_rule(&self) -> super::builder::security_policies::AddRule {
14908 super::builder::security_policies::AddRule::new(self.inner.clone())
14909 }
14910
14911 /// Retrieves the list of all SecurityPolicy resources, regional and global,
14912 /// available to the specified project.
14913 ///
14914 /// To prevent failure, Google recommends that you set the
14915 /// `returnPartialSuccess` parameter to `true`.
14916 pub fn aggregated_list(&self) -> super::builder::security_policies::AggregatedList {
14917 super::builder::security_policies::AggregatedList::new(self.inner.clone())
14918 }
14919
14920 /// Deletes the specified policy.
14921 pub fn delete(&self) -> super::builder::security_policies::Delete {
14922 super::builder::security_policies::Delete::new(self.inner.clone())
14923 }
14924
14925 /// List all of the ordered rules present in a single specified policy.
14926 pub fn get(&self) -> super::builder::security_policies::Get {
14927 super::builder::security_policies::Get::new(self.inner.clone())
14928 }
14929
14930 /// Gets a rule at the specified priority.
14931 pub fn get_rule(&self) -> super::builder::security_policies::GetRule {
14932 super::builder::security_policies::GetRule::new(self.inner.clone())
14933 }
14934
14935 /// Creates a new policy in the specified project using the data included in
14936 /// the request.
14937 pub fn insert(&self) -> super::builder::security_policies::Insert {
14938 super::builder::security_policies::Insert::new(self.inner.clone())
14939 }
14940
14941 /// List all the policies that have been configured for the specified project.
14942 pub fn list(&self) -> super::builder::security_policies::List {
14943 super::builder::security_policies::List::new(self.inner.clone())
14944 }
14945
14946 /// Gets the current list of preconfigured Web Application Firewall (WAF)
14947 /// expressions.
14948 pub fn list_preconfigured_expression_sets(
14949 &self,
14950 ) -> super::builder::security_policies::ListPreconfiguredExpressionSets {
14951 super::builder::security_policies::ListPreconfiguredExpressionSets::new(self.inner.clone())
14952 }
14953
14954 /// Patches the specified policy with the data included in the request. To
14955 /// clear fields in the policy, leave the fields empty and specify them in the
14956 /// updateMask. This cannot be used to be update the rules in the policy.
14957 /// Please use the per rule methods like addRule, patchRule, and removeRule
14958 /// instead.
14959 pub fn patch(&self) -> super::builder::security_policies::Patch {
14960 super::builder::security_policies::Patch::new(self.inner.clone())
14961 }
14962
14963 /// Patches a rule at the specified priority. To clear fields in the rule,
14964 /// leave the fields empty and specify them in the updateMask.
14965 pub fn patch_rule(&self) -> super::builder::security_policies::PatchRule {
14966 super::builder::security_policies::PatchRule::new(self.inner.clone())
14967 }
14968
14969 /// Deletes a rule at the specified priority.
14970 pub fn remove_rule(&self) -> super::builder::security_policies::RemoveRule {
14971 super::builder::security_policies::RemoveRule::new(self.inner.clone())
14972 }
14973
14974 /// Sets the labels on a security policy. To learn more about labels,
14975 /// read the Labeling Resources
14976 /// documentation.
14977 pub fn set_labels(&self) -> super::builder::security_policies::SetLabels {
14978 super::builder::security_policies::SetLabels::new(self.inner.clone())
14979 }
14980
14981 /// Retrieves the specified Operations resource.
14982 pub fn get_operation(&self) -> super::builder::security_policies::GetOperation {
14983 super::builder::security_policies::GetOperation::new(self.inner.clone())
14984 }
14985}
14986
14987/// Implements a client for the Google Compute Engine API.
14988///
14989/// # Example
14990/// ```
14991/// # tokio_test::block_on(async {
14992/// # use google_cloud_compute_v1::client::ServiceAttachments;
14993/// let client = ServiceAttachments::builder().build().await?;
14994/// // use `client` to make requests to the Google Compute Engine API.
14995/// # gax::client_builder::Result::<()>::Ok(()) });
14996/// ```
14997///
14998/// # Service Description
14999///
15000/// Service for the `serviceAttachments` resource.
15001///
15002/// # Configuration
15003///
15004/// To configure `ServiceAttachments` use the `with_*` methods in the type returned
15005/// by [builder()][ServiceAttachments::builder]. The default configuration should
15006/// work for most applications. Common configuration changes include
15007///
15008/// * [with_endpoint()]: by default this client uses the global default endpoint
15009/// (`https://compute.googleapis.com`). Applications using regional
15010/// endpoints or running in restricted networks (e.g. a network configured
15011// with [Private Google Access with VPC Service Controls]) may want to
15012/// override this default.
15013/// * [with_credentials()]: by default this client uses
15014/// [Application Default Credentials]. Applications using custom
15015/// authentication may need to override this default.
15016///
15017/// [with_endpoint()]: super::builder::service_attachments::ClientBuilder::with_endpoint
15018/// [with_credentials()]: super::builder::service_attachments::ClientBuilder::credentials
15019/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15020/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15021///
15022/// # Pooling and Cloning
15023///
15024/// `ServiceAttachments` holds a connection pool internally, it is advised to
15025/// create one and the reuse it. You do not need to wrap `ServiceAttachments` in
15026/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15027/// already uses an `Arc` internally.
15028#[cfg(feature = "service-attachments")]
15029#[cfg_attr(docsrs, doc(cfg(feature = "service-attachments")))]
15030#[derive(Clone, Debug)]
15031pub struct ServiceAttachments {
15032 inner: std::sync::Arc<dyn super::stub::dynamic::ServiceAttachments>,
15033}
15034
15035#[cfg(feature = "service-attachments")]
15036impl ServiceAttachments {
15037 /// Returns a builder for [ServiceAttachments].
15038 ///
15039 /// ```
15040 /// # tokio_test::block_on(async {
15041 /// # use google_cloud_compute_v1::client::ServiceAttachments;
15042 /// let client = ServiceAttachments::builder().build().await?;
15043 /// # gax::client_builder::Result::<()>::Ok(()) });
15044 /// ```
15045 pub fn builder() -> super::builder::service_attachments::ClientBuilder {
15046 gax::client_builder::internal::new_builder(
15047 super::builder::service_attachments::client::Factory,
15048 )
15049 }
15050
15051 /// Creates a new client from the provided stub.
15052 ///
15053 /// The most common case for calling this function is in tests mocking the
15054 /// client's behavior.
15055 pub fn from_stub<T>(stub: T) -> Self
15056 where
15057 T: super::stub::ServiceAttachments + 'static,
15058 {
15059 Self {
15060 inner: std::sync::Arc::new(stub),
15061 }
15062 }
15063
15064 pub(crate) async fn new(
15065 config: gaxi::options::ClientConfig,
15066 ) -> gax::client_builder::Result<Self> {
15067 let inner = Self::build_inner(config).await?;
15068 Ok(Self { inner })
15069 }
15070
15071 async fn build_inner(
15072 conf: gaxi::options::ClientConfig,
15073 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::ServiceAttachments>>
15074 {
15075 if gaxi::options::tracing_enabled(&conf) {
15076 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15077 }
15078 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15079 }
15080
15081 async fn build_transport(
15082 conf: gaxi::options::ClientConfig,
15083 ) -> gax::client_builder::Result<impl super::stub::ServiceAttachments> {
15084 super::transport::ServiceAttachments::new(conf).await
15085 }
15086
15087 async fn build_with_tracing(
15088 conf: gaxi::options::ClientConfig,
15089 ) -> gax::client_builder::Result<impl super::stub::ServiceAttachments> {
15090 Self::build_transport(conf)
15091 .await
15092 .map(super::tracing::ServiceAttachments::new)
15093 }
15094
15095 /// Retrieves the list of all ServiceAttachment resources,
15096 /// regional and global, available to the specified project.
15097 ///
15098 /// To prevent failure, Google recommends that you set the
15099 /// `returnPartialSuccess` parameter to `true`.
15100 pub fn aggregated_list(&self) -> super::builder::service_attachments::AggregatedList {
15101 super::builder::service_attachments::AggregatedList::new(self.inner.clone())
15102 }
15103
15104 /// Deletes the specified ServiceAttachment in the given scope
15105 pub fn delete(&self) -> super::builder::service_attachments::Delete {
15106 super::builder::service_attachments::Delete::new(self.inner.clone())
15107 }
15108
15109 /// Returns the specified ServiceAttachment resource in the given scope.
15110 pub fn get(&self) -> super::builder::service_attachments::Get {
15111 super::builder::service_attachments::Get::new(self.inner.clone())
15112 }
15113
15114 /// Gets the access control policy for a resource. May be empty if no such
15115 /// policy or resource exists.
15116 pub fn get_iam_policy(&self) -> super::builder::service_attachments::GetIamPolicy {
15117 super::builder::service_attachments::GetIamPolicy::new(self.inner.clone())
15118 }
15119
15120 /// Creates a ServiceAttachment in the specified project in the given scope
15121 /// using the parameters that are included in the request.
15122 pub fn insert(&self) -> super::builder::service_attachments::Insert {
15123 super::builder::service_attachments::Insert::new(self.inner.clone())
15124 }
15125
15126 /// Lists the ServiceAttachments for a project in the given scope.
15127 pub fn list(&self) -> super::builder::service_attachments::List {
15128 super::builder::service_attachments::List::new(self.inner.clone())
15129 }
15130
15131 /// Patches the specified ServiceAttachment resource with the data included in
15132 /// the request. This method supports PATCH
15133 /// semantics and usesJSON merge
15134 /// patch format and processing rules.
15135 pub fn patch(&self) -> super::builder::service_attachments::Patch {
15136 super::builder::service_attachments::Patch::new(self.inner.clone())
15137 }
15138
15139 /// Sets the access control policy on the specified resource.
15140 /// Replaces any existing policy.
15141 pub fn set_iam_policy(&self) -> super::builder::service_attachments::SetIamPolicy {
15142 super::builder::service_attachments::SetIamPolicy::new(self.inner.clone())
15143 }
15144
15145 /// Returns permissions that a caller has on the specified resource.
15146 pub fn test_iam_permissions(&self) -> super::builder::service_attachments::TestIamPermissions {
15147 super::builder::service_attachments::TestIamPermissions::new(self.inner.clone())
15148 }
15149
15150 /// Retrieves the specified region-specific Operations resource.
15151 pub fn get_operation(&self) -> super::builder::service_attachments::GetOperation {
15152 super::builder::service_attachments::GetOperation::new(self.inner.clone())
15153 }
15154}
15155
15156/// Implements a client for the Google Compute Engine API.
15157///
15158/// # Example
15159/// ```
15160/// # tokio_test::block_on(async {
15161/// # use google_cloud_compute_v1::client::SnapshotSettings;
15162/// let client = SnapshotSettings::builder().build().await?;
15163/// // use `client` to make requests to the Google Compute Engine API.
15164/// # gax::client_builder::Result::<()>::Ok(()) });
15165/// ```
15166///
15167/// # Service Description
15168///
15169/// Service for the `snapshotSettings` resource.
15170///
15171/// # Configuration
15172///
15173/// To configure `SnapshotSettings` use the `with_*` methods in the type returned
15174/// by [builder()][SnapshotSettings::builder]. The default configuration should
15175/// work for most applications. Common configuration changes include
15176///
15177/// * [with_endpoint()]: by default this client uses the global default endpoint
15178/// (`https://compute.googleapis.com`). Applications using regional
15179/// endpoints or running in restricted networks (e.g. a network configured
15180// with [Private Google Access with VPC Service Controls]) may want to
15181/// override this default.
15182/// * [with_credentials()]: by default this client uses
15183/// [Application Default Credentials]. Applications using custom
15184/// authentication may need to override this default.
15185///
15186/// [with_endpoint()]: super::builder::snapshot_settings::ClientBuilder::with_endpoint
15187/// [with_credentials()]: super::builder::snapshot_settings::ClientBuilder::credentials
15188/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15189/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15190///
15191/// # Pooling and Cloning
15192///
15193/// `SnapshotSettings` holds a connection pool internally, it is advised to
15194/// create one and the reuse it. You do not need to wrap `SnapshotSettings` in
15195/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15196/// already uses an `Arc` internally.
15197#[cfg(feature = "snapshot-settings")]
15198#[cfg_attr(docsrs, doc(cfg(feature = "snapshot-settings")))]
15199#[derive(Clone, Debug)]
15200pub struct SnapshotSettings {
15201 inner: std::sync::Arc<dyn super::stub::dynamic::SnapshotSettings>,
15202}
15203
15204#[cfg(feature = "snapshot-settings")]
15205impl SnapshotSettings {
15206 /// Returns a builder for [SnapshotSettings].
15207 ///
15208 /// ```
15209 /// # tokio_test::block_on(async {
15210 /// # use google_cloud_compute_v1::client::SnapshotSettings;
15211 /// let client = SnapshotSettings::builder().build().await?;
15212 /// # gax::client_builder::Result::<()>::Ok(()) });
15213 /// ```
15214 pub fn builder() -> super::builder::snapshot_settings::ClientBuilder {
15215 gax::client_builder::internal::new_builder(
15216 super::builder::snapshot_settings::client::Factory,
15217 )
15218 }
15219
15220 /// Creates a new client from the provided stub.
15221 ///
15222 /// The most common case for calling this function is in tests mocking the
15223 /// client's behavior.
15224 pub fn from_stub<T>(stub: T) -> Self
15225 where
15226 T: super::stub::SnapshotSettings + 'static,
15227 {
15228 Self {
15229 inner: std::sync::Arc::new(stub),
15230 }
15231 }
15232
15233 pub(crate) async fn new(
15234 config: gaxi::options::ClientConfig,
15235 ) -> gax::client_builder::Result<Self> {
15236 let inner = Self::build_inner(config).await?;
15237 Ok(Self { inner })
15238 }
15239
15240 async fn build_inner(
15241 conf: gaxi::options::ClientConfig,
15242 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::SnapshotSettings>>
15243 {
15244 if gaxi::options::tracing_enabled(&conf) {
15245 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15246 }
15247 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15248 }
15249
15250 async fn build_transport(
15251 conf: gaxi::options::ClientConfig,
15252 ) -> gax::client_builder::Result<impl super::stub::SnapshotSettings> {
15253 super::transport::SnapshotSettings::new(conf).await
15254 }
15255
15256 async fn build_with_tracing(
15257 conf: gaxi::options::ClientConfig,
15258 ) -> gax::client_builder::Result<impl super::stub::SnapshotSettings> {
15259 Self::build_transport(conf)
15260 .await
15261 .map(super::tracing::SnapshotSettings::new)
15262 }
15263
15264 /// Get snapshot settings.
15265 pub fn get(&self) -> super::builder::snapshot_settings::Get {
15266 super::builder::snapshot_settings::Get::new(self.inner.clone())
15267 }
15268
15269 /// Patch snapshot settings.
15270 pub fn patch(&self) -> super::builder::snapshot_settings::Patch {
15271 super::builder::snapshot_settings::Patch::new(self.inner.clone())
15272 }
15273
15274 /// Retrieves the specified Operations resource.
15275 pub fn get_operation(&self) -> super::builder::snapshot_settings::GetOperation {
15276 super::builder::snapshot_settings::GetOperation::new(self.inner.clone())
15277 }
15278}
15279
15280/// Implements a client for the Google Compute Engine API.
15281///
15282/// # Example
15283/// ```
15284/// # tokio_test::block_on(async {
15285/// # use google_cloud_compute_v1::client::Snapshots;
15286/// let client = Snapshots::builder().build().await?;
15287/// // use `client` to make requests to the Google Compute Engine API.
15288/// # gax::client_builder::Result::<()>::Ok(()) });
15289/// ```
15290///
15291/// # Service Description
15292///
15293/// Service for the `snapshots` resource.
15294///
15295/// # Configuration
15296///
15297/// To configure `Snapshots` use the `with_*` methods in the type returned
15298/// by [builder()][Snapshots::builder]. The default configuration should
15299/// work for most applications. Common configuration changes include
15300///
15301/// * [with_endpoint()]: by default this client uses the global default endpoint
15302/// (`https://compute.googleapis.com`). Applications using regional
15303/// endpoints or running in restricted networks (e.g. a network configured
15304// with [Private Google Access with VPC Service Controls]) may want to
15305/// override this default.
15306/// * [with_credentials()]: by default this client uses
15307/// [Application Default Credentials]. Applications using custom
15308/// authentication may need to override this default.
15309///
15310/// [with_endpoint()]: super::builder::snapshots::ClientBuilder::with_endpoint
15311/// [with_credentials()]: super::builder::snapshots::ClientBuilder::credentials
15312/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15313/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15314///
15315/// # Pooling and Cloning
15316///
15317/// `Snapshots` holds a connection pool internally, it is advised to
15318/// create one and the reuse it. You do not need to wrap `Snapshots` in
15319/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15320/// already uses an `Arc` internally.
15321#[cfg(feature = "snapshots")]
15322#[cfg_attr(docsrs, doc(cfg(feature = "snapshots")))]
15323#[derive(Clone, Debug)]
15324pub struct Snapshots {
15325 inner: std::sync::Arc<dyn super::stub::dynamic::Snapshots>,
15326}
15327
15328#[cfg(feature = "snapshots")]
15329impl Snapshots {
15330 /// Returns a builder for [Snapshots].
15331 ///
15332 /// ```
15333 /// # tokio_test::block_on(async {
15334 /// # use google_cloud_compute_v1::client::Snapshots;
15335 /// let client = Snapshots::builder().build().await?;
15336 /// # gax::client_builder::Result::<()>::Ok(()) });
15337 /// ```
15338 pub fn builder() -> super::builder::snapshots::ClientBuilder {
15339 gax::client_builder::internal::new_builder(super::builder::snapshots::client::Factory)
15340 }
15341
15342 /// Creates a new client from the provided stub.
15343 ///
15344 /// The most common case for calling this function is in tests mocking the
15345 /// client's behavior.
15346 pub fn from_stub<T>(stub: T) -> Self
15347 where
15348 T: super::stub::Snapshots + 'static,
15349 {
15350 Self {
15351 inner: std::sync::Arc::new(stub),
15352 }
15353 }
15354
15355 pub(crate) async fn new(
15356 config: gaxi::options::ClientConfig,
15357 ) -> gax::client_builder::Result<Self> {
15358 let inner = Self::build_inner(config).await?;
15359 Ok(Self { inner })
15360 }
15361
15362 async fn build_inner(
15363 conf: gaxi::options::ClientConfig,
15364 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Snapshots>> {
15365 if gaxi::options::tracing_enabled(&conf) {
15366 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15367 }
15368 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15369 }
15370
15371 async fn build_transport(
15372 conf: gaxi::options::ClientConfig,
15373 ) -> gax::client_builder::Result<impl super::stub::Snapshots> {
15374 super::transport::Snapshots::new(conf).await
15375 }
15376
15377 async fn build_with_tracing(
15378 conf: gaxi::options::ClientConfig,
15379 ) -> gax::client_builder::Result<impl super::stub::Snapshots> {
15380 Self::build_transport(conf)
15381 .await
15382 .map(super::tracing::Snapshots::new)
15383 }
15384
15385 /// Deletes the specified Snapshot resource. Keep in mind that deleting
15386 /// a single snapshot might not necessarily delete all the data on that
15387 /// snapshot. If any data on the snapshot that is marked for deletion is
15388 /// needed for subsequent snapshots, the data will be moved to the next
15389 /// corresponding snapshot.
15390 ///
15391 /// For more information, seeDeleting
15392 /// snapshots.
15393 pub fn delete(&self) -> super::builder::snapshots::Delete {
15394 super::builder::snapshots::Delete::new(self.inner.clone())
15395 }
15396
15397 /// Returns the specified Snapshot resource.
15398 pub fn get(&self) -> super::builder::snapshots::Get {
15399 super::builder::snapshots::Get::new(self.inner.clone())
15400 }
15401
15402 /// Gets the access control policy for a resource. May be empty if no such
15403 /// policy or resource exists.
15404 pub fn get_iam_policy(&self) -> super::builder::snapshots::GetIamPolicy {
15405 super::builder::snapshots::GetIamPolicy::new(self.inner.clone())
15406 }
15407
15408 /// Creates a snapshot in the specified project using the data included
15409 /// in the request. For regular snapshot creation, consider using this method
15410 /// instead of disks.createSnapshot,
15411 /// as this method supports more features, such as creating snapshots in a
15412 /// project different from the source disk project.
15413 pub fn insert(&self) -> super::builder::snapshots::Insert {
15414 super::builder::snapshots::Insert::new(self.inner.clone())
15415 }
15416
15417 /// Retrieves the list of Snapshot resources contained within
15418 /// the specified project.
15419 pub fn list(&self) -> super::builder::snapshots::List {
15420 super::builder::snapshots::List::new(self.inner.clone())
15421 }
15422
15423 /// Sets the access control policy on the specified resource.
15424 /// Replaces any existing policy.
15425 pub fn set_iam_policy(&self) -> super::builder::snapshots::SetIamPolicy {
15426 super::builder::snapshots::SetIamPolicy::new(self.inner.clone())
15427 }
15428
15429 /// Sets the labels on a snapshot. To learn more about labels, read theLabeling
15430 /// Resources documentation.
15431 pub fn set_labels(&self) -> super::builder::snapshots::SetLabels {
15432 super::builder::snapshots::SetLabels::new(self.inner.clone())
15433 }
15434
15435 /// Returns permissions that a caller has on the specified resource.
15436 pub fn test_iam_permissions(&self) -> super::builder::snapshots::TestIamPermissions {
15437 super::builder::snapshots::TestIamPermissions::new(self.inner.clone())
15438 }
15439
15440 /// Retrieves the specified Operations resource.
15441 pub fn get_operation(&self) -> super::builder::snapshots::GetOperation {
15442 super::builder::snapshots::GetOperation::new(self.inner.clone())
15443 }
15444}
15445
15446/// Implements a client for the Google Compute Engine API.
15447///
15448/// # Example
15449/// ```
15450/// # tokio_test::block_on(async {
15451/// # use google_cloud_compute_v1::client::SslCertificates;
15452/// let client = SslCertificates::builder().build().await?;
15453/// // use `client` to make requests to the Google Compute Engine API.
15454/// # gax::client_builder::Result::<()>::Ok(()) });
15455/// ```
15456///
15457/// # Service Description
15458///
15459/// Service for the `sslCertificates` resource.
15460///
15461/// # Configuration
15462///
15463/// To configure `SslCertificates` use the `with_*` methods in the type returned
15464/// by [builder()][SslCertificates::builder]. The default configuration should
15465/// work for most applications. Common configuration changes include
15466///
15467/// * [with_endpoint()]: by default this client uses the global default endpoint
15468/// (`https://compute.googleapis.com`). Applications using regional
15469/// endpoints or running in restricted networks (e.g. a network configured
15470// with [Private Google Access with VPC Service Controls]) may want to
15471/// override this default.
15472/// * [with_credentials()]: by default this client uses
15473/// [Application Default Credentials]. Applications using custom
15474/// authentication may need to override this default.
15475///
15476/// [with_endpoint()]: super::builder::ssl_certificates::ClientBuilder::with_endpoint
15477/// [with_credentials()]: super::builder::ssl_certificates::ClientBuilder::credentials
15478/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15479/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15480///
15481/// # Pooling and Cloning
15482///
15483/// `SslCertificates` holds a connection pool internally, it is advised to
15484/// create one and the reuse it. You do not need to wrap `SslCertificates` in
15485/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15486/// already uses an `Arc` internally.
15487#[cfg(feature = "ssl-certificates")]
15488#[cfg_attr(docsrs, doc(cfg(feature = "ssl-certificates")))]
15489#[derive(Clone, Debug)]
15490pub struct SslCertificates {
15491 inner: std::sync::Arc<dyn super::stub::dynamic::SslCertificates>,
15492}
15493
15494#[cfg(feature = "ssl-certificates")]
15495impl SslCertificates {
15496 /// Returns a builder for [SslCertificates].
15497 ///
15498 /// ```
15499 /// # tokio_test::block_on(async {
15500 /// # use google_cloud_compute_v1::client::SslCertificates;
15501 /// let client = SslCertificates::builder().build().await?;
15502 /// # gax::client_builder::Result::<()>::Ok(()) });
15503 /// ```
15504 pub fn builder() -> super::builder::ssl_certificates::ClientBuilder {
15505 gax::client_builder::internal::new_builder(
15506 super::builder::ssl_certificates::client::Factory,
15507 )
15508 }
15509
15510 /// Creates a new client from the provided stub.
15511 ///
15512 /// The most common case for calling this function is in tests mocking the
15513 /// client's behavior.
15514 pub fn from_stub<T>(stub: T) -> Self
15515 where
15516 T: super::stub::SslCertificates + 'static,
15517 {
15518 Self {
15519 inner: std::sync::Arc::new(stub),
15520 }
15521 }
15522
15523 pub(crate) async fn new(
15524 config: gaxi::options::ClientConfig,
15525 ) -> gax::client_builder::Result<Self> {
15526 let inner = Self::build_inner(config).await?;
15527 Ok(Self { inner })
15528 }
15529
15530 async fn build_inner(
15531 conf: gaxi::options::ClientConfig,
15532 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::SslCertificates>>
15533 {
15534 if gaxi::options::tracing_enabled(&conf) {
15535 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15536 }
15537 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15538 }
15539
15540 async fn build_transport(
15541 conf: gaxi::options::ClientConfig,
15542 ) -> gax::client_builder::Result<impl super::stub::SslCertificates> {
15543 super::transport::SslCertificates::new(conf).await
15544 }
15545
15546 async fn build_with_tracing(
15547 conf: gaxi::options::ClientConfig,
15548 ) -> gax::client_builder::Result<impl super::stub::SslCertificates> {
15549 Self::build_transport(conf)
15550 .await
15551 .map(super::tracing::SslCertificates::new)
15552 }
15553
15554 /// Retrieves the list of all SslCertificate resources, regional and global,
15555 /// available to the specified project.
15556 ///
15557 /// To prevent failure, Google recommends that you set the
15558 /// `returnPartialSuccess` parameter to `true`.
15559 pub fn aggregated_list(&self) -> super::builder::ssl_certificates::AggregatedList {
15560 super::builder::ssl_certificates::AggregatedList::new(self.inner.clone())
15561 }
15562
15563 /// Deletes the specified SslCertificate resource.
15564 pub fn delete(&self) -> super::builder::ssl_certificates::Delete {
15565 super::builder::ssl_certificates::Delete::new(self.inner.clone())
15566 }
15567
15568 /// Returns the specified SslCertificate resource.
15569 pub fn get(&self) -> super::builder::ssl_certificates::Get {
15570 super::builder::ssl_certificates::Get::new(self.inner.clone())
15571 }
15572
15573 /// Creates a SslCertificate resource in the specified project using the data
15574 /// included in the request.
15575 pub fn insert(&self) -> super::builder::ssl_certificates::Insert {
15576 super::builder::ssl_certificates::Insert::new(self.inner.clone())
15577 }
15578
15579 /// Retrieves the list of SslCertificate resources available to the specified
15580 /// project.
15581 pub fn list(&self) -> super::builder::ssl_certificates::List {
15582 super::builder::ssl_certificates::List::new(self.inner.clone())
15583 }
15584
15585 /// Retrieves the specified Operations resource.
15586 pub fn get_operation(&self) -> super::builder::ssl_certificates::GetOperation {
15587 super::builder::ssl_certificates::GetOperation::new(self.inner.clone())
15588 }
15589}
15590
15591/// Implements a client for the Google Compute Engine API.
15592///
15593/// # Example
15594/// ```
15595/// # tokio_test::block_on(async {
15596/// # use google_cloud_compute_v1::client::SslPolicies;
15597/// let client = SslPolicies::builder().build().await?;
15598/// // use `client` to make requests to the Google Compute Engine API.
15599/// # gax::client_builder::Result::<()>::Ok(()) });
15600/// ```
15601///
15602/// # Service Description
15603///
15604/// Service for the `sslPolicies` resource.
15605///
15606/// # Configuration
15607///
15608/// To configure `SslPolicies` use the `with_*` methods in the type returned
15609/// by [builder()][SslPolicies::builder]. The default configuration should
15610/// work for most applications. Common configuration changes include
15611///
15612/// * [with_endpoint()]: by default this client uses the global default endpoint
15613/// (`https://compute.googleapis.com`). Applications using regional
15614/// endpoints or running in restricted networks (e.g. a network configured
15615// with [Private Google Access with VPC Service Controls]) may want to
15616/// override this default.
15617/// * [with_credentials()]: by default this client uses
15618/// [Application Default Credentials]. Applications using custom
15619/// authentication may need to override this default.
15620///
15621/// [with_endpoint()]: super::builder::ssl_policies::ClientBuilder::with_endpoint
15622/// [with_credentials()]: super::builder::ssl_policies::ClientBuilder::credentials
15623/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15624/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15625///
15626/// # Pooling and Cloning
15627///
15628/// `SslPolicies` holds a connection pool internally, it is advised to
15629/// create one and the reuse it. You do not need to wrap `SslPolicies` in
15630/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15631/// already uses an `Arc` internally.
15632#[cfg(feature = "ssl-policies")]
15633#[cfg_attr(docsrs, doc(cfg(feature = "ssl-policies")))]
15634#[derive(Clone, Debug)]
15635pub struct SslPolicies {
15636 inner: std::sync::Arc<dyn super::stub::dynamic::SslPolicies>,
15637}
15638
15639#[cfg(feature = "ssl-policies")]
15640impl SslPolicies {
15641 /// Returns a builder for [SslPolicies].
15642 ///
15643 /// ```
15644 /// # tokio_test::block_on(async {
15645 /// # use google_cloud_compute_v1::client::SslPolicies;
15646 /// let client = SslPolicies::builder().build().await?;
15647 /// # gax::client_builder::Result::<()>::Ok(()) });
15648 /// ```
15649 pub fn builder() -> super::builder::ssl_policies::ClientBuilder {
15650 gax::client_builder::internal::new_builder(super::builder::ssl_policies::client::Factory)
15651 }
15652
15653 /// Creates a new client from the provided stub.
15654 ///
15655 /// The most common case for calling this function is in tests mocking the
15656 /// client's behavior.
15657 pub fn from_stub<T>(stub: T) -> Self
15658 where
15659 T: super::stub::SslPolicies + 'static,
15660 {
15661 Self {
15662 inner: std::sync::Arc::new(stub),
15663 }
15664 }
15665
15666 pub(crate) async fn new(
15667 config: gaxi::options::ClientConfig,
15668 ) -> gax::client_builder::Result<Self> {
15669 let inner = Self::build_inner(config).await?;
15670 Ok(Self { inner })
15671 }
15672
15673 async fn build_inner(
15674 conf: gaxi::options::ClientConfig,
15675 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::SslPolicies>> {
15676 if gaxi::options::tracing_enabled(&conf) {
15677 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15678 }
15679 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15680 }
15681
15682 async fn build_transport(
15683 conf: gaxi::options::ClientConfig,
15684 ) -> gax::client_builder::Result<impl super::stub::SslPolicies> {
15685 super::transport::SslPolicies::new(conf).await
15686 }
15687
15688 async fn build_with_tracing(
15689 conf: gaxi::options::ClientConfig,
15690 ) -> gax::client_builder::Result<impl super::stub::SslPolicies> {
15691 Self::build_transport(conf)
15692 .await
15693 .map(super::tracing::SslPolicies::new)
15694 }
15695
15696 /// Retrieves the list of all SslPolicy resources, regional and global,
15697 /// available to the specified project.
15698 ///
15699 /// To prevent failure, Google recommends that you set the
15700 /// `returnPartialSuccess` parameter to `true`.
15701 pub fn aggregated_list(&self) -> super::builder::ssl_policies::AggregatedList {
15702 super::builder::ssl_policies::AggregatedList::new(self.inner.clone())
15703 }
15704
15705 /// Deletes the specified SSL policy. The SSL policy resource can be deleted
15706 /// only if it is not in use by any TargetHttpsProxy or TargetSslProxy
15707 /// resources.
15708 pub fn delete(&self) -> super::builder::ssl_policies::Delete {
15709 super::builder::ssl_policies::Delete::new(self.inner.clone())
15710 }
15711
15712 /// Lists all of the ordered rules present in a single specified policy.
15713 pub fn get(&self) -> super::builder::ssl_policies::Get {
15714 super::builder::ssl_policies::Get::new(self.inner.clone())
15715 }
15716
15717 /// Returns the specified SSL policy resource.
15718 pub fn insert(&self) -> super::builder::ssl_policies::Insert {
15719 super::builder::ssl_policies::Insert::new(self.inner.clone())
15720 }
15721
15722 /// Lists all the SSL policies that have been configured for the specified
15723 /// project.
15724 pub fn list(&self) -> super::builder::ssl_policies::List {
15725 super::builder::ssl_policies::List::new(self.inner.clone())
15726 }
15727
15728 /// Lists all features that can be specified in the SSL policy when using
15729 /// custom profile.
15730 pub fn list_available_features(&self) -> super::builder::ssl_policies::ListAvailableFeatures {
15731 super::builder::ssl_policies::ListAvailableFeatures::new(self.inner.clone())
15732 }
15733
15734 /// Patches the specified SSL policy with the data included in the request.
15735 pub fn patch(&self) -> super::builder::ssl_policies::Patch {
15736 super::builder::ssl_policies::Patch::new(self.inner.clone())
15737 }
15738
15739 /// Retrieves the specified Operations resource.
15740 pub fn get_operation(&self) -> super::builder::ssl_policies::GetOperation {
15741 super::builder::ssl_policies::GetOperation::new(self.inner.clone())
15742 }
15743}
15744
15745/// Implements a client for the Google Compute Engine API.
15746///
15747/// # Example
15748/// ```
15749/// # tokio_test::block_on(async {
15750/// # use google_cloud_compute_v1::client::StoragePoolTypes;
15751/// let client = StoragePoolTypes::builder().build().await?;
15752/// // use `client` to make requests to the Google Compute Engine API.
15753/// # gax::client_builder::Result::<()>::Ok(()) });
15754/// ```
15755///
15756/// # Service Description
15757///
15758/// Service for the `storagePoolTypes` resource.
15759///
15760/// # Configuration
15761///
15762/// To configure `StoragePoolTypes` use the `with_*` methods in the type returned
15763/// by [builder()][StoragePoolTypes::builder]. The default configuration should
15764/// work for most applications. Common configuration changes include
15765///
15766/// * [with_endpoint()]: by default this client uses the global default endpoint
15767/// (`https://compute.googleapis.com`). Applications using regional
15768/// endpoints or running in restricted networks (e.g. a network configured
15769// with [Private Google Access with VPC Service Controls]) may want to
15770/// override this default.
15771/// * [with_credentials()]: by default this client uses
15772/// [Application Default Credentials]. Applications using custom
15773/// authentication may need to override this default.
15774///
15775/// [with_endpoint()]: super::builder::storage_pool_types::ClientBuilder::with_endpoint
15776/// [with_credentials()]: super::builder::storage_pool_types::ClientBuilder::credentials
15777/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15778/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15779///
15780/// # Pooling and Cloning
15781///
15782/// `StoragePoolTypes` holds a connection pool internally, it is advised to
15783/// create one and the reuse it. You do not need to wrap `StoragePoolTypes` in
15784/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15785/// already uses an `Arc` internally.
15786#[cfg(feature = "storage-pool-types")]
15787#[cfg_attr(docsrs, doc(cfg(feature = "storage-pool-types")))]
15788#[derive(Clone, Debug)]
15789pub struct StoragePoolTypes {
15790 inner: std::sync::Arc<dyn super::stub::dynamic::StoragePoolTypes>,
15791}
15792
15793#[cfg(feature = "storage-pool-types")]
15794impl StoragePoolTypes {
15795 /// Returns a builder for [StoragePoolTypes].
15796 ///
15797 /// ```
15798 /// # tokio_test::block_on(async {
15799 /// # use google_cloud_compute_v1::client::StoragePoolTypes;
15800 /// let client = StoragePoolTypes::builder().build().await?;
15801 /// # gax::client_builder::Result::<()>::Ok(()) });
15802 /// ```
15803 pub fn builder() -> super::builder::storage_pool_types::ClientBuilder {
15804 gax::client_builder::internal::new_builder(
15805 super::builder::storage_pool_types::client::Factory,
15806 )
15807 }
15808
15809 /// Creates a new client from the provided stub.
15810 ///
15811 /// The most common case for calling this function is in tests mocking the
15812 /// client's behavior.
15813 pub fn from_stub<T>(stub: T) -> Self
15814 where
15815 T: super::stub::StoragePoolTypes + 'static,
15816 {
15817 Self {
15818 inner: std::sync::Arc::new(stub),
15819 }
15820 }
15821
15822 pub(crate) async fn new(
15823 config: gaxi::options::ClientConfig,
15824 ) -> gax::client_builder::Result<Self> {
15825 let inner = Self::build_inner(config).await?;
15826 Ok(Self { inner })
15827 }
15828
15829 async fn build_inner(
15830 conf: gaxi::options::ClientConfig,
15831 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::StoragePoolTypes>>
15832 {
15833 if gaxi::options::tracing_enabled(&conf) {
15834 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15835 }
15836 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15837 }
15838
15839 async fn build_transport(
15840 conf: gaxi::options::ClientConfig,
15841 ) -> gax::client_builder::Result<impl super::stub::StoragePoolTypes> {
15842 super::transport::StoragePoolTypes::new(conf).await
15843 }
15844
15845 async fn build_with_tracing(
15846 conf: gaxi::options::ClientConfig,
15847 ) -> gax::client_builder::Result<impl super::stub::StoragePoolTypes> {
15848 Self::build_transport(conf)
15849 .await
15850 .map(super::tracing::StoragePoolTypes::new)
15851 }
15852
15853 /// Retrieves an aggregated list of storage pool types.
15854 ///
15855 /// To prevent failure, Google recommends that you set the
15856 /// `returnPartialSuccess` parameter to `true`.
15857 pub fn aggregated_list(&self) -> super::builder::storage_pool_types::AggregatedList {
15858 super::builder::storage_pool_types::AggregatedList::new(self.inner.clone())
15859 }
15860
15861 /// Returns the specified storage pool type.
15862 pub fn get(&self) -> super::builder::storage_pool_types::Get {
15863 super::builder::storage_pool_types::Get::new(self.inner.clone())
15864 }
15865
15866 /// Retrieves a list of storage pool types available to the specified
15867 /// project.
15868 pub fn list(&self) -> super::builder::storage_pool_types::List {
15869 super::builder::storage_pool_types::List::new(self.inner.clone())
15870 }
15871}
15872
15873/// Implements a client for the Google Compute Engine API.
15874///
15875/// # Example
15876/// ```
15877/// # tokio_test::block_on(async {
15878/// # use google_cloud_compute_v1::client::StoragePools;
15879/// let client = StoragePools::builder().build().await?;
15880/// // use `client` to make requests to the Google Compute Engine API.
15881/// # gax::client_builder::Result::<()>::Ok(()) });
15882/// ```
15883///
15884/// # Service Description
15885///
15886/// Service for the `storagePools` resource.
15887///
15888/// # Configuration
15889///
15890/// To configure `StoragePools` use the `with_*` methods in the type returned
15891/// by [builder()][StoragePools::builder]. The default configuration should
15892/// work for most applications. Common configuration changes include
15893///
15894/// * [with_endpoint()]: by default this client uses the global default endpoint
15895/// (`https://compute.googleapis.com`). Applications using regional
15896/// endpoints or running in restricted networks (e.g. a network configured
15897// with [Private Google Access with VPC Service Controls]) may want to
15898/// override this default.
15899/// * [with_credentials()]: by default this client uses
15900/// [Application Default Credentials]. Applications using custom
15901/// authentication may need to override this default.
15902///
15903/// [with_endpoint()]: super::builder::storage_pools::ClientBuilder::with_endpoint
15904/// [with_credentials()]: super::builder::storage_pools::ClientBuilder::credentials
15905/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15906/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15907///
15908/// # Pooling and Cloning
15909///
15910/// `StoragePools` holds a connection pool internally, it is advised to
15911/// create one and the reuse it. You do not need to wrap `StoragePools` in
15912/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15913/// already uses an `Arc` internally.
15914#[cfg(feature = "storage-pools")]
15915#[cfg_attr(docsrs, doc(cfg(feature = "storage-pools")))]
15916#[derive(Clone, Debug)]
15917pub struct StoragePools {
15918 inner: std::sync::Arc<dyn super::stub::dynamic::StoragePools>,
15919}
15920
15921#[cfg(feature = "storage-pools")]
15922impl StoragePools {
15923 /// Returns a builder for [StoragePools].
15924 ///
15925 /// ```
15926 /// # tokio_test::block_on(async {
15927 /// # use google_cloud_compute_v1::client::StoragePools;
15928 /// let client = StoragePools::builder().build().await?;
15929 /// # gax::client_builder::Result::<()>::Ok(()) });
15930 /// ```
15931 pub fn builder() -> super::builder::storage_pools::ClientBuilder {
15932 gax::client_builder::internal::new_builder(super::builder::storage_pools::client::Factory)
15933 }
15934
15935 /// Creates a new client from the provided stub.
15936 ///
15937 /// The most common case for calling this function is in tests mocking the
15938 /// client's behavior.
15939 pub fn from_stub<T>(stub: T) -> Self
15940 where
15941 T: super::stub::StoragePools + 'static,
15942 {
15943 Self {
15944 inner: std::sync::Arc::new(stub),
15945 }
15946 }
15947
15948 pub(crate) async fn new(
15949 config: gaxi::options::ClientConfig,
15950 ) -> gax::client_builder::Result<Self> {
15951 let inner = Self::build_inner(config).await?;
15952 Ok(Self { inner })
15953 }
15954
15955 async fn build_inner(
15956 conf: gaxi::options::ClientConfig,
15957 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::StoragePools>> {
15958 if gaxi::options::tracing_enabled(&conf) {
15959 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15960 }
15961 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15962 }
15963
15964 async fn build_transport(
15965 conf: gaxi::options::ClientConfig,
15966 ) -> gax::client_builder::Result<impl super::stub::StoragePools> {
15967 super::transport::StoragePools::new(conf).await
15968 }
15969
15970 async fn build_with_tracing(
15971 conf: gaxi::options::ClientConfig,
15972 ) -> gax::client_builder::Result<impl super::stub::StoragePools> {
15973 Self::build_transport(conf)
15974 .await
15975 .map(super::tracing::StoragePools::new)
15976 }
15977
15978 /// Retrieves an aggregated list of storage pools.
15979 ///
15980 /// To prevent failure, Google recommends that you set the
15981 /// `returnPartialSuccess` parameter to `true`.
15982 pub fn aggregated_list(&self) -> super::builder::storage_pools::AggregatedList {
15983 super::builder::storage_pools::AggregatedList::new(self.inner.clone())
15984 }
15985
15986 /// Deletes the specified storage pool. Deleting a storagePool
15987 /// removes its data permanently and is irreversible. However, deleting a
15988 /// storagePool does not delete any snapshots previously
15989 /// made from the storagePool. You must separately delete
15990 /// snapshots.
15991 pub fn delete(&self) -> super::builder::storage_pools::Delete {
15992 super::builder::storage_pools::Delete::new(self.inner.clone())
15993 }
15994
15995 /// Returns a specified storage pool. Gets a list of available
15996 /// storage pools by making a list() request.
15997 pub fn get(&self) -> super::builder::storage_pools::Get {
15998 super::builder::storage_pools::Get::new(self.inner.clone())
15999 }
16000
16001 /// Gets the access control policy for a resource. May be empty if no such
16002 /// policy or resource exists.
16003 pub fn get_iam_policy(&self) -> super::builder::storage_pools::GetIamPolicy {
16004 super::builder::storage_pools::GetIamPolicy::new(self.inner.clone())
16005 }
16006
16007 /// Creates a storage pool in the specified project using the data
16008 /// in the request.
16009 pub fn insert(&self) -> super::builder::storage_pools::Insert {
16010 super::builder::storage_pools::Insert::new(self.inner.clone())
16011 }
16012
16013 /// Retrieves a list of storage pools contained within
16014 /// the specified zone.
16015 pub fn list(&self) -> super::builder::storage_pools::List {
16016 super::builder::storage_pools::List::new(self.inner.clone())
16017 }
16018
16019 /// Lists the disks in a specified storage pool.
16020 pub fn list_disks(&self) -> super::builder::storage_pools::ListDisks {
16021 super::builder::storage_pools::ListDisks::new(self.inner.clone())
16022 }
16023
16024 /// Sets the access control policy on the specified resource.
16025 /// Replaces any existing policy.
16026 pub fn set_iam_policy(&self) -> super::builder::storage_pools::SetIamPolicy {
16027 super::builder::storage_pools::SetIamPolicy::new(self.inner.clone())
16028 }
16029
16030 /// Returns permissions that a caller has on the specified resource.
16031 pub fn test_iam_permissions(&self) -> super::builder::storage_pools::TestIamPermissions {
16032 super::builder::storage_pools::TestIamPermissions::new(self.inner.clone())
16033 }
16034
16035 /// Updates the specified storagePool with the data included in the request.
16036 /// The update is performed only on selected fields included as part
16037 /// of update-mask. Only the following fields can be modified:
16038 /// pool_provisioned_capacity_gb, pool_provisioned_iops and
16039 /// pool_provisioned_throughput.
16040 pub fn update(&self) -> super::builder::storage_pools::Update {
16041 super::builder::storage_pools::Update::new(self.inner.clone())
16042 }
16043
16044 /// Retrieves the specified zone-specific Operations resource.
16045 pub fn get_operation(&self) -> super::builder::storage_pools::GetOperation {
16046 super::builder::storage_pools::GetOperation::new(self.inner.clone())
16047 }
16048}
16049
16050/// Implements a client for the Google Compute Engine API.
16051///
16052/// # Example
16053/// ```
16054/// # tokio_test::block_on(async {
16055/// # use google_cloud_compute_v1::client::Subnetworks;
16056/// let client = Subnetworks::builder().build().await?;
16057/// // use `client` to make requests to the Google Compute Engine API.
16058/// # gax::client_builder::Result::<()>::Ok(()) });
16059/// ```
16060///
16061/// # Service Description
16062///
16063/// Service for the `subnetworks` resource.
16064///
16065/// # Configuration
16066///
16067/// To configure `Subnetworks` use the `with_*` methods in the type returned
16068/// by [builder()][Subnetworks::builder]. The default configuration should
16069/// work for most applications. Common configuration changes include
16070///
16071/// * [with_endpoint()]: by default this client uses the global default endpoint
16072/// (`https://compute.googleapis.com`). Applications using regional
16073/// endpoints or running in restricted networks (e.g. a network configured
16074// with [Private Google Access with VPC Service Controls]) may want to
16075/// override this default.
16076/// * [with_credentials()]: by default this client uses
16077/// [Application Default Credentials]. Applications using custom
16078/// authentication may need to override this default.
16079///
16080/// [with_endpoint()]: super::builder::subnetworks::ClientBuilder::with_endpoint
16081/// [with_credentials()]: super::builder::subnetworks::ClientBuilder::credentials
16082/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16083/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16084///
16085/// # Pooling and Cloning
16086///
16087/// `Subnetworks` holds a connection pool internally, it is advised to
16088/// create one and the reuse it. You do not need to wrap `Subnetworks` in
16089/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16090/// already uses an `Arc` internally.
16091#[cfg(feature = "subnetworks")]
16092#[cfg_attr(docsrs, doc(cfg(feature = "subnetworks")))]
16093#[derive(Clone, Debug)]
16094pub struct Subnetworks {
16095 inner: std::sync::Arc<dyn super::stub::dynamic::Subnetworks>,
16096}
16097
16098#[cfg(feature = "subnetworks")]
16099impl Subnetworks {
16100 /// Returns a builder for [Subnetworks].
16101 ///
16102 /// ```
16103 /// # tokio_test::block_on(async {
16104 /// # use google_cloud_compute_v1::client::Subnetworks;
16105 /// let client = Subnetworks::builder().build().await?;
16106 /// # gax::client_builder::Result::<()>::Ok(()) });
16107 /// ```
16108 pub fn builder() -> super::builder::subnetworks::ClientBuilder {
16109 gax::client_builder::internal::new_builder(super::builder::subnetworks::client::Factory)
16110 }
16111
16112 /// Creates a new client from the provided stub.
16113 ///
16114 /// The most common case for calling this function is in tests mocking the
16115 /// client's behavior.
16116 pub fn from_stub<T>(stub: T) -> Self
16117 where
16118 T: super::stub::Subnetworks + 'static,
16119 {
16120 Self {
16121 inner: std::sync::Arc::new(stub),
16122 }
16123 }
16124
16125 pub(crate) async fn new(
16126 config: gaxi::options::ClientConfig,
16127 ) -> gax::client_builder::Result<Self> {
16128 let inner = Self::build_inner(config).await?;
16129 Ok(Self { inner })
16130 }
16131
16132 async fn build_inner(
16133 conf: gaxi::options::ClientConfig,
16134 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Subnetworks>> {
16135 if gaxi::options::tracing_enabled(&conf) {
16136 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16137 }
16138 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16139 }
16140
16141 async fn build_transport(
16142 conf: gaxi::options::ClientConfig,
16143 ) -> gax::client_builder::Result<impl super::stub::Subnetworks> {
16144 super::transport::Subnetworks::new(conf).await
16145 }
16146
16147 async fn build_with_tracing(
16148 conf: gaxi::options::ClientConfig,
16149 ) -> gax::client_builder::Result<impl super::stub::Subnetworks> {
16150 Self::build_transport(conf)
16151 .await
16152 .map(super::tracing::Subnetworks::new)
16153 }
16154
16155 /// Retrieves an aggregated list of subnetworks.
16156 ///
16157 /// To prevent failure, Google recommends that you set the
16158 /// `returnPartialSuccess` parameter to `true`.
16159 pub fn aggregated_list(&self) -> super::builder::subnetworks::AggregatedList {
16160 super::builder::subnetworks::AggregatedList::new(self.inner.clone())
16161 }
16162
16163 /// Deletes the specified subnetwork.
16164 pub fn delete(&self) -> super::builder::subnetworks::Delete {
16165 super::builder::subnetworks::Delete::new(self.inner.clone())
16166 }
16167
16168 /// Expands the IP CIDR range of the subnetwork to a specified value.
16169 pub fn expand_ip_cidr_range(&self) -> super::builder::subnetworks::ExpandIpCidrRange {
16170 super::builder::subnetworks::ExpandIpCidrRange::new(self.inner.clone())
16171 }
16172
16173 /// Returns the specified subnetwork.
16174 pub fn get(&self) -> super::builder::subnetworks::Get {
16175 super::builder::subnetworks::Get::new(self.inner.clone())
16176 }
16177
16178 /// Gets the access control policy for a resource. May be empty if no such
16179 /// policy or resource exists.
16180 pub fn get_iam_policy(&self) -> super::builder::subnetworks::GetIamPolicy {
16181 super::builder::subnetworks::GetIamPolicy::new(self.inner.clone())
16182 }
16183
16184 /// Creates a subnetwork in the specified project using the data
16185 /// included in the request.
16186 pub fn insert(&self) -> super::builder::subnetworks::Insert {
16187 super::builder::subnetworks::Insert::new(self.inner.clone())
16188 }
16189
16190 /// Retrieves a list of subnetworks available to the specified
16191 /// project.
16192 pub fn list(&self) -> super::builder::subnetworks::List {
16193 super::builder::subnetworks::List::new(self.inner.clone())
16194 }
16195
16196 /// Retrieves an aggregated list of all usable subnetworks in the project.
16197 pub fn list_usable(&self) -> super::builder::subnetworks::ListUsable {
16198 super::builder::subnetworks::ListUsable::new(self.inner.clone())
16199 }
16200
16201 /// Patches the specified subnetwork with the data included in the request.
16202 /// Only certain fields can be updated with a patch request
16203 /// as indicated in the field descriptions.
16204 /// You must specify the current fingerprint of the
16205 /// subnetwork resource being patched.
16206 pub fn patch(&self) -> super::builder::subnetworks::Patch {
16207 super::builder::subnetworks::Patch::new(self.inner.clone())
16208 }
16209
16210 /// Sets the access control policy on the specified resource.
16211 /// Replaces any existing policy.
16212 pub fn set_iam_policy(&self) -> super::builder::subnetworks::SetIamPolicy {
16213 super::builder::subnetworks::SetIamPolicy::new(self.inner.clone())
16214 }
16215
16216 /// Set whether VMs in this subnet can access Google services without assigning
16217 /// external IP addresses through Private Google Access.
16218 pub fn set_private_ip_google_access(
16219 &self,
16220 ) -> super::builder::subnetworks::SetPrivateIpGoogleAccess {
16221 super::builder::subnetworks::SetPrivateIpGoogleAccess::new(self.inner.clone())
16222 }
16223
16224 /// Returns permissions that a caller has on the specified resource.
16225 pub fn test_iam_permissions(&self) -> super::builder::subnetworks::TestIamPermissions {
16226 super::builder::subnetworks::TestIamPermissions::new(self.inner.clone())
16227 }
16228
16229 /// Retrieves the specified region-specific Operations resource.
16230 pub fn get_operation(&self) -> super::builder::subnetworks::GetOperation {
16231 super::builder::subnetworks::GetOperation::new(self.inner.clone())
16232 }
16233}
16234
16235/// Implements a client for the Google Compute Engine API.
16236///
16237/// # Example
16238/// ```
16239/// # tokio_test::block_on(async {
16240/// # use google_cloud_compute_v1::client::TargetGrpcProxies;
16241/// let client = TargetGrpcProxies::builder().build().await?;
16242/// // use `client` to make requests to the Google Compute Engine API.
16243/// # gax::client_builder::Result::<()>::Ok(()) });
16244/// ```
16245///
16246/// # Service Description
16247///
16248/// Service for the `targetGrpcProxies` resource.
16249///
16250/// # Configuration
16251///
16252/// To configure `TargetGrpcProxies` use the `with_*` methods in the type returned
16253/// by [builder()][TargetGrpcProxies::builder]. The default configuration should
16254/// work for most applications. Common configuration changes include
16255///
16256/// * [with_endpoint()]: by default this client uses the global default endpoint
16257/// (`https://compute.googleapis.com`). Applications using regional
16258/// endpoints or running in restricted networks (e.g. a network configured
16259// with [Private Google Access with VPC Service Controls]) may want to
16260/// override this default.
16261/// * [with_credentials()]: by default this client uses
16262/// [Application Default Credentials]. Applications using custom
16263/// authentication may need to override this default.
16264///
16265/// [with_endpoint()]: super::builder::target_grpc_proxies::ClientBuilder::with_endpoint
16266/// [with_credentials()]: super::builder::target_grpc_proxies::ClientBuilder::credentials
16267/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16268/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16269///
16270/// # Pooling and Cloning
16271///
16272/// `TargetGrpcProxies` holds a connection pool internally, it is advised to
16273/// create one and the reuse it. You do not need to wrap `TargetGrpcProxies` in
16274/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16275/// already uses an `Arc` internally.
16276#[cfg(feature = "target-grpc-proxies")]
16277#[cfg_attr(docsrs, doc(cfg(feature = "target-grpc-proxies")))]
16278#[derive(Clone, Debug)]
16279pub struct TargetGrpcProxies {
16280 inner: std::sync::Arc<dyn super::stub::dynamic::TargetGrpcProxies>,
16281}
16282
16283#[cfg(feature = "target-grpc-proxies")]
16284impl TargetGrpcProxies {
16285 /// Returns a builder for [TargetGrpcProxies].
16286 ///
16287 /// ```
16288 /// # tokio_test::block_on(async {
16289 /// # use google_cloud_compute_v1::client::TargetGrpcProxies;
16290 /// let client = TargetGrpcProxies::builder().build().await?;
16291 /// # gax::client_builder::Result::<()>::Ok(()) });
16292 /// ```
16293 pub fn builder() -> super::builder::target_grpc_proxies::ClientBuilder {
16294 gax::client_builder::internal::new_builder(
16295 super::builder::target_grpc_proxies::client::Factory,
16296 )
16297 }
16298
16299 /// Creates a new client from the provided stub.
16300 ///
16301 /// The most common case for calling this function is in tests mocking the
16302 /// client's behavior.
16303 pub fn from_stub<T>(stub: T) -> Self
16304 where
16305 T: super::stub::TargetGrpcProxies + 'static,
16306 {
16307 Self {
16308 inner: std::sync::Arc::new(stub),
16309 }
16310 }
16311
16312 pub(crate) async fn new(
16313 config: gaxi::options::ClientConfig,
16314 ) -> gax::client_builder::Result<Self> {
16315 let inner = Self::build_inner(config).await?;
16316 Ok(Self { inner })
16317 }
16318
16319 async fn build_inner(
16320 conf: gaxi::options::ClientConfig,
16321 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::TargetGrpcProxies>>
16322 {
16323 if gaxi::options::tracing_enabled(&conf) {
16324 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16325 }
16326 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16327 }
16328
16329 async fn build_transport(
16330 conf: gaxi::options::ClientConfig,
16331 ) -> gax::client_builder::Result<impl super::stub::TargetGrpcProxies> {
16332 super::transport::TargetGrpcProxies::new(conf).await
16333 }
16334
16335 async fn build_with_tracing(
16336 conf: gaxi::options::ClientConfig,
16337 ) -> gax::client_builder::Result<impl super::stub::TargetGrpcProxies> {
16338 Self::build_transport(conf)
16339 .await
16340 .map(super::tracing::TargetGrpcProxies::new)
16341 }
16342
16343 /// Deletes the specified TargetGrpcProxy in the given scope
16344 pub fn delete(&self) -> super::builder::target_grpc_proxies::Delete {
16345 super::builder::target_grpc_proxies::Delete::new(self.inner.clone())
16346 }
16347
16348 /// Returns the specified TargetGrpcProxy resource in the given scope.
16349 pub fn get(&self) -> super::builder::target_grpc_proxies::Get {
16350 super::builder::target_grpc_proxies::Get::new(self.inner.clone())
16351 }
16352
16353 /// Creates a TargetGrpcProxy in the specified project in the given scope
16354 /// using the parameters that are included in the request.
16355 pub fn insert(&self) -> super::builder::target_grpc_proxies::Insert {
16356 super::builder::target_grpc_proxies::Insert::new(self.inner.clone())
16357 }
16358
16359 /// Lists the TargetGrpcProxies for a project in the given scope.
16360 pub fn list(&self) -> super::builder::target_grpc_proxies::List {
16361 super::builder::target_grpc_proxies::List::new(self.inner.clone())
16362 }
16363
16364 /// Patches the specified TargetGrpcProxy resource with the data included in
16365 /// the request. This method supports PATCH
16366 /// semantics and usesJSON merge
16367 /// patch format and processing rules.
16368 pub fn patch(&self) -> super::builder::target_grpc_proxies::Patch {
16369 super::builder::target_grpc_proxies::Patch::new(self.inner.clone())
16370 }
16371
16372 /// Retrieves the specified Operations resource.
16373 pub fn get_operation(&self) -> super::builder::target_grpc_proxies::GetOperation {
16374 super::builder::target_grpc_proxies::GetOperation::new(self.inner.clone())
16375 }
16376}
16377
16378/// Implements a client for the Google Compute Engine API.
16379///
16380/// # Example
16381/// ```
16382/// # tokio_test::block_on(async {
16383/// # use google_cloud_compute_v1::client::TargetHttpProxies;
16384/// let client = TargetHttpProxies::builder().build().await?;
16385/// // use `client` to make requests to the Google Compute Engine API.
16386/// # gax::client_builder::Result::<()>::Ok(()) });
16387/// ```
16388///
16389/// # Service Description
16390///
16391/// Service for the `targetHttpProxies` resource.
16392///
16393/// # Configuration
16394///
16395/// To configure `TargetHttpProxies` use the `with_*` methods in the type returned
16396/// by [builder()][TargetHttpProxies::builder]. The default configuration should
16397/// work for most applications. Common configuration changes include
16398///
16399/// * [with_endpoint()]: by default this client uses the global default endpoint
16400/// (`https://compute.googleapis.com`). Applications using regional
16401/// endpoints or running in restricted networks (e.g. a network configured
16402// with [Private Google Access with VPC Service Controls]) may want to
16403/// override this default.
16404/// * [with_credentials()]: by default this client uses
16405/// [Application Default Credentials]. Applications using custom
16406/// authentication may need to override this default.
16407///
16408/// [with_endpoint()]: super::builder::target_http_proxies::ClientBuilder::with_endpoint
16409/// [with_credentials()]: super::builder::target_http_proxies::ClientBuilder::credentials
16410/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16411/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16412///
16413/// # Pooling and Cloning
16414///
16415/// `TargetHttpProxies` holds a connection pool internally, it is advised to
16416/// create one and the reuse it. You do not need to wrap `TargetHttpProxies` in
16417/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16418/// already uses an `Arc` internally.
16419#[cfg(feature = "target-http-proxies")]
16420#[cfg_attr(docsrs, doc(cfg(feature = "target-http-proxies")))]
16421#[derive(Clone, Debug)]
16422pub struct TargetHttpProxies {
16423 inner: std::sync::Arc<dyn super::stub::dynamic::TargetHttpProxies>,
16424}
16425
16426#[cfg(feature = "target-http-proxies")]
16427impl TargetHttpProxies {
16428 /// Returns a builder for [TargetHttpProxies].
16429 ///
16430 /// ```
16431 /// # tokio_test::block_on(async {
16432 /// # use google_cloud_compute_v1::client::TargetHttpProxies;
16433 /// let client = TargetHttpProxies::builder().build().await?;
16434 /// # gax::client_builder::Result::<()>::Ok(()) });
16435 /// ```
16436 pub fn builder() -> super::builder::target_http_proxies::ClientBuilder {
16437 gax::client_builder::internal::new_builder(
16438 super::builder::target_http_proxies::client::Factory,
16439 )
16440 }
16441
16442 /// Creates a new client from the provided stub.
16443 ///
16444 /// The most common case for calling this function is in tests mocking the
16445 /// client's behavior.
16446 pub fn from_stub<T>(stub: T) -> Self
16447 where
16448 T: super::stub::TargetHttpProxies + 'static,
16449 {
16450 Self {
16451 inner: std::sync::Arc::new(stub),
16452 }
16453 }
16454
16455 pub(crate) async fn new(
16456 config: gaxi::options::ClientConfig,
16457 ) -> gax::client_builder::Result<Self> {
16458 let inner = Self::build_inner(config).await?;
16459 Ok(Self { inner })
16460 }
16461
16462 async fn build_inner(
16463 conf: gaxi::options::ClientConfig,
16464 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::TargetHttpProxies>>
16465 {
16466 if gaxi::options::tracing_enabled(&conf) {
16467 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16468 }
16469 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16470 }
16471
16472 async fn build_transport(
16473 conf: gaxi::options::ClientConfig,
16474 ) -> gax::client_builder::Result<impl super::stub::TargetHttpProxies> {
16475 super::transport::TargetHttpProxies::new(conf).await
16476 }
16477
16478 async fn build_with_tracing(
16479 conf: gaxi::options::ClientConfig,
16480 ) -> gax::client_builder::Result<impl super::stub::TargetHttpProxies> {
16481 Self::build_transport(conf)
16482 .await
16483 .map(super::tracing::TargetHttpProxies::new)
16484 }
16485
16486 /// Retrieves the list of all TargetHttpProxy resources, regional and global,
16487 /// available to the specified project.
16488 ///
16489 /// To prevent failure, Google recommends that you set the
16490 /// `returnPartialSuccess` parameter to `true`.
16491 pub fn aggregated_list(&self) -> super::builder::target_http_proxies::AggregatedList {
16492 super::builder::target_http_proxies::AggregatedList::new(self.inner.clone())
16493 }
16494
16495 /// Deletes the specified TargetHttpProxy resource.
16496 pub fn delete(&self) -> super::builder::target_http_proxies::Delete {
16497 super::builder::target_http_proxies::Delete::new(self.inner.clone())
16498 }
16499
16500 /// Returns the specified TargetHttpProxy resource.
16501 pub fn get(&self) -> super::builder::target_http_proxies::Get {
16502 super::builder::target_http_proxies::Get::new(self.inner.clone())
16503 }
16504
16505 /// Creates a TargetHttpProxy resource in the specified
16506 /// project using the data included in the request.
16507 pub fn insert(&self) -> super::builder::target_http_proxies::Insert {
16508 super::builder::target_http_proxies::Insert::new(self.inner.clone())
16509 }
16510
16511 /// Retrieves the list of TargetHttpProxy resources available
16512 /// to the specified project.
16513 pub fn list(&self) -> super::builder::target_http_proxies::List {
16514 super::builder::target_http_proxies::List::new(self.inner.clone())
16515 }
16516
16517 /// Patches the specified TargetHttpProxy resource with the data included in
16518 /// the request. This method supports PATCH
16519 /// semantics and usesJSON merge
16520 /// patch format and processing rules.
16521 pub fn patch(&self) -> super::builder::target_http_proxies::Patch {
16522 super::builder::target_http_proxies::Patch::new(self.inner.clone())
16523 }
16524
16525 /// Changes the URL map for TargetHttpProxy.
16526 pub fn set_url_map(&self) -> super::builder::target_http_proxies::SetUrlMap {
16527 super::builder::target_http_proxies::SetUrlMap::new(self.inner.clone())
16528 }
16529
16530 /// Retrieves the specified Operations resource.
16531 pub fn get_operation(&self) -> super::builder::target_http_proxies::GetOperation {
16532 super::builder::target_http_proxies::GetOperation::new(self.inner.clone())
16533 }
16534}
16535
16536/// Implements a client for the Google Compute Engine API.
16537///
16538/// # Example
16539/// ```
16540/// # tokio_test::block_on(async {
16541/// # use google_cloud_compute_v1::client::TargetHttpsProxies;
16542/// let client = TargetHttpsProxies::builder().build().await?;
16543/// // use `client` to make requests to the Google Compute Engine API.
16544/// # gax::client_builder::Result::<()>::Ok(()) });
16545/// ```
16546///
16547/// # Service Description
16548///
16549/// Service for the `targetHttpsProxies` resource.
16550///
16551/// # Configuration
16552///
16553/// To configure `TargetHttpsProxies` use the `with_*` methods in the type returned
16554/// by [builder()][TargetHttpsProxies::builder]. The default configuration should
16555/// work for most applications. Common configuration changes include
16556///
16557/// * [with_endpoint()]: by default this client uses the global default endpoint
16558/// (`https://compute.googleapis.com`). Applications using regional
16559/// endpoints or running in restricted networks (e.g. a network configured
16560// with [Private Google Access with VPC Service Controls]) may want to
16561/// override this default.
16562/// * [with_credentials()]: by default this client uses
16563/// [Application Default Credentials]. Applications using custom
16564/// authentication may need to override this default.
16565///
16566/// [with_endpoint()]: super::builder::target_https_proxies::ClientBuilder::with_endpoint
16567/// [with_credentials()]: super::builder::target_https_proxies::ClientBuilder::credentials
16568/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16569/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16570///
16571/// # Pooling and Cloning
16572///
16573/// `TargetHttpsProxies` holds a connection pool internally, it is advised to
16574/// create one and the reuse it. You do not need to wrap `TargetHttpsProxies` in
16575/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16576/// already uses an `Arc` internally.
16577#[cfg(feature = "target-https-proxies")]
16578#[cfg_attr(docsrs, doc(cfg(feature = "target-https-proxies")))]
16579#[derive(Clone, Debug)]
16580pub struct TargetHttpsProxies {
16581 inner: std::sync::Arc<dyn super::stub::dynamic::TargetHttpsProxies>,
16582}
16583
16584#[cfg(feature = "target-https-proxies")]
16585impl TargetHttpsProxies {
16586 /// Returns a builder for [TargetHttpsProxies].
16587 ///
16588 /// ```
16589 /// # tokio_test::block_on(async {
16590 /// # use google_cloud_compute_v1::client::TargetHttpsProxies;
16591 /// let client = TargetHttpsProxies::builder().build().await?;
16592 /// # gax::client_builder::Result::<()>::Ok(()) });
16593 /// ```
16594 pub fn builder() -> super::builder::target_https_proxies::ClientBuilder {
16595 gax::client_builder::internal::new_builder(
16596 super::builder::target_https_proxies::client::Factory,
16597 )
16598 }
16599
16600 /// Creates a new client from the provided stub.
16601 ///
16602 /// The most common case for calling this function is in tests mocking the
16603 /// client's behavior.
16604 pub fn from_stub<T>(stub: T) -> Self
16605 where
16606 T: super::stub::TargetHttpsProxies + 'static,
16607 {
16608 Self {
16609 inner: std::sync::Arc::new(stub),
16610 }
16611 }
16612
16613 pub(crate) async fn new(
16614 config: gaxi::options::ClientConfig,
16615 ) -> gax::client_builder::Result<Self> {
16616 let inner = Self::build_inner(config).await?;
16617 Ok(Self { inner })
16618 }
16619
16620 async fn build_inner(
16621 conf: gaxi::options::ClientConfig,
16622 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::TargetHttpsProxies>>
16623 {
16624 if gaxi::options::tracing_enabled(&conf) {
16625 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16626 }
16627 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16628 }
16629
16630 async fn build_transport(
16631 conf: gaxi::options::ClientConfig,
16632 ) -> gax::client_builder::Result<impl super::stub::TargetHttpsProxies> {
16633 super::transport::TargetHttpsProxies::new(conf).await
16634 }
16635
16636 async fn build_with_tracing(
16637 conf: gaxi::options::ClientConfig,
16638 ) -> gax::client_builder::Result<impl super::stub::TargetHttpsProxies> {
16639 Self::build_transport(conf)
16640 .await
16641 .map(super::tracing::TargetHttpsProxies::new)
16642 }
16643
16644 /// Retrieves the list of all TargetHttpsProxy resources, regional and global,
16645 /// available to the specified project.
16646 ///
16647 /// To prevent failure, Google recommends that you set the
16648 /// `returnPartialSuccess` parameter to `true`.
16649 pub fn aggregated_list(&self) -> super::builder::target_https_proxies::AggregatedList {
16650 super::builder::target_https_proxies::AggregatedList::new(self.inner.clone())
16651 }
16652
16653 /// Deletes the specified TargetHttpsProxy resource.
16654 pub fn delete(&self) -> super::builder::target_https_proxies::Delete {
16655 super::builder::target_https_proxies::Delete::new(self.inner.clone())
16656 }
16657
16658 /// Returns the specified TargetHttpsProxy resource.
16659 pub fn get(&self) -> super::builder::target_https_proxies::Get {
16660 super::builder::target_https_proxies::Get::new(self.inner.clone())
16661 }
16662
16663 /// Creates a TargetHttpsProxy resource in the specified
16664 /// project using the data included in the request.
16665 pub fn insert(&self) -> super::builder::target_https_proxies::Insert {
16666 super::builder::target_https_proxies::Insert::new(self.inner.clone())
16667 }
16668
16669 /// Retrieves the list of TargetHttpsProxy resources
16670 /// available to the specified project.
16671 pub fn list(&self) -> super::builder::target_https_proxies::List {
16672 super::builder::target_https_proxies::List::new(self.inner.clone())
16673 }
16674
16675 /// Patches the specified TargetHttpsProxy resource with the data included in
16676 /// the request. This method supports PATCH
16677 /// semantics and usesJSON merge
16678 /// patch format and processing rules.
16679 pub fn patch(&self) -> super::builder::target_https_proxies::Patch {
16680 super::builder::target_https_proxies::Patch::new(self.inner.clone())
16681 }
16682
16683 /// Changes the Certificate Map for TargetHttpsProxy.
16684 pub fn set_certificate_map(&self) -> super::builder::target_https_proxies::SetCertificateMap {
16685 super::builder::target_https_proxies::SetCertificateMap::new(self.inner.clone())
16686 }
16687
16688 /// Sets the QUIC override policy for TargetHttpsProxy.
16689 pub fn set_quic_override(&self) -> super::builder::target_https_proxies::SetQuicOverride {
16690 super::builder::target_https_proxies::SetQuicOverride::new(self.inner.clone())
16691 }
16692
16693 /// Replaces SslCertificates for TargetHttpsProxy.
16694 pub fn set_ssl_certificates(&self) -> super::builder::target_https_proxies::SetSslCertificates {
16695 super::builder::target_https_proxies::SetSslCertificates::new(self.inner.clone())
16696 }
16697
16698 /// Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies the
16699 /// server-side support for SSL features. This affects connections between
16700 /// clients and the HTTPS proxy load balancer. They do not affect the
16701 /// connection between the load balancer and the backends.
16702 pub fn set_ssl_policy(&self) -> super::builder::target_https_proxies::SetSslPolicy {
16703 super::builder::target_https_proxies::SetSslPolicy::new(self.inner.clone())
16704 }
16705
16706 /// Changes the URL map for TargetHttpsProxy.
16707 pub fn set_url_map(&self) -> super::builder::target_https_proxies::SetUrlMap {
16708 super::builder::target_https_proxies::SetUrlMap::new(self.inner.clone())
16709 }
16710
16711 /// Retrieves the specified Operations resource.
16712 pub fn get_operation(&self) -> super::builder::target_https_proxies::GetOperation {
16713 super::builder::target_https_proxies::GetOperation::new(self.inner.clone())
16714 }
16715}
16716
16717/// Implements a client for the Google Compute Engine API.
16718///
16719/// # Example
16720/// ```
16721/// # tokio_test::block_on(async {
16722/// # use google_cloud_compute_v1::client::TargetInstances;
16723/// let client = TargetInstances::builder().build().await?;
16724/// // use `client` to make requests to the Google Compute Engine API.
16725/// # gax::client_builder::Result::<()>::Ok(()) });
16726/// ```
16727///
16728/// # Service Description
16729///
16730/// Service for the `targetInstances` resource.
16731///
16732/// # Configuration
16733///
16734/// To configure `TargetInstances` use the `with_*` methods in the type returned
16735/// by [builder()][TargetInstances::builder]. The default configuration should
16736/// work for most applications. Common configuration changes include
16737///
16738/// * [with_endpoint()]: by default this client uses the global default endpoint
16739/// (`https://compute.googleapis.com`). Applications using regional
16740/// endpoints or running in restricted networks (e.g. a network configured
16741// with [Private Google Access with VPC Service Controls]) may want to
16742/// override this default.
16743/// * [with_credentials()]: by default this client uses
16744/// [Application Default Credentials]. Applications using custom
16745/// authentication may need to override this default.
16746///
16747/// [with_endpoint()]: super::builder::target_instances::ClientBuilder::with_endpoint
16748/// [with_credentials()]: super::builder::target_instances::ClientBuilder::credentials
16749/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16750/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16751///
16752/// # Pooling and Cloning
16753///
16754/// `TargetInstances` holds a connection pool internally, it is advised to
16755/// create one and the reuse it. You do not need to wrap `TargetInstances` in
16756/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16757/// already uses an `Arc` internally.
16758#[cfg(feature = "target-instances")]
16759#[cfg_attr(docsrs, doc(cfg(feature = "target-instances")))]
16760#[derive(Clone, Debug)]
16761pub struct TargetInstances {
16762 inner: std::sync::Arc<dyn super::stub::dynamic::TargetInstances>,
16763}
16764
16765#[cfg(feature = "target-instances")]
16766impl TargetInstances {
16767 /// Returns a builder for [TargetInstances].
16768 ///
16769 /// ```
16770 /// # tokio_test::block_on(async {
16771 /// # use google_cloud_compute_v1::client::TargetInstances;
16772 /// let client = TargetInstances::builder().build().await?;
16773 /// # gax::client_builder::Result::<()>::Ok(()) });
16774 /// ```
16775 pub fn builder() -> super::builder::target_instances::ClientBuilder {
16776 gax::client_builder::internal::new_builder(
16777 super::builder::target_instances::client::Factory,
16778 )
16779 }
16780
16781 /// Creates a new client from the provided stub.
16782 ///
16783 /// The most common case for calling this function is in tests mocking the
16784 /// client's behavior.
16785 pub fn from_stub<T>(stub: T) -> Self
16786 where
16787 T: super::stub::TargetInstances + 'static,
16788 {
16789 Self {
16790 inner: std::sync::Arc::new(stub),
16791 }
16792 }
16793
16794 pub(crate) async fn new(
16795 config: gaxi::options::ClientConfig,
16796 ) -> gax::client_builder::Result<Self> {
16797 let inner = Self::build_inner(config).await?;
16798 Ok(Self { inner })
16799 }
16800
16801 async fn build_inner(
16802 conf: gaxi::options::ClientConfig,
16803 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::TargetInstances>>
16804 {
16805 if gaxi::options::tracing_enabled(&conf) {
16806 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16807 }
16808 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16809 }
16810
16811 async fn build_transport(
16812 conf: gaxi::options::ClientConfig,
16813 ) -> gax::client_builder::Result<impl super::stub::TargetInstances> {
16814 super::transport::TargetInstances::new(conf).await
16815 }
16816
16817 async fn build_with_tracing(
16818 conf: gaxi::options::ClientConfig,
16819 ) -> gax::client_builder::Result<impl super::stub::TargetInstances> {
16820 Self::build_transport(conf)
16821 .await
16822 .map(super::tracing::TargetInstances::new)
16823 }
16824
16825 /// Retrieves an aggregated list of target instances.
16826 ///
16827 /// To prevent failure, Google recommends that you set the
16828 /// `returnPartialSuccess` parameter to `true`.
16829 pub fn aggregated_list(&self) -> super::builder::target_instances::AggregatedList {
16830 super::builder::target_instances::AggregatedList::new(self.inner.clone())
16831 }
16832
16833 /// Deletes the specified TargetInstance resource.
16834 pub fn delete(&self) -> super::builder::target_instances::Delete {
16835 super::builder::target_instances::Delete::new(self.inner.clone())
16836 }
16837
16838 /// Returns the specified TargetInstance resource.
16839 pub fn get(&self) -> super::builder::target_instances::Get {
16840 super::builder::target_instances::Get::new(self.inner.clone())
16841 }
16842
16843 /// Creates a TargetInstance resource in the specified project and zone using
16844 /// the data included in the request.
16845 pub fn insert(&self) -> super::builder::target_instances::Insert {
16846 super::builder::target_instances::Insert::new(self.inner.clone())
16847 }
16848
16849 /// Retrieves a list of TargetInstance resources available to the specified
16850 /// project and zone.
16851 pub fn list(&self) -> super::builder::target_instances::List {
16852 super::builder::target_instances::List::new(self.inner.clone())
16853 }
16854
16855 /// Sets the Google Cloud Armor security policy for the specified target
16856 /// instance. For more information, seeGoogle
16857 /// Cloud Armor Overview
16858 pub fn set_security_policy(&self) -> super::builder::target_instances::SetSecurityPolicy {
16859 super::builder::target_instances::SetSecurityPolicy::new(self.inner.clone())
16860 }
16861
16862 /// Returns permissions that a caller has on the specified resource.
16863 pub fn test_iam_permissions(&self) -> super::builder::target_instances::TestIamPermissions {
16864 super::builder::target_instances::TestIamPermissions::new(self.inner.clone())
16865 }
16866
16867 /// Retrieves the specified zone-specific Operations resource.
16868 pub fn get_operation(&self) -> super::builder::target_instances::GetOperation {
16869 super::builder::target_instances::GetOperation::new(self.inner.clone())
16870 }
16871}
16872
16873/// Implements a client for the Google Compute Engine API.
16874///
16875/// # Example
16876/// ```
16877/// # tokio_test::block_on(async {
16878/// # use google_cloud_compute_v1::client::TargetPools;
16879/// let client = TargetPools::builder().build().await?;
16880/// // use `client` to make requests to the Google Compute Engine API.
16881/// # gax::client_builder::Result::<()>::Ok(()) });
16882/// ```
16883///
16884/// # Service Description
16885///
16886/// Service for the `targetPools` resource.
16887///
16888/// # Configuration
16889///
16890/// To configure `TargetPools` use the `with_*` methods in the type returned
16891/// by [builder()][TargetPools::builder]. The default configuration should
16892/// work for most applications. Common configuration changes include
16893///
16894/// * [with_endpoint()]: by default this client uses the global default endpoint
16895/// (`https://compute.googleapis.com`). Applications using regional
16896/// endpoints or running in restricted networks (e.g. a network configured
16897// with [Private Google Access with VPC Service Controls]) may want to
16898/// override this default.
16899/// * [with_credentials()]: by default this client uses
16900/// [Application Default Credentials]. Applications using custom
16901/// authentication may need to override this default.
16902///
16903/// [with_endpoint()]: super::builder::target_pools::ClientBuilder::with_endpoint
16904/// [with_credentials()]: super::builder::target_pools::ClientBuilder::credentials
16905/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16906/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16907///
16908/// # Pooling and Cloning
16909///
16910/// `TargetPools` holds a connection pool internally, it is advised to
16911/// create one and the reuse it. You do not need to wrap `TargetPools` in
16912/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16913/// already uses an `Arc` internally.
16914#[cfg(feature = "target-pools")]
16915#[cfg_attr(docsrs, doc(cfg(feature = "target-pools")))]
16916#[derive(Clone, Debug)]
16917pub struct TargetPools {
16918 inner: std::sync::Arc<dyn super::stub::dynamic::TargetPools>,
16919}
16920
16921#[cfg(feature = "target-pools")]
16922impl TargetPools {
16923 /// Returns a builder for [TargetPools].
16924 ///
16925 /// ```
16926 /// # tokio_test::block_on(async {
16927 /// # use google_cloud_compute_v1::client::TargetPools;
16928 /// let client = TargetPools::builder().build().await?;
16929 /// # gax::client_builder::Result::<()>::Ok(()) });
16930 /// ```
16931 pub fn builder() -> super::builder::target_pools::ClientBuilder {
16932 gax::client_builder::internal::new_builder(super::builder::target_pools::client::Factory)
16933 }
16934
16935 /// Creates a new client from the provided stub.
16936 ///
16937 /// The most common case for calling this function is in tests mocking the
16938 /// client's behavior.
16939 pub fn from_stub<T>(stub: T) -> Self
16940 where
16941 T: super::stub::TargetPools + 'static,
16942 {
16943 Self {
16944 inner: std::sync::Arc::new(stub),
16945 }
16946 }
16947
16948 pub(crate) async fn new(
16949 config: gaxi::options::ClientConfig,
16950 ) -> gax::client_builder::Result<Self> {
16951 let inner = Self::build_inner(config).await?;
16952 Ok(Self { inner })
16953 }
16954
16955 async fn build_inner(
16956 conf: gaxi::options::ClientConfig,
16957 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::TargetPools>> {
16958 if gaxi::options::tracing_enabled(&conf) {
16959 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16960 }
16961 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16962 }
16963
16964 async fn build_transport(
16965 conf: gaxi::options::ClientConfig,
16966 ) -> gax::client_builder::Result<impl super::stub::TargetPools> {
16967 super::transport::TargetPools::new(conf).await
16968 }
16969
16970 async fn build_with_tracing(
16971 conf: gaxi::options::ClientConfig,
16972 ) -> gax::client_builder::Result<impl super::stub::TargetPools> {
16973 Self::build_transport(conf)
16974 .await
16975 .map(super::tracing::TargetPools::new)
16976 }
16977
16978 /// Adds health check URLs to a target pool.
16979 pub fn add_health_check(&self) -> super::builder::target_pools::AddHealthCheck {
16980 super::builder::target_pools::AddHealthCheck::new(self.inner.clone())
16981 }
16982
16983 /// Adds an instance to a target pool.
16984 pub fn add_instance(&self) -> super::builder::target_pools::AddInstance {
16985 super::builder::target_pools::AddInstance::new(self.inner.clone())
16986 }
16987
16988 /// Retrieves an aggregated list of target pools.
16989 ///
16990 /// To prevent failure, Google recommends that you set the
16991 /// `returnPartialSuccess` parameter to `true`.
16992 pub fn aggregated_list(&self) -> super::builder::target_pools::AggregatedList {
16993 super::builder::target_pools::AggregatedList::new(self.inner.clone())
16994 }
16995
16996 /// Deletes the specified target pool.
16997 pub fn delete(&self) -> super::builder::target_pools::Delete {
16998 super::builder::target_pools::Delete::new(self.inner.clone())
16999 }
17000
17001 /// Returns the specified target pool.
17002 pub fn get(&self) -> super::builder::target_pools::Get {
17003 super::builder::target_pools::Get::new(self.inner.clone())
17004 }
17005
17006 /// Gets the most recent health check results for each IP for the
17007 /// instance that is referenced by the given target pool.
17008 pub fn get_health(&self) -> super::builder::target_pools::GetHealth {
17009 super::builder::target_pools::GetHealth::new(self.inner.clone())
17010 }
17011
17012 /// Creates a target pool in the specified project and region using
17013 /// the data included in the request.
17014 pub fn insert(&self) -> super::builder::target_pools::Insert {
17015 super::builder::target_pools::Insert::new(self.inner.clone())
17016 }
17017
17018 /// Retrieves a list of target pools available to the specified
17019 /// project and region.
17020 pub fn list(&self) -> super::builder::target_pools::List {
17021 super::builder::target_pools::List::new(self.inner.clone())
17022 }
17023
17024 /// Removes health check URL from a target pool.
17025 pub fn remove_health_check(&self) -> super::builder::target_pools::RemoveHealthCheck {
17026 super::builder::target_pools::RemoveHealthCheck::new(self.inner.clone())
17027 }
17028
17029 /// Removes instance URL from a target pool.
17030 pub fn remove_instance(&self) -> super::builder::target_pools::RemoveInstance {
17031 super::builder::target_pools::RemoveInstance::new(self.inner.clone())
17032 }
17033
17034 /// Changes a backup target pool's configurations.
17035 pub fn set_backup(&self) -> super::builder::target_pools::SetBackup {
17036 super::builder::target_pools::SetBackup::new(self.inner.clone())
17037 }
17038
17039 /// Sets the Google Cloud Armor security policy for the specified target pool.
17040 /// For more information, seeGoogle
17041 /// Cloud Armor Overview
17042 pub fn set_security_policy(&self) -> super::builder::target_pools::SetSecurityPolicy {
17043 super::builder::target_pools::SetSecurityPolicy::new(self.inner.clone())
17044 }
17045
17046 /// Returns permissions that a caller has on the specified resource.
17047 pub fn test_iam_permissions(&self) -> super::builder::target_pools::TestIamPermissions {
17048 super::builder::target_pools::TestIamPermissions::new(self.inner.clone())
17049 }
17050
17051 /// Retrieves the specified region-specific Operations resource.
17052 pub fn get_operation(&self) -> super::builder::target_pools::GetOperation {
17053 super::builder::target_pools::GetOperation::new(self.inner.clone())
17054 }
17055}
17056
17057/// Implements a client for the Google Compute Engine API.
17058///
17059/// # Example
17060/// ```
17061/// # tokio_test::block_on(async {
17062/// # use google_cloud_compute_v1::client::TargetSslProxies;
17063/// let client = TargetSslProxies::builder().build().await?;
17064/// // use `client` to make requests to the Google Compute Engine API.
17065/// # gax::client_builder::Result::<()>::Ok(()) });
17066/// ```
17067///
17068/// # Service Description
17069///
17070/// Service for the `targetSslProxies` resource.
17071///
17072/// # Configuration
17073///
17074/// To configure `TargetSslProxies` use the `with_*` methods in the type returned
17075/// by [builder()][TargetSslProxies::builder]. The default configuration should
17076/// work for most applications. Common configuration changes include
17077///
17078/// * [with_endpoint()]: by default this client uses the global default endpoint
17079/// (`https://compute.googleapis.com`). Applications using regional
17080/// endpoints or running in restricted networks (e.g. a network configured
17081// with [Private Google Access with VPC Service Controls]) may want to
17082/// override this default.
17083/// * [with_credentials()]: by default this client uses
17084/// [Application Default Credentials]. Applications using custom
17085/// authentication may need to override this default.
17086///
17087/// [with_endpoint()]: super::builder::target_ssl_proxies::ClientBuilder::with_endpoint
17088/// [with_credentials()]: super::builder::target_ssl_proxies::ClientBuilder::credentials
17089/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17090/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17091///
17092/// # Pooling and Cloning
17093///
17094/// `TargetSslProxies` holds a connection pool internally, it is advised to
17095/// create one and the reuse it. You do not need to wrap `TargetSslProxies` in
17096/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17097/// already uses an `Arc` internally.
17098#[cfg(feature = "target-ssl-proxies")]
17099#[cfg_attr(docsrs, doc(cfg(feature = "target-ssl-proxies")))]
17100#[derive(Clone, Debug)]
17101pub struct TargetSslProxies {
17102 inner: std::sync::Arc<dyn super::stub::dynamic::TargetSslProxies>,
17103}
17104
17105#[cfg(feature = "target-ssl-proxies")]
17106impl TargetSslProxies {
17107 /// Returns a builder for [TargetSslProxies].
17108 ///
17109 /// ```
17110 /// # tokio_test::block_on(async {
17111 /// # use google_cloud_compute_v1::client::TargetSslProxies;
17112 /// let client = TargetSslProxies::builder().build().await?;
17113 /// # gax::client_builder::Result::<()>::Ok(()) });
17114 /// ```
17115 pub fn builder() -> super::builder::target_ssl_proxies::ClientBuilder {
17116 gax::client_builder::internal::new_builder(
17117 super::builder::target_ssl_proxies::client::Factory,
17118 )
17119 }
17120
17121 /// Creates a new client from the provided stub.
17122 ///
17123 /// The most common case for calling this function is in tests mocking the
17124 /// client's behavior.
17125 pub fn from_stub<T>(stub: T) -> Self
17126 where
17127 T: super::stub::TargetSslProxies + 'static,
17128 {
17129 Self {
17130 inner: std::sync::Arc::new(stub),
17131 }
17132 }
17133
17134 pub(crate) async fn new(
17135 config: gaxi::options::ClientConfig,
17136 ) -> gax::client_builder::Result<Self> {
17137 let inner = Self::build_inner(config).await?;
17138 Ok(Self { inner })
17139 }
17140
17141 async fn build_inner(
17142 conf: gaxi::options::ClientConfig,
17143 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::TargetSslProxies>>
17144 {
17145 if gaxi::options::tracing_enabled(&conf) {
17146 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17147 }
17148 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17149 }
17150
17151 async fn build_transport(
17152 conf: gaxi::options::ClientConfig,
17153 ) -> gax::client_builder::Result<impl super::stub::TargetSslProxies> {
17154 super::transport::TargetSslProxies::new(conf).await
17155 }
17156
17157 async fn build_with_tracing(
17158 conf: gaxi::options::ClientConfig,
17159 ) -> gax::client_builder::Result<impl super::stub::TargetSslProxies> {
17160 Self::build_transport(conf)
17161 .await
17162 .map(super::tracing::TargetSslProxies::new)
17163 }
17164
17165 /// Deletes the specified TargetSslProxy resource.
17166 pub fn delete(&self) -> super::builder::target_ssl_proxies::Delete {
17167 super::builder::target_ssl_proxies::Delete::new(self.inner.clone())
17168 }
17169
17170 /// Returns the specified TargetSslProxy resource.
17171 pub fn get(&self) -> super::builder::target_ssl_proxies::Get {
17172 super::builder::target_ssl_proxies::Get::new(self.inner.clone())
17173 }
17174
17175 /// Creates a TargetSslProxy resource in the specified project using
17176 /// the data included in the request.
17177 pub fn insert(&self) -> super::builder::target_ssl_proxies::Insert {
17178 super::builder::target_ssl_proxies::Insert::new(self.inner.clone())
17179 }
17180
17181 /// Retrieves the list of TargetSslProxy resources
17182 /// available to the specified project.
17183 pub fn list(&self) -> super::builder::target_ssl_proxies::List {
17184 super::builder::target_ssl_proxies::List::new(self.inner.clone())
17185 }
17186
17187 /// Changes the BackendService for TargetSslProxy.
17188 pub fn set_backend_service(&self) -> super::builder::target_ssl_proxies::SetBackendService {
17189 super::builder::target_ssl_proxies::SetBackendService::new(self.inner.clone())
17190 }
17191
17192 /// Changes the Certificate Map for TargetSslProxy.
17193 pub fn set_certificate_map(&self) -> super::builder::target_ssl_proxies::SetCertificateMap {
17194 super::builder::target_ssl_proxies::SetCertificateMap::new(self.inner.clone())
17195 }
17196
17197 /// Changes the ProxyHeaderType for TargetSslProxy.
17198 pub fn set_proxy_header(&self) -> super::builder::target_ssl_proxies::SetProxyHeader {
17199 super::builder::target_ssl_proxies::SetProxyHeader::new(self.inner.clone())
17200 }
17201
17202 /// Changes SslCertificates for TargetSslProxy.
17203 pub fn set_ssl_certificates(&self) -> super::builder::target_ssl_proxies::SetSslCertificates {
17204 super::builder::target_ssl_proxies::SetSslCertificates::new(self.inner.clone())
17205 }
17206
17207 /// Sets the SSL policy for TargetSslProxy. The SSL policy specifies the
17208 /// server-side support for SSL features. This affects connections between
17209 /// clients and the load balancer. They do not affect the
17210 /// connection between the load balancer and the backends.
17211 pub fn set_ssl_policy(&self) -> super::builder::target_ssl_proxies::SetSslPolicy {
17212 super::builder::target_ssl_proxies::SetSslPolicy::new(self.inner.clone())
17213 }
17214
17215 /// Retrieves the specified Operations resource.
17216 pub fn get_operation(&self) -> super::builder::target_ssl_proxies::GetOperation {
17217 super::builder::target_ssl_proxies::GetOperation::new(self.inner.clone())
17218 }
17219}
17220
17221/// Implements a client for the Google Compute Engine API.
17222///
17223/// # Example
17224/// ```
17225/// # tokio_test::block_on(async {
17226/// # use google_cloud_compute_v1::client::TargetTcpProxies;
17227/// let client = TargetTcpProxies::builder().build().await?;
17228/// // use `client` to make requests to the Google Compute Engine API.
17229/// # gax::client_builder::Result::<()>::Ok(()) });
17230/// ```
17231///
17232/// # Service Description
17233///
17234/// Service for the `targetTcpProxies` resource.
17235///
17236/// # Configuration
17237///
17238/// To configure `TargetTcpProxies` use the `with_*` methods in the type returned
17239/// by [builder()][TargetTcpProxies::builder]. The default configuration should
17240/// work for most applications. Common configuration changes include
17241///
17242/// * [with_endpoint()]: by default this client uses the global default endpoint
17243/// (`https://compute.googleapis.com`). Applications using regional
17244/// endpoints or running in restricted networks (e.g. a network configured
17245// with [Private Google Access with VPC Service Controls]) may want to
17246/// override this default.
17247/// * [with_credentials()]: by default this client uses
17248/// [Application Default Credentials]. Applications using custom
17249/// authentication may need to override this default.
17250///
17251/// [with_endpoint()]: super::builder::target_tcp_proxies::ClientBuilder::with_endpoint
17252/// [with_credentials()]: super::builder::target_tcp_proxies::ClientBuilder::credentials
17253/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17254/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17255///
17256/// # Pooling and Cloning
17257///
17258/// `TargetTcpProxies` holds a connection pool internally, it is advised to
17259/// create one and the reuse it. You do not need to wrap `TargetTcpProxies` in
17260/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17261/// already uses an `Arc` internally.
17262#[cfg(feature = "target-tcp-proxies")]
17263#[cfg_attr(docsrs, doc(cfg(feature = "target-tcp-proxies")))]
17264#[derive(Clone, Debug)]
17265pub struct TargetTcpProxies {
17266 inner: std::sync::Arc<dyn super::stub::dynamic::TargetTcpProxies>,
17267}
17268
17269#[cfg(feature = "target-tcp-proxies")]
17270impl TargetTcpProxies {
17271 /// Returns a builder for [TargetTcpProxies].
17272 ///
17273 /// ```
17274 /// # tokio_test::block_on(async {
17275 /// # use google_cloud_compute_v1::client::TargetTcpProxies;
17276 /// let client = TargetTcpProxies::builder().build().await?;
17277 /// # gax::client_builder::Result::<()>::Ok(()) });
17278 /// ```
17279 pub fn builder() -> super::builder::target_tcp_proxies::ClientBuilder {
17280 gax::client_builder::internal::new_builder(
17281 super::builder::target_tcp_proxies::client::Factory,
17282 )
17283 }
17284
17285 /// Creates a new client from the provided stub.
17286 ///
17287 /// The most common case for calling this function is in tests mocking the
17288 /// client's behavior.
17289 pub fn from_stub<T>(stub: T) -> Self
17290 where
17291 T: super::stub::TargetTcpProxies + 'static,
17292 {
17293 Self {
17294 inner: std::sync::Arc::new(stub),
17295 }
17296 }
17297
17298 pub(crate) async fn new(
17299 config: gaxi::options::ClientConfig,
17300 ) -> gax::client_builder::Result<Self> {
17301 let inner = Self::build_inner(config).await?;
17302 Ok(Self { inner })
17303 }
17304
17305 async fn build_inner(
17306 conf: gaxi::options::ClientConfig,
17307 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::TargetTcpProxies>>
17308 {
17309 if gaxi::options::tracing_enabled(&conf) {
17310 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17311 }
17312 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17313 }
17314
17315 async fn build_transport(
17316 conf: gaxi::options::ClientConfig,
17317 ) -> gax::client_builder::Result<impl super::stub::TargetTcpProxies> {
17318 super::transport::TargetTcpProxies::new(conf).await
17319 }
17320
17321 async fn build_with_tracing(
17322 conf: gaxi::options::ClientConfig,
17323 ) -> gax::client_builder::Result<impl super::stub::TargetTcpProxies> {
17324 Self::build_transport(conf)
17325 .await
17326 .map(super::tracing::TargetTcpProxies::new)
17327 }
17328
17329 /// Retrieves the list of all TargetTcpProxy resources, regional and global,
17330 /// available to the specified project.
17331 ///
17332 /// To prevent failure, Google recommends that you set the
17333 /// `returnPartialSuccess` parameter to `true`.
17334 pub fn aggregated_list(&self) -> super::builder::target_tcp_proxies::AggregatedList {
17335 super::builder::target_tcp_proxies::AggregatedList::new(self.inner.clone())
17336 }
17337
17338 /// Deletes the specified TargetTcpProxy resource.
17339 pub fn delete(&self) -> super::builder::target_tcp_proxies::Delete {
17340 super::builder::target_tcp_proxies::Delete::new(self.inner.clone())
17341 }
17342
17343 /// Returns the specified TargetTcpProxy resource.
17344 pub fn get(&self) -> super::builder::target_tcp_proxies::Get {
17345 super::builder::target_tcp_proxies::Get::new(self.inner.clone())
17346 }
17347
17348 /// Creates a TargetTcpProxy resource in the specified project using
17349 /// the data included in the request.
17350 pub fn insert(&self) -> super::builder::target_tcp_proxies::Insert {
17351 super::builder::target_tcp_proxies::Insert::new(self.inner.clone())
17352 }
17353
17354 /// Retrieves the list of TargetTcpProxy resources
17355 /// available to the specified project.
17356 pub fn list(&self) -> super::builder::target_tcp_proxies::List {
17357 super::builder::target_tcp_proxies::List::new(self.inner.clone())
17358 }
17359
17360 /// Changes the BackendService for TargetTcpProxy.
17361 pub fn set_backend_service(&self) -> super::builder::target_tcp_proxies::SetBackendService {
17362 super::builder::target_tcp_proxies::SetBackendService::new(self.inner.clone())
17363 }
17364
17365 /// Changes the ProxyHeaderType for TargetTcpProxy.
17366 pub fn set_proxy_header(&self) -> super::builder::target_tcp_proxies::SetProxyHeader {
17367 super::builder::target_tcp_proxies::SetProxyHeader::new(self.inner.clone())
17368 }
17369
17370 /// Retrieves the specified Operations resource.
17371 pub fn get_operation(&self) -> super::builder::target_tcp_proxies::GetOperation {
17372 super::builder::target_tcp_proxies::GetOperation::new(self.inner.clone())
17373 }
17374}
17375
17376/// Implements a client for the Google Compute Engine API.
17377///
17378/// # Example
17379/// ```
17380/// # tokio_test::block_on(async {
17381/// # use google_cloud_compute_v1::client::TargetVpnGateways;
17382/// let client = TargetVpnGateways::builder().build().await?;
17383/// // use `client` to make requests to the Google Compute Engine API.
17384/// # gax::client_builder::Result::<()>::Ok(()) });
17385/// ```
17386///
17387/// # Service Description
17388///
17389/// Service for the `targetVpnGateways` resource.
17390///
17391/// # Configuration
17392///
17393/// To configure `TargetVpnGateways` use the `with_*` methods in the type returned
17394/// by [builder()][TargetVpnGateways::builder]. The default configuration should
17395/// work for most applications. Common configuration changes include
17396///
17397/// * [with_endpoint()]: by default this client uses the global default endpoint
17398/// (`https://compute.googleapis.com`). Applications using regional
17399/// endpoints or running in restricted networks (e.g. a network configured
17400// with [Private Google Access with VPC Service Controls]) may want to
17401/// override this default.
17402/// * [with_credentials()]: by default this client uses
17403/// [Application Default Credentials]. Applications using custom
17404/// authentication may need to override this default.
17405///
17406/// [with_endpoint()]: super::builder::target_vpn_gateways::ClientBuilder::with_endpoint
17407/// [with_credentials()]: super::builder::target_vpn_gateways::ClientBuilder::credentials
17408/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17409/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17410///
17411/// # Pooling and Cloning
17412///
17413/// `TargetVpnGateways` holds a connection pool internally, it is advised to
17414/// create one and the reuse it. You do not need to wrap `TargetVpnGateways` in
17415/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17416/// already uses an `Arc` internally.
17417#[cfg(feature = "target-vpn-gateways")]
17418#[cfg_attr(docsrs, doc(cfg(feature = "target-vpn-gateways")))]
17419#[derive(Clone, Debug)]
17420pub struct TargetVpnGateways {
17421 inner: std::sync::Arc<dyn super::stub::dynamic::TargetVpnGateways>,
17422}
17423
17424#[cfg(feature = "target-vpn-gateways")]
17425impl TargetVpnGateways {
17426 /// Returns a builder for [TargetVpnGateways].
17427 ///
17428 /// ```
17429 /// # tokio_test::block_on(async {
17430 /// # use google_cloud_compute_v1::client::TargetVpnGateways;
17431 /// let client = TargetVpnGateways::builder().build().await?;
17432 /// # gax::client_builder::Result::<()>::Ok(()) });
17433 /// ```
17434 pub fn builder() -> super::builder::target_vpn_gateways::ClientBuilder {
17435 gax::client_builder::internal::new_builder(
17436 super::builder::target_vpn_gateways::client::Factory,
17437 )
17438 }
17439
17440 /// Creates a new client from the provided stub.
17441 ///
17442 /// The most common case for calling this function is in tests mocking the
17443 /// client's behavior.
17444 pub fn from_stub<T>(stub: T) -> Self
17445 where
17446 T: super::stub::TargetVpnGateways + 'static,
17447 {
17448 Self {
17449 inner: std::sync::Arc::new(stub),
17450 }
17451 }
17452
17453 pub(crate) async fn new(
17454 config: gaxi::options::ClientConfig,
17455 ) -> gax::client_builder::Result<Self> {
17456 let inner = Self::build_inner(config).await?;
17457 Ok(Self { inner })
17458 }
17459
17460 async fn build_inner(
17461 conf: gaxi::options::ClientConfig,
17462 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::TargetVpnGateways>>
17463 {
17464 if gaxi::options::tracing_enabled(&conf) {
17465 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17466 }
17467 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17468 }
17469
17470 async fn build_transport(
17471 conf: gaxi::options::ClientConfig,
17472 ) -> gax::client_builder::Result<impl super::stub::TargetVpnGateways> {
17473 super::transport::TargetVpnGateways::new(conf).await
17474 }
17475
17476 async fn build_with_tracing(
17477 conf: gaxi::options::ClientConfig,
17478 ) -> gax::client_builder::Result<impl super::stub::TargetVpnGateways> {
17479 Self::build_transport(conf)
17480 .await
17481 .map(super::tracing::TargetVpnGateways::new)
17482 }
17483
17484 /// Retrieves an aggregated list of target VPN gateways.
17485 ///
17486 /// To prevent failure, Google recommends that you set the
17487 /// `returnPartialSuccess` parameter to `true`.
17488 pub fn aggregated_list(&self) -> super::builder::target_vpn_gateways::AggregatedList {
17489 super::builder::target_vpn_gateways::AggregatedList::new(self.inner.clone())
17490 }
17491
17492 /// Deletes the specified target VPN gateway.
17493 pub fn delete(&self) -> super::builder::target_vpn_gateways::Delete {
17494 super::builder::target_vpn_gateways::Delete::new(self.inner.clone())
17495 }
17496
17497 /// Returns the specified target VPN gateway.
17498 pub fn get(&self) -> super::builder::target_vpn_gateways::Get {
17499 super::builder::target_vpn_gateways::Get::new(self.inner.clone())
17500 }
17501
17502 /// Creates a target VPN gateway in the specified project and region using
17503 /// the data included in the request.
17504 pub fn insert(&self) -> super::builder::target_vpn_gateways::Insert {
17505 super::builder::target_vpn_gateways::Insert::new(self.inner.clone())
17506 }
17507
17508 /// Retrieves a list of target VPN gateways available to the specified
17509 /// project and region.
17510 pub fn list(&self) -> super::builder::target_vpn_gateways::List {
17511 super::builder::target_vpn_gateways::List::new(self.inner.clone())
17512 }
17513
17514 /// Sets the labels on a TargetVpnGateway. To learn more about labels, read theLabeling
17515 /// Resources documentation.
17516 pub fn set_labels(&self) -> super::builder::target_vpn_gateways::SetLabels {
17517 super::builder::target_vpn_gateways::SetLabels::new(self.inner.clone())
17518 }
17519
17520 /// Retrieves the specified region-specific Operations resource.
17521 pub fn get_operation(&self) -> super::builder::target_vpn_gateways::GetOperation {
17522 super::builder::target_vpn_gateways::GetOperation::new(self.inner.clone())
17523 }
17524}
17525
17526/// Implements a client for the Google Compute Engine API.
17527///
17528/// # Example
17529/// ```
17530/// # tokio_test::block_on(async {
17531/// # use google_cloud_compute_v1::client::UrlMaps;
17532/// let client = UrlMaps::builder().build().await?;
17533/// // use `client` to make requests to the Google Compute Engine API.
17534/// # gax::client_builder::Result::<()>::Ok(()) });
17535/// ```
17536///
17537/// # Service Description
17538///
17539/// Service for the `urlMaps` resource.
17540///
17541/// # Configuration
17542///
17543/// To configure `UrlMaps` use the `with_*` methods in the type returned
17544/// by [builder()][UrlMaps::builder]. The default configuration should
17545/// work for most applications. Common configuration changes include
17546///
17547/// * [with_endpoint()]: by default this client uses the global default endpoint
17548/// (`https://compute.googleapis.com`). Applications using regional
17549/// endpoints or running in restricted networks (e.g. a network configured
17550// with [Private Google Access with VPC Service Controls]) may want to
17551/// override this default.
17552/// * [with_credentials()]: by default this client uses
17553/// [Application Default Credentials]. Applications using custom
17554/// authentication may need to override this default.
17555///
17556/// [with_endpoint()]: super::builder::url_maps::ClientBuilder::with_endpoint
17557/// [with_credentials()]: super::builder::url_maps::ClientBuilder::credentials
17558/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17559/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17560///
17561/// # Pooling and Cloning
17562///
17563/// `UrlMaps` holds a connection pool internally, it is advised to
17564/// create one and the reuse it. You do not need to wrap `UrlMaps` in
17565/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17566/// already uses an `Arc` internally.
17567#[cfg(feature = "url-maps")]
17568#[cfg_attr(docsrs, doc(cfg(feature = "url-maps")))]
17569#[derive(Clone, Debug)]
17570pub struct UrlMaps {
17571 inner: std::sync::Arc<dyn super::stub::dynamic::UrlMaps>,
17572}
17573
17574#[cfg(feature = "url-maps")]
17575impl UrlMaps {
17576 /// Returns a builder for [UrlMaps].
17577 ///
17578 /// ```
17579 /// # tokio_test::block_on(async {
17580 /// # use google_cloud_compute_v1::client::UrlMaps;
17581 /// let client = UrlMaps::builder().build().await?;
17582 /// # gax::client_builder::Result::<()>::Ok(()) });
17583 /// ```
17584 pub fn builder() -> super::builder::url_maps::ClientBuilder {
17585 gax::client_builder::internal::new_builder(super::builder::url_maps::client::Factory)
17586 }
17587
17588 /// Creates a new client from the provided stub.
17589 ///
17590 /// The most common case for calling this function is in tests mocking the
17591 /// client's behavior.
17592 pub fn from_stub<T>(stub: T) -> Self
17593 where
17594 T: super::stub::UrlMaps + 'static,
17595 {
17596 Self {
17597 inner: std::sync::Arc::new(stub),
17598 }
17599 }
17600
17601 pub(crate) async fn new(
17602 config: gaxi::options::ClientConfig,
17603 ) -> gax::client_builder::Result<Self> {
17604 let inner = Self::build_inner(config).await?;
17605 Ok(Self { inner })
17606 }
17607
17608 async fn build_inner(
17609 conf: gaxi::options::ClientConfig,
17610 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::UrlMaps>> {
17611 if gaxi::options::tracing_enabled(&conf) {
17612 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17613 }
17614 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17615 }
17616
17617 async fn build_transport(
17618 conf: gaxi::options::ClientConfig,
17619 ) -> gax::client_builder::Result<impl super::stub::UrlMaps> {
17620 super::transport::UrlMaps::new(conf).await
17621 }
17622
17623 async fn build_with_tracing(
17624 conf: gaxi::options::ClientConfig,
17625 ) -> gax::client_builder::Result<impl super::stub::UrlMaps> {
17626 Self::build_transport(conf)
17627 .await
17628 .map(super::tracing::UrlMaps::new)
17629 }
17630
17631 /// Retrieves the list of all UrlMap resources, regional and global,
17632 /// available to the specified project.
17633 ///
17634 /// To prevent failure, Google recommends that you set the
17635 /// `returnPartialSuccess` parameter to `true`.
17636 pub fn aggregated_list(&self) -> super::builder::url_maps::AggregatedList {
17637 super::builder::url_maps::AggregatedList::new(self.inner.clone())
17638 }
17639
17640 /// Deletes the specified UrlMap resource.
17641 pub fn delete(&self) -> super::builder::url_maps::Delete {
17642 super::builder::url_maps::Delete::new(self.inner.clone())
17643 }
17644
17645 /// Returns the specified UrlMap resource.
17646 pub fn get(&self) -> super::builder::url_maps::Get {
17647 super::builder::url_maps::Get::new(self.inner.clone())
17648 }
17649
17650 /// Creates a UrlMap resource in the specified project using
17651 /// the data included in the request.
17652 pub fn insert(&self) -> super::builder::url_maps::Insert {
17653 super::builder::url_maps::Insert::new(self.inner.clone())
17654 }
17655
17656 /// Initiates a cache invalidation operation, invalidating the specified path,
17657 /// scoped to the specified UrlMap.
17658 ///
17659 /// For more information, see [Invalidating cached
17660 /// content](/cdn/docs/invalidating-cached-content).
17661 pub fn invalidate_cache(&self) -> super::builder::url_maps::InvalidateCache {
17662 super::builder::url_maps::InvalidateCache::new(self.inner.clone())
17663 }
17664
17665 /// Retrieves the list of UrlMap resources available to the specified
17666 /// project.
17667 pub fn list(&self) -> super::builder::url_maps::List {
17668 super::builder::url_maps::List::new(self.inner.clone())
17669 }
17670
17671 /// Patches the specified UrlMap resource with the data included in the
17672 /// request. This method supportsPATCH
17673 /// semantics and uses theJSON merge
17674 /// patch format and processing rules.
17675 pub fn patch(&self) -> super::builder::url_maps::Patch {
17676 super::builder::url_maps::Patch::new(self.inner.clone())
17677 }
17678
17679 /// Updates the specified UrlMap resource with the data included in the
17680 /// request.
17681 pub fn update(&self) -> super::builder::url_maps::Update {
17682 super::builder::url_maps::Update::new(self.inner.clone())
17683 }
17684
17685 /// Runs static validation for the UrlMap. In particular, the tests of the
17686 /// provided UrlMap will be run. Calling this method does NOT create the
17687 /// UrlMap.
17688 pub fn validate(&self) -> super::builder::url_maps::Validate {
17689 super::builder::url_maps::Validate::new(self.inner.clone())
17690 }
17691
17692 /// Retrieves the specified Operations resource.
17693 pub fn get_operation(&self) -> super::builder::url_maps::GetOperation {
17694 super::builder::url_maps::GetOperation::new(self.inner.clone())
17695 }
17696}
17697
17698/// Implements a client for the Google Compute Engine API.
17699///
17700/// # Example
17701/// ```
17702/// # tokio_test::block_on(async {
17703/// # use google_cloud_compute_v1::client::VpnGateways;
17704/// let client = VpnGateways::builder().build().await?;
17705/// // use `client` to make requests to the Google Compute Engine API.
17706/// # gax::client_builder::Result::<()>::Ok(()) });
17707/// ```
17708///
17709/// # Service Description
17710///
17711/// Service for the `vpnGateways` resource.
17712///
17713/// # Configuration
17714///
17715/// To configure `VpnGateways` use the `with_*` methods in the type returned
17716/// by [builder()][VpnGateways::builder]. The default configuration should
17717/// work for most applications. Common configuration changes include
17718///
17719/// * [with_endpoint()]: by default this client uses the global default endpoint
17720/// (`https://compute.googleapis.com`). Applications using regional
17721/// endpoints or running in restricted networks (e.g. a network configured
17722// with [Private Google Access with VPC Service Controls]) may want to
17723/// override this default.
17724/// * [with_credentials()]: by default this client uses
17725/// [Application Default Credentials]. Applications using custom
17726/// authentication may need to override this default.
17727///
17728/// [with_endpoint()]: super::builder::vpn_gateways::ClientBuilder::with_endpoint
17729/// [with_credentials()]: super::builder::vpn_gateways::ClientBuilder::credentials
17730/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17731/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17732///
17733/// # Pooling and Cloning
17734///
17735/// `VpnGateways` holds a connection pool internally, it is advised to
17736/// create one and the reuse it. You do not need to wrap `VpnGateways` in
17737/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17738/// already uses an `Arc` internally.
17739#[cfg(feature = "vpn-gateways")]
17740#[cfg_attr(docsrs, doc(cfg(feature = "vpn-gateways")))]
17741#[derive(Clone, Debug)]
17742pub struct VpnGateways {
17743 inner: std::sync::Arc<dyn super::stub::dynamic::VpnGateways>,
17744}
17745
17746#[cfg(feature = "vpn-gateways")]
17747impl VpnGateways {
17748 /// Returns a builder for [VpnGateways].
17749 ///
17750 /// ```
17751 /// # tokio_test::block_on(async {
17752 /// # use google_cloud_compute_v1::client::VpnGateways;
17753 /// let client = VpnGateways::builder().build().await?;
17754 /// # gax::client_builder::Result::<()>::Ok(()) });
17755 /// ```
17756 pub fn builder() -> super::builder::vpn_gateways::ClientBuilder {
17757 gax::client_builder::internal::new_builder(super::builder::vpn_gateways::client::Factory)
17758 }
17759
17760 /// Creates a new client from the provided stub.
17761 ///
17762 /// The most common case for calling this function is in tests mocking the
17763 /// client's behavior.
17764 pub fn from_stub<T>(stub: T) -> Self
17765 where
17766 T: super::stub::VpnGateways + 'static,
17767 {
17768 Self {
17769 inner: std::sync::Arc::new(stub),
17770 }
17771 }
17772
17773 pub(crate) async fn new(
17774 config: gaxi::options::ClientConfig,
17775 ) -> gax::client_builder::Result<Self> {
17776 let inner = Self::build_inner(config).await?;
17777 Ok(Self { inner })
17778 }
17779
17780 async fn build_inner(
17781 conf: gaxi::options::ClientConfig,
17782 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::VpnGateways>> {
17783 if gaxi::options::tracing_enabled(&conf) {
17784 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17785 }
17786 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17787 }
17788
17789 async fn build_transport(
17790 conf: gaxi::options::ClientConfig,
17791 ) -> gax::client_builder::Result<impl super::stub::VpnGateways> {
17792 super::transport::VpnGateways::new(conf).await
17793 }
17794
17795 async fn build_with_tracing(
17796 conf: gaxi::options::ClientConfig,
17797 ) -> gax::client_builder::Result<impl super::stub::VpnGateways> {
17798 Self::build_transport(conf)
17799 .await
17800 .map(super::tracing::VpnGateways::new)
17801 }
17802
17803 /// Retrieves an aggregated list of VPN gateways.
17804 ///
17805 /// To prevent failure, Google recommends that you set the
17806 /// `returnPartialSuccess` parameter to `true`.
17807 pub fn aggregated_list(&self) -> super::builder::vpn_gateways::AggregatedList {
17808 super::builder::vpn_gateways::AggregatedList::new(self.inner.clone())
17809 }
17810
17811 /// Deletes the specified VPN gateway.
17812 pub fn delete(&self) -> super::builder::vpn_gateways::Delete {
17813 super::builder::vpn_gateways::Delete::new(self.inner.clone())
17814 }
17815
17816 /// Returns the specified VPN gateway.
17817 pub fn get(&self) -> super::builder::vpn_gateways::Get {
17818 super::builder::vpn_gateways::Get::new(self.inner.clone())
17819 }
17820
17821 /// Returns the status for the specified VPN gateway.
17822 pub fn get_status(&self) -> super::builder::vpn_gateways::GetStatus {
17823 super::builder::vpn_gateways::GetStatus::new(self.inner.clone())
17824 }
17825
17826 /// Creates a VPN gateway in the specified project and region using
17827 /// the data included in the request.
17828 pub fn insert(&self) -> super::builder::vpn_gateways::Insert {
17829 super::builder::vpn_gateways::Insert::new(self.inner.clone())
17830 }
17831
17832 /// Retrieves a list of VPN gateways available to the specified
17833 /// project and region.
17834 pub fn list(&self) -> super::builder::vpn_gateways::List {
17835 super::builder::vpn_gateways::List::new(self.inner.clone())
17836 }
17837
17838 /// Sets the labels on a VpnGateway. To learn more about labels, read theLabeling
17839 /// Resources documentation.
17840 pub fn set_labels(&self) -> super::builder::vpn_gateways::SetLabels {
17841 super::builder::vpn_gateways::SetLabels::new(self.inner.clone())
17842 }
17843
17844 /// Returns permissions that a caller has on the specified resource.
17845 pub fn test_iam_permissions(&self) -> super::builder::vpn_gateways::TestIamPermissions {
17846 super::builder::vpn_gateways::TestIamPermissions::new(self.inner.clone())
17847 }
17848
17849 /// Retrieves the specified region-specific Operations resource.
17850 pub fn get_operation(&self) -> super::builder::vpn_gateways::GetOperation {
17851 super::builder::vpn_gateways::GetOperation::new(self.inner.clone())
17852 }
17853}
17854
17855/// Implements a client for the Google Compute Engine API.
17856///
17857/// # Example
17858/// ```
17859/// # tokio_test::block_on(async {
17860/// # use google_cloud_compute_v1::client::VpnTunnels;
17861/// let client = VpnTunnels::builder().build().await?;
17862/// // use `client` to make requests to the Google Compute Engine API.
17863/// # gax::client_builder::Result::<()>::Ok(()) });
17864/// ```
17865///
17866/// # Service Description
17867///
17868/// Service for the `vpnTunnels` resource.
17869///
17870/// # Configuration
17871///
17872/// To configure `VpnTunnels` use the `with_*` methods in the type returned
17873/// by [builder()][VpnTunnels::builder]. The default configuration should
17874/// work for most applications. Common configuration changes include
17875///
17876/// * [with_endpoint()]: by default this client uses the global default endpoint
17877/// (`https://compute.googleapis.com`). Applications using regional
17878/// endpoints or running in restricted networks (e.g. a network configured
17879// with [Private Google Access with VPC Service Controls]) may want to
17880/// override this default.
17881/// * [with_credentials()]: by default this client uses
17882/// [Application Default Credentials]. Applications using custom
17883/// authentication may need to override this default.
17884///
17885/// [with_endpoint()]: super::builder::vpn_tunnels::ClientBuilder::with_endpoint
17886/// [with_credentials()]: super::builder::vpn_tunnels::ClientBuilder::credentials
17887/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17888/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17889///
17890/// # Pooling and Cloning
17891///
17892/// `VpnTunnels` holds a connection pool internally, it is advised to
17893/// create one and the reuse it. You do not need to wrap `VpnTunnels` in
17894/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17895/// already uses an `Arc` internally.
17896#[cfg(feature = "vpn-tunnels")]
17897#[cfg_attr(docsrs, doc(cfg(feature = "vpn-tunnels")))]
17898#[derive(Clone, Debug)]
17899pub struct VpnTunnels {
17900 inner: std::sync::Arc<dyn super::stub::dynamic::VpnTunnels>,
17901}
17902
17903#[cfg(feature = "vpn-tunnels")]
17904impl VpnTunnels {
17905 /// Returns a builder for [VpnTunnels].
17906 ///
17907 /// ```
17908 /// # tokio_test::block_on(async {
17909 /// # use google_cloud_compute_v1::client::VpnTunnels;
17910 /// let client = VpnTunnels::builder().build().await?;
17911 /// # gax::client_builder::Result::<()>::Ok(()) });
17912 /// ```
17913 pub fn builder() -> super::builder::vpn_tunnels::ClientBuilder {
17914 gax::client_builder::internal::new_builder(super::builder::vpn_tunnels::client::Factory)
17915 }
17916
17917 /// Creates a new client from the provided stub.
17918 ///
17919 /// The most common case for calling this function is in tests mocking the
17920 /// client's behavior.
17921 pub fn from_stub<T>(stub: T) -> Self
17922 where
17923 T: super::stub::VpnTunnels + 'static,
17924 {
17925 Self {
17926 inner: std::sync::Arc::new(stub),
17927 }
17928 }
17929
17930 pub(crate) async fn new(
17931 config: gaxi::options::ClientConfig,
17932 ) -> gax::client_builder::Result<Self> {
17933 let inner = Self::build_inner(config).await?;
17934 Ok(Self { inner })
17935 }
17936
17937 async fn build_inner(
17938 conf: gaxi::options::ClientConfig,
17939 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::VpnTunnels>> {
17940 if gaxi::options::tracing_enabled(&conf) {
17941 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17942 }
17943 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17944 }
17945
17946 async fn build_transport(
17947 conf: gaxi::options::ClientConfig,
17948 ) -> gax::client_builder::Result<impl super::stub::VpnTunnels> {
17949 super::transport::VpnTunnels::new(conf).await
17950 }
17951
17952 async fn build_with_tracing(
17953 conf: gaxi::options::ClientConfig,
17954 ) -> gax::client_builder::Result<impl super::stub::VpnTunnels> {
17955 Self::build_transport(conf)
17956 .await
17957 .map(super::tracing::VpnTunnels::new)
17958 }
17959
17960 /// Retrieves an aggregated list of VPN tunnels.
17961 ///
17962 /// To prevent failure, Google recommends that you set the
17963 /// `returnPartialSuccess` parameter to `true`.
17964 pub fn aggregated_list(&self) -> super::builder::vpn_tunnels::AggregatedList {
17965 super::builder::vpn_tunnels::AggregatedList::new(self.inner.clone())
17966 }
17967
17968 /// Deletes the specified VpnTunnel resource.
17969 pub fn delete(&self) -> super::builder::vpn_tunnels::Delete {
17970 super::builder::vpn_tunnels::Delete::new(self.inner.clone())
17971 }
17972
17973 /// Returns the specified VpnTunnel resource.
17974 pub fn get(&self) -> super::builder::vpn_tunnels::Get {
17975 super::builder::vpn_tunnels::Get::new(self.inner.clone())
17976 }
17977
17978 /// Creates a VpnTunnel resource in the specified project and region using
17979 /// the data included in the request.
17980 pub fn insert(&self) -> super::builder::vpn_tunnels::Insert {
17981 super::builder::vpn_tunnels::Insert::new(self.inner.clone())
17982 }
17983
17984 /// Retrieves a list of VpnTunnel resources contained in the specified
17985 /// project and region.
17986 pub fn list(&self) -> super::builder::vpn_tunnels::List {
17987 super::builder::vpn_tunnels::List::new(self.inner.clone())
17988 }
17989
17990 /// Sets the labels on a VpnTunnel. To learn more about labels, read theLabeling
17991 /// Resources documentation.
17992 pub fn set_labels(&self) -> super::builder::vpn_tunnels::SetLabels {
17993 super::builder::vpn_tunnels::SetLabels::new(self.inner.clone())
17994 }
17995
17996 /// Retrieves the specified region-specific Operations resource.
17997 pub fn get_operation(&self) -> super::builder::vpn_tunnels::GetOperation {
17998 super::builder::vpn_tunnels::GetOperation::new(self.inner.clone())
17999 }
18000}
18001
18002/// Implements a client for the Google Compute Engine API.
18003///
18004/// # Example
18005/// ```
18006/// # tokio_test::block_on(async {
18007/// # use google_cloud_compute_v1::client::WireGroups;
18008/// let client = WireGroups::builder().build().await?;
18009/// // use `client` to make requests to the Google Compute Engine API.
18010/// # gax::client_builder::Result::<()>::Ok(()) });
18011/// ```
18012///
18013/// # Service Description
18014///
18015/// Service for the `wireGroups` resource.
18016///
18017/// # Configuration
18018///
18019/// To configure `WireGroups` use the `with_*` methods in the type returned
18020/// by [builder()][WireGroups::builder]. The default configuration should
18021/// work for most applications. Common configuration changes include
18022///
18023/// * [with_endpoint()]: by default this client uses the global default endpoint
18024/// (`https://compute.googleapis.com`). Applications using regional
18025/// endpoints or running in restricted networks (e.g. a network configured
18026// with [Private Google Access with VPC Service Controls]) may want to
18027/// override this default.
18028/// * [with_credentials()]: by default this client uses
18029/// [Application Default Credentials]. Applications using custom
18030/// authentication may need to override this default.
18031///
18032/// [with_endpoint()]: super::builder::wire_groups::ClientBuilder::with_endpoint
18033/// [with_credentials()]: super::builder::wire_groups::ClientBuilder::credentials
18034/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18035/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18036///
18037/// # Pooling and Cloning
18038///
18039/// `WireGroups` holds a connection pool internally, it is advised to
18040/// create one and the reuse it. You do not need to wrap `WireGroups` in
18041/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18042/// already uses an `Arc` internally.
18043#[cfg(feature = "wire-groups")]
18044#[cfg_attr(docsrs, doc(cfg(feature = "wire-groups")))]
18045#[derive(Clone, Debug)]
18046pub struct WireGroups {
18047 inner: std::sync::Arc<dyn super::stub::dynamic::WireGroups>,
18048}
18049
18050#[cfg(feature = "wire-groups")]
18051impl WireGroups {
18052 /// Returns a builder for [WireGroups].
18053 ///
18054 /// ```
18055 /// # tokio_test::block_on(async {
18056 /// # use google_cloud_compute_v1::client::WireGroups;
18057 /// let client = WireGroups::builder().build().await?;
18058 /// # gax::client_builder::Result::<()>::Ok(()) });
18059 /// ```
18060 pub fn builder() -> super::builder::wire_groups::ClientBuilder {
18061 gax::client_builder::internal::new_builder(super::builder::wire_groups::client::Factory)
18062 }
18063
18064 /// Creates a new client from the provided stub.
18065 ///
18066 /// The most common case for calling this function is in tests mocking the
18067 /// client's behavior.
18068 pub fn from_stub<T>(stub: T) -> Self
18069 where
18070 T: super::stub::WireGroups + 'static,
18071 {
18072 Self {
18073 inner: std::sync::Arc::new(stub),
18074 }
18075 }
18076
18077 pub(crate) async fn new(
18078 config: gaxi::options::ClientConfig,
18079 ) -> gax::client_builder::Result<Self> {
18080 let inner = Self::build_inner(config).await?;
18081 Ok(Self { inner })
18082 }
18083
18084 async fn build_inner(
18085 conf: gaxi::options::ClientConfig,
18086 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::WireGroups>> {
18087 if gaxi::options::tracing_enabled(&conf) {
18088 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18089 }
18090 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18091 }
18092
18093 async fn build_transport(
18094 conf: gaxi::options::ClientConfig,
18095 ) -> gax::client_builder::Result<impl super::stub::WireGroups> {
18096 super::transport::WireGroups::new(conf).await
18097 }
18098
18099 async fn build_with_tracing(
18100 conf: gaxi::options::ClientConfig,
18101 ) -> gax::client_builder::Result<impl super::stub::WireGroups> {
18102 Self::build_transport(conf)
18103 .await
18104 .map(super::tracing::WireGroups::new)
18105 }
18106
18107 /// Deletes the specified wire group in the given scope.
18108 pub fn delete(&self) -> super::builder::wire_groups::Delete {
18109 super::builder::wire_groups::Delete::new(self.inner.clone())
18110 }
18111
18112 /// Gets the specified wire group resource in the given scope.
18113 pub fn get(&self) -> super::builder::wire_groups::Get {
18114 super::builder::wire_groups::Get::new(self.inner.clone())
18115 }
18116
18117 /// Creates a wire group in the specified project in the given scope
18118 /// using the parameters that are included in the request.
18119 pub fn insert(&self) -> super::builder::wire_groups::Insert {
18120 super::builder::wire_groups::Insert::new(self.inner.clone())
18121 }
18122
18123 /// Lists the wire groups for a project in the given scope.
18124 pub fn list(&self) -> super::builder::wire_groups::List {
18125 super::builder::wire_groups::List::new(self.inner.clone())
18126 }
18127
18128 /// Updates the specified wire group resource with the data included in the
18129 /// request. This method supportsPATCH
18130 /// semantics and usesJSON merge
18131 /// patch format and processing rules.
18132 pub fn patch(&self) -> super::builder::wire_groups::Patch {
18133 super::builder::wire_groups::Patch::new(self.inner.clone())
18134 }
18135
18136 /// Retrieves the specified Operations resource.
18137 pub fn get_operation(&self) -> super::builder::wire_groups::GetOperation {
18138 super::builder::wire_groups::GetOperation::new(self.inner.clone())
18139 }
18140}
18141
18142/// Implements a client for the Google Compute Engine API.
18143///
18144/// # Example
18145/// ```
18146/// # tokio_test::block_on(async {
18147/// # use google_cloud_compute_v1::client::ZoneOperations;
18148/// let client = ZoneOperations::builder().build().await?;
18149/// // use `client` to make requests to the Google Compute Engine API.
18150/// # gax::client_builder::Result::<()>::Ok(()) });
18151/// ```
18152///
18153/// # Service Description
18154///
18155/// Service for the `zoneOperations` resource.
18156///
18157/// # Configuration
18158///
18159/// To configure `ZoneOperations` use the `with_*` methods in the type returned
18160/// by [builder()][ZoneOperations::builder]. The default configuration should
18161/// work for most applications. Common configuration changes include
18162///
18163/// * [with_endpoint()]: by default this client uses the global default endpoint
18164/// (`https://compute.googleapis.com`). Applications using regional
18165/// endpoints or running in restricted networks (e.g. a network configured
18166// with [Private Google Access with VPC Service Controls]) may want to
18167/// override this default.
18168/// * [with_credentials()]: by default this client uses
18169/// [Application Default Credentials]. Applications using custom
18170/// authentication may need to override this default.
18171///
18172/// [with_endpoint()]: super::builder::zone_operations::ClientBuilder::with_endpoint
18173/// [with_credentials()]: super::builder::zone_operations::ClientBuilder::credentials
18174/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18175/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18176///
18177/// # Pooling and Cloning
18178///
18179/// `ZoneOperations` holds a connection pool internally, it is advised to
18180/// create one and the reuse it. You do not need to wrap `ZoneOperations` in
18181/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18182/// already uses an `Arc` internally.
18183#[cfg(feature = "zone-operations")]
18184#[cfg_attr(docsrs, doc(cfg(feature = "zone-operations")))]
18185#[derive(Clone, Debug)]
18186pub struct ZoneOperations {
18187 inner: std::sync::Arc<dyn super::stub::dynamic::ZoneOperations>,
18188}
18189
18190#[cfg(feature = "zone-operations")]
18191impl ZoneOperations {
18192 /// Returns a builder for [ZoneOperations].
18193 ///
18194 /// ```
18195 /// # tokio_test::block_on(async {
18196 /// # use google_cloud_compute_v1::client::ZoneOperations;
18197 /// let client = ZoneOperations::builder().build().await?;
18198 /// # gax::client_builder::Result::<()>::Ok(()) });
18199 /// ```
18200 pub fn builder() -> super::builder::zone_operations::ClientBuilder {
18201 gax::client_builder::internal::new_builder(super::builder::zone_operations::client::Factory)
18202 }
18203
18204 /// Creates a new client from the provided stub.
18205 ///
18206 /// The most common case for calling this function is in tests mocking the
18207 /// client's behavior.
18208 pub fn from_stub<T>(stub: T) -> Self
18209 where
18210 T: super::stub::ZoneOperations + 'static,
18211 {
18212 Self {
18213 inner: std::sync::Arc::new(stub),
18214 }
18215 }
18216
18217 pub(crate) async fn new(
18218 config: gaxi::options::ClientConfig,
18219 ) -> gax::client_builder::Result<Self> {
18220 let inner = Self::build_inner(config).await?;
18221 Ok(Self { inner })
18222 }
18223
18224 async fn build_inner(
18225 conf: gaxi::options::ClientConfig,
18226 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::ZoneOperations>> {
18227 if gaxi::options::tracing_enabled(&conf) {
18228 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18229 }
18230 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18231 }
18232
18233 async fn build_transport(
18234 conf: gaxi::options::ClientConfig,
18235 ) -> gax::client_builder::Result<impl super::stub::ZoneOperations> {
18236 super::transport::ZoneOperations::new(conf).await
18237 }
18238
18239 async fn build_with_tracing(
18240 conf: gaxi::options::ClientConfig,
18241 ) -> gax::client_builder::Result<impl super::stub::ZoneOperations> {
18242 Self::build_transport(conf)
18243 .await
18244 .map(super::tracing::ZoneOperations::new)
18245 }
18246
18247 /// Deletes the specified zone-specific Operations resource.
18248 pub fn delete(&self) -> super::builder::zone_operations::Delete {
18249 super::builder::zone_operations::Delete::new(self.inner.clone())
18250 }
18251
18252 /// Retrieves the specified zone-specific Operations resource.
18253 pub fn get(&self) -> super::builder::zone_operations::Get {
18254 super::builder::zone_operations::Get::new(self.inner.clone())
18255 }
18256
18257 /// Retrieves a list of Operation resources contained within
18258 /// the specified zone.
18259 pub fn list(&self) -> super::builder::zone_operations::List {
18260 super::builder::zone_operations::List::new(self.inner.clone())
18261 }
18262
18263 /// Waits for the specified Operation resource to return as `DONE`
18264 /// or for the request to approach the 2 minute deadline, and retrieves the
18265 /// specified Operation resource. This method waits for no more than the
18266 /// 2 minutes and then returns the current state of the
18267 /// operation, which might be `DONE` or still in progress.
18268 ///
18269 /// This method is called on a best-effort basis. Specifically:
18270 ///
18271 /// ```norust
18272 /// - In uncommon cases, when the server is overloaded, the request might
18273 /// return before the default deadline is reached, or might return after zero
18274 /// seconds.
18275 /// ```
18276 ///
18277 /// - If the default deadline is reached, there is no guarantee that the
18278 /// operation is actually done when the method returns. Be prepared to retry
18279 /// if the operation is not `DONE`.
18280 pub fn wait(&self) -> super::builder::zone_operations::Wait {
18281 super::builder::zone_operations::Wait::new(self.inner.clone())
18282 }
18283}
18284
18285/// Implements a client for the Google Compute Engine API.
18286///
18287/// # Example
18288/// ```
18289/// # tokio_test::block_on(async {
18290/// # use google_cloud_compute_v1::client::Zones;
18291/// let client = Zones::builder().build().await?;
18292/// // use `client` to make requests to the Google Compute Engine API.
18293/// # gax::client_builder::Result::<()>::Ok(()) });
18294/// ```
18295///
18296/// # Service Description
18297///
18298/// Service for the `zones` resource.
18299///
18300/// # Configuration
18301///
18302/// To configure `Zones` use the `with_*` methods in the type returned
18303/// by [builder()][Zones::builder]. The default configuration should
18304/// work for most applications. Common configuration changes include
18305///
18306/// * [with_endpoint()]: by default this client uses the global default endpoint
18307/// (`https://compute.googleapis.com`). Applications using regional
18308/// endpoints or running in restricted networks (e.g. a network configured
18309// with [Private Google Access with VPC Service Controls]) may want to
18310/// override this default.
18311/// * [with_credentials()]: by default this client uses
18312/// [Application Default Credentials]. Applications using custom
18313/// authentication may need to override this default.
18314///
18315/// [with_endpoint()]: super::builder::zones::ClientBuilder::with_endpoint
18316/// [with_credentials()]: super::builder::zones::ClientBuilder::credentials
18317/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18318/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18319///
18320/// # Pooling and Cloning
18321///
18322/// `Zones` holds a connection pool internally, it is advised to
18323/// create one and the reuse it. You do not need to wrap `Zones` in
18324/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18325/// already uses an `Arc` internally.
18326#[cfg(feature = "zones")]
18327#[cfg_attr(docsrs, doc(cfg(feature = "zones")))]
18328#[derive(Clone, Debug)]
18329pub struct Zones {
18330 inner: std::sync::Arc<dyn super::stub::dynamic::Zones>,
18331}
18332
18333#[cfg(feature = "zones")]
18334impl Zones {
18335 /// Returns a builder for [Zones].
18336 ///
18337 /// ```
18338 /// # tokio_test::block_on(async {
18339 /// # use google_cloud_compute_v1::client::Zones;
18340 /// let client = Zones::builder().build().await?;
18341 /// # gax::client_builder::Result::<()>::Ok(()) });
18342 /// ```
18343 pub fn builder() -> super::builder::zones::ClientBuilder {
18344 gax::client_builder::internal::new_builder(super::builder::zones::client::Factory)
18345 }
18346
18347 /// Creates a new client from the provided stub.
18348 ///
18349 /// The most common case for calling this function is in tests mocking the
18350 /// client's behavior.
18351 pub fn from_stub<T>(stub: T) -> Self
18352 where
18353 T: super::stub::Zones + 'static,
18354 {
18355 Self {
18356 inner: std::sync::Arc::new(stub),
18357 }
18358 }
18359
18360 pub(crate) async fn new(
18361 config: gaxi::options::ClientConfig,
18362 ) -> gax::client_builder::Result<Self> {
18363 let inner = Self::build_inner(config).await?;
18364 Ok(Self { inner })
18365 }
18366
18367 async fn build_inner(
18368 conf: gaxi::options::ClientConfig,
18369 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Zones>> {
18370 if gaxi::options::tracing_enabled(&conf) {
18371 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18372 }
18373 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18374 }
18375
18376 async fn build_transport(
18377 conf: gaxi::options::ClientConfig,
18378 ) -> gax::client_builder::Result<impl super::stub::Zones> {
18379 super::transport::Zones::new(conf).await
18380 }
18381
18382 async fn build_with_tracing(
18383 conf: gaxi::options::ClientConfig,
18384 ) -> gax::client_builder::Result<impl super::stub::Zones> {
18385 Self::build_transport(conf)
18386 .await
18387 .map(super::tracing::Zones::new)
18388 }
18389
18390 /// Returns the specified Zone resource.
18391 pub fn get(&self) -> super::builder::zones::Get {
18392 super::builder::zones::Get::new(self.inner.clone())
18393 }
18394
18395 /// Retrieves the list of Zone resources available to the specified project.
18396 pub fn list(&self) -> super::builder::zones::List {
18397 super::builder::zones::List::new(self.inner.clone())
18398 }
18399}