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

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

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

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

                        continue;
                    }
                    if (context.TestExpression("bucket", targetDepth))
                    {
                        spotDatafeedSubscription.Bucket = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("prefix", targetDepth))
                    {
                        spotDatafeedSubscription.Prefix = StringUnmarshaller.GetInstance().Unmarshall(context);

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

                        continue;
                    }
                    if (context.TestExpression("fault", targetDepth))
                    {
                        spotDatafeedSubscription.Fault = SpotInstanceStateFaultUnmarshaller.GetInstance().Unmarshall(context);

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



            return(spotDatafeedSubscription);
        }
Exemplo n.º 3
0
        public SpotInstanceRequest Unmarshall(XmlUnmarshallerContext context)
        {
            SpotInstanceRequest spotInstanceRequest = new SpotInstanceRequest();
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

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

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

                        continue;
                    }
                    if (context.TestExpression("spotPrice", targetDepth))
                    {
                        spotInstanceRequest.SpotPrice = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("type", targetDepth))
                    {
                        spotInstanceRequest.Type = StringUnmarshaller.GetInstance().Unmarshall(context);

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

                        continue;
                    }
                    if (context.TestExpression("fault", targetDepth))
                    {
                        spotInstanceRequest.Fault = SpotInstanceStateFaultUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("status", targetDepth))
                    {
                        spotInstanceRequest.Status = SpotInstanceStatusUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("validFrom", targetDepth))
                    {
                        spotInstanceRequest.ValidFrom = DateTimeUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("validUntil", targetDepth))
                    {
                        spotInstanceRequest.ValidUntil = DateTimeUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("launchGroup", targetDepth))
                    {
                        spotInstanceRequest.LaunchGroup = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("availabilityZoneGroup", targetDepth))
                    {
                        spotInstanceRequest.AvailabilityZoneGroup = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("launchSpecification", targetDepth))
                    {
                        spotInstanceRequest.LaunchSpecification = LaunchSpecificationUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("instanceId", targetDepth))
                    {
                        spotInstanceRequest.InstanceId = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("createTime", targetDepth))
                    {
                        spotInstanceRequest.CreateTime = DateTimeUnmarshaller.GetInstance().Unmarshall(context);

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

                        continue;
                    }
                    if (context.TestExpression("tagSet/item", targetDepth))
                    {
                        spotInstanceRequest.Tags.Add(TagUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                    if (context.TestExpression("launchedAvailabilityZone", targetDepth))
                    {
                        spotInstanceRequest.LaunchedAvailabilityZone = StringUnmarshaller.GetInstance().Unmarshall(context);

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



            return(spotInstanceRequest);
        }