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

<schema targetNamespace="urn:ietf:params:xml:ns:domain-1.0"
        xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"
        xmlns:epp="urn:ietf:params:xml:ns:epp-1.0"
        xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0"
        xmlns="http://www.w3.org/2001/XMLSchema"
        elementFormDefault="qualified">

<!--
Import common element types.
-->
  <import namespace="urn:ietf:params:xml:ns:eppcom-1.0"
          schemaLocation="eppcom-1.0.xsd"/>
  <import namespace="urn:ietf:params:xml:ns:epp-1.0"
          schemaLocation="epp-1.0.xsd"/>

  <annotation>
    <documentation>
      Extensible Provisioning Protocol v1.0
      domain provisioning schema.
    </documentation>
  </annotation>

<!--
Child elements found in EPP commands.
-->
  <element name="check" type="domain:mNameType"/>
  <element name="create" type="domain:createType"/>
  <element name="delete" type="domain:sNameType"/>
  <element name="info" type="domain:infoType"/>
  <element name="renew" type="domain:renewType"/>
  <element name="transfer" type="domain:transferType"/>
  <element name="update" type="domain:updateType"/>

<!--
Child elements of the <create> command.
-->
  <complexType name="createType">
    <sequence>
      <element name="name" type="eppcom:labelType"/>
      <element name="period" type="domain:periodType"
       minOccurs="0"/>
      <element name="ns" type="eppcom:labelType"
       minOccurs="0" maxOccurs="unbounded"/>
      <element name="registrant" type="eppcom:clIDType"
       minOccurs="0"/>
      <element name="contact" type="domain:contactType"
       minOccurs="0" maxOccurs="unbounded"/>
      <element name="authInfo" type="eppcom:authInfoType"/>
    </sequence>
  </complexType>

  <complexType name="periodType">
    <simpleContent>
      <extension base="domain:pLimitType">
        <attribute name="unit" type="domain:pUnitType"
         use="required"/>
      </extension>
    </simpleContent>
  </complexType>

  <simpleType name="pLimitType">
    <restriction base="unsignedShort">
      <minInclusive value="1"/>
      <maxInclusive value="99"/>
    </restriction>
  </simpleType>

  <simpleType name="pUnitType">
    <restriction base="token">
      <enumeration value="y"/>
      <enumeration value="m"/>
    </restriction>
  </simpleType>

  <complexType name="contactType">
    <simpleContent>
      <extension base="eppcom:clIDType">
        <attribute name="type" type="domain:contactAttrType"/>
      </extension>
    </simpleContent>
  </complexType>

  <simpleType name="contactAttrType">
    <restriction base="token">
      <enumeration value="admin"/>
      <enumeration value="billing"/>
      <enumeration value="tech"/>
    </restriction>
  </simpleType>

<!--
Child element of commands that require a single name.
-->
  <complexType name="sNameType">
    <sequence>
      <element name="name" type="eppcom:labelType"/>
    </sequence>
  </complexType>

<!--
Child element of commands that accept multiple names.
-->
  <complexType name="mNameType">
    <sequence>
      <element name="name" type="eppcom:labelType"
       maxOccurs="unbounded"/>
    </sequence>
  </complexType>

<!--
Child elements of the <info> command.
-->
  <complexType name="infoType">
    <sequence>
      <element name="name" type="domain:infoNameType"/>
    </sequence>
  </complexType>

  <complexType name="infoNameType">
    <simpleContent>
      <extension base = "eppcom:labelType">
        <attribute name="hosts" type="domain:hostsType"
         default="all"/>
      </extension>
    </simpleContent>
  </complexType>

  <simpleType name="hostsType">
    <restriction base="token">
      <enumeration value="all"/>
      <enumeration value="del"/>
      <enumeration value="none"/>
      <enumeration value="sub"/>
    </restriction>
  </simpleType>

<!--
Child elements of the <renew> command.
-->
  <complexType name="renewType">
    <sequence>
      <element name="name" type="eppcom:labelType"/>
      <element name="curExpDate" type="date"/>
      <element name="period" type="domain:periodType"
       minOccurs="0"/>
    </sequence>
  </complexType>

<!--
Child elements of the <transfer> command.
-->
  <complexType name="transferType">
    <sequence>
      <element name="name" type="eppcom:labelType"/>
      <element name="period" type="domain:periodType"
       minOccurs="0"/>
      <element name="authInfo" type="eppcom:authInfoType"
       minOccurs="0"/>
    </sequence>
  </complexType>

<!--
Child elements of the <update> command.
-->
  <complexType name="updateType">
    <sequence>
      <element name="name" type="eppcom:labelType"/>
      <choice minOccurs="0" maxOccurs="3">
        <element name="add" type="domain:addRemType"
         minOccurs="0"/>
        <element name="rem" type="domain:addRemType"
         minOccurs="0"/>
        <element name="chg" type="domain:chgType"
         minOccurs="0"/>
       </choice>
    </sequence>
  </complexType>

