/*
 * Zernio API
 *
 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
 *
 * The version of the OpenAPI document: 1.0.4
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

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

/// ConversionEventUser : User identity fields. More signals mean higher match rates.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ConversionEventUser {
    /// Plaintext email. Hashed server-side.
    #[serde(rename = "email", skip_serializing_if = "Option::is_none")]
    pub email: Option<String>,
    /// Phone number, ideally E.164. Hashed server-side.
    #[serde(rename = "phone", skip_serializing_if = "Option::is_none")]
    pub phone: Option<String>,
    /// Plaintext first name. Hashed server-side.
    #[serde(rename = "firstName", skip_serializing_if = "Option::is_none")]
    pub first_name: Option<String>,
    /// Plaintext last name. Hashed server-side.
    #[serde(rename = "lastName", skip_serializing_if = "Option::is_none")]
    pub last_name: Option<String>,
    /// Stable customer identifier (e.g. CRM user ID). Hashed server-side for Meta and Google. Sent as plaintext to LinkedIn (LinkedIn's Conversions API spec requires the raw value). Maximum effective list size on LinkedIn is 1.
    #[serde(rename = "externalId", skip_serializing_if = "Option::is_none")]
    pub external_id: Option<String>,
    /// Client IP address. Sent plaintext.
    #[serde(rename = "ipAddress", skip_serializing_if = "Option::is_none")]
    pub ip_address: Option<String>,
    /// Client user-agent string. Sent plaintext.
    #[serde(rename = "userAgent", skip_serializing_if = "Option::is_none")]
    pub user_agent: Option<String>,
    /// ISO 3166-1 alpha-2 country code, e.g. 'us'.
    #[serde(rename = "country", skip_serializing_if = "Option::is_none")]
    pub country: Option<String>,
    /// Meta advanced matching (ct). Plaintext city; normalized + SHA-256 hashed server-side. Meta only.
    #[serde(rename = "city", skip_serializing_if = "Option::is_none")]
    pub city: Option<String>,
    /// Meta advanced matching (st). 2-letter ANSI for US; hashed server-side. Meta only.
    #[serde(rename = "state", skip_serializing_if = "Option::is_none")]
    pub state: Option<String>,
    /// Meta advanced matching (zp). US uses first 5 digits; hashed server-side. Meta only.
    #[serde(rename = "zip", skip_serializing_if = "Option::is_none")]
    pub zip: Option<String>,
    /// Meta advanced matching (db). YYYYMMDD; hashed server-side. Meta only.
    #[serde(rename = "dob", skip_serializing_if = "Option::is_none")]
    pub dob: Option<String>,
    /// Meta advanced matching (ge). 'f' or 'm'; hashed server-side. Meta only.
    #[serde(rename = "gender", skip_serializing_if = "Option::is_none")]
    pub gender: Option<String>,
    #[serde(rename = "clickIds", skip_serializing_if = "Option::is_none")]
    pub click_ids: Option<Box<models::ConversionEventUserClickIds>>,
}

impl ConversionEventUser {
    /// User identity fields. More signals mean higher match rates.
    pub fn new() -> ConversionEventUser {
        ConversionEventUser {
            email: None,
            phone: None,
            first_name: None,
            last_name: None,
            external_id: None,
            ip_address: None,
            user_agent: None,
            country: None,
            city: None,
            state: None,
            zip: None,
            dob: None,
            gender: None,
            click_ids: None,
        }
    }
}
