use serde::{Deserialize, Serialize}; /*
                                      * Firebase Cloud Messaging API
                                      *
                                      * FCM send API that provides a cross-platform messaging solution to reliably deliver messages at no cost.
                                      *
                                      * The version of the OpenAPI document: v1
                                      *
                                      * Generated by: https://openapi-generator.tech
                                      */

use crate::google_rest_apis::fcm_v1::models;

/// AndroidNotification : Notification to send to android devices.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AndroidNotification {
    /// The notification's body text. If present, it will override google.firebase.fcm.v1.Notification.body.
    #[serde(rename = "body", skip_serializing_if = "Option::is_none")]
    pub body: Option<String>,
    /// Variable string values to be used in place of the format specifiers in body_loc_key to use to localize the body text to the user's current localization. See [Formatting and Styling](https://goo.gl/MalYE3) for more information.
    #[serde(rename = "bodyLocArgs", skip_serializing_if = "Option::is_none")]
    pub body_loc_args: Option<Vec<String>>,
    /// The key to the body string in the app's string resources to use to localize the body text to the user's current localization. See [String Resources](https://goo.gl/NdFZGI) for more information.
    #[serde(rename = "bodyLocKey", skip_serializing_if = "Option::is_none")]
    pub body_loc_key: Option<String>,
    /// If set, display notifications delivered to the device will be handled by the app instead of the proxy.
    #[serde(
        rename = "bypassProxyNotification",
        skip_serializing_if = "Option::is_none"
    )]
    pub bypass_proxy_notification: Option<bool>,
    /// The [notification's channel id](https://developer.android.com/guide/topics/ui/notifiers/notifications#ManageChannels) (new in Android O). The app must create a channel with this channel ID before any notification with this channel ID is received. If you don't send this channel ID in the request, or if the channel ID provided has not yet been created by the app, FCM uses the channel ID specified in the app manifest.
    #[serde(rename = "channelId", skip_serializing_if = "Option::is_none")]
    pub channel_id: Option<String>,
    /// The action associated with a user click on the notification. If specified, an activity with a matching intent filter is launched when a user clicks on the notification.
    #[serde(rename = "clickAction", skip_serializing_if = "Option::is_none")]
    pub click_action: Option<String>,
    /// The notification's icon color, expressed in #rrggbb format.
    #[serde(rename = "color", skip_serializing_if = "Option::is_none")]
    pub color: Option<String>,
    /// If set to true, use the Android framework's default LED light settings for the notification. Default values are specified in [config.xml](https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/values/config.xml). If `default_light_settings` is set to true and `light_settings` is also set, the user-specified `light_settings` is used instead of the default value.
    #[serde(
        rename = "defaultLightSettings",
        skip_serializing_if = "Option::is_none"
    )]
    pub default_light_settings: Option<bool>,
    /// If set to true, use the Android framework's default sound for the notification. Default values are specified in [config.xml](https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/values/config.xml).
    #[serde(rename = "defaultSound", skip_serializing_if = "Option::is_none")]
    pub default_sound: Option<bool>,
    /// If set to true, use the Android framework's default vibrate pattern for the notification. Default values are specified in [config.xml](https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/values/config.xml). If `default_vibrate_timings` is set to true and `vibrate_timings` is also set, the default value is used instead of the user-specified `vibrate_timings`.
    #[serde(
        rename = "defaultVibrateTimings",
        skip_serializing_if = "Option::is_none"
    )]
    pub default_vibrate_timings: Option<bool>,
    /// Set the time that the event in the notification occurred. Notifications in the panel are sorted by this time. A point in time is represented using [protobuf.Timestamp](https://developers.google.com/protocol-buffers/docs/reference/java/com/google/protobuf/Timestamp).
    #[serde(rename = "eventTime", skip_serializing_if = "Option::is_none")]
    pub event_time: Option<String>,
    /// The notification's icon. Sets the notification icon to myicon for drawable resource myicon. If you don't send this key in the request, FCM displays the launcher icon specified in your app manifest.
    #[serde(rename = "icon", skip_serializing_if = "Option::is_none")]
    pub icon: Option<String>,
    /// Contains the URL of an image that is going to be displayed in a notification. If present, it will override google.firebase.fcm.v1.Notification.image.
    #[serde(rename = "image", skip_serializing_if = "Option::is_none")]
    pub image: Option<String>,
    #[serde(rename = "lightSettings", skip_serializing_if = "Option::is_none")]
    pub light_settings: Option<Box<models::LightSettings>>,
    /// Set whether or not this notification is relevant only to the current device. Some notifications can be bridged to other devices for remote display, such as a Wear OS watch. This hint can be set to recommend this notification not be bridged. See [Wear OS guides](https://developer.android.com/training/wearables/notifications/bridger#existing-method-of-preventing-bridging)
    #[serde(rename = "localOnly", skip_serializing_if = "Option::is_none")]
    pub local_only: Option<bool>,
    /// Sets the number of items this notification represents. May be displayed as a badge count for launchers that support badging.See [Notification Badge](https://developer.android.com/training/notify-user/badges). For example, this might be useful if you're using just one notification to represent multiple new messages but you want the count here to represent the number of total new messages. If zero or unspecified, systems that support badging use the default, which is to increment a number displayed on the long-press menu each time a new notification arrives.
    #[serde(rename = "notificationCount", skip_serializing_if = "Option::is_none")]
    pub notification_count: Option<i32>,
    /// Set the relative priority for this notification. Priority is an indication of how much of the user's attention should be consumed by this notification. Low-priority notifications may be hidden from the user in certain situations, while the user might be interrupted for a higher-priority notification. The effect of setting the same priorities may differ slightly on different platforms. Note this priority differs from `AndroidMessagePriority`. This priority is processed by the client after the message has been delivered, whereas [AndroidMessagePriority](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#androidmessagepriority) is an FCM concept that controls when the message is delivered.
    #[serde(
        rename = "notificationPriority",
        skip_serializing_if = "Option::is_none"
    )]
    pub notification_priority: Option<NotificationPriority>,
    /// Setting to control when a notification may be proxied.
    #[serde(rename = "proxy", skip_serializing_if = "Option::is_none")]
    pub proxy: Option<Proxy>,
    /// The sound to play when the device receives the notification. Supports \"default\" or the filename of a sound resource bundled in the app. Sound files must reside in /res/raw/.
    #[serde(rename = "sound", skip_serializing_if = "Option::is_none")]
    pub sound: Option<String>,
    /// When set to false or unset, the notification is automatically dismissed when the user clicks it in the panel. When set to true, the notification persists even when the user clicks it.
    #[serde(rename = "sticky", skip_serializing_if = "Option::is_none")]
    pub sticky: Option<bool>,
    /// Identifier used to replace existing notifications in the notification drawer. If not specified, each request creates a new notification. If specified and a notification with the same tag is already being shown, the new notification replaces the existing one in the notification drawer.
    #[serde(rename = "tag", skip_serializing_if = "Option::is_none")]
    pub tag: Option<String>,
    /// Sets the \"ticker\" text, which is sent to accessibility services. Prior to API level 21 (`Lollipop`), sets the text that is displayed in the status bar when the notification first arrives.
    #[serde(rename = "ticker", skip_serializing_if = "Option::is_none")]
    pub ticker: Option<String>,
    /// The notification's title. If present, it will override google.firebase.fcm.v1.Notification.title.
    #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
    pub title: Option<String>,
    /// Variable string values to be used in place of the format specifiers in title_loc_key to use to localize the title text to the user's current localization. See [Formatting and Styling](https://goo.gl/MalYE3) for more information.
    #[serde(rename = "titleLocArgs", skip_serializing_if = "Option::is_none")]
    pub title_loc_args: Option<Vec<String>>,
    /// The key to the title string in the app's string resources to use to localize the title text to the user's current localization. See [String Resources](https://goo.gl/NdFZGI) for more information.
    #[serde(rename = "titleLocKey", skip_serializing_if = "Option::is_none")]
    pub title_loc_key: Option<String>,
    /// Set the vibration pattern to use. Pass in an array of [protobuf.Duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration) to turn on or off the vibrator. The first value indicates the `Duration` to wait before turning the vibrator on. The next value indicates the `Duration` to keep the vibrator on. Subsequent values alternate between `Duration` to turn the vibrator off and to turn the vibrator on. If `vibrate_timings` is set and `default_vibrate_timings` is set to `true`, the default value is used instead of the user-specified `vibrate_timings`.
    #[serde(rename = "vibrateTimings", skip_serializing_if = "Option::is_none")]
    pub vibrate_timings: Option<Vec<String>>,
    /// Set the [Notification.visibility](https://developer.android.com/reference/android/app/Notification.html#visibility) of the notification.
    #[serde(rename = "visibility", skip_serializing_if = "Option::is_none")]
    pub visibility: Option<Visibility>,
}

