]> git.basschouten.com Git - openhab-addons.git/blob
3246ae1dd6d1b7af89eafc71420e8037079f3aab
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2024 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.salus.internal.rest;
14
15 import java.util.Objects;
16
17 import com.google.gson.annotations.SerializedName;
18
19 /**
20  * @author Martin GrzeĊ›lowski - Initial contribution
21  */
22 public record AuthToken(@SerializedName("access_token") String accessToken,
23         @SerializedName("refresh_token") String refreshToken, @SerializedName("expires_in") Long expiresIn,
24         @SerializedName("role") String role) {
25     public AuthToken {
26         Objects.requireNonNull(accessToken, "accessToken cannot be null!");
27         Objects.requireNonNull(refreshToken, "refreshToken cannot be null!");
28     }
29
30     @Override
31     public String toString() {
32         return "AuthToken{" + "accessToken='<SECRET>'" + ", refreshToken='<SECRET>'" + ", expiresIn=" + expiresIn
33                 + ", role='" + role + '\'' + '}';
34     }
35 }