software.amazon.awssdk.services.firehose.model.SplunkDestinationUpdate 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.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 Splunk.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class SplunkDestinationUpdate implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField HEC_ENDPOINT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("HECEndpoint").getter(getter(SplunkDestinationUpdate::hecEndpoint)).setter(setter(Builder::hecEndpoint))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HECEndpoint").build()).build();
private static final SdkField HEC_ENDPOINT_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("HECEndpointType").getter(getter(SplunkDestinationUpdate::hecEndpointTypeAsString))
.setter(setter(Builder::hecEndpointType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HECEndpointType").build()).build();
private static final SdkField HEC_TOKEN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("HECToken").getter(getter(SplunkDestinationUpdate::hecToken)).setter(setter(Builder::hecToken))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HECToken").build()).build();
private static final SdkField HEC_ACKNOWLEDGMENT_TIMEOUT_IN_SECONDS_FIELD = SdkField
. builder(MarshallingType.INTEGER)
.memberName("HECAcknowledgmentTimeoutInSeconds")
.getter(getter(SplunkDestinationUpdate::hecAcknowledgmentTimeoutInSeconds))
.setter(setter(Builder::hecAcknowledgmentTimeoutInSeconds))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HECAcknowledgmentTimeoutInSeconds")
.build()).build();
private static final SdkField RETRY_OPTIONS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("RetryOptions")
.getter(getter(SplunkDestinationUpdate::retryOptions)).setter(setter(Builder::retryOptions))
.constructor(SplunkRetryOptions::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RetryOptions").build()).build();
private static final SdkField S3_BACKUP_MODE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("S3BackupMode").getter(getter(SplunkDestinationUpdate::s3BackupModeAsString))
.setter(setter(Builder::s3BackupMode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("S3BackupMode").build()).build();
private static final SdkField S3_UPDATE_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("S3Update")
.getter(getter(SplunkDestinationUpdate::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(SplunkDestinationUpdate::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(SplunkDestinationUpdate::cloudWatchLoggingOptions)).setter(setter(Builder::cloudWatchLoggingOptions))
.constructor(CloudWatchLoggingOptions::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CloudWatchLoggingOptions").build())
.build();
private static final SdkField BUFFERING_HINTS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("BufferingHints")
.getter(getter(SplunkDestinationUpdate::bufferingHints)).setter(setter(Builder::bufferingHints))
.constructor(SplunkBufferingHints::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BufferingHints").build()).build();
private static final SdkField SECRETS_MANAGER_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("SecretsManagerConfiguration")
.getter(getter(SplunkDestinationUpdate::secretsManagerConfiguration))
.setter(setter(Builder::secretsManagerConfiguration))
.constructor(SecretsManagerConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SecretsManagerConfiguration")
.build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(HEC_ENDPOINT_FIELD,
HEC_ENDPOINT_TYPE_FIELD, HEC_TOKEN_FIELD, HEC_ACKNOWLEDGMENT_TIMEOUT_IN_SECONDS_FIELD, RETRY_OPTIONS_FIELD,
S3_BACKUP_MODE_FIELD, S3_UPDATE_FIELD, PROCESSING_CONFIGURATION_FIELD, CLOUD_WATCH_LOGGING_OPTIONS_FIELD,
BUFFERING_HINTS_FIELD, SECRETS_MANAGER_CONFIGURATION_FIELD));
private static final long serialVersionUID = 1L;
private final String hecEndpoint;
private final String hecEndpointType;
private final String hecToken;
private final Integer hecAcknowledgmentTimeoutInSeconds;
private final SplunkRetryOptions retryOptions;
private final String s3BackupMode;
private final S3DestinationUpdate s3Update;
private final ProcessingConfiguration processingConfiguration;
private final CloudWatchLoggingOptions cloudWatchLoggingOptions;
private final SplunkBufferingHints bufferingHints;
private final SecretsManagerConfiguration secretsManagerConfiguration;
private SplunkDestinationUpdate(BuilderImpl builder) {
this.hecEndpoint = builder.hecEndpoint;
this.hecEndpointType = builder.hecEndpointType;
this.hecToken = builder.hecToken;
this.hecAcknowledgmentTimeoutInSeconds = builder.hecAcknowledgmentTimeoutInSeconds;
this.retryOptions = builder.retryOptions;
this.s3BackupMode = builder.s3BackupMode;
this.s3Update = builder.s3Update;
this.processingConfiguration = builder.processingConfiguration;
this.cloudWatchLoggingOptions = builder.cloudWatchLoggingOptions;
this.bufferingHints = builder.bufferingHints;
this.secretsManagerConfiguration = builder.secretsManagerConfiguration;
}
/**
*
* The HTTP Event Collector (HEC) endpoint to which Firehose sends your data.
*
*
* @return The HTTP Event Collector (HEC) endpoint to which Firehose sends your data.
*/
public final String hecEndpoint() {
return hecEndpoint;
}
/**
*
* This type can be either "Raw" or "Event."
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #hecEndpointType}
* will return {@link HECEndpointType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #hecEndpointTypeAsString}.
*
*
* @return This type can be either "Raw" or "Event."
* @see HECEndpointType
*/
public final HECEndpointType hecEndpointType() {
return HECEndpointType.fromValue(hecEndpointType);
}
/**
*
* This type can be either "Raw" or "Event."
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #hecEndpointType}
* will return {@link HECEndpointType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #hecEndpointTypeAsString}.
*
*
* @return This type can be either "Raw" or "Event."
* @see HECEndpointType
*/
public final String hecEndpointTypeAsString() {
return hecEndpointType;
}
/**
*
* A GUID that you obtain from your Splunk cluster when you create a new HEC endpoint.
*
*
* @return A GUID that you obtain from your Splunk cluster when you create a new HEC endpoint.
*/
public final String hecToken() {
return hecToken;
}
/**
*
* The amount of time that Firehose waits to receive an acknowledgment from Splunk after it sends data. At the end
* of the timeout period, Firehose either tries to send the data again or considers it an error, based on your retry
* settings.
*
*
* @return The amount of time that Firehose waits to receive an acknowledgment from Splunk after it sends data. At
* the end of the timeout period, Firehose either tries to send the data again or considers it an error,
* based on your retry settings.
*/
public final Integer hecAcknowledgmentTimeoutInSeconds() {
return hecAcknowledgmentTimeoutInSeconds;
}
/**
*
* The retry behavior in case Firehose is unable to deliver data to Splunk or if it doesn't receive an
* acknowledgment of receipt from Splunk.
*
*
* @return The retry behavior in case Firehose is unable to deliver data to Splunk or if it doesn't receive an
* acknowledgment of receipt from Splunk.
*/
public final SplunkRetryOptions retryOptions() {
return retryOptions;
}
/**
*
* Specifies how you want Firehose to back up documents to Amazon S3. When set to FailedDocumentsOnly
,
* Firehose writes any data that could not be indexed to the configured Amazon S3 destination. When set to
* AllEvents
, Firehose delivers all incoming records to Amazon S3, and also writes failed documents to
* Amazon S3. The default value is FailedEventsOnly
.
*
*
* You can update this backup mode from FailedEventsOnly
to AllEvents
. You can't update it
* from AllEvents
to FailedEventsOnly
.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #s3BackupMode} will
* return {@link SplunkS3BackupMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #s3BackupModeAsString}.
*
*
* @return Specifies how you want Firehose to back up documents to Amazon S3. When set to
* FailedDocumentsOnly
, Firehose writes any data that could not be indexed to the configured
* Amazon S3 destination. When set to AllEvents
, Firehose delivers all incoming records to
* Amazon S3, and also writes failed documents to Amazon S3. The default value is
* FailedEventsOnly
.
*
* You can update this backup mode from FailedEventsOnly
to AllEvents
. You can't
* update it from AllEvents
to FailedEventsOnly
.
* @see SplunkS3BackupMode
*/
public final SplunkS3BackupMode s3BackupMode() {
return SplunkS3BackupMode.fromValue(s3BackupMode);
}
/**
*
* Specifies how you want Firehose to back up documents to Amazon S3. When set to FailedDocumentsOnly
,
* Firehose writes any data that could not be indexed to the configured Amazon S3 destination. When set to
* AllEvents
, Firehose delivers all incoming records to Amazon S3, and also writes failed documents to
* Amazon S3. The default value is FailedEventsOnly
.
*
*
* You can update this backup mode from FailedEventsOnly
to AllEvents
. You can't update it
* from AllEvents
to FailedEventsOnly
.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #s3BackupMode} will
* return {@link SplunkS3BackupMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #s3BackupModeAsString}.
*
*
* @return Specifies how you want Firehose to back up documents to Amazon S3. When set to
* FailedDocumentsOnly
, Firehose writes any data that could not be indexed to the configured
* Amazon S3 destination. When set to AllEvents
, Firehose delivers all incoming records to
* Amazon S3, and also writes failed documents to Amazon S3. The default value is
* FailedEventsOnly
.
*
* You can update this backup mode from FailedEventsOnly
to AllEvents
. You can't
* update it from AllEvents
to FailedEventsOnly
.
* @see SplunkS3BackupMode
*/
public final String s3BackupModeAsString() {
return s3BackupMode;
}
/**
*
* Your update to the configuration of the backup Amazon S3 location.
*
*
* @return Your update to the configuration of the backup Amazon S3 location.
*/
public final S3DestinationUpdate s3Update() {
return s3Update;
}
/**
*
* The data processing configuration.
*
*
* @return The data processing configuration.
*/
public final ProcessingConfiguration processingConfiguration() {
return processingConfiguration;
}
/**
*
* The Amazon CloudWatch logging options for your delivery stream.
*
*
* @return The Amazon CloudWatch logging options for your delivery stream.
*/
public final CloudWatchLoggingOptions cloudWatchLoggingOptions() {
return cloudWatchLoggingOptions;
}
/**
*
* The buffering options. If no value is specified, the default values for Splunk are used.
*
*
* @return The buffering options. If no value is specified, the default values for Splunk are used.
*/
public final SplunkBufferingHints bufferingHints() {
return bufferingHints;
}
/**
*
* The configuration that defines how you access secrets for Splunk.
*
*
* @return The configuration that defines how you access secrets for Splunk.
*/
public final SecretsManagerConfiguration secretsManagerConfiguration() {
return secretsManagerConfiguration;
}
@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(hecEndpoint());
hashCode = 31 * hashCode + Objects.hashCode(hecEndpointTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(hecToken());
hashCode = 31 * hashCode + Objects.hashCode(hecAcknowledgmentTimeoutInSeconds());
hashCode = 31 * hashCode + Objects.hashCode(retryOptions());
hashCode = 31 * hashCode + Objects.hashCode(s3BackupModeAsString());
hashCode = 31 * hashCode + Objects.hashCode(s3Update());
hashCode = 31 * hashCode + Objects.hashCode(processingConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(cloudWatchLoggingOptions());
hashCode = 31 * hashCode + Objects.hashCode(bufferingHints());
hashCode = 31 * hashCode + Objects.hashCode(secretsManagerConfiguration());
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 SplunkDestinationUpdate)) {
return false;
}
SplunkDestinationUpdate other = (SplunkDestinationUpdate) obj;
return Objects.equals(hecEndpoint(), other.hecEndpoint())
&& Objects.equals(hecEndpointTypeAsString(), other.hecEndpointTypeAsString())
&& Objects.equals(hecToken(), other.hecToken())
&& Objects.equals(hecAcknowledgmentTimeoutInSeconds(), other.hecAcknowledgmentTimeoutInSeconds())
&& Objects.equals(retryOptions(), other.retryOptions())
&& Objects.equals(s3BackupModeAsString(), other.s3BackupModeAsString())
&& Objects.equals(s3Update(), other.s3Update())
&& Objects.equals(processingConfiguration(), other.processingConfiguration())
&& Objects.equals(cloudWatchLoggingOptions(), other.cloudWatchLoggingOptions())
&& Objects.equals(bufferingHints(), other.bufferingHints())
&& Objects.equals(secretsManagerConfiguration(), other.secretsManagerConfiguration());
}
/**
* 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("SplunkDestinationUpdate").add("HECEndpoint", hecEndpoint())
.add("HECEndpointType", hecEndpointTypeAsString()).add("HECToken", hecToken())
.add("HECAcknowledgmentTimeoutInSeconds", hecAcknowledgmentTimeoutInSeconds())
.add("RetryOptions", retryOptions()).add("S3BackupMode", s3BackupModeAsString()).add("S3Update", s3Update())
.add("ProcessingConfiguration", processingConfiguration())
.add("CloudWatchLoggingOptions", cloudWatchLoggingOptions()).add("BufferingHints", bufferingHints())
.add("SecretsManagerConfiguration", secretsManagerConfiguration()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "HECEndpoint":
return Optional.ofNullable(clazz.cast(hecEndpoint()));
case "HECEndpointType":
return Optional.ofNullable(clazz.cast(hecEndpointTypeAsString()));
case "HECToken":
return Optional.ofNullable(clazz.cast(hecToken()));
case "HECAcknowledgmentTimeoutInSeconds":
return Optional.ofNullable(clazz.cast(hecAcknowledgmentTimeoutInSeconds()));
case "RetryOptions":
return Optional.ofNullable(clazz.cast(retryOptions()));
case "S3BackupMode":
return Optional.ofNullable(clazz.cast(s3BackupModeAsString()));
case "S3Update":
return Optional.ofNullable(clazz.cast(s3Update()));
case "ProcessingConfiguration":
return Optional.ofNullable(clazz.cast(processingConfiguration()));
case "CloudWatchLoggingOptions":
return Optional.ofNullable(clazz.cast(cloudWatchLoggingOptions()));
case "BufferingHints":
return Optional.ofNullable(clazz.cast(bufferingHints()));
case "SecretsManagerConfiguration":
return Optional.ofNullable(clazz.cast(secretsManagerConfiguration()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function