Class ExternalKey.Attachment
-
- All Implemented Interfaces:
public final class ExternalKey.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 interfaceExternalKey.Attachment.VisitorAn interface that defines how to map each variant of Attachment to a value of type T.
public final classExternalKey.Attachment.Type
-
Method Summary
Modifier and Type Method Description final Optional<ExternalKeyAttachedAttachment>attached()final Optional<ExternalKeyUnattachedAttachment>unattached()final Optional<JsonValue>_json()final ExternalKey.Attachment.Typetype()final BooleanisAttached()final BooleanisUnattached()final ExternalKeyAttachedAttachmentasAttached()final ExternalKeyUnattachedAttachmentasUnattached()final <T extends Any> Taccept(ExternalKey.Attachment.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final ExternalKey.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 ExternalKey.AttachmentofAttached(ExternalKeyAttachedAttachment attached)final static ExternalKey.AttachmentofUnattached(ExternalKeyUnattachedAttachment unattached)-
-
Method Detail
-
attached
final Optional<ExternalKeyAttachedAttachment> attached()
-
unattached
final Optional<ExternalKeyUnattachedAttachment> unattached()
-
type
final ExternalKey.Attachment.Type type()
-
isAttached
final Boolean isAttached()
-
isUnattached
final Boolean isUnattached()
-
asAttached
final ExternalKeyAttachedAttachment asAttached()
-
asUnattached
final ExternalKeyUnattachedAttachment asUnattached()
-
accept
final <T extends Any> T accept(ExternalKey.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(ExternalKeyAttachedAttachment attached) { return Optional.of(attached.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final ExternalKey.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 ExternalKey.Attachment ofAttached(ExternalKeyAttachedAttachment attached)
-
ofUnattached
final static ExternalKey.Attachment ofUnattached(ExternalKeyUnattachedAttachment unattached)
-
-
-
-