-
Notifications
You must be signed in to change notification settings - Fork 14
/
sourceip2whois.go
70 lines (58 loc) · 1.47 KB
/
sourceip2whois.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
60
61
62
63
64
65
66
67
68
69
70
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
package shared
import (
"encoding/json"
"fmt"
"github.com/airbytehq/terraform-provider-airbyte/internal/sdk/pkg/utils"
)
type Ip2whois string
const (
Ip2whoisIp2whois Ip2whois = "ip2whois"
)
func (e Ip2whois) ToPointer() *Ip2whois {
return &e
}
func (e *Ip2whois) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "ip2whois":
*e = Ip2whois(v)
return nil
default:
return fmt.Errorf("invalid value for Ip2whois: %v", v)
}
}
type SourceIp2whois struct {
// Your API Key. See <a href="https://www.ip2whois.com/developers-api">here</a>.
APIKey *string `json:"api_key,omitempty"`
// Domain name. See <a href="https://www.ip2whois.com/developers-api">here</a>.
Domain *string `json:"domain,omitempty"`
sourceType *Ip2whois `const:"ip2whois" json:"sourceType,omitempty"`
}
func (s SourceIp2whois) MarshalJSON() ([]byte, error) {
return utils.MarshalJSON(s, "", false)
}
func (s *SourceIp2whois) UnmarshalJSON(data []byte) error {
if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil {
return err
}
return nil
}
func (o *SourceIp2whois) GetAPIKey() *string {
if o == nil {
return nil
}
return o.APIKey
}
func (o *SourceIp2whois) GetDomain() *string {
if o == nil {
return nil
}
return o.Domain
}
func (o *SourceIp2whois) GetSourceType() *Ip2whois {
return Ip2whoisIp2whois.ToPointer()
}