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

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The type of IoT Security recommendation. */
@Fluent
public final class RecommendationConfigurationProperties {
    /*
     * The type of IoT Security recommendation.
     */
    @JsonProperty(value = "recommendationType", required = true)
    private RecommendationType recommendationType;

    /*
     * The name property.
     */
    @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
    private String name;

    /*
     * Recommendation status. When the recommendation status is disabled recommendations are not generated.
     */
    @JsonProperty(value = "status", required = true)
    private RecommendationConfigStatus status;

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

    /**
     * Get the recommendationType property: The type of IoT Security recommendation.
     *
     * @return the recommendationType value.
     */
    public RecommendationType recommendationType() {
        return this.recommendationType;
    }

    /**
     * Set the recommendationType property: The type of IoT Security recommendation.
     *
     * @param recommendationType the recommendationType value to set.
     * @return the RecommendationConfigurationProperties object itself.
     */
    public RecommendationConfigurationProperties withRecommendationType(RecommendationType recommendationType) {
        this.recommendationType = recommendationType;
        return this;
    }

    /**
     * Get the name property: The name property.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Get the status property: Recommendation status. When the recommendation status is disabled recommendations are
     * not generated.
     *
     * @return the status value.
     */
    public RecommendationConfigStatus status() {
        return this.status;
    }

    /**
     * Set the status property: Recommendation status. When the recommendation status is disabled recommendations are
     * not generated.
     *
     * @param status the status value to set.
     * @return the RecommendationConfigurationProperties object itself.
     */
    public RecommendationConfigurationProperties withStatus(RecommendationConfigStatus status) {
        this.status = status;
        return this;
    }

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

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