<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:element name="download_counter">
    <xs:annotation>
      <xs:documentation>
        Download counter - top build service downloads.
      </xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="count" minOccurs="0" maxOccurs="unbounded" />
      </xs:sequence>
      <xs:attribute name="first" use="required" type="xs:dateTime">
        <xs:annotation>
          <xs:documentation>
            Timestamp of first counted download (of all counters).
          </xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="last"  use="required" type="xs:dateTime">
        <xs:annotation>
          <xs:documentation>
            Timestamp of last counted download (of all counters).
          </xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="sum"   use="required" type="xs:nonNegativeInteger">
        <xs:annotation>
          <xs:documentation>
            Sum of all counted downloads of the selected objects
            (project/package/repo/arch).
          </xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="all"   use="required" type="xs:nonNegativeInteger">
        <xs:annotation>
          <xs:documentation>
            Sum of all counted downloads (of the whole build service).
          </xs:documentation>
        </xs:annotation>
      </xs:attribute>
    </xs:complexType>
  </xs:element>

  <xs:element name="count">
    <xs:complexType mixed="true">
      <xs:attribute name="project"      type="xs:string" use="required" />
      <xs:attribute name="repository"   type="xs:string" use="required" />
      <xs:attribute name="package"      type="xs:string" use="required" />
      <xs:attribute name="architecture" type="xs:string" use="required" />
      <xs:attribute name="filename"     type="xs:string" use="required" />
      <xs:attribute name="filetype"     type="xs:string" use="required" />
      <xs:attribute name="version"      type="xs:string" use="required" />
      <xs:attribute name="release"      type="xs:string" use="required" />
    </xs:complexType>
  </xs:element>

</xs:schema>

