Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ message NotificationChannelMutableData {
repeated SplunkIntegrationChannelConfig splunk_integration_channel_config = 5;
repeated SyslogIntegrationChannelConfig syslog_integration_channel_config = 6;
repeated HttpEventCollectorChannelConfig http_event_collector_channel_config = 7;
repeated GoogleSecopsIntegrationChannelConfig google_secops_integration_channel_config = 8;
}

message GoogleSecopsIntegrationChannelConfig {
string google_secops_integration_id = 1;
}

message HttpEventCollectorChannelConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.hypertrace.notification.config.service.v1.EmailChannelConfig;
import org.hypertrace.notification.config.service.v1.GetAllNotificationChannelsRequest;
import org.hypertrace.notification.config.service.v1.GetNotificationChannelRequest;
import org.hypertrace.notification.config.service.v1.GoogleSecopsIntegrationChannelConfig;
import org.hypertrace.notification.config.service.v1.HttpEventCollectorChannelConfig;
import org.hypertrace.notification.config.service.v1.NotificationChannel;
import org.hypertrace.notification.config.service.v1.NotificationChannelMutableData;
Expand Down Expand Up @@ -131,7 +132,8 @@ private void validateNotificationChannelMutableData(NotificationChannelMutableDa
&& data.getS3BucketChannelConfigCount() == 0
&& data.getSplunkIntegrationChannelConfigCount() == 0
&& data.getSyslogIntegrationChannelConfigCount() == 0
&& data.getHttpEventCollectorChannelConfigCount() == 0) {
&& data.getHttpEventCollectorChannelConfigCount() == 0
&& data.getGoogleSecopsIntegrationChannelConfigCount() == 0) {
throw Status.INVALID_ARGUMENT.withDescription("No config present").asRuntimeException();
}
data.getEmailChannelConfigList().forEach(this::validateEmailChannelConfig);
Expand All @@ -143,6 +145,8 @@ private void validateNotificationChannelMutableData(NotificationChannelMutableDa
.forEach(this::validateSyslogIntegrationChannelConfig);
data.getHttpEventCollectorChannelConfigList()
.forEach(this::validateHttpEventCollectorChannelConfig);
data.getGoogleSecopsIntegrationChannelConfigList()
.forEach(this::validateGoogleSecopsIntegrationChannelConfig);
}

public void validateGetAllNotificationChannelsRequest(
Expand Down Expand Up @@ -234,6 +238,13 @@ private void validateSyslogIntegrationChannelConfig(
SyslogIntegrationChannelConfig.SYSLOG_SERVER_INTEGRATION_ID_FIELD_NUMBER);
}

private void validateGoogleSecopsIntegrationChannelConfig(
GoogleSecopsIntegrationChannelConfig googleSecopsIntegrationChannelConfig) {
validateNonDefaultPresenceOrThrow(
googleSecopsIntegrationChannelConfig,
GoogleSecopsIntegrationChannelConfig.GOOGLE_SECOPS_INTEGRATION_ID_FIELD_NUMBER);
}

private void validateNonDuplicateNotificationChannelOrThrow(
@Nullable String id,
String channelName,
Expand Down
Loading