<?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/pubnub">
  <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.module.pubnub.config.PubNubModuleLifecycleAdapter">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="mule:abstractExtensionType">
          <xs:annotation>
            <xs:documentation>PubNub is an Internet-Wide Messaging Service for Real-time Web and Mobile apps and games. PubNub
is a massively scalable Real-time Bidirectional Messaging Service in the Cloud.
&lt;p/&gt;
This connector supports version 3 of the PubNub REST API.
&lt;p/&gt;
PubNub is a freemium service where users get 5,000 messages per day for free but then have reasonable pricing
plans for higher volume usage.  For more information go to PubNub: http://pubnub.com</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="publishKey" use="required" type="xs:string">
            <xs:annotation>
              <xs:documentation>Your publish key that allows you to send data to the PubNub cloud</xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="subscribeKey" use="required" type="xs:string">
            <xs:annotation>
              <xs:documentation>Your subscribe key that allows you to send data to the PubNub cloud</xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="secretKey" use="required" type="xs:string">
            <xs:annotation>
              <xs:documentation>The secret key given to you when you created the account</xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute xmlns="http://www.mulesoft.org/schema/mule/pubnub" name="ssl" default="false" use="optional" type="booleanType">
            <xs:annotation>
              <xs:documentation>Whether to use SSL or not when communicating with the PubNub cloud</xs:documentation>
            </xs:annotation>
          </xs:attribute>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element xmlns="http://www.mulesoft.org/schema/mule/pubnub" xmlns:mule="http://www.mulesoft.org/schema/mule/core" name="publish" substitutionGroup="mule:abstract-message-processor" type="PublishType">
    <xs:annotation>
      <xs:documentation>Send a json message to a channel.
&lt;p/&gt;</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="PublishType">
    <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 name="channel" use="required" type="xs:string">
          <xs:annotation>
            <xs:documentation>name to publish the message to</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="jsonMessage" use="required" type="xs:string">
          <xs:annotation>
            <xs:documentation>the message to publish</xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element xmlns="http://www.mulesoft.org/schema/mule/pubnub" xmlns:mule="http://www.mulesoft.org/schema/mule/core" name="request" substitutionGroup="mule:abstract-message-processor" type="RequestType">
    <xs:annotation>
      <xs:documentation>Makes a blocking request to receive a message on a channel.
&lt;p/&gt;</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="RequestType">
    <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 name="channel" use="required" type="xs:string">
          <xs:annotation>
            <xs:documentation>name to read from</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute xmlns="http://www.mulesoft.org/schema/mule/pubnub" name="timeout" default="5000" use="optional" type="longType">
          <xs:annotation>
            <xs:documentation>how long to wait for a message. The value is expressed in milliseconds. specify for</xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element xmlns="http://www.mulesoft.org/schema/mule/pubnub" xmlns:mule="http://www.mulesoft.org/schema/mule/core" name="history" substitutionGroup="mule:abstract-message-processor" type="HistoryType">
    <xs:annotation>
      <xs:documentation>Load history from a channel.
&lt;p/&gt;</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="HistoryType">
    <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 name="channel" use="required" type="xs:string">
          <xs:annotation>
            <xs:documentation>name.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute xmlns="http://www.mulesoft.org/schema/mule/pubnub" name="limit" use="required" type="integerType">
          <xs:annotation>
            <xs:documentation>history count response.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element xmlns="http://www.mulesoft.org/schema/mule/pubnub" xmlns:mule="http://www.mulesoft.org/schema/mule/core" name="server-time" substitutionGroup="mule:abstract-message-processor" type="ServerTimeType">
    <xs:annotation>
      <xs:documentation>Get the Timestamp from PubNub Cloud.
&lt;p/&gt;</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ServerTimeType">
    <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:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element xmlns="http://www.mulesoft.org/schema/mule/pubnub" xmlns:mule="http://www.mulesoft.org/schema/mule/core" name="subscribe" substitutionGroup="mule:abstract-inbound-endpoint" type="SubscribeType">
    <xs:annotation>
      <xs:documentation>Listen for a message on a channel.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="SubscribeType">
    <xs:complexContent>
      <xs:extension xmlns:mule="http://www.mulesoft.org/schema/mule/core" base="mule:abstractInboundEndpointType">
        <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 name="channel" use="required" type="xs:string">
          <xs:annotation>
            <xs:documentation>name to listen on</xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>