smithy4s.com.amazonaws.kinesis.PutRecordsRequestEntry.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.schema.Schema.struct
/** Represents the output for PutRecords
.
* @param Data
* The data blob to put into the record, which is base64-encoded when the blob is
* serialized. When the data blob (the payload before base64-encoding) is added to the
* partition key size, the total size must not exceed the maximum record size (1
* MiB).
* @param ExplicitHashKey
* The hash value used to determine explicitly the shard that the data record is assigned
* to by overriding the partition key hash.
* @param PartitionKey
* Determines which shard in the stream the data record is assigned to. Partition keys
* are Unicode strings with a maximum length limit of 256 characters for each key. Amazon
* Kinesis Data Streams uses the partition key as input to a hash function that maps the
* partition key and associated data to a specific shard. Specifically, an MD5 hash
* function is used to map partition keys to 128-bit integer values and to map associated
* data records to shards. As a result of this hashing mechanism, all data records with the
* same partition key map to the same shard within the stream.
*/
final case class PutRecordsRequestEntry(data: Data, partitionKey: PartitionKey, explicitHashKey: Option[HashKey] = None)
object PutRecordsRequestEntry extends ShapeTag.Companion[PutRecordsRequestEntry] {
val id: ShapeId = ShapeId("com.amazonaws.kinesis", "PutRecordsRequestEntry")
val hints: Hints = Hints(
smithy.api.Documentation("Represents the output for PutRecords
.
"),
).lazily
// constructor using the original order from the spec
private def make(data: Data, explicitHashKey: Option[HashKey], partitionKey: PartitionKey): PutRecordsRequestEntry = PutRecordsRequestEntry(data, partitionKey, explicitHashKey)
implicit val schema: Schema[PutRecordsRequestEntry] = struct(
Data.schema.required[PutRecordsRequestEntry]("Data", _.data).addHints(smithy.api.Documentation("The data blob to put into the record, which is base64-encoded when the blob is\n serialized. When the data blob (the payload before base64-encoding) is added to the\n partition key size, the total size must not exceed the maximum record size (1\n MiB).
")),
HashKey.schema.optional[PutRecordsRequestEntry]("ExplicitHashKey", _.explicitHashKey).addHints(smithy.api.Documentation("The hash value used to determine explicitly the shard that the data record is assigned\n to by overriding the partition key hash.
")),
PartitionKey.schema.required[PutRecordsRequestEntry]("PartitionKey", _.partitionKey).addHints(smithy.api.Documentation("Determines which shard in the stream the data record is assigned to. Partition keys\n are Unicode strings with a maximum length limit of 256 characters for each key. Amazon\n Kinesis Data Streams uses the partition key as input to a hash function that maps the\n partition key and associated data to a specific shard. Specifically, an MD5 hash\n function is used to map partition keys to 128-bit integer values and to map associated\n data records to shards. As a result of this hashing mechanism, all data records with the\n same partition key map to the same shard within the stream.
")),
)(make).withId(id).addHints(hints)
}