All Downloads are FREE. Search and download functionalities are using the official Maven repository.

live.radix.gateway.model.PackageBlueprintCollectionItem Maven / Gradle / Ivy

There is a newer version: 1.9.0
Show newest version
/*
 * Radix Gateway API - Babylon
 * This API is exposed by the Babylon Radix Gateway to enable clients to efficiently query current and historic state on the RadixDLT ledger, and intelligently handle transaction submission.  It is designed for use by wallets and explorers, and for light queries from front-end dApps. For exchange/asset integrations, back-end dApp integrations, or simple use cases, you should consider using the Core API on a Node. A Gateway is only needed for reading historic snapshots of ledger states or a more robust set-up.  The Gateway API is implemented by the [Network Gateway](https://github.com/radixdlt/babylon-gateway), which is configured to read from [full node(s)](https://github.com/radixdlt/babylon-node) to extract and index data from the network.  This document is an API reference documentation, visit [User Guide](https://docs.radixdlt.com/) to learn more about how to run a Gateway of your own.  ## Migration guide  Please see [the latest release notes](https://github.com/radixdlt/babylon-gateway/releases).  ## Integration and forward compatibility guarantees  All responses may have additional fields added at any release, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects.  When the Radix protocol is updated, new functionality may be added, and so discriminated unions returned by the API may need to be updated to have new variants added, corresponding to the updated data. Clients may need to update in advance to be able to handle these new variants when a protocol update comes out.  On the very rare occasions we need to make breaking changes to the API, these will be warned in advance with deprecation notices on previous versions. These deprecation notices will include a safe migration path. Deprecation notes or breaking changes will be flagged clearly in release notes for new versions of the Gateway.  The Gateway DB schema is not subject to any compatibility guarantees, and may be changed at any release. DB changes will be flagged in the release notes so clients doing custom DB integrations can prepare. 
 *
 * The version of the OpenAPI document: v1.9.2-L
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package live.radix.gateway.model;

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 live.radix.gateway.model.BlueprintRoyaltyConfig;
import org.openapitools.jackson.nullable.JsonNullable;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.openapitools.jackson.nullable.JsonNullable;
import java.util.NoSuchElementException;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.StringJoiner;

/**
 * PackageBlueprintCollectionItem
 */
