![JAR search and dependency download from the Maven repository](/logo.png)
software.amazon.awssdk.services.firehose.model.IcebergDestinationConfiguration Maven / Gradle / Ivy
Show all versions of firehose Show documentation
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.firehose.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Specifies the destination configure settings for Apache Iceberg Table.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class IcebergDestinationConfiguration implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField> DESTINATION_TABLE_CONFIGURATION_LIST_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("DestinationTableConfigurationList")
.getter(getter(IcebergDestinationConfiguration::destinationTableConfigurationList))
.setter(setter(Builder::destinationTableConfigurationList))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DestinationTableConfigurationList")
.build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(DestinationTableConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField SCHEMA_EVOLUTION_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("SchemaEvolutionConfiguration")
.getter(getter(IcebergDestinationConfiguration::schemaEvolutionConfiguration))
.setter(setter(Builder::schemaEvolutionConfiguration))
.constructor(SchemaEvolutionConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SchemaEvolutionConfiguration")
.build()).build();
private static final SdkField TABLE_CREATION_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("TableCreationConfiguration")
.getter(getter(IcebergDestinationConfiguration::tableCreationConfiguration))
.setter(setter(Builder::tableCreationConfiguration))
.constructor(TableCreationConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TableCreationConfiguration").build())
.build();
private static final SdkField BUFFERING_HINTS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("BufferingHints")
.getter(getter(IcebergDestinationConfiguration::bufferingHints)).setter(setter(Builder::bufferingHints))
.constructor(BufferingHints::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BufferingHints").build()).build();
private static final SdkField CLOUD_WATCH_LOGGING_OPTIONS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("CloudWatchLoggingOptions")
.getter(getter(IcebergDestinationConfiguration::cloudWatchLoggingOptions))
.setter(setter(Builder::cloudWatchLoggingOptions)).constructor(CloudWatchLoggingOptions::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CloudWatchLoggingOptions").build())
.build();
private static final SdkField PROCESSING_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("ProcessingConfiguration")
.getter(getter(IcebergDestinationConfiguration::processingConfiguration))
.setter(setter(Builder::processingConfiguration)).constructor(ProcessingConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProcessingConfiguration").build())
.build();
private static final SdkField S3_BACKUP_MODE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("S3BackupMode").getter(getter(IcebergDestinationConfiguration::s3BackupModeAsString))
.setter(setter(Builder::s3BackupMode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("S3BackupMode").build()).build();
private static final SdkField RETRY_OPTIONS_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("RetryOptions").getter(getter(IcebergDestinationConfiguration::retryOptions))
.setter(setter(Builder::retryOptions)).constructor(RetryOptions::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RetryOptions").build()).build();
private static final SdkField ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RoleARN").getter(getter(IcebergDestinationConfiguration::roleARN)).setter(setter(Builder::roleARN))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RoleARN").build()).build();
private static final SdkField CATALOG_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("CatalogConfiguration")
.getter(getter(IcebergDestinationConfiguration::catalogConfiguration)).setter(setter(Builder::catalogConfiguration))
.constructor(CatalogConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CatalogConfiguration").build())
.build();
private static final SdkField S3_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("S3Configuration")
.getter(getter(IcebergDestinationConfiguration::s3Configuration)).setter(setter(Builder::s3Configuration))
.constructor(S3DestinationConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("S3Configuration").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
DESTINATION_TABLE_CONFIGURATION_LIST_FIELD, SCHEMA_EVOLUTION_CONFIGURATION_FIELD, TABLE_CREATION_CONFIGURATION_FIELD,
BUFFERING_HINTS_FIELD, CLOUD_WATCH_LOGGING_OPTIONS_FIELD, PROCESSING_CONFIGURATION_FIELD, S3_BACKUP_MODE_FIELD,
RETRY_OPTIONS_FIELD, ROLE_ARN_FIELD, CATALOG_CONFIGURATION_FIELD, S3_CONFIGURATION_FIELD));
private static final Map> SDK_NAME_TO_FIELD = Collections
.unmodifiableMap(new HashMap>() {
{
put("DestinationTableConfigurationList", DESTINATION_TABLE_CONFIGURATION_LIST_FIELD);
put("SchemaEvolutionConfiguration", SCHEMA_EVOLUTION_CONFIGURATION_FIELD);
put("TableCreationConfiguration", TABLE_CREATION_CONFIGURATION_FIELD);
put("BufferingHints", BUFFERING_HINTS_FIELD);
put("CloudWatchLoggingOptions", CLOUD_WATCH_LOGGING_OPTIONS_FIELD);
put("ProcessingConfiguration", PROCESSING_CONFIGURATION_FIELD);
put("S3BackupMode", S3_BACKUP_MODE_FIELD);
put("RetryOptions", RETRY_OPTIONS_FIELD);
put("RoleARN", ROLE_ARN_FIELD);
put("CatalogConfiguration", CATALOG_CONFIGURATION_FIELD);
put("S3Configuration", S3_CONFIGURATION_FIELD);
}
});
private static final long serialVersionUID = 1L;
private final List destinationTableConfigurationList;
private final SchemaEvolutionConfiguration schemaEvolutionConfiguration;
private final TableCreationConfiguration tableCreationConfiguration;
private final BufferingHints bufferingHints;
private final CloudWatchLoggingOptions cloudWatchLoggingOptions;
private final ProcessingConfiguration processingConfiguration;
private final String s3BackupMode;
private final RetryOptions retryOptions;
private final String roleARN;
private final CatalogConfiguration catalogConfiguration;
private final S3DestinationConfiguration s3Configuration;
private IcebergDestinationConfiguration(BuilderImpl builder) {
this.destinationTableConfigurationList = builder.destinationTableConfigurationList;
this.schemaEvolutionConfiguration = builder.schemaEvolutionConfiguration;
this.tableCreationConfiguration = builder.tableCreationConfiguration;
this.bufferingHints = builder.bufferingHints;
this.cloudWatchLoggingOptions = builder.cloudWatchLoggingOptions;
this.processingConfiguration = builder.processingConfiguration;
this.s3BackupMode = builder.s3BackupMode;
this.retryOptions = builder.retryOptions;
this.roleARN = builder.roleARN;
this.catalogConfiguration = builder.catalogConfiguration;
this.s3Configuration = builder.s3Configuration;
}
/**
* For responses, this returns true if the service returned a value for the DestinationTableConfigurationList
* property. This DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()}
* method on the property). This is useful because the SDK will never return a null collection or map, but you may
* need to differentiate between the service returning nothing (or null) and the service returning an empty
* collection or map. For requests, this returns true if a value for the property was specified in the request
* builder, and false if a value was not specified.
*/
public final boolean hasDestinationTableConfigurationList() {
return destinationTableConfigurationList != null && !(destinationTableConfigurationList instanceof SdkAutoConstructList);
}
/**
*
* Provides a list of DestinationTableConfigurations
which Firehose uses to deliver data to Apache
* Iceberg Tables. Firehose will write data with insert if table specific configuration is not provided here.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasDestinationTableConfigurationList}
* method.
*
*
* @return Provides a list of DestinationTableConfigurations
which Firehose uses to deliver data to
* Apache Iceberg Tables. Firehose will write data with insert if table specific configuration is not
* provided here.
*/
public final List destinationTableConfigurationList() {
return destinationTableConfigurationList;
}
/**
*
*
*
* Amazon Data Firehose is in preview release and is subject to change.
*
*
* @return
*
* Amazon Data Firehose is in preview release and is subject to change.
*/
public final SchemaEvolutionConfiguration schemaEvolutionConfiguration() {
return schemaEvolutionConfiguration;
}
/**
*
*
*
* Amazon Data Firehose is in preview release and is subject to change.
*
*
* @return
*
* Amazon Data Firehose is in preview release and is subject to change.
*/
public final TableCreationConfiguration tableCreationConfiguration() {
return tableCreationConfiguration;
}
/**
* Returns the value of the BufferingHints property for this object.
*
* @return The value of the BufferingHints property for this object.
*/
public final BufferingHints bufferingHints() {
return bufferingHints;
}
/**
* Returns the value of the CloudWatchLoggingOptions property for this object.
*
* @return The value of the CloudWatchLoggingOptions property for this object.
*/
public final CloudWatchLoggingOptions cloudWatchLoggingOptions() {
return cloudWatchLoggingOptions;
}
/**
* Returns the value of the ProcessingConfiguration property for this object.
*
* @return The value of the ProcessingConfiguration property for this object.
*/
public final ProcessingConfiguration processingConfiguration() {
return processingConfiguration;
}
/**
*
* Describes how Firehose will backup records. Currently,S3 backup only supports FailedDataOnly
.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #s3BackupMode} will
* return {@link IcebergS3BackupMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #s3BackupModeAsString}.
*
*
* @return Describes how Firehose will backup records. Currently,S3 backup only supports FailedDataOnly
* .
* @see IcebergS3BackupMode
*/
public final IcebergS3BackupMode s3BackupMode() {
return IcebergS3BackupMode.fromValue(s3BackupMode);
}
/**
*
* Describes how Firehose will backup records. Currently,S3 backup only supports FailedDataOnly
.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #s3BackupMode} will
* return {@link IcebergS3BackupMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #s3BackupModeAsString}.
*
*
* @return Describes how Firehose will backup records. Currently,S3 backup only supports FailedDataOnly
* .
* @see IcebergS3BackupMode
*/
public final String s3BackupModeAsString() {
return s3BackupMode;
}
/**
* Returns the value of the RetryOptions property for this object.
*
* @return The value of the RetryOptions property for this object.
*/
public final RetryOptions retryOptions() {
return retryOptions;
}
/**
*
* The Amazon Resource Name (ARN) of the IAM role to be assumed by Firehose for calling Apache Iceberg Tables.
*
*
* @return The Amazon Resource Name (ARN) of the IAM role to be assumed by Firehose for calling Apache Iceberg
* Tables.
*/
public final String roleARN() {
return roleARN;
}
/**
*
* Configuration describing where the destination Apache Iceberg Tables are persisted.
*
*
* @return Configuration describing where the destination Apache Iceberg Tables are persisted.
*/
public final CatalogConfiguration catalogConfiguration() {
return catalogConfiguration;
}
/**
* Returns the value of the S3Configuration property for this object.
*
* @return The value of the S3Configuration property for this object.
*/
public final S3DestinationConfiguration s3Configuration() {
return s3Configuration;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode
+ Objects.hashCode(hasDestinationTableConfigurationList() ? destinationTableConfigurationList() : null);
hashCode = 31 * hashCode + Objects.hashCode(schemaEvolutionConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(tableCreationConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(bufferingHints());
hashCode = 31 * hashCode + Objects.hashCode(cloudWatchLoggingOptions());
hashCode = 31 * hashCode + Objects.hashCode(processingConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(s3BackupModeAsString());
hashCode = 31 * hashCode + Objects.hashCode(retryOptions());
hashCode = 31 * hashCode + Objects.hashCode(roleARN());
hashCode = 31 * hashCode + Objects.hashCode(catalogConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(s3Configuration());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof IcebergDestinationConfiguration)) {
return false;
}
IcebergDestinationConfiguration other = (IcebergDestinationConfiguration) obj;
return hasDestinationTableConfigurationList() == other.hasDestinationTableConfigurationList()
&& Objects.equals(destinationTableConfigurationList(), other.destinationTableConfigurationList())
&& Objects.equals(schemaEvolutionConfiguration(), other.schemaEvolutionConfiguration())
&& Objects.equals(tableCreationConfiguration(), other.tableCreationConfiguration())
&& Objects.equals(bufferingHints(), other.bufferingHints())
&& Objects.equals(cloudWatchLoggingOptions(), other.cloudWatchLoggingOptions())
&& Objects.equals(processingConfiguration(), other.processingConfiguration())
&& Objects.equals(s3BackupModeAsString(), other.s3BackupModeAsString())
&& Objects.equals(retryOptions(), other.retryOptions()) && Objects.equals(roleARN(), other.roleARN())
&& Objects.equals(catalogConfiguration(), other.catalogConfiguration())
&& Objects.equals(s3Configuration(), other.s3Configuration());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString
.builder("IcebergDestinationConfiguration")
.add("DestinationTableConfigurationList",
hasDestinationTableConfigurationList() ? destinationTableConfigurationList() : null)
.add("SchemaEvolutionConfiguration", schemaEvolutionConfiguration())
.add("TableCreationConfiguration", tableCreationConfiguration()).add("BufferingHints", bufferingHints())
.add("CloudWatchLoggingOptions", cloudWatchLoggingOptions())
.add("ProcessingConfiguration", processingConfiguration()).add("S3BackupMode", s3BackupModeAsString())
.add("RetryOptions", retryOptions()).add("RoleARN", roleARN())
.add("CatalogConfiguration", catalogConfiguration()).add("S3Configuration", s3Configuration()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "DestinationTableConfigurationList":
return Optional.ofNullable(clazz.cast(destinationTableConfigurationList()));
case "SchemaEvolutionConfiguration":
return Optional.ofNullable(clazz.cast(schemaEvolutionConfiguration()));
case "TableCreationConfiguration":
return Optional.ofNullable(clazz.cast(tableCreationConfiguration()));
case "BufferingHints":
return Optional.ofNullable(clazz.cast(bufferingHints()));
case "CloudWatchLoggingOptions":
return Optional.ofNullable(clazz.cast(cloudWatchLoggingOptions()));
case "ProcessingConfiguration":
return Optional.ofNullable(clazz.cast(processingConfiguration()));
case "S3BackupMode":
return Optional.ofNullable(clazz.cast(s3BackupModeAsString()));
case "RetryOptions":
return Optional.ofNullable(clazz.cast(retryOptions()));
case "RoleARN":
return Optional.ofNullable(clazz.cast(roleARN()));
case "CatalogConfiguration":
return Optional.ofNullable(clazz.cast(catalogConfiguration()));
case "S3Configuration":
return Optional.ofNullable(clazz.cast(s3Configuration()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Function