public static QuerySuperDeviceGroupResponse Unmarshall(UnmarshallerContext context) { QuerySuperDeviceGroupResponse querySuperDeviceGroupResponse = new QuerySuperDeviceGroupResponse(); querySuperDeviceGroupResponse.HttpResponse = context.HttpResponse; querySuperDeviceGroupResponse.RequestId = context.StringValue("QuerySuperDeviceGroup.RequestId"); querySuperDeviceGroupResponse.Success = context.BooleanValue("QuerySuperDeviceGroup.Success"); querySuperDeviceGroupResponse.Code = context.StringValue("QuerySuperDeviceGroup.Code"); querySuperDeviceGroupResponse.ErrorMessage = context.StringValue("QuerySuperDeviceGroup.ErrorMessage"); List <QuerySuperDeviceGroupResponse.QuerySuperDeviceGroup_GroupInfo> querySuperDeviceGroupResponse_data = new List <QuerySuperDeviceGroupResponse.QuerySuperDeviceGroup_GroupInfo>(); for (int i = 0; i < context.Length("QuerySuperDeviceGroup.Data.Length"); i++) { QuerySuperDeviceGroupResponse.QuerySuperDeviceGroup_GroupInfo groupInfo = new QuerySuperDeviceGroupResponse.QuerySuperDeviceGroup_GroupInfo(); groupInfo.GroupId = context.StringValue("QuerySuperDeviceGroup.Data[" + i + "].GroupId"); groupInfo.GroupName = context.StringValue("QuerySuperDeviceGroup.Data[" + i + "].GroupName"); groupInfo.GroupDesc = context.StringValue("QuerySuperDeviceGroup.Data[" + i + "].GroupDesc"); querySuperDeviceGroupResponse_data.Add(groupInfo); } querySuperDeviceGroupResponse.Data = querySuperDeviceGroupResponse_data; return(querySuperDeviceGroupResponse); }
//根据子分组ID获取父分组信息 public void TestQuerySuperDeviceGroup() { DefaultAcsClient acsClient = Demo.IotClient.GetClient(); String GroupId = "hcfH99RL4Td87QZf0Yzh010200"; QuerySuperDeviceGroupRequest request = new QuerySuperDeviceGroupRequest(); request.GroupId = GroupId; QuerySuperDeviceGroupResponse response = acsClient.GetAcsResponse(request); Console.WriteLine("Query Super Device Group:" + response.Success); if (!(bool)response.Success) { Console.WriteLine(response.Code + ", " + response.ErrorMessage); Console.ReadKey(); return; } List <QuerySuperDeviceGroupResponse.QuerySuperDeviceGroup_GroupInfo> GroupInfos = response.Data; for (int i = 0; i < GroupInfos.Count; i += 1) { QuerySuperDeviceGroupResponse.QuerySuperDeviceGroup_GroupInfo GroupInfoData = GroupInfos[i]; Console.WriteLine("Device Group ID: " + GroupInfoData.GroupId); Console.WriteLine("Device Group Name: " + GroupInfoData.GroupName); Console.WriteLine("Device Group Desc: " + GroupInfoData.GroupDesc); Console.WriteLine(); } }