use super::*; /// A builder providing access to all methods supported on *backupRun* resources. /// It is not used directly, but through the [`SQLAdmin`] hub. /// /// # Example /// /// Instantiate a resource builder /// /// ```test_harness,no_run /// extern crate hyper; /// extern crate hyper_rustls; /// extern crate google_sql1_beta4 as sql1_beta4; /// /// # async fn dox() { /// use std::default::Default; /// use sql1_beta4::{SQLAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask}; /// /// let secret: oauth2::ApplicationSecret = Default::default(); /// let auth = oauth2::InstalledFlowAuthenticator::builder( /// secret, /// oauth2::InstalledFlowReturnMethod::HTTPRedirect, /// ).build().await.unwrap(); /// let mut hub = SQLAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* /// // like `delete(...)`, `get(...)`, `insert(...)` and `list(...)` /// // to build up your call. /// let rb = hub.backup_runs(); /// # } /// ``` pub struct BackupRunMethods<'a, S> where S: 'a { pub(super) hub: &'a SQLAdmin, } impl<'a, S> client::MethodsBuilder for BackupRunMethods<'a, S> {} impl<'a, S> BackupRunMethods<'a, S> { /// Create a builder to help you perform the following task: /// /// Deletes the backup taken by a backup run. /// /// # Arguments /// /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Cloud SQL instance ID. This does not include the project ID. /// * `id` - The ID of the Backup Run to delete. To find a Backup Run ID, use the list /// method. pub fn delete(&self, project: &str, instance: &str, id: i64) -> BackupRunDeleteCall<'a, S> { BackupRunDeleteCall { hub: self.hub, _project: project.to_string(), _instance: instance.to_string(), _id: id, _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Retrieves a resource containing information about a backup run. /// /// # Arguments /// /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Cloud SQL instance ID. This does not include the project ID. /// * `id` - The ID of this Backup Run. pub fn get(&self, project: &str, instance: &str, id: i64) -> BackupRunGetCall<'a, S> { BackupRunGetCall { hub: self.hub, _project: project.to_string(), _instance: instance.to_string(), _id: id, _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Creates a new backup run on demand. This method is applicable only to /// Second Generation instances. /// /// # Arguments /// /// * `request` - No description provided. /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Cloud SQL instance ID. This does not include the project ID. pub fn insert(&self, request: BackupRun, project: &str, instance: &str) -> BackupRunInsertCall<'a, S> { BackupRunInsertCall { hub: self.hub, _request: request, _project: project.to_string(), _instance: instance.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Lists all backup runs associated with a given instance and configuration in /// the reverse chronological order of the backup initiation time. /// /// # Arguments /// /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Cloud SQL instance ID. This does not include the project ID. pub fn list(&self, project: &str, instance: &str) -> BackupRunListCall<'a, S> { BackupRunListCall { hub: self.hub, _project: project.to_string(), _instance: instance.to_string(), _page_token: Default::default(), _max_results: Default::default(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } } /// A builder providing access to all methods supported on *database* resources. /// It is not used directly, but through the [`SQLAdmin`] hub. /// /// # Example /// /// Instantiate a resource builder /// /// ```test_harness,no_run /// extern crate hyper; /// extern crate hyper_rustls; /// extern crate google_sql1_beta4 as sql1_beta4; /// /// # async fn dox() { /// use std::default::Default; /// use sql1_beta4::{SQLAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask}; /// /// let secret: oauth2::ApplicationSecret = Default::default(); /// let auth = oauth2::InstalledFlowAuthenticator::builder( /// secret, /// oauth2::InstalledFlowReturnMethod::HTTPRedirect, /// ).build().await.unwrap(); /// let mut hub = SQLAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* /// // like `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` /// // to build up your call. /// let rb = hub.databases(); /// # } /// ``` pub struct DatabaseMethods<'a, S> where S: 'a { pub(super) hub: &'a SQLAdmin, } impl<'a, S> client::MethodsBuilder for DatabaseMethods<'a, S> {} impl<'a, S> DatabaseMethods<'a, S> { /// Create a builder to help you perform the following task: /// /// Deletes a database from a Cloud SQL instance. /// /// # Arguments /// /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Database instance ID. This does not include the project ID. /// * `database` - Name of the database to be deleted in the instance. pub fn delete(&self, project: &str, instance: &str, database: &str) -> DatabaseDeleteCall<'a, S> { DatabaseDeleteCall { hub: self.hub, _project: project.to_string(), _instance: instance.to_string(), _database: database.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Retrieves a resource containing information about a database inside a Cloud /// SQL instance. /// /// # Arguments /// /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Database instance ID. This does not include the project ID. /// * `database` - Name of the database in the instance. pub fn get(&self, project: &str, instance: &str, database: &str) -> DatabaseGetCall<'a, S> { DatabaseGetCall { hub: self.hub, _project: project.to_string(), _instance: instance.to_string(), _database: database.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Inserts a resource containing information about a database inside a Cloud /// SQL instance. /// /// # Arguments /// /// * `request` - No description provided. /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Database instance ID. This does not include the project ID. pub fn insert(&self, request: Database, project: &str, instance: &str) -> DatabaseInsertCall<'a, S> { DatabaseInsertCall { hub: self.hub, _request: request, _project: project.to_string(), _instance: instance.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Lists databases in the specified Cloud SQL instance. /// /// # Arguments /// /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Cloud SQL instance ID. This does not include the project ID. pub fn list(&self, project: &str, instance: &str) -> DatabaseListCall<'a, S> { DatabaseListCall { hub: self.hub, _project: project.to_string(), _instance: instance.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Partially updates a resource containing information about a database inside /// a Cloud SQL instance. This method supports patch semantics. /// /// # Arguments /// /// * `request` - No description provided. /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Database instance ID. This does not include the project ID. /// * `database` - Name of the database to be updated in the instance. pub fn patch(&self, request: Database, project: &str, instance: &str, database: &str) -> DatabasePatchCall<'a, S> { DatabasePatchCall { hub: self.hub, _request: request, _project: project.to_string(), _instance: instance.to_string(), _database: database.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Updates a resource containing information about a database inside a Cloud /// SQL instance. /// /// # Arguments /// /// * `request` - No description provided. /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Database instance ID. This does not include the project ID. /// * `database` - Name of the database to be updated in the instance. pub fn update(&self, request: Database, project: &str, instance: &str, database: &str) -> DatabaseUpdateCall<'a, S> { DatabaseUpdateCall { hub: self.hub, _request: request, _project: project.to_string(), _instance: instance.to_string(), _database: database.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } } /// A builder providing access to all methods supported on *flag* resources. /// It is not used directly, but through the [`SQLAdmin`] hub. /// /// # Example /// /// Instantiate a resource builder /// /// ```test_harness,no_run /// extern crate hyper; /// extern crate hyper_rustls; /// extern crate google_sql1_beta4 as sql1_beta4; /// /// # async fn dox() { /// use std::default::Default; /// use sql1_beta4::{SQLAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask}; /// /// let secret: oauth2::ApplicationSecret = Default::default(); /// let auth = oauth2::InstalledFlowAuthenticator::builder( /// secret, /// oauth2::InstalledFlowReturnMethod::HTTPRedirect, /// ).build().await.unwrap(); /// let mut hub = SQLAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* /// // like `list(...)` /// // to build up your call. /// let rb = hub.flags(); /// # } /// ``` pub struct FlagMethods<'a, S> where S: 'a { pub(super) hub: &'a SQLAdmin, } impl<'a, S> client::MethodsBuilder for FlagMethods<'a, S> {} impl<'a, S> FlagMethods<'a, S> { /// Create a builder to help you perform the following task: /// /// List all available database flags for Cloud SQL instances. pub fn list(&self) -> FlagListCall<'a, S> { FlagListCall { hub: self.hub, _database_version: Default::default(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } } /// A builder providing access to all methods supported on *instance* resources. /// It is not used directly, but through the [`SQLAdmin`] hub. /// /// # Example /// /// Instantiate a resource builder /// /// ```test_harness,no_run /// extern crate hyper; /// extern crate hyper_rustls; /// extern crate google_sql1_beta4 as sql1_beta4; /// /// # async fn dox() { /// use std::default::Default; /// use sql1_beta4::{SQLAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask}; /// /// let secret: oauth2::ApplicationSecret = Default::default(); /// let auth = oauth2::InstalledFlowAuthenticator::builder( /// secret, /// oauth2::InstalledFlowReturnMethod::HTTPRedirect, /// ).build().await.unwrap(); /// let mut hub = SQLAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* /// // like `add_server_ca(...)`, `clone(...)`, `delete(...)`, `demote_master(...)`, `export(...)`, `failover(...)`, `get(...)`, `import(...)`, `insert(...)`, `list(...)`, `list_server_cas(...)`, `patch(...)`, `promote_replica(...)`, `reset_ssl_config(...)`, `restart(...)`, `restore_backup(...)`, `rotate_server_ca(...)`, `start_replica(...)`, `stop_replica(...)`, `truncate_log(...)` and `update(...)` /// // to build up your call. /// let rb = hub.instances(); /// # } /// ``` pub struct InstanceMethods<'a, S> where S: 'a { pub(super) hub: &'a SQLAdmin, } impl<'a, S> client::MethodsBuilder for InstanceMethods<'a, S> {} impl<'a, S> InstanceMethods<'a, S> { /// Create a builder to help you perform the following task: /// /// Add a new trusted Certificate Authority (CA) version for the specified /// instance. Required to prepare for a certificate rotation. If a CA version /// was previously added but never used in a certificate rotation, this /// operation replaces that version. There cannot be more than one CA version /// waiting to be rotated in. /// /// # Arguments /// /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Cloud SQL instance ID. This does not include the project ID. pub fn add_server_ca(&self, project: &str, instance: &str) -> InstanceAddServerCaCall<'a, S> { InstanceAddServerCaCall { hub: self.hub, _project: project.to_string(), _instance: instance.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Creates a Cloud SQL instance as a clone of the source instance. Using this /// operation might cause your instance to restart. /// /// # Arguments /// /// * `request` - No description provided. /// * `project` - Project ID of the source as well as the clone Cloud SQL instance. /// * `instance` - The ID of the Cloud SQL instance to be cloned (source). This does not /// include the project ID. pub fn clone(&self, request: InstancesCloneRequest, project: &str, instance: &str) -> InstanceCloneCall<'a, S> { InstanceCloneCall { hub: self.hub, _request: request, _project: project.to_string(), _instance: instance.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Deletes a Cloud SQL instance. /// /// # Arguments /// /// * `project` - Project ID of the project that contains the instance to be deleted. /// * `instance` - Cloud SQL instance ID. This does not include the project ID. pub fn delete(&self, project: &str, instance: &str) -> InstanceDeleteCall<'a, S> { InstanceDeleteCall { hub: self.hub, _project: project.to_string(), _instance: instance.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Demotes the stand-alone instance to be a Cloud SQL read replica for an /// external database server. /// /// # Arguments /// /// * `request` - No description provided. /// * `project` - ID of the project that contains the instance. /// * `instance` - Cloud SQL instance name. pub fn demote_master(&self, request: InstancesDemoteMasterRequest, project: &str, instance: &str) -> InstanceDemoteMasterCall<'a, S> { InstanceDemoteMasterCall { hub: self.hub, _request: request, _project: project.to_string(), _instance: instance.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL /// dump or CSV file. /// /// # Arguments /// /// * `request` - No description provided. /// * `project` - Project ID of the project that contains the instance to be exported. /// * `instance` - Cloud SQL instance ID. This does not include the project ID. pub fn export(&self, request: InstancesExportRequest, project: &str, instance: &str) -> InstanceExportCall<'a, S> { InstanceExportCall { hub: self.hub, _request: request, _project: project.to_string(), _instance: instance.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Failover the instance to its failover replica instance. Using this /// operation might cause your instance to restart. /// /// # Arguments /// /// * `request` - No description provided. /// * `project` - ID of the project that contains the read replica. /// * `instance` - Cloud SQL instance ID. This does not include the project ID. pub fn failover(&self, request: InstancesFailoverRequest, project: &str, instance: &str) -> InstanceFailoverCall<'a, S> { InstanceFailoverCall { hub: self.hub, _request: request, _project: project.to_string(), _instance: instance.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Retrieves a resource containing information about a Cloud SQL instance. /// /// # Arguments /// /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Database instance ID. This does not include the project ID. pub fn get(&self, project: &str, instance: &str) -> InstanceGetCall<'a, S> { InstanceGetCall { hub: self.hub, _project: project.to_string(), _instance: instance.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Imports data into a Cloud SQL instance from a SQL dump or CSV file in /// Cloud Storage. /// /// # Arguments /// /// * `request` - No description provided. /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Cloud SQL instance ID. This does not include the project ID. pub fn import(&self, request: InstancesImportRequest, project: &str, instance: &str) -> InstanceImportCall<'a, S> { InstanceImportCall { hub: self.hub, _request: request, _project: project.to_string(), _instance: instance.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Creates a new Cloud SQL instance. /// /// # Arguments /// /// * `request` - No description provided. /// * `project` - Project ID of the project to which the newly created Cloud SQL instances /// should belong. pub fn insert(&self, request: DatabaseInstance, project: &str) -> InstanceInsertCall<'a, S> { InstanceInsertCall { hub: self.hub, _request: request, _project: project.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Lists instances under a given project. /// /// # Arguments /// /// * `project` - Project ID of the project for which to list Cloud SQL instances. pub fn list(&self, project: &str) -> InstanceListCall<'a, S> { InstanceListCall { hub: self.hub, _project: project.to_string(), _page_token: Default::default(), _max_results: Default::default(), _filter: Default::default(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Lists all of the trusted Certificate Authorities (CAs) for the specified /// instance. There can be up to three CAs listed: the CA that was used to sign /// the certificate that is currently in use, a CA that has been added but not /// yet used to sign a certificate, and a CA used to sign a certificate that /// has previously rotated out. /// /// # Arguments /// /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Cloud SQL instance ID. This does not include the project ID. pub fn list_server_cas(&self, project: &str, instance: &str) -> InstanceListServerCaCall<'a, S> { InstanceListServerCaCall { hub: self.hub, _project: project.to_string(), _instance: instance.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Updates settings of a Cloud SQL instance. /// This method supports patch semantics. /// /// # Arguments /// /// * `request` - No description provided. /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Cloud SQL instance ID. This does not include the project ID. pub fn patch(&self, request: DatabaseInstance, project: &str, instance: &str) -> InstancePatchCall<'a, S> { InstancePatchCall { hub: self.hub, _request: request, _project: project.to_string(), _instance: instance.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Promotes the read replica instance to be a stand-alone Cloud SQL instance. /// Using this operation might cause your instance to restart. /// /// # Arguments /// /// * `project` - ID of the project that contains the read replica. /// * `instance` - Cloud SQL read replica instance name. pub fn promote_replica(&self, project: &str, instance: &str) -> InstancePromoteReplicaCall<'a, S> { InstancePromoteReplicaCall { hub: self.hub, _project: project.to_string(), _instance: instance.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Deletes all client certificates and generates a new server SSL certificate /// for the instance. /// /// # Arguments /// /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Cloud SQL instance ID. This does not include the project ID. pub fn reset_ssl_config(&self, project: &str, instance: &str) -> InstanceResetSslConfigCall<'a, S> { InstanceResetSslConfigCall { hub: self.hub, _project: project.to_string(), _instance: instance.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Restarts a Cloud SQL instance. /// /// # Arguments /// /// * `project` - Project ID of the project that contains the instance to be restarted. /// * `instance` - Cloud SQL instance ID. This does not include the project ID. pub fn restart(&self, project: &str, instance: &str) -> InstanceRestartCall<'a, S> { InstanceRestartCall { hub: self.hub, _project: project.to_string(), _instance: instance.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Restores a backup of a Cloud SQL instance. Using this operation might cause /// your instance to restart. /// /// # Arguments /// /// * `request` - No description provided. /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Cloud SQL instance ID. This does not include the project ID. pub fn restore_backup(&self, request: InstancesRestoreBackupRequest, project: &str, instance: &str) -> InstanceRestoreBackupCall<'a, S> { InstanceRestoreBackupCall { hub: self.hub, _request: request, _project: project.to_string(), _instance: instance.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Rotates the server certificate to one signed by the Certificate Authority /// (CA) version previously added with the addServerCA method. /// /// # Arguments /// /// * `request` - No description provided. /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Cloud SQL instance ID. This does not include the project ID. pub fn rotate_server_ca(&self, request: InstancesRotateServerCaRequest, project: &str, instance: &str) -> InstanceRotateServerCaCall<'a, S> { InstanceRotateServerCaCall { hub: self.hub, _request: request, _project: project.to_string(), _instance: instance.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Starts the replication in the read replica instance. /// /// # Arguments /// /// * `project` - ID of the project that contains the read replica. /// * `instance` - Cloud SQL read replica instance name. pub fn start_replica(&self, project: &str, instance: &str) -> InstanceStartReplicaCall<'a, S> { InstanceStartReplicaCall { hub: self.hub, _project: project.to_string(), _instance: instance.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Stops the replication in the read replica instance. /// /// # Arguments /// /// * `project` - ID of the project that contains the read replica. /// * `instance` - Cloud SQL read replica instance name. pub fn stop_replica(&self, project: &str, instance: &str) -> InstanceStopReplicaCall<'a, S> { InstanceStopReplicaCall { hub: self.hub, _project: project.to_string(), _instance: instance.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Truncate MySQL general and slow query log tables /// /// # Arguments /// /// * `request` - No description provided. /// * `project` - Project ID of the Cloud SQL project. /// * `instance` - Cloud SQL instance ID. This does not include the project ID. pub fn truncate_log(&self, request: InstancesTruncateLogRequest, project: &str, instance: &str) -> InstanceTruncateLogCall<'a, S> { InstanceTruncateLogCall { hub: self.hub, _request: request, _project: project.to_string(), _instance: instance.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Updates settings of a Cloud SQL instance. Using this operation might cause /// your instance to restart. /// /// # Arguments /// /// * `request` - No description provided. /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Cloud SQL instance ID. This does not include the project ID. pub fn update(&self, request: DatabaseInstance, project: &str, instance: &str) -> InstanceUpdateCall<'a, S> { InstanceUpdateCall { hub: self.hub, _request: request, _project: project.to_string(), _instance: instance.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } } /// A builder providing access to all methods supported on *operation* resources. /// It is not used directly, but through the [`SQLAdmin`] hub. /// /// # Example /// /// Instantiate a resource builder /// /// ```test_harness,no_run /// extern crate hyper; /// extern crate hyper_rustls; /// extern crate google_sql1_beta4 as sql1_beta4; /// /// # async fn dox() { /// use std::default::Default; /// use sql1_beta4::{SQLAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask}; /// /// let secret: oauth2::ApplicationSecret = Default::default(); /// let auth = oauth2::InstalledFlowAuthenticator::builder( /// secret, /// oauth2::InstalledFlowReturnMethod::HTTPRedirect, /// ).build().await.unwrap(); /// let mut hub = SQLAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* /// // like `get(...)` and `list(...)` /// // to build up your call. /// let rb = hub.operations(); /// # } /// ``` pub struct OperationMethods<'a, S> where S: 'a { pub(super) hub: &'a SQLAdmin, } impl<'a, S> client::MethodsBuilder for OperationMethods<'a, S> {} impl<'a, S> OperationMethods<'a, S> { /// Create a builder to help you perform the following task: /// /// Retrieves an instance operation that has been performed on an instance. /// /// # Arguments /// /// * `project` - Project ID of the project that contains the instance. /// * `operation` - Instance operation ID. pub fn get(&self, project: &str, operation: &str) -> OperationGetCall<'a, S> { OperationGetCall { hub: self.hub, _project: project.to_string(), _operation: operation.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Lists all instance operations that have been performed on the given Cloud /// SQL instance in the reverse chronological order of the start time. /// /// # Arguments /// /// * `project` - Project ID of the project that contains the instance. pub fn list(&self, project: &str) -> OperationListCall<'a, S> { OperationListCall { hub: self.hub, _project: project.to_string(), _page_token: Default::default(), _max_results: Default::default(), _instance: Default::default(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } } /// A builder providing access to all methods supported on *project* resources. /// It is not used directly, but through the [`SQLAdmin`] hub. /// /// # Example /// /// Instantiate a resource builder /// /// ```test_harness,no_run /// extern crate hyper; /// extern crate hyper_rustls; /// extern crate google_sql1_beta4 as sql1_beta4; /// /// # async fn dox() { /// use std::default::Default; /// use sql1_beta4::{SQLAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask}; /// /// let secret: oauth2::ApplicationSecret = Default::default(); /// let auth = oauth2::InstalledFlowAuthenticator::builder( /// secret, /// oauth2::InstalledFlowReturnMethod::HTTPRedirect, /// ).build().await.unwrap(); /// let mut hub = SQLAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* /// // like `instances_reschedule_maintenance(...)`, `instances_start_external_sync(...)` and `instances_verify_external_sync_settings(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } /// ``` pub struct ProjectMethods<'a, S> where S: 'a { pub(super) hub: &'a SQLAdmin, } impl<'a, S> client::MethodsBuilder for ProjectMethods<'a, S> {} impl<'a, S> ProjectMethods<'a, S> { /// Create a builder to help you perform the following task: /// /// Reschedules the maintenance on the given instance. /// /// # Arguments /// /// * `request` - No description provided. /// * `project` - ID of the project that contains the instance. /// * `instance` - Cloud SQL instance ID. This does not include the project ID. pub fn instances_reschedule_maintenance(&self, request: SqlInstancesRescheduleMaintenanceRequestBody, project: &str, instance: &str) -> ProjectInstanceRescheduleMaintenanceCall<'a, S> { ProjectInstanceRescheduleMaintenanceCall { hub: self.hub, _request: request, _project: project.to_string(), _instance: instance.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Start External master migration. /// /// # Arguments /// /// * `project` - ID of the project that contains the first generation instance. /// * `instance` - Cloud SQL instance ID. This does not include the project ID. pub fn instances_start_external_sync(&self, project: &str, instance: &str) -> ProjectInstanceStartExternalSyncCall<'a, S> { ProjectInstanceStartExternalSyncCall { hub: self.hub, _project: project.to_string(), _instance: instance.to_string(), _sync_mode: Default::default(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Verify External master external sync settings. /// /// # Arguments /// /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Cloud SQL instance ID. This does not include the project ID. pub fn instances_verify_external_sync_settings(&self, project: &str, instance: &str) -> ProjectInstanceVerifyExternalSyncSettingCall<'a, S> { ProjectInstanceVerifyExternalSyncSettingCall { hub: self.hub, _project: project.to_string(), _instance: instance.to_string(), _verify_connection_only: Default::default(), _sync_mode: Default::default(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } } /// A builder providing access to all methods supported on *sslCert* resources. /// It is not used directly, but through the [`SQLAdmin`] hub. /// /// # Example /// /// Instantiate a resource builder /// /// ```test_harness,no_run /// extern crate hyper; /// extern crate hyper_rustls; /// extern crate google_sql1_beta4 as sql1_beta4; /// /// # async fn dox() { /// use std::default::Default; /// use sql1_beta4::{SQLAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask}; /// /// let secret: oauth2::ApplicationSecret = Default::default(); /// let auth = oauth2::InstalledFlowAuthenticator::builder( /// secret, /// oauth2::InstalledFlowReturnMethod::HTTPRedirect, /// ).build().await.unwrap(); /// let mut hub = SQLAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* /// // like `create_ephemeral(...)`, `delete(...)`, `get(...)`, `insert(...)` and `list(...)` /// // to build up your call. /// let rb = hub.ssl_certs(); /// # } /// ``` pub struct SslCertMethods<'a, S> where S: 'a { pub(super) hub: &'a SQLAdmin, } impl<'a, S> client::MethodsBuilder for SslCertMethods<'a, S> {} impl<'a, S> SslCertMethods<'a, S> { /// Create a builder to help you perform the following task: /// /// Generates a short-lived X509 certificate containing the provided public key /// and signed by a private key specific to the target instance. Users may use /// the certificate to authenticate as themselves when connecting to the /// database. /// /// # Arguments /// /// * `request` - No description provided. /// * `project` - Project ID of the Cloud SQL project. /// * `instance` - Cloud SQL instance ID. This does not include the project ID. pub fn create_ephemeral(&self, request: SslCertsCreateEphemeralRequest, project: &str, instance: &str) -> SslCertCreateEphemeralCall<'a, S> { SslCertCreateEphemeralCall { hub: self.hub, _request: request, _project: project.to_string(), _instance: instance.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Deletes the SSL certificate. For First Generation instances, the /// certificate remains valid until the instance is restarted. /// /// # Arguments /// /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Cloud SQL instance ID. This does not include the project ID. /// * `sha1Fingerprint` - Sha1 FingerPrint. pub fn delete(&self, project: &str, instance: &str, sha1_fingerprint: &str) -> SslCertDeleteCall<'a, S> { SslCertDeleteCall { hub: self.hub, _project: project.to_string(), _instance: instance.to_string(), _sha1_fingerprint: sha1_fingerprint.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Retrieves a particular SSL certificate. Does not include the private key /// (required for usage). The private key must be saved from the response to /// initial creation. /// /// # Arguments /// /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Cloud SQL instance ID. This does not include the project ID. /// * `sha1Fingerprint` - Sha1 FingerPrint. pub fn get(&self, project: &str, instance: &str, sha1_fingerprint: &str) -> SslCertGetCall<'a, S> { SslCertGetCall { hub: self.hub, _project: project.to_string(), _instance: instance.to_string(), _sha1_fingerprint: sha1_fingerprint.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Creates an SSL certificate and returns it along with the private key and /// server certificate authority. The new certificate will not be usable until /// the instance is restarted. /// /// # Arguments /// /// * `request` - No description provided. /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Cloud SQL instance ID. This does not include the project ID. pub fn insert(&self, request: SslCertsInsertRequest, project: &str, instance: &str) -> SslCertInsertCall<'a, S> { SslCertInsertCall { hub: self.hub, _request: request, _project: project.to_string(), _instance: instance.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Lists all of the current SSL certificates for the instance. /// /// # Arguments /// /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Cloud SQL instance ID. This does not include the project ID. pub fn list(&self, project: &str, instance: &str) -> SslCertListCall<'a, S> { SslCertListCall { hub: self.hub, _project: project.to_string(), _instance: instance.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } } /// A builder providing access to all methods supported on *tier* resources. /// It is not used directly, but through the [`SQLAdmin`] hub. /// /// # Example /// /// Instantiate a resource builder /// /// ```test_harness,no_run /// extern crate hyper; /// extern crate hyper_rustls; /// extern crate google_sql1_beta4 as sql1_beta4; /// /// # async fn dox() { /// use std::default::Default; /// use sql1_beta4::{SQLAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask}; /// /// let secret: oauth2::ApplicationSecret = Default::default(); /// let auth = oauth2::InstalledFlowAuthenticator::builder( /// secret, /// oauth2::InstalledFlowReturnMethod::HTTPRedirect, /// ).build().await.unwrap(); /// let mut hub = SQLAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* /// // like `list(...)` /// // to build up your call. /// let rb = hub.tiers(); /// # } /// ``` pub struct TierMethods<'a, S> where S: 'a { pub(super) hub: &'a SQLAdmin, } impl<'a, S> client::MethodsBuilder for TierMethods<'a, S> {} impl<'a, S> TierMethods<'a, S> { /// Create a builder to help you perform the following task: /// /// Lists all available machine types (tiers) for Cloud SQL, for example, /// db-n1-standard-1. For related information, see Pricing. /// /// # Arguments /// /// * `project` - Project ID of the project for which to list tiers. pub fn list(&self, project: &str) -> TierListCall<'a, S> { TierListCall { hub: self.hub, _project: project.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } } /// A builder providing access to all methods supported on *user* resources. /// It is not used directly, but through the [`SQLAdmin`] hub. /// /// # Example /// /// Instantiate a resource builder /// /// ```test_harness,no_run /// extern crate hyper; /// extern crate hyper_rustls; /// extern crate google_sql1_beta4 as sql1_beta4; /// /// # async fn dox() { /// use std::default::Default; /// use sql1_beta4::{SQLAdmin, oauth2, hyper, hyper_rustls, chrono, FieldMask}; /// /// let secret: oauth2::ApplicationSecret = Default::default(); /// let auth = oauth2::InstalledFlowAuthenticator::builder( /// secret, /// oauth2::InstalledFlowReturnMethod::HTTPRedirect, /// ).build().await.unwrap(); /// let mut hub = SQLAdmin::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* /// // like `delete(...)`, `insert(...)`, `list(...)` and `update(...)` /// // to build up your call. /// let rb = hub.users(); /// # } /// ``` pub struct UserMethods<'a, S> where S: 'a { pub(super) hub: &'a SQLAdmin, } impl<'a, S> client::MethodsBuilder for UserMethods<'a, S> {} impl<'a, S> UserMethods<'a, S> { /// Create a builder to help you perform the following task: /// /// Deletes a user from a Cloud SQL instance. /// /// # Arguments /// /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Database instance ID. This does not include the project ID. pub fn delete(&self, project: &str, instance: &str) -> UserDeleteCall<'a, S> { UserDeleteCall { hub: self.hub, _project: project.to_string(), _instance: instance.to_string(), _name: Default::default(), _host: Default::default(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Creates a new user in a Cloud SQL instance. /// /// # Arguments /// /// * `request` - No description provided. /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Database instance ID. This does not include the project ID. pub fn insert(&self, request: User, project: &str, instance: &str) -> UserInsertCall<'a, S> { UserInsertCall { hub: self.hub, _request: request, _project: project.to_string(), _instance: instance.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Lists users in the specified Cloud SQL instance. /// /// # Arguments /// /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Database instance ID. This does not include the project ID. pub fn list(&self, project: &str, instance: &str) -> UserListCall<'a, S> { UserListCall { hub: self.hub, _project: project.to_string(), _instance: instance.to_string(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } /// Create a builder to help you perform the following task: /// /// Updates an existing user in a Cloud SQL instance. /// /// # Arguments /// /// * `request` - No description provided. /// * `project` - Project ID of the project that contains the instance. /// * `instance` - Database instance ID. This does not include the project ID. pub fn update(&self, request: User, project: &str, instance: &str) -> UserUpdateCall<'a, S> { UserUpdateCall { hub: self.hub, _request: request, _project: project.to_string(), _instance: instance.to_string(), _name: Default::default(), _host: Default::default(), _delegate: Default::default(), _additional_params: Default::default(), _scopes: Default::default(), } } }