import sys
import re as re_
import base64
import datetime as datetime_

from lxml import etree as etree_

Validate_simpletypes_ = True
if sys.version_info.major == 2:
    BaseStrType_ = basestring
else:
    BaseStrType_ = str


def parsexml_(infile, parser=None, **kwargs):
    if parser is None:
        # Use the lxml ElementTree compatible parser so that, e.g.,
        #   we ignore comments.
        parser = etree_.ETCompatXMLParser()
    doc = etree_.parse(infile, parser=parser, **kwargs)
    return doc


#
# User methods
#
# Calls to the methods in these classes are generated by generateDS.py.
# You can replace these methods by re-implementing the following class
#   in a module named generatedssuper.py.

try:
    from generatedssuper import GeneratedsSuper
except ImportError as exp:

    class GeneratedsSuper(object):
        tzoff_pattern = re_.compile(r'(\+|-)((0\d|1[0-3]):[0-5]\d|14:00)$')

        class _FixedOffsetTZ(datetime_.tzinfo):
            def __init__(self, offset, name):
                self.__offset = datetime_.timedelta(minutes=offset)
                self.__name = name

            def utcoffset(self, dt):
                return self.__offset

            def tzname(self, dt):
                return self.__name

            def dst(self, dt):
                return None

        def gds_format_string(self, input_data, input_name=''):
            return input_data

        def gds_validate_string(self, input_data, node=None, input_name=''):
            if not input_data:
                return ''
            else:
                return input_data

        def gds_format_base64(self, input_data, input_name=''):
            return base64.b64encode(input_data)

        def gds_validate_base64(self, input_data, node=None, input_name=''):
            return input_data

        def gds_format_integer(self, input_data, input_name=''):
            return '%d' % input_data

        def gds_validate_integer(self, input_data, node=None, input_name=''):
            return input_data

        def gds_format_integer_list(self, input_data, input_name=''):
            return '%s' % ' '.join(input_data)

        def gds_validate_integer_list(
                self, input_data, node=None, input_name=''):
            values = input_data.split()
            for value in values:
                try:
                    int(value)
                except (TypeError, ValueError):
                    raise_parse_error(node, 'Requires sequence of integers')
            return values

        def gds_format_float(self, input_data, input_name=''):
            return ('%.15f' % input_data).rstrip('0')

        def gds_validate_float(self, input_data, node=None, input_name=''):
            return input_data

        def gds_format_float_list(self, input_data, input_name=''):
            return '%s' % ' '.join(input_data)

        def gds_validate_float_list(
                self, input_data, node=None, input_name=''):
            values = input_data.split()
            for value in values:
                try:
                    float(value)
                except (TypeError, ValueError):
                    raise_parse_error(node, 'Requires sequence of floats')
            return values

        def gds_format_double(self, input_data, input_name=''):
            return '%e' % input_data

        def gds_validate_double(self, input_data, node=None, input_name=''):
            return input_data

        def gds_format_double_list(self, input_data, input_name=''):
            return '%s' % ' '.join(input_data)

        def gds_validate_double_list(
                self, input_data, node=None, input_name=''):
            values = input_data.split()
            for value in values:
                try:
                    float(value)
                except (TypeError, ValueError):
                    raise_parse_error(node, 'Requires sequence of doubles')
            return values

        def gds_format_boolean(self, input_data, input_name=''):
            return ('%s' % input_data).lower()

        def gds_validate_boolean(self, input_data, node=None, input_name=''):
            return input_data

        def gds_format_boolean_list(self, input_data, input_name=''):
            return '%s' % ' '.join(input_data)

        def gds_validate_boolean_list(
                self, input_data, node=None, input_name=''):
            values = input_data.split()
            for value in values:
                if value not in ('true', '1', 'false', '0',):
                    raise_parse_error(
                        node,
                        'Requires sequence of booleans '
                        '("true", "1", "false", "0")')
            return values

        def gds_validate_datetime(self, input_data, node=None, input_name=''):
            return input_data

        def gds_format_datetime(self, input_data, input_name=''):
            if input_data.microsecond == 0:
                _svalue = '%04d-%02d-%02dT%02d:%02d:%02d' % (
                    input_data.year,
                    input_data.month,
                    input_data.day,
                    input_data.hour,
                    input_data.minute,
                    input_data.second,
                )
            else:
                _svalue = '%04d-%02d-%02dT%02d:%02d:%02d.%s' % (
                    input_data.year,
                    input_data.month,
                    input_data.day,
                    input_data.hour,
                    input_data.minute,
                    input_data.second,
                    ('%f' % (float(input_data.microsecond) / 1000000))[2:],
                )
            if input_data.tzinfo is not None:
                tzoff = input_data.tzinfo.utcoffset(input_data)
                if tzoff is not None:
                    total_seconds = tzoff.seconds + (86400 * tzoff.days)
                    if total_seconds == 0:
                        _svalue += 'Z'
                    else:
                        if total_seconds < 0:
                            _svalue += '-'
                            total_seconds *= -1
                        else:
                            _svalue += '+'
                        hours = total_seconds // 3600
                        minutes = (total_seconds - (hours * 3600)) // 60
                        _svalue += '{0:02d}:{1:02d}'.format(hours, minutes)
            return _svalue

        @classmethod
        def gds_parse_datetime(cls, input_data):
            tz = None
            if input_data[-1] == 'Z':
                tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')
                input_data = input_data[:-1]
            else:
                results = GeneratedsSuper.tzoff_pattern.search(input_data)
                if results is not None:
                    tzoff_parts = results.group(2).split(':')
                    tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])
                    if results.group(1) == '-':
                        tzoff *= -1
                    tz = GeneratedsSuper._FixedOffsetTZ(
                        tzoff, results.group(0))
                    input_data = input_data[:-6]
            time_parts = input_data.split('.')
            if len(time_parts) > 1:
                micro_seconds = int(float('0.' + time_parts[1]) * 1000000)
                input_data = '%s.%s' % (time_parts[0], micro_seconds,)
                dt = datetime_.datetime.strptime(
                    input_data, '%Y-%m-%dT%H:%M:%S.%f')
            else:
                dt = datetime_.datetime.strptime(
                    input_data, '%Y-%m-%dT%H:%M:%S')
            dt = dt.replace(tzinfo=tz)
            return dt

        def gds_validate_date(self, input_data, node=None, input_name=''):
            return input_data

        def gds_format_date(self, input_data, input_name=''):
            _svalue = '%04d-%02d-%02d' % (
                input_data.year,
                input_data.month,
                input_data.day,
            )
            try:
                if input_data.tzinfo is not None:
                    tzoff = input_data.tzinfo.utcoffset(input_data)
                    if tzoff is not None:
                        total_seconds = tzoff.seconds + (86400 * tzoff.days)
                        if total_seconds == 0:
                            _svalue += 'Z'
                        else:
                            if total_seconds < 0:
                                _svalue += '-'
                                total_seconds *= -1
                            else:
                                _svalue += '+'
                            hours = total_seconds // 3600
                            minutes = (total_seconds - (hours * 3600)) // 60
                            _svalue += '{0:02d}:{1:02d}'.format(
                                hours, minutes)
            except AttributeError:
                pass
            return _svalue

        @classmethod
        def gds_parse_date(cls, input_data):
            tz = None
            if input_data[-1] == 'Z':
                tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')
                input_data = input_data[:-1]
            else:
                results = GeneratedsSuper.tzoff_pattern.search(input_data)
                if results is not None:
                    tzoff_parts = results.group(2).split(':')
                    tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])
                    if results.group(1) == '-':
                        tzoff *= -1
                    tz = GeneratedsSuper._FixedOffsetTZ(
                        tzoff, results.group(0))
                    input_data = input_data[:-6]
            dt = datetime_.datetime.strptime(input_data, '%Y-%m-%d')
            dt = dt.replace(tzinfo=tz)
            return dt.date()

        def gds_validate_time(self, input_data, node=None, input_name=''):
            return input_data

        def gds_format_time(self, input_data, input_name=''):
            if input_data.microsecond == 0:
                _svalue = '%02d:%02d:%02d' % (
                    input_data.hour,
                    input_data.minute,
                    input_data.second,
                )
            else:
                _svalue = '%02d:%02d:%02d.%s' % (
                    input_data.hour,
                    input_data.minute,
                    input_data.second,
                    ('%f' % (float(input_data.microsecond) / 1000000))[2:],
                )
            if input_data.tzinfo is not None:
                tzoff = input_data.tzinfo.utcoffset(input_data)
                if tzoff is not None:
                    total_seconds = tzoff.seconds + (86400 * tzoff.days)
                    if total_seconds == 0:
                        _svalue += 'Z'
                    else:
                        if total_seconds < 0:
                            _svalue += '-'
                            total_seconds *= -1
                        else:
                            _svalue += '+'
                        hours = total_seconds // 3600
                        minutes = (total_seconds - (hours * 3600)) // 60
                        _svalue += '{0:02d}:{1:02d}'.format(hours, minutes)
            return _svalue

        def gds_validate_simple_patterns(self, patterns, target):
            # pat is a list of lists of strings/patterns.  We should:
            # - AND the outer elements
            # - OR the inner elements
            found1 = True
            for patterns1 in patterns:
                found2 = False
                for patterns2 in patterns1:
                    if re_.search(patterns2, target) is not None:
                        found2 = True
                        break
                if not found2:
                    found1 = False
                    break
            return found1

        @classmethod
        def gds_parse_time(cls, input_data):
            tz = None
            if input_data[-1] == 'Z':
                tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')
                input_data = input_data[:-1]
            else:
                results = GeneratedsSuper.tzoff_pattern.search(input_data)
                if results is not None:
                    tzoff_parts = results.group(2).split(':')
                    tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])
                    if results.group(1) == '-':
                        tzoff *= -1
                    tz = GeneratedsSuper._FixedOffsetTZ(
                        tzoff, results.group(0))
                    input_data = input_data[:-6]
            if len(input_data.split('.')) > 1:
                dt = datetime_.datetime.strptime(input_data, '%H:%M:%S.%f')
            else:
                dt = datetime_.datetime.strptime(input_data, '%H:%M:%S')
            dt = dt.replace(tzinfo=tz)
            return dt.time()

        def gds_str_lower(self, instring):
            return instring.lower()

        def get_path_(self, node):
            path_list = []
            self.get_path_list_(node, path_list)
            path_list.reverse()
            path = '/'.join(path_list)
            return path

        Tag_strip_pattern_ = re_.compile(r'\{.*\}')

        def get_path_list_(self, node, path_list):
            if node is None:
                return
            tag = GeneratedsSuper.Tag_strip_pattern_.sub('', node.tag)
            if tag:
                path_list.append(tag)
            self.get_path_list_(node.getparent(), path_list)

        def get_class_obj_(self, node, default_class=None):
            class_obj1 = default_class
            if 'xsi' in node.nsmap:
                classname = node.get('{%s}type' % node.nsmap['xsi'])
                if classname is not None:
                    names = classname.split(':')
                    if len(names) == 2:
                        classname = names[1]
                    class_obj2 = globals().get(classname)
                    if class_obj2 is not None:
                        class_obj1 = class_obj2
            return class_obj1

        def gds_build_any(self, node, type_name=None):
            return None

        @classmethod
        def gds_reverse_node_mapping(cls, mapping):
            return dict(((v, k) for k, v in mapping.iteritems()))

        @staticmethod
        def gds_encode(instring):
            if sys.version_info.major == 2:
                return instring.encode(ExternalEncoding)
            else:
                return instring


    def getSubclassFromModule_(module, class_):
        '''Get the subclass of a class from a specific module.'''
        name = class_.__name__ + 'Sub'
        if hasattr(module, name):
            return getattr(module, name)
        else:
            return None