@JsonPropertyOrder({
  PackageBlueprintCollectionItem.JSON_PROPERTY_NAME,
  PackageBlueprintCollectionItem.JSON_PROPERTY_VERSION,
  PackageBlueprintCollectionItem.JSON_PROPERTY_DEFINITION,
  PackageBlueprintCollectionItem.JSON_PROPERTY_DEPENDANT_ENTITIES,
  PackageBlueprintCollectionItem.JSON_PROPERTY_AUTH_TEMPLATE,
  PackageBlueprintCollectionItem.JSON_PROPERTY_AUTH_TEMPLATE_IS_LOCKED,
  PackageBlueprintCollectionItem.JSON_PROPERTY_ROYALTY_CONFIG,
  PackageBlueprintCollectionItem.JSON_PROPERTY_ROYALTY_CONFIG_IS_LOCKED
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-12T19:38:04.213407200+02:00[Europe/Kiev]", comments = "Generator version: 7.7.0")
public class PackageBlueprintCollectionItem {
  public static final String JSON_PROPERTY_NAME = "name";
  private String name;

  public static final String JSON_PROPERTY_VERSION = "version";
  private String version;

  public static final String JSON_PROPERTY_DEFINITION = "definition";
  private Object definition;

  public static final String JSON_PROPERTY_DEPENDANT_ENTITIES = "dependant_entities";
  private List dependantEntities = new ArrayList<>();

  public static final String JSON_PROPERTY_AUTH_TEMPLATE = "auth_template";
  private Object authTemplate;

  public static final String JSON_PROPERTY_AUTH_TEMPLATE_IS_LOCKED = "auth_template_is_locked";
  private JsonNullable authTemplateIsLocked = JsonNullable.undefined();

  public static final String JSON_PROPERTY_ROYALTY_CONFIG = "royalty_config";
  private BlueprintRoyaltyConfig royaltyConfig;

  public static final String JSON_PROPERTY_ROYALTY_CONFIG_IS_LOCKED = "royalty_config_is_locked";
  private JsonNullable royaltyConfigIsLocked = JsonNullable.undefined();

  public PackageBlueprintCollectionItem() {
  }

  public PackageBlueprintCollectionItem name(String name) {
    
    this.name = name;
    return this;
  }

  /**
   * Get name
   * @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(String name) {
    this.name = name;
  }

  public PackageBlueprintCollectionItem version(String version) {
    
    this.version = version;
    return this;
  }

  /**
   * Get version
   * @return version
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_VERSION)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public String getVersion() {
    return version;
  }


  @JsonProperty(JSON_PROPERTY_VERSION)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setVersion(String version) {
    this.version = version;
  }

  public PackageBlueprintCollectionItem definition(Object definition) {
    
    this.definition = definition;
    return this;
  }

  /**
   * This type is defined in the Core API as `BlueprintDefinition`. See the Core API documentation for more details. 
   * @return definition
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_DEFINITION)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public Object getDefinition() {
    return definition;
  }


  @JsonProperty(JSON_PROPERTY_DEFINITION)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setDefinition(Object definition) {
    this.definition = definition;
  }

  public PackageBlueprintCollectionItem dependantEntities(List dependantEntities) {
    
    this.dependantEntities = dependantEntities;
    return this;
  }

  public PackageBlueprintCollectionItem addDependantEntitiesItem(String dependantEntitiesItem) {
    if (this.dependantEntities == null) {
      this.dependantEntities = new ArrayList<>();
    }
    this.dependantEntities.add(dependantEntitiesItem);
    return this;
  }

  /**
   * Get dependantEntities
   * @return dependantEntities
   */
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_DEPENDANT_ENTITIES)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public List getDependantEntities() {
    return dependantEntities;
  }


  @JsonProperty(JSON_PROPERTY_DEPENDANT_ENTITIES)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setDependantEntities(List dependantEntities) {
    this.dependantEntities = dependantEntities;
  }

  public PackageBlueprintCollectionItem authTemplate(Object authTemplate) {
    
    this.authTemplate = authTemplate;
    return this;
  }

  /**
   * This type is defined in the Core API as `AuthConfig`. See the Core API documentation for more details. 
   * @return authTemplate
   */
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_AUTH_TEMPLATE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Object getAuthTemplate() {
    return authTemplate;
  }


  @JsonProperty(JSON_PROPERTY_AUTH_TEMPLATE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setAuthTemplate(Object authTemplate) {
    this.authTemplate = authTemplate;
  }

  public PackageBlueprintCollectionItem authTemplateIsLocked(Boolean authTemplateIsLocked) {
    this.authTemplateIsLocked = JsonNullable.of(authTemplateIsLocked);
    
    return this;
  }

  /**
   * Get authTemplateIsLocked
   * @return authTemplateIsLocked
   */
  @javax.annotation.Nullable
  @JsonIgnore

  public Boolean isAuthTemplateIsLocked() {
        return authTemplateIsLocked.orElse(null);
  }

  @JsonProperty(JSON_PROPERTY_AUTH_TEMPLATE_IS_LOCKED)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public JsonNullable isAuthTemplateIsLocked_JsonNullable() {
    return authTemplateIsLocked;
  }
  
  @JsonProperty(JSON_PROPERTY_AUTH_TEMPLATE_IS_LOCKED)
  public void setAuthTemplateIsLocked_JsonNullable(JsonNullable authTemplateIsLocked) {
    this.authTemplateIsLocked = authTemplateIsLocked;
  }

  public void setAuthTemplateIsLocked(Boolean authTemplateIsLocked) {
    this.authTemplateIsLocked = JsonNullable.of(authTemplateIsLocked);
  }

  public PackageBlueprintCollectionItem royaltyConfig(BlueprintRoyaltyConfig royaltyConfig) {
    
    this.royaltyConfig = royaltyConfig;
    return this;
  }

  /**
   * Get royaltyConfig
   * @return royaltyConfig
   */
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_ROYALTY_CONFIG)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public BlueprintRoyaltyConfig getRoyaltyConfig() {
    return royaltyConfig;
  }


  @JsonProperty(JSON_PROPERTY_ROYALTY_CONFIG)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setRoyaltyConfig(BlueprintRoyaltyConfig royaltyConfig) {
    this.royaltyConfig = royaltyConfig;
  }

  public PackageBlueprintCollectionItem royaltyConfigIsLocked(Boolean royaltyConfigIsLocked) {
    this.royaltyConfigIsLocked = JsonNullable.of(royaltyConfigIsLocked);
    
    return this;
  }

  /**
   * Get royaltyConfigIsLocked
   * @return royaltyConfigIsLocked
   */
  @javax.annotation.Nullable
  @JsonIgnore

  public Boolean isRoyaltyConfigIsLocked() {
        return royaltyConfigIsLocked.orElse(null);
  }

  @JsonProperty(JSON_PROPERTY_ROYALTY_CONFIG_IS_LOCKED)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public JsonNullable isRoyaltyConfigIsLocked_JsonNullable() {
    return royaltyConfigIsLocked;
  }
  
  @JsonProperty(JSON_PROPERTY_ROYALTY_CONFIG_IS_LOCKED)
  public void setRoyaltyConfigIsLocked_JsonNullable(JsonNullable royaltyConfigIsLocked) {
    this.royaltyConfigIsLocked = royaltyConfigIsLocked;
  }

  public void setRoyaltyConfigIsLocked(Boolean royaltyConfigIsLocked) {
    this.royaltyConfigIsLocked = JsonNullable.of(royaltyConfigIsLocked);
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    PackageBlueprintCollectionItem packageBlueprintCollectionItem = (PackageBlueprintCollectionItem) o;
    return Objects.equals(this.name, packageBlueprintCollectionItem.name) &&
        Objects.equals(this.version, packageBlueprintCollectionItem.version) &&
        Objects.equals(this.definition, packageBlueprintCollectionItem.definition) &&
        Objects.equals(this.dependantEntities, packageBlueprintCollectionItem.dependantEntities) &&
        Objects.equals(this.authTemplate, packageBlueprintCollectionItem.authTemplate) &&
        equalsNullable(this.authTemplateIsLocked, packageBlueprintCollectionItem.authTemplateIsLocked) &&
        Objects.equals(this.royaltyConfig, packageBlueprintCollectionItem.royaltyConfig) &&
        equalsNullable(this.royaltyConfigIsLocked, packageBlueprintCollectionItem.royaltyConfigIsLocked);
  }

  private static  boolean equalsNullable(JsonNullable a, JsonNullable b) {
    return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
  }

  @Override
  public int hashCode() {
    return Objects.hash(name, version, definition, dependantEntities, authTemplate, hashCodeNullable(authTemplateIsLocked), royaltyConfig, hashCodeNullable(royaltyConfigIsLocked));
  }

  private static  int hashCodeNullable(JsonNullable a) {
    if (a == null) {
      return 1;
    }
    return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class PackageBlueprintCollectionItem {\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    version: ").append(toIndentedString(version)).append("\n");
    sb.append("    definition: ").append(toIndentedString(definition)).append("\n");
    sb.append("    dependantEntities: ").append(toIndentedString(dependantEntities)).append("\n");
    sb.append("    authTemplate: ").append(toIndentedString(authTemplate)).append("\n");
    sb.append("    authTemplateIsLocked: ").append(toIndentedString(authTemplateIsLocked)).append("\n");
    sb.append("    royaltyConfig: ").append(toIndentedString(royaltyConfig)).append("\n");
    sb.append("    royaltyConfigIsLocked: ").append(toIndentedString(royaltyConfigIsLocked)).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 `version` to the URL query string
    if (getVersion() != null) {
      try {
        joiner.add(String.format("%sversion%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getVersion()), "UTF-8").replaceAll("\\+", "%20")));
      } catch (UnsupportedEncodingException e) {
        // Should never happen, UTF-8 is always supported
        throw new RuntimeException(e);
      }
    }

    // add `definition` to the URL query string
    if (getDefinition() != null) {
      try {
        joiner.add(String.format("%sdefinition%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDefinition()), "UTF-8").replaceAll("\\+", "%20")));
      } catch (UnsupportedEncodingException e) {
        // Should never happen, UTF-8 is always supported
        throw new RuntimeException(e);
      }
    }

    // add `dependant_entities` to the URL query string
    if (getDependantEntities() != null) {
      for (int i = 0; i < getDependantEntities().size(); i++) {
        try {
          joiner.add(String.format("%sdependant_entities%s%s=%s", prefix, suffix,
              "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
              URLEncoder.encode(String.valueOf(getDependantEntities().get(i)), "UTF-8").replaceAll("\\+", "%20")));
        } catch (UnsupportedEncodingException e) {
          // Should never happen, UTF-8 is always supported
          throw new RuntimeException(e);
        }
      }
    }

    // add `auth_template` to the URL query string
    if (getAuthTemplate() != null) {
      try {
        joiner.add(String.format("%sauth_template%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAuthTemplate()), "UTF-8").replaceAll("\\+", "%20")));
      } catch (UnsupportedEncodingException e) {
        // Should never happen, UTF-8 is always supported
        throw new RuntimeException(e);
      }
    }

    // add `auth_template_is_locked` to the URL query string
    if (isAuthTemplateIsLocked() != null) {
      try {
        joiner.add(String.format("%sauth_template_is_locked%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(isAuthTemplateIsLocked()), "UTF-8").replaceAll("\\+", "%20")));
      } catch (UnsupportedEncodingException e) {
        // Should never happen, UTF-8 is always supported
        throw new RuntimeException(e);
      }
    }

    // add `royalty_config` to the URL query string
    if (getRoyaltyConfig() != null) {
      joiner.add(getRoyaltyConfig().toUrlQueryString(prefix + "royalty_config" + suffix));
    }

    // add `royalty_config_is_locked` to the URL query string
    if (isRoyaltyConfigIsLocked() != null) {
      try {
        joiner.add(String.format("%sroyalty_config_is_locked%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(isRoyaltyConfigIsLocked()), "UTF-8").replaceAll("\\+", "%20")));
      } catch (UnsupportedEncodingException e) {
        // Should never happen, UTF-8 is always supported
        throw new RuntimeException(e);
      }
    }

    return joiner.toString();
  }

}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy