From b24a1e980b45447c511c89436ddef187b1df84e8 Mon Sep 17 00:00:00 2001 From: fjerlov-cs <158591046+fjerlov-cs@users.noreply.github.com> Date: Wed, 10 Jul 2024 10:09:46 +0200 Subject: [PATCH] Filter Alerts - Omit Throttle Time and Throttle Field when not present (#167) --- api/filter-alerts.go | 2 +- api/internal/humiographql/filter-alerts.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/filter-alerts.go b/api/filter-alerts.go index 9a459b3..7378192 100644 --- a/api/filter-alerts.go +++ b/api/filter-alerts.go @@ -16,7 +16,7 @@ type FilterAlert struct { Enabled bool `graphql:"enabled" yaml:"enabled" json:"enabled"` QueryOwnershipType string `graphql:"queryOwnership" yaml:"queryOwnershipType" json:"queryOwnershipType"` ThrottleTimeSeconds int `graphql:"throttleTimeSeconds" yaml:"throttleTimeSeconds,omitempty" json:"throttleTimeSeconds,omitempty"` - ThrottleField string `graphql:"throttleField" yaml:"throttleField,omitempty" json:"throttleField"` + ThrottleField string `graphql:"throttleField" yaml:"throttleField,omitempty" json:"throttleField,omitempty"` RunAsUserID string `graphql:"runAsUserId" yaml:"runAsUserId,omitempty" json:"runAsUserId,omitempty"` } diff --git a/api/internal/humiographql/filter-alerts.go b/api/internal/humiographql/filter-alerts.go index b612dde..99eb9b7 100644 --- a/api/internal/humiographql/filter-alerts.go +++ b/api/internal/humiographql/filter-alerts.go @@ -29,8 +29,8 @@ type CreateFilterAlert struct { ActionIdsOrNames []graphql.String `json:"actionIdsOrNames"` Labels []graphql.String `json:"labels"` Enabled graphql.Boolean `json:"enabled"` - ThrottleTimeSeconds Long `json:"throttleTimeSeconds"` - ThrottleField graphql.String `json:"throttleField"` + ThrottleTimeSeconds Long `json:"throttleTimeSeconds,omitempty"` + ThrottleField graphql.String `json:"throttleField,omitempty"` RunAsUserID graphql.String `json:"runAsUserId,omitempty"` QueryOwnershipType QueryOwnershipType `json:"queryOwnershipType"` } @@ -44,8 +44,8 @@ type UpdateFilterAlert struct { ActionIdsOrNames []graphql.String `json:"actionIdsOrNames"` Labels []graphql.String `json:"labels"` Enabled graphql.Boolean `json:"enabled"` - ThrottleTimeSeconds Long `json:"throttleTimeSeconds"` - ThrottleField graphql.String `json:"throttleField"` + ThrottleTimeSeconds Long `json:"throttleTimeSeconds,omitempty"` + ThrottleField graphql.String `json:"throttleField,omitempty"` RunAsUserID graphql.String `json:"runAsUserId,omitempty"` QueryOwnershipType QueryOwnershipType `json:"queryOwnershipType"` }