package io.delphiplatform.api.v3.model.video;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.Objects;

/**
 * A single video-related image
 */
public class VideoImage {

    @JsonProperty("height")
    private Integer height;

    @JsonProperty("url")
    private String url;

    @JsonProperty("width")
    private Integer width;

    public VideoImage height(Integer height) {
        this.height = height;
        return this;
    }

    /**
     * Height of a VideoImage in pixels minimum: 0
     *
     * @return height
     */
    public Integer getHeight() {
        return height;
    }

    public void setHeight(Integer height) {
        this.height = height;
    }

    public VideoImage url(String url) {
        this.url = url;
        return this;
    }

    /**
     * Full URL to a VideoImage
     *
     * @return url
     */
    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public VideoImage width(Integer width) {
        this.width = width;
        return this;
    }

    /**
     * Width of a VideoImage in pixels minimum: 0
     *
     * @return width
     */
    public Integer getWidth() {
        return width;
    }

    public void setWidth(Integer width) {
        this.width = width;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        VideoImage videoImage = (VideoImage) o;
        return Objects.equals(this.height, videoImage.height) &&
            Objects.equals(this.url, videoImage.url) &&
            Objects.equals(this.width, videoImage.width);
    }

    @Override
    public int hashCode() {
        return Objects.hash(height, url, width);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class VideoImage {\n");

        sb.append("    height: ").append(toIndentedString(height)).append("\n");
        sb.append("    url: ").append(toIndentedString(url)).append("\n");
        sb.append("    width: ").append(toIndentedString(width)).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    ");
    }
}

