Add @JsonClass to all enums

This commit is contained in:
Hugh Nimmo-Smith 2022-10-17 16:06:08 +01:00
parent 29065b819f
commit e877feed6e
6 changed files with 12 additions and 0 deletions

View File

@ -17,7 +17,9 @@
package org.matrix.android.sdk.api.rendezvous.model package org.matrix.android.sdk.api.rendezvous.model
import com.squareup.moshi.Json import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
enum class Outcome(val value: String) { enum class Outcome(val value: String) {
@Json(name = "success") @Json(name = "success")
SUCCESS("success"), SUCCESS("success"),

View File

@ -17,7 +17,9 @@
package org.matrix.android.sdk.api.rendezvous.model package org.matrix.android.sdk.api.rendezvous.model
import com.squareup.moshi.Json import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
internal enum class PayloadType(val value: String) { internal enum class PayloadType(val value: String) {
@Json(name = "m.login.start") @Json(name = "m.login.start")
START("m.login.start"), START("m.login.start"),

View File

@ -17,7 +17,9 @@
package org.matrix.android.sdk.api.rendezvous.model package org.matrix.android.sdk.api.rendezvous.model
import com.squareup.moshi.Json import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
enum class Protocol(val value: String) { enum class Protocol(val value: String) {
@Json(name = "login_token") @Json(name = "login_token")
LOGIN_TOKEN("login_token") LOGIN_TOKEN("login_token")

View File

@ -17,7 +17,9 @@
package org.matrix.android.sdk.api.rendezvous.model package org.matrix.android.sdk.api.rendezvous.model
import com.squareup.moshi.Json import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
enum class RendezvousIntent { enum class RendezvousIntent {
@Json(name = "login.start") LOGIN_ON_NEW_DEVICE, @Json(name = "login.start") LOGIN_ON_NEW_DEVICE,
@Json(name = "login.reciprocate") RECIPROCATE_LOGIN_ON_EXISTING_DEVICE @Json(name = "login.reciprocate") RECIPROCATE_LOGIN_ON_EXISTING_DEVICE

View File

@ -17,7 +17,9 @@
package org.matrix.android.sdk.api.rendezvous.model package org.matrix.android.sdk.api.rendezvous.model
import com.squareup.moshi.Json import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
enum class RendezvousTransportType(val value: String) { enum class RendezvousTransportType(val value: String) {
@Json(name = "http.v1") MSC3886_SIMPLE_HTTP_V1("http.v1") @Json(name = "http.v1") MSC3886_SIMPLE_HTTP_V1("http.v1")
} }

View File

@ -17,7 +17,9 @@
package org.matrix.android.sdk.api.rendezvous.model package org.matrix.android.sdk.api.rendezvous.model
import com.squareup.moshi.Json import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
enum class SecureRendezvousChannelAlgorithm(val value: String) { enum class SecureRendezvousChannelAlgorithm(val value: String) {
@Json(name = "m.rendezvous.v1.curve25519-aes-sha256") ECDH_V1("m.rendezvous.v1.curve25519-aes-sha256") @Json(name = "m.rendezvous.v1.curve25519-aes-sha256") ECDH_V1("m.rendezvous.v1.curve25519-aes-sha256")
} }