All Downloads are FREE. Search and download functionalities are using the official Maven repository.

studio.crud.feature.auth.authentication.model.MethodRequestPayload.kt Maven / Gradle / Ivy

There is a newer version: 0.3.0
Show newest version
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