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

import com.fasterxml.jackson.annotation.JsonProperty;

import org.openapitools.jackson.nullable.JsonNullable;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * VideoChartPositions
 */
public class VideoChartPositions {

    @JsonProperty("count")
    private Integer count;

    @JsonProperty("items")
    private List<VideoChartPosition> items = null;

    @JsonProperty("next_cursor")
    private JsonNullable<String> nextCursor;

    public VideoChartPositions count(Integer count) {
        this.count = count;
        return this;
    }

    /**
     * The number of `items` returned in the response
     *
     * @return count
     */
    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public VideoChartPositions items(List<VideoChartPosition> items) {
        this.items = items;
        return this;
    }

    public VideoChartPositions addItemsItem(VideoChartPosition itemsItem) {
        if (this.items == null) {
            this.items = new ArrayList<>();
        }
        this.items.add(itemsItem);
        return this;
    }

    public VideoChartPositions nextCursor(String nextCursor) {
        this.nextCursor = JsonNullable.of(nextCursor);
        return this;
    }

    public JsonNullable<String> getNextCursor() {
        return nextCursor;
    }

    public void setNextCursor(JsonNullable<String> nextCursor) {
        this.nextCursor = nextCursor;
    }


    /**
     * Get items
     *
     * @return items
     */
    public List<VideoChartPosition> getItems() {
        return items;
    }

    public void setItems(List<VideoChartPosition> items) {
        this.items = items;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        VideoChartPositions videoChartPositions = (VideoChartPositions) o;
        return Objects.equals(this.count, videoChartPositions.count) &&
            Objects.equals(this.nextCursor, videoChartPositions.nextCursor) &&
            Objects.equals(this.items, videoChartPositions.items);
    }

    @Override
    public int hashCode() {
        return Objects.hash(count, nextCursor, items);
    }

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

        sb.append("    count: ").append(toIndentedString(count)).append("\n");
        sb.append("    nextCursor: ").append(toIndentedString(nextCursor)).append("\n");
        sb.append("    items: ").append(toIndentedString(items)).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    ");
    }
}

