asterisk_ari/apis/events/
params.rs

1use derive_new::new;
2use derive_setters::Setters;
3use serde::Serialize;
4
5#[derive(Clone, Debug, Serialize, new, Setters)]
6#[setters(prefix = "with_")]
7#[setters(into, strip_option)]
8pub struct GenerateRequest {
9    /// Event name
10    #[serde(skip_serializing)]
11    #[setters(skip)]
12    #[new(into)]
13    pub(crate) event_name: String,
14
15    /// The name of the application that will receive this event
16    #[setters(skip)]
17    #[new(into)]
18    pub(crate) application: String,
19
20    /// URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource}, deviceState:{deviceName}
21    #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
22    #[new(default)]
23    source: Option<String>,
24
25    /// The "variables" key in the body object holds custom key/value pairs to add to the user event.
26    /// Ex. { "variables": { "key": "value" } }
27    #[serde(skip_serializing)]
28    #[new(default)]
29    pub(crate) variables: Option<serde_json::Value>,
30}