<?xml version="1.0"?>
<schema elementFormDefault="unqualified" targetNamespace="http://ws.infotorg.no/xml/Brreg/eTinglysningLoesoere/2014-05-26/eTinglysningLoesoere.xsd"
    xmlns:tns="http://ws.infotorg.no/xml/Brreg/eTinglysningLoesoere/2014-05-26/eTinglysningLoesoere.xsd"
    xmlns:feil="http://ws.infotorg.no/xml/Feil/Feil.xsd"
    xmlns="http://www.w3.org/2001/XMLSchema"
    >
    <annotation>
        <documentation xml:lang="no">
            Datatyper for eTinglysningLoesoere.

            © 2014 ErgoGroup AS
            Forfatter: Frank Olaf Sem-Jacobsen &lt;frank.olaf.jacobsen@evry.com&gt;
        </documentation>
    </annotation>

    <import
        namespace="http://ws.infotorg.no/xml/Feil/Feil.xsd"
        schemaLocation="https://ws.infotorg.no/xml/Feil/Feil.xsd"/>

    <import
        namespace="http://schemas.altinn.no/services/Intermediary/Receipt/2009/10"
        schemaLocation="https://ws.infotorg.no/xml/Brreg/eTinglysningLoesoere/2014-05-26/include/receiptExternal.xsd"/>

  <import
        namespace="http://schemas.altinn.no/services/intermediary/brokerservice/2009/10"
        schemaLocation="https://ws.infotorg.no/xml/Brreg/eTinglysningLoesoere/2014-05-26/include/brokerservice.xsd"/>



    <element name="hentSendMelding">
        <complexType>
            <sequence>
                <element name="SendBrokerShipment" type="tns:SendBrokerShipment"/>
            </sequence>
        </complexType>
    </element>

    <element name="hentKvitteringOgMelding">
        <complexType>
            <sequence>
                <element name="reference" type="string"/>
                <!--<element name="sender" type="string"/>-->
            </sequence>
        </complexType>
    </element>

    <element name="hentKvitteringer">
        <complexType>
            <sequence>
                <element minOccurs="0" name="receiptTypeName" type="tns:ReceiptTypeEnum"/>
                <element minOccurs="0" name="dateFrom" type="dateTime"/>
                <element minOccurs="0" name="dateTo" type="dateTime"/>
            </sequence>
        </complexType>
    </element>

  <element name="SendMelding">
    <complexType>
      <sequence>
        <element name="status" type="string"/>
      </sequence>
    </complexType>
  </element>

  <element name="KvitteringOgMelding">
    <complexType>
      <sequence>
        <element name="SendBrokerShipment" type="tns:SendBrokerShipment" minOccurs="0"/>
        <element name="GetReceiptBasicResult" type="tns:ReceiptExternal" minOccurs="0"/>
      </sequence>
    </complexType>
  </element>

  <element name="Kvitteringer">
    <complexType>
      <sequence>
        <element minOccurs="0" name="GetReceiptListBasicResult" nillable="true" type="tns:ReceiptExternalList"/>
      </sequence>
    </complexType>
  </element>

  <element name="AltinnFault">
    <complexType>
      <sequence>
        <element name="AltinnErrorMessage" type="string" nillable="true" minOccurs="0"/>
        <element name="AltinnExtendedErrorMessage" type="string" nillable="true" minOccurs="0"/>
        <element name="AltinnLocalizedErrorMessage" type="string" nillable="true" minOccurs="0"/>
        <element name="ErrorGuid" type="string" nillable="true" minOccurs="0"/>
        <element name="ErrorID" type="int" minOccurs="0"/>
        <element name="UserGuid" type="string" nillable="true" minOccurs="0"/>
        <element name="UserId" type="string" nillable="true" minOccurs="0"/>
      </sequence>
    </complexType>
  </element>

  <complexType name="SendBrokerShipment">
    <sequence>
      <element name="SystemUserCode" type="string" minOccurs="0">
        <annotation>
          <documentation>A id which identify the partners sending system. Leave blank, provided by EVRY.</documentation>
        </annotation>
      </element>
      <element name="SystemPassword" minOccurs="0">
        <annotation>
          <documentation>The Altinn password of the partners sending system. Leave blank, provided by EVRY.</documentation>
        </annotation>
        <simpleType>
          <restriction base="string" />
        </simpleType>
      </element>
      <element name="BrokerShipment">
        <annotation>
          <documentation>This element contains elements for one BrokerShipment.</documentation>
        </annotation>
        <complexType>
          <sequence>
            <element minOccurs="1" maxOccurs="1" name="ServiceCode">
              <annotation>
                <documentation>The registered Service code for the broker service</documentation>
              </annotation>
              <simpleType>
                <restriction base="string">
                  <maxLength value="7" />
                </restriction>
              </simpleType>
            </element>
            <element minOccurs="0" maxOccurs="1" name="ServiceEdition">
              <annotation>
                <documentation>The Service edition code for the broker service</documentation>
              </annotation>
              <simpleType>
                <restriction base="string">
                  <maxLength value="4" />
                </restriction>
              </simpleType>
            </element>
            <element name="Sender" type="string">
              <annotation>
                <documentation>The organization number or social security number of the sending part</documentation>
              </annotation>
            </element>
            <element minOccurs="1" maxOccurs="1" name="SendersReference" type="string">
              <annotation>
                <documentation>A sender unique reference for the broker message shipment</documentation>
              </annotation>
            </element>
            <element minOccurs="0" maxOccurs="1" name="Receiver" type="string" />
            <element minOccurs="0" maxOccurs="1" name="ReceiversReference" type="string" />
            <element minOccurs="0" maxOccurs="1" name="Type" type="string" />
            <element minOccurs="1" maxOccurs="1" name="SentDateTime" type="dateTime">
              <annotation>
                <documentation>Date indicating when the Shipment broker message was sent</documentation>
              </annotation>
            </element>
            <element minOccurs="0" maxOccurs="1" name="ControlData" type="string">
              <annotation>
                <documentation>Control data used by exchanging parts to ensure the correct data has been received, ex. a hash or number of items in payload</documentation>
              </annotation>
            </element>
            <element name="Content">
              <annotation>
                <documentation>This element contains content elements for one shipment.</documentation>
              </annotation>
              <complexType>
                <sequence>
                  <element minOccurs="0" maxOccurs="1" name="Data" type="string">
                    <annotation>
                      <documentation>The data in this section needs to be contained in a CDATA section</documentation>
                    </annotation>
                  </element>
                  <element minOccurs="0" maxOccurs="1" name="Attachments">
                    <annotation>
                      <documentation>This element contains all attachments for the shipment</documentation>
                    </annotation>
                    <complexType>
                      <sequence>
                        <element minOccurs="0" maxOccurs="unbounded" name="BinaryAttachment">
                          <annotation>
                            <documentation>This element contains elements for one attachment.</documentation>
                          </annotation>
                          <complexType>
                            <sequence>
                              <element minOccurs="1" maxOccurs="1" name="FileName">
                                <annotation>
                                  <documentation>Attachment file name.</documentation>
                                </annotation>
                                <simpleType>
                                  <restriction base="string">
                                    <minLength value="1" />
                                    <maxLength value="255" />
                                  </restriction>
                                </simpleType>
                              </element>
                              <element minOccurs="1" maxOccurs="1" name="Data" type="base64Binary">
                                <annotation>
                                  <documentation>The binary attachment.</documentation>
                                </annotation>
                              </element>
                            </sequence>
                          </complexType>
                        </element>
                      </sequence>
                    </complexType>
                  </element>
                </sequence>
              </complexType>
            </element>
          </sequence>
        </complexType>
      </element>
    </sequence>
  </complexType>

  <complexType name="ReceiptExternal">
    <sequence>
      <element minOccurs="0" name="LastChanged" type="dateTime">
        <annotation>
          <documentation xml:lang="en">
            Gets or sets the date and time for when the recipe was last changed.
          </documentation>
        </annotation>
      </element>
      <element minOccurs="0" name="ParentReceiptId" type="int">
        <annotation>
          <documentation xml:lang="en">
            Gets or sets the id of the parent receipt if the current reciept is a child receipt.
          </documentation>
        </annotation>
      </element>
      <element minOccurs="0" name="ReceiptHistory" nillable="true" type="string">
        <annotation>
          <documentation xml:lang="en">
            Gets or sets the reciept history. The content of ReceiptText is added to ReceiptHistory at every update.
          </documentation>
        </annotation>
      </element>
      <element minOccurs="0" name="ReceiptId" type="int">
        <annotation>
          <documentation xml:lang="en">
            Gets or sets the unique id of the receipt.
          </documentation>
        </annotation>
      </element>
      <element minOccurs="0" name="ReceiptStatusCode" type="tns:ReceiptStatusEnum">
        <annotation>
          <documentation xml:lang="en">
            Gets or sets a value that indicates the status of the action that the reciept belong. For example if a submition
            has been "Rejected".
          </documentation>
        </annotation>
      </element>
      <element minOccurs="0" name="ReceiptText" nillable="true" type="string">
        <annotation>
          <documentation xml:lang="en">
            Gets or sets the reciept text with a short description of the last step done to the element.
          </documentation>
        </annotation>
      </element>
      <element minOccurs="0" name="ReceiptTypeName" type="tns:ReceiptTypeEnum">
        <annotation>
          <documentation xml:lang="en">
            Gets or sets a value indicating what type of recipe this is.
          </documentation>
        </annotation>
      </element>
      <element minOccurs="0" name="References" nillable="true" type="tns:ReferenceList">
        <annotation>
          <documentation xml:lang="en">
            Gets or sets a list of references.
          </documentation>
        </annotation>
      </element>
      <element minOccurs="0" name="SubReceipts" nillable="true" type="tns:ReceiptExternalList">
        <annotation>
          <documentation xml:lang="en">
            Gets or sets a list of child receipts.
          </documentation>
        </annotation>
      </element>
    </sequence>
  </complexType>

  <simpleType name="ReceiptStatusEnum">
    <restriction base="string">
      <enumeration value="NotSet">
        <annotation>
          <documentation xml:lang="en">
            Specifies that the reciept status is unknown.
            This type should not be used. It is an error condition if status is of this type.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="OK">
        <annotation>
          <documentation xml:lang="en">
            Specifies that the request was processed without any error.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="UnExpectedError">
        <annotation>
          <documentation xml:lang="en">
            Specifies that there was an unexpected error during processing of a request.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="ValidationFailed">
        <annotation>
          <documentation xml:lang="en">
             Specifies that the data in a request failed validation.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="Rejected">
        <annotation>
          <documentation xml:lang="en">
             Specifies that the request was rejected. Usually because of known error conditions.
          </documentation>
        </annotation>
      </enumeration>
    </restriction>
  </simpleType>

  <simpleType name="ReceiptTypeEnum">
    <restriction base="string">
      <enumeration value="NotSet">
        <annotation>
          <documentation xml:lang="no">
            SHOULD NOT BE USED (For Enum error handling).
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="FormTask">
        <annotation>
          <documentation xml:lang="no">
            Specifies that the receipt is for a form task.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="Correspondence">
        <annotation>
          <documentation xml:lang="no">
            Specifies that the receipt is for correspondence.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="PINCODE">
        <annotation>
          <documentation xml:lang="no">
            Specifies that the receipt is for pin code.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="Subscription">
        <annotation>
          <documentation xml:lang="no">
            Specifies that the receipt is for a subscription shipment.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="Outbound">
        <annotation>
          <documentation xml:lang="no">
            Specifies that the receipt is for an outbound shipment.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="PreFill">
        <annotation>
          <documentation xml:lang="no">
            Specifies that the receipt is for a prefill shipment.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="RegisterDLS">
        <annotation>
          <documentation xml:lang="no">
            Specifies that the receipt is for a register DLS (DeltarkerLiknet Selskap) shipment.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="RegisterDSF">
        <annotation>
          <documentation xml:lang="no">
            Specifies that the receipt is for a register DSF (Det Sentrale Folkeregister) shipment.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="RegisterER">
        <annotation>
          <documentation xml:lang="no">
            Specifies that the receipt is for a register ER (EnhetsRegister) shipment.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="RegisterDSFProperty">
        <annotation>
          <documentation xml:lang="no">
            Specifies that the receipt is for a register DFS (Det Sentrale Folkeregister) property shipment.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="RegisterDSFStreet">
        <annotation>
          <documentation xml:lang="no">
            Specifies that the receipt is for a register DFS (Det Sentrale Folkeregister) street shipment.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="RegisterDSFCountry">
        <annotation>
          <documentation xml:lang="no">
            Specifies that the receipt is for a register DSF (Det Sentrale Folkeregister) country shipment.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="RegisterDSFUser">
        <annotation>
          <documentation xml:lang="no">
            Specifies that the receipt is for a register DSF (Det Sentrale Folkeregister) user shipment.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="LookUp">
        <annotation>
          <documentation xml:lang="no">
            Specifies that the receipt is for a lookup shipment.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="RegisterDSFStreetAdd">
        <annotation>
          <documentation xml:lang="no">
            Specifies that the receipt is for a register DSF (Det Sentrale Folkeregister) street address batch.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="RegisterDSFPropertyAdd">
        <annotation>
          <documentation xml:lang="no">
            Specifies that the receipt is for a register DSF (Det Sentrale Folkeregister) property address batch.
          </documentation>
        </annotation>
      </enumeration>
    </restriction>
  </simpleType>

  <complexType name="ReferenceList">
    <sequence>
      <element minOccurs="0" maxOccurs="unbounded" name="Reference" nillable="true" type="tns:Reference"/>
    </sequence>
  </complexType>

  <complexType name="Reference">
    <sequence>
      <element minOccurs="0" name="ReferenceTypeName" type="tns:ReferenceType">
      </element>
      <element minOccurs="0" name="ReferenceValue" nillable="true" type="string">
      </element>
    </sequence>
  </complexType>

  <complexType name="ReceiptExternalList">
    <sequence>
      <element minOccurs="0" maxOccurs="unbounded" name="ReceiptExternal" nillable="true" type="tns:ReceiptExternal"/>
    </sequence>
  </complexType>

  <simpleType name="ReferenceType">
    <restriction base="string">
      <enumeration value="NotSet">
        <annotation>
          <documentation xml:lang="en">
            Specifies that reference type is unknown.
            This type should not be used. It is an error condition if a reference is of this type.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="ExternalShipmentReference">
        <annotation>
          <documentation xml:lang="en">
            Specifies that a reference value is a shipment reference given by an external system.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="EndUserSystemReference">
        <annotation>
          <documentation xml:lang="en">
            Specifies that a reference value is an element (usually form task) reference given by an external system.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="ParentReference">
        <annotation>
          <documentation xml:lang="en">
            Specifies that a reference value is an element id for a parent element.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="SendersReference">
        <annotation>
          <documentation xml:lang="en">
            Specifies that a reference value is an element reference given by an external system. This is similar to EndUserSystemReference,
            but can also be used by service owners when they are creating elements.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="WorkFlowReference">
        <annotation>
          <documentation xml:lang="en">
            Specifies that a reference value is a workflow id.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="BatchReference">
        <annotation>
          <documentation xml:lang="en">
            Specifies that a reference value is a batch reference.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="OutboundShipmentReference">
        <annotation>
          <documentation xml:lang="en">
            Specifies that a reference value is an outbound shipment reference.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="ReceiversReference">
        <annotation>
          <documentation xml:lang="en">
            Specifies that a reference value is a recievers reference.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="Altinn1Reference">
        <annotation>
          <documentation xml:lang="en">
            Specifies that a reference value is an Altinn1 reference.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="OwnerPartyReference">
        <annotation>
          <documentation xml:lang="en">
            Specifies that a reference value is the id of the reciept owner.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="PartyReference">
        <annotation>
          <documentation xml:lang="en">
            Specifies that a reference value is the id of the reciept reportee.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="ArchiveReference">
        <annotation>
          <documentation xml:lang="en">
            Specifies that a reference value is an archive reference.
          </documentation>
        </annotation>
      </enumeration>
    </restriction>
  </simpleType>
</schema>
