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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.deploymentmanager.models.RestHealthCheck;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The parameters for the REST health check. */
@Fluent
public final class RestParameters {
    /*
     * The list of checks that form the health check step.
     */
    @JsonProperty(value = "healthChecks", required = true)
    private List<RestHealthCheck> healthChecks;

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

    /**
     * Get the healthChecks property: The list of checks that form the health check step.
     *
     * @return the healthChecks value.
     */
    public List<RestHealthCheck> healthChecks() {
        return this.healthChecks;
    }

    /**
     * Set the healthChecks property: The list of checks that form the health check step.
     *
     * @param healthChecks the healthChecks value to set.
     * @return the RestParameters object itself.
     */
    public RestParameters withHealthChecks(List<RestHealthCheck> healthChecks) {
        this.healthChecks = healthChecks;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (healthChecks() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property healthChecks in model RestParameters"));
        } else {
            healthChecks().forEach(e -> e.validate());
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(RestParameters.class);
}
