From 22fe1c256c7e7ce1c8a5202b99d051cb660b57e0 Mon Sep 17 00:00:00 2001 From: TATSUNO Yasuhiro Date: Wed, 22 Dec 2021 09:24:27 +0900 Subject: [PATCH] [kinesis] Add FirehoseTransformationEvent.sourceKinesisStreamArn & FirehoseTransformationResultRecord.metadata --- .../kinesis_firehose_transformation.scala | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/main/scala/net/exoego/facade/aws_lambda/kinesis_firehose_transformation.scala b/src/main/scala/net/exoego/facade/aws_lambda/kinesis_firehose_transformation.scala index d449315..37fffff 100644 --- a/src/main/scala/net/exoego/facade/aws_lambda/kinesis_firehose_transformation.scala +++ b/src/main/scala/net/exoego/facade/aws_lambda/kinesis_firehose_transformation.scala @@ -6,6 +6,7 @@ import scala.scalajs.js trait FirehoseTransformationEvent extends js.Object { var invocationId: String = js.native var deliveryStreamArn: String = js.native + var sourceKinesisStreamArn: js.UndefOr[String] = js.native var region: String = js.native var records: js.Array[FirehoseTransformationEventRecord] = js.native } @@ -15,7 +16,8 @@ object FirehoseTransformationEvent { invocationId: String, deliveryStreamArn: String, region: String, - records: js.Array[FirehoseTransformationEventRecord] + records: js.Array[FirehoseTransformationEventRecord], + sourceKinesisStreamArn: js.UndefOr[String] = js.undefined ): FirehoseTransformationEvent = { val _obj$ = js.Dynamic.literal( "invocationId" -> invocationId.asInstanceOf[js.Any], @@ -23,6 +25,7 @@ object FirehoseTransformationEvent { "region" -> region.asInstanceOf[js.Any], "records" -> records.asInstanceOf[js.Any] ) + sourceKinesisStreamArn.foreach(_v => _obj$.updateDynamic("sourceKinesisStreamArn")(_v.asInstanceOf[js.Any])) _obj$.asInstanceOf[FirehoseTransformationEvent] } } @@ -80,24 +83,45 @@ object FirehoseRecordMetadata { } } +@js.native +trait FirehoseTransformationMetadata extends js.Object { + var partitionKeys: FirehoseTransformationMetadata.PartitionKeys = js.native +} + +object FirehoseTransformationMetadata { + type PartitionKeys = js.Dictionary[String] + + def apply( + partitionKeys: FirehoseTransformationMetadata.PartitionKeys + ): FirehoseTransformationMetadata = { + val _obj$ = js.Dynamic.literal( + "partitionKeys" -> partitionKeys.asInstanceOf[js.Any] + ) + _obj$.asInstanceOf[FirehoseTransformationMetadata] + } +} + @js.native trait FirehoseTransformationResultRecord extends js.Object { var recordId: String = js.native var result: literal.FirehoseRecordTransformationStatus = js.native var data: String = js.native + var metadata: js.UndefOr[FirehoseTransformationMetadata] = js.native } object FirehoseTransformationResultRecord { def apply( recordId: String, result: literal.FirehoseRecordTransformationStatus, - data: String + data: String, + metadata: js.UndefOr[FirehoseTransformationMetadata] = js.undefined ): FirehoseTransformationResultRecord = { val _obj$ = js.Dynamic.literal( "recordId" -> recordId.asInstanceOf[js.Any], "result" -> result.asInstanceOf[js.Any], "data" -> data.asInstanceOf[js.Any] ) + metadata.foreach(_v => _obj$.updateDynamic("metadata")(_v.asInstanceOf[js.Any])) _obj$.asInstanceOf[FirehoseTransformationResultRecord] } }