コード例 #1
0
        //获取某一规则的详细信息
        public void TestGetRuleAction()
        {
            DefaultAcsClient acsClient    = Demo.IotClient.GetClient();
            long             ruleActionId = 309386;

            GetRuleActionRequest request = new GetRuleActionRequest();

            request.ActionId = ruleActionId;

            GetRuleActionResponse response = acsClient.GetAcsResponse(request);

            Console.WriteLine("Get Rule Action: " + response.Success);
            if (!(bool)response.Success)
            {
                Console.WriteLine(response.Code + ", " + response.ErrorMessage);
                Console.ReadKey();
                return;
            }
            GetRuleActionResponse.GetRuleAction_RuleActionInfo ActionInfo = response.RuleActionInfo;
            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);
        }
        public static GetRuleActionResponse Unmarshall(UnmarshallerContext context)
        {
            GetRuleActionResponse getRuleActionResponse = new GetRuleActionResponse();

            getRuleActionResponse.HttpResponse = context.HttpResponse;
            getRuleActionResponse.RequestId    = context.StringValue("GetRuleAction.RequestId");
            getRuleActionResponse.Success      = context.BooleanValue("GetRuleAction.Success");
            getRuleActionResponse.ErrorMessage = context.StringValue("GetRuleAction.ErrorMessage");

            GetRuleActionResponse.GetRuleAction_RuleActionInfo ruleActionInfo = new GetRuleActionResponse.GetRuleAction_RuleActionInfo();
            ruleActionInfo.Id                    = context.LongValue("GetRuleAction.RuleActionInfo.Id");
            ruleActionInfo.RuleId                = context.LongValue("GetRuleAction.RuleActionInfo.RuleId");
            ruleActionInfo.Type                  = context.StringValue("GetRuleAction.RuleActionInfo.Type");
            ruleActionInfo.Configuration         = context.StringValue("GetRuleAction.RuleActionInfo.Configuration");
            getRuleActionResponse.RuleActionInfo = ruleActionInfo;

            return(getRuleActionResponse);
        }