#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UserFeedback {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub free_form_feedback: ::prost::alloc::string::String,
#[prost(enumeration = "user_feedback::UserFeedbackRating", tag = "3")]
pub rating: i32,
}
pub mod user_feedback {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum UserFeedbackRating {
Unspecified = 0,
Positive = 1,
Negative = 2,
}
impl UserFeedbackRating {
pub fn as_str_name(&self) -> &'static str {
match self {
UserFeedbackRating::Unspecified => "USER_FEEDBACK_RATING_UNSPECIFIED",
UserFeedbackRating::Positive => "POSITIVE",
UserFeedbackRating::Negative => "NEGATIVE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"USER_FEEDBACK_RATING_UNSPECIFIED" => Some(Self::Unspecified),
"POSITIVE" => Some(Self::Positive),
"NEGATIVE" => Some(Self::Negative),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AnnotatedString {
#[prost(string, tag = "1")]
pub text_formatted: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub html_formatted: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "3")]
pub markups: ::prost::alloc::vec::Vec<annotated_string::SemanticMarkup>,
}
pub mod annotated_string {
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SemanticMarkup {
#[prost(enumeration = "SemanticMarkupType", tag = "1")]
pub r#type: i32,
#[prost(int32, tag = "2")]
pub start_char_index: i32,
#[prost(int32, tag = "3")]
pub length: i32,
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum SemanticMarkupType {
MarkupTypeUnspecified = 0,
Metric = 1,
Dimension = 2,
Filter = 3,
Unused = 4,
Blocked = 5,
Row = 6,
}
impl SemanticMarkupType {
pub fn as_str_name(&self) -> &'static str {
match self {
SemanticMarkupType::MarkupTypeUnspecified => "MARKUP_TYPE_UNSPECIFIED",
SemanticMarkupType::Metric => "METRIC",
SemanticMarkupType::Dimension => "DIMENSION",
SemanticMarkupType::Filter => "FILTER",
SemanticMarkupType::Unused => "UNUSED",
SemanticMarkupType::Blocked => "BLOCKED",
SemanticMarkupType::Row => "ROW",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"MARKUP_TYPE_UNSPECIFIED" => Some(Self::MarkupTypeUnspecified),
"METRIC" => Some(Self::Metric),
"DIMENSION" => Some(Self::Dimension),
"FILTER" => Some(Self::Filter),
"UNUSED" => Some(Self::Unused),
"BLOCKED" => Some(Self::Blocked),
"ROW" => Some(Self::Row),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Question {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "2")]
pub scopes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, tag = "3")]
pub query: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "4")]
pub data_source_annotations: ::prost::alloc::vec::Vec<
::prost::alloc::string::String,
>,
#[prost(message, optional, tag = "5")]
pub interpret_error: ::core::option::Option<InterpretError>,
#[prost(message, repeated, tag = "6")]
pub interpretations: ::prost::alloc::vec::Vec<Interpretation>,
#[prost(message, optional, tag = "7")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "8")]
pub user_email: ::prost::alloc::string::String,
#[prost(message, optional, tag = "9")]
pub debug_flags: ::core::option::Option<DebugFlags>,
#[prost(message, optional, tag = "10")]
pub debug_info: ::core::option::Option<::prost_types::Any>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InterpretError {
#[prost(string, tag = "1")]
pub message: ::prost::alloc::string::String,
#[prost(enumeration = "interpret_error::InterpretErrorCode", tag = "2")]
pub code: i32,
#[prost(message, optional, tag = "3")]
pub details: ::core::option::Option<interpret_error::InterpretErrorDetails>,
}
pub mod interpret_error {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InterpretErrorDetails {
#[prost(message, optional, tag = "1")]
pub unsupported_details: ::core::option::Option<InterpretUnsupportedDetails>,
#[prost(message, optional, tag = "2")]
pub incomplete_query_details: ::core::option::Option<
InterpretIncompleteQueryDetails,
>,
#[prost(message, optional, tag = "3")]
pub ambiguity_details: ::core::option::Option<InterpretAmbiguityDetails>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InterpretUnsupportedDetails {
#[prost(string, repeated, tag = "1")]
pub operators: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "2")]
pub intent: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InterpretIncompleteQueryDetails {
#[prost(enumeration = "super::InterpretEntity", repeated, tag = "1")]
pub entities: ::prost::alloc::vec::Vec<i32>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct InterpretAmbiguityDetails {}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum InterpretErrorCode {
Unspecified = 0,
InvalidQuery = 1,
FailedToUnderstand = 2,
FailedToAnswer = 3,
}
impl InterpretErrorCode {
pub fn as_str_name(&self) -> &'static str {
match self {
InterpretErrorCode::Unspecified => "INTERPRET_ERROR_CODE_UNSPECIFIED",
InterpretErrorCode::InvalidQuery => "INVALID_QUERY",
InterpretErrorCode::FailedToUnderstand => "FAILED_TO_UNDERSTAND",
InterpretErrorCode::FailedToAnswer => "FAILED_TO_ANSWER",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"INTERPRET_ERROR_CODE_UNSPECIFIED" => Some(Self::Unspecified),
"INVALID_QUERY" => Some(Self::InvalidQuery),
"FAILED_TO_UNDERSTAND" => Some(Self::FailedToUnderstand),
"FAILED_TO_ANSWER" => Some(Self::FailedToAnswer),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutionInfo {
#[prost(message, optional, tag = "1")]
pub job_creation_status: ::core::option::Option<super::super::super::rpc::Status>,
#[prost(enumeration = "execution_info::JobExecutionState", tag = "2")]
pub job_execution_state: i32,
#[prost(message, optional, tag = "3")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "4")]
pub bigquery_job: ::core::option::Option<BigQueryJob>,
}
pub mod execution_info {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum JobExecutionState {
Unspecified = 0,
NotExecuted = 1,
Running = 2,
Succeeded = 3,
Failed = 4,
}
impl JobExecutionState {
pub fn as_str_name(&self) -> &'static str {
match self {
JobExecutionState::Unspecified => "JOB_EXECUTION_STATE_UNSPECIFIED",
JobExecutionState::NotExecuted => "NOT_EXECUTED",
JobExecutionState::Running => "RUNNING",
JobExecutionState::Succeeded => "SUCCEEDED",
JobExecutionState::Failed => "FAILED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"JOB_EXECUTION_STATE_UNSPECIFIED" => Some(Self::Unspecified),
"NOT_EXECUTED" => Some(Self::NotExecuted),
"RUNNING" => Some(Self::Running),
"SUCCEEDED" => Some(Self::Succeeded),
"FAILED" => Some(Self::Failed),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BigQueryJob {
#[prost(string, tag = "1")]
pub job_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub project_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub location: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Interpretation {
#[prost(string, repeated, tag = "1")]
pub data_sources: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(double, tag = "2")]
pub confidence: f64,
#[prost(string, repeated, tag = "3")]
pub unused_phrases: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub human_readable: ::core::option::Option<HumanReadable>,
#[prost(message, optional, tag = "5")]
pub interpretation_structure: ::core::option::Option<InterpretationStructure>,
#[prost(message, optional, tag = "6")]
pub data_query: ::core::option::Option<DataQuery>,
#[prost(message, optional, tag = "7")]
pub execution_info: ::core::option::Option<ExecutionInfo>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DataQuery {
#[prost(string, tag = "1")]
pub sql: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HumanReadable {
#[prost(message, optional, tag = "1")]
pub generated_interpretation: ::core::option::Option<AnnotatedString>,
#[prost(message, optional, tag = "2")]
pub original_question: ::core::option::Option<AnnotatedString>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InterpretationStructure {
#[prost(
enumeration = "interpretation_structure::VisualizationType",
repeated,
tag = "1"
)]
pub visualization_types: ::prost::alloc::vec::Vec<i32>,
#[prost(message, repeated, tag = "2")]
pub column_info: ::prost::alloc::vec::Vec<interpretation_structure::ColumnInfo>,
}
pub mod interpretation_structure {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ColumnInfo {
#[prost(string, tag = "1")]
pub output_alias: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub display_name: ::prost::alloc::string::String,
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum VisualizationType {
Unspecified = 0,
Table = 1,
BarChart = 2,
ColumnChart = 3,
Timeline = 4,
ScatterPlot = 5,
PieChart = 6,
LineChart = 7,
AreaChart = 8,
ComboChart = 9,
Histogram = 10,
GenericChart = 11,
ChartNotUnderstood = 12,
}
impl VisualizationType {
pub fn as_str_name(&self) -> &'static str {
match self {
VisualizationType::Unspecified => "VISUALIZATION_TYPE_UNSPECIFIED",
VisualizationType::Table => "TABLE",
VisualizationType::BarChart => "BAR_CHART",
VisualizationType::ColumnChart => "COLUMN_CHART",
VisualizationType::Timeline => "TIMELINE",
VisualizationType::ScatterPlot => "SCATTER_PLOT",
VisualizationType::PieChart => "PIE_CHART",
VisualizationType::LineChart => "LINE_CHART",
VisualizationType::AreaChart => "AREA_CHART",
VisualizationType::ComboChart => "COMBO_CHART",
VisualizationType::Histogram => "HISTOGRAM",
VisualizationType::GenericChart => "GENERIC_CHART",
VisualizationType::ChartNotUnderstood => "CHART_NOT_UNDERSTOOD",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"VISUALIZATION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"TABLE" => Some(Self::Table),
"BAR_CHART" => Some(Self::BarChart),
"COLUMN_CHART" => Some(Self::ColumnChart),
"TIMELINE" => Some(Self::Timeline),
"SCATTER_PLOT" => Some(Self::ScatterPlot),
"PIE_CHART" => Some(Self::PieChart),
"LINE_CHART" => Some(Self::LineChart),
"AREA_CHART" => Some(Self::AreaChart),
"COMBO_CHART" => Some(Self::ComboChart),
"HISTOGRAM" => Some(Self::Histogram),
"GENERIC_CHART" => Some(Self::GenericChart),
"CHART_NOT_UNDERSTOOD" => Some(Self::ChartNotUnderstood),
_ => None,
}
}
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DebugFlags {
#[prost(bool, tag = "1")]
pub include_va_query: bool,
#[prost(bool, tag = "2")]
pub include_nested_va_query: bool,
#[prost(bool, tag = "3")]
pub include_human_interpretation: bool,
#[prost(bool, tag = "4")]
pub include_aqua_debug_response: bool,
#[prost(int64, tag = "5")]
pub time_override: i64,
#[prost(bool, tag = "6")]
pub is_internal_google_user: bool,
#[prost(bool, tag = "7")]
pub ignore_cache: bool,
#[prost(bool, tag = "8")]
pub include_search_entities_rpc: bool,
#[prost(bool, tag = "9")]
pub include_list_column_annotations_rpc: bool,
#[prost(bool, tag = "10")]
pub include_virtual_analyst_entities: bool,
#[prost(bool, tag = "11")]
pub include_table_list: bool,
#[prost(bool, tag = "12")]
pub include_domain_list: bool,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum InterpretEntity {
Unspecified = 0,
Dimension = 1,
Metric = 2,
}
impl InterpretEntity {
pub fn as_str_name(&self) -> &'static str {
match self {
InterpretEntity::Unspecified => "INTERPRET_ENTITY_UNSPECIFIED",
InterpretEntity::Dimension => "DIMENSION",
InterpretEntity::Metric => "METRIC",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"INTERPRET_ENTITY_UNSPECIFIED" => Some(Self::Unspecified),
"DIMENSION" => Some(Self::Dimension),
"METRIC" => Some(Self::Metric),
_ => None,
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SuggestQueriesRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "2")]
pub scopes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, tag = "3")]
pub query: ::prost::alloc::string::String,
#[prost(enumeration = "SuggestionType", repeated, tag = "4")]
pub suggestion_types: ::prost::alloc::vec::Vec<i32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Suggestion {
#[prost(message, optional, tag = "1")]
pub suggestion_info: ::core::option::Option<SuggestionInfo>,
#[prost(double, tag = "2")]
pub ranking_score: f64,
#[prost(enumeration = "SuggestionType", tag = "3")]
pub suggestion_type: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SuggestionInfo {
#[prost(message, optional, tag = "1")]
pub annotated_suggestion: ::core::option::Option<AnnotatedString>,
#[prost(message, repeated, tag = "2")]
pub query_matches: ::prost::alloc::vec::Vec<suggestion_info::MatchInfo>,
}
pub mod suggestion_info {
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct MatchInfo {
#[prost(int32, tag = "1")]
pub start_char_index: i32,
#[prost(int32, tag = "2")]
pub length: i32,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SuggestQueriesResponse {
#[prost(message, repeated, tag = "1")]
pub suggestions: ::prost::alloc::vec::Vec<Suggestion>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SuggestionType {
Unspecified = 0,
Entity = 1,
Template = 2,
}
impl SuggestionType {
pub fn as_str_name(&self) -> &'static str {
match self {
SuggestionType::Unspecified => "SUGGESTION_TYPE_UNSPECIFIED",
SuggestionType::Entity => "ENTITY",
SuggestionType::Template => "TEMPLATE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SUGGESTION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"ENTITY" => Some(Self::Entity),
"TEMPLATE" => Some(Self::Template),
_ => None,
}
}
}
pub mod auto_suggestion_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct AutoSuggestionServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> AutoSuggestionServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> AutoSuggestionServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
AutoSuggestionServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn suggest_queries(
&mut self,
request: impl tonic::IntoRequest<super::SuggestQueriesRequest>,
) -> std::result::Result<
tonic::Response<super::SuggestQueriesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dataqna.v1alpha.AutoSuggestionService/SuggestQueries",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.dataqna.v1alpha.AutoSuggestionService",
"SuggestQueries",
),
);
self.inner.unary(req, path, codec).await
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetQuestionRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateQuestionRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub question: ::core::option::Option<Question>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecuteQuestionRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub interpretation_index: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetUserFeedbackRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateUserFeedbackRequest {
#[prost(message, optional, tag = "1")]
pub user_feedback: ::core::option::Option<UserFeedback>,
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
pub mod question_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct QuestionServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> QuestionServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> QuestionServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
QuestionServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn get_question(
&mut self,
request: impl tonic::IntoRequest<super::GetQuestionRequest>,
) -> std::result::Result<tonic::Response<super::Question>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dataqna.v1alpha.QuestionService/GetQuestion",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.dataqna.v1alpha.QuestionService",
"GetQuestion",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn create_question(
&mut self,
request: impl tonic::IntoRequest<super::CreateQuestionRequest>,
) -> std::result::Result<tonic::Response<super::Question>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dataqna.v1alpha.QuestionService/CreateQuestion",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.dataqna.v1alpha.QuestionService",
"CreateQuestion",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn execute_question(
&mut self,
request: impl tonic::IntoRequest<super::ExecuteQuestionRequest>,
) -> std::result::Result<tonic::Response<super::Question>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dataqna.v1alpha.QuestionService/ExecuteQuestion",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.dataqna.v1alpha.QuestionService",
"ExecuteQuestion",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_user_feedback(
&mut self,
request: impl tonic::IntoRequest<super::GetUserFeedbackRequest>,
) -> std::result::Result<tonic::Response<super::UserFeedback>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dataqna.v1alpha.QuestionService/GetUserFeedback",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.dataqna.v1alpha.QuestionService",
"GetUserFeedback",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn update_user_feedback(
&mut self,
request: impl tonic::IntoRequest<super::UpdateUserFeedbackRequest>,
) -> std::result::Result<tonic::Response<super::UserFeedback>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.dataqna.v1alpha.QuestionService/UpdateUserFeedback",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.dataqna.v1alpha.QuestionService",
"UpdateUserFeedback",
),
);
self.inner.unary(req, path, codec).await
}
}
}