#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SpeechWordInfo {
#[prost(string, tag="3")]
pub word: ::prost::alloc::string::String,
#[prost(message, optional, tag="1")]
pub start_offset: ::core::option::Option<::prost_types::Duration>,
#[prost(message, optional, tag="2")]
pub end_offset: ::core::option::Option<::prost_types::Duration>,
#[prost(float, tag="4")]
pub confidence: f32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InputAudioConfig {
#[prost(enumeration="AudioEncoding", tag="1")]
pub audio_encoding: i32,
#[prost(int32, tag="2")]
pub sample_rate_hertz: i32,
#[prost(bool, tag="13")]
pub enable_word_info: bool,
#[prost(string, repeated, tag="4")]
pub phrase_hints: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, tag="7")]
pub model: ::prost::alloc::string::String,
#[prost(enumeration="SpeechModelVariant", tag="10")]
pub model_variant: i32,
#[prost(bool, tag="8")]
pub single_utterance: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VoiceSelectionParams {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(enumeration="SsmlVoiceGender", tag="2")]
pub ssml_gender: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SynthesizeSpeechConfig {
#[prost(double, tag="1")]
pub speaking_rate: f64,
#[prost(double, tag="2")]
pub pitch: f64,
#[prost(double, tag="3")]
pub volume_gain_db: f64,
#[prost(string, repeated, tag="5")]
pub effects_profile_id: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, optional, tag="4")]
pub voice: ::core::option::Option<VoiceSelectionParams>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OutputAudioConfig {
#[prost(enumeration="OutputAudioEncoding", tag="1")]
pub audio_encoding: i32,
#[prost(int32, tag="2")]
pub sample_rate_hertz: i32,
#[prost(message, optional, tag="3")]
pub synthesize_speech_config: ::core::option::Option<SynthesizeSpeechConfig>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum AudioEncoding {
Unspecified = 0,
Linear16 = 1,
Flac = 2,
Mulaw = 3,
Amr = 4,
AmrWb = 5,
OggOpus = 6,
SpeexWithHeaderByte = 7,
}
impl AudioEncoding {
pub fn as_str_name(&self) -> &'static str {
match self {
AudioEncoding::Unspecified => "AUDIO_ENCODING_UNSPECIFIED",
AudioEncoding::Linear16 => "AUDIO_ENCODING_LINEAR_16",
AudioEncoding::Flac => "AUDIO_ENCODING_FLAC",
AudioEncoding::Mulaw => "AUDIO_ENCODING_MULAW",
AudioEncoding::Amr => "AUDIO_ENCODING_AMR",
AudioEncoding::AmrWb => "AUDIO_ENCODING_AMR_WB",
AudioEncoding::OggOpus => "AUDIO_ENCODING_OGG_OPUS",
AudioEncoding::SpeexWithHeaderByte => "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE",
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SpeechModelVariant {
Unspecified = 0,
UseBestAvailable = 1,
UseStandard = 2,
UseEnhanced = 3,
}
impl SpeechModelVariant {
pub fn as_str_name(&self) -> &'static str {
match self {
SpeechModelVariant::Unspecified => "SPEECH_MODEL_VARIANT_UNSPECIFIED",
SpeechModelVariant::UseBestAvailable => "USE_BEST_AVAILABLE",
SpeechModelVariant::UseStandard => "USE_STANDARD",
SpeechModelVariant::UseEnhanced => "USE_ENHANCED",
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SsmlVoiceGender {
Unspecified = 0,
Male = 1,
Female = 2,
Neutral = 3,
}
impl SsmlVoiceGender {
pub fn as_str_name(&self) -> &'static str {
match self {
SsmlVoiceGender::Unspecified => "SSML_VOICE_GENDER_UNSPECIFIED",
SsmlVoiceGender::Male => "SSML_VOICE_GENDER_MALE",
SsmlVoiceGender::Female => "SSML_VOICE_GENDER_FEMALE",
SsmlVoiceGender::Neutral => "SSML_VOICE_GENDER_NEUTRAL",
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OutputAudioEncoding {
Unspecified = 0,
Linear16 = 1,
Mp3 = 2,
Mp364Kbps = 4,
OggOpus = 3,
Mulaw = 5,
}
impl OutputAudioEncoding {
pub fn as_str_name(&self) -> &'static str {
match self {
OutputAudioEncoding::Unspecified => "OUTPUT_AUDIO_ENCODING_UNSPECIFIED",
OutputAudioEncoding::Linear16 => "OUTPUT_AUDIO_ENCODING_LINEAR_16",
OutputAudioEncoding::Mp3 => "OUTPUT_AUDIO_ENCODING_MP3",
OutputAudioEncoding::Mp364Kbps => "OUTPUT_AUDIO_ENCODING_MP3_64_KBPS",
OutputAudioEncoding::OggOpus => "OUTPUT_AUDIO_ENCODING_OGG_OPUS",
OutputAudioEncoding::Mulaw => "OUTPUT_AUDIO_ENCODING_MULAW",
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResponseMessage {
#[prost(oneof="response_message::Message", tags="1, 2, 9, 8, 10, 11, 12, 13")]
pub message: ::core::option::Option<response_message::Message>,
}
pub mod response_message {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Text {
#[prost(string, repeated, tag="1")]
pub text: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(bool, tag="2")]
pub allow_playback_interruption: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LiveAgentHandoff {
#[prost(message, optional, tag="1")]
pub metadata: ::core::option::Option<::prost_types::Struct>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConversationSuccess {
#[prost(message, optional, tag="1")]
pub metadata: ::core::option::Option<::prost_types::Struct>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OutputAudioText {
#[prost(bool, tag="3")]
pub allow_playback_interruption: bool,
#[prost(oneof="output_audio_text::Source", tags="1, 2")]
pub source: ::core::option::Option<output_audio_text::Source>,
}
pub mod output_audio_text {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Source {
#[prost(string, tag="1")]
Text(::prost::alloc::string::String),
#[prost(string, tag="2")]
Ssml(::prost::alloc::string::String),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EndInteraction {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PlayAudio {
#[prost(string, tag="1")]
pub audio_uri: ::prost::alloc::string::String,
#[prost(bool, tag="2")]
pub allow_playback_interruption: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MixedAudio {
#[prost(message, repeated, tag="1")]
pub segments: ::prost::alloc::vec::Vec<mixed_audio::Segment>,
}
pub mod mixed_audio {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Segment {
#[prost(bool, tag="3")]
pub allow_playback_interruption: bool,
#[prost(oneof="segment::Content", tags="1, 2")]
pub content: ::core::option::Option<segment::Content>,
}
pub mod segment {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Content {
#[prost(bytes, tag="1")]
Audio(::prost::alloc::vec::Vec<u8>),
#[prost(string, tag="2")]
Uri(::prost::alloc::string::String),
}
}
}
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Message {
#[prost(message, tag="1")]
Text(Text),
#[prost(message, tag="2")]
Payload(::prost_types::Struct),
#[prost(message, tag="9")]
ConversationSuccess(ConversationSuccess),
#[prost(message, tag="8")]
OutputAudioText(OutputAudioText),
#[prost(message, tag="10")]
LiveAgentHandoff(LiveAgentHandoff),
#[prost(message, tag="11")]
EndInteraction(EndInteraction),
#[prost(message, tag="12")]
PlayAudio(PlayAudio),
#[prost(message, tag="13")]
MixedAudio(MixedAudio),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Fulfillment {
#[prost(message, repeated, tag="1")]
pub messages: ::prost::alloc::vec::Vec<ResponseMessage>,
#[prost(string, tag="2")]
pub webhook: ::prost::alloc::string::String,
#[prost(string, tag="3")]
pub tag: ::prost::alloc::string::String,
#[prost(message, repeated, tag="4")]
pub set_parameter_actions: ::prost::alloc::vec::Vec<fulfillment::SetParameterAction>,
#[prost(message, repeated, tag="5")]
pub conditional_cases: ::prost::alloc::vec::Vec<fulfillment::ConditionalCases>,
}
pub mod fulfillment {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetParameterAction {
#[prost(string, tag="1")]
pub parameter: ::prost::alloc::string::String,
#[prost(message, optional, tag="2")]
pub value: ::core::option::Option<::prost_types::Value>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConditionalCases {
#[prost(message, repeated, tag="1")]
pub cases: ::prost::alloc::vec::Vec<conditional_cases::Case>,
}
pub mod conditional_cases {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Case {
#[prost(string, tag="1")]
pub condition: ::prost::alloc::string::String,
#[prost(message, repeated, tag="2")]
pub case_content: ::prost::alloc::vec::Vec<case::CaseContent>,
}
pub mod case {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CaseContent {
#[prost(oneof="case_content::CasesOrMessage", tags="1, 2")]
pub cases_or_message: ::core::option::Option<case_content::CasesOrMessage>,
}
pub mod case_content {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum CasesOrMessage {
#[prost(message, tag="1")]
Message(super::super::super::super::ResponseMessage),
#[prost(message, tag="2")]
AdditionalCases(super::super::super::ConditionalCases),
}
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Page {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub display_name: ::prost::alloc::string::String,
#[prost(message, optional, tag="7")]
pub entry_fulfillment: ::core::option::Option<Fulfillment>,
#[prost(message, optional, tag="4")]
pub form: ::core::option::Option<Form>,
#[prost(string, repeated, tag="11")]
pub transition_route_groups: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, repeated, tag="9")]
pub transition_routes: ::prost::alloc::vec::Vec<TransitionRoute>,
#[prost(message, repeated, tag="10")]
pub event_handlers: ::prost::alloc::vec::Vec<EventHandler>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Form {
#[prost(message, repeated, tag="1")]
pub parameters: ::prost::alloc::vec::Vec<form::Parameter>,
}
pub mod form {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Parameter {
#[prost(string, tag="1")]
pub display_name: ::prost::alloc::string::String,
#[prost(bool, tag="2")]
pub required: bool,
#[prost(string, tag="3")]
pub entity_type: ::prost::alloc::string::String,
#[prost(bool, tag="4")]
pub is_list: bool,
#[prost(message, optional, tag="7")]
pub fill_behavior: ::core::option::Option<parameter::FillBehavior>,
#[prost(message, optional, tag="9")]
pub default_value: ::core::option::Option<::prost_types::Value>,
#[prost(bool, tag="11")]
pub redact: bool,
}
pub mod parameter {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FillBehavior {
#[prost(message, optional, tag="3")]
pub initial_prompt_fulfillment: ::core::option::Option<super::super::Fulfillment>,
#[prost(message, repeated, tag="5")]
pub reprompt_event_handlers: ::prost::alloc::vec::Vec<super::super::EventHandler>,
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventHandler {
#[prost(string, tag="6")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag="4")]
pub event: ::prost::alloc::string::String,
#[prost(message, optional, tag="5")]
pub trigger_fulfillment: ::core::option::Option<Fulfillment>,
#[prost(oneof="event_handler::Target", tags="2, 3")]
pub target: ::core::option::Option<event_handler::Target>,
}
pub mod event_handler {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Target {
#[prost(string, tag="2")]
TargetPage(::prost::alloc::string::String),
#[prost(string, tag="3")]
TargetFlow(::prost::alloc::string::String),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransitionRoute {
#[prost(string, tag="6")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag="1")]
pub intent: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub condition: ::prost::alloc::string::String,
#[prost(message, optional, tag="3")]
pub trigger_fulfillment: ::core::option::Option<Fulfillment>,
#[prost(oneof="transition_route::Target", tags="4, 5")]
pub target: ::core::option::Option<transition_route::Target>,
}
pub mod transition_route {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Target {
#[prost(string, tag="4")]
TargetPage(::prost::alloc::string::String),
#[prost(string, tag="5")]
TargetFlow(::prost::alloc::string::String),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListPagesRequest {
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
#[prost(int32, tag="3")]
pub page_size: i32,
#[prost(string, tag="4")]
pub page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListPagesResponse {
#[prost(message, repeated, tag="1")]
pub pages: ::prost::alloc::vec::Vec<Page>,
#[prost(string, tag="2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetPageRequest {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreatePageRequest {
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
#[prost(message, optional, tag="2")]
pub page: ::core::option::Option<Page>,
#[prost(string, tag="3")]
pub language_code: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdatePageRequest {
#[prost(message, optional, tag="1")]
pub page: ::core::option::Option<Page>,
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
#[prost(message, optional, tag="3")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeletePageRequest {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(bool, tag="2")]
pub force: bool,
}
pub mod pages_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 PagesClient<T> {
inner: tonic::client::Grpc<T>,
}
impl PagesClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> PagesClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + 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,
) -> PagesClient<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> + Send + Sync,
{
PagesClient::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
}
pub async fn list_pages(
&mut self,
request: impl tonic::IntoRequest<super::ListPagesRequest>,
) -> Result<tonic::Response<super::ListPagesResponse>, 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.dialogflow.cx.v3beta1.Pages/ListPages",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn get_page(
&mut self,
request: impl tonic::IntoRequest<super::GetPageRequest>,
) -> Result<tonic::Response<super::Page>, 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.dialogflow.cx.v3beta1.Pages/GetPage",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn create_page(
&mut self,
request: impl tonic::IntoRequest<super::CreatePageRequest>,
) -> Result<tonic::Response<super::Page>, 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.dialogflow.cx.v3beta1.Pages/CreatePage",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn update_page(
&mut self,
request: impl tonic::IntoRequest<super::UpdatePageRequest>,
) -> Result<tonic::Response<super::Page>, 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.dialogflow.cx.v3beta1.Pages/UpdatePage",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn delete_page(
&mut self,
request: impl tonic::IntoRequest<super::DeletePageRequest>,
) -> Result<tonic::Response<()>, 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.dialogflow.cx.v3beta1.Pages/DeletePage",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidationMessage {
#[prost(enumeration="validation_message::ResourceType", tag="1")]
pub resource_type: i32,
#[deprecated]
#[prost(string, repeated, tag="2")]
pub resources: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, repeated, tag="6")]
pub resource_names: ::prost::alloc::vec::Vec<ResourceName>,
#[prost(enumeration="validation_message::Severity", tag="3")]
pub severity: i32,
#[prost(string, tag="4")]
pub detail: ::prost::alloc::string::String,
}
pub mod validation_message {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ResourceType {
Unspecified = 0,
Agent = 1,
Intent = 2,
IntentTrainingPhrase = 8,
IntentParameter = 9,
Intents = 10,
IntentTrainingPhrases = 11,
EntityType = 3,
EntityTypes = 12,
Webhook = 4,
Flow = 5,
Page = 6,
Pages = 13,
TransitionRouteGroup = 7,
}
impl ResourceType {
pub fn as_str_name(&self) -> &'static str {
match self {
ResourceType::Unspecified => "RESOURCE_TYPE_UNSPECIFIED",
ResourceType::Agent => "AGENT",
ResourceType::Intent => "INTENT",
ResourceType::IntentTrainingPhrase => "INTENT_TRAINING_PHRASE",
ResourceType::IntentParameter => "INTENT_PARAMETER",
ResourceType::Intents => "INTENTS",
ResourceType::IntentTrainingPhrases => "INTENT_TRAINING_PHRASES",
ResourceType::EntityType => "ENTITY_TYPE",
ResourceType::EntityTypes => "ENTITY_TYPES",
ResourceType::Webhook => "WEBHOOK",
ResourceType::Flow => "FLOW",
ResourceType::Page => "PAGE",
ResourceType::Pages => "PAGES",
ResourceType::TransitionRouteGroup => "TRANSITION_ROUTE_GROUP",
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Severity {
Unspecified = 0,
Info = 1,
Warning = 2,
Error = 3,
}
impl Severity {
pub fn as_str_name(&self) -> &'static str {
match self {
Severity::Unspecified => "SEVERITY_UNSPECIFIED",
Severity::Info => "INFO",
Severity::Warning => "WARNING",
Severity::Error => "ERROR",
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResourceName {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub display_name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NluSettings {
#[prost(enumeration="nlu_settings::ModelType", tag="1")]
pub model_type: i32,
#[prost(float, tag="3")]
pub classification_threshold: f32,
#[prost(enumeration="nlu_settings::ModelTrainingMode", tag="4")]
pub model_training_mode: i32,
}
pub mod nlu_settings {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ModelType {
Unspecified = 0,
Standard = 1,
Advanced = 3,
}
impl ModelType {
pub fn as_str_name(&self) -> &'static str {
match self {
ModelType::Unspecified => "MODEL_TYPE_UNSPECIFIED",
ModelType::Standard => "MODEL_TYPE_STANDARD",
ModelType::Advanced => "MODEL_TYPE_ADVANCED",
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ModelTrainingMode {
Unspecified = 0,
Automatic = 1,
Manual = 2,
}
impl ModelTrainingMode {
pub fn as_str_name(&self) -> &'static str {
match self {
ModelTrainingMode::Unspecified => "MODEL_TRAINING_MODE_UNSPECIFIED",
ModelTrainingMode::Automatic => "MODEL_TRAINING_MODE_AUTOMATIC",
ModelTrainingMode::Manual => "MODEL_TRAINING_MODE_MANUAL",
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Flow {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub display_name: ::prost::alloc::string::String,
#[prost(string, tag="3")]
pub description: ::prost::alloc::string::String,
#[prost(message, repeated, tag="4")]
pub transition_routes: ::prost::alloc::vec::Vec<TransitionRoute>,
#[prost(message, repeated, tag="10")]
pub event_handlers: ::prost::alloc::vec::Vec<EventHandler>,
#[prost(string, repeated, tag="15")]
pub transition_route_groups: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, optional, tag="11")]
pub nlu_settings: ::core::option::Option<NluSettings>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateFlowRequest {
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
#[prost(message, optional, tag="2")]
pub flow: ::core::option::Option<Flow>,
#[prost(string, tag="3")]
pub language_code: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteFlowRequest {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(bool, tag="2")]
pub force: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFlowsRequest {
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
#[prost(int32, tag="2")]
pub page_size: i32,
#[prost(string, tag="3")]
pub page_token: ::prost::alloc::string::String,
#[prost(string, tag="4")]
pub language_code: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFlowsResponse {
#[prost(message, repeated, tag="1")]
pub flows: ::prost::alloc::vec::Vec<Flow>,
#[prost(string, tag="2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetFlowRequest {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateFlowRequest {
#[prost(message, optional, tag="1")]
pub flow: ::core::option::Option<Flow>,
#[prost(message, optional, tag="2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
#[prost(string, tag="3")]
pub language_code: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TrainFlowRequest {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidateFlowRequest {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetFlowValidationResultRequest {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FlowValidationResult {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(message, repeated, tag="2")]
pub validation_messages: ::prost::alloc::vec::Vec<ValidationMessage>,
#[prost(message, optional, tag="3")]
pub update_time: ::core::option::Option<::prost_types::Timestamp>,
}
pub mod flows_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 FlowsClient<T> {
inner: tonic::client::Grpc<T>,
}
impl FlowsClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> FlowsClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + 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,
) -> FlowsClient<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> + Send + Sync,
{
FlowsClient::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
}
pub async fn create_flow(
&mut self,
request: impl tonic::IntoRequest<super::CreateFlowRequest>,
) -> Result<tonic::Response<super::Flow>, 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.dialogflow.cx.v3beta1.Flows/CreateFlow",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn delete_flow(
&mut self,
request: impl tonic::IntoRequest<super::DeleteFlowRequest>,
) -> Result<tonic::Response<()>, 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.dialogflow.cx.v3beta1.Flows/DeleteFlow",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn list_flows(
&mut self,
request: impl tonic::IntoRequest<super::ListFlowsRequest>,
) -> Result<tonic::Response<super::ListFlowsResponse>, 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.dialogflow.cx.v3beta1.Flows/ListFlows",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn get_flow(
&mut self,
request: impl tonic::IntoRequest<super::GetFlowRequest>,
) -> Result<tonic::Response<super::Flow>, 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.dialogflow.cx.v3beta1.Flows/GetFlow",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn update_flow(
&mut self,
request: impl tonic::IntoRequest<super::UpdateFlowRequest>,
) -> Result<tonic::Response<super::Flow>, 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.dialogflow.cx.v3beta1.Flows/UpdateFlow",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn train_flow(
&mut self,
request: impl tonic::IntoRequest<super::TrainFlowRequest>,
) -> Result<
tonic::Response<super::super::super::super::super::longrunning::Operation>,
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.dialogflow.cx.v3beta1.Flows/TrainFlow",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn validate_flow(
&mut self,
request: impl tonic::IntoRequest<super::ValidateFlowRequest>,
) -> Result<tonic::Response<super::FlowValidationResult>, 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.dialogflow.cx.v3beta1.Flows/ValidateFlow",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn get_flow_validation_result(
&mut self,
request: impl tonic::IntoRequest<super::GetFlowValidationResultRequest>,
) -> Result<tonic::Response<super::FlowValidationResult>, 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.dialogflow.cx.v3beta1.Flows/GetFlowValidationResult",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Intent {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub display_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag="3")]
pub training_phrases: ::prost::alloc::vec::Vec<intent::TrainingPhrase>,
#[prost(message, repeated, tag="4")]
pub parameters: ::prost::alloc::vec::Vec<intent::Parameter>,
#[prost(int32, tag="5")]
pub priority: i32,
#[prost(bool, tag="6")]
pub is_fallback: bool,
#[prost(map="string, string", tag="7")]
pub labels: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
#[prost(string, tag="8")]
pub description: ::prost::alloc::string::String,
}
pub mod intent {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TrainingPhrase {
#[prost(string, tag="1")]
pub id: ::prost::alloc::string::String,
#[prost(message, repeated, tag="2")]
pub parts: ::prost::alloc::vec::Vec<training_phrase::Part>,
#[prost(int32, tag="3")]
pub repeat_count: i32,
}
pub mod training_phrase {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Part {
#[prost(string, tag="1")]
pub text: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub parameter_id: ::prost::alloc::string::String,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Parameter {
#[prost(string, tag="1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub entity_type: ::prost::alloc::string::String,
#[prost(bool, tag="3")]
pub is_list: bool,
#[prost(bool, tag="4")]
pub redact: bool,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListIntentsRequest {
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
#[prost(enumeration="IntentView", tag="5")]
pub intent_view: i32,
#[prost(int32, tag="3")]
pub page_size: i32,
#[prost(string, tag="4")]
pub page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListIntentsResponse {
#[prost(message, repeated, tag="1")]
pub intents: ::prost::alloc::vec::Vec<Intent>,
#[prost(string, tag="2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetIntentRequest {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateIntentRequest {
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
#[prost(message, optional, tag="2")]
pub intent: ::core::option::Option<Intent>,
#[prost(string, tag="3")]
pub language_code: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateIntentRequest {
#[prost(message, optional, tag="1")]
pub intent: ::core::option::Option<Intent>,
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
#[prost(message, optional, tag="3")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteIntentRequest {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum IntentView {
Unspecified = 0,
Partial = 1,
Full = 2,
}
impl IntentView {
pub fn as_str_name(&self) -> &'static str {
match self {
IntentView::Unspecified => "INTENT_VIEW_UNSPECIFIED",
IntentView::Partial => "INTENT_VIEW_PARTIAL",
IntentView::Full => "INTENT_VIEW_FULL",
}
}
}
pub mod intents_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 IntentsClient<T> {
inner: tonic::client::Grpc<T>,
}
impl IntentsClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> IntentsClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + 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,
) -> IntentsClient<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> + Send + Sync,
{
IntentsClient::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
}
pub async fn list_intents(
&mut self,
request: impl tonic::IntoRequest<super::ListIntentsRequest>,
) -> Result<tonic::Response<super::ListIntentsResponse>, 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.dialogflow.cx.v3beta1.Intents/ListIntents",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn get_intent(
&mut self,
request: impl tonic::IntoRequest<super::GetIntentRequest>,
) -> Result<tonic::Response<super::Intent>, 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.dialogflow.cx.v3beta1.Intents/GetIntent",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn create_intent(
&mut self,
request: impl tonic::IntoRequest<super::CreateIntentRequest>,
) -> Result<tonic::Response<super::Intent>, 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.dialogflow.cx.v3beta1.Intents/CreateIntent",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn update_intent(
&mut self,
request: impl tonic::IntoRequest<super::UpdateIntentRequest>,
) -> Result<tonic::Response<super::Intent>, 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.dialogflow.cx.v3beta1.Intents/UpdateIntent",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn delete_intent(
&mut self,
request: impl tonic::IntoRequest<super::DeleteIntentRequest>,
) -> Result<tonic::Response<()>, 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.dialogflow.cx.v3beta1.Intents/DeleteIntent",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EntityType {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub display_name: ::prost::alloc::string::String,
#[prost(enumeration="entity_type::Kind", tag="3")]
pub kind: i32,
#[prost(enumeration="entity_type::AutoExpansionMode", tag="4")]
pub auto_expansion_mode: i32,
#[prost(message, repeated, tag="5")]
pub entities: ::prost::alloc::vec::Vec<entity_type::Entity>,
#[prost(message, repeated, tag="6")]
pub excluded_phrases: ::prost::alloc::vec::Vec<entity_type::ExcludedPhrase>,
#[prost(bool, tag="7")]
pub enable_fuzzy_extraction: bool,
#[prost(bool, tag="9")]
pub redact: bool,
}
pub mod entity_type {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Entity {
#[prost(string, tag="1")]
pub value: ::prost::alloc::string::String,
#[prost(string, repeated, tag="2")]
pub synonyms: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExcludedPhrase {
#[prost(string, tag="1")]
pub value: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Kind {
Unspecified = 0,
Map = 1,
List = 2,
Regexp = 3,
}
impl Kind {
pub fn as_str_name(&self) -> &'static str {
match self {
Kind::Unspecified => "KIND_UNSPECIFIED",
Kind::Map => "KIND_MAP",
Kind::List => "KIND_LIST",
Kind::Regexp => "KIND_REGEXP",
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum AutoExpansionMode {
Unspecified = 0,
Default = 1,
}
impl AutoExpansionMode {
pub fn as_str_name(&self) -> &'static str {
match self {
AutoExpansionMode::Unspecified => "AUTO_EXPANSION_MODE_UNSPECIFIED",
AutoExpansionMode::Default => "AUTO_EXPANSION_MODE_DEFAULT",
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListEntityTypesRequest {
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
#[prost(int32, tag="3")]
pub page_size: i32,
#[prost(string, tag="4")]
pub page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListEntityTypesResponse {
#[prost(message, repeated, tag="1")]
pub entity_types: ::prost::alloc::vec::Vec<EntityType>,
#[prost(string, tag="2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetEntityTypeRequest {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateEntityTypeRequest {
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
#[prost(message, optional, tag="2")]
pub entity_type: ::core::option::Option<EntityType>,
#[prost(string, tag="3")]
pub language_code: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateEntityTypeRequest {
#[prost(message, optional, tag="1")]
pub entity_type: ::core::option::Option<EntityType>,
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
#[prost(message, optional, tag="3")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteEntityTypeRequest {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(bool, tag="2")]
pub force: bool,
}
pub mod entity_types_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 EntityTypesClient<T> {
inner: tonic::client::Grpc<T>,
}
impl EntityTypesClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> EntityTypesClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + 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,
) -> EntityTypesClient<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> + Send + Sync,
{
EntityTypesClient::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
}
pub async fn list_entity_types(
&mut self,
request: impl tonic::IntoRequest<super::ListEntityTypesRequest>,
) -> Result<tonic::Response<super::ListEntityTypesResponse>, 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.dialogflow.cx.v3beta1.EntityTypes/ListEntityTypes",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn get_entity_type(
&mut self,
request: impl tonic::IntoRequest<super::GetEntityTypeRequest>,
) -> Result<tonic::Response<super::EntityType>, 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.dialogflow.cx.v3beta1.EntityTypes/GetEntityType",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn create_entity_type(
&mut self,
request: impl tonic::IntoRequest<super::CreateEntityTypeRequest>,
) -> Result<tonic::Response<super::EntityType>, 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.dialogflow.cx.v3beta1.EntityTypes/CreateEntityType",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn update_entity_type(
&mut self,
request: impl tonic::IntoRequest<super::UpdateEntityTypeRequest>,
) -> Result<tonic::Response<super::EntityType>, 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.dialogflow.cx.v3beta1.EntityTypes/UpdateEntityType",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn delete_entity_type(
&mut self,
request: impl tonic::IntoRequest<super::DeleteEntityTypeRequest>,
) -> Result<tonic::Response<()>, 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.dialogflow.cx.v3beta1.EntityTypes/DeleteEntityType",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SessionEntityType {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(enumeration="session_entity_type::EntityOverrideMode", tag="3")]
pub entity_override_mode: i32,
#[prost(message, repeated, tag="4")]
pub entities: ::prost::alloc::vec::Vec<entity_type::Entity>,
}
pub mod session_entity_type {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum EntityOverrideMode {
Unspecified = 0,
Override = 1,
Supplement = 2,
}
impl EntityOverrideMode {
pub fn as_str_name(&self) -> &'static str {
match self {
EntityOverrideMode::Unspecified => "ENTITY_OVERRIDE_MODE_UNSPECIFIED",
EntityOverrideMode::Override => "ENTITY_OVERRIDE_MODE_OVERRIDE",
EntityOverrideMode::Supplement => "ENTITY_OVERRIDE_MODE_SUPPLEMENT",
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSessionEntityTypesRequest {
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
#[prost(int32, tag="2")]
pub page_size: i32,
#[prost(string, tag="3")]
pub page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSessionEntityTypesResponse {
#[prost(message, repeated, tag="1")]
pub session_entity_types: ::prost::alloc::vec::Vec<SessionEntityType>,
#[prost(string, tag="2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetSessionEntityTypeRequest {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateSessionEntityTypeRequest {
#[prost(string, tag="1")]
pub parent: ::prost::alloc::string::String,
#[prost(message, optional, tag="2")]
pub session_entity_type: ::core::option::Option<SessionEntityType>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateSessionEntityTypeRequest {
#[prost(message, optional, tag="1")]
pub session_entity_type: ::core::option::Option<SessionEntityType>,
#[prost(message, optional, tag="2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteSessionEntityTypeRequest {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
}
pub mod session_entity_types_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 SessionEntityTypesClient<T> {
inner: tonic::client::Grpc<T>,
}
impl SessionEntityTypesClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> SessionEntityTypesClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + 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,
) -> SessionEntityTypesClient<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> + Send + Sync,
{
SessionEntityTypesClient::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
}
pub async fn list_session_entity_types(
&mut self,
request: impl tonic::IntoRequest<super::ListSessionEntityTypesRequest>,
) -> Result<
tonic::Response<super::ListSessionEntityTypesResponse>,
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.dialogflow.cx.v3beta1.SessionEntityTypes/ListSessionEntityTypes",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn get_session_entity_type(
&mut self,
request: impl tonic::IntoRequest<super::GetSessionEntityTypeRequest>,
) -> Result<tonic::Response<super::SessionEntityType>, 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.dialogflow.cx.v3beta1.SessionEntityTypes/GetSessionEntityType",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn create_session_entity_type(
&mut self,
request: impl tonic::IntoRequest<super::CreateSessionEntityTypeRequest>,
) -> Result<tonic::Response<super::SessionEntityType>, 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.dialogflow.cx.v3beta1.SessionEntityTypes/CreateSessionEntityType",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn update_session_entity_type(
&mut self,
request: impl tonic::IntoRequest<super::UpdateSessionEntityTypeRequest>,
) -> Result<tonic::Response<super::SessionEntityType>, 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.dialogflow.cx.v3beta1.SessionEntityTypes/UpdateSessionEntityType",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn delete_session_entity_type(
&mut self,
request: impl tonic::IntoRequest<super::DeleteSessionEntityTypeRequest>,
) -> Result<tonic::Response<()>, 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.dialogflow.cx.v3beta1.SessionEntityTypes/DeleteSessionEntityType",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DetectIntentRequest {
#[prost(string, tag="1")]
pub session: ::prost::alloc::string::String,
#[prost(message, optional, tag="2")]
pub query_params: ::core::option::Option<QueryParameters>,
#[prost(message, optional, tag="3")]
pub query_input: ::core::option::Option<QueryInput>,
#[prost(message, optional, tag="4")]
pub output_audio_config: ::core::option::Option<OutputAudioConfig>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DetectIntentResponse {
#[prost(string, tag="1")]
pub response_id: ::prost::alloc::string::String,
#[prost(message, optional, tag="2")]
pub query_result: ::core::option::Option<QueryResult>,
#[prost(bytes="vec", tag="4")]
pub output_audio: ::prost::alloc::vec::Vec<u8>,
#[prost(message, optional, tag="5")]
pub output_audio_config: ::core::option::Option<OutputAudioConfig>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamingDetectIntentRequest {
#[prost(string, tag="1")]
pub session: ::prost::alloc::string::String,
#[prost(message, optional, tag="2")]
pub query_params: ::core::option::Option<QueryParameters>,
#[prost(message, optional, tag="3")]
pub query_input: ::core::option::Option<QueryInput>,
#[prost(message, optional, tag="4")]
pub output_audio_config: ::core::option::Option<OutputAudioConfig>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamingDetectIntentResponse {
#[prost(oneof="streaming_detect_intent_response::Response", tags="1, 2")]
pub response: ::core::option::Option<streaming_detect_intent_response::Response>,
}
pub mod streaming_detect_intent_response {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Response {
#[prost(message, tag="1")]
RecognitionResult(super::StreamingRecognitionResult),
#[prost(message, tag="2")]
DetectIntentResponse(super::DetectIntentResponse),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamingRecognitionResult {
#[prost(enumeration="streaming_recognition_result::MessageType", tag="1")]
pub message_type: i32,
#[prost(string, tag="2")]
pub transcript: ::prost::alloc::string::String,
#[prost(bool, tag="3")]
pub is_final: bool,
#[prost(float, tag="4")]
pub confidence: f32,
#[prost(float, tag="6")]
pub stability: f32,
#[prost(message, repeated, tag="7")]
pub speech_word_info: ::prost::alloc::vec::Vec<SpeechWordInfo>,
#[prost(message, optional, tag="8")]
pub speech_end_offset: ::core::option::Option<::prost_types::Duration>,
}
pub mod streaming_recognition_result {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MessageType {
Unspecified = 0,
Transcript = 1,
EndOfSingleUtterance = 2,
}
impl MessageType {
pub fn as_str_name(&self) -> &'static str {
match self {
MessageType::Unspecified => "MESSAGE_TYPE_UNSPECIFIED",
MessageType::Transcript => "TRANSCRIPT",
MessageType::EndOfSingleUtterance => "END_OF_SINGLE_UTTERANCE",
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryParameters {
#[prost(string, tag="1")]
pub time_zone: ::prost::alloc::string::String,
#[prost(message, optional, tag="2")]
pub geo_location: ::core::option::Option<super::super::super::super::r#type::LatLng>,
#[prost(message, repeated, tag="3")]
pub session_entity_types: ::prost::alloc::vec::Vec<SessionEntityType>,
#[prost(message, optional, tag="4")]
pub payload: ::core::option::Option<::prost_types::Struct>,
#[prost(message, optional, tag="5")]
pub parameters: ::core::option::Option<::prost_types::Struct>,
#[prost(string, tag="6")]
pub current_page: ::prost::alloc::string::String,
#[prost(bool, tag="7")]
pub disable_webhook: bool,
#[prost(bool, tag="8")]
pub analyze_query_text_sentiment: bool,
#[prost(map="string, string", tag="10")]
pub webhook_headers: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryInput {
#[prost(string, tag="4")]
pub language_code: ::prost::alloc::string::String,
#[prost(oneof="query_input::Input", tags="2, 3, 5, 6, 7")]
pub input: ::core::option::Option<query_input::Input>,
}
pub mod query_input {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Input {
#[prost(message, tag="2")]
Text(super::TextInput),
#[prost(message, tag="3")]
Intent(super::IntentInput),
#[prost(message, tag="5")]
Audio(super::AudioInput),
#[prost(message, tag="6")]
Event(super::EventInput),
#[prost(message, tag="7")]
Dtmf(super::DtmfInput),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryResult {
#[prost(string, tag="2")]
pub language_code: ::prost::alloc::string::String,
#[prost(message, optional, tag="3")]
pub parameters: ::core::option::Option<::prost_types::Struct>,
#[prost(message, repeated, tag="4")]
pub response_messages: ::prost::alloc::vec::Vec<ResponseMessage>,
#[prost(message, repeated, tag="13")]
pub webhook_statuses: ::prost::alloc::vec::Vec<super::super::super::super::rpc::Status>,
#[prost(message, repeated, tag="6")]
pub webhook_payloads: ::prost::alloc::vec::Vec<::prost_types::Struct>,
#[prost(message, optional, tag="7")]
pub current_page: ::core::option::Option<Page>,
#[deprecated]
#[prost(message, optional, tag="8")]
pub intent: ::core::option::Option<Intent>,
#[deprecated]
#[prost(float, tag="9")]
pub intent_detection_confidence: f32,
#[prost(message, optional, tag="15")]
pub r#match: ::core::option::Option<Match>,
#[prost(message, optional, tag="10")]
pub diagnostic_info: ::core::option::Option<::prost_types::Struct>,
#[prost(message, optional, tag="17")]
pub sentiment_analysis_result: ::core::option::Option<SentimentAnalysisResult>,
#[prost(oneof="query_result::Query", tags="1, 11, 12, 14")]
pub query: ::core::option::Option<query_result::Query>,
}
pub mod query_result {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Query {
#[prost(string, tag="1")]
Text(::prost::alloc::string::String),
#[prost(string, tag="11")]
TriggerIntent(::prost::alloc::string::String),
#[prost(string, tag="12")]
Transcript(::prost::alloc::string::String),
#[prost(string, tag="14")]
TriggerEvent(::prost::alloc::string::String),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextInput {
#[prost(string, tag="1")]
pub text: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IntentInput {
#[prost(string, tag="1")]
pub intent: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AudioInput {
#[prost(message, optional, tag="1")]
pub config: ::core::option::Option<InputAudioConfig>,
#[prost(bytes="vec", tag="2")]
pub audio: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventInput {
#[prost(string, tag="1")]
pub event: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DtmfInput {
#[prost(string, tag="1")]
pub digits: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub finish_digit: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Match {
#[prost(message, optional, tag="1")]
pub intent: ::core::option::Option<Intent>,
#[prost(string, tag="6")]
pub event: ::prost::alloc::string::String,
#[prost(message, optional, tag="2")]
pub parameters: ::core::option::Option<::prost_types::Struct>,
#[prost(string, tag="3")]
pub resolved_input: ::prost::alloc::string::String,
#[prost(enumeration="r#match::MatchType", tag="4")]
pub match_type: i32,
#[prost(float, tag="5")]
pub confidence: f32,
}
pub mod r#match {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MatchType {
Unspecified = 0,
Intent = 1,
DirectIntent = 2,
ParameterFilling = 3,
NoMatch = 4,
NoInput = 5,
Event = 6,
}
impl MatchType {
pub fn as_str_name(&self) -> &'static str {
match self {
MatchType::Unspecified => "MATCH_TYPE_UNSPECIFIED",
MatchType::Intent => "INTENT",
MatchType::DirectIntent => "DIRECT_INTENT",
MatchType::ParameterFilling => "PARAMETER_FILLING",
MatchType::NoMatch => "NO_MATCH",
MatchType::NoInput => "NO_INPUT",
MatchType::Event => "EVENT",
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MatchIntentRequest {
#[prost(string, tag="1")]
pub session: ::prost::alloc::string::String,
#[prost(message, optional, tag="2")]
pub query_params: ::core::option::Option<QueryParameters>,
#[prost(message, optional, tag="3")]
pub query_input: ::core::option::Option<QueryInput>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MatchIntentResponse {
#[prost(message, repeated, tag="4")]
pub matches: ::prost::alloc::vec::Vec<Match>,
#[prost(message, optional, tag="5")]
pub current_page: ::core::option::Option<Page>,
#[prost(oneof="match_intent_response::Query", tags="1, 2, 3, 6")]
pub query: ::core::option::Option<match_intent_response::Query>,
}
pub mod match_intent_response {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Query {
#[prost(string, tag="1")]
Text(::prost::alloc::string::String),
#[prost(string, tag="2")]
TriggerIntent(::prost::alloc::string::String),
#[prost(string, tag="3")]
Transcript(::prost::alloc::string::String),
#[prost(string, tag="6")]
TriggerEvent(::prost::alloc::string::String),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FulfillIntentRequest {
#[prost(message, optional, tag="1")]
pub match_intent_request: ::core::option::Option<MatchIntentRequest>,
#[prost(message, optional, tag="2")]
pub r#match: ::core::option::Option<Match>,
#[prost(message, optional, tag="3")]
pub output_audio_config: ::core::option::Option<OutputAudioConfig>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FulfillIntentResponse {
#[prost(string, tag="1")]
pub response_id: ::prost::alloc::string::String,
#[prost(message, optional, tag="2")]
pub query_result: ::core::option::Option<QueryResult>,
#[prost(bytes="vec", tag="3")]
pub output_audio: ::prost::alloc::vec::Vec<u8>,
#[prost(message, optional, tag="4")]
pub output_audio_config: ::core::option::Option<OutputAudioConfig>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SentimentAnalysisResult {
#[prost(float, tag="1")]
pub score: f32,
#[prost(float, tag="2")]
pub magnitude: f32,
}
pub mod sessions_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 SessionsClient<T> {
inner: tonic::client::Grpc<T>,
}
impl SessionsClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> SessionsClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + 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,
) -> SessionsClient<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> + Send + Sync,
{
SessionsClient::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
}
pub async fn detect_intent(
&mut self,
request: impl tonic::IntoRequest<super::DetectIntentRequest>,
) -> Result<tonic::Response<super::DetectIntentResponse>, 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.dialogflow.cx.v3beta1.Sessions/DetectIntent",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn streaming_detect_intent(
&mut self,
request: impl tonic::IntoStreamingRequest<
Message = super::StreamingDetectIntentRequest,
>,
) -> Result<
tonic::Response<
tonic::codec::Streaming<super::StreamingDetectIntentResponse>,
>,
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.dialogflow.cx.v3beta1.Sessions/StreamingDetectIntent",
);
self.inner.streaming(request.into_streaming_request(), path, codec).await
}
pub async fn match_intent(
&mut self,
request: impl tonic::IntoRequest<super::MatchIntentRequest>,
) -> Result<tonic::Response<super::MatchIntentResponse>, 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.dialogflow.cx.v3beta1.Sessions/MatchIntent",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn fulfill_intent(
&mut self,
request: impl tonic::IntoRequest<super::FulfillIntentRequest>,
) -> Result<tonic::Response<super::FulfillIntentResponse>, 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.dialogflow.cx.v3beta1.Sessions/FulfillIntent",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}