-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.go
47 lines (39 loc) · 1.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
package dnbclient
type ClientOptions func(*Client)
func WithBaseURL(baseURL string) ClientOptions {
return func(client *Client) {
client.BaseURL = baseURL
}
}
func WithCredentials(username string, password string) ClientOptions {
return func(client *Client) {
client.username = username
client.password = password
}
}
func WithTokens(apiKey string, apiSecret string) ClientOptions {
return func(client *Client) {
client.ApiKey = apiKey
client.ApiSecret = apiSecret
}
}
func WithAPIToken(apiToken string) ClientOptions {
return func(client *Client) {
client.apiToken = apiToken
}
}
func WithCompanySerchRequest(companySearch *CompanySearchRequest) ClientOptions {
return func(client *Client) {
client.RequestBody.CompanySearch = companySearch
}
}
func WithContactSearchRequest(contactSearch *ContactSearchRequest) ClientOptions {
return func(client *Client) {
client.RequestBody.ContactSearch = contactSearch
}
}
func WithDUNS(duns string) ClientOptions {
return func(client *Client) {
client.RequestBody.CompanySearch.DUNS = duns
}
}