<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../xslt/schema.xslt"?>

<schema
    elementFormDefault="qualified"
    attributeFormDefault="unqualified"
    xmlns="http://www.w3.org/2001/XMLSchema"
    xmlns:identity="http://docs.openstack.org/identity/api/v2.0"
    xmlns:RAX-KSADM="http://docs.rackspace.com/identity/api/ext/RAX-KSADM/v1.0"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
    xmlns:xsdxt="http://docs.rackspacecloud.com/xsd-ext/v1.0"
    xmlns:atom="http://www.w3.org/2005/Atom"
    targetNamespace="http://docs.rackspace.com/identity/api/ext/RAX-KSADM/v1.0"
    >
    <!--Import schema we are extending -->
    <import namespace="http://docs.openstack.org/identity/api/v2.0"
        schemaLocation="user.xsd"/>

    <!-- Elements -->
    <complexType name="UserWithOnlyEnabled">
        <complexContent>
            <restriction base="identity:User">
                <attribute name="id" type="xsd:string" use="prohibited"/>
                <attribute name="username" type="xsd:string" use="prohibited"/>
                <attribute name="email" type="xsd:string" use="prohibited"/>
                <attribute name="enabled" type="xsd:boolean" use="required"/>
            </restriction>
        </complexContent>
    </complexType>

    <complexType name="UserWithPassword">
         <complexContent>
              <annotation>
                   <xsd:appinfo>
                        <xsdxt:samples>
                             <xsdxt:sample>
                                  <xsdxt:code type="application/xml" href="../samples/RAX-KSADM-userWithPassword.xml" />
                             </xsdxt:sample>
                             <xsdxt:sample>
                                  <xsdxt:code type="application/json" href="../samples/RAX-KSADM-userWithPassword.json" />
                             </xsdxt:sample>
                        </xsdxt:samples>
                   </xsd:appinfo>
              </annotation>
              <extension base="identity:User">
                   <attribute name="password" type="xsd:string" use="optional"/>
                   <anyAttribute namespace="##other" processContents="lax" />
              </extension>
         </complexContent>
    </complexType>

</schema>
