Skip to content

Commit dec54e5

Browse files
committed
Include Kinesis Analytics Events
1 parent 43a167f commit dec54e5

14 files changed

+724
-1
lines changed

Libraries/Libraries.sln

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 15
4-
VisualStudioVersion = 15.0.26510.0
4+
VisualStudioVersion = 15.0.27130.2027
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{AAB54E74-20B1-42ED-BC3D-CE9F7BC7FD12}"
77
EndProject
@@ -75,6 +75,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StateMachineDefinitionStrin
7575
EndProject
7676
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Amazon.Lambda.CloudWatchLogsEvents", "src\Amazon.Lambda.CloudWatchLogsEvents\Amazon.Lambda.CloudWatchLogsEvents.csproj", "{32827626-2128-49A0-A2A9-2F5076AADDAD}"
7777
EndProject
78+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Amazon.Lambda.KinesisAnalyticsEvents", "src\Amazon.Lambda.KinesisAnalyticsEvents\Amazon.Lambda.KinesisAnalyticsEvents.csproj", "{EAC0F95B-B43A-49EB-A6DF-D0353DAD4593}"
79+
EndProject
7880
Global
7981
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8082
Debug|Any CPU = Debug|Any CPU
@@ -201,6 +203,10 @@ Global
201203
{32827626-2128-49A0-A2A9-2F5076AADDAD}.Debug|Any CPU.Build.0 = Debug|Any CPU
202204
{32827626-2128-49A0-A2A9-2F5076AADDAD}.Release|Any CPU.ActiveCfg = Release|Any CPU
203205
{32827626-2128-49A0-A2A9-2F5076AADDAD}.Release|Any CPU.Build.0 = Release|Any CPU
206+
{EAC0F95B-B43A-49EB-A6DF-D0353DAD4593}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
207+
{EAC0F95B-B43A-49EB-A6DF-D0353DAD4593}.Debug|Any CPU.Build.0 = Debug|Any CPU
208+
{EAC0F95B-B43A-49EB-A6DF-D0353DAD4593}.Release|Any CPU.ActiveCfg = Release|Any CPU
209+
{EAC0F95B-B43A-49EB-A6DF-D0353DAD4593}.Release|Any CPU.Build.0 = Release|Any CPU
204210
EndGlobalSection
205211
GlobalSection(SolutionProperties) = preSolution
206212
HideSolutionNode = FALSE
@@ -239,6 +245,7 @@ Global
239245
{EE7F2FF6-2C90-465C-AF91-153090863D4E} = {1DE4EE60-45BA-4EF7-BE00-B9EB861E4C69}
240246
{D25486BF-E79F-4DFF-AEA4-D91ABFF71039} = {EE7F2FF6-2C90-465C-AF91-153090863D4E}
241247
{32827626-2128-49A0-A2A9-2F5076AADDAD} = {AAB54E74-20B1-42ED-BC3D-CE9F7BC7FD12}
248+
{EAC0F95B-B43A-49EB-A6DF-D0353DAD4593} = {AAB54E74-20B1-42ED-BC3D-CE9F7BC7FD12}
242249
EndGlobalSection
243250
GlobalSection(ExtensibilityGlobals) = postSolution
244251
SolutionGuid = {503678A4-B8D1-4486-8915-405A3E9CF0EB}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
2+
3+
<Import Project="..\..\..\buildtools\common.props" />
4+
5+
<PropertyGroup>
6+
<TargetFramework>netstandard1.3</TargetFramework>
7+
<NetStandardImplicitPackageVersion>1.6.0</NetStandardImplicitPackageVersion>
8+
<Description>Amazon Lambda .NET Core support - Amazon Kinesis Analytics package.</Description>
9+
<AssemblyTitle>Amazon.Lambda.KinesisAnalyticsEvents</AssemblyTitle>
10+
<VersionPrefix>1.0.0</VersionPrefix>
11+
<AssemblyName>Amazon.Lambda.KinesisAnalyticsEvents</AssemblyName>
12+
<PackageId>Amazon.Lambda.KinesisAnalyticsEvents</PackageId>
13+
<PackageTags>AWS;Amazon;Lambda;KinesisAnalytics</PackageTags>
14+
</PropertyGroup>
15+
16+
<ItemGroup>
17+
<PackageReference Include="System.Collections" Version="4.0.11" />
18+
<PackageReference Include="System.Runtime" Version="4.1.0" />
19+
<PackageReference Include="System.Runtime.Serialization.Primitives" Version="4.1.1" />
20+
</ItemGroup>
21+
22+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Runtime.Serialization;
4+
5+
namespace Amazon.Lambda.KinesisAnalyticsEvents
6+
{
7+
/// <summary>
8+
/// This class represents the event from Kinesis Analytics application to preprocess Kinesis Firehose data.
9+
/// </summary>
10+
[DataContract]
11+
public class KinesisAnalyticsFirehoseInputPreprocessingEvent
12+
{
13+
/// <summary>
14+
/// Gets or sets the invocation identifier.
15+
/// </summary>
16+
/// <value>
17+
/// The invocation identifier.
18+
/// </value>
19+
[DataMember(Name = "invocationId")]
20+
public string InvocationId { get; set; }
21+
22+
/// <summary>
23+
/// Gets or sets the application arn.
24+
/// </summary>
25+
/// <value>
26+
/// The application arn.
27+
/// </value>
28+
[DataMember(Name = "applicationArn")]
29+
public string ApplicationArn { get; set; }
30+
31+
/// <summary>
32+
/// Gets or sets the stream arn.
33+
/// </summary>
34+
/// <value>
35+
/// The stream arn.
36+
/// </value>
37+
[DataMember(Name = "streamArn")]
38+
public string StreamArn { get; set; }
39+
40+
/// <summary>
41+
/// Gets or sets the records.
42+
/// </summary>
43+
/// <value>
44+
/// The records.
45+
/// </value>
46+
[DataMember(Name = "records")]
47+
public IList<FirehoseRecord> Records { get; set; }
48+
49+
/// <summary>
50+
///
51+
/// </summary>
52+
[DataContract]
53+
public class FirehoseRecord
54+
{
55+
56+
/// <summary>
57+
/// Gets or sets the record identifier.
58+
/// </summary>
59+
/// <value>
60+
/// The record identifier.
61+
/// </value>
62+
[DataMember(Name = "recordId")]
63+
public string RecordId { get; set; }
64+
65+
/// <summary>
66+
/// Gets or sets the record metadata.
67+
/// </summary>
68+
/// <value>
69+
/// The record metadata.
70+
/// </value>
71+
[DataMember(Name = "kinesisFirehoseRecordMetadata")]
72+
public KinesisFirehoseRecordMetadata RecordMetadata { get; set; }
73+
74+
/// <summary>
75+
///
76+
/// </summary>
77+
[DataContract]
78+
public class KinesisFirehoseRecordMetadata
79+
{
80+
/// <summary>
81+
/// Gets or sets the approximate arrival timestamp.
82+
/// </summary>
83+
/// <value>
84+
/// The approximate arrival timestamp.
85+
/// </value>
86+
[DataMember(Name = "approximateArrivalTimestamp")]
87+
public long ApproximateArrivalTimestamp { get; set; }
88+
89+
}
90+
91+
/// <summary>
92+
/// Gets or sets the base64 encoded data.
93+
/// </summary>
94+
/// <value>
95+
/// The base64 encoded data.
96+
/// </value>
97+
[DataMember(Name = "data")]
98+
public string Base64EncodedData { get; set; }
99+
100+
/// <summary>
101+
/// Base64 decodes the Base64EncodedData property.
102+
/// </summary>
103+
/// <returns></returns>
104+
public string DecodeData()
105+
{
106+
var decodedData = System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(this.Base64EncodedData));
107+
return decodedData;
108+
}
109+
}
110+
}
111+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Runtime.Serialization;
4+
5+
namespace Amazon.Lambda.KinesisAnalyticsEvents
6+
{
7+
/// <summary>
8+
/// This class represents the response from Lambda function for Kinesis Analytics input preprocessing.
9+
/// </summary>
10+
[DataContract]
11+
public class KinesisAnalyticsInputPreprocessingResponse
12+
{
13+
/// <summary>
14+
/// The record was preprocessed successfully.
15+
/// </summary>
16+
public const string OK = "Ok";
17+
18+
/// <summary>
19+
/// The record was dropped intentionally by your processing logic.
20+
/// </summary>
21+
public const string DROPPED = "Dropped";
22+
23+
/// <summary>
24+
/// The record could not be preprocessed.
25+
/// </summary>
26+
public const string PROCESSINGFAILED = "ProcessingFailed";
27+
28+
29+
/// <summary>
30+
/// Gets or sets the records.
31+
/// </summary>
32+
/// <value>
33+
/// The records.
34+
/// </value>
35+
[DataMember(Name = "records")]
36+
public IList<Record> Records { get; set; }
37+
38+
/// <summary>
39+
///
40+
/// </summary>
41+
[DataContract]
42+
public class Record
43+
{
44+
/// <summary>
45+
/// Gets or sets the record identifier.
46+
/// </summary>
47+
/// <value>
48+
/// The record identifier.
49+
/// </value>
50+
[DataMember(Name = "recordId")]
51+
public string RecordId { get; set; }
52+
53+
/// <summary>
54+
/// Gets or sets the result.
55+
/// </summary>
56+
/// <value>
57+
/// The result.
58+
/// </value>
59+
[DataMember(Name = "result")]
60+
public string Result { get; set; }
61+
62+
/// <summary>
63+
/// Gets or sets the base64 encoded data.
64+
/// </summary>
65+
/// <value>
66+
/// The base64 encoded data.
67+
/// </value>
68+
[DataMember(Name = "data")]
69+
public string Base64EncodedData { get; set; }
70+
/// <summary>
71+
/// Encodes the data.
72+
/// </summary>
73+
/// <param name="data">The data.</param>
74+
public void EncodeData(string data)
75+
{
76+
this.Base64EncodedData = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(data));
77+
}
78+
}
79+
}
80+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Runtime.Serialization;
4+
5+
namespace Amazon.Lambda.KinesisAnalyticsEvents
6+
{
7+
/// <summary>
8+
/// This class represents the event from Kinesis Analytics application output.
9+
/// </summary>
10+
[DataContract]
11+
public class KinesisAnalyticsOutputDeliveryEvent
12+
{
13+
14+
/// <summary>
15+
/// Gets or sets the invocation identifier.
16+
/// </summary>
17+
/// <value>
18+
/// The invocation identifier.
19+
/// </value>
20+
[DataMember(Name = "invocationId")]
21+
public string InvocationId { get; set; }
22+
23+
/// <summary>
24+
/// Gets or sets the application arn.
25+
/// </summary>
26+
/// <value>
27+
/// The application arn.
28+
/// </value>
29+
[DataMember(Name = "applicationArn")]
30+
public string ApplicationArn { get; set; }
31+
32+
/// <summary>
33+
/// Gets or sets the records.
34+
/// </summary>
35+
/// <value>
36+
/// The records.
37+
/// </value>
38+
[DataMember(Name = "records")]
39+
public IList<DeliveryRecord> Records { get; set; }
40+
41+
/// <summary>
42+
///
43+
/// </summary>
44+
[DataContract]
45+
public class DeliveryRecord
46+
{
47+
/// <summary>
48+
/// Gets or sets the record identifier.
49+
/// </summary>
50+
/// <value>
51+
/// The record identifier.
52+
/// </value>
53+
[DataMember(Name = "recordId")]
54+
public string RecordId { get; set; }
55+
56+
/// <summary>
57+
/// Gets or sets the record metadata.
58+
/// </summary>
59+
/// <value>
60+
/// The record metadata.
61+
/// </value>
62+
[DataMember(Name = "lambdaDeliveryRecordMetadata")]
63+
public LambdaDeliveryRecordMetadata RecordMetadata { get; set; }
64+
65+
/// <summary>
66+
///
67+
/// </summary>
68+
[DataContract]
69+
public class LambdaDeliveryRecordMetadata
70+
{
71+
/// <summary>
72+
/// Gets or sets the retry hint.
73+
/// </summary>
74+
/// <value>
75+
/// The retry hint.
76+
/// </value>
77+
[DataMember(Name = "retryHint")]
78+
public long RetryHint { get; set; }
79+
}
80+
81+
/// <summary>
82+
/// Gets or sets the base64 encoded data.
83+
/// </summary>
84+
/// <value>
85+
/// The base64 encoded data.
86+
/// </value>
87+
[DataMember(Name = "data")]
88+
public string Base64EncodedData { get; set; }
89+
90+
/// <summary>
91+
/// Base64 decodes the Base64EncodedData property.
92+
/// </summary>
93+
/// <returns></returns>
94+
public string DecodeData()
95+
{
96+
var decodedData = System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(this.Base64EncodedData));
97+
return decodedData;
98+
}
99+
}
100+
}
101+
}

0 commit comments

Comments
 (0)