ExternalEncoding = 'ascii'
Tag_pattern_ = re_.compile(r'({.*})?(.*)')
String_cleanup_pat_ = re_.compile(r"[\n\r\s]+")
Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)')
CDATA_pattern_ = re_.compile(r"<!\[CDATA\[.*?\]\]>", re_.DOTALL)

# Change this to redirect the generated superclass module to use a
# specific subclass module.
CurrentSubclassModule_ = None


#
# Support/utility functions.
#


def showIndent(outfile, level, pretty_print=True):
    if pretty_print:
        for idx in range(level):
            outfile.write('    ')


def quote_xml(inStr):
    "Escape markup chars, but do not modify CDATA sections."
    if not inStr:
        return ''
    s1 = (isinstance(inStr, BaseStrType_) and inStr or '%s' % inStr)
    s2 = ''
    pos = 0
    matchobjects = CDATA_pattern_.finditer(s1)
    for mo in matchobjects:
        s3 = s1[pos:mo.start()]
        s2 += quote_xml_aux(s3)
        s2 += s1[mo.start():mo.end()]
        pos = mo.end()
    s3 = s1[pos:]
    s2 += quote_xml_aux(s3)
    return s2


def quote_xml_aux(inStr):
    s1 = inStr.replace('&', '&amp;')
    s1 = s1.replace('<', '&lt;')
    s1 = s1.replace('>', '&gt;')
    return s1


def quote_attrib(inStr):
    s1 = (isinstance(inStr, BaseStrType_) and inStr or '%s' % inStr)
    s1 = s1.replace('&', '&amp;')
    s1 = s1.replace('<', '&lt;')
    s1 = s1.replace('>', '&gt;')
    if '"' in s1:
        if "'" in s1:
            s1 = '"%s"' % s1.replace('"', "&quot;")
        else:
            s1 = "'%s'" % s1
    else:
        s1 = '"%s"' % s1
    return s1


def quote_python(inStr):
    s1 = inStr
    if s1.find("'") == -1:
        if s1.find('\n') == -1:
            return "'%s'" % s1
        else:
            return "'''%s'''" % s1
    else:
        if s1.find('"') != -1:
            s1 = s1.replace('"', '\\"')
        if s1.find('\n') == -1:
            return '"%s"' % s1
        else:
            return '"""%s"""' % s1


def get_all_text_(node):
    if node.text is not None:
        text = node.text
    else:
        text = ''
    for child in node:
        if child.tail is not None:
            text += child.tail
    return text


def find_attr_value_(attr_name, node):
    attrs = node.attrib
    attr_parts = attr_name.split(':')
    value = None
    if len(attr_parts) == 1:
        value = attrs.get(attr_name)
    elif len(attr_parts) == 2:
        prefix, name = attr_parts
        namespace = node.nsmap.get(prefix)
        if namespace is not None:
            value = attrs.get('{%s}%s' % (namespace, name,))
    return value


class GDSParseError(Exception):
    pass


def raise_parse_error(node, msg):
    msg = '%s (element %s/line %d)' % (msg, node.tag, node.sourceline,)
    raise GDSParseError(msg)


class MixedContainer:
    # Constants for category:
    CategoryNone = 0
    CategoryText = 1
    CategorySimple = 2
    CategoryComplex = 3
    # Constants for content_type:
    TypeNone = 0
    TypeText = 1
    TypeString = 2
    TypeInteger = 3
    TypeFloat = 4
    TypeDecimal = 5
    TypeDouble = 6
    TypeBoolean = 7
    TypeBase64 = 8

    def __init__(self, category, content_type, name, value):
        self.category = category
        self.content_type = content_type
        self.name = name
        self.value = value

    def getCategory(self):
        return self.category

    def getContenttype(self, content_type):
        return self.content_type

    def getValue(self):
        return self.value

    def getName(self):
        return self.name

    def export(self, outfile, level, name, namespace, pretty_print=True):
        if self.category == MixedContainer.CategoryText:
            # Prevent exporting empty content as empty lines.
            if self.value.strip():
                outfile.write(self.value)
        elif self.category == MixedContainer.CategorySimple:
            self.exportSimple(outfile, level, name)
        else:  # category == MixedContainer.CategoryComplex
            self.value.export(outfile, level, namespace, name, pretty_print)

    def exportSimple(self, outfile, level, name):
        if self.content_type == MixedContainer.TypeString:
            outfile.write('<%s>%s</%s>' % (
                self.name, self.value, self.name))
        elif self.content_type == MixedContainer.TypeInteger or \
                        self.content_type == MixedContainer.TypeBoolean:
            outfile.write('<%s>%d</%s>' % (
                self.name, self.value, self.name))
        elif self.content_type == MixedContainer.TypeFloat or \
                        self.content_type == MixedContainer.TypeDecimal:
            outfile.write('<%s>%f</%s>' % (
                self.name, self.value, self.name))
        elif self.content_type == MixedContainer.TypeDouble:
            outfile.write('<%s>%g</%s>' % (
                self.name, self.value, self.name))
        elif self.content_type == MixedContainer.TypeBase64:
            outfile.write('<%s>%s</%s>' % (
                self.name, base64.b64encode(self.value), self.name))

    def to_etree(self, element):
        if self.category == MixedContainer.CategoryText:
            # Prevent exporting empty content as empty lines.
            if self.value.strip():
                if len(element) > 0:
                    if element[-1].tail is None:
                        element[-1].tail = self.value
                    else:
                        element[-1].tail += self.value
                else:
                    if element.text is None:
                        element.text = self.value
                    else:
                        element.text += self.value
        elif self.category == MixedContainer.CategorySimple:
            subelement = etree_.SubElement(element, '%s' % self.name)
            subelement.text = self.to_etree_simple()
        else:  # category == MixedContainer.CategoryComplex
            self.value.to_etree(element)

    def to_etree_simple(self):
        if self.content_type == MixedContainer.TypeString:
            text = self.value
        elif (self.content_type == MixedContainer.TypeInteger or
                      self.content_type == MixedContainer.TypeBoolean):
            text = '%d' % self.value
        elif (self.content_type == MixedContainer.TypeFloat or
                      self.content_type == MixedContainer.TypeDecimal):
            text = '%f' % self.value
        elif self.content_type == MixedContainer.TypeDouble:
            text = '%g' % self.value
        elif self.content_type == MixedContainer.TypeBase64:
            text = '%s' % base64.b64encode(self.value)
        return text

    def exportLiteral(self, outfile, level, name):
        if self.category == MixedContainer.CategoryText:
            showIndent(outfile, level)
            outfile.write(
                'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % (
                    self.category, self.content_type, self.name, self.value))
        elif self.category == MixedContainer.CategorySimple:
            showIndent(outfile, level)
            outfile.write(
                'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % (
                    self.category, self.content_type, self.name, self.value))
        else:  # category == MixedContainer.CategoryComplex
            showIndent(outfile, level)
            outfile.write(
                'model_.MixedContainer(%d, %d, "%s",\n' % (
                    self.category, self.content_type, self.name,))
            self.value.exportLiteral(outfile, level + 1)
            showIndent(outfile, level)
            outfile.write(')\n')


class MemberSpec_(object):
    def __init__(self, name='', data_type='', container=0):
        self.name = name
        self.data_type = data_type
        self.container = container

    def set_name(self, name):
        self.name = name

    def get_name(self):
        return self.name

    def set_data_type(self, data_type):
        self.data_type = data_type

    def get_data_type_chain(self):
        return self.data_type

    def get_data_type(self):
        if isinstance(self.data_type, list):
            if len(self.data_type) > 0:
                return self.data_type[-1]
            else:
                return 'xs:string'
        else:
            return self.data_type

    def set_container(self, container):
        self.container = container

    def get_container(self):
        return self.container


def _cast(typ, value):
    if typ is None or value is None:
        return value
    return typ(value)


#
# Data representation classes.
#


class F2bCobranca(GeneratedsSuper):
    subclass = None
    superclass = None

    def __init__(self, mensagem=None, sacador=None, cobranca=None, agendamento=None, sacado=None):
        self.original_tagname_ = None
        self.mensagem = mensagem
        self.sacador = sacador
        self.cobranca = cobranca
        self.agendamento = agendamento
        if sacado is None:
            self.sacado = []
        else:
            self.sacado = sacado

    def factory(*args_, **kwargs_):
        if CurrentSubclassModule_ is not None:
            subclass = getSubclassFromModule_(
                CurrentSubclassModule_, F2bCobranca)
            if subclass is not None:
                return subclass(*args_, **kwargs_)
        if F2bCobranca.subclass:
            return F2bCobranca.subclass(*args_, **kwargs_)
        else:
            return F2bCobranca(*args_, **kwargs_)

    factory = staticmethod(factory)

    def get_mensagem(self):
        return self.mensagem

    def set_mensagem(self, mensagem):
        self.mensagem = mensagem

    def get_sacador(self):
        return self.sacador

    def set_sacador(self, sacador):
        self.sacador = sacador

    def get_cobranca(self):
        return self.cobranca

    def set_cobranca(self, cobranca):
        self.cobranca = cobranca

    def get_agendamento(self):
        return self.agendamento

    def set_agendamento(self, agendamento):
        self.agendamento = agendamento

    def get_sacado(self):
        return self.sacado

    def set_sacado(self, sacado):
        self.sacado = sacado

    def add_sacado(self, value):
        self.sacado.append(value)

    def insert_sacado_at(self, index, value):
        self.sacado.insert(index, value)

    def replace_sacado_at(self, index, value):
        self.sacado[index] = value

    def hasContent_(self):
        if (
                                    self.mensagem is not None or
                                    self.sacador is not None or
                                self.cobranca is not None or
                            self.agendamento is not None or
                    self.sacado
        ):
            return True
        else:
            return False

    def export(self, outfile, level, namespace_='', name_='F2bCobranca', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))
        already_processed = set()
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='F2bCobranca')
        if self.hasContent_():
            outfile.write('>%s' % (eol_,))
            self.exportChildren(outfile, level + 1, namespace_='', name_='F2bCobranca', pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_,))

    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='F2bCobranca'):
        pass

    def exportChildren(self, outfile, level, namespace_='', name_='F2bCobranca', fromsubclass_=False,
                       pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.mensagem is not None:
            self.mensagem.export(outfile, level, namespace_, name_='mensagem', pretty_print=pretty_print)
        if self.sacador is not None:
            self.sacador.export(outfile, level, namespace_, name_='sacador', pretty_print=pretty_print)
        if self.cobranca is not None:
            self.cobranca.export(outfile, level, namespace_, name_='cobranca', pretty_print=pretty_print)
        if self.agendamento is not None:
            self.agendamento.export(outfile, level, namespace_, name_='agendamento', pretty_print=pretty_print)
        for sacado_ in self.sacado:
            sacado_.export(outfile, level, namespace_, name_='sacado', pretty_print=pretty_print)

    def build(self, node):
        already_processed = set()
        self.buildAttributes(node, node.attrib, already_processed)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
        return self

    def buildAttributes(self, node, attrs, already_processed):
        pass

    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'mensagem':
            obj_ = mensagem.factory()
            obj_.build(child_)
            self.mensagem = obj_
            obj_.original_tagname_ = 'mensagem'
        elif nodeName_ == 'sacador':
            obj_ = sacador.factory()
            obj_.build(child_)
            self.sacador = obj_
            obj_.original_tagname_ = 'sacador'
        elif nodeName_ == 'cobranca':
            obj_ = cobranca.factory()
            obj_.build(child_)
            self.cobranca = obj_
            obj_.original_tagname_ = 'cobranca'
        elif nodeName_ == 'agendamento':
            obj_ = agendamento.factory()
            obj_.build(child_)
            self.agendamento = obj_
            obj_.original_tagname_ = 'agendamento'
        elif nodeName_ == 'sacado':
            obj_ = sacado.factory()
            obj_.build(child_)
            self.sacado.append(obj_)
            obj_.original_tagname_ = 'sacado'


# end class F2bCobranca


class mensagem(GeneratedsSuper):
    subclass = None
    superclass = None

    def __init__(self, data=None, numero=None, tipo_ws=None):
        self.original_tagname_ = None
        if isinstance(data, BaseStrType_):
            initvalue_ = datetime_.datetime.strptime(data, '%Y-%m-%d').date()
        else:
            initvalue_ = data
        self.data = initvalue_
        self.numero = _cast(None, numero)
        self.tipo_ws = _cast(None, tipo_ws)

    def factory(*args_, **kwargs_):
        if CurrentSubclassModule_ is not None:
            subclass = getSubclassFromModule_(
                CurrentSubclassModule_, mensagem)
            if subclass is not None:
                return subclass(*args_, **kwargs_)
        if mensagem.subclass:
            return mensagem.subclass(*args_, **kwargs_)
        else:
            return mensagem(*args_, **kwargs_)

    factory = staticmethod(factory)

    def get_data(self):
        return self.data

    def set_data(self, data):
        self.data = data

    def get_numero(self):
        return self.numero

    def set_numero(self, numero):
        self.numero = numero

    def get_tipo_ws(self):
        return self.tipo_ws

    def set_tipo_ws(self, tipo_ws):
        self.tipo_ws = tipo_ws

    def hasContent_(self):
        if (

        ):
            return True
        else:
            return False

    def export(self, outfile, level, namespace_='', name_='mensagem', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))
        already_processed = set()
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='mensagem')
        if self.hasContent_():
            outfile.write('>%s' % (eol_,))
            self.exportChildren(outfile, level + 1, namespace_='', name_='mensagem', pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_,))

    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='mensagem'):
        if self.data is not None and 'data' not in already_processed:
            already_processed.add('data')
            outfile.write(' data="%s"' % self.gds_format_date(self.data, input_name='data'))
        if self.numero is not None and 'numero' not in already_processed:
            already_processed.add('numero')
            outfile.write(' numero=%s' %
                          (self.gds_encode(self.gds_format_string(quote_attrib(self.numero), input_name='numero')),))
        if self.tipo_ws is not None and 'tipo_ws' not in already_processed:
            already_processed.add('tipo_ws')
            outfile.write(' tipo_ws=%s' % (
                self.gds_encode(self.gds_format_string(quote_attrib(self.tipo_ws), input_name='tipo_ws')),))

    def exportChildren(self, outfile, level, namespace_='', name_='mensagem', fromsubclass_=False, pretty_print=True):
        pass

    def build(self, node):
        already_processed = set()
        self.buildAttributes(node, node.attrib, already_processed)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
        return self

    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('data', node)
        if value is not None and 'data' not in already_processed:
            already_processed.add('data')
            try:
                self.data = self.gds_parse_date(value)
            except ValueError as exp:
                raise ValueError('Bad date attribute (data): %s' % exp)
        value = find_attr_value_('numero', node)
        if value is not None and 'numero' not in already_processed:
            already_processed.add('numero')
            self.numero = value
        value = find_attr_value_('tipo_ws', node)
        if value is not None and 'tipo_ws' not in already_processed:
            already_processed.add('tipo_ws')
            self.tipo_ws = value

    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass


# end class mensagem


class sacador(GeneratedsSuper):
    subclass = None
    superclass = None

    def __init__(self, conta=None, valueOf_=None):
        self.original_tagname_ = None
        self.conta = _cast(None, conta)
        self.valueOf_ = valueOf_

    def factory(*args_, **kwargs_):
        if CurrentSubclassModule_ is not None:
            subclass = getSubclassFromModule_(
                CurrentSubclassModule_, sacador)
            if subclass is not None:
                return subclass(*args_, **kwargs_)
        if sacador.subclass:
            return sacador.subclass(*args_, **kwargs_)
        else:
            return sacador(*args_, **kwargs_)

    factory = staticmethod(factory)

    def get_conta(self):
        return self.conta

    def set_conta(self, conta):
        self.conta = conta

    def get_valueOf_(self):
        return self.valueOf_

    def set_valueOf_(self, valueOf_):
        self.valueOf_ = valueOf_

    def hasContent_(self):
        if (
                1 if type(self.valueOf_) in [int, float] else self.valueOf_
        ):
            return True
        else:
            return False

    def export(self, outfile, level, namespace_='', name_='sacador', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))
        already_processed = set()
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='sacador')
        if self.hasContent_():
            outfile.write('>')
            outfile.write(
                (quote_xml(self.valueOf_) if type(self.valueOf_) is str else self.gds_encode(str(self.valueOf_))))
            self.exportChildren(outfile, level + 1, namespace_='', name_='sacador', pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_,))

    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='sacador'):
        if self.conta is not None and 'conta' not in already_processed:
            already_processed.add('conta')
            outfile.write(
                ' conta=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.conta), input_name='conta')),))

    def exportChildren(self, outfile, level, namespace_='', name_='sacador', fromsubclass_=False, pretty_print=True):
        pass

    def build(self, node):
        already_processed = set()
        self.buildAttributes(node, node.attrib, already_processed)
        self.valueOf_ = get_all_text_(node)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
        return self

    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('conta', node)
        if value is not None and 'conta' not in already_processed:
            already_processed.add('conta')
            self.conta = value

    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass


# end class sacador


class cobranca(GeneratedsSuper):
    subclass = None
    superclass = None

    def __init__(self, valor=None, tipo_cobranca=None, num_document=None, cod_banco=None, taxa=None, tipo_taxa=None,
                 tipo_parcelamento=None, num_parcelas=None, demonstrativo=None, sacador_avalista=None, desconto=None,
                 multa=None):
        self.original_tagname_ = None
        self.valor = _cast(float, valor)
        self.tipo_cobranca = _cast(None, tipo_cobranca)
        self.num_document = _cast(int, num_document)
        self.cod_banco = _cast(None, cod_banco)
        self.taxa = _cast(float, taxa)
        self.tipo_taxa = _cast(int, tipo_taxa)
        self.tipo_parcelamento = _cast(None, tipo_parcelamento)
        self.num_parcelas = _cast(int, num_parcelas)
        if demonstrativo is None:
            self.demonstrativo = []
        else:
            self.demonstrativo = demonstrativo
        self.sacador_avalista = sacador_avalista
        self.desconto = desconto
        self.multa = multa

    def factory(*args_, **kwargs_):
        if CurrentSubclassModule_ is not None:
            subclass = getSubclassFromModule_(
                CurrentSubclassModule_, cobranca)
            if subclass is not None:
                return subclass(*args_, **kwargs_)
        if cobranca.subclass:
            return cobranca.subclass(*args_, **kwargs_)
        else:
            return cobranca(*args_, **kwargs_)

    factory = staticmethod(factory)

    def get_demonstrativo(self):
        return self.demonstrativo

    def set_demonstrativo(self, demonstrativo):
        self.demonstrativo = demonstrativo

    def add_demonstrativo(self, value):
        self.demonstrativo.append(value)

    def insert_demonstrativo_at(self, index, value):
        self.demonstrativo.insert(index, value)

    def replace_demonstrativo_at(self, index, value):
        self.demonstrativo[index] = value

    def get_sacador_avalista(self):
        return self.sacador_avalista

    def set_sacador_avalista(self, sacador_avalista):
        self.sacador_avalista = sacador_avalista

    def get_desconto(self):
        return self.desconto

    def set_desconto(self, desconto):
        self.desconto = desconto

    def get_multa(self):
        return self.multa

    def set_multa(self, multa):
        self.multa = multa

    def get_valor(self):
        return self.valor

    def set_valor(self, valor):
        self.valor = valor

    def get_tipo_cobranca(self):
        return self.tipo_cobranca

    def set_tipo_cobranca(self, tipo_cobranca):
        self.tipo_cobranca = tipo_cobranca

    def get_num_document(self):
        return self.num_document

    def set_num_document(self, num_document):
        self.num_document = num_document

    def get_cod_banco(self):
        return self.cod_banco

    def set_cod_banco(self, cod_banco):
        self.cod_banco = cod_banco

    def get_taxa(self):
        return self.taxa

    def set_taxa(self, taxa):
        self.taxa = taxa

    def get_tipo_taxa(self):
        return self.tipo_taxa

    def set_tipo_taxa(self, tipo_taxa):
        self.tipo_taxa = tipo_taxa

    def get_tipo_parcelamento(self):
        return self.tipo_parcelamento

    def set_tipo_parcelamento(self, tipo_parcelamento):
        self.tipo_parcelamento = tipo_parcelamento

    def get_num_parcelas(self):
        return self.num_parcelas

    def set_num_parcelas(self, num_parcelas):
        self.num_parcelas = num_parcelas

    def hasContent_(self):
        if (
                            self.demonstrativo or
                                self.sacador_avalista is not None or
                            self.desconto is not None or
                        self.multa is not None
        ):
            return True
        else:
            return False

    def export(self, outfile, level, namespace_='', name_='cobranca', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))
        already_processed = set()
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='cobranca')
        if self.hasContent_():
            outfile.write('>%s' % (eol_,))
            self.exportChildren(outfile, level + 1, namespace_='', name_='cobranca', pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_,))

    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='cobranca'):
        if self.valor is not None and 'valor' not in already_processed:
            already_processed.add('valor')
            outfile.write(' valor="%s"' % self.gds_format_float(self.valor, input_name='valor'))
        if self.tipo_cobranca is not None and 'tipo_cobranca' not in already_processed:
            already_processed.add('tipo_cobranca')
            outfile.write(' tipo_cobranca=%s' % (
                self.gds_encode(self.gds_format_string(quote_attrib(self.tipo_cobranca), input_name='tipo_cobranca')),))
        if self.num_document is not None and 'num_document' not in already_processed:
            already_processed.add('num_document')
            outfile.write(' num_document="%s"' % self.gds_format_integer(self.num_document, input_name='num_document'))
        if self.cod_banco is not None and 'cod_banco' not in already_processed:
            already_processed.add('cod_banco')
            outfile.write(' cod_banco=%s' % (
                self.gds_encode(self.gds_format_string(quote_attrib(self.cod_banco), input_name='cod_banco')),))
        if self.taxa is not None and 'taxa' not in already_processed:
            already_processed.add('taxa')
            outfile.write(' taxa="%s"' % self.gds_format_float(self.taxa, input_name='taxa'))
        if self.tipo_taxa is not None and 'tipo_taxa' not in already_processed:
            already_processed.add('tipo_taxa')
            outfile.write(' tipo_taxa="%s"' % self.gds_format_integer(self.tipo_taxa, input_name='tipo_taxa'))
        if self.tipo_parcelamento is not None and 'tipo_parcelamento' not in already_processed:
            already_processed.add('tipo_parcelamento')
            outfile.write(' tipo_parcelamento=%s' % (self.gds_encode(
                self.gds_format_string(quote_attrib(self.tipo_parcelamento), input_name='tipo_parcelamento')),))
        if self.num_parcelas is not None and 'num_parcelas' not in already_processed:
            already_processed.add('num_parcelas')
            outfile.write(' num_parcelas="%s"' % self.gds_format_integer(self.num_parcelas, input_name='num_parcelas'))

    def exportChildren(self, outfile, level, namespace_='', name_='cobranca', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for demonstrativo_ in self.demonstrativo:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sdemonstrativo>%s</%sdemonstrativo>%s' % (
                namespace_,
                self.gds_encode(self.gds_format_string(quote_xml(demonstrativo_), input_name='demonstrativo')),
                namespace_, eol_))
        if self.sacador_avalista is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%ssacador_avalista>%s</%ssacador_avalista>%s' % (namespace_, self.gds_encode(
                self.gds_format_string(quote_xml(self.sacador_avalista), input_name='sacador_avalista')), namespace_,
                                                                             eol_))
        if self.desconto is not None:
            self.desconto.export(outfile, level, namespace_, name_='desconto', pretty_print=pretty_print)
        if self.multa is not None:
            self.multa.export(outfile, level, namespace_, name_='multa', pretty_print=pretty_print)

    def build(self, node):
        already_processed = set()
        self.buildAttributes(node, node.attrib, already_processed)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
        return self

    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('valor', node)
        if value is not None and 'valor' not in already_processed:
            already_processed.add('valor')
            try:
                self.valor = float(value)
            except ValueError as exp:
                raise ValueError('Bad float/double attribute (valor): %s' % exp)
        value = find_attr_value_('tipo_cobranca', node)
        if value is not None and 'tipo_cobranca' not in already_processed:
            already_processed.add('tipo_cobranca')
            self.tipo_cobranca = value
        value = find_attr_value_('num_document', node)
        if value is not None and 'num_document' not in already_processed:
            already_processed.add('num_document')
            try:
                self.num_document = int(value)
            except ValueError as exp:
                raise_parse_error(node, 'Bad integer attribute: %s' % exp)
        value = find_attr_value_('cod_banco', node)
        if value is not None and 'cod_banco' not in already_processed:
            already_processed.add('cod_banco')
            self.cod_banco = value
        value = find_attr_value_('taxa', node)
        if value is not None and 'taxa' not in already_processed:
            already_processed.add('taxa')
            try:
                self.taxa = float(value)
            except ValueError as exp:
                raise ValueError('Bad float/double attribute (taxa): %s' % exp)
        value = find_attr_value_('tipo_taxa', node)
        if value is not None and 'tipo_taxa' not in already_processed:
            already_processed.add('tipo_taxa')
            try:
                self.tipo_taxa = int(value)
            except ValueError as exp:
                raise_parse_error(node, 'Bad integer attribute: %s' % exp)
        value = find_attr_value_('tipo_parcelamento', node)
        if value is not None and 'tipo_parcelamento' not in already_processed:
            already_processed.add('tipo_parcelamento')
            self.tipo_parcelamento = value
        value = find_attr_value_('num_parcelas', node)
        if value is not None and 'num_parcelas' not in already_processed:
            already_processed.add('num_parcelas')
            try:
                self.num_parcelas = int(value)
            except ValueError as exp:
                raise_parse_error(node, 'Bad integer attribute: %s' % exp)

    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'demonstrativo':
            demonstrativo_ = child_.text
            demonstrativo_ = self.gds_validate_string(demonstrativo_, node, 'demonstrativo')
            self.demonstrativo.append(demonstrativo_)
        elif nodeName_ == 'sacador_avalista':
            sacador_avalista_ = child_.text
            sacador_avalista_ = self.gds_validate_string(sacador_avalista_, node, 'sacador_avalista')
            self.sacador_avalista = sacador_avalista_
        elif nodeName_ == 'desconto':
            obj_ = desconto.factory()
            obj_.build(child_)
            self.desconto = obj_
            obj_.original_tagname_ = 'desconto'
        elif nodeName_ == 'multa':
            obj_ = multa.factory()
            obj_.build(child_)
            self.multa = obj_
            obj_.original_tagname_ = 'multa'


# end class cobranca


class desconto(GeneratedsSuper):
    subclass = None
    superclass = None

    def __init__(self, valor=None, tipo_desconto=None, antecedencia=None):
        self.original_tagname_ = None
        self.valor = _cast(float, valor)
        self.tipo_desconto = _cast(int, tipo_desconto)
        self.antecedencia = _cast(int, antecedencia)

    def factory(*args_, **kwargs_):
        if CurrentSubclassModule_ is not None:
            subclass = getSubclassFromModule_(
                CurrentSubclassModule_, desconto)
            if subclass is not None:
                return subclass(*args_, **kwargs_)
        if desconto.subclass:
            return desconto.subclass(*args_, **kwargs_)
        else:
            return desconto(*args_, **kwargs_)

    factory = staticmethod(factory)

    def get_valor(self):
        return self.valor

    def set_valor(self, valor):
        self.valor = valor

    def get_tipo_desconto(self):
        return self.tipo_desconto

    def set_tipo_desconto(self, tipo_desconto):
        self.tipo_desconto = tipo_desconto

    def get_antecedencia(self):
        return self.antecedencia

    def set_antecedencia(self, antecedencia):
        self.antecedencia = antecedencia

    def hasContent_(self):
        if (

        ):
            return True
        else:
            return False

    def export(self, outfile, level, namespace_='', name_='desconto', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))
        already_processed = set()
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='desconto')
        if self.hasContent_():
            outfile.write('>%s' % (eol_,))
            self.exportChildren(outfile, level + 1, namespace_='', name_='desconto', pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_,))

    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='desconto'):
        if self.valor is not None and 'valor' not in already_processed:
            already_processed.add('valor')
            outfile.write(' valor="%s"' % self.gds_format_float(self.valor, input_name='valor'))
        if self.tipo_desconto is not None and 'tipo_desconto' not in already_processed:
            already_processed.add('tipo_desconto')
            outfile.write(
                ' tipo_desconto="%s"' % self.gds_format_integer(self.tipo_desconto, input_name='tipo_desconto'))
        if self.antecedencia is not None and 'antecedencia' not in already_processed:
            already_processed.add('antecedencia')
            outfile.write(' antecedencia="%s"' % self.gds_format_integer(self.antecedencia, input_name='antecedencia'))

    def exportChildren(self, outfile, level, namespace_='', name_='desconto', fromsubclass_=False, pretty_print=True):
        pass

    def build(self, node):
        already_processed = set()
        self.buildAttributes(node, node.attrib, already_processed)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
        return self

    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('valor', node)
        if value is not None and 'valor' not in already_processed:
            already_processed.add('valor')
            try:
                self.valor = float(value)
            except ValueError as exp:
                raise ValueError('Bad float/double attribute (valor): %s' % exp)
        value = find_attr_value_('tipo_desconto', node)
        if value is not None and 'tipo_desconto' not in already_processed:
            already_processed.add('tipo_desconto')
            try:
                self.tipo_desconto = int(value)
            except ValueError as exp:
                raise_parse_error(node, 'Bad integer attribute: %s' % exp)
        value = find_attr_value_('antecedencia', node)
        if value is not None and 'antecedencia' not in already_processed:
            already_processed.add('antecedencia')
            try:
                self.antecedencia = int(value)
            except ValueError as exp:
                raise_parse_error(node, 'Bad integer attribute: %s' % exp)

    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass


# end class desconto


class multa(GeneratedsSuper):
    subclass = None
    superclass = None

    def __init__(self, valor=None, tipo_multa=None, valor_dia=None, tipo_multa_dia=None, atraso=None):
        self.original_tagname_ = None
        self.valor = _cast(float, valor)
        self.tipo_multa = _cast(int, tipo_multa)
        self.valor_dia = _cast(float, valor_dia)
        self.tipo_multa_dia = _cast(int, tipo_multa_dia)
        self.atraso = _cast(int, atraso)

    def factory(*args_, **kwargs_):
        if CurrentSubclassModule_ is not None:
            subclass = getSubclassFromModule_(
                CurrentSubclassModule_, multa)
            if subclass is not None:
                return subclass(*args_, **kwargs_)
        if multa.subclass:
            return multa.subclass(*args_, **kwargs_)
        else:
            return multa(*args_, **kwargs_)

    factory = staticmethod(factory)

    def get_valor(self):
        return self.valor

    def set_valor(self, valor):
        self.valor = valor

    def get_tipo_multa(self):
        return self.tipo_multa

    def set_tipo_multa(self, tipo_multa):
        self.tipo_multa = tipo_multa

    def get_valor_dia(self):
        return self.valor_dia

    def set_valor_dia(self, valor_dia):
        self.valor_dia = valor_dia

    def get_tipo_multa_dia(self):
        return self.tipo_multa_dia

    def set_tipo_multa_dia(self, tipo_multa_dia):
        self.tipo_multa_dia = tipo_multa_dia

    def get_atraso(self):
        return self.atraso

    def set_atraso(self, atraso):
        self.atraso = atraso

    def hasContent_(self):
        if (

        ):
            return True
        else:
            return False

    def export(self, outfile, level, namespace_='', name_='multa', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))
        already_processed = set()
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='multa')
        if self.hasContent_():
            outfile.write('>%s' % (eol_,))
            self.exportChildren(outfile, level + 1, namespace_='', name_='multa', pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_,))

    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='multa'):
        if self.valor is not None and 'valor' not in already_processed:
            already_processed.add('valor')
            outfile.write(' valor="%s"' % self.gds_format_float(self.valor, input_name='valor'))
        if self.tipo_multa is not None and 'tipo_multa' not in already_processed:
            already_processed.add('tipo_multa')
            outfile.write(' tipo_multa="%s"' % self.gds_format_integer(self.tipo_multa, input_name='tipo_multa'))
        if self.valor_dia is not None and 'valor_dia' not in already_processed:
            already_processed.add('valor_dia')
            outfile.write(' valor_dia="%s"' % self.gds_format_float(self.valor_dia, input_name='valor_dia'))
        if self.tipo_multa_dia is not None and 'tipo_multa_dia' not in already_processed:
            already_processed.add('tipo_multa_dia')
            outfile.write(
                ' tipo_multa_dia="%s"' % self.gds_format_integer(self.tipo_multa_dia, input_name='tipo_multa_dia'))
        if self.atraso is not None and 'atraso' not in already_processed:
            already_processed.add('atraso')
            outfile.write(' atraso="%s"' % self.gds_format_integer(self.atraso, input_name='atraso'))

    def exportChildren(self, outfile, level, namespace_='', name_='multa', fromsubclass_=False, pretty_print=True):
        pass

    def build(self, node):
        already_processed = set()
        self.buildAttributes(node, node.attrib, already_processed)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
        return self

    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('valor', node)
        if value is not None and 'valor' not in already_processed:
            already_processed.add('valor')
            try:
                self.valor = float(value)
            except ValueError as exp:
                raise ValueError('Bad float/double attribute (valor): %s' % exp)
        value = find_attr_value_('tipo_multa', node)
        if value is not None and 'tipo_multa' not in already_processed:
            already_processed.add('tipo_multa')
            try:
                self.tipo_multa = int(value)
            except ValueError as exp:
                raise_parse_error(node, 'Bad integer attribute: %s' % exp)
        value = find_attr_value_('valor_dia', node)
        if value is not None and 'valor_dia' not in already_processed:
            already_processed.add('valor_dia')
            try:
                self.valor_dia = float(value)
            except ValueError as exp:
                raise ValueError('Bad float/double attribute (valor_dia): %s' % exp)
        value = find_attr_value_('tipo_multa_dia', node)
        if value is not None and 'tipo_multa_dia' not in already_processed:
            already_processed.add('tipo_multa_dia')
            try:
                self.tipo_multa_dia = int(value)
            except ValueError as exp:
                raise_parse_error(node, 'Bad integer attribute: %s' % exp)
        value = find_attr_value_('atraso', node)
        if value is not None and 'atraso' not in already_processed:
            already_processed.add('atraso')
            try:
                self.atraso = int(value)
            except ValueError as exp:
                raise_parse_error(node, 'Bad integer attribute: %s' % exp)

    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass


# end class multa


class agendamento(GeneratedsSuper):
    subclass = None
    superclass = None

    def __init__(self, vencimento=None, ultimo_dia=None, antecedencia=None, periodicidade=None, periodos=None,
                 sem_vencimento=None, carne=None, valueOf_=None):
        self.original_tagname_ = None
        if isinstance(vencimento, BaseStrType_):
            initvalue_ = datetime_.datetime.strptime(vencimento, '%Y-%m-%d').date()
        else:
            initvalue_ = vencimento
        self.vencimento = initvalue_
        self.ultimo_dia = _cast(None, ultimo_dia)
        self.antecedencia = _cast(int, antecedencia)
        self.periodicidade = _cast(int, periodicidade)
        self.periodos = _cast(int, periodos)
        self.sem_vencimento = _cast(None, sem_vencimento)
        self.carne = _cast(None, carne)
        self.valueOf_ = valueOf_

    def factory(*args_, **kwargs_):
        if CurrentSubclassModule_ is not None:
            subclass = getSubclassFromModule_(
                CurrentSubclassModule_, agendamento)
            if subclass is not None:
                return subclass(*args_, **kwargs_)
        if agendamento.subclass:
            return agendamento.subclass(*args_, **kwargs_)
        else:
            return agendamento(*args_, **kwargs_)

    factory = staticmethod(factory)

    def get_vencimento(self):
        return self.vencimento

    def set_vencimento(self, vencimento):
        self.vencimento = vencimento

    def get_ultimo_dia(self):
        return self.ultimo_dia

    def set_ultimo_dia(self, ultimo_dia):
        self.ultimo_dia = ultimo_dia

    def get_antecedencia(self):
        return self.antecedencia

    def set_antecedencia(self, antecedencia):
        self.antecedencia = antecedencia

    def get_periodicidade(self):
        return self.periodicidade

    def set_periodicidade(self, periodicidade):
        self.periodicidade = periodicidade

    def get_periodos(self):
        return self.periodos

    def set_periodos(self, periodos):
        self.periodos = periodos

    def get_sem_vencimento(self):
        return self.sem_vencimento

    def set_sem_vencimento(self, sem_vencimento):
        self.sem_vencimento = sem_vencimento

    def get_carne(self):
        return self.carne

    def set_carne(self, carne):
        self.carne = carne

    def get_valueOf_(self):
        return self.valueOf_

    def set_valueOf_(self, valueOf_):
        self.valueOf_ = valueOf_

    def hasContent_(self):
        if (
                1 if type(self.valueOf_) in [int, float] else self.valueOf_
        ):
            return True
        else:
            return False

    def export(self, outfile, level, namespace_='', name_='agendamento', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))
        already_processed = set()
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='agendamento')
        if self.hasContent_():
            outfile.write('>')
            outfile.write(
                (quote_xml(self.valueOf_) if type(self.valueOf_) is str else self.gds_encode(str(self.valueOf_))))
            self.exportChildren(outfile, level + 1, namespace_='', name_='agendamento', pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_,))

    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='agendamento'):
        if self.vencimento is not None and 'vencimento' not in already_processed:
            already_processed.add('vencimento')
            outfile.write(' vencimento="%s"' % self.gds_format_date(self.vencimento, input_name='vencimento'))
        if self.ultimo_dia is not None and 'ultimo_dia' not in already_processed:
            already_processed.add('ultimo_dia')
            outfile.write(' ultimo_dia=%s' % (
                self.gds_encode(self.gds_format_string(quote_attrib(self.ultimo_dia), input_name='ultimo_dia')),))
        if self.antecedencia is not None and 'antecedencia' not in already_processed:
            already_processed.add('antecedencia')
            outfile.write(' antecedencia="%s"' % self.gds_format_integer(self.antecedencia, input_name='antecedencia'))
        if self.periodicidade is not None and 'periodicidade' not in already_processed:
            already_processed.add('periodicidade')
            outfile.write(
                ' periodicidade="%s"' % self.gds_format_integer(self.periodicidade, input_name='periodicidade'))
        if self.periodos is not None and 'periodos' not in already_processed:
            already_processed.add('periodos')
            outfile.write(' periodos="%s"' % self.gds_format_integer(self.periodos, input_name='periodos'))
        if self.sem_vencimento is not None and 'sem_vencimento' not in already_processed:
            already_processed.add('sem_vencimento')
            outfile.write(' sem_vencimento=%s' % (
                self.gds_encode(
                    self.gds_format_string(quote_attrib(self.sem_vencimento), input_name='sem_vencimento')),))
        if self.carne is not None and 'carne' not in already_processed:
            already_processed.add('carne')
            outfile.write(
                ' carne=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.carne), input_name='carne')),))

    def exportChildren(self, outfile, level, namespace_='', name_='agendamento', fromsubclass_=False,
                       pretty_print=True):
        pass

    def build(self, node):
        already_processed = set()
        self.buildAttributes(node, node.attrib, already_processed)
        self.valueOf_ = get_all_text_(node)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
        return self

    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('vencimento', node)
        if value is not None and 'vencimento' not in already_processed:
            already_processed.add('vencimento')
            try:
                self.vencimento = self.gds_parse_date(value)
            except ValueError as exp:
                raise ValueError('Bad date attribute (vencimento): %s' % exp)
        value = find_attr_value_('ultimo_dia', node)
        if value is not None and 'ultimo_dia' not in already_processed:
            already_processed.add('ultimo_dia')
            self.ultimo_dia = value
        value = find_attr_value_('antecedencia', node)
        if value is not None and 'antecedencia' not in already_processed:
            already_processed.add('antecedencia')
            try:
                self.antecedencia = int(value)
            except ValueError as exp:
                raise_parse_error(node, 'Bad integer attribute: %s' % exp)
        value = find_attr_value_('periodicidade', node)
        if value is not None and 'periodicidade' not in already_processed:
            already_processed.add('periodicidade')
            try:
                self.periodicidade = int(value)
            except ValueError as exp:
                raise_parse_error(node, 'Bad integer attribute: %s' % exp)
        value = find_attr_value_('periodos', node)
        if value is not None and 'periodos' not in already_processed:
            already_processed.add('periodos')
            try:
                self.periodos = int(value)
            except ValueError as exp:
                raise_parse_error(node, 'Bad integer attribute: %s' % exp)
        value = find_attr_value_('sem_vencimento', node)
        if value is not None and 'sem_vencimento' not in already_processed:
            already_processed.add('sem_vencimento')
            self.sem_vencimento = value
        value = find_attr_value_('carne', node)
        if value is not None and 'carne' not in already_processed:
            already_processed.add('carne')
            self.carne = value

    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass


# end class agendamento


class sacado(GeneratedsSuper):
    subclass = None
    superclass = None

    def __init__(self, grupo=None, codigo=None, envio=None, atualizar=None, servicos=None, nome=None, email=None,
                 endereco=None, telefone=None, telefone_com=None, telefone_cel=None, cpf=None, cnpj=None,
                 observacao=None):
        self.original_tagname_ = None
        self.grupo = _cast(None, grupo)
        self.codigo = _cast(None, codigo)
        self.envio = _cast(None, envio)
        self.atualizar = _cast(None, atualizar)
        self.servicos = _cast(None, servicos)
        self.nome = nome
        if email is None:
            self.email = []
        else:
            self.email = email
        self.endereco = endereco
        self.telefone = telefone
        self.telefone_com = telefone_com
        self.telefone_cel = telefone_cel
        self.cpf = cpf
        self.cnpj = cnpj
        self.observacao = observacao

    def factory(*args_, **kwargs_):
        if CurrentSubclassModule_ is not None:
            subclass = getSubclassFromModule_(
                CurrentSubclassModule_, sacado)
            if subclass is not None:
                return subclass(*args_, **kwargs_)
        if sacado.subclass:
            return sacado.subclass(*args_, **kwargs_)
        else:
            return sacado(*args_, **kwargs_)

    factory = staticmethod(factory)

    def get_nome(self):
        return self.nome

    def set_nome(self, nome):
        self.nome = nome

    def get_email(self):
        return self.email

    def set_email(self, email):
        self.email = email

    def add_email(self, value):
        self.email.append(value)

    def insert_email_at(self, index, value):
        self.email.insert(index, value)

    def replace_email_at(self, index, value):
        self.email[index] = value

    def get_endereco(self):
        return self.endereco

    def set_endereco(self, endereco):
        self.endereco = endereco

    def get_telefone(self):
        return self.telefone

    def set_telefone(self, telefone):
        self.telefone = telefone

    def get_telefone_com(self):
        return self.telefone_com

    def set_telefone_com(self, telefone_com):
        self.telefone_com = telefone_com

    def get_telefone_cel(self):
        return self.telefone_cel

    def set_telefone_cel(self, telefone_cel):
        self.telefone_cel = telefone_cel

    def get_cpf(self):
        return self.cpf

    def set_cpf(self, cpf):
        self.cpf = cpf

    def get_cnpj(self):
        return self.cnpj

    def set_cnpj(self, cnpj):
        self.cnpj = cnpj

    def get_observacao(self):
        return self.observacao

    def set_observacao(self, observacao):
        self.observacao = observacao

    def get_grupo(self):
        return self.grupo

    def set_grupo(self, grupo):
        self.grupo = grupo

    def get_codigo(self):
        return self.codigo

    def set_codigo(self, codigo):
        self.codigo = codigo

    def get_envio(self):
        return self.envio

    def set_envio(self, envio):
        self.envio = envio

    def get_atualizar(self):
        return self.atualizar

    def set_atualizar(self, atualizar):
        self.atualizar = atualizar

    def get_servicos(self):
        return self.servicos

    def set_servicos(self, servicos):
        self.servicos = servicos

    def hasContent_(self):
        if (
                                                    self.nome is not None or
                                                self.email or
                                                self.endereco is not None or
                                            self.telefone is not None or
                                        self.telefone_com is not None or
                                    self.telefone_cel is not None or
                                self.cpf is not None or
                            self.cnpj is not None or
                        self.observacao is not None
        ):
            return True
        else:
            return False

    def export(self, outfile, level, namespace_='', name_='sacado', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))
        already_processed = set()
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='sacado')
        if self.hasContent_():
            outfile.write('>%s' % (eol_,))
            self.exportChildren(outfile, level + 1, namespace_='', name_='sacado', pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_,))

    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='sacado'):
        if self.grupo is not None and 'grupo' not in already_processed:
            already_processed.add('grupo')
            outfile.write(
                ' grupo=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.grupo), input_name='grupo')),))
        if self.codigo is not None and 'codigo' not in already_processed:
            already_processed.add('codigo')
            outfile.write(' codigo=%s' % (
                self.gds_encode(self.gds_format_string(quote_attrib(self.codigo), input_name='codigo')),))
        if self.envio is not None and 'envio' not in already_processed:
            already_processed.add('envio')
            outfile.write(
                ' envio=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.envio), input_name='envio')),))
        if self.atualizar is not None and 'atualizar' not in already_processed:
            already_processed.add('atualizar')
            outfile.write(' atualizar=%s' % (
                self.gds_encode(self.gds_format_string(quote_attrib(self.atualizar), input_name='atualizar')),))
        if self.servicos is not None and 'servicos' not in already_processed:
            already_processed.add('servicos')
            outfile.write(' servicos=%s' % (
                self.gds_encode(self.gds_format_string(quote_attrib(self.servicos), input_name='servicos')),))

    def exportChildren(self, outfile, level, namespace_='', name_='sacado', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.nome is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%snome>%s</%snome>%s' % (
                namespace_, self.gds_encode(self.gds_format_string(quote_xml(self.nome), input_name='nome')),
                namespace_,
                eol_))
        for email_ in self.email:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%semail>%s</%semail>%s' % (
                namespace_, self.gds_encode(self.gds_format_string(quote_xml(email_), input_name='email')), namespace_,
                eol_))
        if self.endereco is not None:
            self.endereco.export(outfile, level, namespace_, name_='endereco', pretty_print=pretty_print)
        if self.telefone is not None:
            self.telefone.export(outfile, level, namespace_, name_='telefone', pretty_print=pretty_print)
        if self.telefone_com is not None:
            self.telefone_com.export(outfile, level, namespace_, name_='telefone_com', pretty_print=pretty_print)
        if self.telefone_cel is not None:
            self.telefone_cel.export(outfile, level, namespace_, name_='telefone_cel', pretty_print=pretty_print)
        if self.cpf is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%scpf>%s</%scpf>%s' % (
                namespace_, self.gds_encode(self.gds_format_string(quote_xml(self.cpf), input_name='cpf')), namespace_,
                eol_))
        if self.cnpj is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%scnpj>%s</%scnpj>%s' % (
                namespace_, self.gds_encode(self.gds_format_string(quote_xml(self.cnpj), input_name='cnpj')),
                namespace_,
                eol_))
        if self.observacao is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sobservacao>%s</%sobservacao>%s' % (
                namespace_,
                self.gds_encode(self.gds_format_string(quote_xml(self.observacao), input_name='observacao')),
                namespace_, eol_))

    def build(self, node):
        already_processed = set()
        self.buildAttributes(node, node.attrib, already_processed)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
        return self

    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('grupo', node)
        if value is not None and 'grupo' not in already_processed:
            already_processed.add('grupo')
            self.grupo = value
        value = find_attr_value_('codigo', node)
        if value is not None and 'codigo' not in already_processed:
            already_processed.add('codigo')
            self.codigo = value
        value = find_attr_value_('envio', node)
        if value is not None and 'envio' not in already_processed:
            already_processed.add('envio')
            self.envio = value
        value = find_attr_value_('atualizar', node)
        if value is not None and 'atualizar' not in already_processed:
            already_processed.add('atualizar')
            self.atualizar = value
        value = find_attr_value_('servicos', node)
        if value is not None and 'servicos' not in already_processed:
            already_processed.add('servicos')
            self.servicos = value

    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'nome':
            nome_ = child_.text
            nome_ = self.gds_validate_string(nome_, node, 'nome')
            self.nome = nome_
        elif nodeName_ == 'email':
            email_ = child_.text
            email_ = self.gds_validate_string(email_, node, 'email')
            self.email.append(email_)
        elif nodeName_ == 'endereco':
            obj_ = endereco.factory()
            obj_.build(child_)
            self.endereco = obj_
            obj_.original_tagname_ = 'endereco'
        elif nodeName_ == 'telefone':
            obj_ = telefone.factory()
            obj_.build(child_)
            self.telefone = obj_
            obj_.original_tagname_ = 'telefone'
        elif nodeName_ == 'telefone_com':
            obj_ = telefone_com.factory()
            obj_.build(child_)
            self.telefone_com = obj_
            obj_.original_tagname_ = 'telefone_com'
        elif nodeName_ == 'telefone_cel':
            obj_ = telefone_cel.factory()
            obj_.build(child_)
            self.telefone_cel = obj_
            obj_.original_tagname_ = 'telefone_cel'
        elif nodeName_ == 'cpf':
            cpf_ = child_.text
            cpf_ = self.gds_validate_string(cpf_, node, 'cpf')
            self.cpf = cpf_
        elif nodeName_ == 'cnpj':
            cnpj_ = child_.text
            cnpj_ = self.gds_validate_string(cnpj_, node, 'cnpj')
            self.cnpj = cnpj_
        elif nodeName_ == 'observacao':
            observacao_ = child_.text
            observacao_ = self.gds_validate_string(observacao_, node, 'observacao')
            self.observacao = observacao_


# end class sacado


