diff --git a/dns.go b/dns.go index 198bdc13d62..c56902e53df 100644 --- a/dns.go +++ b/dns.go @@ -41,23 +41,23 @@ func (c DNSRecordComment) MarshalJSON() ([]byte, error) { // DNSRecord represents a DNS record in a zone. type DNSRecord struct { - CreatedOn time.Time `json:"created_on,omitempty"` - ModifiedOn time.Time `json:"modified_on,omitempty"` - Type string `json:"type,omitempty"` - Name string `json:"name,omitempty"` - Content string `json:"content,omitempty"` - Meta interface{} `json:"meta,omitempty"` - Data interface{} `json:"data,omitempty"` // data returned by: SRV, LOC - ID string `json:"id,omitempty"` - ZoneID string `json:"zone_id,omitempty"` - ZoneName string `json:"zone_name,omitempty"` - Priority *uint16 `json:"priority,omitempty"` - TTL int `json:"ttl,omitempty"` - Proxied *bool `json:"proxied,omitempty"` - Proxiable bool `json:"proxiable,omitempty"` - Locked bool `json:"locked,omitempty"` - Comment DNSRecordComment `json:"comment,omitempty"` - Tags []string `json:"tags,omitempty"` + CreatedOn time.Time `json:"created_on,omitempty"` + ModifiedOn time.Time `json:"modified_on,omitempty"` + Type string `json:"type,omitempty"` + Name string `json:"name,omitempty"` + Content string `json:"content,omitempty"` + Meta interface{} `json:"meta,omitempty"` + Data interface{} `json:"data,omitempty"` // data returned by: SRV, LOC + ID string `json:"id,omitempty"` + ZoneID string `json:"zone_id,omitempty"` + ZoneName string `json:"zone_name,omitempty"` + Priority *uint16 `json:"priority,omitempty"` + TTL int `json:"ttl,omitempty"` + Proxied *bool `json:"proxied,omitempty"` + Proxiable bool `json:"proxiable,omitempty"` + Locked bool `json:"locked,omitempty"` + Comment *DNSRecordComment `json:"comment,omitempty"` + Tags []string `json:"tags,omitempty"` } // DNSRecordResponse represents the response from the DNS endpoint. @@ -138,23 +138,23 @@ func toUTS46ASCII(name string) string { } type CreateDNSRecordParams struct { - CreatedOn time.Time `json:"created_on,omitempty" url:"created_on,omitempty"` - ModifiedOn time.Time `json:"modified_on,omitempty" url:"modified_on,omitempty"` - Type string `json:"type,omitempty" url:"type,omitempty"` - Name string `json:"name,omitempty" url:"name,omitempty"` - Content string `json:"content,omitempty" url:"content,omitempty"` - Meta interface{} `json:"meta,omitempty"` - Data interface{} `json:"data,omitempty"` // data returned by: SRV, LOC - ID string `json:"id,omitempty"` - ZoneID string `json:"zone_id,omitempty"` - ZoneName string `json:"zone_name,omitempty"` - Priority *uint16 `json:"priority,omitempty"` - TTL int `json:"ttl,omitempty"` - Proxied *bool `json:"proxied,omitempty" url:"proxied,omitempty"` - Proxiable bool `json:"proxiable,omitempty"` - Locked bool `json:"locked,omitempty"` - Comment DNSRecordComment `json:"comment,omitempty" url:"comment,omitempty"` - Tags []string `json:"tags,omitempty"` + CreatedOn time.Time `json:"created_on,omitempty" url:"created_on,omitempty"` + ModifiedOn time.Time `json:"modified_on,omitempty" url:"modified_on,omitempty"` + Type string `json:"type,omitempty" url:"type,omitempty"` + Name string `json:"name,omitempty" url:"name,omitempty"` + Content string `json:"content,omitempty" url:"content,omitempty"` + Meta interface{} `json:"meta,omitempty"` + Data interface{} `json:"data,omitempty"` // data returned by: SRV, LOC + ID string `json:"id,omitempty"` + ZoneID string `json:"zone_id,omitempty"` + ZoneName string `json:"zone_name,omitempty"` + Priority *uint16 `json:"priority,omitempty"` + TTL int `json:"ttl,omitempty"` + Proxied *bool `json:"proxied,omitempty" url:"proxied,omitempty"` + Proxiable bool `json:"proxiable,omitempty"` + Locked bool `json:"locked,omitempty"` + Comment *DNSRecordComment `json:"comment,omitempty" url:"comment,omitempty"` + Tags []string `json:"tags,omitempty"` } // CreateDNSRecord creates a DNS record for the zone identifier. diff --git a/dns_test.go b/dns_test.go index 08a55e4eb85..8538b0e0e3f 100644 --- a/dns_test.go +++ b/dns_test.go @@ -382,6 +382,7 @@ func TestDNSRecord(t *testing.T) { mux.HandleFunc("/zones/"+testZoneID+"/dns_records/"+dnsRecordID, handler) proxied := false + comment := DNSRecordComment("This is a comment") createdOn, _ := time.Parse(time.RFC3339, "2014-01-01T05:20:00Z") modifiedOn, _ := time.Parse(time.RFC3339, "2014-01-01T05:20:00Z") want := DNSRecord{ @@ -401,7 +402,7 @@ func TestDNSRecord(t *testing.T) { "auto_added": true, "source": "primary", }, - Comment: "This is a comment", + Comment: &comment, Tags: []string{"tag1", "tag2"}, }