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

smithy4s.com.dwolla.consul.smithy.Discoverable.scala Maven / Gradle / Ivy

package com.dwolla.consul.smithy

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

final case class Discoverable(serviceName: ServiceName)

object Discoverable extends ShapeTag.Companion[Discoverable] {
  val id: ShapeId = ShapeId("com.dwolla.consul.smithy", "discoverable")

  val hints: Hints = Hints(
    smithy.api.Trait(selector = Some(":is(service)"), structurallyExclusive = None, conflicts = None, breakingChanges = None),
  ).lazily

  // constructor using the original order from the spec
  private def make(serviceName: ServiceName): Discoverable = Discoverable(serviceName)

  implicit val schema: Schema[Discoverable] = recursive(struct(
    ServiceName.schema.required[Discoverable]("serviceName", _.serviceName),
  )(make).withId(id).addHints(hints))
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy