#!/usr/bin/env python
# -*- coding: utf-8 -*- 

#
# Generated Wed Nov 14 13:00:00 2012 by generateDS.py version 2.7c.
#

import sys
import getopt
import re as re_

import cybox.bindings.cybox_core_1_0 as cybox_core_binding
import cybox.bindings.cybox_common_types_1_0 as cybox_common_binding
import stix.bindings.iodef.iodef_1_0 as iodef_binding
import stix.bindings.oasis.xal as xal_binding
import stix.bindings.stix_indicator_1_1 as stix_indicator_binding
import stix.bindings.stix_common_0_2 as stix_common_binding
import stix.bindings.stix_ttp_0_6 as stix_ttp_binding
#import stix.bindings.stix_threat_actor_0_5_1 as stix_threat_actor_binding # deferred
import stix.bindings.stix_coa_0_3_1 as stix_coa_binding
import stix.bindings.data_marking_0_5 as data_marking_binding

etree_ = None
Verbose_import_ = False
(   XMLParser_import_none, XMLParser_import_lxml,
    XMLParser_import_elementtree
    ) = range(3)
XMLParser_import_library = None
try:
    # lxml
    from lxml import etree as etree_
    XMLParser_import_library = XMLParser_import_lxml
    if Verbose_import_:
        print("running with lxml.etree")
except ImportError:
    try:
        # cElementTree from Python 2.5+
        import xml.etree.cElementTree as etree_
        XMLParser_import_library = XMLParser_import_elementtree
        if Verbose_import_:
            print("running with cElementTree on Python 2.5+")
    except ImportError:
        try:
            # ElementTree from Python 2.5+
            import xml.etree.ElementTree as etree_
            XMLParser_import_library = XMLParser_import_elementtree
            if Verbose_import_:
                print("running with ElementTree on Python 2.5+")
        except ImportError:
            try:
                # normal cElementTree install
                import cElementTree as etree_
                XMLParser_import_library = XMLParser_import_elementtree
                if Verbose_import_:
                    print("running with cElementTree")
            except ImportError:
                try:
                    # normal ElementTree install
                    import elementtree.ElementTree as etree_
                    XMLParser_import_library = XMLParser_import_elementtree
                    if Verbose_import_:
                        print("running with ElementTree")
                except ImportError:
                    raise ImportError("Failed to import ElementTree from any known place")

