#[non_exhaustive]pub struct DetectIntentResponse {
pub response_id: String,
pub query_result: Option<QueryResult>,
pub webhook_status: Option<Status>,
pub output_audio: Bytes,
pub output_audio_config: Option<OutputAudioConfig>,
/* private fields */
}participants or sessions only.Expand description
The message returned from the [DetectIntent][] method.
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.response_id: StringThe unique identifier of the response. It can be used to locate a response in the training example set or for reporting issues.
query_result: Option<QueryResult>The selected results of the conversational query or event processing.
See alternative_query_results for additional potential results.
webhook_status: Option<Status>Specifies the status of the webhook request.
output_audio: BytesThe audio data bytes encoded as specified in the request.
Note: The output audio is generated based on the values of default platform
text responses found in the query_result.fulfillment_messages field. If
multiple default text responses exist, they will be concatenated when
generating audio. If no default platform text responses exist, the
generated audio content will be empty.
In some scenarios, multiple output audio fields may be present in the response structure. In these cases, only the top-most-level audio output has content.
output_audio_config: Option<OutputAudioConfig>The config used by the speech synthesizer to generate the output audio.
Implementations§
Source§impl DetectIntentResponse
impl DetectIntentResponse
pub fn new() -> Self
Sourcepub fn set_response_id<T: Into<String>>(self, v: T) -> Self
pub fn set_response_id<T: Into<String>>(self, v: T) -> Self
Sets the value of response_id.
§Example
let x = DetectIntentResponse::new().set_response_id("example");Sourcepub fn set_query_result<T>(self, v: T) -> Selfwhere
T: Into<QueryResult>,
pub fn set_query_result<T>(self, v: T) -> Selfwhere
T: Into<QueryResult>,
Sets the value of query_result.
§Example
use google_cloud_dialogflow_v2::model::QueryResult;
let x = DetectIntentResponse::new().set_query_result(QueryResult::default()/* use setters */);Sourcepub fn set_or_clear_query_result<T>(self, v: Option<T>) -> Selfwhere
T: Into<QueryResult>,
pub fn set_or_clear_query_result<T>(self, v: Option<T>) -> Selfwhere
T: Into<QueryResult>,
Sets or clears the value of query_result.
§Example
use google_cloud_dialogflow_v2::model::QueryResult;
let x = DetectIntentResponse::new().set_or_clear_query_result(Some(QueryResult::default()/* use setters */));
let x = DetectIntentResponse::new().set_or_clear_query_result(None::<QueryResult>);Sourcepub fn set_webhook_status<T>(self, v: T) -> Self
pub fn set_webhook_status<T>(self, v: T) -> Self
Sets the value of webhook_status.
§Example
use rpc::model::Status;
let x = DetectIntentResponse::new().set_webhook_status(Status::default()/* use setters */);Sourcepub fn set_or_clear_webhook_status<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_webhook_status<T>(self, v: Option<T>) -> Self
Sets or clears the value of webhook_status.
§Example
use rpc::model::Status;
let x = DetectIntentResponse::new().set_or_clear_webhook_status(Some(Status::default()/* use setters */));
let x = DetectIntentResponse::new().set_or_clear_webhook_status(None::<Status>);Sourcepub fn set_output_audio<T: Into<Bytes>>(self, v: T) -> Self
pub fn set_output_audio<T: Into<Bytes>>(self, v: T) -> Self
Sets the value of output_audio.
§Example
let x = DetectIntentResponse::new().set_output_audio(bytes::Bytes::from_static(b"example"));Sourcepub fn set_output_audio_config<T>(self, v: T) -> Selfwhere
T: Into<OutputAudioConfig>,
pub fn set_output_audio_config<T>(self, v: T) -> Selfwhere
T: Into<OutputAudioConfig>,
Sets the value of output_audio_config.
§Example
use google_cloud_dialogflow_v2::model::OutputAudioConfig;
let x = DetectIntentResponse::new().set_output_audio_config(OutputAudioConfig::default()/* use setters */);Sourcepub fn set_or_clear_output_audio_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<OutputAudioConfig>,
pub fn set_or_clear_output_audio_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<OutputAudioConfig>,
Sets or clears the value of output_audio_config.
§Example
use google_cloud_dialogflow_v2::model::OutputAudioConfig;
let x = DetectIntentResponse::new().set_or_clear_output_audio_config(Some(OutputAudioConfig::default()/* use setters */));
let x = DetectIntentResponse::new().set_or_clear_output_audio_config(None::<OutputAudioConfig>);Trait Implementations§
Source§impl Clone for DetectIntentResponse
impl Clone for DetectIntentResponse
Source§fn clone(&self) -> DetectIntentResponse
fn clone(&self) -> DetectIntentResponse
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more