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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.resourcemanager.alertsmanagement.models.Severity;
import com.azure.resourcemanager.alertsmanagement.models.SmartGroupAggregatedProperty;
import com.azure.resourcemanager.alertsmanagement.models.State;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;

/** Set of related alerts grouped together smartly by AMS. */
@Fluent
public final class SmartGroupInner extends ProxyResource {
    /*
     * Properties of smart group.
     */
    @JsonProperty(value = "properties")
    private SmartGroupProperties innerProperties;

    /**
     * Get the innerProperties property: Properties of smart group.
     *
     * @return the innerProperties value.
     */
    private SmartGroupProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the alertsCount property: Total number of alerts in smart group.
     *
     * @return the alertsCount value.
     */
    public Long alertsCount() {
        return this.innerProperties() == null ? null : this.innerProperties().alertsCount();
    }

    /**
     * Set the alertsCount property: Total number of alerts in smart group.
     *
     * @param alertsCount the alertsCount value to set.
     * @return the SmartGroupInner object itself.
     */
    public SmartGroupInner withAlertsCount(Long alertsCount) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SmartGroupProperties();
        }
        this.innerProperties().withAlertsCount(alertsCount);
        return this;
    }

    /**
     * Get the smartGroupState property: Smart group state.
     *
     * @return the smartGroupState value.
     */
    public State smartGroupState() {
        return this.innerProperties() == null ? null : this.innerProperties().smartGroupState();
    }

    /**
     * Get the severity property: Severity of smart group is the highest(Sev0 &gt;... &gt; Sev4) severity of all the
     * alerts in the group.
     *
     * @return the severity value.
     */
    public Severity severity() {
        return this.innerProperties() == null ? null : this.innerProperties().severity();
    }

    /**
     * Get the startDateTime property: Creation time of smart group. Date-Time in ISO-8601 format.
     *
     * @return the startDateTime value.
     */
    public OffsetDateTime startDateTime() {
        return this.innerProperties() == null ? null : this.innerProperties().startDateTime();
    }

    /**
     * Get the lastModifiedDateTime property: Last updated time of smart group. Date-Time in ISO-8601 format.
     *
     * @return the lastModifiedDateTime value.
     */
    public OffsetDateTime lastModifiedDateTime() {
        return this.innerProperties() == null ? null : this.innerProperties().lastModifiedDateTime();
    }

    /**
     * Get the lastModifiedUsername property: Last modified by user name.
     *
     * @return the lastModifiedUsername value.
     */
    public String lastModifiedUsername() {
        return this.innerProperties() == null ? null : this.innerProperties().lastModifiedUsername();
    }

    /**
     * Get the resources property: Summary of target resources in the smart group.
     *
     * @return the resources value.
     */
    public List<SmartGroupAggregatedProperty> resources() {
        return this.innerProperties() == null ? null : this.innerProperties().resources();
    }

    /**
     * Set the resources property: Summary of target resources in the smart group.
     *
     * @param resources the resources value to set.
     * @return the SmartGroupInner object itself.
     */
    public SmartGroupInner withResources(List<SmartGroupAggregatedProperty> resources) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SmartGroupProperties();
        }
        this.innerProperties().withResources(resources);
        return this;
    }

    /**
     * Get the resourceTypes property: Summary of target resource types in the smart group.
     *
     * @return the resourceTypes value.
     */
    public List<SmartGroupAggregatedProperty> resourceTypes() {
        return this.innerProperties() == null ? null : this.innerProperties().resourceTypes();
    }

    /**
     * Set the resourceTypes property: Summary of target resource types in the smart group.
     *
     * @param resourceTypes the resourceTypes value to set.
     * @return the SmartGroupInner object itself.
     */
    public SmartGroupInner withResourceTypes(List<SmartGroupAggregatedProperty> resourceTypes) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SmartGroupProperties();
        }
        this.innerProperties().withResourceTypes(resourceTypes);
        return this;
    }

    /**
     * Get the resourceGroups property: Summary of target resource groups in the smart group.
     *
     * @return the resourceGroups value.
     */
    public List<SmartGroupAggregatedProperty> resourceGroups() {
        return this.innerProperties() == null ? null : this.innerProperties().resourceGroups();
    }

    /**
     * Set the resourceGroups property: Summary of target resource groups in the smart group.
     *
     * @param resourceGroups the resourceGroups value to set.
     * @return the SmartGroupInner object itself.
     */
    public SmartGroupInner withResourceGroups(List<SmartGroupAggregatedProperty> resourceGroups) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SmartGroupProperties();
        }
        this.innerProperties().withResourceGroups(resourceGroups);
        return this;
    }

    /**
     * Get the monitorServices property: Summary of monitorServices in the smart group.
     *
     * @return the monitorServices value.
     */
    public List<SmartGroupAggregatedProperty> monitorServices() {
        return this.innerProperties() == null ? null : this.innerProperties().monitorServices();
    }

    /**
     * Set the monitorServices property: Summary of monitorServices in the smart group.
     *
     * @param monitorServices the monitorServices value to set.
     * @return the SmartGroupInner object itself.
     */
    public SmartGroupInner withMonitorServices(List<SmartGroupAggregatedProperty> monitorServices) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SmartGroupProperties();
        }
        this.innerProperties().withMonitorServices(monitorServices);
        return this;
    }

    /**
     * Get the monitorConditions property: Summary of monitorConditions in the smart group.
     *
     * @return the monitorConditions value.
     */
    public List<SmartGroupAggregatedProperty> monitorConditions() {
        return this.innerProperties() == null ? null : this.innerProperties().monitorConditions();
    }

    /**
     * Set the monitorConditions property: Summary of monitorConditions in the smart group.
     *
     * @param monitorConditions the monitorConditions value to set.
     * @return the SmartGroupInner object itself.
     */
    public SmartGroupInner withMonitorConditions(List<SmartGroupAggregatedProperty> monitorConditions) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SmartGroupProperties();
        }
        this.innerProperties().withMonitorConditions(monitorConditions);
        return this;
    }

    /**
     * Get the alertStates property: Summary of alertStates in the smart group.
     *
     * @return the alertStates value.
     */
    public List<SmartGroupAggregatedProperty> alertStates() {
        return this.innerProperties() == null ? null : this.innerProperties().alertStates();
    }

    /**
     * Set the alertStates property: Summary of alertStates in the smart group.
     *
     * @param alertStates the alertStates value to set.
     * @return the SmartGroupInner object itself.
     */
    public SmartGroupInner withAlertStates(List<SmartGroupAggregatedProperty> alertStates) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SmartGroupProperties();
        }
        this.innerProperties().withAlertStates(alertStates);
        return this;
    }

    /**
     * Get the alertSeverities property: Summary of alertSeverities in the smart group.
     *
     * @return the alertSeverities value.
     */
    public List<SmartGroupAggregatedProperty> alertSeverities() {
        return this.innerProperties() == null ? null : this.innerProperties().alertSeverities();
    }

    /**
     * Set the alertSeverities property: Summary of alertSeverities in the smart group.
     *
     * @param alertSeverities the alertSeverities value to set.
     * @return the SmartGroupInner object itself.
     */
    public SmartGroupInner withAlertSeverities(List<SmartGroupAggregatedProperty> alertSeverities) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SmartGroupProperties();
        }
        this.innerProperties().withAlertSeverities(alertSeverities);
        return this;
    }

    /**
     * Get the nextLink property: The URI to fetch the next page of alerts. Call ListNext() with this URI to fetch the
     * next page alerts.
     *
     * @return the nextLink value.
     */
    public String nextLink() {
        return this.innerProperties() == null ? null : this.innerProperties().nextLink();
    }

    /**
     * Set the nextLink property: The URI to fetch the next page of alerts. Call ListNext() with this URI to fetch the
     * next page alerts.
     *
     * @param nextLink the nextLink value to set.
     * @return the SmartGroupInner object itself.
     */
    public SmartGroupInner withNextLink(String nextLink) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SmartGroupProperties();
        }
        this.innerProperties().withNextLink(nextLink);
        return this;
    }

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