// 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.management.ProxyResource;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Details of the security control, its score, and the health status of the relevant resources. */
@Fluent
public final class SecureScoreControlDetailsInner extends ProxyResource {
    /*
     * Calculation result data in control level
     */
    @JsonProperty(value = "properties")
    private SecureScoreControlScoreDetailsInner innerProperties;

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

    /**
     * Get the innerProperties property: Calculation result data in control level.
     *
     * @return the innerProperties value.
     */
    private SecureScoreControlScoreDetailsInner innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the displayName property: User friendly display name of the control.
     *
     * @return the displayName value.
     */
    public String displayName() {
        return this.innerProperties() == null ? null : this.innerProperties().displayName();
    }

    /**
     * Get the healthyResourceCount property: Number of healthy resources in the control.
     *
     * @return the healthyResourceCount value.
     */
    public Integer healthyResourceCount() {
        return this.innerProperties() == null ? null : this.innerProperties().healthyResourceCount();
    }

    /**
     * Get the unhealthyResourceCount property: Number of unhealthy resources in the control.
     *
     * @return the unhealthyResourceCount value.
     */
    public Integer unhealthyResourceCount() {
        return this.innerProperties() == null ? null : this.innerProperties().unhealthyResourceCount();
    }

    /**
     * Get the notApplicableResourceCount property: Number of not applicable resources in the control.
     *
     * @return the notApplicableResourceCount value.
     */
    public Integer notApplicableResourceCount() {
        return this.innerProperties() == null ? null : this.innerProperties().notApplicableResourceCount();
    }

    /**
     * Get the weight property: The relative weight for this specific control in each of your subscriptions. Used when
     * calculating an aggregated score for this control across all of your subscriptions.
     *
     * @return the weight value.
     */
    public Long weight() {
        return this.innerProperties() == null ? null : this.innerProperties().weight();
    }

    /**
     * Get the definition property: Information about the security control.
     *
     * @return the definition value.
     */
    public SecureScoreControlDefinitionItemInner definition() {
        return this.innerProperties() == null ? null : this.innerProperties().definition();
    }

    /**
     * Set the definition property: Information about the security control.
     *
     * @param definition the definition value to set.
     * @return the SecureScoreControlDetailsInner object itself.
     */
    public SecureScoreControlDetailsInner withDefinition(SecureScoreControlDefinitionItemInner definition) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SecureScoreControlScoreDetailsInner();
        }
        this.innerProperties().withDefinition(definition);
        return this;
    }

    /**
     * Get the max property: Maximum score available.
     *
     * @return the max value.
     */
    public Integer max() {
        return this.innerProperties() == null ? null : this.innerProperties().max();
    }

    /**
     * Get the current property: Current score.
     *
     * @return the current value.
     */
    public Double current() {
        return this.innerProperties() == null ? null : this.innerProperties().current();
    }

    /**
     * Get the percentage property: Ratio of the current score divided by the maximum. Rounded to 4 digits after the
     * decimal point.
     *
     * @return the percentage value.
     */
    public Double percentage() {
        return this.innerProperties() == null ? null : this.innerProperties().percentage();
    }

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