smithy.waiters.PathComparator.scala Maven / Gradle / Ivy
package smithy.waiters
import smithy4s.Enumeration
import smithy4s.Hints
import smithy4s.Schema
import smithy4s.ShapeId
import smithy4s.ShapeTag
import smithy4s.schema.EnumTag
import smithy4s.schema.Schema.enumeration
/** Defines a comparison to perform in a PathMatcher.
* @param STRING_EQUALS
* Matches if the return value is a string that is equal to the expected string.
* @param BOOLEAN_EQUALS
* Matches if the return value is a boolean that is equal to the string literal 'true' or 'false'.
* @param ALL_STRING_EQUALS
* Matches if all values in the list matches the expected string.
* @param ANY_STRING_EQUALS
* Matches if any value in the list matches the expected string.
*/
sealed abstract class PathComparator(_value: String, _name: String, _intValue: Int, _hints: Hints) extends Enumeration.Value {
override type EnumType = PathComparator
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] = PathComparator
@inline final def widen: PathComparator = this
}
object PathComparator extends Enumeration[PathComparator] with ShapeTag.Companion[PathComparator] {
val id: ShapeId = ShapeId("smithy.waiters", "PathComparator")
val hints: Hints = Hints(
smithy.api.Documentation("Defines a comparison to perform in a PathMatcher."),
smithy.api.Private(),
).lazily
/** Matches if the return value is a string that is equal to the expected string. */
case object STRING_EQUALS extends PathComparator("stringEquals", "STRING_EQUALS", 0, Hints.empty) {
override val hints: Hints = Hints(smithy.api.Documentation("Matches if the return value is a string that is equal to the expected string.")).lazily
}
/** Matches if the return value is a boolean that is equal to the string literal 'true' or 'false'. */
case object BOOLEAN_EQUALS extends PathComparator("booleanEquals", "BOOLEAN_EQUALS", 1, Hints.empty) {
override val hints: Hints = Hints(smithy.api.Documentation("Matches if the return value is a boolean that is equal to the string literal \'true\' or \'false\'.")).lazily
}
/** Matches if all values in the list matches the expected string. */
case object ALL_STRING_EQUALS extends PathComparator("allStringEquals", "ALL_STRING_EQUALS", 2, Hints.empty) {
override val hints: Hints = Hints(smithy.api.Documentation("Matches if all values in the list matches the expected string.")).lazily
}
/** Matches if any value in the list matches the expected string. */
case object ANY_STRING_EQUALS extends PathComparator("anyStringEquals", "ANY_STRING_EQUALS", 3, Hints.empty) {
override val hints: Hints = Hints(smithy.api.Documentation("Matches if any value in the list matches the expected string.")).lazily
}
val values: List[PathComparator] = List(
STRING_EQUALS,
BOOLEAN_EQUALS,
ALL_STRING_EQUALS,
ANY_STRING_EQUALS,
)
val tag: EnumTag[PathComparator] = EnumTag.ClosedStringEnum
implicit val schema: Schema[PathComparator] = enumeration(tag, values).withId(id).addHints(hints)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy