Class DeploymentUpdateParams.Resource
-
- All Implemented Interfaces:
public final class DeploymentUpdateParams.ResourceUnion of resources that can be mounted into a session.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceDeploymentUpdateParams.Resource.VisitorAn interface that defines how to map each variant of Resource to a value of type T.
public final classDeploymentUpdateParams.Resource.Type
-
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 Optional<JsonValue>_json()final DeploymentUpdateParams.Resource.Typetype()final Optional<String>mountPath()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 <T extends Any> Taccept(DeploymentUpdateParams.Resource.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final DeploymentUpdateParams.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 DeploymentUpdateParams.ResourceofGitHubRepository(BetaManagedAgentsGitHubRepositoryResourceParams githubRepository)Mount a GitHub repository into the session's container. final static DeploymentUpdateParams.ResourceofGitHubRepository(String url)Returns an immutable instance of Resource whose ofGitHubRepository variant is built from the given required url. final static DeploymentUpdateParams.ResourceofFile(BetaManagedAgentsFileResourceParams file)Mount a file uploaded via the Files API into the session. final static DeploymentUpdateParams.ResourceofFile(String fileId)Returns an immutable instance of Resource whose ofFile variant is built from the given required fileId. final static DeploymentUpdateParams.ResourceofMemoryStore(BetaManagedAgentsMemoryStoreResourceParam memoryStore)Parameters for attaching a memory store to an agent session. final static DeploymentUpdateParams.ResourceofMemoryStore(String memoryStoreId)Returns an immutable instance of Resource whose ofMemoryStore variant is built from the given required memoryStoreId. -
-
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.
-
type
final DeploymentUpdateParams.Resource.Type type()
-
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(DeploymentUpdateParams.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 DeploymentUpdateParams.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 DeploymentUpdateParams.Resource ofGitHubRepository(BetaManagedAgentsGitHubRepositoryResourceParams githubRepository)
Mount a GitHub repository into the session's container.
-
ofGitHubRepository
final static DeploymentUpdateParams.Resource ofGitHubRepository(String url)
Returns an immutable instance of Resource whose ofGitHubRepository variant is built from the given required url.
-
ofFile
final static DeploymentUpdateParams.Resource ofFile(BetaManagedAgentsFileResourceParams file)
Mount a file uploaded via the Files API into the session.
-
ofFile
final static DeploymentUpdateParams.Resource ofFile(String fileId)
Returns an immutable instance of Resource whose ofFile variant is built from the given required fileId.
-
ofMemoryStore
final static DeploymentUpdateParams.Resource ofMemoryStore(BetaManagedAgentsMemoryStoreResourceParam memoryStore)
Parameters for attaching a memory store to an agent session.
-
ofMemoryStore
final static DeploymentUpdateParams.Resource ofMemoryStore(String memoryStoreId)
Returns an immutable instance of Resource whose ofMemoryStore variant is built from the given required memoryStoreId.
-
-
-
-