enbbox 1.0.1

Notification infrastructure API — open-source alternative to Novu/Courier
Documentation
/*
 * enbbox API
 *
 * Notification infrastructure API — open-source alternative to Novu/Courier
 *
 * The version of the OpenAPI document: 1.0.0
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// UpdateSubscriber : Partial update of an existing subscriber's profile. Only provided fields are updated.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct UpdateSubscriber {
    /// Updated avatar URL.
    #[serde(rename = "avatar", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub avatar: Option<Option<String>>,
    /// Updated metadata (replaces existing data).
    #[serde(rename = "data")]
    pub data: serde_json::Value,
    /// Updated email address.
    #[serde(rename = "email", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub email: Option<Option<String>>,
    /// Updated first name.
    #[serde(rename = "first_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub first_name: Option<Option<String>>,
    /// Updated last name.
    #[serde(rename = "last_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub last_name: Option<Option<String>>,
    /// Updated locale tag.
    #[serde(rename = "locale", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub locale: Option<Option<String>>,
    /// Updated phone number in E.164 format.
    #[serde(rename = "phone", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub phone: Option<Option<String>>,
    /// Updated timezone.
    #[serde(rename = "timezone", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub timezone: Option<Option<String>>,
}

impl UpdateSubscriber {
    /// Partial update of an existing subscriber's profile. Only provided fields are updated.
    pub fn new(data: serde_json::Value) -> UpdateSubscriber {
        UpdateSubscriber {
            avatar: None,
            data,
            email: None,
            first_name: None,
            last_name: None,
            locale: None,
            phone: None,
            timezone: None,
        }
    }
}