1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
* 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};
/// ExternalPostWebhookPost : Native (external) post data shared by all post.external.* payloads.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ExternalPostWebhookPost {
/// Platform-native post ID (NOT a Zernio post ID).
#[serde(rename = "id")]
pub id: String,
/// Platform the post lives on (e.g. \"googlebusiness\").
#[serde(rename = "platform")]
pub platform: String,
/// Zernio social account ID the post belongs to.
#[serde(rename = "accountId")]
pub account_id: String,
/// Direct URL to the post on the platform, when available.
#[serde(rename = "url")]
pub url: String,
/// Post text. May be empty.
#[serde(rename = "content")]
pub content: String,
/// One of image, video, gif, document, text, carousel.
#[serde(rename = "mediaType")]
pub media_type: String,
#[serde(rename = "mediaItems")]
pub media_items: Vec<models::ExternalPostWebhookPostMediaItemsInner>,
#[serde(rename = "thumbnailUrl")]
pub thumbnail_url: String,
#[serde(rename = "publishedAt")]
pub published_at: String,
/// Always \"external\" — distinguishes these from Zernio-originated post.* events.
#[serde(rename = "source")]
pub source: Source,
/// Detection time of deletion. Present on post.external.deleted; null/absent otherwise.
#[serde(rename = "deletedAt", skip_serializing_if = "Option::is_none")]
pub deleted_at: Option<String>,
}
impl ExternalPostWebhookPost {
/// Native (external) post data shared by all post.external.* payloads.
pub fn new(
id: String,
platform: String,
account_id: String,
url: String,
content: String,
media_type: String,
media_items: Vec<models::ExternalPostWebhookPostMediaItemsInner>,
thumbnail_url: String,
published_at: String,
source: Source,
) -> ExternalPostWebhookPost {
ExternalPostWebhookPost {
id,
platform,
account_id,
url,
content,
media_type,
media_items,
thumbnail_url,
published_at,
source,
deleted_at: None,
}
}
}
/// Always \"external\" — distinguishes these from Zernio-originated post.* events.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Source {
#[serde(rename = "external")]
External,
}
impl Default for Source {
fn default() -> Source {
Self::External
}
}