/*
* 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.104.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 GetAdComments200ResponseMeta {
/// Platform of the comments.
#[serde(rename = "platform")]
pub platform: Platform,
/// The placement these comments are for, useful when you didn't pass ?placement= and want to know which one you got.
#[serde(rename = "placement", skip_serializing_if = "Option::is_none")]
pub placement: Option<Placement>,
/// Internal Zernio ad ID.
#[serde(rename = "adId")]
pub ad_id: String,
/// Platform ad ID.
#[serde(rename = "platformAdId", skip_serializing_if = "Option::is_none")]
pub platform_ad_id: Option<String>,
/// Underlying post ID the comments belong to. effective_object_story_id for the Facebook side, effective_instagram_media_id for the Instagram side.
#[serde(rename = "effectiveStoryId", skip_serializing_if = "Option::is_none")]
pub effective_story_id: Option<String>,
/// TikTok-only video item ID from stored ad fields or returned comments. Null does not prevent listing; ad details are not fetched to populate it.
#[serde(
rename = "tiktokItemId",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub tiktok_item_id: Option<Option<String>>,
/// TikTok-only resolved start date.
#[serde(rename = "since", skip_serializing_if = "Option::is_none")]
pub since: Option<String>,
/// TikTok-only resolved end date.
#[serde(rename = "until", skip_serializing_if = "Option::is_none")]
pub until: Option<String>,
/// Facebook-only. The connected Facebook Page SocialAccount these comments were read through. Pass it as `accountId` (with `effectiveStoryId` as the postId) to /v1/inbox/comments to reply/hide/delete. Null when no connected Page was used (then moderation isn't possible).
#[serde(
rename = "facebookAccountId",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub facebook_account_id: Option<Option<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. Pass it as `accountId` (with `effectiveStoryId` as the postId) to /v1/inbox/comments to reply/hide/delete.
#[serde(rename = "instagramAccountId", skip_serializing_if = "Option::is_none")]
pub instagram_account_id: Option<String>,
/// 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,
account_id: String,
last_updated: String,
) -> GetAdComments200ResponseMeta {
GetAdComments200ResponseMeta {
platform,
placement: None,
ad_id,
platform_ad_id: None,
effective_story_id: None,
tiktok_item_id: None,
since: None,
until: None,
facebook_account_id: None,
instagram_user_id: None,
instagram_permalink: None,
instagram_account_id: None,
account_id,
last_updated,
}
}
}
/// Platform of the comments.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Platform {
#[serde(rename = "facebook")]
Facebook,
#[serde(rename = "instagram")]
Instagram,
#[serde(rename = "tiktok")]
Tiktok,
}
impl Default for Platform {
fn default() -> Platform {
Self::Facebook
}
}
/// The placement these comments are for, useful when you didn't pass ?placement= and want to know which one you got.
#[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
}
}