smithy4s.com.amazonaws.kinesis.Shard.scala Maven / Gradle / Ivy
package com.amazonaws.kinesis
import smithy4s.Hints
import smithy4s.Schema
import smithy4s.ShapeId
import smithy4s.ShapeTag
import smithy4s.schema.Schema.struct
/** A uniquely identified group of data records in a Kinesis data stream.
* @param ParentShardId
* The shard ID of the shard's parent.
* @param AdjacentParentShardId
* The shard ID of the shard adjacent to the shard's parent.
* @param HashKeyRange
* The range of possible hash key values for the shard, which is a set of ordered
* contiguous positive integers.
* @param SequenceNumberRange
* The range of possible sequence numbers for the shard.
* @param ShardId
* The unique identifier of the shard within the stream.
*/
final case class Shard(shardId: ShardId, hashKeyRange: HashKeyRange, sequenceNumberRange: SequenceNumberRange, parentShardId: Option[ShardId] = None, adjacentParentShardId: Option[ShardId] = None)
object Shard extends ShapeTag.Companion[Shard] {
val id: ShapeId = ShapeId("com.amazonaws.kinesis", "Shard")
val hints: Hints = Hints(
smithy.api.Documentation("A uniquely identified group of data records in a Kinesis data stream.
"),
).lazily
// constructor using the original order from the spec
private def make(shardId: ShardId, parentShardId: Option[ShardId], adjacentParentShardId: Option[ShardId], hashKeyRange: HashKeyRange, sequenceNumberRange: SequenceNumberRange): Shard = Shard(shardId, hashKeyRange, sequenceNumberRange, parentShardId, adjacentParentShardId)
implicit val schema: Schema[Shard] = struct(
ShardId.schema.required[Shard]("ShardId", _.shardId).addHints(smithy.api.Documentation("The unique identifier of the shard within the stream.
")),
ShardId.schema.optional[Shard]("ParentShardId", _.parentShardId).addHints(smithy.api.Documentation("The shard ID of the shard\'s parent.
")),
ShardId.schema.optional[Shard]("AdjacentParentShardId", _.adjacentParentShardId).addHints(smithy.api.Documentation("The shard ID of the shard adjacent to the shard\'s parent.
")),
HashKeyRange.schema.required[Shard]("HashKeyRange", _.hashKeyRange).addHints(smithy.api.Documentation("The range of possible hash key values for the shard, which is a set of ordered\n contiguous positive integers.
")),
SequenceNumberRange.schema.required[Shard]("SequenceNumberRange", _.sequenceNumberRange).addHints(smithy.api.Documentation("The range of possible sequence numbers for the shard.
")),
)(make).withId(id).addHints(hints)
}