content: /*
   * CredentialIssuanceService
   * 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.credential.issuance.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.math.BigDecimal;
  import com.fasterxml.jackson.annotation.JsonPropertyOrder;
  import com.fasterxml.jackson.annotation.JsonTypeName;
  import java.io.UnsupportedEncodingException;
  import java.net.URLEncoder;
  import java.util.StringJoiner;
  
  /**
   * StartIssuanceResponse
   */
  @JsonPropertyOrder({
    StartIssuanceResponse.JSON_PROPERTY_CREDENTIAL_OFFER_URI,
    StartIssuanceResponse.JSON_PROPERTY_TX_CODE,
    StartIssuanceResponse.JSON_PROPERTY_ISSUANCE_ID,
    StartIssuanceResponse.JSON_PROPERTY_EXPIRES_IN
  })
  @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.13.0")
  public class StartIssuanceResponse {
    public static final String JSON_PROPERTY_CREDENTIAL_OFFER_URI = "credentialOfferUri";
    @javax.annotation.Nonnull
    private String credentialOfferUri;
  
    public static final String JSON_PROPERTY_TX_CODE = "txCode";
    @javax.annotation.Nullable
    private String txCode;
  
    public static final String JSON_PROPERTY_ISSUANCE_ID = "issuanceId";
    @javax.annotation.Nonnull
    private String issuanceId;
  
    public static final String JSON_PROPERTY_EXPIRES_IN = "expiresIn";
    @javax.annotation.Nonnull
    private BigDecimal expiresIn;
  
    public StartIssuanceResponse() {
    }
  
    public StartIssuanceResponse credentialOfferUri(@javax.annotation.Nonnull String credentialOfferUri) {
      
      this.credentialOfferUri = credentialOfferUri;
      return this;
    }
  
    /**
     * URL where wallet can view offer details
     * @return credentialOfferUri
     */
    @javax.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_CREDENTIAL_OFFER_URI)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
  
    public String getCredentialOfferUri() {
      return credentialOfferUri;
    }
  
  
    @JsonProperty(JSON_PROPERTY_CREDENTIAL_OFFER_URI)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setCredentialOfferUri(@javax.annotation.Nonnull String credentialOfferUri) {
      this.credentialOfferUri = credentialOfferUri;
    }
  
    public StartIssuanceResponse txCode(@javax.annotation.Nullable String txCode) {
      
      this.txCode = txCode;
      return this;
    }
  
    /**
     * One time transaction code generated by CIS
     * @return txCode
     */
    @javax.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_TX_CODE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  
    public String getTxCode() {
      return txCode;
    }
  
  
    @JsonProperty(JSON_PROPERTY_TX_CODE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setTxCode(@javax.annotation.Nullable String txCode) {
      this.txCode = txCode;
    }
  
    public StartIssuanceResponse issuanceId(@javax.annotation.Nonnull String issuanceId) {
      
      this.issuanceId = issuanceId;
      return this;
    }
  
    /**
     * Website&#39;s internal identifier. Website may use to get info about the status of issuance flow. If it is not provided, CIS will generate one.
     * @return issuanceId
     */
    @javax.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_ISSUANCE_ID)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
  
    public String getIssuanceId() {
      return issuanceId;
    }
  
  
    @JsonProperty(JSON_PROPERTY_ISSUANCE_ID)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setIssuanceId(@javax.annotation.Nonnull String issuanceId) {
      this.issuanceId = issuanceId;
    }
  
    public StartIssuanceResponse expiresIn(@javax.annotation.Nonnull BigDecimal expiresIn) {
      
      this.expiresIn = expiresIn;
      return this;
    }
  
    /**
     * Expire time in seconds
     * @return expiresIn
     */
    @javax.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_EXPIRES_IN)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
  
    public BigDecimal getExpiresIn() {
      return expiresIn;
    }
  
  
    @JsonProperty(JSON_PROPERTY_EXPIRES_IN)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setExpiresIn(@javax.annotation.Nonnull BigDecimal expiresIn) {
      this.expiresIn = expiresIn;
    }
  
    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }
      StartIssuanceResponse startIssuanceResponse = (StartIssuanceResponse) o;
      return Objects.equals(this.credentialOfferUri, startIssuanceResponse.credentialOfferUri) &&
          Objects.equals(this.txCode, startIssuanceResponse.txCode) &&
          Objects.equals(this.issuanceId, startIssuanceResponse.issuanceId) &&
          Objects.equals(this.expiresIn, startIssuanceResponse.expiresIn);
    }
  
    @Override
    public int hashCode() {
      return Objects.hash(credentialOfferUri, txCode, issuanceId, expiresIn);
    }
  
    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class StartIssuanceResponse {\n");
      sb.append("    credentialOfferUri: ").append(toIndentedString(credentialOfferUri)).append("\n");
      sb.append("    txCode: ").append(toIndentedString(txCode)).append("\n");
      sb.append("    issuanceId: ").append(toIndentedString(issuanceId)).append("\n");
      sb.append("    expiresIn: ").append(toIndentedString(expiresIn)).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 `credentialOfferUri` to the URL query string
      if (getCredentialOfferUri() != null) {
        try {
          joiner.add(String.format("%scredentialOfferUri%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCredentialOfferUri()), "UTF-8").replaceAll("\\+", "%20")));
        } catch (UnsupportedEncodingException e) {
          // Should never happen, UTF-8 is always supported
          throw new RuntimeException(e);
        }
      }
  
      // add `txCode` to the URL query string
      if (getTxCode() != null) {
        try {
          joiner.add(String.format("%stxCode%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTxCode()), "UTF-8").replaceAll("\\+", "%20")));
        } catch (UnsupportedEncodingException e) {
          // Should never happen, UTF-8 is always supported
          throw new RuntimeException(e);
        }
      }
  
      // add `issuanceId` to the URL query string
      if (getIssuanceId() != null) {
        try {
          joiner.add(String.format("%sissuanceId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIssuanceId()), "UTF-8").replaceAll("\\+", "%20")));
        } catch (UnsupportedEncodingException e) {
          // Should never happen, UTF-8 is always supported
          throw new RuntimeException(e);
        }
      }
  
      // add `expiresIn` to the URL query string
      if (getExpiresIn() != null) {
        try {
          joiner.add(String.format("%sexpiresIn%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getExpiresIn()), "UTF-8").replaceAll("\\+", "%20")));
        } catch (UnsupportedEncodingException e) {
          // Should never happen, UTF-8 is always supported
          throw new RuntimeException(e);
        }
      }
  
      return joiner.toString();
    }
  
  }
  
  