live.radix.gateway.model.ProgrammaticScryptoSborValueMap Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of babylon-gateway-client Show documentation
Show all versions of babylon-gateway-client Show documentation
A generated Client library for Radix Babylon Gateway API.
/*
* 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.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
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.ProgrammaticScryptoSborValue;
import live.radix.gateway.model.ProgrammaticScryptoSborValueKind;
import live.radix.gateway.model.ProgrammaticScryptoSborValueMapEntry;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.StringJoiner;
/**
* ProgrammaticScryptoSborValueMap
*/
@JsonPropertyOrder({
ProgrammaticScryptoSborValueMap.JSON_PROPERTY_KEY_KIND,
ProgrammaticScryptoSborValueMap.JSON_PROPERTY_KEY_TYPE_NAME,
ProgrammaticScryptoSborValueMap.JSON_PROPERTY_VALUE_KIND,
ProgrammaticScryptoSborValueMap.JSON_PROPERTY_VALUE_TYPE_NAME,
ProgrammaticScryptoSborValueMap.JSON_PROPERTY_ENTRIES
})
@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")
@JsonIgnoreProperties(
value = "kind", // ignore manually set kind, it will be automatically generated by Jackson during serialization
allowSetters = true // allows the kind to be set during deserialization
)
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind", visible = true)
public class ProgrammaticScryptoSborValueMap extends ProgrammaticScryptoSborValue {
public static final String JSON_PROPERTY_KEY_KIND = "key_kind";
private ProgrammaticScryptoSborValueKind keyKind;
public static final String JSON_PROPERTY_KEY_TYPE_NAME = "key_type_name";
private String keyTypeName;
public static final String JSON_PROPERTY_VALUE_KIND = "value_kind";
private ProgrammaticScryptoSborValueKind valueKind;
public static final String JSON_PROPERTY_VALUE_TYPE_NAME = "value_type_name";
private String valueTypeName;
public static final String JSON_PROPERTY_ENTRIES = "entries";
private List entries = new ArrayList<>();
public ProgrammaticScryptoSborValueMap() {
}
public ProgrammaticScryptoSborValueMap keyKind(ProgrammaticScryptoSborValueKind keyKind) {
this.keyKind = keyKind;
return this;
}
/**
* Get keyKind
* @return keyKind
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_KEY_KIND)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public ProgrammaticScryptoSborValueKind getKeyKind() {
return keyKind;
}
@JsonProperty(JSON_PROPERTY_KEY_KIND)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setKeyKind(ProgrammaticScryptoSborValueKind keyKind) {
this.keyKind = keyKind;
}
public ProgrammaticScryptoSborValueMap keyTypeName(String keyTypeName) {
this.keyTypeName = keyTypeName;
return this;
}
/**
* Get keyTypeName
* @return keyTypeName
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_KEY_TYPE_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getKeyTypeName() {
return keyTypeName;
}
@JsonProperty(JSON_PROPERTY_KEY_TYPE_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setKeyTypeName(String keyTypeName) {
this.keyTypeName = keyTypeName;
}
public ProgrammaticScryptoSborValueMap valueKind(ProgrammaticScryptoSborValueKind valueKind) {
this.valueKind = valueKind;
return this;
}
/**
* Get valueKind
* @return valueKind
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_VALUE_KIND)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public ProgrammaticScryptoSborValueKind getValueKind() {
return valueKind;
}
@JsonProperty(JSON_PROPERTY_VALUE_KIND)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setValueKind(ProgrammaticScryptoSborValueKind valueKind) {
this.valueKind = valueKind;
}
public ProgrammaticScryptoSborValueMap valueTypeName(String valueTypeName) {
this.valueTypeName = valueTypeName;
return this;
}
/**
* Get valueTypeName
* @return valueTypeName
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_VALUE_TYPE_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getValueTypeName() {
return valueTypeName;
}
@JsonProperty(JSON_PROPERTY_VALUE_TYPE_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setValueTypeName(String valueTypeName) {
this.valueTypeName = valueTypeName;
}
public ProgrammaticScryptoSborValueMap entries(List entries) {
this.entries = entries;
return this;
}
public ProgrammaticScryptoSborValueMap addEntriesItem(ProgrammaticScryptoSborValueMapEntry entriesItem) {
if (this.entries == null) {
this.entries = new ArrayList<>();
}
this.entries.add(entriesItem);
return this;
}
/**
* Get entries
* @return entries
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_ENTRIES)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public List getEntries() {
return entries;
}
@JsonProperty(JSON_PROPERTY_ENTRIES)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setEntries(List entries) {
this.entries = entries;
}
@Override
public ProgrammaticScryptoSborValueMap kind(ProgrammaticScryptoSborValueKind kind) {
this.setKind(kind);
return this;
}
@Override
public ProgrammaticScryptoSborValueMap typeName(String typeName) {
this.setTypeName(typeName);
return this;
}
@Override
public ProgrammaticScryptoSborValueMap fieldName(String fieldName) {
this.setFieldName(fieldName);
return this;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ProgrammaticScryptoSborValueMap programmaticScryptoSborValueMap = (ProgrammaticScryptoSborValueMap) o;
return Objects.equals(this.keyKind, programmaticScryptoSborValueMap.keyKind) &&
Objects.equals(this.keyTypeName, programmaticScryptoSborValueMap.keyTypeName) &&
Objects.equals(this.valueKind, programmaticScryptoSborValueMap.valueKind) &&
Objects.equals(this.valueTypeName, programmaticScryptoSborValueMap.valueTypeName) &&
Objects.equals(this.entries, programmaticScryptoSborValueMap.entries) &&
super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(keyKind, keyTypeName, valueKind, valueTypeName, entries, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ProgrammaticScryptoSborValueMap {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" keyKind: ").append(toIndentedString(keyKind)).append("\n");
sb.append(" keyTypeName: ").append(toIndentedString(keyTypeName)).append("\n");
sb.append(" valueKind: ").append(toIndentedString(valueKind)).append("\n");
sb.append(" valueTypeName: ").append(toIndentedString(valueTypeName)).append("\n");
sb.append(" entries: ").append(toIndentedString(entries)).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 `kind` to the URL query string
if (getKind() != null) {
try {
joiner.add(String.format("%skind%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getKind()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
// add `type_name` to the URL query string
if (getTypeName() != null) {
try {
joiner.add(String.format("%stype_name%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTypeName()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
// add `field_name` to the URL query string
if (getFieldName() != null) {
try {
joiner.add(String.format("%sfield_name%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFieldName()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
// add `key_kind` to the URL query string
if (getKeyKind() != null) {
try {
joiner.add(String.format("%skey_kind%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getKeyKind()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
// add `key_type_name` to the URL query string
if (getKeyTypeName() != null) {
try {
joiner.add(String.format("%skey_type_name%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getKeyTypeName()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
// add `value_kind` to the URL query string
if (getValueKind() != null) {
try {
joiner.add(String.format("%svalue_kind%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getValueKind()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
// add `value_type_name` to the URL query string
if (getValueTypeName() != null) {
try {
joiner.add(String.format("%svalue_type_name%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getValueTypeName()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
// add `entries` to the URL query string
if (getEntries() != null) {
for (int i = 0; i < getEntries().size(); i++) {
if (getEntries().get(i) != null) {
joiner.add(getEntries().get(i).toUrlQueryString(String.format("%sentries%s%s", prefix, suffix,
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix))));
}
}
}
return joiner.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy