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

scala.smithy.rules.Properties.scala Maven / Gradle / Ivy

There is a newer version: 0.0.32
Show newest version
package smithy.rules

import smithy4s.Document
import smithy4s.Hints
import smithy4s.Newtype
import smithy4s.Schema
import smithy4s.ShapeId
import smithy4s.schema.Schema.bijection
import smithy4s.schema.Schema.document
import smithy4s.schema.Schema.map
import smithy4s.schema.Schema.string

/** A map of strings to document values.
  * @param key
  *   The property name.
  * @param value
  *   The property value.
  */
object Properties extends Newtype[Map[String, Document]] {
  val id: ShapeId = ShapeId("smithy.rules", "Properties")
  val hints: Hints = Hints(
    smithy.api.Documentation("A map of strings to document values."),
    smithy.api.Unstable(),
    smithy.api.Private(),
  ).lazily
  val underlyingSchema: Schema[Map[String, Document]] = map(string.addMemberHints(smithy.api.Documentation("The property name.")), document.addMemberHints(smithy.api.Documentation("The property value."))).withId(id).addHints(hints)
  implicit val schema: Schema[Properties] = bijection(underlyingSchema, asBijection)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy