#![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 CloudLocationFinder {
inner: std::sync::Arc<dyn super::stub::dynamic::CloudLocationFinder>,
}
impl CloudLocationFinder {
pub fn builder() -> super::builder::cloud_location_finder::ClientBuilder {
crate::new_client_builder(super::builder::cloud_location_finder::client::Factory)
}
pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
where
T: super::stub::CloudLocationFinder + '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::CloudLocationFinder>>
{
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::CloudLocationFinder> {
super::transport::CloudLocationFinder::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::CloudLocationFinder> {
Self::build_transport(conf)
.await
.map(super::tracing::CloudLocationFinder::new)
}
pub fn list_cloud_locations(
&self,
) -> super::builder::cloud_location_finder::ListCloudLocations {
super::builder::cloud_location_finder::ListCloudLocations::new(self.inner.clone())
}
pub fn get_cloud_location(&self) -> super::builder::cloud_location_finder::GetCloudLocation {
super::builder::cloud_location_finder::GetCloudLocation::new(self.inner.clone())
}
pub fn search_cloud_locations(
&self,
) -> super::builder::cloud_location_finder::SearchCloudLocations {
super::builder::cloud_location_finder::SearchCloudLocations::new(self.inner.clone())
}
pub fn list_locations(&self) -> super::builder::cloud_location_finder::ListLocations {
super::builder::cloud_location_finder::ListLocations::new(self.inner.clone())
}
pub fn get_location(&self) -> super::builder::cloud_location_finder::GetLocation {
super::builder::cloud_location_finder::GetLocation::new(self.inner.clone())
}
}