<?xml version="1.0" encoding="UTF-8"?>
<!--
 - Copyright 2013 Red Hat Inc. and/or its affiliates and other contributors.
 - 
 - Licensed 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.
 -->
<schema xmlns="http://www.w3.org/2001/XMLSchema"
    targetNamespace="urn:switchyard-component-camel-sap:config:2.0"
    xmlns:tns="urn:switchyard-component-camel-sap:config:2.0"
    xmlns:switchyard="urn:switchyard-config:switchyard:2.0"
    elementFormDefault="qualified">

    <import namespace="urn:switchyard-config:switchyard:2.0"/>
    <include schemaLocation="camel-common_2_0.xsd" />

    <element name="binding.sap" type="tns:CamelSapBindingType" substitutionGroup="switchyard:binding.switchyard"/>
    <complexType name="CamelSapBindingType">
        <annotation>
            <documentation xml:lang="en">
                SAP Binding configuration. *-server is for service binding, and *-destination is for reference binding.
            </documentation>
        </annotation>
        <complexContent>
            <extension base="tns:BaseCamelBinding">
                <sequence>
                    <choice minOccurs="1" maxOccurs="1">
                        <element name="idoclist-server" type="tns:CamelSapIDocListServerType" />
                        <element name="srfc-server" type="tns:CamelSapSRfcServerType" />
                        <element name="trfc-server" type="tns:CamelSapTRfcServerType" />
                        <element name="idoc-destination" type="tns:CamelSapIDocDestinationType" />
                        <element name="idoclist-destination" type="tns:CamelSapIDocListDestinationType" />
                        <element name="qidoc-destination" type="tns:CamelSapQIDocDestinationType" />
                        <element name="qidoclist-destination" type="tns:CamelSapQIDocListDestinationType" />
                        <element name="qrfc-destination" type="tns:CamelSapQRfcDestinationType" />
                        <element name="srfc-destination" type="tns:CamelSapSRfcDestinationType" />
                        <element name="trfc-destination" type="tns:CamelSapTRfcDestinationType" />
                    </choice>
                </sequence>
            </extension>
        </complexContent>
    </complexType>

    <complexType name="CamelSapIDocListServerType">
        <sequence>
            <element name="serverName" type="string" minOccurs="1" maxOccurs="1"/>
            <element name="idocType" type="string" minOccurs="1" maxOccurs="1"/>
            <element name="idocTypeExtension" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="systemRelease" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="applicationRelease" type="string" minOccurs="0" maxOccurs="1"/>
        </sequence>
    </complexType>
    <complexType name="CamelSapSRfcServerType">
        <sequence>
            <element name="serverName" type="string" minOccurs="1" maxOccurs="1"/>
            <element name="rfcName" type="string" minOccurs="1" maxOccurs="1"/>
        </sequence>
    </complexType>
    <complexType name="CamelSapTRfcServerType">
        <sequence>
            <element name="serverName" type="string" minOccurs="1" maxOccurs="1"/>
            <element name="rfcName" type="string" minOccurs="1" maxOccurs="1"/>
        </sequence>
    </complexType>

    <complexType name="CamelSapIDocDestinationType">
        <sequence>
            <element name="destinationName" type="string" minOccurs="1" maxOccurs="1"/>
            <element name="idocType" type="string" minOccurs="1" maxOccurs="1"/>
            <element name="idocTypeExtension" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="systemRelease" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="applicationRelease" type="string" minOccurs="0" maxOccurs="1"/>
        </sequence>
    </complexType>
    <complexType name="CamelSapIDocListDestinationType">
        <sequence>
            <element name="destinationName" type="string" minOccurs="1" maxOccurs="1"/>
            <element name="idocType" type="string" minOccurs="1" maxOccurs="1"/>
            <element name="idocTypeExtension" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="systemRelease" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="applicationRelease" type="string" minOccurs="0" maxOccurs="1"/>
        </sequence>
    </complexType>
    <complexType name="CamelSapQIDocDestinationType">
        <sequence>
            <element name="destinationName" type="string" minOccurs="1" maxOccurs="1"/>
            <element name="queueName" type="string" minOccurs="1" maxOccurs="1"/>
            <element name="idocType" type="string" minOccurs="1" maxOccurs="1"/>
            <element name="idocTypeExtension" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="systemRelease" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="applicationRelease" type="string" minOccurs="0" maxOccurs="1"/>
        </sequence>
    </complexType>
    <complexType name="CamelSapQIDocListDestinationType">
        <sequence>
            <element name="destinationName" type="string" minOccurs="1" maxOccurs="1"/>
            <element name="queueName" type="string" minOccurs="1" maxOccurs="1"/>
            <element name="idocType" type="string" minOccurs="1" maxOccurs="1"/>
            <element name="idocTypeExtension" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="systemRelease" type="string" minOccurs="0" maxOccurs="1"/>
            <element name="applicationRelease" type="string" minOccurs="0" maxOccurs="1"/>
        </sequence>
    </complexType>
    <complexType name="CamelSapQRfcDestinationType">
        <sequence>
            <element name="destinationName" type="string" minOccurs="1" maxOccurs="1"/>
            <element name="queueName" type="string" minOccurs="1" maxOccurs="1"/>
            <element name="rfcName" type="string" minOccurs="1" maxOccurs="1"/>
            <element name="transacted" type="switchyard:propBoolean" minOccurs="0" maxOccurs="1"/>
        </sequence>
    </complexType>
    <complexType name="CamelSapSRfcDestinationType">
        <sequence>
            <element name="destinationName" type="string" minOccurs="1" maxOccurs="1"/>
            <element name="rfcName" type="string" minOccurs="1" maxOccurs="1"/>
            <element name="transacted" type="switchyard:propBoolean" minOccurs="0" maxOccurs="1"/>
        </sequence>
    </complexType>
    <complexType name="CamelSapTRfcDestinationType">
        <sequence>
            <element name="destinationName" type="string" minOccurs="1" maxOccurs="1"/>
            <element name="rfcName" type="string" minOccurs="1" maxOccurs="1"/>
            <element name="transacted" type="switchyard:propBoolean" minOccurs="0" maxOccurs="1"/>
        </sequence>
    </complexType>

</schema>
