software.amazon.awscdk.services.glue.alpha.S3Encryption Maven / Gradle / Ivy
package software.amazon.awscdk.services.glue.alpha;
/**
* (experimental) S3 encryption configuration.
*
* Example:
*
*
* SecurityConfiguration.Builder.create(this, "MySecurityConfiguration")
* .cloudWatchEncryption(CloudWatchEncryption.builder()
* .mode(CloudWatchEncryptionMode.KMS)
* .build())
* .jobBookmarksEncryption(JobBookmarksEncryption.builder()
* .mode(JobBookmarksEncryptionMode.CLIENT_SIDE_KMS)
* .build())
* .s3Encryption(S3Encryption.builder()
* .mode(S3EncryptionMode.KMS)
* .build())
* .build();
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.104.0 (build e79254c)", date = "2024-11-15T10:25:09.354Z")
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.glue.alpha.$Module.class, fqn = "@aws-cdk/aws-glue-alpha.S3Encryption")
@software.amazon.jsii.Jsii.Proxy(S3Encryption.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface S3Encryption extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) Encryption mode.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull software.amazon.awscdk.services.glue.alpha.S3EncryptionMode getMode();
/**
* (experimental) The KMS key to be used to encrypt the data.
*
* Default: no kms key if mode = S3_MANAGED. A key will be created if one is not provided and mode = KMS.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.kms.IKey getKmsKey() {
return null;
}
/**
* @return a {@link Builder} of {@link S3Encryption}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link S3Encryption}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
software.amazon.awscdk.services.glue.alpha.S3EncryptionMode mode;
software.amazon.awscdk.services.kms.IKey kmsKey;
/**
* Sets the value of {@link S3Encryption#getMode}
* @param mode Encryption mode. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder mode(software.amazon.awscdk.services.glue.alpha.S3EncryptionMode mode) {
this.mode = mode;
return this;
}
/**
* Sets the value of {@link S3Encryption#getKmsKey}
* @param kmsKey The KMS key to be used to encrypt the data.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder kmsKey(software.amazon.awscdk.services.kms.IKey kmsKey) {
this.kmsKey = kmsKey;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link S3Encryption}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public S3Encryption build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link S3Encryption}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements S3Encryption {
private final software.amazon.awscdk.services.glue.alpha.S3EncryptionMode mode;
private final software.amazon.awscdk.services.kms.IKey kmsKey;
/**
* Constructor that initializes the object based on values retrieved from the JsiiObject.
* @param objRef Reference to the JSII managed object.
*/
protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
this.mode = software.amazon.jsii.Kernel.get(this, "mode", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.glue.alpha.S3EncryptionMode.class));
this.kmsKey = software.amazon.jsii.Kernel.get(this, "kmsKey", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.kms.IKey.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.mode = java.util.Objects.requireNonNull(builder.mode, "mode is required");
this.kmsKey = builder.kmsKey;
}
@Override
public final software.amazon.awscdk.services.glue.alpha.S3EncryptionMode getMode() {
return this.mode;
}
@Override
public final software.amazon.awscdk.services.kms.IKey getKmsKey() {
return this.kmsKey;
}
@Override
@software.amazon.jsii.Internal
public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() {
final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE;
final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
data.set("mode", om.valueToTree(this.getMode()));
if (this.getKmsKey() != null) {
data.set("kmsKey", om.valueToTree(this.getKmsKey()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@aws-cdk/aws-glue-alpha.S3Encryption"));
struct.set("data", data);
final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
obj.set("$jsii.struct", struct);
return obj;
}
@Override
public final boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
S3Encryption.Jsii$Proxy that = (S3Encryption.Jsii$Proxy) o;
if (!mode.equals(that.mode)) return false;
return this.kmsKey != null ? this.kmsKey.equals(that.kmsKey) : that.kmsKey == null;
}
@Override
public final int hashCode() {
int result = this.mode.hashCode();
result = 31 * result + (this.kmsKey != null ? this.kmsKey.hashCode() : 0);
return result;
}
}
}