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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/*
* 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 PlatformTarget {
/// Supported values: twitter, threads, instagram, youtube, facebook, linkedin, pinterest, reddit, tiktok, bluesky, googlebusiness, telegram
#[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<Box<models::PlatformTargetAccountId>>,
/// Platform-specific text override. When set, this content is used instead of the top-level post content for this platform. Useful for tailoring captions per platform (e.g. keeping tweets under 280 characters).
#[serde(rename = "customContent", skip_serializing_if = "Option::is_none")]
pub custom_content: Option<String>,
#[serde(rename = "customMedia", skip_serializing_if = "Option::is_none")]
pub custom_media: Option<Vec<models::MediaItem>>,
/// Optional per-platform scheduled time override (uses post.scheduledFor when omitted)
#[serde(rename = "scheduledFor", skip_serializing_if = "Option::is_none")]
pub scheduled_for: Option<String>,
#[serde(
rename = "platformSpecificData",
skip_serializing_if = "Option::is_none"
)]
pub platform_specific_data: Option<Box<models::PlatformTargetPlatformSpecificData>>,
/// Platform-specific status: pending, publishing, published, failed
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
/// The native post ID on the platform (populated after successful publish)
#[serde(rename = "platformPostId", skip_serializing_if = "Option::is_none")]
pub platform_post_id: Option<String>,
/// Public URL of the published post. Included in the response for immediate posts; for scheduled posts, fetch via GET /v1/posts/{postId} after publish time.
#[serde(rename = "platformPostUrl", skip_serializing_if = "Option::is_none")]
pub platform_post_url: Option<String>,
/// Timestamp when the post was published to this platform
#[serde(rename = "publishedAt", skip_serializing_if = "Option::is_none")]
pub published_at: Option<String>,
/// Present and true only when this Instagram reel was launched as a Trial through Zernio (created with platformSpecificData.trialParams). Use it to segment trial reels in analytics. Note: Instagram's Graph API exposes no readable trial field, so this reflects creation-time intent only. It indicates the reel STARTED as a trial, not whether or when it graduated.
#[serde(rename = "isTrialReel", skip_serializing_if = "Option::is_none")]
pub is_trial_reel: Option<bool>,
/// Graduation strategy the trial reel was launched with. Present only when isTrialReel is true.
#[serde(
rename = "trialGraduationStrategy",
skip_serializing_if = "Option::is_none"
)]
pub trial_graduation_strategy: Option<TrialGraduationStrategy>,
/// Human-readable error message when status is failed. Contains platform-specific error details explaining why the publish failed.
#[serde(rename = "errorMessage", skip_serializing_if = "Option::is_none")]
pub error_message: Option<String>,
/// Error category for programmatic handling: auth_expired (token expired/revoked), user_content (wrong format/too long), user_abuse (rate limits/spam), account_issue (config problems), platform_rejected (policy violation), platform_error (5xx/maintenance), system_error (Zernio infra), unknown
#[serde(rename = "errorCategory", skip_serializing_if = "Option::is_none")]
pub error_category: Option<ErrorCategory>,
/// Who caused the error: user (fix content/reconnect), platform (outage/API change), system (Zernio issue, rare)
#[serde(rename = "errorSource", skip_serializing_if = "Option::is_none")]
pub error_source: Option<ErrorSource>,
}
impl PlatformTarget {
pub fn new() -> PlatformTarget {
PlatformTarget {
platform: None,
account_id: None,
custom_content: None,
custom_media: None,
scheduled_for: None,
platform_specific_data: None,
status: None,
platform_post_id: None,
platform_post_url: None,
published_at: None,
is_trial_reel: None,
trial_graduation_strategy: None,
error_message: None,
error_category: None,
error_source: None,
}
}
}
/// Graduation strategy the trial reel was launched with. Present only when isTrialReel is true.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TrialGraduationStrategy {
#[serde(rename = "MANUAL")]
Manual,
#[serde(rename = "SS_PERFORMANCE")]
SsPerformance,
}
impl Default for TrialGraduationStrategy {
fn default() -> TrialGraduationStrategy {
Self::Manual
}
}
/// Error category for programmatic handling: auth_expired (token expired/revoked), user_content (wrong format/too long), user_abuse (rate limits/spam), account_issue (config problems), platform_rejected (policy violation), platform_error (5xx/maintenance), system_error (Zernio infra), unknown
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ErrorCategory {
#[serde(rename = "auth_expired")]
AuthExpired,
#[serde(rename = "user_content")]
UserContent,
#[serde(rename = "user_abuse")]
UserAbuse,
#[serde(rename = "account_issue")]
AccountIssue,
#[serde(rename = "platform_rejected")]
PlatformRejected,
#[serde(rename = "platform_error")]
PlatformError,
#[serde(rename = "system_error")]
SystemError,
#[serde(rename = "unknown")]
Unknown,
}
impl Default for ErrorCategory {
fn default() -> ErrorCategory {
Self::AuthExpired
}
}
/// Who caused the error: user (fix content/reconnect), platform (outage/API change), system (Zernio issue, rare)
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ErrorSource {
#[serde(rename = "user")]
User,
#[serde(rename = "platform")]
Platform,
#[serde(rename = "system")]
System,
}
impl Default for ErrorSource {
fn default() -> ErrorSource {
Self::User
}
}