content: /*
   * Iam
   * 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.iam.client.models;
  
  import java.util.Objects;
  import java.util.Arrays;
  import com.affinidi.tdk.iam.client.models.TokenPrivateKeyAuthenticationMethodDtoPublicKeyInfo;
  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;
  
  /**
   * Private Key JWT Authentication of Client with &#x60;private_key_jwt&#x60; oAuth Method
   */
  @JsonPropertyOrder({
    UpdateTokenPrivateKeyAuthenticationMethodDto.JSON_PROPERTY_TYPE,
    UpdateTokenPrivateKeyAuthenticationMethodDto.JSON_PROPERTY_SIGNING_ALGORITHM,
    UpdateTokenPrivateKeyAuthenticationMethodDto.JSON_PROPERTY_PUBLIC_KEY_INFO
  })
  @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.13.0")
  public class UpdateTokenPrivateKeyAuthenticationMethodDto {
    /**
     * Gets or Sets type
     */
    public enum TypeEnum {
      PRIVATE_KEY(String.valueOf("PRIVATE_KEY"));
  
      private String value;
  
      TypeEnum(String value) {
        this.value = value;
      }
  
      @JsonValue
      public String getValue() {
        return value;
      }
  
      @Override
      public String toString() {
        return String.valueOf(value);
      }
  
      @JsonCreator
      public static TypeEnum fromValue(String value) {
        for (TypeEnum b : TypeEnum.values()) {
          if (b.value.equals(value)) {
            return b;
          }
        }
        throw new IllegalArgumentException("Unexpected value '" + value + "'");
      }
    }
  
    public static final String JSON_PROPERTY_TYPE = "type";
    @javax.annotation.Nullable
    private TypeEnum type;
  
    /**
     * Gets or Sets signingAlgorithm
     */
    public enum SigningAlgorithmEnum {
      RS256(String.valueOf("RS256")),
      
      RS512(String.valueOf("RS512")),
      
      ES256(String.valueOf("ES256")),
      
      ES512(String.valueOf("ES512"));
  
      private String value;
  
      SigningAlgorithmEnum(String value) {
        this.value = value;
      }
  
      @JsonValue
      public String getValue() {
        return value;
      }
  
      @Override
      public String toString() {
        return String.valueOf(value);
      }
  
      @JsonCreator
      public static SigningAlgorithmEnum fromValue(String value) {
        for (SigningAlgorithmEnum b : SigningAlgorithmEnum.values()) {
          if (b.value.equals(value)) {
            return b;
          }
        }
        throw new IllegalArgumentException("Unexpected value '" + value + "'");
      }
    }
  
    public static final String JSON_PROPERTY_SIGNING_ALGORITHM = "signingAlgorithm";
    @javax.annotation.Nullable
    private SigningAlgorithmEnum signingAlgorithm;
  
    public static final String JSON_PROPERTY_PUBLIC_KEY_INFO = "publicKeyInfo";
    @javax.annotation.Nullable
    private TokenPrivateKeyAuthenticationMethodDtoPublicKeyInfo publicKeyInfo;
  
    public UpdateTokenPrivateKeyAuthenticationMethodDto() {
    }
  
    public UpdateTokenPrivateKeyAuthenticationMethodDto type(@javax.annotation.Nullable TypeEnum type) {
      
      this.type = type;
      return this;
    }
  
    /**
     * Get type
     * @return type
     */
    @javax.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_TYPE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  
    public TypeEnum getType() {
      return type;
    }
  
  
    @JsonProperty(JSON_PROPERTY_TYPE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setType(@javax.annotation.Nullable TypeEnum type) {
      this.type = type;
    }
  
    public UpdateTokenPrivateKeyAuthenticationMethodDto signingAlgorithm(@javax.annotation.Nullable SigningAlgorithmEnum signingAlgorithm) {
      
      this.signingAlgorithm = signingAlgorithm;
      return this;
    }
  
    /**
     * Get signingAlgorithm
     * @return signingAlgorithm
     */
    @javax.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_SIGNING_ALGORITHM)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  
    public SigningAlgorithmEnum getSigningAlgorithm() {
      return signingAlgorithm;
    }
  
  
    @JsonProperty(JSON_PROPERTY_SIGNING_ALGORITHM)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setSigningAlgorithm(@javax.annotation.Nullable SigningAlgorithmEnum signingAlgorithm) {
      this.signingAlgorithm = signingAlgorithm;
    }
  
    public UpdateTokenPrivateKeyAuthenticationMethodDto publicKeyInfo(@javax.annotation.Nullable TokenPrivateKeyAuthenticationMethodDtoPublicKeyInfo publicKeyInfo) {
      
      this.publicKeyInfo = publicKeyInfo;
      return this;
    }
  
    /**
     * Get publicKeyInfo
     * @return publicKeyInfo
     */
    @javax.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_PUBLIC_KEY_INFO)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  
    public TokenPrivateKeyAuthenticationMethodDtoPublicKeyInfo getPublicKeyInfo() {
      return publicKeyInfo;
    }
  
  
    @JsonProperty(JSON_PROPERTY_PUBLIC_KEY_INFO)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setPublicKeyInfo(@javax.annotation.Nullable TokenPrivateKeyAuthenticationMethodDtoPublicKeyInfo publicKeyInfo) {
      this.publicKeyInfo = publicKeyInfo;
    }
  
    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }
      UpdateTokenPrivateKeyAuthenticationMethodDto updateTokenPrivateKeyAuthenticationMethodDto = (UpdateTokenPrivateKeyAuthenticationMethodDto) o;
      return Objects.equals(this.type, updateTokenPrivateKeyAuthenticationMethodDto.type) &&
          Objects.equals(this.signingAlgorithm, updateTokenPrivateKeyAuthenticationMethodDto.signingAlgorithm) &&
          Objects.equals(this.publicKeyInfo, updateTokenPrivateKeyAuthenticationMethodDto.publicKeyInfo);
    }
  
    @Override
    public int hashCode() {
      return Objects.hash(type, signingAlgorithm, publicKeyInfo);
    }
  
    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class UpdateTokenPrivateKeyAuthenticationMethodDto {\n");
      sb.append("    type: ").append(toIndentedString(type)).append("\n");
      sb.append("    signingAlgorithm: ").append(toIndentedString(signingAlgorithm)).append("\n");
      sb.append("    publicKeyInfo: ").append(toIndentedString(publicKeyInfo)).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 `type` to the URL query string
      if (getType() != null) {
        try {
          joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), "UTF-8").replaceAll("\\+", "%20")));
        } catch (UnsupportedEncodingException e) {
          // Should never happen, UTF-8 is always supported
          throw new RuntimeException(e);
        }
      }
  
      // add `signingAlgorithm` to the URL query string
      if (getSigningAlgorithm() != null) {
        try {
          joiner.add(String.format("%ssigningAlgorithm%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSigningAlgorithm()), "UTF-8").replaceAll("\\+", "%20")));
        } catch (UnsupportedEncodingException e) {
          // Should never happen, UTF-8 is always supported
          throw new RuntimeException(e);
        }
      }
  
      // add `publicKeyInfo` to the URL query string
      if (getPublicKeyInfo() != null) {
        joiner.add(getPublicKeyInfo().toUrlQueryString(prefix + "publicKeyInfo" + suffix));
      }
  
      return joiner.toString();
    }
  
  }
  
  