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

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;

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

import javax.validation.Valid;

import io.swagger.annotations.ApiModelProperty;

@JsonPropertyOrder(alphabetic = true)
public class ProductVersions {

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

    @JsonProperty("count")
    private Integer count;

    public ProductVersions items(List<ProductVersion> items) {
        this.items = items;
        return this;
    }

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

    /**
     * Get items
     *
     * @return items
     */
    @ApiModelProperty(value = "")

    @Valid

    public List<ProductVersion> getItems() {
        return items;
    }

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

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

    /**
     * The number of `items` returned in the response
     *
     * @return count
     */
    @ApiModelProperty(example = "25", value = "The number of `items` returned in the response")

    public Integer getCount() {
        return count;
    }

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


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

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

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

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

