dns.go raw
1 package network
2
3 import (
4 liquidweb "github.com/liquidweb/liquidweb-go"
5 "github.com/liquidweb/liquidweb-go/types"
6 )
7
8 type DNSZoneCreateParams struct {
9 Name string `json:"name"`
10 ImportRecords types.FlexInt `json:"live_domain,omitempty"`
11 SkipCreateCommonRecords types.FlexInt `json:"no_extra,omitempty"`
12 }
13
14 // DNSRecord is the resource representing a DNS record entry.
15 type DNSZone struct {
16 ID types.FlexInt `json:"id,omitempty"`
17 Name string `json:"name,omitempty"`
18 Active types.FlexInt `json:"active,omitempty"`
19 DelegationStatus string `json:"delegation_status,omitempty"`
20 PrimaryNameserver string `json:"master,omitempty"`
21 NotifiedSerial *types.FlexInt `json:"notified_serial,omitempty"`
22 Contact string `json:"contact,omitempty"`
23 }
24
25 type DNSZoneList struct {
26 liquidweb.ListMeta
27 Items []DNSZone `json:"items,omitempty"`
28 }
29
30 // DNSRecordParams is the set of parameters used when creating or updating a DNS record.
31 type DNSRecordParams struct {
32 ID int `json:"id,omitempty"`
33 Name string `json:"name,omitempty"`
34 Prio int `json:"prio,omitempty"`
35 RData string `json:"rdata,omitempty"`
36 TTL int `json:"ttl,omitempty"`
37 Type string `json:"type,omitempty"`
38 Zone string `json:"zone,omitempty"`
39 ZoneID int `json:"zone_id,omitempty"`
40 AdminEmail string `json:"adminEmail,omitempty"`
41 Created string `json:"created,omitempty"`
42 Exchange string `json:"exchange,omitempty"`
43 Expiry int `json:"expiry,omitempty"`
44 FullData string `json:"fullData,omitempty"`
45 LastUpdated string `json:"last_updated,omitempty"`
46 Minimum int `json:"minimum,omitempty"`
47 Nameserver string `json:"nameserver,omitempty"`
48 Port int `json:"port,omitempty"`
49 RefreshInterval int `json:"refreshInterval,omitempty"`
50 RegionOverrides *RegionOverrides `json:"regionOverrides,omitempty"`
51 Retry int `json:"retry,omitempty"`
52 Serial int `json:"serial,omitempty"`
53 Target string `json:"target,omitempty"`
54 Weight int `json:"weight,omitempty"`
55 PageNum int `json:"page_num,omitempty"`
56 }
57
58 // RegionOverrides contains region data.
59 type RegionOverrides struct {
60 RData string
61 Region string
62 RegionID int
63 }
64
65 // DNSRecord is the resource representing a DNS record entry.
66 type DNSRecord struct {
67 ID types.FlexInt `json:"id,omitempty"`
68 Name string `json:"name,omitempty"`
69 Prio types.FlexInt `json:"prio,omitempty"`
70 RData string `json:"rdata,omitempty"`
71 TTL types.FlexInt `json:"ttl,omitempty"`
72 Type string `json:"type,omitempty"`
73 Zone string `json:"zone,omitempty"`
74 ZoneID types.FlexInt `json:"zone_id,omitempty"`
75 AdminEmail string `json:"adminEmail,omitempty"`
76 Created string `json:"created,omitempty"`
77 Exchange string `json:"exchange,omitempty"`
78 Expiry types.FlexInt `json:"expiry,omitempty"`
79 FullData string `json:"fullData,omitempty"`
80 LastUpdated string `json:"last_updated,omitempty"`
81 Minimum types.FlexInt `json:"minimum,omitempty"`
82 Nameserver string `json:"nameserver,omitempty"`
83 Port types.FlexInt `json:"port,omitempty"`
84 RefreshInterval types.FlexInt `json:"refreshInterval,omitempty"`
85 RegionOverrides *RegionOverrides `json:"regionOverrides,omitempty"`
86 Retry types.FlexInt `json:"retry,omitempty"`
87 Serial types.FlexInt `json:"serial,omitempty"`
88 Target string `json:"target,omitempty"`
89 Weight types.FlexInt `json:"weight,omitempty"`
90 }
91
92 // DNSRecordList is an envelope for the API result containing either a list of DNS Records or an error.
93 type DNSRecordList struct {
94 liquidweb.ListMeta
95 Items []DNSRecord `json:"items,omitempty"`
96 }
97
98 // DNSRecordDeletion represents the API result when deleting a DNS Record.
99 type DNSRecordDeletion struct {
100 Deleted types.FlexInt `json:"deleted"`
101 }
102