示例#1
0
        /// <summary>
        /// A simple function that takes a string and does a ToUpper
        /// </summary>
        /// <param name="input"></param>
        /// <param name="context"></param>
        /// <returns></returns>
        public APIGatewayProxyResponse FunctionHandler(APIGatewayProxyRequest request, ILambdaContext context)
        {
            context.Logger.Log("Starting Minimum Get call");

            using (AwsFactory factory = new AwsFactory(context.Logger))
            {
                string userId    = request.PathParameters["userId"];
                string firstName = request.PathParameters["firstName"];

                context.Logger.LogLine($"userId=\"{userId}\"");
                context.Logger.LogLine($"firstName=\"{firstName}\"");

                using (GetMinimum getMinimum = new GetMinimum(factory))
                {
                    string jsonResponse = getMinimum.Retrieve(userId, firstName);

                    context.Logger.LogLine($"Response: {jsonResponse}");
                    APIGatewayProxyResponse response = new APIGatewayProxyResponse()
                    {
                        Body       = jsonResponse,
                        StatusCode = 200
                    };

                    return(response);
                }
            }
        }