late 0.0.1136

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.
Documentation
/*
 * 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.226.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 CommentAutomationLog {
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[serde(rename = "commentId", skip_serializing_if = "Option::is_none")]
    pub comment_id: Option<String>,
    #[serde(rename = "commenterId", skip_serializing_if = "Option::is_none")]
    pub commenter_id: Option<String>,
    #[serde(
        rename = "commenterName",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub commenter_name: Option<Option<String>>,
    #[serde(
        rename = "commenterUsername",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub commenter_username: Option<Option<String>>,
    #[serde(
        rename = "commentText",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub comment_text: Option<Option<String>>,
    /// Which door triggered this send. Null on rows written before this field existed (all of those are comment-triggered).
    #[serde(
        rename = "source",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub source: Option<Option<Source>>,
    /// DM outcome. 'pending' = the automation has a dmDelaySeconds and the response is queued but not sent yet. 'gated' = the follow-gate confirmation DM went out and we are waiting for the tap; it flips to 'sent' or 'skipped' when they tap. 'skipped' also covers repeatPolicy, cooldown and dedupeSameTextHours suppressions, with the reason in error.
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Status>,
    /// How the audience rule resolved. Null on automations without one.
    #[serde(
        rename = "audienceOutcome",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub audience_outcome: Option<Option<AudienceOutcome>>,
    /// Whether the follow-gate button reached the commenter: 'rejected' = Meta refused the gate DM, 'omitted' = the prompt went out as plain text because it was over 640 characters. Null when no gate DM was sent.
    #[serde(
        rename = "gateButtonStatus",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub gate_button_status: Option<Option<GateButtonStatus>>,
    /// Follow relationship at decision time. Null when Instagram would not tell us (the commenter never messaged the account).
    #[serde(
        rename = "commenterIsFollower",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub commenter_is_follower: Option<Option<bool>>,
    #[serde(
        rename = "commenterFollowerCount",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub commenter_follower_count: Option<Option<i32>>,
    /// When the follow-gate tap was claimed.
    #[serde(
        rename = "gateResolvedAt",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub gate_resolved_at: Option<Option<String>>,
    /// DM error message when status is failed, or the reason when it is skipped.
    #[serde(
        rename = "error",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub error: Option<Option<String>>,
    #[serde(rename = "platformError", skip_serializing_if = "Option::is_none")]
    pub platform_error: Option<Box<models::CommentAutomationLogPlatformError>>,
    /// True when the failed send spent the comment's single private reply (Instagram subcode 1545133 or 2534023, or Meta code 10900 on Instagram and Facebook), the same rule as `details.privateReplyConsumed` on the private-reply endpoint. Null on direct DMs and on rows written before this field existed.
    #[serde(
        rename = "privateReplyConsumed",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub private_reply_consumed: Option<Option<bool>>,
    /// Outcome of the optional public reply on the triggering comment. With publicReplyPolicy after_dm, 'skipped' if no commentReply was configured or if the DM failed (the public reply is not attempted in that case).
    #[serde(
        rename = "commentReplyStatus",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub comment_reply_status: Option<Option<CommentReplyStatus>>,
    /// Public-reply error message if commentReplyStatus is failed
    #[serde(
        rename = "commentReplyError",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub comment_reply_error: Option<Option<String>>,
    /// When the public reply was posted. Null when it was not.
    #[serde(
        rename = "publicReplyPostedAt",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub public_reply_posted_at: Option<Option<String>>,
    /// Why actions.likeComment did not like the comment. Null when it did or was not configured.
    #[serde(
        rename = "likeSkipped",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub like_skipped: Option<Option<String>>,
    /// Why actions.hideComment did not hide the comment. Null when it did or was not configured.
    #[serde(
        rename = "hideSkipped",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub hide_skipped: Option<Option<String>>,
    /// Why the dmMedia follow-up was not delivered. The DM itself still counts as sent.
    #[serde(
        rename = "mediaError",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub media_error: Option<Option<String>>,
    /// When the next queued send fires. Present only while something is still pending.
    #[serde(
        rename = "nextDueAt",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub next_due_at: Option<Option<String>>,
    /// This recipient's first click on a tracked link (what uniqueClicks counts).
    #[serde(
        rename = "clickedAt",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub clicked_at: Option<Option<String>>,
    /// This recipient's total clicks on tracked links.
    #[serde(rename = "clickCount", skip_serializing_if = "Option::is_none")]
    pub click_count: Option<i32>,
    #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
    pub created_at: Option<String>,
}

impl CommentAutomationLog {
    pub fn new() -> CommentAutomationLog {
        CommentAutomationLog {
            id: None,
            comment_id: None,
            commenter_id: None,
            commenter_name: None,
            commenter_username: None,
            comment_text: None,
            source: None,
            status: None,
            audience_outcome: None,
            gate_button_status: None,
            commenter_is_follower: None,
            commenter_follower_count: None,
            gate_resolved_at: None,
            error: None,
            platform_error: None,
            private_reply_consumed: None,
            comment_reply_status: None,
            comment_reply_error: None,
            public_reply_posted_at: None,
            like_skipped: None,
            hide_skipped: None,
            media_error: None,
            next_due_at: None,
            clicked_at: None,
            click_count: None,
            created_at: None,
        }
    }
}
/// Which door triggered this send. Null on rows written before this field existed (all of those are comment-triggered).
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Source {
    #[serde(rename = "comment")]
    Comment,
    #[serde(rename = "live_comment")]
    LiveComment,
    #[serde(rename = "story_reply")]
    StoryReply,
    #[serde(rename = "story_mention")]
    StoryMention,
    #[serde(rename = "dm")]
    Dm,
}

impl Default for Source {
    fn default() -> Source {
        Self::Comment
    }
}
/// DM outcome. 'pending' = the automation has a dmDelaySeconds and the response is queued but not sent yet. 'gated' = the follow-gate confirmation DM went out and we are waiting for the tap; it flips to 'sent' or 'skipped' when they tap. 'skipped' also covers repeatPolicy, cooldown and dedupeSameTextHours suppressions, with the reason in error.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "pending")]
    Pending,
    #[serde(rename = "sent")]
    Sent,
    #[serde(rename = "failed")]
    Failed,
    #[serde(rename = "skipped")]
    Skipped,
    #[serde(rename = "gated")]
    Gated,
}

impl Default for Status {
    fn default() -> Status {
        Self::Pending
    }
}
/// How the audience rule resolved. Null on automations without one.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum AudienceOutcome {
    #[serde(rename = "passed")]
    Passed,
    #[serde(rename = "blocked")]
    Blocked,
    #[serde(rename = "gate_sent")]
    GateSent,
    #[serde(rename = "gate_passed")]
    GatePassed,
    #[serde(rename = "gate_failed")]
    GateFailed,
}

impl Default for AudienceOutcome {
    fn default() -> AudienceOutcome {
        Self::Passed
    }
}
/// Whether the follow-gate button reached the commenter: 'rejected' = Meta refused the gate DM, 'omitted' = the prompt went out as plain text because it was over 640 characters. Null when no gate DM was sent.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum GateButtonStatus {
    #[serde(rename = "delivered")]
    Delivered,
    #[serde(rename = "rejected")]
    Rejected,
    #[serde(rename = "omitted")]
    Omitted,
}

impl Default for GateButtonStatus {
    fn default() -> GateButtonStatus {
        Self::Delivered
    }
}
/// Outcome of the optional public reply on the triggering comment. With publicReplyPolicy after_dm, 'skipped' if no commentReply was configured or if the DM failed (the public reply is not attempted in that case).
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum CommentReplyStatus {
    #[serde(rename = "pending")]
    Pending,
    #[serde(rename = "sent")]
    Sent,
    #[serde(rename = "failed")]
    Failed,
    #[serde(rename = "skipped")]
    Skipped,
}

impl Default for CommentReplyStatus {
    fn default() -> CommentReplyStatus {
        Self::Pending
    }
}