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
/*
* Hanzo Cloud API
*
* The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
*
* The version of the OpenAPI document: v1
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SocialPost {
/// AccountID / ExternalID / Error are server-managed publish results, set only by the publish path (never by a client update): the account a post was published through, the provider's returned external post id (for reconciliation), and the last failure reason. Empty until a publish attempt lands. AccountID is the connected account the post went out through. Absent until a publish succeeds.
#[serde(rename = "accountId", skip_serializing_if = "Option::is_none")]
pub account_id: Option<String>,
/// Channel is the network this post targets: x, facebook, instagram, linkedin, tiktok, youtube or threads. It is the channel whose CONNECTED accounts a publish fans out to. Example: \"x\"
#[serde(rename = "channel", skip_serializing_if = "Option::is_none")]
pub channel: Option<String>,
/// Content is the post's text, bounded at 8192 characters. Example: \"Shipping today.\"
#[serde(rename = "content", skip_serializing_if = "Option::is_none")]
pub content: Option<String>,
/// CreatedAt is when the post was created, as a unix timestamp in seconds.
#[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
pub created_at: Option<i32>,
/// Error is why the last publish attempt failed, verbatim and bounded. Absent when no attempt has failed; cleared by a later success.
#[serde(rename = "error", skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
/// ExternalID is the id the network returned for the published post, which is what reconciles this row against the post on the network. Absent until a publish succeeds.
#[serde(rename = "externalId", skip_serializing_if = "Option::is_none")]
pub external_id: Option<String>,
/// ID is the post's identifier, minted on create and the id every later call addresses it by. Example: \"post_91ab20\"
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
/// Media is the post's attached media as a list of URLs (images today; the composer's URL field now, an S3 picker later, populate it). Stored as a JSON array in the media TEXT column and ALWAYS serialized as an array (never null), so a client can rely on `media` being present. Bounded at the write layer (normMedia in social.go): each URL clipped to maxField, the list to maxMedia.
#[serde(rename = "media", skip_serializing_if = "Option::is_none")]
pub media: Option<Vec<String>>,
/// ScheduleAt is when the post is due, as a unix timestamp in SECONDS. 0 means unscheduled. It is meaningful only while the status is scheduled — a scheduled post whose time has arrived is published by the scheduler.
#[serde(rename = "scheduleAt", skip_serializing_if = "Option::is_none")]
pub schedule_at: Option<i32>,
/// Status is the post's lifecycle state: draft, scheduled, published or failed. A fifth, transient publishing state exists while a publish attempt holds the claim; it is never settable from a request and a caller sees it only if it reads a post mid-attempt.
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
/// UpdatedAt is when the post row last changed, as a unix timestamp in seconds. The listing is ordered by it, newest first.
#[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")]
pub updated_at: Option<i32>,
}
impl SocialPost {
pub fn new() -> SocialPost {
SocialPost {
account_id: None,
channel: None,
content: None,
created_at: None,
error: None,
external_id: None,
id: None,
media: None,
schedule_at: None,
status: None,
updated_at: None,
}
}
}