diff --git a/.changelog/1410.txt b/.changelog/1410.txt index adad3ab47c6..589d96d96af 100644 --- a/.changelog/1410.txt +++ b/.changelog/1410.txt @@ -1,3 +1,3 @@ ```release-note:bug -cloudflare: fix incorrect data type in UpdateCustomNameserverZoneMetadataParams struct +custom_nameservers: change `NSSet` from string to int to match API response ``` diff --git a/custom_nameservers.go b/custom_nameservers.go index 4c9b017bd1c..dda3003c579 100644 --- a/custom_nameservers.go +++ b/custom_nameservers.go @@ -28,9 +28,8 @@ type CustomNameserverResult struct { } type CustomNameserverZoneMetadata struct { - Type string `json:"type"` - NSSet string `json:"ns_set"` - Enabled bool `json:"enabled"` + NSSet int `json:"ns_set"` + Enabled bool `json:"enabled"` } type customNameserverListResponse struct { diff --git a/custom_nameservers_test.go b/custom_nameservers_test.go index 3f5384cf2ac..423205cac6a 100644 --- a/custom_nameservers_test.go +++ b/custom_nameservers_test.go @@ -196,7 +196,7 @@ func TestAccountCustomNameserver_GetAccountCustomNameserverZoneMetadata(t *testi w.Header().Set("content-type", "application/json") fmt.Fprintf(w, `{ "result": { - "ns_set": "1", + "ns_set": 1, "enabled": true }, "success": true, @@ -207,7 +207,7 @@ func TestAccountCustomNameserver_GetAccountCustomNameserverZoneMetadata(t *testi mux.HandleFunc("/zones/"+testZoneID+"/custom_ns", handler) want := CustomNameserverZoneMetadata{ - NSSet: "1", + NSSet: 1, Enabled: true, }