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

package com.azure.resourcemanager.billingbenefits.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.billingbenefits.models.SavingsPlanValidResponseProperty;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The SavingsPlanValidateResponse model. */
@Fluent
public final class SavingsPlanValidateResponseInner {
    /*
     * The benefits property.
     */
    @JsonProperty(value = "benefits")
    private List<SavingsPlanValidResponseProperty> benefits;

    /*
     * Url to get the next page.
     */
    @JsonProperty(value = "nextLink")
    private String nextLink;

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

    /**
     * Get the benefits property: The benefits property.
     *
     * @return the benefits value.
     */
    public List<SavingsPlanValidResponseProperty> benefits() {
        return this.benefits;
    }

    /**
     * Set the benefits property: The benefits property.
     *
     * @param benefits the benefits value to set.
     * @return the SavingsPlanValidateResponseInner object itself.
     */
    public SavingsPlanValidateResponseInner withBenefits(List<SavingsPlanValidResponseProperty> benefits) {
        this.benefits = benefits;
        return this;
    }

    /**
     * Get the nextLink property: Url to get the next page.
     *
     * @return the nextLink value.
     */
    public String nextLink() {
        return this.nextLink;
    }

    /**
     * Set the nextLink property: Url to get the next page.
     *
     * @param nextLink the nextLink value to set.
     * @return the SavingsPlanValidateResponseInner object itself.
     */
    public SavingsPlanValidateResponseInner withNextLink(String nextLink) {
        this.nextLink = nextLink;
        return this;
    }

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