Пример #1
0
        /// <summary>
        /// A Lambda function that gets the biggest, smallest and the images extensions info about
        /// all the S3 Bucket imges.
        /// path for http request: /
        /// </summary>
        /// <param name="request"></param>
        /// <param name="context"></param>
        /// <returns></returns>
        public async Task <APIGatewayProxyResponse> InfoImageAsync(APIGatewayProxyRequest request, ILambdaContext context)
        {
            var info = new InfoImage
            {
                BiggestImage    = await getService.GetBiggestImage(),
                SmallerImage    = await getService.GetSmallestImage(),
                ImageExtensions = await getService.GetImagesExtensions()
            };
            var response = new APIGatewayProxyResponse
            {
                StatusCode = (int)HttpStatusCode.OK,
                Body       = JsonConvert.SerializeObject(info),
                Headers    = new Dictionary <string, string> {
                    { "Content-Type", "application/json" }
                }
            };

            return(response);
        }