@@ -7,15 +7,17 @@ import (
77)
88
99type FilterAlert struct {
10- ID string `graphql:"id" yaml:"-" json:"id"`
11- Name string `graphql:"name" yaml:"name" json:"name"`
12- Description string `graphql:"description" yaml:"description,omitempty" json:"description,omitempty"`
13- QueryString string `graphql:"queryString" yaml:"queryString" json:"queryString"`
14- ActionNames []string `graphql:"actionNames" yaml:"actionNames" json:"actionNames"`
15- Labels []string `graphql:"labels" yaml:"labels" json:"labels"`
16- Enabled bool `graphql:"enabled" yaml:"enabled" json:"enabled"`
17- QueryOwnershipType string `graphql:"queryOwnership" yaml:"queryOwnershipType" json:"queryOwnershipType"`
18- RunAsUserID string `graphql:"runAsUserId" yaml:"runAsUserId,omitempty" json:"runAsUserId,omitempty"`
10+ ID string `graphql:"id" yaml:"-" json:"id"`
11+ Name string `graphql:"name" yaml:"name" json:"name"`
12+ Description string `graphql:"description" yaml:"description,omitempty" json:"description,omitempty"`
13+ QueryString string `graphql:"queryString" yaml:"queryString" json:"queryString"`
14+ ActionNames []string `graphql:"actionNames" yaml:"actionNames" json:"actionNames"`
15+ Labels []string `graphql:"labels" yaml:"labels" json:"labels"`
16+ Enabled bool `graphql:"enabled" yaml:"enabled" json:"enabled"`
17+ QueryOwnershipType string `graphql:"queryOwnership" yaml:"queryOwnershipType" json:"queryOwnershipType"`
18+ ThrottleTimeSeconds int `graphql:"throttleTimeSeconds" yaml:"throttleTimeSeconds,omitempty" json:"throttleTimeSeconds,omitempty"`
19+ ThrottleField string `graphql:"throttleField" yaml:"throttleField,omitempty" json:"throttleField"`
20+ RunAsUserID string `graphql:"runAsUserId" yaml:"runAsUserId,omitempty" json:"runAsUserId,omitempty"`
1921}
2022
2123type FilterAlerts struct {
@@ -72,16 +74,18 @@ func (fa *FilterAlerts) Update(viewName string, updatedFilterAlert *FilterAlert)
7274 }
7375
7476 updateAlert := humiographql.UpdateFilterAlert {
75- ViewName : humiographql .RepoOrViewName (viewName ),
76- ID : graphql .String (updatedFilterAlert .ID ),
77- Name : graphql .String (updatedFilterAlert .Name ),
78- Description : graphql .String (updatedFilterAlert .Description ),
79- QueryString : graphql .String (updatedFilterAlert .QueryString ),
80- ActionIdsOrNames : actionNames ,
81- Labels : labels ,
82- Enabled : graphql .Boolean (updatedFilterAlert .Enabled ),
83- RunAsUserID : graphql .String (updatedFilterAlert .RunAsUserID ),
84- QueryOwnershipType : humiographql .QueryOwnershipType (updatedFilterAlert .QueryOwnershipType ),
77+ ViewName : humiographql .RepoOrViewName (viewName ),
78+ ID : graphql .String (updatedFilterAlert .ID ),
79+ Name : graphql .String (updatedFilterAlert .Name ),
80+ Description : graphql .String (updatedFilterAlert .Description ),
81+ QueryString : graphql .String (updatedFilterAlert .QueryString ),
82+ ActionIdsOrNames : actionNames ,
83+ Labels : labels ,
84+ Enabled : graphql .Boolean (updatedFilterAlert .Enabled ),
85+ RunAsUserID : graphql .String (updatedFilterAlert .RunAsUserID ),
86+ ThrottleTimeSeconds : humiographql .Long (updatedFilterAlert .ThrottleTimeSeconds ),
87+ ThrottleField : graphql .String (updatedFilterAlert .ThrottleField ),
88+ QueryOwnershipType : humiographql .QueryOwnershipType (updatedFilterAlert .QueryOwnershipType ),
8589 }
8690
8791 variables := map [string ]any {
@@ -118,15 +122,17 @@ func (fa *FilterAlerts) Create(viewName string, newFilterAlert *FilterAlert) (*F
118122 }
119123
120124 createFilterAlert := humiographql.CreateFilterAlert {
121- ViewName : humiographql .RepoOrViewName (viewName ),
122- Name : graphql .String (newFilterAlert .Name ),
123- Description : graphql .String (newFilterAlert .Description ),
124- QueryString : graphql .String (newFilterAlert .QueryString ),
125- ActionIdsOrNames : actionNames ,
126- Labels : labels ,
127- Enabled : graphql .Boolean (newFilterAlert .Enabled ),
128- RunAsUserID : graphql .String (newFilterAlert .RunAsUserID ),
129- QueryOwnershipType : humiographql .QueryOwnershipType (newFilterAlert .QueryOwnershipType ),
125+ ViewName : humiographql .RepoOrViewName (viewName ),
126+ Name : graphql .String (newFilterAlert .Name ),
127+ Description : graphql .String (newFilterAlert .Description ),
128+ QueryString : graphql .String (newFilterAlert .QueryString ),
129+ ActionIdsOrNames : actionNames ,
130+ Labels : labels ,
131+ Enabled : graphql .Boolean (newFilterAlert .Enabled ),
132+ ThrottleTimeSeconds : humiographql .Long (newFilterAlert .ThrottleTimeSeconds ),
133+ ThrottleField : graphql .String (newFilterAlert .ThrottleField ),
134+ RunAsUserID : graphql .String (newFilterAlert .RunAsUserID ),
135+ QueryOwnershipType : humiographql .QueryOwnershipType (newFilterAlert .QueryOwnershipType ),
130136 }
131137
132138 variables := map [string ]any {
@@ -209,14 +215,16 @@ func mapHumioGraphqlFilterAlertToFilterAlert(input humiographql.FilterAlert) Fil
209215 }
210216
211217 return FilterAlert {
212- ID : string (input .ID ),
213- Name : string (input .Name ),
214- Description : string (input .Description ),
215- QueryString : string (input .QueryString ),
216- ActionNames : actionNames ,
217- Labels : labels ,
218- Enabled : bool (input .Enabled ),
219- QueryOwnershipType : queryOwnershipType ,
220- RunAsUserID : runAsUserID ,
218+ ID : string (input .ID ),
219+ Name : string (input .Name ),
220+ Description : string (input .Description ),
221+ QueryString : string (input .QueryString ),
222+ ActionNames : actionNames ,
223+ Labels : labels ,
224+ Enabled : bool (input .Enabled ),
225+ ThrottleTimeSeconds : int (input .ThrottleTimeSeconds ),
226+ ThrottleField : string (input .ThrottleField ),
227+ QueryOwnershipType : queryOwnershipType ,
228+ RunAsUserID : runAsUserID ,
221229 }
222230}
0 commit comments