1#!/usr/bin/env python
2
3#
4# Generated Mon May  2 14:23:34 2011 by parse_xsd.py version 0.4.
5#
6
7import saml2
8from saml2 import SamlBase
9
10from saml2 import saml
11
12NAMESPACE = 'urn:oasis:names:tc:SAML:metadata:attribute'
13
14class EntityAttributesType_(SamlBase):
15    """The urn:oasis:names:tc:SAML:metadata:attribute:EntityAttributesType element """
16
17    c_tag = 'EntityAttributesType'
18    c_namespace = NAMESPACE
19    c_children = SamlBase.c_children.copy()
20    c_attributes = SamlBase.c_attributes.copy()
21    c_child_order = SamlBase.c_child_order[:]
22    c_cardinality = SamlBase.c_cardinality.copy()
23    c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Attribute'] = ('attribute', [saml.Attribute])
24    c_cardinality['attribute'] = {"min":0}
25    c_children['{urn:oasis:names:tc:SAML:2.0:assertion}Assertion'] = ('assertion', [saml.Assertion])
26    c_cardinality['assertion'] = {"min":0}
27    c_child_order.extend(['attribute', 'assertion'])
28
29    def __init__(self,
30            attribute=None,
31            assertion=None,
32            text=None,
33            extension_elements=None,
34            extension_attributes=None,
35        ):
36        SamlBase.__init__(self,
37                text=text,
38                extension_elements=extension_elements,
39                extension_attributes=extension_attributes,
40                )
41        self.attribute=attribute or []
42        self.assertion=assertion or []
43
44def entity_attributes_type__from_string(xml_string):
45    return saml2.create_class_from_xml_string(EntityAttributesType_, xml_string)
46
47
48class EntityAttributes(EntityAttributesType_):
49    """The urn:oasis:names:tc:SAML:metadata:attribute:EntityAttributes element """
50
51    c_tag = 'EntityAttributes'
52    c_namespace = NAMESPACE
53    c_children = EntityAttributesType_.c_children.copy()
54    c_attributes = EntityAttributesType_.c_attributes.copy()
55    c_child_order = EntityAttributesType_.c_child_order[:]
56    c_cardinality = EntityAttributesType_.c_cardinality.copy()
57
58def entity_attributes_from_string(xml_string):
59    return saml2.create_class_from_xml_string(EntityAttributes, xml_string)
60
61
62ELEMENT_FROM_STRING = {
63    EntityAttributes.c_tag: entity_attributes_from_string,
64    EntityAttributesType_.c_tag: entity_attributes_type__from_string,
65}
66
67ELEMENT_BY_TAG = {
68    'EntityAttributes': EntityAttributes,
69    'EntityAttributesType': EntityAttributesType_,
70}
71
72
73def factory(tag, **kwargs):
74    return ELEMENT_BY_TAG[tag](**kwargs)
75
76