smithy.api.Auth.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.set
/** Defines the ordered list of supported authentication schemes.
* @param member
* A string that must target an auth trait.
*/
object Auth extends Newtype[Set[AuthTraitReference]] {
val id: ShapeId = ShapeId("smithy.api", "auth")
val hints: Hints = Hints(
smithy.api.UniqueItems(),
smithy.api.Documentation("Defines the ordered list of supported authentication schemes."),
smithy.api.Trait(selector = Some(":is(service, operation)"), structurallyExclusive = None, conflicts = None, breakingChanges = None),
).lazily
val underlyingSchema: Schema[Set[AuthTraitReference]] = set(AuthTraitReference.schema).withId(id).addHints(hints)
implicit val schema: Schema[Auth] = recursive(bijection(underlyingSchema, asBijection))
}