Class ExternalKey.ProviderConfig
-
- All Implemented Interfaces:
public final class ExternalKey.ProviderConfigKMS provider identity and auth coordinates.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceExternalKey.ProviderConfig.VisitorAn interface that defines how to map each variant of ProviderConfig to a value of type T.
public final classExternalKey.ProviderConfig.Type
-
Method Summary
-
-
Method Detail
-
aws
final Optional<AwsExternalKeyConfig> aws()
-
gcp
final Optional<GcpExternalKeyConfig> gcp()
-
azure
final Optional<AzureExternalKeyConfig> azure()
-
type
final ExternalKey.ProviderConfig.Type type()
-
asAws
final AwsExternalKeyConfig asAws()
-
asGcp
final GcpExternalKeyConfig asGcp()
-
asAzure
final AzureExternalKeyConfig asAzure()
-
accept
final <T extends Any> T accept(ExternalKey.ProviderConfig.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 = providerConfig.accept(new ProviderConfig.Visitor<Optional<String>>() { @Override public Optional<String> visitAws(AwsExternalKeyConfig aws) { return Optional.of(aws.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final ExternalKey.ProviderConfig 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.
-
ofAws
final static ExternalKey.ProviderConfig ofAws(AwsExternalKeyConfig aws)
-
ofAws
final static ExternalKey.ProviderConfig ofAws(String kmsArn)
Returns an immutable instance of ProviderConfig whose ofAws variant is built from the given required kmsArn.
-
ofGcp
final static ExternalKey.ProviderConfig ofGcp(GcpExternalKeyConfig gcp)
-
ofGcp
final static ExternalKey.ProviderConfig ofGcp(String keyName)
Returns an immutable instance of ProviderConfig whose ofGcp variant is built from the given required keyName.
-
ofAzure
final static ExternalKey.ProviderConfig ofAzure(AzureExternalKeyConfig azure)
-
-
-
-