
software.amazon.awssdk.services.firehose.model.AmazonopensearchserviceDestinationUpdate 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 OpenSearch Service.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class AmazonopensearchserviceDestinationUpdate implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RoleARN").getter(getter(AmazonopensearchserviceDestinationUpdate::roleARN))
.setter(setter(Builder::roleARN))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RoleARN").build()).build();
private static final SdkField DOMAIN_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DomainARN").getter(getter(AmazonopensearchserviceDestinationUpdate::domainARN))
.setter(setter(Builder::domainARN))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DomainARN").build()).build();
private static final SdkField CLUSTER_ENDPOINT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ClusterEndpoint").getter(getter(AmazonopensearchserviceDestinationUpdate::clusterEndpoint))
.setter(setter(Builder::clusterEndpoint))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ClusterEndpoint").build()).build();
private static final SdkField INDEX_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("IndexName").getter(getter(AmazonopensearchserviceDestinationUpdate::indexName))
.setter(setter(Builder::indexName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IndexName").build()).build();
private static final SdkField TYPE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TypeName").getter(getter(AmazonopensearchserviceDestinationUpdate::typeName))
.setter(setter(Builder::typeName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TypeName").build()).build();
private static final SdkField INDEX_ROTATION_PERIOD_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("IndexRotationPeriod")
.getter(getter(AmazonopensearchserviceDestinationUpdate::indexRotationPeriodAsString))
.setter(setter(Builder::indexRotationPeriod))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IndexRotationPeriod").build())
.build();
private static final SdkField BUFFERING_HINTS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("BufferingHints")
.getter(getter(AmazonopensearchserviceDestinationUpdate::bufferingHints)).setter(setter(Builder::bufferingHints))
.constructor(AmazonopensearchserviceBufferingHints::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BufferingHints").build()).build();
private static final SdkField RETRY_OPTIONS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("RetryOptions")
.getter(getter(AmazonopensearchserviceDestinationUpdate::retryOptions)).setter(setter(Builder::retryOptions))
.constructor(AmazonopensearchserviceRetryOptions::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RetryOptions").build()).build();
private static final SdkField S3_UPDATE_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("S3Update")
.getter(getter(AmazonopensearchserviceDestinationUpdate::s3Update)).setter(setter(Builder::s3Update))
.constructor(S3DestinationUpdate::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("S3Update").build()).build();
private static final SdkField PROCESSING_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("ProcessingConfiguration")
.getter(getter(AmazonopensearchserviceDestinationUpdate::processingConfiguration))
.setter(setter(Builder::processingConfiguration)).constructor(ProcessingConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProcessingConfiguration").build())
.build();
private static final SdkField CLOUD_WATCH_LOGGING_OPTIONS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("CloudWatchLoggingOptions")
.getter(getter(AmazonopensearchserviceDestinationUpdate::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,
DOMAIN_ARN_FIELD, CLUSTER_ENDPOINT_FIELD, INDEX_NAME_FIELD, TYPE_NAME_FIELD, INDEX_ROTATION_PERIOD_FIELD,
BUFFERING_HINTS_FIELD, RETRY_OPTIONS_FIELD, S3_UPDATE_FIELD, PROCESSING_CONFIGURATION_FIELD,
CLOUD_WATCH_LOGGING_OPTIONS_FIELD));
private static final long serialVersionUID = 1L;
private final String roleARN;
private final String domainARN;
private final String clusterEndpoint;
private final String indexName;
private final String typeName;
private final String indexRotationPeriod;
private final AmazonopensearchserviceBufferingHints bufferingHints;
private final AmazonopensearchserviceRetryOptions retryOptions;
private final S3DestinationUpdate s3Update;
private final ProcessingConfiguration processingConfiguration;
private final CloudWatchLoggingOptions cloudWatchLoggingOptions;
private AmazonopensearchserviceDestinationUpdate(BuilderImpl builder) {
this.roleARN = builder.roleARN;
this.domainARN = builder.domainARN;
this.clusterEndpoint = builder.clusterEndpoint;
this.indexName = builder.indexName;
this.typeName = builder.typeName;
this.indexRotationPeriod = builder.indexRotationPeriod;
this.bufferingHints = builder.bufferingHints;
this.retryOptions = builder.retryOptions;
this.s3Update = builder.s3Update;
this.processingConfiguration = builder.processingConfiguration;
this.cloudWatchLoggingOptions = builder.cloudWatchLoggingOptions;
}
/**
*
* The Amazon Resource Name (ARN) of the IAM role to be assumed by Kinesis Data Firehose for calling the Amazon
* OpenSearch Service Configuration API and for indexing documents.
*
*
* @return The Amazon Resource Name (ARN) of the IAM role to be assumed by Kinesis Data Firehose for calling the
* Amazon OpenSearch Service Configuration API and for indexing documents.
*/
public final String roleARN() {
return roleARN;
}
/**
*
* The ARN of the Amazon OpenSearch Service domain. The IAM role must have permissions for DescribeDomain,
* DescribeDomains, and DescribeDomainConfig after assuming the IAM role specified in RoleARN.
*
*
* @return The ARN of the Amazon OpenSearch Service domain. The IAM role must have permissions for DescribeDomain,
* DescribeDomains, and DescribeDomainConfig after assuming the IAM role specified in RoleARN.
*/
public final String domainARN() {
return domainARN;
}
/**
*
* The endpoint to use when communicating with the cluster. Specify either this ClusterEndpoint or the DomainARN
* field.
*
*
* @return The endpoint to use when communicating with the cluster. Specify either this ClusterEndpoint or the
* DomainARN field.
*/
public final String clusterEndpoint() {
return clusterEndpoint;
}
/**
*
* The Amazon OpenSearch Service index name.
*
*
* @return The Amazon OpenSearch Service index name.
*/
public final String indexName() {
return indexName;
}
/**
*
* The Amazon OpenSearch Service type name. For Elasticsearch 6.x, there can be only one type per index. If you try
* to specify a new type for an existing index that already has another type, Kinesis Data Firehose returns an error
* during runtime.
*
*
* If you upgrade Elasticsearch from 6.x to 7.x and don’t update your delivery stream, Kinesis Data Firehose still
* delivers data to Elasticsearch with the old index name and type name. If you want to update your delivery stream
* with a new index name, provide an empty string for TypeName.
*
*
* @return The Amazon OpenSearch Service type name. For Elasticsearch 6.x, there can be only one type per index. If
* you try to specify a new type for an existing index that already has another type, Kinesis Data Firehose
* returns an error during runtime.
*
* If you upgrade Elasticsearch from 6.x to 7.x and don’t update your delivery stream, Kinesis Data Firehose
* still delivers data to Elasticsearch with the old index name and type name. If you want to update your
* delivery stream with a new index name, provide an empty string for TypeName.
*/
public final String typeName() {
return typeName;
}
/**
*
* The Amazon OpenSearch Service index rotation period. Index rotation appends a timestamp to IndexName to
* facilitate the expiration of old data.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #indexRotationPeriod} will return
* {@link AmazonopensearchserviceIndexRotationPeriod#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service
* is available from {@link #indexRotationPeriodAsString}.
*
*
* @return The Amazon OpenSearch Service index rotation period. Index rotation appends a timestamp to IndexName to
* facilitate the expiration of old data.
* @see AmazonopensearchserviceIndexRotationPeriod
*/
public final AmazonopensearchserviceIndexRotationPeriod indexRotationPeriod() {
return AmazonopensearchserviceIndexRotationPeriod.fromValue(indexRotationPeriod);
}
/**
*
* The Amazon OpenSearch Service index rotation period. Index rotation appends a timestamp to IndexName to
* facilitate the expiration of old data.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #indexRotationPeriod} will return
* {@link AmazonopensearchserviceIndexRotationPeriod#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service
* is available from {@link #indexRotationPeriodAsString}.
*
*
* @return The Amazon OpenSearch Service index rotation period. Index rotation appends a timestamp to IndexName to
* facilitate the expiration of old data.
* @see AmazonopensearchserviceIndexRotationPeriod
*/
public final String indexRotationPeriodAsString() {
return indexRotationPeriod;
}
/**
*
* The buffering options. If no value is specified, AmazonopensearchBufferingHints object default values are used.
*
*
* @return The buffering options. If no value is specified, AmazonopensearchBufferingHints object default values are
* used.
*/
public final AmazonopensearchserviceBufferingHints bufferingHints() {
return bufferingHints;
}
/**
*
* The retry behavior in case Kinesis Data Firehose is unable to deliver documents to Amazon OpenSearch Service. The
* default value is 300 (5 minutes).
*
*
* @return The retry behavior in case Kinesis Data Firehose is unable to deliver documents to Amazon OpenSearch
* Service. The default value is 300 (5 minutes).
*/
public final AmazonopensearchserviceRetryOptions retryOptions() {
return retryOptions;
}
/**
* Returns the value of the S3Update property for this object.
*
* @return The value of the S3Update property for this object.
*/
public final S3DestinationUpdate s3Update() {
return s3Update;
}
/**
* 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;
}
/**
* 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;
}
@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(domainARN());
hashCode = 31 * hashCode + Objects.hashCode(clusterEndpoint());
hashCode = 31 * hashCode + Objects.hashCode(indexName());
hashCode = 31 * hashCode + Objects.hashCode(typeName());
hashCode = 31 * hashCode + Objects.hashCode(indexRotationPeriodAsString());
hashCode = 31 * hashCode + Objects.hashCode(bufferingHints());
hashCode = 31 * hashCode + Objects.hashCode(retryOptions());
hashCode = 31 * hashCode + Objects.hashCode(s3Update());
hashCode = 31 * hashCode + Objects.hashCode(processingConfiguration());
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 AmazonopensearchserviceDestinationUpdate)) {
return false;
}
AmazonopensearchserviceDestinationUpdate other = (AmazonopensearchserviceDestinationUpdate) obj;
return Objects.equals(roleARN(), other.roleARN()) && Objects.equals(domainARN(), other.domainARN())
&& Objects.equals(clusterEndpoint(), other.clusterEndpoint()) && Objects.equals(indexName(), other.indexName())
&& Objects.equals(typeName(), other.typeName())
&& Objects.equals(indexRotationPeriodAsString(), other.indexRotationPeriodAsString())
&& Objects.equals(bufferingHints(), other.bufferingHints())
&& Objects.equals(retryOptions(), other.retryOptions()) && Objects.equals(s3Update(), other.s3Update())
&& Objects.equals(processingConfiguration(), other.processingConfiguration())
&& 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("AmazonopensearchserviceDestinationUpdate").add("RoleARN", roleARN())
.add("DomainARN", domainARN()).add("ClusterEndpoint", clusterEndpoint()).add("IndexName", indexName())
.add("TypeName", typeName()).add("IndexRotationPeriod", indexRotationPeriodAsString())
.add("BufferingHints", bufferingHints()).add("RetryOptions", retryOptions()).add("S3Update", s3Update())
.add("ProcessingConfiguration", processingConfiguration())
.add("CloudWatchLoggingOptions", cloudWatchLoggingOptions()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "RoleARN":
return Optional.ofNullable(clazz.cast(roleARN()));
case "DomainARN":
return Optional.ofNullable(clazz.cast(domainARN()));
case "ClusterEndpoint":
return Optional.ofNullable(clazz.cast(clusterEndpoint()));
case "IndexName":
return Optional.ofNullable(clazz.cast(indexName()));
case "TypeName":
return Optional.ofNullable(clazz.cast(typeName()));
case "IndexRotationPeriod":
return Optional.ofNullable(clazz.cast(indexRotationPeriodAsString()));
case "BufferingHints":
return Optional.ofNullable(clazz.cast(bufferingHints()));
case "RetryOptions":
return Optional.ofNullable(clazz.cast(retryOptions()));
case "S3Update":
return Optional.ofNullable(clazz.cast(s3Update()));
case "ProcessingConfiguration":
return Optional.ofNullable(clazz.cast(processingConfiguration()));
case "CloudWatchLoggingOptions":
return Optional.ofNullable(clazz.cast(cloudWatchLoggingOptions()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function