google_sqladmin1/
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:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v7.0.0*.
6//!
7//! Everything else about the *SQL Admin* *v1* 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).
10//! # Features
11//!
12//! Handle the following *Resources* with ease from the central [hub](SQLAdmin) ...
13//!
14//! * [backups](api::Backup)
15//!  * [*create backup*](api::BackupCreateBackupCall), [*delete backup*](api::BackupDeleteBackupCall), [*get backup*](api::BackupGetBackupCall), [*list backups*](api::BackupListBackupCall) and [*update backup*](api::BackupUpdateBackupCall)
16//! * [backup runs](api::BackupRun)
17//!  * [*delete*](api::BackupRunDeleteCall), [*get*](api::BackupRunGetCall), [*insert*](api::BackupRunInsertCall) and [*list*](api::BackupRunListCall)
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.backups().create_backup(...).doit().await
71//! let r = hub.backups().delete_backup(...).doit().await
72//! let r = hub.backups().update_backup(...).doit().await
73//! let r = hub.backup_runs().delete(...).doit().await
74//! let r = hub.backup_runs().insert(...).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 = "*"
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 as sqladmin1;
143//! use sqladmin1::{Result, Error};
144//! # async fn dox() {
145//! use sqladmin1::{SQLAdmin, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
146//!
147//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
148//! // `client_secret`, among other things.
149//! let secret: yup_oauth2::ApplicationSecret = Default::default();
150//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
151//! // unless you replace  `None` with the desired Flow.
152//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
153//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
154//! // retrieve them from storage.
155//! let connector = hyper_rustls::HttpsConnectorBuilder::new()
156//!     .with_native_roots()
157//!     .unwrap()
158//!     .https_only()
159//!     .enable_http2()
160//!     .build();
161//!
162//! let executor = hyper_util::rt::TokioExecutor::new();
163//! let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
164//!     secret,
165//!     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
166//!     yup_oauth2::client::CustomHyperClientBuilder::from(
167//!         hyper_util::client::legacy::Client::builder(executor).build(connector),
168//!     ),
169//! ).build().await.unwrap();
170//!
171//! let client = hyper_util::client::legacy::Client::builder(
172//!     hyper_util::rt::TokioExecutor::new()
173//! )
174//! .build(
175//!     hyper_rustls::HttpsConnectorBuilder::new()
176//!         .with_native_roots()
177//!         .unwrap()
178//!         .https_or_http()
179//!         .enable_http2()
180//!         .build()
181//! );
182//! let mut hub = SQLAdmin::new(client, auth);
183//! // You can configure optional parameters by calling the respective setters at will, and
184//! // execute the final call using `doit()`.
185//! // Values shown here are possibly random and not representative !
186//! let result = hub.instances().delete("project", "instance")
187//!              .final_backup_ttl_days(-52)
188//!              .final_backup_expiry_time(chrono::Utc::now())
189//!              .final_backup_description("duo")
190//!              .enable_final_backup(true)
191//!              .doit().await;
192//!
193//! match result {
194//!     Err(e) => match e {
195//!         // The Error enum provides details about what exactly happened.
196//!         // You can also just use its `Debug`, `Display` or `Error` traits
197//!          Error::HttpError(_)
198//!         |Error::Io(_)
199//!         |Error::MissingAPIKey
200//!         |Error::MissingToken(_)
201//!         |Error::Cancelled
202//!         |Error::UploadSizeLimitExceeded(_, _)
203//!         |Error::Failure(_)
204//!         |Error::BadRequest(_)
205//!         |Error::FieldClash(_)
206//!         |Error::JsonDecodeError(_, _) => println!("{}", e),
207//!     },
208//!     Ok(res) => println!("Success: {:?}", res),
209//! }
210//! # }
211//! ```
212//! ## Handling Errors
213//!
214//! All errors produced by the system are provided either as [Result](common::Result) enumeration as return value of
215//! the doit() methods, or handed as possibly intermediate results to either the
216//! [Hub Delegate](common::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
217//!
218//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
219//! makes the system potentially resilient to all kinds of errors.
220//!
221//! ## Uploads and Downloads
222//! If a method supports downloads, the response body, which is part of the [Result](common::Result), should be
223//! read by you to obtain the media.
224//! If such a method also supports a [Response Result](common::ResponseResult), it will return that by default.
225//! 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
226//! this call: `.param("alt", "media")`.
227//!
228//! Methods supporting uploads can do so using up to 2 different protocols:
229//! *simple* and *resumable*. The distinctiveness of each is represented by customized
230//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
231//!
232//! ## Customization and Callbacks
233//!
234//! You may alter the way an `doit()` method is called by providing a [delegate](common::Delegate) to the
235//! [Method Builder](common::CallBuilder) before making the final `doit()` call.
236//! Respective methods will be called to provide progress information, as well as determine whether the system should
237//! retry on failure.
238//!
239//! The [delegate trait](common::Delegate) is default-implemented, allowing you to customize it with minimal effort.
240//!
241//! ## Optional Parts in Server-Requests
242//!
243//! All structures provided by this library are made to be [encodable](common::RequestValue) and
244//! [decodable](common::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
245//! are valid.
246//! Most optionals are are considered [Parts](common::Part) which are identifiable by name, which will be sent to
247//! the server to indicate either the set parts of the request or the desired parts in the response.
248//!
249//! ## Builder Arguments
250//!
251//! Using [method builders](common::CallBuilder), you are able to prepare an action call by repeatedly calling it's methods.
252//! These will always take a single argument, for which the following statements are true.
253//!
254//! * [PODs][wiki-pod] are handed by copy
255//! * strings are passed as `&str`
256//! * [request values](common::RequestValue) are moved
257//!
258//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
259//!
260//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure
261//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern
262//! [google-go-api]: https://github.com/google/google-api-go-client
263//!
264//! ## Cargo Features
265//!
266//! * `utoipa` - Add support for [utoipa](https://crates.io/crates/utoipa) and derive `utoipa::ToSchema` on all
267//! the types. You'll have to import and register the required types in `#[openapi(schemas(...))]`, otherwise the
268//! generated `openapi` spec would be invalid.
269//!
270//!
271//!
272
273// Unused attributes happen thanks to defined, but unused structures We don't
274// warn about this, as depending on the API, some data structures or facilities
275// are never used. Instead of pre-determining this, we just disable the lint.
276// It's manually tuned to not have any unused imports in fully featured APIs.
277// Same with unused_mut.
278#![allow(unused_imports, unused_mut, dead_code)]
279
280// DO NOT EDIT !
281// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
282// DO NOT EDIT !
283
284pub extern crate hyper;
285pub extern crate hyper_rustls;
286pub extern crate hyper_util;
287#[cfg(feature = "yup-oauth2")]
288pub extern crate yup_oauth2;
289
290pub extern crate google_apis_common as common;
291pub use common::{Delegate, Error, FieldMask, Result};
292
293pub mod api;
294pub use api::SQLAdmin;