public static DeleteTopicRouteTableResponse Unmarshall(UnmarshallerContext _ctx) { DeleteTopicRouteTableResponse deleteTopicRouteTableResponse = new DeleteTopicRouteTableResponse(); deleteTopicRouteTableResponse.HttpResponse = _ctx.HttpResponse; deleteTopicRouteTableResponse.RequestId = _ctx.StringValue("DeleteTopicRouteTable.RequestId"); deleteTopicRouteTableResponse.Success = _ctx.BooleanValue("DeleteTopicRouteTable.Success"); deleteTopicRouteTableResponse.Code = _ctx.StringValue("DeleteTopicRouteTable.Code"); deleteTopicRouteTableResponse.IsAllSucceed = _ctx.BooleanValue("DeleteTopicRouteTable.IsAllSucceed"); deleteTopicRouteTableResponse.ErrorMessage = _ctx.StringValue("DeleteTopicRouteTable.ErrorMessage"); List <Dictionary <string, string> > deleteTopicRouteTableResponse_failureTopics = new List <Dictionary <string, string> >(); for (int i = 0; i < _ctx.Length("DeleteTopicRouteTable.FailureTopics.Length"); i++) { Dictionary <string, string> tmp = new Dictionary <string, string>() { }; foreach (var _item in _ctx.ResponseDictionary) { string prefix = "DeleteTopicRouteTable.FailureTopics[" + i + "]."; if (_item.Key.IndexOf(prefix) == 0) { tmp.Add(_item.Key.Substring(prefix.Length), _item.Value); } } if (tmp.Count > 0) { deleteTopicRouteTableResponse_failureTopics.Add(tmp); } } deleteTopicRouteTableResponse.FailureTopics = deleteTopicRouteTableResponse_failureTopics; return(deleteTopicRouteTableResponse); }
public static DeleteTopicRouteTableResponse Unmarshall(UnmarshallerContext context) { DeleteTopicRouteTableResponse deleteTopicRouteTableResponse = new DeleteTopicRouteTableResponse(); deleteTopicRouteTableResponse.HttpResponse = context.HttpResponse; deleteTopicRouteTableResponse.RequestId = context.StringValue("DeleteTopicRouteTable.RequestId"); deleteTopicRouteTableResponse.Success = context.BooleanValue("DeleteTopicRouteTable.Success"); deleteTopicRouteTableResponse.IsAllSucceed = context.BooleanValue("DeleteTopicRouteTable.IsAllSucceed"); deleteTopicRouteTableResponse.ErrorMessage = context.StringValue("DeleteTopicRouteTable.ErrorMessage"); List <string> deleteTopicRouteTableResponse_failureTopics = new List <string>(); for (int i = 0; i < context.Length("DeleteTopicRouteTable.FailureTopics.Length"); i++) { deleteTopicRouteTableResponse_failureTopics.Add(context.StringValue("DeleteTopicRouteTable.FailureTopics[" + i + "]")); } deleteTopicRouteTableResponse.FailureTopics = deleteTopicRouteTableResponse_failureTopics; return(deleteTopicRouteTableResponse); }
//删除消息路由表 public void TestDeleteTopicRouteTable() { DefaultAcsClient acsClient = Demo.IotClient.GetClient(); String SrcTopic = "/<productKey>/device_0821_148/user/update"; DeleteTopicRouteTableRequest request = new DeleteTopicRouteTableRequest(); request.SrcTopic = SrcTopic; List <String> DstTopics = new List <string>(); DstTopics.Add("/a1HVMkh4YlK/device_0821_148/user/update"); request.DstTopics = DstTopics; DeleteTopicRouteTableResponse response = acsClient.GetAcsResponse(request); Console.WriteLine("Query Topic Reverse Route Table: " + response.Success); if (!(bool)response.Success) { Console.WriteLine(response.Code + ", " + response.ErrorMessage); Console.ReadKey(); return; } bool isAllSucceed = true; if (response.IsAllSucceed != null) { isAllSucceed = (bool)response.IsAllSucceed; } List <String> FailureTopics = response.FailureTopics; Console.WriteLine("isAllSucceed: " + isAllSucceed + ", failedTopicCount: " + FailureTopics.Count); }