#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#[cfg(feature = "assistant-service")]
#[cfg_attr(docsrs, doc(cfg(feature = "assistant-service")))]
#[derive(Clone, Debug)]
pub struct AssistantService {
inner: std::sync::Arc<dyn super::stub::dynamic::AssistantService>,
}
#[cfg(feature = "assistant-service")]
impl AssistantService {
pub fn builder() -> super::builder::assistant_service::ClientBuilder {
crate::new_client_builder(super::builder::assistant_service::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::AssistantService + '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::AssistantService>>
{
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::AssistantService> {
super::transport::AssistantService::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::AssistantService> {
Self::build_transport(conf)
.await
.map(super::tracing::AssistantService::new)
}
pub fn list_operations(&self) -> super::builder::assistant_service::ListOperations {
super::builder::assistant_service::ListOperations::new(self.inner.clone())
}
pub fn get_operation(&self) -> super::builder::assistant_service::GetOperation {
super::builder::assistant_service::GetOperation::new(self.inner.clone())
}
pub fn cancel_operation(&self) -> super::builder::assistant_service::CancelOperation {
super::builder::assistant_service::CancelOperation::new(self.inner.clone())
}
}
#[cfg(feature = "cmek-config-service")]
#[cfg_attr(docsrs, doc(cfg(feature = "cmek-config-service")))]
#[derive(Clone, Debug)]
pub struct CmekConfigService {
inner: std::sync::Arc<dyn super::stub::dynamic::CmekConfigService>,
}
#[cfg(feature = "cmek-config-service")]
impl CmekConfigService {
pub fn builder() -> super::builder::cmek_config_service::ClientBuilder {
crate::new_client_builder(super::builder::cmek_config_service::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::CmekConfigService + '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::CmekConfigService>>
{
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::CmekConfigService> {
super::transport::CmekConfigService::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::CmekConfigService> {
Self::build_transport(conf)
.await
.map(super::tracing::CmekConfigService::new)
}
pub fn update_cmek_config(&self) -> super::builder::cmek_config_service::UpdateCmekConfig {
super::builder::cmek_config_service::UpdateCmekConfig::new(self.inner.clone())
}
pub fn get_cmek_config(&self) -> super::builder::cmek_config_service::GetCmekConfig {
super::builder::cmek_config_service::GetCmekConfig::new(self.inner.clone())
}
pub fn list_cmek_configs(&self) -> super::builder::cmek_config_service::ListCmekConfigs {
super::builder::cmek_config_service::ListCmekConfigs::new(self.inner.clone())
}
pub fn delete_cmek_config(&self) -> super::builder::cmek_config_service::DeleteCmekConfig {
super::builder::cmek_config_service::DeleteCmekConfig::new(self.inner.clone())
}
pub fn list_operations(&self) -> super::builder::cmek_config_service::ListOperations {
super::builder::cmek_config_service::ListOperations::new(self.inner.clone())
}
pub fn get_operation(&self) -> super::builder::cmek_config_service::GetOperation {
super::builder::cmek_config_service::GetOperation::new(self.inner.clone())
}
pub fn cancel_operation(&self) -> super::builder::cmek_config_service::CancelOperation {
super::builder::cmek_config_service::CancelOperation::new(self.inner.clone())
}
}
#[cfg(feature = "completion-service")]
#[cfg_attr(docsrs, doc(cfg(feature = "completion-service")))]
#[derive(Clone, Debug)]
pub struct CompletionService {
inner: std::sync::Arc<dyn super::stub::dynamic::CompletionService>,
}
#[cfg(feature = "completion-service")]
impl CompletionService {
pub fn builder() -> super::builder::completion_service::ClientBuilder {
crate::new_client_builder(super::builder::completion_service::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::CompletionService + '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::CompletionService>>
{
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::CompletionService> {
super::transport::CompletionService::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::CompletionService> {
Self::build_transport(conf)
.await
.map(super::tracing::CompletionService::new)
}
pub fn complete_query(&self) -> super::builder::completion_service::CompleteQuery {
super::builder::completion_service::CompleteQuery::new(self.inner.clone())
}
pub fn import_suggestion_deny_list_entries(
&self,
) -> super::builder::completion_service::ImportSuggestionDenyListEntries {
super::builder::completion_service::ImportSuggestionDenyListEntries::new(self.inner.clone())
}
pub fn purge_suggestion_deny_list_entries(
&self,
) -> super::builder::completion_service::PurgeSuggestionDenyListEntries {
super::builder::completion_service::PurgeSuggestionDenyListEntries::new(self.inner.clone())
}
pub fn import_completion_suggestions(
&self,
) -> super::builder::completion_service::ImportCompletionSuggestions {
super::builder::completion_service::ImportCompletionSuggestions::new(self.inner.clone())
}
pub fn purge_completion_suggestions(
&self,
) -> super::builder::completion_service::PurgeCompletionSuggestions {
super::builder::completion_service::PurgeCompletionSuggestions::new(self.inner.clone())
}
pub fn list_operations(&self) -> super::builder::completion_service::ListOperations {
super::builder::completion_service::ListOperations::new(self.inner.clone())
}
pub fn get_operation(&self) -> super::builder::completion_service::GetOperation {
super::builder::completion_service::GetOperation::new(self.inner.clone())
}
pub fn cancel_operation(&self) -> super::builder::completion_service::CancelOperation {
super::builder::completion_service::CancelOperation::new(self.inner.clone())
}
}
#[cfg(feature = "control-service")]
#[cfg_attr(docsrs, doc(cfg(feature = "control-service")))]
#[derive(Clone, Debug)]
pub struct ControlService {
inner: std::sync::Arc<dyn super::stub::dynamic::ControlService>,
}
#[cfg(feature = "control-service")]
impl ControlService {
pub fn builder() -> super::builder::control_service::ClientBuilder {
crate::new_client_builder(super::builder::control_service::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::ControlService + '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::ControlService>> {
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::ControlService> {
super::transport::ControlService::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::ControlService> {
Self::build_transport(conf)
.await
.map(super::tracing::ControlService::new)
}
pub fn create_control(&self) -> super::builder::control_service::CreateControl {
super::builder::control_service::CreateControl::new(self.inner.clone())
}
pub fn delete_control(&self) -> super::builder::control_service::DeleteControl {
super::builder::control_service::DeleteControl::new(self.inner.clone())
}
pub fn update_control(&self) -> super::builder::control_service::UpdateControl {
super::builder::control_service::UpdateControl::new(self.inner.clone())
}
pub fn get_control(&self) -> super::builder::control_service::GetControl {
super::builder::control_service::GetControl::new(self.inner.clone())
}
pub fn list_controls(&self) -> super::builder::control_service::ListControls {
super::builder::control_service::ListControls::new(self.inner.clone())
}
pub fn list_operations(&self) -> super::builder::control_service::ListOperations {
super::builder::control_service::ListOperations::new(self.inner.clone())
}
pub fn get_operation(&self) -> super::builder::control_service::GetOperation {
super::builder::control_service::GetOperation::new(self.inner.clone())
}
pub fn cancel_operation(&self) -> super::builder::control_service::CancelOperation {
super::builder::control_service::CancelOperation::new(self.inner.clone())
}
}
#[cfg(feature = "conversational-search-service")]
#[cfg_attr(docsrs, doc(cfg(feature = "conversational-search-service")))]
#[derive(Clone, Debug)]
pub struct ConversationalSearchService {
inner: std::sync::Arc<dyn super::stub::dynamic::ConversationalSearchService>,
}
#[cfg(feature = "conversational-search-service")]
impl ConversationalSearchService {
pub fn builder() -> super::builder::conversational_search_service::ClientBuilder {
crate::new_client_builder(super::builder::conversational_search_service::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::ConversationalSearchService + '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::ConversationalSearchService>,
> {
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::ConversationalSearchService> {
super::transport::ConversationalSearchService::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::ConversationalSearchService> {
Self::build_transport(conf)
.await
.map(super::tracing::ConversationalSearchService::new)
}
pub fn converse_conversation(
&self,
) -> super::builder::conversational_search_service::ConverseConversation {
super::builder::conversational_search_service::ConverseConversation::new(self.inner.clone())
}
pub fn create_conversation(
&self,
) -> super::builder::conversational_search_service::CreateConversation {
super::builder::conversational_search_service::CreateConversation::new(self.inner.clone())
}
pub fn delete_conversation(
&self,
) -> super::builder::conversational_search_service::DeleteConversation {
super::builder::conversational_search_service::DeleteConversation::new(self.inner.clone())
}
pub fn update_conversation(
&self,
) -> super::builder::conversational_search_service::UpdateConversation {
super::builder::conversational_search_service::UpdateConversation::new(self.inner.clone())
}
pub fn get_conversation(
&self,
) -> super::builder::conversational_search_service::GetConversation {
super::builder::conversational_search_service::GetConversation::new(self.inner.clone())
}
pub fn list_conversations(
&self,
) -> super::builder::conversational_search_service::ListConversations {
super::builder::conversational_search_service::ListConversations::new(self.inner.clone())
}
pub fn answer_query(&self) -> super::builder::conversational_search_service::AnswerQuery {
super::builder::conversational_search_service::AnswerQuery::new(self.inner.clone())
}
pub fn get_answer(&self) -> super::builder::conversational_search_service::GetAnswer {
super::builder::conversational_search_service::GetAnswer::new(self.inner.clone())
}
pub fn create_session(&self) -> super::builder::conversational_search_service::CreateSession {
super::builder::conversational_search_service::CreateSession::new(self.inner.clone())
}
pub fn delete_session(&self) -> super::builder::conversational_search_service::DeleteSession {
super::builder::conversational_search_service::DeleteSession::new(self.inner.clone())
}
pub fn update_session(&self) -> super::builder::conversational_search_service::UpdateSession {
super::builder::conversational_search_service::UpdateSession::new(self.inner.clone())
}
pub fn get_session(&self) -> super::builder::conversational_search_service::GetSession {
super::builder::conversational_search_service::GetSession::new(self.inner.clone())
}
pub fn list_sessions(&self) -> super::builder::conversational_search_service::ListSessions {
super::builder::conversational_search_service::ListSessions::new(self.inner.clone())
}
pub fn list_operations(&self) -> super::builder::conversational_search_service::ListOperations {
super::builder::conversational_search_service::ListOperations::new(self.inner.clone())
}
pub fn get_operation(&self) -> super::builder::conversational_search_service::GetOperation {
super::builder::conversational_search_service::GetOperation::new(self.inner.clone())
}
pub fn cancel_operation(
&self,
) -> super::builder::conversational_search_service::CancelOperation {
super::builder::conversational_search_service::CancelOperation::new(self.inner.clone())
}
}
#[cfg(feature = "data-store-service")]
#[cfg_attr(docsrs, doc(cfg(feature = "data-store-service")))]
#[derive(Clone, Debug)]
pub struct DataStoreService {
inner: std::sync::Arc<dyn super::stub::dynamic::DataStoreService>,
}
#[cfg(feature = "data-store-service")]
impl DataStoreService {
pub fn builder() -> super::builder::data_store_service::ClientBuilder {
crate::new_client_builder(super::builder::data_store_service::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::DataStoreService + '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::DataStoreService>>
{
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::DataStoreService> {
super::transport::DataStoreService::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::DataStoreService> {
Self::build_transport(conf)
.await
.map(super::tracing::DataStoreService::new)
}
pub fn create_data_store(&self) -> super::builder::data_store_service::CreateDataStore {
super::builder::data_store_service::CreateDataStore::new(self.inner.clone())
}
pub fn get_data_store(&self) -> super::builder::data_store_service::GetDataStore {
super::builder::data_store_service::GetDataStore::new(self.inner.clone())
}
pub fn list_data_stores(&self) -> super::builder::data_store_service::ListDataStores {
super::builder::data_store_service::ListDataStores::new(self.inner.clone())
}
pub fn delete_data_store(&self) -> super::builder::data_store_service::DeleteDataStore {
super::builder::data_store_service::DeleteDataStore::new(self.inner.clone())
}
pub fn update_data_store(&self) -> super::builder::data_store_service::UpdateDataStore {
super::builder::data_store_service::UpdateDataStore::new(self.inner.clone())
}
pub fn list_operations(&self) -> super::builder::data_store_service::ListOperations {
super::builder::data_store_service::ListOperations::new(self.inner.clone())
}
pub fn get_operation(&self) -> super::builder::data_store_service::GetOperation {
super::builder::data_store_service::GetOperation::new(self.inner.clone())
}
pub fn cancel_operation(&self) -> super::builder::data_store_service::CancelOperation {
super::builder::data_store_service::CancelOperation::new(self.inner.clone())
}
}
#[cfg(feature = "document-service")]
#[cfg_attr(docsrs, doc(cfg(feature = "document-service")))]
#[derive(Clone, Debug)]
pub struct DocumentService {
inner: std::sync::Arc<dyn super::stub::dynamic::DocumentService>,
}
#[cfg(feature = "document-service")]
impl DocumentService {
pub fn builder() -> super::builder::document_service::ClientBuilder {
crate::new_client_builder(super::builder::document_service::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::DocumentService + '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::DocumentService>> {
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::DocumentService> {
super::transport::DocumentService::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::DocumentService> {
Self::build_transport(conf)
.await
.map(super::tracing::DocumentService::new)
}
pub fn get_document(&self) -> super::builder::document_service::GetDocument {
super::builder::document_service::GetDocument::new(self.inner.clone())
}
pub fn list_documents(&self) -> super::builder::document_service::ListDocuments {
super::builder::document_service::ListDocuments::new(self.inner.clone())
}
pub fn create_document(&self) -> super::builder::document_service::CreateDocument {
super::builder::document_service::CreateDocument::new(self.inner.clone())
}
pub fn update_document(&self) -> super::builder::document_service::UpdateDocument {
super::builder::document_service::UpdateDocument::new(self.inner.clone())
}
pub fn delete_document(&self) -> super::builder::document_service::DeleteDocument {
super::builder::document_service::DeleteDocument::new(self.inner.clone())
}
pub fn import_documents(&self) -> super::builder::document_service::ImportDocuments {
super::builder::document_service::ImportDocuments::new(self.inner.clone())
}
pub fn purge_documents(&self) -> super::builder::document_service::PurgeDocuments {
super::builder::document_service::PurgeDocuments::new(self.inner.clone())
}
pub fn batch_get_documents_metadata(
&self,
) -> super::builder::document_service::BatchGetDocumentsMetadata {
super::builder::document_service::BatchGetDocumentsMetadata::new(self.inner.clone())
}
pub fn list_operations(&self) -> super::builder::document_service::ListOperations {
super::builder::document_service::ListOperations::new(self.inner.clone())
}
pub fn get_operation(&self) -> super::builder::document_service::GetOperation {
super::builder::document_service::GetOperation::new(self.inner.clone())
}
pub fn cancel_operation(&self) -> super::builder::document_service::CancelOperation {
super::builder::document_service::CancelOperation::new(self.inner.clone())
}
}
#[cfg(feature = "engine-service")]
#[cfg_attr(docsrs, doc(cfg(feature = "engine-service")))]
#[derive(Clone, Debug)]
pub struct EngineService {
inner: std::sync::Arc<dyn super::stub::dynamic::EngineService>,
}
#[cfg(feature = "engine-service")]
impl EngineService {
pub fn builder() -> super::builder::engine_service::ClientBuilder {
crate::new_client_builder(super::builder::engine_service::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::EngineService + '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::EngineService>> {
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::EngineService> {
super::transport::EngineService::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::EngineService> {
Self::build_transport(conf)
.await
.map(super::tracing::EngineService::new)
}
pub fn create_engine(&self) -> super::builder::engine_service::CreateEngine {
super::builder::engine_service::CreateEngine::new(self.inner.clone())
}
pub fn delete_engine(&self) -> super::builder::engine_service::DeleteEngine {
super::builder::engine_service::DeleteEngine::new(self.inner.clone())
}
pub fn update_engine(&self) -> super::builder::engine_service::UpdateEngine {
super::builder::engine_service::UpdateEngine::new(self.inner.clone())
}
pub fn get_engine(&self) -> super::builder::engine_service::GetEngine {
super::builder::engine_service::GetEngine::new(self.inner.clone())
}
pub fn list_engines(&self) -> super::builder::engine_service::ListEngines {
super::builder::engine_service::ListEngines::new(self.inner.clone())
}
pub fn list_operations(&self) -> super::builder::engine_service::ListOperations {
super::builder::engine_service::ListOperations::new(self.inner.clone())
}
pub fn get_operation(&self) -> super::builder::engine_service::GetOperation {
super::builder::engine_service::GetOperation::new(self.inner.clone())
}
pub fn cancel_operation(&self) -> super::builder::engine_service::CancelOperation {
super::builder::engine_service::CancelOperation::new(self.inner.clone())
}
}
#[cfg(feature = "grounded-generation-service")]
#[cfg_attr(docsrs, doc(cfg(feature = "grounded-generation-service")))]
#[derive(Clone, Debug)]
pub struct GroundedGenerationService {
inner: std::sync::Arc<dyn super::stub::dynamic::GroundedGenerationService>,
}
#[cfg(feature = "grounded-generation-service")]
impl GroundedGenerationService {
pub fn builder() -> super::builder::grounded_generation_service::ClientBuilder {
crate::new_client_builder(super::builder::grounded_generation_service::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::GroundedGenerationService + '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::GroundedGenerationService>,
> {
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::GroundedGenerationService> {
super::transport::GroundedGenerationService::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::GroundedGenerationService> {
Self::build_transport(conf)
.await
.map(super::tracing::GroundedGenerationService::new)
}
pub fn generate_grounded_content(
&self,
) -> super::builder::grounded_generation_service::GenerateGroundedContent {
super::builder::grounded_generation_service::GenerateGroundedContent::new(
self.inner.clone(),
)
}
pub fn check_grounding(&self) -> super::builder::grounded_generation_service::CheckGrounding {
super::builder::grounded_generation_service::CheckGrounding::new(self.inner.clone())
}
pub fn list_operations(&self) -> super::builder::grounded_generation_service::ListOperations {
super::builder::grounded_generation_service::ListOperations::new(self.inner.clone())
}
pub fn get_operation(&self) -> super::builder::grounded_generation_service::GetOperation {
super::builder::grounded_generation_service::GetOperation::new(self.inner.clone())
}
pub fn cancel_operation(&self) -> super::builder::grounded_generation_service::CancelOperation {
super::builder::grounded_generation_service::CancelOperation::new(self.inner.clone())
}
}
#[cfg(feature = "identity-mapping-store-service")]
#[cfg_attr(docsrs, doc(cfg(feature = "identity-mapping-store-service")))]
#[derive(Clone, Debug)]
pub struct IdentityMappingStoreService {
inner: std::sync::Arc<dyn super::stub::dynamic::IdentityMappingStoreService>,
}
#[cfg(feature = "identity-mapping-store-service")]
impl IdentityMappingStoreService {
pub fn builder() -> super::builder::identity_mapping_store_service::ClientBuilder {
crate::new_client_builder(super::builder::identity_mapping_store_service::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::IdentityMappingStoreService + '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::IdentityMappingStoreService>,
> {
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::IdentityMappingStoreService> {
super::transport::IdentityMappingStoreService::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::IdentityMappingStoreService> {
Self::build_transport(conf)
.await
.map(super::tracing::IdentityMappingStoreService::new)
}
pub fn create_identity_mapping_store(
&self,
) -> super::builder::identity_mapping_store_service::CreateIdentityMappingStore {
super::builder::identity_mapping_store_service::CreateIdentityMappingStore::new(
self.inner.clone(),
)
}
pub fn get_identity_mapping_store(
&self,
) -> super::builder::identity_mapping_store_service::GetIdentityMappingStore {
super::builder::identity_mapping_store_service::GetIdentityMappingStore::new(
self.inner.clone(),
)
}
pub fn delete_identity_mapping_store(
&self,
) -> super::builder::identity_mapping_store_service::DeleteIdentityMappingStore {
super::builder::identity_mapping_store_service::DeleteIdentityMappingStore::new(
self.inner.clone(),
)
}
pub fn import_identity_mappings(
&self,
) -> super::builder::identity_mapping_store_service::ImportIdentityMappings {
super::builder::identity_mapping_store_service::ImportIdentityMappings::new(
self.inner.clone(),
)
}
pub fn purge_identity_mappings(
&self,
) -> super::builder::identity_mapping_store_service::PurgeIdentityMappings {
super::builder::identity_mapping_store_service::PurgeIdentityMappings::new(
self.inner.clone(),
)
}
pub fn list_identity_mappings(
&self,
) -> super::builder::identity_mapping_store_service::ListIdentityMappings {
super::builder::identity_mapping_store_service::ListIdentityMappings::new(
self.inner.clone(),
)
}
pub fn list_identity_mapping_stores(
&self,
) -> super::builder::identity_mapping_store_service::ListIdentityMappingStores {
super::builder::identity_mapping_store_service::ListIdentityMappingStores::new(
self.inner.clone(),
)
}
pub fn list_operations(
&self,
) -> super::builder::identity_mapping_store_service::ListOperations {
super::builder::identity_mapping_store_service::ListOperations::new(self.inner.clone())
}
pub fn get_operation(&self) -> super::builder::identity_mapping_store_service::GetOperation {
super::builder::identity_mapping_store_service::GetOperation::new(self.inner.clone())
}
pub fn cancel_operation(
&self,
) -> super::builder::identity_mapping_store_service::CancelOperation {
super::builder::identity_mapping_store_service::CancelOperation::new(self.inner.clone())
}
}
#[cfg(feature = "project-service")]
#[cfg_attr(docsrs, doc(cfg(feature = "project-service")))]
#[derive(Clone, Debug)]
pub struct ProjectService {
inner: std::sync::Arc<dyn super::stub::dynamic::ProjectService>,
}
#[cfg(feature = "project-service")]
impl ProjectService {
pub fn builder() -> super::builder::project_service::ClientBuilder {
crate::new_client_builder(super::builder::project_service::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::ProjectService + '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::ProjectService>> {
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::ProjectService> {
super::transport::ProjectService::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::ProjectService> {
Self::build_transport(conf)
.await
.map(super::tracing::ProjectService::new)
}
pub fn provision_project(&self) -> super::builder::project_service::ProvisionProject {
super::builder::project_service::ProvisionProject::new(self.inner.clone())
}
pub fn list_operations(&self) -> super::builder::project_service::ListOperations {
super::builder::project_service::ListOperations::new(self.inner.clone())
}
pub fn get_operation(&self) -> super::builder::project_service::GetOperation {
super::builder::project_service::GetOperation::new(self.inner.clone())
}
pub fn cancel_operation(&self) -> super::builder::project_service::CancelOperation {
super::builder::project_service::CancelOperation::new(self.inner.clone())
}
}
#[cfg(feature = "rank-service")]
#[cfg_attr(docsrs, doc(cfg(feature = "rank-service")))]
#[derive(Clone, Debug)]
pub struct RankService {
inner: std::sync::Arc<dyn super::stub::dynamic::RankService>,
}
#[cfg(feature = "rank-service")]
impl RankService {
pub fn builder() -> super::builder::rank_service::ClientBuilder {
crate::new_client_builder(super::builder::rank_service::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::RankService + '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::RankService>> {
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::RankService> {
super::transport::RankService::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::RankService> {
Self::build_transport(conf)
.await
.map(super::tracing::RankService::new)
}
pub fn rank(&self) -> super::builder::rank_service::Rank {
super::builder::rank_service::Rank::new(self.inner.clone())
}
pub fn list_operations(&self) -> super::builder::rank_service::ListOperations {
super::builder::rank_service::ListOperations::new(self.inner.clone())
}
pub fn get_operation(&self) -> super::builder::rank_service::GetOperation {
super::builder::rank_service::GetOperation::new(self.inner.clone())
}
pub fn cancel_operation(&self) -> super::builder::rank_service::CancelOperation {
super::builder::rank_service::CancelOperation::new(self.inner.clone())
}
}
#[cfg(feature = "recommendation-service")]
#[cfg_attr(docsrs, doc(cfg(feature = "recommendation-service")))]
#[derive(Clone, Debug)]
pub struct RecommendationService {
inner: std::sync::Arc<dyn super::stub::dynamic::RecommendationService>,
}
#[cfg(feature = "recommendation-service")]
impl RecommendationService {
pub fn builder() -> super::builder::recommendation_service::ClientBuilder {
crate::new_client_builder(super::builder::recommendation_service::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::RecommendationService + '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::RecommendationService>>
{
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::RecommendationService> {
super::transport::RecommendationService::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::RecommendationService> {
Self::build_transport(conf)
.await
.map(super::tracing::RecommendationService::new)
}
pub fn recommend(&self) -> super::builder::recommendation_service::Recommend {
super::builder::recommendation_service::Recommend::new(self.inner.clone())
}
pub fn list_operations(&self) -> super::builder::recommendation_service::ListOperations {
super::builder::recommendation_service::ListOperations::new(self.inner.clone())
}
pub fn get_operation(&self) -> super::builder::recommendation_service::GetOperation {
super::builder::recommendation_service::GetOperation::new(self.inner.clone())
}
pub fn cancel_operation(&self) -> super::builder::recommendation_service::CancelOperation {
super::builder::recommendation_service::CancelOperation::new(self.inner.clone())
}
}
#[cfg(feature = "schema-service")]
#[cfg_attr(docsrs, doc(cfg(feature = "schema-service")))]
#[derive(Clone, Debug)]
pub struct SchemaService {
inner: std::sync::Arc<dyn super::stub::dynamic::SchemaService>,
}
#[cfg(feature = "schema-service")]
impl SchemaService {
pub fn builder() -> super::builder::schema_service::ClientBuilder {
crate::new_client_builder(super::builder::schema_service::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::SchemaService + '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::SchemaService>> {
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::SchemaService> {
super::transport::SchemaService::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::SchemaService> {
Self::build_transport(conf)
.await
.map(super::tracing::SchemaService::new)
}
pub fn get_schema(&self) -> super::builder::schema_service::GetSchema {
super::builder::schema_service::GetSchema::new(self.inner.clone())
}
pub fn list_schemas(&self) -> super::builder::schema_service::ListSchemas {
super::builder::schema_service::ListSchemas::new(self.inner.clone())
}
pub fn create_schema(&self) -> super::builder::schema_service::CreateSchema {
super::builder::schema_service::CreateSchema::new(self.inner.clone())
}
pub fn update_schema(&self) -> super::builder::schema_service::UpdateSchema {
super::builder::schema_service::UpdateSchema::new(self.inner.clone())
}
pub fn delete_schema(&self) -> super::builder::schema_service::DeleteSchema {
super::builder::schema_service::DeleteSchema::new(self.inner.clone())
}
pub fn list_operations(&self) -> super::builder::schema_service::ListOperations {
super::builder::schema_service::ListOperations::new(self.inner.clone())
}
pub fn get_operation(&self) -> super::builder::schema_service::GetOperation {
super::builder::schema_service::GetOperation::new(self.inner.clone())
}
pub fn cancel_operation(&self) -> super::builder::schema_service::CancelOperation {
super::builder::schema_service::CancelOperation::new(self.inner.clone())
}
}
#[cfg(feature = "search-service")]
#[cfg_attr(docsrs, doc(cfg(feature = "search-service")))]
#[derive(Clone, Debug)]
pub struct SearchService {
inner: std::sync::Arc<dyn super::stub::dynamic::SearchService>,
}
#[cfg(feature = "search-service")]
impl SearchService {
pub fn builder() -> super::builder::search_service::ClientBuilder {
crate::new_client_builder(super::builder::search_service::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::SearchService + '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::SearchService>> {
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::SearchService> {
super::transport::SearchService::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::SearchService> {
Self::build_transport(conf)
.await
.map(super::tracing::SearchService::new)
}
pub fn search(&self) -> super::builder::search_service::Search {
super::builder::search_service::Search::new(self.inner.clone())
}
pub fn search_lite(&self) -> super::builder::search_service::SearchLite {
super::builder::search_service::SearchLite::new(self.inner.clone())
}
pub fn list_operations(&self) -> super::builder::search_service::ListOperations {
super::builder::search_service::ListOperations::new(self.inner.clone())
}
pub fn get_operation(&self) -> super::builder::search_service::GetOperation {
super::builder::search_service::GetOperation::new(self.inner.clone())
}
pub fn cancel_operation(&self) -> super::builder::search_service::CancelOperation {
super::builder::search_service::CancelOperation::new(self.inner.clone())
}
}
#[cfg(feature = "search-tuning-service")]
#[cfg_attr(docsrs, doc(cfg(feature = "search-tuning-service")))]
#[derive(Clone, Debug)]
pub struct SearchTuningService {
inner: std::sync::Arc<dyn super::stub::dynamic::SearchTuningService>,
}
#[cfg(feature = "search-tuning-service")]
impl SearchTuningService {
pub fn builder() -> super::builder::search_tuning_service::ClientBuilder {
crate::new_client_builder(super::builder::search_tuning_service::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::SearchTuningService + '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::SearchTuningService>>
{
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::SearchTuningService> {
super::transport::SearchTuningService::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::SearchTuningService> {
Self::build_transport(conf)
.await
.map(super::tracing::SearchTuningService::new)
}
pub fn train_custom_model(&self) -> super::builder::search_tuning_service::TrainCustomModel {
super::builder::search_tuning_service::TrainCustomModel::new(self.inner.clone())
}
pub fn list_custom_models(&self) -> super::builder::search_tuning_service::ListCustomModels {
super::builder::search_tuning_service::ListCustomModels::new(self.inner.clone())
}
pub fn list_operations(&self) -> super::builder::search_tuning_service::ListOperations {
super::builder::search_tuning_service::ListOperations::new(self.inner.clone())
}
pub fn get_operation(&self) -> super::builder::search_tuning_service::GetOperation {
super::builder::search_tuning_service::GetOperation::new(self.inner.clone())
}
pub fn cancel_operation(&self) -> super::builder::search_tuning_service::CancelOperation {
super::builder::search_tuning_service::CancelOperation::new(self.inner.clone())
}
}
#[cfg(feature = "serving-config-service")]
#[cfg_attr(docsrs, doc(cfg(feature = "serving-config-service")))]
#[derive(Clone, Debug)]
pub struct ServingConfigService {
inner: std::sync::Arc<dyn super::stub::dynamic::ServingConfigService>,
}
#[cfg(feature = "serving-config-service")]
impl ServingConfigService {
pub fn builder() -> super::builder::serving_config_service::ClientBuilder {
crate::new_client_builder(super::builder::serving_config_service::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::ServingConfigService + '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::ServingConfigService>>
{
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::ServingConfigService> {
super::transport::ServingConfigService::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::ServingConfigService> {
Self::build_transport(conf)
.await
.map(super::tracing::ServingConfigService::new)
}
pub fn update_serving_config(
&self,
) -> super::builder::serving_config_service::UpdateServingConfig {
super::builder::serving_config_service::UpdateServingConfig::new(self.inner.clone())
}
pub fn list_operations(&self) -> super::builder::serving_config_service::ListOperations {
super::builder::serving_config_service::ListOperations::new(self.inner.clone())
}
pub fn get_operation(&self) -> super::builder::serving_config_service::GetOperation {
super::builder::serving_config_service::GetOperation::new(self.inner.clone())
}
pub fn cancel_operation(&self) -> super::builder::serving_config_service::CancelOperation {
super::builder::serving_config_service::CancelOperation::new(self.inner.clone())
}
}
#[cfg(feature = "session-service")]
#[cfg_attr(docsrs, doc(cfg(feature = "session-service")))]
#[derive(Clone, Debug)]
pub struct SessionService {
inner: std::sync::Arc<dyn super::stub::dynamic::SessionService>,
}
#[cfg(feature = "session-service")]
impl SessionService {
pub fn builder() -> super::builder::session_service::ClientBuilder {
crate::new_client_builder(super::builder::session_service::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::SessionService + '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::SessionService>> {
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::SessionService> {
super::transport::SessionService::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::SessionService> {
Self::build_transport(conf)
.await
.map(super::tracing::SessionService::new)
}
pub fn create_session(&self) -> super::builder::session_service::CreateSession {
super::builder::session_service::CreateSession::new(self.inner.clone())
}
pub fn delete_session(&self) -> super::builder::session_service::DeleteSession {
super::builder::session_service::DeleteSession::new(self.inner.clone())
}
pub fn update_session(&self) -> super::builder::session_service::UpdateSession {
super::builder::session_service::UpdateSession::new(self.inner.clone())
}
pub fn get_session(&self) -> super::builder::session_service::GetSession {
super::builder::session_service::GetSession::new(self.inner.clone())
}
pub fn list_sessions(&self) -> super::builder::session_service::ListSessions {
super::builder::session_service::ListSessions::new(self.inner.clone())
}
pub fn list_operations(&self) -> super::builder::session_service::ListOperations {
super::builder::session_service::ListOperations::new(self.inner.clone())
}
pub fn get_operation(&self) -> super::builder::session_service::GetOperation {
super::builder::session_service::GetOperation::new(self.inner.clone())
}
pub fn cancel_operation(&self) -> super::builder::session_service::CancelOperation {
super::builder::session_service::CancelOperation::new(self.inner.clone())
}
}
#[cfg(feature = "site-search-engine-service")]
#[cfg_attr(docsrs, doc(cfg(feature = "site-search-engine-service")))]
#[derive(Clone, Debug)]
pub struct SiteSearchEngineService {
inner: std::sync::Arc<dyn super::stub::dynamic::SiteSearchEngineService>,
}
#[cfg(feature = "site-search-engine-service")]
impl SiteSearchEngineService {
pub fn builder() -> super::builder::site_search_engine_service::ClientBuilder {
crate::new_client_builder(super::builder::site_search_engine_service::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::SiteSearchEngineService + '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::SiteSearchEngineService>>
{
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::SiteSearchEngineService> {
super::transport::SiteSearchEngineService::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::SiteSearchEngineService> {
Self::build_transport(conf)
.await
.map(super::tracing::SiteSearchEngineService::new)
}
pub fn get_site_search_engine(
&self,
) -> super::builder::site_search_engine_service::GetSiteSearchEngine {
super::builder::site_search_engine_service::GetSiteSearchEngine::new(self.inner.clone())
}
pub fn create_target_site(
&self,
) -> super::builder::site_search_engine_service::CreateTargetSite {
super::builder::site_search_engine_service::CreateTargetSite::new(self.inner.clone())
}
pub fn batch_create_target_sites(
&self,
) -> super::builder::site_search_engine_service::BatchCreateTargetSites {
super::builder::site_search_engine_service::BatchCreateTargetSites::new(self.inner.clone())
}
pub fn get_target_site(&self) -> super::builder::site_search_engine_service::GetTargetSite {
super::builder::site_search_engine_service::GetTargetSite::new(self.inner.clone())
}
pub fn update_target_site(
&self,
) -> super::builder::site_search_engine_service::UpdateTargetSite {
super::builder::site_search_engine_service::UpdateTargetSite::new(self.inner.clone())
}
pub fn delete_target_site(
&self,
) -> super::builder::site_search_engine_service::DeleteTargetSite {
super::builder::site_search_engine_service::DeleteTargetSite::new(self.inner.clone())
}
pub fn list_target_sites(&self) -> super::builder::site_search_engine_service::ListTargetSites {
super::builder::site_search_engine_service::ListTargetSites::new(self.inner.clone())
}
pub fn create_sitemap(&self) -> super::builder::site_search_engine_service::CreateSitemap {
super::builder::site_search_engine_service::CreateSitemap::new(self.inner.clone())
}
pub fn delete_sitemap(&self) -> super::builder::site_search_engine_service::DeleteSitemap {
super::builder::site_search_engine_service::DeleteSitemap::new(self.inner.clone())
}
pub fn fetch_sitemaps(&self) -> super::builder::site_search_engine_service::FetchSitemaps {
super::builder::site_search_engine_service::FetchSitemaps::new(self.inner.clone())
}
pub fn enable_advanced_site_search(
&self,
) -> super::builder::site_search_engine_service::EnableAdvancedSiteSearch {
super::builder::site_search_engine_service::EnableAdvancedSiteSearch::new(
self.inner.clone(),
)
}
pub fn disable_advanced_site_search(
&self,
) -> super::builder::site_search_engine_service::DisableAdvancedSiteSearch {
super::builder::site_search_engine_service::DisableAdvancedSiteSearch::new(
self.inner.clone(),
)
}
pub fn recrawl_uris(&self) -> super::builder::site_search_engine_service::RecrawlUris {
super::builder::site_search_engine_service::RecrawlUris::new(self.inner.clone())
}
pub fn batch_verify_target_sites(
&self,
) -> super::builder::site_search_engine_service::BatchVerifyTargetSites {
super::builder::site_search_engine_service::BatchVerifyTargetSites::new(self.inner.clone())
}
pub fn fetch_domain_verification_status(
&self,
) -> super::builder::site_search_engine_service::FetchDomainVerificationStatus {
super::builder::site_search_engine_service::FetchDomainVerificationStatus::new(
self.inner.clone(),
)
}
pub fn list_operations(&self) -> super::builder::site_search_engine_service::ListOperations {
super::builder::site_search_engine_service::ListOperations::new(self.inner.clone())
}
pub fn get_operation(&self) -> super::builder::site_search_engine_service::GetOperation {
super::builder::site_search_engine_service::GetOperation::new(self.inner.clone())
}
pub fn cancel_operation(&self) -> super::builder::site_search_engine_service::CancelOperation {
super::builder::site_search_engine_service::CancelOperation::new(self.inner.clone())
}
}
#[cfg(feature = "user-event-service")]
#[cfg_attr(docsrs, doc(cfg(feature = "user-event-service")))]
#[derive(Clone, Debug)]
pub struct UserEventService {
inner: std::sync::Arc<dyn super::stub::dynamic::UserEventService>,
}
#[cfg(feature = "user-event-service")]
impl UserEventService {
pub fn builder() -> super::builder::user_event_service::ClientBuilder {
crate::new_client_builder(super::builder::user_event_service::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::UserEventService + '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::UserEventService>>
{
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::UserEventService> {
super::transport::UserEventService::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::UserEventService> {
Self::build_transport(conf)
.await
.map(super::tracing::UserEventService::new)
}
pub fn write_user_event(&self) -> super::builder::user_event_service::WriteUserEvent {
super::builder::user_event_service::WriteUserEvent::new(self.inner.clone())
}
pub fn collect_user_event(&self) -> super::builder::user_event_service::CollectUserEvent {
super::builder::user_event_service::CollectUserEvent::new(self.inner.clone())
}
pub fn purge_user_events(&self) -> super::builder::user_event_service::PurgeUserEvents {
super::builder::user_event_service::PurgeUserEvents::new(self.inner.clone())
}
pub fn import_user_events(&self) -> super::builder::user_event_service::ImportUserEvents {
super::builder::user_event_service::ImportUserEvents::new(self.inner.clone())
}
pub fn list_operations(&self) -> super::builder::user_event_service::ListOperations {
super::builder::user_event_service::ListOperations::new(self.inner.clone())
}
pub fn get_operation(&self) -> super::builder::user_event_service::GetOperation {
super::builder::user_event_service::GetOperation::new(self.inner.clone())
}
pub fn cancel_operation(&self) -> super::builder::user_event_service::CancelOperation {
super::builder::user_event_service::CancelOperation::new(self.inner.clone())
}
}
#[cfg(feature = "user-license-service")]
#[cfg_attr(docsrs, doc(cfg(feature = "user-license-service")))]
#[derive(Clone, Debug)]
pub struct UserLicenseService {
inner: std::sync::Arc<dyn super::stub::dynamic::UserLicenseService>,
}
#[cfg(feature = "user-license-service")]
impl UserLicenseService {
pub fn builder() -> super::builder::user_license_service::ClientBuilder {
crate::new_client_builder(super::builder::user_license_service::client::Factory)
}
pub fn from_stub<T>(stub: T) -> Self
where
T: super::stub::UserLicenseService + '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::UserLicenseService>>
{
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::UserLicenseService> {
super::transport::UserLicenseService::new(conf).await
}
async fn build_with_tracing(
conf: gaxi::options::ClientConfig,
) -> crate::ClientBuilderResult<impl super::stub::UserLicenseService> {
Self::build_transport(conf)
.await
.map(super::tracing::UserLicenseService::new)
}
pub fn list_user_licenses(&self) -> super::builder::user_license_service::ListUserLicenses {
super::builder::user_license_service::ListUserLicenses::new(self.inner.clone())
}
pub fn batch_update_user_licenses(
&self,
) -> super::builder::user_license_service::BatchUpdateUserLicenses {
super::builder::user_license_service::BatchUpdateUserLicenses::new(self.inner.clone())
}
pub fn list_operations(&self) -> super::builder::user_license_service::ListOperations {
super::builder::user_license_service::ListOperations::new(self.inner.clone())
}
pub fn get_operation(&self) -> super::builder::user_license_service::GetOperation {
super::builder::user_license_service::GetOperation::new(self.inner.clone())
}
pub fn cancel_operation(&self) -> super::builder::user_license_service::CancelOperation {
super::builder::user_license_service::CancelOperation::new(self.inner.clone())
}
}