/*
* 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.66.0
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// UpdateConversionDestinationRequest : At least one mutable field beyond `adAccountId` is required; the route returns 400 if no patch fields are provided.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct UpdateConversionDestinationRequest {
#[serde(rename = "adAccountId")]
pub ad_account_id: String,
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// Setting `false` is equivalent to calling DELETE: the rule will appear as `inactive` afterwards.
#[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
pub enabled: Option<bool>,
#[serde(rename = "attributionType", skip_serializing_if = "Option::is_none")]
pub attribution_type: Option<AttributionType>,
/// 365 only allowed for LEAD, PURCHASE, ADD_TO_CART, QUALIFIED_LEAD, SUBMIT_APPLICATION rule types.
#[serde(
rename = "postClickAttributionWindowSize",
skip_serializing_if = "Option::is_none"
)]
pub post_click_attribution_window_size: Option<PostClickAttributionWindowSize>,
/// 365 only allowed for LEAD, PURCHASE, ADD_TO_CART, QUALIFIED_LEAD, SUBMIT_APPLICATION rule types.
#[serde(
rename = "viewThroughAttributionWindowSize",
skip_serializing_if = "Option::is_none"
)]
pub view_through_attribution_window_size: Option<ViewThroughAttributionWindowSize>,
#[serde(rename = "valueType", skip_serializing_if = "Option::is_none")]
pub value_type: Option<ValueType>,
#[serde(rename = "value", skip_serializing_if = "Option::is_none")]
pub value: Option<Box<models::UpdateConversionDestinationRequestValue>>,
}
impl UpdateConversionDestinationRequest {
/// At least one mutable field beyond `adAccountId` is required; the route returns 400 if no patch fields are provided.
pub fn new(ad_account_id: String) -> UpdateConversionDestinationRequest {
UpdateConversionDestinationRequest {
ad_account_id,
name: None,
enabled: None,
attribution_type: None,
post_click_attribution_window_size: None,
view_through_attribution_window_size: None,
value_type: None,
value: None,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum AttributionType {
#[serde(rename = "LAST_TOUCH_BY_CAMPAIGN")]
LastTouchByCampaign,
#[serde(rename = "LAST_TOUCH_BY_CONVERSION")]
LastTouchByConversion,
}
impl Default for AttributionType {
fn default() -> AttributionType {
Self::LastTouchByCampaign
}
}
/// 365 only allowed for LEAD, PURCHASE, ADD_TO_CART, QUALIFIED_LEAD, SUBMIT_APPLICATION rule types.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum PostClickAttributionWindowSize {
#[serde(rename = "1")]
Variant1,
#[serde(rename = "7")]
Variant7,
#[serde(rename = "30")]
Variant30,
#[serde(rename = "90")]
Variant90,
#[serde(rename = "365")]
Variant365,
}
impl Default for PostClickAttributionWindowSize {
fn default() -> PostClickAttributionWindowSize {
Self::Variant1
}
}
/// 365 only allowed for LEAD, PURCHASE, ADD_TO_CART, QUALIFIED_LEAD, SUBMIT_APPLICATION rule types.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ViewThroughAttributionWindowSize {
#[serde(rename = "1")]
Variant1,
#[serde(rename = "7")]
Variant7,
#[serde(rename = "30")]
Variant30,
#[serde(rename = "90")]
Variant90,
#[serde(rename = "365")]
Variant365,
}
impl Default for ViewThroughAttributionWindowSize {
fn default() -> ViewThroughAttributionWindowSize {
Self::Variant1
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ValueType {
#[serde(rename = "DYNAMIC")]
Dynamic,
#[serde(rename = "FIXED")]
Fixed,
#[serde(rename = "NO_VALUE")]
NoValue,
}
impl Default for ValueType {
fn default() -> ValueType {
Self::Dynamic
}
}