live.radix.gateway.model.TransactionStatusResponseKnownPayloadItem 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.
The 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.6.3
*
*
* 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 live.radix.gateway.model.TransactionPayloadGatewayHandlingStatus;
import live.radix.gateway.model.TransactionPayloadStatus;
import live.radix.gateway.model.TransactionStatus;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.StringJoiner;
/**
* TransactionStatusResponseKnownPayloadItem
*/
@JsonPropertyOrder({
TransactionStatusResponseKnownPayloadItem.JSON_PROPERTY_PAYLOAD_HASH,
TransactionStatusResponseKnownPayloadItem.JSON_PROPERTY_STATUS,
TransactionStatusResponseKnownPayloadItem.JSON_PROPERTY_PAYLOAD_STATUS,
TransactionStatusResponseKnownPayloadItem.JSON_PROPERTY_PAYLOAD_STATUS_DESCRIPTION,
TransactionStatusResponseKnownPayloadItem.JSON_PROPERTY_ERROR_MESSAGE,
TransactionStatusResponseKnownPayloadItem.JSON_PROPERTY_LATEST_ERROR_MESSAGE,
TransactionStatusResponseKnownPayloadItem.JSON_PROPERTY_HANDLING_STATUS,
TransactionStatusResponseKnownPayloadItem.JSON_PROPERTY_HANDLING_STATUS_REASON,
TransactionStatusResponseKnownPayloadItem.JSON_PROPERTY_SUBMISSION_ERROR
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-15T00:18:13.130575900+03:00[Europe/Kiev]", comments = "Generator version: 7.7.0")
public class TransactionStatusResponseKnownPayloadItem {
public static final String JSON_PROPERTY_PAYLOAD_HASH = "payload_hash";
private String payloadHash;
public static final String JSON_PROPERTY_STATUS = "status";
private TransactionStatus status;
public static final String JSON_PROPERTY_PAYLOAD_STATUS = "payload_status";
private TransactionPayloadStatus payloadStatus;
public static final String JSON_PROPERTY_PAYLOAD_STATUS_DESCRIPTION = "payload_status_description";
private String payloadStatusDescription;
public static final String JSON_PROPERTY_ERROR_MESSAGE = "error_message";
private String errorMessage;
public static final String JSON_PROPERTY_LATEST_ERROR_MESSAGE = "latest_error_message";
private String latestErrorMessage;
public static final String JSON_PROPERTY_HANDLING_STATUS = "handling_status";
private TransactionPayloadGatewayHandlingStatus handlingStatus;
public static final String JSON_PROPERTY_HANDLING_STATUS_REASON = "handling_status_reason";
private String handlingStatusReason;
public static final String JSON_PROPERTY_SUBMISSION_ERROR = "submission_error";
private String submissionError;
public TransactionStatusResponseKnownPayloadItem() {
}
public TransactionStatusResponseKnownPayloadItem payloadHash(String payloadHash) {
this.payloadHash = payloadHash;
return this;
}
/**
* Bech32m-encoded hash.
* @return payloadHash
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_PAYLOAD_HASH)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getPayloadHash() {
return payloadHash;
}
@JsonProperty(JSON_PROPERTY_PAYLOAD_HASH)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setPayloadHash(String payloadHash) {
this.payloadHash = payloadHash;
}
public TransactionStatusResponseKnownPayloadItem 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 TransactionStatusResponseKnownPayloadItem payloadStatus(TransactionPayloadStatus payloadStatus) {
this.payloadStatus = payloadStatus;
return this;
}
/**
* Get payloadStatus
* @return payloadStatus
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_PAYLOAD_STATUS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public TransactionPayloadStatus getPayloadStatus() {
return payloadStatus;
}
@JsonProperty(JSON_PROPERTY_PAYLOAD_STATUS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setPayloadStatus(TransactionPayloadStatus payloadStatus) {
this.payloadStatus = payloadStatus;
}
public TransactionStatusResponseKnownPayloadItem payloadStatusDescription(String payloadStatusDescription) {
this.payloadStatusDescription = payloadStatusDescription;
return this;
}
/**
* An additional description to clarify the payload status.
* @return payloadStatusDescription
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_PAYLOAD_STATUS_DESCRIPTION)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getPayloadStatusDescription() {
return payloadStatusDescription;
}
@JsonProperty(JSON_PROPERTY_PAYLOAD_STATUS_DESCRIPTION)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setPayloadStatusDescription(String payloadStatusDescription) {
this.payloadStatusDescription = payloadStatusDescription;
}
public TransactionStatusResponseKnownPayloadItem errorMessage(String errorMessage) {
this.errorMessage = errorMessage;
return this;
}
/**
* The initial error message received for a rejection or failure during transaction execution. This will typically be the useful error message, explaining the root cause of the issue. Please note that presence of an error message doesn't imply that this payload will definitely reject or fail. This could represent an error during a temporary rejection (such as out of fees) which then gets resolved (e.g. by depositing money to pay the fee), allowing the transaction to be 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;
}
public TransactionStatusResponseKnownPayloadItem latestErrorMessage(String latestErrorMessage) {
this.latestErrorMessage = latestErrorMessage;
return this;
}
/**
* The latest error message received for a rejection or failure during transaction execution, this is only returned if it is different from the initial error message. This is more current than the initial error message, but may be less useful, as it could be a message regarding the expiry of the transaction at the end of its epoch validity window. Please note that presence of an error message doesn't imply that this payload will definitely reject or fail. This could represent an error during a temporary rejection (such as out of fees) which then gets resolved (e.g. by depositing money to pay the fee), allowing the transaction to be committed.
* @return latestErrorMessage
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_LATEST_ERROR_MESSAGE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getLatestErrorMessage() {
return latestErrorMessage;
}
@JsonProperty(JSON_PROPERTY_LATEST_ERROR_MESSAGE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setLatestErrorMessage(String latestErrorMessage) {
this.latestErrorMessage = latestErrorMessage;
}
public TransactionStatusResponseKnownPayloadItem handlingStatus(TransactionPayloadGatewayHandlingStatus handlingStatus) {
this.handlingStatus = handlingStatus;
return this;
}
/**
* Get handlingStatus
* @return handlingStatus
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_HANDLING_STATUS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public TransactionPayloadGatewayHandlingStatus getHandlingStatus() {
return handlingStatus;
}
@JsonProperty(JSON_PROPERTY_HANDLING_STATUS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setHandlingStatus(TransactionPayloadGatewayHandlingStatus handlingStatus) {
this.handlingStatus = handlingStatus;
}
public TransactionStatusResponseKnownPayloadItem handlingStatusReason(String handlingStatusReason) {
this.handlingStatusReason = handlingStatusReason;
return this;
}
/**
* Additional reason for why the Gateway has its current handling status.
* @return handlingStatusReason
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_HANDLING_STATUS_REASON)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getHandlingStatusReason() {
return handlingStatusReason;
}
@JsonProperty(JSON_PROPERTY_HANDLING_STATUS_REASON)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setHandlingStatusReason(String handlingStatusReason) {
this.handlingStatusReason = handlingStatusReason;
}
public TransactionStatusResponseKnownPayloadItem submissionError(String submissionError) {
this.submissionError = submissionError;
return this;
}
/**
* The most recent error message received when submitting this transaction to the network. Please note that the presence of an error message doesn't imply that this transaction payload will definitely reject or fail. This could be a transient error.
* @return submissionError
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SUBMISSION_ERROR)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getSubmissionError() {
return submissionError;
}
@JsonProperty(JSON_PROPERTY_SUBMISSION_ERROR)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setSubmissionError(String submissionError) {
this.submissionError = submissionError;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TransactionStatusResponseKnownPayloadItem transactionStatusResponseKnownPayloadItem = (TransactionStatusResponseKnownPayloadItem) o;
return Objects.equals(this.payloadHash, transactionStatusResponseKnownPayloadItem.payloadHash) &&
Objects.equals(this.status, transactionStatusResponseKnownPayloadItem.status) &&
Objects.equals(this.payloadStatus, transactionStatusResponseKnownPayloadItem.payloadStatus) &&
Objects.equals(this.payloadStatusDescription, transactionStatusResponseKnownPayloadItem.payloadStatusDescription) &&
Objects.equals(this.errorMessage, transactionStatusResponseKnownPayloadItem.errorMessage) &&
Objects.equals(this.latestErrorMessage, transactionStatusResponseKnownPayloadItem.latestErrorMessage) &&
Objects.equals(this.handlingStatus, transactionStatusResponseKnownPayloadItem.handlingStatus) &&
Objects.equals(this.handlingStatusReason, transactionStatusResponseKnownPayloadItem.handlingStatusReason) &&
Objects.equals(this.submissionError, transactionStatusResponseKnownPayloadItem.submissionError);
}
@Override
public int hashCode() {
return Objects.hash(payloadHash, status, payloadStatus, payloadStatusDescription, errorMessage, latestErrorMessage, handlingStatus, handlingStatusReason, submissionError);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TransactionStatusResponseKnownPayloadItem {\n");
sb.append(" payloadHash: ").append(toIndentedString(payloadHash)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" payloadStatus: ").append(toIndentedString(payloadStatus)).append("\n");
sb.append(" payloadStatusDescription: ").append(toIndentedString(payloadStatusDescription)).append("\n");
sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n");
sb.append(" latestErrorMessage: ").append(toIndentedString(latestErrorMessage)).append("\n");
sb.append(" handlingStatus: ").append(toIndentedString(handlingStatus)).append("\n");
sb.append(" handlingStatusReason: ").append(toIndentedString(handlingStatusReason)).append("\n");
sb.append(" submissionError: ").append(toIndentedString(submissionError)).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 `payload_hash` to the URL query string
if (getPayloadHash() != null) {
try {
joiner.add(String.format("%spayload_hash%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPayloadHash()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
// 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 `payload_status` to the URL query string
if (getPayloadStatus() != null) {
try {
joiner.add(String.format("%spayload_status%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPayloadStatus()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
// add `payload_status_description` to the URL query string
if (getPayloadStatusDescription() != null) {
try {
joiner.add(String.format("%spayload_status_description%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPayloadStatusDescription()), "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);
}
}
// add `latest_error_message` to the URL query string
if (getLatestErrorMessage() != null) {
try {
joiner.add(String.format("%slatest_error_message%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLatestErrorMessage()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
// add `handling_status` to the URL query string
if (getHandlingStatus() != null) {
try {
joiner.add(String.format("%shandling_status%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHandlingStatus()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
// add `handling_status_reason` to the URL query string
if (getHandlingStatusReason() != null) {
try {
joiner.add(String.format("%shandling_status_reason%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHandlingStatusReason()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
// add `submission_error` to the URL query string
if (getSubmissionError() != null) {
try {
joiner.add(String.format("%ssubmission_error%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSubmissionError()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
return joiner.toString();
}
}