public ReservedInstances Unmarshall(XmlUnmarshallerContext context) { ReservedInstances reservedInstances = new ReservedInstances(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth += 1; } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("reservedInstancesId", targetDepth)) { reservedInstances.ReservedInstancesId = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("instanceType", targetDepth)) { reservedInstances.InstanceType = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("availabilityZone", targetDepth)) { reservedInstances.AvailabilityZone = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("start", targetDepth)) { reservedInstances.Start = DateTimeUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("end", targetDepth)) { reservedInstances.End = DateTimeUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("duration", targetDepth)) { reservedInstances.Duration = LongUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("usagePrice", targetDepth)) { reservedInstances.UsagePrice = FloatUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("fixedPrice", targetDepth)) { reservedInstances.FixedPrice = FloatUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("instanceCount", targetDepth)) { reservedInstances.InstanceCount = IntUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("productDescription", targetDepth)) { reservedInstances.ProductDescription = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("state", targetDepth)) { reservedInstances.State = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("tagSet/item", targetDepth)) { reservedInstances.Tags.Add(TagUnmarshaller.GetInstance().Unmarshall(context)); continue; } if (context.TestExpression("instanceTenancy", targetDepth)) { reservedInstances.InstanceTenancy = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("currencyCode", targetDepth)) { reservedInstances.CurrencyCode = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("offeringType", targetDepth)) { reservedInstances.OfferingType = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("recurringCharges/item", targetDepth)) { reservedInstances.RecurringCharges.Add(RecurringChargeUnmarshaller.GetInstance().Unmarshall(context)); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return(reservedInstances); } } return(reservedInstances); }
public ReservedInstancesOffering Unmarshall(XmlUnmarshallerContext context) { ReservedInstancesOffering reservedInstancesOffering = new ReservedInstancesOffering(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth += 1; } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("reservedInstancesOfferingId", targetDepth)) { reservedInstancesOffering.ReservedInstancesOfferingId = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("instanceType", targetDepth)) { reservedInstancesOffering.InstanceType = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("availabilityZone", targetDepth)) { reservedInstancesOffering.AvailabilityZone = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("duration", targetDepth)) { reservedInstancesOffering.Duration = LongUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("usagePrice", targetDepth)) { reservedInstancesOffering.UsagePrice = FloatUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("fixedPrice", targetDepth)) { reservedInstancesOffering.FixedPrice = FloatUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("productDescription", targetDepth)) { reservedInstancesOffering.ProductDescription = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("instanceTenancy", targetDepth)) { reservedInstancesOffering.InstanceTenancy = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("currencyCode", targetDepth)) { reservedInstancesOffering.CurrencyCode = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("offeringType", targetDepth)) { reservedInstancesOffering.OfferingType = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("recurringCharges/item", targetDepth)) { reservedInstancesOffering.RecurringCharges.Add(RecurringChargeUnmarshaller.GetInstance().Unmarshall(context)); continue; } if (context.TestExpression("marketplace", targetDepth)) { reservedInstancesOffering.Marketplace = BoolUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("pricingDetailsSet/item", targetDepth)) { reservedInstancesOffering.PricingDetails.Add(PricingDetailUnmarshaller.GetInstance().Unmarshall(context)); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return(reservedInstancesOffering); } } return(reservedInstancesOffering); }