onesignal-rust-api 5.15.0

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
Documentation
/*
 * 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
 */




#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct EstimateNotificationRecipientsRequestAllOf {
    /// The OneSignal App ID for your app, which can be found in Keys & IDs.
    #[serde(rename = "app_id", skip_serializing_if = "Option::is_none")]
    pub app_id: Option<String>,
    #[serde(rename = "filters", skip_serializing_if = "Option::is_none")]
    pub filters: Option<Vec<crate::models::FilterExpression>>,
    /// Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Keys must match API spellings exactly (for example the label for External ID is the string `external_id`; arbitrary keys such as camelCase variants are not aliases and may yield no recipients). Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms.
    #[serde(rename = "include_aliases", skip_serializing_if = "Option::is_none")]
    pub include_aliases: Option<::std::collections::HashMap<String, Vec<String>>>,
    /// Which platforms to count recipients for. Selects the same default platforms Create notification would use for the channel. Individual platform flags (`isIos`, `isAndroid`, etc.) are not supported by this endpoint.
    #[serde(rename = "target_channel", skip_serializing_if = "Option::is_none")]
    pub target_channel: Option<TargetChannelType>,
}

impl EstimateNotificationRecipientsRequestAllOf {
    pub fn new() -> EstimateNotificationRecipientsRequestAllOf {
        EstimateNotificationRecipientsRequestAllOf {
            app_id: None,
            filters: None,
            include_aliases: None,
            target_channel: None,
        }
    }
}

/// Which platforms to count recipients for. Selects the same default platforms Create notification would use for the channel. Individual platform flags (`isIos`, `isAndroid`, etc.) are not supported by this endpoint.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TargetChannelType {
    #[serde(rename = "push")]
    Push,
    #[serde(rename = "email")]
    Email,
    #[serde(rename = "sms")]
    Sms,
}

impl Default for TargetChannelType {
    fn default() -> TargetChannelType {
        Self::Push
    }
}