using System.Net;
using Amazon.Lambda.Core;
using Amazon.Lambda.APIGatewayEvents;
using Amazon.Lambda.Annotations;
using Amazon.Lambda.Annotations.APIGateway;
// Assembly attribute to enable the Lambda function's JSON input to be converted into a .NET class.
[assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer))]
namespace BlueprintBaseName._1;
public class Functions
{
///
/// Default constructor that Lambda will invoke.
///
public Functions()
{
}
///
/// A Lambda function to respond to HTTP Get methods from API Gateway
///
///
/// This uses the Lambda Annotations
/// programming model to bridge the gap between the Lambda programming model and a more idiomatic .NET model.
///
/// This automatically handles reading parameters from an APIGatewayProxyRequest
/// as well as syncing the function definitions to serverless.template each time you build.
///
/// If you do not wish to use this model and need to manipulate the API Gateway
/// objects directly, see the accompanying Readme.md for instructions.
///
/// Information about the invocation, function, and execution environment
/// The response as an implicit
[LambdaFunction(Policies = "AWSLambdaBasicExecutionRole", MemorySize = 256, Timeout = 30)]
[RestApi(LambdaHttpMethod.Get, "/")]
public IHttpResult Get(ILambdaContext context)
{
context.Logger.LogInformation("Handling the 'Get' Request");
return HttpResults.Ok("Hello AWS Serverless");
}
}