smithy.waiters.AcceptorState.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
/** The transition state of a waiter.
* @param SUCCESS
* The waiter successfully finished waiting. This is a terminal
* state that causes the waiter to stop.
* @param FAILURE
* The waiter failed to enter into the desired state. This is a
* terminal state that causes the waiter to stop.
* @param RETRY
* The waiter will retry the operation. This state transition is
* implicit if no accepter causes a state transition.
*/
sealed abstract class AcceptorState(_value: String, _name: String, _intValue: Int, _hints: Hints) extends Enumeration.Value {
override type EnumType = AcceptorState
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] = AcceptorState
@inline final def widen: AcceptorState = this
}
object AcceptorState extends Enumeration[AcceptorState] with ShapeTag.Companion[AcceptorState] {
val id: ShapeId = ShapeId("smithy.waiters", "AcceptorState")
val hints: Hints = Hints(
smithy.api.Documentation("The transition state of a waiter."),
smithy.api.Private(),
).lazily
/** The waiter successfully finished waiting. This is a terminal
* state that causes the waiter to stop.
*/
case object SUCCESS extends AcceptorState("success", "SUCCESS", 0, Hints.empty) {
override val hints: Hints = Hints(smithy.api.Documentation("The waiter successfully finished waiting. This is a terminal\nstate that causes the waiter to stop.")).lazily
}
/** The waiter failed to enter into the desired state. This is a
* terminal state that causes the waiter to stop.
*/
case object FAILURE extends AcceptorState("failure", "FAILURE", 1, Hints.empty) {
override val hints: Hints = Hints(smithy.api.Documentation("The waiter failed to enter into the desired state. This is a\nterminal state that causes the waiter to stop.")).lazily
}
/** The waiter will retry the operation. This state transition is
* implicit if no accepter causes a state transition.
*/
case object RETRY extends AcceptorState("retry", "RETRY", 2, Hints.empty) {
override val hints: Hints = Hints(smithy.api.Documentation("The waiter will retry the operation. This state transition is\nimplicit if no accepter causes a state transition.")).lazily
}
val values: List[AcceptorState] = List(
SUCCESS,
FAILURE,
RETRY,
)
val tag: EnumTag[AcceptorState] = EnumTag.ClosedStringEnum
implicit val schema: Schema[AcceptorState] = enumeration(tag, values).withId(id).addHints(hints)
}