Beispiel #1
0
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            DescribeSnapshotAttributeResponse response = new DescribeSnapshotAttributeResponse();

            int targetDepth = 2;

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

                        continue;
                    }
                    if (context.TestExpression("createVolumePermission/item", targetDepth))
                    {
                        response.CreateVolumePermissions.Add(CreateVolumePermissionUnmarshaller.GetInstance().Unmarshall(context));

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

                        continue;
                    }
                }
            }


            return(response);
        }
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            DescribeVolumeAttributeResponse response = new DescribeVolumeAttributeResponse();

            int targetDepth = 2;

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

                        continue;
                    }
                    if (context.TestExpression("autoEnableIO/value", targetDepth))
                    {
                        response.AutoEnableIO = BoolUnmarshaller.GetInstance().Unmarshall(context);

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

                        continue;
                    }
                }
            }


            return(response);
        }
        public static ProductCodeUnmarshaller GetInstance()
        {
            if (instance == null)
            {
                instance = new ProductCodeUnmarshaller();
            }

            return(instance);
        }
Beispiel #4
0
        public ImageAttribute Unmarshall(XmlUnmarshallerContext context)
        {
            ImageAttribute imageAttribute = new ImageAttribute();
            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))
                    {
                        imageAttribute.ImageId = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("launchPermission/item", targetDepth))
                    {
                        imageAttribute.LaunchPermissions.Add(LaunchPermissionUnmarshaller.GetInstance().Unmarshall(context));

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

                        continue;
                    }
                    if (context.TestExpression("kernel/value", targetDepth))
                    {
                        imageAttribute.KernelId = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("ramdisk/value", targetDepth))
                    {
                        imageAttribute.RamdiskId = StringUnmarshaller.GetInstance().Unmarshall(context);

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

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

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

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



            return(imageAttribute);
        }
        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 #6
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);
        }
Beispiel #7
0
        public InstanceAttribute Unmarshall(XmlUnmarshallerContext context)
        {
            InstanceAttribute instanceAttribute = new InstanceAttribute();
            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))
                    {
                        instanceAttribute.InstanceId = StringUnmarshaller.GetInstance().Unmarshall(context);

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

                        continue;
                    }
                    if (context.TestExpression("kernel/value", targetDepth))
                    {
                        instanceAttribute.KernelId = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("ramdisk/value", targetDepth))
                    {
                        instanceAttribute.RamdiskId = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("userData/value", targetDepth))
                    {
                        instanceAttribute.UserData = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("disableApiTermination/value", targetDepth))
                    {
                        instanceAttribute.DisableApiTermination = BoolUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("instanceInitiatedShutdownBehavior/value", targetDepth))
                    {
                        instanceAttribute.InstanceInitiatedShutdownBehavior = StringUnmarshaller.GetInstance().Unmarshall(context);

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

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

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

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

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

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



            return(instanceAttribute);
        }