live.radix.gateway.model.TransactionStatusResponse 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.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.LedgerState;
import live.radix.gateway.model.TransactionIntentStatus;
import live.radix.gateway.model.TransactionStatus;
import live.radix.gateway.model.TransactionStatusResponseKnownPayloadItem;
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;
/**
* TransactionStatusResponse
*/
@JsonPropertyOrder({
TransactionStatusResponse.JSON_PROPERTY_LEDGER_STATE,
TransactionStatusResponse.JSON_PROPERTY_STATUS,
TransactionStatusResponse.JSON_PROPERTY_INTENT_STATUS,
TransactionStatusResponse.JSON_PROPERTY_INTENT_STATUS_DESCRIPTION,
TransactionStatusResponse.JSON_PROPERTY_KNOWN_PAYLOADS,
TransactionStatusResponse.JSON_PROPERTY_COMMITTED_STATE_VERSION,
TransactionStatusResponse.JSON_PROPERTY_PERMANENTLY_REJECTS_AT_EPOCH,
TransactionStatusResponse.JSON_PROPERTY_ERROR_MESSAGE
})
@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 TransactionStatusResponse {
public static final String JSON_PROPERTY_LEDGER_STATE = "ledger_state";
private LedgerState ledgerState;
public static final String JSON_PROPERTY_STATUS = "status";
private TransactionStatus status;
public static final String JSON_PROPERTY_INTENT_STATUS = "intent_status";
private TransactionIntentStatus intentStatus;
public static final String JSON_PROPERTY_INTENT_STATUS_DESCRIPTION = "intent_status_description";
private String intentStatusDescription;
public static final String JSON_PROPERTY_KNOWN_PAYLOADS = "known_payloads";
private List knownPayloads = new ArrayList<>();
public static final String JSON_PROPERTY_COMMITTED_STATE_VERSION = "committed_state_version";
private JsonNullable committedStateVersion = JsonNullable.undefined();
public static final String JSON_PROPERTY_PERMANENTLY_REJECTS_AT_EPOCH = "permanently_rejects_at_epoch";
private JsonNullable permanentlyRejectsAtEpoch = JsonNullable.undefined();
public static final String JSON_PROPERTY_ERROR_MESSAGE = "error_message";
private String errorMessage;
public TransactionStatusResponse() {
}
public TransactionStatusResponse ledgerState(LedgerState ledgerState) {
this.ledgerState = ledgerState;
return this;
}
/**
* Get ledgerState
* @return ledgerState
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_LEDGER_STATE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public LedgerState getLedgerState() {
return ledgerState;
}
@JsonProperty(JSON_PROPERTY_LEDGER_STATE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setLedgerState(LedgerState ledgerState) {
this.ledgerState = ledgerState;
}
public TransactionStatusResponse status(TransactionStatus status) {
this.status = status;
return this;
}
/**
* Get status
* @return status
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_STATUS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public TransactionStatus getStatus() {
return status;
}
@JsonProperty(JSON_PROPERTY_STATUS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setStatus(TransactionStatus status) {
this.status = status;
}
public TransactionStatusResponse intentStatus(TransactionIntentStatus intentStatus) {
this.intentStatus = intentStatus;
return this;
}
/**
* Get intentStatus
* @return intentStatus
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_INTENT_STATUS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public TransactionIntentStatus getIntentStatus() {
return intentStatus;
}
@JsonProperty(JSON_PROPERTY_INTENT_STATUS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setIntentStatus(TransactionIntentStatus intentStatus) {
this.intentStatus = intentStatus;
}
public TransactionStatusResponse intentStatusDescription(String intentStatusDescription) {
this.intentStatusDescription = intentStatusDescription;
return this;
}
/**
* An additional description to clarify the intent status.
* @return intentStatusDescription
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_INTENT_STATUS_DESCRIPTION)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getIntentStatusDescription() {
return intentStatusDescription;
}
@JsonProperty(JSON_PROPERTY_INTENT_STATUS_DESCRIPTION)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setIntentStatusDescription(String intentStatusDescription) {
this.intentStatusDescription = intentStatusDescription;
}
public TransactionStatusResponse knownPayloads(List knownPayloads) {
this.knownPayloads = knownPayloads;
return this;
}
public TransactionStatusResponse addKnownPayloadsItem(TransactionStatusResponseKnownPayloadItem knownPayloadsItem) {
if (this.knownPayloads == null) {
this.knownPayloads = new ArrayList<>();
}
this.knownPayloads.add(knownPayloadsItem);
return this;
}
/**
* Get knownPayloads
* @return knownPayloads
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_KNOWN_PAYLOADS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public List getKnownPayloads() {
return knownPayloads;
}
@JsonProperty(JSON_PROPERTY_KNOWN_PAYLOADS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setKnownPayloads(List knownPayloads) {
this.knownPayloads = knownPayloads;
}
public TransactionStatusResponse committedStateVersion(Long committedStateVersion) {
this.committedStateVersion = JsonNullable.of(committedStateVersion);
return this;
}
/**
* If the intent was committed, this gives the state version when this intent was committed.
* @return committedStateVersion
*/
@javax.annotation.Nullable
@JsonIgnore
public Long getCommittedStateVersion() {
return committedStateVersion.orElse(null);
}
@JsonProperty(JSON_PROPERTY_COMMITTED_STATE_VERSION)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public JsonNullable getCommittedStateVersion_JsonNullable() {
return committedStateVersion;
}
@JsonProperty(JSON_PROPERTY_COMMITTED_STATE_VERSION)
public void setCommittedStateVersion_JsonNullable(JsonNullable committedStateVersion) {
this.committedStateVersion = committedStateVersion;
}
public void setCommittedStateVersion(Long committedStateVersion) {
this.committedStateVersion = JsonNullable.of(committedStateVersion);
}
public TransactionStatusResponse permanentlyRejectsAtEpoch(Long permanentlyRejectsAtEpoch) {
this.permanentlyRejectsAtEpoch = JsonNullable.of(permanentlyRejectsAtEpoch);
return this;
}
/**
* The epoch number at which the transaction is guaranteed to get permanently rejected by the Network due to exceeded epoch range defined when submitting transaction.
* minimum: 0
* maximum: 10000000000
* @return permanentlyRejectsAtEpoch
*/
@javax.annotation.Nullable
@JsonIgnore
public Long getPermanentlyRejectsAtEpoch() {
return permanentlyRejectsAtEpoch.orElse(null);
}
@JsonProperty(JSON_PROPERTY_PERMANENTLY_REJECTS_AT_EPOCH)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public JsonNullable getPermanentlyRejectsAtEpoch_JsonNullable() {
return permanentlyRejectsAtEpoch;
}
@JsonProperty(JSON_PROPERTY_PERMANENTLY_REJECTS_AT_EPOCH)
public void setPermanentlyRejectsAtEpoch_JsonNullable(JsonNullable permanentlyRejectsAtEpoch) {
this.permanentlyRejectsAtEpoch = permanentlyRejectsAtEpoch;
}
public void setPermanentlyRejectsAtEpoch(Long permanentlyRejectsAtEpoch) {
this.permanentlyRejectsAtEpoch = JsonNullable.of(permanentlyRejectsAtEpoch);
}
public TransactionStatusResponse errorMessage(String errorMessage) {
this.errorMessage = errorMessage;
return this;
}
/**
* The most relevant error message received, due to a rejection or commit as failure. Please note that presence of an error message doesn't imply that the intent will definitely reject or fail. This could represent a temporary error (such as out of fees), or an error with a payload which doesn't end up being committed.
* @return errorMessage
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ERROR_MESSAGE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getErrorMessage() {
return errorMessage;
}
@JsonProperty(JSON_PROPERTY_ERROR_MESSAGE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TransactionStatusResponse transactionStatusResponse = (TransactionStatusResponse) o;
return Objects.equals(this.ledgerState, transactionStatusResponse.ledgerState) &&
Objects.equals(this.status, transactionStatusResponse.status) &&
Objects.equals(this.intentStatus, transactionStatusResponse.intentStatus) &&
Objects.equals(this.intentStatusDescription, transactionStatusResponse.intentStatusDescription) &&
Objects.equals(this.knownPayloads, transactionStatusResponse.knownPayloads) &&
equalsNullable(this.committedStateVersion, transactionStatusResponse.committedStateVersion) &&
equalsNullable(this.permanentlyRejectsAtEpoch, transactionStatusResponse.permanentlyRejectsAtEpoch) &&
Objects.equals(this.errorMessage, transactionStatusResponse.errorMessage);
}
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(ledgerState, status, intentStatus, intentStatusDescription, knownPayloads, hashCodeNullable(committedStateVersion), hashCodeNullable(permanentlyRejectsAtEpoch), errorMessage);
}
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 TransactionStatusResponse {\n");
sb.append(" ledgerState: ").append(toIndentedString(ledgerState)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" intentStatus: ").append(toIndentedString(intentStatus)).append("\n");
sb.append(" intentStatusDescription: ").append(toIndentedString(intentStatusDescription)).append("\n");
sb.append(" knownPayloads: ").append(toIndentedString(knownPayloads)).append("\n");
sb.append(" committedStateVersion: ").append(toIndentedString(committedStateVersion)).append("\n");
sb.append(" permanentlyRejectsAtEpoch: ").append(toIndentedString(permanentlyRejectsAtEpoch)).append("\n");
sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).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 `ledger_state` to the URL query string
if (getLedgerState() != null) {
joiner.add(getLedgerState().toUrlQueryString(prefix + "ledger_state" + suffix));
}
// add `status` to the URL query string
if (getStatus() != null) {
try {
joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
// add `intent_status` to the URL query string
if (getIntentStatus() != null) {
try {
joiner.add(String.format("%sintent_status%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIntentStatus()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
// add `intent_status_description` to the URL query string
if (getIntentStatusDescription() != null) {
try {
joiner.add(String.format("%sintent_status_description%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIntentStatusDescription()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
// add `known_payloads` to the URL query string
if (getKnownPayloads() != null) {
for (int i = 0; i < getKnownPayloads().size(); i++) {
if (getKnownPayloads().get(i) != null) {
joiner.add(getKnownPayloads().get(i).toUrlQueryString(String.format("%sknown_payloads%s%s", prefix, suffix,
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix))));
}
}
}
// add `committed_state_version` to the URL query string
if (getCommittedStateVersion() != null) {
try {
joiner.add(String.format("%scommitted_state_version%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCommittedStateVersion()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
// add `permanently_rejects_at_epoch` to the URL query string
if (getPermanentlyRejectsAtEpoch() != null) {
try {
joiner.add(String.format("%spermanently_rejects_at_epoch%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPermanentlyRejectsAtEpoch()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
// add `error_message` to the URL query string
if (getErrorMessage() != null) {
try {
joiner.add(String.format("%serror_message%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getErrorMessage()), "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