Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extended deleted workflow response with list of monitor ids failed to… #416

Merged
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 @@ -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"
}
}