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 * The version of the OpenAPI document: 1.4.1
7 * Contact: devrel@onesignal.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12
13
14#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
15pub struct Segment {
16    /// UUID of the segment.  If left empty, it will be assigned automaticaly.
17    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
18    pub id: Option<String>,
19    /// Name of the segment.  You'll see this name on the Web UI.
20    #[serde(rename = "name")]
21    pub name: String,
22    /// Filter or operators the segment will have.  For a list of available filters with details, please see Send to Users Based on Filters.
23    #[serde(rename = "filters")]
24    pub filters: Vec<crate::models::FilterExpressions>,
25}
26
27impl Segment {
28    pub fn new(name: String, filters: Vec<crate::models::FilterExpressions>) -> Segment {
29        Segment {
30            id: None,
31            name,
32            filters,
33        }
34    }
35}
36
37