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

package com.azure.communication.jobrouter.models;

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

/** A rule that defines actions to execute upon a specific trigger. */
@Fluent
public final class ExceptionRule {
    /*
     * The trigger for this exception rule
     */
    @JsonProperty(value = "trigger", required = true)
    private ExceptionTrigger trigger;

    /*
     * A dictionary collection of actions to perform once the exception is
     * triggered. Key is the Id of each exception action.
     */
    @JsonProperty(value = "actions", required = true)
    private Map<String, ExceptionAction> actions;

    /**
     * Get the trigger property: The trigger for this exception rule.
     *
     * @return the trigger value.
     */
    public ExceptionTrigger getTrigger() {
        return this.trigger;
    }

    /**
     * Set the trigger property: The trigger for this exception rule.
     *
     * @param trigger the trigger value to set.
     * @return the ExceptionRule object itself.
     */
    public ExceptionRule setTrigger(ExceptionTrigger trigger) {
        this.trigger = trigger;
        return this;
    }

    /**
     * Get the actions property: A dictionary collection of actions to perform once the exception is triggered. Key is
     * the Id of each exception action.
     *
     * @return the actions value.
     */
    public Map<String, ExceptionAction> getActions() {
        return this.actions;
    }

    /**
     * Set the actions property: A dictionary collection of actions to perform once the exception is triggered. Key is
     * the Id of each exception action.
     *
     * @param actions the actions value to set.
     * @return the ExceptionRule object itself.
     */
    public ExceptionRule setActions(Map<String, ExceptionAction> actions) {
        this.actions = actions;
        return this;
    }
}
