
software.amazon.awssdk.services.firehose.model.S3DestinationUpdate Maven / Gradle / Ivy
/*
* 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.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
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.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Describes an update for a destination in Amazon S3.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class S3DestinationUpdate implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RoleARN").getter(getter(S3DestinationUpdate::roleARN)).setter(setter(Builder::roleARN))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RoleARN").build()).build();
private static final SdkField BUCKET_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("BucketARN").getter(getter(S3DestinationUpdate::bucketARN)).setter(setter(Builder::bucketARN))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BucketARN").build()).build();
private static final SdkField PREFIX_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Prefix")
.getter(getter(S3DestinationUpdate::prefix)).setter(setter(Builder::prefix))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Prefix").build()).build();
private static final SdkField ERROR_OUTPUT_PREFIX_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ErrorOutputPrefix").getter(getter(S3DestinationUpdate::errorOutputPrefix))
.setter(setter(Builder::errorOutputPrefix))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ErrorOutputPrefix").build()).build();
private static final SdkField BUFFERING_HINTS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("BufferingHints")
.getter(getter(S3DestinationUpdate::bufferingHints)).setter(setter(Builder::bufferingHints))
.constructor(BufferingHints::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BufferingHints").build()).build();
private static final SdkField COMPRESSION_FORMAT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CompressionFormat").getter(getter(S3DestinationUpdate::compressionFormatAsString))
.setter(setter(Builder::compressionFormat))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CompressionFormat").build()).build();
private static final SdkField ENCRYPTION_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("EncryptionConfiguration")
.getter(getter(S3DestinationUpdate::encryptionConfiguration)).setter(setter(Builder::encryptionConfiguration))
.constructor(EncryptionConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EncryptionConfiguration").build())
.build();
private static final SdkField CLOUD_WATCH_LOGGING_OPTIONS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("CloudWatchLoggingOptions")
.getter(getter(S3DestinationUpdate::cloudWatchLoggingOptions)).setter(setter(Builder::cloudWatchLoggingOptions))
.constructor(CloudWatchLoggingOptions::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CloudWatchLoggingOptions").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ROLE_ARN_FIELD,
BUCKET_ARN_FIELD, PREFIX_FIELD, ERROR_OUTPUT_PREFIX_FIELD, BUFFERING_HINTS_FIELD, COMPRESSION_FORMAT_FIELD,
ENCRYPTION_CONFIGURATION_FIELD, CLOUD_WATCH_LOGGING_OPTIONS_FIELD));
private static final long serialVersionUID = 1L;
private final String roleARN;
private final String bucketARN;
private final String prefix;
private final String errorOutputPrefix;
private final BufferingHints bufferingHints;
private final String compressionFormat;
private final EncryptionConfiguration encryptionConfiguration;
private final CloudWatchLoggingOptions cloudWatchLoggingOptions;
private S3DestinationUpdate(BuilderImpl builder) {
this.roleARN = builder.roleARN;
this.bucketARN = builder.bucketARN;
this.prefix = builder.prefix;
this.errorOutputPrefix = builder.errorOutputPrefix;
this.bufferingHints = builder.bufferingHints;
this.compressionFormat = builder.compressionFormat;
this.encryptionConfiguration = builder.encryptionConfiguration;
this.cloudWatchLoggingOptions = builder.cloudWatchLoggingOptions;
}
/**
*
* The Amazon Resource Name (ARN) of the Amazon Web Services credentials. For more information, see Amazon Resource Names (ARNs)
* and Amazon Web Services Service Namespaces.
*
*
* @return The Amazon Resource Name (ARN) of the Amazon Web Services credentials. For more information, see Amazon Resource Names
* (ARNs) and Amazon Web Services Service Namespaces.
*/
public final String roleARN() {
return roleARN;
}
/**
*
* The ARN of the S3 bucket. For more information, see Amazon Resource Names (ARNs)
* and Amazon Web Services Service Namespaces.
*
*
* @return The ARN of the S3 bucket. For more information, see Amazon Resource Names
* (ARNs) and Amazon Web Services Service Namespaces.
*/
public final String bucketARN() {
return bucketARN;
}
/**
*
* The "YYYY/MM/DD/HH" time format prefix is automatically used for delivered Amazon S3 files. You can also specify
* a custom prefix, as described in Custom Prefixes for Amazon S3
* Objects.
*
*
* @return The "YYYY/MM/DD/HH" time format prefix is automatically used for delivered Amazon S3 files. You can also
* specify a custom prefix, as described in Custom Prefixes for Amazon S3
* Objects.
*/
public final String prefix() {
return prefix;
}
/**
*
* A prefix that Kinesis Data Firehose evaluates and adds to failed records before writing them to S3. This prefix
* appears immediately following the bucket name. For information about how to specify this prefix, see Custom Prefixes for Amazon S3
* Objects.
*
*
* @return A prefix that Kinesis Data Firehose evaluates and adds to failed records before writing them to S3. This
* prefix appears immediately following the bucket name. For information about how to specify this prefix,
* see Custom Prefixes for Amazon
* S3 Objects.
*/
public final String errorOutputPrefix() {
return errorOutputPrefix;
}
/**
*
* The buffering option. If no value is specified, BufferingHints
object default values are used.
*
*
* @return The buffering option. If no value is specified, BufferingHints
object default values are
* used.
*/
public final BufferingHints bufferingHints() {
return bufferingHints;
}
/**
*
* The compression format. If no value is specified, the default is UNCOMPRESSED
.
*
*
* The compression formats SNAPPY
or ZIP
cannot be specified for Amazon Redshift
* destinations because they are not supported by the Amazon Redshift COPY
operation that reads from
* the S3 bucket.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #compressionFormat}
* will return {@link CompressionFormat#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #compressionFormatAsString}.
*
*
* @return The compression format. If no value is specified, the default is UNCOMPRESSED
.
*
* The compression formats SNAPPY
or ZIP
cannot be specified for Amazon Redshift
* destinations because they are not supported by the Amazon Redshift COPY
operation that reads
* from the S3 bucket.
* @see CompressionFormat
*/
public final CompressionFormat compressionFormat() {
return CompressionFormat.fromValue(compressionFormat);
}
/**
*
* The compression format. If no value is specified, the default is UNCOMPRESSED
.
*
*
* The compression formats SNAPPY
or ZIP
cannot be specified for Amazon Redshift
* destinations because they are not supported by the Amazon Redshift COPY
operation that reads from
* the S3 bucket.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #compressionFormat}
* will return {@link CompressionFormat#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #compressionFormatAsString}.
*
*
* @return The compression format. If no value is specified, the default is UNCOMPRESSED
.
*
* The compression formats SNAPPY
or ZIP
cannot be specified for Amazon Redshift
* destinations because they are not supported by the Amazon Redshift COPY
operation that reads
* from the S3 bucket.
* @see CompressionFormat
*/
public final String compressionFormatAsString() {
return compressionFormat;
}
/**
*
* The encryption configuration. If no value is specified, the default is no encryption.
*
*
* @return The encryption configuration. If no value is specified, the default is no encryption.
*/
public final EncryptionConfiguration encryptionConfiguration() {
return encryptionConfiguration;
}
/**
*
* The CloudWatch logging options for your delivery stream.
*
*
* @return The CloudWatch logging options for your delivery stream.
*/
public final CloudWatchLoggingOptions cloudWatchLoggingOptions() {
return cloudWatchLoggingOptions;
}
@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(roleARN());
hashCode = 31 * hashCode + Objects.hashCode(bucketARN());
hashCode = 31 * hashCode + Objects.hashCode(prefix());
hashCode = 31 * hashCode + Objects.hashCode(errorOutputPrefix());
hashCode = 31 * hashCode + Objects.hashCode(bufferingHints());
hashCode = 31 * hashCode + Objects.hashCode(compressionFormatAsString());
hashCode = 31 * hashCode + Objects.hashCode(encryptionConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(cloudWatchLoggingOptions());
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 S3DestinationUpdate)) {
return false;
}
S3DestinationUpdate other = (S3DestinationUpdate) obj;
return Objects.equals(roleARN(), other.roleARN()) && Objects.equals(bucketARN(), other.bucketARN())
&& Objects.equals(prefix(), other.prefix()) && Objects.equals(errorOutputPrefix(), other.errorOutputPrefix())
&& Objects.equals(bufferingHints(), other.bufferingHints())
&& Objects.equals(compressionFormatAsString(), other.compressionFormatAsString())
&& Objects.equals(encryptionConfiguration(), other.encryptionConfiguration())
&& Objects.equals(cloudWatchLoggingOptions(), other.cloudWatchLoggingOptions());
}
/**
* 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("S3DestinationUpdate").add("RoleARN", roleARN()).add("BucketARN", bucketARN())
.add("Prefix", prefix()).add("ErrorOutputPrefix", errorOutputPrefix()).add("BufferingHints", bufferingHints())
.add("CompressionFormat", compressionFormatAsString()).add("EncryptionConfiguration", encryptionConfiguration())
.add("CloudWatchLoggingOptions", cloudWatchLoggingOptions()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "RoleARN":
return Optional.ofNullable(clazz.cast(roleARN()));
case "BucketARN":
return Optional.ofNullable(clazz.cast(bucketARN()));
case "Prefix":
return Optional.ofNullable(clazz.cast(prefix()));
case "ErrorOutputPrefix":
return Optional.ofNullable(clazz.cast(errorOutputPrefix()));
case "BufferingHints":
return Optional.ofNullable(clazz.cast(bufferingHints()));
case "CompressionFormat":
return Optional.ofNullable(clazz.cast(compressionFormatAsString()));
case "EncryptionConfiguration":
return Optional.ofNullable(clazz.cast(encryptionConfiguration()));
case "CloudWatchLoggingOptions":
return Optional.ofNullable(clazz.cast(cloudWatchLoggingOptions()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function