#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#[derive(Clone, Debug)]
pub struct CaseAttachmentService {
inner: std::sync::Arc<dyn super::stub::dynamic::CaseAttachmentService>,
}
impl CaseAttachmentService {
pub fn builder() -> super::builder::case_attachment_service::ClientBuilder {
crate::new_client_builder(super::builder::case_attachment_service::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::CaseAttachmentService + 'static,
{
Self {
inner: std::sync::Arc::new(stub),
}
}
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::CaseAttachmentService>>
{
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::CaseAttachmentService> {
super::transport::CaseAttachmentService::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::CaseAttachmentService> {
Self::build_transport(conf)
.await
.map(super::tracing::CaseAttachmentService::new)
}
pub fn list_attachments(&self) -> super::builder::case_attachment_service::ListAttachments {
super::builder::case_attachment_service::ListAttachments::new(self.inner.clone())
}
}
#[derive(Clone, Debug)]
pub struct CaseService {
inner: std::sync::Arc<dyn super::stub::dynamic::CaseService>,
}
impl CaseService {
pub fn builder() -> super::builder::case_service::ClientBuilder {
crate::new_client_builder(super::builder::case_service::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::CaseService + 'static,
{
Self {
inner: std::sync::Arc::new(stub),
}
}
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::CaseService>> {
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::CaseService> {
super::transport::CaseService::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::CaseService> {
Self::build_transport(conf)
.await
.map(super::tracing::CaseService::new)
}
pub fn get_case(&self) -> super::builder::case_service::GetCase {
super::builder::case_service::GetCase::new(self.inner.clone())
}
pub fn list_cases(&self) -> super::builder::case_service::ListCases {
super::builder::case_service::ListCases::new(self.inner.clone())
}
pub fn search_cases(&self) -> super::builder::case_service::SearchCases {
super::builder::case_service::SearchCases::new(self.inner.clone())
}
pub fn create_case(&self) -> super::builder::case_service::CreateCase {
super::builder::case_service::CreateCase::new(self.inner.clone())
}
pub fn update_case(&self) -> super::builder::case_service::UpdateCase {
super::builder::case_service::UpdateCase::new(self.inner.clone())
}
pub fn escalate_case(&self) -> super::builder::case_service::EscalateCase {
super::builder::case_service::EscalateCase::new(self.inner.clone())
}
pub fn close_case(&self) -> super::builder::case_service::CloseCase {
super::builder::case_service::CloseCase::new(self.inner.clone())
}
pub fn search_case_classifications(
&self,
) -> super::builder::case_service::SearchCaseClassifications {
super::builder::case_service::SearchCaseClassifications::new(self.inner.clone())
}
}
#[derive(Clone, Debug)]
pub struct CommentService {
inner: std::sync::Arc<dyn super::stub::dynamic::CommentService>,
}
impl CommentService {
pub fn builder() -> super::builder::comment_service::ClientBuilder {
crate::new_client_builder(super::builder::comment_service::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::CommentService + 'static,
{
Self {
inner: std::sync::Arc::new(stub),
}
}
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::CommentService>> {
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::CommentService> {
super::transport::CommentService::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::CommentService> {
Self::build_transport(conf)
.await
.map(super::tracing::CommentService::new)
}
pub fn list_comments(&self) -> super::builder::comment_service::ListComments {
super::builder::comment_service::ListComments::new(self.inner.clone())
}
pub fn create_comment(&self) -> super::builder::comment_service::CreateComment {
super::builder::comment_service::CreateComment::new(self.inner.clone())
}
}