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

package com.azure.communication.phonenumbers.siprouting.implementation.models;

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

/**
 * Represents a SIP configuration. When a call is being routed the routes are applied in the same order as in the routes
 * list. A route is matched by its number pattern. Call is then directed into route's first available trunk, based on
 * the order in the route's trunks list.
 */
@Fluent
public final class SipConfiguration {
    /*
     * SIP trunks for routing calls.
     * Map key is trunk's FQDN (1-249 characters).
     */
    @JsonProperty(value = "trunks")
    @JsonInclude(value = JsonInclude.Include.NON_ABSENT)
    private Map<String, SipTrunk> trunks;

    /*
     * Trunk routes for routing calls.
     */
    @JsonProperty(value = "routes")
    @JsonInclude(value = JsonInclude.Include.NON_ABSENT)
    private List<SipTrunkRoute> routes;

    /**
     * Get the trunks property: SIP trunks for routing calls. Map key is trunk's FQDN (1-249 characters).
     *
     * @return the trunks value.
     */
    public Map<String, SipTrunk> getTrunks() {
        return this.trunks;
    }

    /**
     * Set the trunks property: SIP trunks for routing calls. Map key is trunk's FQDN (1-249 characters).
     *
     * @param trunks the trunks value to set.
     * @return the SipConfiguration object itself.
     */
    public SipConfiguration setTrunks(Map<String, SipTrunk> trunks) {
        this.trunks = trunks;
        return this;
    }

    /**
     * Get the routes property: Trunk routes for routing calls.
     *
     * @return the routes value.
     */
    public List<SipTrunkRoute> getRoutes() {
        return this.routes;
    }

    /**
     * Set the routes property: Trunk routes for routing calls.
     *
     * @param routes the routes value to set.
     * @return the SipConfiguration object itself.
     */
    public SipConfiguration setRoutes(List<SipTrunkRoute> routes) {
        this.routes = routes;
        return this;
    }
}
