smithy4s.com.amazonaws.kinesis.Record.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 unit of data of the Kinesis data stream, which is composed of a sequence number, a
* partition key, and a data blob.
* @param ApproximateArrivalTimestamp
* The approximate time that the record was inserted into the stream.
* @param PartitionKey
* Identifies which shard in the stream the data record is assigned to.
* @param SequenceNumber
* The unique identifier of the record within its shard.
* @param Data
* The data blob. The data in the blob is both opaque and immutable to Kinesis Data
* Streams, which does not inspect, interpret, or change the data in the blob in any way.
* 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 EncryptionType
* The encryption type used on the record. This parameter can be one of the following
* values:
*
* -
*
* NONE
: Do not encrypt the records in the stream.
*
* -
*
* KMS
: Use server-side encryption on the records in the stream
* using a customer-managed Amazon Web Services KMS key.
*
*
*/
final case class Record(sequenceNumber: SequenceNumber, data: Data, partitionKey: PartitionKey, approximateArrivalTimestamp: Option[Timestamp] = None, encryptionType: Option[EncryptionType] = None)
object Record extends ShapeTag.Companion[Record] {
val id: ShapeId = ShapeId("com.amazonaws.kinesis", "Record")
val hints: Hints = Hints(
smithy.api.Documentation("The unit of data of the Kinesis data stream, which is composed of a sequence number, a\n partition key, and a data blob.
"),
).lazily
// constructor using the original order from the spec
private def make(sequenceNumber: SequenceNumber, approximateArrivalTimestamp: Option[Timestamp], data: Data, partitionKey: PartitionKey, encryptionType: Option[EncryptionType]): Record = Record(sequenceNumber, data, partitionKey, approximateArrivalTimestamp, encryptionType)
implicit val schema: Schema[Record] = struct(
SequenceNumber.schema.required[Record]("SequenceNumber", _.sequenceNumber).addHints(smithy.api.Documentation("The unique identifier of the record within its shard.
")),
timestamp.optional[Record]("ApproximateArrivalTimestamp", _.approximateArrivalTimestamp).addHints(smithy.api.Documentation("The approximate time that the record was inserted into the stream.
")),
Data.schema.required[Record]("Data", _.data).addHints(smithy.api.Documentation("The data blob. The data in the blob is both opaque and immutable to Kinesis Data\n Streams, which does not inspect, interpret, or change the data in the blob in any way.\n When the data blob (the payload before base64-encoding) is added to the partition key\n size, the total size must not exceed the maximum record size (1 MiB).
")),
PartitionKey.schema.required[Record]("PartitionKey", _.partitionKey).addHints(smithy.api.Documentation("Identifies which shard in the stream the data record is assigned to.
")),
EncryptionType.schema.optional[Record]("EncryptionType", _.encryptionType).addHints(smithy.api.Documentation("The encryption type used on the record. This parameter can be one of the following\n values:
\n \n - \n
\n NONE
: Do not encrypt the records in the stream.
\n \n - \n
\n KMS
: Use server-side encryption on the records in the stream\n using a customer-managed Amazon Web Services KMS key.
\n \n
")),
)(make).withId(id).addHints(hints)
}