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

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

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

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

/** Defines endpoint test-cases for validating a client's endpoint rule-set.
  * @param version
  *   The endpoint tests schema version.
  * @param testCases
  *   List of endpoint test cases.
  */
final case class EndpointTests(version: String, testCases: Option[List[EndpointTest]] = None)

object EndpointTests extends ShapeTag.Companion[EndpointTests] {
  val id: ShapeId = ShapeId("smithy.rules", "endpointTests")

  val hints: Hints = Hints(
    smithy.api.Documentation("Defines endpoint test-cases for validating a client\'s endpoint rule-set."),
    smithy.api.Unstable(),
    smithy.api.Trait(selector = Some("service"), structurallyExclusive = None, conflicts = None, breakingChanges = None),
  ).lazily

  implicit val schema: Schema[EndpointTests] = recursive(struct(
    string.required[EndpointTests]("version", _.version).addHints(smithy.api.Documentation("The endpoint tests schema version.")),
    EndpointTestList.underlyingSchema.optional[EndpointTests]("testCases", _.testCases).addHints(smithy.api.Documentation("List of endpoint test cases.")),
  ){
    EndpointTests.apply
  }.withId(id).addHints(hints))
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy