package com.fireworksdk.bridge.models import org.json.JSONObject object FWActionButtonSerializer { private const val BACKGROUND_COLOR = "backgroundColor" private const val TEXT_COLOR = "textColor" private const val SHAPE = "shape" private const val DIVIDING_LINE_COLOR = "dividingLineColor" fun serialize(model: FWActionButtonModel?): JSONObject? { model ?: return null val jsonObject = JSONObject() jsonObject.put(BACKGROUND_COLOR, model.backgroundColor) jsonObject.put(TEXT_COLOR, model.textColor) jsonObject.put(SHAPE, FWShape.serialize(model.shape)) jsonObject.put(DIVIDING_LINE_COLOR, model.dividingLineColor) return jsonObject } }