/*
* 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.104.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 AdjustConversionsRequestAdjustmentsInner {
#[serde(rename = "adjustmentType")]
pub adjustment_type: AdjustmentType,
/// When the adjustment occurred, unix seconds.
#[serde(rename = "adjustmentTime")]
pub adjustment_time: f64,
/// Transaction ID of the original conversion (the `eventId` you sent). Recommended; required for ENHANCEMENT.
#[serde(rename = "orderId", skip_serializing_if = "Option::is_none")]
pub order_id: Option<String>,
/// Alternative key. The original click ID. Pair with `conversionTime`. Not valid for ENHANCEMENT.
#[serde(rename = "gclid", skip_serializing_if = "Option::is_none")]
pub gclid: Option<String>,
/// The original conversion's time, unix seconds. Required when identifying by `gclid`.
#[serde(rename = "conversionTime", skip_serializing_if = "Option::is_none")]
pub conversion_time: Option<f64>,
/// RESTATEMENT only. The corrected TOTAL conversion value.
#[serde(rename = "restatementValue", skip_serializing_if = "Option::is_none")]
pub restatement_value: Option<f64>,
/// RESTATEMENT only. ISO 4217 currency for `restatementValue`.
#[serde(rename = "currency", skip_serializing_if = "Option::is_none")]
pub currency: Option<String>,
#[serde(rename = "user", skip_serializing_if = "Option::is_none")]
pub user: Option<Box<models::AdjustConversionsRequestAdjustmentsInnerUser>>,
/// ENHANCEMENT only. The original conversion's user agent (improves match quality).
#[serde(rename = "userAgent", skip_serializing_if = "Option::is_none")]
pub user_agent: Option<String>,
}
impl AdjustConversionsRequestAdjustmentsInner {
pub fn new(
adjustment_type: AdjustmentType,
adjustment_time: f64,
) -> AdjustConversionsRequestAdjustmentsInner {
AdjustConversionsRequestAdjustmentsInner {
adjustment_type,
adjustment_time,
order_id: None,
gclid: None,
conversion_time: None,
restatement_value: None,
currency: None,
user: None,
user_agent: None,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum AdjustmentType {
#[serde(rename = "RETRACTION")]
Retraction,
#[serde(rename = "RESTATEMENT")]
Restatement,
#[serde(rename = "ENHANCEMENT")]
Enhancement,
}
impl Default for AdjustmentType {
fn default() -> AdjustmentType {
Self::Retraction
}
}