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.io.hueemulation.internal.dto.response;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
19 * Hue API response base type
21 * @author David Graeff - Initial contribution
24 public class HueResponse {
25 public static final int UNAUTHORIZED = 1;
26 public static final int INVALID_JSON = 2;
27 public static final int NOT_AVAILABLE = 3;
28 public static final int METHOD_NOT_ALLOWED = 4;
29 public static final int ARGUMENTS_INVALID = 7;
30 public static final int SENSOR_NOT_CLIP_SENSOR = 8;
31 public static final int LINK_BUTTON_NOT_PRESSED = 101;
32 public static final int INTERNAL_ERROR = 901;
34 public static final int RULE_ENGINE_FULL = 601; // The Rule Engine has reached its maximum capacity of 100 rules.
35 public static final int CONDITION_ERROR = 607; // Rule conditions contain errors or operator combination is not
37 public static final int ACTION_ERROR = 608; // Rule actions contain errors or multiple actions with the same
39 public static final int TOO_MANY_ITEMS = 11; // Too many items in the list (too many conditions or too many actions)
41 public final @Nullable HueErrorMessage error;
42 public final @Nullable HueSuccessResponse success;
44 public HueResponse(HueErrorMessage error) {
49 public HueResponse(HueSuccessResponse success) {
51 this.success = success;
54 public static class HueErrorMessage {
55 public final String address;
56 public final String description;
57 public final int type;
59 public HueErrorMessage(int type, String address, String description) {
61 this.address = address;
62 this.description = description;