<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:mule="http://www.mulesoft.org/schema/mule/core" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" targetNamespace="http://www.mulesoft.org/schema/mule/coupa">
  <xs:import namespace="http://www.w3.org/XML/1998/namespace"></xs:import>
  <xs:import schemaLocation="http://www.springframework.org/schema/beans/spring-beans-3.0.xsd" namespace="http://www.springframework.org/schema/beans"></xs:import>
  <xs:import schemaLocation="http://www.mulesoft.org/schema/mule/core/current/mule.xsd" namespace="http://www.mulesoft.org/schema/mule/core"></xs:import>
  <xs:import schemaLocation="http://www.mulesoft.org/schema/mule/devkit/current/mule-devkit.xsd" namespace="http://www.mulesoft.org/schema/mule/devkit"></xs:import>
  <xs:simpleType name="integerType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:integer"></xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="(\#\[[^\]]+\]|\$\{[^\}]+\})"></xs:pattern>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="decimalType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:decimal"></xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="(\#\[[^\]]+\]|\$\{[^\}]+\})"></xs:pattern>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="floatType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:float"></xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="(\#\[[^\]]+\]|\$\{[^\}]+\})"></xs:pattern>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="doubleType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:double"></xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="(\#\[[^\]]+\]|\$\{[^\}]+\})"></xs:pattern>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="dateTimeType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:dateTime"></xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="(\#\[[^\]]+\]|\$\{[^\}]+\})"></xs:pattern>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="longType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:long"></xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="(\#\[[^\]]+\]|\$\{[^\}]+\})"></xs:pattern>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="byteType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:byte"></xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="(\#\[[^\]]+\]|\$\{[^\}]+\})"></xs:pattern>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="booleanType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:boolean"></xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="(\#\[[^\]]+\]|\$\{[^\}]+\})"></xs:pattern>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="anyUriType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:anyURI"></xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="(\#\[[^\]]+\]|\$\{[^\}]+\})"></xs:pattern>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="charType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:minLength value="1"></xs:minLength>
          <xs:maxLength value="1"></xs:maxLength>
        </xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="(\#\[[^\]]+\]|\$\{[^\}]+\})"></xs:pattern>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:complexType name="XmlType">
    <xs:sequence>
      <xs:any maxOccurs="unbounded" minOccurs="0" processContents="lax"></xs:any>
    </xs:sequence>
    <xs:attribute name="ref" use="optional" type="xs:string">
      <xs:annotation>
        <xs:documentation>The reference object for this parameter</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>
  <xs:element xmlns:devkit="http://www.mulesoft.org/schema/mule/devkit" xmlns:mule="http://www.mulesoft.org/schema/mule/core" name="config" substitutionGroup="mule:abstract-extension" devkit:javaClass="org.mule.modules.coupa.config.CoupaModuleLifecycleAdapter">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="mule:abstractExtensionType">
          <xs:annotation>
            <xs:documentation>Coupa is a provider of cloud spend management (CSM) solutions that help companies
control their indirect spending and generate savings that go direct to the bottom
line. This Mule Module is cable of creating, updating and finding coupa resources
both &lt;a href=
"http://integrate.coupa.com/home/erp-integration/rest-apis/object-resources"
&gt;master resources&lt;/a&gt; and &lt;a href=
"http://integrate.coupa.com/home/erp-integration/rest-apis/transaction-resources&lt;gd"
&gt; transaction resources&lt;/a&gt;</xs:documentation>
          </xs:annotation>
          <xs:attribute name="name" use="optional" type="xs:string">
            <xs:annotation>
              <xs:documentation>Give a name to this configuration so it can be later referenced by config-ref.</xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="baseUrl" use="required" type="xs:string">
            <xs:annotation>
              <xs:documentation>The base URL of your company's account in Coupa. Its looks like
https://[company].[coupahost].com/api</xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="apiKey" use="required" type="xs:string">
            <xs:annotation>
              <xs:documentation>The token of your company's account in Coupa. You can get if from the
administrative coupa UI, in the API Keys section</xs:documentation>
            </xs:annotation>
          </xs:attribute>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element xmlns="http://www.mulesoft.org/schema/mule/coupa" xmlns:mule="http://www.mulesoft.org/schema/mule/core" name="save" substitutionGroup="mule:abstract-message-processor" type="SaveType">
    <xs:annotation>
      <xs:documentation>Creates or updates and object. If the resource's id is not null, the connector
