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;

/// WebpushConfig : [Webpush protocol](https://tools.ietf.org/html/rfc8030) options.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebpushConfig {
    /// Arbitrary key/value payload. If present, it will override google.firebase.fcm.v1.Message.data.
    #[serde(rename = "data", skip_serializing_if = "Option::is_none")]
    pub data: Option<std::collections::HashMap<String, String>>,
    #[serde(rename = "fcmOptions", skip_serializing_if = "Option::is_none")]
    pub fcm_options: Option<Box<models::WebpushFcmOptions>>,
    /// HTTP headers defined in webpush protocol. Refer to [Webpush protocol](https://tools.ietf.org/html/rfc8030#section-5) for supported headers, e.g. \"TTL\": \"15\".
    #[serde(rename = "headers", skip_serializing_if = "Option::is_none")]
    pub headers: Option<std::collections::HashMap<String, String>>,
    /// Web Notification options as a JSON object. Supports Notification instance properties as defined in [Web Notification API](https://developer.mozilla.org/en-US/docs/Web/API/Notification). If present, \"title\" and \"body\" fields override [google.firebase.fcm.v1.Notification.title] and [google.firebase.fcm.v1.Notification.body].
    #[serde(rename = "notification", skip_serializing_if = "Option::is_none")]
    pub notification: Option<std::collections::HashMap<String, serde_json::Value>>,
}

impl WebpushConfig {
    /// [Webpush protocol](https://tools.ietf.org/html/rfc8030) options.
    pub fn new() -> WebpushConfig {
        WebpushConfig {
            data: None,
            fcm_options: None,
            headers: None,
            notification: None,
        }
    }
}