def parsexml_(*args, **kwargs):
    if (XMLParser_import_library == XMLParser_import_lxml and
        'parser' not in kwargs):
        # Use the lxml ElementTree compatible parser so that, e.g.,
        #   we ignore comments.
        kwargs['parser'] = etree_.ETCompatXMLParser()
    doc = etree_.parse(*args, **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, exp:

    class GeneratedsSuper(object):
        def gds_format_string(self, input_data, input_name=''):
            return input_data
        def gds_validate_string(self, input_data, node, 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, input_name=''):
            return input_data
        def gds_format_integer_list(self, input_data, input_name=''):
            return '%s' % input_data
        def gds_validate_integer_list(self, input_data, node, input_name=''):
            values = input_data.split()
            for value in values:
                try:
                    fvalue = float(value)
                except (TypeError, ValueError), exp:
                    raise_parse_error(node, 'Requires sequence of integers')
            return input_data
        def gds_format_float(self, input_data, input_name=''):
            return '%f' % input_data
        def gds_validate_float(self, input_data, node, input_name=''):
            return input_data
        def gds_format_float_list(self, input_data, input_name=''):
            return '%s' % input_data
        def gds_validate_float_list(self, input_data, node, input_name=''):
            values = input_data.split()
            for value in values:
                try:
                    fvalue = float(value)
                except (TypeError, ValueError), exp:
                    raise_parse_error(node, 'Requires sequence of floats')
            return input_data
        def gds_format_double(self, input_data, input_name=''):
            return '%e' % input_data
        def gds_validate_double(self, input_data, node, input_name=''):
            return input_data
        def gds_format_double_list(self, input_data, input_name=''):
            return '%s' % input_data
        def gds_validate_double_list(self, input_data, node, input_name=''):
            values = input_data.split()
            for value in values:
                try:
                    fvalue = float(value)
                except (TypeError, ValueError), exp:
                    raise_parse_error(node, 'Requires sequence of doubles')
            return input_data
        def gds_format_boolean(self, input_data, input_name=''):
            return '%s' % input_data
        def gds_validate_boolean(self, input_data, node, input_name=''):
            return input_data
        def gds_format_boolean_list(self, input_data, input_name=''):
            return '%s' % input_data
        def gds_validate_boolean_list(self, input_data, node, 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 input_data
        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


#
# If you have installed IPython you can uncomment and use the following.
# IPython is available from http://ipython.scipy.org/.
#

## from IPython.Shell import IPShellEmbed
## args = ''
## ipshell = IPShellEmbed(args,
##     banner = 'Dropping into IPython',
##     exit_msg = 'Leaving Interpreter, back to program.')

# Then use the following line where and when you want to drop into the
# IPython shell:
#    ipshell('<some message> -- Entering ipshell.\nHit Ctrl-D to exit')

#
# Globals
#

ExternalEncoding = 'ascii'
Tag_pattern_ = re_.compile(r'({.*})?(.*)')
String_cleanup_pat_ = re_.compile(r"[\n\r\s]+")
Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)')

#
# Support/utility functions.
#

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

def quote_xml(inStr):
    if not inStr:
        return ''
    s1 = (isinstance(inStr, basestring) and inStr or
          '%s' % inStr)
    s1 = s1.replace('&', '&amp;')
    s1 = s1.replace('<', '&lt;')
    s1 = s1.replace('>', '&gt;')
    return s1

def quote_attrib(inStr):
    s1 = (isinstance(inStr, basestring) 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):
    if XMLParser_import_library == XMLParser_import_lxml:
        msg = '%s (element %s/line %d)' % (msg, node.tag, node.sourceline, )
    else:
        msg = '%s (element %s)' % (msg, node.tag, )
    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
    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))
    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 IncidentType(GeneratedsSuper):
    """The IncidentType characterizes a single cyber threat
    Incident.Specifies a globally unique identifier for this cyber
    threat Incident.Specifies a globally unique identifier for a
    cyber threat Incident specified elsewhere.Specifies the relevant
    STIX-Incident schema version for this content.Specifies a URL
    referencing the location for the Incident
    specification.Specifies knowledge of whether the Incident
    involved a compromise of security properties."""
    subclass = None
    superclass = None
    def __init__(self, URL=None, security_compromise=None, idref=None, id=None, version=None, Time=None, Description=None, Reporter=None, Responder=None, Coordinator=None, Victim=None, AffectedAssets=None, ImpactAssessment=None, RelatedIndicators=None, LeveragedTTPs=None, RelatedThreatActors=None, Intent=None, DiscoveryMethod=None, RelatedIncidents=None, COARequested=None, COATaken=None, Confidence=None, Contact=None, History=None):
        self.URL = _cast(None, URL)
        self.security_compromise = _cast(None, security_compromise)
        self.idref = _cast(None, idref)
        self.id = _cast(None, id)
        self.version = _cast(None, version)
        self.Time = Time
        self.Description = Description
        self.Reporter = Reporter
        if Responder is None:
            self.Responder = []
        else:
            self.Responder = Responder
        if Coordinator is None:
            self.Coordinator = []
        else:
            self.Coordinator = Coordinator
        if Victim is None:
            self.Victim = []
        else:
            self.Victim = Victim
        self.AffectedAssets = AffectedAssets
        self.ImpactAssessment = ImpactAssessment
        self.RelatedIndicators = RelatedIndicators
        self.LeveragedTTPs = LeveragedTTPs
        self.RelatedThreatActors = RelatedThreatActors
        self.Intent = Intent
        if DiscoveryMethod is None:
            self.DiscoveryMethod = []
        else:
            self.DiscoveryMethod = DiscoveryMethod
        self.RelatedIncidents = RelatedIncidents
        self.COARequested = COARequested
        self.COATaken = COATaken
        self.Confidence = Confidence
        if Contact is None:
            self.Contact = []
        else:
            self.Contact = Contact
        self.History = History
    def factory(*args_, **kwargs_):
        if IncidentType.subclass:
            return IncidentType.subclass(*args_, **kwargs_)
        else:
            return IncidentType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_Time(self): return self.Time
    def set_Time(self, Time): self.Time = Time
    def get_Description(self): return self.Description
    def set_Description(self, Description): self.Description = Description
    def get_Reporter(self): return self.Reporter
    def set_Reporter(self, Reporter): self.Reporter = Reporter
    def get_Responder(self): return self.Responder
    def set_Responder(self, Responder): self.Responder = Responder
    def add_Responder(self, value): self.Responder.append(value)
    def insert_Responder(self, index, value): self.Responder[index] = value
    def get_Coordinator(self): return self.Coordinator
    def set_Coordinator(self, Coordinator): self.Coordinator = Coordinator
    def add_Coordinator(self, value): self.Coordinator.append(value)
    def insert_Coordinator(self, index, value): self.Coordinator[index] = value
    def get_Victim(self): return self.Victim
    def set_Victim(self, Victim): self.Victim = Victim
    def add_Victim(self, value): self.Victim.append(value)
    def insert_Victim(self, index, value): self.Victim[index] = value
    def get_AffectedAssets(self): return self.AffectedAssets
    def set_AffectedAssets(self, AffectedAssets): self.AffectedAssets = AffectedAssets
    def get_ImpactAssessment(self): return self.ImpactAssessment
    def set_ImpactAssessment(self, ImpactAssessment): self.ImpactAssessment = ImpactAssessment
    def get_RelatedIndicators(self): return self.RelatedIndicators
    def set_RelatedIndicators(self, RelatedIndicators): self.RelatedIndicators = RelatedIndicators
    def get_LeveragedTTPs(self): return self.LeveragedTTPs
    def set_LeveragedTTPs(self, LeveragedTTPs): self.LeveragedTTPs = LeveragedTTPs
    def get_RelatedThreatActors(self): return self.RelatedThreatActors
    def set_RelatedThreatActors(self, RelatedThreatActors): self.RelatedThreatActors = RelatedThreatActors
    def get_Intent(self): return self.Intent
    def set_Intent(self, Intent): self.Intent = Intent
    def get_DiscoveryMethod(self): return self.DiscoveryMethod
    def set_DiscoveryMethod(self, DiscoveryMethod): self.DiscoveryMethod = DiscoveryMethod
    def add_DiscoveryMethod(self, value): self.DiscoveryMethod.append(value)
    def insert_DiscoveryMethod(self, index, value): self.DiscoveryMethod[index] = value
    def get_RelatedIncidents(self): return self.RelatedIncidents
    def set_RelatedIncidents(self, RelatedIncidents): self.RelatedIncidents = RelatedIncidents
    def get_COARequested(self): return self.COARequested
    def set_COARequested(self, COARequested): self.COARequested = COARequested
    def get_COATaken(self): return self.COATaken
    def set_COATaken(self, COATaken): self.COATaken = COATaken
    def get_Confidence(self): return self.Confidence
    def set_Confidence(self, Confidence): self.Confidence = Confidence
    def get_Contact(self): return self.Contact
    def set_Contact(self, Contact): self.Contact = Contact
    def add_Contact(self, value): self.Contact.append(value)
    def insert_Contact(self, index, value): self.Contact[index] = value
    def get_History(self): return self.History
    def set_History(self, History): self.History = History
    def get_URL(self): return self.URL
    def set_URL(self, URL): self.URL = URL
    def get_security_compromise(self): return self.security_compromise
    def set_security_compromise(self, security_compromise): self.security_compromise = security_compromise
    def get_idref(self): return self.idref
    def set_idref(self, idref): self.idref = idref
    def get_id(self): return self.id
    def set_id(self, id): self.id = id
    def get_version(self): return self.version
    def set_version(self, version): self.version = version
    def export(self, outfile, level, namespace_='incident:', name_='IncidentType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='IncidentType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='IncidentType'):
        if self.URL is not None and 'URL' not in already_processed:
            already_processed.append('URL')
            outfile.write(' URL=%s' % (self.gds_format_string(quote_attrib(self.URL).encode(ExternalEncoding), input_name='URL'), ))
        if self.security_compromise is not None and 'security_compromise' not in already_processed:
            already_processed.append('security_compromise')
            outfile.write(' security_compromise=%s' % (quote_attrib(self.security_compromise), ))
        if self.idref is not None and 'idref' not in already_processed:
            already_processed.append('idref')
            outfile.write(' idref=%s' % (quote_attrib(self.idref), ))
        if self.id is not None and 'id' not in already_processed:
            already_processed.append('id')
            outfile.write(' id=%s' % (quote_attrib(self.id), ))
        if self.version is not None and 'version' not in already_processed:
            already_processed.append('version')
            outfile.write(' version=%s' % (self.gds_format_string(quote_attrib(self.version).encode(ExternalEncoding), input_name='version'), ))
    def exportChildren(self, outfile, level, namespace_='incident:', name_='IncidentType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.Time is not None:
            self.Time.export(outfile, level, 'incident:', name_='Time', pretty_print=pretty_print)
        if self.Description is not None:
            self.Description.export(outfile, level, 'incident:', name_='Description', pretty_print=pretty_print)
        if self.Reporter is not None:
            self.Reporter.export(outfile, level, 'incident:', name_='Reporter', pretty_print=pretty_print)
        for Responder_ in self.Responder:
            Responder_.export(outfile, level, 'incident:', name_='Responder', pretty_print=pretty_print)
        for Coordinator_ in self.Coordinator:
            Coordinator_.export(outfile, level, 'incident:', name_='Coordinator', pretty_print=pretty_print)
        for Victim_ in self.Victim:
            Victim_.export(outfile, level, 'incident:', name_='Victim', pretty_print=pretty_print)
        if self.AffectedAssets is not None:
            self.AffectedAssets.export(outfile, level, 'incident:', name_='AffectedAssets', pretty_print=pretty_print)
        if self.ImpactAssessment is not None:
            self.ImpactAssessment.export(outfile, level, 'incident:', name_='ImpactAssessment', pretty_print=pretty_print)
        if self.RelatedIndicators is not None:
            self.RelatedIndicators.export(outfile, level, 'incident:', name_='RelatedIndicators', pretty_print=pretty_print)
        if self.LeveragedTTPs is not None:
            self.LeveragedTTPs.export(outfile, level, 'incident:', name_='LeveragedTTPs', pretty_print=pretty_print)
        if self.RelatedThreatActors is not None:
            self.RelatedThreatActors.export(outfile, level, 'incident:', name_='RelatedThreatActors', pretty_print=pretty_print)
        if self.Intent is not None:
            self.Intent.export(outfile, level, 'incident:', name_='Intent', pretty_print=pretty_print)
        for DiscoveryMethod_ in self.DiscoveryMethod:
            DiscoveryMethod_.export(outfile, level, 'incident:', name_='DiscoveryMethod', pretty_print=pretty_print)
        if self.RelatedIncidents is not None:
            self.RelatedIncidents.export(outfile, level, 'incident:', name_='RelatedIncidents', pretty_print=pretty_print)
        if self.COARequested is not None:
            self.COARequested.export(outfile, level, 'incident:', name_='COARequested', pretty_print=pretty_print)
        if self.COATaken is not None:
            self.COATaken.export(outfile, level, 'incident:', name_='COATaken', pretty_print=pretty_print)
        if self.Confidence is not None:
            self.Confidence.export(outfile, level, 'incident:', name_='Confidence', pretty_print=pretty_print)
        for Contact_ in self.Contact:
            Contact_.export(outfile, level, 'incident:', name_='Contact', pretty_print=pretty_print)
        if self.History is not None:
            self.History.export(outfile, level, 'incident:', name_='History', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.Time is not None or
            self.Description is not None or
            self.Reporter is not None or
            self.Responder or
            self.Coordinator or
            self.Victim or
            self.AffectedAssets is not None or
            self.ImpactAssessment is not None or
            self.RelatedIndicators is not None or
            self.LeveragedTTPs is not None or
            self.RelatedThreatActors is not None or
            self.Intent is not None or
            self.DiscoveryMethod or
            self.RelatedIncidents is not None or
            self.COARequested is not None or
            self.COATaken is not None or
            self.Confidence is not None or
            self.Contact or
            self.History is not None
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='IncidentType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.URL is not None and 'URL' not in already_processed:
            already_processed.append('URL')
            showIndent(outfile, level)
            outfile.write('URL = "%s",\n' % (self.URL,))
        if self.security_compromise is not None and 'security_compromise' not in already_processed:
            already_processed.append('security_compromise')
            showIndent(outfile, level)
            outfile.write('security_compromise = %s,\n' % (self.security_compromise,))
        if self.idref is not None and 'idref' not in already_processed:
            already_processed.append('idref')
            showIndent(outfile, level)
            outfile.write('idref = %s,\n' % (self.idref,))
        if self.id is not None and 'id' not in already_processed:
            already_processed.append('id')
            showIndent(outfile, level)
            outfile.write('id = %s,\n' % (self.id,))
        if self.version is not None and 'version' not in already_processed:
            already_processed.append('version')
            showIndent(outfile, level)
            outfile.write('version = "%s",\n' % (self.version,))
    def exportLiteralChildren(self, outfile, level, name_):
        if self.Time is not None:
            showIndent(outfile, level)
            outfile.write('Time=model_.TimeType(\n')
            self.Time.exportLiteral(outfile, level, name_='Time')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.Description is not None:
            showIndent(outfile, level)
            outfile.write('Description=model_.cybox_common_binding.StructuredTextType(\n')
            self.Description.exportLiteral(outfile, level, name_='Description')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.Reporter is not None:
            showIndent(outfile, level)
            outfile.write('Reporter=model_.stix_common_binding.InformationSourceType(\n')
            self.Reporter.exportLiteral(outfile, level, name_='Reporter')
            showIndent(outfile, level)
            outfile.write('),\n')
        showIndent(outfile, level)
        outfile.write('Responder=[\n')
        level += 1
        for Responder_ in self.Responder:
            showIndent(outfile, level)
            outfile.write('model_.stix_common_binding.InformationSourceType(\n')
            Responder_.exportLiteral(outfile, level, name_='stix_common_binding.InformationSourceType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
        showIndent(outfile, level)
        outfile.write('Coordinator=[\n')
        level += 1
        for Coordinator_ in self.Coordinator:
            showIndent(outfile, level)
            outfile.write('model_.stix_common_binding.InformationSourceType(\n')
            Coordinator_.exportLiteral(outfile, level, name_='stix_common_binding.InformationSourceType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
        showIndent(outfile, level)
        outfile.write('Victim=[\n')
        level += 1
        for Victim_ in self.Victim:
            showIndent(outfile, level)
            outfile.write('model_.stix_common_binding.IdentityType(\n')
            Victim_.exportLiteral(outfile, level, name_='stix_common_binding.IdentityType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
        if self.AffectedAssets is not None:
            showIndent(outfile, level)
            outfile.write('AffectedAssets=model_.AffectedAssetsType(\n')
            self.AffectedAssets.exportLiteral(outfile, level, name_='AffectedAssets')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.ImpactAssessment is not None:
            showIndent(outfile, level)
            outfile.write('ImpactAssessment=model_.ImpactAssessmentType(\n')
            self.ImpactAssessment.exportLiteral(outfile, level, name_='ImpactAssessment')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.RelatedIndicators is not None:
            showIndent(outfile, level)
            outfile.write('RelatedIndicators=model_.RelatedIndicatorsType(\n')
            self.RelatedIndicators.exportLiteral(outfile, level, name_='RelatedIndicators')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.LeveragedTTPs is not None:
            showIndent(outfile, level)
            outfile.write('LeveragedTTPs=model_.LeveragedTTPsType(\n')
            self.LeveragedTTPs.exportLiteral(outfile, level, name_='LeveragedTTPs')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.RelatedThreatActors is not None:
            showIndent(outfile, level)
            outfile.write('RelatedThreatActors=model_.RelatedThreatActorsType(\n')
            self.RelatedThreatActors.exportLiteral(outfile, level, name_='RelatedThreatActors')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.Intent is not None:
            showIndent(outfile, level)
            outfile.write('Intent=model_.stix_common_binding.IntentType(\n')
            self.Intent.exportLiteral(outfile, level, name_='Intent')
            showIndent(outfile, level)
            outfile.write('),\n')
        showIndent(outfile, level)
        outfile.write('DiscoveryMethod=[\n')
        level += 1
        for DiscoveryMethod_ in self.DiscoveryMethod:
            showIndent(outfile, level)
            outfile.write('model_.DiscoveryMethodType(\n')
            DiscoveryMethod_.exportLiteral(outfile, level, name_='DiscoveryMethodType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
        if self.RelatedIncidents is not None:
            showIndent(outfile, level)
            outfile.write('RelatedIncidents=model_.RelatedIncidentsType(\n')
            self.RelatedIncidents.exportLiteral(outfile, level, name_='RelatedIncidents')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.COARequested is not None:
            showIndent(outfile, level)
            outfile.write('COARequested=model_.COARequestedType(\n')
            self.COARequested.exportLiteral(outfile, level, name_='COARequested')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.COATaken is not None:
            showIndent(outfile, level)
            outfile.write('COATaken=model_.COATakenType(\n')
            self.COATaken.exportLiteral(outfile, level, name_='COATaken')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.Confidence is not None:
            showIndent(outfile, level)
            outfile.write('Confidence=model_.stix_common_binding.ConfidenceType(\n')
            self.Confidence.exportLiteral(outfile, level, name_='Confidence')
            showIndent(outfile, level)
            outfile.write('),\n')
        showIndent(outfile, level)
        outfile.write('Contact=[\n')
        level += 1
        for Contact_ in self.Contact:
            showIndent(outfile, level)
            outfile.write('model_.stix_common_binding.InformationSourceType(\n')
            Contact_.exportLiteral(outfile, level, name_='stix_common_binding.InformationSourceType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
        if self.History is not None:
            showIndent(outfile, level)
            outfile.write('History=model_.HistoryType(\n')
            self.History.exportLiteral(outfile, level, name_='History')
            showIndent(outfile, level)
            outfile.write('),\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('URL', node)
        if value is not None and 'URL' not in already_processed:
            already_processed.append('URL')
            self.URL = value
        value = find_attr_value_('security_compromise', node)
        if value is not None and 'security_compromise' not in already_processed:
            already_processed.append('security_compromise')
            self.security_compromise = value
        value = find_attr_value_('idref', node)
        if value is not None and 'idref' not in already_processed:
            already_processed.append('idref')
            self.idref = value
        value = find_attr_value_('id', node)
        if value is not None and 'id' not in already_processed:
            already_processed.append('id')
            self.id = value
        value = find_attr_value_('version', node)
        if value is not None and 'version' not in already_processed:
            already_processed.append('version')
            self.version = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'Time':
            obj_ = TimeType.factory()
            obj_.build(child_)
            self.set_Time(obj_)
        elif nodeName_ == 'Description':
            obj_ = cybox_common_binding.StructuredTextType.factory()
            obj_.build(child_)
            self.set_Description(obj_)
        elif nodeName_ == 'Reporter':
            obj_ = stix_common_binding.InformationSourceType.factory()
            obj_.build(child_)
            self.set_Reporter(obj_)
        elif nodeName_ == 'Responder':
            obj_ = stix_common_binding.InformationSourceType.factory()
            obj_.build(child_)
            self.Responder.append(obj_)
        elif nodeName_ == 'Coordinator':
            obj_ = stix_common_binding.InformationSourceType.factory()
            obj_.build(child_)
            self.Coordinator.append(obj_)
        elif nodeName_ == 'Victim':
            obj_ = stix_common_binding.IdentityType.factory()
            obj_.build(child_)
            self.Victim.append(obj_)
        elif nodeName_ == 'AffectedAssets':
            obj_ = AffectedAssetsType.factory()
            obj_.build(child_)
            self.set_AffectedAssets(obj_)
        elif nodeName_ == 'ImpactAssessment':
            obj_ = ImpactAssessmentType.factory()
            obj_.build(child_)
            self.set_ImpactAssessment(obj_)
        elif nodeName_ == 'RelatedIndicators':
            obj_ = RelatedIndicatorsType.factory()
            obj_.build(child_)
            self.set_RelatedIndicators(obj_)
        elif nodeName_ == 'LeveragedTTPs':
            obj_ = LeveragedTTPsType.factory()
            obj_.build(child_)
            self.set_LeveragedTTPs(obj_)
        elif nodeName_ == 'RelatedThreatActors':
            obj_ = RelatedThreatActorsType.factory()
            obj_.build(child_)
            self.set_RelatedThreatActors(obj_)
        elif nodeName_ == 'Intent':
            obj_ = stix_common_binding.IntentType.factory()
            obj_.build(child_)
            self.set_Intent(obj_)
        elif nodeName_ == 'DiscoveryMethod':
            obj_ = DiscoveryMethodType.factory()
            obj_.build(child_)
            self.DiscoveryMethod.append(obj_)
        elif nodeName_ == 'RelatedIncidents':
            obj_ = RelatedIncidentsType.factory()
            obj_.build(child_)
            self.set_RelatedIncidents(obj_)
        elif nodeName_ == 'COARequested':
            obj_ = COARequestedType.factory()
            obj_.build(child_)
            self.set_COARequested(obj_)
        elif nodeName_ == 'COATaken':
            obj_ = COATakenType.factory()
            obj_.build(child_)
            self.set_COATaken(obj_)
        elif nodeName_ == 'Confidence':
            obj_ = stix_common_binding.ConfidenceType.factory()
            obj_.build(child_)
            self.set_Confidence(obj_)
        elif nodeName_ == 'Contact':
            obj_ = stix_common_binding.InformationSourceType.factory()
            obj_.build(child_)
            self.Contact.append(obj_)
        elif nodeName_ == 'History':
            obj_ = HistoryType.factory()
            obj_.build(child_)
            self.set_History(obj_)
# end class IncidentType


class DiscoveryMethodType(GeneratedsSuper):
    """This field specifies a reference to an incident discovery method
    value reference. The value is a QName or URL that should
    reference a term in a controlled vocabulary (e.g. VERIS) which
    is understood by both the producing and consuming parties."""
    subclass = None
    superclass = None
    def __init__(self, incidentDiscoveryMethodRef=None, valueOf_=None):
        self.incidentDiscoveryMethodRef = _cast(None, incidentDiscoveryMethodRef)
        self.valueOf_ = valueOf_
    def factory(*args_, **kwargs_):
        if DiscoveryMethodType.subclass:
            return DiscoveryMethodType.subclass(*args_, **kwargs_)
        else:
            return DiscoveryMethodType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_incidentDiscoveryMethodRef(self): return self.incidentDiscoveryMethodRef
    def set_incidentDiscoveryMethodRef(self, incidentDiscoveryMethodRef): self.incidentDiscoveryMethodRef = incidentDiscoveryMethodRef
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def export(self, outfile, level, namespace_='incident:', name_='DiscoveryMethodType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='DiscoveryMethodType')
        if self.hasContent_():
            outfile.write('>')
            outfile.write(str(self.valueOf_).encode(ExternalEncoding))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='DiscoveryMethodType'):
        if self.incidentDiscoveryMethodRef is not None and 'incidentDiscoveryMethodRef' not in already_processed:
            already_processed.append('incidentDiscoveryMethodRef')
            outfile.write(' incidentDiscoveryMethodRef=%s' % (self.gds_format_string(quote_attrib(self.incidentDiscoveryMethodRef).encode(ExternalEncoding), input_name='incidentDiscoveryMethodRef'), ))
    def exportChildren(self, outfile, level, namespace_='incident:', name_='DiscoveryMethodType', fromsubclass_=False, pretty_print=True):
        pass
    def hasContent_(self):
        if (
            self.valueOf_
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='DiscoveryMethodType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
        showIndent(outfile, level)
        outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.incidentDiscoveryMethodRef is not None and 'incidentDiscoveryMethodRef' not in already_processed:
            already_processed.append('incidentDiscoveryMethodRef')
            showIndent(outfile, level)
            outfile.write('incidentDiscoveryMethodRef = "%s",\n' % (self.incidentDiscoveryMethodRef,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        self.valueOf_ = get_all_text_(node)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('incidentDiscoveryMethodRef', node)
        if value is not None and 'incidentDiscoveryMethodRef' not in already_processed:
            already_processed.append('incidentDiscoveryMethodRef')
            self.incidentDiscoveryMethodRef = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class DiscoveryMethodType


class PropertyAffectedType(GeneratedsSuper):
    """This field specifies a reference to an security property (e.g.
    Confidentiality, Integrity, Availability) value reference. The
    value is a QName or URL that should reference a term in a
    controlled vocabulary which is understood by both the producing
    and consuming parties.This field specifies whether non-public
    data was compromised or exposed."""
    subclass = None
    superclass = None
    def __init__(self, nonPublicDataCompromised=None, securityPropertyRef=None, DescriptionOfEffect=None, TypeOfAvailabilityLoss=None, DurationOfAvailabilityLoss=None):
        self.nonPublicDataCompromised = _cast(None, nonPublicDataCompromised)
        self.securityPropertyRef = _cast(None, securityPropertyRef)
        self.DescriptionOfEffect = DescriptionOfEffect
        self.TypeOfAvailabilityLoss = TypeOfAvailabilityLoss
        self.DurationOfAvailabilityLoss = DurationOfAvailabilityLoss
    def factory(*args_, **kwargs_):
        if PropertyAffectedType.subclass:
            return PropertyAffectedType.subclass(*args_, **kwargs_)
        else:
            return PropertyAffectedType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_DescriptionOfEffect(self): return self.DescriptionOfEffect
    def set_DescriptionOfEffect(self, DescriptionOfEffect): self.DescriptionOfEffect = DescriptionOfEffect
    def get_TypeOfAvailabilityLoss(self): return self.TypeOfAvailabilityLoss
    def set_TypeOfAvailabilityLoss(self, TypeOfAvailabilityLoss): self.TypeOfAvailabilityLoss = TypeOfAvailabilityLoss
    def get_DurationOfAvailabilityLoss(self): return self.DurationOfAvailabilityLoss
    def set_DurationOfAvailabilityLoss(self, DurationOfAvailabilityLoss): self.DurationOfAvailabilityLoss = DurationOfAvailabilityLoss
    def get_nonPublicDataCompromised(self): return self.nonPublicDataCompromised
    def set_nonPublicDataCompromised(self, nonPublicDataCompromised): self.nonPublicDataCompromised = nonPublicDataCompromised
    def get_securityPropertyRef(self): return self.securityPropertyRef
    def set_securityPropertyRef(self, securityPropertyRef): self.securityPropertyRef = securityPropertyRef
    def export(self, outfile, level, namespace_='incident:', name_='PropertyAffectedType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='PropertyAffectedType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='PropertyAffectedType'):
        if self.nonPublicDataCompromised is not None and 'nonPublicDataCompromised' not in already_processed:
            already_processed.append('nonPublicDataCompromised')
            outfile.write(' nonPublicDataCompromised=%s' % (quote_attrib(self.nonPublicDataCompromised), ))
        if self.securityPropertyRef is not None and 'securityPropertyRef' not in already_processed:
            already_processed.append('securityPropertyRef')
            outfile.write(' securityPropertyRef=%s' % (self.gds_format_string(quote_attrib(self.securityPropertyRef).encode(ExternalEncoding), input_name='securityPropertyRef'), ))
    def exportChildren(self, outfile, level, namespace_='incident:', name_='PropertyAffectedType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.DescriptionOfEffect is not None:
            self.DescriptionOfEffect.export(outfile, level, 'incident:', name_='DescriptionOfEffect', pretty_print=pretty_print)
        if self.TypeOfAvailabilityLoss is not None:
            self.TypeOfAvailabilityLoss.export(outfile, level, 'incident:', name_='TypeOfAvailabilityLoss', pretty_print=pretty_print)
        if self.DurationOfAvailabilityLoss is not None:
            self.DurationOfAvailabilityLoss.export(outfile, level, 'incident:', name_='DurationOfAvailabilityLoss', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.DescriptionOfEffect is not None or
            self.TypeOfAvailabilityLoss is not None or
            self.DurationOfAvailabilityLoss is not None
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='PropertyAffectedType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.nonPublicDataCompromised is not None and 'nonPublicDataCompromised' not in already_processed:
            already_processed.append('nonPublicDataCompromised')
            showIndent(outfile, level)
            outfile.write('nonPublicDataCompromised = %s,\n' % (self.nonPublicDataCompromised,))
        if self.securityPropertyRef is not None and 'securityPropertyRef' not in already_processed:
            already_processed.append('securityPropertyRef')
            showIndent(outfile, level)
            outfile.write('securityPropertyRef = "%s",\n' % (self.securityPropertyRef,))
    def exportLiteralChildren(self, outfile, level, name_):
        if self.DescriptionOfEffect is not None:
            showIndent(outfile, level)
            outfile.write('DescriptionOfEffect=model_.cybox_common_binding.StructuredTextType(\n')
            self.DescriptionOfEffect.exportLiteral(outfile, level, name_='DescriptionOfEffect')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.TypeOfAvailabilityLoss is not None:
            showIndent(outfile, level)
            outfile.write('TypeOfAvailabilityLoss=model_.TypeOfAvailabilityLossType(\n')
            self.TypeOfAvailabilityLoss.exportLiteral(outfile, level, name_='TypeOfAvailabilityLoss')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.DurationOfAvailabilityLoss is not None:
            showIndent(outfile, level)
            outfile.write('DurationOfAvailabilityLoss=model_.DurationOfAvailabilityLossType(\n')
            self.DurationOfAvailabilityLoss.exportLiteral(outfile, level, name_='DurationOfAvailabilityLoss')
            showIndent(outfile, level)
            outfile.write('),\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('nonPublicDataCompromised', node)
        if value is not None and 'nonPublicDataCompromised' not in already_processed:
            already_processed.append('nonPublicDataCompromised')
            self.nonPublicDataCompromised = value
        value = find_attr_value_('securityPropertyRef', node)
        if value is not None and 'securityPropertyRef' not in already_processed:
            already_processed.append('securityPropertyRef')
            self.securityPropertyRef = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'DescriptionOfEffect':
            obj_ = cybox_common_binding.StructuredTextType.factory()
            obj_.build(child_)
            self.set_DescriptionOfEffect(obj_)
        elif nodeName_ == 'TypeOfAvailabilityLoss':
            obj_ = TypeOfAvailabilityLossType.factory()
            obj_.build(child_)
            self.set_TypeOfAvailabilityLoss(obj_)
        elif nodeName_ == 'DurationOfAvailabilityLoss':
            obj_ = DurationOfAvailabilityLossType.factory()
            obj_.build(child_)
            self.set_DurationOfAvailabilityLoss(obj_)
# end class PropertyAffectedType


class AssetTypeType(GeneratedsSuper):
    """This field specifies a reference to an asset-type value reference.
    The value is a QName or URL that should reference a term in a
    controlled vocabulary which is understood by both the producing
    and consuming parties.This field specifies the number of assets
    of this type affected."""
    subclass = None
    superclass = None
    def __init__(self, countAffected=None, assetTypeRef=None, valueOf_=None):
        self.countAffected = _cast(None, countAffected)
        self.assetTypeRef = _cast(None, assetTypeRef)
        self.valueOf_ = valueOf_
    def factory(*args_, **kwargs_):
        if AssetTypeType.subclass:
            return AssetTypeType.subclass(*args_, **kwargs_)
        else:
            return AssetTypeType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_countAffected(self): return self.countAffected
    def set_countAffected(self, countAffected): self.countAffected = countAffected
    def get_assetTypeRef(self): return self.assetTypeRef
    def set_assetTypeRef(self, assetTypeRef): self.assetTypeRef = assetTypeRef
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def export(self, outfile, level, namespace_='incident:', name_='AssetTypeType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='AssetTypeType')
        if self.hasContent_():
            outfile.write('>')
            outfile.write(str(self.valueOf_).encode(ExternalEncoding))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='AssetTypeType'):
        if self.countAffected is not None and 'countAffected' not in already_processed:
            already_processed.append('countAffected')
            outfile.write(' countAffected=%s' % (self.gds_format_string(quote_attrib(self.countAffected).encode(ExternalEncoding), input_name='countAffected'), ))
        if self.assetTypeRef is not None and 'assetTypeRef' not in already_processed:
            already_processed.append('assetTypeRef')
            outfile.write(' assetTypeRef=%s' % (self.gds_format_string(quote_attrib(self.assetTypeRef).encode(ExternalEncoding), input_name='assetTypeRef'), ))
    def exportChildren(self, outfile, level, namespace_='incident:', name_='AssetTypeType', fromsubclass_=False, pretty_print=True):
        pass
    def hasContent_(self):
        if (
            self.valueOf_
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='AssetTypeType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
        showIndent(outfile, level)
        outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.countAffected is not None and 'countAffected' not in already_processed:
            already_processed.append('countAffected')
            showIndent(outfile, level)
            outfile.write('countAffected = "%s",\n' % (self.countAffected,))
        if self.assetTypeRef is not None and 'assetTypeRef' not in already_processed:
            already_processed.append('assetTypeRef')
            showIndent(outfile, level)
            outfile.write('assetTypeRef = "%s",\n' % (self.assetTypeRef,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        self.valueOf_ = get_all_text_(node)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('countAffected', node)
        if value is not None and 'countAffected' not in already_processed:
            already_processed.append('countAffected')
            self.countAffected = value
        value = find_attr_value_('assetTypeRef', node)
        if value is not None and 'assetTypeRef' not in already_processed:
            already_processed.append('assetTypeRef')
            self.assetTypeRef = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class AssetTypeType


class OwnershipClassType(GeneratedsSuper):
    """This field specifies a reference to an ownership class (e,g,
    Internally-owned, Employee-owned, Partner-owned, Customer-owned)
    value reference. The value is a QName or URL that should
    reference a term in a controlled vocabulary (e.g. VERIS) which
    is understood by both the producing and consuming parties."""
    subclass = None
    superclass = None
    def __init__(self, ownershipClassRef=None, valueOf_=None):
        self.ownershipClassRef = _cast(None, ownershipClassRef)
        self.valueOf_ = valueOf_
    def factory(*args_, **kwargs_):
        if OwnershipClassType.subclass:
            return OwnershipClassType.subclass(*args_, **kwargs_)
        else:
            return OwnershipClassType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_ownershipClassRef(self): return self.ownershipClassRef
    def set_ownershipClassRef(self, ownershipClassRef): self.ownershipClassRef = ownershipClassRef
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def export(self, outfile, level, namespace_='incident:', name_='OwnershipClassType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='OwnershipClassType')
        if self.hasContent_():
            outfile.write('>')
            outfile.write(str(self.valueOf_).encode(ExternalEncoding))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='OwnershipClassType'):
        if self.ownershipClassRef is not None and 'ownershipClassRef' not in already_processed:
            already_processed.append('ownershipClassRef')
            outfile.write(' ownershipClassRef=%s' % (self.gds_format_string(quote_attrib(self.ownershipClassRef).encode(ExternalEncoding), input_name='ownershipClassRef'), ))
    def exportChildren(self, outfile, level, namespace_='incident:', name_='OwnershipClassType', fromsubclass_=False, pretty_print=True):
        pass
    def hasContent_(self):
        if (
            self.valueOf_
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='OwnershipClassType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
        showIndent(outfile, level)
        outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.ownershipClassRef is not None and 'ownershipClassRef' not in already_processed:
            already_processed.append('ownershipClassRef')
            showIndent(outfile, level)
            outfile.write('ownershipClassRef = "%s",\n' % (self.ownershipClassRef,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        self.valueOf_ = get_all_text_(node)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('ownershipClassRef', node)
        if value is not None and 'ownershipClassRef' not in already_processed:
            already_processed.append('ownershipClassRef')
            self.ownershipClassRef = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class OwnershipClassType


class ManagementClassType(GeneratedsSuper):
    """This field specifies a reference to an management class (e.g.
    Managed Internally, Managed by External Party, Co-managed) value
    reference. The value is a QName or URL that should reference a
    term in a controlled vocabulary (e.g. VERIS) which is understood
    by both the producing and consuming parties."""
    subclass = None
    superclass = None
    def __init__(self, managementClassRef=None, valueOf_=None):
        self.managementClassRef = _cast(None, managementClassRef)
        self.valueOf_ = valueOf_
    def factory(*args_, **kwargs_):
        if ManagementClassType.subclass:
            return ManagementClassType.subclass(*args_, **kwargs_)
        else:
            return ManagementClassType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_managementClassRef(self): return self.managementClassRef
    def set_managementClassRef(self, managementClassRef): self.managementClassRef = managementClassRef
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def export(self, outfile, level, namespace_='incident:', name_='ManagementClassType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='ManagementClassType')
        if self.hasContent_():
            outfile.write('>')
            outfile.write(str(self.valueOf_).encode(ExternalEncoding))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='ManagementClassType'):
        if self.managementClassRef is not None and 'managementClassRef' not in already_processed:
            already_processed.append('managementClassRef')
            outfile.write(' managementClassRef=%s' % (self.gds_format_string(quote_attrib(self.managementClassRef).encode(ExternalEncoding), input_name='managementClassRef'), ))
    def exportChildren(self, outfile, level, namespace_='incident:', name_='ManagementClassType', fromsubclass_=False, pretty_print=True):
        pass
    def hasContent_(self):
        if (
            self.valueOf_
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='ManagementClassType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
        showIndent(outfile, level)
        outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.managementClassRef is not None and 'managementClassRef' not in already_processed:
            already_processed.append('managementClassRef')
            showIndent(outfile, level)
            outfile.write('managementClassRef = "%s",\n' % (self.managementClassRef,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        self.valueOf_ = get_all_text_(node)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('managementClassRef', node)
        if value is not None and 'managementClassRef' not in already_processed:
            already_processed.append('managementClassRef')
            self.managementClassRef = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class ManagementClassType


class LocationClassType(GeneratedsSuper):
    """This field specifies a reference to an location class (e.g. Internal
    location, External location, Co-located, Mobile) value
    reference. The value is a QName or URL that should reference a
    term in a controlled vocabulary (e.g. VERIS) which is understood
    by both the producing and consuming parties."""
    subclass = None
    superclass = None
    def __init__(self, locationClassRef=None, valueOf_=None):
        self.locationClassRef = _cast(None, locationClassRef)
        self.valueOf_ = valueOf_
    def factory(*args_, **kwargs_):
        if LocationClassType.subclass:
            return LocationClassType.subclass(*args_, **kwargs_)
        else:
            return LocationClassType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_locationClassRef(self): return self.locationClassRef
    def set_locationClassRef(self, locationClassRef): self.locationClassRef = locationClassRef
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def export(self, outfile, level, namespace_='incident:', name_='LocationClassType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='LocationClassType')
        if self.hasContent_():
            outfile.write('>')
            outfile.write(str(self.valueOf_).encode(ExternalEncoding))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='LocationClassType'):
        if self.locationClassRef is not None and 'locationClassRef' not in already_processed:
            already_processed.append('locationClassRef')
            outfile.write(' locationClassRef=%s' % (self.gds_format_string(quote_attrib(self.locationClassRef).encode(ExternalEncoding), input_name='locationClassRef'), ))
    def exportChildren(self, outfile, level, namespace_='incident:', name_='LocationClassType', fromsubclass_=False, pretty_print=True):
        pass
    def hasContent_(self):
        if (
            self.valueOf_
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='LocationClassType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
        showIndent(outfile, level)
        outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.locationClassRef is not None and 'locationClassRef' not in already_processed:
            already_processed.append('locationClassRef')
            showIndent(outfile, level)
            outfile.write('locationClassRef = "%s",\n' % (self.locationClassRef,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        self.valueOf_ = get_all_text_(node)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('locationClassRef', node)
        if value is not None and 'locationClassRef' not in already_processed:
            already_processed.append('locationClassRef')
            self.locationClassRef = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class LocationClassType





class AffectedAssetType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, AssetType=None, AssetDescription=None, BusinessFunctionOrRole=None, OwnershipClass=None, ManagementClass=None, LocationClass=None, AssetLocation=None, NatureOfSecurityEffect=None, AssetStructuredDescription=None):
        self.AssetType = AssetType
        self.AssetDescription = AssetDescription
        self.BusinessFunctionOrRole = BusinessFunctionOrRole
        self.OwnershipClass = OwnershipClass
        self.ManagementClass = ManagementClass
        self.LocationClass = LocationClass
        self.AssetLocation = AssetLocation
        self.NatureOfSecurityEffect = NatureOfSecurityEffect
        self.AssetStructuredDescription = AssetStructuredDescription
    def factory(*args_, **kwargs_):
        if AffectedAssetType.subclass:
            return AffectedAssetType.subclass(*args_, **kwargs_)
        else:
            return AffectedAssetType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_AssetType(self): return self.AssetType
    def set_AssetType(self, AssetType): self.AssetType = AssetType
    def get_AssetDescription(self): return self.AssetDescription
    def set_AssetDescription(self, AssetDescription): self.AssetDescription = AssetDescription
    def get_BusinessFunctionOrRole(self): return self.BusinessFunctionOrRole
    def set_BusinessFunctionOrRole(self, BusinessFunctionOrRole): self.BusinessFunctionOrRole = BusinessFunctionOrRole
    def get_OwnershipClass(self): return self.OwnershipClass
    def set_OwnershipClass(self, OwnershipClass): self.OwnershipClass = OwnershipClass
    def get_ManagementClass(self): return self.ManagementClass
    def set_ManagementClass(self, ManagementClass): self.ManagementClass = ManagementClass
    def get_LocationClass(self): return self.LocationClass
    def set_LocationClass(self, LocationClass): self.LocationClass = LocationClass
    def get_AssetLocation(self): return self.AssetLocation
    def set_AssetLocation(self, AssetLocation): self.AssetLocation = AssetLocation
    def get_NatureOfSecurityEffect(self): return self.NatureOfSecurityEffect
    def set_NatureOfSecurityEffect(self, NatureOfSecurityEffect): self.NatureOfSecurityEffect = NatureOfSecurityEffect
    def get_AssetStructuredDescription(self): return self.AssetStructuredDescription
    def set_AssetStructuredDescription(self, AssetStructuredDescription): self.AssetStructuredDescription = AssetStructuredDescription
    def export(self, outfile, level, namespace_='incident:', name_='AffectedAssetType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='AffectedAssetType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='AffectedAssetType'):
        pass
    def exportChildren(self, outfile, level, namespace_='incident:', name_='AffectedAssetType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.AssetType is not None:
            self.AssetType.export(outfile, level, 'incident:', name_='AssetType', pretty_print=pretty_print)
        if self.AssetDescription is not None:
            self.AssetDescription.export(outfile, level, 'incident:', name_='AssetDescription', pretty_print=pretty_print)
        if self.BusinessFunctionOrRole is not None:
            self.BusinessFunctionOrRole.export(outfile, level, 'incident:', name_='BusinessFunctionOrRole', pretty_print=pretty_print)
        if self.OwnershipClass is not None:
            self.OwnershipClass.export(outfile, level, 'incident:', name_='OwnershipClass', pretty_print=pretty_print)
        if self.ManagementClass is not None:
            self.ManagementClass.export(outfile, level, 'incident:', name_='ManagementClass', pretty_print=pretty_print)
        if self.LocationClass is not None:
            self.LocationClass.export(outfile, level, 'incident:', name_='LocationClass', pretty_print=pretty_print)
        if self.AssetLocation is not None:
            self.AssetLocation.export(outfile, level, 'incident:', name_='AssetLocation', pretty_print=pretty_print)
        if self.NatureOfSecurityEffect is not None:
            self.NatureOfSecurityEffect.export(outfile, level, 'incident:', name_='NatureOfSecurityEffect', pretty_print=pretty_print)
        if self.AssetStructuredDescription is not None:
            self.AssetStructuredDescription.export(outfile, level, 'incident:', name_='AssetStructuredDescription', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.AssetType is not None or
            self.AssetDescription is not None or
            self.BusinessFunctionOrRole is not None or
            self.OwnershipClass is not None or
            self.ManagementClass is not None or
            self.LocationClass is not None or
            self.AssetLocation is not None or
            self.NatureOfSecurityEffect is not None or
            self.AssetStructuredDescription is not None
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='AffectedAssetType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        if self.AssetType is not None:
            showIndent(outfile, level)
            outfile.write('AssetType=model_.AssetTypeType(\n')
            self.AssetType.exportLiteral(outfile, level, name_='AssetType')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.AssetDescription is not None:
            showIndent(outfile, level)
            outfile.write('AssetDescription=model_.cybox_common_binding.StructuredTextType(\n')
            self.AssetDescription.exportLiteral(outfile, level, name_='AssetDescription')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.BusinessFunctionOrRole is not None:
            showIndent(outfile, level)
            outfile.write('BusinessFunctionOrRole=model_.cybox_common_binding.StructuredTextType(\n')
            self.BusinessFunctionOrRole.exportLiteral(outfile, level, name_='BusinessFunctionOrRole')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.OwnershipClass is not None:
            showIndent(outfile, level)
            outfile.write('OwnershipClass=model_.OwnershipClassType(\n')
            self.OwnershipClass.exportLiteral(outfile, level, name_='OwnershipClass')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.ManagementClass is not None:
            showIndent(outfile, level)
            outfile.write('ManagementClass=model_.ManagementClassType(\n')
            self.ManagementClass.exportLiteral(outfile, level, name_='ManagementClass')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.LocationClass is not None:
            showIndent(outfile, level)
            outfile.write('LocationClass=model_.LocationClassType(\n')
            self.LocationClass.exportLiteral(outfile, level, name_='LocationClass')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.AssetLocation is not None:
            showIndent(outfile, level)
            outfile.write('AssetLocation=model_.xal_binding.AddressType(\n')
            self.AssetLocation.exportLiteral(outfile, level, name_='AssetLocation')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.NatureOfSecurityEffect is not None:
            showIndent(outfile, level)
            outfile.write('NatureOfSecurityEffect=model_.NatureOfSecurityEffectType(\n')
            self.NatureOfSecurityEffect.exportLiteral(outfile, level, name_='NatureOfSecurityEffect')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.AssetStructuredDescription is not None:
            showIndent(outfile, level)
            outfile.write('AssetStructuredDescription=model_.cybox_core_binding.ObservablesType(\n')
            self.AssetStructuredDescription.exportLiteral(outfile, level, name_='AssetStructuredDescription')
            showIndent(outfile, level)
            outfile.write('),\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'AssetType':
            obj_ = AssetTypeType.factory()
            obj_.build(child_)
            self.set_AssetType(obj_)
        elif nodeName_ == 'AssetDescription':
            obj_ = cybox_common_binding.StructuredTextType.factory()
            obj_.build(child_)
            self.set_AssetDescription(obj_)
        elif nodeName_ == 'BusinessFunctionOrRole':
            obj_ = cybox_common_binding.StructuredTextType.factory()
            obj_.build(child_)
            self.set_BusinessFunctionOrRole(obj_)
        elif nodeName_ == 'OwnershipClass':
            obj_ = OwnershipClassType.factory()
            obj_.build(child_)
            self.set_OwnershipClass(obj_)
        elif nodeName_ == 'ManagementClass':
            obj_ = ManagementClassType.factory()
            obj_.build(child_)
            self.set_ManagementClass(obj_)
        elif nodeName_ == 'LocationClass':
            obj_ = LocationClassType.factory()
            obj_.build(child_)
            self.set_LocationClass(obj_)
        elif nodeName_ == 'AssetLocation':
            obj_ = xal_binding.AddressType.factory()
            obj_.build(child_)
            self.set_AssetLocation(obj_)
        elif nodeName_ == 'NatureOfSecurityEffect':
            obj_ = NatureOfSecurityEffectType.factory()
            obj_.build(child_)
            self.set_NatureOfSecurityEffect(obj_)
        elif nodeName_ == 'AssetStructuredDescription':
            obj_ = cybox_core_binding.ObservablesType.factory()
            obj_.build(child_)
            self.set_AssetStructuredDescription(obj_)
# end class AffectedAssetType

class RelatedIncidentType(GeneratedsSuper):
    """Identifies or characterizes another Incident related to this
    Incident.Specifies the nature of the relationship between this
    Incident and the related Incident."""
    subclass = None
    superclass = None
    def __init__(self, relationship=None, Incident=None, IODEF_Incident=None, RelatedIncidentConfidence=None):
        self.relationship = _cast(None, relationship)
        self.Incident = Incident
        self.IODEF_Incident = IODEF_Incident
        self.RelatedIncidentConfidence = RelatedIncidentConfidence
    def factory(*args_, **kwargs_):
        if RelatedIncidentType.subclass:
            return RelatedIncidentType.subclass(*args_, **kwargs_)
        else:
            return RelatedIncidentType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_Incident(self): return self.Incident
    def set_Incident(self, Incident): self.Incident = Incident
    def get_IODEF_Incident(self): return self.IODEF_Incident
    def set_IODEF_Incident(self, IODEF_Incident): self.IODEF_Incident = IODEF_Incident
    def get_RelatedIncidentConfidence(self): return self.RelatedIncidentConfidence
    def set_RelatedIncidentConfidence(self, RelatedIncidentConfidence): self.RelatedIncidentConfidence = RelatedIncidentConfidence
    def get_relationship(self): return self.relationship
    def set_relationship(self, relationship): self.relationship = relationship
    def export(self, outfile, level, namespace_='incident:', name_='RelatedIncidentType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='RelatedIncidentType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='RelatedIncidentType'):
        if self.relationship is not None and 'relationship' not in already_processed:
            already_processed.append('relationship')
            outfile.write(' relationship=%s' % (self.gds_format_string(quote_attrib(self.relationship).encode(ExternalEncoding), input_name='relationship'), ))
    def exportChildren(self, outfile, level, namespace_='incident:', name_='RelatedIncidentType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.Incident is not None:
            self.Incident.export(outfile, level, 'incident:', name_='Incident', pretty_print=pretty_print)
        if self.IODEF_Incident is not None:
            self.IODEF_Incident.export(outfile, level, 'incident:', name_='IODEF-Incident', pretty_print=pretty_print)
        if self.RelatedIncidentConfidence is not None:
            self.RelatedIncidentConfidence.export(outfile, level, 'incident:', name_='RelatedIncidentConfidence', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.Incident is not None or
            self.IODEF_Incident is not None or
            self.RelatedIncidentConfidence is not None
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='RelatedIncidentType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.relationship is not None and 'relationship' not in already_processed:
            already_processed.append('relationship')
            showIndent(outfile, level)
            outfile.write('relationship = "%s",\n' % (self.relationship,))
    def exportLiteralChildren(self, outfile, level, name_):
        if self.Incident is not None:
            showIndent(outfile, level)
            outfile.write('Incident=model_.IncidentType(\n')
            self.Incident.exportLiteral(outfile, level, name_='Incident')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.IODEF_Incident is not None:
            showIndent(outfile, level)
            outfile.write('IODEF_Incident=model_.IODEF_IncidentType(\n')
            self.IODEF_Incident.exportLiteral(outfile, level, name_='IODEF_Incident')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.RelatedIncidentConfidence is not None:
            showIndent(outfile, level)
            outfile.write('RelatedIncidentConfidence=model_.stix_common_binding.ConfidenceType(\n')
            self.RelatedIncidentConfidence.exportLiteral(outfile, level, name_='RelatedIncidentConfidence')
            showIndent(outfile, level)
            outfile.write('),\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('relationship', node)
        if value is not None and 'relationship' not in already_processed:
            already_processed.append('relationship')
            self.relationship = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'Incident':
            obj_ = IncidentType.factory()
            obj_.build(child_)
            self.set_Incident(obj_)
        elif nodeName_ == 'IODEF-Incident':
            obj_ = IncidentType.factory()
            obj_.build(child_)
            self.set_Incident(obj_)
        elif nodeName_ == 'RelatedIncidentConfidence':
            obj_ = stix_common_binding.ConfidenceType.factory()
            obj_.build(child_)
            self.set_RelatedIncidentConfidence(obj_)
# end class RelatedIncidentType

class ImpactAssessmentType(GeneratedsSuper):
    """The ImpactAssessmentType specifies a summary assessment of impact
    for this cyber threat Incident."""
    subclass = None
    superclass = None
    def __init__(self, DirectImpactSummary=None, IndirectImpactSummary=None, TotalLossEstimation=None, ImpactQualification=None, ExternalImpactAssessmentModel=None):
        self.DirectImpactSummary = DirectImpactSummary
        self.IndirectImpactSummary = IndirectImpactSummary
        self.TotalLossEstimation = TotalLossEstimation
        self.ImpactQualification = ImpactQualification
        self.ExternalImpactAssessmentModel = ExternalImpactAssessmentModel
    def factory(*args_, **kwargs_):
        if ImpactAssessmentType.subclass:
            return ImpactAssessmentType.subclass(*args_, **kwargs_)
        else:
            return ImpactAssessmentType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_DirectImpactSummary(self): return self.DirectImpactSummary
    def set_DirectImpactSummary(self, DirectImpactSummary): self.DirectImpactSummary = DirectImpactSummary
    def get_IndirectImpactSummary(self): return self.IndirectImpactSummary
    def set_IndirectImpactSummary(self, IndirectImpactSummary): self.IndirectImpactSummary = IndirectImpactSummary
    def get_TotalLossEstimation(self): return self.TotalLossEstimation
    def set_TotalLossEstimation(self, TotalLossEstimation): self.TotalLossEstimation = TotalLossEstimation
    def get_ImpactQualification(self): return self.ImpactQualification
    def set_ImpactQualification(self, ImpactQualification): self.ImpactQualification = ImpactQualification
    def validate_ImpactQualificationEnum(self, value):
        # Validate type ImpactQualificationEnum, a restriction on xs:string.
        pass
    def get_ExternalImpactAssessmentModel(self): return self.ExternalImpactAssessmentModel
    def set_ExternalImpactAssessmentModel(self, ExternalImpactAssessmentModel): self.ExternalImpactAssessmentModel = ExternalImpactAssessmentModel
    def export(self, outfile, level, namespace_='incident:', name_='ImpactAssessmentType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='ImpactAssessmentType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='ImpactAssessmentType'):
        pass
    def exportChildren(self, outfile, level, namespace_='incident:', name_='ImpactAssessmentType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.DirectImpactSummary is not None:
            self.DirectImpactSummary.export(outfile, level, 'incident:', name_='DirectImpactSummary', pretty_print=pretty_print)
        if self.IndirectImpactSummary is not None:
            self.IndirectImpactSummary.export(outfile, level, 'incident:', name_='IndirectImpactSummary', pretty_print=pretty_print)
        if self.TotalLossEstimation is not None:
            self.TotalLossEstimation.export(outfile, level, 'incident:', name_='TotalLossEstimation', pretty_print=pretty_print)
        if self.ImpactQualification is not None:
            outfile.write('<%sImpactQualification>%s</%sImpactQualification>%s' % ('incident:', self.gds_format_string(quote_xml(self.ImpactQualification).encode(ExternalEncoding), input_name='ImpactQualification'), 'incident:', eol_))
        if self.ExternalImpactAssessmentModel is not None:
            self.ExternalImpactAssessmentModel.export(outfile, level, 'incident:', name_='ExternalImpactAssessmentModel', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.DirectImpactSummary is not None or
            self.IndirectImpactSummary is not None or
            self.TotalLossEstimation is not None or
            self.ImpactQualification is not None or
            self.ExternalImpactAssessmentModel is not None
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='ImpactAssessmentType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        if self.DirectImpactSummary is not None:
            showIndent(outfile, level)
            outfile.write('DirectImpactSummary=model_.DirectImpactSummaryType(\n')
            self.DirectImpactSummary.exportLiteral(outfile, level, name_='DirectImpactSummary')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.IndirectImpactSummary is not None:
            showIndent(outfile, level)
            outfile.write('IndirectImpactSummary=model_.IndirectImpactSummaryType(\n')
            self.IndirectImpactSummary.exportLiteral(outfile, level, name_='IndirectImpactSummary')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.TotalLossEstimation is not None:
            showIndent(outfile, level)
            outfile.write('TotalLossEstimation=model_.TotalLossEstimationType(\n')
            self.TotalLossEstimation.exportLiteral(outfile, level, name_='TotalLossEstimation')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.ImpactQualification is not None:
            showIndent(outfile, level)
            outfile.write('ImpactQualification=%s,\n' % quote_python(self.ImpactQualification).encode(ExternalEncoding))
        if self.ExternalImpactAssessmentModelType is not None:
            showIndent(outfile, level)
            outfile.write('ExternalImpactAssessmentModelType=model_.ExternalImpactAssessmentModelType(\n')
            self.ExternalImpactAssessmentModelType.exportLiteral(outfile, level)
            showIndent(outfile, level)
            outfile.write('),\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'DirectImpactSummary':
            obj_ = DirectImpactSummaryType.factory()
            obj_.build(child_)
            self.set_DirectImpactSummary(obj_)
        elif nodeName_ == 'IndirectImpactSummary':
            obj_ = IndirectImpactSummaryType.factory()
            obj_.build(child_)
            self.set_IndirectImpactSummary(obj_)
        elif nodeName_ == 'TotalLossEstimation':
            obj_ = TotalLossEstimationType.factory()
            obj_.build(child_)
            self.set_TotalLossEstimation(obj_)
        elif nodeName_ == 'ImpactQualification':
            ImpactQualification_ = child_.text
            ImpactQualification_ = self.gds_validate_string(ImpactQualification_, node, 'ImpactQualification')
            self.set_ImpactQualification(ImpactQualification_)
        elif nodeName_ == 'ExternalImpactAssessmentModel':
            type_name_ = child_.attrib.get('{http://www.w3.org/2001/XMLSchema-instance}type')
            if type_name_ is None:
                type_name_ = child_.attrib.get('type')
            if type_name_ is not None:
                type_names_ = type_name_.split(':')
                if len(type_names_) == 1:
                    type_name_ = type_names_[0]
                else:
                    type_name_ = type_names_[1]
                class_ = globals()[type_name_]
                obj_ = class_.factory()
                obj_.build(child_)
            else:
                raise NotImplementedError(
                    'Class not implemented for <ExternalImpactAssessmentModel> element')
            self.set_ExternalImpactAssessmentModel(obj_)
# end class ImpactAssessmentType

class ExternalImpactAssessmentModelType(GeneratedsSuper):
    """The ExternalImpactAssessmentModelType is an abstract type enabling
    the definition through extension of incident impact assessment
    models external to STIX.Specifies the name of the externally
    defined impact assessment model.Specifies a URL reference for
    the externally defined impact assessment model."""
    subclass = None
    superclass = None
    def __init__(self, model_name=None, model_reference=None):
        self.model_name = _cast(None, model_name)
        self.model_reference = _cast(None, model_reference)
        pass
    def factory(*args_, **kwargs_):
        if ExternalImpactAssessmentModelType.subclass:
            return ExternalImpactAssessmentModelType.subclass(*args_, **kwargs_)
        else:
            return ExternalImpactAssessmentModelType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_model_name(self): return self.model_name
    def set_model_name(self, model_name): self.model_name = model_name
    def get_model_reference(self): return self.model_reference
    def set_model_reference(self, model_reference): self.model_reference = model_reference
    def export(self, outfile, level, namespace_='incident:', name_='ExternalImpactAssessmentModelType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='ExternalImpactAssessmentModelType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='ExternalImpactAssessmentModelType'):
        if self.model_name is not None and 'model_name' not in already_processed:
            already_processed.append('model_name')
            outfile.write(' model_name=%s' % (self.gds_format_string(quote_attrib(self.model_name).encode(ExternalEncoding), input_name='model_name'), ))
        if self.model_reference is not None and 'model_reference' not in already_processed:
            already_processed.append('model_reference')
            outfile.write(' model_reference=%s' % (self.gds_format_string(quote_attrib(self.model_reference).encode(ExternalEncoding), input_name='model_reference'), ))
    def exportChildren(self, outfile, level, namespace_='incident:', name_='ExternalImpactAssessmentModelType', fromsubclass_=False, pretty_print=True):
        pass
    def hasContent_(self):
        if (

            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='ExternalImpactAssessmentModelType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.model_name is not None and 'model_name' not in already_processed:
            already_processed.append('model_name')
            showIndent(outfile, level)
            outfile.write('model_name = "%s",\n' % (self.model_name,))
        if self.model_reference is not None and 'model_reference' not in already_processed:
            already_processed.append('model_reference')
            showIndent(outfile, level)
            outfile.write('model_reference = "%s",\n' % (self.model_reference,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('model_name', node)
        if value is not None and 'model_name' not in already_processed:
            already_processed.append('model_name')
            self.model_name = value
        value = find_attr_value_('model_reference', node)
        if value is not None and 'model_reference' not in already_processed:
            already_processed.append('model_reference')
            self.model_reference = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class ExternalImpactAssessmentModelType

class COATakenType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, Time=None, Contributors=None, CourseOfAction=None):
        self.Time = Time
        self.Contributors = Contributors
        self.CourseOfAction = CourseOfAction
    def factory(*args_, **kwargs_):
        if COATakenType.subclass:
            return COATakenType.subclass(*args_, **kwargs_)
        else:
            return COATakenType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_Time(self): return self.Time
    def set_Time(self, Time): self.Time = Time
    def get_Contributors(self): return self.Contributors
    def set_Contributors(self, Contributors): self.Contributors = Contributors
    def get_CourseOfAction(self): return self.CourseOfAction
    def set_CourseOfAction(self, CourseOfAction): self.CourseOfAction = CourseOfAction
    def export(self, outfile, level, namespace_='incident:', name_='COATakenType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='COATakenType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='COATakenType'):
        pass
    def exportChildren(self, outfile, level, namespace_='incident:', name_='COATakenType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.Time is not None:
            self.Time.export(outfile, level, 'incident:', name_='Time', pretty_print=pretty_print)
        if self.Contributors is not None:
            self.Contributors.export(outfile, level, 'incident:', name_='Contributors', pretty_print=pretty_print)
        if self.CourseOfAction is not None:
            self.CourseOfAction.export(outfile, level, 'incident:', name_='CourseOfAction', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.Time is not None or
            self.Contributors is not None or
            self.CourseOfAction is not None
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='COATakenType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        if self.Time is not None:
            showIndent(outfile, level)
            outfile.write('Time=model_.TimeType(\n')
            self.Time.exportLiteral(outfile, level, name_='Time')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.Contributors is not None:
            showIndent(outfile, level)
            outfile.write('Contributors=model_.ContributorsType(\n')
            self.Contributors.exportLiteral(outfile, level, name_='Contributors')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.CourseOfAction is not None:
            showIndent(outfile, level)
            outfile.write('CourseOfAction=model_.stix_coa_binding.COAType(\n')
            self.CourseOfAction.exportLiteral(outfile, level, name_='CourseOfAction')
            showIndent(outfile, level)
            outfile.write('),\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'Time':
            obj_ = TimeType2.factory()
            obj_.build(child_)
            self.set_Time(obj_)
        elif nodeName_ == 'Contributors':
            obj_ = ContributorsType.factory()
            obj_.build(child_)
            self.set_Contributors(obj_)
        elif nodeName_ == 'CourseOfAction':
            obj_ = stix_coa_binding.COAType.factory()
            obj_.build(child_)
            self.set_CourseOfAction(obj_)
# end class COATakenType

class JournalEntryType(GeneratedsSuper):
    """The JournalEntryType is optional and provides journal notes for
    information discovered during the handling of the
    Incident.Specifies the author of the JournalEntry note.Specifies
    the date and time that the JournalEntry note was written."""
    subclass = None
    superclass = None
    def __init__(self, time=None, author=None, valueOf_=None):
        self.time = _cast(None, time)
        self.author = _cast(None, author)
        self.valueOf_ = valueOf_
    def factory(*args_, **kwargs_):
        if JournalEntryType.subclass:
            return JournalEntryType.subclass(*args_, **kwargs_)
        else:
            return JournalEntryType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_time(self): return self.time
    def set_time(self, time): self.time = time
    def get_author(self): return self.author
    def set_author(self, author): self.author = author
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def export(self, outfile, level, namespace_='incident:', name_='JournalEntryType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='JournalEntryType')
        if self.hasContent_():
            outfile.write('>')
            outfile.write(str(self.valueOf_).encode(ExternalEncoding))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='JournalEntryType'):
        if self.time is not None and 'time' not in already_processed:
            already_processed.append('time')
            outfile.write(' time=%s' % (self.gds_format_string(quote_attrib(self.time).encode(ExternalEncoding), input_name='time'), ))
        if self.author is not None and 'author' not in already_processed:
            already_processed.append('author')
            outfile.write(' author=%s' % (self.gds_format_string(quote_attrib(self.author).encode(ExternalEncoding), input_name='author'), ))
    def exportChildren(self, outfile, level, namespace_='incident:', name_='JournalEntryType', fromsubclass_=False, pretty_print=True):
        pass
    def hasContent_(self):
        if (
            self.valueOf_
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='JournalEntryType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
        showIndent(outfile, level)
        outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.time is not None and 'time' not in already_processed:
            already_processed.append('time')
            showIndent(outfile, level)
            outfile.write('time = "%s",\n' % (self.time,))
        if self.author is not None and 'author' not in already_processed:
            already_processed.append('author')
            showIndent(outfile, level)
            outfile.write('author = "%s",\n' % (self.author,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        self.valueOf_ = get_all_text_(node)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('time', node)
        if value is not None and 'time' not in already_processed:
            already_processed.append('time')
            self.time = value
        value = find_attr_value_('author', node)
        if value is not None and 'author' not in already_processed:
            already_processed.append('author')
            self.author = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class JournalEntryType

class RelatedIndicatorType(stix_indicator_binding.IndicatorType):
    """Specifies a locally-defined type of relationship (predicate) being
    defined between the subject and the object of the relationship.
    Specifies an externally-defined type of relationship (predicate)
    being defined between the subject and the object of the
    relationship. The value is a QName that should reference a term
    in a controlled vocabulary which is understood by both the
    producing and consuming parties.Indicates how multiple
    IndicatorRef elements should be interpreted in this
    relationship. If "inclusive" is specified, then the relationship
    being defined is between the subject and the collection of
    objects indicated by the IndicatorRef elements (i.e. the
    relationship is not necessarily relevant for any one particular
    object being referenced, but for the aggregated collection of
    objects referenced). If "exclusive" is specified, then the
    relationship being defined is between the specific subject
    Indicator and each object individually (i.e. this is the same as
    specifying multiple relationship elements, each with the same
    @type).A placeholder so that content creators can add attributes
    as desired."""
    subclass = None
    superclass = stix_indicator_binding.IndicatorType
    def __init__(self, id=None, idref=None, version=None, RelatedIndicatorConfidence=None):
        super(RelatedIndicatorType, self).__init__()
        self.id = _cast(None, id)
        self.idref= _cast(None, idref)
        self.version = _cast(None, version)
        self.RelatedIndicatorConfidence = RelatedIndicatorConfidence

    def factory(*args_, **kwargs_):
        if RelatedIndicatorType.subclass:
            return RelatedIndicatorType.subclass(*args_, **kwargs_)
        else:
            return RelatedIndicatorType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_RelatedIndicatorConfidence(self): return self.RelatedIndicatorConfidence
    def set_RelatedIndicatorConfidence(self, RelatedIndicatorConfidence): self.RelatedIndicatorConfidence = RelatedIndicatorConfidence
    def get_id(self): return self.id
    def set_id(self, id): self.id = id
    def get_idref(self): return self.idref
    def set_idref(self, idref): self.idref = idref
    def get_version(self): return self.version
    def set_version(self, version): self.version = version
    def export(self, outfile, level, namespace_='incident:', name_='RelatedIndicatorType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='RelatedIndicatorType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='RelatedIndicatorType'):
        super(RelatedIndicatorType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='RelatedIndicatorType')
        if self.id is not None and 'id' not in already_processed:
            already_processed.append('id')
            outfile.write(' id=%s' % (quote_attrib(self.id), ))
        if self.idref is not None and 'idref' not in already_processed:
            already_processed.append('idref')
            outfile.write(' idref=%s' % (quote_attrib(self.idref), ))
        if self.version is not None and 'version' not in already_processed:
            already_processed.append('version')
            outfile.write(' version=%s' % (quote_attrib(self.version), ))
    def exportChildren(self, outfile, level, namespace_='incident:', name_='RelatedIndicatorType', fromsubclass_=False, pretty_print=True):
        super(RelatedIndicatorType, self).exportChildren(outfile, level, 'incident:', name_, True, pretty_print=pretty_print)
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.RelatedIndicatorConfidence is not None:
            self.RelatedIndicatorConfidence.export(outfile, level, 'incident:', name_='RelatedIndicatorConfidence', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.RelatedIndicatorConfidence is not None or
            super(RelatedIndicatorType, self).hasContent_()
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='RelatedIndicatorType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.id is not None and 'id' not in already_processed:
            already_processed.append('id')
            showIndent(outfile, level)
            outfile.write('id = %s,\n' % (self.id,))
        if self.idref is not None and 'idref' not in already_processed:
            already_processed.append('idref')
            showIndent(outfile, level)
            outfile.write('idref = %s,\n' % (self.idref,))
        if self.version is not None and 'version' not in already_processed:
            already_processed.append('version')
            showIndent(outfile, level)
            outfile.write('version = %s,\n' % (self.version,))
        for name, value in self.anyAttributes_.items():
            showIndent(outfile, level)
            outfile.write('%s = "%s",\n' % (name, value,))
        super(RelatedIndicatorType, self).exportLiteralAttributes(outfile, level, already_processed, name_)
    def exportLiteralChildren(self, outfile, level, name_):
        super(RelatedIndicatorType, self).exportLiteralChildren(outfile, level, name_)
        if self.RelatedIndicatorConfidence is not None:
            showIndent(outfile, level)
            outfile.write('RelatedIndicatorConfidence=model_.stix_common_binding.ConfidenceType(\n')
            self.RelatedIndicatorConfidence.exportLiteral(outfile, level, name_='RelatedIndicatorConfidence')
            showIndent(outfile, level)
            outfile.write('),\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('id', node)
        if value is not None and 'id' not in already_processed:
            already_processed.append('id')
            self.id = value
        value = find_attr_value_('idref', node)
        if value is not None and 'idref' not in already_processed:
            already_processed.append('idref')
            self.idref = value
        value = find_attr_value_('version', node)
        if value is not None and 'version' not in already_processed:
            already_processed.append('version')
            self.version = value
            
        super(RelatedIndicatorType, self).buildAttributes(node, attrs, already_processed)
        
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'RelatedIndicatorConfidence':
            obj_ = stix_common_binding.ConfidenceType.factory()
            obj_.build(child_)
            self.set_RelatedIndicatorConfidence(obj_)
        super(RelatedIndicatorType, self).buildChildren(child_, node, nodeName_, True)
# end class RelatedIndicatorType

class LeveragedTTPType(stix_ttp_binding.TTPType):
    """The LeveragedTTPType specifies a single TTP asserted to be related
    to this cyber threat Incident."""
    subclass = None
    superclass = stix_ttp_binding.TTPType
    def __init__(self, idref=None, id=None, version=None, Behavior_AttackPatterns=None, Behavior_Malware=None, Behavior_Exploits=None, Resource_Tools=None, Resource_Infrastructure=None, VictimTargeting=None, ExploitTargets=None, Intent=None, RelatedTTPs=None, KillChainPhases=None, InformationSource=None, KillChains=None, LeveragedTTPConfidence=None):
        super(LeveragedTTPType, self).__init__(idref, id, version, Behavior_AttackPatterns, Behavior_Malware, Behavior_Exploits, Resource_Tools, Resource_Infrastructure, VictimTargeting, ExploitTargets, Intent, RelatedTTPs, KillChainPhases, InformationSource, KillChains, )
        self.LeveragedTTPConfidence = LeveragedTTPConfidence
    def factory(*args_, **kwargs_):
        if LeveragedTTPType.subclass:
            return LeveragedTTPType.subclass(*args_, **kwargs_)
        else:
            return LeveragedTTPType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_LeveragedTTPConfidence(self): return self.LeveragedTTPConfidence
    def set_LeveragedTTPConfidence(self, LeveragedTTPConfidence): self.LeveragedTTPConfidence = LeveragedTTPConfidence
    def export(self, outfile, level, namespace_='incident:', name_='LeveragedTTPType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='LeveragedTTPType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='LeveragedTTPType'):
        super(LeveragedTTPType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='LeveragedTTPType')
    def exportChildren(self, outfile, level, namespace_='incident:', name_='LeveragedTTPType', fromsubclass_=False, pretty_print=True):
        super(LeveragedTTPType, self).exportChildren(outfile, level, 'incident:', name_, True, pretty_print=pretty_print)
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.LeveragedTTPConfidence is not None:
            self.LeveragedTTPConfidence.export(outfile, level, 'incident:', name_='LeveragedTTPConfidence', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.LeveragedTTPConfidence is not None or
            super(LeveragedTTPType, self).hasContent_()
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='LeveragedTTPType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        super(LeveragedTTPType, self).exportLiteralAttributes(outfile, level, already_processed, name_)
    def exportLiteralChildren(self, outfile, level, name_):
        super(LeveragedTTPType, self).exportLiteralChildren(outfile, level, name_)
        if self.LeveragedTTPConfidence is not None:
            showIndent(outfile, level)
            outfile.write('LeveragedTTPConfidence=model_.stix_common_binding.ConfidenceType(\n')
            self.LeveragedTTPConfidence.exportLiteral(outfile, level, name_='LeveragedTTPConfidence')
            showIndent(outfile, level)
            outfile.write('),\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        super(LeveragedTTPType, self).buildAttributes(node, attrs, already_processed)
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'LeveragedTTPConfidence':
            obj_ = stix_common_binding.ConfidenceType.factory()
            obj_.build(child_)
            self.set_LeveragedTTPConfidence(obj_)
        super(LeveragedTTPType, self).buildChildren(child_, node, nodeName_, True)
# end class LeveragedTTPType



class TimeType(GeneratedsSuper):
    """TimeType corresponds to the Time element child of incident:IncidentType"""
    
    subclass = None
    superclass = None
    def __init__(self, FirstMaliciousAction=None, InitialCompromise=None, FirstDataExfiltration=None, IncidentDiscovery=None, IncidentOpened=None, ContainmentAcheived=None, RestorationAchieved=None, IncidentReported=None, IncidentClosed=None):
        self.FirstMaliciousAction = FirstMaliciousAction
        self.InitialCompromise = InitialCompromise
        self.FirstDataExfiltration = FirstDataExfiltration
        self.IncidentDiscovery = IncidentDiscovery
        self.IncidentOpened = IncidentOpened
        self.ContainmentAcheived = ContainmentAcheived
        self.RestorationAchieved = RestorationAchieved
        self.IncidentReported = IncidentReported
        self.IncidentClosed = IncidentClosed
    def factory(*args_, **kwargs_):
        if TimeType.subclass:
            return TimeType.subclass(*args_, **kwargs_)
        else:
            return TimeType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_FirstMaliciousAction(self): return self.FirstMaliciousAction
    def set_FirstMaliciousAction(self, FirstMaliciousAction): self.FirstMaliciousAction = FirstMaliciousAction
    def get_InitialCompromise(self): return self.InitialCompromise
    def set_InitialCompromise(self, InitialCompromise): self.InitialCompromise = InitialCompromise
    def get_FirstDataExfiltration(self): return self.FirstDataExfiltration
    def set_FirstDataExfiltration(self, FirstDataExfiltration): self.FirstDataExfiltration = FirstDataExfiltration
    def get_IncidentDiscovery(self): return self.IncidentDiscovery
    def set_IncidentDiscovery(self, IncidentDiscovery): self.IncidentDiscovery = IncidentDiscovery
    def get_IncidentOpened(self): return self.IncidentOpened
    def set_IncidentOpened(self, IncidentOpened): self.IncidentOpened = IncidentOpened
    def get_ContainmentAcheived(self): return self.ContainmentAcheived
    def set_ContainmentAcheived(self, ContainmentAcheived): self.ContainmentAcheived = ContainmentAcheived
    def get_RestorationAchieved(self): return self.RestorationAchieved
    def set_RestorationAchieved(self, RestorationAchieved): self.RestorationAchieved = RestorationAchieved
    def get_IncidentReported(self): return self.IncidentReported
    def set_IncidentReported(self, IncidentReported): self.IncidentReported = IncidentReported
    def get_IncidentClosed(self): return self.IncidentClosed
    def set_IncidentClosed(self, IncidentClosed): self.IncidentClosed = IncidentClosed
    def export(self, outfile, level, namespace_='incident:', name_='TimeType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='TimeType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='TimeType'):
        pass
    def exportChildren(self, outfile, level, namespace_='incident:', name_='TimeType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.FirstMaliciousAction is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sFirstMaliciousAction>%s</%sFirstMaliciousAction>%s' % (namespace_, self.gds_format_string(quote_xml(self.FirstMaliciousAction).encode(ExternalEncoding), input_name='FirstMaliciousAction'), namespace_, eol_))
        if self.InitialCompromise is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sInitialCompromise>%s</%sInitialCompromise>%s' % (namespace_, self.gds_format_string(quote_xml(self.InitialCompromise).encode(ExternalEncoding), input_name='InitialCompromise'), namespace_, eol_))
        if self.FirstDataExfiltration is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sFirstDataExfiltration>%s</%sFirstDataExfiltration>%s' % (namespace_, self.gds_format_string(quote_xml(self.FirstDataExfiltration).encode(ExternalEncoding), input_name='FirstDataExfiltration'), namespace_, eol_))
        if self.IncidentDiscovery is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sIncidentDiscovery>%s</%sIncidentDiscovery>%s' % (namespace_, self.gds_format_string(quote_xml(self.IncidentDiscovery).encode(ExternalEncoding), input_name='IncidentDiscovery'), namespace_, eol_))
        if self.IncidentOpened is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sIncidentOpened>%s</%sIncidentOpened>%s' % (namespace_, self.gds_format_string(quote_xml(self.IncidentOpened).encode(ExternalEncoding), input_name='IncidentOpened'), namespace_, eol_))
        if self.ContainmentAcheived is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sContainmentAcheived>%s</%sContainmentAcheived>%s' % (namespace_, self.gds_format_string(quote_xml(self.ContainmentAcheived).encode(ExternalEncoding), input_name='ContainmentAcheived'), namespace_, eol_))
        if self.RestorationAchieved is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sRestorationAchieved>%s</%sRestorationAchieved>%s' % (namespace_, self.gds_format_string(quote_xml(self.RestorationAchieved).encode(ExternalEncoding), input_name='RestorationAchieved'), namespace_, eol_))
        if self.IncidentReported is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sIncidentReported>%s</%sIncidentReported>%s' % (namespace_, self.gds_format_string(quote_xml(self.IncidentReported).encode(ExternalEncoding), input_name='IncidentReported'), namespace_, eol_))
        if self.IncidentClosed is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sIncidentClosed>%s</%sIncidentClosed>%s' % (namespace_, self.gds_format_string(quote_xml(self.IncidentClosed).encode(ExternalEncoding), input_name='IncidentClosed'), namespace_, eol_))
    def hasContent_(self):
        if (
            self.FirstMaliciousAction is not None or
            self.InitialCompromise is not None or
            self.FirstDataExfiltration is not None or
            self.IncidentDiscovery is not None or
            self.IncidentOpened is not None or
            self.ContainmentAcheived is not None or
            self.RestorationAchieved is not None or
            self.IncidentReported is not None or
            self.IncidentClosed is not None
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='TimeType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        if self.FirstMaliciousAction is not None:
            showIndent(outfile, level)
            outfile.write('FirstMaliciousAction=%s,\n' % quote_python(self.FirstMaliciousAction).encode(ExternalEncoding))
        if self.InitialCompromise is not None:
            showIndent(outfile, level)
            outfile.write('InitialCompromise=%s,\n' % quote_python(self.InitialCompromise).encode(ExternalEncoding))
        if self.FirstDataExfiltration is not None:
            showIndent(outfile, level)
            outfile.write('FirstDataExfiltration=%s,\n' % quote_python(self.FirstDataExfiltration).encode(ExternalEncoding))
        if self.IncidentDiscovery is not None:
            showIndent(outfile, level)
            outfile.write('IncidentDiscovery=%s,\n' % quote_python(self.IncidentDiscovery).encode(ExternalEncoding))
        if self.IncidentOpened is not None:
            showIndent(outfile, level)
            outfile.write('IncidentOpened=%s,\n' % quote_python(self.IncidentOpened).encode(ExternalEncoding))
        if self.ContainmentAcheived is not None:
            showIndent(outfile, level)
            outfile.write('ContainmentAcheived=%s,\n' % quote_python(self.ContainmentAcheived).encode(ExternalEncoding))
        if self.RestorationAchieved is not None:
            showIndent(outfile, level)
            outfile.write('RestorationAchieved=%s,\n' % quote_python(self.RestorationAchieved).encode(ExternalEncoding))
        if self.IncidentReported is not None:
            showIndent(outfile, level)
            outfile.write('IncidentReported=%s,\n' % quote_python(self.IncidentReported).encode(ExternalEncoding))
        if self.IncidentClosed is not None:
            showIndent(outfile, level)
            outfile.write('IncidentClosed=%s,\n' % quote_python(self.IncidentClosed).encode(ExternalEncoding))
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'FirstMaliciousAction':
            FirstMaliciousAction_ = child_.text
            FirstMaliciousAction_ = self.gds_validate_string(FirstMaliciousAction_, node, 'FirstMaliciousAction')
            self.FirstMaliciousAction = FirstMaliciousAction_
        elif nodeName_ == 'InitialCompromise':
            InitialCompromise_ = child_.text
            InitialCompromise_ = self.gds_validate_string(InitialCompromise_, node, 'InitialCompromise')
            self.InitialCompromise = InitialCompromise_
        elif nodeName_ == 'FirstDataExfiltration':
            FirstDataExfiltration_ = child_.text
            FirstDataExfiltration_ = self.gds_validate_string(FirstDataExfiltration_, node, 'FirstDataExfiltration')
            self.FirstDataExfiltration = FirstDataExfiltration_
        elif nodeName_ == 'IncidentDiscovery':
            IncidentDiscovery_ = child_.text
            IncidentDiscovery_ = self.gds_validate_string(IncidentDiscovery_, node, 'IncidentDiscovery')
            self.IncidentDiscovery = IncidentDiscovery_
        elif nodeName_ == 'IncidentOpened':
            IncidentOpened_ = child_.text
            IncidentOpened_ = self.gds_validate_string(IncidentOpened_, node, 'IncidentOpened')
            self.IncidentOpened = IncidentOpened_
        elif nodeName_ == 'ContainmentAcheived':
            ContainmentAcheived_ = child_.text
            ContainmentAcheived_ = self.gds_validate_string(ContainmentAcheived_, node, 'ContainmentAcheived')
            self.ContainmentAcheived = ContainmentAcheived_
        elif nodeName_ == 'RestorationAchieved':
            RestorationAchieved_ = child_.text
            RestorationAchieved_ = self.gds_validate_string(RestorationAchieved_, node, 'RestorationAchieved')
            self.RestorationAchieved = RestorationAchieved_
        elif nodeName_ == 'IncidentReported':
            IncidentReported_ = child_.text
            IncidentReported_ = self.gds_validate_string(IncidentReported_, node, 'IncidentReported')
            self.IncidentReported = IncidentReported_
        elif nodeName_ == 'IncidentClosed':
            IncidentClosed_ = child_.text
            IncidentClosed_ = self.gds_validate_string(IncidentClosed_, node, 'IncidentClosed')
            self.IncidentClosed = IncidentClosed_
# end class TimeType


class AffectedAssetsType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, AffectedAsset=None):
        if AffectedAsset is None:
            self.AffectedAsset = []
        else:
            self.AffectedAsset = AffectedAsset
    def factory(*args_, **kwargs_):
        if AffectedAssetsType.subclass:
            return AffectedAssetsType.subclass(*args_, **kwargs_)
        else:
            return AffectedAssetsType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_AffectedAsset(self): return self.AffectedAsset
    def set_AffectedAsset(self, AffectedAsset): self.AffectedAsset = AffectedAsset
    def add_AffectedAsset(self, value): self.AffectedAsset.append(value)
    def insert_AffectedAsset(self, index, value): self.AffectedAsset[index] = value
    def export(self, outfile, level, namespace_='incident:', name_='AffectedAssetsType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='AffectedAssetsType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='AffectedAssetsType'):
        pass
    def exportChildren(self, outfile, level, namespace_='incident:', name_='AffectedAssetsType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for AffectedAsset_ in self.AffectedAsset:
            AffectedAsset_.export(outfile, level, namespace_, name_='AffectedAsset', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.AffectedAsset
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='AffectedAssetsType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('AffectedAsset=[\n')
        level += 1
        for AffectedAsset_ in self.AffectedAsset:
            showIndent(outfile, level)
            outfile.write('model_.AffectedAssetType(\n')
            AffectedAsset_.exportLiteral(outfile, level, name_='AffectedAssetType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'AffectedAsset':
            obj_ = AffectedAssetType.factory()
            obj_.build(child_)
            self.AffectedAsset.append(obj_)
# end class AffectedAssetsType


class RelatedIndicatorsType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, RelatedIndicator=None):
        if RelatedIndicator is None:
            self.RelatedIndicator = []
        else:
            self.RelatedIndicator = RelatedIndicator
    def factory(*args_, **kwargs_):
        if RelatedIndicatorsType.subclass:
            return RelatedIndicatorsType.subclass(*args_, **kwargs_)
        else:
            return RelatedIndicatorsType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_RelatedIndicator(self): return self.RelatedIndicator
    def set_RelatedIndicator(self, RelatedIndicator): self.RelatedIndicator = RelatedIndicator
    def add_RelatedIndicator(self, value): self.RelatedIndicator.append(value)
    def insert_RelatedIndicator(self, index, value): self.RelatedIndicator[index] = value
    def export(self, outfile, level, namespace_='incident:', name_='RelatedIndicatorsType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='RelatedIndicatorsType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='RelatedIndicatorsType'):
        pass
    def exportChildren(self, outfile, level, namespace_='incident:', name_='RelatedIndicatorsType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for RelatedIndicator_ in self.RelatedIndicator:
            RelatedIndicator_.export(outfile, level, namespace_, name_='RelatedIndicator', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.RelatedIndicator
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='RelatedIndicatorsType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('RelatedIndicator=[\n')
        level += 1
        for RelatedIndicator_ in self.RelatedIndicator:
            showIndent(outfile, level)
            outfile.write('model_.RelatedIndicatorType(\n')
            RelatedIndicator_.exportLiteral(outfile, level, name_='RelatedIndicatorType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'RelatedIndicator':
            obj_ = RelatedIndicatorType.factory()
            obj_.build(child_)
            self.RelatedIndicator.append(obj_)
# end class RelatedIndicatorsType


class LeveragedTTPsType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, LeveragedTTP=None):
        if LeveragedTTP is None:
            self.LeveragedTTP = []
        else:
            self.LeveragedTTP = LeveragedTTP
    def factory(*args_, **kwargs_):
        if LeveragedTTPsType.subclass:
            return LeveragedTTPsType.subclass(*args_, **kwargs_)
        else:
            return LeveragedTTPsType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_LeveragedTTP(self): return self.LeveragedTTP
    def set_LeveragedTTP(self, LeveragedTTP): self.LeveragedTTP = LeveragedTTP
    def add_LeveragedTTP(self, value): self.LeveragedTTP.append(value)
    def insert_LeveragedTTP(self, index, value): self.LeveragedTTP[index] = value
    def export(self, outfile, level, namespace_='incident:', name_='LeveragedTTPsType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='LeveragedTTPsType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='LeveragedTTPsType'):
        pass
    def exportChildren(self, outfile, level, namespace_='incident:', name_='LeveragedTTPsType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for LeveragedTTP_ in self.LeveragedTTP:
            LeveragedTTP_.export(outfile, level, namespace_, name_='LeveragedTTP', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.LeveragedTTP
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='LeveragedTTPsType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('LeveragedTTP=[\n')
        level += 1
        for LeveragedTTP_ in self.LeveragedTTP:
            showIndent(outfile, level)
            outfile.write('model_.LeveragedTTPType(\n')
            LeveragedTTP_.exportLiteral(outfile, level, name_='LeveragedTTPType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'LeveragedTTP':
            obj_ = LeveragedTTPType.factory()
            obj_.build(child_)
            self.LeveragedTTP.append(obj_)
# end class LeveragedTTPsType


class RelatedThreatActorsType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, RelatedThreatActor=None):
        if RelatedThreatActor is None:
            self.RelatedThreatActor = []
        else:
            self.RelatedThreatActor = RelatedThreatActor
    def factory(*args_, **kwargs_):
        if RelatedThreatActorsType.subclass:
            return RelatedThreatActorsType.subclass(*args_, **kwargs_)
        else:
            return RelatedThreatActorsType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_RelatedThreatActor(self): return self.RelatedThreatActor
    def set_RelatedThreatActor(self, RelatedThreatActor): self.RelatedThreatActor = RelatedThreatActor
    def add_RelatedThreatActor(self, value): self.RelatedThreatActor.append(value)
    def insert_RelatedThreatActor(self, index, value): self.RelatedThreatActor[index] = value
    def export(self, outfile, level, namespace_='incident:', name_='RelatedThreatActorsType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='RelatedThreatActorsType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='RelatedThreatActorsType'):
        pass
    def exportChildren(self, outfile, level, namespace_='incident:', name_='RelatedThreatActorsType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for RelatedThreatActor_ in self.RelatedThreatActor:
            RelatedThreatActor_.export(outfile, level, namespace_, name_='RelatedThreatActor', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.RelatedThreatActor
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='RelatedThreatActorsType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('RelatedThreatActor=[\n')
        level += 1
        for RelatedThreatActor_ in self.RelatedThreatActor:
            showIndent(outfile, level)
            outfile.write('model_.ThreatActorType(\n')
            RelatedThreatActor_.exportLiteral(outfile, level, name_='ThreatActorType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'RelatedThreatActor':
            import stix.bindings.stix_threat_actor_0_5_1 as stix_threat_actor_binding # deferred import to fix circular
            class_obj_ = self.get_class_obj_(child_, stix_threat_actor_binding.ThreatActorType)
            obj_ = class_obj_.factory()
            obj_.build(child_)
            self.RelatedThreatActor.append(obj_)
# end class RelatedThreatActorsType

class RelatedIncidentsType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, RelatedIncident=None):
        if RelatedIncident is None:
            self.RelatedIncident = []
        else:
            self.RelatedIncident = RelatedIncident
    def factory(*args_, **kwargs_):
        if RelatedIncidentsType.subclass:
            return RelatedIncidentsType.subclass(*args_, **kwargs_)
        else:
            return RelatedIncidentsType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_RelatedIncident(self): return self.RelatedIncident
    def set_RelatedIncident(self, RelatedIncident): self.RelatedIncident = RelatedIncident
    def add_RelatedIncident(self, value): self.RelatedIncident.append(value)
    def insert_RelatedIncident(self, index, value): self.RelatedIncident[index] = value
    def export(self, outfile, level, namespace_='incident:', name_='RelatedIncidentsType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='RelatedIncidentsType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='RelatedIncidentsType'):
        pass
    def exportChildren(self, outfile, level, namespace_='incident:', name_='RelatedIncidentsType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for RelatedIncident_ in self.RelatedIncident:
            RelatedIncident_.export(outfile, level, namespace_, name_='RelatedIncident', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.RelatedIncident
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='RelatedIncidentsType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('RelatedIncident=[\n')
        level += 1
        for RelatedIncident_ in self.RelatedIncident:
            showIndent(outfile, level)
            outfile.write('model_.RelatedIncidentType(\n')
            RelatedIncident_.exportLiteral(outfile, level, name_='RelatedIncidentType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'RelatedIncident':
            obj_ = RelatedIncidentType.factory()
            obj_.build(child_)
            self.RelatedIncident.append(obj_)
# end class RelatedIncidentsType

class COARequestedType(GeneratedsSuper):
    """Specifies a suggested level of priority to be applied to this
    requested COA."""
    subclass = None
    superclass = None
    def __init__(self, Priority=None, Time=None, AssignedContact=None, CourseOfAction=None):
        self.Priority = _cast(None, Priority)
        self.Time = Time
        self.AssignedContact = AssignedContact
        self.CourseOfAction = CourseOfAction
    def factory(*args_, **kwargs_):
        if COARequestedType.subclass:
            return COARequestedType.subclass(*args_, **kwargs_)
        else:
            return COARequestedType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_Time(self): return self.Time
    def set_Time(self, Time): self.Time = Time
    def get_AssignedContact(self): return self.AssignedContact
    def set_AssignedContact(self, AssignedContact): self.AssignedContact = AssignedContact
    def get_CourseOfAction(self): return self.CourseOfAction
    def set_CourseOfAction(self, CourseOfAction): self.CourseOfAction = CourseOfAction
    def get_Priority(self): return self.Priority
    def set_Priority(self, Priority): self.Priority = Priority
    def export(self, outfile, level, namespace_='incident:', name_='COARequestedType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='COARequestedType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='COARequestedType'):
        if self.Priority is not None and 'Priority' not in already_processed:
            already_processed.append('Priority')
            outfile.write(' Priority=%s' % (self.gds_format_string(quote_attrib(self.Priority).encode(ExternalEncoding), input_name='Priority'), ))
    def exportChildren(self, outfile, level, namespace_='incident:', name_='COARequestedType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.Time is not None:
            self.Time.export(outfile, level, namespace_, name_='Time', pretty_print=pretty_print)
        if self.AssignedContact is not None:
            self.AssignedContact.export(outfile, level, namespace_, name_='AssignedContact', pretty_print=pretty_print)
        if self.CourseOfAction is not None:
            self.CourseOfAction.export(outfile, level, namespace_, name_='CourseOfAction', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.Time is not None or
            self.AssignedContact is not None or
            self.CourseOfAction is not None
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='COARequestedType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.Priority is not None and 'Priority' not in already_processed:
            already_processed.append('Priority')
            showIndent(outfile, level)
            outfile.write('Priority = "%s",\n' % (self.Priority,))
    def exportLiteralChildren(self, outfile, level, name_):
        if self.Time is not None:
            showIndent(outfile, level)
            outfile.write('Time=model_.TimeType2(\n')
            self.Time.exportLiteral(outfile, level, name_='Time')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.AssignedContact is not None:
            showIndent(outfile, level)
            outfile.write('AssignedContact=model_.ContributorType(\n')
            self.AssignedContact.exportLiteral(outfile, level, name_='AssignedContact')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.CourseOfAction is not None:
            showIndent(outfile, level)
            outfile.write('CourseOfAction=model_.COAType(\n')
            self.CourseOfAction.exportLiteral(outfile, level, name_='CourseOfAction')
            showIndent(outfile, level)
            outfile.write('),\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('Priority', node)
        if value is not None and 'Priority' not in already_processed:
            already_processed.append('Priority')
            self.Priority = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'Time':
            obj_ = TimeType2.factory()
            obj_.build(child_)
            self.set_Time(obj_)
        elif nodeName_ == 'AssignedContact':
            obj_ = cybox_common_binding.ContributorType.factory()
            obj_.build(child_)
            self.set_AssignedContact(obj_)
        elif nodeName_ == 'CourseOfAction':
            obj_ = stix_coa_binding.COAType.factory()
            obj_.build(child_)
            self.set_CourseOfAction(obj_)
# end class COARequestedType


class HistoryType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, HistoryItem=None):
        if HistoryItem is None:
            self.HistoryItem = []
        else:
            self.HistoryItem = HistoryItem
    def factory(*args_, **kwargs_):
        if HistoryType.subclass:
            return HistoryType.subclass(*args_, **kwargs_)
        else:
            return HistoryType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_HistoryItem(self): return self.HistoryItem
    def set_HistoryItem(self, HistoryItem): self.HistoryItem = HistoryItem
    def add_HistoryItem(self, value): self.HistoryItem.append(value)
    def insert_HistoryItem(self, index, value): self.HistoryItem[index] = value
    def export(self, outfile, level, namespace_='incident:', name_='HistoryType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='HistoryType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='HistoryType'):
        pass
    def exportChildren(self, outfile, level, namespace_='incident:', name_='HistoryType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for HistoryItem_ in self.HistoryItem:
            HistoryItem_.export(outfile, level, namespace_, name_='HistoryItem', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.HistoryItem
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='HistoryType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('HistoryItem=[\n')
        level += 1
        for HistoryItem_ in self.HistoryItem:
            showIndent(outfile, level)
            outfile.write('model_.HistoryItemType(\n')
            HistoryItem_.exportLiteral(outfile, level, name_='HistoryItemType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'HistoryItem':
            obj_ = HistoryItemType.factory()
            obj_.build(child_)
            self.HistoryItem.append(obj_)
# end class HistoryType


class HistoryItemType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, ActionEntry=None, JournalEntry=None):
        self.ActionEntry = ActionEntry
        self.JournalEntry = JournalEntry
    def factory(*args_, **kwargs_):
        if HistoryItemType.subclass:
            return HistoryItemType.subclass(*args_, **kwargs_)
        else:
            return HistoryItemType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_ActionEntry(self): return self.ActionEntry
    def set_ActionEntry(self, ActionEntry): self.ActionEntry = ActionEntry
    def get_JournalEntry(self): return self.JournalEntry
    def set_JournalEntry(self, JournalEntry): self.JournalEntry = JournalEntry
    def export(self, outfile, level, namespace_='incident:', name_='HistoryItemType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='HistoryItemType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='HistoryItemType'):
        pass
    def exportChildren(self, outfile, level, namespace_='incident:', name_='HistoryItemType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.ActionEntry is not None:
            self.ActionEntry.export(outfile, level, namespace_, name_='ActionEntry', pretty_print=pretty_print)
        if self.JournalEntry is not None:
            self.JournalEntry.export(outfile, level, namespace_, name_='JournalEntry', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.ActionEntry is not None or
            self.JournalEntry is not None
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='HistoryItemType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        if self.ActionEntry is not None:
            showIndent(outfile, level)
            outfile.write('ActionEntry=model_.COATakenType(\n')
            self.ActionEntry.exportLiteral(outfile, level, name_='ActionEntry')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.JournalEntry is not None:
            showIndent(outfile, level)
            outfile.write('JournalEntry=model_.JournalEntryType(\n')
            self.JournalEntry.exportLiteral(outfile, level, name_='JournalEntry')
            showIndent(outfile, level)
            outfile.write('),\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'ActionEntry':
            obj_ = COATakenType.factory()
            obj_.build(child_)
            self.set_ActionEntry(obj_)
        elif nodeName_ == 'JournalEntry':
            obj_ = JournalEntryType.factory()
            obj_.build(child_)
            self.set_JournalEntry(obj_)
# end class HistoryItemType

class TimeType2(GeneratedsSuper):
    """TimeType2 corresponds to the Time element nested under the COARequested element inside incident:IncidentType""" 
    subclass = None
    superclass = None
    def __init__(self, StartTime=None, EndTime=None):
        self.StartTime = StartTime
        self.EndTime = EndTime
    def factory(*args_, **kwargs_):
        if TimeType2.subclass:
            return TimeType2.subclass(*args_, **kwargs_)
        else:
            return TimeType2(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_StartTime(self): return self.StartTime
    def set_StartTime(self, StartTime): self.StartTime = StartTime
    def get_EndTime(self): return self.EndTime
    def set_EndTime(self, EndTime): self.EndTime = EndTime
    def export(self, outfile, level, namespace_='incident:', name_='TimeType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='TimeType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='TimeType'):
        pass
    def exportChildren(self, outfile, level, namespace_='incident:', name_='TimeType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.StartTime is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sStartTime>%s</%sStartTime>%s' % (namespace_, self.gds_format_string(quote_xml(self.StartTime).encode(ExternalEncoding), input_name='StartTime'), namespace_, eol_))
        if self.EndTime is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sEndTime>%s</%sEndTime>%s' % (namespace_, self.gds_format_string(quote_xml(self.EndTime).encode(ExternalEncoding), input_name='EndTime'), namespace_, eol_))
    def hasContent_(self):
        if (
            self.StartTime is not None or
            self.EndTime is not None
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='TimeType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        if self.StartTime is not None:
            showIndent(outfile, level)
            outfile.write('StartTime=%s,\n' % quote_python(self.StartTime).encode(ExternalEncoding))
        if self.EndTime is not None:
            showIndent(outfile, level)
            outfile.write('EndTime=%s,\n' % quote_python(self.EndTime).encode(ExternalEncoding))
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'StartTime':
            StartTime_ = child_.text
            StartTime_ = self.gds_validate_string(StartTime_, node, 'StartTime')
            self.StartTime = StartTime_
        elif nodeName_ == 'EndTime':
            EndTime_ = child_.text
            EndTime_ = self.gds_validate_string(EndTime_, node, 'EndTime')
            self.EndTime = EndTime_
# end class TimeType2


class ContributorsType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, Contributor=None):
        self.Contributor = Contributor
    def factory(*args_, **kwargs_):
        if ContributorsType.subclass:
            return ContributorsType.subclass(*args_, **kwargs_)
        else:
            return ContributorsType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_Contributor(self): return self.Contributor
    def set_Contributor(self, Contributor): self.Contributor = Contributor
    def export(self, outfile, level, namespace_='incident:', name_='ContributorsType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='ContributorsType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='ContributorsType'):
        pass
    def exportChildren(self, outfile, level, namespace_='incident:', name_='ContributorsType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.Contributor is not None:
            self.Contributor.export(outfile, level, namespace_, name_='Contributor', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.Contributor is not None
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='ContributorsType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        if self.Contributor is not None:
            showIndent(outfile, level)
            outfile.write('Contributor=model_.ContributorType(\n')
            self.Contributor.exportLiteral(outfile, level, name_='Contributor')
            showIndent(outfile, level)
            outfile.write('),\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'Contributor':
            obj_ = cybox_common_binding.ContributorType.factory().factory()
            obj_.build(child_)
            self.set_Contributor(obj_)
# end class ContributorsType

class TypeOfAvailabilityLossType(GeneratedsSuper):
    """This field specifies a reference to an availability loss type (e.g.
    Destruction, Deletion, Interruption) value reference. The value
    is a QName or URL that should reference a term in a controlled
    vocabulary which is understood by both the producing and
    consuming parties."""
    subclass = None
    superclass = None
    def __init__(self, availabilityLossTypeRef=None):
        self.availabilityLossTypeRef = _cast(None, availabilityLossTypeRef)
        pass
    def factory(*args_, **kwargs_):
        if TypeOfAvailabilityLossType.subclass:
            return TypeOfAvailabilityLossType.subclass(*args_, **kwargs_)
        else:
            return TypeOfAvailabilityLossType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_availabilityLossTypeRef(self): return self.availabilityLossTypeRef
    def set_availabilityLossTypeRef(self, availabilityLossTypeRef): self.availabilityLossTypeRef = availabilityLossTypeRef
    def export(self, outfile, level, namespace_='incident:', name_='TypeOfAvailabilityLossType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='TypeOfAvailabilityLossType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='TypeOfAvailabilityLossType'):
        if self.availabilityLossTypeRef is not None and 'availabilityLossTypeRef' not in already_processed:
            already_processed.append('availabilityLossTypeRef')
            outfile.write(' availabilityLossTypeRef=%s' % (self.gds_format_string(quote_attrib(self.availabilityLossTypeRef).encode(ExternalEncoding), input_name='availabilityLossTypeRef'), ))
    def exportChildren(self, outfile, level, namespace_='incident:', name_='TypeOfAvailabilityLossType', fromsubclass_=False, pretty_print=True):
        pass
    def hasContent_(self):
        if (

            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='TypeOfAvailabilityLossType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.availabilityLossTypeRef is not None and 'availabilityLossTypeRef' not in already_processed:
            already_processed.append('availabilityLossTypeRef')
            showIndent(outfile, level)
            outfile.write('availabilityLossTypeRef = "%s",\n' % (self.availabilityLossTypeRef,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('availabilityLossTypeRef', node)
        if value is not None and 'availabilityLossTypeRef' not in already_processed:
            already_processed.append('availabilityLossTypeRef')
            self.availabilityLossTypeRef = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class TypeOfAvailabilityLossType


class DurationOfAvailabilityLossType(GeneratedsSuper):
    """This field specifies a reference to an availability duration (e.g.
    Permanent, Seconds, Minutes, Hours, Days) value reference. The
    value is a QName or URL that should reference a term in a
    controlled vocabulary which is understood by both the producing
    and consuming parties."""
    subclass = None
    superclass = None
    def __init__(self, availabilityLossDurationRef=None):
        self.availabilityLossDurationRef = _cast(None, availabilityLossDurationRef)
        pass
    def factory(*args_, **kwargs_):
        if DurationOfAvailabilityLossType.subclass:
            return DurationOfAvailabilityLossType.subclass(*args_, **kwargs_)
        else:
            return DurationOfAvailabilityLossType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_availabilityLossDurationRef(self): return self.availabilityLossDurationRef
    def set_availabilityLossDurationRef(self, availabilityLossDurationRef): self.availabilityLossDurationRef = availabilityLossDurationRef
    def export(self, outfile, level, namespace_='incident:', name_='DurationOfAvailabilityLossType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='DurationOfAvailabilityLossType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='DurationOfAvailabilityLossType'):
        if self.availabilityLossDurationRef is not None and 'availabilityLossDurationRef' not in already_processed:
            already_processed.append('availabilityLossDurationRef')
            outfile.write(' availabilityLossDurationRef=%s' % (self.gds_format_string(quote_attrib(self.availabilityLossDurationRef).encode(ExternalEncoding), input_name='availabilityLossDurationRef'), ))
    def exportChildren(self, outfile, level, namespace_='incident:', name_='DurationOfAvailabilityLossType', fromsubclass_=False, pretty_print=True):
        pass
    def hasContent_(self):
        if (

            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='DurationOfAvailabilityLossType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.availabilityLossDurationRef is not None and 'availabilityLossDurationRef' not in already_processed:
            already_processed.append('availabilityLossDurationRef')
            showIndent(outfile, level)
            outfile.write('availabilityLossDurationRef = "%s",\n' % (self.availabilityLossDurationRef,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('availabilityLossDurationRef', node)
        if value is not None and 'availabilityLossDurationRef' not in already_processed:
            already_processed.append('availabilityLossDurationRef')
            self.availabilityLossDurationRef = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class DurationOfAvailabilityLossType


class NatureOfSecurityEffectType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, PropertyAffected=None):
        if PropertyAffected is None:
            self.PropertyAffected = []
        else:
            self.PropertyAffected = PropertyAffected
    def factory(*args_, **kwargs_):
        if NatureOfSecurityEffectType.subclass:
            return NatureOfSecurityEffectType.subclass(*args_, **kwargs_)
        else:
            return NatureOfSecurityEffectType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_PropertyAffected(self): return self.PropertyAffected
    def set_PropertyAffected(self, PropertyAffected): self.PropertyAffected = PropertyAffected
    def add_PropertyAffected(self, value): self.PropertyAffected.append(value)
    def insert_PropertyAffected(self, index, value): self.PropertyAffected[index] = value
    def export(self, outfile, level, namespace_='incident:', name_='NatureOfSecurityEffectType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='NatureOfSecurityEffectType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='NatureOfSecurityEffectType'):
        pass
    def exportChildren(self, outfile, level, namespace_='incident:', name_='NatureOfSecurityEffectType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for PropertyAffected_ in self.PropertyAffected:
            PropertyAffected_.export(outfile, level, namespace_, name_='PropertyAffected', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.PropertyAffected
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='NatureOfSecurityEffectType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('PropertyAffected=[\n')
        level += 1
        for PropertyAffected_ in self.PropertyAffected:
            showIndent(outfile, level)
            outfile.write('model_.PropertyAffectedType(\n')
            PropertyAffected_.exportLiteral(outfile, level, name_='PropertyAffectedType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'PropertyAffected':
            obj_ = PropertyAffectedType.factory()
            obj_.build(child_)
            self.PropertyAffected.append(obj_)
# end class NatureOfSecurityEffectType

class IODEF_IncidentType(GeneratedsSuper):
    """Specifies the identifier for the referenced Incident.Specifies a URL
    location reference for the referenced Incident."""
    subclass = None
    superclass = None
    def __init__(self, idref=None, LocationReference=None):
        self.idref = _cast(None, idref)
        self.LocationReference = _cast(None, LocationReference)
        pass
    def factory(*args_, **kwargs_):
        if IODEF_IncidentType.subclass:
            return IODEF_IncidentType.subclass(*args_, **kwargs_)
        else:
            return IODEF_IncidentType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_idref(self): return self.idref
    def set_idref(self, idref): self.idref = idref
    def get_LocationReference(self): return self.LocationReference
    def set_LocationReference(self, LocationReference): self.LocationReference = LocationReference
    def export(self, outfile, level, namespace_='incident:', name_='IODEF-IncidentType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='IODEF-IncidentType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='IODEF-IncidentType'):
        if self.idref is not None and 'idref' not in already_processed:
            already_processed.append('idref')
            outfile.write(' idref=%s' % (self.gds_format_string(quote_attrib(self.idref).encode(ExternalEncoding), input_name='idref'), ))
        if self.LocationReference is not None and 'LocationReference' not in already_processed:
            already_processed.append('LocationReference')
            outfile.write(' LocationReference=%s' % (self.gds_format_string(quote_attrib(self.LocationReference).encode(ExternalEncoding), input_name='LocationReference'), ))
    def exportChildren(self, outfile, level, namespace_='incident:', name_='IODEF-IncidentType', fromsubclass_=False, pretty_print=True):
        pass
    def hasContent_(self):
        if (

            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='IODEF-IncidentType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.idref is not None and 'idref' not in already_processed:
            already_processed.append('idref')
            showIndent(outfile, level)
            outfile.write('idref = "%s",\n' % (self.idref,))
        if self.LocationReference is not None and 'LocationReference' not in already_processed:
            already_processed.append('LocationReference')
            showIndent(outfile, level)
            outfile.write('LocationReference = "%s",\n' % (self.LocationReference,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('idref', node)
        if value is not None and 'idref' not in already_processed:
            already_processed.append('idref')
            self.idref = value
        value = find_attr_value_('LocationReference', node)
        if value is not None and 'LocationReference' not in already_processed:
            already_processed.append('LocationReference')
            self.LocationReference = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class IODEF_IncidentType


class DirectImpactSummaryType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, AssetLosses=None, Business_MisionDisruption=None, ResponseAndRecoveryCosts=None):
        self.AssetLosses = AssetLosses
        self.Business_MisionDisruption = Business_MisionDisruption
        self.ResponseAndRecoveryCosts = ResponseAndRecoveryCosts
    def factory(*args_, **kwargs_):
        if DirectImpactSummaryType.subclass:
            return DirectImpactSummaryType.subclass(*args_, **kwargs_)
        else:
            return DirectImpactSummaryType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_AssetLosses(self): return self.AssetLosses
    def set_AssetLosses(self, AssetLosses): self.AssetLosses = AssetLosses
    def validate_ImpactLevelEnum(self, value):
        # Validate type ImpactLevelEnum, a restriction on xs:string.
        pass
    def get_Business_MisionDisruption(self): return self.Business_MisionDisruption
    def set_Business_MisionDisruption(self, Business_MisionDisruption): self.Business_MisionDisruption = Business_MisionDisruption
    def get_ResponseAndRecoveryCosts(self): return self.ResponseAndRecoveryCosts
    def set_ResponseAndRecoveryCosts(self, ResponseAndRecoveryCosts): self.ResponseAndRecoveryCosts = ResponseAndRecoveryCosts
    def export(self, outfile, level, namespace_='incident:', name_='DirectImpactSummaryType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='DirectImpactSummaryType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='DirectImpactSummaryType'):
        pass
    def exportChildren(self, outfile, level, namespace_='incident:', name_='DirectImpactSummaryType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.AssetLosses is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sAssetLosses>%s</%sAssetLosses>%s' % (namespace_, self.gds_format_string(quote_xml(self.AssetLosses).encode(ExternalEncoding), input_name='AssetLosses'), namespace_, eol_))
        if self.Business_MisionDisruption is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sBusiness-MisionDisruption>%s</%sBusiness-MisionDisruption>%s' % (namespace_, self.gds_format_string(quote_xml(self.Business_MisionDisruption).encode(ExternalEncoding), input_name='Business-MisionDisruption'), namespace_, eol_))
        if self.ResponseAndRecoveryCosts is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sResponseAndRecoveryCosts>%s</%sResponseAndRecoveryCosts>%s' % (namespace_, self.gds_format_string(quote_xml(self.ResponseAndRecoveryCosts).encode(ExternalEncoding), input_name='ResponseAndRecoveryCosts'), namespace_, eol_))
    def hasContent_(self):
        if (
            self.AssetLosses is not None or
            self.Business_MisionDisruption is not None or
            self.ResponseAndRecoveryCosts is not None
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='DirectImpactSummaryType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        if self.AssetLosses is not None:
            showIndent(outfile, level)
            outfile.write('AssetLosses=%s,\n' % quote_python(self.AssetLosses).encode(ExternalEncoding))
        if self.Business_MisionDisruption is not None:
            showIndent(outfile, level)
            outfile.write('Business_MisionDisruption=%s,\n' % quote_python(self.Business_MisionDisruption).encode(ExternalEncoding))
        if self.ResponseAndRecoveryCosts is not None:
            showIndent(outfile, level)
            outfile.write('ResponseAndRecoveryCosts=%s,\n' % quote_python(self.ResponseAndRecoveryCosts).encode(ExternalEncoding))
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'AssetLosses':
            AssetLosses_ = child_.text
            AssetLosses_ = self.gds_validate_string(AssetLosses_, node, 'AssetLosses')
            self.AssetLosses = AssetLosses_
            self.validate_ImpactLevelEnum(self.AssetLosses)    # validate type ImpactLevelEnum
        elif nodeName_ == 'Business-MisionDisruption':
            Business_MisionDisruption_ = child_.text
            Business_MisionDisruption_ = self.gds_validate_string(Business_MisionDisruption_, node, 'Business_MisionDisruption')
            self.Business_MisionDisruption = Business_MisionDisruption_
            self.validate_ImpactLevelEnum(self.Business_MisionDisruption)    # validate type ImpactLevelEnum
        elif nodeName_ == 'ResponseAndRecoveryCosts':
            ResponseAndRecoveryCosts_ = child_.text
            ResponseAndRecoveryCosts_ = self.gds_validate_string(ResponseAndRecoveryCosts_, node, 'ResponseAndRecoveryCosts')
            self.ResponseAndRecoveryCosts = ResponseAndRecoveryCosts_
            self.validate_ImpactLevelEnum(self.ResponseAndRecoveryCosts)    # validate type ImpactLevelEnum
# end class DirectImpactSummaryType


class IndirectImpactSummaryType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, LossOfCompetitiveAdvantage=None, BrandAndMarketDamage=None, IncreasedOperatingCosts=None, LegalAndRegulatoryCosts=None):
        self.LossOfCompetitiveAdvantage = LossOfCompetitiveAdvantage
        self.BrandAndMarketDamage = BrandAndMarketDamage
        self.IncreasedOperatingCosts = IncreasedOperatingCosts
        self.LegalAndRegulatoryCosts = LegalAndRegulatoryCosts
    def factory(*args_, **kwargs_):
        if IndirectImpactSummaryType.subclass:
            return IndirectImpactSummaryType.subclass(*args_, **kwargs_)
        else:
            return IndirectImpactSummaryType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_LossOfCompetitiveAdvantage(self): return self.LossOfCompetitiveAdvantage
    def set_LossOfCompetitiveAdvantage(self, LossOfCompetitiveAdvantage): self.LossOfCompetitiveAdvantage = LossOfCompetitiveAdvantage
    def validate_ImpactLevelEnum(self, value):
        # Validate type ImpactLevelEnum, a restriction on xs:string.
        pass
    def get_BrandAndMarketDamage(self): return self.BrandAndMarketDamage
    def set_BrandAndMarketDamage(self, BrandAndMarketDamage): self.BrandAndMarketDamage = BrandAndMarketDamage
    def get_IncreasedOperatingCosts(self): return self.IncreasedOperatingCosts
    def set_IncreasedOperatingCosts(self, IncreasedOperatingCosts): self.IncreasedOperatingCosts = IncreasedOperatingCosts
    def get_LegalAndRegulatoryCosts(self): return self.LegalAndRegulatoryCosts
    def set_LegalAndRegulatoryCosts(self, LegalAndRegulatoryCosts): self.LegalAndRegulatoryCosts = LegalAndRegulatoryCosts
    def export(self, outfile, level, namespace_='incident:', name_='IndirectImpactSummaryType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='IndirectImpactSummaryType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='IndirectImpactSummaryType'):
        pass
    def exportChildren(self, outfile, level, namespace_='incident:', name_='IndirectImpactSummaryType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.LossOfCompetitiveAdvantage is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sLossOfCompetitiveAdvantage>%s</%sLossOfCompetitiveAdvantage>%s' % (namespace_, self.gds_format_string(quote_xml(self.LossOfCompetitiveAdvantage).encode(ExternalEncoding), input_name='LossOfCompetitiveAdvantage'), namespace_, eol_))
        if self.BrandAndMarketDamage is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sBrandAndMarketDamage>%s</%sBrandAndMarketDamage>%s' % (namespace_, self.gds_format_string(quote_xml(self.BrandAndMarketDamage).encode(ExternalEncoding), input_name='BrandAndMarketDamage'), namespace_, eol_))
        if self.IncreasedOperatingCosts is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sIncreasedOperatingCosts>%s</%sIncreasedOperatingCosts>%s' % (namespace_, self.gds_format_string(quote_xml(self.IncreasedOperatingCosts).encode(ExternalEncoding), input_name='IncreasedOperatingCosts'), namespace_, eol_))
        if self.LegalAndRegulatoryCosts is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sLegalAndRegulatoryCosts>%s</%sLegalAndRegulatoryCosts>%s' % (namespace_, self.gds_format_string(quote_xml(self.LegalAndRegulatoryCosts).encode(ExternalEncoding), input_name='LegalAndRegulatoryCosts'), namespace_, eol_))
    def hasContent_(self):
        if (
            self.LossOfCompetitiveAdvantage is not None or
            self.BrandAndMarketDamage is not None or
            self.IncreasedOperatingCosts is not None or
            self.LegalAndRegulatoryCosts is not None
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='IndirectImpactSummaryType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        if self.LossOfCompetitiveAdvantage is not None:
            showIndent(outfile, level)
            outfile.write('LossOfCompetitiveAdvantage=%s,\n' % quote_python(self.LossOfCompetitiveAdvantage).encode(ExternalEncoding))
        if self.BrandAndMarketDamage is not None:
            showIndent(outfile, level)
            outfile.write('BrandAndMarketDamage=%s,\n' % quote_python(self.BrandAndMarketDamage).encode(ExternalEncoding))
        if self.IncreasedOperatingCosts is not None:
            showIndent(outfile, level)
            outfile.write('IncreasedOperatingCosts=%s,\n' % quote_python(self.IncreasedOperatingCosts).encode(ExternalEncoding))
        if self.LegalAndRegulatoryCosts is not None:
            showIndent(outfile, level)
            outfile.write('LegalAndRegulatoryCosts=%s,\n' % quote_python(self.LegalAndRegulatoryCosts).encode(ExternalEncoding))
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'LossOfCompetitiveAdvantage':
            LossOfCompetitiveAdvantage_ = child_.text
            LossOfCompetitiveAdvantage_ = self.gds_validate_string(LossOfCompetitiveAdvantage_, node, 'LossOfCompetitiveAdvantage')
            self.LossOfCompetitiveAdvantage = LossOfCompetitiveAdvantage_
            self.validate_ImpactLevelEnum(self.LossOfCompetitiveAdvantage)    # validate type ImpactLevelEnum
        elif nodeName_ == 'BrandAndMarketDamage':
            BrandAndMarketDamage_ = child_.text
            BrandAndMarketDamage_ = self.gds_validate_string(BrandAndMarketDamage_, node, 'BrandAndMarketDamage')
            self.BrandAndMarketDamage = BrandAndMarketDamage_
            self.validate_ImpactLevelEnum(self.BrandAndMarketDamage)    # validate type ImpactLevelEnum
        elif nodeName_ == 'IncreasedOperatingCosts':
            IncreasedOperatingCosts_ = child_.text
            IncreasedOperatingCosts_ = self.gds_validate_string(IncreasedOperatingCosts_, node, 'IncreasedOperatingCosts')
            self.IncreasedOperatingCosts = IncreasedOperatingCosts_
            self.validate_ImpactLevelEnum(self.IncreasedOperatingCosts)    # validate type ImpactLevelEnum
        elif nodeName_ == 'LegalAndRegulatoryCosts':
            LegalAndRegulatoryCosts_ = child_.text
            LegalAndRegulatoryCosts_ = self.gds_validate_string(LegalAndRegulatoryCosts_, node, 'LegalAndRegulatoryCosts')
            self.LegalAndRegulatoryCosts = LegalAndRegulatoryCosts_
            self.validate_ImpactLevelEnum(self.LegalAndRegulatoryCosts)    # validate type ImpactLevelEnum
# end class IndirectImpactSummaryType


class TotalLossEstimationType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, InitialReportedTotalLossEstimation=None, ActualTotalLossEstimation=None):
        self.InitialReportedTotalLossEstimation = InitialReportedTotalLossEstimation
        self.ActualTotalLossEstimation = ActualTotalLossEstimation
    def factory(*args_, **kwargs_):
        if TotalLossEstimationType.subclass:
            return TotalLossEstimationType.subclass(*args_, **kwargs_)
        else:
            return TotalLossEstimationType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_InitialReportedTotalLossEstimation(self): return self.InitialReportedTotalLossEstimation
    def set_InitialReportedTotalLossEstimation(self, InitialReportedTotalLossEstimation): self.InitialReportedTotalLossEstimation = InitialReportedTotalLossEstimation
    def get_ActualTotalLossEstimation(self): return self.ActualTotalLossEstimation
    def set_ActualTotalLossEstimation(self, ActualTotalLossEstimation): self.ActualTotalLossEstimation = ActualTotalLossEstimation
    def export(self, outfile, level, namespace_='incident:', name_='TotalLossEstimationType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='TotalLossEstimationType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='TotalLossEstimationType'):
        pass
    def exportChildren(self, outfile, level, namespace_='incident:', name_='TotalLossEstimationType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.InitialReportedTotalLossEstimation is not None:
            self.InitialReportedTotalLossEstimation.export(outfile, level, namespace_, name_='InitialReportedTotalLossEstimation', pretty_print=pretty_print)
        if self.ActualTotalLossEstimation is not None:
            self.ActualTotalLossEstimation.export(outfile, level, namespace_, name_='ActualTotalLossEstimation', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.InitialReportedTotalLossEstimation is not None or
            self.ActualTotalLossEstimation is not None
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='TotalLossEstimationType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        if self.InitialReportedTotalLossEstimation is not None:
            showIndent(outfile, level)
            outfile.write('InitialReportedTotalLossEstimation=model_.InitialReportedTotalLossEstimationType(\n')
            self.InitialReportedTotalLossEstimation.exportLiteral(outfile, level, name_='InitialReportedTotalLossEstimation')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.ActualTotalLossEstimation is not None:
            showIndent(outfile, level)
            outfile.write('ActualTotalLossEstimation=model_.ActualTotalLossEstimationType(\n')
            self.ActualTotalLossEstimation.exportLiteral(outfile, level, name_='ActualTotalLossEstimation')
            showIndent(outfile, level)
            outfile.write('),\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'InitialReportedTotalLossEstimation':
            obj_ = InitialReportedTotalLossEstimationType.factory()
            obj_.build(child_)
            self.set_InitialReportedTotalLossEstimation(obj_)
        elif nodeName_ == 'ActualTotalLossEstimation':
            obj_ = ActualTotalLossEstimationType.factory()
            obj_.build(child_)
            self.set_ActualTotalLossEstimation(obj_)
# end class TotalLossEstimationType


class InitialReportedTotalLossEstimationType(GeneratedsSuper):
    """Specifies the amount of total estimated financial loss for the
    Incident.Specifies the ISO 4217 currency code if other than USD"""
    subclass = None
    superclass = None
    def __init__(self, iso_currency_code=None, amount=None):
        self.iso_currency_code = _cast(None, iso_currency_code)
        self.amount = _cast(None, amount)
        pass
    def factory(*args_, **kwargs_):
        if InitialReportedTotalLossEstimationType.subclass:
            return InitialReportedTotalLossEstimationType.subclass(*args_, **kwargs_)
        else:
            return InitialReportedTotalLossEstimationType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_iso_currency_code(self): return self.iso_currency_code
    def set_iso_currency_code(self, iso_currency_code): self.iso_currency_code = iso_currency_code
    def get_amount(self): return self.amount
    def set_amount(self, amount): self.amount = amount
    def export(self, outfile, level, namespace_='incident:', name_='InitialReportedTotalLossEstimationType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='InitialReportedTotalLossEstimationType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='InitialReportedTotalLossEstimationType'):
        if self.iso_currency_code is not None and 'iso_currency_code' not in already_processed:
            already_processed.append('iso_currency_code')
            outfile.write(' iso_currency_code=%s' % (self.gds_format_string(quote_attrib(self.iso_currency_code).encode(ExternalEncoding), input_name='iso_currency_code'), ))
        if self.amount is not None and 'amount' not in already_processed:
            already_processed.append('amount')
            outfile.write(' amount=%s' % (self.gds_format_string(quote_attrib(self.amount).encode(ExternalEncoding), input_name='amount'), ))
    def exportChildren(self, outfile, level, namespace_='incident:', name_='InitialReportedTotalLossEstimationType', fromsubclass_=False, pretty_print=True):
        pass
    def hasContent_(self):
        if (

            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='InitialReportedTotalLossEstimationType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.iso_currency_code is not None and 'iso_currency_code' not in already_processed:
            already_processed.append('iso_currency_code')
            showIndent(outfile, level)
            outfile.write('iso_currency_code = "%s",\n' % (self.iso_currency_code,))
        if self.amount is not None and 'amount' not in already_processed:
            already_processed.append('amount')
            showIndent(outfile, level)
            outfile.write('amount = "%s",\n' % (self.amount,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('iso_currency_code', node)
        if value is not None and 'iso_currency_code' not in already_processed:
            already_processed.append('iso_currency_code')
            self.iso_currency_code = value
        value = find_attr_value_('amount', node)
        if value is not None and 'amount' not in already_processed:
            already_processed.append('amount')
            self.amount = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class InitialReportedTotalLossEstimationType


class ActualTotalLossEstimationType(GeneratedsSuper):
    """Specifies the amount of total estimated financial loss for the
    Incident.Specifies the ISO 4217 currency code if other than USD"""
    subclass = None
    superclass = None
    def __init__(self, iso_currency_code=None, amount=None):
        self.iso_currency_code = _cast(None, iso_currency_code)
        self.amount = _cast(None, amount)
        pass
    def factory(*args_, **kwargs_):
        if ActualTotalLossEstimationType.subclass:
            return ActualTotalLossEstimationType.subclass(*args_, **kwargs_)
        else:
            return ActualTotalLossEstimationType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_iso_currency_code(self): return self.iso_currency_code
    def set_iso_currency_code(self, iso_currency_code): self.iso_currency_code = iso_currency_code
    def get_amount(self): return self.amount
    def set_amount(self, amount): self.amount = amount
    def export(self, outfile, level, namespace_='incident:', name_='ActualTotalLossEstimationType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='ActualTotalLossEstimationType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, 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_='incident:', name_='ActualTotalLossEstimationType'):
        if self.iso_currency_code is not None and 'iso_currency_code' not in already_processed:
            already_processed.append('iso_currency_code')
            outfile.write(' iso_currency_code=%s' % (self.gds_format_string(quote_attrib(self.iso_currency_code).encode(ExternalEncoding), input_name='iso_currency_code'), ))
        if self.amount is not None and 'amount' not in already_processed:
            already_processed.append('amount')
            outfile.write(' amount=%s' % (self.gds_format_string(quote_attrib(self.amount).encode(ExternalEncoding), input_name='amount'), ))
    def exportChildren(self, outfile, level, namespace_='incident:', name_='ActualTotalLossEstimationType', fromsubclass_=False, pretty_print=True):
        pass
    def hasContent_(self):
        if (

            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='ActualTotalLossEstimationType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.iso_currency_code is not None and 'iso_currency_code' not in already_processed:
            already_processed.append('iso_currency_code')
            showIndent(outfile, level)
            outfile.write('iso_currency_code = "%s",\n' % (self.iso_currency_code,))
        if self.amount is not None and 'amount' not in already_processed:
            already_processed.append('amount')
            showIndent(outfile, level)
            outfile.write('amount = "%s",\n' % (self.amount,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('iso_currency_code', node)
        if value is not None and 'iso_currency_code' not in already_processed:
            already_processed.append('iso_currency_code')
            self.iso_currency_code = value
        value = find_attr_value_('amount', node)
        if value is not None and 'amount' not in already_processed:
            already_processed.append('amount')
            self.amount = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class ActualTotalLossEstimationType




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 = globals().get(tag)
    return tag, rootClass

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

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

def parseLiteral(inFileName):
    doc = parsexml_(inFileName)
    rootNode = doc.getroot()
    rootTag, rootClass = get_root_tag(rootNode)
    if rootClass is None:
        rootTag = 'Incident'
        rootClass = IncidentType
    rootObj = rootClass.factory()
    rootObj.build(rootNode)
    # Enable Python to collect the space used by the DOM.
    doc = None
    sys.stdout.write('#from stix_exploit_incident_0_3 import *\n\n')
    sys.stdout.write('import stix_exploit_incident_0_3 as model_\n\n')
    sys.stdout.write('rootObj = model_.rootTag(\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__ = [
    "IncidentType",
    "PropertyAffectedType",
    "AffectedAssetType",
    "LeveragedTTPType",
    "RelatedIncidentType",
    "RelatedIndicatorType",
    "ImpactAssessmentType",
    "ExternalImpactAssessmentModelType",
    "COATakenType",
    "JournalEntryType"
    ]
