late 0.0.1001

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).
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).
 *
 * The version of the OpenAPI document: 1.43.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 UpdateAdRequest {
    /// Google Search and Display only. Replaces the complete headline list. Search takes 3-15, Display 1-5 and rejects pinnedField; the count is checked once the ad's channel is known. No padding or truncation on update.
    #[serde(rename = "headlines", skip_serializing_if = "Option::is_none")]
    pub headlines: Option<Vec<models::GoogleRsaHeadline>>,
    /// Google Search and Display only. Replaces the complete description list. Search takes 2-4, Display 1-5 and rejects pinnedField. No padding or truncation on update.
    #[serde(rename = "descriptions", skip_serializing_if = "Option::is_none")]
    pub descriptions: Option<Vec<models::GoogleRsaDescription>>,
    /// Google Search and Display only. Replaces final URLs. Omitted lists stay unchanged. For Performance Max use assetGroup.finalUrl.
    #[serde(rename = "finalUrls", skip_serializing_if = "Option::is_none")]
    pub final_urls: Option<Vec<String>>,
    /// Google Performance Max only. Replaces whole asset roles on the ad's asset group. Returns 422 on any other platform or channel.
    #[serde(rename = "assetGroup", skip_serializing_if = "Option::is_none")]
    pub asset_group: Option<Box<models::GooglePmaxAssetGroupUpdate>>,
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Status>,
    #[serde(rename = "budget", skip_serializing_if = "Option::is_none")]
    pub budget: Option<Box<models::UpdateAdRequestBudget>>,
    #[serde(rename = "targeting", skip_serializing_if = "Option::is_none")]
    pub targeting: Option<Box<models::UpdateAdRequestTargeting>>,
    #[serde(rename = "creative", skip_serializing_if = "Option::is_none")]
    pub creative: Option<Box<models::UpdateAdRequestCreative>>,
    /// Rename the ad. Now propagated to Meta (POST /{ad-id}); non-Meta platforms return 501.
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
}

impl UpdateAdRequest {
    pub fn new() -> UpdateAdRequest {
        UpdateAdRequest {
            headlines: None,
            descriptions: None,
            final_urls: None,
            asset_group: None,
            status: None,
            budget: None,
            targeting: None,
            creative: None,
            name: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "active")]
    Active,
    #[serde(rename = "paused")]
    Paused,
}

impl Default for Status {
    fn default() -> Status {
        Self::Active
    }
}