Beispiel #1
0
        internal static RemoteDeviceAdapterProperties DeserializeRemoteDeviceAdapterProperties(JsonElement element)
        {
            Optional <string>         description            = default;
            RemoteDeviceAdapterTarget target                 = default;
            IotHubDeviceConnection    iotHubDeviceConnection = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("description"))
                {
                    description = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("target"))
                {
                    target = RemoteDeviceAdapterTarget.DeserializeRemoteDeviceAdapterTarget(property.Value);
                    continue;
                }
                if (property.NameEquals("iotHubDeviceConnection"))
                {
                    iotHubDeviceConnection = IotHubDeviceConnection.DeserializeIotHubDeviceConnection(property.Value);
                    continue;
                }
            }
            return(new RemoteDeviceAdapterProperties(description.Value, target, iotHubDeviceConnection));
        }
        public RemoteDeviceAdapterProperties(RemoteDeviceAdapterTarget target, IotHubDeviceConnection iotHubDeviceConnection)
        {
            if (target == null)
            {
                throw new ArgumentNullException(nameof(target));
            }
            if (iotHubDeviceConnection == null)
            {
                throw new ArgumentNullException(nameof(iotHubDeviceConnection));
            }

            Target = target;
            IotHubDeviceConnection = iotHubDeviceConnection;
        }
 internal RemoteDeviceAdapterProperties(string description, RemoteDeviceAdapterTarget target, IotHubDeviceConnection iotHubDeviceConnection)
 {
     Description            = description;
     Target                 = target;
     IotHubDeviceConnection = iotHubDeviceConnection;
 }