Inceptum/launcher/src/main/java/io/gitlab/jfronny/inceptum/launcher/model/microsoft/OauthTokenResponse.java

49 lines
1.4 KiB
Java

package io.gitlab.jfronny.inceptum.launcher.model.microsoft;
import io.gitlab.jfronny.gson.annotations.SerializedName;
import io.gitlab.jfronny.gson.compile.annotations.GPrefer;
import io.gitlab.jfronny.gson.compile.annotations.GSerializable;
import java.util.Date;
@GSerializable
public class OauthTokenResponse {
@SerializedName("token_type")
public String tokenType;
@SerializedName("expires_in")
public Integer expiresIn;
@SerializedName("expires_at")
public Date expiresAt;
public String scope;
@SerializedName("access_token")
public String accessToken;
@SerializedName("refresh_token")
public String refreshToken;
@SerializedName("user_id")
public String userId;
public String foci;
@GPrefer
public OauthTokenResponse(String tokenType, Integer expiresIn, Date expiresAt, String scope, String accessToken, String refreshToken, String userId, String foci) {
this.tokenType = tokenType;
this.expiresIn = expiresIn;
this.expiresAt = expiresAt;
this.scope = scope;
this.accessToken = accessToken;
this.refreshToken = refreshToken;
this.userId = userId;
this.foci = foci;
if (this.expiresAt == null) {
this.expiresAt = new Date();
this.expiresAt.setTime(this.expiresAt.getTime() + this.expiresIn * 1000);
}
}
}