@@ -231,7 +231,7 @@ func resourceCheck() *schema.Resource {
231
231
Description : "An array of one or more private locations slugs." ,
232
232
},
233
233
"alert_settings" : {
234
- Type : schema .TypeSet ,
234
+ Type : schema .TypeList ,
235
235
Optional : true ,
236
236
Computed : true ,
237
237
MaxItems : 1 ,
@@ -243,8 +243,9 @@ func resourceCheck() *schema.Resource {
243
243
Description : "Determines what type of escalation to use. Possible values are `RUN_BASED` or `TIME_BASED`." ,
244
244
},
245
245
"run_based_escalation" : {
246
- Type : schema .TypeSet ,
246
+ Type : schema .TypeList ,
247
247
Optional : true ,
248
+ Computed : true ,
248
249
Elem : & schema.Resource {
249
250
Schema : map [string ]* schema.Schema {
250
251
"failed_run_threshold" : {
@@ -256,8 +257,9 @@ func resourceCheck() *schema.Resource {
256
257
},
257
258
},
258
259
"time_based_escalation" : {
259
- Type : schema .TypeSet ,
260
+ Type : schema .TypeList ,
260
261
Optional : true ,
262
+ Computed : true ,
261
263
Elem : & schema.Resource {
262
264
Schema : map [string ]* schema.Schema {
263
265
"minutes_failing_threshold" : {
@@ -269,8 +271,9 @@ func resourceCheck() *schema.Resource {
269
271
},
270
272
},
271
273
"reminders" : {
272
- Type : schema .TypeSet ,
274
+ Type : schema .TypeList ,
273
275
Optional : true ,
276
+ Computed : true ,
274
277
Elem : & schema.Resource {
275
278
Schema : map [string ]* schema.Schema {
276
279
"amount" : {
@@ -288,8 +291,9 @@ func resourceCheck() *schema.Resource {
288
291
},
289
292
},
290
293
"parallel_run_failure_threshold" : {
291
- Type : schema .TypeSet ,
294
+ Type : schema .TypeList ,
292
295
Optional : true ,
296
+ Computed : true ,
293
297
Elem : & schema.Resource {
294
298
Schema : map [string ]* schema.Schema {
295
299
"enabled" : {
@@ -799,7 +803,7 @@ func checkFromResourceData(d *schema.ResourceData) (checkly.Check, error) {
799
803
TearDownSnippetID : int64 (d .Get ("teardown_snippet_id" ).(int )),
800
804
LocalSetupScript : d .Get ("local_setup_script" ).(string ),
801
805
LocalTearDownScript : d .Get ("local_teardown_script" ).(string ),
802
- AlertSettings : alertSettingsFromSet (d .Get ("alert_settings" ).(* schema. Set )),
806
+ AlertSettings : alertSettingsFromSet (d .Get ("alert_settings" ).([] interface {} )),
803
807
UseGlobalAlertSettings : d .Get ("use_global_alert_settings" ).(bool ),
804
808
GroupID : int64 (d .Get ("group_id" ).(int )),
805
809
GroupOrder : d .Get ("group_order" ).(int ),
@@ -877,26 +881,26 @@ func basicAuthFromSet(s *schema.Set) *checkly.BasicAuth {
877
881
}
878
882
}
879
883
880
- func alertSettingsFromSet (s * schema. Set ) checkly.AlertSettings {
881
- if s . Len ( ) == 0 {
884
+ func alertSettingsFromSet (s [] interface {} ) checkly.AlertSettings {
885
+ if len ( s ) == 0 {
882
886
return checkly.AlertSettings {
883
887
EscalationType : checkly .RunBased ,
884
888
RunBasedEscalation : checkly.RunBasedEscalation {
885
889
FailedRunThreshold : 1 ,
886
890
},
887
891
}
888
892
}
889
- res := s . List () [0 ].(tfMap )
893
+ res := s [0 ].(tfMap )
890
894
alertSettings := checkly.AlertSettings {
891
895
EscalationType : res ["escalation_type" ].(string ),
892
- Reminders : remindersFromSet (res ["reminders" ].(* schema. Set )),
893
- ParallelRunFailureThreshold : parallelRunFailureThresholdFromSet (res ["parallel_run_failure_threshold" ].(* schema. Set )),
896
+ Reminders : remindersFromSet (res ["reminders" ].([] interface {} )),
897
+ ParallelRunFailureThreshold : parallelRunFailureThresholdFromSet (res ["parallel_run_failure_threshold" ].([] interface {} )),
894
898
}
895
899
896
900
if alertSettings .EscalationType == checkly .RunBased {
897
- alertSettings .RunBasedEscalation = runBasedEscalationFromSet (res ["run_based_escalation" ].(* schema. Set ))
901
+ alertSettings .RunBasedEscalation = runBasedEscalationFromSet (res ["run_based_escalation" ].([] interface {} ))
898
902
} else {
899
- alertSettings .TimeBasedEscalation = timeBasedEscalationFromSet (res ["time_based_escalation" ].(* schema. Set ))
903
+ alertSettings .TimeBasedEscalation = timeBasedEscalationFromSet (res ["time_based_escalation" ].([] interface {} ))
900
904
}
901
905
902
906
return alertSettings
@@ -953,42 +957,42 @@ func environmentVariablesFromSet(s []interface{}) []checkly.EnvironmentVariable
953
957
return res
954
958
}
955
959
956
- func runBasedEscalationFromSet (s * schema. Set ) checkly.RunBasedEscalation {
957
- if s . Len ( ) == 0 {
960
+ func runBasedEscalationFromSet (s [] interface {} ) checkly.RunBasedEscalation {
961
+ if len ( s ) == 0 {
958
962
return checkly.RunBasedEscalation {}
959
963
}
960
- res := s . List () [0 ].(tfMap )
964
+ res := s [0 ].(tfMap )
961
965
return checkly.RunBasedEscalation {
962
966
FailedRunThreshold : res ["failed_run_threshold" ].(int ),
963
967
}
964
968
}
965
969
966
- func timeBasedEscalationFromSet (s * schema. Set ) checkly.TimeBasedEscalation {
967
- if s . Len ( ) == 0 {
970
+ func timeBasedEscalationFromSet (s [] interface {} ) checkly.TimeBasedEscalation {
971
+ if len ( s ) == 0 {
968
972
return checkly.TimeBasedEscalation {}
969
973
}
970
- res := s . List () [0 ].(tfMap )
974
+ res := s [0 ].(tfMap )
971
975
return checkly.TimeBasedEscalation {
972
976
MinutesFailingThreshold : res ["minutes_failing_threshold" ].(int ),
973
977
}
974
978
}
975
979
976
- func remindersFromSet (s * schema. Set ) checkly.Reminders {
977
- if s . Len ( ) == 0 {
980
+ func remindersFromSet (s [] interface {} ) checkly.Reminders {
981
+ if len ( s ) == 0 {
978
982
return checkly.Reminders {}
979
983
}
980
- res := s . List () [0 ].(tfMap )
984
+ res := s [0 ].(tfMap )
981
985
return checkly.Reminders {
982
986
Amount : res ["amount" ].(int ),
983
987
Interval : res ["interval" ].(int ),
984
988
}
985
989
}
986
990
987
- func parallelRunFailureThresholdFromSet (s * schema. Set ) checkly.ParallelRunFailureThreshold {
988
- if s . Len ( ) == 0 {
991
+ func parallelRunFailureThresholdFromSet (s [] interface {} ) checkly.ParallelRunFailureThreshold {
992
+ if len ( s ) == 0 {
989
993
return checkly.ParallelRunFailureThreshold {}
990
994
}
991
- res := s . List () [0 ].(tfMap )
995
+ res := s [0 ].(tfMap )
992
996
return checkly.ParallelRunFailureThreshold {
993
997
Enabled : res ["enabled" ].(bool ),
994
998
Percentage : res ["percentage" ].(int ),
0 commit comments