/*
* 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.240.1
* 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 UpdateConversionActionRequest {
/// Zernio SocialAccount id (Google Ads)
#[serde(rename = "accountId")]
pub account_id: String,
/// Google customer id. Required when the connection has multiple customers.
#[serde(rename = "adAccountId", skip_serializing_if = "Option::is_none")]
pub ad_account_id: Option<String>,
/// Alias of adAccountId
#[serde(rename = "customerId", skip_serializing_if = "Option::is_none")]
pub customer_id: Option<String>,
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// REMOVED removes the action and must be sent alone; ENABLED restores a removed one.
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<Status>,
#[serde(rename = "defaultValue", skip_serializing_if = "Option::is_none")]
pub default_value: Option<f64>,
#[serde(
rename = "alwaysUseDefaultValue",
skip_serializing_if = "Option::is_none"
)]
pub always_use_default_value: Option<bool>,
/// conversion_action.category. Defaults to DEFAULT on create.
#[serde(rename = "category", skip_serializing_if = "Option::is_none")]
pub category: Option<Category>,
/// ONE_PER_CLICK counts one conversion per ad click (leads); MANY_PER_CLICK counts every one (purchases).
#[serde(rename = "countingType", skip_serializing_if = "Option::is_none")]
pub counting_type: Option<CountingType>,
/// ISO 4217 currency of defaultValue (value_settings.default_currency_code).
#[serde(rename = "defaultCurrency", skip_serializing_if = "Option::is_none")]
pub default_currency: Option<String>,
/// Days after an ad click a conversion still counts.
#[serde(
rename = "clickThroughLookbackWindowDays",
skip_serializing_if = "Option::is_none"
)]
pub click_through_lookback_window_days: Option<i32>,
/// Days after an ad view a view-through conversion still counts.
#[serde(
rename = "viewThroughLookbackWindowDays",
skip_serializing_if = "Option::is_none"
)]
pub view_through_lookback_window_days: Option<i32>,
/// true = primary (counts toward bidding when its goal is biddable), false = secondary.
#[serde(rename = "primaryForGoal", skip_serializing_if = "Option::is_none")]
pub primary_for_goal: Option<bool>,
}
impl UpdateConversionActionRequest {
pub fn new(account_id: String) -> UpdateConversionActionRequest {
UpdateConversionActionRequest {
account_id,
ad_account_id: None,
customer_id: None,
name: None,
status: None,
default_value: None,
always_use_default_value: None,
category: None,
counting_type: None,
default_currency: None,
click_through_lookback_window_days: None,
view_through_lookback_window_days: None,
primary_for_goal: None,
}
}
}
/// REMOVED removes the action and must be sent alone; ENABLED restores a removed one.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
#[serde(rename = "ENABLED")]
Enabled,
#[serde(rename = "REMOVED")]
Removed,
}
impl Default for Status {
fn default() -> Status {
Self::Enabled
}
}
/// conversion_action.category. Defaults to DEFAULT on create.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Category {
#[serde(rename = "DEFAULT")]
Default,
#[serde(rename = "PAGE_VIEW")]
PageView,
#[serde(rename = "PURCHASE")]
Purchase,
#[serde(rename = "SIGNUP")]
Signup,
#[serde(rename = "DOWNLOAD")]
Download,
#[serde(rename = "ADD_TO_CART")]
AddToCart,
#[serde(rename = "BEGIN_CHECKOUT")]
BeginCheckout,
#[serde(rename = "SUBSCRIBE_PAID")]
SubscribePaid,
#[serde(rename = "PHONE_CALL_LEAD")]
PhoneCallLead,
#[serde(rename = "IMPORTED_LEAD")]
ImportedLead,
#[serde(rename = "SUBMIT_LEAD_FORM")]
SubmitLeadForm,
#[serde(rename = "BOOK_APPOINTMENT")]
BookAppointment,
#[serde(rename = "REQUEST_QUOTE")]
RequestQuote,
#[serde(rename = "GET_DIRECTIONS")]
GetDirections,
#[serde(rename = "OUTBOUND_CLICK")]
OutboundClick,
#[serde(rename = "CONTACT")]
Contact,
#[serde(rename = "ENGAGEMENT")]
Engagement,
#[serde(rename = "STORE_VISIT")]
StoreVisit,
#[serde(rename = "STORE_SALE")]
StoreSale,
#[serde(rename = "QUALIFIED_LEAD")]
QualifiedLead,
#[serde(rename = "CONVERTED_LEAD")]
ConvertedLead,
}
impl Default for Category {
fn default() -> Category {
Self::Default
}
}
/// ONE_PER_CLICK counts one conversion per ad click (leads); MANY_PER_CLICK counts every one (purchases).
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum CountingType {
#[serde(rename = "ONE_PER_CLICK")]
OnePerClick,
#[serde(rename = "MANY_PER_CLICK")]
ManyPerClick,
}
impl Default for CountingType {
fn default() -> CountingType {
Self::OnePerClick
}
}