public static ExportImageResponse Unmarshall(UnmarshallerContext _ctx)
        {
            ExportImageResponse exportImageResponse = new ExportImageResponse();

            exportImageResponse.HttpResponse = _ctx.HttpResponse;
            exportImageResponse.RequestId    = _ctx.StringValue("ExportImage.RequestId");
            exportImageResponse.TaskId       = _ctx.StringValue("ExportImage.TaskId");
            exportImageResponse.RegionId     = _ctx.StringValue("ExportImage.RegionId");

            return(exportImageResponse);
        }
        public static ExportImageResponse Unmarshall(UnmarshallerContext context)
        {
            ExportImageResponse exportImageResponse = new ExportImageResponse
            {
                HttpResponse = context.HttpResponse,
                RequestId    = context.StringValue("ExportImage.RequestId"),
                TaskId       = context.StringValue("ExportImage.TaskId"),
                RegionId     = context.StringValue("ExportImage.RegionId")
            };


            return(exportImageResponse);
        }
Example #3
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)
        {
            ExportImageResponse response = new ExportImageResponse();

            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("description", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.Description = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("diskImageFormat", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.DiskImageFormat = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("exportImageTaskId", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.ExportImageTaskId = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("imageId", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.ImageId = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("progress", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.Progress = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("roleName", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.RoleName = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("s3ExportLocation", targetDepth))
                    {
                        var unmarshaller = ExportTaskS3LocationUnmarshaller.Instance;
                        response.S3ExportLocation = unmarshaller.Unmarshall(context);
                        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;
                    }
                    if (context.TestExpression("tagSet/item", targetDepth))
                    {
                        var unmarshaller = TagUnmarshaller.Instance;
                        var item         = unmarshaller.Unmarshall(context);
                        response.Tags.Add(item);
                        continue;
                    }
                }
            }

            return(response);
        }