com.deque.axe.android.moshi.AuthUrlResponseAdapter.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of axe-devtools-android-data Show documentation
Show all versions of axe-devtools-android-data Show documentation
The Axe Devtools Android Data Library
package com.deque.axe.android.moshi
import com.deque.networking.models.auth.AuthUrlResponse
import com.squareup.moshi.FromJson
import com.squareup.moshi.ToJson
internal class AuthUrlResponseAdapter {
@ToJson
fun toJson(authUrlResponse: AuthUrlResponse): UrlResponseJson {
return UrlResponseJson(
authUrlResponse.url,
authUrlResponse.realm
)
}
@FromJson
fun fromJson(urlResponseJson: UrlResponseJson): AuthUrlResponse {
return AuthUrlResponse(
urlResponseJson.url,
urlResponseJson.realm
)
}
}
internal data class UrlResponseJson(
val url: String?,
val realm: String?
)