示例#1
0
        public ReservedCacheNodesOffering Unmarshall(XmlUnmarshallerContext context)
        {
            ReservedCacheNodesOffering reservedCacheNodesOffering = new ReservedCacheNodesOffering();
            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("ReservedCacheNodesOfferingId", targetDepth))
                    {
                        reservedCacheNodesOffering.ReservedCacheNodesOfferingId = StringUnmarshaller.GetInstance().Unmarshall(context);

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

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

                        continue;
                    }
                    if (context.TestExpression("FixedPrice", targetDepth))
                    {
                        reservedCacheNodesOffering.FixedPrice = DoubleUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("UsagePrice", targetDepth))
                    {
                        reservedCacheNodesOffering.UsagePrice = DoubleUnmarshaller.GetInstance().Unmarshall(context);

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

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

                        continue;
                    }
                    if (context.TestExpression("RecurringCharges/RecurringCharge", targetDepth))
                    {
                        reservedCacheNodesOffering.RecurringCharges.Add(RecurringChargeUnmarshaller.GetInstance().Unmarshall(context));

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



            return(reservedCacheNodesOffering);
        }
        public ItemCollectionMetrics Unmarshall(JsonUnmarshallerContext context)
        {
            ItemCollectionMetrics itemCollectionMetrics = new ItemCollectionMetrics();

            itemCollectionMetrics.ItemCollectionKey   = null;
            itemCollectionMetrics.SizeEstimateRangeGB = 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("ItemCollectionKey", targetDepth))
                    {
                        itemCollectionMetrics.ItemCollectionKey = new Dictionary <String, AttributeValue>();
                        KeyValueUnmarshaller <string, AttributeValue, StringUnmarshaller, AttributeValueUnmarshaller> unmarshaller = new KeyValueUnmarshaller <string, AttributeValue, StringUnmarshaller, AttributeValueUnmarshaller>(StringUnmarshaller.GetInstance(), AttributeValueUnmarshaller.GetInstance());
                        while (context.Read())
                        {
                            if (((context.IsStartArray || context.IsStartElement || context.IsLeafValue) && (context.CurrentDepth == targetDepth)) ||
                                ((context.IsKey) && (context.CurrentDepth == targetDepth + 1)))
                            {
                                KeyValuePair <string, AttributeValue> kvp = unmarshaller.Unmarshall(context);
                                itemCollectionMetrics.ItemCollectionKey.Add(kvp.Key, kvp.Value);
                            }
                            else if (context.IsEndElement)
                            {
                                break;
                            }
                        }
                        continue;
                    }

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


            return(itemCollectionMetrics);
        }
        public QueryResult Unmarshall(JsonUnmarshallerContext context)
        {
            QueryResult queryResult = new QueryResult();

            queryResult.Items = 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("Items", targetDepth))
                    {
                        queryResult.Items = new List <Dictionary <string, AttributeValue> >();
                        DictionaryUnmarshaller <string, AttributeValue, StringUnmarshaller, AttributeValueUnmarshaller> unmarshaller = new DictionaryUnmarshaller <string, AttributeValue, StringUnmarshaller, AttributeValueUnmarshaller>(StringUnmarshaller.GetInstance(), AttributeValueUnmarshaller.GetInstance());
                        while (context.Read())
                        {
                            if ((context.IsArrayElement) && (context.CurrentDepth == targetDepth))
                            {
                                queryResult.Items.Add(unmarshaller.Unmarshall(context));
                            }
                            else if (context.IsEndArray)
                            {
                                break;
                            }
                        }
                        continue;
                    }

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

                    if (context.TestExpression("LastEvaluatedKey", targetDepth))
                    {
                        queryResult.LastEvaluatedKey = KeyUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("ConsumedCapacityUnits", targetDepth))
                    {
                        queryResult.ConsumedCapacityUnits = DoubleUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth <= originalDepth)
                {
                    return(queryResult);
                }
            }


            return(queryResult);
        }
示例#4
0
        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("SnapshotIdentifier", targetDepth))
                    {
                        snapshot.SnapshotIdentifier = StringUnmarshaller.GetInstance().Unmarshall(context);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        continue;
                    }
                    if (context.TestExpression("AccountsWithRestoreAccess/AccountWithRestoreAccess", targetDepth))
                    {
                        snapshot.AccountsWithRestoreAccess.Add(AccountWithRestoreAccessUnmarshaller.GetInstance().Unmarshall(context));

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

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

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

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

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

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

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

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

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



            return(snapshot);
        }
示例#5
0
        public DoubleOptions Unmarshall(XmlUnmarshallerContext context)
        {
            DoubleOptions doubleOptions = new DoubleOptions();
            int           originalDepth = context.CurrentDepth;
            int           targetDepth   = originalDepth + 1;

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

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("DefaultValue", targetDepth))
                    {
                        doubleOptions.DefaultValue = DoubleUnmarshaller.GetInstance().Unmarshall(context);

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

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

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

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

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

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



            return(doubleOptions);
        }
示例#6
0
        public TrustedAdvisorCostOptimizingSummary Unmarshall(JsonUnmarshallerContext context)
        {
            context.Read();
            if (context.CurrentTokenType == JsonToken.Null)
            {
                return(null);
            }
            TrustedAdvisorCostOptimizingSummary trustedAdvisorCostOptimizingSummary = new TrustedAdvisorCostOptimizingSummary();


            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("estimatedMonthlySavings", targetDepth))
                {
                    trustedAdvisorCostOptimizingSummary.EstimatedMonthlySavings = DoubleUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("estimatedPercentMonthlySavings", targetDepth))
                {
                    trustedAdvisorCostOptimizingSummary.EstimatedPercentMonthlySavings = DoubleUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }
            }

            return(trustedAdvisorCostOptimizingSummary);
        }
        public ItemCollectionMetrics Unmarshall(JsonUnmarshallerContext context)
        {
            if (context.CurrentTokenType == JsonToken.Null)
            {
                return(null);
            }

            ItemCollectionMetrics itemCollectionMetrics = new ItemCollectionMetrics();



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

            while (context.Read())
            {
                if (context.TestExpression("ItemCollectionKey", targetDepth))
                {
                    context.Read();
                    itemCollectionMetrics.ItemCollectionKey = new Dictionary <String, AttributeValue>();
                    if (context.CurrentTokenType == JsonToken.Null)
                    {
                        continue;
                    }
                    KeyValueUnmarshaller <string, AttributeValue, StringUnmarshaller, AttributeValueUnmarshaller> unmarshaller = new KeyValueUnmarshaller <string, AttributeValue, StringUnmarshaller, AttributeValueUnmarshaller>(StringUnmarshaller.GetInstance(), AttributeValueUnmarshaller.GetInstance());
                    while (context.Read())
                    {
                        JsonToken token = context.CurrentTokenType;
                        if (token == JsonToken.ArrayStart || token == JsonToken.ObjectStart)
                        {
                            continue;
                        }
                        if (token == JsonToken.ArrayEnd || token == JsonToken.ObjectEnd)
                        {
                            break;
                        }
                        KeyValuePair <string, AttributeValue> kvp = unmarshaller.Unmarshall(context);
                        itemCollectionMetrics.ItemCollectionKey.Add(kvp.Key, kvp.Value);
                    }
                    continue;
                }

                if (context.TestExpression("SizeEstimateRangeGB", targetDepth))
                {
                    context.Read();
                    itemCollectionMetrics.SizeEstimateRangeGB = new List <Double>();
                    if (context.CurrentTokenType == JsonToken.Null)
                    {
                        continue;
                    }
                    DoubleUnmarshaller unmarshaller = DoubleUnmarshaller.GetInstance();
                    while (context.Read())
                    {
                        JsonToken token = context.CurrentTokenType;
                        if (token == JsonToken.ArrayStart)
                        {
                            continue;
                        }
                        if (token == JsonToken.ArrayEnd)
                        {
                            break;
                        }
                        itemCollectionMetrics.SizeEstimateRangeGB.Add(unmarshaller.Unmarshall(context));
                    }
                    continue;
                }

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


            return(itemCollectionMetrics);
        }
        public MetricAlarm Unmarshall(XmlUnmarshallerContext context)
        {
            MetricAlarm metricAlarm   = new MetricAlarm();
            int         originalDepth = context.CurrentDepth;
            int         targetDepth   = originalDepth + 1;

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

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

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

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

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

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

                        continue;
                    }
                    if (context.TestExpression("OKActions/member", targetDepth))
                    {
                        metricAlarm.OKActions.Add(StringUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                    if (context.TestExpression("AlarmActions/member", targetDepth))
                    {
                        metricAlarm.AlarmActions.Add(StringUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                    if (context.TestExpression("InsufficientDataActions/member", targetDepth))
                    {
                        metricAlarm.InsufficientDataActions.Add(StringUnmarshaller.GetInstance().Unmarshall(context));

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

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

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

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

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

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

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

                        continue;
                    }
                    if (context.TestExpression("Dimensions/member", targetDepth))
                    {
                        metricAlarm.Dimensions.Add(DimensionUnmarshaller.GetInstance().Unmarshall(context));

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

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

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

                        continue;
                    }
                    if (context.TestExpression("Threshold", targetDepth))
                    {
                        metricAlarm.Threshold = DoubleUnmarshaller.GetInstance().Unmarshall(context);

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

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



            return(metricAlarm);
        }
        public ReservedNode Unmarshall(XmlUnmarshallerContext context)
        {
            ReservedNode reservedNode  = new ReservedNode();
            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("ReservedNodeId", targetDepth))
                    {
                        reservedNode.ReservedNodeId = StringUnmarshaller.GetInstance().Unmarshall(context);

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

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

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

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

                        continue;
                    }
                    if (context.TestExpression("FixedPrice", targetDepth))
                    {
                        reservedNode.FixedPrice = DoubleUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("UsagePrice", targetDepth))
                    {
                        reservedNode.UsagePrice = DoubleUnmarshaller.GetInstance().Unmarshall(context);

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

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

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

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

                        continue;
                    }
                    if (context.TestExpression("RecurringCharges/RecurringCharge", targetDepth))
                    {
                        reservedNode.RecurringCharges.Add(RecurringChargeUnmarshaller.GetInstance().Unmarshall(context));

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



            return(reservedNode);
        }
        public ConsumedCapacity Unmarshall(JsonUnmarshallerContext context)
        {
            if (context.CurrentTokenType == JsonToken.Null)
            {
                return(null);
            }

            ConsumedCapacity consumedCapacity = new ConsumedCapacity();



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

            while (context.Read())
            {
                if (context.TestExpression("TableName", targetDepth))
                {
                    context.Read();
                    consumedCapacity.TableName = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("CapacityUnits", targetDepth))
                {
                    context.Read();
                    consumedCapacity.CapacityUnits = DoubleUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("Table", targetDepth))
                {
                    context.Read();
                    consumedCapacity.Table = CapacityUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("LocalSecondaryIndexes", targetDepth))
                {
                    context.Read();
                    consumedCapacity.LocalSecondaryIndexes = new Dictionary <String, Capacity>();
                    if (context.CurrentTokenType == JsonToken.Null)
                    {
                        continue;
                    }
                    KeyValueUnmarshaller <string, Capacity, StringUnmarshaller, CapacityUnmarshaller> unmarshaller = new KeyValueUnmarshaller <string, Capacity, StringUnmarshaller, CapacityUnmarshaller>(StringUnmarshaller.GetInstance(), CapacityUnmarshaller.GetInstance());
                    while (context.Read())
                    {
                        JsonToken token = context.CurrentTokenType;
                        if (token == JsonToken.ArrayStart || token == JsonToken.ObjectStart)
                        {
                            continue;
                        }
                        if (token == JsonToken.ArrayEnd || token == JsonToken.ObjectEnd)
                        {
                            break;
                        }
                        KeyValuePair <string, Capacity> kvp = unmarshaller.Unmarshall(context);
                        consumedCapacity.LocalSecondaryIndexes.Add(kvp.Key, kvp.Value);
                    }
                    continue;
                }

                if (context.TestExpression("GlobalSecondaryIndexes", targetDepth))
                {
                    context.Read();
                    consumedCapacity.GlobalSecondaryIndexes = new Dictionary <String, Capacity>();
                    if (context.CurrentTokenType == JsonToken.Null)
                    {
                        continue;
                    }
                    KeyValueUnmarshaller <string, Capacity, StringUnmarshaller, CapacityUnmarshaller> unmarshaller = new KeyValueUnmarshaller <string, Capacity, StringUnmarshaller, CapacityUnmarshaller>(StringUnmarshaller.GetInstance(), CapacityUnmarshaller.GetInstance());
                    while (context.Read())
                    {
                        JsonToken token = context.CurrentTokenType;
                        if (token == JsonToken.ArrayStart || token == JsonToken.ObjectStart)
                        {
                            continue;
                        }
                        if (token == JsonToken.ArrayEnd || token == JsonToken.ObjectEnd)
                        {
                            break;
                        }
                        KeyValuePair <string, Capacity> kvp = unmarshaller.Unmarshall(context);
                        consumedCapacity.GlobalSecondaryIndexes.Add(kvp.Key, kvp.Value);
                    }
                    continue;
                }

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


            return(consumedCapacity);
        }
        public StorediSCSIVolume Unmarshall(JsonUnmarshallerContext context)
        {
            context.Read();
            if (context.CurrentTokenType == JsonToken.Null)
            {
                return(null);
            }
            StorediSCSIVolume storediSCSIVolume = new StorediSCSIVolume();


            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("VolumeARN", targetDepth))
                {
                    storediSCSIVolume.VolumeARN = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

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

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

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

                if (context.TestExpression("VolumeSizeInBytes", targetDepth))
                {
                    storediSCSIVolume.VolumeSizeInBytes = LongUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("VolumeProgress", targetDepth))
                {
                    storediSCSIVolume.VolumeProgress = DoubleUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

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

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

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

                if (context.TestExpression("VolumeiSCSIAttributes", targetDepth))
                {
                    storediSCSIVolume.VolumeiSCSIAttributes = VolumeiSCSIAttributesUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }
            }

            return(storediSCSIVolume);
        }
        public Datapoint Unmarshall(XmlUnmarshallerContext context)
        {
            Datapoint datapoint     = new Datapoint();
            int       originalDepth = context.CurrentDepth;
            int       targetDepth   = originalDepth + 1;

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

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("Timestamp", targetDepth))
                    {
                        datapoint.Timestamp = DateTimeUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("SampleCount", targetDepth))
                    {
                        datapoint.SampleCount = DoubleUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("Average", targetDepth))
                    {
                        datapoint.Average = DoubleUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("Sum", targetDepth))
                    {
                        datapoint.Sum = DoubleUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("Minimum", targetDepth))
                    {
                        datapoint.Minimum = DoubleUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("Maximum", targetDepth))
                    {
                        datapoint.Maximum = DoubleUnmarshaller.GetInstance().Unmarshall(context);

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

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



            return(datapoint);
        }