-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtask_fraud.go
46 lines (34 loc) · 1.2 KB
/
task_fraud.go
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
// go-mirage-api
//
// Copyright 2023, Valerian Saliou
// Author: Valerian Saliou <[email protected]>
package mirage
// FraudSpamicityRequest mapping
type FraudSpamicityRequest struct {
Name string `json:"name"`
Domain string `json:"domain"`
EmailDomain string `json:"email_domain"`
}
// FraudSpamicityResponseData mapping
type FraudSpamicityResponseData struct {
Data *FraudSpamicityResponse `json:"data"`
}
// FraudSpamicityResponse mapping
type FraudSpamicityResponse struct {
Fraud bool `json:"fraud"`
Score float32 `json:"score"`
}
// String returns the string representation of FraudSpamicityResponse
func (instance FraudSpamicityResponse) String() string {
return Stringify(instance)
}
// FraudSpamicity fraud check classification on scammy websites using a website name, domain and email domain.
func (service *TaskService) FraudSpamicity(ctx RequestContext, data FraudSpamicityRequest) (*FraudSpamicityResponse, error) {
req, _ := service.client.NewRequest("POST", "task/fraud/spamicity", data, ctx)
result := new(FraudSpamicityResponseData)
_, err := service.client.Do(req, result)
if err != nil {
return nil, err
}
return result.Data, err
}