Skip to content

Commit 2d08b78

Browse files
committed
Merge branch 'system.text.json' into dev-netcore31
2 parents 841fb09 + 3c7b48d commit 2d08b78

File tree

57 files changed

+1379
-620
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1379
-620
lines changed

Libraries/Libraries.sln

+312-292
Large diffs are not rendered by default.

Libraries/src/Amazon.Lambda.APIGatewayEvents/APIGatewayCustomAuthorizerPolicy.cs

+15
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,17 @@ public class APIGatewayCustomAuthorizerPolicy
1010
/// <summary>
1111
/// Gets or sets the IAM API version.
1212
/// </summary>
13+
#if NETCOREAPP_3_1
14+
[System.Text.Json.Serialization.JsonPropertyName("Version")]
15+
#endif
1316
public string Version { get; set; } = "2012-10-17";
1417

1518
/// <summary>
1619
/// Gets or sets a list of IAM policy statements to apply.
1720
/// </summary>
21+
#if NETCOREAPP_3_1
22+
[System.Text.Json.Serialization.JsonPropertyName("Statement")]
23+
#endif
1824
public List<IAMPolicyStatement> Statement { get; set; } = new List<IAMPolicyStatement>();
1925

2026
/// <summary>
@@ -25,16 +31,25 @@ public class IAMPolicyStatement
2531
/// <summary>
2632
/// Gets or sets the effect the statement has.
2733
/// </summary>
34+
#if NETCOREAPP_3_1
35+
[System.Text.Json.Serialization.JsonPropertyName("Effect")]
36+
#endif
2837
public string Effect { get; set; } = "Allow";
2938

3039
/// <summary>
3140
/// Gets or sets the action/s the statement has.
3241
/// </summary>
42+
#if NETCOREAPP_3_1
43+
[System.Text.Json.Serialization.JsonPropertyName("Action")]
44+
#endif
3345
public HashSet<string> Action { get; set; }
3446

3547
/// <summary>
3648
/// Gets or sets the resources the statement applies to.
3749
/// </summary>
50+
#if NETCOREAPP_3_1
51+
[System.Text.Json.Serialization.JsonPropertyName("Resource")]
52+
#endif
3853
public HashSet<string> Resource { get; set; }
3954
}
4055
}

Libraries/src/Amazon.Lambda.APIGatewayEvents/APIGatewayCustomAuthorizerResponse.cs

+12
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,36 @@ public class APIGatewayCustomAuthorizerResponse
1212
/// Gets or sets the ID of the principal.
1313
/// </summary>
1414
[DataMember(Name = "principalId")]
15+
#if NETCOREAPP_3_1
16+
[System.Text.Json.Serialization.JsonPropertyName("principalId")]
17+
#endif
1518
public string PrincipalID { get; set; }
1619

1720
/// <summary>
1821
/// Gets or sets the <see cref="APIGatewayCustomAuthorizerPolicy"/> policy document.
1922
/// </summary>
2023
[DataMember(Name = "policyDocument")]
24+
#if NETCOREAPP_3_1
25+
[System.Text.Json.Serialization.JsonPropertyName("policyDocument")]
26+
#endif
2127
public APIGatewayCustomAuthorizerPolicy PolicyDocument { get; set; } = new APIGatewayCustomAuthorizerPolicy();
2228

2329
/// <summary>
2430
/// Gets or sets the <see cref="APIGatewayCustomAuthorizerContext"/> property.
2531
/// </summary>
2632
[DataMember(Name = "context")]
33+
#if NETCOREAPP_3_1
34+
[System.Text.Json.Serialization.JsonPropertyName("context")]
35+
#endif
2736
public APIGatewayCustomAuthorizerContextOutput Context { get; set; }
2837

2938
/// <summary>
3039
/// Gets or sets the usageIdentifierKey.
3140
/// </summary>
3241
[DataMember(Name = "usageIdentifierKey")]
42+
#if NETCOREAPP_3_1
43+
[System.Text.Json.Serialization.JsonPropertyName("usageIdentifierKey")]
44+
#endif
3345
public string UsageIdentifierKey { get; set; }
3446
}
3547
}

Libraries/src/Amazon.Lambda.APIGatewayEvents/APIGatewayProxyResponse.cs

+15
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ public class APIGatewayProxyResponse
1414
/// The HTTP status code for the request
1515
/// </summary>
1616
[DataMember(Name = "statusCode")]
17+
#if NETCOREAPP_3_1
18+
[System.Text.Json.Serialization.JsonPropertyName("statusCode")]
19+
#endif
1720
public int StatusCode { get; set; }
1821

1922
/// <summary>
@@ -22,6 +25,9 @@ public class APIGatewayProxyResponse
2225
/// before returning back the headers to the caller.
2326
/// </summary>
2427
[DataMember(Name = "headers")]
28+
#if NETCOREAPP_3_1
29+
[System.Text.Json.Serialization.JsonPropertyName("headers")]
30+
#endif
2531
public IDictionary<string, string> Headers { get; set; }
2632

2733
/// <summary>
@@ -30,18 +36,27 @@ public class APIGatewayProxyResponse
3036
/// before returning back the headers to the caller.
3137
/// </summary>
3238
[DataMember(Name = "multiValueHeaders")]
39+
#if NETCOREAPP_3_1
40+
[System.Text.Json.Serialization.JsonPropertyName("multiValueHeaders")]
41+
#endif
3342
public IDictionary<string, IList<string>> MultiValueHeaders { get; set; }
3443

3544
/// <summary>
3645
/// The response body
3746
/// </summary>
3847
[DataMember(Name = "body")]
48+
#if NETCOREAPP_3_1
49+
[System.Text.Json.Serialization.JsonPropertyName("body")]
50+
#endif
3951
public string Body { get; set; }
4052

4153
/// <summary>
4254
/// Flag indicating whether the body should be treated as a base64-encoded string
4355
/// </summary>
4456
[DataMember(Name = "isBase64Encoded")]
57+
#if NETCOREAPP_3_1
58+
[System.Text.Json.Serialization.JsonPropertyName("isBase64Encoded")]
59+
#endif
4560
public bool IsBase64Encoded { get; set; }
4661
}
4762
}

Libraries/src/Amazon.Lambda.APIGatewayEvents/Amazon.Lambda.APIGatewayEvents.csproj

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,19 @@
33
<Import Project="..\..\..\buildtools\common.props" />
44

55
<PropertyGroup>
6-
<TargetFrameworks>netstandard1.3;netstandard2.0</TargetFrameworks>
6+
<TargetFrameworks>netstandard2.0;netcoreapp3.1</TargetFrameworks>
77
<Description>Amazon Lambda .NET Core support - API Gateway package.</Description>
88
<AssemblyTitle>Amazon.Lambda.APIGatewayEvents</AssemblyTitle>
9-
<VersionPrefix>1.3.0</VersionPrefix>
9+
<VersionPrefix>2.0.0-preview1</VersionPrefix>
1010
<AssemblyName>Amazon.Lambda.APIGatewayEvents</AssemblyName>
1111
<PackageId>Amazon.Lambda.APIGatewayEvents</PackageId>
1212
<PackageTags>AWS;Amazon;Lambda</PackageTags>
1313
</PropertyGroup>
1414

15+
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
16+
<DefineConstants>NETCOREAPP_3_1</DefineConstants>
17+
</PropertyGroup>
18+
1519
<ItemGroup>
1620
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
1721
</ItemGroup>

Libraries/src/Amazon.Lambda.AspNetCoreServer/AbstractAspNetCoreFunction.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
using System.Text;
1313
using System.Threading.Tasks;
1414
using Microsoft.AspNetCore.Http.Features.Authentication;
15-
#if NETCOREAPP_3_0
15+
#if NETCOREAPP_3_1
1616
using Microsoft.Extensions.Hosting;
1717
#endif
1818

@@ -341,7 +341,11 @@ protected string ErrorReport(Exception e)
341341
/// <param name="request"></param>
342342
/// <param name="lambdaContext"></param>
343343
/// <returns></returns>
344+
#if NETCOREAPP_2_1
344345
[LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))]
346+
#elif NETCOREAPP_3_1
347+
[LambdaSerializer(typeof(Amazon.Lambda.Serialization.SystemTextJson.LambdaJsonSerializer))]
348+
#endif
345349
public virtual async Task<TRESPONSE> FunctionHandlerAsync(TREQUEST request, ILambdaContext lambdaContext)
346350
{
347351
if (!IsStarted)

Libraries/src/Amazon.Lambda.AspNetCoreServer/Amazon.Lambda.AspNetCoreServer.csproj

+7-6
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
<PropertyGroup>
66
<Description>Amazon.Lambda.AspNetCoreServer makes it easy to run ASP.NET Core Web API applications as AWS Lambda functions.</Description>
7-
<TargetFrameworks>netstandard2.0;netcoreapp3.0</TargetFrameworks>
7+
<TargetFrameworks>netstandard2.0;netcoreapp3.1</TargetFrameworks>
88
<AssemblyTitle>Amazon.Lambda.AspNetCoreServer</AssemblyTitle>
9-
<VersionPrefix>4.1.0</VersionPrefix>
9+
<VersionPrefix>5.0.0-preview1</VersionPrefix>
1010
<AssemblyName>Amazon.Lambda.AspNetCoreServer</AssemblyName>
1111
<PackageId>Amazon.Lambda.AspNetCoreServer</PackageId>
1212
<PackageTags>AWS;Amazon;Lambda;aspnetcore</PackageTags>
@@ -17,25 +17,26 @@
1717
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
1818
<DefineConstants>NETSTANDARD_2_0,NETCOREAPP_2_1</DefineConstants>
1919
</PropertyGroup>
20-
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
21-
<DefineConstants>NETCOREAPP_3_0</DefineConstants>
20+
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
21+
<DefineConstants>NETCOREAPP_3_1</DefineConstants>
2222
</PropertyGroup>
2323

2424
<ItemGroup>
2525
<ProjectReference Include="..\Amazon.Lambda.ApplicationLoadBalancerEvents\Amazon.Lambda.ApplicationLoadBalancerEvents.csproj" />
2626
<ProjectReference Include="..\Amazon.Lambda.Core\Amazon.Lambda.Core.csproj" />
2727
<ProjectReference Include="..\Amazon.Lambda.Logging.AspNetCore\Amazon.Lambda.Logging.AspNetCore.csproj" />
28-
<ProjectReference Include="..\Amazon.Lambda.Serialization.Json\Amazon.Lambda.Serialization.Json.csproj" />
2928
<ProjectReference Include="..\Amazon.Lambda.APIGatewayEvents\Amazon.Lambda.APIGatewayEvents.csproj" />
3029
</ItemGroup>
3130

3231
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
3332
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.0" />
3433
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.0.0" />
3534
<PackageReference Include="Newtonsoft.Json" Version="10.0.1" />
35+
<ProjectReference Include="..\Amazon.Lambda.Serialization.Json\Amazon.Lambda.Serialization.Json.csproj" />
3636
</ItemGroup>
37-
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
37+
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
3838
<FrameworkReference Include="Microsoft.AspNetCore.App" />
39+
<ProjectReference Include="..\Amazon.Lambda.Serialization.SystemTextJson\Amazon.Lambda.Serialization.SystemTextJson.csproj" />
3940
</ItemGroup>
4041

4142
</Project>

Libraries/src/Amazon.Lambda.CloudWatchEvents/Amazon.Lambda.CloudWatchEvents.csproj

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@
33
<Import Project="..\..\..\buildtools\common.props" />
44

55
<PropertyGroup>
6-
<TargetFramework>netstandard2.0</TargetFramework>
6+
<TargetFrameworks>netstandard2.0;netcoreapp3.1</TargetFrameworks>
77
<Description>Amazon Lambda .NET Core support - CloudWatchEvents package.</Description>
88
<AssemblyTitle>Amazon.Lambda.CloudWatchEvents</AssemblyTitle>
9-
<VersionPrefix>1.0.0</VersionPrefix>
9+
<VersionPrefix>2.0.0-preview1</VersionPrefix>
1010
<AssemblyName>Amazon.Lambda.CloudWatchEvents</AssemblyName>
1111
<PackageId>Amazon.Lambda.CloudWatchEvents</PackageId>
1212
<PackageTags>AWS;Amazon;Lambda</PackageTags>
1313
</PropertyGroup>
1414

15+
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
16+
<DefineConstants>NETCOREAPP_3_1</DefineConstants>
17+
</PropertyGroup>
18+
1519
</Project>

Libraries/src/Amazon.Lambda.CloudWatchEvents/CloudWatchEvent.cs

+3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ public class CloudWatchEvent<T>
4040
/// For example, ScheduledEvent will be null
4141
/// For example, ECSEvent could be "ECS Container Instance State Change" or "ECS Task State Change"
4242
/// </summary>
43+
#if NETCOREAPP_3_1
44+
[System.Text.Json.Serialization.JsonPropertyName("detail-type")]
45+
#endif
4346
public string DetailType { get; set; }
4447

4548
/// <summary>

Libraries/src/Amazon.Lambda.CloudWatchLogsEvents/Amazon.Lambda.CloudWatchLogsEvents.csproj

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@
22
<Import Project="..\..\..\buildtools\common.props" />
33
<PropertyGroup>
44
<Description>Amazon Lambda .NET Core support - CloudWatchLogsEvents package.</Description>
5-
<TargetFrameworks>netstandard1.3;netstandard2.0</TargetFrameworks>
5+
<TargetFrameworks>netstandard2.0;netcoreapp3.1</TargetFrameworks>
66
<AssemblyTitle>Amazon.Lambda.CloudWatchLogsEvents</AssemblyTitle>
7-
<VersionPrefix>1.1.0</VersionPrefix>
7+
<VersionPrefix>2.0.0-preview1</VersionPrefix>
88
<AssemblyName>Amazon.Lambda.CloudWatchLogsEvents</AssemblyName>
99
<PackageId>Amazon.Lambda.CloudWatchLogsEvents</PackageId>
1010
<PackageTags>AWS;Amazon;Lambda</PackageTags>
1111
</PropertyGroup>
1212

13+
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
14+
<DefineConstants>NETCOREAPP_3_1</DefineConstants>
15+
</PropertyGroup>
16+
1317
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">
1418
<PackageReference Include="System.Runtime.Serialization.Primitives" Version="4.1.1" />
1519
</ItemGroup>

Libraries/src/Amazon.Lambda.CloudWatchLogsEvents/CloudWatchLogsEvents.cs

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ public class Log
3030
/// The data that are base64 encoded and gziped messages in LogStreams.
3131
/// </summary>
3232
[DataMember(Name = "data", IsRequired = false)]
33+
#if NETCOREAPP_3_1
34+
[System.Text.Json.Serialization.JsonPropertyName("data")]
35+
#endif
3336
public string EncodedData { get; set; }
3437

3538
/// <summary>

Libraries/src/Amazon.Lambda.KinesisAnalyticsEvents/Amazon.Lambda.KinesisAnalyticsEvents.csproj

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,19 @@
33
<Import Project="..\..\..\buildtools\common.props" />
44

55
<PropertyGroup>
6-
<TargetFrameworks>netstandard1.3;netstandard2.0</TargetFrameworks>
6+
<TargetFrameworks>netstandard2.0;netcoreapp3.1</TargetFrameworks>
77
<Description>Amazon Lambda .NET Core support - Amazon Kinesis Analytics package.</Description>
88
<AssemblyTitle>Amazon.Lambda.KinesisAnalyticsEvents</AssemblyTitle>
9-
<VersionPrefix>1.1.0</VersionPrefix>
9+
<VersionPrefix>2.0.0-preview1</VersionPrefix>
1010
<AssemblyName>Amazon.Lambda.KinesisAnalyticsEvents</AssemblyName>
1111
<PackageId>Amazon.Lambda.KinesisAnalyticsEvents</PackageId>
1212
<PackageTags>AWS;Amazon;Lambda;KinesisAnalytics</PackageTags>
1313
</PropertyGroup>
1414

15+
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
16+
<DefineConstants>NETCOREAPP_3_1</DefineConstants>
17+
</PropertyGroup>
18+
1519
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">
1620
<PackageReference Include="System.Runtime.Serialization.Primitives" Version="4.1.1" />
1721
</ItemGroup>

Libraries/src/Amazon.Lambda.KinesisAnalyticsEvents/KinesisAnalyticsInputPreprocessingResponse.cs

+13
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ public class KinesisAnalyticsInputPreprocessingResponse
3333
/// The records.
3434
/// </value>
3535
[DataMember(Name = "records")]
36+
#if NETCOREAPP_3_1
37+
[System.Text.Json.Serialization.JsonPropertyName("records")]
38+
#endif
3639
public IList<Record> Records { get; set; }
3740

3841
/// <summary>
@@ -48,6 +51,9 @@ public class Record
4851
/// The record identifier.
4952
/// </value>
5053
[DataMember(Name = "recordId")]
54+
#if NETCOREAPP_3_1
55+
[System.Text.Json.Serialization.JsonPropertyName("recordId")]
56+
#endif
5157
public string RecordId { get; set; }
5258

5359
/// <summary>
@@ -57,6 +63,9 @@ public class Record
5763
/// The result.
5864
/// </value>
5965
[DataMember(Name = "result")]
66+
#if NETCOREAPP_3_1
67+
[System.Text.Json.Serialization.JsonPropertyName("result")]
68+
#endif
6069
public string Result { get; set; }
6170

6271
/// <summary>
@@ -66,7 +75,11 @@ public class Record
6675
/// The base64 encoded data.
6776
/// </value>
6877
[DataMember(Name = "data")]
78+
#if NETCOREAPP_3_1
79+
[System.Text.Json.Serialization.JsonPropertyName("data")]
80+
#endif
6981
public string Base64EncodedData { get; set; }
82+
7083
/// <summary>
7184
/// Encodes the data.
7285
/// </summary>

Libraries/src/Amazon.Lambda.KinesisAnalyticsEvents/KinesisAnalyticsOutputDeliveryEvent.cs

+3
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ public class LambdaDeliveryRecordMetadata
8585
/// The base64 encoded data.
8686
/// </value>
8787
[DataMember(Name = "data")]
88+
#if NETCOREAPP_3_1
89+
[System.Text.Json.Serialization.JsonPropertyName("data")]
90+
#endif
8891
public string Base64EncodedData { get; set; }
8992

9093
/// <summary>

Libraries/src/Amazon.Lambda.KinesisAnalyticsEvents/KinesisAnalyticsStreamsInputPreprocessingEvent.cs

+3
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ public DateTime ApproximateArrivalTimestamp
131131
/// The base64 encoded data.
132132
/// </value>
133133
[DataMember(Name = "data")]
134+
#if NETCOREAPP_3_1
135+
[System.Text.Json.Serialization.JsonPropertyName("data")]
136+
#endif
134137
public string Base64EncodedData { get; set; }
135138

136139
/// <summary>

Libraries/src/Amazon.Lambda.KinesisFirehoseEvents/Amazon.Lambda.KinesisFirehoseEvents.csproj

+7-3
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@
22
<Import Project="..\..\..\buildtools\common.props" />
33

44
<PropertyGroup>
5-
<TargetFrameworks>netstandard1.3;netstandard2.0</TargetFrameworks>
5+
<TargetFrameworks>netstandard2.0;netcoreapp3.1</TargetFrameworks>
66
<Description>Amazon Lambda .NET Core support - Amazon Kinesis Firehose package.</Description>
77
<AssemblyTitle>Amazon.Lambda.KinesisFirehoseEvents</AssemblyTitle>
8-
<VersionPrefix>1.1.0</VersionPrefix>
8+
<VersionPrefix>2.0.0-preview1</VersionPrefix>
99
<AssemblyName>Amazon.Lambda.KinesisFirehoseEvents</AssemblyName>
1010
<PackageId>Amazon.Lambda.KinesisFirehoseEvents</PackageId>
1111
<PackageTags>AWS;Amazon;Lambda;KinesisFirehose</PackageTags>
1212
</PropertyGroup>
13-
13+
14+
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
15+
<DefineConstants>NETCOREAPP_3_1</DefineConstants>
16+
</PropertyGroup>
17+
1418
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">
1519
<PackageReference Include="System.Runtime.Serialization.Primitives" Version="4.1.1" />
1620
</ItemGroup>

0 commit comments

Comments
 (0)