Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: incorrect data type in UpdateCustomNameserverZoneMetadataParams #1410

Merged
merged 4 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/1410.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
cloudflare: fix incorrect data type in UpdateCustomNameserverZoneMetadataParams struct
rwhelan marked this conversation as resolved.
Show resolved Hide resolved
```
6 changes: 2 additions & 4 deletions custom_nameservers.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ type GetEligibleZonesAccountCustomNameserversParams struct{}
type GetCustomNameserverZoneMetadataParams struct{}

type UpdateCustomNameserverZoneMetadataParams struct {
Type string `json:"type"`
NSSet string `json:"ns_set"`
Enabled bool `json:"enabled"`
NSSet int `json:"ns_set"`
Enabled bool `json:"enabled"`
}

// GetCustomNameservers lists custom nameservers.
Expand Down Expand Up @@ -200,7 +199,6 @@ func (api *API) UpdateCustomNameserverZoneMetadata(ctx context.Context, rc *Reso

uri := fmt.Sprintf("/%s/%s/custom_ns", rc.Level, rc.Identifier)

params.Type = ""
_, err := api.makeRequestContext(ctx, http.MethodPut, uri, params)
if err != nil {
return err
Expand Down
2 changes: 0 additions & 2 deletions custom_nameservers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ func TestAccountCustomNameserver_GetAccountCustomNameserverZoneMetadata(t *testi
w.Header().Set("content-type", "application/json")
fmt.Fprintf(w, `{
"result": {
"type": "account",
"ns_set": "1",
rwhelan marked this conversation as resolved.
Show resolved Hide resolved
"enabled": true
},
Expand All @@ -208,7 +207,6 @@ func TestAccountCustomNameserver_GetAccountCustomNameserverZoneMetadata(t *testi

mux.HandleFunc("/zones/"+testZoneID+"/custom_ns", handler)
want := CustomNameserverZoneMetadata{
Type: "account",
NSSet: "1",
rwhelan marked this conversation as resolved.
Show resolved Hide resolved
Enabled: true,
}
Expand Down