/*
* 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.168.0
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// MetaCustomerLifecycle : Meta's Customer Lifecycle Strategy on a Sales ad set (Meta `ad_set_goal`). Rejected with 400 in adSetId attach mode: use PUT /v1/ads/ad-sets/{adSetId} for an ad set that already exists. Read it back with `GET /v1/ads/ad-sets/{adSetId}?fields=ad_set_goal` (type 0 all customers, 1 new excluding engaged, 2 new customers).
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct MetaCustomerLifecycle {
/// `all_customers` is \"Maximize conversions from all customers\". `new_customers` is \"Acquire new customers\" (excludes existing customers). `new_customers_excluding_engaged` also excludes people who engaged with you but have not bought yet.
#[serde(rename = "strategy")]
pub strategy: Strategy,
/// Custom audience ids that define your existing customers. Required with both new_customers strategies (Meta answers 400 subcode 1870251 without them); not allowed with all_customers.
#[serde(
rename = "existingCustomerAudienceIds",
skip_serializing_if = "Option::is_none"
)]
pub existing_customer_audience_ids: Option<Vec<String>>,
/// Custom audience ids of people who engaged but have not bought. Required with new_customers_excluding_engaged, not allowed with the other strategies.
#[serde(rename = "engagedAudienceIds", skip_serializing_if = "Option::is_none")]
pub engaged_audience_ids: Option<Vec<String>>,
}
impl MetaCustomerLifecycle {
/// Meta's Customer Lifecycle Strategy on a Sales ad set (Meta `ad_set_goal`). Rejected with 400 in adSetId attach mode: use PUT /v1/ads/ad-sets/{adSetId} for an ad set that already exists. Read it back with `GET /v1/ads/ad-sets/{adSetId}?fields=ad_set_goal` (type 0 all customers, 1 new excluding engaged, 2 new customers).
pub fn new(strategy: Strategy) -> MetaCustomerLifecycle {
MetaCustomerLifecycle {
strategy,
existing_customer_audience_ids: None,
engaged_audience_ids: None,
}
}
}
/// `all_customers` is \"Maximize conversions from all customers\". `new_customers` is \"Acquire new customers\" (excludes existing customers). `new_customers_excluding_engaged` also excludes people who engaged with you but have not bought yet.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Strategy {
#[serde(rename = "all_customers")]
AllCustomers,
#[serde(rename = "new_customers")]
NewCustomers,
#[serde(rename = "new_customers_excluding_engaged")]
NewCustomersExcludingEngaged,
}
impl Default for Strategy {
fn default() -> Strategy {
Self::AllCustomers
}
}