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

import com.fasterxml.jackson.annotation.JsonProperty;

import org.openapitools.jackson.nullable.JsonNullable;

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

import lombok.Data;

/**
 * ShazamChartPositions
 */
@Data
public class ShazamChartPositions {

    @JsonProperty("count")
    private Integer count;

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

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

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

    public ShazamChartPositions items(List<ShazamChartTrackPosition> items) {
        this.items = items;
        return this;
    }

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

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

    @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    ");
    }
}

