public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
SearchResponse response = new SearchResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("facets", targetDepth))
{
var unmarshaller = new DictionaryUnmarshaller<string, BucketInfo, StringUnmarshaller, BucketInfoUnmarshaller>(StringUnmarshaller.Instance, BucketInfoUnmarshaller.Instance);
response.Facets = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("hits", targetDepth))
{
var unmarshaller = HitsUnmarshaller.Instance;
response.Hits = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("stats", targetDepth))
{
var unmarshaller = new DictionaryUnmarshaller<string, FieldStats, StringUnmarshaller, FieldStatsUnmarshaller>(StringUnmarshaller.Instance, FieldStatsUnmarshaller.Instance);
response.Stats = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("status", targetDepth))
{
var unmarshaller = SearchStatusUnmarshaller.Instance;
response.Status = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}