diff --git a/syntheticsclientv2/common_models.go b/syntheticsclientv2/common_models.go index bc54a75..9d02219 100644 --- a/syntheticsclientv2/common_models.go +++ b/syntheticsclientv2/common_models.go @@ -229,6 +229,7 @@ type DowntimeConfiguration struct { Testcount int `json:"testCount,omitempty"` Testids []int `json:"testIds,omitempty"` Recurrence *Recurrence `json:"recurrence"` + Timezone *string `json:"timezone,omitempty"` } type DeleteCheck struct { diff --git a/syntheticsclientv2/create_downtimeconfigurationv2_test.go b/syntheticsclientv2/create_downtimeconfigurationv2_test.go index 1c06f39..f368633 100644 --- a/syntheticsclientv2/create_downtimeconfigurationv2_test.go +++ b/syntheticsclientv2/create_downtimeconfigurationv2_test.go @@ -26,7 +26,7 @@ import ( ) var ( - createDowntimeConfigurationV2Body = `{"downtimeConfiguration":{"name":"dc test","description":"My super awesome test downtimeConfiguration","rule":"augment_data","testIds":[482],"startTime":"2024-05-16T20:23:00.000Z","endTime":"2024-05-16T20:38:00.000Z","recurrence":{"repeats":{"type":"daily"},"end":{"type":"after","value":"10"}}}}` + createDowntimeConfigurationV2Body = `{"downtimeConfiguration":{"name":"dc test","description":"My super awesome test downtimeConfiguration","rule":"augment_data","testIds":[482],"startTime":"2024-05-16T20:23:00.000Z","endTime":"2024-05-16T20:38:00.000Z","timezone":"UTC","recurrence":{"repeats":{"type":"daily"},"end":{"type":"after","value":"10"}}}}` inputDowntimeConfigurationV2Data = DowntimeConfigurationV2Input{} ) @@ -83,4 +83,8 @@ func TestCreateDowntimeConfigurationV2(t *testing.T) { t.Errorf("returned \n\n%#v want \n\n%#v", resp.DowntimeConfiguration.Recurrence, inputDowntimeConfigurationV2Data.DowntimeConfiguration.Recurrence) } + if !reflect.DeepEqual(resp.DowntimeConfiguration.Timezone, inputDowntimeConfigurationV2Data.DowntimeConfiguration.Timezone) { + t.Errorf("returned \n\n%#v want \n\n%#v", resp.DowntimeConfiguration.Timezone, inputDowntimeConfigurationV2Data.DowntimeConfiguration.Timezone) + } + } diff --git a/syntheticsclientv2/get_downtimeconfigurationsv2_test.go b/syntheticsclientv2/get_downtimeconfigurationsv2_test.go index bfbbf63..d9fe4c2 100644 --- a/syntheticsclientv2/get_downtimeconfigurationsv2_test.go +++ b/syntheticsclientv2/get_downtimeconfigurationsv2_test.go @@ -27,9 +27,9 @@ import ( var ( getDowntimeConfigurationsV2Body = `{"page":1,"perPage":50}` inputGetDowntimeConfigurationsV2 = verifyDowntimeConfigurationsV2Input(string(getDowntimeConfigurationsV2Body)) - getDowntimeConfigurationsV2Output = `{"downtimeConfigurations":[{"id":1,"name":"dc test","description":"My super awesome test downtimeConfiguration","rule":"pause_tests","startTime":"2024-05-16T20:23:00.000Z","endTime":"2024-05-16T20:38:00.000Z","status":"scheduled","createdAt":"2024-05-15T20:24:07.541Z","updatedAt":"2024-05-15T20:25:44.211Z","testsUpdatedAt":"2024-05-15T20:24:07.541Z","testCount":1,"recurrence":{"repeats":{"type":"daily"},"end":{"type":"after","value":"10"}}}],"page":1,"pageLimit":1,"totalCount":1}` + getDowntimeConfigurationsV2Output = `{"downtimeConfigurations":[{"id":1,"name":"dc test","description":"My super awesome test downtimeConfiguration","rule":"pause_tests","startTime":"2024-05-16T20:23:00.000Z","endTime":"2024-05-16T20:38:00.000Z","status":"scheduled","createdAt":"2024-05-15T20:24:07.541Z","updatedAt":"2024-05-15T20:25:44.211Z","testsUpdatedAt":"2024-05-15T20:24:07.541Z","testCount":1,"timezone":"UTC","recurrence":{"repeats":{"type":"daily"},"end":{"type":"after","value":"10"}}}],"page":1,"pageLimit":1,"totalCount":1}` downtimeConfigurationsV2Output = &DowntimeConfigurationsV2Response{} - getDowntimeConfigurationV2Body = `{"downtimeConfiguration":{"id":1,"name":"dc test","description":"My super awesome test downtimeConfiguration","rule":"pause_tests","startTime":"2024-05-16T20:23:00.000Z","endTime":"2024-05-16T20:38:00.000Z","status":"scheduled","createdAt":"2024-05-15T20:24:07.541Z","updatedAt":"2024-05-15T20:25:44.211Z","testsUpdatedAt":"2024-05-15T20:24:07.541Z","testIds":[29976],"recurrence":{"repeats":{"type":"daily"},"end":{"type":"after","value":"10"}}}}` + getDowntimeConfigurationV2Body = `{"downtimeConfiguration":{"id":1,"name":"dc test","description":"My super awesome test downtimeConfiguration","rule":"pause_tests","startTime":"2024-05-16T20:23:00.000Z","endTime":"2024-05-16T20:38:00.000Z","status":"scheduled","createdAt":"2024-05-15T20:24:07.541Z","updatedAt":"2024-05-15T20:25:44.211Z","testsUpdatedAt":"2024-05-15T20:24:07.541Z","testIds":[29976],"timezone":"UTC","recurrence":{"repeats":{"type":"daily"},"end":{"type":"after","value":"10"}}}}` inputGetDowntimeConfigurationV2 = verifyDowntimeConfigurationV2Input(string(getDowntimeConfigurationV2Body)) ) @@ -94,6 +94,10 @@ func TestGetDowntimeConfigurationV2(t *testing.T) { t.Errorf("returned \n\n%#v want \n\n%#v", resp.DowntimeConfiguration.Recurrence, inputGetDowntimeConfigurationV2.DowntimeConfiguration.Recurrence) } + if !reflect.DeepEqual(resp.DowntimeConfiguration.Timezone, inputGetDowntimeConfigurationV2.DowntimeConfiguration.Timezone) { + t.Errorf("returned \n\n%#v want \n\n%#v", resp.DowntimeConfiguration.Timezone, inputGetDowntimeConfigurationV2.DowntimeConfiguration.Timezone) + } + } func verifyDowntimeConfigurationV2Input(stringInput string) *DowntimeConfigurationV2Response {