<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
~ Copyright (c) 2018 - 2023, 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.
-->

<!--
        This configuration file represents the configuration that are needed
        when publishing APIs to API Manager
-->
<WebappPublisherConfigs>

    <!-- This host is used to define the host address which is used to publish APIs -->
    {% if webapp_publisher_configs.host is defined %}
    <Host>{{webapp_publisher_configs.host}}</Host>
    {% else %}
    <Host>https://${iot.core.host}:${iot.core.https.port}</Host>
    {% endif %}

    <!-- If it is true, the APIs of this instance will be published to the defined host -->
    {% if webapp_publisher_configs.publish_api is defined %}
    <PublishAPI>{{webapp_publisher_configs.publish_api}}</PublishAPI>
    {% else %}
    <PublishAPI>true</PublishAPI>
    {% endif %}

    <!-- If it is true, the APIs of this instance will be updated when the webapps are redeployed -->
    {% if webapp_publisher_configs.enable_update_api is defined %}
    <EnabledUpdateApi>{{webapp_publisher_configs.enable_update_api}}</EnabledUpdateApi>
    {% else %}
    <EnabledUpdateApi>true</EnabledUpdateApi>
    {% endif %}

    <!--Webapp will be published only when running below profiles-->
    <Profiles>
        <Profile>default</Profile>
    {% if webapp_publisher_configs.profiles is defined %}
        {%- for profile in webapp_publisher_configs.profiles -%}
        <Profile>{{profile}}</Profile>
        {% endfor %}
    {% endif %}
    </Profiles>

    <!-- Apart from the super tenant, APIs will be published to the following tenants -->
    <Tenants>
    {% if webapp_publisher_configs.tenants is defined %}
        {%- for tenant in webapp_publisher_configs.tenants -%}
        <Tenant>{{tenant}}</Tenant>
        {% endfor %}
    {% endif %}
    </Tenants>
</WebappPublisherConfigs>
