#![allow(rustdoc::bare_urls)]
#![allow(rustdoc::broken_intra_doc_links)]
#![allow(rustdoc::invalid_html_tags)]
#![allow(rustdoc::redundant_explicit_links)]
#[derive(Clone, Debug)]
pub struct AlloyDBCSQLAdmin {
inner: std::sync::Arc<dyn super::stub::dynamic::AlloyDBCSQLAdmin>,
}
impl AlloyDBCSQLAdmin {
pub fn builder() -> super::builder::alloy_dbcsql_admin::ClientBuilder {
crate::new_client_builder(super::builder::alloy_dbcsql_admin::client::Factory)
}
pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
where
T: super::stub::AlloyDBCSQLAdmin + 'static,
{
Self { inner: stub.into() }
}
pub(crate) async fn new(
config: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<Self> {
let inner = Self::build_inner(config).await?;
Ok(Self { inner })
}
async fn build_inner(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::AlloyDBCSQLAdmin>>
{
if gaxi::options::tracing_enabled(&conf) {
return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
}
Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
}
async fn build_transport(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::AlloyDBCSQLAdmin> {
super::transport::AlloyDBCSQLAdmin::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::AlloyDBCSQLAdmin> {
Self::build_transport(conf)
.await
.map(super::tracing::AlloyDBCSQLAdmin::new)
}
pub fn restore_from_cloud_sql(
&self,
) -> super::builder::alloy_dbcsql_admin::RestoreFromCloudSQL {
super::builder::alloy_dbcsql_admin::RestoreFromCloudSQL::new(self.inner.clone())
}
pub fn list_locations(&self) -> super::builder::alloy_dbcsql_admin::ListLocations {
super::builder::alloy_dbcsql_admin::ListLocations::new(self.inner.clone())
}
pub fn get_location(&self) -> super::builder::alloy_dbcsql_admin::GetLocation {
super::builder::alloy_dbcsql_admin::GetLocation::new(self.inner.clone())
}
pub fn list_operations(&self) -> super::builder::alloy_dbcsql_admin::ListOperations {
super::builder::alloy_dbcsql_admin::ListOperations::new(self.inner.clone())
}
pub fn get_operation(&self) -> super::builder::alloy_dbcsql_admin::GetOperation {
super::builder::alloy_dbcsql_admin::GetOperation::new(self.inner.clone())
}
pub fn delete_operation(&self) -> super::builder::alloy_dbcsql_admin::DeleteOperation {
super::builder::alloy_dbcsql_admin::DeleteOperation::new(self.inner.clone())
}
pub fn cancel_operation(&self) -> super::builder::alloy_dbcsql_admin::CancelOperation {
super::builder::alloy_dbcsql_admin::CancelOperation::new(self.inner.clone())
}
}
#[derive(Clone, Debug)]
pub struct AlloyDBAdmin {
inner: std::sync::Arc<dyn super::stub::dynamic::AlloyDBAdmin>,
}
impl AlloyDBAdmin {
pub fn builder() -> super::builder::alloy_db_admin::ClientBuilder {
crate::new_client_builder(super::builder::alloy_db_admin::client::Factory)
}
pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
where
T: super::stub::AlloyDBAdmin + 'static,
{
Self { inner: stub.into() }
}
pub(crate) async fn new(
config: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<Self> {
let inner = Self::build_inner(config).await?;
Ok(Self { inner })
}
async fn build_inner(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::AlloyDBAdmin>> {
if gaxi::options::tracing_enabled(&conf) {
return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
}
Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
}
async fn build_transport(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::AlloyDBAdmin> {
super::transport::AlloyDBAdmin::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::AlloyDBAdmin> {
Self::build_transport(conf)
.await
.map(super::tracing::AlloyDBAdmin::new)
}
pub fn list_clusters(&self) -> super::builder::alloy_db_admin::ListClusters {
super::builder::alloy_db_admin::ListClusters::new(self.inner.clone())
}
pub fn get_cluster(&self) -> super::builder::alloy_db_admin::GetCluster {
super::builder::alloy_db_admin::GetCluster::new(self.inner.clone())
}
pub fn create_cluster(&self) -> super::builder::alloy_db_admin::CreateCluster {
super::builder::alloy_db_admin::CreateCluster::new(self.inner.clone())
}
pub fn update_cluster(&self) -> super::builder::alloy_db_admin::UpdateCluster {
super::builder::alloy_db_admin::UpdateCluster::new(self.inner.clone())
}
pub fn export_cluster(&self) -> super::builder::alloy_db_admin::ExportCluster {
super::builder::alloy_db_admin::ExportCluster::new(self.inner.clone())
}
pub fn import_cluster(&self) -> super::builder::alloy_db_admin::ImportCluster {
super::builder::alloy_db_admin::ImportCluster::new(self.inner.clone())
}
pub fn upgrade_cluster(&self) -> super::builder::alloy_db_admin::UpgradeCluster {
super::builder::alloy_db_admin::UpgradeCluster::new(self.inner.clone())
}
pub fn delete_cluster(&self) -> super::builder::alloy_db_admin::DeleteCluster {
super::builder::alloy_db_admin::DeleteCluster::new(self.inner.clone())
}
pub fn promote_cluster(&self) -> super::builder::alloy_db_admin::PromoteCluster {
super::builder::alloy_db_admin::PromoteCluster::new(self.inner.clone())
}
pub fn switchover_cluster(&self) -> super::builder::alloy_db_admin::SwitchoverCluster {
super::builder::alloy_db_admin::SwitchoverCluster::new(self.inner.clone())
}
pub fn restore_cluster(&self) -> super::builder::alloy_db_admin::RestoreCluster {
super::builder::alloy_db_admin::RestoreCluster::new(self.inner.clone())
}
pub fn create_secondary_cluster(
&self,
) -> super::builder::alloy_db_admin::CreateSecondaryCluster {
super::builder::alloy_db_admin::CreateSecondaryCluster::new(self.inner.clone())
}
pub fn list_instances(&self) -> super::builder::alloy_db_admin::ListInstances {
super::builder::alloy_db_admin::ListInstances::new(self.inner.clone())
}
pub fn get_instance(&self) -> super::builder::alloy_db_admin::GetInstance {
super::builder::alloy_db_admin::GetInstance::new(self.inner.clone())
}
pub fn create_instance(&self) -> super::builder::alloy_db_admin::CreateInstance {
super::builder::alloy_db_admin::CreateInstance::new(self.inner.clone())
}
pub fn create_secondary_instance(
&self,
) -> super::builder::alloy_db_admin::CreateSecondaryInstance {
super::builder::alloy_db_admin::CreateSecondaryInstance::new(self.inner.clone())
}
pub fn batch_create_instances(&self) -> super::builder::alloy_db_admin::BatchCreateInstances {
super::builder::alloy_db_admin::BatchCreateInstances::new(self.inner.clone())
}
pub fn update_instance(&self) -> super::builder::alloy_db_admin::UpdateInstance {
super::builder::alloy_db_admin::UpdateInstance::new(self.inner.clone())
}
pub fn delete_instance(&self) -> super::builder::alloy_db_admin::DeleteInstance {
super::builder::alloy_db_admin::DeleteInstance::new(self.inner.clone())
}
pub fn failover_instance(&self) -> super::builder::alloy_db_admin::FailoverInstance {
super::builder::alloy_db_admin::FailoverInstance::new(self.inner.clone())
}
pub fn inject_fault(&self) -> super::builder::alloy_db_admin::InjectFault {
super::builder::alloy_db_admin::InjectFault::new(self.inner.clone())
}
pub fn restart_instance(&self) -> super::builder::alloy_db_admin::RestartInstance {
super::builder::alloy_db_admin::RestartInstance::new(self.inner.clone())
}
pub fn execute_sql(&self) -> super::builder::alloy_db_admin::ExecuteSql {
super::builder::alloy_db_admin::ExecuteSql::new(self.inner.clone())
}
pub fn list_backups(&self) -> super::builder::alloy_db_admin::ListBackups {
super::builder::alloy_db_admin::ListBackups::new(self.inner.clone())
}
pub fn get_backup(&self) -> super::builder::alloy_db_admin::GetBackup {
super::builder::alloy_db_admin::GetBackup::new(self.inner.clone())
}
pub fn create_backup(&self) -> super::builder::alloy_db_admin::CreateBackup {
super::builder::alloy_db_admin::CreateBackup::new(self.inner.clone())
}
pub fn update_backup(&self) -> super::builder::alloy_db_admin::UpdateBackup {
super::builder::alloy_db_admin::UpdateBackup::new(self.inner.clone())
}
pub fn delete_backup(&self) -> super::builder::alloy_db_admin::DeleteBackup {
super::builder::alloy_db_admin::DeleteBackup::new(self.inner.clone())
}
pub fn list_supported_database_flags(
&self,
) -> super::builder::alloy_db_admin::ListSupportedDatabaseFlags {
super::builder::alloy_db_admin::ListSupportedDatabaseFlags::new(self.inner.clone())
}
pub fn generate_client_certificate(
&self,
) -> super::builder::alloy_db_admin::GenerateClientCertificate {
super::builder::alloy_db_admin::GenerateClientCertificate::new(self.inner.clone())
}
pub fn get_connection_info(&self) -> super::builder::alloy_db_admin::GetConnectionInfo {
super::builder::alloy_db_admin::GetConnectionInfo::new(self.inner.clone())
}
pub fn list_users(&self) -> super::builder::alloy_db_admin::ListUsers {
super::builder::alloy_db_admin::ListUsers::new(self.inner.clone())
}
pub fn get_user(&self) -> super::builder::alloy_db_admin::GetUser {
super::builder::alloy_db_admin::GetUser::new(self.inner.clone())
}
pub fn create_user(&self) -> super::builder::alloy_db_admin::CreateUser {
super::builder::alloy_db_admin::CreateUser::new(self.inner.clone())
}
pub fn update_user(&self) -> super::builder::alloy_db_admin::UpdateUser {
super::builder::alloy_db_admin::UpdateUser::new(self.inner.clone())
}
pub fn delete_user(&self) -> super::builder::alloy_db_admin::DeleteUser {
super::builder::alloy_db_admin::DeleteUser::new(self.inner.clone())
}
pub fn list_databases(&self) -> super::builder::alloy_db_admin::ListDatabases {
super::builder::alloy_db_admin::ListDatabases::new(self.inner.clone())
}
pub fn list_locations(&self) -> super::builder::alloy_db_admin::ListLocations {
super::builder::alloy_db_admin::ListLocations::new(self.inner.clone())
}
pub fn get_location(&self) -> super::builder::alloy_db_admin::GetLocation {
super::builder::alloy_db_admin::GetLocation::new(self.inner.clone())
}
pub fn list_operations(&self) -> super::builder::alloy_db_admin::ListOperations {
super::builder::alloy_db_admin::ListOperations::new(self.inner.clone())
}
pub fn get_operation(&self) -> super::builder::alloy_db_admin::GetOperation {
super::builder::alloy_db_admin::GetOperation::new(self.inner.clone())
}
pub fn delete_operation(&self) -> super::builder::alloy_db_admin::DeleteOperation {
super::builder::alloy_db_admin::DeleteOperation::new(self.inner.clone())
}
pub fn cancel_operation(&self) -> super::builder::alloy_db_admin::CancelOperation {
super::builder::alloy_db_admin::CancelOperation::new(self.inner.clone())
}
}