class endereco(GeneratedsSuper):
    subclass = None
    superclass = None

    def __init__(self, logradouro=None, numero=None, complemento=None, bairro=None, cidade=None, estado=None, cep=None):
        self.original_tagname_ = None
        self.logradouro = _cast(None, logradouro)
        self.numero = _cast(None, numero)
        self.complemento = _cast(None, complemento)
        self.bairro = _cast(None, bairro)
        self.cidade = _cast(None, cidade)
        self.estado = _cast(None, estado)
        self.cep = _cast(None, cep)

    def factory(*args_, **kwargs_):
        if CurrentSubclassModule_ is not None:
            subclass = getSubclassFromModule_(
                CurrentSubclassModule_, endereco)
            if subclass is not None:
                return subclass(*args_, **kwargs_)
        if endereco.subclass:
            return endereco.subclass(*args_, **kwargs_)
        else:
            return endereco(*args_, **kwargs_)

    factory = staticmethod(factory)

    def get_logradouro(self):
        return self.logradouro

    def set_logradouro(self, logradouro):
        self.logradouro = logradouro

    def get_numero(self):
        return self.numero

    def set_numero(self, numero):
        self.numero = numero

    def get_complemento(self):
        return self.complemento

    def set_complemento(self, complemento):
        self.complemento = complemento

    def get_bairro(self):
        return self.bairro

    def set_bairro(self, bairro):
        self.bairro = bairro

    def get_cidade(self):
        return self.cidade

    def set_cidade(self, cidade):
        self.cidade = cidade

    def get_estado(self):
        return self.estado

    def set_estado(self, estado):
        self.estado = estado

    def get_cep(self):
        return self.cep

    def set_cep(self, cep):
        self.cep = cep

    def hasContent_(self):
        if (

        ):
            return True
        else:
            return False

    def export(self, outfile, level, namespace_='', name_='endereco', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))
        already_processed = set()
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='endereco')
        if self.hasContent_():
            outfile.write('>%s' % (eol_,))
            self.exportChildren(outfile, level + 1, namespace_='', name_='endereco', pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_,))

    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='endereco'):
        if self.logradouro is not None and 'logradouro' not in already_processed:
            already_processed.add('logradouro')
            outfile.write(' logradouro=%s' % (
                self.gds_encode(self.gds_format_string(quote_attrib(self.logradouro), input_name='logradouro')),))
        if self.numero is not None and 'numero' not in already_processed:
            already_processed.add('numero')
            outfile.write(' numero=%s' % (
                self.gds_encode(self.gds_format_string(quote_attrib(self.numero), input_name='numero')),))
        if self.complemento is not None and 'complemento' not in already_processed:
            already_processed.add('complemento')
            outfile.write(' complemento=%s' % (
                self.gds_encode(self.gds_format_string(quote_attrib(self.complemento), input_name='complemento')),))
        if self.bairro is not None and 'bairro' not in already_processed:
            already_processed.add('bairro')
            outfile.write(' bairro=%s' % (
                self.gds_encode(self.gds_format_string(quote_attrib(self.bairro), input_name='bairro')),))
        if self.cidade is not None and 'cidade' not in already_processed:
            already_processed.add('cidade')
            outfile.write(' cidade=%s' % (
                self.gds_encode(self.gds_format_string(quote_attrib(self.cidade), input_name='cidade')),))
        if self.estado is not None and 'estado' not in already_processed:
            already_processed.add('estado')
            outfile.write(' estado=%s' % (
                self.gds_encode(self.gds_format_string(quote_attrib(self.estado), input_name='estado')),))
        if self.cep is not None and 'cep' not in already_processed:
            already_processed.add('cep')
            outfile.write(
                ' cep=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.cep), input_name='cep')),))

    def exportChildren(self, outfile, level, namespace_='', name_='endereco', fromsubclass_=False, pretty_print=True):
        pass

    def build(self, node):
        already_processed = set()
        self.buildAttributes(node, node.attrib, already_processed)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
        return self

    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('logradouro', node)
        if value is not None and 'logradouro' not in already_processed:
            already_processed.add('logradouro')
            self.logradouro = value
        value = find_attr_value_('numero', node)
        if value is not None and 'numero' not in already_processed:
            already_processed.add('numero')
            self.numero = value
        value = find_attr_value_('complemento', node)
        if value is not None and 'complemento' not in already_processed:
            already_processed.add('complemento')
            self.complemento = value
        value = find_attr_value_('bairro', node)
        if value is not None and 'bairro' not in already_processed:
            already_processed.add('bairro')
            self.bairro = value
        value = find_attr_value_('cidade', node)
        if value is not None and 'cidade' not in already_processed:
            already_processed.add('cidade')
            self.cidade = value
        value = find_attr_value_('estado', node)
        if value is not None and 'estado' not in already_processed:
            already_processed.add('estado')
            self.estado = value
        value = find_attr_value_('cep', node)
        if value is not None and 'cep' not in already_processed:
            already_processed.add('cep')
            self.cep = value

    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass


# end class endereco


class telefone(GeneratedsSuper):
    subclass = None
    superclass = None

    def __init__(self, ddd=None, numero=None):
        self.original_tagname_ = None
        self.ddd = _cast(int, ddd)
        self.numero = _cast(int, numero)

    def factory(*args_, **kwargs_):
        if CurrentSubclassModule_ is not None:
            subclass = getSubclassFromModule_(
                CurrentSubclassModule_, telefone)
            if subclass is not None:
                return subclass(*args_, **kwargs_)
        if telefone.subclass:
            return telefone.subclass(*args_, **kwargs_)
        else:
            return telefone(*args_, **kwargs_)

    factory = staticmethod(factory)

    def get_ddd(self):
        return self.ddd

    def set_ddd(self, ddd):
        self.ddd = ddd

    def get_numero(self):
        return self.numero

    def set_numero(self, numero):
        self.numero = numero

    def hasContent_(self):
        if (

        ):
            return True
        else:
            return False

    def export(self, outfile, level, namespace_='', name_='telefone', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))
        already_processed = set()
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='telefone')
        if self.hasContent_():
            outfile.write('>%s' % (eol_,))
            self.exportChildren(outfile, level + 1, namespace_='', name_='telefone', pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_,))

    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='telefone'):
        if self.ddd is not None and 'ddd' not in already_processed:
            already_processed.add('ddd')
            outfile.write(' ddd="%s"' % self.gds_format_integer(self.ddd, input_name='ddd'))
        if self.numero is not None and 'numero' not in already_processed:
            already_processed.add('numero')
            outfile.write(' numero="%s"' % self.gds_format_integer(self.numero, input_name='numero'))

    def exportChildren(self, outfile, level, namespace_='', name_='telefone', fromsubclass_=False, pretty_print=True):
        pass

    def build(self, node):
        already_processed = set()
        self.buildAttributes(node, node.attrib, already_processed)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
        return self

    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('ddd', node)
        if value is not None and 'ddd' not in already_processed:
            already_processed.add('ddd')
            try:
                self.ddd = int(value)
            except ValueError as exp:
                raise_parse_error(node, 'Bad integer attribute: %s' % exp)
        value = find_attr_value_('numero', node)
        if value is not None and 'numero' not in already_processed:
            already_processed.add('numero')
            try:
                self.numero = int(value)
            except ValueError as exp:
                raise_parse_error(node, 'Bad integer attribute: %s' % exp)

    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass


# end class telefone


class telefone_com(GeneratedsSuper):
    subclass = None
    superclass = None

    def __init__(self, ddd_com=None, numero_com=None):
        self.original_tagname_ = None
        self.ddd_com = _cast(int, ddd_com)
        self.numero_com = _cast(int, numero_com)

    def factory(*args_, **kwargs_):
        if CurrentSubclassModule_ is not None:
            subclass = getSubclassFromModule_(
                CurrentSubclassModule_, telefone_com)
            if subclass is not None:
                return subclass(*args_, **kwargs_)
        if telefone_com.subclass:
            return telefone_com.subclass(*args_, **kwargs_)
        else:
            return telefone_com(*args_, **kwargs_)

    factory = staticmethod(factory)

    def get_ddd_com(self):
        return self.ddd_com

    def set_ddd_com(self, ddd_com):
        self.ddd_com = ddd_com

    def get_numero_com(self):
        return self.numero_com

    def set_numero_com(self, numero_com):
        self.numero_com = numero_com

    def hasContent_(self):
        if (

        ):
            return True
        else:
            return False

    def export(self, outfile, level, namespace_='', name_='telefone_com', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))
        already_processed = set()
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='telefone_com')
        if self.hasContent_():
            outfile.write('>%s' % (eol_,))
            self.exportChildren(outfile, level + 1, namespace_='', name_='telefone_com', pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_,))

    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='telefone_com'):
        if self.ddd_com is not None and 'ddd_com' not in already_processed:
            already_processed.add('ddd_com')
            outfile.write(' ddd_com="%s"' % self.gds_format_integer(self.ddd_com, input_name='ddd_com'))
        if self.numero_com is not None and 'numero_com' not in already_processed:
            already_processed.add('numero_com')
            outfile.write(' numero_com="%s"' % self.gds_format_integer(self.numero_com, input_name='numero_com'))

    def exportChildren(self, outfile, level, namespace_='', name_='telefone_com', fromsubclass_=False,
                       pretty_print=True):
        pass

    def build(self, node):
        already_processed = set()
        self.buildAttributes(node, node.attrib, already_processed)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
        return self

    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('ddd_com', node)
        if value is not None and 'ddd_com' not in already_processed:
            already_processed.add('ddd_com')
            try:
                self.ddd_com = int(value)
            except ValueError as exp:
                raise_parse_error(node, 'Bad integer attribute: %s' % exp)
        value = find_attr_value_('numero_com', node)
        if value is not None and 'numero_com' not in already_processed:
            already_processed.add('numero_com')
            try:
                self.numero_com = int(value)
            except ValueError as exp:
                raise_parse_error(node, 'Bad integer attribute: %s' % exp)

    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass


# end class telefone_com


class telefone_cel(GeneratedsSuper):
    subclass = None
    superclass = None

    def __init__(self, ddd_cel=None, numero_cel=None):
        self.original_tagname_ = None
        self.ddd_cel = _cast(int, ddd_cel)
        self.numero_cel = _cast(int, numero_cel)

    def factory(*args_, **kwargs_):
        if CurrentSubclassModule_ is not None:
            subclass = getSubclassFromModule_(
                CurrentSubclassModule_, telefone_cel)
            if subclass is not None:
                return subclass(*args_, **kwargs_)
        if telefone_cel.subclass:
            return telefone_cel.subclass(*args_, **kwargs_)
        else:
            return telefone_cel(*args_, **kwargs_)

    factory = staticmethod(factory)

    def get_ddd_cel(self):
        return self.ddd_cel

    def set_ddd_cel(self, ddd_cel):
        self.ddd_cel = ddd_cel

    def get_numero_cel(self):
        return self.numero_cel

    def set_numero_cel(self, numero_cel):
        self.numero_cel = numero_cel

    def hasContent_(self):
        if (

        ):
            return True
        else:
            return False

    def export(self, outfile, level, namespace_='', name_='telefone_cel', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))
        already_processed = set()
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='telefone_cel')
        if self.hasContent_():
            outfile.write('>%s' % (eol_,))
            self.exportChildren(outfile, level + 1, namespace_='', name_='telefone_cel', pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_,))

    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='telefone_cel'):
        if self.ddd_cel is not None and 'ddd_cel' not in already_processed:
            already_processed.add('ddd_cel')
            outfile.write(' ddd_cel="%s"' % self.gds_format_integer(self.ddd_cel, input_name='ddd_cel'))
        if self.numero_cel is not None and 'numero_cel' not in already_processed:
            already_processed.add('numero_cel')
            outfile.write(' numero_cel="%s"' % self.gds_format_integer(self.numero_cel, input_name='numero_cel'))

    def exportChildren(self, outfile, level, namespace_='', name_='telefone_cel', fromsubclass_=False,
                       pretty_print=True):
        pass

    def build(self, node):
        already_processed = set()
        self.buildAttributes(node, node.attrib, already_processed)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
        return self

    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('ddd_cel', node)
        if value is not None and 'ddd_cel' not in already_processed:
            already_processed.add('ddd_cel')
            try:
                self.ddd_cel = int(value)
            except ValueError as exp:
                raise_parse_error(node, 'Bad integer attribute: %s' % exp)
        value = find_attr_value_('numero_cel', node)
        if value is not None and 'numero_cel' not in already_processed:
            already_processed.add('numero_cel')
            try:
                self.numero_cel = int(value)
            except ValueError as exp:
                raise_parse_error(node, 'Bad integer attribute: %s' % exp)

    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass


# end class telefone_cel


class F2bCobrancaRetorno(GeneratedsSuper):
    subclass = None
    superclass = None

    def __init__(self, sacado=None, agendamento=None, cobranca=None, carne=None, log=None):
        self.original_tagname_ = None
        if sacado is None:
            self.sacado = []
        else:
            self.sacado = sacado
        self.agendamento = agendamento
        if cobranca is None:
            self.cobranca = []
        else:
            self.cobranca = cobranca
        if carne is None:
            self.carne = []
        else:
            self.carne = carne
        self.log = log

    def factory(*args_, **kwargs_):
        if CurrentSubclassModule_ is not None:
            subclass = getSubclassFromModule_(
                CurrentSubclassModule_, F2bCobrancaRetorno)
            if subclass is not None:
                return subclass(*args_, **kwargs_)
        if F2bCobrancaRetorno.subclass:
            return F2bCobrancaRetorno.subclass(*args_, **kwargs_)
        else:
            return F2bCobrancaRetorno(*args_, **kwargs_)

    factory = staticmethod(factory)

    def get_sacado(self):
        return self.sacado

    def set_sacado(self, sacado):
        self.sacado = sacado

    def add_sacado(self, value):
        self.sacado.append(value)

    def insert_sacado_at(self, index, value):
        self.sacado.insert(index, value)

    def replace_sacado_at(self, index, value):
        self.sacado[index] = value

    def get_agendamento(self):
        return self.agendamento

    def set_agendamento(self, agendamento):
        self.agendamento = agendamento

    def get_cobranca(self):
        return self.cobranca

    def set_cobranca(self, cobranca):
        self.cobranca = cobranca

    def add_cobranca(self, value):
        self.cobranca.append(value)

    def insert_cobranca_at(self, index, value):
        self.cobranca.insert(index, value)

    def replace_cobranca_at(self, index, value):
        self.cobranca[index] = value

    def get_carne(self):
        return self.carne

    def set_carne(self, carne):
        self.carne = carne

    def add_carne(self, value):
        self.carne.append(value)

    def insert_carne_at(self, index, value):
        self.carne.insert(index, value)

    def replace_carne_at(self, index, value):
        self.carne[index] = value

    def get_log(self):
        return self.log

    def set_log(self, log):
        self.log = log

    def hasContent_(self):
        if (
                                self.sacado or
                                    self.agendamento is not None or
                            self.cobranca or
                        self.carne or
                        self.log is not None
        ):
            return True
        else:
            return False

    def export(self, outfile, level, namespace_='', name_='F2bCobrancaRetorno', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))
        already_processed = set()
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='F2bCobrancaRetorno')
        if self.hasContent_():
            outfile.write('>%s' % (eol_,))
            self.exportChildren(outfile, level + 1, namespace_='', name_='F2bCobrancaRetorno',
                                pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_,))

    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='F2bCobrancaRetorno'):
        pass

    def exportChildren(self, outfile, level, namespace_='', name_='F2bCobrancaRetorno', fromsubclass_=False,
                       pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for sacado_ in self.sacado:
            sacado_.export(outfile, level, namespace_, name_='sacado', pretty_print=pretty_print)
        if self.agendamento is not None:
            self.agendamento.export(outfile, level, namespace_, name_='agendamento', pretty_print=pretty_print)
        for cobranca_ in self.cobranca:
            cobranca_.export(outfile, level, namespace_, name_='cobranca', pretty_print=pretty_print)
        for carne_ in self.carne:
            carne_.export(outfile, level, namespace_, name_='carne', pretty_print=pretty_print)
        if self.log is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%slog>%s</%slog>%s' % (
                namespace_, self.gds_encode(self.gds_format_string(quote_xml(self.log), input_name='log')), namespace_,
                eol_))

    def build(self, node):
        already_processed = set()
        self.buildAttributes(node, node.attrib, already_processed)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
        return self

    def buildAttributes(self, node, attrs, already_processed):
        pass

    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'sacado':
            obj_ = sacado.factory()
            obj_.build(child_)
            self.sacado.append(obj_)
            obj_.original_tagname_ = 'sacado'
        elif nodeName_ == 'agendamento':
            obj_ = agendamento.factory()
            obj_.build(child_)
            self.agendamento = obj_
            obj_.original_tagname_ = 'agendamento'
        elif nodeName_ == 'cobranca':
            obj_ = cobranca.factory()
            obj_.build(child_)
            self.cobranca.append(obj_)
            obj_.original_tagname_ = 'cobranca'
        elif nodeName_ == 'carne':
            obj_ = carne.factory()
            obj_.build(child_)
            self.carne.append(obj_)
            obj_.original_tagname_ = 'carne'
        elif nodeName_ == 'log':
            log_ = child_.text
            log_ = self.gds_validate_string(log_, node, 'log')
            self.log = log_


# end class F2bCobrancaRetorno


class carne(GeneratedsSuper):
    subclass = None
    superclass = None

    def __init__(self, numero=None, url=None):
        self.original_tagname_ = None
        self.numero = _cast(int, numero)
        self.url = url

    def factory(*args_, **kwargs_):
        if CurrentSubclassModule_ is not None:
            subclass = getSubclassFromModule_(
                CurrentSubclassModule_, carne)
            if subclass is not None:
                return subclass(*args_, **kwargs_)
        if carne.subclass:
            return carne.subclass(*args_, **kwargs_)
        else:
            return carne(*args_, **kwargs_)

    factory = staticmethod(factory)

    def get_url(self):
        return self.url

    def set_url(self, url):
        self.url = url

    def get_numero(self):
        return self.numero

    def set_numero(self, numero):
        self.numero = numero

    def hasContent_(self):
        if (
                    self.url is not None
        ):
            return True
        else:
            return False

    def export(self, outfile, level, namespace_='', name_='carne', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '',))
        already_processed = set()
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='carne')
        if self.hasContent_():
            outfile.write('>%s' % (eol_,))
            self.exportChildren(outfile, level + 1, namespace_='', name_='carne', pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_,))

    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='carne'):
        if self.numero is not None and 'numero' not in already_processed:
            already_processed.add('numero')
            outfile.write(' numero="%s"' % self.gds_format_integer(self.numero, input_name='numero'))

    def exportChildren(self, outfile, level, namespace_='', name_='carne', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.url is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%surl>%s</%surl>%s' % (
                namespace_, self.gds_encode(self.gds_format_string(quote_xml(self.url), input_name='url')), namespace_,
                eol_))

    def build(self, node):
        already_processed = set()
        self.buildAttributes(node, node.attrib, already_processed)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
        return self

    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('numero', node)
        if value is not None and 'numero' not in already_processed:
            already_processed.add('numero')
            try:
                self.numero = int(value)
            except ValueError as exp:
                raise_parse_error(node, 'Bad integer attribute: %s' % exp)

    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'url':
            url_ = child_.text
            url_ = self.gds_validate_string(url_, node, 'url')
            self.url = url_


# end class carne


GDSClassesMapping = {
}

USAGE_TEXT = """
Usage: python <Parser>.py [ -s ] <in_xml_file>
"""


def usage():
    print(USAGE_TEXT)
    sys.exit(1)


def get_root_tag(node):
    tag = Tag_pattern_.match(node.tag).groups()[-1]
    rootClass = GDSClassesMapping.get(tag)
    if rootClass is None:
        rootClass = globals().get(tag)
    return tag, rootClass


def parse(inFileName, silence=False):
    parser = None
    doc = parsexml_(inFileName, parser)
    rootNode = doc.getroot()
    rootTag, rootClass = get_root_tag(rootNode)
    if rootClass is None:
        rootTag = 'F2bCobranca'
        rootClass = F2bCobranca
    rootObj = rootClass.factory()
    rootObj.build(rootNode)
    # Enable Python to collect the space used by the DOM.
    doc = None
    if not silence:
        sys.stdout.write('<?xml version="1.0" ?>\n')
        rootObj.export(
            sys.stdout, 0, name_=rootTag,
            namespacedef_='',
            pretty_print=True)
    return rootObj


def parseEtree(inFileName, silence=False):
    parser = None
    doc = parsexml_(inFileName, parser)
    rootNode = doc.getroot()
    rootTag, rootClass = get_root_tag(rootNode)
    if rootClass is None:
        rootTag = 'F2bCobranca'
        rootClass = F2bCobranca
    rootObj = rootClass.factory()
    rootObj.build(rootNode)
    # Enable Python to collect the space used by the DOM.
    doc = None
    mapping = {}
    rootElement = rootObj.to_etree(None, name_=rootTag, mapping_=mapping)
    reverse_mapping = rootObj.gds_reverse_node_mapping(mapping)
    if not silence:
        content = etree_.tostring(
            rootElement, pretty_print=True,
            xml_declaration=True, encoding="utf-8")
        sys.stdout.write(content)
        sys.stdout.write('\n')
    return rootObj, rootElement, mapping, reverse_mapping


def parseString(inString, silence=False):
    from StringIO import StringIO
    parser = None
    doc = parsexml_(StringIO(inString), parser)
    rootNode = doc.getroot()
    rootTag, rootClass = get_root_tag(rootNode)
    if rootClass is None:
        rootTag = 'F2bCobranca'
        rootClass = F2bCobranca
    rootObj = rootClass.factory()
    rootObj.build(rootNode)
    # Enable Python to collect the space used by the DOM.
    doc = None
    if not silence:
        sys.stdout.write('<?xml version="1.0" ?>\n')
        rootObj.export(
            sys.stdout, 0, name_=rootTag,
            namespacedef_='')
    return rootObj


def parseLiteral(inFileName, silence=False):
    parser = None
    doc = parsexml_(inFileName, parser)
    rootNode = doc.getroot()
    rootTag, rootClass = get_root_tag(rootNode)
    if rootClass is None:
        rootTag = 'F2bCobranca'
        rootClass = F2bCobranca
    rootObj = rootClass.factory()
    rootObj.build(rootNode)
    # Enable Python to collect the space used by the DOM.
    doc = None
    if not silence:
        sys.stdout.write('#from WSBilling import *\n\n')
        sys.stdout.write('import WSBilling as model_\n\n')
        sys.stdout.write('rootObj = model_.rootClass(\n')
        rootObj.exportLiteral(sys.stdout, 0, name_=rootTag)
        sys.stdout.write(')\n')
    return rootObj


def main():
    args = sys.argv[1:]
    if len(args) == 1:
        parse(args[0])
    else:
        usage()


if __name__ == '__main__':
    # import pdb; pdb.set_trace()
    main()

__all__ = [
    "F2bCobranca",
    "F2bCobrancaRetorno",
    "agendamento",
    "carne",
    "cobranca",
    "desconto",
    "endereco",
    "mensagem",
    "multa",
    "sacado",
    "sacador",
    "telefone",
    "telefone_cel",
    "telefone_com"
]
