Class BetaManagedAgentsModelRequestFailedError.RetryStatus
-
- All Implemented Interfaces:
public final class BetaManagedAgentsModelRequestFailedError.RetryStatusWhat the client should do next in response to this error.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaManagedAgentsModelRequestFailedError.RetryStatus.VisitorAn interface that defines how to map each variant of RetryStatus to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<BetaManagedAgentsRetryStatusRetrying>retrying()The server is retrying automatically. final Optional<BetaManagedAgentsRetryStatusExhausted>exhausted()This turn is dead; queued inputs are flushed and the session returns to idle. final Optional<BetaManagedAgentsRetryStatusTerminal>terminal()The session encountered a terminal error and will transition to terminatedstate.final BooleanisRetrying()final BooleanisExhausted()final BooleanisTerminal()final BetaManagedAgentsRetryStatusRetryingasRetrying()The server is retrying automatically. final BetaManagedAgentsRetryStatusExhaustedasExhausted()This turn is dead; queued inputs are flushed and the session returns to idle. final BetaManagedAgentsRetryStatusTerminalasTerminal()The session encountered a terminal error and will transition to terminatedstate.final Optional<JsonValue>_json()final <T extends Any> Taccept(BetaManagedAgentsModelRequestFailedError.RetryStatus.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaManagedAgentsModelRequestFailedError.RetryStatusvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaManagedAgentsModelRequestFailedError.RetryStatusofRetrying(BetaManagedAgentsRetryStatusRetrying retrying)The server is retrying automatically. final static BetaManagedAgentsModelRequestFailedError.RetryStatusofExhausted(BetaManagedAgentsRetryStatusExhausted exhausted)This turn is dead; queued inputs are flushed and the session returns to idle. final static BetaManagedAgentsModelRequestFailedError.RetryStatusofTerminal(BetaManagedAgentsRetryStatusTerminal terminal)The session encountered a terminal error and will transition to terminatedstate.-
-
Method Detail
-
retrying
final Optional<BetaManagedAgentsRetryStatusRetrying> retrying()
The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
-
exhausted
final Optional<BetaManagedAgentsRetryStatusExhausted> exhausted()
This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
-
terminal
final Optional<BetaManagedAgentsRetryStatusTerminal> terminal()
The session encountered a terminal error and will transition to
terminatedstate.
-
isRetrying
final Boolean isRetrying()
-
isExhausted
final Boolean isExhausted()
-
isTerminal
final Boolean isTerminal()
-
asRetrying
final BetaManagedAgentsRetryStatusRetrying asRetrying()
The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
-
asExhausted
final BetaManagedAgentsRetryStatusExhausted asExhausted()
This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
-
asTerminal
final BetaManagedAgentsRetryStatusTerminal asTerminal()
The session encountered a terminal error and will transition to
terminatedstate.
-
accept
final <T extends Any> T accept(BetaManagedAgentsModelRequestFailedError.RetryStatus.Visitor<T> visitor)
Maps this instance's current variant to a value of type T using the given visitor.
Note that this method is not forwards compatible with new variants from the API, unless visitor overrides Visitor.unknown. To handle variants not known to this version of the SDK gracefully, consider overriding Visitor.unknown:
import com.anthropic.core.JsonValue; import java.util.Optional; Optional<String> result = retryStatus.accept(new RetryStatus.Visitor<Optional<String>>() { @Override public Optional<String> visitRetrying(BetaManagedAgentsRetryStatusRetrying retrying) { return Optional.of(retrying.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaManagedAgentsModelRequestFailedError.RetryStatus validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
ofRetrying
final static BetaManagedAgentsModelRequestFailedError.RetryStatus ofRetrying(BetaManagedAgentsRetryStatusRetrying retrying)
The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.
-
ofExhausted
final static BetaManagedAgentsModelRequestFailedError.RetryStatus ofExhausted(BetaManagedAgentsRetryStatusExhausted exhausted)
This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.
-
ofTerminal
final static BetaManagedAgentsModelRequestFailedError.RetryStatus ofTerminal(BetaManagedAgentsRetryStatusTerminal terminal)
The session encountered a terminal error and will transition to
terminatedstate.
-
-
-
-