Class DeploymentCreateParams.Resource
-
- All Implemented Interfaces:
public final class DeploymentCreateParams.ResourceUnion of resources that can be mounted into a session.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceDeploymentCreateParams.Resource.VisitorAn interface that defines how to map each variant of Resource to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<BetaManagedAgentsGitHubRepositoryResourceParams>githubRepository()Mount a GitHub repository into the session's container. final Optional<BetaManagedAgentsFileResourceParams>file()Mount a file uploaded via the Files API into the session. final Optional<BetaManagedAgentsMemoryStoreResourceParam>memoryStore()Parameters for attaching a memory store to an agent session. final BooleanisGitHubRepository()final BooleanisFile()final BooleanisMemoryStore()final BetaManagedAgentsGitHubRepositoryResourceParamsasGitHubRepository()Mount a GitHub repository into the session's container. final BetaManagedAgentsFileResourceParamsasFile()Mount a file uploaded via the Files API into the session. final BetaManagedAgentsMemoryStoreResourceParamasMemoryStore()Parameters for attaching a memory store to an agent session. final Optional<JsonValue>_json()final <T extends Any> Taccept(DeploymentCreateParams.Resource.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final DeploymentCreateParams.Resourcevalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static DeploymentCreateParams.ResourceofGitHubRepository(BetaManagedAgentsGitHubRepositoryResourceParams githubRepository)Mount a GitHub repository into the session's container. final static DeploymentCreateParams.ResourceofFile(BetaManagedAgentsFileResourceParams file)Mount a file uploaded via the Files API into the session. final static DeploymentCreateParams.ResourceofMemoryStore(BetaManagedAgentsMemoryStoreResourceParam memoryStore)Parameters for attaching a memory store to an agent session. -
-
Method Detail
-
githubRepository
final Optional<BetaManagedAgentsGitHubRepositoryResourceParams> githubRepository()
Mount a GitHub repository into the session's container.
-
file
final Optional<BetaManagedAgentsFileResourceParams> file()
Mount a file uploaded via the Files API into the session.
-
memoryStore
final Optional<BetaManagedAgentsMemoryStoreResourceParam> memoryStore()
Parameters for attaching a memory store to an agent session.
-
isGitHubRepository
final Boolean isGitHubRepository()
-
isMemoryStore
final Boolean isMemoryStore()
-
asGitHubRepository
final BetaManagedAgentsGitHubRepositoryResourceParams asGitHubRepository()
Mount a GitHub repository into the session's container.
-
asFile
final BetaManagedAgentsFileResourceParams asFile()
Mount a file uploaded via the Files API into the session.
-
asMemoryStore
final BetaManagedAgentsMemoryStoreResourceParam asMemoryStore()
Parameters for attaching a memory store to an agent session.
-
accept
final <T extends Any> T accept(DeploymentCreateParams.Resource.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 = resource.accept(new Resource.Visitor<Optional<String>>() { @Override public Optional<String> visitGitHubRepository(BetaManagedAgentsGitHubRepositoryResourceParams githubRepository) { return Optional.of(githubRepository.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final DeploymentCreateParams.Resource 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 DeploymentCreateParams.Resource ofGitHubRepository(BetaManagedAgentsGitHubRepositoryResourceParams githubRepository)
Mount a GitHub repository into the session's container.
-
ofFile
final static DeploymentCreateParams.Resource ofFile(BetaManagedAgentsFileResourceParams file)
Mount a file uploaded via the Files API into the session.
-
ofMemoryStore
final static DeploymentCreateParams.Resource ofMemoryStore(BetaManagedAgentsMemoryStoreResourceParam memoryStore)
Parameters for attaching a memory store to an agent session.
-
-
-
-