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.innogysmarthome.internal.client.entity.error;
15 import java.util.List;
17 import com.google.gson.annotations.SerializedName;
20 * Error response object from the innogy SmartHome api.
22 * @author Oliver Kuhl - Initial contribution
25 public class ErrorResponse {
28 public static final int ERR_UNKNOWN = 1000;
29 public static final int ERR_SERVICE_UNAVAILABLE = 1001;
30 public static final int ERR_SERVICE_TIMEOUT = 1002;
31 public static final int ERR_INTERNAL_API_ERROR = 1003;
32 public static final int ERR_INVALID_SHC_OPERATION = 1004;
33 public static final int ERR_MISSING_ARGUMENT_OR_WRONG_VALUE = 1005;
34 public static final int ERR_SERVICE_TOO_BUSY = 1006;
36 // Authentication and authorization errors
37 public static final int ERR_UNKNOWN_AUTHENTICATION_ERROR = 2000;
38 public static final int ERR_ACCESS_NOT_ALLOWED = 2001;
39 public static final int ERR_INVALID_TOKEN_REQUEST = 2002;
40 public static final int ERR_INVALID_CLIENT_CREDENTIALS = 2003;
41 public static final int ERR_INVALID_TOKEN_SIGNATURE = 2004;
42 public static final int ERR_SESSION_INITIALIZATION_FAILED = 2005;
43 public static final int ERR_SESSION_EXISTS = 2006;
44 public static final int ERR_TOKEN_EXPIRED = 2007;
45 public static final int ERR_LOGIN_FROM_DIFFERENT_CLIENT = 2008;
46 public static final int ERR_INVALID_USER_CREDENTIALS = 2009;
47 public static final int ERR_REMOTE_ACCESS_NOT_ALLOWED = 2010;
48 public static final int ERR_INSUFFICIENT_PERMISSIONS = 2011;
49 public static final int ERR_SESSION_NOT_FOUND = 2012;
50 public static final int ERR_ACCOUNT_TEMPORARY_LOCKED = 2013;
53 public static final int ERR_ENTITY_DOES_NOT_EXIST = 3000;
54 public static final int ERR_INVALID_REQUEST_CONTENT = 3001;
55 public static final int ERR_NO_CHANGE_PERFORMED = 3002;
56 public static final int ERR_ENTITY_ALREADY_EXISTS = 3003;
57 public static final int ERR_INVALID_INTERACTION = 3004;
60 public static final int ERR_PREMIUM_SERVICE_CANNOT_BE_ENABLED_DIRECTLY = 3500;
61 public static final int ERR_CANNOT_REMOVE_A_PRODUCT_THAT_WAS_PAID = 3501;
64 public static final int ERR_INVALID_ACTION_TRIGGERED = 4000;
65 public static final int ERR_INVALID_PARAMETER = 4001;
66 public static final int ERR_TRIGGER_ACTION_NOT_ALLOWED = 4002;
67 public static final int ERR_UNSUPPORTED_ACTION_TYPE = 4003;
70 public static final int ERR_ERROR_UPDATING_CONFIG = 5000;
71 public static final int ERR_CONFIG_LOCKED_BY_OTHER_PROCESS = 5001;
72 public static final int ERR_COMMUNICATION_WITH_SHC_FAILED = 5002;
73 public static final int ERR_LATEST_TERMS_AND_CONDITIONS_NOT_ACCEPTED_BY_USER = 5003;
74 public static final int ERR_ONE_SHC_ALREADY_REGISTERED = 5004;
75 public static final int ERR_USER_HAS_NO_REGISTERED_SHC = 5005;
76 public static final int ERR_CONTROLLER_OFFLINE = 5006;
77 public static final int ERR_REGISTRATION_FAILURE = 5009;
80 public static final int ERR_SMARTCODE_REQUEST_NOT_ALLOWED = 6000;
81 public static final int ERR_SMARTCODE_CANNOT_BE_REDEEMED = 6001;
82 public static final int ERR_RESTRICTED_ACCESS = 6002;
84 @SerializedName("errorcode")
87 @SerializedName("description")
88 private String description;
90 @SerializedName("messages")
91 private List<String> messages;
94 * @return the error code
96 public int getCode() {
101 * @param code the error code to set
103 public void setCode(int code) {
108 * @return the description
110 public String getDescription() {
115 * @param description the description to set
117 public void setDescription(String description) {
118 this.description = description;
122 * @return the messages
124 public List<String> getMessages() {
129 * @param messages the messages to set
131 public void setMessages(List<String> messages) {
132 this.messages = messages;
136 public String toString() {
137 String stringRepresentation = "ErrorResponse [code=" + code + ", description=" + description;
138 if (messages != null) {
139 stringRepresentation += ", messages=" + messages.toString();
141 stringRepresentation += "]";
142 return stringRepresentation;