public static StorediSCSIVolumeUnmarshaller GetInstance()
 {
     if (instance == null)
     {
         instance = new StorediSCSIVolumeUnmarshaller();
     }
     return(instance);
 }
        public DescribeStorediSCSIVolumesResult Unmarshall(JsonUnmarshallerContext context)
        {
            DescribeStorediSCSIVolumesResult describeStorediSCSIVolumesResult = new DescribeStorediSCSIVolumesResult();

            describeStorediSCSIVolumesResult.StorediSCSIVolumes = null;

            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            while (context.Read())
            {
                if ((context.IsKey) && (context.CurrentDepth == targetDepth))
                {
                    context.Read();
                    context.Read();

                    if (context.TestExpression("StorediSCSIVolumes", targetDepth))
                    {
                        describeStorediSCSIVolumesResult.StorediSCSIVolumes = new List <StorediSCSIVolume>();
                        StorediSCSIVolumeUnmarshaller unmarshaller = StorediSCSIVolumeUnmarshaller.GetInstance();
                        while (context.Read())
                        {
                            if ((context.IsArrayElement) && (context.CurrentDepth == targetDepth))
                            {
                                describeStorediSCSIVolumesResult.StorediSCSIVolumes.Add(unmarshaller.Unmarshall(context));
                            }
                            else if (context.IsEndArray)
                            {
                                break;
                            }
                        }
                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth <= originalDepth)
                {
                    return(describeStorediSCSIVolumesResult);
                }
            }


            return(describeStorediSCSIVolumesResult);
        }
Esempio n. 3
0
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            DescribeStorediSCSIVolumesResponse response = new DescribeStorediSCSIVolumesResponse();

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("StorediSCSIVolumes", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <StorediSCSIVolume, StorediSCSIVolumeUnmarshaller>(
                        StorediSCSIVolumeUnmarshaller.GetInstance());
                    response.StorediSCSIVolumes = unmarshaller.Unmarshall(context);

                    continue;
                }
            }

            return(response);
        }
        private static void UnmarshallResult(JsonUnmarshallerContext context, DescribeStorediSCSIVolumesResponse response)
        {
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

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

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

            return;
        }