2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.amazonechocontrol.internal.jsons;
15 import java.util.List;
16 import java.util.stream.Collectors;
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.eclipse.jdt.annotation.Nullable;
22 * The {@link JsonAnnouncementTarget} encapsulate the GSON data of the sequence command AlexaAnnouncement for
25 * @author Michael Geramb - Initial contribution
28 public class JsonAnnouncementTarget {
30 public @Nullable String customerId;
31 public List<TargetDevice> devices;
33 public JsonAnnouncementTarget(List<JsonDevices.Device> deviceList) {
34 customerId = deviceList.get(0).deviceOwnerCustomerId;
35 devices = deviceList.stream().map(TargetDevice::new).collect(Collectors.toList());
38 public static class TargetDevice {
39 public @Nullable String deviceSerialNumber;
40 public @Nullable String deviceTypeId;
42 public TargetDevice(JsonDevices.Device device) {
43 deviceSerialNumber = device.serialNumber;
44 deviceTypeId = device.deviceType;