software.amazon.awssdk.services.firehose.model.DeliveryStreamDescription 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.time.Instant;
import java.util.Arrays;
import java.util.Collection;
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 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;
/**
*
* Contains information about a delivery stream.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class DeliveryStreamDescription implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField DELIVERY_STREAM_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DeliveryStreamName").getter(getter(DeliveryStreamDescription::deliveryStreamName))
.setter(setter(Builder::deliveryStreamName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeliveryStreamName").build())
.build();
private static final SdkField DELIVERY_STREAM_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DeliveryStreamARN").getter(getter(DeliveryStreamDescription::deliveryStreamARN))
.setter(setter(Builder::deliveryStreamARN))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeliveryStreamARN").build()).build();
private static final SdkField DELIVERY_STREAM_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DeliveryStreamStatus").getter(getter(DeliveryStreamDescription::deliveryStreamStatusAsString))
.setter(setter(Builder::deliveryStreamStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeliveryStreamStatus").build())
.build();
private static final SdkField FAILURE_DESCRIPTION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("FailureDescription")
.getter(getter(DeliveryStreamDescription::failureDescription)).setter(setter(Builder::failureDescription))
.constructor(FailureDescription::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FailureDescription").build())
.build();
private static final SdkField DELIVERY_STREAM_ENCRYPTION_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("DeliveryStreamEncryptionConfiguration")
.getter(getter(DeliveryStreamDescription::deliveryStreamEncryptionConfiguration))
.setter(setter(Builder::deliveryStreamEncryptionConfiguration))
.constructor(DeliveryStreamEncryptionConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("DeliveryStreamEncryptionConfiguration").build()).build();
private static final SdkField DELIVERY_STREAM_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DeliveryStreamType").getter(getter(DeliveryStreamDescription::deliveryStreamTypeAsString))
.setter(setter(Builder::deliveryStreamType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeliveryStreamType").build())
.build();
private static final SdkField VERSION_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("VersionId").getter(getter(DeliveryStreamDescription::versionId)).setter(setter(Builder::versionId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VersionId").build()).build();
private static final SdkField CREATE_TIMESTAMP_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CreateTimestamp").getter(getter(DeliveryStreamDescription::createTimestamp))
.setter(setter(Builder::createTimestamp))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreateTimestamp").build()).build();
private static final SdkField LAST_UPDATE_TIMESTAMP_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("LastUpdateTimestamp").getter(getter(DeliveryStreamDescription::lastUpdateTimestamp))
.setter(setter(Builder::lastUpdateTimestamp))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastUpdateTimestamp").build())
.build();
private static final SdkField SOURCE_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("Source")
.getter(getter(DeliveryStreamDescription::source)).setter(setter(Builder::source))
.constructor(SourceDescription::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Source").build()).build();
private static final SdkField> DESTINATIONS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Destinations")
.getter(getter(DeliveryStreamDescription::destinations))
.setter(setter(Builder::destinations))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Destinations").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(DestinationDescription::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField HAS_MORE_DESTINATIONS_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("HasMoreDestinations").getter(getter(DeliveryStreamDescription::hasMoreDestinations))
.setter(setter(Builder::hasMoreDestinations))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HasMoreDestinations").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DELIVERY_STREAM_NAME_FIELD,
DELIVERY_STREAM_ARN_FIELD, DELIVERY_STREAM_STATUS_FIELD, FAILURE_DESCRIPTION_FIELD,
DELIVERY_STREAM_ENCRYPTION_CONFIGURATION_FIELD, DELIVERY_STREAM_TYPE_FIELD, VERSION_ID_FIELD, CREATE_TIMESTAMP_FIELD,
LAST_UPDATE_TIMESTAMP_FIELD, SOURCE_FIELD, DESTINATIONS_FIELD, HAS_MORE_DESTINATIONS_FIELD));
private static final long serialVersionUID = 1L;
private final String deliveryStreamName;
private final String deliveryStreamARN;
private final String deliveryStreamStatus;
private final FailureDescription failureDescription;
private final DeliveryStreamEncryptionConfiguration deliveryStreamEncryptionConfiguration;
private final String deliveryStreamType;
private final String versionId;
private final Instant createTimestamp;
private final Instant lastUpdateTimestamp;
private final SourceDescription source;
private final List destinations;
private final Boolean hasMoreDestinations;
private DeliveryStreamDescription(BuilderImpl builder) {
this.deliveryStreamName = builder.deliveryStreamName;
this.deliveryStreamARN = builder.deliveryStreamARN;
this.deliveryStreamStatus = builder.deliveryStreamStatus;
this.failureDescription = builder.failureDescription;
this.deliveryStreamEncryptionConfiguration = builder.deliveryStreamEncryptionConfiguration;
this.deliveryStreamType = builder.deliveryStreamType;
this.versionId = builder.versionId;
this.createTimestamp = builder.createTimestamp;
this.lastUpdateTimestamp = builder.lastUpdateTimestamp;
this.source = builder.source;
this.destinations = builder.destinations;
this.hasMoreDestinations = builder.hasMoreDestinations;
}
/**
*
* The name of the delivery stream.
*
*
* @return The name of the delivery stream.
*/
public final String deliveryStreamName() {
return deliveryStreamName;
}
/**
*
* The Amazon Resource Name (ARN) of the delivery stream. For more information, see Amazon Resource Names (ARNs)
* and Amazon Web Services Service Namespaces.
*
*
* @return The Amazon Resource Name (ARN) of the delivery stream. For more information, see Amazon Resource Names
* (ARNs) and Amazon Web Services Service Namespaces.
*/
public final String deliveryStreamARN() {
return deliveryStreamARN;
}
/**
*
* The status of the delivery stream. If the status of a delivery stream is CREATING_FAILED
, this
* status doesn't change, and you can't invoke CreateDeliveryStream
again on it. However, you can
* invoke the DeleteDeliveryStream operation to delete it.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #deliveryStreamStatus} will return {@link DeliveryStreamStatus#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #deliveryStreamStatusAsString}.
*
*
* @return The status of the delivery stream. If the status of a delivery stream is CREATING_FAILED
,
* this status doesn't change, and you can't invoke CreateDeliveryStream
again on it. However,
* you can invoke the DeleteDeliveryStream operation to delete it.
* @see DeliveryStreamStatus
*/
public final DeliveryStreamStatus deliveryStreamStatus() {
return DeliveryStreamStatus.fromValue(deliveryStreamStatus);
}
/**
*
* The status of the delivery stream. If the status of a delivery stream is CREATING_FAILED
, this
* status doesn't change, and you can't invoke CreateDeliveryStream
again on it. However, you can
* invoke the DeleteDeliveryStream operation to delete it.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #deliveryStreamStatus} will return {@link DeliveryStreamStatus#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #deliveryStreamStatusAsString}.
*
*
* @return The status of the delivery stream. If the status of a delivery stream is CREATING_FAILED
,
* this status doesn't change, and you can't invoke CreateDeliveryStream
again on it. However,
* you can invoke the DeleteDeliveryStream operation to delete it.
* @see DeliveryStreamStatus
*/
public final String deliveryStreamStatusAsString() {
return deliveryStreamStatus;
}
/**
*
* Provides details in case one of the following operations fails due to an error related to KMS:
* CreateDeliveryStream, DeleteDeliveryStream, StartDeliveryStreamEncryption,
* StopDeliveryStreamEncryption.
*
*
* @return Provides details in case one of the following operations fails due to an error related to KMS:
* CreateDeliveryStream, DeleteDeliveryStream, StartDeliveryStreamEncryption,
* StopDeliveryStreamEncryption.
*/
public final FailureDescription failureDescription() {
return failureDescription;
}
/**
*
* Indicates the server-side encryption (SSE) status for the delivery stream.
*
*
* @return Indicates the server-side encryption (SSE) status for the delivery stream.
*/
public final DeliveryStreamEncryptionConfiguration deliveryStreamEncryptionConfiguration() {
return deliveryStreamEncryptionConfiguration;
}
/**
*
* The delivery stream type. This can be one of the following values:
*
*
* -
*
* DirectPut
: Provider applications access the delivery stream directly.
*
*
* -
*
* KinesisStreamAsSource
: The delivery stream uses a Kinesis data stream as a source.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #deliveryStreamType} will return {@link DeliveryStreamType#UNKNOWN_TO_SDK_VERSION}. The raw value returned
* by the service is available from {@link #deliveryStreamTypeAsString}.
*
*
* @return The delivery stream type. This can be one of the following values:
*
* -
*
* DirectPut
: Provider applications access the delivery stream directly.
*
*
* -
*
* KinesisStreamAsSource
: The delivery stream uses a Kinesis data stream as a source.
*
*
* @see DeliveryStreamType
*/
public final DeliveryStreamType deliveryStreamType() {
return DeliveryStreamType.fromValue(deliveryStreamType);
}
/**
*
* The delivery stream type. This can be one of the following values:
*
*
* -
*
* DirectPut
: Provider applications access the delivery stream directly.
*
*
* -
*
* KinesisStreamAsSource
: The delivery stream uses a Kinesis data stream as a source.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #deliveryStreamType} will return {@link DeliveryStreamType#UNKNOWN_TO_SDK_VERSION}. The raw value returned
* by the service is available from {@link #deliveryStreamTypeAsString}.
*
*
* @return The delivery stream type. This can be one of the following values:
*
* -
*
* DirectPut
: Provider applications access the delivery stream directly.
*
*
* -
*
* KinesisStreamAsSource
: The delivery stream uses a Kinesis data stream as a source.
*
*
* @see DeliveryStreamType
*/
public final String deliveryStreamTypeAsString() {
return deliveryStreamType;
}
/**
*
* Each time the destination is updated for a delivery stream, the version ID is changed, and the current version ID
* is required when updating the destination. This is so that the service knows it is applying the changes to the
* correct version of the delivery stream.
*
*
* @return Each time the destination is updated for a delivery stream, the version ID is changed, and the current
* version ID is required when updating the destination. This is so that the service knows it is applying
* the changes to the correct version of the delivery stream.
*/
public final String versionId() {
return versionId;
}
/**
*
* The date and time that the delivery stream was created.
*
*
* @return The date and time that the delivery stream was created.
*/
public final Instant createTimestamp() {
return createTimestamp;
}
/**
*
* The date and time that the delivery stream was last updated.
*
*
* @return The date and time that the delivery stream was last updated.
*/
public final Instant lastUpdateTimestamp() {
return lastUpdateTimestamp;
}
/**
*
* If the DeliveryStreamType
parameter is KinesisStreamAsSource
, a
* SourceDescription object describing the source Kinesis data stream.
*
*
* @return If the DeliveryStreamType
parameter is KinesisStreamAsSource
, a
* SourceDescription object describing the source Kinesis data stream.
*/
public final SourceDescription source() {
return source;
}
/**
* For responses, this returns true if the service returned a value for the Destinations 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 hasDestinations() {
return destinations != null && !(destinations instanceof SdkAutoConstructList);
}
/**
*
* The destinations.
*
*
* 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 #hasDestinations} method.
*
*
* @return The destinations.
*/
public final List destinations() {
return destinations;
}
/**
*
* Indicates whether there are more destinations available to list.
*
*
* @return Indicates whether there are more destinations available to list.
*/
public final Boolean hasMoreDestinations() {
return hasMoreDestinations;
}
@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(deliveryStreamName());
hashCode = 31 * hashCode + Objects.hashCode(deliveryStreamARN());
hashCode = 31 * hashCode + Objects.hashCode(deliveryStreamStatusAsString());
hashCode = 31 * hashCode + Objects.hashCode(failureDescription());
hashCode = 31 * hashCode + Objects.hashCode(deliveryStreamEncryptionConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(deliveryStreamTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(versionId());
hashCode = 31 * hashCode + Objects.hashCode(createTimestamp());
hashCode = 31 * hashCode + Objects.hashCode(lastUpdateTimestamp());
hashCode = 31 * hashCode + Objects.hashCode(source());
hashCode = 31 * hashCode + Objects.hashCode(hasDestinations() ? destinations() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMoreDestinations());
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 DeliveryStreamDescription)) {
return false;
}
DeliveryStreamDescription other = (DeliveryStreamDescription) obj;
return Objects.equals(deliveryStreamName(), other.deliveryStreamName())
&& Objects.equals(deliveryStreamARN(), other.deliveryStreamARN())
&& Objects.equals(deliveryStreamStatusAsString(), other.deliveryStreamStatusAsString())
&& Objects.equals(failureDescription(), other.failureDescription())
&& Objects.equals(deliveryStreamEncryptionConfiguration(), other.deliveryStreamEncryptionConfiguration())
&& Objects.equals(deliveryStreamTypeAsString(), other.deliveryStreamTypeAsString())
&& Objects.equals(versionId(), other.versionId()) && Objects.equals(createTimestamp(), other.createTimestamp())
&& Objects.equals(lastUpdateTimestamp(), other.lastUpdateTimestamp()) && Objects.equals(source(), other.source())
&& hasDestinations() == other.hasDestinations() && Objects.equals(destinations(), other.destinations())
&& Objects.equals(hasMoreDestinations(), other.hasMoreDestinations());
}
/**
* 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("DeliveryStreamDescription").add("DeliveryStreamName", deliveryStreamName())
.add("DeliveryStreamARN", deliveryStreamARN()).add("DeliveryStreamStatus", deliveryStreamStatusAsString())
.add("FailureDescription", failureDescription())
.add("DeliveryStreamEncryptionConfiguration", deliveryStreamEncryptionConfiguration())
.add("DeliveryStreamType", deliveryStreamTypeAsString()).add("VersionId", versionId())
.add("CreateTimestamp", createTimestamp()).add("LastUpdateTimestamp", lastUpdateTimestamp())
.add("Source", source()).add("Destinations", hasDestinations() ? destinations() : null)
.add("HasMoreDestinations", hasMoreDestinations()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "DeliveryStreamName":
return Optional.ofNullable(clazz.cast(deliveryStreamName()));
case "DeliveryStreamARN":
return Optional.ofNullable(clazz.cast(deliveryStreamARN()));
case "DeliveryStreamStatus":
return Optional.ofNullable(clazz.cast(deliveryStreamStatusAsString()));
case "FailureDescription":
return Optional.ofNullable(clazz.cast(failureDescription()));
case "DeliveryStreamEncryptionConfiguration":
return Optional.ofNullable(clazz.cast(deliveryStreamEncryptionConfiguration()));
case "DeliveryStreamType":
return Optional.ofNullable(clazz.cast(deliveryStreamTypeAsString()));
case "VersionId":
return Optional.ofNullable(clazz.cast(versionId()));
case "CreateTimestamp":
return Optional.ofNullable(clazz.cast(createTimestamp()));
case "LastUpdateTimestamp":
return Optional.ofNullable(clazz.cast(lastUpdateTimestamp()));
case "Source":
return Optional.ofNullable(clazz.cast(source()));
case "Destinations":
return Optional.ofNullable(clazz.cast(destinations()));
case "HasMoreDestinations":
return Optional.ofNullable(clazz.cast(hasMoreDestinations()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function