Skip to content

Commit

Permalink
Notification center re-exports
Browse files Browse the repository at this point in the history
  • Loading branch information
assafad1 committed Jan 21, 2025
1 parent f38de46 commit 21727d8
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 8 deletions.
15 changes: 11 additions & 4 deletions go/cxsdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ type ClientSet struct {
saml *SamlClient
dataUsage *DataUsageClient
roles *RolesClient
notifications *NotificationsClient
}

// RuleGroups gets a RuleGroupsClient from the ClientSet.
Expand Down Expand Up @@ -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)
Expand All @@ -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),
}
}

Expand Down
9 changes: 5 additions & 4 deletions go/examples/notifications_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
)

func TestConnectors(t *testing.T) {
t.Skip("Connectors are not supported in the current version of the SDK")
//t.Skip("Connectors are not supported in the current version of the SDK")
region, err := cxsdk.CoralogixRegionFromEnv()
assertNilAndPrintError(t, err)
authContext, err := cxsdk.AuthContextFromEnv()
Expand Down Expand Up @@ -73,7 +73,7 @@ func TestConnectors(t *testing.T) {
}

func TestPresets(t *testing.T) {
t.Skip("Presets are not supported in the current version of the SDK")
//t.Skip("Presets are not supported in the current version of the SDK")
region, err := cxsdk.CoralogixRegionFromEnv()
assertNilAndPrintError(t, err)
authContext, err := cxsdk.AuthContextFromEnv()
Expand All @@ -82,15 +82,15 @@ 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",
Description: "This is the preset to use for Notification Center testing.",
PresetType: &presetType,
EntityType: "alerts",
Parent: &cxsdk.Preset{
Id: &parentId,
UserFacingId: &parentUserFacingId,
},
ConnectorType: cxsdk.ConnectorTypeGenericHTTPS,
ConfigOverrides: []*cxsdk.ConfigOverrides{
Expand Down Expand Up @@ -131,6 +131,7 @@ func TestPresets(t *testing.T) {
},
},
})

if err != nil {
t.Fatal(err)
}
Expand Down
21 changes: 21 additions & 0 deletions go/notifications-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -149,6 +152,18 @@ type GetSystemDefaultPresetSummaryResponse = presets.GetSystemDefaultPresetSumma
// Preset represents a preset.
type Preset = presets.Preset

// GetPresetIDIdentifier is a preset ID identifier for get requests.
type GetPresetIDIdentifier = presets.GetPresetRequest_Id

// GetPresetUserFacingIDIdentifier is a preset user-facing ID identifier for get requests.
type GetPresetUserFacingIDIdentifier = presets.GetPresetRequest_UserFacingId

// DeletePresetIDIdentifier is a preset ID identifier for delete requests.
type DeletePresetIDIdentifier = presets.DeleteCustomPresetRequest_Id

// DeletePresetUserFacingIDIdentifier is a preset user-facing ID identifier for delete requests.
type DeletePresetUserFacingIDIdentifier = presets.DeleteCustomPresetRequest_UserFacingId

// ConfigOverrides is a configuration override.
type ConfigOverrides = common.ConfigOverrides

Expand All @@ -161,6 +176,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

Expand Down

0 comments on commit 21727d8

Please sign in to comment.