impl AndroidNotification {
    /// Notification to send to android devices.
    pub fn new() -> AndroidNotification {
        AndroidNotification {
            body: None,
            body_loc_args: None,
            body_loc_key: None,
            bypass_proxy_notification: None,
            channel_id: None,
            click_action: None,
            color: None,
            default_light_settings: None,
            default_sound: None,
            default_vibrate_timings: None,
            event_time: None,
            icon: None,
            image: None,
            light_settings: None,
            local_only: None,
            notification_count: None,
            notification_priority: None,
            proxy: None,
            sound: None,
            sticky: None,
            tag: None,
            ticker: None,
            title: None,
            title_loc_args: None,
            title_loc_key: None,
            vibrate_timings: None,
            visibility: None,
        }
    }
}
/// Set the relative priority for this notification. Priority is an indication of how much of the user's attention should be consumed by this notification. Low-priority notifications may be hidden from the user in certain situations, while the user might be interrupted for a higher-priority notification. The effect of setting the same priorities may differ slightly on different platforms. Note this priority differs from `AndroidMessagePriority`. This priority is processed by the client after the message has been delivered, whereas [AndroidMessagePriority](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#androidmessagepriority) is an FCM concept that controls when the message is delivered.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum NotificationPriority {
    #[serde(rename = "PRIORITY_UNSPECIFIED")]
    Unspecified,
    #[serde(rename = "PRIORITY_MIN")]
    Min,
    #[serde(rename = "PRIORITY_LOW")]
    Low,
    #[serde(rename = "PRIORITY_DEFAULT")]
    Default,
    #[serde(rename = "PRIORITY_HIGH")]
    High,
    #[serde(rename = "PRIORITY_MAX")]
    Max,
}

impl Default for NotificationPriority {
    fn default() -> NotificationPriority {
        Self::Unspecified
    }
}
/// Setting to control when a notification may be proxied.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Proxy {
    #[serde(rename = "PROXY_UNSPECIFIED")]
    ProxyUnspecified,
    #[serde(rename = "ALLOW")]
    Allow,
    #[serde(rename = "DENY")]
    Deny,
    #[serde(rename = "IF_PRIORITY_LOWERED")]
    IfPriorityLowered,
}

impl Default for Proxy {
    fn default() -> Proxy {
        Self::ProxyUnspecified
    }
}
/// Set the [Notification.visibility](https://developer.android.com/reference/android/app/Notification.html#visibility) of the notification.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Visibility {
    #[serde(rename = "VISIBILITY_UNSPECIFIED")]
    VisibilityUnspecified,
    #[serde(rename = "PRIVATE")]
    Private,
    #[serde(rename = "PUBLIC")]
    Public,
    #[serde(rename = "SECRET")]
    Secret,
}

impl Default for Visibility {
    fn default() -> Visibility {
        Self::VisibilityUnspecified
    }
}
