/*
* 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.22.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 CreateConversionActionRequest {
/// SocialAccount ID. Must be a `googleads` account.
#[serde(rename = "accountId")]
pub account_id: String,
/// Google Ads customer id (digits only). Resolved automatically when the connection has exactly one accessible customer.
#[serde(rename = "customerId", skip_serializing_if = "Option::is_none")]
pub customer_id: Option<String>,
#[serde(rename = "name")]
pub name: String,
/// Only WEBPAGE is supported for creation today.
#[serde(rename = "type")]
pub r#type: Type,
/// Default conversion value used when an event doesn't carry its own value.
#[serde(rename = "defaultValue", skip_serializing_if = "Option::is_none")]
pub default_value: Option<f64>,
/// When true, always use defaultValue and ignore any value sent with the event. Defaults to true when defaultValue is set.
#[serde(
rename = "alwaysUseDefaultValue",
skip_serializing_if = "Option::is_none"
)]
pub always_use_default_value: Option<bool>,
}
impl CreateConversionActionRequest {
pub fn new(account_id: String, name: String, r#type: Type) -> CreateConversionActionRequest {
CreateConversionActionRequest {
account_id,
customer_id: None,
name,
r#type,
default_value: None,
always_use_default_value: None,
}
}
}
/// Only WEBPAGE is supported for creation today.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "WEBPAGE")]
Webpage,
}
impl Default for Type {
fn default() -> Type {
Self::Webpage
}
}