#[derive(Debug, Clone, PartialEq)]
pub struct Schema {
pub target_namespace: String,
pub elements: Vec<Element>,
pub simple_types: Vec<SimpleType>,
pub complex_types: Vec<ComplexType>,
}
#[derive(Debug, Clone, PartialEq)]
pub struct Element {
pub name: String,
pub type_name: String,
}
#[derive(Debug, Clone, PartialEq)]
pub struct SimpleType {
pub name: String,
pub restriction: Restriction,
}
#[derive(Debug, Clone, PartialEq)]
pub struct Restriction {
pub base: String,
pub facets: Vec<Facet>,
}
#[derive(Debug, Clone, PartialEq)]
pub enum Facet {
Enumeration(String),
Pattern(String),
MinLength(u64),
MaxLength(u64),
MinInclusive(String),
MaxInclusive(String),
TotalDigits(u32),
FractionDigits(u32),
}
#[derive(Debug, Clone, PartialEq)]
pub struct ComplexType {
pub name: String,
pub content: ComplexContent,
}
#[derive(Debug, Clone, PartialEq)]
pub enum ComplexContent {
Sequence(Vec<SequenceElement>),
Choice(Vec<ChoiceVariant>),
SimpleContent {
base: String,
attributes: Vec<Attribute>,
},
Any {
namespace: Option<String>,
},
}
#[derive(Debug, Clone, PartialEq)]
pub struct SequenceElement {
pub name: String,
pub type_name: String,
pub min_occurs: u32,
pub max_occurs: MaxOccurs,
}
#[derive(Debug, Clone, PartialEq)]
pub enum MaxOccurs {
Bounded(u32),
Unbounded,
}
#[derive(Debug, Clone, PartialEq)]
pub struct ChoiceVariant {
pub name: String,
pub type_name: String,
}
#[derive(Debug, Clone, PartialEq)]
pub struct Attribute {
pub name: String,
pub type_name: String,
pub required: bool,
}