late 0.0.936

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

/// GetInboxConversation200ResponseDataMetadata : Ad-click attribution for a conversation that started from a Meta ad. Absent when the conversation did not originate from an ad click.  Captured once, on the first inbound message after the click, and never overwritten. If the same person later clicks a different ad, the original values are kept. Meta only sends the referral on that first message.  This operation currently returns only the `meta_ad_*` family, which covers Instagram Click-to-Direct and Facebook Messenger Click-to-Message. WhatsApp Click-to-WhatsApp attribution (the `ctwa_*` keys, where the ad ID is `ctwa_source_id`) is returned by `GET /v1/inbox/conversations` instead.  Every key is optional and only the keys Meta supplied are returned, so read defensively. Meta does not send a campaign or ad set ID, so none is exposed here. More keys may be added over time. Treat any key you do not recognise as an opaque string.  Key names differ from the `message.received` webhook on purpose. The webhook forwards Meta's referral verbatim (`ad_id`, `source`, `type`) while the stored conversation record uses the prefixed names below. Renaming either side would break existing integrations, so both spellings are kept.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetInboxConversation200ResponseDataMetadata {
    /// The Meta ad ID the user clicked. Always present when a referral was captured.
    #[serde(rename = "meta_ad_id", skip_serializing_if = "Option::is_none")]
    pub meta_ad_id: Option<String>,
    /// Meta-supplied source identifier, for example ADS.
    #[serde(rename = "meta_ad_source", skip_serializing_if = "Option::is_none")]
    pub meta_ad_source: Option<String>,
    /// Meta-supplied referral type, for example OPEN_THREAD.
    #[serde(rename = "meta_ad_type", skip_serializing_if = "Option::is_none")]
    pub meta_ad_type: Option<String>,
    /// The ref parameter passed through from the ad creative.
    #[serde(rename = "meta_ad_ref", skip_serializing_if = "Option::is_none")]
    pub meta_ad_ref: Option<String>,
    /// Title of the ad creative at click time.
    #[serde(rename = "meta_ad_title", skip_serializing_if = "Option::is_none")]
    pub meta_ad_title: Option<String>,
    /// Image of the ad creative at click time.
    #[serde(rename = "meta_ad_photo_url", skip_serializing_if = "Option::is_none")]
    pub meta_ad_photo_url: Option<String>,
    /// Video of the ad creative at click time.
    #[serde(rename = "meta_ad_video_url", skip_serializing_if = "Option::is_none")]
    pub meta_ad_video_url: Option<String>,
    /// The organic post the ad promoted, when the ad was a boosted post.
    #[serde(rename = "meta_ad_post_id", skip_serializing_if = "Option::is_none")]
    pub meta_ad_post_id: Option<String>,
    /// The catalogue product the user clicked, for product ads.
    #[serde(rename = "meta_ad_product_id", skip_serializing_if = "Option::is_none")]
    pub meta_ad_product_id: Option<String>,
    /// The Meta flow the ad launched, for flow ads.
    #[serde(rename = "meta_ad_flow_id", skip_serializing_if = "Option::is_none")]
    pub meta_ad_flow_id: Option<String>,
    /// When Zernio stored this referral. Always present when a referral was captured.
    #[serde(
        rename = "meta_ad_captured_at",
        skip_serializing_if = "Option::is_none"
    )]
    pub meta_ad_captured_at: Option<String>,
}

impl GetInboxConversation200ResponseDataMetadata {
    /// Ad-click attribution for a conversation that started from a Meta ad. Absent when the conversation did not originate from an ad click.  Captured once, on the first inbound message after the click, and never overwritten. If the same person later clicks a different ad, the original values are kept. Meta only sends the referral on that first message.  This operation currently returns only the `meta_ad_*` family, which covers Instagram Click-to-Direct and Facebook Messenger Click-to-Message. WhatsApp Click-to-WhatsApp attribution (the `ctwa_*` keys, where the ad ID is `ctwa_source_id`) is returned by `GET /v1/inbox/conversations` instead.  Every key is optional and only the keys Meta supplied are returned, so read defensively. Meta does not send a campaign or ad set ID, so none is exposed here. More keys may be added over time. Treat any key you do not recognise as an opaque string.  Key names differ from the `message.received` webhook on purpose. The webhook forwards Meta's referral verbatim (`ad_id`, `source`, `type`) while the stored conversation record uses the prefixed names below. Renaming either side would break existing integrations, so both spellings are kept.
    pub fn new() -> GetInboxConversation200ResponseDataMetadata {
        GetInboxConversation200ResponseDataMetadata {
            meta_ad_id: None,
            meta_ad_source: None,
            meta_ad_type: None,
            meta_ad_ref: None,
            meta_ad_title: None,
            meta_ad_photo_url: None,
            meta_ad_video_url: None,
            meta_ad_post_id: None,
            meta_ad_product_id: None,
            meta_ad_flow_id: None,
            meta_ad_captured_at: None,
        }
    }
}