From 9ad5a1537dc19400276116c83629f500683764ac Mon Sep 17 00:00:00 2001 From: Dennis Toepker Date: Thu, 6 Jun 2024 11:58:17 -0700 Subject: [PATCH] misc review-based cleanup Signed-off-by: Dennis Toepker --- .../opensearch/commons/alerting/action/AlertingActions.kt | 6 +++--- .../kotlin/org/opensearch/commons/alerting/model/Comment.kt | 6 +----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/main/kotlin/org/opensearch/commons/alerting/action/AlertingActions.kt b/src/main/kotlin/org/opensearch/commons/alerting/action/AlertingActions.kt index fbd798b7..ba4e33fe 100644 --- a/src/main/kotlin/org/opensearch/commons/alerting/action/AlertingActions.kt +++ b/src/main/kotlin/org/opensearch/commons/alerting/action/AlertingActions.kt @@ -21,9 +21,9 @@ object AlertingActions { const val SUBSCRIBE_FINDINGS_ACTION_NAME = "cluster:admin/opensearch/alerting/findings/subscribe" const val GET_MONITOR_ACTION_NAME = "cluster:admin/opendistro/alerting/monitor/get" const val SEARCH_MONITORS_ACTION_NAME = "cluster:admin/opendistro/alerting/monitor/search" - const val INDEX_COMMENT_ACTION_NAME = "cluster:admin/opendistro/alerting/alerts/comments/write" - const val SEARCH_COMMENTS_ACTION_NAME = "cluster:admin/opendistro/alerting/alerts/comments/search" - const val DELETE_COMMENT_ACTION_NAME = "cluster:admin/opendistro/alerting/alerts/comments/delete" + const val INDEX_COMMENT_ACTION_NAME = "cluster:admin/opensearch/alerting/alerts/comments/write" + const val SEARCH_COMMENTS_ACTION_NAME = "cluster:admin/opensearch/alerting/alerts/comments/search" + const val DELETE_COMMENT_ACTION_NAME = "cluster:admin/opensearch/alerting/alerts/comments/delete" @JvmField val INDEX_MONITOR_ACTION_TYPE = diff --git a/src/main/kotlin/org/opensearch/commons/alerting/model/Comment.kt b/src/main/kotlin/org/opensearch/commons/alerting/model/Comment.kt index c605c500..68ae7bf5 100644 --- a/src/main/kotlin/org/opensearch/commons/alerting/model/Comment.kt +++ b/src/main/kotlin/org/opensearch/commons/alerting/model/Comment.kt @@ -32,11 +32,7 @@ data class Comment( content = sin.readString(), createdTime = sin.readInstant(), lastUpdatedTime = sin.readOptionalInstant(), - user = if (sin.readBoolean()) { - User(sin) - } else { - null - } + user = if (sin.readBoolean()) User(sin) else null ) constructor(