Class BetaManagedAgentsError
-
- All Implemented Interfaces:
public final class BetaManagedAgentsError
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaManagedAgentsError.VisitorAn interface that defines how to map each variant of BetaManagedAgentsError to a value of type T.
public final classBetaManagedAgentsError.Type
-
Method Summary
Modifier and Type Method Description final Optional<BetaInvalidRequestError>invalidRequest()final Optional<BetaAuthenticationError>authentication()final Optional<BetaBillingError>billing()final Optional<BetaPermissionError>permission()final Optional<BetaNotFoundError>notFound()final Optional<BetaRateLimitError>rateLimit()final Optional<BetaGatewayTimeoutError>timeout()final Optional<BetaApiError>api()final Optional<BetaOverloadedError>overloaded()final Optional<BetaManagedAgentsMemoryPreconditionFailedError>memoryPreconditionFailed()The error returned with HTTP status 409 when a request's precondition doesn't hold for the memory's current state, such as preconditionon an update orexpected_content_sha256on a delete.final Optional<BetaManagedAgentsMemoryPathConflictError>memoryPathConflict()The error returned with HTTP status 409 when you create or rename a memory and the path you give is already used by another memory or overlaps another memory's path. final Optional<BetaManagedAgentsConflictError>conflict()final Optional<JsonValue>_json()final BetaManagedAgentsError.Typetype()final Optional<String>message()final BooleanisInvalidRequest()final BooleanisAuthentication()final BooleanisBilling()final BooleanisPermission()final BooleanisNotFound()final BooleanisRateLimit()final BooleanisTimeout()final BooleanisApi()final BooleanisOverloaded()final BooleanisMemoryPreconditionFailed()final BooleanisMemoryPathConflict()final BooleanisConflict()final BetaInvalidRequestErrorasInvalidRequest()final BetaAuthenticationErrorasAuthentication()final BetaBillingErrorasBilling()final BetaPermissionErrorasPermission()final BetaNotFoundErrorasNotFound()final BetaRateLimitErrorasRateLimit()final BetaGatewayTimeoutErrorasTimeout()final BetaApiErrorasApi()final BetaOverloadedErrorasOverloaded()final BetaManagedAgentsMemoryPreconditionFailedErrorasMemoryPreconditionFailed()The error returned with HTTP status 409 when a request's precondition doesn't hold for the memory's current state, such as preconditionon an update orexpected_content_sha256on a delete.final BetaManagedAgentsMemoryPathConflictErrorasMemoryPathConflict()The error returned with HTTP status 409 when you create or rename a memory and the path you give is already used by another memory or overlaps another memory's path. final BetaManagedAgentsConflictErrorasConflict()final <T extends Any> Taccept(BetaManagedAgentsError.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaManagedAgentsErrorvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaManagedAgentsErrorofInvalidRequest(BetaInvalidRequestError invalidRequest)final static BetaManagedAgentsErrorofInvalidRequest(String message)Returns an immutable instance of BetaManagedAgentsError whose ofInvalidRequest variant is built from the given required message. final static BetaManagedAgentsErrorofAuthentication(BetaAuthenticationError authentication)final static BetaManagedAgentsErrorofAuthentication(String message)Returns an immutable instance of BetaManagedAgentsError whose ofAuthentication variant is built from the given required message. final static BetaManagedAgentsErrorofBilling(BetaBillingError billing)final static BetaManagedAgentsErrorofBilling(String message)Returns an immutable instance of BetaManagedAgentsError whose ofBilling variant is built from the given required message. final static BetaManagedAgentsErrorofPermission(BetaPermissionError permission)final static BetaManagedAgentsErrorofPermission(String message)Returns an immutable instance of BetaManagedAgentsError whose ofPermission variant is built from the given required message. final static BetaManagedAgentsErrorofNotFound(BetaNotFoundError notFound)final static BetaManagedAgentsErrorofNotFound(String message)Returns an immutable instance of BetaManagedAgentsError whose ofNotFound variant is built from the given required message. final static BetaManagedAgentsErrorofRateLimit(BetaRateLimitError rateLimit)final static BetaManagedAgentsErrorofRateLimit(String message)Returns an immutable instance of BetaManagedAgentsError whose ofRateLimit variant is built from the given required message. final static BetaManagedAgentsErrorofTimeout(BetaGatewayTimeoutError timeout)final static BetaManagedAgentsErrorofTimeout(String message)Returns an immutable instance of BetaManagedAgentsError whose ofTimeout variant is built from the given required message. final static BetaManagedAgentsErrorofApi(BetaApiError api)final static BetaManagedAgentsErrorofApi(String message)Returns an immutable instance of BetaManagedAgentsError whose ofApi variant is built from the given required message. final static BetaManagedAgentsErrorofOverloaded(BetaOverloadedError overloaded)final static BetaManagedAgentsErrorofOverloaded(String message)Returns an immutable instance of BetaManagedAgentsError whose ofOverloaded variant is built from the given required message. final static BetaManagedAgentsErrorofMemoryPreconditionFailed(BetaManagedAgentsMemoryPreconditionFailedError memoryPreconditionFailed)The error returned with HTTP status 409 when a request's precondition doesn't hold for the memory's current state, such as preconditionon an update orexpected_content_sha256on a delete.final static BetaManagedAgentsErrorofMemoryPathConflict(BetaManagedAgentsMemoryPathConflictError memoryPathConflict)The error returned with HTTP status 409 when you create or rename a memory and the path you give is already used by another memory or overlaps another memory's path. final static BetaManagedAgentsErrorofConflict(BetaManagedAgentsConflictError conflict)-
-
Method Detail
-
invalidRequest
final Optional<BetaInvalidRequestError> invalidRequest()
-
authentication
final Optional<BetaAuthenticationError> authentication()
-
billing
final Optional<BetaBillingError> billing()
-
permission
final Optional<BetaPermissionError> permission()
-
notFound
final Optional<BetaNotFoundError> notFound()
-
rateLimit
final Optional<BetaRateLimitError> rateLimit()
-
timeout
final Optional<BetaGatewayTimeoutError> timeout()
-
api
final Optional<BetaApiError> api()
-
overloaded
final Optional<BetaOverloadedError> overloaded()
-
memoryPreconditionFailed
final Optional<BetaManagedAgentsMemoryPreconditionFailedError> memoryPreconditionFailed()
The error returned with HTTP status 409 when a request's precondition doesn't hold for the memory's current state, such as
preconditionon an update orexpected_content_sha256on a delete.The error doesn't include the memory's current state. Retrieve the memory to see its current content and
content_sha256before you retry.See the memory guide to learn more about safe content edits with content hash preconditions.
-
memoryPathConflict
final Optional<BetaManagedAgentsMemoryPathConflictError> memoryPathConflict()
The error returned with HTTP status 409 when you create or rename a memory and the path you give is already used by another memory or overlaps another memory's path.
Two paths overlap when one is an ancestor of the other, such as
/notesand/notes/todo.md. To free the path, rename or delete the memory thatconflicting_memory_idreferences, then retry. To change that memory instead of creating a new one, update it.To handle the error in code, use
conflicting_pathandconflicting_memory_idinstead ofmessage.
-
conflict
final Optional<BetaManagedAgentsConflictError> conflict()
-
type
final BetaManagedAgentsError.Type type()
-
isInvalidRequest
final Boolean isInvalidRequest()
-
isAuthentication
final Boolean isAuthentication()
-
isPermission
final Boolean isPermission()
-
isNotFound
final Boolean isNotFound()
-
isRateLimit
final Boolean isRateLimit()
-
isOverloaded
final Boolean isOverloaded()
-
isMemoryPreconditionFailed
final Boolean isMemoryPreconditionFailed()
-
isMemoryPathConflict
final Boolean isMemoryPathConflict()
-
isConflict
final Boolean isConflict()
-
asInvalidRequest
final BetaInvalidRequestError asInvalidRequest()
-
asAuthentication
final BetaAuthenticationError asAuthentication()
-
asBilling
final BetaBillingError asBilling()
-
asPermission
final BetaPermissionError asPermission()
-
asNotFound
final BetaNotFoundError asNotFound()
-
asRateLimit
final BetaRateLimitError asRateLimit()
-
asTimeout
final BetaGatewayTimeoutError asTimeout()
-
asApi
final BetaApiError asApi()
-
asOverloaded
final BetaOverloadedError asOverloaded()
-
asMemoryPreconditionFailed
final BetaManagedAgentsMemoryPreconditionFailedError asMemoryPreconditionFailed()
The error returned with HTTP status 409 when a request's precondition doesn't hold for the memory's current state, such as
preconditionon an update orexpected_content_sha256on a delete.The error doesn't include the memory's current state. Retrieve the memory to see its current content and
content_sha256before you retry.See the memory guide to learn more about safe content edits with content hash preconditions.
-
asMemoryPathConflict
final BetaManagedAgentsMemoryPathConflictError asMemoryPathConflict()
The error returned with HTTP status 409 when you create or rename a memory and the path you give is already used by another memory or overlaps another memory's path.
Two paths overlap when one is an ancestor of the other, such as
/notesand/notes/todo.md. To free the path, rename or delete the memory thatconflicting_memory_idreferences, then retry. To change that memory instead of creating a new one, update it.To handle the error in code, use
conflicting_pathandconflicting_memory_idinstead ofmessage.
-
asConflict
final BetaManagedAgentsConflictError asConflict()
-
accept
final <T extends Any> T accept(BetaManagedAgentsError.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 = betaManagedAgentsError.accept(new BetaManagedAgentsError.Visitor<Optional<String>>() { @Override public Optional<String> visitInvalidRequest(BetaInvalidRequestError invalidRequest) { return Optional.of(invalidRequest.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaManagedAgentsError 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.
-
ofInvalidRequest
final static BetaManagedAgentsError ofInvalidRequest(BetaInvalidRequestError invalidRequest)
-
ofInvalidRequest
final static BetaManagedAgentsError ofInvalidRequest(String message)
Returns an immutable instance of BetaManagedAgentsError whose ofInvalidRequest variant is built from the given required message.
-
ofAuthentication
final static BetaManagedAgentsError ofAuthentication(BetaAuthenticationError authentication)
-
ofAuthentication
final static BetaManagedAgentsError ofAuthentication(String message)
Returns an immutable instance of BetaManagedAgentsError whose ofAuthentication variant is built from the given required message.
-
ofBilling
final static BetaManagedAgentsError ofBilling(BetaBillingError billing)
-
ofBilling
final static BetaManagedAgentsError ofBilling(String message)
Returns an immutable instance of BetaManagedAgentsError whose ofBilling variant is built from the given required message.
-
ofPermission
final static BetaManagedAgentsError ofPermission(BetaPermissionError permission)
-
ofPermission
final static BetaManagedAgentsError ofPermission(String message)
Returns an immutable instance of BetaManagedAgentsError whose ofPermission variant is built from the given required message.
-
ofNotFound
final static BetaManagedAgentsError ofNotFound(BetaNotFoundError notFound)
-
ofNotFound
final static BetaManagedAgentsError ofNotFound(String message)
Returns an immutable instance of BetaManagedAgentsError whose ofNotFound variant is built from the given required message.
-
ofRateLimit
final static BetaManagedAgentsError ofRateLimit(BetaRateLimitError rateLimit)
-
ofRateLimit
final static BetaManagedAgentsError ofRateLimit(String message)
Returns an immutable instance of BetaManagedAgentsError whose ofRateLimit variant is built from the given required message.
-
ofTimeout
final static BetaManagedAgentsError ofTimeout(BetaGatewayTimeoutError timeout)
-
ofTimeout
final static BetaManagedAgentsError ofTimeout(String message)
Returns an immutable instance of BetaManagedAgentsError whose ofTimeout variant is built from the given required message.
-
ofApi
final static BetaManagedAgentsError ofApi(BetaApiError api)
-
ofApi
final static BetaManagedAgentsError ofApi(String message)
Returns an immutable instance of BetaManagedAgentsError whose ofApi variant is built from the given required message.
-
ofOverloaded
final static BetaManagedAgentsError ofOverloaded(BetaOverloadedError overloaded)
-
ofOverloaded
final static BetaManagedAgentsError ofOverloaded(String message)
Returns an immutable instance of BetaManagedAgentsError whose ofOverloaded variant is built from the given required message.
-
ofMemoryPreconditionFailed
final static BetaManagedAgentsError ofMemoryPreconditionFailed(BetaManagedAgentsMemoryPreconditionFailedError memoryPreconditionFailed)
The error returned with HTTP status 409 when a request's precondition doesn't hold for the memory's current state, such as
preconditionon an update orexpected_content_sha256on a delete.The error doesn't include the memory's current state. Retrieve the memory to see its current content and
content_sha256before you retry.See the memory guide to learn more about safe content edits with content hash preconditions.
-
ofMemoryPathConflict
final static BetaManagedAgentsError ofMemoryPathConflict(BetaManagedAgentsMemoryPathConflictError memoryPathConflict)
The error returned with HTTP status 409 when you create or rename a memory and the path you give is already used by another memory or overlaps another memory's path.
Two paths overlap when one is an ancestor of the other, such as
/notesand/notes/todo.md. To free the path, rename or delete the memory thatconflicting_memory_idreferences, then retry. To change that memory instead of creating a new one, update it.To handle the error in code, use
conflicting_pathandconflicting_memory_idinstead ofmessage.
-
ofConflict
final static BetaManagedAgentsError ofConflict(BetaManagedAgentsConflictError conflict)
-
-
-
-