// 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.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.List;

/** Add action groups to alert processing rule. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "actionType")
@JsonTypeName("AddActionGroups")
@Fluent
public final class AddActionGroups extends Action {
    /*
     * List of action group Ids to add to alert processing rule.
     */
    @JsonProperty(value = "actionGroupIds", required = true)
    private List<String> actionGroupIds;

    /**
     * Get the actionGroupIds property: List of action group Ids to add to alert processing rule.
     *
     * @return the actionGroupIds value.
     */
    public List<String> actionGroupIds() {
        return this.actionGroupIds;
    }

    /**
     * Set the actionGroupIds property: List of action group Ids to add to alert processing rule.
     *
     * @param actionGroupIds the actionGroupIds value to set.
     * @return the AddActionGroups object itself.
     */
    public AddActionGroups withActionGroupIds(List<String> actionGroupIds) {
        this.actionGroupIds = actionGroupIds;
        return this;
    }

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

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