sh.ory.hydra.model.OauthTokenResponse Maven / Gradle / Ivy
/*
* Ory Oathkeeper API
* Documentation for all of Ory Oathkeeper's APIs.
*
* The version of the OpenAPI document: v1.11.6
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package sh.ory.hydra.model;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* The token response
*/
@ApiModel(description = "The token response")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-02-23T08:12:00.883126307Z[Etc/UTC]")
public class OauthTokenResponse {
public static final String SERIALIZED_NAME_ACCESS_TOKEN = "access_token";
@SerializedName(SERIALIZED_NAME_ACCESS_TOKEN)
private String accessToken;
public static final String SERIALIZED_NAME_EXPIRES_IN = "expires_in";
@SerializedName(SERIALIZED_NAME_EXPIRES_IN)
private Long expiresIn;
public static final String SERIALIZED_NAME_ID_TOKEN = "id_token";
@SerializedName(SERIALIZED_NAME_ID_TOKEN)
private Long idToken;
public static final String SERIALIZED_NAME_REFRESH_TOKEN = "refresh_token";
@SerializedName(SERIALIZED_NAME_REFRESH_TOKEN)
private String refreshToken;
public static final String SERIALIZED_NAME_SCOPE = "scope";
@SerializedName(SERIALIZED_NAME_SCOPE)
private Long scope;
public static final String SERIALIZED_NAME_TOKEN_TYPE = "token_type";
@SerializedName(SERIALIZED_NAME_TOKEN_TYPE)
private String tokenType;
public OauthTokenResponse() {
}
public OauthTokenResponse accessToken(String accessToken) {
this.accessToken = accessToken;
return this;
}
/**
* The access token issued by the authorization server.
* @return accessToken
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The access token issued by the authorization server.")
public String getAccessToken() {
return accessToken;
}
public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
}
public OauthTokenResponse expiresIn(Long expiresIn) {
this.expiresIn = expiresIn;
return this;
}
/**
* The lifetime in seconds of the access token. For example, the value \"3600\" denotes that the access token will expire in one hour from the time the response was generated.
* @return expiresIn
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The lifetime in seconds of the access token. For example, the value \"3600\" denotes that the access token will expire in one hour from the time the response was generated.")
public Long getExpiresIn() {
return expiresIn;
}
public void setExpiresIn(Long expiresIn) {
this.expiresIn = expiresIn;
}
public OauthTokenResponse idToken(Long idToken) {
this.idToken = idToken;
return this;
}
/**
* To retrieve a refresh token request the id_token scope.
* @return idToken
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "To retrieve a refresh token request the id_token scope.")
public Long getIdToken() {
return idToken;
}
public void setIdToken(Long idToken) {
this.idToken = idToken;
}
public OauthTokenResponse refreshToken(String refreshToken) {
this.refreshToken = refreshToken;
return this;
}
/**
* The refresh token, which can be used to obtain new access tokens. To retrieve it add the scope \"offline\" to your access token request.
* @return refreshToken
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The refresh token, which can be used to obtain new access tokens. To retrieve it add the scope \"offline\" to your access token request.")
public String getRefreshToken() {
return refreshToken;
}
public void setRefreshToken(String refreshToken) {
this.refreshToken = refreshToken;
}
public OauthTokenResponse scope(Long scope) {
this.scope = scope;
return this;
}
/**
* The scope of the access token
* @return scope
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The scope of the access token")
public Long getScope() {
return scope;
}
public void setScope(Long scope) {
this.scope = scope;
}
public OauthTokenResponse tokenType(String tokenType) {
this.tokenType = tokenType;
return this;
}
/**
* The type of the token issued
* @return tokenType
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The type of the token issued")
public String getTokenType() {
return tokenType;
}
public void setTokenType(String tokenType) {
this.tokenType = tokenType;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
OauthTokenResponse oauthTokenResponse = (OauthTokenResponse) o;
return Objects.equals(this.accessToken, oauthTokenResponse.accessToken) &&
Objects.equals(this.expiresIn, oauthTokenResponse.expiresIn) &&
Objects.equals(this.idToken, oauthTokenResponse.idToken) &&
Objects.equals(this.refreshToken, oauthTokenResponse.refreshToken) &&
Objects.equals(this.scope, oauthTokenResponse.scope) &&
Objects.equals(this.tokenType, oauthTokenResponse.tokenType);
}
@Override
public int hashCode() {
return Objects.hash(accessToken, expiresIn, idToken, refreshToken, scope, tokenType);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class OauthTokenResponse {\n");
sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n");
sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n");
sb.append(" idToken: ").append(toIndentedString(idToken)).append("\n");
sb.append(" refreshToken: ").append(toIndentedString(refreshToken)).append("\n");
sb.append(" scope: ").append(toIndentedString(scope)).append("\n");
sb.append(" tokenType: ").append(toIndentedString(tokenType)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}