diff --git a/src/main/kotlin/org/opensearch/commons/alerting/AlertingPluginInterface.kt b/src/main/kotlin/org/opensearch/commons/alerting/AlertingPluginInterface.kt index 3030d57e..eafe8e69 100644 --- a/src/main/kotlin/org/opensearch/commons/alerting/AlertingPluginInterface.kt +++ b/src/main/kotlin/org/opensearch/commons/alerting/AlertingPluginInterface.kt @@ -24,10 +24,10 @@ import org.opensearch.commons.alerting.action.GetWorkflowRequest import org.opensearch.commons.alerting.action.GetWorkflowResponse import org.opensearch.commons.alerting.action.IndexMonitorRequest import org.opensearch.commons.alerting.action.IndexMonitorResponse -import org.opensearch.commons.alerting.action.PublishFindingsRequest -import org.opensearch.commons.alerting.action.SubscribeFindingsResponse import org.opensearch.commons.alerting.action.IndexWorkflowRequest import org.opensearch.commons.alerting.action.IndexWorkflowResponse +import org.opensearch.commons.alerting.action.PublishFindingsRequest +import org.opensearch.commons.alerting.action.SubscribeFindingsResponse import org.opensearch.commons.notifications.action.BaseResponse import org.opensearch.commons.utils.recreateObject diff --git a/src/main/kotlin/org/opensearch/commons/alerting/action/DeleteWorkflowResponse.kt b/src/main/kotlin/org/opensearch/commons/alerting/action/DeleteWorkflowResponse.kt index 7a4a2084..8da62c5e 100644 --- a/src/main/kotlin/org/opensearch/commons/alerting/action/DeleteWorkflowResponse.kt +++ b/src/main/kotlin/org/opensearch/commons/alerting/action/DeleteWorkflowResponse.kt @@ -10,29 +10,39 @@ import org.opensearch.core.xcontent.XContentBuilder class DeleteWorkflowResponse : BaseResponse { var id: String var version: Long + var nonDeletedMonitors: List? = null constructor( id: String, - version: Long + version: Long, + nonDeletedMonitors: List? = null ) : super() { this.id = id this.version = version + this.nonDeletedMonitors = nonDeletedMonitors } constructor(sin: StreamInput) : this( sin.readString(), // id - sin.readLong() // version + sin.readLong(), // version + sin.readOptionalStringList() ) override fun writeTo(out: StreamOutput) { out.writeString(id) out.writeLong(version) + out.writeOptionalStringCollection(nonDeletedMonitors) } override fun toXContent(builder: XContentBuilder, params: ToXContent.Params): XContentBuilder { return builder.startObject() .field(IndexUtils._ID, id) .field(IndexUtils._VERSION, version) + .field(NON_DELETED_MONITORS, nonDeletedMonitors) .endObject() } + + companion object { + const val NON_DELETED_MONITORS = "NON_DELETED_MONITORS" + } }