late 0.0.1372

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.
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).  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.572.0
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebhookPayloadConversionConversion {
    #[serde(rename = "eventId")]
    pub event_id: String,
    #[serde(rename = "eventName")]
    pub event_name: String,
    #[serde(rename = "eventTime")]
    pub event_time: String,
    #[serde(rename = "receivedAt")]
    pub received_at: String,
    /// Who sent it: `api`, `relay`, a lead form (`meta_leads`, `google_leads`, `linkedin_leads`, `tiktok_leads`), a store (`shopify`, `woocommerce`), `stripe` or `hubspot`.
    #[serde(rename = "source")]
    pub source: String,
    #[serde(
        rename = "actionSource",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub action_source: Option<Option<String>>,
    #[serde(
        rename = "value",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub value: Option<Option<f64>>,
    #[serde(
        rename = "currency",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub currency: Option<Option<String>>,
    /// Origin, path and attribution parameters only.
    #[serde(
        rename = "sourceUrl",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub source_url: Option<Option<String>>,
    #[serde(rename = "utm", skip_serializing_if = "Option::is_none")]
    pub utm: Option<Box<models::StoredEventUtm>>,
    #[serde(
        rename = "zrn",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub zrn: Option<Option<String>>,
    #[serde(rename = "clickIds", skip_serializing_if = "Option::is_none")]
    pub click_ids: Option<Box<models::StoredEventClickIds>>,
    #[serde(rename = "destinationsSent", skip_serializing_if = "Option::is_none")]
    pub destinations_sent: Option<i32>,
    #[serde(rename = "hasEmail", skip_serializing_if = "Option::is_none")]
    pub has_email: Option<bool>,
    #[serde(rename = "hasPhone", skip_serializing_if = "Option::is_none")]
    pub has_phone: Option<bool>,
    #[serde(rename = "hasExternalId", skip_serializing_if = "Option::is_none")]
    pub has_external_id: Option<bool>,
    #[serde(rename = "campaign")]
    pub campaign: Box<models::WebhookPayloadConversionConversionCampaign>,
    /// `matched`, or why there is no campaign: `no_hint`, `no_campaign`, `ambiguous`, `not_counted` or `match_failed`.
    #[serde(rename = "campaignMatch")]
    pub campaign_match: String,
}

impl WebhookPayloadConversionConversion {
    pub fn new(
        event_id: String,
        event_name: String,
        event_time: String,
        received_at: String,
        source: String,
        campaign: models::WebhookPayloadConversionConversionCampaign,
        campaign_match: String,
    ) -> WebhookPayloadConversionConversion {
        WebhookPayloadConversionConversion {
            event_id,
            event_name,
            event_time,
            received_at,
            source,
            action_source: None,
            value: None,
            currency: None,
            source_url: None,
            utm: None,
            zrn: None,
            click_ids: None,
            destinations_sent: None,
            has_email: None,
            has_phone: None,
            has_external_id: None,
            campaign: Box::new(campaign),
            campaign_match,
        }
    }
}