100 lines
2.7 KiB
Go
100 lines
2.7 KiB
Go
|
package ezcaptcha
|
||
|
|
||
|
type Client struct {
|
||
|
ClientKey string `json:"clientKey"`
|
||
|
AppID string `json:"appId,omitempty"`
|
||
|
Attempts int
|
||
|
}
|
||
|
|
||
|
type GetBalanceRequest struct {
|
||
|
ClientKey string `json:"clientKey"`
|
||
|
}
|
||
|
|
||
|
// Structs which are using for creating tasks
|
||
|
|
||
|
type TaskRequest struct {
|
||
|
Client
|
||
|
Task any `json:"task"`
|
||
|
}
|
||
|
|
||
|
type SolutionRequest struct {
|
||
|
ClientKey string `json:"clientKey"`
|
||
|
TaskID string `json:"taskId"`
|
||
|
}
|
||
|
|
||
|
type ReCaptchaV2 struct {
|
||
|
Type string `json:"type"`
|
||
|
WebsiteURL string `json:"websiteURL"`
|
||
|
WebsiteKey string `json:"websiteKey"`
|
||
|
IsInvisible bool `json:"isInvisible,omitempty"`
|
||
|
Sa string `json:"sa,omitempty"`
|
||
|
S string `json:"s,omitempty"`
|
||
|
}
|
||
|
|
||
|
type ReCaptchaV3 struct {
|
||
|
Type string `json:"type"`
|
||
|
WebsiteURL string `json:"websiteURL"`
|
||
|
WebsiteKey string `json:"websiteKey"`
|
||
|
IsInvisible bool `json:"isInvisible,omitempty"`
|
||
|
PageAction string `json:"pageAction,omitempty"`
|
||
|
}
|
||
|
|
||
|
type HCaptcha struct {
|
||
|
Type string `json:"type"`
|
||
|
WebsiteURL string `json:"websiteURL"`
|
||
|
WebsiteKey string `json:"websiteKey"`
|
||
|
EnterpricePayload string `json:"enterprisePayload,omitempty"`
|
||
|
IsInvisible bool `json:"isInvisible,omitempty"`
|
||
|
}
|
||
|
|
||
|
type Akamai struct {
|
||
|
Type string `json:"type"`
|
||
|
PageURL string `json:"pageUrl"`
|
||
|
Bmsz string `json:"bmsz"`
|
||
|
UA string `json:"ua"`
|
||
|
Lang string `json:"lang"`
|
||
|
}
|
||
|
|
||
|
type AkamaiBMP struct {
|
||
|
Type string `json:"type"`
|
||
|
BundleID string `json:"bundleID"`
|
||
|
Device string `json:"device"`
|
||
|
Version string `json:"version"`
|
||
|
}
|
||
|
|
||
|
// Structs to parse the response from their api
|
||
|
|
||
|
type CreateTaskResponse struct {
|
||
|
ErrorID int `json:"errorId"`
|
||
|
ErrorCode string `json:"errorCode,omitempty"`
|
||
|
ErrorDescription string `json:"errorDescription,omitempty"`
|
||
|
TaskID string `json:"taskId,omitempty"`
|
||
|
}
|
||
|
|
||
|
type SolutionResponse struct {
|
||
|
ErrorID int `json:"errorId"`
|
||
|
ErrorCode any `json:"errorCode,omitempty"`
|
||
|
ErrorDescription any `json:"errorDescription,omitempty"`
|
||
|
Solution struct {
|
||
|
GRecaptchaResponse string `json:"gRecaptchaResponse,omitempty"`
|
||
|
} `json:"solution"`
|
||
|
Status string `json:"status,omitempty"`
|
||
|
}
|
||
|
|
||
|
type AkamaiResponse struct {
|
||
|
ErrorID int `json:"errorId"`
|
||
|
ErrorCode any `json:"errorCode,omitempty"`
|
||
|
ErrorDescription any `json:"errorDescription,omitempty"`
|
||
|
Solution struct {
|
||
|
Payload string `json:"payload,omitempty"`
|
||
|
Sensor string `json:"sensor,omitempty"`
|
||
|
} `json:"solution"`
|
||
|
Status string `json:"status"`
|
||
|
}
|
||
|
type GetBalanceResponse struct {
|
||
|
Balance int `json:"balance,omitempty"`
|
||
|
ErrorID int `json:"errorId"`
|
||
|
ErrorCode any `json:"errorCode,omitempty"`
|
||
|
ErrorDescription any `json:"errorDescription,omitempty"`
|
||
|
}
|