#[non_exhaustive]pub struct QueryInput {
pub language_code: String,
pub input: Option<Input>,
/* private fields */
}sessions or test-cases only.Expand description
Represents the query input. It can contain one of:
-
A conversational query in the form of text.
-
An intent query that specifies which intent to trigger.
-
Natural language speech audio to be processed.
-
An event to be triggered.
-
DTMF digits to invoke an intent and fill in parameter value.
-
The results of a tool executed by the client.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.language_code: StringRequired. The language of the input. See Language Support for a list of the currently supported language codes. Note that queries in the same session do not necessarily need to specify the same language.
input: Option<Input>Required. The input specification.
Implementations§
Source§impl QueryInput
impl QueryInput
Sourcepub fn set_language_code<T: Into<String>>(self, v: T) -> Self
pub fn set_language_code<T: Into<String>>(self, v: T) -> Self
Sourcepub fn text(&self) -> Option<&Box<TextInput>>
pub fn text(&self) -> Option<&Box<TextInput>>
The value of input
if it holds a Text, None if the field is not set or
holds a different branch.
Sourcepub fn set_text<T: Into<Box<TextInput>>>(self, v: T) -> Self
pub fn set_text<T: Into<Box<TextInput>>>(self, v: T) -> Self
Sets the value of input
to hold a Text.
Note that all the setters affecting input are
mutually exclusive.
§Example
use google_cloud_dialogflow_cx_v3::model::TextInput;
let x = QueryInput::new().set_text(TextInput::default()/* use setters */);
assert!(x.text().is_some());
assert!(x.intent().is_none());
assert!(x.audio().is_none());
assert!(x.event().is_none());
assert!(x.dtmf().is_none());
assert!(x.tool_call_result().is_none());Sourcepub fn intent(&self) -> Option<&Box<IntentInput>>
pub fn intent(&self) -> Option<&Box<IntentInput>>
The value of input
if it holds a Intent, None if the field is not set or
holds a different branch.
Sourcepub fn set_intent<T: Into<Box<IntentInput>>>(self, v: T) -> Self
pub fn set_intent<T: Into<Box<IntentInput>>>(self, v: T) -> Self
Sets the value of input
to hold a Intent.
Note that all the setters affecting input are
mutually exclusive.
§Example
use google_cloud_dialogflow_cx_v3::model::IntentInput;
let x = QueryInput::new().set_intent(IntentInput::default()/* use setters */);
assert!(x.intent().is_some());
assert!(x.text().is_none());
assert!(x.audio().is_none());
assert!(x.event().is_none());
assert!(x.dtmf().is_none());
assert!(x.tool_call_result().is_none());Sourcepub fn audio(&self) -> Option<&Box<AudioInput>>
pub fn audio(&self) -> Option<&Box<AudioInput>>
The value of input
if it holds a Audio, None if the field is not set or
holds a different branch.
Sourcepub fn set_audio<T: Into<Box<AudioInput>>>(self, v: T) -> Self
pub fn set_audio<T: Into<Box<AudioInput>>>(self, v: T) -> Self
Sets the value of input
to hold a Audio.
Note that all the setters affecting input are
mutually exclusive.
§Example
use google_cloud_dialogflow_cx_v3::model::AudioInput;
let x = QueryInput::new().set_audio(AudioInput::default()/* use setters */);
assert!(x.audio().is_some());
assert!(x.text().is_none());
assert!(x.intent().is_none());
assert!(x.event().is_none());
assert!(x.dtmf().is_none());
assert!(x.tool_call_result().is_none());Sourcepub fn event(&self) -> Option<&Box<EventInput>>
pub fn event(&self) -> Option<&Box<EventInput>>
The value of input
if it holds a Event, None if the field is not set or
holds a different branch.
Sourcepub fn set_event<T: Into<Box<EventInput>>>(self, v: T) -> Self
pub fn set_event<T: Into<Box<EventInput>>>(self, v: T) -> Self
Sets the value of input
to hold a Event.
Note that all the setters affecting input are
mutually exclusive.
§Example
use google_cloud_dialogflow_cx_v3::model::EventInput;
let x = QueryInput::new().set_event(EventInput::default()/* use setters */);
assert!(x.event().is_some());
assert!(x.text().is_none());
assert!(x.intent().is_none());
assert!(x.audio().is_none());
assert!(x.dtmf().is_none());
assert!(x.tool_call_result().is_none());Sourcepub fn dtmf(&self) -> Option<&Box<DtmfInput>>
pub fn dtmf(&self) -> Option<&Box<DtmfInput>>
The value of input
if it holds a Dtmf, None if the field is not set or
holds a different branch.
Sourcepub fn set_dtmf<T: Into<Box<DtmfInput>>>(self, v: T) -> Self
pub fn set_dtmf<T: Into<Box<DtmfInput>>>(self, v: T) -> Self
Sets the value of input
to hold a Dtmf.
Note that all the setters affecting input are
mutually exclusive.
§Example
use google_cloud_dialogflow_cx_v3::model::DtmfInput;
let x = QueryInput::new().set_dtmf(DtmfInput::default()/* use setters */);
assert!(x.dtmf().is_some());
assert!(x.text().is_none());
assert!(x.intent().is_none());
assert!(x.audio().is_none());
assert!(x.event().is_none());
assert!(x.tool_call_result().is_none());Sourcepub fn tool_call_result(&self) -> Option<&Box<ToolCallResult>>
pub fn tool_call_result(&self) -> Option<&Box<ToolCallResult>>
The value of input
if it holds a ToolCallResult, None if the field is not set or
holds a different branch.
Sourcepub fn set_tool_call_result<T: Into<Box<ToolCallResult>>>(self, v: T) -> Self
pub fn set_tool_call_result<T: Into<Box<ToolCallResult>>>(self, v: T) -> Self
Sets the value of input
to hold a ToolCallResult.
Note that all the setters affecting input are
mutually exclusive.
§Example
use google_cloud_dialogflow_cx_v3::model::ToolCallResult;
let x = QueryInput::new().set_tool_call_result(ToolCallResult::default()/* use setters */);
assert!(x.tool_call_result().is_some());
assert!(x.text().is_none());
assert!(x.intent().is_none());
assert!(x.audio().is_none());
assert!(x.event().is_none());
assert!(x.dtmf().is_none());Trait Implementations§
Source§impl Clone for QueryInput
impl Clone for QueryInput
Source§fn clone(&self) -> QueryInput
fn clone(&self) -> QueryInput
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for QueryInput
impl Debug for QueryInput
Source§impl Default for QueryInput
impl Default for QueryInput
Source§fn default() -> QueryInput
fn default() -> QueryInput
Source§impl PartialEq for QueryInput
impl PartialEq for QueryInput
Source§fn eq(&self, other: &QueryInput) -> bool
fn eq(&self, other: &QueryInput) -> bool
self and other values to be equal, and is used by ==.