rust_anticaptcha/core/
enums.rs

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
pub trait TaskTypeTrait {
    fn value_as_string(&self) -> String;
}

pub enum ImageTaskType {
    ImageToTextTask,
    ImageToCoordinatesTask,
}
impl TaskTypeTrait for ImageTaskType {
    fn value_as_string(&self) -> String {
        match &self {
            ImageTaskType::ImageToTextTask => "ImageToTextTask".to_string(),
            ImageTaskType::ImageToCoordinatesTask => "ImageToCoordinatesTask".to_string(),
        }
    }
}
pub enum TokenTaskType {
    RecaptchaV2Task,
    RecaptchaV2TaskProxyless,

    RecaptchaV3Enterprise,
    RecaptchaV3TaskProxyless,

    RecaptchaV2EnterpriseTask,
    RecaptchaV2EnterpriseTaskProxyless,

    FunCaptchaTask,
    FunCaptchaTaskProxyless,

    GeeTestTask,
    GeeTestTaskProxyless,

    TurnstileTask,
    TurnstileTaskProxyless,

    AntiGateTask,
}

impl TaskTypeTrait for TokenTaskType {
    fn value_as_string(&self) -> String {
        match &self {
            TokenTaskType::RecaptchaV2Task => "RecaptchaV2Task".to_string(),
            TokenTaskType::RecaptchaV2TaskProxyless => "RecaptchaV2TaskProxyless".to_string(),
            TokenTaskType::RecaptchaV3Enterprise => "RecaptchaV3Enterprise".to_string(),
            TokenTaskType::RecaptchaV3TaskProxyless => "RecaptchaV3TaskProxyless".to_string(),
            TokenTaskType::RecaptchaV2EnterpriseTask => "RecaptchaV2EnterpriseTask".to_string(),
            TokenTaskType::RecaptchaV2EnterpriseTaskProxyless => {
                "RecaptchaV2EnterpriseTaskProxyless".to_string()
            }
            TokenTaskType::FunCaptchaTask => "FunCaptchaTask".to_string(),
            TokenTaskType::FunCaptchaTaskProxyless => "FunCaptchaTaskProxyless".to_string(),
            TokenTaskType::GeeTestTask => "GeeTestTask".to_string(),
            TokenTaskType::GeeTestTaskProxyless => "GeeTestTaskProxyless".to_string(),
            TokenTaskType::TurnstileTask => "TurnstileTask".to_string(),
            TokenTaskType::TurnstileTaskProxyless => "TurnstileTaskProxyless".to_string(),
            TokenTaskType::AntiGateTask => "AntiGateTask".to_string(),
        }
    }
}

pub enum EnpPostfix {
    // tasks processing
    createTask,
    getTaskResult,
    // get account info
    getBalance,
    getQueueStats,
    getAppStats,
    getSpendingStats,
    // reports
    reportIncorrectImageCaptcha,
    reportIncorrectRecaptcha,
    reportCorrectRecaptcha,
    reportIncorrectHcaptcha,
    pushAntiGateVariable,
}

impl EnpPostfix {
    pub fn value_as_string(&self) -> String {
        match &self {
            EnpPostfix::createTask => "createTask".to_string(),
            EnpPostfix::getTaskResult => "getTaskResult".to_string(),
            EnpPostfix::getBalance => "getBalance".to_string(),
            EnpPostfix::getQueueStats => "getQueueStats".to_string(),
            EnpPostfix::getAppStats => "getAppStats".to_string(),
            EnpPostfix::getSpendingStats => "getSpendingStats".to_string(),
            EnpPostfix::reportIncorrectImageCaptcha => "reportIncorrectImageCaptcha".to_string(),
            EnpPostfix::reportIncorrectRecaptcha => "reportIncorrectRecaptcha".to_string(),
            EnpPostfix::reportCorrectRecaptcha => "reportCorrectRecaptcha".to_string(),
            EnpPostfix::reportIncorrectHcaptcha => "reportIncorrectHcaptcha".to_string(),
            EnpPostfix::pushAntiGateVariable => "pushAntiGateVariable".to_string(),
        }
    }
}

pub enum GetResultStatus {
    processing,
    ready,
    error,
}

impl GetResultStatus {
    pub fn value_as_string(&self) -> String {
        match &self {
            GetResultStatus::processing => "processing".to_string(),
            GetResultStatus::ready => "ready".to_string(),
            GetResultStatus::error => "error".to_string(),
        }
    }
}