scala.smithy.rules.StaticContextParams.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kinesis4cats-smithy4s-client_3 Show documentation
Show all versions of kinesis4cats-smithy4s-client_3 Show documentation
Cats tooling for the Smithy4s Kinesis Client
package smithy.rules
import smithy4s.Hints
import smithy4s.Newtype
import smithy4s.Schema
import smithy4s.ShapeId
import smithy4s.schema.Schema.bijection
import smithy4s.schema.Schema.map
import smithy4s.schema.Schema.recursive
import smithy4s.schema.Schema.string
/** Binds one or more named rule-set parameters to the defined static value for the targeted operation.
* The type of the targeted shape targeted by the trait MUST match the parameter type defined in the rule-set.
* @param key
* The rule-set parameter name.
* @param value
* The static parameter definition.
*/
object StaticContextParams extends Newtype[Map[String, StaticContextParamDefinition]] {
val id: ShapeId = ShapeId("smithy.rules", "staticContextParams")
val hints: Hints = Hints(
smithy.api.Documentation("Binds one or more named rule-set parameters to the defined static value for the targeted operation.\nThe type of the targeted shape targeted by the trait MUST match the parameter type defined in the rule-set."),
smithy.api.Unstable(),
smithy.api.Trait(selector = Some("operation"), structurallyExclusive = None, conflicts = None, breakingChanges = None),
)
val underlyingSchema: Schema[Map[String, StaticContextParamDefinition]] = map(string.addMemberHints(smithy.api.Documentation("The rule-set parameter name.")), StaticContextParamDefinition.schema.addMemberHints(smithy.api.Documentation("The static parameter definition."))).withId(id).addHints(hints)
implicit val schema: Schema[StaticContextParams] = recursive(bijection(underlyingSchema, asBijection))
}