Skip to content

Instantly share code, notes, and snippets.

@IslandUsurper
Created December 22, 2017 13:31
Show Gist options
  • Select an option

  • Save IslandUsurper/a9e26a86225b3727189e59bb3af7ef0b to your computer and use it in GitHub Desktop.

Select an option

Save IslandUsurper/a9e26a86225b3727189e59bb3af7ef0b to your computer and use it in GitHub Desktop.

Revisions

  1. IslandUsurper created this gist Dec 22, 2017.
    11 changes: 11 additions & 0 deletions example.xml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    <ErrorRecovery>
    <ListID>1235623425</ListID>
    <EditSequence>whatever</EditSequence>
    </ErrorRecovery>
    <ErrorRecovery>
    <OwnerID>FOO</OwnerID>
    </ErrorRecovery>
    <ErrorRecovery>
    <TxnID>18302-1488303-random-numbers</TxnId>
    <TxnNumber>9492023</TxnNumber>
    </ErrorRecovery>
    20 changes: 20 additions & 0 deletions some.xsd
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    <xsd:element name="ErrorRecovery">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:choice>
    <xsd:element ref="ListID" minOccurs="0"/>
    <xsd:element ref="OwnerID" minOccurs="0"/>
    <xsd:element ref="TxnID" minOccurs="0"/>
    </xsd:choice>
    <xsd:element ref="TxnNumber" minOccurs="0"/>
    <xsd:element name="EditSequence" minOccurs="0">
    <xsd:simpleType>
    <xsd:restriction base="STRTYPE">
    <xsd:maxLength value="16"/>
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element ref="ExternalGUID" minOccurs="0"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    17 changes: 17 additions & 0 deletions types.rs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    #[derive(Debug, Deserialize)]
    pub struct ErrorRecovery {
    pub _id: Option<ErrorRecoveryID>,

    pub txn_number: Option<i64>,
    pub edit_sequence: Option<String>,

    #[serde(rename = "ExternalGUID")]
    pub external_guid: Option<String>,
    }

    #[derive(Debug, Deserialize)]
    pub enum ErrorRecoveryId {
    ListID(String),
    OwnerID(String),
    TxnID(String),
    }