Esempio n. 1
0
        public static AvailabilityZoneUnmarshaller GetInstance()
        {
            if (instance == null)
            {
                instance = new AvailabilityZoneUnmarshaller();
            }

            return(instance);
        }
        public OrderableDBInstanceOption Unmarshall(UnmarshallerContext context)
        {
            OrderableDBInstanceOption orderableDBInstanceOption = new OrderableDBInstanceOption();
            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("Engine", targetDepth))
                    {
                        orderableDBInstanceOption.Engine = StringUnmarshaller.GetInstance().Unmarshall(context);

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

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

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

                        continue;
                    }
                    if (context.TestExpression("AvailabilityZones/AvailabilityZone", targetDepth))
                    {
                        orderableDBInstanceOption.AvailabilityZones.Add(AvailabilityZoneUnmarshaller.GetInstance().Unmarshall(context));

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

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

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

            return(orderableDBInstanceOption);
        }