Skip to content

Commit

Permalink
Merge pull request #2986 from janik-cloudflare/dns-record-zone-name
Browse files Browse the repository at this point in the history
Remove deprecated zone fields on DNS records
  • Loading branch information
jacobbednarz authored Sep 2, 2024
2 parents 5e55156 + fe15c7b commit 933dac0
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 38 deletions.
3 changes: 3 additions & 0 deletions .changelog/2986.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:breaking-change
dns: removed deprecated `ZoneID` and `ZoneName` fields
```
4 changes: 0 additions & 4 deletions dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ type DNSRecord struct {
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"`
Expand Down Expand Up @@ -185,8 +183,6 @@ type CreateDNSRecordParams struct {
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"`
Expand Down
24 changes: 0 additions & 24 deletions dns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ func TestCreateDNSRecord(t *testing.T) {
"proxiable": true,
"proxied": false,
"ttl": 120,
"zone_id": "d56084adb405e0b7e32c52321bf07be6",
"zone_name": "example.com",
"created_on": "2014-01-01T05:20:00Z",
"modified_on": "2014-01-01T05:20:00Z",
"data": {},
Expand All @@ -123,8 +121,6 @@ func TestCreateDNSRecord(t *testing.T) {
Proxiable: true,
Proxied: asciiInput.Proxied,
TTL: asciiInput.TTL,
ZoneID: testZoneID,
ZoneName: "example.com",
CreatedOn: createdOn,
ModifiedOn: modifiedOn,
Data: map[string]interface{}{},
Expand Down Expand Up @@ -179,8 +175,6 @@ func TestListDNSRecords(t *testing.T) {
"proxiable": true,
"proxied": false,
"ttl": 120,
"zone_id": "d56084adb405e0b7e32c52321bf07be6",
"zone_name": "example.com",
"created_on": "2014-01-01T05:20:00Z",
"modified_on": "2014-01-01T05:20:00Z",
"data": {},
Expand Down Expand Up @@ -212,8 +206,6 @@ func TestListDNSRecords(t *testing.T) {
Proxiable: true,
Proxied: &proxied,
TTL: 120,
ZoneID: testZoneID,
ZoneName: "example.com",
CreatedOn: createdOn,
ModifiedOn: modifiedOn,
Data: map[string]interface{}{},
Expand Down Expand Up @@ -272,8 +264,6 @@ func TestListDNSRecordsSearch(t *testing.T) {
"proxiable": true,
"proxied": true,
"ttl": 120,
"zone_id": "d56084adb405e0b7e32c52321bf07be6",
"zone_name": "example.com",
"created_on": "2014-01-01T05:20:00Z",
"modified_on": "2014-01-01T05:20:00Z",
"data": {},
Expand Down Expand Up @@ -306,8 +296,6 @@ func TestListDNSRecordsSearch(t *testing.T) {
Proxiable: true,
Proxied: &proxied,
TTL: 120,
ZoneID: testZoneID,
ZoneName: "example.com",
CreatedOn: createdOn,
ModifiedOn: modifiedOn,
Data: map[string]interface{}{},
Expand Down Expand Up @@ -403,8 +391,6 @@ func TestListDNSRecordsPagination(t *testing.T) {
assert.Equal(t, expected["proxiable"].(bool), actualRecord.Proxiable)
assert.Equal(t, expected["proxied"].(bool), *actualRecord.Proxied)
assert.Equal(t, int(expected["ttl"].(float64)), actualRecord.TTL)
assert.Equal(t, expected["zone_id"].(string), actualRecord.ZoneID)
assert.Equal(t, expected["zone_name"].(string), actualRecord.ZoneName)
assert.Equal(t, expected["data"], actualRecord.Data)
assert.Equal(t, expected["meta"], actualRecord.Meta)
}
Expand All @@ -430,8 +416,6 @@ func TestGetDNSRecord(t *testing.T) {
"proxiable": true,
"proxied": false,
"ttl": 120,
"zone_id": "d56084adb405e0b7e32c52321bf07be6",
"zone_name": "example.com",
"created_on": "2014-01-01T05:20:00Z",
"modified_on": "2014-01-01T05:20:00Z",
"data": {},
Expand Down Expand Up @@ -460,8 +444,6 @@ func TestGetDNSRecord(t *testing.T) {
Proxiable: true,
Proxied: &proxied,
TTL: 120,
ZoneID: testZoneID,
ZoneName: "example.com",
CreatedOn: createdOn,
ModifiedOn: modifiedOn,
Data: map[string]interface{}{},
Expand Down Expand Up @@ -521,8 +503,6 @@ func TestUpdateDNSRecord(t *testing.T) {
"proxiable": true,
"proxied": false,
"ttl": 120,
"zone_id": "d56084adb405e0b7e32c52321bf07be6",
"zone_name": "example.com",
"created_on": "2014-01-01T05:20:00Z",
"modified_on": "2014-01-01T05:20:00Z",
"data": {},
Expand Down Expand Up @@ -586,8 +566,6 @@ func TestUpdateDNSRecord_ClearComment(t *testing.T) {
"proxiable": true,
"proxied": false,
"ttl": 120,
"zone_id": "d56084adb405e0b7e32c52321bf07be6",
"zone_name": "example.com",
"created_on": "2014-01-01T05:20:00Z",
"modified_on": "2014-01-01T05:20:00Z",
"comment":null,
Expand Down Expand Up @@ -642,8 +620,6 @@ func TestUpdateDNSRecord_KeepComment(t *testing.T) {
"proxiable": true,
"proxied": false,
"ttl": 120,
"zone_id": "d56084adb405e0b7e32c52321bf07be6",
"zone_name": "example.com",
"created_on": "2014-01-01T05:20:00Z",
"modified_on": "2014-01-01T05:20:00Z",
"comment":null,
Expand Down
6 changes: 0 additions & 6 deletions testdata/fixtures/dns/list_page_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
"proxiable": true,
"proxied": true,
"ttl": 120,
"zone_id": "d56084adb405e0b7e32c52321bf07be6",
"zone_name": "example.com",
"created_on": "2014-01-01T05:20:00Z",
"modified_on": "2014-01-01T05:20:00Z",
"data": {},
Expand All @@ -33,8 +31,6 @@
"proxiable": true,
"proxied": false,
"ttl": 120,
"zone_id": "d56084adb405e0b7e32c52321bf07be6",
"zone_name": "example.com",
"created_on": "2014-01-01T05:20:00Z",
"modified_on": "2014-01-01T05:20:00Z",
"data": {},
Expand All @@ -55,8 +51,6 @@
"proxiable": true,
"proxied": true,
"ttl": 120,
"zone_id": "d56084adb405e0b7e32c52321bf07be6",
"zone_name": "example.com",
"created_on": "2014-01-01T05:20:00Z",
"modified_on": "2014-01-01T05:20:00Z",
"data": {},
Expand Down
4 changes: 0 additions & 4 deletions testdata/fixtures/dns/list_page_2.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
"proxiable": true,
"proxied": false,
"ttl": 120,
"zone_id": "d56084adb405e0b7e32c52321bf07be6",
"zone_name": "example.com",
"created_on": "2014-01-01T05:20:00Z",
"modified_on": "2014-01-01T05:20:00Z",
"data": {},
Expand All @@ -33,8 +31,6 @@
"proxiable": true,
"proxied": false,
"ttl": 120,
"zone_id": "d56084adb405e0b7e32c52321bf07be6",
"zone_name": "example.com",
"created_on": "2014-01-01T05:20:00Z",
"modified_on": "2014-01-01T05:20:00Z",
"data": {},
Expand Down

0 comments on commit 933dac0

Please sign in to comment.