public static ListRuleActionsResponse Unmarshall(UnmarshallerContext context)
        {
            ListRuleActionsResponse listRuleActionsResponse = new ListRuleActionsResponse();

            listRuleActionsResponse.HttpResponse = context.HttpResponse;
            listRuleActionsResponse.RequestId    = context.StringValue("ListRuleActions.RequestId");
            listRuleActionsResponse.Success      = context.BooleanValue("ListRuleActions.Success");
            listRuleActionsResponse.Code         = context.StringValue("ListRuleActions.Code");
            listRuleActionsResponse.ErrorMessage = context.StringValue("ListRuleActions.ErrorMessage");

            List <ListRuleActionsResponse.ListRuleActions_RuleActionInfo> listRuleActionsResponse_ruleActionList = new List <ListRuleActionsResponse.ListRuleActions_RuleActionInfo>();

            for (int i = 0; i < context.Length("ListRuleActions.RuleActionList.Length"); i++)
            {
                ListRuleActionsResponse.ListRuleActions_RuleActionInfo ruleActionInfo = new ListRuleActionsResponse.ListRuleActions_RuleActionInfo();
                ruleActionInfo.Id              = context.LongValue("ListRuleActions.RuleActionList[" + i + "].Id");
                ruleActionInfo.RuleId          = context.LongValue("ListRuleActions.RuleActionList[" + i + "].RuleId");
                ruleActionInfo.Type            = context.StringValue("ListRuleActions.RuleActionList[" + i + "].Type");
                ruleActionInfo.Configuration   = context.StringValue("ListRuleActions.RuleActionList[" + i + "].Configuration");
                ruleActionInfo.ErrorActionFlag = context.BooleanValue("ListRuleActions.RuleActionList[" + i + "].ErrorActionFlag");

                listRuleActionsResponse_ruleActionList.Add(ruleActionInfo);
            }
            listRuleActionsResponse.RuleActionList = listRuleActionsResponse_ruleActionList;

            return(listRuleActionsResponse);
        }
Пример #2
0
        //获取某一规则下的全部转发目的地,包括错误数据转发目的地
        public void TestListRuleActions()
        {
            DefaultAcsClient acsClient = Demo.IotClient.GetClient();
            long             ruleId    = 321103;

            ListRuleActionsRequest request = new ListRuleActionsRequest();

            request.RuleId = ruleId;

            ListRuleActionsResponse response = acsClient.GetAcsResponse(request);

            Console.WriteLine("List Rule Action: " + response.Success);
            if (!(bool)response.Success)
            {
                Console.WriteLine(response.Code + ", " + response.ErrorMessage);
                Console.ReadKey();
                return;
            }
            List <ListRuleActionsResponse.ListRuleActions_RuleActionInfo> ActionInfos = response.RuleActionList;

            for (int i = 0; i < ActionInfos.Count; i += 1)
            {
                ListRuleActionsResponse.ListRuleActions_RuleActionInfo ActionInfo = ActionInfos[i];
                Console.WriteLine("Rule Action ID: " + ActionInfo.Id);
                Console.WriteLine("Rule Action RuleId: " + ActionInfo.RuleId);
                Console.WriteLine("Rule Action Type: " + ActionInfo.Type);
                Console.WriteLine("Rule Action Configuration: " + ActionInfo.Configuration);
                Console.WriteLine("Rule Action ErrorActionFlag: " + ActionInfo.ErrorActionFlag);
                Console.WriteLine();
            }
        }