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