Skip to content

Commit

Permalink
rename BackupPolicyCreateRequest to DropletBackupPolicyRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
loosla committed Oct 31, 2024
1 parent 1abca82 commit 6ae90e3
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 36 deletions.
70 changes: 35 additions & 35 deletions droplets.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,43 +221,43 @@ func (d DropletCreateSSHKey) MarshalJSON() ([]byte, error) {

// DropletCreateRequest represents a request to create a Droplet.
type DropletCreateRequest struct {
Name string `json:"name"`
Region string `json:"region"`
Size string `json:"size"`
Image DropletCreateImage `json:"image"`
SSHKeys []DropletCreateSSHKey `json:"ssh_keys"`
Backups bool `json:"backups"`
IPv6 bool `json:"ipv6"`
PrivateNetworking bool `json:"private_networking"`
Monitoring bool `json:"monitoring"`
UserData string `json:"user_data,omitempty"`
Volumes []DropletCreateVolume `json:"volumes,omitempty"`
Tags []string `json:"tags"`
VPCUUID string `json:"vpc_uuid,omitempty"`
WithDropletAgent *bool `json:"with_droplet_agent,omitempty"`
BackupPolicy *BackupPolicyCreateRequest `json:"backup_policy,omitempty"`
Name string `json:"name"`
Region string `json:"region"`
Size string `json:"size"`
Image DropletCreateImage `json:"image"`
SSHKeys []DropletCreateSSHKey `json:"ssh_keys"`
Backups bool `json:"backups"`
IPv6 bool `json:"ipv6"`
PrivateNetworking bool `json:"private_networking"`
Monitoring bool `json:"monitoring"`
UserData string `json:"user_data,omitempty"`
Volumes []DropletCreateVolume `json:"volumes,omitempty"`
Tags []string `json:"tags"`
VPCUUID string `json:"vpc_uuid,omitempty"`
WithDropletAgent *bool `json:"with_droplet_agent,omitempty"`
BackupPolicy *DropletBackupPolicyRequest `json:"backup_policy,omitempty"`
}

// DropletMultiCreateRequest is a request to create multiple Droplets.
type DropletMultiCreateRequest struct {
Names []string `json:"names"`
Region string `json:"region"`
Size string `json:"size"`
Image DropletCreateImage `json:"image"`
SSHKeys []DropletCreateSSHKey `json:"ssh_keys"`
Backups bool `json:"backups"`
IPv6 bool `json:"ipv6"`
PrivateNetworking bool `json:"private_networking"`
Monitoring bool `json:"monitoring"`
UserData string `json:"user_data,omitempty"`
Tags []string `json:"tags"`
VPCUUID string `json:"vpc_uuid,omitempty"`
WithDropletAgent *bool `json:"with_droplet_agent,omitempty"`
BackupPolicy *BackupPolicyCreateRequest `json:"backup_policy,omitempty"`
}

// BackupPolicyCreateRequest defines the backup policy when creating a Droplet.
type BackupPolicyCreateRequest struct {
Names []string `json:"names"`
Region string `json:"region"`
Size string `json:"size"`
Image DropletCreateImage `json:"image"`
SSHKeys []DropletCreateSSHKey `json:"ssh_keys"`
Backups bool `json:"backups"`
IPv6 bool `json:"ipv6"`
PrivateNetworking bool `json:"private_networking"`
Monitoring bool `json:"monitoring"`
UserData string `json:"user_data,omitempty"`
Tags []string `json:"tags"`
VPCUUID string `json:"vpc_uuid,omitempty"`
WithDropletAgent *bool `json:"with_droplet_agent,omitempty"`
BackupPolicy *DropletBackupPolicyRequest `json:"backup_policy,omitempty"`
}

// DropletBackupPolicyRequest defines the backup policy when creating a Droplet.
type DropletBackupPolicyRequest struct {
Plan string `json:"plan,omitempty"`
Weekday string `json:"weekday,omitempty"`
Hour int `json:"hour,omitempty"`
Expand Down Expand Up @@ -655,8 +655,8 @@ type dropletBackupPolicyRoot struct {

type dropletBackupPoliciesRoot struct {
DropletBackupPolicies map[int]*DropletBackupPolicy `json:"policies,omitempty"`
Links *Links `json:"links,omitempty"`
Meta *Meta `json:"meta"`
Links *Links `json:"links,omitempty"`
Meta *Meta `json:"meta"`
}

// Get individual droplet backup policy.
Expand Down
2 changes: 1 addition & 1 deletion droplets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ func TestDroplets_Create(t *testing.T) {
},
Tags: []string{"one", "two"},
VPCUUID: "880b7f98-f062-404d-b33c-458d545696f6",
BackupPolicy: &BackupPolicyCreateRequest{
BackupPolicy: &DropletBackupPolicyRequest{
Plan: "weekly",
Weekday: "MON",
},
Expand Down

0 comments on commit 6ae90e3

Please sign in to comment.