/*
 * 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.4
 * 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 ListInboxComments200ResponseDataInner {
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[serde(rename = "platform", skip_serializing_if = "Option::is_none")]
    pub platform: Option<String>,
    #[serde(rename = "accountId", skip_serializing_if = "Option::is_none")]
    pub account_id: Option<String>,
    #[serde(rename = "accountUsername", skip_serializing_if = "Option::is_none")]
    pub account_username: Option<String>,
    #[serde(rename = "content", skip_serializing_if = "Option::is_none")]
    pub content: Option<String>,
    #[serde(
        rename = "picture",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub picture: Option<Option<String>>,
    #[serde(
        rename = "permalink",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub permalink: Option<Option<String>>,
    #[serde(rename = "createdTime", skip_serializing_if = "Option::is_none")]
    pub created_time: Option<String>,
    #[serde(rename = "commentCount", skip_serializing_if = "Option::is_none")]
    pub comment_count: Option<i32>,
    #[serde(rename = "likeCount", skip_serializing_if = "Option::is_none")]
    pub like_count: Option<i32>,
    /// Bluesky content identifier
    #[serde(
        rename = "cid",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub cid: Option<Option<String>>,
    /// Reddit subreddit name
    #[serde(
        rename = "subreddit",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub subreddit: Option<Option<String>>,
    /// True when this row is an ad (boosted/dark post). `platform` is then the placement (facebook = the Page dark post / instagram = the IG media), `id` is `{adId}:{placement}`, and the thread is at GET /v1/ads/{adId}/comments?placement={placement}.
    #[serde(rename = "isAd", skip_serializing_if = "Option::is_none")]
    pub is_ad: Option<bool>,
    /// Internal Zernio ad id — only on ad rows.
    #[serde(rename = "adId", skip_serializing_if = "Option::is_none")]
    pub ad_id: Option<String>,
    /// Which side of the ad this row's comments are on — only on ad rows.
    #[serde(rename = "placement", skip_serializing_if = "Option::is_none")]
    pub placement: Option<Placement>,
}

impl ListInboxComments200ResponseDataInner {
    pub fn new() -> ListInboxComments200ResponseDataInner {
        ListInboxComments200ResponseDataInner {
            id: None,
            platform: None,
            account_id: None,
            account_username: None,
            content: None,
            picture: None,
            permalink: None,
            created_time: None,
            comment_count: None,
            like_count: None,
            cid: None,
            subreddit: None,
            is_ad: None,
            ad_id: None,
            placement: None,
        }
    }
}
/// Which side of the ad this row's comments are on — only on ad rows.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Placement {
    #[serde(rename = "facebook")]
    Facebook,
    #[serde(rename = "instagram")]
    Instagram,
}

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