################################################## 
# test_Choice_xsd_services_types.py 
# generated by ZSI.generate.wsdl2python
##################################################


import ZSI
import ZSI.TCcompound
from ZSI.TC import ElementDeclaration,TypeDefinition
from ZSI.generate.pyclass import pyclass_type

##############################
# targetNamespace
# urn:example
##############################

class ns0:
    targetNamespace = "urn:example"

    class EasyChoice_Def(ZSI.TCcompound.ComplexType, TypeDefinition):
        schema = "urn:example"
        type = (schema, "EasyChoice")
        def __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):
            ns = ns0.EasyChoice_Def.schema
            TClist = [ZSI.TC.String(pname="name", aname="_name", minOccurs=0, maxOccurs=1, nillable=False, encoded=kw.get("encoded")), ZSI.TCnumbers.Iint(pname="rank", aname="_rank", minOccurs=0, maxOccurs=1, nillable=False, encoded=kw.get("encoded")), ZSI.TC.AnyType(pname="any", aname="_any", minOccurs=0, maxOccurs=1, nillable=False, encoded=kw.get("encoded"))]
            self.attribute_typecode_dict = attributes or {}
            if extend: TClist += ofwhat
            if restrict: TClist = ofwhat
            ZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, **kw)
            class Holder:
                __metaclass__ = pyclass_type
                typecode = self
                def __init__(self):
                    # pyclass
                    self._name = None
                    self._rank = None
                    self._any = None
                    return
            Holder.__name__ = "EasyChoice_Holder"
            self.pyclass = Holder

    class HardChoice_Def(ZSI.TCcompound.ComplexType, TypeDefinition):
        schema = "urn:example"
        type = (schema, "HardChoice")
        def __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):
            ns = ns0.HardChoice_Def.schema
            TClist = [ZSI.TC.String(pname="name", aname="_name", minOccurs=0, maxOccurs="unbounded", nillable=False, encoded=kw.get("encoded")), ZSI.TCnumbers.Iint(pname="rank", aname="_rank", minOccurs=0, maxOccurs="unbounded", nillable=False, encoded=kw.get("encoded")), ZSI.TC.AnyType(pname="any", aname="_any", minOccurs=0, maxOccurs="unbounded", nillable=False, encoded=kw.get("encoded"))]
            self.attribute_typecode_dict = attributes or {}
            if extend: TClist += ofwhat
            if restrict: TClist = ofwhat
            ZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, **kw)
            class Holder:
                __metaclass__ = pyclass_type
                typecode = self
                def __init__(self):
                    # pyclass
                    self._name = []
                    self._rank = []
                    self._any = []
                    return
            Holder.__name__ = "HardChoice_Holder"
            self.pyclass = Holder

    class Easy_Dec(ElementDeclaration):
        literal = "Easy"
        schema = "urn:example"
        def __init__(self, **kw):
            kw["pname"] = ("urn:example","Easy")
            kw["aname"] = "_Easy"
            if ns0.EasyChoice_Def not in ns0.Easy_Dec.__bases__:
                bases = list(ns0.Easy_Dec.__bases__)
                bases.insert(0, ns0.EasyChoice_Def)
                ns0.Easy_Dec.__bases__ = tuple(bases)

            ns0.EasyChoice_Def.__init__(self, **kw)
            if self.pyclass is not None: self.pyclass.__name__ = "Easy_Dec_Holder"

    class Hard_Dec(ElementDeclaration):
        literal = "Hard"
        schema = "urn:example"
        def __init__(self, **kw):
            kw["pname"] = ("urn:example","Hard")
            kw["aname"] = "_Hard"
            if ns0.HardChoice_Def not in ns0.Hard_Dec.__bases__:
                bases = list(ns0.Hard_Dec.__bases__)
                bases.insert(0, ns0.HardChoice_Def)
                ns0.Hard_Dec.__bases__ = tuple(bases)

            ns0.HardChoice_Def.__init__(self, **kw)
            if self.pyclass is not None: self.pyclass.__name__ = "Hard_Dec_Holder"

# end class ns0 (tns: urn:example)
