/*
* 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.96.1
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// BoostPostRequestPromotedObject : Meta and TikTok. What the conversion ad set optimizes toward, so a boost of an existing organic post can run for a conversion instead of only engagement or traffic. Required when `goal` is `conversions` (Meta also `lead_conversion`); ignored on goals that do not optimize for a conversion. Meta: `pixelId` + `customEventType` (a commerce event such as PURCHASE under `conversions`, a leads-class event such as LEAD under `lead_conversion`), or `customConversionId` to optimize against a Custom Conversion, or `customEventType: OTHER` + `customEventStr` for a pixel custom event. Becomes the ad set `promoted_object`; without it Meta rejects the ad set (\"Please select a promoted object\", subcode 1815430). With `adSetId` the existing ad set already carries it. TikTok: BOTH `pixelId` and `customEventType` are required. TikTok refuses a conversion ad group with no pixel (\"Please select a pixel\") and one with a pixel but no event (\"Select a pixel event.\"). Combine freely with `platformPostId` + `sparkAuthCode`: the pixel lives on the ad group and the Spark item on the creative.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BoostPostRequestPromotedObject {
/// Meta Pixel id, or TikTok Pixel (numeric id or the alphanumeric pixel code from Events Manager, resolved for you).
#[serde(rename = "pixelId", skip_serializing_if = "Option::is_none")]
pub pixel_id: Option<String>,
/// Meta: standard pixel event (PURCHASE, LEAD, ...) or OTHER with customEventStr. TikTok: optimization_event code (e.g. ON_WEB_ORDER, SHOPPING, FORM) or the exact event name shown in Events Manager, resolved to its code; the event must already exist on that pixel.
#[serde(rename = "customEventType", skip_serializing_if = "Option::is_none")]
pub custom_event_type: Option<String>,
/// Meta only. Pixel custom event name as it appears in Events Manager; requires customEventType OTHER.
#[serde(rename = "customEventStr", skip_serializing_if = "Option::is_none")]
pub custom_event_str: Option<String>,
/// Meta only. Custom Conversion to optimize against, instead of pixelId + customEventType.
#[serde(rename = "customConversionId", skip_serializing_if = "Option::is_none")]
pub custom_conversion_id: Option<String>,
}
impl BoostPostRequestPromotedObject {
/// Meta and TikTok. What the conversion ad set optimizes toward, so a boost of an existing organic post can run for a conversion instead of only engagement or traffic. Required when `goal` is `conversions` (Meta also `lead_conversion`); ignored on goals that do not optimize for a conversion. Meta: `pixelId` + `customEventType` (a commerce event such as PURCHASE under `conversions`, a leads-class event such as LEAD under `lead_conversion`), or `customConversionId` to optimize against a Custom Conversion, or `customEventType: OTHER` + `customEventStr` for a pixel custom event. Becomes the ad set `promoted_object`; without it Meta rejects the ad set (\"Please select a promoted object\", subcode 1815430). With `adSetId` the existing ad set already carries it. TikTok: BOTH `pixelId` and `customEventType` are required. TikTok refuses a conversion ad group with no pixel (\"Please select a pixel\") and one with a pixel but no event (\"Select a pixel event.\"). Combine freely with `platformPostId` + `sparkAuthCode`: the pixel lives on the ad group and the Spark item on the creative.
pub fn new() -> BoostPostRequestPromotedObject {
BoostPostRequestPromotedObject {
pixel_id: None,
custom_event_type: None,
custom_event_str: None,
custom_conversion_id: None,
}
}
}