Skip to content

Commit

Permalink
rename BackupPolicy to DropletBackupPolicyConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
loosla committed Oct 31, 2024
1 parent 3a7bfd2 commit 82f2809
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions droplets.go
Original file line number Diff line number Diff line change
Expand Up @@ -633,14 +633,14 @@ func (s *DropletsServiceOp) dropletActionStatus(ctx context.Context, uri string)

// DropletBackupPolicy defines the information about a droplet's backup policy.
type DropletBackupPolicy struct {
DropletID int `json:"droplet_id,omitempty"`
BackupEnabled bool `json:"backup_enabled,omitempty"`
BackupPolicy *BackupPolicy `json:"backup_policy,omitempty"`
NextBackupWindow *BackupWindow `json:"next_backup_window,omitempty"`
DropletID int `json:"droplet_id,omitempty"`
BackupEnabled bool `json:"backup_enabled,omitempty"`
BackupPolicy *DropletBackupPolicyConfig `json:"backup_policy,omitempty"`
NextBackupWindow *BackupWindow `json:"next_backup_window,omitempty"`
}

// BackupPolicy defines the backup policy for a Droplet.
type BackupPolicy struct {
// DropletBackupPolicyConfig defines the backup policy for a Droplet.
type DropletBackupPolicyConfig struct {
Plan string `json:"plan,omitempty"`
Weekday string `json:"weekday,omitempty"`
Hour int `json:"hour,omitempty"`
Expand Down
4 changes: 2 additions & 2 deletions droplets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ func TestDroplets_GetBackupPolicy(t *testing.T) {
expected := &DropletBackupPolicy{
DropletID: 12345,
BackupEnabled: true,
BackupPolicy: &BackupPolicy{
BackupPolicy: &DropletBackupPolicyConfig{
Plan: "weekly",
Weekday: "SUN",
Hour: 0,
Expand Down Expand Up @@ -1026,7 +1026,7 @@ func TestDroplets_ListBackupPolicies(t *testing.T) {
testBackupPolicy := DropletBackupPolicy{
DropletID: 12345,
BackupEnabled: true,
BackupPolicy: &BackupPolicy{
BackupPolicy: &DropletBackupPolicyConfig{
Plan: "weekly",
Weekday: "SUN",
Hour: 0,
Expand Down

0 comments on commit 82f2809

Please sign in to comment.