public static ImportImageResponse Unmarshall(UnmarshallerContext context)
        {
            ImportImageResponse importImageResponse = new ImportImageResponse();

            importImageResponse.HttpResponse = context.HttpResponse;
            importImageResponse.RequestId    = context.StringValue("ImportImage.RequestId");
            importImageResponse.TaskId       = context.StringValue("ImportImage.TaskId");
            importImageResponse.RegionId     = context.StringValue("ImportImage.RegionId");
            importImageResponse.ImageId      = context.StringValue("ImportImage.ImageId");

            return(importImageResponse);
        }
Beispiel #2
0
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            ImportImageResponse response = new ImportImageResponse();

            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

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

            while (context.ReadAtDepth(originalDepth))
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("architecture", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.Architecture = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("description", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.Description = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("encrypted", targetDepth))
                    {
                        var unmarshaller = BoolUnmarshaller.Instance;
                        response.Encrypted = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("hypervisor", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.Hypervisor = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("imageId", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.ImageId = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("importTaskId", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.ImportTaskId = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("kmsKeyId", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.KmsKeyId = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("licenseType", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.LicenseType = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("platform", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.Platform = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("progress", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.Progress = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("snapshotDetailSet/item", targetDepth))
                    {
                        var unmarshaller = SnapshotDetailUnmarshaller.Instance;
                        var item         = unmarshaller.Unmarshall(context);
                        response.SnapshotDetails.Add(item);
                        continue;
                    }
                    if (context.TestExpression("status", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.Status = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("statusMessage", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.StatusMessage = unmarshaller.Unmarshall(context);
                        continue;
                    }
                }
            }

            return(response);
        }