Class BetaManagedAgentsGitHubRepositoryResourceConfig.Checkout
-
- All Implemented Interfaces:
public final class BetaManagedAgentsGitHubRepositoryResourceConfig.CheckoutBranch or commit to check out. Defaults to the repository's default branch.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaManagedAgentsGitHubRepositoryResourceConfig.Checkout.VisitorAn interface that defines how to map each variant of Checkout to a value of type T.
-
Method Summary
-
-
Method Detail
-
branch
final Optional<BetaManagedAgentsBranchCheckout> branch()
-
commit
final Optional<BetaManagedAgentsCommitCheckout> commit()
-
asBranch
final BetaManagedAgentsBranchCheckout asBranch()
-
asCommit
final BetaManagedAgentsCommitCheckout asCommit()
-
accept
final <T extends Any> T accept(BetaManagedAgentsGitHubRepositoryResourceConfig.Checkout.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 = checkout.accept(new Checkout.Visitor<Optional<String>>() { @Override public Optional<String> visitBranch(BetaManagedAgentsBranchCheckout branch) { return Optional.of(branch.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaManagedAgentsGitHubRepositoryResourceConfig.Checkout 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.
-
ofBranch
final static BetaManagedAgentsGitHubRepositoryResourceConfig.Checkout ofBranch(BetaManagedAgentsBranchCheckout branch)
-
ofCommit
final static BetaManagedAgentsGitHubRepositoryResourceConfig.Checkout ofCommit(BetaManagedAgentsCommitCheckout commit)
-
-
-
-