Struct google_api_proto::google::actions::sdk::v2::interactionmodel::ConditionalEvent
source · pub struct ConditionalEvent {
pub condition: String,
pub transition_to_scene: String,
pub handler: Option<EventHandler>,
}
Expand description
Registers events that trigger as the result of a true condition.
Fields§
§condition: String
Required. Filter condition for this event to trigger. If condition is evaluated to
true then the associated handler
will be triggered.
The following variable references are supported:
$session
- To reference data in session storage.
$user
- To reference data in user storage.
The following boolean operators are supported (with examples):
&&
- session.params.counter > 0 && session.params.counter < 100
||
- session.params.foo == "John" || session.params.counter == "Adam"
!
- !(session.params.counter == 5)
The following comparisons are supported:
==
, !=
, <
, >
, <=
, >=
The following list and string operators are supported (with examples):
in
- “Watermelon” in session.params.fruitList
size
- size(session.params.fruitList) > 2
substring
- session.params.fullName.contains("John")
transition_to_scene: String
Optional. Destination scene which the conversation should jump to when the associated condition is evaluated to true. The state of the current scene is destroyed on the transition.
handler: Option<EventHandler>
Optional. Event handler which is triggered when the associated condition is evaluated
to true
. Should execute before transitioning to the destination scene.
Useful to generate Prompts in response to events.
Trait Implementations§
source§impl Clone for ConditionalEvent
impl Clone for ConditionalEvent
source§fn clone(&self) -> ConditionalEvent
fn clone(&self) -> ConditionalEvent
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ConditionalEvent
impl Debug for ConditionalEvent
source§impl Default for ConditionalEvent
impl Default for ConditionalEvent
source§impl Message for ConditionalEvent
impl Message for ConditionalEvent
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for ConditionalEvent
impl PartialEq for ConditionalEvent
source§fn eq(&self, other: &ConditionalEvent) -> bool
fn eq(&self, other: &ConditionalEvent) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for ConditionalEvent
Auto Trait Implementations§
impl Freeze for ConditionalEvent
impl RefUnwindSafe for ConditionalEvent
impl Send for ConditionalEvent
impl Sync for ConditionalEvent
impl Unpin for ConditionalEvent
impl UnwindSafe for ConditionalEvent
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request