/*
* 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).
*
* The version of the OpenAPI document: 1.15.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 CreateCommentAutomation200ResponseAutomation {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "platform", skip_serializing_if = "Option::is_none")]
pub platform: Option<String>,
#[serde(rename = "trigger", skip_serializing_if = "Option::is_none")]
pub trigger: Option<Trigger>,
#[serde(rename = "platformPostId", skip_serializing_if = "Option::is_none")]
pub platform_post_id: Option<String>,
#[serde(rename = "keywords", skip_serializing_if = "Option::is_none")]
pub keywords: Option<Vec<String>>,
/// How a keyword is compared with the comment. 'contains' (default) matches anywhere, even inside another word (keyword 'app' fires on 'happy'). 'word' matches the keyword only as a standalone word. 'exact' requires the whole comment to be exactly the keyword.
#[serde(rename = "matchMode", skip_serializing_if = "Option::is_none")]
pub match_mode: Option<MatchMode>,
/// Comments containing one of these never trigger the automation, even when a trigger keyword also matches. Compared using the same matchMode.
#[serde(rename = "excludeKeywords", skip_serializing_if = "Option::is_none")]
pub exclude_keywords: Option<Vec<String>>,
/// Only with matchMode=word: also fire on close misspellings of a keyword (one edit for 4-7 character keywords, two from 8 up). Keywords shorter than 4 characters are never fuzzy-matched.
#[serde(rename = "typoTolerance", skip_serializing_if = "Option::is_none")]
pub typo_tolerance: Option<bool>,
#[serde(rename = "dmMessage", skip_serializing_if = "Option::is_none")]
pub dm_message: Option<String>,
/// Inline DM buttons (up to 3). Omitted when none are set.
#[serde(rename = "buttons", skip_serializing_if = "Option::is_none")]
pub buttons: Option<Vec<models::DmButton>>,
#[serde(
rename = "template",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub template: Option<Option<Box<models::CommentAutomationTemplate>>>,
#[serde(rename = "commentReply", skip_serializing_if = "Option::is_none")]
pub comment_reply: Option<String>,
/// Alternate DM texts rotated at random with dmMessage. Omitted when none.
#[serde(
rename = "dmMessageVariations",
skip_serializing_if = "Option::is_none"
)]
pub dm_message_variations: Option<Vec<String>>,
/// Alternate public replies rotated at random with commentReply. Omitted when none.
#[serde(
rename = "commentReplyVariations",
skip_serializing_if = "Option::is_none"
)]
pub comment_reply_variations: Option<Vec<String>>,
#[serde(rename = "linkTracking", skip_serializing_if = "Option::is_none")]
pub link_tracking: Option<bool>,
#[serde(rename = "clickTag", skip_serializing_if = "Option::is_none")]
pub click_tag: Option<String>,
/// Seconds waited after the trigger before the DM is sent. Absent when the DM goes out immediately.
#[serde(rename = "dmDelaySeconds", skip_serializing_if = "Option::is_none")]
pub dm_delay_seconds: Option<i32>,
/// Seconds waited before the public reply is posted. Absent when it follows the DM immediately.
#[serde(
rename = "commentReplyDelaySeconds",
skip_serializing_if = "Option::is_none"
)]
pub comment_reply_delay_seconds: Option<i32>,
#[serde(rename = "audience", skip_serializing_if = "Option::is_none")]
pub audience: Option<Box<models::CommentAutomationAudience>>,
#[serde(rename = "followGate", skip_serializing_if = "Option::is_none")]
pub follow_gate: Option<Box<models::CommentAutomationFollowGate>>,
/// Whether these keywords also fire on a plain inbound DM.
#[serde(rename = "alsoMatchInDms", skip_serializing_if = "Option::is_none")]
pub also_match_in_dms: Option<bool>,
#[serde(rename = "isActive", skip_serializing_if = "Option::is_none")]
pub is_active: Option<bool>,
#[serde(rename = "stats", skip_serializing_if = "Option::is_none")]
pub stats: Option<Box<models::CreateCommentAutomation200ResponseAutomationStats>>,
#[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
}
impl CreateCommentAutomation200ResponseAutomation {
pub fn new() -> CreateCommentAutomation200ResponseAutomation {
CreateCommentAutomation200ResponseAutomation {
id: None,
name: None,
platform: None,
trigger: None,
platform_post_id: None,
keywords: None,
match_mode: None,
exclude_keywords: None,
typo_tolerance: None,
dm_message: None,
buttons: None,
template: None,
comment_reply: None,
dm_message_variations: None,
comment_reply_variations: None,
link_tracking: None,
click_tag: None,
dm_delay_seconds: None,
comment_reply_delay_seconds: None,
audience: None,
follow_gate: None,
also_match_in_dms: None,
is_active: None,
stats: None,
created_at: None,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Trigger {
#[serde(rename = "comment")]
Comment,
#[serde(rename = "story_reply")]
StoryReply,
}
impl Default for Trigger {
fn default() -> Trigger {
Self::Comment
}
}
/// How a keyword is compared with the comment. 'contains' (default) matches anywhere, even inside another word (keyword 'app' fires on 'happy'). 'word' matches the keyword only as a standalone word. 'exact' requires the whole comment to be exactly the keyword.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum MatchMode {
#[serde(rename = "exact")]
Exact,
#[serde(rename = "contains")]
Contains,
#[serde(rename = "word")]
Word,
}
impl Default for MatchMode {
fn default() -> MatchMode {
Self::Exact
}
}