コード例 #1
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();


            return(response);
        }
コード例 #2
0
        /// <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;
        }
コード例 #3
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();


            return response;
        }
コード例 #4
0
        /// <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);
        }
コード例 #5
0
        public static DeleteRuleResponse Unmarshall(UnmarshallerContext context)
        {
            DeleteRuleResponse deleteRuleResponse = new DeleteRuleResponse();

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

            return(deleteRuleResponse);
        }
コード例 #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);
        }
コード例 #7
0
        /// <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);
        }
コード例 #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;
            }
        }
コード例 #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);
        }
コード例 #10
0
        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;
        }
コード例 #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);
        }
コード例 #12
0
        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;
        }