diff --git a/droplets.go b/droplets.go index ddc9fc3..0366da7 100644 --- a/droplets.go +++ b/droplets.go @@ -260,7 +260,7 @@ type DropletMultiCreateRequest struct { type DropletBackupPolicyRequest struct { Plan string `json:"plan,omitempty"` Weekday string `json:"weekday,omitempty"` - Hour int `json:"hour,omitempty"` + Hour int `json:"hour"` // Avoid using omitempty to ensure zero values are included in the JSON output. } func (d DropletCreateRequest) String() string { diff --git a/droplets_test.go b/droplets_test.go index 4b68f5d..8ec0a85 100644 --- a/droplets_test.go +++ b/droplets_test.go @@ -321,9 +321,11 @@ func TestDroplets_Create(t *testing.T) { }, Tags: []string{"one", "two"}, VPCUUID: "880b7f98-f062-404d-b33c-458d545696f6", + Backups: true, BackupPolicy: &DropletBackupPolicyRequest{ Plan: "weekly", Weekday: "MON", + Hour: 0, }, } @@ -334,7 +336,6 @@ func TestDroplets_Create(t *testing.T) { "size": "size", "image": float64(1), "ssh_keys": nil, - "backups": false, "ipv6": false, "private_networking": false, "monitoring": false, @@ -344,7 +345,8 @@ func TestDroplets_Create(t *testing.T) { }, "tags": []interface{}{"one", "two"}, "vpc_uuid": "880b7f98-f062-404d-b33c-458d545696f6", - "backup_policy": map[string]interface{}{"plan": "weekly", "weekday": "MON"}, + "backups": true, + "backup_policy": map[string]interface{}{"plan": "weekly", "weekday": "MON", "hour": float64(0)}, } jsonBlob := ` {