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.netatmo.internal.api;
15 import java.util.Collection;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
19 import org.openhab.binding.netatmo.internal.api.dto.NAObject;
20 import org.openhab.binding.netatmo.internal.deserialization.NAObjectMap;
22 import com.google.gson.annotations.SerializedName;
25 * The {@link ListBodyResponse} models a response returned by API call containing
28 * @author Gaƫl L'hopital - Initial contribution
32 public class ListBodyResponse<T extends NAObject> {
33 @SerializedName(value = "devices", alternate = { "homes", "events_list", "events" })
34 private NAObjectMap<T> elements = new NAObjectMap<>();
37 T getElement(String id) {
38 return elements.get(id);
41 public Collection<T> getElements() {
42 return elements.values();