/
options.go
59 lines (46 loc) · 2.05 KB
/
options.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
47
48
49
50
51
52
53
54
55
56
57
58
59
package emailableclient
import "net/url"
// https://emailable.com/docs/api/#emails
type UniqueOption struct {
Smtp bool
AcceptAll bool
Timeout uint64 // time in seconds
}
// https://emailable.com/docs/api/#verify-a-batch-of-emails
type BatchOption struct {
// A URL that will receive the batch results via HTTP POST.
Url *url.URL
// A comma separated list of fields to include in the response.
// If nothing is specified, all fields will be returned.
// Valid fields are accept_all, did_you_mean, disposable, domain, email, first_name, free, full_name, gender, last_name, mx_record, reason, role, score, smtp_provider, state, tag, and user.
ResponseFields []ResponseField
// Defaults to true.
// Retries increase accuracy by automatically retrying verification when our system receives certain responses from mail servers.
// To speed up verification, you can disable this by setting retries to false; however, doing so may increase the number of unknown responses.
Retries bool
// A boolean value indicating whether to include partial results when a batch is still verifying.
// This option is only available for batches with up to 1,000 emails. Defaults to false.
Partial bool
// Used to simulate certain responses from the API while using a test key. Valid options are generic_error, insufficient_credits_error, payment_error, and card_error.
simulate *BatchSimulate
}
func (o *BatchOption) AddSimulate(s BatchSimulate) {
o.simulate = &s
}
func (o *BatchOption) RemoveSimulate() {
o.simulate = nil
}
type BatchStatusOption struct {
// A boolean value indicating whether to include partial results when a batch is still verifying.
//This option is only available for batches with up to 1,000 emails. Defaults to false.
Partial bool
// Used to simulate certain responses from the API while using a test key.
// Valid options are generic_error, importing, verifying, and paused.
simulate *StatusSimulate
}
func (o *BatchStatusOption) AddSimulate(s StatusSimulate) {
o.simulate = &s
}
func (o *BatchStatusOption) RemoveSimulate() {
o.simulate = nil
}