late 0.0.1389

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.
Documentation
/*
 * 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.610.0
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// AutomationSubjects : What an ad rule checks, and where.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AutomationSubjects {
    /// The objects judged one by one.
    #[serde(rename = "each")]
    pub each: Each,
    /// The ad account to check. One per ad rule, and an edit cannot move it to another.
    #[serde(rename = "adAccounts")]
    pub ad_accounts: Vec<models::AutomationSubjectsAdAccountsInner>,
    /// Only these platform campaigns or their ad sets and ads. Leave out to check the whole ad account.
    #[serde(rename = "campaignIds", skip_serializing_if = "Option::is_none")]
    pub campaign_ids: Option<Vec<String>>,
    /// All must hold.
    #[serde(rename = "filters", skip_serializing_if = "Option::is_none")]
    pub filters: Option<Vec<models::AutomationAdFilter>>,
    /// Judges campaigns together (campaign rules only): each group's numbers are summed and its rates computed on the totals, and a matching group acts on each of its campaigns.  A group with no filters holds every campaign the rule checks. `reach` and `frequency` cannot be used with groups.
    #[serde(rename = "groups", skip_serializing_if = "Option::is_none")]
    pub groups: Option<Vec<models::AutomationSubjectsGroupsInner>>,
}

impl AutomationSubjects {
    /// What an ad rule checks, and where.
    pub fn new(
        each: Each,
        ad_accounts: Vec<models::AutomationSubjectsAdAccountsInner>,
    ) -> AutomationSubjects {
        AutomationSubjects {
            each,
            ad_accounts,
            campaign_ids: None,
            filters: None,
            groups: None,
        }
    }
}
/// The objects judged one by one.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Each {
    #[serde(rename = "campaign")]
    Campaign,
    #[serde(rename = "adset")]
    Adset,
    #[serde(rename = "ad")]
    Ad,
}

impl Default for Each {
    fn default() -> Each {
        Self::Campaign
    }
}