smithy.api.Title.scala Maven / Gradle / Ivy
package smithy.api
import smithy4s.Hints
import smithy4s.Newtype
import smithy4s.Schema
import smithy4s.ShapeId
import smithy4s.schema.Schema.bijection
import smithy4s.schema.Schema.recursive
import smithy4s.schema.Schema.string
/** Defines a proper name for a service or resource shape.
*
* This title can be used in automatically generated documentation
* and other contexts to provide a user friendly name for services
* and resources.
*/
object Title extends Newtype[String] {
val id: ShapeId = ShapeId("smithy.api", "title")
val hints: Hints = Hints(
smithy.api.Documentation("Defines a proper name for a service or resource shape.\n\nThis title can be used in automatically generated documentation\nand other contexts to provide a user friendly name for services\nand resources."),
smithy.api.Trait(selector = Some(":is(service, resource)"), structurallyExclusive = None, conflicts = None, breakingChanges = None),
).lazily
val underlyingSchema: Schema[String] = string.withId(id).addHints(hints)
implicit val schema: Schema[Title] = recursive(bijection(underlyingSchema, asBijection))
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy