Skip to content

Commit

Permalink
Extended deleted workflow response with list of monitor ids failed to…
Browse files Browse the repository at this point in the history
… delete (#416)

Signed-off-by: Stevan Buzejic <[email protected]>
  • Loading branch information
stevanbz authored and eirsep committed May 24, 2023
1 parent bb3f846 commit f003869
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,39 @@ import org.opensearch.core.xcontent.XContentBuilder
class DeleteWorkflowResponse : BaseResponse {
var id: String
var version: Long
var nonDeletedMonitors: List<String>? = null

constructor(
id: String,
version: Long
version: Long,
nonDeletedMonitors: List<String>? = 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"
}
}

0 comments on commit f003869

Please sign in to comment.