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

import com.fasterxml.jackson.annotation.JsonProperty;

import org.openapitools.jackson.nullable.JsonNullable;

import java.util.Objects;

/**
 * Detailed info about Spotify streams: requires include&#x3D;all to be included
 */
public class SpotifyStreamsInfo {

    @JsonProperty("free_streams")
    private JsonNullable<Long> freeStreams = JsonNullable.undefined();

    @JsonProperty("paid_streams")
    private JsonNullable<Long> paidStreams = JsonNullable.undefined();

    @JsonProperty("repeat_play")
    private JsonNullable<Long> repeatPlay = JsonNullable.undefined();

    @JsonProperty("shuffle_play")
    private JsonNullable<Long> shufflePlay = JsonNullable.undefined();

    @JsonProperty("offline_play")
    private JsonNullable<Long> offlinePlay = JsonNullable.undefined();

    @JsonProperty("completion_play")
    private JsonNullable<Long> completionPlay = JsonNullable.undefined();

    @JsonProperty("skips")
    private JsonNullable<Long> skips = JsonNullable.undefined();

    @JsonProperty("source")
    private JsonNullable<SpotifySource> source = JsonNullable.undefined();

    @JsonProperty("device_type")
    private JsonNullable<SpotifyDeviceType> deviceType = JsonNullable.undefined();

    @JsonProperty("operating_system")
    private JsonNullable<SpotifyOperatingSystem> operatingSystem = JsonNullable.undefined();

    @JsonProperty("engagement")
    private JsonNullable<SpotifyEngagement> engagement = JsonNullable.undefined();

    @JsonProperty("saves")
    private JsonNullable<SpotifySaves> saves = JsonNullable.undefined();

    public SpotifyStreamsInfo freeStreams(Long freeStreams) {
        this.freeStreams = JsonNullable.of(freeStreams);
        return this;
    }

    /**
     * The number of streams, aggregated by provided filter parameters.
     *
     * @return freeStreams
     */
    public JsonNullable<Long> getFreeStreams() {
        return freeStreams;
    }

    public void setFreeStreams(JsonNullable<Long> freeStreams) {
        this.freeStreams = freeStreams;
    }

    public SpotifyStreamsInfo paidStreams(Long paidStreams) {
        this.paidStreams = JsonNullable.of(paidStreams);
        return this;
    }

    /**
     * The number of streams, aggregated by provided filter parameters.
     *
     * @return paidStreams
     */
    public JsonNullable<Long> getPaidStreams() {
        return paidStreams;
    }

    public void setPaidStreams(JsonNullable<Long> paidStreams) {
        this.paidStreams = paidStreams;
    }

    public SpotifyStreamsInfo repeatPlay(Long repeatPlay) {
        this.repeatPlay = JsonNullable.of(repeatPlay);
        return this;
    }

    /**
     * The number of streams, aggregated by provided filter parameters.
     *
     * @return repeatPlay
     */
    public JsonNullable<Long> getRepeatPlay() {
        return repeatPlay;
    }

    public void setRepeatPlay(JsonNullable<Long> repeatPlay) {
        this.repeatPlay = repeatPlay;
    }

    public SpotifyStreamsInfo shufflePlay(Long shufflePlay) {
        this.shufflePlay = JsonNullable.of(shufflePlay);
        return this;
    }

    /**
     * The number of streams, aggregated by provided filter parameters.
     *
     * @return shufflePlay
     */
    public JsonNullable<Long> getShufflePlay() {
        return shufflePlay;
    }

    public void setShufflePlay(JsonNullable<Long> shufflePlay) {
        this.shufflePlay = shufflePlay;
    }

    public SpotifyStreamsInfo offlinePlay(Long offlinePlay) {
        this.offlinePlay = JsonNullable.of(offlinePlay);
        return this;
    }

    /**
     * The number of streams, aggregated by provided filter parameters.
     *
     * @return offlinePlay
     */
    public JsonNullable<Long> getOfflinePlay() {
        return offlinePlay;
    }

    public void setOfflinePlay(JsonNullable<Long> offlinePlay) {
        this.offlinePlay = offlinePlay;
    }

    public SpotifyStreamsInfo completionPlay(Long completionPlay) {
        this.completionPlay = JsonNullable.of(completionPlay);
        return this;
    }

    /**
     * The number of streams, aggregated by provided filter parameters.
     *
     * @return completionPlay
     */
    public JsonNullable<Long> getCompletionPlay() {
        return completionPlay;
    }

    public void setCompletionPlay(JsonNullable<Long> completionPlay) {
        this.completionPlay = completionPlay;
    }

    public SpotifyStreamsInfo skips(Long skips) {
        this.skips = JsonNullable.of(skips);
        return this;
    }

    /**
     * The number of streams, aggregated by provided filter parameters.
     *
     * @return skips
     */
    public JsonNullable<Long> getSkips() {
        return skips;
    }

    public void setSkips(JsonNullable<Long> skips) {
        this.skips = skips;
    }

    public SpotifyStreamsInfo source(SpotifySource source) {
        this.source = JsonNullable.of(source);
        return this;
    }

    /**
     * Get source
     *
     * @return source
     */
    public JsonNullable<SpotifySource> getSource() {
        return source;
    }

    public void setSource(JsonNullable<SpotifySource> source) {
        this.source = source;
    }

    public SpotifyStreamsInfo deviceType(SpotifyDeviceType deviceType) {
        this.deviceType = JsonNullable.of(deviceType);
        return this;
    }

    /**
     * Get deviceType
     *
     * @return deviceType
     */
    public JsonNullable<SpotifyDeviceType> getDeviceType() {
        return deviceType;
    }

    public void setDeviceType(JsonNullable<SpotifyDeviceType> deviceType) {
        this.deviceType = deviceType;
    }

    public SpotifyStreamsInfo operatingSystem(SpotifyOperatingSystem operatingSystem) {
        this.operatingSystem = JsonNullable.of(operatingSystem);
        return this;
    }

    /**
     * Get operatingSystem
     *
     * @return operatingSystem
     */
    public JsonNullable<SpotifyOperatingSystem> getOperatingSystem() {
        return operatingSystem;
    }

    public void setOperatingSystem(JsonNullable<SpotifyOperatingSystem> operatingSystem) {
        this.operatingSystem = operatingSystem;
    }

    public SpotifyStreamsInfo engagement(SpotifyEngagement engagement) {
        this.engagement = JsonNullable.of(engagement);
        return this;
    }

    /**
     * Get engagement
     *
     * @return engagement
     */
    public JsonNullable<SpotifyEngagement> getEngagement() {
        return engagement;
    }

    public void setEngagement(JsonNullable<SpotifyEngagement> engagement) {
        this.engagement = engagement;
    }

    public SpotifyStreamsInfo saves(SpotifySaves saves) {
        this.saves = JsonNullable.of(saves);
        return this;
    }

    /**
     * Get saves
     *
     * @return saves
     */
    public JsonNullable<SpotifySaves> getSaves() {
        return saves;
    }

    public void setSaves(JsonNullable<SpotifySaves> saves) {
        this.saves = saves;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        SpotifyStreamsInfo spotifyStreamsInfo = (SpotifyStreamsInfo) o;
        return Objects.equals(this.freeStreams, spotifyStreamsInfo.freeStreams) &&
            Objects.equals(this.paidStreams, spotifyStreamsInfo.paidStreams) &&
            Objects.equals(this.repeatPlay, spotifyStreamsInfo.repeatPlay) &&
            Objects.equals(this.shufflePlay, spotifyStreamsInfo.shufflePlay) &&
            Objects.equals(this.offlinePlay, spotifyStreamsInfo.offlinePlay) &&
            Objects.equals(this.completionPlay, spotifyStreamsInfo.completionPlay) &&
            Objects.equals(this.skips, spotifyStreamsInfo.skips) &&
            Objects.equals(this.source, spotifyStreamsInfo.source) &&
            Objects.equals(this.deviceType, spotifyStreamsInfo.deviceType) &&
            Objects.equals(this.operatingSystem, spotifyStreamsInfo.operatingSystem) &&
            Objects.equals(this.engagement, spotifyStreamsInfo.engagement) &&
            Objects.equals(this.saves, spotifyStreamsInfo.saves);
    }

    @Override
    public int hashCode() {
        return Objects
            .hash(freeStreams, paidStreams, repeatPlay, shufflePlay, offlinePlay, completionPlay, skips, source,
                deviceType, operatingSystem, engagement, saves);
    }

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

        sb.append("    freeStreams: ").append(toIndentedString(freeStreams)).append("\n");
        sb.append("    paidStreams: ").append(toIndentedString(paidStreams)).append("\n");
        sb.append("    repeatPlay: ").append(toIndentedString(repeatPlay)).append("\n");
        sb.append("    shufflePlay: ").append(toIndentedString(shufflePlay)).append("\n");
        sb.append("    offlinePlay: ").append(toIndentedString(offlinePlay)).append("\n");
        sb.append("    completionPlay: ").append(toIndentedString(completionPlay)).append("\n");
        sb.append("    skips: ").append(toIndentedString(skips)).append("\n");
        sb.append("    source: ").append(toIndentedString(source)).append("\n");
        sb.append("    deviceType: ").append(toIndentedString(deviceType)).append("\n");
        sb.append("    operatingSystem: ").append(toIndentedString(operatingSystem)).append("\n");
        sb.append("    engagement: ").append(toIndentedString(engagement)).append("\n");
        sb.append("    saves: ").append(toIndentedString(saves)).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    ");
    }
}

