com.reown.foundation.crypto.data.repository.model.IrnJwtClaimsJsonAdapter.kt Maven / Gradle / Ivy
// Code generated by moshi-kotlin-codegen. Do not edit.
@file:Suppress("DEPRECATION", "unused", "UNUSED_PARAMETER", "ClassName", "REDUNDANT_PROJECTION",
"RedundantExplicitType", "LocalVariableName", "RedundantVisibilityModifier",
"PLATFORM_CLASS_MAPPED_TO_KOTLIN", "IMPLICIT_NOTHING_TYPE_ARGUMENT_IN_RETURN_POSITION")
package com.reown.foundation.crypto.`data`.repository.model
import com.squareup.moshi.JsonAdapter
import com.squareup.moshi.JsonReader
import com.squareup.moshi.JsonWriter
import com.squareup.moshi.Moshi
import com.squareup.moshi.`internal`.Util
import java.lang.NullPointerException
import kotlin.Long
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.emptySet
import kotlin.text.buildString
public class IrnJwtClaimsJsonAdapter(
moshi: Moshi,
) : JsonAdapter() {
private val options: JsonReader.Options = JsonReader.Options.of("iss", "sub", "aud", "iat", "exp")
private val stringAdapter: JsonAdapter = moshi.adapter(String::class.java, emptySet(),
"issuer")
private val longAdapter: JsonAdapter = moshi.adapter(Long::class.java, emptySet(),
"issuedAt")
public override fun toString(): String = buildString(34) {
append("GeneratedJsonAdapter(").append("IrnJwtClaims").append(')') }
public override fun fromJson(reader: JsonReader): IrnJwtClaims {
var issuer: String? = null
var subject: String? = null
var audience: String? = null
var issuedAt: Long? = null
var expiration: Long? = null
reader.beginObject()
while (reader.hasNext()) {
when (reader.selectName(options)) {
0 -> issuer = stringAdapter.fromJson(reader) ?: throw Util.unexpectedNull("issuer", "iss",
reader)
1 -> subject = stringAdapter.fromJson(reader) ?: throw Util.unexpectedNull("subject", "sub",
reader)
2 -> audience = stringAdapter.fromJson(reader) ?: throw Util.unexpectedNull("audience",
"aud", reader)
3 -> issuedAt = longAdapter.fromJson(reader) ?: throw Util.unexpectedNull("issuedAt", "iat",
reader)
4 -> expiration = longAdapter.fromJson(reader) ?: throw Util.unexpectedNull("expiration",
"exp", reader)
-1 -> {
// Unknown name, skip it.
reader.skipName()
reader.skipValue()
}
}
}
reader.endObject()
return IrnJwtClaims(
issuer = issuer ?: throw Util.missingProperty("issuer", "iss", reader),
subject = subject ?: throw Util.missingProperty("subject", "sub", reader),
audience = audience ?: throw Util.missingProperty("audience", "aud", reader),
issuedAt = issuedAt ?: throw Util.missingProperty("issuedAt", "iat", reader),
expiration = expiration ?: throw Util.missingProperty("expiration", "exp", reader)
)
}
public override fun toJson(writer: JsonWriter, value_: IrnJwtClaims?): Unit {
if (value_ == null) {
throw NullPointerException("value_ was null! Wrap in .nullSafe() to write nullable values.")
}
writer.beginObject()
writer.name("iss")
stringAdapter.toJson(writer, value_.issuer)
writer.name("sub")
stringAdapter.toJson(writer, value_.subject)
writer.name("aud")
stringAdapter.toJson(writer, value_.audience)
writer.name("iat")
longAdapter.toJson(writer, value_.issuedAt)
writer.name("exp")
longAdapter.toJson(writer, value_.expiration)
writer.endObject()
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy