Class BetaExternalKey.Attachment
-
- All Implemented Interfaces:
public final class BetaExternalKey.AttachmentWhether any workspace uses this config to encrypt its data — counting live and archived workspaces (an archived workspace's data remains encrypted under the config), excluding deleted ones. Only an attached config is used by the encryption path; an
unattachedconfig is inert and can be deleted.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaExternalKey.Attachment.VisitorAn interface that defines how to map each variant of Attachment to a value of type T.
public final classBetaExternalKey.Attachment.Type
-
Method Summary
Modifier and Type Method Description final Optional<BetaExternalKeyAttachedAttachment>attached()final Optional<BetaExternalKeyUnattachedAttachment>unattached()final Optional<JsonValue>_json()final BetaExternalKey.Attachment.Typetype()final BooleanisAttached()final BooleanisUnattached()final BetaExternalKeyAttachedAttachmentasAttached()final BetaExternalKeyUnattachedAttachmentasUnattached()final <T extends Any> Taccept(BetaExternalKey.Attachment.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaExternalKey.Attachmentvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaExternalKey.AttachmentofAttached(BetaExternalKeyAttachedAttachment attached)final static BetaExternalKey.AttachmentofUnattached(BetaExternalKeyUnattachedAttachment unattached)-
-
Method Detail
-
attached
final Optional<BetaExternalKeyAttachedAttachment> attached()
-
unattached
final Optional<BetaExternalKeyUnattachedAttachment> unattached()
-
type
final BetaExternalKey.Attachment.Type type()
-
isAttached
final Boolean isAttached()
-
isUnattached
final Boolean isUnattached()
-
asAttached
final BetaExternalKeyAttachedAttachment asAttached()
-
asUnattached
final BetaExternalKeyUnattachedAttachment asUnattached()
-
accept
final <T extends Any> T accept(BetaExternalKey.Attachment.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 = attachment.accept(new Attachment.Visitor<Optional<String>>() { @Override public Optional<String> visitAttached(BetaExternalKeyAttachedAttachment attached) { return Optional.of(attached.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaExternalKey.Attachment 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.
-
ofAttached
final static BetaExternalKey.Attachment ofAttached(BetaExternalKeyAttachedAttachment attached)
-
ofUnattached
final static BetaExternalKey.Attachment ofUnattached(BetaExternalKeyUnattachedAttachment unattached)
-
-
-
-