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

com.okta.sdk.resource.model.ErrorResponse 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 org.openapitools.jackson.nullable.JsonNullable;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.openapitools.jackson.nullable.JsonNullable;
import java.util.NoSuchElementException;
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;

/**
 * ErrorResponse
 */
@JsonPropertyOrder({ ErrorResponse.JSON_PROPERTY_ERROR_CAUSE, ErrorResponse.JSON_PROPERTY_ERROR_CODE,
        ErrorResponse.JSON_PROPERTY_ERROR_ID, ErrorResponse.JSON_PROPERTY_ERROR_LINK,
        ErrorResponse.JSON_PROPERTY_ERROR_SUMMARY })
@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 ErrorResponse implements Serializable {

    private static final long serialVersionUID = 1L;

    public static final String JSON_PROPERTY_ERROR_CAUSE = "errorCause";
    private JsonNullable errorCause = JsonNullable. undefined();

    public static final String JSON_PROPERTY_ERROR_CODE = "errorCode";
    private String errorCode;

    public static final String JSON_PROPERTY_ERROR_ID = "errorId";
    private JsonNullable errorId = JsonNullable. undefined();

    public static final String JSON_PROPERTY_ERROR_LINK = "errorLink";
    private JsonNullable errorLink = JsonNullable. undefined();

    public static final String JSON_PROPERTY_ERROR_SUMMARY = "errorSummary";
    private String errorSummary;

    public ErrorResponse() {
    }

    public ErrorResponse errorCause(String errorCause) {
        this.errorCause = JsonNullable. of(errorCause);

        return this;
    }

    /**
     * The reason or cause for the error in the org domain for the dr operation
     *
     * @return errorCause
     **/
    @javax.annotation.Nullable
    @ApiModelProperty(value = "The reason or cause for the error in the org domain for the dr operation")
    @JsonIgnore

    public String getErrorCause() {
        return errorCause.orElse(null);
    }

    @JsonProperty(JSON_PROPERTY_ERROR_CAUSE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

    public JsonNullable getErrorCause_JsonNullable() {
        return errorCause;
    }

    @JsonProperty(JSON_PROPERTY_ERROR_CAUSE)
    public void setErrorCause_JsonNullable(JsonNullable errorCause) {
        this.errorCause = errorCause;
    }

    public void setErrorCause(String errorCause) {
        this.errorCause = JsonNullable. of(errorCause);
    }

    public ErrorResponse errorCode(String errorCode) {

        this.errorCode = errorCode;
        return this;
    }

    /**
     * An error code unique to the error
     *
     * @return errorCode
     **/
    @javax.annotation.Nonnull
    @ApiModelProperty(required = true, value = "An error code unique to the error")
    @JsonProperty(JSON_PROPERTY_ERROR_CODE)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)

    public String getErrorCode() {
        return errorCode;
    }

    @JsonProperty(JSON_PROPERTY_ERROR_CODE)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }

    public ErrorResponse errorId(String errorId) {
        this.errorId = JsonNullable. of(errorId);

        return this;
    }

    /**
     * The unique identifier of this error
     *
     * @return errorId
     **/
    @javax.annotation.Nullable
    @ApiModelProperty(value = "The unique identifier of this error")
    @JsonIgnore

    public String getErrorId() {
        return errorId.orElse(null);
    }

    @JsonProperty(JSON_PROPERTY_ERROR_ID)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

    public JsonNullable getErrorId_JsonNullable() {
        return errorId;
    }

    @JsonProperty(JSON_PROPERTY_ERROR_ID)
    public void setErrorId_JsonNullable(JsonNullable errorId) {
        this.errorId = errorId;
    }

    public void setErrorId(String errorId) {
        this.errorId = JsonNullable. of(errorId);
    }

    public ErrorResponse errorLink(String errorLink) {
        this.errorLink = JsonNullable. of(errorLink);

        return this;
    }

    /**
     * An indicator where to look out to troubleshoot the error
     *
     * @return errorLink
     **/
    @javax.annotation.Nullable
    @ApiModelProperty(value = "An indicator where to look out to troubleshoot the error")
    @JsonIgnore

    public String getErrorLink() {
        return errorLink.orElse(null);
    }

    @JsonProperty(JSON_PROPERTY_ERROR_LINK)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

    public JsonNullable getErrorLink_JsonNullable() {
        return errorLink;
    }

    @JsonProperty(JSON_PROPERTY_ERROR_LINK)
    public void setErrorLink_JsonNullable(JsonNullable errorLink) {
        this.errorLink = errorLink;
    }

    public void setErrorLink(String errorLink) {
        this.errorLink = JsonNullable. of(errorLink);
    }

    public ErrorResponse errorSummary(String errorSummary) {

        this.errorSummary = errorSummary;
        return this;
    }

    /**
     * An error code description, detailing the error
     *
     * @return errorSummary
     **/
    @javax.annotation.Nonnull
    @ApiModelProperty(required = true, value = "An error code description, detailing the error")
    @JsonProperty(JSON_PROPERTY_ERROR_SUMMARY)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)

    public String getErrorSummary() {
        return errorSummary;
    }

    @JsonProperty(JSON_PROPERTY_ERROR_SUMMARY)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setErrorSummary(String errorSummary) {
        this.errorSummary = errorSummary;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        ErrorResponse errorResponse = (ErrorResponse) o;
        return equalsNullable(this.errorCause, errorResponse.errorCause)
                && Objects.equals(this.errorCode, errorResponse.errorCode)
                && equalsNullable(this.errorId, errorResponse.errorId)
                && equalsNullable(this.errorLink, errorResponse.errorLink)
                && Objects.equals(this.errorSummary, errorResponse.errorSummary);
        // ;
    }

    private static  boolean equalsNullable(JsonNullable a, JsonNullable b) {
        return a == b
                || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
    }

    @Override
    public int hashCode() {
        return Objects.hash(hashCodeNullable(errorCause), errorCode, hashCodeNullable(errorId),
                hashCodeNullable(errorLink), errorSummary);
    }

    private static  int hashCodeNullable(JsonNullable a) {
        if (a == null) {
            return 1;
        }
        return a.isPresent() ? Arrays.deepHashCode(new Object[] { a.get() }) : 31;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class ErrorResponse {\n");
        sb.append("    errorCause: ").append(toIndentedString(errorCause)).append("\n");
        sb.append("    errorCode: ").append(toIndentedString(errorCode)).append("\n");
        sb.append("    errorId: ").append(toIndentedString(errorId)).append("\n");
        sb.append("    errorLink: ").append(toIndentedString(errorLink)).append("\n");
        sb.append("    errorSummary: ").append(toIndentedString(errorSummary)).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