Class BetaPluginMarketplace.Owner
-
- All Implemented Interfaces:
public final class BetaPluginMarketplace.OwnerThe organization, or the member whose personal plugin marketplace it is.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaPluginMarketplace.Owner.VisitorAn interface that defines how to map each variant of Owner to a value of type T.
public final classBetaPluginMarketplace.Owner.Type
-
Method Summary
-
-
Method Detail
-
organization
final Optional<BetaPluginOwnerOrganization> organization()
-
user
final Optional<BetaPluginOwnerUser> user()
-
type
final BetaPluginMarketplace.Owner.Type type()
-
isOrganization
final Boolean isOrganization()
-
asOrganization
final BetaPluginOwnerOrganization asOrganization()
-
asUser
final BetaPluginOwnerUser asUser()
-
accept
final <T extends Any> T accept(BetaPluginMarketplace.Owner.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 = owner.accept(new Owner.Visitor<Optional<String>>() { @Override public Optional<String> visitOrganization(BetaPluginOwnerOrganization organization) { return Optional.of(organization.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaPluginMarketplace.Owner 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.
-
ofOrganization
final static BetaPluginMarketplace.Owner ofOrganization(BetaPluginOwnerOrganization organization)
-
ofUser
final static BetaPluginMarketplace.Owner ofUser(BetaPluginOwnerUser user)
-
-
-
-