Skip to main content

onesignal_rust_api/models/
segment.rs

1/*
2 * OneSignal
3 *
4 * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
5 *
6 * Contact: devrel@onesignal.com
7 * Generated by: https://openapi-generator.tech
8 */
9
10
11
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct Segment {
15    /// UUID of the segment.  If left empty, it will be assigned automaticaly.
16    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
17    pub id: Option<String>,
18    /// Name of the segment.  You'll see this name on the Web UI.
19    #[serde(rename = "name")]
20    pub name: String,
21    /// Filter or operators the segment will have.  For a list of available filters with details, please see Send to Users Based on Filters.
22    #[serde(rename = "filters")]
23    pub filters: Vec<crate::models::FilterExpression>,
24}
25
26impl Segment {
27    pub fn new(name: String, filters: Vec<crate::models::FilterExpression>) -> Segment {
28        Segment {
29            id: None,
30            name,
31            filters,
32        }
33    }
34}
35
36