Skip to content

Commit

Permalink
fix: Make WeekOfMonth nullable (#252)
Browse files Browse the repository at this point in the history
* Make WeekOfMonth nullable
  • Loading branch information
LBGarber authored May 25, 2022
1 parent 0117d4b commit c460a58
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ type MySQLDatabaseMaintenanceWindow struct {
Duration int `json:"duration"`
Frequency DatabaseMaintenanceFrequency `json:"frequency"`
HourOfDay int `json:"hour_of_day"`
WeekOfMonth int `json:"week_of_month,omitempty"`
WeekOfMonth *int `json:"week_of_month"`
}

// MySQLUpdateOptions fields are used when altering the existing MySQL Database
Expand Down
4 changes: 3 additions & 1 deletion test/integration/databases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,14 @@ func TestDatabase_Suite(t *testing.T) {
t.Errorf("got wrong db from GetMySQLDatabase: %v", db)
}

week := 3

updatedWindow := linodego.MySQLDatabaseMaintenanceWindow{
DayOfWeek: linodego.DatabaseMaintenanceDayWednesday,
Duration: 1,
Frequency: linodego.DatabaseMaintenanceFrequencyMonthly,
HourOfDay: 8,
WeekOfMonth: 3,
WeekOfMonth: &week,
}

opts := linodego.MySQLUpdateOptions{
Expand Down

0 comments on commit c460a58

Please sign in to comment.