// 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.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

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

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

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

    /**
     * Set the benefits property: The benefits property.
     *
     * @param benefits the benefits value to set.
     * @return the SavingsPlanUpdateValidateRequest object itself.
     */
    public SavingsPlanUpdateValidateRequest withBenefits(List<SavingsPlanUpdateRequestProperties> benefits) {
        this.benefits = benefits;
        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());
        }
    }
}
