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

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

/** A policy that defines actions to execute when exception are triggered. */
@Fluent
public final class ExceptionPolicyInternal {
    /*
     * The Id of the exception policy
     */
    @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY)
    private String id;

    /*
     * (Optional) The name of the exception policy.
     */
    @JsonProperty(value = "name")
    private String name;

    /*
     * (Optional) A dictionary collection of exception rules on the exception policy. Key is the Id of each exception
     * rule.
     */
    @JsonProperty(value = "exceptionRules")
    private Map<String, ExceptionRuleInternal> exceptionRules;

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

    /**
     * Get the id property: The Id of the exception policy.
     *
     * @return the id value.
     */
    public String getId() {
        return this.id;
    }

    /**
     * Get the name property: (Optional) The name of the exception policy.
     *
     * @return the name value.
     */
    public String getName() {
        return this.name;
    }

    /**
     * Set the name property: (Optional) The name of the exception policy.
     *
     * @param name the name value to set.
     * @return the ExceptionPolicyInternal object itself.
     */
    public ExceptionPolicyInternal setName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Get the exceptionRules property: (Optional) A dictionary collection of exception rules on the exception policy.
     * Key is the Id of each exception rule.
     *
     * @return the exceptionRules value.
     */
    public Map<String, ExceptionRuleInternal> getExceptionRules() {
        return this.exceptionRules;
    }

    /**
     * Set the exceptionRules property: (Optional) A dictionary collection of exception rules on the exception policy.
     * Key is the Id of each exception rule.
     *
     * @param exceptionRules the exceptionRules value to set.
     * @return the ExceptionPolicyInternal object itself.
     */
    public ExceptionPolicyInternal setExceptionRules(Map<String, ExceptionRuleInternal> exceptionRules) {
        this.exceptionRules = exceptionRules;
        return this;
    }
}
