public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            DescribeTapeArchivesResponse response = new DescribeTapeArchivesResponse();

            context.Read();
            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("TapeArchives", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <TapeArchive, TapeArchiveUnmarshaller>(
                        TapeArchiveUnmarshaller.GetInstance());
                    response.TapeArchives = unmarshaller.Unmarshall(context);

                    continue;
                }

                if (context.TestExpression("Marker", targetDepth))
                {
                    response.Marker = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
 public static TapeArchiveUnmarshaller GetInstance()
 {
     if (instance == null)
     {
         instance = new TapeArchiveUnmarshaller();
     }
     return(instance);
 }
        private static void UnmarshallResult(JsonUnmarshallerContext context, DescribeTapeArchivesResponse response)
        {
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            while (context.Read())
            {
                if (context.TestExpression("TapeArchives", targetDepth))
                {
                    context.Read();
                    response.TapeArchives = new List <TapeArchive>();
                    TapeArchiveUnmarshaller unmarshaller = TapeArchiveUnmarshaller.GetInstance();
                    while (context.Read())
                    {
                        JsonToken token = context.CurrentTokenType;
                        if (token == JsonToken.ArrayStart)
                        {
                            continue;
                        }
                        if (token == JsonToken.ArrayEnd)
                        {
                            break;
                        }
                        response.TapeArchives.Add(unmarshaller.Unmarshall(context));
                    }
                    continue;
                }

                if (context.TestExpression("Marker", targetDepth))
                {
                    context.Read();
                    response.Marker = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.CurrentDepth <= originalDepth)
                {
                    return;
                }
            }

            return;
        }