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

org.danielnixon.progressive.shared.api.SubmitButtonSettings.scala Maven / Gradle / Ivy

package org.danielnixon.progressive.shared.api

import io.circe.{ Decoder, Encoder }
import io.circe.generic.semiauto.{ deriveDecoder, deriveEncoder }
import org.danielnixon.progressive.shared.Wart

final case class SubmitButtonSettings(
  target: Option[Target] = None,
  busyMessage: Option[String] = None
)

@SuppressWarnings(Array(Wart.AsInstanceOf, Wart.Nothing))
object SubmitButtonSettings {
  implicit val decoder: Decoder[SubmitButtonSettings] = deriveDecoder[SubmitButtonSettings]
  implicit val encoder: Encoder[SubmitButtonSettings] = deriveEncoder[SubmitButtonSettings]

  def asJson(target: SubmitButtonSettings): String = Json.asJson(target)

  def fromJson(json: String): Option[SubmitButtonSettings] = Json.fromJson(json)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy