Skip to content

Commit

Permalink
Add more snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
96malhar committed May 9, 2024
1 parent 5734594 commit a14bf6d
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.IO;
using Amazon.Lambda.Core;
using Amazon.Lambda.Annotations.APIGateway;
using System.Text.Json;

namespace TestServerlessApp
{
Expand Down Expand Up @@ -51,12 +52,12 @@ public CustomizeResponseExamples_NotFoundResponseWithHeaderV1Async_Generated()
},
StatusCode = 400
};
var errorStream = new System.IO.MemoryStream();
serializer.Serialize(errorResult, errorStream);

var errorStream = new MemoryStream();
JsonSerializer.Serialize(errorStream, errorResult, typeof(Amazon.Lambda.APIGatewayEvents.APIGatewayProxyResponse));
errorStream.Position = 0;
return errorStream;
}

var httpResults = await customizeResponseExamples.NotFoundResponseWithHeaderV1Async(x, __context__);
HttpResultSerializationOptions.ProtocolFormat serializationFormat = HttpResultSerializationOptions.ProtocolFormat.HttpApi;
HttpResultSerializationOptions.ProtocolVersion serializationVersion = HttpResultSerializationOptions.ProtocolVersion.V1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.IO;
using Amazon.Lambda.Core;
using Amazon.Lambda.Annotations.APIGateway;
using System.Text.Json;

namespace TestServerlessApp
{
Expand Down Expand Up @@ -51,12 +52,12 @@ public System.IO.Stream NotFoundResponseWithHeaderV1(Amazon.Lambda.APIGatewayEve
},
StatusCode = 400
};
var errorStream = new System.IO.MemoryStream();
serializer.Serialize(errorResult, errorStream);

var errorStream = new MemoryStream();
JsonSerializer.Serialize(errorStream, errorResult, typeof(Amazon.Lambda.APIGatewayEvents.APIGatewayProxyResponse));
errorStream.Position = 0;
return errorStream;
}

var httpResults = customizeResponseExamples.NotFoundResponseWithHeaderV1(x, __context__);
HttpResultSerializationOptions.ProtocolFormat serializationFormat = HttpResultSerializationOptions.ProtocolFormat.HttpApi;
HttpResultSerializationOptions.ProtocolVersion serializationVersion = HttpResultSerializationOptions.ProtocolVersion.V1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.IO;
using Amazon.Lambda.Core;
using Amazon.Lambda.Annotations.APIGateway;
using System.Text.Json;

namespace TestServerlessApp
{
Expand Down Expand Up @@ -51,12 +52,12 @@ public CustomizeResponseExamples_NotFoundResponseWithHeaderV2Async_Generated()
},
StatusCode = 400
};
var errorStream = new System.IO.MemoryStream();
serializer.Serialize(errorResult, errorStream);

var errorStream = new MemoryStream();
JsonSerializer.Serialize(errorStream, errorResult, typeof(Amazon.Lambda.APIGatewayEvents.APIGatewayHttpApiV2ProxyResponse));
errorStream.Position = 0;
return errorStream;
}

var httpResults = await customizeResponseExamples.NotFoundResponseWithHeaderV2Async(x, __context__);
HttpResultSerializationOptions.ProtocolFormat serializationFormat = HttpResultSerializationOptions.ProtocolFormat.HttpApi;
HttpResultSerializationOptions.ProtocolVersion serializationVersion = HttpResultSerializationOptions.ProtocolVersion.V2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.IO;
using Amazon.Lambda.Core;
using Amazon.Lambda.Annotations.APIGateway;
using System.Text.Json;

namespace TestServerlessApp
{
Expand Down Expand Up @@ -51,12 +52,12 @@ public System.IO.Stream NotFoundResponseWithHeaderV2(Amazon.Lambda.APIGatewayEve
},
StatusCode = 400
};
var errorStream = new System.IO.MemoryStream();
serializer.Serialize(errorResult, errorStream);

var errorStream = new MemoryStream();
JsonSerializer.Serialize(errorStream, errorResult, typeof(Amazon.Lambda.APIGatewayEvents.APIGatewayHttpApiV2ProxyResponse));
errorStream.Position = 0;
return errorStream;
}

var httpResults = customizeResponseExamples.NotFoundResponseWithHeaderV2(x, __context__);
HttpResultSerializationOptions.ProtocolFormat serializationFormat = HttpResultSerializationOptions.ProtocolFormat.HttpApi;
HttpResultSerializationOptions.ProtocolVersion serializationVersion = HttpResultSerializationOptions.ProtocolVersion.V2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.IO;
using Amazon.Lambda.Core;
using Amazon.Lambda.Annotations.APIGateway;
using System.Text.Json;

namespace TestServerlessApp
{
Expand Down Expand Up @@ -51,12 +52,12 @@ public CustomizeResponseExamples_OkResponseWithHeaderAsync_Generated()
},
StatusCode = 400
};
var errorStream = new System.IO.MemoryStream();
serializer.Serialize(errorResult, errorStream);

var errorStream = new MemoryStream();
JsonSerializer.Serialize(errorStream, errorResult, typeof(Amazon.Lambda.APIGatewayEvents.APIGatewayProxyResponse));
errorStream.Position = 0;
return errorStream;
}

var httpResults = await customizeResponseExamples.OkResponseWithHeaderAsync(x, __context__);
HttpResultSerializationOptions.ProtocolFormat serializationFormat = HttpResultSerializationOptions.ProtocolFormat.RestApi;
HttpResultSerializationOptions.ProtocolVersion serializationVersion = HttpResultSerializationOptions.ProtocolVersion.V1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.IO;
using Amazon.Lambda.Core;
using Amazon.Lambda.Annotations.APIGateway;
using System.Text.Json;

namespace TestServerlessApp
{
Expand Down Expand Up @@ -51,12 +52,12 @@ public System.IO.Stream OkResponseWithHeader(Amazon.Lambda.APIGatewayEvents.APIG
},
StatusCode = 400
};
var errorStream = new System.IO.MemoryStream();
serializer.Serialize(errorResult, errorStream);

var errorStream = new MemoryStream();
JsonSerializer.Serialize(errorStream, errorResult, typeof(Amazon.Lambda.APIGatewayEvents.APIGatewayProxyResponse));
errorStream.Position = 0;
return errorStream;
}

var httpResults = customizeResponseExamples.OkResponseWithHeader(x, __context__);
HttpResultSerializationOptions.ProtocolFormat serializationFormat = HttpResultSerializationOptions.ProtocolFormat.RestApi;
HttpResultSerializationOptions.ProtocolVersion serializationVersion = HttpResultSerializationOptions.ProtocolVersion.V1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using System;
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using Amazon.Lambda.Core;
using System.Text.Json;

namespace TestServerlessApp
{
Expand All @@ -20,7 +21,7 @@ public Greeter_SayHelloAsync_Generated()
serializer = new Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer();
}

public async System.Threading.Tasks.Task<Amazon.Lambda.APIGatewayEvents.APIGatewayProxyResponse> SayHelloAsync(Amazon.Lambda.APIGatewayEvents.APIGatewayProxyRequest __request__, Amazon.Lambda.Core.ILambdaContext __context__)
public async System.Threading.Tasks.Task<System.IO.Stream> SayHelloAsync(Amazon.Lambda.APIGatewayEvents.APIGatewayProxyRequest __request__, Amazon.Lambda.Core.ILambdaContext __context__)
{
var validationErrors = new List<string>();

Expand Down Expand Up @@ -56,15 +57,22 @@ public Greeter_SayHelloAsync_Generated()
},
StatusCode = 400
};
return errorResult;
}

var errorStream = new MemoryStream();
JsonSerializer.Serialize(errorStream, errorResult, typeof(Amazon.Lambda.APIGatewayEvents.APIGatewayProxyResponse));
errorStream.Position = 0;
return errorStream;
}
await greeter.SayHelloAsync(firstNames);

return new Amazon.Lambda.APIGatewayEvents.APIGatewayProxyResponse
var response = new Amazon.Lambda.APIGatewayEvents.APIGatewayProxyResponse
{
StatusCode = 200
};

var responseStream = new MemoryStream();
JsonSerializer.Serialize(responseStream, response, typeof(Amazon.Lambda.APIGatewayEvents.APIGatewayProxyResponse));
responseStream.Position = 0;
return responseStream;
}

private static void SetExecutionEnvironment()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using System;
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using Amazon.Lambda.Core;
using System.Text.Json;

namespace TestServerlessApp
{
Expand All @@ -20,7 +21,7 @@ public Greeter_SayHello_Generated()
serializer = new Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer();
}

public Amazon.Lambda.APIGatewayEvents.APIGatewayProxyResponse SayHello(Amazon.Lambda.APIGatewayEvents.APIGatewayProxyRequest __request__, Amazon.Lambda.Core.ILambdaContext __context__)
public System.IO.Stream SayHello(Amazon.Lambda.APIGatewayEvents.APIGatewayProxyRequest __request__, Amazon.Lambda.Core.ILambdaContext __context__)
{
var validationErrors = new List<string>();

Expand Down Expand Up @@ -56,15 +57,22 @@ public Amazon.Lambda.APIGatewayEvents.APIGatewayProxyResponse SayHello(Amazon.La
},
StatusCode = 400
};
return errorResult;
}

var errorStream = new MemoryStream();
JsonSerializer.Serialize(errorStream, errorResult, typeof(Amazon.Lambda.APIGatewayEvents.APIGatewayProxyResponse));
errorStream.Position = 0;
return errorStream;
}
greeter.SayHello(firstNames, __request__, __context__);

return new Amazon.Lambda.APIGatewayEvents.APIGatewayProxyResponse
var response = new Amazon.Lambda.APIGatewayEvents.APIGatewayProxyResponse
{
StatusCode = 200
};

var responseStream = new MemoryStream();
JsonSerializer.Serialize(responseStream, response, typeof(Amazon.Lambda.APIGatewayEvents.APIGatewayProxyResponse));
responseStream.Position = 0;
return responseStream;
}

private static void SetExecutionEnvironment()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Threading.Tasks;
using System.IO;
using Amazon.Lambda.Core;
using System.Text.Json;

namespace TestServerlessApp
{
Expand All @@ -20,7 +21,7 @@ public NullableReferenceTypeExample_NullableHeaderHttpApi_Generated()
serializer = new Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer();
}

public Amazon.Lambda.APIGatewayEvents.APIGatewayHttpApiV2ProxyResponse NullableHeaderHttpApi(Amazon.Lambda.APIGatewayEvents.APIGatewayHttpApiV2ProxyRequest __request__, Amazon.Lambda.Core.ILambdaContext __context__)
public System.IO.Stream NullableHeaderHttpApi(Amazon.Lambda.APIGatewayEvents.APIGatewayHttpApiV2ProxyRequest __request__, Amazon.Lambda.Core.ILambdaContext __context__)
{
var validationErrors = new List<string>();

Expand Down Expand Up @@ -50,15 +51,22 @@ public Amazon.Lambda.APIGatewayEvents.APIGatewayHttpApiV2ProxyResponse NullableH
},
StatusCode = 400
};
return errorResult;
}

var errorStream = new MemoryStream();
JsonSerializer.Serialize(errorStream, errorResult, typeof(Amazon.Lambda.APIGatewayEvents.APIGatewayHttpApiV2ProxyResponse));
errorStream.Position = 0;
return errorStream;
}
nullableReferenceTypeExample.NullableHeaderHttpApi(text, __context__);

return new Amazon.Lambda.APIGatewayEvents.APIGatewayHttpApiV2ProxyResponse
var response = new Amazon.Lambda.APIGatewayEvents.APIGatewayHttpApiV2ProxyResponse
{
StatusCode = 200
};

var responseStream = new MemoryStream();
JsonSerializer.Serialize(responseStream, response, typeof(Amazon.Lambda.APIGatewayEvents.APIGatewayHttpApiV2ProxyResponse));
responseStream.Position = 0;
return responseStream;
}

private static void SetExecutionEnvironment()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.IO;
using Amazon.Lambda.Core;
using Amazon.Lambda.Annotations.APIGateway;
using System.Text.Json;

namespace TestExecutableServerlessApp
{
Expand Down

0 comments on commit a14bf6d

Please sign in to comment.