forked from KablamoOSS/kombustion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cluster_CloudWatchAlarmDefinition.go
50 lines (29 loc) · 1.09 KB
/
Cluster_CloudWatchAlarmDefinition.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package properties
import "fmt"
type Cluster_CloudWatchAlarmDefinition struct {
ComparisonOperator interface{} `yaml:"ComparisonOperator"`
EvaluationPeriods interface{} `yaml:"EvaluationPeriods,omitempty"`
MetricName interface{} `yaml:"MetricName"`
Namespace interface{} `yaml:"Namespace,omitempty"`
Period interface{} `yaml:"Period"`
Statistic interface{} `yaml:"Statistic,omitempty"`
Threshold interface{} `yaml:"Threshold"`
Unit interface{} `yaml:"Unit,omitempty"`
Dimensions interface{} `yaml:"Dimensions,omitempty"`
}
func (resource Cluster_CloudWatchAlarmDefinition) Validate() []error {
errs := []error{}
if resource.ComparisonOperator == nil {
errs = append(errs, fmt.Errorf("Missing required field 'ComparisonOperator'"))
}
if resource.MetricName == nil {
errs = append(errs, fmt.Errorf("Missing required field 'MetricName'"))
}
if resource.Period == nil {
errs = append(errs, fmt.Errorf("Missing required field 'Period'"))
}
if resource.Threshold == nil {
errs = append(errs, fmt.Errorf("Missing required field 'Threshold'"))
}
return errs
}