コード例 #1
0
        private static void addDeviceGroup(IoTDAClient client)
        {
            AddDeviceGroupRequest req = new AddDeviceGroupRequest
            {
                Body = new AddDeviceGroupDTO()
                {
                    Name        = "GroupA2",
                    Description = "GroupA1"
                }
            };

            try
            {
                var resp = client.AddDeviceGroup(req);
                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);
            }
        }