Skip to content

Commit

Permalink
Preserve binary compatibility for JsonErrorCode
Browse files Browse the repository at this point in the history
  • Loading branch information
lukellmann committed Jan 13, 2022
1 parent 09e75a8 commit ee829f5
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions rest/src/main/kotlin/json/JsonErrorCode.kt
Original file line number Diff line number Diff line change
Expand Up @@ -469,24 +469,32 @@ enum class JsonErrorCode(val code: Int) {
ReplaceWith("JsonErrorCode.OperationOnArchivedThread"),
DeprecationLevel.ERROR,
)
val OperationOnAchievedThread: JsonErrorCode
get() = OperationOnArchivedThread
@JvmField
val OperationOnAchievedThread: JsonErrorCode = OperationOnArchivedThread

@Deprecated(
"JsonErrorCode.InvalidThreadSettings was removed because it was a duplicate of JsonErrorCode.InvalidThreadNotificationSettings.",
ReplaceWith("JsonErrorCode.InvalidThreadNotificationSettings"),
DeprecationLevel.ERROR,
)
val InvalidThreadSettings: JsonErrorCode
get() = InvalidThreadNotificationSettings
@JvmField
val InvalidThreadSettings: JsonErrorCode = InvalidThreadNotificationSettings

@Deprecated(
"JsonErrorCode.InvalidThreadBefore was removed because it was a duplicate of JsonErrorCode.BeforeValueBeforeThreadCreate.",
ReplaceWith("JsonErrorCode.BeforeValueBeforeThreadCreate"),
DeprecationLevel.ERROR,
)
val InvalidThreadBefore: JsonErrorCode
get() = BeforeValueBeforeThreadCreate
@JvmField
val InvalidThreadBefore: JsonErrorCode = BeforeValueBeforeThreadCreate

@Deprecated(
"Object JsonErrorCode.JsonErrorCodeSerializer is internal now, use JsonErrorCode.serializer() instead.",
ReplaceWith("JsonErrorCode.serializer()", "dev.kord.rest.json.JsonErrorCode"),
DeprecationLevel.ERROR
)
@JvmField
val JsonErrorCodeSerializer: KSerializer<JsonErrorCode> = Serializer
}

internal object Serializer : KSerializer<JsonErrorCode> {
Expand Down

0 comments on commit ee829f5

Please sign in to comment.