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

com.fireblocks.sdk.model.LeanDeployedContractResponseDto 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.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Objects;
import java.util.StringJoiner;

/** LeanDeployedContractResponseDto */
@JsonPropertyOrder({
    LeanDeployedContractResponseDto.JSON_PROPERTY_ID,
    LeanDeployedContractResponseDto.JSON_PROPERTY_CONTRACT_ADDRESS,
    LeanDeployedContractResponseDto.JSON_PROPERTY_CONTRACT_TEMPLATE_ID,
    LeanDeployedContractResponseDto.JSON_PROPERTY_BLOCKCHAIN_ID
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class LeanDeployedContractResponseDto {
    public static final String JSON_PROPERTY_ID = "id";
    private String id;

    public static final String JSON_PROPERTY_CONTRACT_ADDRESS = "contractAddress";
    private String contractAddress;

    public static final String JSON_PROPERTY_CONTRACT_TEMPLATE_ID = "contractTemplateId";
    private String contractTemplateId;

    public static final String JSON_PROPERTY_BLOCKCHAIN_ID = "blockchainId";
    private String blockchainId;

    public LeanDeployedContractResponseDto() {}

    public LeanDeployedContractResponseDto id(String id) {
        this.id = id;
        return this;
    }

    /**
     * The deployed contract data identifier
     *
     * @return id
     */
    @jakarta.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_ID)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public String getId() {
        return id;
    }

    @JsonProperty(JSON_PROPERTY_ID)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setId(String id) {
        this.id = id;
    }

    public LeanDeployedContractResponseDto contractAddress(String contractAddress) {
        this.contractAddress = contractAddress;
        return this;
    }

    /**
     * The contract's onchain address
     *
     * @return contractAddress
     */
    @jakarta.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_CONTRACT_ADDRESS)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public String getContractAddress() {
        return contractAddress;
    }

    @JsonProperty(JSON_PROPERTY_CONTRACT_ADDRESS)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setContractAddress(String contractAddress) {
        this.contractAddress = contractAddress;
    }

    public LeanDeployedContractResponseDto contractTemplateId(String contractTemplateId) {
        this.contractTemplateId = contractTemplateId;
        return this;
    }

    /**
     * The contract template identifier
     *
     * @return contractTemplateId
     */
    @jakarta.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_CONTRACT_TEMPLATE_ID)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public String getContractTemplateId() {
        return contractTemplateId;
    }

    @JsonProperty(JSON_PROPERTY_CONTRACT_TEMPLATE_ID)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setContractTemplateId(String contractTemplateId) {
        this.contractTemplateId = contractTemplateId;
    }

    public LeanDeployedContractResponseDto blockchainId(String blockchainId) {
        this.blockchainId = blockchainId;
        return this;
    }

    /**
     * Get blockchainId
     *
     * @return blockchainId
     */
    @jakarta.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_BLOCKCHAIN_ID)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public String getBlockchainId() {
        return blockchainId;
    }

    @JsonProperty(JSON_PROPERTY_BLOCKCHAIN_ID)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setBlockchainId(String blockchainId) {
        this.blockchainId = blockchainId;
    }

    /** Return true if this LeanDeployedContractResponseDto object is equal to o. */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        LeanDeployedContractResponseDto leanDeployedContractResponseDto =
                (LeanDeployedContractResponseDto) o;
        return Objects.equals(this.id, leanDeployedContractResponseDto.id)
                && Objects.equals(
                        this.contractAddress, leanDeployedContractResponseDto.contractAddress)
                && Objects.equals(
                        this.contractTemplateId, leanDeployedContractResponseDto.contractTemplateId)
                && Objects.equals(this.blockchainId, leanDeployedContractResponseDto.blockchainId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, contractAddress, contractTemplateId, blockchainId);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class LeanDeployedContractResponseDto {\n");
        sb.append("    id: ").append(toIndentedString(id)).append("\n");
        sb.append("    contractAddress: ").append(toIndentedString(contractAddress)).append("\n");
        sb.append("    contractTemplateId: ")
                .append(toIndentedString(contractTemplateId))
                .append("\n");
        sb.append("    blockchainId: ").append(toIndentedString(blockchainId)).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 `id` to the URL query string
        if (getId() != null) {
            joiner.add(
                    String.format(
                            "%sid%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

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

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

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

        return joiner.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy