studio.crud.feature.auth.authentication.model.MethodRequestPayload.kt Maven / Gradle / Ivy
package studio.crud.feature.auth.authentication.model
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
class MethodRequestPayload(
val queryParameters: Map>,
val body: String?
) {
val parameters: Map = try {
val map: MutableMap = Gson().fromJson(body, object : TypeToken>() {}.type)
map.putAll(queryParameters.map { it.key to it.value.first() })
map
} catch(e: Exception) {
emptyMap()
}
override fun toString(): String {
return "MethodRequestPayload(queryParameters=$queryParameters, body=$body, parameters=$parameters)"
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy