All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.okta.sdk.resource.model.OAuth2RefreshToken Maven / Gradle / Ivy

Go to download

The Okta Java SDK API .jar provides a Java API that your code can use to make calls to the Okta API. This .jar is the only compile-time dependency within the Okta SDK project that your code should depend on. Implementations of this API (implementation .jars) should be runtime dependencies only.

There is a newer version: 21.0.0
Show newest version
package com.okta.sdk.resource.model;

import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import com.okta.sdk.resource.model.GrantOrTokenStatus;
import com.okta.sdk.resource.model.OAuth2RefreshTokenEmbedded;
import com.okta.sdk.resource.model.OAuth2RefreshTokenLinks;
import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModel;

/**
 * OAuth2RefreshToken
 */
@JsonPropertyOrder({ OAuth2RefreshToken.JSON_PROPERTY_CLIENT_ID, OAuth2RefreshToken.JSON_PROPERTY_CREATED,
        OAuth2RefreshToken.JSON_PROPERTY_EXPIRES_AT, OAuth2RefreshToken.JSON_PROPERTY_ID,
        OAuth2RefreshToken.JSON_PROPERTY_ISSUER, OAuth2RefreshToken.JSON_PROPERTY_LAST_UPDATED,
        OAuth2RefreshToken.JSON_PROPERTY_SCOPES, OAuth2RefreshToken.JSON_PROPERTY_STATUS,
        OAuth2RefreshToken.JSON_PROPERTY_USER_ID, OAuth2RefreshToken.JSON_PROPERTY_EMBEDDED,
        OAuth2RefreshToken.JSON_PROPERTY_LINKS })
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-11-15T08:48:47.130589-06:00[America/Chicago]", comments = "Generator version: 7.8.0")
public class OAuth2RefreshToken implements Serializable {

    private static final long serialVersionUID = 1L;

    public static final String JSON_PROPERTY_CLIENT_ID = "clientId";
    private String clientId;

    public static final String JSON_PROPERTY_CREATED = "created";
    private OffsetDateTime created;

    public static final String JSON_PROPERTY_EXPIRES_AT = "expiresAt";
    private OffsetDateTime expiresAt;

    public static final String JSON_PROPERTY_ID = "id";
    private String id;

    public static final String JSON_PROPERTY_ISSUER = "issuer";
    private String issuer;

    public static final String JSON_PROPERTY_LAST_UPDATED = "lastUpdated";
    private OffsetDateTime lastUpdated;

    public static final String JSON_PROPERTY_SCOPES = "scopes";
    private List scopes = null;

    public static final String JSON_PROPERTY_STATUS = "status";
    private GrantOrTokenStatus status;

    public static final String JSON_PROPERTY_USER_ID = "userId";
    private String userId;

    public static final String JSON_PROPERTY_EMBEDDED = "_embedded";
    private OAuth2RefreshTokenEmbedded embedded;

    public static final String JSON_PROPERTY_LINKS = "_links";
    private OAuth2RefreshTokenLinks links;

    public OAuth2RefreshToken() {
    }

    /*
     * @JsonCreator public OAuth2RefreshToken(
     *
     * @JsonProperty(JSON_PROPERTY_CREATED) OffsetDateTime created,
     *
     * @JsonProperty(JSON_PROPERTY_EXPIRES_AT) OffsetDateTime expiresAt,
     *
     * @JsonProperty(JSON_PROPERTY_ID) String id,
     *
     * @JsonProperty(JSON_PROPERTY_LAST_UPDATED) OffsetDateTime lastUpdated ) { this(); this.created = created;
     * this.expiresAt = expiresAt; this.id = id; this.lastUpdated = lastUpdated; }
     */

    public OAuth2RefreshToken clientId(String clientId) {

        this.clientId = clientId;
        return this;
    }

    /**
     * Client ID
     *
     * @return clientId
     **/
    @javax.annotation.Nullable
    @ApiModelProperty(value = "Client ID")
    @JsonProperty(JSON_PROPERTY_CLIENT_ID)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

    public String getClientId() {
        return clientId;
    }

    @JsonProperty(JSON_PROPERTY_CLIENT_ID)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setClientId(String clientId) {
        this.clientId = clientId;
    }

    /**
     * Timestamp when the object was created
     *
     * @return created
     **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "2017-03-28T01:11:10Z", value = "Timestamp when the object was created")
    @JsonProperty(JSON_PROPERTY_CREATED)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

    public OffsetDateTime getCreated() {
        return created;
    }

    /**
     * Expiration time of the OAuth 2.0 Token
     *
     * @return expiresAt
     **/
    @javax.annotation.Nullable
    @ApiModelProperty(value = "Expiration time of the OAuth 2.0 Token")
    @JsonProperty(JSON_PROPERTY_EXPIRES_AT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

    public OffsetDateTime getExpiresAt() {
        return expiresAt;
    }

    /**
     * ID of the Token object
     *
     * @return id
     **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "oar579Mcp7OUsNTlo0g3", value = "ID of the Token object")
    @JsonProperty(JSON_PROPERTY_ID)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

    public String getId() {
        return id;
    }

    public OAuth2RefreshToken issuer(String issuer) {

        this.issuer = issuer;
        return this;
    }

    /**
     * The complete URL of the authorization server that issued the Token
     *
     * @return issuer
     **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "https://{yourOktaDomain}/oauth2/ausain6z9zIedDCxB0h7", value = "The complete URL of the authorization server that issued the Token")
    @JsonProperty(JSON_PROPERTY_ISSUER)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

    public String getIssuer() {
        return issuer;
    }

    @JsonProperty(JSON_PROPERTY_ISSUER)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setIssuer(String issuer) {
        this.issuer = issuer;
    }

    /**
     * Timestamp when the object was last updated
     *
     * @return lastUpdated
     **/
    @javax.annotation.Nullable
    @ApiModelProperty(value = "Timestamp when the object was last updated")
    @JsonProperty(JSON_PROPERTY_LAST_UPDATED)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

    public OffsetDateTime getLastUpdated() {
        return lastUpdated;
    }

    public OAuth2RefreshToken scopes(List scopes) {

        this.scopes = scopes;
        return this;
    }

    public OAuth2RefreshToken addscopesItem(String scopesItem) {
        if (this.scopes == null) {
            this.scopes = new ArrayList<>();
        }
        this.scopes.add(scopesItem);
        return this;
    }

    /**
     * The scope names attached to the Token
     *
     * @return scopes
     **/
    @javax.annotation.Nullable
    @ApiModelProperty(value = "The scope names attached to the Token")
    @JsonProperty(JSON_PROPERTY_SCOPES)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

    public List getScopes() {
        return scopes;
    }

    @JsonProperty(JSON_PROPERTY_SCOPES)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setScopes(List scopes) {
        this.scopes = scopes;
    }

    public OAuth2RefreshToken status(GrantOrTokenStatus status) {

        this.status = status;
        return this;
    }

    /**
     * Get status
     *
     * @return status
     **/
    @javax.annotation.Nullable
    @ApiModelProperty(value = "")
    @JsonProperty(JSON_PROPERTY_STATUS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

    public GrantOrTokenStatus getStatus() {
        return status;
    }

    @JsonProperty(JSON_PROPERTY_STATUS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setStatus(GrantOrTokenStatus status) {
        this.status = status;
    }

    public OAuth2RefreshToken userId(String userId) {

        this.userId = userId;
        return this;
    }

    /**
     * The ID of the user associated with the Token
     *
     * @return userId
     **/
    @javax.annotation.Nullable
    @ApiModelProperty(example = "00u5t60iloOHN9pBi0h7", value = "The ID of the user associated with the Token")
    @JsonProperty(JSON_PROPERTY_USER_ID)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

    public String getUserId() {
        return userId;
    }

    @JsonProperty(JSON_PROPERTY_USER_ID)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setUserId(String userId) {
        this.userId = userId;
    }

    public OAuth2RefreshToken embedded(OAuth2RefreshTokenEmbedded embedded) {

        this.embedded = embedded;
        return this;
    }

    /**
     * Get embedded
     *
     * @return embedded
     **/
    @javax.annotation.Nullable
    @ApiModelProperty(value = "")
    @JsonProperty(JSON_PROPERTY_EMBEDDED)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

    public OAuth2RefreshTokenEmbedded getEmbedded() {
        return embedded;
    }

    @JsonProperty(JSON_PROPERTY_EMBEDDED)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setEmbedded(OAuth2RefreshTokenEmbedded embedded) {
        this.embedded = embedded;
    }

    public OAuth2RefreshToken links(OAuth2RefreshTokenLinks links) {

        this.links = links;
        return this;
    }

    /**
     * Get links
     *
     * @return links
     **/
    @javax.annotation.Nullable
    @ApiModelProperty(value = "")
    @JsonProperty(JSON_PROPERTY_LINKS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

    public OAuth2RefreshTokenLinks getLinks() {
        return links;
    }

    @JsonProperty(JSON_PROPERTY_LINKS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setLinks(OAuth2RefreshTokenLinks links) {
        this.links = links;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        OAuth2RefreshToken oauth2RefreshToken = (OAuth2RefreshToken) o;
        return Objects.equals(this.clientId, oauth2RefreshToken.clientId)
                && Objects.equals(this.created, oauth2RefreshToken.created)
                && Objects.equals(this.expiresAt, oauth2RefreshToken.expiresAt)
                && Objects.equals(this.id, oauth2RefreshToken.id)
                && Objects.equals(this.issuer, oauth2RefreshToken.issuer)
                && Objects.equals(this.lastUpdated, oauth2RefreshToken.lastUpdated)
                && Objects.equals(this.scopes, oauth2RefreshToken.scopes)
                && Objects.equals(this.status, oauth2RefreshToken.status)
                && Objects.equals(this.userId, oauth2RefreshToken.userId)
                && Objects.equals(this.embedded, oauth2RefreshToken.embedded)
                && Objects.equals(this.links, oauth2RefreshToken.links);
        // ;
    }

    @Override
    public int hashCode() {
        return Objects.hash(clientId, created, expiresAt, id, issuer, lastUpdated, scopes, status, userId, embedded,
                links);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class OAuth2RefreshToken {\n");
        sb.append("    clientId: ").append(toIndentedString(clientId)).append("\n");
        sb.append("    created: ").append(toIndentedString(created)).append("\n");
        sb.append("    expiresAt: ").append(toIndentedString(expiresAt)).append("\n");
        sb.append("    id: ").append(toIndentedString(id)).append("\n");
        sb.append("    issuer: ").append(toIndentedString(issuer)).append("\n");
        sb.append("    lastUpdated: ").append(toIndentedString(lastUpdated)).append("\n");
        sb.append("    scopes: ").append(toIndentedString(scopes)).append("\n");
        sb.append("    status: ").append(toIndentedString(status)).append("\n");
        sb.append("    userId: ").append(toIndentedString(userId)).append("\n");
        sb.append("    embedded: ").append(toIndentedString(embedded)).append("\n");
        sb.append("    links: ").append(toIndentedString(links)).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    ");
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy