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

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("Capacity", targetDepth))
                {
                    var unmarshaller = LongUnmarshaller.Instance;
                    response.Capacity = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("Rules", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <RuleSummary, RuleSummaryUnmarshaller>(RuleSummaryUnmarshaller.Instance);
                    response.Rules = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
Exemple #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)
        {
            DescribeManagedRuleGroupResponse response = new DescribeManagedRuleGroupResponse();

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("AvailableLabels", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <LabelSummary, LabelSummaryUnmarshaller>(LabelSummaryUnmarshaller.Instance);
                    response.AvailableLabels = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("Capacity", targetDepth))
                {
                    var unmarshaller = LongUnmarshaller.Instance;
                    response.Capacity = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("ConsumedLabels", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <LabelSummary, LabelSummaryUnmarshaller>(LabelSummaryUnmarshaller.Instance);
                    response.ConsumedLabels = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("LabelNamespace", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.LabelNamespace = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("Rules", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <RuleSummary, RuleSummaryUnmarshaller>(RuleSummaryUnmarshaller.Instance);
                    response.Rules = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("SnsTopicArn", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.SnsTopicArn = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("VersionName", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.VersionName = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }