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

com.fireblocks.sdk.model.AssetResponse Maven / Gradle / Ivy

/*
 * Fireblocks API
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.6.2
 * Contact: [email protected]
 *
 * 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.fireblocks.sdk.model;


import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonValue;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Objects;
import java.util.StringJoiner;

/** AssetResponse */
@JsonPropertyOrder({
    AssetResponse.JSON_PROPERTY_LEGACY_ID,
    AssetResponse.JSON_PROPERTY_ASSET_CLASS,
    AssetResponse.JSON_PROPERTY_ONCHAIN,
    AssetResponse.JSON_PROPERTY_METADATA
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class AssetResponse {
    public static final String JSON_PROPERTY_LEGACY_ID = "legacyId";
    private String legacyId;

    /** Gets or Sets assetClass */
    public enum AssetClassEnum {
        NATIVE("NATIVE"),

        FT("FT"),

        NFT("NFT"),

        SFT("SFT");

        private String value;

        AssetClassEnum(String value) {
            this.value = value;
        }

        @JsonValue
        public String getValue() {
            return value;
        }

        @Override
        public String toString() {
            return String.valueOf(value);
        }

        @JsonCreator
        public static AssetClassEnum fromValue(String value) {
            for (AssetClassEnum b : AssetClassEnum.values()) {
                if (b.value.equals(value)) {
                    return b;
                }
            }
            throw new IllegalArgumentException("Unexpected value '" + value + "'");
        }
    }

    public static final String JSON_PROPERTY_ASSET_CLASS = "assetClass";
    private AssetClassEnum assetClass;

    public static final String JSON_PROPERTY_ONCHAIN = "onchain";
    private AssetResponseOnchain onchain;

    public static final String JSON_PROPERTY_METADATA = "metadata";
    private AssetResponseMetadata metadata;

    public AssetResponse() {}

    public AssetResponse legacyId(String legacyId) {
        this.legacyId = legacyId;
        return this;
    }

    /**
     * Get legacyId
     *
     * @return legacyId
     */
    @jakarta.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_LEGACY_ID)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public String getLegacyId() {
        return legacyId;
    }

    @JsonProperty(JSON_PROPERTY_LEGACY_ID)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setLegacyId(String legacyId) {
        this.legacyId = legacyId;
    }

    public AssetResponse assetClass(AssetClassEnum assetClass) {
        this.assetClass = assetClass;
        return this;
    }

    /**
     * Get assetClass
     *
     * @return assetClass
     */
    @jakarta.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_ASSET_CLASS)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public AssetClassEnum getAssetClass() {
        return assetClass;
    }

    @JsonProperty(JSON_PROPERTY_ASSET_CLASS)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setAssetClass(AssetClassEnum assetClass) {
        this.assetClass = assetClass;
    }

    public AssetResponse onchain(AssetResponseOnchain onchain) {
        this.onchain = onchain;
        return this;
    }

    /**
     * Get onchain
     *
     * @return onchain
     */
    @jakarta.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_ONCHAIN)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public AssetResponseOnchain getOnchain() {
        return onchain;
    }

    @JsonProperty(JSON_PROPERTY_ONCHAIN)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setOnchain(AssetResponseOnchain onchain) {
        this.onchain = onchain;
    }

    public AssetResponse metadata(AssetResponseMetadata metadata) {
        this.metadata = metadata;
        return this;
    }

    /**
     * Get metadata
     *
     * @return metadata
     */
    @jakarta.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_METADATA)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public AssetResponseMetadata getMetadata() {
        return metadata;
    }

    @JsonProperty(JSON_PROPERTY_METADATA)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setMetadata(AssetResponseMetadata metadata) {
        this.metadata = metadata;
    }

    /** Return true if this AssetResponse object is equal to o. */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        AssetResponse assetResponse = (AssetResponse) o;
        return Objects.equals(this.legacyId, assetResponse.legacyId)
                && Objects.equals(this.assetClass, assetResponse.assetClass)
                && Objects.equals(this.onchain, assetResponse.onchain)
                && Objects.equals(this.metadata, assetResponse.metadata);
    }

    @Override
    public int hashCode() {
        return Objects.hash(legacyId, assetClass, onchain, metadata);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class AssetResponse {\n");
        sb.append("    legacyId: ").append(toIndentedString(legacyId)).append("\n");
        sb.append("    assetClass: ").append(toIndentedString(assetClass)).append("\n");
        sb.append("    onchain: ").append(toIndentedString(onchain)).append("\n");
        sb.append("    metadata: ").append(toIndentedString(metadata)).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 `legacyId` to the URL query string
        if (getLegacyId() != null) {
            joiner.add(
                    String.format(
                            "%slegacyId%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(String.valueOf(getLegacyId()), StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `assetClass` to the URL query string
        if (getAssetClass() != null) {
            joiner.add(
                    String.format(
                            "%sassetClass%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(
                                            String.valueOf(getAssetClass()), StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

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

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

        return joiner.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy