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

dev.mayuna.cobalt.api.objects.DownloadResult Maven / Gradle / Ivy

package dev.mayuna.cobalt.api.objects;

import dev.mayuna.cobalt.api.CobaltApiResponse;
import lombok.Getter;

import java.util.List;

/**
 * Represents the download result. Documentation
 */
@SuppressWarnings("LombokGetterMayBeUsed")
@Getter
public final class DownloadResult extends CobaltApiResponse {

    private String url;
    private PickerType pickerType;
    private List picker;
    private String audio;

    /**
     * Used for deserialization.
     */
    public DownloadResult() {
    }

    /**
     * Creates a new {@link DownloadResult} instance.
     *
     * @param status     The status
     * @param text       The request's text
     * @param url        The URL
     * @param pickerType The picker type
     * @param picker     List of pickers
     * @param audio      The audio URL
     */
    public DownloadResult(String status, String text, String url, PickerType pickerType, List picker, String audio) {
        this.status = status;
        this.text = text;
        this.url = url;
        this.pickerType = pickerType;
        this.picker = picker;
        this.audio = audio;
    }

    /**
     * Direct link to a file or a link to cobalt's live render
     *
     * @return The URL
     */
    public String getUrl() {
        return url;
    }

    /**
     * Direct link to a file or a link to cobalt's live render
     *
     * @return The URL
     */
    public String getAudio() {
        return audio;
    }

    @Override
    public String toString() {
        return "DownloadResult{" +
                "url='" + url + '\'' +
                ", pickerType=" + pickerType +
                ", picker=" + picker +
                ", audio='" + audio + '\'' +
                ", status='" + status + '\'' +
                ", text='" + text + '\'' +
                '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy