/*
* 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.565.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 WebhookPayloadMentionMention {
/// Mention ID, the same as `id` on GET /v1/inbox/mentions.
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "platform")]
pub platform: Platform,
/// Null on LinkedIn.
#[serde(rename = "type", deserialize_with = "Option::deserialize")]
pub r#type: Option<Type>,
/// Instagram media ID.
#[serde(rename = "mediaId", deserialize_with = "Option::deserialize")]
pub media_id: Option<String>,
/// Facebook post ID.
#[serde(rename = "postId", deserialize_with = "Option::deserialize")]
pub post_id: Option<String>,
#[serde(rename = "commentId", deserialize_with = "Option::deserialize")]
pub comment_id: Option<String>,
/// Text that mentioned the account.
#[serde(rename = "content", deserialize_with = "Option::deserialize")]
pub content: Option<String>,
/// URL to the source post on LinkedIn. Null on Instagram and Facebook.
#[serde(rename = "permalink", deserialize_with = "Option::deserialize")]
pub permalink: Option<String>,
#[serde(rename = "authorUrn", deserialize_with = "Option::deserialize")]
pub author_urn: Option<String>,
#[serde(rename = "authorName", deserialize_with = "Option::deserialize")]
pub author_name: Option<String>,
#[serde(rename = "authorUsername", deserialize_with = "Option::deserialize")]
pub author_username: Option<String>,
#[serde(rename = "authorPicture", deserialize_with = "Option::deserialize")]
pub author_picture: Option<String>,
/// The mentioned organization, Page or Instagram account.
#[serde(rename = "organizationalEntity")]
pub organizational_entity: String,
#[serde(rename = "publishedAt")]
pub published_at: String,
}
impl WebhookPayloadMentionMention {
pub fn new(
id: String,
platform: Platform,
r#type: Option<Type>,
media_id: Option<String>,
post_id: Option<String>,
comment_id: Option<String>,
content: Option<String>,
permalink: Option<String>,
author_urn: Option<String>,
author_name: Option<String>,
author_username: Option<String>,
author_picture: Option<String>,
organizational_entity: String,
published_at: String,
) -> WebhookPayloadMentionMention {
WebhookPayloadMentionMention {
id,
platform,
r#type,
media_id,
post_id,
comment_id,
content,
permalink,
author_urn,
author_name,
author_username,
author_picture,
organizational_entity,
published_at,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Platform {
#[serde(rename = "instagram")]
Instagram,
#[serde(rename = "facebook")]
Facebook,
#[serde(rename = "linkedin")]
Linkedin,
}
impl Default for Platform {
fn default() -> Platform {
Self::Instagram
}
}
/// Null on LinkedIn.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "caption")]
Caption,
#[serde(rename = "post")]
Post,
#[serde(rename = "comment")]
Comment,
}
impl Default for Type {
fn default() -> Type {
Self::Caption
}
}