public static QueryProductTopicResponse Unmarshall(UnmarshallerContext context) { QueryProductTopicResponse queryProductTopicResponse = new QueryProductTopicResponse(); queryProductTopicResponse.HttpResponse = context.HttpResponse; queryProductTopicResponse.RequestId = context.StringValue("QueryProductTopic.RequestId"); queryProductTopicResponse.Success = context.BooleanValue("QueryProductTopic.Success"); queryProductTopicResponse.Code = context.StringValue("QueryProductTopic.Code"); queryProductTopicResponse.ErrorMessage = context.StringValue("QueryProductTopic.ErrorMessage"); List <QueryProductTopicResponse.QueryProductTopic_ProductTopicInfo> queryProductTopicResponse_data = new List <QueryProductTopicResponse.QueryProductTopic_ProductTopicInfo>(); for (int i = 0; i < context.Length("QueryProductTopic.Data.Length"); i++) { QueryProductTopicResponse.QueryProductTopic_ProductTopicInfo productTopicInfo = new QueryProductTopicResponse.QueryProductTopic_ProductTopicInfo(); productTopicInfo.ProductKey = context.StringValue("QueryProductTopic.Data[" + i + "].ProductKey"); productTopicInfo.TopicShortName = context.StringValue("QueryProductTopic.Data[" + i + "].TopicShortName"); productTopicInfo.Operation = context.StringValue("QueryProductTopic.Data[" + i + "].Operation"); productTopicInfo.Desc = context.StringValue("QueryProductTopic.Data[" + i + "].Desc"); productTopicInfo.Id = context.StringValue("QueryProductTopic.Data[" + i + "].Id"); queryProductTopicResponse_data.Add(productTopicInfo); } queryProductTopicResponse.Data = queryProductTopicResponse_data; return(queryProductTopicResponse); }
public void TestQueryProductTopic() { DefaultAcsClient acsClient = Demo.IotClient.GetClient(); String productKey = "<productKey>"; QueryProductTopicRequest request = new QueryProductTopicRequest(); request.ProductKey = productKey; QueryProductTopicResponse response = acsClient.GetAcsResponse(request); Console.WriteLine("Query Product Topic: " + response.Success); if (!(bool)response.Success) { Console.WriteLine(response.Code + ", " + response.ErrorMessage); Console.ReadKey(); return; } List <QueryProductTopicResponse.QueryProductTopic_ProductTopicInfo> ProductTopicInfos = response.Data; for (int i = 0; i < ProductTopicInfos.Count; i += 1) { QueryProductTopicResponse.QueryProductTopic_ProductTopicInfo ProductTopicInfo = ProductTopicInfos[i]; Console.WriteLine("Product Topic Id: " + ProductTopicInfo.Id); Console.WriteLine("Product Topic ProductKey: " + ProductTopicInfo.ProductKey); Console.WriteLine("Product Topic TopicShortName: " + ProductTopicInfo.TopicShortName); Console.WriteLine("Product Topic Operation: " + ProductTopicInfo.Operation); Console.WriteLine("Product Topic Desc: " + ProductTopicInfo.Desc); Console.WriteLine(); } }