public static QueryProductListResponse Unmarshall(UnmarshallerContext context)
        {
            QueryProductListResponse queryProductListResponse = new QueryProductListResponse();

            queryProductListResponse.HttpResponse = context.HttpResponse;
            queryProductListResponse.RequestId    = context.StringValue("QueryProductList.RequestId");
            queryProductListResponse.Success      = context.BooleanValue("QueryProductList.Success");
            queryProductListResponse.ErrorMessage = context.StringValue("QueryProductList.ErrorMessage");

            QueryProductListResponse.QueryProductList_Data data = new QueryProductListResponse.QueryProductList_Data();
            data.CurrentPage = context.IntegerValue("QueryProductList.Data.CurrentPage");
            data.PageCount   = context.IntegerValue("QueryProductList.Data.PageCount");
            data.PageSize    = context.IntegerValue("QueryProductList.Data.PageSize");
            data.Total       = context.IntegerValue("QueryProductList.Data.Total");

            List <QueryProductListResponse.QueryProductList_Data.QueryProductList_ProductInfo> data_list = new List <QueryProductListResponse.QueryProductList_Data.QueryProductList_ProductInfo>();

            for (int i = 0; i < context.Length("QueryProductList.Data.List.Length"); i++)
            {
                QueryProductListResponse.QueryProductList_Data.QueryProductList_ProductInfo productInfo = new QueryProductListResponse.QueryProductList_Data.QueryProductList_ProductInfo();
                productInfo.GmtCreate   = context.StringValue("QueryProductList.Data.List[" + i + "].GmtCreate");
                productInfo.DataFormat  = context.IntegerValue("QueryProductList.Data.List[" + i + "].DataFormat");
                productInfo.Description = context.StringValue("QueryProductList.Data.List[" + i + "].Description");
                productInfo.DeviceCount = context.IntegerValue("QueryProductList.Data.List[" + i + "].DeviceCount");
                productInfo.NodeType    = context.IntegerValue("QueryProductList.Data.List[" + i + "].NodeType");
                productInfo.ProductKey  = context.StringValue("QueryProductList.Data.List[" + i + "].ProductKey");
                productInfo.ProductName = context.StringValue("QueryProductList.Data.List[" + i + "].ProductName");

                data_list.Add(productInfo);
            }
            data.List = data_list;
            queryProductListResponse.Data = data;

            return(queryProductListResponse);
        }
Ejemplo n.º 2
0
        public static QueryProductListResponse Unmarshall(UnmarshallerContext _ctx)
        {
            QueryProductListResponse queryProductListResponse = new QueryProductListResponse();

            queryProductListResponse.HttpResponse = _ctx.HttpResponse;
            queryProductListResponse.RequestId    = _ctx.StringValue("QueryProductList.RequestId");
            queryProductListResponse.Success      = _ctx.BooleanValue("QueryProductList.Success");
            queryProductListResponse.Code         = _ctx.StringValue("QueryProductList.Code");
            queryProductListResponse.Message      = _ctx.StringValue("QueryProductList.Message");

            QueryProductListResponse.QueryProductList_Data data = new QueryProductListResponse.QueryProductList_Data();
            data.TotalCount = _ctx.IntegerValue("QueryProductList.Data.TotalCount");
            data.PageNum    = _ctx.IntegerValue("QueryProductList.Data.PageNum");
            data.PageSize   = _ctx.IntegerValue("QueryProductList.Data.PageSize");

            List <QueryProductListResponse.QueryProductList_Data.QueryProductList_Product> data_productList = new List <QueryProductListResponse.QueryProductList_Data.QueryProductList_Product>();

            for (int i = 0; i < _ctx.Length("QueryProductList.Data.ProductList.Length"); i++)
            {
                QueryProductListResponse.QueryProductList_Data.QueryProductList_Product product = new QueryProductListResponse.QueryProductList_Data.QueryProductList_Product();
                product.ProductCode      = _ctx.StringValue("QueryProductList.Data.ProductList[" + i + "].ProductCode");
                product.ProductName      = _ctx.StringValue("QueryProductList.Data.ProductList[" + i + "].ProductName");
                product.ProductType      = _ctx.StringValue("QueryProductList.Data.ProductList[" + i + "].ProductType");
                product.SubscriptionType = _ctx.StringValue("QueryProductList.Data.ProductList[" + i + "].SubscriptionType");

                data_productList.Add(product);
            }
            data.ProductList = data_productList;
            queryProductListResponse.Data = data;

            return(queryProductListResponse);
        }
Ejemplo n.º 3
0
        //分页获取产品列表
        public void TestQueryProductList()
        {
            DefaultAcsClient        acsClient = Demo.IotClient.GetClient();
            QueryProductListRequest request   = new QueryProductListRequest();

            request.CurrentPage = 1;
            request.PageSize    = 10;

            QueryProductListResponse response = acsClient.GetAcsResponse(request);

            Console.WriteLine(response.Success);
            Console.WriteLine(response.ErrorMessage);
            Console.WriteLine(response.Code);

            QueryProductListResponse.QueryProductList_Data data = response.Data;

            Console.WriteLine(data.CurrentPage);
            Console.WriteLine(data.PageSize);
            Console.WriteLine(data.PageCount);
            Console.WriteLine(data.Total);

            List <QueryProductListResponse.QueryProductList_Data.QueryProductList_ProductInfo> productList = data.List;

            Console.WriteLine(productList.Count);
        }