smithy4s.com.amazonaws.kinesis.StartingPosition.scala Maven / Gradle / Ivy
Show all versions of kinesis4cats-smithy4s-client_3 Show documentation
package com.amazonaws.kinesis
import smithy4s.Hints
import smithy4s.Schema
import smithy4s.ShapeId
import smithy4s.ShapeTag
import smithy4s.Timestamp
import smithy4s.schema.Schema.struct
import smithy4s.schema.Schema.timestamp
/** The starting position in the data stream from which to start streaming.
* @param Type
* You can set the starting position to one of the following values:
*
* AT_SEQUENCE_NUMBER
: Start streaming from the position denoted by the
* sequence number specified in the SequenceNumber
field.
*
* AFTER_SEQUENCE_NUMBER
: Start streaming right after the position denoted
* by the sequence number specified in the SequenceNumber
field.
*
* AT_TIMESTAMP
: Start streaming from the position denoted by the time stamp
* specified in the Timestamp
field.
*
* TRIM_HORIZON
: Start streaming at the last untrimmed record in the shard,
* which is the oldest data record in the shard.
*
* LATEST
: Start streaming just after the most recent record in the shard,
* so that you always read the most recent data in the shard.
* @param SequenceNumber
* The sequence number of the data record in the shard from which to start streaming. To
* specify a sequence number, set StartingPosition
to
* AT_SEQUENCE_NUMBER
or AFTER_SEQUENCE_NUMBER
.
* @param Timestamp
* The time stamp of the data record from which to start reading. To specify a time
* stamp, set StartingPosition
to Type AT_TIMESTAMP
. A time stamp
* is the Unix epoch date with precision in milliseconds. For example,
* 2016-04-04T19:58:46.480-00:00
or 1459799926.480
. If a
* record with this exact time stamp does not exist, records will be streamed from the next
* (later) record. If the time stamp is older than the current trim horizon, records will
* be streamed from the oldest untrimmed data record (TRIM_HORIZON
).
*/
final case class StartingPosition(_type: ShardIteratorType, sequenceNumber: Option[SequenceNumber] = None, timestamp: Option[Timestamp] = None)
object StartingPosition extends ShapeTag.Companion[StartingPosition] {
val id: ShapeId = ShapeId("com.amazonaws.kinesis", "StartingPosition")
val hints: Hints = Hints(
smithy.api.Documentation("The starting position in the data stream from which to start streaming.
"),
).lazily
// constructor using the original order from the spec
private def make(_type: ShardIteratorType, sequenceNumber: Option[SequenceNumber], timestamp: Option[Timestamp]): StartingPosition = StartingPosition(_type, sequenceNumber, timestamp)
implicit val schema: Schema[StartingPosition] = struct(
ShardIteratorType.schema.required[StartingPosition]("Type", _._type).addHints(smithy.api.Documentation("You can set the starting position to one of the following values:
\n \n AT_SEQUENCE_NUMBER
: Start streaming from the position denoted by the\n sequence number specified in the SequenceNumber
field.
\n \n AFTER_SEQUENCE_NUMBER
: Start streaming right after the position denoted\n by the sequence number specified in the SequenceNumber
field.
\n \n AT_TIMESTAMP
: Start streaming from the position denoted by the time stamp\n specified in the Timestamp
field.
\n \n TRIM_HORIZON
: Start streaming at the last untrimmed record in the shard,\n which is the oldest data record in the shard.
\n \n LATEST
: Start streaming just after the most recent record in the shard,\n so that you always read the most recent data in the shard.
")),
SequenceNumber.schema.optional[StartingPosition]("SequenceNumber", _.sequenceNumber).addHints(smithy.api.Documentation("The sequence number of the data record in the shard from which to start streaming. To\n specify a sequence number, set StartingPosition
to\n AT_SEQUENCE_NUMBER
or AFTER_SEQUENCE_NUMBER
.
")),
timestamp.optional[StartingPosition]("Timestamp", _.timestamp).addHints(smithy.api.Documentation("The time stamp of the data record from which to start reading. To specify a time\n stamp, set StartingPosition
to Type AT_TIMESTAMP
. A time stamp\n is the Unix epoch date with precision in milliseconds. For example,\n 2016-04-04T19:58:46.480-00:00
or 1459799926.480
. If a\n record with this exact time stamp does not exist, records will be streamed from the next\n (later) record. If the time stamp is older than the current trim horizon, records will\n be streamed from the oldest untrimmed data record (TRIM_HORIZON
).
")),
)(make).withId(id).addHints(hints)
}