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

io.github.quafadas.dairect.ImageUrlDetails.scala Maven / Gradle / Ivy

The newest version!
package io.github.quafadas.dairect

import smithy4s.Hints
import smithy4s.Schema
import smithy4s.ShapeId
import smithy4s.ShapeTag
import smithy4s.schema.Schema.string
import smithy4s.schema.Schema.struct

final case class ImageUrlDetails(url: String, detail: Option[String] = None)

object ImageUrlDetails extends ShapeTag.Companion[ImageUrlDetails] {
  val id: ShapeId = ShapeId("io.github.quafadas.dairect", "ImageUrlDetails")

  val hints: Hints = Hints.empty

  // constructor using the original order from the spec
  private def make(url: String, detail: Option[String]): ImageUrlDetails = ImageUrlDetails(url, detail)

  implicit val schema: Schema[ImageUrlDetails] = struct(
    string.required[ImageUrlDetails]("url", _.url),
    string.optional[ImageUrlDetails]("detail", _.detail),
  )(make).withId(id).addHints(hints)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy