com.amazonaws.services.kinesis.model.ShardFilter Maven / Gradle / Ivy
Show all versions of aws-java-sdk-kinesis Show documentation
/*
* Copyright 2017-2022 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 com.amazonaws.services.kinesis.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* The request parameter used to filter out the response of the ListShards
API.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ShardFilter implements Serializable, Cloneable, StructuredPojo {
/**
*
* The shard type specified in the ShardFilter
parameter. This is a required property of the
* ShardFilter
parameter.
*
*
* You can specify the following valid values:
*
*
* -
*
* AFTER_SHARD_ID
- the response includes all the shards, starting with the shard whose ID immediately
* follows the ShardId
that you provided.
*
*
* -
*
* AT_TRIM_HORIZON
- the response includes all the shards that were open at TRIM_HORIZON
.
*
*
* -
*
* FROM_TRIM_HORIZON
- (default), the response includes all the shards within the retention period of
* the data stream (trim to tip).
*
*
* -
*
* AT_LATEST
- the response includes only the currently open shards of the data stream.
*
*
* -
*
* AT_TIMESTAMP
- the response includes all shards whose start timestamp is less than or equal to the
* given timestamp and end timestamp is greater than or equal to the given timestamp or still open.
*
*
* -
*
* FROM_TIMESTAMP
- the response incldues all closed shards whose end timestamp is greater than or
* equal to the given timestamp and also all open shards. Corrected to TRIM_HORIZON
of the data stream
* if FROM_TIMESTAMP
is less than the TRIM_HORIZON
value.
*
*
*
*/
private String type;
/**
*
* The exclusive start shardID
speified in the ShardFilter
parameter. This property can
* only be used if the AFTER_SHARD_ID
shard type is specified.
*
*/
private String shardId;
/**
*
* The timestamps specified in the ShardFilter
parameter. A timestamp is a Unix epoch date with
* precision in milliseconds. For example, 2016-04-04T19:58:46.480-00:00 or 1459799926.480. This property can only
* be used if FROM_TIMESTAMP
or AT_TIMESTAMP
shard types are specified.
*
*/
private java.util.Date timestamp;
/**
*
* The shard type specified in the ShardFilter
parameter. This is a required property of the
* ShardFilter
parameter.
*
*
* You can specify the following valid values:
*
*
* -
*
* AFTER_SHARD_ID
- the response includes all the shards, starting with the shard whose ID immediately
* follows the ShardId
that you provided.
*
*
* -
*
* AT_TRIM_HORIZON
- the response includes all the shards that were open at TRIM_HORIZON
.
*
*
* -
*
* FROM_TRIM_HORIZON
- (default), the response includes all the shards within the retention period of
* the data stream (trim to tip).
*
*
* -
*
* AT_LATEST
- the response includes only the currently open shards of the data stream.
*
*
* -
*
* AT_TIMESTAMP
- the response includes all shards whose start timestamp is less than or equal to the
* given timestamp and end timestamp is greater than or equal to the given timestamp or still open.
*
*
* -
*
* FROM_TIMESTAMP
- the response incldues all closed shards whose end timestamp is greater than or
* equal to the given timestamp and also all open shards. Corrected to TRIM_HORIZON
of the data stream
* if FROM_TIMESTAMP
is less than the TRIM_HORIZON
value.
*
*
*
*
* @param type
* The shard type specified in the ShardFilter
parameter. This is a required property of the
* ShardFilter
parameter.
*
* You can specify the following valid values:
*
*
* -
*
* AFTER_SHARD_ID
- the response includes all the shards, starting with the shard whose ID
* immediately follows the ShardId
that you provided.
*
*
* -
*
* AT_TRIM_HORIZON
- the response includes all the shards that were open at
* TRIM_HORIZON
.
*
*
* -
*
* FROM_TRIM_HORIZON
- (default), the response includes all the shards within the retention
* period of the data stream (trim to tip).
*
*
* -
*
* AT_LATEST
- the response includes only the currently open shards of the data stream.
*
*
* -
*
* AT_TIMESTAMP
- the response includes all shards whose start timestamp is less than or equal
* to the given timestamp and end timestamp is greater than or equal to the given timestamp or still open.
*
*
* -
*
* FROM_TIMESTAMP
- the response incldues all closed shards whose end timestamp is greater than
* or equal to the given timestamp and also all open shards. Corrected to TRIM_HORIZON
of the
* data stream if FROM_TIMESTAMP
is less than the TRIM_HORIZON
value.
*
*
* @see ShardFilterType
*/
public void setType(String type) {
this.type = type;
}
/**
*
* The shard type specified in the ShardFilter
parameter. This is a required property of the
* ShardFilter
parameter.
*
*
* You can specify the following valid values:
*
*
* -
*
* AFTER_SHARD_ID
- the response includes all the shards, starting with the shard whose ID immediately
* follows the ShardId
that you provided.
*
*
* -
*
* AT_TRIM_HORIZON
- the response includes all the shards that were open at TRIM_HORIZON
.
*
*
* -
*
* FROM_TRIM_HORIZON
- (default), the response includes all the shards within the retention period of
* the data stream (trim to tip).
*
*
* -
*
* AT_LATEST
- the response includes only the currently open shards of the data stream.
*
*
* -
*
* AT_TIMESTAMP
- the response includes all shards whose start timestamp is less than or equal to the
* given timestamp and end timestamp is greater than or equal to the given timestamp or still open.
*
*
* -
*
* FROM_TIMESTAMP
- the response incldues all closed shards whose end timestamp is greater than or
* equal to the given timestamp and also all open shards. Corrected to TRIM_HORIZON
of the data stream
* if FROM_TIMESTAMP
is less than the TRIM_HORIZON
value.
*
*
*
*
* @return The shard type specified in the ShardFilter
parameter. This is a required property of the
* ShardFilter
parameter.
*
* You can specify the following valid values:
*
*
* -
*
* AFTER_SHARD_ID
- the response includes all the shards, starting with the shard whose ID
* immediately follows the ShardId
that you provided.
*
*
* -
*
* AT_TRIM_HORIZON
- the response includes all the shards that were open at
* TRIM_HORIZON
.
*
*
* -
*
* FROM_TRIM_HORIZON
- (default), the response includes all the shards within the retention
* period of the data stream (trim to tip).
*
*
* -
*
* AT_LATEST
- the response includes only the currently open shards of the data stream.
*
*
* -
*
* AT_TIMESTAMP
- the response includes all shards whose start timestamp is less than or equal
* to the given timestamp and end timestamp is greater than or equal to the given timestamp or still open.
*
*
* -
*
* FROM_TIMESTAMP
- the response incldues all closed shards whose end timestamp is greater than
* or equal to the given timestamp and also all open shards. Corrected to TRIM_HORIZON
of the
* data stream if FROM_TIMESTAMP
is less than the TRIM_HORIZON
value.
*
*
* @see ShardFilterType
*/
public String getType() {
return this.type;
}
/**
*
* The shard type specified in the ShardFilter
parameter. This is a required property of the
* ShardFilter
parameter.
*
*
* You can specify the following valid values:
*
*
* -
*
* AFTER_SHARD_ID
- the response includes all the shards, starting with the shard whose ID immediately
* follows the ShardId
that you provided.
*
*
* -
*
* AT_TRIM_HORIZON
- the response includes all the shards that were open at TRIM_HORIZON
.
*
*
* -
*
* FROM_TRIM_HORIZON
- (default), the response includes all the shards within the retention period of
* the data stream (trim to tip).
*
*
* -
*
* AT_LATEST
- the response includes only the currently open shards of the data stream.
*
*
* -
*
* AT_TIMESTAMP
- the response includes all shards whose start timestamp is less than or equal to the
* given timestamp and end timestamp is greater than or equal to the given timestamp or still open.
*
*
* -
*
* FROM_TIMESTAMP
- the response incldues all closed shards whose end timestamp is greater than or
* equal to the given timestamp and also all open shards. Corrected to TRIM_HORIZON
of the data stream
* if FROM_TIMESTAMP
is less than the TRIM_HORIZON
value.
*
*
*
*
* @param type
* The shard type specified in the ShardFilter
parameter. This is a required property of the
* ShardFilter
parameter.
*
* You can specify the following valid values:
*
*
* -
*
* AFTER_SHARD_ID
- the response includes all the shards, starting with the shard whose ID
* immediately follows the ShardId
that you provided.
*
*
* -
*
* AT_TRIM_HORIZON
- the response includes all the shards that were open at
* TRIM_HORIZON
.
*
*
* -
*
* FROM_TRIM_HORIZON
- (default), the response includes all the shards within the retention
* period of the data stream (trim to tip).
*
*
* -
*
* AT_LATEST
- the response includes only the currently open shards of the data stream.
*
*
* -
*
* AT_TIMESTAMP
- the response includes all shards whose start timestamp is less than or equal
* to the given timestamp and end timestamp is greater than or equal to the given timestamp or still open.
*
*
* -
*
* FROM_TIMESTAMP
- the response incldues all closed shards whose end timestamp is greater than
* or equal to the given timestamp and also all open shards. Corrected to TRIM_HORIZON
of the
* data stream if FROM_TIMESTAMP
is less than the TRIM_HORIZON
value.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see ShardFilterType
*/
public ShardFilter withType(String type) {
setType(type);
return this;
}
/**
*
* The shard type specified in the ShardFilter
parameter. This is a required property of the
* ShardFilter
parameter.
*
*
* You can specify the following valid values:
*
*
* -
*
* AFTER_SHARD_ID
- the response includes all the shards, starting with the shard whose ID immediately
* follows the ShardId
that you provided.
*
*
* -
*
* AT_TRIM_HORIZON
- the response includes all the shards that were open at TRIM_HORIZON
.
*
*
* -
*
* FROM_TRIM_HORIZON
- (default), the response includes all the shards within the retention period of
* the data stream (trim to tip).
*
*
* -
*
* AT_LATEST
- the response includes only the currently open shards of the data stream.
*
*
* -
*
* AT_TIMESTAMP
- the response includes all shards whose start timestamp is less than or equal to the
* given timestamp and end timestamp is greater than or equal to the given timestamp or still open.
*
*
* -
*
* FROM_TIMESTAMP
- the response incldues all closed shards whose end timestamp is greater than or
* equal to the given timestamp and also all open shards. Corrected to TRIM_HORIZON
of the data stream
* if FROM_TIMESTAMP
is less than the TRIM_HORIZON
value.
*
*
*
*
* @param type
* The shard type specified in the ShardFilter
parameter. This is a required property of the
* ShardFilter
parameter.
*
* You can specify the following valid values:
*
*
* -
*
* AFTER_SHARD_ID
- the response includes all the shards, starting with the shard whose ID
* immediately follows the ShardId
that you provided.
*
*
* -
*
* AT_TRIM_HORIZON
- the response includes all the shards that were open at
* TRIM_HORIZON
.
*
*
* -
*
* FROM_TRIM_HORIZON
- (default), the response includes all the shards within the retention
* period of the data stream (trim to tip).
*
*
* -
*
* AT_LATEST
- the response includes only the currently open shards of the data stream.
*
*
* -
*
* AT_TIMESTAMP
- the response includes all shards whose start timestamp is less than or equal
* to the given timestamp and end timestamp is greater than or equal to the given timestamp or still open.
*
*
* -
*
* FROM_TIMESTAMP
- the response incldues all closed shards whose end timestamp is greater than
* or equal to the given timestamp and also all open shards. Corrected to TRIM_HORIZON
of the
* data stream if FROM_TIMESTAMP
is less than the TRIM_HORIZON
value.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see ShardFilterType
*/
public ShardFilter withType(ShardFilterType type) {
this.type = type.toString();
return this;
}
/**
*
* The exclusive start shardID
speified in the ShardFilter
parameter. This property can
* only be used if the AFTER_SHARD_ID
shard type is specified.
*
*
* @param shardId
* The exclusive start shardID
speified in the ShardFilter
parameter. This property
* can only be used if the AFTER_SHARD_ID
shard type is specified.
*/
public void setShardId(String shardId) {
this.shardId = shardId;
}
/**
*
* The exclusive start shardID
speified in the ShardFilter
parameter. This property can
* only be used if the AFTER_SHARD_ID
shard type is specified.
*
*
* @return The exclusive start shardID
speified in the ShardFilter
parameter. This
* property can only be used if the AFTER_SHARD_ID
shard type is specified.
*/
public String getShardId() {
return this.shardId;
}
/**
*
* The exclusive start shardID
speified in the ShardFilter
parameter. This property can
* only be used if the AFTER_SHARD_ID
shard type is specified.
*
*
* @param shardId
* The exclusive start shardID
speified in the ShardFilter
parameter. This property
* can only be used if the AFTER_SHARD_ID
shard type is specified.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ShardFilter withShardId(String shardId) {
setShardId(shardId);
return this;
}
/**
*
* The timestamps specified in the ShardFilter
parameter. A timestamp is a Unix epoch date with
* precision in milliseconds. For example, 2016-04-04T19:58:46.480-00:00 or 1459799926.480. This property can only
* be used if FROM_TIMESTAMP
or AT_TIMESTAMP
shard types are specified.
*
*
* @param timestamp
* The timestamps specified in the ShardFilter
parameter. A timestamp is a Unix epoch date with
* precision in milliseconds. For example, 2016-04-04T19:58:46.480-00:00 or 1459799926.480. This property can
* only be used if FROM_TIMESTAMP
or AT_TIMESTAMP
shard types are specified.
*/
public void setTimestamp(java.util.Date timestamp) {
this.timestamp = timestamp;
}
/**
*
* The timestamps specified in the ShardFilter
parameter. A timestamp is a Unix epoch date with
* precision in milliseconds. For example, 2016-04-04T19:58:46.480-00:00 or 1459799926.480. This property can only
* be used if FROM_TIMESTAMP
or AT_TIMESTAMP
shard types are specified.
*
*
* @return The timestamps specified in the ShardFilter
parameter. A timestamp is a Unix epoch date with
* precision in milliseconds. For example, 2016-04-04T19:58:46.480-00:00 or 1459799926.480. This property
* can only be used if FROM_TIMESTAMP
or AT_TIMESTAMP
shard types are specified.
*/
public java.util.Date getTimestamp() {
return this.timestamp;
}
/**
*
* The timestamps specified in the ShardFilter
parameter. A timestamp is a Unix epoch date with
* precision in milliseconds. For example, 2016-04-04T19:58:46.480-00:00 or 1459799926.480. This property can only
* be used if FROM_TIMESTAMP
or AT_TIMESTAMP
shard types are specified.
*
*
* @param timestamp
* The timestamps specified in the ShardFilter
parameter. A timestamp is a Unix epoch date with
* precision in milliseconds. For example, 2016-04-04T19:58:46.480-00:00 or 1459799926.480. This property can
* only be used if FROM_TIMESTAMP
or AT_TIMESTAMP
shard types are specified.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ShardFilter withTimestamp(java.util.Date timestamp) {
setTimestamp(timestamp);
return this;
}
/**
* 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.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getType() != null)
sb.append("Type: ").append(getType()).append(",");
if (getShardId() != null)
sb.append("ShardId: ").append(getShardId()).append(",");
if (getTimestamp() != null)
sb.append("Timestamp: ").append(getTimestamp());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ShardFilter == false)
return false;
ShardFilter other = (ShardFilter) obj;
if (other.getType() == null ^ this.getType() == null)
return false;
if (other.getType() != null && other.getType().equals(this.getType()) == false)
return false;
if (other.getShardId() == null ^ this.getShardId() == null)
return false;
if (other.getShardId() != null && other.getShardId().equals(this.getShardId()) == false)
return false;
if (other.getTimestamp() == null ^ this.getTimestamp() == null)
return false;
if (other.getTimestamp() != null && other.getTimestamp().equals(this.getTimestamp()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode());
hashCode = prime * hashCode + ((getShardId() == null) ? 0 : getShardId().hashCode());
hashCode = prime * hashCode + ((getTimestamp() == null) ? 0 : getTimestamp().hashCode());
return hashCode;
}
@Override
public ShardFilter clone() {
try {
return (ShardFilter) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.kinesis.model.transform.ShardFilterMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}