示例#1
0
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            DescribePackageVersionResponse response = new DescribePackageVersionResponse();

            context.Read();
            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("packageVersion", targetDepth))
                {
                    var unmarshaller = PackageVersionDescriptionUnmarshaller.Instance;
                    response.PackageVersion = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            DescribePackageVersionResponse response = new DescribePackageVersionResponse();

            context.Read();
            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("IsLatestPatch", targetDepth))
                {
                    var unmarshaller = BoolUnmarshaller.Instance;
                    response.IsLatestPatch = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("OwnerAccount", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.OwnerAccount = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("PackageArn", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.PackageArn = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("PackageId", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.PackageId = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("PackageName", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.PackageName = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("PackageVersion", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.PackageVersion = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("PatchVersion", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.PatchVersion = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("RegisteredTime", targetDepth))
                {
                    var unmarshaller = DateTimeUnmarshaller.Instance;
                    response.RegisteredTime = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("Status", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.Status = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("StatusDescription", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.StatusDescription = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }