Example #1
0
        public static InstanceMonitoringUnmarshaller GetInstance()
        {
            if (instance == null)
            {
                instance = new InstanceMonitoringUnmarshaller();
            }

            return(instance);
        }
Example #2
0
        public LaunchConfiguration Unmarshall(XmlUnmarshallerContext context)
        {
            LaunchConfiguration launchConfiguration = new LaunchConfiguration();
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

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

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

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

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

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

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

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

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

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

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

                        continue;
                    }
                    if (context.TestExpression("BlockDeviceMappings/member", targetDepth))
                    {
                        launchConfiguration.BlockDeviceMappings.Add(BlockDeviceMappingUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                    if (context.TestExpression("InstanceMonitoring", targetDepth))
                    {
                        launchConfiguration.InstanceMonitoring = InstanceMonitoringUnmarshaller.GetInstance().Unmarshall(context);

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

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

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

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

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



            return(launchConfiguration);
        }