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

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

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

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

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

                        continue;
                    }
                    if (context.TestExpression("instanceState", targetDepth))
                    {
                        instance.State = InstanceStateUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("privateDnsName", targetDepth))
                    {
                        instance.PrivateDnsName = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("dnsName", targetDepth))
                    {
                        instance.PublicDnsName = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("reason", targetDepth))
                    {
                        instance.StateTransitionReason = StringUnmarshaller.GetInstance().Unmarshall(context);

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

                        continue;
                    }
                    if (context.TestExpression("amiLaunchIndex", targetDepth))
                    {
                        instance.AmiLaunchIndex = IntUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("productCodes/item", targetDepth))
                    {
                        instance.ProductCodes.Add(ProductCodeUnmarshaller.GetInstance().Unmarshall(context));

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

                        continue;
                    }
                    if (context.TestExpression("launchTime", targetDepth))
                    {
                        instance.LaunchTime = DateTimeUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("placement", targetDepth))
                    {
                        instance.Placement = PlacementUnmarshaller.GetInstance().Unmarshall(context);

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

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

                        continue;
                    }
                    if (context.TestExpression("platform", targetDepth))
                    {
                        instance.Platform = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("monitoring", targetDepth))
                    {
                        instance.Monitoring = MonitoringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("subnetId", targetDepth))
                    {
                        instance.SubnetId = StringUnmarshaller.GetInstance().Unmarshall(context);

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

                        continue;
                    }
                    if (context.TestExpression("privateIpAddress", targetDepth))
                    {
                        instance.PrivateIpAddress = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("ipAddress", targetDepth))
                    {
                        instance.PublicIpAddress = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("stateReason", targetDepth))
                    {
                        instance.StateReason = StateReasonUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("architecture", targetDepth))
                    {
                        instance.Architecture = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("rootDeviceType", targetDepth))
                    {
                        instance.RootDeviceType = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("rootDeviceName", targetDepth))
                    {
                        instance.RootDeviceName = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("blockDeviceMapping/item", targetDepth))
                    {
                        instance.BlockDeviceMappings.Add(InstanceBlockDeviceMappingUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                    if (context.TestExpression("virtualizationType", targetDepth))
                    {
                        instance.VirtualizationType = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("instanceLifecycle", targetDepth))
                    {
                        instance.InstanceLifecycle = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("spotInstanceRequestId", targetDepth))
                    {
                        instance.SpotInstanceRequestId = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("clientToken", targetDepth))
                    {
                        instance.ClientToken = StringUnmarshaller.GetInstance().Unmarshall(context);

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

                        continue;
                    }
                    if (context.TestExpression("groupSet/item", targetDepth))
                    {
                        instance.SecurityGroups.Add(GroupIdentifierUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                    if (context.TestExpression("sourceDestCheck", targetDepth))
                    {
                        instance.SourceDestCheck = BoolUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("hypervisor", targetDepth))
                    {
                        instance.Hypervisor = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("networkInterfaceSet/item", targetDepth))
                    {
                        instance.NetworkInterfaces.Add(InstanceNetworkInterfaceUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                    if (context.TestExpression("iamInstanceProfile", targetDepth))
                    {
                        instance.IamInstanceProfile = IamInstanceProfileUnmarshaller.GetInstance().Unmarshall(context);

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

                        continue;
                    }
                    if (context.TestExpression("sriovNetSupport", targetDepth))
                    {
                        instance.SriovNetSupport = StringUnmarshaller.GetInstance().Unmarshall(context);

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



            return(instance);
        }
Beispiel #3
0
        public Image Unmarshall(XmlUnmarshallerContext context)
        {
            Image image         = new Image();
            int   originalDepth = context.CurrentDepth;
            int   targetDepth   = originalDepth + 1;

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

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

                        continue;
                    }
                    if (context.TestExpression("imageLocation", targetDepth))
                    {
                        image.ImageLocation = StringUnmarshaller.GetInstance().Unmarshall(context);

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

                        continue;
                    }
                    if (context.TestExpression("imageOwnerId", targetDepth))
                    {
                        image.OwnerId = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("isPublic", targetDepth))
                    {
                        image.Public = BoolUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("productCodes/item", targetDepth))
                    {
                        image.ProductCodes.Add(ProductCodeUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                    if (context.TestExpression("architecture", targetDepth))
                    {
                        image.Architecture = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("imageType", targetDepth))
                    {
                        image.ImageType = StringUnmarshaller.GetInstance().Unmarshall(context);

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

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

                        continue;
                    }
                    if (context.TestExpression("platform", targetDepth))
                    {
                        image.Platform = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("sriovNetSupport", targetDepth))
                    {
                        image.SriovNetSupport = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("stateReason", targetDepth))
                    {
                        image.StateReason = StateReasonUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("imageOwnerAlias", targetDepth))
                    {
                        image.ImageOwnerAlias = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("name", targetDepth))
                    {
                        image.Name = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("description", targetDepth))
                    {
                        image.Description = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("rootDeviceType", targetDepth))
                    {
                        image.RootDeviceType = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("rootDeviceName", targetDepth))
                    {
                        image.RootDeviceName = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("blockDeviceMapping/item", targetDepth))
                    {
                        image.BlockDeviceMappings.Add(BlockDeviceMappingUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                    if (context.TestExpression("virtualizationType", targetDepth))
                    {
                        image.VirtualizationType = StringUnmarshaller.GetInstance().Unmarshall(context);

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

                        continue;
                    }
                    if (context.TestExpression("hypervisor", targetDepth))
                    {
                        image.Hypervisor = StringUnmarshaller.GetInstance().Unmarshall(context);

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



            return(image);
        }