// 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.azure.resourcemanager.security.models.AllowlistCustomAlertRule;
import com.azure.resourcemanager.security.models.DenylistCustomAlertRule;
import com.azure.resourcemanager.security.models.ThresholdCustomAlertRule;
import com.azure.resourcemanager.security.models.TimeWindowCustomAlertRule;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The device security group resource. */
@Fluent
public final class DeviceSecurityGroupInner extends ProxyResource {
    /*
     * Device Security group data
     */
    @JsonProperty(value = "properties")
    private DeviceSecurityGroupProperties innerProperties;

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

    /**
     * Get the innerProperties property: Device Security group data.
     *
     * @return the innerProperties value.
     */
    private DeviceSecurityGroupProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the thresholdRules property: The list of custom alert threshold rules.
     *
     * @return the thresholdRules value.
     */
    public List<ThresholdCustomAlertRule> thresholdRules() {
        return this.innerProperties() == null ? null : this.innerProperties().thresholdRules();
    }

    /**
     * Set the thresholdRules property: The list of custom alert threshold rules.
     *
     * @param thresholdRules the thresholdRules value to set.
     * @return the DeviceSecurityGroupInner object itself.
     */
    public DeviceSecurityGroupInner withThresholdRules(List<ThresholdCustomAlertRule> thresholdRules) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DeviceSecurityGroupProperties();
        }
        this.innerProperties().withThresholdRules(thresholdRules);
        return this;
    }

    /**
     * Get the timeWindowRules property: The list of custom alert time-window rules.
     *
     * @return the timeWindowRules value.
     */
    public List<TimeWindowCustomAlertRule> timeWindowRules() {
        return this.innerProperties() == null ? null : this.innerProperties().timeWindowRules();
    }

    /**
     * Set the timeWindowRules property: The list of custom alert time-window rules.
     *
     * @param timeWindowRules the timeWindowRules value to set.
     * @return the DeviceSecurityGroupInner object itself.
     */
    public DeviceSecurityGroupInner withTimeWindowRules(List<TimeWindowCustomAlertRule> timeWindowRules) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DeviceSecurityGroupProperties();
        }
        this.innerProperties().withTimeWindowRules(timeWindowRules);
        return this;
    }

    /**
     * Get the allowlistRules property: The allow-list custom alert rules.
     *
     * @return the allowlistRules value.
     */
    public List<AllowlistCustomAlertRule> allowlistRules() {
        return this.innerProperties() == null ? null : this.innerProperties().allowlistRules();
    }

    /**
     * Set the allowlistRules property: The allow-list custom alert rules.
     *
     * @param allowlistRules the allowlistRules value to set.
     * @return the DeviceSecurityGroupInner object itself.
     */
    public DeviceSecurityGroupInner withAllowlistRules(List<AllowlistCustomAlertRule> allowlistRules) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DeviceSecurityGroupProperties();
        }
        this.innerProperties().withAllowlistRules(allowlistRules);
        return this;
    }

    /**
     * Get the denylistRules property: The deny-list custom alert rules.
     *
     * @return the denylistRules value.
     */
    public List<DenylistCustomAlertRule> denylistRules() {
        return this.innerProperties() == null ? null : this.innerProperties().denylistRules();
    }

    /**
     * Set the denylistRules property: The deny-list custom alert rules.
     *
     * @param denylistRules the denylistRules value to set.
     * @return the DeviceSecurityGroupInner object itself.
     */
    public DeviceSecurityGroupInner withDenylistRules(List<DenylistCustomAlertRule> denylistRules) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DeviceSecurityGroupProperties();
        }
        this.innerProperties().withDenylistRules(denylistRules);
        return this;
    }

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