package com.fireworksdk.bridge.models import com.fireworksdk.bridge.models.enums.FWVideoPlayerLogoOption import org.json.JSONObject object FWVideoPlayerLogoConfigurationModelDeserializer { private const val OPTION_KEY = "option" private const val ENCODED_ID_KEY = "encodedId" private const val IS_CLICKABLE = "isClickable" fun deserialize(responseJson: JSONObject?): FWVideoPlayerLogoConfigurationModel? { responseJson ?: return null val option = if (responseJson.has(OPTION_KEY)) responseJson.optString(OPTION_KEY) else null val encodedId = if (responseJson.has(ENCODED_ID_KEY)) responseJson.optString(ENCODED_ID_KEY) else null val isClickable = if (responseJson.has(IS_CLICKABLE)) responseJson.optBoolean(IS_CLICKABLE) else null return FWVideoPlayerLogoConfigurationModel( option = if (!option.isNullOrBlank()) FWVideoPlayerLogoOption.deserialize(option) else null, encodedId = encodedId, isClickable = isClickable ) } }