Class ResourceRetrieveResponse
-
- All Implemented Interfaces:
public final class ResourceRetrieveResponseThe requested session resource.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceResourceRetrieveResponse.VisitorAn interface that defines how to map each variant of ResourceRetrieveResponse to a value of type T.
-
Method Summary
-
-
Method Detail
-
githubRepository
final Optional<BetaManagedAgentsGitHubRepositoryResource> githubRepository()
-
file
final Optional<BetaManagedAgentsFileResource> file()
-
memoryStore
final Optional<BetaManagedAgentsMemoryStoreResource> memoryStore()
A memory store attached to an agent session.
-
isGitHubRepository
final Boolean isGitHubRepository()
-
isMemoryStore
final Boolean isMemoryStore()
-
asGitHubRepository
final BetaManagedAgentsGitHubRepositoryResource asGitHubRepository()
-
asFile
final BetaManagedAgentsFileResource asFile()
-
asMemoryStore
final BetaManagedAgentsMemoryStoreResource asMemoryStore()
A memory store attached to an agent session.
-
accept
final <T extends Any> T accept(ResourceRetrieveResponse.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 = resourceRetrieveResponse.accept(new ResourceRetrieveResponse.Visitor<Optional<String>>() { @Override public Optional<String> visitGitHubRepository(BetaManagedAgentsGitHubRepositoryResource githubRepository) { return Optional.of(githubRepository.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final ResourceRetrieveResponse 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.
-
ofGitHubRepository
final static ResourceRetrieveResponse ofGitHubRepository(BetaManagedAgentsGitHubRepositoryResource githubRepository)
-
ofFile
final static ResourceRetrieveResponse ofFile(BetaManagedAgentsFileResource file)
-
ofMemoryStore
final static ResourceRetrieveResponse ofMemoryStore(BetaManagedAgentsMemoryStoreResource memoryStore)
A memory store attached to an agent session.
-
-
-
-