/*
 * 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.1
 * 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 CreateCommentAutomationRequest {
    #[serde(rename = "profileId")]
    pub profile_id: String,
    /// Instagram or Facebook account ID
    #[serde(rename = "accountId")]
    pub account_id: String,
    /// Platform media/post ID
    #[serde(rename = "platformPostId")]
    pub platform_post_id: String,
    /// Zernio post ID (optional)
    #[serde(rename = "postId", skip_serializing_if = "Option::is_none")]
    pub post_id: Option<String>,
    /// Post content snippet for display
    #[serde(rename = "postTitle", skip_serializing_if = "Option::is_none")]
    pub post_title: Option<String>,
    /// Automation label
    #[serde(rename = "name")]
    pub name: String,
    /// Trigger keywords (empty = any comment triggers)
    #[serde(rename = "keywords", skip_serializing_if = "Option::is_none")]
    pub keywords: Option<Vec<String>>,
    #[serde(rename = "matchMode", skip_serializing_if = "Option::is_none")]
    pub match_mode: Option<MatchMode>,
    /// DM text to send to commenter
    #[serde(rename = "dmMessage")]
    pub dm_message: String,
    /// Optional public reply to the comment
    #[serde(rename = "commentReply", skip_serializing_if = "Option::is_none")]
    pub comment_reply: Option<String>,
}

impl CreateCommentAutomationRequest {
    pub fn new(
        profile_id: String,
        account_id: String,
        platform_post_id: String,
        name: String,
        dm_message: String,
    ) -> CreateCommentAutomationRequest {
        CreateCommentAutomationRequest {
            profile_id,
            account_id,
            platform_post_id,
            post_id: None,
            post_title: None,
            name,
            keywords: None,
            match_mode: None,
            dm_message,
            comment_reply: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum MatchMode {
    #[serde(rename = "exact")]
    Exact,
    #[serde(rename = "contains")]
    Contains,
}

impl Default for MatchMode {
    fn default() -> MatchMode {
        Self::Exact
    }
}
