/*
 * 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};

/// UpdateTrackingTagRequest : At least one field is required; the route returns 400 if the body is empty.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct UpdateTrackingTagRequest {
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Meta Advanced Matching toggle (`enable_automatic_matching`).
    #[serde(
        rename = "enableAutomaticMatching",
        skip_serializing_if = "Option::is_none"
    )]
    pub enable_automatic_matching: Option<bool>,
    /// Which user fields Advanced Matching may collect. Meta's terse codes: em=email, ph=phone, fn=first name, ln=last name, ge=gender, db=date of birth, ct=city, st=state, zp=zip.
    #[serde(
        rename = "automaticMatchingFields",
        skip_serializing_if = "Option::is_none"
    )]
    pub automatic_matching_fields: Option<Vec<AutomaticMatchingFields>>,
    #[serde(
        rename = "firstPartyCookieStatus",
        skip_serializing_if = "Option::is_none"
    )]
    pub first_party_cookie_status: Option<FirstPartyCookieStatus>,
    #[serde(rename = "dataUseSetting", skip_serializing_if = "Option::is_none")]
    pub data_use_setting: Option<DataUseSetting>,
}

impl UpdateTrackingTagRequest {
    /// At least one field is required; the route returns 400 if the body is empty.
    pub fn new() -> UpdateTrackingTagRequest {
        UpdateTrackingTagRequest {
            name: None,
            enable_automatic_matching: None,
            automatic_matching_fields: None,
            first_party_cookie_status: None,
            data_use_setting: None,
        }
    }
}
/// Which user fields Advanced Matching may collect. Meta's terse codes: em=email, ph=phone, fn=first name, ln=last name, ge=gender, db=date of birth, ct=city, st=state, zp=zip.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum AutomaticMatchingFields {
    #[serde(rename = "em")]
    Em,
    #[serde(rename = "ph")]
    Ph,
    #[serde(rename = "fn")]
    Fn,
    #[serde(rename = "ln")]
    Ln,
    #[serde(rename = "ge")]
    Ge,
    #[serde(rename = "db")]
    Db,
    #[serde(rename = "ct")]
    Ct,
    #[serde(rename = "st")]
    St,
    #[serde(rename = "zp")]
    Zp,
    #[serde(rename = "country")]
    Country,
    #[serde(rename = "external_id")]
    ExternalId,
}

impl Default for AutomaticMatchingFields {
    fn default() -> AutomaticMatchingFields {
        Self::Em
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum FirstPartyCookieStatus {
    #[serde(rename = "empty")]
    Empty,
    #[serde(rename = "first_party_cookie_disabled")]
    FirstPartyCookieDisabled,
    #[serde(rename = "first_party_cookie_enabled")]
    FirstPartyCookieEnabled,
}

impl Default for FirstPartyCookieStatus {
    fn default() -> FirstPartyCookieStatus {
        Self::Empty
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum DataUseSetting {
    #[serde(rename = "advertising_and_analytics")]
    AdvertisingAndAnalytics,
    #[serde(rename = "analytics_only")]
    AnalyticsOnly,
    #[serde(rename = "empty")]
    Empty,
}

impl Default for DataUseSetting {
    fn default() -> DataUseSetting {
        Self::AdvertisingAndAnalytics
    }
}
