Beispiel #1
0
        private static void unbindTagsToResource(IoTDAClient client)
        {
            UntagDeviceRequest req = new UntagDeviceRequest
            {
                Body = new UnbindTagsDTO()
                {
                    ResourceId   = "5e25d39a3b7c24fa3638804b_nb_0403_1",
                    ResourceType = "device",
                    TagKeys      = new List <string>()
                    {
                        "testTagName"
                    }
                }
            };

            try
            {
                var resp = client.UntagDevice(req);
                Console.WriteLine(resp.HttpStatusCode);
                Console.WriteLine(resp);
            }
            catch (RequestTimeoutException requestTimeoutException)
            {
                Console.WriteLine(requestTimeoutException.ErrorMessage);
            }
            catch (ServiceResponseException clientRequestException)
            {
                Console.WriteLine(clientRequestException.HttpStatusCode);
                Console.WriteLine(clientRequestException.ErrorCode);
                Console.WriteLine(clientRequestException.ErrorMsg);
            }
            catch (ConnectionException connectionException)
            {
                Console.WriteLine(connectionException.ErrorMessage);
            }
        }