]> git.basschouten.com Git - openhab-addons.git/blob
c94a9d58ddf189c4e15d010223be1e25ed4c5ed1
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 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.netatmo.internal.api.dto;
14
15 import java.util.List;
16
17 import org.openhab.binding.netatmo.internal.api.data.NetatmoConstants.Scope;
18
19 /**
20  * This is the Access Token Response, a simple value-object holding the result of an Access Token Request, as
21  * provided by Netatmo API.
22  *
23  * @author GaĆ«l L'hopital - Initial contribution
24  */
25 public final class AccessTokenResponse {
26
27     /**
28      * The access token issued by the authorization server. It is used
29      * by the client to gain access to a resource.
30      *
31      */
32     private String accessToken;
33
34     /**
35      * Number of seconds that this OAuthToken is valid for since the time it was created.
36      *
37      */
38     private long expiresIn;
39
40     /**
41      * Refresh token is a string representing the authorization granted to
42      * the client by the resource owner. Unlike access tokens, refresh tokens are
43      * intended for use only with authorization servers and are never sent
44      * to resource servers.
45      *
46      */
47     private String refreshToken;
48
49     private List<Scope> scope;
50
51     public String getAccessToken() {
52         return accessToken;
53     }
54
55     public long getExpiresIn() {
56         return expiresIn;
57     }
58
59     public String getRefreshToken() {
60         return refreshToken;
61     }
62
63     public List<Scope> getScope() {
64         return scope;
65     }
66
67     @Override
68     public String toString() {
69         return "AccessTokenResponse [accessToken=" + accessToken + ", expiresIn=" + expiresIn + ", refreshToken="
70                 + refreshToken + ", scope=" + scope + "]";
71     }
72 }