Class BetaManagedAgentsWorkflowRunError
-
- All Implemented Interfaces:
public final class BetaManagedAgentsWorkflowRunErrorWhy a workflow run did not finish, or was not created. More types may be added. On
workflow_run.status_ended, for atypeyou do not recognize, rely on the event'sresult.type.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaManagedAgentsWorkflowRunError.VisitorAn interface that defines how to map each variant of BetaManagedAgentsWorkflowRunError to a value of type T.
public final classBetaManagedAgentsWorkflowRunError.Type
-
Method Summary
Modifier and Type Method Description final Optional<BetaManagedAgentsTimeoutWorkflowRunError>timeout()The run reached its time limit. final Optional<BetaManagedAgentsProgramWorkflowRunError>program()The plan, a program that the agent wrote, failed, or the server refused it. final Optional<BetaManagedAgentsUnknownWorkflowRunError>unknown()A failure that has no type of its own. final Optional<BetaManagedAgentsThreadLimitWorkflowRunError>threadLimit()The run exceeded the limit on the number of threads that a run can create. final Optional<BetaManagedAgentsMaxWorkflowRunsWorkflowRunError>maxWorkflowRuns()No run was created, because the session was at its limit of open workflow runs, which are runs that have not ended. final Optional<JsonValue>_json()final BetaManagedAgentsWorkflowRunError.Typetype()final Stringmessage()final BooleanisTimeout()final BooleanisProgram()final BooleanisUnknown()final BooleanisThreadLimit()final BooleanisMaxWorkflowRuns()final BetaManagedAgentsTimeoutWorkflowRunErrorasTimeout()The run reached its time limit. final BetaManagedAgentsProgramWorkflowRunErrorasProgram()The plan, a program that the agent wrote, failed, or the server refused it. final BetaManagedAgentsUnknownWorkflowRunErrorasUnknown()A failure that has no type of its own. final BetaManagedAgentsThreadLimitWorkflowRunErrorasThreadLimit()The run exceeded the limit on the number of threads that a run can create. final BetaManagedAgentsMaxWorkflowRunsWorkflowRunErrorasMaxWorkflowRuns()No run was created, because the session was at its limit of open workflow runs, which are runs that have not ended. final <T extends Any> Taccept(BetaManagedAgentsWorkflowRunError.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaManagedAgentsWorkflowRunErrorvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaManagedAgentsWorkflowRunErrorofTimeout(BetaManagedAgentsTimeoutWorkflowRunError timeout)The run reached its time limit. final static BetaManagedAgentsWorkflowRunErrorofTimeout(String message)Returns an immutable instance of BetaManagedAgentsWorkflowRunError whose ofTimeout variant is built from the given required message. final static BetaManagedAgentsWorkflowRunErrorofProgram(BetaManagedAgentsProgramWorkflowRunError program)The plan, a program that the agent wrote, failed, or the server refused it. final static BetaManagedAgentsWorkflowRunErrorofProgram(String message)Returns an immutable instance of BetaManagedAgentsWorkflowRunError whose ofProgram variant is built from the given required message. final static BetaManagedAgentsWorkflowRunErrorofUnknown(BetaManagedAgentsUnknownWorkflowRunError unknown)A failure that has no type of its own. final static BetaManagedAgentsWorkflowRunErrorofUnknown(String message)Returns an immutable instance of BetaManagedAgentsWorkflowRunError whose ofUnknown variant is built from the given required message. final static BetaManagedAgentsWorkflowRunErrorofThreadLimit(BetaManagedAgentsThreadLimitWorkflowRunError threadLimit)The run exceeded the limit on the number of threads that a run can create. final static BetaManagedAgentsWorkflowRunErrorofThreadLimit(String message)Returns an immutable instance of BetaManagedAgentsWorkflowRunError whose ofThreadLimit variant is built from the given required message. final static BetaManagedAgentsWorkflowRunErrorofMaxWorkflowRuns(BetaManagedAgentsMaxWorkflowRunsWorkflowRunError maxWorkflowRuns)No run was created, because the session was at its limit of open workflow runs, which are runs that have not ended. final static BetaManagedAgentsWorkflowRunErrorofMaxWorkflowRuns(String message)Returns an immutable instance of BetaManagedAgentsWorkflowRunError whose ofMaxWorkflowRuns variant is built from the given required message. -
-
Method Detail
-
timeout
final Optional<BetaManagedAgentsTimeoutWorkflowRunError> timeout()
The run reached its time limit.
-
program
final Optional<BetaManagedAgentsProgramWorkflowRunError> program()
The plan, a program that the agent wrote, failed, or the server refused it.
-
unknown
final Optional<BetaManagedAgentsUnknownWorkflowRunError> unknown()
A failure that has no type of its own.
-
threadLimit
final Optional<BetaManagedAgentsThreadLimitWorkflowRunError> threadLimit()
The run exceeded the limit on the number of threads that a run can create.
-
maxWorkflowRuns
final Optional<BetaManagedAgentsMaxWorkflowRunsWorkflowRunError> maxWorkflowRuns()
No run was created, because the session was at its limit of open workflow runs, which are runs that have not ended. Only
workflow_run.errorcarries this type.
-
type
final BetaManagedAgentsWorkflowRunError.Type type()
-
isThreadLimit
final Boolean isThreadLimit()
-
isMaxWorkflowRuns
final Boolean isMaxWorkflowRuns()
-
asTimeout
final BetaManagedAgentsTimeoutWorkflowRunError asTimeout()
The run reached its time limit.
-
asProgram
final BetaManagedAgentsProgramWorkflowRunError asProgram()
The plan, a program that the agent wrote, failed, or the server refused it.
-
asUnknown
final BetaManagedAgentsUnknownWorkflowRunError asUnknown()
A failure that has no type of its own.
-
asThreadLimit
final BetaManagedAgentsThreadLimitWorkflowRunError asThreadLimit()
The run exceeded the limit on the number of threads that a run can create.
-
asMaxWorkflowRuns
final BetaManagedAgentsMaxWorkflowRunsWorkflowRunError asMaxWorkflowRuns()
No run was created, because the session was at its limit of open workflow runs, which are runs that have not ended. Only
workflow_run.errorcarries this type.
-
accept
final <T extends Any> T accept(BetaManagedAgentsWorkflowRunError.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 = betaManagedAgentsWorkflowRunError.accept(new BetaManagedAgentsWorkflowRunError.Visitor<Optional<String>>() { @Override public Optional<String> visitTimeout(BetaManagedAgentsTimeoutWorkflowRunError timeout) { return Optional.of(timeout.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaManagedAgentsWorkflowRunError 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.
-
ofTimeout
final static BetaManagedAgentsWorkflowRunError ofTimeout(BetaManagedAgentsTimeoutWorkflowRunError timeout)
The run reached its time limit.
-
ofTimeout
final static BetaManagedAgentsWorkflowRunError ofTimeout(String message)
Returns an immutable instance of BetaManagedAgentsWorkflowRunError whose ofTimeout variant is built from the given required message.
-
ofProgram
final static BetaManagedAgentsWorkflowRunError ofProgram(BetaManagedAgentsProgramWorkflowRunError program)
The plan, a program that the agent wrote, failed, or the server refused it.
-
ofProgram
final static BetaManagedAgentsWorkflowRunError ofProgram(String message)
Returns an immutable instance of BetaManagedAgentsWorkflowRunError whose ofProgram variant is built from the given required message.
-
ofUnknown
final static BetaManagedAgentsWorkflowRunError ofUnknown(BetaManagedAgentsUnknownWorkflowRunError unknown)
A failure that has no type of its own.
-
ofUnknown
final static BetaManagedAgentsWorkflowRunError ofUnknown(String message)
Returns an immutable instance of BetaManagedAgentsWorkflowRunError whose ofUnknown variant is built from the given required message.
-
ofThreadLimit
final static BetaManagedAgentsWorkflowRunError ofThreadLimit(BetaManagedAgentsThreadLimitWorkflowRunError threadLimit)
The run exceeded the limit on the number of threads that a run can create.
-
ofThreadLimit
final static BetaManagedAgentsWorkflowRunError ofThreadLimit(String message)
Returns an immutable instance of BetaManagedAgentsWorkflowRunError whose ofThreadLimit variant is built from the given required message.
-
ofMaxWorkflowRuns
final static BetaManagedAgentsWorkflowRunError ofMaxWorkflowRuns(BetaManagedAgentsMaxWorkflowRunsWorkflowRunError maxWorkflowRuns)
No run was created, because the session was at its limit of open workflow runs, which are runs that have not ended. Only
workflow_run.errorcarries this type.
-
ofMaxWorkflowRuns
final static BetaManagedAgentsWorkflowRunError ofMaxWorkflowRuns(String message)
Returns an immutable instance of BetaManagedAgentsWorkflowRunError whose ofMaxWorkflowRuns variant is built from the given required message.
-
-
-
-