late 0.0.228

API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
Documentation
/*
 * Zernio API
 *
 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
 *
 * The version of the OpenAPI document: 1.0.1
 * 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 GetAdComments200ResponseMeta {
    #[serde(rename = "platform")]
    pub platform: Platform,
    /// Internal Zernio ad ID.
    #[serde(rename = "adId")]
    pub ad_id: String,
    /// Meta ad ID.
    #[serde(rename = "platformAdId")]
    pub platform_ad_id: String,
    /// Underlying post ID the comments belong to. effective_object_story_id for Facebook, effective_instagram_media_id for Instagram.
    #[serde(rename = "effectiveStoryId")]
    pub effective_story_id: String,
    /// Instagram-only. The Instagram-scoped business ID that owns the boosted media (creative.instagram_user_id).
    #[serde(rename = "instagramUserId", skip_serializing_if = "Option::is_none")]
    pub instagram_user_id: Option<String>,
    /// Instagram-only. Public permalink of the boosted IG post (creative.instagram_permalink_url).
    #[serde(rename = "instagramPermalink", skip_serializing_if = "Option::is_none")]
    pub instagram_permalink: Option<String>,
    /// Instagram-only. The connected Instagram SocialAccount these comments were read through — use it for reply/hide actions via /v1/inbox/comments.
    #[serde(rename = "instagramAccountId", skip_serializing_if = "Option::is_none")]
    pub instagram_account_id: Option<String>,
    /// Social account ID (ads SocialAccount).
    #[serde(rename = "accountId")]
    pub account_id: String,
    #[serde(rename = "lastUpdated")]
    pub last_updated: String,
}

impl GetAdComments200ResponseMeta {
    pub fn new(
        platform: Platform,
        ad_id: String,
        platform_ad_id: String,
        effective_story_id: String,
        account_id: String,
        last_updated: String,
    ) -> GetAdComments200ResponseMeta {
        GetAdComments200ResponseMeta {
            platform,
            ad_id,
            platform_ad_id,
            effective_story_id,
            instagram_user_id: None,
            instagram_permalink: None,
            instagram_account_id: None,
            account_id,
            last_updated,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Platform {
    #[serde(rename = "facebook")]
    Facebook,
    #[serde(rename = "instagram")]
    Instagram,
}

impl Default for Platform {
    fn default() -> Platform {
        Self::Facebook
    }
}