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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.security.models.AutoProvision;
import com.fasterxml.jackson.annotation.JsonProperty;

/** describes properties of an auto provisioning setting. */
@Fluent
public final class AutoProvisioningSettingProperties {
    /*
     * Describes what kind of security agent provisioning action to take
     */
    @JsonProperty(value = "autoProvision", required = true)
    private AutoProvision autoProvision;

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

    /**
     * Get the autoProvision property: Describes what kind of security agent provisioning action to take.
     *
     * @return the autoProvision value.
     */
    public AutoProvision autoProvision() {
        return this.autoProvision;
    }

    /**
     * Set the autoProvision property: Describes what kind of security agent provisioning action to take.
     *
     * @param autoProvision the autoProvision value to set.
     * @return the AutoProvisioningSettingProperties object itself.
     */
    public AutoProvisioningSettingProperties withAutoProvision(AutoProvision autoProvision) {
        this.autoProvision = autoProvision;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (autoProvision() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property autoProvision in model AutoProvisioningSettingProperties"));
        }
    }

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