diff --git a/go/cxsdk.go b/go/cxsdk.go index 5dc4bce6..452f7cd0 100644 --- a/go/cxsdk.go +++ b/go/cxsdk.go @@ -105,6 +105,7 @@ type ClientSet struct { saml *SamlClient dataUsage *DataUsageClient roles *RolesClient + notifications *NotificationsClient } // RuleGroups gets a RuleGroupsClient from the ClientSet. @@ -221,6 +222,11 @@ func (c *ClientSet) Roles() *RolesClient { return c.roles } +// Notifications gets a NotificationsClient from the ClientSet. +func (c *ClientSet) Notifications() *NotificationsClient { + return c.notifications +} + // NewClientSet Creates a new ClientSet. func NewClientSet(targetURL, teamsLevelAPIKey string, userLevelAPIKey string) *ClientSet { authContext := NewAuthContext(teamsLevelAPIKey, userLevelAPIKey) @@ -246,10 +252,11 @@ func NewClientSet(targetURL, teamsLevelAPIKey string, userLevelAPIKey string) *C scopes: NewScopesClient(apikeyCPC), roles: NewRolesClient(apikeyCPC), // dahboardsFolders: NewDashboardsFoldersClient(apikeyCPC), - apiKeys: NewAPIKeysClient(apikeyCPC), - groups: NewGroupsClient(apikeyCPC), - saml: NewSamlClient(apikeyCPC), - users: NewUsersClient(apikeyCPC), + apiKeys: NewAPIKeysClient(apikeyCPC), + groups: NewGroupsClient(apikeyCPC), + saml: NewSamlClient(apikeyCPC), + users: NewUsersClient(apikeyCPC), + notifications: NewNotificationsClient(apikeyCPC), } } diff --git a/go/examples/notifications_test.go b/go/examples/notifications_test.go index 6d15e295..4cec3e4d 100644 --- a/go/examples/notifications_test.go +++ b/go/examples/notifications_test.go @@ -23,7 +23,6 @@ import ( ) func TestConnectors(t *testing.T) { - t.Skip("Connectors are not supported in the current version of the SDK") region, err := cxsdk.CoralogixRegionFromEnv() assertNilAndPrintError(t, err) authContext, err := cxsdk.AuthContextFromEnv() @@ -73,7 +72,6 @@ func TestConnectors(t *testing.T) { } func TestPresets(t *testing.T) { - t.Skip("Presets are not supported in the current version of the SDK") region, err := cxsdk.CoralogixRegionFromEnv() assertNilAndPrintError(t, err) authContext, err := cxsdk.AuthContextFromEnv() @@ -82,7 +80,7 @@ func TestPresets(t *testing.T) { c := cxsdk.NewNotificationsClient(creator) presetType := cxsdk.PresetTypeCustom - parentId := "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" + parentUserFacingId := "preset_system_generic_https_alerts_empty" createRes, err := c.CreateCustomPreset(context.Background(), &cxsdk.CreateCustomPresetRequest{ Preset: &cxsdk.Preset{ Name: "TestPreset", @@ -90,7 +88,7 @@ func TestPresets(t *testing.T) { PresetType: &presetType, EntityType: "alerts", Parent: &cxsdk.Preset{ - Id: &parentId, + UserFacingId: &parentUserFacingId, }, ConnectorType: cxsdk.ConnectorTypeGenericHTTPS, ConfigOverrides: []*cxsdk.ConfigOverrides{ @@ -131,6 +129,7 @@ func TestPresets(t *testing.T) { }, }, }) + if err != nil { t.Fatal(err) } diff --git a/go/notifications-client.go b/go/notifications-client.go index 70446913..bba76b71 100644 --- a/go/notifications-client.go +++ b/go/notifications-client.go @@ -72,6 +72,9 @@ type Connector = connectores.Connector // ConnectorConfig represents a connector configuration. type ConnectorConfig = connectores.ConnectorConfig +// EntityTypeConfigOverrides represents a connector configuration overrides. +type EntityTypeConfigOverrides = connectores.EntityTypeConfigOverrides + // ConnectorConfigField represents a connector configuration field. type ConnectorConfigField = commonv1.ConnectorConfigField @@ -161,6 +164,12 @@ type ConditionTypeMatchEntityType = common.ConditionType_MatchEntityType // MatchEntityTypeCondition is a match entity type condition. type MatchEntityTypeCondition = common.MatchEntityTypeCondition +// ConditionTypeMatchEntityTypeAndSubType is a match entity type and sub-type condition type. +type ConditionTypeMatchEntityTypeAndSubType = common.ConditionType_MatchEntityTypeAndSubType + +// MatchEntityTypeAndSubTypeCondition is a match entity type and sub-type condition. +type MatchEntityTypeAndSubTypeCondition = common.MatchEntityTypeAndSubTypeCondition + // PresetType is a preset type. type PresetType = presets.PresetType