late 0.0.1046

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

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

/// CreateStandaloneAdRequestPlacements : Meta only. Manual ad placements. Omit for automatic placements (Meta's default, recommended for most cases, since Meta optimises delivery across all eligible surfaces). When set, restricts delivery to the chosen surfaces, mapped onto the ad set's `targeting.{publisher_platforms, facebook_positions, instagram_positions, messenger_positions, audience_network_positions, threads_positions, whatsapp_positions, device_platforms}`. Enum membership is validated here; Meta additionally enforces co-selection rules (e.g. some positions require their parent publisher platform) and returns an actionable error which we surface. Non-Meta platforms reject this field.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateStandaloneAdRequestPlacements {
    /// Top-level platforms to deliver on. A position field below is only honoured when its parent platform is included here.
    #[serde(rename = "publisherPlatforms", skip_serializing_if = "Option::is_none")]
    pub publisher_platforms: Option<Vec<PublisherPlatforms>>,
    #[serde(rename = "facebookPositions", skip_serializing_if = "Option::is_none")]
    pub facebook_positions: Option<Vec<FacebookPositions>>,
    #[serde(rename = "instagramPositions", skip_serializing_if = "Option::is_none")]
    pub instagram_positions: Option<Vec<InstagramPositions>>,
    #[serde(rename = "messengerPositions", skip_serializing_if = "Option::is_none")]
    pub messenger_positions: Option<Vec<MessengerPositions>>,
    #[serde(
        rename = "audienceNetworkPositions",
        skip_serializing_if = "Option::is_none"
    )]
    pub audience_network_positions: Option<Vec<AudienceNetworkPositions>>,
    #[serde(rename = "threadsPositions", skip_serializing_if = "Option::is_none")]
    pub threads_positions: Option<Vec<ThreadsPositions>>,
    #[serde(rename = "whatsappPositions", skip_serializing_if = "Option::is_none")]
    pub whatsapp_positions: Option<Vec<WhatsappPositions>>,
    /// Restrict by device. Omit to deliver on both mobile and desktop.
    #[serde(rename = "devicePlatforms", skip_serializing_if = "Option::is_none")]
    pub device_platforms: Option<Vec<DevicePlatforms>>,
}

impl CreateStandaloneAdRequestPlacements {
    /// Meta only. Manual ad placements. Omit for automatic placements (Meta's default, recommended for most cases, since Meta optimises delivery across all eligible surfaces). When set, restricts delivery to the chosen surfaces, mapped onto the ad set's `targeting.{publisher_platforms, facebook_positions, instagram_positions, messenger_positions, audience_network_positions, threads_positions, whatsapp_positions, device_platforms}`. Enum membership is validated here; Meta additionally enforces co-selection rules (e.g. some positions require their parent publisher platform) and returns an actionable error which we surface. Non-Meta platforms reject this field.
    pub fn new() -> CreateStandaloneAdRequestPlacements {
        CreateStandaloneAdRequestPlacements {
            publisher_platforms: None,
            facebook_positions: None,
            instagram_positions: None,
            messenger_positions: None,
            audience_network_positions: None,
            threads_positions: None,
            whatsapp_positions: None,
            device_platforms: None,
        }
    }
}
/// Top-level platforms to deliver on. A position field below is only honoured when its parent platform is included here.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum PublisherPlatforms {
    #[serde(rename = "facebook")]
    Facebook,
    #[serde(rename = "instagram")]
    Instagram,
    #[serde(rename = "threads")]
    Threads,
    #[serde(rename = "messenger")]
    Messenger,
    #[serde(rename = "audience_network")]
    AudienceNetwork,
    #[serde(rename = "whatsapp")]
    Whatsapp,
}

impl Default for PublisherPlatforms {
    fn default() -> PublisherPlatforms {
        Self::Facebook
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum FacebookPositions {
    #[serde(rename = "feed")]
    Feed,
    #[serde(rename = "right_hand_column")]
    RightHandColumn,
    #[serde(rename = "marketplace")]
    Marketplace,
    #[serde(rename = "video_feeds")]
    VideoFeeds,
    #[serde(rename = "story")]
    Story,
    #[serde(rename = "search")]
    Search,
    #[serde(rename = "instream_video")]
    InstreamVideo,
    #[serde(rename = "facebook_reels")]
    FacebookReels,
    #[serde(rename = "facebook_reels_overlay")]
    FacebookReelsOverlay,
    #[serde(rename = "profile_feed")]
    ProfileFeed,
    #[serde(rename = "notification")]
    Notification,
}

impl Default for FacebookPositions {
    fn default() -> FacebookPositions {
        Self::Feed
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum InstagramPositions {
    #[serde(rename = "stream")]
    Stream,
    #[serde(rename = "story")]
    Story,
    #[serde(rename = "explore")]
    Explore,
    #[serde(rename = "explore_home")]
    ExploreHome,
    #[serde(rename = "reels")]
    Reels,
    #[serde(rename = "profile_feed")]
    ProfileFeed,
    #[serde(rename = "ig_search")]
    IgSearch,
    #[serde(rename = "profile_reels")]
    ProfileReels,
}

impl Default for InstagramPositions {
    fn default() -> InstagramPositions {
        Self::Stream
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum MessengerPositions {
    #[serde(rename = "messenger_home")]
    MessengerHome,
    #[serde(rename = "sponsored_messages")]
    SponsoredMessages,
    #[serde(rename = "story")]
    Story,
}

impl Default for MessengerPositions {
    fn default() -> MessengerPositions {
        Self::MessengerHome
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum AudienceNetworkPositions {
    #[serde(rename = "classic")]
    Classic,
    #[serde(rename = "rewarded_video")]
    RewardedVideo,
}

impl Default for AudienceNetworkPositions {
    fn default() -> AudienceNetworkPositions {
        Self::Classic
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ThreadsPositions {
    #[serde(rename = "threads_stream")]
    ThreadsStream,
}

impl Default for ThreadsPositions {
    fn default() -> ThreadsPositions {
        Self::ThreadsStream
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum WhatsappPositions {
    #[serde(rename = "status")]
    Status,
}

impl Default for WhatsappPositions {
    fn default() -> WhatsappPositions {
        Self::Status
    }
}
/// Restrict by device. Omit to deliver on both mobile and desktop.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum DevicePlatforms {
    #[serde(rename = "mobile")]
    Mobile,
    #[serde(rename = "desktop")]
    Desktop,
}

impl Default for DevicePlatforms {
    fn default() -> DevicePlatforms {
        Self::Mobile
    }
}