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

scala.smithy.rules.EndpointTest.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.Schema
import smithy4s.ShapeId
import smithy4s.ShapeTag
import smithy4s.schema.Schema.document
import smithy4s.schema.Schema.string
import smithy4s.schema.Schema.struct

/** Describes an endpoint test case for validation of an endpoint rule-set.
  * @param documentation
  *   Documentation describing the test case.
  * @param params
  *   Defines rule-set parameters and values to use for testing rules-engine.
  * @param operationInputs
  *   Defines a set of service operation configurations used for testing the rules-engine.
  * @param expect
  *   The expected outcome of the test case.
  */
final case class EndpointTest(expect: EndpointTestExpectation, documentation: Option[String] = None, params: Option[Document] = None, operationInputs: Option[List[OperationInput]] = None)

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

  val hints: Hints = Hints(
    smithy.api.Documentation("Describes an endpoint test case for validation of an endpoint rule-set."),
    smithy.api.Unstable(),
    smithy.api.Private(),
  )

  implicit val schema: Schema[EndpointTest] = struct(
    EndpointTestExpectation.schema.required[EndpointTest]("expect", _.expect).addHints(smithy.api.Documentation("The expected outcome of the test case.")),
    string.optional[EndpointTest]("documentation", _.documentation).addHints(smithy.api.Documentation("Documentation describing the test case.")),
    document.optional[EndpointTest]("params", _.params).addHints(smithy.api.Documentation("Defines rule-set parameters and values to use for testing rules-engine.")),
    OperationInputs.underlyingSchema.optional[EndpointTest]("operationInputs", _.operationInputs).addHints(smithy.api.Documentation("Defines a set of service operation configurations used for testing the rules-engine.")),
  ){
    EndpointTest.apply
  }.withId(id).addHints(hints)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy