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

com.deque.axe.android.moshi.AuthUrlResponseAdapter.kt Maven / Gradle / Ivy

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy