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

package com.azure.resourcemanager.billing.models;

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

/**
 * The invoice sections associated to the billing profile. By default this is not populated, unless it's specified in
 * $expand.
 */
@Fluent
public final class InvoiceSectionsOnExpand {
    /*
     * Indicates whether there are more invoice sections than the ones listed in this collection. The collection lists
     * a maximum of 50 invoice sections. To get all invoice sections, use the list invoice sections API.
     */
    @JsonProperty(value = "hasMoreResults", access = JsonProperty.Access.WRITE_ONLY)
    private Boolean hasMoreResults;

    /*
     * The invoice sections associated to the billing profile.
     */
    @JsonProperty(value = "value")
    private List<InvoiceSectionInner> value;

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

    /**
     * Get the hasMoreResults property: Indicates whether there are more invoice sections than the ones listed in this
     * collection. The collection lists a maximum of 50 invoice sections. To get all invoice sections, use the list
     * invoice sections API.
     *
     * @return the hasMoreResults value.
     */
    public Boolean hasMoreResults() {
        return this.hasMoreResults;
    }

    /**
     * Get the value property: The invoice sections associated to the billing profile.
     *
     * @return the value value.
     */
    public List<InvoiceSectionInner> value() {
        return this.value;
    }

    /**
     * Set the value property: The invoice sections associated to the billing profile.
     *
     * @param value the value value to set.
     * @return the InvoiceSectionsOnExpand object itself.
     */
    public InvoiceSectionsOnExpand withValue(List<InvoiceSectionInner> value) {
        this.value = value;
        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());
        }
    }
}
