<?xml version="1.0" encoding="ISO-8859-1"?>

<!--
~ Copyright (c) 2021, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
~
~ Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
~ in compliance with the License.
~ You may obtain a copy of the License at
~
~    http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->

<SMSConfiguration>
    <Gateways>
        <!-- multiple gateways can be listed and the gateway having the isDefault=true is picked up or gateway
        extensionClass can be passed and relevant impl can be used-->
        <Gateway name="sample" extensionClass="io.entgra.device.mgt.core.transport.mgt.sms.handler.core.impl.SampleSenderImpl" {% if sms_conf.gateway.sample is defined %} isDefault="{{sms_conf.gateway.sample.is_default}}" {% else%} isDefault="true" {% endif %}>
            <!-- properties can be listed and can be picked up in the relevant implementation class as required-->
            <Properties>
                <Property name="sample-property">sample</Property>
                <Property name="country-code">+94</Property>
                <Property name="max-msg-size">160</Property>
            </Properties>
        </Gateway>
    {% if sms_conf.gateways is defined %}
        {%- for gateway in sms_conf.gateways -%}
        <Gateway name="{{gateway.name}}" extensionClass="{{gateway.extension_class}}" isDefault="{{gateway.is_default}}">
            <Properties>
                {% for property_name,property_value in gateway.properties_options.items() %}
                <Property name="{{property_name}}">{{property_value}}</Property>
                {% endfor %}
            </Properties>
        </Gateway>
        {% endfor %}
    {% endif %}
    </Gateways>
</SMSConfiguration>
