fastcomments-sdk 3.0.0

Official FastComments Rust SDK (Typed API Client & Utilities)
Documentation
/*
 * fastcomments
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 0.0.0
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::client::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct HeaderAccountNotification {
    #[serde(rename = "_id")]
    pub _id: String,
    #[serde(rename = "title")]
    pub title: String,
    #[serde(rename = "message")]
    pub message: String,
    /// Construct a type with a set of properties K of type T
    #[serde(rename = "messagesByLocale", deserialize_with = "Option::deserialize")]
    pub messages_by_locale: Option<std::collections::HashMap<String, String>>,
    /// Construct a type with a set of properties K of type T
    #[serde(rename = "dates", deserialize_with = "Option::deserialize")]
    pub dates: Option<std::collections::HashMap<String, String>>,
    #[serde(rename = "severity")]
    pub severity: String,
    #[serde(rename = "linkUrl", deserialize_with = "Option::deserialize")]
    pub link_url: Option<String>,
    #[serde(rename = "linkText", deserialize_with = "Option::deserialize")]
    pub link_text: Option<String>,
    #[serde(rename = "createdAt")]
    pub created_at: chrono::DateTime<chrono::FixedOffset>,
    /// Discriminator for notifications with a special layout/click handler (e.g. \"feedback-offer\").
    #[serde(rename = "type", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<Option<String>>,
}

impl HeaderAccountNotification {
    pub fn new(_id: String, title: String, message: String, messages_by_locale: Option<std::collections::HashMap<String, String>>, dates: Option<std::collections::HashMap<String, String>>, severity: String, link_url: Option<String>, link_text: Option<String>, created_at: chrono::DateTime<chrono::FixedOffset>) -> HeaderAccountNotification {
        HeaderAccountNotification {
            _id,
            title,
            message,
            messages_by_locale,
            dates,
            severity,
            link_url,
            link_text,
            created_at,
            r#type: None,
        }
    }
}