content: /*
   * VaultFileSystem
   * 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.vault.data.manager.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.HashMap;
  import java.util.Map;
  import com.fasterxml.jackson.annotation.JsonPropertyOrder;
  import com.fasterxml.jackson.annotation.JsonTypeName;
  import java.io.UnsupportedEncodingException;
  import java.net.URLEncoder;
  import java.util.StringJoiner;
  
  /**
   * CreateNodeOK
   */
  @JsonPropertyOrder({
    CreateNodeOK.JSON_PROPERTY_NODE_ID,
    CreateNodeOK.JSON_PROPERTY_URL,
    CreateNodeOK.JSON_PROPERTY_LINK,
    CreateNodeOK.JSON_PROPERTY_FIELDS
  })
  @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.13.0")
  public class CreateNodeOK {
    public static final String JSON_PROPERTY_NODE_ID = "nodeId";
    @javax.annotation.Nonnull
    private String nodeId;
  
    public static final String JSON_PROPERTY_URL = "url";
    @javax.annotation.Nullable
    private String url;
  
    public static final String JSON_PROPERTY_LINK = "link";
    @javax.annotation.Nullable
    private String link;
  
    public static final String JSON_PROPERTY_FIELDS = "fields";
    @javax.annotation.Nullable
    private Map<String, Object> fields = new HashMap<>();
  
    public CreateNodeOK() {
    }
  
    public CreateNodeOK nodeId(@javax.annotation.Nonnull String nodeId) {
      
      this.nodeId = nodeId;
      return this;
    }
  
    /**
     * Get nodeId
     * @return nodeId
     */
    @javax.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_NODE_ID)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
  
    public String getNodeId() {
      return nodeId;
    }
  
  
    @JsonProperty(JSON_PROPERTY_NODE_ID)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setNodeId(@javax.annotation.Nonnull String nodeId) {
      this.nodeId = nodeId;
    }
  
    public CreateNodeOK url(@javax.annotation.Nullable String url) {
      
      this.url = url;
      return this;
    }
  
    /**
     * Get url
     * @return url
     */
    @javax.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_URL)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  
    public String getUrl() {
      return url;
    }
  
  
    @JsonProperty(JSON_PROPERTY_URL)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setUrl(@javax.annotation.Nullable String url) {
      this.url = url;
    }
  
    public CreateNodeOK link(@javax.annotation.Nullable String link) {
      
      this.link = link;
      return this;
    }
  
    /**
     * Get link
     * @return link
     */
    @javax.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_LINK)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  
    public String getLink() {
      return link;
    }
  
  
    @JsonProperty(JSON_PROPERTY_LINK)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setLink(@javax.annotation.Nullable String link) {
      this.link = link;
    }
  
    public CreateNodeOK fields(@javax.annotation.Nullable Map<String, Object> fields) {
      
      this.fields = fields;
      return this;
    }
  
    public CreateNodeOK putFieldsItem(String key, Object fieldsItem) {
      if (this.fields == null) {
        this.fields = new HashMap<>();
      }
      this.fields.put(key, fieldsItem);
      return this;
    }
  
    /**
     * Get fields
     * @return fields
     */
    @javax.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_FIELDS)
    @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS)
  
    public Map<String, Object> getFields() {
      return fields;
    }
  
  
    @JsonProperty(JSON_PROPERTY_FIELDS)
    @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS)
    public void setFields(@javax.annotation.Nullable Map<String, Object> fields) {
      this.fields = fields;
    }
  
    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }
      CreateNodeOK createNodeOK = (CreateNodeOK) o;
      return Objects.equals(this.nodeId, createNodeOK.nodeId) &&
          Objects.equals(this.url, createNodeOK.url) &&
          Objects.equals(this.link, createNodeOK.link) &&
          Objects.equals(this.fields, createNodeOK.fields);
    }
  
    @Override
    public int hashCode() {
      return Objects.hash(nodeId, url, link, fields);
    }
  
    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class CreateNodeOK {\n");
      sb.append("    nodeId: ").append(toIndentedString(nodeId)).append("\n");
      sb.append("    url: ").append(toIndentedString(url)).append("\n");
      sb.append("    link: ").append(toIndentedString(link)).append("\n");
      sb.append("    fields: ").append(toIndentedString(fields)).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 `nodeId` to the URL query string
      if (getNodeId() != null) {
        try {
          joiner.add(String.format("%snodeId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNodeId()), "UTF-8").replaceAll("\\+", "%20")));
        } catch (UnsupportedEncodingException e) {
          // Should never happen, UTF-8 is always supported
          throw new RuntimeException(e);
        }
      }
  
      // add `url` to the URL query string
      if (getUrl() != null) {
        try {
          joiner.add(String.format("%surl%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUrl()), "UTF-8").replaceAll("\\+", "%20")));
        } catch (UnsupportedEncodingException e) {
          // Should never happen, UTF-8 is always supported
          throw new RuntimeException(e);
        }
      }
  
      // add `link` to the URL query string
      if (getLink() != null) {
        try {
          joiner.add(String.format("%slink%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLink()), "UTF-8").replaceAll("\\+", "%20")));
        } catch (UnsupportedEncodingException e) {
          // Should never happen, UTF-8 is always supported
          throw new RuntimeException(e);
        }
      }
  
      // add `fields` to the URL query string
      if (getFields() != null) {
        for (String _key : getFields().keySet()) {
          try {
            joiner.add(String.format("%sfields%s%s=%s", prefix, suffix,
                "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix),
                getFields().get(_key), URLEncoder.encode(String.valueOf(getFields().get(_key)), "UTF-8").replaceAll("\\+", "%20")));
          } catch (UnsupportedEncodingException e) {
            // Should never happen, UTF-8 is always supported
            throw new RuntimeException(e);
          }
        }
      }
  
      return joiner.toString();
    }
  
  }
  
  