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


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

            context.Read();
            int targetDepth = context.CurrentDepth;
            while (context.ReadAtDepth(targetDepth))
            {
                if (context.IsStartElement)
                {                    
                    if(context.TestExpression("DeleteRuleResult", 2))
                    {
                        UnmarshallResult(context, response);                        
                        continue;
                    }
                    
                    if (context.TestExpression("ResponseMetadata", 2))
                    {
                        response.ResponseMetadata = ResponseMetadataUnmarshaller.Instance.Unmarshall(context);
                    }
                }
            }

            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)
        {
            DeleteRuleResponse response = new DeleteRuleResponse();


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

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.IsStartElement)
                {
                    if (context.TestExpression("DeleteRuleResult", 2))
                    {
                        UnmarshallResult(context, response);
                        continue;
                    }

                    if (context.TestExpression("ResponseMetadata", 2))
                    {
                        response.ResponseMetadata = ResponseMetadataUnmarshaller.Instance.Unmarshall(context);
                    }
                }
            }

            return(response);
        }
        public static DeleteRuleResponse Unmarshall(UnmarshallerContext context)
        {
            DeleteRuleResponse deleteRuleResponse = new DeleteRuleResponse();

            deleteRuleResponse.HttpResponse = context.HttpResponse;
            deleteRuleResponse.RequestId    = context.StringValue("DeleteRule.RequestId");

            return(deleteRuleResponse);
        }
Esempio n. 6
0
        public static DeleteRuleResponse Unmarshall(UnmarshallerContext context)
        {
            DeleteRuleResponse deleteRuleResponse = new DeleteRuleResponse();

            deleteRuleResponse.HttpResponse = context.HttpResponse;
            deleteRuleResponse.RequestId    = context.StringValue("DeleteRule.RequestId");
            deleteRuleResponse.Success      = context.BooleanValue("DeleteRule.Success");
            deleteRuleResponse.ErrorMessage = context.StringValue("DeleteRule.ErrorMessage");

            return(deleteRuleResponse);
        }
        /// <summary>
        /// 删除规则
        /// </summary>
        public DeleteRuleResponse DeleteRule(DeleteRuleRequest deleteRuleRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("rule_id", deleteRuleRequest.RuleId.ToString());
            string              urlPath            = HttpUtils.AddUrlPath("/v5/iot/{project_id}/rules/{rule_id}", urlParam);
            SdkRequest          request            = HttpUtils.InitSdkRequest(urlPath, deleteRuleRequest);
            HttpResponseMessage response           = DoHttpRequestSync("DELETE", request);
            DeleteRuleResponse  deleteRuleResponse = JsonUtils.DeSerializeNull <DeleteRuleResponse>(response);

            return(deleteRuleResponse);
        }
Esempio n. 8
0
        //删除已经创建好的规则
        public void TestDeleteRule()
        {
            DefaultAcsClient acsClient = Demo.IotClient.GetClient();
            long             ruleId    = 106844;

            DeleteRuleRequest request = new DeleteRuleRequest();

            request.RuleId = ruleId;

            DeleteRuleResponse response = acsClient.GetAcsResponse(request);

            Console.WriteLine("Delete Rule: " + response.Success);
            if (!(bool)response.Success)
            {
                Console.WriteLine(response.Code + ", " + response.ErrorMessage);
                return;
            }
        }
Esempio n. 9
0
        public static DeleteRuleResponse Unmarshall(UnmarshallerContext _ctx)
        {
            DeleteRuleResponse deleteRuleResponse = new DeleteRuleResponse();

            deleteRuleResponse.HttpResponse = _ctx.HttpResponse;
            deleteRuleResponse.Code         = _ctx.StringValue("DeleteRule.Code");
            deleteRuleResponse.Message      = _ctx.StringValue("DeleteRule.Message");
            deleteRuleResponse.RequestId    = _ctx.StringValue("DeleteRule.RequestId");

            DeleteRuleResponse.DeleteRule_Data data = new DeleteRuleResponse.DeleteRule_Data();
            data.Content            = _ctx.StringValue("DeleteRule.Data.Content");
            data.CreatedAt          = _ctx.StringValue("DeleteRule.Data.CreatedAt");
            data.Id                 = _ctx.StringValue("DeleteRule.Data.Id");
            data.Name               = _ctx.StringValue("DeleteRule.Data.Name");
            deleteRuleResponse.Data = data;

            return(deleteRuleResponse);
        }
        private static void UnmarshallResult(XmlUnmarshallerContext context, DeleteRuleResponse response)
        {
            
            int originalDepth = context.CurrentDepth;
            int targetDepth = originalDepth + 1;
            
            if (context.IsStartOfDocument) 
               targetDepth += 2;
            
            while (context.ReadAtDepth(originalDepth))
            {
                if (context.IsStartElement || context.IsAttribute)
                {

                } 
           }

            return;
        }
Esempio n. 11
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)
        {
            DeleteRuleResponse response = new DeleteRuleResponse();

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

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

            return(response);
        }
        private static void UnmarshallResult(XmlUnmarshallerContext context, DeleteRuleResponse response)
        {
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            if (context.IsStartOfDocument)
            {
                targetDepth += 2;
            }

            while (context.ReadAtDepth(originalDepth))
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                }
            }

            return;
        }