1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* OneSignal
*
* A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
*
* Contact: devrel@onesignal.com
* Generated by: https://openapi-generator.tech
*/
/// JourneyAudience : The journey entry audience. The kind field selects which other fields apply.
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct JourneyAudience {
/// Audience kind. Selects which other fields apply.
#[serde(rename = "kind")]
pub kind: KindType,
/// segment audiences: Segment UUIDs whose users enter the journey.
#[serde(rename = "included_segment_ids", skip_serializing_if = "Option::is_none")]
pub included_segment_ids: Option<Vec<String>>,
/// segment audiences: Segment UUIDs whose users are excluded.
#[serde(rename = "excluded_segment_ids", skip_serializing_if = "Option::is_none")]
pub excluded_segment_ids: Option<Vec<String>>,
/// segment audiences: when true, only users who newly match the segment after activation enter the journey. Defaults to false.
#[serde(rename = "future_additions_only", skip_serializing_if = "Option::is_none")]
pub future_additions_only: Option<bool>,
/// event_trigger audiences: event name that triggers entry, up to 255 characters.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// Event attribute matchers, as a list of condition groups. Send a single group whose conditions are AND'd together. More than one group is rejected.
#[serde(rename = "attributes", skip_serializing_if = "Option::is_none")]
pub attributes: Option<Vec<Vec<crate::models::JourneyEventAttribute>>>,
}
impl JourneyAudience {
/// The journey entry audience. The kind field selects which other fields apply.
pub fn new(kind: KindType) -> JourneyAudience {
JourneyAudience {
kind,
included_segment_ids: None,
excluded_segment_ids: None,
future_additions_only: None,
name: None,
attributes: None,
}
}
}
/// Audience kind. Selects which other fields apply.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum KindType {
#[serde(rename = "segment")]
Segment,
#[serde(rename = "event_trigger")]
EventTrigger,
}
impl Default for KindType {
fn default() -> KindType {
Self::Segment
}
}