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.livisismarthome.internal.client.api.entity.error;
15 import java.util.List;
17 import com.google.gson.annotations.SerializedName;
20 * Error response object from the LIVISI SmartHome api.
22 * @author Oliver Kuhl - Initial contribution
24 public class ErrorResponseDTO {
27 public static final int ERR_UNKNOWN = 1000;
28 public static final int ERR_SERVICE_UNAVAILABLE = 1001;
29 public static final int ERR_SERVICE_TIMEOUT = 1002;
30 public static final int ERR_INTERNAL_API_ERROR = 1003;
31 public static final int ERR_INVALID_SHC_OPERATION = 1004;
32 public static final int ERR_MISSING_ARGUMENT_OR_WRONG_VALUE = 1005;
33 public static final int ERR_SERVICE_TOO_BUSY = 1006;
35 // Authentication and authorization errors
36 public static final int ERR_UNKNOWN_AUTHENTICATION_ERROR = 2000;
37 public static final int ERR_ACCESS_NOT_ALLOWED = 2001;
38 public static final int ERR_INVALID_TOKEN_REQUEST = 2002;
39 public static final int ERR_INVALID_CLIENT_CREDENTIALS = 2003;
40 public static final int ERR_INVALID_TOKEN_SIGNATURE = 2004;
41 public static final int ERR_SESSION_INITIALIZATION_FAILED = 2005;
42 public static final int ERR_SESSION_EXISTS = 2006;
43 public static final int ERR_TOKEN_EXPIRED = 2007;
44 public static final int ERR_LOGIN_FROM_DIFFERENT_CLIENT = 2008;
45 public static final int ERR_INVALID_USER_CREDENTIALS = 2009;
46 public static final int ERR_REMOTE_ACCESS_NOT_ALLOWED = 2010;
47 public static final int ERR_INSUFFICIENT_PERMISSIONS = 2011;
48 public static final int ERR_SESSION_NOT_FOUND = 2012;
49 public static final int ERR_ACCOUNT_TEMPORARY_LOCKED = 2013;
52 public static final int ERR_ENTITY_DOES_NOT_EXIST = 3000;
53 public static final int ERR_INVALID_REQUEST_CONTENT = 3001;
54 public static final int ERR_NO_CHANGE_PERFORMED = 3002;
55 public static final int ERR_ENTITY_ALREADY_EXISTS = 3003;
56 public static final int ERR_INVALID_INTERACTION = 3004;
59 public static final int ERR_PREMIUM_SERVICE_CANNOT_BE_ENABLED_DIRECTLY = 3500;
60 public static final int ERR_CANNOT_REMOVE_A_PRODUCT_THAT_WAS_PAID = 3501;
63 public static final int ERR_INVALID_ACTION_TRIGGERED = 4000;
64 public static final int ERR_INVALID_PARAMETER = 4001;
65 public static final int ERR_TRIGGER_ACTION_NOT_ALLOWED = 4002;
66 public static final int ERR_UNSUPPORTED_ACTION_TYPE = 4003;
69 public static final int ERR_ERROR_UPDATING_CONFIG = 5000;
70 public static final int ERR_CONFIG_LOCKED_BY_OTHER_PROCESS = 5001;
71 public static final int ERR_COMMUNICATION_WITH_SHC_FAILED = 5002;
72 public static final int ERR_LATEST_TERMS_AND_CONDITIONS_NOT_ACCEPTED_BY_USER = 5003;
73 public static final int ERR_ONE_SHC_ALREADY_REGISTERED = 5004;
74 public static final int ERR_USER_HAS_NO_REGISTERED_SHC = 5005;
75 public static final int ERR_CONTROLLER_OFFLINE = 5006;
76 public static final int ERR_REGISTRATION_FAILURE = 5009;
79 public static final int ERR_SMARTCODE_REQUEST_NOT_ALLOWED = 6000;
80 public static final int ERR_SMARTCODE_CANNOT_BE_REDEEMED = 6001;
81 public static final int ERR_RESTRICTED_ACCESS = 6002;
83 @SerializedName("errorcode")
85 @SerializedName("description")
86 private String description;
87 @SerializedName("messages")
88 private List<String> messages;
91 * @return the error code
93 public int getCode() {
98 * @param code the error code to set
100 public void setCode(int code) {
105 * @return the description
107 public String getDescription() {
112 * @param description the description to set
114 public void setDescription(String description) {
115 this.description = description;
119 * @return the messages
121 public List<String> getMessages() {
126 * @param messages the messages to set
128 public void setMessages(List<String> messages) {
129 this.messages = messages;
133 public String toString() {
134 String stringRepresentation = "ErrorResponse [code=" + code + ", description=" + description;
135 if (messages != null) {
136 stringRepresentation += ", messages=" + messages.toString();
138 stringRepresentation += "]";
139 return stringRepresentation;