Class BetaManagedAgentsSessionAgent.Skill
-
- All Implemented Interfaces:
public final class BetaManagedAgentsSessionAgent.SkillResolved skill as returned in API responses.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaManagedAgentsSessionAgent.Skill.VisitorAn interface that defines how to map each variant of Skill to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<BetaManagedAgentsAnthropicSkill>anthropic()A resolved Anthropic-managed skill. final Optional<BetaManagedAgentsCustomSkill>custom()A resolved user-created custom skill. final BooleanisAnthropic()final BooleanisCustom()final BetaManagedAgentsAnthropicSkillasAnthropic()A resolved Anthropic-managed skill. final BetaManagedAgentsCustomSkillasCustom()A resolved user-created custom skill. final Optional<JsonValue>_json()final <T extends Any> Taccept(BetaManagedAgentsSessionAgent.Skill.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaManagedAgentsSessionAgent.Skillvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaManagedAgentsSessionAgent.SkillofAnthropic(BetaManagedAgentsAnthropicSkill anthropic)A resolved Anthropic-managed skill. final static BetaManagedAgentsSessionAgent.SkillofCustom(BetaManagedAgentsCustomSkill custom)A resolved user-created custom skill. -
-
Method Detail
-
anthropic
final Optional<BetaManagedAgentsAnthropicSkill> anthropic()
A resolved Anthropic-managed skill.
-
custom
final Optional<BetaManagedAgentsCustomSkill> custom()
A resolved user-created custom skill.
-
isAnthropic
final Boolean isAnthropic()
-
asAnthropic
final BetaManagedAgentsAnthropicSkill asAnthropic()
A resolved Anthropic-managed skill.
-
asCustom
final BetaManagedAgentsCustomSkill asCustom()
A resolved user-created custom skill.
-
accept
final <T extends Any> T accept(BetaManagedAgentsSessionAgent.Skill.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 = skill.accept(new Skill.Visitor<Optional<String>>() { @Override public Optional<String> visitAnthropic(BetaManagedAgentsAnthropicSkill anthropic) { return Optional.of(anthropic.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaManagedAgentsSessionAgent.Skill 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.
-
ofAnthropic
final static BetaManagedAgentsSessionAgent.Skill ofAnthropic(BetaManagedAgentsAnthropicSkill anthropic)
A resolved Anthropic-managed skill.
-
ofCustom
final static BetaManagedAgentsSessionAgent.Skill ofCustom(BetaManagedAgentsCustomSkill custom)
A resolved user-created custom skill.
-
-
-
-