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 java.util.ArrayList;
  import java.util.Arrays;
  import java.util.List;
  import com.fasterxml.jackson.annotation.JsonPropertyOrder;
  import com.fasterxml.jackson.annotation.JsonTypeName;
  import java.io.UnsupportedEncodingException;
  import java.net.URLEncoder;
  import java.util.StringJoiner;
  
  /**
   * OAuth2TokenAuthorizationDetailsInner
   */
  @JsonPropertyOrder({
    OAuth2TokenAuthorizationDetailsInner.JSON_PROPERTY_TYPE,
    OAuth2TokenAuthorizationDetailsInner.JSON_PROPERTY_CREDENTIAL_CONFIGURATION_ID,
    OAuth2TokenAuthorizationDetailsInner.JSON_PROPERTY_CREDENTIAL_IDENTIFIERS
  })
  @JsonTypeName("OAuth2Token_authorization_details_inner")
  @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.13.0")
  public class OAuth2TokenAuthorizationDetailsInner {
    /**
     * String that determines the authorization details type. 
     */
    public enum TypeEnum {
      OPENID_CREDENTIAL(String.valueOf("openid_credential"));
  
      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.Nonnull
    private TypeEnum type = TypeEnum.OPENID_CREDENTIAL;
  
    public static final String JSON_PROPERTY_CREDENTIAL_CONFIGURATION_ID = "credential_configuration_id";
    @javax.annotation.Nonnull
    private String credentialConfigurationId;
  
    public static final String JSON_PROPERTY_CREDENTIAL_IDENTIFIERS = "credential_identifiers";
    @javax.annotation.Nullable
    private List<String> credentialIdentifiers = new ArrayList<>();
  
    public OAuth2TokenAuthorizationDetailsInner() {
    }
  
    public OAuth2TokenAuthorizationDetailsInner type(@javax.annotation.Nonnull TypeEnum type) {
      
      this.type = type;
      return this;
    }
  
    /**
     * String that determines the authorization details type. 
     * @return type
     */
    @javax.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_TYPE)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
  
    public TypeEnum getType() {
      return type;
    }
  
  
    @JsonProperty(JSON_PROPERTY_TYPE)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setType(@javax.annotation.Nonnull TypeEnum type) {
      this.type = type;
    }
  
    public OAuth2TokenAuthorizationDetailsInner credentialConfigurationId(@javax.annotation.Nonnull String credentialConfigurationId) {
      
      this.credentialConfigurationId = credentialConfigurationId;
      return this;
    }
  
    /**
     * Get credentialConfigurationId
     * @return credentialConfigurationId
     */
    @javax.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_CREDENTIAL_CONFIGURATION_ID)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
  
    public String getCredentialConfigurationId() {
      return credentialConfigurationId;
    }
  
  
    @JsonProperty(JSON_PROPERTY_CREDENTIAL_CONFIGURATION_ID)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setCredentialConfigurationId(@javax.annotation.Nonnull String credentialConfigurationId) {
      this.credentialConfigurationId = credentialConfigurationId;
    }
  
    public OAuth2TokenAuthorizationDetailsInner credentialIdentifiers(@javax.annotation.Nullable List<String> credentialIdentifiers) {
      
      this.credentialIdentifiers = credentialIdentifiers;
      return this;
    }
  
    public OAuth2TokenAuthorizationDetailsInner addCredentialIdentifiersItem(String credentialIdentifiersItem) {
      if (this.credentialIdentifiers == null) {
        this.credentialIdentifiers = new ArrayList<>();
      }
      this.credentialIdentifiers.add(credentialIdentifiersItem);
      return this;
    }
  
    /**
     * Get credentialIdentifiers
     * @return credentialIdentifiers
     */
    @javax.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_CREDENTIAL_IDENTIFIERS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  
    public List<String> getCredentialIdentifiers() {
      return credentialIdentifiers;
    }
  
  
    @JsonProperty(JSON_PROPERTY_CREDENTIAL_IDENTIFIERS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setCredentialIdentifiers(@javax.annotation.Nullable List<String> credentialIdentifiers) {
      this.credentialIdentifiers = credentialIdentifiers;
    }
  
    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }
      OAuth2TokenAuthorizationDetailsInner oauth2TokenAuthorizationDetailsInner = (OAuth2TokenAuthorizationDetailsInner) o;
      return Objects.equals(this.type, oauth2TokenAuthorizationDetailsInner.type) &&
          Objects.equals(this.credentialConfigurationId, oauth2TokenAuthorizationDetailsInner.credentialConfigurationId) &&
          Objects.equals(this.credentialIdentifiers, oauth2TokenAuthorizationDetailsInner.credentialIdentifiers);
    }
  
    @Override
    public int hashCode() {
      return Objects.hash(type, credentialConfigurationId, credentialIdentifiers);
    }
  
    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class OAuth2TokenAuthorizationDetailsInner {\n");
      sb.append("    type: ").append(toIndentedString(type)).append("\n");
      sb.append("    credentialConfigurationId: ").append(toIndentedString(credentialConfigurationId)).append("\n");
      sb.append("    credentialIdentifiers: ").append(toIndentedString(credentialIdentifiers)).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 `credential_configuration_id` to the URL query string
      if (getCredentialConfigurationId() != null) {
        try {
          joiner.add(String.format("%scredential_configuration_id%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCredentialConfigurationId()), "UTF-8").replaceAll("\\+", "%20")));
        } catch (UnsupportedEncodingException e) {
          // Should never happen, UTF-8 is always supported
          throw new RuntimeException(e);
        }
      }
  
      // add `credential_identifiers` to the URL query string
      if (getCredentialIdentifiers() != null) {
        for (int i = 0; i < getCredentialIdentifiers().size(); i++) {
          try {
            joiner.add(String.format("%scredential_identifiers%s%s=%s", prefix, suffix,
                "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
                URLEncoder.encode(String.valueOf(getCredentialIdentifiers().get(i)), "UTF-8").replaceAll("\\+", "%20")));
          } catch (UnsupportedEncodingException e) {
            // Should never happen, UTF-8 is always supported
            throw new RuntimeException(e);
          }
        }
      }
  
      return joiner.toString();
    }
  
  }
  
  