/*
* Zernio API
*
* API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema). Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
*
* The version of the OpenAPI document: 1.624.0
* 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 (Meta, Pinterest, Reddit, OpenAI, Google Ads).
#[serde(rename = "ipAddress", skip_serializing_if = "Option::is_none")]
pub ip_address: Option<String>,
/// Client user-agent string. Sent plaintext (Meta, Pinterest, Reddit, OpenAI, Google Ads).
#[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>,
/// Postal code. Meta advanced matching (zp; US uses first 5 digits; hashed server-side). Google Ads sends it plain in an address identifier with firstName, lastName and country, only when all four are present.
#[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>,
/// Meta lead ID from a Lead Ad submission, as a string. Required for Conversion Leads CRM events: send it with `actionSource: 'crm'` and `platformData: { event_source: 'crm', lead_event_source: '<CRM name>' }`. Forwarded unhashed to Meta's `user_data.lead_id`. Meta only.
#[serde(rename = "leadId", skip_serializing_if = "Option::is_none")]
pub lead_id: Option<String>,
/// The Zernio tag's visitor id, from the `_zid` cookie the tag sets on your site. Zernio adds the click ids and browser ids of that visit that the event lacks, before storing and forwarding it. Without it, Zernio finds the visit by the `email`, `phone` or `externalId` the tag saw. Ids you send always win. Never sent to a platform. Read only by `POST /v1/events`, for a profile with a tracking site.
#[serde(rename = "visitorId", skip_serializing_if = "Option::is_none")]
pub visitor_id: 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,
lead_id: None,
visitor_id: None,
click_ids: None,
}
}
}