public static NodeSnapshotUnmarshaller GetInstance()
        {
            if (instance == null)
            {
                instance = new NodeSnapshotUnmarshaller();
            }

            return(instance);
        }
        public Snapshot Unmarshall(XmlUnmarshallerContext context)
        {
            Snapshot snapshot      = new Snapshot();
            int      originalDepth = context.CurrentDepth;
            int      targetDepth   = originalDepth + 1;

            if (context.IsStartOfDocument)
            {
                targetDepth += 2;
            }

            if (context.IsStartOfDocument)
            {
                targetDepth++;
            }

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("SnapshotName", targetDepth))
                    {
                        snapshot.SnapshotName = StringUnmarshaller.GetInstance().Unmarshall(context);

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

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

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

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

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

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

                        continue;
                    }
                    if (context.TestExpression("NumCacheNodes", targetDepth))
                    {
                        snapshot.NumCacheNodes = IntUnmarshaller.GetInstance().Unmarshall(context);

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

                        continue;
                    }
                    if (context.TestExpression("CacheClusterCreateTime", targetDepth))
                    {
                        snapshot.CacheClusterCreateTime = DateTimeUnmarshaller.GetInstance().Unmarshall(context);

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

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

                        continue;
                    }
                    if (context.TestExpression("Port", targetDepth))
                    {
                        snapshot.Port = IntUnmarshaller.GetInstance().Unmarshall(context);

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

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

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

                        continue;
                    }
                    if (context.TestExpression("AutoMinorVersionUpgrade", targetDepth))
                    {
                        snapshot.AutoMinorVersionUpgrade = BoolUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("SnapshotRetentionLimit", targetDepth))
                    {
                        snapshot.SnapshotRetentionLimit = IntUnmarshaller.GetInstance().Unmarshall(context);

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

                        continue;
                    }
                    if (context.TestExpression("NodeSnapshots/NodeSnapshot", targetDepth))
                    {
                        snapshot.NodeSnapshots.Add(NodeSnapshotUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth < originalDepth)
                {
                    return(snapshot);
                }
            }



            return(snapshot);
        }