google_cloud_alloydb_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::redundant_explicit_links)]
17#![allow(rustdoc::broken_intra_doc_links)]
18
19/// Implements a client for the AlloyDB API.
20///
21/// # Example
22/// ```
23/// # tokio_test::block_on(async {
24/// # use google_cloud_alloydb_v1::client::AlloyDBCSQLAdmin;
25/// let client = AlloyDBCSQLAdmin::builder().build().await?;
26/// // use `client` to make requests to the AlloyDB API.
27/// # gax::client_builder::Result::<()>::Ok(()) });
28/// ```
29///
30/// # Service Description
31///
32/// Service for interactions with CloudSQL.
33///
34/// # Configuration
35///
36/// To configure `AlloyDBCSQLAdmin` use the `with_*` methods in the type returned
37/// by [builder()][AlloyDBCSQLAdmin::builder]. The default configuration should
38/// work for most applications. Common configuration changes include
39///
40/// * [with_endpoint()]: by default this client uses the global default endpoint
41/// (`https://alloydb.googleapis.com`). Applications using regional
42/// endpoints or running in restricted networks (e.g. a network configured
43// with [Private Google Access with VPC Service Controls]) may want to
44/// override this default.
45/// * [with_credentials()]: by default this client uses
46/// [Application Default Credentials]. Applications using custom
47/// authentication may need to override this default.
48///
49/// [with_endpoint()]: super::builder::alloy_dbcsql_admin::ClientBuilder::with_endpoint
50/// [with_credentials()]: super::builder::alloy_dbcsql_admin::ClientBuilder::credentials
51/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
52/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
53///
54/// # Pooling and Cloning
55///
56/// `AlloyDBCSQLAdmin` holds a connection pool internally, it is advised to
57/// create one and the reuse it. You do not need to wrap `AlloyDBCSQLAdmin` in
58/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
59/// already uses an `Arc` internally.
60#[derive(Clone, Debug)]
61pub struct AlloyDBCSQLAdmin {
62 inner: std::sync::Arc<dyn super::stub::dynamic::AlloyDBCSQLAdmin>,
63}
64
65impl AlloyDBCSQLAdmin {
66 /// Returns a builder for [AlloyDBCSQLAdmin].
67 ///
68 /// ```
69 /// # tokio_test::block_on(async {
70 /// # use google_cloud_alloydb_v1::client::AlloyDBCSQLAdmin;
71 /// let client = AlloyDBCSQLAdmin::builder().build().await?;
72 /// # gax::client_builder::Result::<()>::Ok(()) });
73 /// ```
74 pub fn builder() -> super::builder::alloy_dbcsql_admin::ClientBuilder {
75 gax::client_builder::internal::new_builder(
76 super::builder::alloy_dbcsql_admin::client::Factory,
77 )
78 }
79
80 /// Creates a new client from the provided stub.
81 ///
82 /// The most common case for calling this function is in tests mocking the
83 /// client's behavior.
84 pub fn from_stub<T>(stub: T) -> Self
85 where
86 T: super::stub::AlloyDBCSQLAdmin + 'static,
87 {
88 Self {
89 inner: std::sync::Arc::new(stub),
90 }
91 }
92
93 pub(crate) async fn new(
94 config: gaxi::options::ClientConfig,
95 ) -> gax::client_builder::Result<Self> {
96 let inner = Self::build_inner(config).await?;
97 Ok(Self { inner })
98 }
99
100 async fn build_inner(
101 conf: gaxi::options::ClientConfig,
102 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::AlloyDBCSQLAdmin>>
103 {
104 if gaxi::options::tracing_enabled(&conf) {
105 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
106 }
107 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
108 }
109
110 async fn build_transport(
111 conf: gaxi::options::ClientConfig,
112 ) -> gax::client_builder::Result<impl super::stub::AlloyDBCSQLAdmin> {
113 super::transport::AlloyDBCSQLAdmin::new(conf).await
114 }
115
116 async fn build_with_tracing(
117 conf: gaxi::options::ClientConfig,
118 ) -> gax::client_builder::Result<impl super::stub::AlloyDBCSQLAdmin> {
119 Self::build_transport(conf)
120 .await
121 .map(super::tracing::AlloyDBCSQLAdmin::new)
122 }
123
124 /// Restores an AlloyDB cluster from a CloudSQL resource.
125 ///
126 /// # Long running operations
127 ///
128 /// This method is used to start, and/or poll a [long-running Operation].
129 /// The [Working with long-running operations] chapter in the [user guide]
130 /// covers these operations in detail.
131 ///
132 /// [long-running operation]: https://google.aip.dev/151
133 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
134 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
135 pub fn restore_from_cloud_sql(
136 &self,
137 ) -> super::builder::alloy_dbcsql_admin::RestoreFromCloudSQL {
138 super::builder::alloy_dbcsql_admin::RestoreFromCloudSQL::new(self.inner.clone())
139 }
140
141 /// Lists information about the supported locations for this service.
142 pub fn list_locations(&self) -> super::builder::alloy_dbcsql_admin::ListLocations {
143 super::builder::alloy_dbcsql_admin::ListLocations::new(self.inner.clone())
144 }
145
146 /// Gets information about a location.
147 pub fn get_location(&self) -> super::builder::alloy_dbcsql_admin::GetLocation {
148 super::builder::alloy_dbcsql_admin::GetLocation::new(self.inner.clone())
149 }
150
151 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
152 ///
153 /// [google.longrunning.Operations]: longrunning::client::Operations
154 pub fn list_operations(&self) -> super::builder::alloy_dbcsql_admin::ListOperations {
155 super::builder::alloy_dbcsql_admin::ListOperations::new(self.inner.clone())
156 }
157
158 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
159 ///
160 /// [google.longrunning.Operations]: longrunning::client::Operations
161 pub fn get_operation(&self) -> super::builder::alloy_dbcsql_admin::GetOperation {
162 super::builder::alloy_dbcsql_admin::GetOperation::new(self.inner.clone())
163 }
164
165 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
166 ///
167 /// [google.longrunning.Operations]: longrunning::client::Operations
168 pub fn delete_operation(&self) -> super::builder::alloy_dbcsql_admin::DeleteOperation {
169 super::builder::alloy_dbcsql_admin::DeleteOperation::new(self.inner.clone())
170 }
171
172 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
173 ///
174 /// [google.longrunning.Operations]: longrunning::client::Operations
175 pub fn cancel_operation(&self) -> super::builder::alloy_dbcsql_admin::CancelOperation {
176 super::builder::alloy_dbcsql_admin::CancelOperation::new(self.inner.clone())
177 }
178}
179
180/// Implements a client for the AlloyDB API.
181///
182/// # Example
183/// ```
184/// # tokio_test::block_on(async {
185/// # use google_cloud_alloydb_v1::client::AlloyDBAdmin;
186/// let client = AlloyDBAdmin::builder().build().await?;
187/// // use `client` to make requests to the AlloyDB API.
188/// # gax::client_builder::Result::<()>::Ok(()) });
189/// ```
190///
191/// # Service Description
192///
193/// Service describing handlers for resources
194///
195/// # Configuration
196///
197/// To configure `AlloyDBAdmin` use the `with_*` methods in the type returned
198/// by [builder()][AlloyDBAdmin::builder]. The default configuration should
199/// work for most applications. Common configuration changes include
200///
201/// * [with_endpoint()]: by default this client uses the global default endpoint
202/// (`https://alloydb.googleapis.com`). Applications using regional
203/// endpoints or running in restricted networks (e.g. a network configured
204// with [Private Google Access with VPC Service Controls]) may want to
205/// override this default.
206/// * [with_credentials()]: by default this client uses
207/// [Application Default Credentials]. Applications using custom
208/// authentication may need to override this default.
209///
210/// [with_endpoint()]: super::builder::alloy_db_admin::ClientBuilder::with_endpoint
211/// [with_credentials()]: super::builder::alloy_db_admin::ClientBuilder::credentials
212/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
213/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
214///
215/// # Pooling and Cloning
216///
217/// `AlloyDBAdmin` holds a connection pool internally, it is advised to
218/// create one and the reuse it. You do not need to wrap `AlloyDBAdmin` in
219/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
220/// already uses an `Arc` internally.
221#[derive(Clone, Debug)]
222pub struct AlloyDBAdmin {
223 inner: std::sync::Arc<dyn super::stub::dynamic::AlloyDBAdmin>,
224}
225
226impl AlloyDBAdmin {
227 /// Returns a builder for [AlloyDBAdmin].
228 ///
229 /// ```
230 /// # tokio_test::block_on(async {
231 /// # use google_cloud_alloydb_v1::client::AlloyDBAdmin;
232 /// let client = AlloyDBAdmin::builder().build().await?;
233 /// # gax::client_builder::Result::<()>::Ok(()) });
234 /// ```
235 pub fn builder() -> super::builder::alloy_db_admin::ClientBuilder {
236 gax::client_builder::internal::new_builder(super::builder::alloy_db_admin::client::Factory)
237 }
238
239 /// Creates a new client from the provided stub.
240 ///
241 /// The most common case for calling this function is in tests mocking the
242 /// client's behavior.
243 pub fn from_stub<T>(stub: T) -> Self
244 where
245 T: super::stub::AlloyDBAdmin + 'static,
246 {
247 Self {
248 inner: std::sync::Arc::new(stub),
249 }
250 }
251
252 pub(crate) async fn new(
253 config: gaxi::options::ClientConfig,
254 ) -> gax::client_builder::Result<Self> {
255 let inner = Self::build_inner(config).await?;
256 Ok(Self { inner })
257 }
258
259 async fn build_inner(
260 conf: gaxi::options::ClientConfig,
261 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::AlloyDBAdmin>> {
262 if gaxi::options::tracing_enabled(&conf) {
263 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
264 }
265 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
266 }
267
268 async fn build_transport(
269 conf: gaxi::options::ClientConfig,
270 ) -> gax::client_builder::Result<impl super::stub::AlloyDBAdmin> {
271 super::transport::AlloyDBAdmin::new(conf).await
272 }
273
274 async fn build_with_tracing(
275 conf: gaxi::options::ClientConfig,
276 ) -> gax::client_builder::Result<impl super::stub::AlloyDBAdmin> {
277 Self::build_transport(conf)
278 .await
279 .map(super::tracing::AlloyDBAdmin::new)
280 }
281
282 /// Lists Clusters in a given project and location.
283 pub fn list_clusters(&self) -> super::builder::alloy_db_admin::ListClusters {
284 super::builder::alloy_db_admin::ListClusters::new(self.inner.clone())
285 }
286
287 /// Gets details of a single Cluster.
288 pub fn get_cluster(&self) -> super::builder::alloy_db_admin::GetCluster {
289 super::builder::alloy_db_admin::GetCluster::new(self.inner.clone())
290 }
291
292 /// Creates a new Cluster in a given project and location.
293 ///
294 /// # Long running operations
295 ///
296 /// This method is used to start, and/or poll a [long-running Operation].
297 /// The [Working with long-running operations] chapter in the [user guide]
298 /// covers these operations in detail.
299 ///
300 /// [long-running operation]: https://google.aip.dev/151
301 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
302 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
303 pub fn create_cluster(&self) -> super::builder::alloy_db_admin::CreateCluster {
304 super::builder::alloy_db_admin::CreateCluster::new(self.inner.clone())
305 }
306
307 /// Updates the parameters of a single Cluster.
308 ///
309 /// # Long running operations
310 ///
311 /// This method is used to start, and/or poll a [long-running Operation].
312 /// The [Working with long-running operations] chapter in the [user guide]
313 /// covers these operations in detail.
314 ///
315 /// [long-running operation]: https://google.aip.dev/151
316 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
317 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
318 pub fn update_cluster(&self) -> super::builder::alloy_db_admin::UpdateCluster {
319 super::builder::alloy_db_admin::UpdateCluster::new(self.inner.clone())
320 }
321
322 /// Exports data from the cluster.
323 /// Imperative only.
324 ///
325 /// # Long running operations
326 ///
327 /// This method is used to start, and/or poll a [long-running Operation].
328 /// The [Working with long-running operations] chapter in the [user guide]
329 /// covers these operations in detail.
330 ///
331 /// [long-running operation]: https://google.aip.dev/151
332 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
333 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
334 pub fn export_cluster(&self) -> super::builder::alloy_db_admin::ExportCluster {
335 super::builder::alloy_db_admin::ExportCluster::new(self.inner.clone())
336 }
337
338 /// Imports data to the cluster.
339 /// Imperative only.
340 ///
341 /// # Long running operations
342 ///
343 /// This method is used to start, and/or poll a [long-running Operation].
344 /// The [Working with long-running operations] chapter in the [user guide]
345 /// covers these operations in detail.
346 ///
347 /// [long-running operation]: https://google.aip.dev/151
348 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
349 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
350 pub fn import_cluster(&self) -> super::builder::alloy_db_admin::ImportCluster {
351 super::builder::alloy_db_admin::ImportCluster::new(self.inner.clone())
352 }
353
354 /// Upgrades a single Cluster.
355 /// Imperative only.
356 ///
357 /// # Long running operations
358 ///
359 /// This method is used to start, and/or poll a [long-running Operation].
360 /// The [Working with long-running operations] chapter in the [user guide]
361 /// covers these operations in detail.
362 ///
363 /// [long-running operation]: https://google.aip.dev/151
364 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
365 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
366 pub fn upgrade_cluster(&self) -> super::builder::alloy_db_admin::UpgradeCluster {
367 super::builder::alloy_db_admin::UpgradeCluster::new(self.inner.clone())
368 }
369
370 /// Deletes a single Cluster.
371 ///
372 /// # Long running operations
373 ///
374 /// This method is used to start, and/or poll a [long-running Operation].
375 /// The [Working with long-running operations] chapter in the [user guide]
376 /// covers these operations in detail.
377 ///
378 /// [long-running operation]: https://google.aip.dev/151
379 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
380 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
381 pub fn delete_cluster(&self) -> super::builder::alloy_db_admin::DeleteCluster {
382 super::builder::alloy_db_admin::DeleteCluster::new(self.inner.clone())
383 }
384
385 /// Promotes a SECONDARY cluster. This turns down replication
386 /// from the PRIMARY cluster and promotes a secondary cluster
387 /// into its own standalone cluster.
388 /// Imperative only.
389 ///
390 /// # Long running operations
391 ///
392 /// This method is used to start, and/or poll a [long-running Operation].
393 /// The [Working with long-running operations] chapter in the [user guide]
394 /// covers these operations in detail.
395 ///
396 /// [long-running operation]: https://google.aip.dev/151
397 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
398 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
399 pub fn promote_cluster(&self) -> super::builder::alloy_db_admin::PromoteCluster {
400 super::builder::alloy_db_admin::PromoteCluster::new(self.inner.clone())
401 }
402
403 /// Switches the roles of PRIMARY and SECONDARY clusters without any data loss.
404 /// This promotes the SECONDARY cluster to PRIMARY and sets up the original
405 /// PRIMARY cluster to replicate from this newly promoted cluster.
406 ///
407 /// # Long running operations
408 ///
409 /// This method is used to start, and/or poll a [long-running Operation].
410 /// The [Working with long-running operations] chapter in the [user guide]
411 /// covers these operations in detail.
412 ///
413 /// [long-running operation]: https://google.aip.dev/151
414 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
415 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
416 pub fn switchover_cluster(&self) -> super::builder::alloy_db_admin::SwitchoverCluster {
417 super::builder::alloy_db_admin::SwitchoverCluster::new(self.inner.clone())
418 }
419
420 /// Creates a new Cluster in a given project and location, with a volume
421 /// restored from the provided source, either a backup ID or a point-in-time
422 /// and a source cluster.
423 ///
424 /// # Long running operations
425 ///
426 /// This method is used to start, and/or poll a [long-running Operation].
427 /// The [Working with long-running operations] chapter in the [user guide]
428 /// covers these operations in detail.
429 ///
430 /// [long-running operation]: https://google.aip.dev/151
431 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
432 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
433 pub fn restore_cluster(&self) -> super::builder::alloy_db_admin::RestoreCluster {
434 super::builder::alloy_db_admin::RestoreCluster::new(self.inner.clone())
435 }
436
437 /// Creates a cluster of type SECONDARY in the given location using
438 /// the primary cluster as the source.
439 ///
440 /// # Long running operations
441 ///
442 /// This method is used to start, and/or poll a [long-running Operation].
443 /// The [Working with long-running operations] chapter in the [user guide]
444 /// covers these operations in detail.
445 ///
446 /// [long-running operation]: https://google.aip.dev/151
447 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
448 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
449 pub fn create_secondary_cluster(
450 &self,
451 ) -> super::builder::alloy_db_admin::CreateSecondaryCluster {
452 super::builder::alloy_db_admin::CreateSecondaryCluster::new(self.inner.clone())
453 }
454
455 /// Lists Instances in a given project and location.
456 pub fn list_instances(&self) -> super::builder::alloy_db_admin::ListInstances {
457 super::builder::alloy_db_admin::ListInstances::new(self.inner.clone())
458 }
459
460 /// Gets details of a single Instance.
461 pub fn get_instance(&self) -> super::builder::alloy_db_admin::GetInstance {
462 super::builder::alloy_db_admin::GetInstance::new(self.inner.clone())
463 }
464
465 /// Creates a new Instance in a given project and location.
466 ///
467 /// # Long running operations
468 ///
469 /// This method is used to start, and/or poll a [long-running Operation].
470 /// The [Working with long-running operations] chapter in the [user guide]
471 /// covers these operations in detail.
472 ///
473 /// [long-running operation]: https://google.aip.dev/151
474 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
475 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
476 pub fn create_instance(&self) -> super::builder::alloy_db_admin::CreateInstance {
477 super::builder::alloy_db_admin::CreateInstance::new(self.inner.clone())
478 }
479
480 /// Creates a new SECONDARY Instance in a given project and location.
481 ///
482 /// # Long running operations
483 ///
484 /// This method is used to start, and/or poll a [long-running Operation].
485 /// The [Working with long-running operations] chapter in the [user guide]
486 /// covers these operations in detail.
487 ///
488 /// [long-running operation]: https://google.aip.dev/151
489 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
490 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
491 pub fn create_secondary_instance(
492 &self,
493 ) -> super::builder::alloy_db_admin::CreateSecondaryInstance {
494 super::builder::alloy_db_admin::CreateSecondaryInstance::new(self.inner.clone())
495 }
496
497 /// Creates new instances under the given project, location and cluster.
498 /// There can be only one primary instance in a cluster. If the primary
499 /// instance exists in the cluster as well as this request, then API will
500 /// throw an error.
501 /// The primary instance should exist before any read pool instance is
502 /// created. If the primary instance is a part of the request payload, then
503 /// the API will take care of creating instances in the correct order.
504 /// This method is here to support Google-internal use cases, and is not meant
505 /// for external customers to consume. Please do not start relying on it; its
506 /// behavior is subject to change without notice.
507 ///
508 /// # Long running operations
509 ///
510 /// This method is used to start, and/or poll a [long-running Operation].
511 /// The [Working with long-running operations] chapter in the [user guide]
512 /// covers these operations in detail.
513 ///
514 /// [long-running operation]: https://google.aip.dev/151
515 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
516 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
517 pub fn batch_create_instances(&self) -> super::builder::alloy_db_admin::BatchCreateInstances {
518 super::builder::alloy_db_admin::BatchCreateInstances::new(self.inner.clone())
519 }
520
521 /// Updates the parameters of a single Instance.
522 ///
523 /// # Long running operations
524 ///
525 /// This method is used to start, and/or poll a [long-running Operation].
526 /// The [Working with long-running operations] chapter in the [user guide]
527 /// covers these operations in detail.
528 ///
529 /// [long-running operation]: https://google.aip.dev/151
530 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
531 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
532 pub fn update_instance(&self) -> super::builder::alloy_db_admin::UpdateInstance {
533 super::builder::alloy_db_admin::UpdateInstance::new(self.inner.clone())
534 }
535
536 /// Deletes a single Instance.
537 ///
538 /// # Long running operations
539 ///
540 /// This method is used to start, and/or poll a [long-running Operation].
541 /// The [Working with long-running operations] chapter in the [user guide]
542 /// covers these operations in detail.
543 ///
544 /// [long-running operation]: https://google.aip.dev/151
545 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
546 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
547 pub fn delete_instance(&self) -> super::builder::alloy_db_admin::DeleteInstance {
548 super::builder::alloy_db_admin::DeleteInstance::new(self.inner.clone())
549 }
550
551 /// Forces a Failover for a highly available instance.
552 /// Failover promotes the HA standby instance as the new primary.
553 /// Imperative only.
554 ///
555 /// # Long running operations
556 ///
557 /// This method is used to start, and/or poll a [long-running Operation].
558 /// The [Working with long-running operations] chapter in the [user guide]
559 /// covers these operations in detail.
560 ///
561 /// [long-running operation]: https://google.aip.dev/151
562 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
563 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
564 pub fn failover_instance(&self) -> super::builder::alloy_db_admin::FailoverInstance {
565 super::builder::alloy_db_admin::FailoverInstance::new(self.inner.clone())
566 }
567
568 /// Injects fault in an instance.
569 /// Imperative only.
570 ///
571 /// # Long running operations
572 ///
573 /// This method is used to start, and/or poll a [long-running Operation].
574 /// The [Working with long-running operations] chapter in the [user guide]
575 /// covers these operations in detail.
576 ///
577 /// [long-running operation]: https://google.aip.dev/151
578 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
579 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
580 pub fn inject_fault(&self) -> super::builder::alloy_db_admin::InjectFault {
581 super::builder::alloy_db_admin::InjectFault::new(self.inner.clone())
582 }
583
584 /// Restart an Instance in a cluster.
585 /// Imperative only.
586 ///
587 /// # Long running operations
588 ///
589 /// This method is used to start, and/or poll a [long-running Operation].
590 /// The [Working with long-running operations] chapter in the [user guide]
591 /// covers these operations in detail.
592 ///
593 /// [long-running operation]: https://google.aip.dev/151
594 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
595 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
596 pub fn restart_instance(&self) -> super::builder::alloy_db_admin::RestartInstance {
597 super::builder::alloy_db_admin::RestartInstance::new(self.inner.clone())
598 }
599
600 /// Executes a SQL statement in a database inside an AlloyDB instance.
601 pub fn execute_sql(&self) -> super::builder::alloy_db_admin::ExecuteSql {
602 super::builder::alloy_db_admin::ExecuteSql::new(self.inner.clone())
603 }
604
605 /// Lists Backups in a given project and location.
606 pub fn list_backups(&self) -> super::builder::alloy_db_admin::ListBackups {
607 super::builder::alloy_db_admin::ListBackups::new(self.inner.clone())
608 }
609
610 /// Gets details of a single Backup.
611 pub fn get_backup(&self) -> super::builder::alloy_db_admin::GetBackup {
612 super::builder::alloy_db_admin::GetBackup::new(self.inner.clone())
613 }
614
615 /// Creates a new Backup in a given project and location.
616 ///
617 /// # Long running operations
618 ///
619 /// This method is used to start, and/or poll a [long-running Operation].
620 /// The [Working with long-running operations] chapter in the [user guide]
621 /// covers these operations in detail.
622 ///
623 /// [long-running operation]: https://google.aip.dev/151
624 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
625 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
626 pub fn create_backup(&self) -> super::builder::alloy_db_admin::CreateBackup {
627 super::builder::alloy_db_admin::CreateBackup::new(self.inner.clone())
628 }
629
630 /// Updates the parameters of a single Backup.
631 ///
632 /// # Long running operations
633 ///
634 /// This method is used to start, and/or poll a [long-running Operation].
635 /// The [Working with long-running operations] chapter in the [user guide]
636 /// covers these operations in detail.
637 ///
638 /// [long-running operation]: https://google.aip.dev/151
639 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
640 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
641 pub fn update_backup(&self) -> super::builder::alloy_db_admin::UpdateBackup {
642 super::builder::alloy_db_admin::UpdateBackup::new(self.inner.clone())
643 }
644
645 /// Deletes a single Backup.
646 ///
647 /// # Long running operations
648 ///
649 /// This method is used to start, and/or poll a [long-running Operation].
650 /// The [Working with long-running operations] chapter in the [user guide]
651 /// covers these operations in detail.
652 ///
653 /// [long-running operation]: https://google.aip.dev/151
654 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
655 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
656 pub fn delete_backup(&self) -> super::builder::alloy_db_admin::DeleteBackup {
657 super::builder::alloy_db_admin::DeleteBackup::new(self.inner.clone())
658 }
659
660 /// Lists SupportedDatabaseFlags for a given project and location.
661 pub fn list_supported_database_flags(
662 &self,
663 ) -> super::builder::alloy_db_admin::ListSupportedDatabaseFlags {
664 super::builder::alloy_db_admin::ListSupportedDatabaseFlags::new(self.inner.clone())
665 }
666
667 /// Generate a client certificate signed by a Cluster CA.
668 /// The sole purpose of this endpoint is to support AlloyDB connectors and the
669 /// Auth Proxy client. The endpoint's behavior is subject to change without
670 /// notice, so do not rely on its behavior remaining constant. Future changes
671 /// will not break AlloyDB connectors or the Auth Proxy client.
672 pub fn generate_client_certificate(
673 &self,
674 ) -> super::builder::alloy_db_admin::GenerateClientCertificate {
675 super::builder::alloy_db_admin::GenerateClientCertificate::new(self.inner.clone())
676 }
677
678 /// Get instance metadata used for a connection.
679 pub fn get_connection_info(&self) -> super::builder::alloy_db_admin::GetConnectionInfo {
680 super::builder::alloy_db_admin::GetConnectionInfo::new(self.inner.clone())
681 }
682
683 /// Lists Users in a given project and location.
684 pub fn list_users(&self) -> super::builder::alloy_db_admin::ListUsers {
685 super::builder::alloy_db_admin::ListUsers::new(self.inner.clone())
686 }
687
688 /// Gets details of a single User.
689 pub fn get_user(&self) -> super::builder::alloy_db_admin::GetUser {
690 super::builder::alloy_db_admin::GetUser::new(self.inner.clone())
691 }
692
693 /// Creates a new User in a given project, location, and cluster.
694 pub fn create_user(&self) -> super::builder::alloy_db_admin::CreateUser {
695 super::builder::alloy_db_admin::CreateUser::new(self.inner.clone())
696 }
697
698 /// Updates the parameters of a single User.
699 pub fn update_user(&self) -> super::builder::alloy_db_admin::UpdateUser {
700 super::builder::alloy_db_admin::UpdateUser::new(self.inner.clone())
701 }
702
703 /// Deletes a single User.
704 pub fn delete_user(&self) -> super::builder::alloy_db_admin::DeleteUser {
705 super::builder::alloy_db_admin::DeleteUser::new(self.inner.clone())
706 }
707
708 /// Lists Databases in a given project and location.
709 pub fn list_databases(&self) -> super::builder::alloy_db_admin::ListDatabases {
710 super::builder::alloy_db_admin::ListDatabases::new(self.inner.clone())
711 }
712
713 /// Lists information about the supported locations for this service.
714 pub fn list_locations(&self) -> super::builder::alloy_db_admin::ListLocations {
715 super::builder::alloy_db_admin::ListLocations::new(self.inner.clone())
716 }
717
718 /// Gets information about a location.
719 pub fn get_location(&self) -> super::builder::alloy_db_admin::GetLocation {
720 super::builder::alloy_db_admin::GetLocation::new(self.inner.clone())
721 }
722
723 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
724 ///
725 /// [google.longrunning.Operations]: longrunning::client::Operations
726 pub fn list_operations(&self) -> super::builder::alloy_db_admin::ListOperations {
727 super::builder::alloy_db_admin::ListOperations::new(self.inner.clone())
728 }
729
730 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
731 ///
732 /// [google.longrunning.Operations]: longrunning::client::Operations
733 pub fn get_operation(&self) -> super::builder::alloy_db_admin::GetOperation {
734 super::builder::alloy_db_admin::GetOperation::new(self.inner.clone())
735 }
736
737 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
738 ///
739 /// [google.longrunning.Operations]: longrunning::client::Operations
740 pub fn delete_operation(&self) -> super::builder::alloy_db_admin::DeleteOperation {
741 super::builder::alloy_db_admin::DeleteOperation::new(self.inner.clone())
742 }
743
744 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
745 ///
746 /// [google.longrunning.Operations]: longrunning::client::Operations
747 pub fn cancel_operation(&self) -> super::builder::alloy_db_admin::CancelOperation {
748 super::builder::alloy_db_admin::CancelOperation::new(self.inner.clone())
749 }
750}