File tree 3 files changed +37
-3
lines changed
src/Amazon.Lambda.KinesisFirehoseEvents 3 files changed +37
-3
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,16 @@ public class FirehoseRecord
92
92
#endif
93
93
public string Base64EncodedData { get ; set ; }
94
94
95
+ /// <summary>
96
+ /// The response record metadata.
97
+ /// </summary>
98
+ [ DataMember ( Name = "metadata" ) ]
99
+ #if NETCOREAPP_3_1
100
+ [ System . Text . Json . Serialization . JsonPropertyName ( "metadata" ) ]
101
+ #endif
102
+ public FirehoseResponseRecordMetadata Metadata { get ; set ; }
103
+
104
+
95
105
/// <summary>
96
106
/// Base64 encodes the data and sets the Base64EncodedData property.
97
107
/// </summary>
@@ -101,5 +111,22 @@ public void EncodeData(string data)
101
111
this . Base64EncodedData = Convert . ToBase64String ( Encoding . UTF8 . GetBytes ( data ) ) ;
102
112
}
103
113
}
114
+
115
+ /// <summary>
116
+ /// The response record metadata after processing KinesisFirehoseEvent.Records
117
+ /// </summary>
118
+ [ DataContract ]
119
+ public class FirehoseResponseRecordMetadata
120
+ {
121
+ /// <summary>
122
+ /// Key Value pairs used for Dynamic Partitioning
123
+ /// https://docs.aws.amazon.com/firehose/latest/dev/dynamic-partitioning.html
124
+ /// </summary>
125
+ [ DataMember ( Name = "partitionKeys" ) ]
126
+ #if NETCOREAPP_3_1
127
+ [ System . Text . Json . Serialization . JsonPropertyName ( "partitionKeys" ) ]
128
+ #endif
129
+ public Dictionary < string , string > PartitionKeys { get ; set ; }
130
+ }
104
131
}
105
132
}
Original file line number Diff line number Diff line change @@ -1559,7 +1559,8 @@ public void KinesisFirehoseResponseTest(Type serializerType)
1559
1559
Assert . Equal ( "49572672223665514422805246926656954630972486059535892482" , kinesisResponse . Records [ 0 ] . RecordId ) ;
1560
1560
Assert . Equal ( KinesisFirehoseResponse . TRANSFORMED_STATE_OK , kinesisResponse . Records [ 0 ] . Result ) ;
1561
1561
Assert . Equal ( "SEVMTE8gV09STEQ=" , kinesisResponse . Records [ 0 ] . Base64EncodedData ) ;
1562
-
1562
+ Assert . Equal ( "iamValue1" , kinesisResponse . Records [ 0 ] . Metadata . PartitionKeys [ "iamKey1" ] ) ;
1563
+ Assert . Equal ( "iamValue2" , kinesisResponse . Records [ 0 ] . Metadata . PartitionKeys [ "iamKey2" ] ) ;
1563
1564
1564
1565
1565
1566
MemoryStream ms = new MemoryStream ( ) ;
Original file line number Diff line number Diff line change 3
3
{
4
4
"recordId" : " 49572672223665514422805246926656954630972486059535892482" ,
5
5
"result" : " Ok" ,
6
- "data" : " SEVMTE8gV09STEQ="
6
+ "data" : " SEVMTE8gV09STEQ=" ,
7
+ "metadata" : {
8
+ "partitionKeys" : {
9
+ "iamKey1" : " iamValue1" ,
10
+ "iamKey2" : " iamValue2"
11
+ }
12
+ }
7
13
}
8
14
]
9
- }
15
+ }
You can’t perform that action at this time.
0 commit comments