zernio 0.0.98

API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
Documentation
/*
 * Late API
 *
 * API reference for Late. Authenticate with a Bearer API key. Base URL: https://getlate.dev/api
 *
 * The version of the OpenAPI document: 1.0.1
 * Contact: support@getlate.dev
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PostLogDetail {
    #[serde(rename = "_id", skip_serializing_if = "Option::is_none")]
    pub _id: Option<String>,
    #[serde(rename = "postId", skip_serializing_if = "Option::is_none")]
    pub post_id: Option<Box<models::PostLogDetailAllOfPostId>>,
    #[serde(rename = "userId", skip_serializing_if = "Option::is_none")]
    pub user_id: Option<String>,
    #[serde(rename = "profileId", skip_serializing_if = "Option::is_none")]
    pub profile_id: Option<String>,
    #[serde(rename = "platform", skip_serializing_if = "Option::is_none")]
    pub platform: Option<Platform>,
    #[serde(rename = "accountId", skip_serializing_if = "Option::is_none")]
    pub account_id: Option<Box<models::PostLogDetailAllOfAccountId>>,
    #[serde(rename = "accountUsername", skip_serializing_if = "Option::is_none")]
    pub account_username: Option<String>,
    /// Type of action logged: - `publish` - Initial publish attempt - `retry` - Retry after failure - `media_upload` - Media upload step - `rate_limit_pause` - Account paused due to rate limits - `token_refresh` - Token was refreshed - `cancelled` - Post was cancelled
    #[serde(rename = "action", skip_serializing_if = "Option::is_none")]
    pub action: Option<Action>,
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Status>,
    /// HTTP status code from platform API
    #[serde(rename = "statusCode", skip_serializing_if = "Option::is_none")]
    pub status_code: Option<i32>,
    /// Platform API endpoint called
    #[serde(rename = "endpoint", skip_serializing_if = "Option::is_none")]
    pub endpoint: Option<String>,
    #[serde(rename = "request", skip_serializing_if = "Option::is_none")]
    pub request: Option<Box<models::PostLogRequest>>,
    #[serde(rename = "response", skip_serializing_if = "Option::is_none")]
    pub response: Option<Box<models::PostLogResponse>>,
    /// How long the operation took in milliseconds
    #[serde(rename = "durationMs", skip_serializing_if = "Option::is_none")]
    pub duration_ms: Option<i32>,
    /// Attempt number (1 for first try, 2+ for retries)
    #[serde(rename = "attemptNumber", skip_serializing_if = "Option::is_none")]
    pub attempt_number: Option<i32>,
    #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
    pub created_at: Option<String>,
    /// Additional metadata (e.g., rate limit info)
    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
    pub metadata: Option<serde_json::Value>,
}

impl PostLogDetail {
    pub fn new() -> PostLogDetail {
        PostLogDetail {
            _id: None,
            post_id: None,
            user_id: None,
            profile_id: None,
            platform: None,
            account_id: None,
            account_username: None,
            action: None,
            status: None,
            status_code: None,
            endpoint: None,
            request: None,
            response: None,
            duration_ms: None,
            attempt_number: None,
            created_at: None,
            metadata: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Platform {
    #[serde(rename = "tiktok")]
    Tiktok,
    #[serde(rename = "instagram")]
    Instagram,
    #[serde(rename = "facebook")]
    Facebook,
    #[serde(rename = "youtube")]
    Youtube,
    #[serde(rename = "linkedin")]
    Linkedin,
    #[serde(rename = "twitter")]
    Twitter,
    #[serde(rename = "threads")]
    Threads,
    #[serde(rename = "pinterest")]
    Pinterest,
    #[serde(rename = "reddit")]
    Reddit,
    #[serde(rename = "bluesky")]
    Bluesky,
    #[serde(rename = "googlebusiness")]
    Googlebusiness,
    #[serde(rename = "telegram")]
    Telegram,
    #[serde(rename = "snapchat")]
    Snapchat,
}

impl Default for Platform {
    fn default() -> Platform {
        Self::Tiktok
    }
}
/// Type of action logged: - `publish` - Initial publish attempt - `retry` - Retry after failure - `media_upload` - Media upload step - `rate_limit_pause` - Account paused due to rate limits - `token_refresh` - Token was refreshed - `cancelled` - Post was cancelled
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Action {
    #[serde(rename = "publish")]
    Publish,
    #[serde(rename = "retry")]
    Retry,
    #[serde(rename = "media_upload")]
    MediaUpload,
    #[serde(rename = "rate_limit_pause")]
    RateLimitPause,
    #[serde(rename = "token_refresh")]
    TokenRefresh,
    #[serde(rename = "cancelled")]
    Cancelled,
}

impl Default for Action {
    fn default() -> Action {
        Self::Publish
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "success")]
    Success,
    #[serde(rename = "failed")]
    Failed,
    #[serde(rename = "pending")]
    Pending,
    #[serde(rename = "skipped")]
    Skipped,
}

impl Default for Status {
    fn default() -> Status {
        Self::Success
    }
}