<!--
Data elements that can be added or removed.
-->
  <complexType name="addRemType">
    <choice minOccurs="1" maxOccurs="3">
      <element name="ns" type="eppcom:labelType"
       minOccurs="0" maxOccurs="unbounded"/>
      <element name="contact" type="domain:contactType"
       minOccurs="0" maxOccurs="unbounded"/>
      <element name="status" type="domain:statusType"
       minOccurs="0" maxOccurs="14"/>
    </choice>
  </complexType>

<!--
Data elements that can be changed.
-->
  <complexType name="chgType">
    <sequence>
      <element name="registrant" type="eppcom:clIDType"
       minOccurs="0"/>
      <element name="authInfo" type="eppcom:authInfoType"
       minOccurs="0"/>
    </sequence>
  </complexType>

<!--
Child response elements.
-->
  <element name="chkData" type="domain:chkDataType"/>
  <element name="creData" type="domain:creDataType"/>
  <element name="infData" type="domain:infDataType"/>
  <element name="renData" type="domain:renDataType"/>
  <element name="trnData" type="domain:trnDataType"/>

<!--
<check> response elements.
-->
  <complexType name="chkDataType">
    <sequence>
      <element name="cd" type="domain:checkType"
       maxOccurs="unbounded"/>
    </sequence>
  </complexType>

  <complexType name="checkType">
    <sequence>
      <element name="name" type="domain:checkNameType"/>
      <element name="reason" type="eppcom:reasonType"
       minOccurs="0"/>
    </sequence>
  </complexType>

  <complexType name="checkNameType">
    <simpleContent>
      <extension base="eppcom:labelType">
        <attribute name="avail" type="boolean"
         use="required"/>
      </extension>
    </simpleContent>
  </complexType>

<!--
<create> response elements.
-->
  <complexType name="creDataType">
    <sequence>
      <element name="name" type="eppcom:labelType"/>
      <element name="crDate" type="dateTime"/>
      <element name="exDate" type="dateTime"
       minOccurs="0"/>
    </sequence>
  </complexType>

<!--
<info> response elements.
-->
  <complexType name="infDataType">
    <sequence>
      <element name="name" type="eppcom:labelType"/>
      <element name="roid" type="eppcom:roidType"/>
      <element name="status" type="domain:statusType"
       maxOccurs="14"/>
      <element name="registrant" type="domain:contactType"
       minOccurs="0"/>
      <element name="contact" type="domain:contactType"
       minOccurs="0" maxOccurs="unbounded"/>
      <element name="ns" type="eppcom:labelType"
       minOccurs="0" maxOccurs="unbounded"/>
      <element name="host" type="eppcom:labelType"
       minOccurs="0" maxOccurs="unbounded"/>
      <element name="clID" type="eppcom:clIDType"/>
      <element name="crID" type="eppcom:clIDType"/>
      <element name="crDate" type="dateTime"/>
      <element name="upID" type="eppcom:clIDType"
       minOccurs="0"/>
      <element name="upDate" type="dateTime"
       minOccurs="0"/>
      <element name="exDate" type="dateTime"
       minOccurs="0"/>
      <element name="trDate" type="dateTime"
       minOccurs="0"/>
      <element name="authInfo" type="eppcom:authInfoType"
       minOccurs="0"/>
    </sequence>
  </complexType>

<!--
Status is a combination of attributes and an optional human-readable
message that may be expressed in languages other than English.
-->
  <complexType name="statusType">
    <simpleContent>
      <extension base="normalizedString">
        <attribute name="s" type="domain:statusValueType"
         use="required"/>
        <attribute name="lang" type="language"
         default="en"/>
      </extension>
    </simpleContent>
  </complexType>

  <simpleType name="statusValueType">
    <restriction base="token">
      <enumeration value="clientDeleteProhibited"/>
      <enumeration value="clientHold"/>
      <enumeration value="clientRenewProhibited"/>
      <enumeration value="clientTransferProhibited"/>
      <enumeration value="clientUpdateProhibited"/>
      <enumeration value="inactive"/>
      <enumeration value="ok"/>
      <enumeration value="pendingDelete"/>
      <enumeration value="pendingTransfer"/>
      <enumeration value="pendingVerification"/>
      <enumeration value="serverDeleteProhibited"/>
      <enumeration value="serverHold"/>
      <enumeration value="serverRenewProhibited"/>
      <enumeration value="serverTransferProhibited"/>
      <enumeration value="serverUpdateProhibited"/>
    </restriction>
  </simpleType>

<!--
<renew> response elements.
-->
  <complexType name="renDataType">
    <sequence>
      <element name="name" type="eppcom:labelType"/>
      <element name="exDate" type="dateTime"
       minOccurs="0"/>
    </sequence>
  </complexType>

<!--
<transfer> response elements.
-->
  <complexType name="trnDataType">
    <sequence>
      <element name="name" type="eppcom:labelType"/>
      <element name="trStatus" type="eppcom:trStatusType"/>
      <element name="reID" type="eppcom:clIDType"/>
      <element name="reDate" type="dateTime"/>
      <element name="acID" type="eppcom:clIDType"/>
      <element name="acDate" type="dateTime"/>
      <element name="exDate" type="dateTime"
       minOccurs="0"/>
    </sequence>
  </complexType>

<!--
End of schema.
-->
</schema>
