google_sqladmin1_beta4/
lib.rs

1// DO NOT EDIT !
2// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
3// DO NOT EDIT !
4
5//! This documentation was generated from *SQL Admin* crate version *7.0.0+20251201*, where *20251201* is the exact revision of the *sqladmin:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v7.0.0*.
6//!
7//! Everything else about the *SQL Admin* *v1_beta4* API can be found at the
8//! [official documentation site](https://cloud.google.com/sql/docs).
9//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/sqladmin1_beta4).
10//! # Features
11//!
12//! Handle the following *Resources* with ease from the central [hub](SQLAdmin) ...
13//!
14//! * [backup runs](api::BackupRun)
15//!  * [*delete*](api::BackupRunDeleteCall), [*get*](api::BackupRunGetCall), [*insert*](api::BackupRunInsertCall) and [*list*](api::BackupRunListCall)
16//! * [backups](api::Backup)
17//!  * [*create backup*](api::BackupCreateBackupCall), [*delete backup*](api::BackupDeleteBackupCall), [*get backup*](api::BackupGetBackupCall), [*list backups*](api::BackupListBackupCall) and [*update backup*](api::BackupUpdateBackupCall)
18//! * connect
19//!  * [*generate ephemeral*](api::ConnectGenerateEphemeralCall) and [*get*](api::ConnectGetCall)
20//! * [databases](api::Database)
21//!  * [*delete*](api::DatabaseDeleteCall), [*get*](api::DatabaseGetCall), [*insert*](api::DatabaseInsertCall), [*list*](api::DatabaseListCall), [*patch*](api::DatabasePatchCall) and [*update*](api::DatabaseUpdateCall)
22//! * [flags](api::Flag)
23//!  * [*list*](api::FlagListCall)
24//! * instances
25//!  * [*list entra id certificates*](api::InstanceListEntraIdCertificateCall), [*list server certificates*](api::InstanceListServerCertificateCall), [*rotate entra id certificate*](api::InstanceRotateEntraIdCertificateCall), [*rotate server certificate*](api::InstanceRotateServerCertificateCall), [*acquire ssrs lease*](api::InstanceAcquireSsrsLeaseCall), [*add entra id certificate*](api::InstanceAddEntraIdCertificateCall), [*add server ca*](api::InstanceAddServerCaCall), [*add server certificate*](api::InstanceAddServerCertificateCall), [*clone*](api::InstanceCloneCall), [*delete*](api::InstanceDeleteCall), [*demote*](api::InstanceDemoteCall), [*demote master*](api::InstanceDemoteMasterCall), [*execute sql*](api::InstanceExecuteSqlCall), [*export*](api::InstanceExportCall), [*failover*](api::InstanceFailoverCall), [*get*](api::InstanceGetCall), [*import*](api::InstanceImportCall), [*insert*](api::InstanceInsertCall), [*list*](api::InstanceListCall), [*list server cas*](api::InstanceListServerCaCall), [*patch*](api::InstancePatchCall), [*point in time restore*](api::InstancePointInTimeRestoreCall), [*pre check major version upgrade*](api::InstancePreCheckMajorVersionUpgradeCall), [*promote replica*](api::InstancePromoteReplicaCall), [*reencrypt*](api::InstanceReencryptCall), [*release ssrs lease*](api::InstanceReleaseSsrsLeaseCall), [*reset ssl config*](api::InstanceResetSslConfigCall), [*restart*](api::InstanceRestartCall), [*restore backup*](api::InstanceRestoreBackupCall), [*rotate server ca*](api::InstanceRotateServerCaCall), [*start replica*](api::InstanceStartReplicaCall), [*stop replica*](api::InstanceStopReplicaCall), [*switchover*](api::InstanceSwitchoverCall), [*truncate log*](api::InstanceTruncateLogCall) and [*update*](api::InstanceUpdateCall)
26//! * [operations](api::Operation)
27//!  * [*cancel*](api::OperationCancelCall), [*get*](api::OperationGetCall) and [*list*](api::OperationListCall)
28//! * projects
29//!  * [*instances get disk shrink config*](api::ProjectInstanceGetDiskShrinkConfigCall), [*instances get latest recovery time*](api::ProjectInstanceGetLatestRecoveryTimeCall), [*instances perform disk shrink*](api::ProjectInstancePerformDiskShrinkCall), [*instances reschedule maintenance*](api::ProjectInstanceRescheduleMaintenanceCall), [*instances reset replica size*](api::ProjectInstanceResetReplicaSizeCall), [*instances start external sync*](api::ProjectInstanceStartExternalSyncCall) and [*instances verify external sync settings*](api::ProjectInstanceVerifyExternalSyncSettingCall)
30//! * [ssl certs](api::SslCert)
31//!  * [*create ephemeral*](api::SslCertCreateEphemeralCall), [*delete*](api::SslCertDeleteCall), [*get*](api::SslCertGetCall), [*insert*](api::SslCertInsertCall) and [*list*](api::SslCertListCall)
32//! * [tiers](api::Tier)
33//!  * [*list*](api::TierListCall)
34//! * [users](api::User)
35//!  * [*delete*](api::UserDeleteCall), [*get*](api::UserGetCall), [*insert*](api::UserInsertCall), [*list*](api::UserListCall) and [*update*](api::UserUpdateCall)
36//!
37//!
38//!
39//!
40//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs).
41//!
42//! # Structure of this Library
43//!
44//! The API is structured into the following primary items:
45//!
46//! * **[Hub](SQLAdmin)**
47//!     * a central object to maintain state and allow accessing all *Activities*
48//!     * creates [*Method Builders*](common::MethodsBuilder) which in turn
49//!       allow access to individual [*Call Builders*](common::CallBuilder)
50//! * **[Resources](common::Resource)**
51//!     * primary types that you can apply *Activities* to
52//!     * a collection of properties and *Parts*
53//!     * **[Parts](common::Part)**
54//!         * a collection of properties
55//!         * never directly used in *Activities*
56//! * **[Activities](common::CallBuilder)**
57//!     * operations to apply to *Resources*
58//!
59//! All *structures* are marked with applicable traits to further categorize them and ease browsing.
60//!
61//! Generally speaking, you can invoke *Activities* like this:
62//!
63//! ```Rust,ignore
64//! let r = hub.resource().activity(...).doit().await
65//! ```
66//!
67//! Or specifically ...
68//!
69//! ```ignore
70//! let r = hub.backup_runs().delete(...).doit().await
71//! let r = hub.backup_runs().insert(...).doit().await
72//! let r = hub.backups().create_backup(...).doit().await
73//! let r = hub.backups().delete_backup(...).doit().await
74//! let r = hub.backups().update_backup(...).doit().await
75//! let r = hub.databases().delete(...).doit().await
76//! let r = hub.databases().insert(...).doit().await
77//! let r = hub.databases().patch(...).doit().await
78//! let r = hub.databases().update(...).doit().await
79//! let r = hub.instances().rotate_entra_id_certificate(...).doit().await
80//! let r = hub.instances().rotate_server_certificate(...).doit().await
81//! let r = hub.instances().add_entra_id_certificate(...).doit().await
82//! let r = hub.instances().add_server_ca(...).doit().await
83//! let r = hub.instances().add_server_certificate(...).doit().await
84//! let r = hub.instances().clone(...).doit().await
85//! let r = hub.instances().delete(...).doit().await
86//! let r = hub.instances().demote(...).doit().await
87//! let r = hub.instances().demote_master(...).doit().await
88//! let r = hub.instances().export(...).doit().await
89//! let r = hub.instances().failover(...).doit().await
90//! let r = hub.instances().import(...).doit().await
91//! let r = hub.instances().insert(...).doit().await
92//! let r = hub.instances().patch(...).doit().await
93//! let r = hub.instances().point_in_time_restore(...).doit().await
94//! let r = hub.instances().pre_check_major_version_upgrade(...).doit().await
95//! let r = hub.instances().promote_replica(...).doit().await
96//! let r = hub.instances().reencrypt(...).doit().await
97//! let r = hub.instances().reset_ssl_config(...).doit().await
98//! let r = hub.instances().restart(...).doit().await
99//! let r = hub.instances().restore_backup(...).doit().await
100//! let r = hub.instances().rotate_server_ca(...).doit().await
101//! let r = hub.instances().start_replica(...).doit().await
102//! let r = hub.instances().stop_replica(...).doit().await
103//! let r = hub.instances().switchover(...).doit().await
104//! let r = hub.instances().truncate_log(...).doit().await
105//! let r = hub.instances().update(...).doit().await
106//! let r = hub.operations().cancel(...).doit().await
107//! let r = hub.operations().get(...).doit().await
108//! let r = hub.operations().list(...).doit().await
109//! let r = hub.projects().instances_perform_disk_shrink(...).doit().await
110//! let r = hub.projects().instances_reschedule_maintenance(...).doit().await
111//! let r = hub.projects().instances_reset_replica_size(...).doit().await
112//! let r = hub.projects().instances_start_external_sync(...).doit().await
113//! let r = hub.ssl_certs().delete(...).doit().await
114//! let r = hub.users().delete(...).doit().await
115//! let r = hub.users().insert(...).doit().await
116//! let r = hub.users().update(...).doit().await
117//! ```
118//!
119//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
120//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
121//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired.
122//! The `doit()` method performs the actual communication with the server and returns the respective result.
123//!
124//! # Usage
125//!
126//! ## Setting up your Project
127//!
128//! To use this library, you would put the following lines into your `Cargo.toml` file:
129//!
130//! ```toml
131//! [dependencies]
132//! google-sqladmin1_beta4 = "*"
133//! serde = "1"
134//! serde_json = "1"
135//! ```
136//!
137//! ## A complete example
138//!
139//! ```test_harness,no_run
140//! extern crate hyper;
141//! extern crate hyper_rustls;
142//! extern crate google_sqladmin1_beta4 as sqladmin1_beta4;
143//! use sqladmin1_beta4::api::User;
144//! use sqladmin1_beta4::{Result, Error};
145//! # async fn dox() {
146//! use sqladmin1_beta4::{SQLAdmin, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
147//!
148//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
149//! // `client_secret`, among other things.
150//! let secret: yup_oauth2::ApplicationSecret = Default::default();
151//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
152//! // unless you replace  `None` with the desired Flow.
153//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
154//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
155//! // retrieve them from storage.
156//! let connector = hyper_rustls::HttpsConnectorBuilder::new()
157//!     .with_native_roots()
158//!     .unwrap()
159//!     .https_only()
160//!     .enable_http2()
161//!     .build();
162//!
163//! let executor = hyper_util::rt::TokioExecutor::new();
164//! let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
165//!     secret,
166//!     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
167//!     yup_oauth2::client::CustomHyperClientBuilder::from(
168//!         hyper_util::client::legacy::Client::builder(executor).build(connector),
169//!     ),
170//! ).build().await.unwrap();
171//!
172//! let client = hyper_util::client::legacy::Client::builder(
173//!     hyper_util::rt::TokioExecutor::new()
174//! )
175//! .build(
176//!     hyper_rustls::HttpsConnectorBuilder::new()
177//!         .with_native_roots()
178//!         .unwrap()
179//!         .https_or_http()
180//!         .enable_http2()
181//!         .build()
182//! );
183//! let mut hub = SQLAdmin::new(client, auth);
184//! // As the method needs a request, you would usually fill it with the desired information
185//! // into the respective structure. Some of the parts shown here might not be applicable !
186//! // Values shown here are possibly random and not representative !
187//! let mut req = User::default();
188//!
189//! // You can configure optional parameters by calling the respective setters at will, and
190//! // execute the final call using `doit()`.
191//! // Values shown here are possibly random and not representative !
192//! let result = hub.users().update(req, "project", "instance")
193//!              .revoke_existing_roles(true)
194//!              .name("amet.")
195//!              .host("duo")
196//!              .add_database_roles("ipsum")
197//!              .doit().await;
198//!
199//! match result {
200//!     Err(e) => match e {
201//!         // The Error enum provides details about what exactly happened.
202//!         // You can also just use its `Debug`, `Display` or `Error` traits
203//!          Error::HttpError(_)
204//!         |Error::Io(_)
205//!         |Error::MissingAPIKey
206//!         |Error::MissingToken(_)
207//!         |Error::Cancelled
208//!         |Error::UploadSizeLimitExceeded(_, _)
209//!         |Error::Failure(_)
210//!         |Error::BadRequest(_)
211//!         |Error::FieldClash(_)
212//!         |Error::JsonDecodeError(_, _) => println!("{}", e),
213//!     },
214//!     Ok(res) => println!("Success: {:?}", res),
215//! }
216//! # }
217//! ```
218//! ## Handling Errors
219//!
220//! All errors produced by the system are provided either as [Result](common::Result) enumeration as return value of
221//! the doit() methods, or handed as possibly intermediate results to either the
222//! [Hub Delegate](common::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
223//!
224//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
225//! makes the system potentially resilient to all kinds of errors.
226//!
227//! ## Uploads and Downloads
228//! If a method supports downloads, the response body, which is part of the [Result](common::Result), should be
229//! read by you to obtain the media.
230//! If such a method also supports a [Response Result](common::ResponseResult), it will return that by default.
231//! You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making
232//! this call: `.param("alt", "media")`.
233//!
234//! Methods supporting uploads can do so using up to 2 different protocols:
235//! *simple* and *resumable*. The distinctiveness of each is represented by customized
236//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
237//!
238//! ## Customization and Callbacks
239//!
240//! You may alter the way an `doit()` method is called by providing a [delegate](common::Delegate) to the
241//! [Method Builder](common::CallBuilder) before making the final `doit()` call.
242//! Respective methods will be called to provide progress information, as well as determine whether the system should
243//! retry on failure.
244//!
245//! The [delegate trait](common::Delegate) is default-implemented, allowing you to customize it with minimal effort.
246//!
247//! ## Optional Parts in Server-Requests
248//!
249//! All structures provided by this library are made to be [encodable](common::RequestValue) and
250//! [decodable](common::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
251//! are valid.
252//! Most optionals are are considered [Parts](common::Part) which are identifiable by name, which will be sent to
253//! the server to indicate either the set parts of the request or the desired parts in the response.
254//!
255//! ## Builder Arguments
256//!
257//! Using [method builders](common::CallBuilder), you are able to prepare an action call by repeatedly calling it's methods.
258//! These will always take a single argument, for which the following statements are true.
259//!
260//! * [PODs][wiki-pod] are handed by copy
261//! * strings are passed as `&str`
262//! * [request values](common::RequestValue) are moved
263//!
264//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
265//!
266//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure
267//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern
268//! [google-go-api]: https://github.com/google/google-api-go-client
269//!
270//! ## Cargo Features
271//!
272//! * `utoipa` - Add support for [utoipa](https://crates.io/crates/utoipa) and derive `utoipa::ToSchema` on all
273//! the types. You'll have to import and register the required types in `#[openapi(schemas(...))]`, otherwise the
274//! generated `openapi` spec would be invalid.
275//!
276//!
277//!
278
279// Unused attributes happen thanks to defined, but unused structures We don't
280// warn about this, as depending on the API, some data structures or facilities
281// are never used. Instead of pre-determining this, we just disable the lint.
282// It's manually tuned to not have any unused imports in fully featured APIs.
283// Same with unused_mut.
284#![allow(unused_imports, unused_mut, dead_code)]
285
286// DO NOT EDIT !
287// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
288// DO NOT EDIT !
289
290pub extern crate hyper;
291pub extern crate hyper_rustls;
292pub extern crate hyper_util;
293#[cfg(feature = "yup-oauth2")]
294pub extern crate yup_oauth2;
295
296pub extern crate google_apis_common as common;
297pub use common::{Delegate, Error, FieldMask, Result};
298
299pub mod api;
300pub use api::SQLAdmin;