smithy.api.Severity.scala Maven / Gradle / Ivy
package smithy.api
import smithy4s.Enumeration
import smithy4s.Hints
import smithy4s.Schema
import smithy4s.ShapeId
import smithy4s.ShapeTag
import smithy4s.schema.EnumTag
import smithy4s.schema.Schema.enumeration
/** @param NOTE
* A minor infraction occurred.
* @param WARNING
* An infraction occurred that needs attention.
* @param DANGER
* An infraction occurred that must be resolved.
* @param ERROR
* An unrecoverable infraction occurred.
*/
sealed abstract class Severity(_value: String, _name: String, _intValue: Int, _hints: Hints) extends Enumeration.Value {
override type EnumType = Severity
override val value: String = _value
override val name: String = _name
override val intValue: Int = _intValue
override val hints: Hints = _hints
override def enumeration: Enumeration[EnumType] = Severity
@inline final def widen: Severity = this
}
object Severity extends Enumeration[Severity] with ShapeTag.Companion[Severity] {
val id: ShapeId = ShapeId("smithy.api", "Severity")
val hints: Hints = Hints(
smithy.api.Private(),
).lazily
/** A minor infraction occurred. */
case object NOTE extends Severity("NOTE", "NOTE", 0, Hints.empty) {
override val hints: Hints = Hints(smithy.api.Documentation("A minor infraction occurred.")).lazily
}
/** An infraction occurred that needs attention. */
case object WARNING extends Severity("WARNING", "WARNING", 1, Hints.empty) {
override val hints: Hints = Hints(smithy.api.Documentation("An infraction occurred that needs attention.")).lazily
}
/** An infraction occurred that must be resolved. */
case object DANGER extends Severity("DANGER", "DANGER", 2, Hints.empty) {
override val hints: Hints = Hints(smithy.api.Documentation("An infraction occurred that must be resolved.")).lazily
}
/** An unrecoverable infraction occurred. */
case object ERROR extends Severity("ERROR", "ERROR", 3, Hints.empty) {
override val hints: Hints = Hints(smithy.api.Documentation("An unrecoverable infraction occurred.")).lazily
}
val values: List[Severity] = List(
NOTE,
WARNING,
DANGER,
ERROR,
)
val tag: EnumTag[Severity] = EnumTag.ClosedStringEnum
implicit val schema: Schema[Severity] = enumeration(tag, values).withId(id).addHints(hints)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy