Amazon.Lambda.Model.Internal.MarshallTransformations.InvokeResponseUnmarshaller.Unmarshall C# (CSharp) Method

Unmarshall() public method

Unmarshaller the response from the service to the response class.
public Unmarshall ( JsonUnmarshallerContext context ) : AmazonWebServiceResponse
context Amazon.Runtime.Internal.Transform.JsonUnmarshallerContext
return Amazon.Runtime.AmazonWebServiceResponse
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            InvokeResponse response = new InvokeResponse();

            var ms = new MemoryStream();
            Amazon.Util.AWSSDKUtils.CopyStream(context.Stream, ms);
            ms.Seek(0, SeekOrigin.Begin);
            response.Payload = ms;
            if (context.ResponseData.IsHeaderPresent("X-Amz-Function-Error"))
                response.FunctionError = context.ResponseData.GetHeaderValue("X-Amz-Function-Error");
            if (context.ResponseData.IsHeaderPresent("X-Amz-Log-Result"))
                response.LogResult = context.ResponseData.GetHeaderValue("X-Amz-Log-Result");
            response.StatusCode = (int)context.ResponseData.StatusCode;

            return response;
        }