software.amazon.awssdk.services.firehose.model.DeliveryStreamDescription Maven / Gradle / Ivy
Show all versions of kinesis Show documentation
/*
* Copyright 2013-2018 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.time.Instant;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import javax.annotation.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.core.protocol.ProtocolMarshaller;
import software.amazon.awssdk.core.protocol.StructuredPojo;
import software.amazon.awssdk.services.firehose.transform.DeliveryStreamDescriptionMarshaller;
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 class DeliveryStreamDescription implements StructuredPojo,
ToCopyableBuilder {
private final String deliveryStreamName;
private final String deliveryStreamARN;
private final String deliveryStreamStatus;
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.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 String deliveryStreamName() {
return deliveryStreamName;
}
/**
*
* The Amazon Resource Name (ARN) of the delivery stream.
*
*
* @return The Amazon Resource Name (ARN) of the delivery stream.
*/
public String deliveryStreamARN() {
return deliveryStreamARN;
}
/**
*
* The status of the delivery stream.
*
*
* 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 #deliveryStreamStatusString}.
*
*
* @return The status of the delivery stream.
* @see DeliveryStreamStatus
*/
public DeliveryStreamStatus deliveryStreamStatus() {
return DeliveryStreamStatus.fromValue(deliveryStreamStatus);
}
/**
*
* The status of the delivery stream.
*
*
* 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 #deliveryStreamStatusString}.
*
*
* @return The status of the delivery stream.
* @see DeliveryStreamStatus
*/
public String deliveryStreamStatusString() {
return deliveryStreamStatus;
}
/**
*
* 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 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 #deliveryStreamTypeString}.
*
*
* @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 stream as a source.
*
*
* @see DeliveryStreamType
*/
public 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 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 #deliveryStreamTypeString}.
*
*
* @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 stream as a source.
*
*
* @see DeliveryStreamType
*/
public String deliveryStreamTypeString() {
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 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 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 Instant lastUpdateTimestamp() {
return lastUpdateTimestamp;
}
/**
*
* If the DeliveryStreamType
parameter is KinesisStreamAsSource
, a
* SourceDescription object describing the source Kinesis stream.
*
*
* @return If the DeliveryStreamType
parameter is KinesisStreamAsSource
, a
* SourceDescription object describing the source Kinesis stream.
*/
public SourceDescription source() {
return source;
}
/**
*
* The destinations.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return The destinations.
*/
public List destinations() {
return destinations;
}
/**
*
* Indicates whether there are more destinations available to list.
*
*
* @return Indicates whether there are more destinations available to list.
*/
public 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 int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(deliveryStreamName());
hashCode = 31 * hashCode + Objects.hashCode(deliveryStreamARN());
hashCode = 31 * hashCode + Objects.hashCode(deliveryStreamStatusString());
hashCode = 31 * hashCode + Objects.hashCode(deliveryStreamTypeString());
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(destinations());
hashCode = 31 * hashCode + Objects.hashCode(hasMoreDestinations());
return hashCode;
}
@Override
public boolean equals(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(deliveryStreamStatusString(), other.deliveryStreamStatusString())
&& Objects.equals(deliveryStreamTypeString(), other.deliveryStreamTypeString())
&& Objects.equals(versionId(), other.versionId()) && Objects.equals(createTimestamp(), other.createTimestamp())
&& Objects.equals(lastUpdateTimestamp(), other.lastUpdateTimestamp()) && Objects.equals(source(), other.source())
&& Objects.equals(destinations(), other.destinations())
&& Objects.equals(hasMoreDestinations(), other.hasMoreDestinations());
}
@Override
public String toString() {
return ToString.builder("DeliveryStreamDescription").add("DeliveryStreamName", deliveryStreamName())
.add("DeliveryStreamARN", deliveryStreamARN()).add("DeliveryStreamStatus", deliveryStreamStatusString())
.add("DeliveryStreamType", deliveryStreamTypeString()).add("VersionId", versionId())
.add("CreateTimestamp", createTimestamp()).add("LastUpdateTimestamp", lastUpdateTimestamp())
.add("Source", source()).add("Destinations", destinations()).add("HasMoreDestinations", hasMoreDestinations())
.build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "DeliveryStreamName":
return Optional.of(clazz.cast(deliveryStreamName()));
case "DeliveryStreamARN":
return Optional.of(clazz.cast(deliveryStreamARN()));
case "DeliveryStreamStatus":
return Optional.of(clazz.cast(deliveryStreamStatusString()));
case "DeliveryStreamType":
return Optional.of(clazz.cast(deliveryStreamTypeString()));
case "VersionId":
return Optional.of(clazz.cast(versionId()));
case "CreateTimestamp":
return Optional.of(clazz.cast(createTimestamp()));
case "LastUpdateTimestamp":
return Optional.of(clazz.cast(lastUpdateTimestamp()));
case "Source":
return Optional.of(clazz.cast(source()));
case "Destinations":
return Optional.of(clazz.cast(destinations()));
case "HasMoreDestinations":
return Optional.of(clazz.cast(hasMoreDestinations()));
default:
return Optional.empty();
}
}
@SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
DeliveryStreamDescriptionMarshaller.getInstance().marshall(this, protocolMarshaller);
}
public interface Builder extends CopyableBuilder {
/**
*
* The name of the delivery stream.
*
*
* @param deliveryStreamName
* The name of the delivery stream.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder deliveryStreamName(String deliveryStreamName);
/**
*
* The Amazon Resource Name (ARN) of the delivery stream.
*
*
* @param deliveryStreamARN
* The Amazon Resource Name (ARN) of the delivery stream.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder deliveryStreamARN(String deliveryStreamARN);
/**
*
* The status of the delivery stream.
*
*
* @param deliveryStreamStatus
* The status of the delivery stream.
* @see DeliveryStreamStatus
* @return Returns a reference to this object so that method calls can be chained together.
* @see DeliveryStreamStatus
*/
Builder deliveryStreamStatus(String deliveryStreamStatus);
/**
*
* The status of the delivery stream.
*
*
* @param deliveryStreamStatus
* The status of the delivery stream.
* @see DeliveryStreamStatus
* @return Returns a reference to this object so that method calls can be chained together.
* @see DeliveryStreamStatus
*/
Builder deliveryStreamStatus(DeliveryStreamStatus deliveryStreamStatus);
/**
*
* 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 stream as a source.
*
*
*
*
* @param 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 stream as a source.
*
*
* @see DeliveryStreamType
* @return Returns a reference to this object so that method calls can be chained together.
* @see DeliveryStreamType
*/
Builder deliveryStreamType(String 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 stream as a source.
*
*
*
*
* @param 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 stream as a source.
*
*
* @see DeliveryStreamType
* @return Returns a reference to this object so that method calls can be chained together.
* @see DeliveryStreamType
*/
Builder deliveryStreamType(DeliveryStreamType 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.
*
*
* @param versionId
* 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 Returns a reference to this object so that method calls can be chained together.
*/
Builder versionId(String versionId);
/**
*
* The date and time that the delivery stream was created.
*
*
* @param createTimestamp
* The date and time that the delivery stream was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder createTimestamp(Instant createTimestamp);
/**
*
* The date and time that the delivery stream was last updated.
*
*
* @param lastUpdateTimestamp
* The date and time that the delivery stream was last updated.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder lastUpdateTimestamp(Instant lastUpdateTimestamp);
/**
*
* If the DeliveryStreamType
parameter is KinesisStreamAsSource
, a
* SourceDescription object describing the source Kinesis stream.
*
*
* @param source
* If the DeliveryStreamType
parameter is KinesisStreamAsSource
, a
* SourceDescription object describing the source Kinesis stream.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder source(SourceDescription source);
/**
*
* If the DeliveryStreamType
parameter is KinesisStreamAsSource
, a
* SourceDescription object describing the source Kinesis stream.
*
* This is a convenience that creates an instance of the {@link SourceDescription.Builder} avoiding the need to
* create one manually via {@link SourceDescription#builder()}.
*
* When the {@link Consumer} completes, {@link SourceDescription.Builder#build()} is called immediately and its
* result is passed to {@link #source(SourceDescription)}.
*
* @param source
* a consumer that will call methods on {@link SourceDescription.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #source(SourceDescription)
*/
default Builder source(Consumer source) {
return source(SourceDescription.builder().apply(source).build());
}
/**
*
* The destinations.
*
*
* @param destinations
* The destinations.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder destinations(Collection destinations);
/**
*
* The destinations.
*
*
* @param destinations
* The destinations.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder destinations(DestinationDescription... destinations);
/**
*
* Indicates whether there are more destinations available to list.
*
*
* @param hasMoreDestinations
* Indicates whether there are more destinations available to list.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder hasMoreDestinations(Boolean hasMoreDestinations);
}
static final class BuilderImpl implements Builder {
private String deliveryStreamName;
private String deliveryStreamARN;
private String deliveryStreamStatus;
private String deliveryStreamType;
private String versionId;
private Instant createTimestamp;
private Instant lastUpdateTimestamp;
private SourceDescription source;
private List destinations;
private Boolean hasMoreDestinations;
private BuilderImpl() {
}
private BuilderImpl(DeliveryStreamDescription model) {
deliveryStreamName(model.deliveryStreamName);
deliveryStreamARN(model.deliveryStreamARN);
deliveryStreamStatus(model.deliveryStreamStatus);
deliveryStreamType(model.deliveryStreamType);
versionId(model.versionId);
createTimestamp(model.createTimestamp);
lastUpdateTimestamp(model.lastUpdateTimestamp);
source(model.source);
destinations(model.destinations);
hasMoreDestinations(model.hasMoreDestinations);
}
public final String getDeliveryStreamName() {
return deliveryStreamName;
}
@Override
public final Builder deliveryStreamName(String deliveryStreamName) {
this.deliveryStreamName = deliveryStreamName;
return this;
}
public final void setDeliveryStreamName(String deliveryStreamName) {
this.deliveryStreamName = deliveryStreamName;
}
public final String getDeliveryStreamARN() {
return deliveryStreamARN;
}
@Override
public final Builder deliveryStreamARN(String deliveryStreamARN) {
this.deliveryStreamARN = deliveryStreamARN;
return this;
}
public final void setDeliveryStreamARN(String deliveryStreamARN) {
this.deliveryStreamARN = deliveryStreamARN;
}
public final String getDeliveryStreamStatus() {
return deliveryStreamStatus;
}
@Override
public final Builder deliveryStreamStatus(String deliveryStreamStatus) {
this.deliveryStreamStatus = deliveryStreamStatus;
return this;
}
@Override
public final Builder deliveryStreamStatus(DeliveryStreamStatus deliveryStreamStatus) {
this.deliveryStreamStatus(deliveryStreamStatus.toString());
return this;
}
public final void setDeliveryStreamStatus(String deliveryStreamStatus) {
this.deliveryStreamStatus = deliveryStreamStatus;
}
public final String getDeliveryStreamType() {
return deliveryStreamType;
}
@Override
public final Builder deliveryStreamType(String deliveryStreamType) {
this.deliveryStreamType = deliveryStreamType;
return this;
}
@Override
public final Builder deliveryStreamType(DeliveryStreamType deliveryStreamType) {
this.deliveryStreamType(deliveryStreamType.toString());
return this;
}
public final void setDeliveryStreamType(String deliveryStreamType) {
this.deliveryStreamType = deliveryStreamType;
}
public final String getVersionId() {
return versionId;
}
@Override
public final Builder versionId(String versionId) {
this.versionId = versionId;
return this;
}
public final void setVersionId(String versionId) {
this.versionId = versionId;
}
public final Instant getCreateTimestamp() {
return createTimestamp;
}
@Override
public final Builder createTimestamp(Instant createTimestamp) {
this.createTimestamp = createTimestamp;
return this;
}
public final void setCreateTimestamp(Instant createTimestamp) {
this.createTimestamp = createTimestamp;
}
public final Instant getLastUpdateTimestamp() {
return lastUpdateTimestamp;
}
@Override
public final Builder lastUpdateTimestamp(Instant lastUpdateTimestamp) {
this.lastUpdateTimestamp = lastUpdateTimestamp;
return this;
}
public final void setLastUpdateTimestamp(Instant lastUpdateTimestamp) {
this.lastUpdateTimestamp = lastUpdateTimestamp;
}
public final SourceDescription.Builder getSource() {
return source != null ? source.toBuilder() : null;
}
@Override
public final Builder source(SourceDescription source) {
this.source = source;
return this;
}
public final void setSource(SourceDescription.BuilderImpl source) {
this.source = source != null ? source.build() : null;
}
public final Collection getDestinations() {
return destinations != null ? destinations.stream().map(DestinationDescription::toBuilder)
.collect(Collectors.toList()) : null;
}
@Override
public final Builder destinations(Collection destinations) {
this.destinations = DestinationDescriptionListCopier.copy(destinations);
return this;
}
@Override
@SafeVarargs
public final Builder destinations(DestinationDescription... destinations) {
destinations(Arrays.asList(destinations));
return this;
}
public final void setDestinations(Collection destinations) {
this.destinations = DestinationDescriptionListCopier.copyFromBuilder(destinations);
}
public final Boolean getHasMoreDestinations() {
return hasMoreDestinations;
}
@Override
public final Builder hasMoreDestinations(Boolean hasMoreDestinations) {
this.hasMoreDestinations = hasMoreDestinations;
return this;
}
public final void setHasMoreDestinations(Boolean hasMoreDestinations) {
this.hasMoreDestinations = hasMoreDestinations;
}
@Override
public DeliveryStreamDescription build() {
return new DeliveryStreamDescription(this);
}
}
}