diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ChangePolicy.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ChangePolicy.kt index 226dce0c7..b649084a6 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ChangePolicy.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ChangePolicy.kt @@ -36,7 +36,7 @@ data class ChangePolicy( val include: List, val isSafe: Boolean, val user: User? = null, - var continuous: Boolean? = null + val continuous: Boolean? = null ) : Writeable, ToXContentObject { @@ -72,7 +72,8 @@ data class ChangePolicy( out.writeBoolean(isSafe) out.writeBoolean(user != null) user?.writeTo(out) - if (continuous != null) { out.writeBoolean(continuous as Boolean) } + out.writeBoolean(continuous != null) + if (continuous != null) out.writeBoolean(continuous) } companion object { diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/changepolicy/ChangePolicyRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/changepolicy/ChangePolicyRequest.kt index 8f9bd76e8..64f7e8f6b 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/changepolicy/ChangePolicyRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/changepolicy/ChangePolicyRequest.kt @@ -18,7 +18,7 @@ class ChangePolicyRequest( val indices: List, val changePolicy: ChangePolicy, val indexType: String, - val continuous: Boolean + val continuous: Boolean = false ) : ActionRequest() { @Throws(IOException::class) @@ -47,7 +47,7 @@ class ChangePolicyRequest( out.writeStringCollection(indices) changePolicy.writeTo(out) out.writeString(indexType) - out.writeBoolean(continuous) + out.writeBoolean(if (continuous != null) continuous else false) } companion object {