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.lutron.internal.protocol.leap.dto;
15 import java.util.regex.Pattern;
17 import org.openhab.binding.lutron.internal.protocol.leap.AbstractMessageBody;
19 import com.google.gson.annotations.SerializedName;
24 * @author Peter Wojciechowski - Initial contribution
26 public class Project extends AbstractMessageBody {
27 @SerializedName("href")
30 @SerializedName("Name")
33 @SerializedName("ProductType")
34 public String productType;
36 @SerializedName("MasterDeviceList")
37 public MasterDeviceList masterDeviceList;
39 @SerializedName("Contacts")
40 public Href[] contacts;
42 @SerializedName("TimeclockEventRules")
43 public Href timeclockEventRules;
45 @SerializedName("ProjectModifiedTimestamp")
46 public ProjectTimestamp projectModifiedTimestamp;
48 public class MasterDeviceList {
49 public static final Pattern DEVICE_HREF_PATTERN = Pattern.compile("/device/([0-9]+)");
51 public int getDeviceIdFromHref(int deviceIndex) {
52 if (devices.length == 0) {
56 return hrefNumber(DEVICE_HREF_PATTERN, devices[deviceIndex].href);
59 @SerializedName("Devices")
60 public Href[] devices;