smithy4s.smithy.rules.OperationContextParamDefinition.scala Maven / Gradle / Ivy
package smithy.rules
import smithy4s.Hints
import smithy4s.Schema
import smithy4s.ShapeId
import smithy4s.ShapeTag
import smithy4s.schema.Schema.string
import smithy4s.schema.Schema.struct
/** An operation context parameter definition.
* @param path
* a JMESPath expression to select element(s) from the operation input to bind to.
*/
final case class OperationContextParamDefinition(path: String)
object OperationContextParamDefinition extends ShapeTag.Companion[OperationContextParamDefinition] {
val id: ShapeId = ShapeId("smithy.rules", "OperationContextParamDefinition")
val hints: Hints = Hints(
smithy.api.Documentation("An operation context parameter definition."),
smithy.api.Unstable(),
smithy.api.Private(),
).lazily
// constructor using the original order from the spec
private def make(path: String): OperationContextParamDefinition = OperationContextParamDefinition(path)
implicit val schema: Schema[OperationContextParamDefinition] = struct(
string.required[OperationContextParamDefinition]("path", _.path).addHints(smithy.api.Documentation("a JMESPath expression to select element(s) from the operation input to bind to.")),
)(make).withId(id).addHints(hints)
}