Example #1
0
        //获取产品的全部标签
        public void TestListProductTags()
        {
            DefaultAcsClient acsClient = Demo.IotClient.GetClient();

            ListProductTagsRequest request = new ListProductTagsRequest();

            request.ProductKey = "<productKey>";

            ListProductTagsResponse response = acsClient.GetAcsResponse(request);

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

            List <ListProductTagsResponse.ListProductTags_ProductTag> productTags = response.Data;

            ListProductTagsResponse.ListProductTags_ProductTag firstTag = productTags.First();
            Console.WriteLine(firstTag.TagKey + ", " + firstTag.TagValue);
            ListProductTagsResponse.ListProductTags_ProductTag lastTag = productTags.Last();
            Console.WriteLine(lastTag.TagKey + ", " + lastTag.TagValue);
        }
Example #2
0
        public static ListProductTagsResponse Unmarshall(UnmarshallerContext _ctx)
        {
            ListProductTagsResponse listProductTagsResponse = new ListProductTagsResponse();

            listProductTagsResponse.HttpResponse = _ctx.HttpResponse;
            listProductTagsResponse.RequestId    = _ctx.StringValue("ListProductTags.RequestId");
            listProductTagsResponse.Success      = _ctx.BooleanValue("ListProductTags.Success");
            listProductTagsResponse.ErrorMessage = _ctx.StringValue("ListProductTags.ErrorMessage");
            listProductTagsResponse.Code         = _ctx.StringValue("ListProductTags.Code");

            List <ListProductTagsResponse.ListProductTags_ProductTag> listProductTagsResponse_data = new List <ListProductTagsResponse.ListProductTags_ProductTag>();

            for (int i = 0; i < _ctx.Length("ListProductTags.Data.Length"); i++)
            {
                ListProductTagsResponse.ListProductTags_ProductTag productTag = new ListProductTagsResponse.ListProductTags_ProductTag();
                productTag.TagKey   = _ctx.StringValue("ListProductTags.Data[" + i + "].TagKey");
                productTag.TagValue = _ctx.StringValue("ListProductTags.Data[" + i + "].TagValue");

                listProductTagsResponse_data.Add(productTag);
            }
            listProductTagsResponse.Data = listProductTagsResponse_data;

            return(listProductTagsResponse);
        }