From c460a58b248c28dfe6b82758e81c738c588c131d Mon Sep 17 00:00:00 2001 From: Lena Garber Date: Wed, 25 May 2022 13:00:05 -0400 Subject: [PATCH] fix: Make WeekOfMonth nullable (#252) * Make WeekOfMonth nullable --- mysql.go | 2 +- test/integration/databases_test.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mysql.go b/mysql.go index f9252f36a..8c2d1a4a4 100644 --- a/mysql.go +++ b/mysql.go @@ -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 diff --git a/test/integration/databases_test.go b/test/integration/databases_test.go index b4353580a..ddec3b4b4 100644 --- a/test/integration/databases_test.go +++ b/test/integration/databases_test.go @@ -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{