creates it. Otherwise, it updates the present fields, leaving the rest of
fields unchanged.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="SaveType">
    <xs:complexContent>
      <xs:extension xmlns:mule="http://www.mulesoft.org/schema/mule/core" base="mule:abstractMessageProcessorType">
        <xs:sequence>
          <xs:element name="resource" maxOccurs="1" minOccurs="1">
            <xs:annotation>
              <xs:documentation>the resource</xs:documentation>
            </xs:annotation>
            <xs:complexType>
              <xs:choice>
                <xs:sequence>
                  <xs:element name="resource" maxOccurs="unbounded" minOccurs="0">
                    <xs:complexType>
                      <xs:simpleContent>
                        <xs:extension base="xs:string">
                          <xs:attribute name="value-ref" use="optional" type="xs:string"></xs:attribute>
                          <xs:attribute name="key" type="xs:string"></xs:attribute>
                        </xs:extension>
                      </xs:simpleContent>
                    </xs:complexType>
                  </xs:element>
                </xs:sequence>
                <xs:sequence>
                  <xs:any maxOccurs="unbounded" minOccurs="0" processContents="lax"></xs:any>
                </xs:sequence>
              </xs:choice>
              <xs:attribute name="ref" use="optional" type="xs:string">
                <xs:annotation>
                  <xs:documentation>The reference object for this parameter</xs:documentation>
                </xs:annotation>
              </xs:attribute>
            </xs:complexType>
          </xs:element>
        </xs:sequence>
        <xs:attribute name="config-ref" use="optional" type="xs:string">
          <xs:annotation>
            <xs:documentation>Specify which configuration to use for this invocation.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute xmlns="http://www.mulesoft.org/schema/mule/coupa" name="type" use="required" type="ResourceTypeEnumType">
          <xs:annotation>
            <xs:documentation>the type of the resource to update</xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element xmlns="http://www.mulesoft.org/schema/mule/coupa" xmlns:mule="http://www.mulesoft.org/schema/mule/core" name="find-by-id" substitutionGroup="mule:abstract-message-processor" type="FindByIdType">
    <xs:annotation>
      <xs:documentation>Searches for an specific resource given its type and id</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="FindByIdType">
    <xs:complexContent>
      <xs:extension xmlns:mule="http://www.mulesoft.org/schema/mule/core" base="mule:abstractMessageProcessorType">
        <xs:attribute name="config-ref" use="optional" type="xs:string">
          <xs:annotation>
            <xs:documentation>Specify which configuration to use for this invocation.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute xmlns="http://www.mulesoft.org/schema/mule/coupa" name="type" use="required" type="ResourceTypeEnumType">
          <xs:annotation>
            <xs:documentation>the type of resource to search</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute xmlns="http://www.mulesoft.org/schema/mule/coupa" name="id" use="required" type="longType">
          <xs:annotation>
            <xs:documentation>the id of the resources</xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element xmlns="http://www.mulesoft.org/schema/mule/coupa" xmlns:mule="http://www.mulesoft.org/schema/mule/core" name="find" substitutionGroup="mule:abstract-message-processor" type="FindType">
    <xs:annotation>
      <xs:documentation>Searches for resources</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="FindType">
    <xs:complexContent>
      <xs:extension xmlns:mule="http://www.mulesoft.org/schema/mule/core" base="mule:abstractMessageProcessorType">
        <xs:sequence>
          <xs:element name="conditions" maxOccurs="1" minOccurs="0">
            <xs:annotation>
              <xs:documentation>TODO</xs:documentation>
            </xs:annotation>
            <xs:complexType>
              <xs:choice>
                <xs:sequence>
                  <xs:element name="condition" maxOccurs="unbounded" minOccurs="0">
                    <xs:complexType>
                      <xs:simpleContent>
                        <xs:extension base="xs:string">
                          <xs:attribute name="value-ref" use="optional" type="xs:string"></xs:attribute>
                          <xs:attribute name="key" type="xs:string"></xs:attribute>
                        </xs:extension>
                      </xs:simpleContent>
                    </xs:complexType>
                  </xs:element>
                </xs:sequence>
                <xs:sequence>
                  <xs:any maxOccurs="unbounded" minOccurs="0" processContents="lax"></xs:any>
                </xs:sequence>
              </xs:choice>
              <xs:attribute name="ref" use="optional" type="xs:string">
                <xs:annotation>
                  <xs:documentation>The reference object for this parameter</xs:documentation>
                </xs:annotation>
              </xs:attribute>
            </xs:complexType>
          </xs:element>
        </xs:sequence>
        <xs:attribute name="config-ref" use="optional" type="xs:string">
          <xs:annotation>
            <xs:documentation>Specify which configuration to use for this invocation.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute xmlns="http://www.mulesoft.org/schema/mule/coupa" name="type" use="required" type="ResourceTypeEnumType">
          <xs:annotation>
            <xs:documentation>the type of resource to search</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute xmlns="http://www.mulesoft.org/schema/mule/coupa" name="exactMatch" default="false" use="optional" type="booleanType">
          <xs:annotation>
            <xs:documentation>TODO</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute xmlns="http://www.mulesoft.org/schema/mule/coupa" name="offset" default="0" use="optional" type="integerType">
          <xs:annotation>
            <xs:documentation>TODO</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute xmlns="http://www.mulesoft.org/schema/mule/coupa" name="limit" use="optional" type="integerType">
          <xs:annotation>
            <xs:documentation>TODO</xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element xmlns="http://www.mulesoft.org/schema/mule/coupa" xmlns:mule="http://www.mulesoft.org/schema/mule/core" name="find-by-example" substitutionGroup="mule:abstract-message-processor" type="FindByExampleType">
    <xs:annotation>
      <xs:documentation>Searches for resources using an example</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="FindByExampleType">
    <xs:complexContent>
      <xs:extension xmlns:mule="http://www.mulesoft.org/schema/mule/core" base="mule:abstractMessageProcessorType">
        <xs:sequence>
          <xs:element name="prototype" maxOccurs="1" minOccurs="1">
            <xs:annotation>
              <xs:documentation>the example. Fields set will be used as search conditions</xs:documentation>
            </xs:annotation>
            <xs:complexType>
              <xs:choice>
                <xs:sequence>
                  <xs:element name="prototype" maxOccurs="unbounded" minOccurs="0">
                    <xs:complexType>
                      <xs:simpleContent>
                        <xs:extension base="xs:string">
                          <xs:attribute name="value-ref" use="optional" type="xs:string"></xs:attribute>
                          <xs:attribute name="key" type="xs:string"></xs:attribute>
                        </xs:extension>
                      </xs:simpleContent>
                    </xs:complexType>
                  </xs:element>
                </xs:sequence>
                <xs:sequence>
                  <xs:any maxOccurs="unbounded" minOccurs="0" processContents="lax"></xs:any>
                </xs:sequence>
              </xs:choice>
              <xs:attribute name="ref" use="optional" type="xs:string">
                <xs:annotation>
                  <xs:documentation>The reference object for this parameter</xs:documentation>
                </xs:annotation>
              </xs:attribute>
            </xs:complexType>
          </xs:element>
        </xs:sequence>
        <xs:attribute name="config-ref" use="optional" type="xs:string">
          <xs:annotation>
            <xs:documentation>Specify which configuration to use for this invocation.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute xmlns="http://www.mulesoft.org/schema/mule/coupa" name="type" use="required" type="ResourceTypeEnumType">
          <xs:annotation>
            <xs:documentation>the type of object to search</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute xmlns="http://www.mulesoft.org/schema/mule/coupa" name="exactMatch" default="false" use="optional" type="booleanType">
          <xs:annotation>
            <xs:documentation>TODO</xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ResourceTypeEnumType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="Account"></xs:enumeration>
          <xs:enumeration value="Address"></xs:enumeration>
          <xs:enumeration value="BudgetLine"></xs:enumeration>
          <xs:enumeration value="Currency"></xs:enumeration>
          <xs:enumeration value="ExchangeRate"></xs:enumeration>
          <xs:enumeration value="ExpenseReport"></xs:enumeration>
          <xs:enumeration value="InventoryTransaction"></xs:enumeration>
          <xs:enumeration value="Item"></xs:enumeration>
          <xs:enumeration value="PaymentTerm"></xs:enumeration>
          <xs:enumeration value="PunchoutSite"></xs:enumeration>
          <xs:enumeration value="ShippingTerm"></xs:enumeration>
          <xs:enumeration value="Supplier"></xs:enumeration>
          <xs:enumeration value="User"></xs:enumeration>
          <xs:enumeration value="InvoicePayment"></xs:enumeration>
          <xs:enumeration value="SupplierItem"></xs:enumeration>
          <xs:enumeration value="Invoice"></xs:enumeration>
          <xs:enumeration value="Requisitions"></xs:enumeration>
          <xs:enumeration value="Order"></xs:enumeration>
          <xs:enumeration value="OrderRevision"></xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="\#\[[^\]]+\]"></xs:pattern>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
</xs:schema>