io.github.cdklabs.cdk.appflow.S3OutputFormatting Maven / Gradle / Ivy
package io.github.cdklabs.cdk.appflow;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-10-11T10:39:08.272Z")
@software.amazon.jsii.Jsii(module = io.github.cdklabs.cdk.appflow.$Module.class, fqn = "@cdklabs/cdk-appflow.S3OutputFormatting")
@software.amazon.jsii.Jsii.Proxy(S3OutputFormatting.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface S3OutputFormatting extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) Sets an aggregation approach per flow run.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable io.github.cdklabs.cdk.appflow.S3FileAggregation getAggregation() {
return null;
}
/**
* (experimental) Sets a prefix approach for files generated during a flow execution.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable io.github.cdklabs.cdk.appflow.S3OutputFilePrefix getFilePrefix() {
return null;
}
/**
* (experimental) Sets the file type for the output files.
*
* Default: - JSON file type
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable io.github.cdklabs.cdk.appflow.S3OutputFileType getFileType() {
return null;
}
/**
* (experimental) Specifies whether AppFlow should attempt data type mapping from source when the destination output file type is Parquet.
*
* Default: - do not preserve source data files
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getPreserveSourceDataTypes() {
return null;
}
/**
* @return a {@link Builder} of {@link S3OutputFormatting}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link S3OutputFormatting}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
io.github.cdklabs.cdk.appflow.S3FileAggregation aggregation;
io.github.cdklabs.cdk.appflow.S3OutputFilePrefix filePrefix;
io.github.cdklabs.cdk.appflow.S3OutputFileType fileType;
java.lang.Boolean preserveSourceDataTypes;
/**
* Sets the value of {@link S3OutputFormatting#getAggregation}
* @param aggregation Sets an aggregation approach per flow run.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder aggregation(io.github.cdklabs.cdk.appflow.S3FileAggregation aggregation) {
this.aggregation = aggregation;
return this;
}
/**
* Sets the value of {@link S3OutputFormatting#getFilePrefix}
* @param filePrefix Sets a prefix approach for files generated during a flow execution.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder filePrefix(io.github.cdklabs.cdk.appflow.S3OutputFilePrefix filePrefix) {
this.filePrefix = filePrefix;
return this;
}
/**
* Sets the value of {@link S3OutputFormatting#getFileType}
* @param fileType Sets the file type for the output files.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder fileType(io.github.cdklabs.cdk.appflow.S3OutputFileType fileType) {
this.fileType = fileType;
return this;
}
/**
* Sets the value of {@link S3OutputFormatting#getPreserveSourceDataTypes}
* @param preserveSourceDataTypes Specifies whether AppFlow should attempt data type mapping from source when the destination output file type is Parquet.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder preserveSourceDataTypes(java.lang.Boolean preserveSourceDataTypes) {
this.preserveSourceDataTypes = preserveSourceDataTypes;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link S3OutputFormatting}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public S3OutputFormatting build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link S3OutputFormatting}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements S3OutputFormatting {
private final io.github.cdklabs.cdk.appflow.S3FileAggregation aggregation;
private final io.github.cdklabs.cdk.appflow.S3OutputFilePrefix filePrefix;
private final io.github.cdklabs.cdk.appflow.S3OutputFileType fileType;
private final java.lang.Boolean preserveSourceDataTypes;
/**
* 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.aggregation = software.amazon.jsii.Kernel.get(this, "aggregation", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdk.appflow.S3FileAggregation.class));
this.filePrefix = software.amazon.jsii.Kernel.get(this, "filePrefix", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdk.appflow.S3OutputFilePrefix.class));
this.fileType = software.amazon.jsii.Kernel.get(this, "fileType", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdk.appflow.S3OutputFileType.class));
this.preserveSourceDataTypes = software.amazon.jsii.Kernel.get(this, "preserveSourceDataTypes", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.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.aggregation = builder.aggregation;
this.filePrefix = builder.filePrefix;
this.fileType = builder.fileType;
this.preserveSourceDataTypes = builder.preserveSourceDataTypes;
}
@Override
public final io.github.cdklabs.cdk.appflow.S3FileAggregation getAggregation() {
return this.aggregation;
}
@Override
public final io.github.cdklabs.cdk.appflow.S3OutputFilePrefix getFilePrefix() {
return this.filePrefix;
}
@Override
public final io.github.cdklabs.cdk.appflow.S3OutputFileType getFileType() {
return this.fileType;
}
@Override
public final java.lang.Boolean getPreserveSourceDataTypes() {
return this.preserveSourceDataTypes;
}
@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();
if (this.getAggregation() != null) {
data.set("aggregation", om.valueToTree(this.getAggregation()));
}
if (this.getFilePrefix() != null) {
data.set("filePrefix", om.valueToTree(this.getFilePrefix()));
}
if (this.getFileType() != null) {
data.set("fileType", om.valueToTree(this.getFileType()));
}
if (this.getPreserveSourceDataTypes() != null) {
data.set("preserveSourceDataTypes", om.valueToTree(this.getPreserveSourceDataTypes()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@cdklabs/cdk-appflow.S3OutputFormatting"));
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;
S3OutputFormatting.Jsii$Proxy that = (S3OutputFormatting.Jsii$Proxy) o;
if (this.aggregation != null ? !this.aggregation.equals(that.aggregation) : that.aggregation != null) return false;
if (this.filePrefix != null ? !this.filePrefix.equals(that.filePrefix) : that.filePrefix != null) return false;
if (this.fileType != null ? !this.fileType.equals(that.fileType) : that.fileType != null) return false;
return this.preserveSourceDataTypes != null ? this.preserveSourceDataTypes.equals(that.preserveSourceDataTypes) : that.preserveSourceDataTypes == null;
}
@Override
public final int hashCode() {
int result = this.aggregation != null ? this.aggregation.hashCode() : 0;
result = 31 * result + (this.filePrefix != null ? this.filePrefix.hashCode() : 0);
result = 31 * result + (this.fileType != null ? this.fileType.hashCode() : 0);
result = 31 * result + (this.preserveSourceDataTypes != null ? this.preserveSourceDataTypes.hashCode() : 0);
return result;
}
}
}