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

            context.Read();
            int targetDepth = context.CurrentDepth;
            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("CreateTime", targetDepth))
                {
                    var unmarshaller = DateTimeUnmarshaller.Instance;
                    response.CreateTime = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("Description", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.Description = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("PricingPlan", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.PricingPlan = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("PricingPlanDataSource", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.PricingPlanDataSource = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("TrackerArn", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.TrackerArn = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("TrackerName", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.TrackerName = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("UpdateTime", targetDepth))
                {
                    var unmarshaller = DateTimeUnmarshaller.Instance;
                    response.UpdateTime = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return response;
        }
Ejemplo n.º 2
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)
        {
            DescribeTrackerResponse response = new DescribeTrackerResponse();

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("CreateTime", targetDepth))
                {
                    var unmarshaller = DateTimeUnmarshaller.Instance;
                    response.CreateTime = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("Description", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.Description = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("KmsKeyId", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.KmsKeyId = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("PositionFiltering", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.PositionFiltering = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("PricingPlan", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.PricingPlan = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("PricingPlanDataSource", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.PricingPlanDataSource = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("Tags", targetDepth))
                {
                    var unmarshaller = new DictionaryUnmarshaller <string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance);
                    response.Tags = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("TrackerArn", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.TrackerArn = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("TrackerName", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.TrackerName = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("UpdateTime", targetDepth))
                {
                    var unmarshaller = DateTimeUnmarshaller.Instance;
                    response.UpdateTime = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }