content: /*
   * OidcVpAdapterBackend
   * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
   *
   * The version of the OpenAPI document: 1.0.0
   * Contact: info@affinidi.com
   *
   * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
   * https://openapi-generator.tech
   * Do not edit the class manually.
   */
  
  
  package com.affinidi.tdk.login.configuration.client.models;
  
  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.fasterxml.jackson.annotation.JsonPropertyOrder;
  import com.fasterxml.jackson.annotation.JsonTypeName;
  import java.io.UnsupportedEncodingException;
  import java.net.URLEncoder;
  import java.util.StringJoiner;
  
  /**
   * Authorization Response per OpenID for Verifiable Presentations Specification
   */
  @JsonPropertyOrder({
    LoginSessionRejectResponseInput.JSON_PROPERTY_ERROR,
    LoginSessionRejectResponseInput.JSON_PROPERTY_ERROR_DESCRIPTION,
    LoginSessionRejectResponseInput.JSON_PROPERTY_STATE
  })
  @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.13.0")
  public class LoginSessionRejectResponseInput {
    public static final String JSON_PROPERTY_ERROR = "error";
    @javax.annotation.Nullable
    private String error;
  
    public static final String JSON_PROPERTY_ERROR_DESCRIPTION = "errorDescription";
    @javax.annotation.Nullable
    private String errorDescription;
  
    public static final String JSON_PROPERTY_STATE = "state";
    @javax.annotation.Nonnull
    private String state;
  
    public LoginSessionRejectResponseInput() {
    }
  
    public LoginSessionRejectResponseInput error(@javax.annotation.Nullable String error) {
      
      this.error = error;
      return this;
    }
  
    /**
     * The error should follow the OAuth2 error format (e.g. invalid_request, login_required). Defaults to request_denied
     * @return error
     */
    @javax.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_ERROR)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  
    public String getError() {
      return error;
    }
  
  
    @JsonProperty(JSON_PROPERTY_ERROR)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setError(@javax.annotation.Nullable String error) {
      this.error = error;
    }
  
    public LoginSessionRejectResponseInput errorDescription(@javax.annotation.Nullable String errorDescription) {
      
      this.errorDescription = errorDescription;
      return this;
    }
  
    /**
     * Description of the error in a human readable format
     * @return errorDescription
     */
    @javax.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_ERROR_DESCRIPTION)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  
    public String getErrorDescription() {
      return errorDescription;
    }
  
  
    @JsonProperty(JSON_PROPERTY_ERROR_DESCRIPTION)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setErrorDescription(@javax.annotation.Nullable String errorDescription) {
      this.errorDescription = errorDescription;
    }
  
    public LoginSessionRejectResponseInput state(@javax.annotation.Nonnull String state) {
      
      this.state = state;
      return this;
    }
  
    /**
     * Random state associated to the Session
     * @return state
     */
    @javax.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_STATE)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
  
    public String getState() {
      return state;
    }
  
  
    @JsonProperty(JSON_PROPERTY_STATE)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setState(@javax.annotation.Nonnull String state) {
      this.state = state;
    }
  
    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }
      LoginSessionRejectResponseInput loginSessionRejectResponseInput = (LoginSessionRejectResponseInput) o;
      return Objects.equals(this.error, loginSessionRejectResponseInput.error) &&
          Objects.equals(this.errorDescription, loginSessionRejectResponseInput.errorDescription) &&
          Objects.equals(this.state, loginSessionRejectResponseInput.state);
    }
  
    @Override
    public int hashCode() {
      return Objects.hash(error, errorDescription, state);
    }
  
    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class LoginSessionRejectResponseInput {\n");
      sb.append("    error: ").append(toIndentedString(error)).append("\n");
      sb.append("    errorDescription: ").append(toIndentedString(errorDescription)).append("\n");
      sb.append("    state: ").append(toIndentedString(state)).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    ");
    }
  
    /**
     * Convert the instance into URL query string.
     *
     * @return URL query string
     */
    public String toUrlQueryString() {
      return toUrlQueryString(null);
    }
  
    /**
     * Convert the instance into URL query string.
     *
     * @param prefix prefix of the query string
     * @return URL query string
     */
    public String toUrlQueryString(String prefix) {
      String suffix = "";
      String containerSuffix = "";
      String containerPrefix = "";
      if (prefix == null) {
        // style=form, explode=true, e.g. /pet?name=cat&type=manx
        prefix = "";
      } else {
        // deepObject style e.g. /pet?id[name]=cat&id[type]=manx
        prefix = prefix + "[";
        suffix = "]";
        containerSuffix = "]";
        containerPrefix = "[";
      }
  
      StringJoiner joiner = new StringJoiner("&");
  
      // add `error` to the URL query string
      if (getError() != null) {
        try {
          joiner.add(String.format("%serror%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getError()), "UTF-8").replaceAll("\\+", "%20")));
        } catch (UnsupportedEncodingException e) {
          // Should never happen, UTF-8 is always supported
          throw new RuntimeException(e);
        }
      }
  
      // add `errorDescription` to the URL query string
      if (getErrorDescription() != null) {
        try {
          joiner.add(String.format("%serrorDescription%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getErrorDescription()), "UTF-8").replaceAll("\\+", "%20")));
        } catch (UnsupportedEncodingException e) {
          // Should never happen, UTF-8 is always supported
          throw new RuntimeException(e);
        }
      }
  
      // add `state` to the URL query string
      if (getState() != null) {
        try {
          joiner.add(String.format("%sstate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getState()), "UTF-8").replaceAll("\\+", "%20")));
        } catch (UnsupportedEncodingException e) {
          // Should never happen, UTF-8 is always supported
          throw new RuntimeException(e);
        }
      }
  
      return joiner.toString();
    }
  
  }
  
  