content: /*
   * IotaService
   * 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.iota.client.models;
  
  import java.util.Objects;
  import java.util.Arrays;
  import com.affinidi.tdk.iota.client.models.IotaConfigurationDtoClientMetadata;
  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.math.BigDecimal;
  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;
  
  /**
   * CreateIotaConfigurationInput
   */
  @JsonPropertyOrder({
    CreateIotaConfigurationInput.JSON_PROPERTY_NAME,
    CreateIotaConfigurationInput.JSON_PROPERTY_DESCRIPTION,
    CreateIotaConfigurationInput.JSON_PROPERTY_WALLET_ARI,
    CreateIotaConfigurationInput.JSON_PROPERTY_IOTA_RESPONSE_WEBHOOK_U_R_L,
    CreateIotaConfigurationInput.JSON_PROPERTY_ENABLE_VERIFICATION,
    CreateIotaConfigurationInput.JSON_PROPERTY_ENABLE_CONSENT_AUDIT_LOG,
    CreateIotaConfigurationInput.JSON_PROPERTY_TOKEN_MAX_AGE,
    CreateIotaConfigurationInput.JSON_PROPERTY_CLIENT_METADATA,
    CreateIotaConfigurationInput.JSON_PROPERTY_MODE,
    CreateIotaConfigurationInput.JSON_PROPERTY_REDIRECT_URIS,
    CreateIotaConfigurationInput.JSON_PROPERTY_ENABLE_IDV_PROVIDERS
  })
  @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.13.0")
  public class CreateIotaConfigurationInput {
    public static final String JSON_PROPERTY_NAME = "name";
    @javax.annotation.Nonnull
    private String name;
  
    public static final String JSON_PROPERTY_DESCRIPTION = "description";
    @javax.annotation.Nullable
    private String description;
  
    public static final String JSON_PROPERTY_WALLET_ARI = "walletAri";
    @javax.annotation.Nonnull
    private String walletAri;
  
    public static final String JSON_PROPERTY_IOTA_RESPONSE_WEBHOOK_U_R_L = "iotaResponseWebhookURL";
    @javax.annotation.Nullable
    private String iotaResponseWebhookURL;
  
    public static final String JSON_PROPERTY_ENABLE_VERIFICATION = "enableVerification";
    @javax.annotation.Nonnull
    private Boolean enableVerification;
  
    public static final String JSON_PROPERTY_ENABLE_CONSENT_AUDIT_LOG = "enableConsentAuditLog";
    @javax.annotation.Nonnull
    private Boolean enableConsentAuditLog;
  
    public static final String JSON_PROPERTY_TOKEN_MAX_AGE = "tokenMaxAge";
    @javax.annotation.Nullable
    private BigDecimal tokenMaxAge;
  
    public static final String JSON_PROPERTY_CLIENT_METADATA = "clientMetadata";
    @javax.annotation.Nonnull
    private IotaConfigurationDtoClientMetadata clientMetadata;
  
    /**
     * Determines whether to handle the data-sharing request using the WebSocket or Redirect flow.
     */
    public enum ModeEnum {
      REDIRECT(String.valueOf("redirect")),
      
      WEBSOCKET(String.valueOf("websocket"));
  
      private String value;
  
      ModeEnum(String value) {
        this.value = value;
      }
  
      @JsonValue
      public String getValue() {
        return value;
      }
  
      @Override
      public String toString() {
        return String.valueOf(value);
      }
  
      @JsonCreator
      public static ModeEnum fromValue(String value) {
        for (ModeEnum b : ModeEnum.values()) {
          if (b.value.equals(value)) {
            return b;
          }
        }
        throw new IllegalArgumentException("Unexpected value '" + value + "'");
      }
    }
  
    public static final String JSON_PROPERTY_MODE = "mode";
    @javax.annotation.Nullable
    private ModeEnum mode = ModeEnum.WEBSOCKET;
  
    public static final String JSON_PROPERTY_REDIRECT_URIS = "redirectUris";
    @javax.annotation.Nullable
    private List<String> redirectUris = new ArrayList<>();
  
    public static final String JSON_PROPERTY_ENABLE_IDV_PROVIDERS = "enableIdvProviders";
    @javax.annotation.Nullable
    private Boolean enableIdvProviders;
  
    public CreateIotaConfigurationInput() {
    }
  
    public CreateIotaConfigurationInput name(@javax.annotation.Nonnull String name) {
      
      this.name = name;
      return this;
    }
  
    /**
     * The name of the configuration to quickly identify the resource.
     * @return name
     */
    @javax.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_NAME)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
  
    public String getName() {
      return name;
    }
  
  
    @JsonProperty(JSON_PROPERTY_NAME)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setName(@javax.annotation.Nonnull String name) {
      this.name = name;
    }
  
    public CreateIotaConfigurationInput description(@javax.annotation.Nullable String description) {
      
      this.description = description;
      return this;
    }
  
    /**
     * An optional description of what the configuration is used for.
     * @return description
     */
    @javax.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_DESCRIPTION)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  
    public String getDescription() {
      return description;
    }
  
  
    @JsonProperty(JSON_PROPERTY_DESCRIPTION)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setDescription(@javax.annotation.Nullable String description) {
      this.description = description;
    }
  
    public CreateIotaConfigurationInput walletAri(@javax.annotation.Nonnull String walletAri) {
      
      this.walletAri = walletAri;
      return this;
    }
  
    /**
     * The unique resource identifier of the Wallet used to sign the request token.
     * @return walletAri
     */
    @javax.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_WALLET_ARI)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
  
    public String getWalletAri() {
      return walletAri;
    }
  
  
    @JsonProperty(JSON_PROPERTY_WALLET_ARI)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setWalletAri(@javax.annotation.Nonnull String walletAri) {
      this.walletAri = walletAri;
    }
  
    public CreateIotaConfigurationInput iotaResponseWebhookURL(@javax.annotation.Nullable String iotaResponseWebhookURL) {
      
      this.iotaResponseWebhookURL = iotaResponseWebhookURL;
      return this;
    }
  
    /**
     * The webhook URL is used for callback when the data is ready.
     * @return iotaResponseWebhookURL
     */
    @javax.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_IOTA_RESPONSE_WEBHOOK_U_R_L)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  
    public String getIotaResponseWebhookURL() {
      return iotaResponseWebhookURL;
    }
  
  
    @JsonProperty(JSON_PROPERTY_IOTA_RESPONSE_WEBHOOK_U_R_L)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setIotaResponseWebhookURL(@javax.annotation.Nullable String iotaResponseWebhookURL) {
      this.iotaResponseWebhookURL = iotaResponseWebhookURL;
    }
  
    public CreateIotaConfigurationInput enableVerification(@javax.annotation.Nonnull Boolean enableVerification) {
      
      this.enableVerification = enableVerification;
      return this;
    }
  
    /**
     * Cryptographically verifies the data shared by the user when enabled.
     * @return enableVerification
     */
    @javax.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_ENABLE_VERIFICATION)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
  
    public Boolean getEnableVerification() {
      return enableVerification;
    }
  
  
    @JsonProperty(JSON_PROPERTY_ENABLE_VERIFICATION)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setEnableVerification(@javax.annotation.Nonnull Boolean enableVerification) {
      this.enableVerification = enableVerification;
    }
  
    public CreateIotaConfigurationInput enableConsentAuditLog(@javax.annotation.Nonnull Boolean enableConsentAuditLog) {
      
      this.enableConsentAuditLog = enableConsentAuditLog;
      return this;
    }
  
    /**
     * Records the user&#39;s consent when they share their data, including the type of data shared when enabled.
     * @return enableConsentAuditLog
     */
    @javax.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_ENABLE_CONSENT_AUDIT_LOG)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
  
    public Boolean getEnableConsentAuditLog() {
      return enableConsentAuditLog;
    }
  
  
    @JsonProperty(JSON_PROPERTY_ENABLE_CONSENT_AUDIT_LOG)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setEnableConsentAuditLog(@javax.annotation.Nonnull Boolean enableConsentAuditLog) {
      this.enableConsentAuditLog = enableConsentAuditLog;
    }
  
    public CreateIotaConfigurationInput tokenMaxAge(@javax.annotation.Nullable BigDecimal tokenMaxAge) {
      
      this.tokenMaxAge = tokenMaxAge;
      return this;
    }
  
    /**
     * This is the lifetime of the signed request token during the data-sharing flow.
     * minimum: 1
     * @return tokenMaxAge
     */
    @javax.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_TOKEN_MAX_AGE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  
    public BigDecimal getTokenMaxAge() {
      return tokenMaxAge;
    }
  
  
    @JsonProperty(JSON_PROPERTY_TOKEN_MAX_AGE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setTokenMaxAge(@javax.annotation.Nullable BigDecimal tokenMaxAge) {
      this.tokenMaxAge = tokenMaxAge;
    }
  
    public CreateIotaConfigurationInput clientMetadata(@javax.annotation.Nonnull IotaConfigurationDtoClientMetadata clientMetadata) {
      
      this.clientMetadata = clientMetadata;
      return this;
    }
  
    /**
     * Get clientMetadata
     * @return clientMetadata
     */
    @javax.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_CLIENT_METADATA)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
  
    public IotaConfigurationDtoClientMetadata getClientMetadata() {
      return clientMetadata;
    }
  
  
    @JsonProperty(JSON_PROPERTY_CLIENT_METADATA)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setClientMetadata(@javax.annotation.Nonnull IotaConfigurationDtoClientMetadata clientMetadata) {
      this.clientMetadata = clientMetadata;
    }
  
    public CreateIotaConfigurationInput mode(@javax.annotation.Nullable ModeEnum mode) {
      
      this.mode = mode;
      return this;
    }
  
    /**
     * Determines whether to handle the data-sharing request using the WebSocket or Redirect flow.
     * @return mode
     */
    @javax.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_MODE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  
    public ModeEnum getMode() {
      return mode;
    }
  
  
    @JsonProperty(JSON_PROPERTY_MODE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setMode(@javax.annotation.Nullable ModeEnum mode) {
      this.mode = mode;
    }
  
    public CreateIotaConfigurationInput redirectUris(@javax.annotation.Nullable List<String> redirectUris) {
      
      this.redirectUris = redirectUris;
      return this;
    }
  
    public CreateIotaConfigurationInput addRedirectUrisItem(String redirectUrisItem) {
      if (this.redirectUris == null) {
        this.redirectUris = new ArrayList<>();
      }
      this.redirectUris.add(redirectUrisItem);
      return this;
    }
  
    /**
     * List of allowed URLs to redirect users, including the response from the request. This is required if the selected data-sharing mode is Redirect.
     * @return redirectUris
     */
    @javax.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_REDIRECT_URIS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  
    public List<String> getRedirectUris() {
      return redirectUris;
    }
  
  
    @JsonProperty(JSON_PROPERTY_REDIRECT_URIS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setRedirectUris(@javax.annotation.Nullable List<String> redirectUris) {
      this.redirectUris = redirectUris;
    }
  
    public CreateIotaConfigurationInput enableIdvProviders(@javax.annotation.Nullable Boolean enableIdvProviders) {
      
      this.enableIdvProviders = enableIdvProviders;
      return this;
    }
  
    /**
     * Enables identity verification from user with a 3rd-party provider when a verified identity document is not found.
     * @return enableIdvProviders
     */
    @javax.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_ENABLE_IDV_PROVIDERS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  
    public Boolean getEnableIdvProviders() {
      return enableIdvProviders;
    }
  
  
    @JsonProperty(JSON_PROPERTY_ENABLE_IDV_PROVIDERS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setEnableIdvProviders(@javax.annotation.Nullable Boolean enableIdvProviders) {
      this.enableIdvProviders = enableIdvProviders;
    }
  
    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }
      CreateIotaConfigurationInput createIotaConfigurationInput = (CreateIotaConfigurationInput) o;
      return Objects.equals(this.name, createIotaConfigurationInput.name) &&
          Objects.equals(this.description, createIotaConfigurationInput.description) &&
          Objects.equals(this.walletAri, createIotaConfigurationInput.walletAri) &&
          Objects.equals(this.iotaResponseWebhookURL, createIotaConfigurationInput.iotaResponseWebhookURL) &&
          Objects.equals(this.enableVerification, createIotaConfigurationInput.enableVerification) &&
          Objects.equals(this.enableConsentAuditLog, createIotaConfigurationInput.enableConsentAuditLog) &&
          Objects.equals(this.tokenMaxAge, createIotaConfigurationInput.tokenMaxAge) &&
          Objects.equals(this.clientMetadata, createIotaConfigurationInput.clientMetadata) &&
          Objects.equals(this.mode, createIotaConfigurationInput.mode) &&
          Objects.equals(this.redirectUris, createIotaConfigurationInput.redirectUris) &&
          Objects.equals(this.enableIdvProviders, createIotaConfigurationInput.enableIdvProviders);
    }
  
    @Override
    public int hashCode() {
      return Objects.hash(name, description, walletAri, iotaResponseWebhookURL, enableVerification, enableConsentAuditLog, tokenMaxAge, clientMetadata, mode, redirectUris, enableIdvProviders);
    }
  
    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class CreateIotaConfigurationInput {\n");
      sb.append("    name: ").append(toIndentedString(name)).append("\n");
      sb.append("    description: ").append(toIndentedString(description)).append("\n");
      sb.append("    walletAri: ").append(toIndentedString(walletAri)).append("\n");
      sb.append("    iotaResponseWebhookURL: ").append(toIndentedString(iotaResponseWebhookURL)).append("\n");
      sb.append("    enableVerification: ").append(toIndentedString(enableVerification)).append("\n");
      sb.append("    enableConsentAuditLog: ").append(toIndentedString(enableConsentAuditLog)).append("\n");
      sb.append("    tokenMaxAge: ").append(toIndentedString(tokenMaxAge)).append("\n");
      sb.append("    clientMetadata: ").append(toIndentedString(clientMetadata)).append("\n");
      sb.append("    mode: ").append(toIndentedString(mode)).append("\n");
      sb.append("    redirectUris: ").append(toIndentedString(redirectUris)).append("\n");
      sb.append("    enableIdvProviders: ").append(toIndentedString(enableIdvProviders)).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 `name` to the URL query string
      if (getName() != null) {
        try {
          joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20")));
        } catch (UnsupportedEncodingException e) {
          // Should never happen, UTF-8 is always supported
          throw new RuntimeException(e);
        }
      }
  
      // add `description` to the URL query string
      if (getDescription() != null) {
        try {
          joiner.add(String.format("%sdescription%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDescription()), "UTF-8").replaceAll("\\+", "%20")));
        } catch (UnsupportedEncodingException e) {
          // Should never happen, UTF-8 is always supported
          throw new RuntimeException(e);
        }
      }
  
      // add `walletAri` to the URL query string
      if (getWalletAri() != null) {
        try {
          joiner.add(String.format("%swalletAri%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getWalletAri()), "UTF-8").replaceAll("\\+", "%20")));
        } catch (UnsupportedEncodingException e) {
          // Should never happen, UTF-8 is always supported
          throw new RuntimeException(e);
        }
      }
  
      // add `iotaResponseWebhookURL` to the URL query string
      if (getIotaResponseWebhookURL() != null) {
        try {
          joiner.add(String.format("%siotaResponseWebhookURL%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIotaResponseWebhookURL()), "UTF-8").replaceAll("\\+", "%20")));
        } catch (UnsupportedEncodingException e) {
          // Should never happen, UTF-8 is always supported
          throw new RuntimeException(e);
        }
      }
  
      // add `enableVerification` to the URL query string
      if (getEnableVerification() != null) {
        try {
          joiner.add(String.format("%senableVerification%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEnableVerification()), "UTF-8").replaceAll("\\+", "%20")));
        } catch (UnsupportedEncodingException e) {
          // Should never happen, UTF-8 is always supported
          throw new RuntimeException(e);
        }
      }
  
      // add `enableConsentAuditLog` to the URL query string
      if (getEnableConsentAuditLog() != null) {
        try {
          joiner.add(String.format("%senableConsentAuditLog%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEnableConsentAuditLog()), "UTF-8").replaceAll("\\+", "%20")));
        } catch (UnsupportedEncodingException e) {
          // Should never happen, UTF-8 is always supported
          throw new RuntimeException(e);
        }
      }
  
      // add `tokenMaxAge` to the URL query string
      if (getTokenMaxAge() != null) {
        try {
          joiner.add(String.format("%stokenMaxAge%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTokenMaxAge()), "UTF-8").replaceAll("\\+", "%20")));
        } catch (UnsupportedEncodingException e) {
          // Should never happen, UTF-8 is always supported
          throw new RuntimeException(e);
        }
      }
  
      // add `clientMetadata` to the URL query string
      if (getClientMetadata() != null) {
        joiner.add(getClientMetadata().toUrlQueryString(prefix + "clientMetadata" + suffix));
      }
  
      // add `mode` to the URL query string
      if (getMode() != null) {
        try {
          joiner.add(String.format("%smode%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMode()), "UTF-8").replaceAll("\\+", "%20")));
        } catch (UnsupportedEncodingException e) {
          // Should never happen, UTF-8 is always supported
          throw new RuntimeException(e);
        }
      }
  
      // add `redirectUris` to the URL query string
      if (getRedirectUris() != null) {
        for (int i = 0; i < getRedirectUris().size(); i++) {
          try {
            joiner.add(String.format("%sredirectUris%s%s=%s", prefix, suffix,
                "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
                URLEncoder.encode(String.valueOf(getRedirectUris().get(i)), "UTF-8").replaceAll("\\+", "%20")));
          } catch (UnsupportedEncodingException e) {
            // Should never happen, UTF-8 is always supported
            throw new RuntimeException(e);
          }
        }
      }
  
      // add `enableIdvProviders` to the URL query string
      if (getEnableIdvProviders() != null) {
        try {
          joiner.add(String.format("%senableIdvProviders%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEnableIdvProviders()), "UTF-8").replaceAll("\\+", "%20")));
        } catch (UnsupportedEncodingException e) {
          // Should never happen, UTF-8 is always supported
          throw new RuntimeException(e);
        }
      }
  
      return joiner.toString();
    }
  
  }
  
  