Skip to content

Commit

Permalink
make AlertSettings pointer types; fixes checkly#13
Browse files Browse the repository at this point in the history
  • Loading branch information
devilleweppenaar committed Nov 26, 2020
1 parent d3a2a7e commit 1f2cb70
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
18 changes: 9 additions & 9 deletions checkly_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,18 @@ var wantCheck = checkly.Check{
},
LocalSetupScript: "setitup",
LocalTearDownScript: "tearitdown",
AlertSettings: checkly.AlertSettings{
AlertSettings: &checkly.AlertSettings{
EscalationType: checkly.RunBased,
RunBasedEscalation: checkly.RunBasedEscalation{
RunBasedEscalation: &checkly.RunBasedEscalation{
FailedRunThreshold: 1,
},
TimeBasedEscalation: checkly.TimeBasedEscalation{
TimeBasedEscalation: &checkly.TimeBasedEscalation{
MinutesFailingThreshold: 5,
},
Reminders: checkly.Reminders{
Reminders: &checkly.Reminders{
Interval: 5,
},
SSLCertificates: checkly.SSLCertificates{
SSLCertificates: &checkly.SSLCertificates{
Enabled: false,
AlertThreshold: 30,
},
Expand Down Expand Up @@ -291,17 +291,17 @@ var wantGroup = checkly.Group{
UseGlobalAlertSettings: false,
AlertSettings: checkly.AlertSettings{
EscalationType: checkly.RunBased,
RunBasedEscalation: checkly.RunBasedEscalation{
RunBasedEscalation: &checkly.RunBasedEscalation{
FailedRunThreshold: 1,
},
TimeBasedEscalation: checkly.TimeBasedEscalation{
TimeBasedEscalation: &checkly.TimeBasedEscalation{
MinutesFailingThreshold: 5,
},
Reminders: checkly.Reminders{
Reminders: &checkly.Reminders{
Amount: 0,
Interval: 5,
},
SSLCertificates: checkly.SSLCertificates{
SSLCertificates: &checkly.SSLCertificates{
Enabled: true,
AlertThreshold: 30,
},
Expand Down
12 changes: 6 additions & 6 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ type Check struct {
TearDownSnippetID int64 `json:"tearDownSnippetId,omitempty"`
LocalSetupScript string `json:"localSetupScript,omitempty"`
LocalTearDownScript string `json:"localTearDownScript,omitempty"`
AlertSettings AlertSettings `json:"alertSettings,omitempty"`
AlertSettings *AlertSettings `json:"alertSettings,omitempty"`
UseGlobalAlertSettings bool `json:"useGlobalAlertSettings"`
Request Request `json:"request"`
GroupID int64 `json:"groupId,omitempty"`
Expand Down Expand Up @@ -157,11 +157,11 @@ type EnvironmentVariable struct {

// AlertSettings represents an alert configuration.
type AlertSettings struct {
EscalationType string `json:"escalationType,omitempty"`
RunBasedEscalation RunBasedEscalation `json:"runBasedEscalation,omitempty"`
TimeBasedEscalation TimeBasedEscalation `json:"timeBasedEscalation,omitempty"`
Reminders Reminders `json:"reminders,omitempty"`
SSLCertificates SSLCertificates `json:"sslCertificates,omitempty"`
EscalationType string `json:"escalationType,omitempty"`
RunBasedEscalation *RunBasedEscalation `json:"runBasedEscalation,omitempty"`
TimeBasedEscalation *TimeBasedEscalation `json:"timeBasedEscalation,omitempty"`
Reminders *Reminders `json:"reminders,omitempty"`
SSLCertificates *SSLCertificates `json:"sslCertificates,omitempty"`
}

// RunBasedEscalation represents an alert escalation based on a number of failed
Expand Down

0 comments on commit 1f2cb70

Please sign in to comment.