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

com.fireblocks.sdk.model.CollectionMintRequestDto 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;

/** CollectionMintRequestDto */
@JsonPropertyOrder({
    CollectionMintRequestDto.JSON_PROPERTY_VAULT_ACCOUNT_ID,
    CollectionMintRequestDto.JSON_PROPERTY_TO,
    CollectionMintRequestDto.JSON_PROPERTY_TOKEN_ID,
    CollectionMintRequestDto.JSON_PROPERTY_AMOUNT,
    CollectionMintRequestDto.JSON_PROPERTY_METADATA_U_R_I,
    CollectionMintRequestDto.JSON_PROPERTY_METADATA
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class CollectionMintRequestDto {
    public static final String JSON_PROPERTY_VAULT_ACCOUNT_ID = "vaultAccountId";
    private String vaultAccountId;

    public static final String JSON_PROPERTY_TO = "to";
    private String to;

    public static final String JSON_PROPERTY_TOKEN_ID = "tokenId";
    private String tokenId;

    public static final String JSON_PROPERTY_AMOUNT = "amount";
    private String amount;

    public static final String JSON_PROPERTY_METADATA_U_R_I = "metadataURI";
    private String metadataURI;

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

    public CollectionMintRequestDto() {}

    public CollectionMintRequestDto vaultAccountId(String vaultAccountId) {
        this.vaultAccountId = vaultAccountId;
        return this;
    }

    /**
     * The id of the vault account that initiates the mint function.
     *
     * @return vaultAccountId
     */
    @jakarta.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_VAULT_ACCOUNT_ID)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public String getVaultAccountId() {
        return vaultAccountId;
    }

    @JsonProperty(JSON_PROPERTY_VAULT_ACCOUNT_ID)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setVaultAccountId(String vaultAccountId) {
        this.vaultAccountId = vaultAccountId;
    }

    public CollectionMintRequestDto to(String to) {
        this.to = to;
        return this;
    }

    /**
     * The EVM address to mint to
     *
     * @return to
     */
    @jakarta.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_TO)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public String getTo() {
        return to;
    }

    @JsonProperty(JSON_PROPERTY_TO)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setTo(String to) {
        this.to = to;
    }

    public CollectionMintRequestDto tokenId(String tokenId) {
        this.tokenId = tokenId;
        return this;
    }

    /**
     * The token id, recommended to have numerical format and in sequential order
     *
     * @return tokenId
     */
    @jakarta.annotation.Nonnull
    @JsonProperty(JSON_PROPERTY_TOKEN_ID)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public String getTokenId() {
        return tokenId;
    }

    @JsonProperty(JSON_PROPERTY_TOKEN_ID)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setTokenId(String tokenId) {
        this.tokenId = tokenId;
    }

    public CollectionMintRequestDto amount(String amount) {
        this.amount = amount;
        return this;
    }

    /**
     * For ERC721, amount is optional or should always be 1 and for ERC1155, amount should be 1 or
     * greater
     *
     * @return amount
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_AMOUNT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getAmount() {
        return amount;
    }

    @JsonProperty(JSON_PROPERTY_AMOUNT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setAmount(String amount) {
        this.amount = amount;
    }

    public CollectionMintRequestDto metadataURI(String metadataURI) {
        this.metadataURI = metadataURI;
        return this;
    }

    /**
     * URL of metadata uploaded, skip uploading to IPFS if this field is provided with any value
     *
     * @return metadataURI
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_METADATA_U_R_I)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getMetadataURI() {
        return metadataURI;
    }

    @JsonProperty(JSON_PROPERTY_METADATA_U_R_I)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setMetadataURI(String metadataURI) {
        this.metadataURI = metadataURI;
    }

    public CollectionMintRequestDto metadata(CollectionTokenMetadataDto metadata) {
        this.metadata = metadata;
        return this;
    }

    /**
     * Metadata to upload
     *
     * @return metadata
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_METADATA)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public CollectionTokenMetadataDto getMetadata() {
        return metadata;
    }

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

    /** Return true if this CollectionMintRequestDto object is equal to o. */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        CollectionMintRequestDto collectionMintRequestDto = (CollectionMintRequestDto) o;
        return Objects.equals(this.vaultAccountId, collectionMintRequestDto.vaultAccountId)
                && Objects.equals(this.to, collectionMintRequestDto.to)
                && Objects.equals(this.tokenId, collectionMintRequestDto.tokenId)
                && Objects.equals(this.amount, collectionMintRequestDto.amount)
                && Objects.equals(this.metadataURI, collectionMintRequestDto.metadataURI)
                && Objects.equals(this.metadata, collectionMintRequestDto.metadata);
    }

    @Override
    public int hashCode() {
        return Objects.hash(vaultAccountId, to, tokenId, amount, metadataURI, metadata);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class CollectionMintRequestDto {\n");
        sb.append("    vaultAccountId: ").append(toIndentedString(vaultAccountId)).append("\n");
        sb.append("    to: ").append(toIndentedString(to)).append("\n");
        sb.append("    tokenId: ").append(toIndentedString(tokenId)).append("\n");
        sb.append("    amount: ").append(toIndentedString(amount)).append("\n");
        sb.append("    metadataURI: ").append(toIndentedString(metadataURI)).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 `vaultAccountId` to the URL query string
        if (getVaultAccountId() != null) {
            joiner.add(
                    String.format(
                            "%svaultAccountId%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(
                                            String.valueOf(getVaultAccountId()),
                                            StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

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

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

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

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

        // 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