// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.reservations.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.reservations.fluent.models.CatalogInner;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The list of catalogs and pagination information. */
@Fluent
public final class CatalogsResult {
    /*
     * The list of catalogs.
     */
    @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY)
    private List<CatalogInner> value;

    /*
     * The link (url) to the next page of results.
     */
    @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY)
    private String nextLink;

    /*
     * The total amount of catalog items.
     */
    @JsonProperty(value = "totalItems")
    private Long totalItems;

    /** Creates an instance of CatalogsResult class. */
    public CatalogsResult() {
    }

    /**
     * Get the value property: The list of catalogs.
     *
     * @return the value value.
     */
    public List<CatalogInner> value() {
        return this.value;
    }

    /**
     * Get the nextLink property: The link (url) to the next page of results.
     *
     * @return the nextLink value.
     */
    public String nextLink() {
        return this.nextLink;
    }

    /**
     * Get the totalItems property: The total amount of catalog items.
     *
     * @return the totalItems value.
     */
    public Long totalItems() {
        return this.totalItems;
    }

    /**
     * Set the totalItems property: The total amount of catalog items.
     *
     * @param totalItems the totalItems value to set.
     * @return the CatalogsResult object itself.
     */
    public CatalogsResult withTotalItems(Long totalItems) {
        this.totalItems = totalItems;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (value() != null) {
            value().forEach(e -> e.validate());
        }
    }
}
