Skip to main content

onesignal_rust_api/models/
operator.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 Operator {
15    /// Strictly, this must be either `\"OR\"`, or `\"AND\"`.  It can be used to compose Filters as part of a Filters object.
16    #[serde(rename = "operator", skip_serializing_if = "Option::is_none")]
17    pub operator: Option<OperatorType>,
18}
19
20impl Operator {
21    pub fn new() -> Operator {
22        Operator {
23            operator: None,
24        }
25    }
26}
27
28/// Strictly, this must be either `\"OR\"`, or `\"AND\"`.  It can be used to compose Filters as part of a Filters object.
29#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
30pub enum OperatorType {
31    #[serde(rename = "OR")]
32    OR,
33    #[serde(rename = "AND")]
34    AND,
35}
36
37impl Default for OperatorType {
38    fn default() -> OperatorType {
39        Self::OR
40    }
41}
42