internal static RemoteDeviceAdapterSetRequest DeserializeRemoteDeviceAdapterSetRequest(JsonElement element) { RemoteDeviceAdapter remoteDeviceAdapter = default; string methodName = default; Optional <string> apiVersion = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("remoteDeviceAdapter")) { remoteDeviceAdapter = RemoteDeviceAdapter.DeserializeRemoteDeviceAdapter(property.Value); continue; } if (property.NameEquals("methodName")) { methodName = property.Value.GetString(); continue; } if (property.NameEquals("@apiVersion")) { apiVersion = property.Value.GetString(); continue; } } return(new RemoteDeviceAdapterSetRequest(methodName, apiVersion.Value, remoteDeviceAdapter)); }
internal static RemoteDeviceAdapterCollection DeserializeRemoteDeviceAdapterCollection(JsonElement element) { Optional <IList <RemoteDeviceAdapter> > value = default; Optional <string> continuationToken = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } List <RemoteDeviceAdapter> array = new List <RemoteDeviceAdapter>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(RemoteDeviceAdapter.DeserializeRemoteDeviceAdapter(item)); } value = array; continue; } if (property.NameEquals("@continuationToken")) { continuationToken = property.Value.GetString(); continue; } } return(new RemoteDeviceAdapterCollection(Optional.ToList(value), continuationToken.Value)); }