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

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Properties of the smartGroup modification item. */
@Fluent
public final class SmartGroupModificationProperties {
    /*
     * Unique Id of the smartGroup for which the history is being retrieved
     */
    @JsonProperty(value = "smartGroupId", access = JsonProperty.Access.WRITE_ONLY)
    private String smartGroupId;

    /*
     * Modification details
     */
    @JsonProperty(value = "modifications")
    private List<SmartGroupModificationItem> modifications;

    /*
     * URL to fetch the next set of results.
     */
    @JsonProperty(value = "nextLink")
    private String nextLink;

    /**
     * Get the smartGroupId property: Unique Id of the smartGroup for which the history is being retrieved.
     *
     * @return the smartGroupId value.
     */
    public String smartGroupId() {
        return this.smartGroupId;
    }

    /**
     * Get the modifications property: Modification details.
     *
     * @return the modifications value.
     */
    public List<SmartGroupModificationItem> modifications() {
        return this.modifications;
    }

    /**
     * Set the modifications property: Modification details.
     *
     * @param modifications the modifications value to set.
     * @return the SmartGroupModificationProperties object itself.
     */
    public SmartGroupModificationProperties withModifications(List<SmartGroupModificationItem> modifications) {
        this.modifications = modifications;
        return this;
    }

    /**
     * Get the nextLink property: URL to fetch the next set of results.
     *
     * @return the nextLink value.
     */
    public String nextLink() {
        return this.nextLink;
    }

    /**
     * Set the nextLink property: URL to fetch the next set of results.
     *
     * @param nextLink the nextLink value to set.
     * @return the SmartGroupModificationProperties object itself.
     */
    public SmartGroupModificationProperties withNextLink(String nextLink) {
        this.nextLink = nextLink;
        return this;
    }

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