smithy.api.HttpQuery.scala Maven / Gradle / Ivy
package smithy.api
import smithy4s.Hints
import smithy4s.Newtype
import smithy4s.Schema
import smithy4s.ShapeId
import smithy4s.schema.Schema.bijection
import smithy4s.schema.Schema.recursive
import smithy4s.schema.Schema.string
/** Binds an operation input structure member to a query string parameter. */
object HttpQuery extends Newtype[String] {
val id: ShapeId = ShapeId("smithy.api", "httpQuery")
val hints: Hints = Hints(
smithy.api.Documentation("Binds an operation input structure member to a query string parameter."),
smithy.api.Trait(selector = Some("structure > member\n:test(> :test(string, number, boolean, timestamp),\n> list > member > :test(string, number, boolean, timestamp))"), structurallyExclusive = None, conflicts = Some(List(smithy.api.NonEmptyString("smithy.api#httpLabel"), smithy.api.NonEmptyString("smithy.api#httpHeader"), smithy.api.NonEmptyString("smithy.api#httpPrefixHeaders"), smithy.api.NonEmptyString("smithy.api#httpPayload"), smithy.api.NonEmptyString("smithy.api#httpResponseCode"), smithy.api.NonEmptyString("smithy.api#httpQueryParams"))), breakingChanges = Some(List(smithy.api.TraitDiffRule(change = smithy.api.TraitChangeType.ANY.widen, severity = smithy.api.Severity.ERROR.widen, path = None, message = None)))),
).lazily
val underlyingSchema: Schema[String] = string.withId(id).addHints(hints).validated(smithy.api.Length(min = Some(1L), max = None))
implicit val schema: Schema[HttpQuery] = recursive(bijection(underlyingSchema, asBijection))
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy