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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*
* 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.4
* 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 UpdateCommentAutomationRequest {
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// What fires the automation. Changing it detaches the automation from its bound post or story (a post id and a story id are different objects), unless this same request sets a new binding. 'story_reply' is Instagram only.
#[serde(rename = "trigger", skip_serializing_if = "Option::is_none")]
pub trigger: Option<Trigger>,
#[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 (1-3). Pass [] to clear all buttons.
#[serde(rename = "buttons", skip_serializing_if = "Option::is_none")]
pub buttons: Option<Vec<models::DmButton>>,
#[serde(rename = "commentReply", skip_serializing_if = "Option::is_none")]
pub comment_reply: Option<String>,
/// Alternate DM texts for random rotation (see create). Pass [] to clear.
#[serde(
rename = "dmMessageVariations",
skip_serializing_if = "Option::is_none"
)]
pub dm_message_variations: Option<Vec<String>>,
/// Alternate public replies for random rotation. Pass [] to clear.
#[serde(
rename = "commentReplyVariations",
skip_serializing_if = "Option::is_none"
)]
pub comment_reply_variations: Option<Vec<String>>,
/// Wrap link buttons in a tracked redirect to count clicks. Pass false to send links untouched.
#[serde(rename = "linkTracking", skip_serializing_if = "Option::is_none")]
pub link_tracking: Option<bool>,
/// Tag applied to a contact when they click a tracked link (requires linkTracking). Empty string clears it.
#[serde(rename = "clickTag", skip_serializing_if = "Option::is_none")]
pub click_tag: Option<String>,
#[serde(rename = "isActive", skip_serializing_if = "Option::is_none")]
pub is_active: Option<bool>,
}
impl UpdateCommentAutomationRequest {
pub fn new() -> UpdateCommentAutomationRequest {
UpdateCommentAutomationRequest {
name: None,
trigger: None,
keywords: None,
match_mode: None,
exclude_keywords: None,
typo_tolerance: None,
dm_message: None,
buttons: None,
comment_reply: None,
dm_message_variations: None,
comment_reply_variations: None,
link_tracking: None,
click_tag: None,
is_active: None,
}
}
}
/// What fires the automation. Changing it detaches the automation from its bound post or story (a post id and a story id are different objects), unless this same request sets a new binding. 'story_reply' is Instagram only.
#[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
}
}