How to use quote_python method in autotest

Best Python code snippet using autotest_python

xml.py

Source:xml.py Github

copy

Full Screen

...202 s1 = "'%s'" % s1203 else:204 s1 = '"%s"' % s1205 return s1206def quote_python(inStr):207 s1 = inStr208 if s1.find("'") == -1:209 if s1.find('\n') == -1:210 return "'%s'" % s1211 else:212 return "'''%s'''" % s1213 else:214 if s1.find('"') != -1:215 s1 = s1.replace('"', '\\"')216 if s1.find('\n') == -1:217 return '"%s"' % s1218 else:219 return '"""%s"""' % s1220def get_all_text_(node):221 if node.text is not None:222 text = node.text223 else:224 text = ''225 for child in node:226 if child.tail is not None:227 text += child.tail228 return text229def find_attr_value_(attr_name, node):230 attrs = node.attrib231 attr_parts = attr_name.split(':')232 value = None233 if len(attr_parts) == 1:234 value = attrs.get(attr_name)235 elif len(attr_parts) == 2:236 prefix, name = attr_parts237 namespace = node.nsmap.get(prefix)238 if namespace is not None:239 value = attrs.get('{%s}%s' % (namespace, name, ))240 return value241class GDSParseError(Exception):242 pass243def raise_parse_error(node, msg):244 if XMLParser_import_library == XMLParser_import_lxml:245 msg = '%s (element %s/line %d)' % (msg, node.tag, node.sourceline, )246 else:247 msg = '%s (element %s)' % (msg, node.tag, )248 raise GDSParseError(msg)249class MixedContainer:250 # Constants for category:251 CategoryNone = 0252 CategoryText = 1253 CategorySimple = 2254 CategoryComplex = 3255 # Constants for content_type:256 TypeNone = 0257 TypeText = 1258 TypeString = 2259 TypeInteger = 3260 TypeFloat = 4261 TypeDecimal = 5262 TypeDouble = 6263 TypeBoolean = 7264 def __init__(self, category, content_type, name, value):265 self.category = category266 self.content_type = content_type267 self.name = name268 self.value = value269 def getCategory(self):270 return self.category271 def getContenttype(self, content_type):272 return self.content_type273 def getValue(self):274 return self.value275 def getName(self):276 return self.name277 def export(self, outfile, level, name, namespace, pretty_print=True):278 if self.category == MixedContainer.CategoryText:279 # Prevent exporting empty content as empty lines.280 if self.value.strip(): 281 outfile.write(self.value)282 elif self.category == MixedContainer.CategorySimple:283 self.exportSimple(outfile, level, name)284 else: # category == MixedContainer.CategoryComplex285 self.value.export(outfile, level, namespace, name, pretty_print)286 def exportSimple(self, outfile, level, name):287 if self.content_type == MixedContainer.TypeString:288 outfile.write('<%s>%s</%s>' % (self.name, self.value, self.name))289 elif self.content_type == MixedContainer.TypeInteger or \290 self.content_type == MixedContainer.TypeBoolean:291 outfile.write('<%s>%d</%s>' % (self.name, self.value, self.name))292 elif self.content_type == MixedContainer.TypeFloat or \293 self.content_type == MixedContainer.TypeDecimal:294 outfile.write('<%s>%f</%s>' % (self.name, self.value, self.name))295 elif self.content_type == MixedContainer.TypeDouble:296 outfile.write('<%s>%g</%s>' % (self.name, self.value, self.name))297 def exportLiteral(self, outfile, level, name):298 if self.category == MixedContainer.CategoryText:299 showIndent(outfile, level)300 outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \301 (self.category, self.content_type, self.name, self.value))302 elif self.category == MixedContainer.CategorySimple:303 showIndent(outfile, level)304 outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \305 (self.category, self.content_type, self.name, self.value))306 else: # category == MixedContainer.CategoryComplex307 showIndent(outfile, level)308 outfile.write('model_.MixedContainer(%d, %d, "%s",\n' % \309 (self.category, self.content_type, self.name,))310 self.value.exportLiteral(outfile, level + 1)311 showIndent(outfile, level)312 outfile.write(')\n')313class MemberSpec_(object):314 def __init__(self, name='', data_type='', container=0):315 self.name = name316 self.data_type = data_type317 self.container = container318 def set_name(self, name): self.name = name319 def get_name(self): return self.name320 def set_data_type(self, data_type): self.data_type = data_type321 def get_data_type_chain(self): return self.data_type322 def get_data_type(self):323 if isinstance(self.data_type, list):324 if len(self.data_type) > 0:325 return self.data_type[-1]326 else:327 return 'xs:string'328 else:329 return self.data_type330 def set_container(self, container): self.container = container331 def get_container(self): return self.container332def _cast(typ, value):333 if typ is None or value is None:334 return value335 return typ(value)336#337# Data representation classes.338#339class QuestionAnswerType(GeneratedsSuper):340 subclass = None341 superclass = None342 def __init__(self, QuestionID=None, Answer=None):343 self.QuestionID = QuestionID344 if Answer is None:345 self.Answer = []346 else:347 self.Answer = Answer348 def factory(*args_, **kwargs_):349 if QuestionAnswerType.subclass:350 return QuestionAnswerType.subclass(*args_, **kwargs_)351 else:352 return QuestionAnswerType(*args_, **kwargs_)353 factory = staticmethod(factory)354 def get_QuestionID(self): return self.QuestionID355 def set_QuestionID(self, QuestionID): self.QuestionID = QuestionID356 def get_Answer(self): return self.Answer357 def set_Answer(self, Answer): self.Answer = Answer358 def add_Answer(self, value): self.Answer.append(value)359 def insert_Answer(self, index, value): self.Answer[index] = value360 def export(self, outfile, level, namespace_='', name_='QuestionAnswerType', namespacedef_='', pretty_print=True):361 if pretty_print:362 eol_ = '\n'363 else:364 eol_ = ''365 showIndent(outfile, level, pretty_print)366 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))367 already_processed = []368 self.exportAttributes(outfile, level, already_processed, namespace_, name_='QuestionAnswerType')369 if self.hasContent_():370 outfile.write('>%s' % (eol_, ))371 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)372 showIndent(outfile, level, pretty_print)373 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))374 else:375 outfile.write('/>%s' % (eol_, ))376 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='QuestionAnswerType'):377 pass378 def exportChildren(self, outfile, level, namespace_='', name_='QuestionAnswerType', fromsubclass_=False, pretty_print=True):379 if pretty_print:380 eol_ = '\n'381 else:382 eol_ = ''383 if self.QuestionID is not None:384 showIndent(outfile, level, pretty_print)385 outfile.write('<%sQuestionID>%s</%sQuestionID>%s' % (namespace_, self.gds_format_integer(self.QuestionID, input_name='QuestionID'), namespace_, eol_))386 for Answer_ in self.Answer:387 Answer_.export(outfile, level, namespace_, name_='Answer', pretty_print=pretty_print)388 def hasContent_(self):389 if (390 self.QuestionID is not None or391 self.Answer392 ):393 return True394 else:395 return False396 def exportLiteral(self, outfile, level, name_='QuestionAnswerType'):397 level += 1398 self.exportLiteralAttributes(outfile, level, [], name_)399 if self.hasContent_():400 self.exportLiteralChildren(outfile, level, name_)401 def exportLiteralAttributes(self, outfile, level, already_processed, name_):402 pass403 def exportLiteralChildren(self, outfile, level, name_):404 if self.QuestionID is not None:405 showIndent(outfile, level)406 outfile.write('QuestionID=%d,\n' % self.QuestionID)407 showIndent(outfile, level)408 outfile.write('Answer=[\n')409 level += 1410 for Answer_ in self.Answer:411 showIndent(outfile, level)412 outfile.write('model_.AnswerType(\n')413 Answer_.exportLiteral(outfile, level, name_='AnswerType')414 showIndent(outfile, level)415 outfile.write('),\n')416 level -= 1417 showIndent(outfile, level)418 outfile.write('],\n')419 def build(self, node):420 self.buildAttributes(node, node.attrib, [])421 for child in node:422 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]423 self.buildChildren(child, node, nodeName_)424 def buildAttributes(self, node, attrs, already_processed):425 pass426 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):427 if nodeName_ == 'QuestionID':428 sval_ = child_.text429 try:430 ival_ = int(sval_)431 except (TypeError, ValueError), exp:432 raise_parse_error(child_, 'requires integer: %s' % exp)433 ival_ = self.gds_validate_integer(ival_, node, 'QuestionID')434 self.QuestionID = ival_435 elif nodeName_ == 'Answer':436 obj_ = AnswerType.factory()437 obj_.build(child_)438 self.Answer.append(obj_)439# end class QuestionAnswerType440class AnswerType(GeneratedsSuper):441 subclass = None442 superclass = None443 def __init__(self, OptionID=None, ModifyFlag=None, BrandID=None, DrinkCategoryID=None, CommunicationChannel=None, AnswerText=None):444 self.OptionID = OptionID445 self.ModifyFlag = ModifyFlag446 self.BrandID = BrandID447 self.DrinkCategoryID = DrinkCategoryID448 self.CommunicationChannel = CommunicationChannel449 self.AnswerText = AnswerText450 def factory(*args_, **kwargs_):451 if AnswerType.subclass:452 return AnswerType.subclass(*args_, **kwargs_)453 else:454 return AnswerType(*args_, **kwargs_)455 factory = staticmethod(factory)456 def get_OptionID(self): return self.OptionID457 def set_OptionID(self, OptionID): self.OptionID = OptionID458 def get_ModifyFlag(self): return self.ModifyFlag459 def set_ModifyFlag(self, ModifyFlag): self.ModifyFlag = ModifyFlag460 def validate_ModifyFlag(self, value):461 # Validate type ModifyFlag, a restriction on xs:string.462 pass463 def get_BrandID(self): return self.BrandID464 def set_BrandID(self, BrandID): self.BrandID = BrandID465 def validate_BrandID(self, value):466 # Validate type BrandID, a restriction on xs:long.467 pass468 def get_DrinkCategoryID(self): return self.DrinkCategoryID469 def set_DrinkCategoryID(self, DrinkCategoryID): self.DrinkCategoryID = DrinkCategoryID470 def validate_DrinkCategoryID(self, value):471 # Validate type DrinkCategoryID, a restriction on xs:long.472 pass473 def get_CommunicationChannel(self): return self.CommunicationChannel474 def set_CommunicationChannel(self, CommunicationChannel): self.CommunicationChannel = CommunicationChannel475 def validate_CommunicationChannel(self, value):476 # Validate type CommunicationChannel, a restriction on xs:byte.477 pass478 def get_AnswerText(self): return self.AnswerText479 def set_AnswerText(self, AnswerText): self.AnswerText = AnswerText480 def validate_AnswerText(self, value):481 # Validate type AnswerText, a restriction on xs:string.482 pass483 def export(self, outfile, level, namespace_='', name_='AnswerType', namespacedef_='', pretty_print=True):484 if pretty_print:485 eol_ = '\n'486 else:487 eol_ = ''488 showIndent(outfile, level, pretty_print)489 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))490 already_processed = []491 self.exportAttributes(outfile, level, already_processed, namespace_, name_='AnswerType')492 if self.hasContent_():493 outfile.write('>%s' % (eol_, ))494 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)495 showIndent(outfile, level, pretty_print)496 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))497 else:498 outfile.write('/>%s' % (eol_, ))499 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='AnswerType'):500 pass501 def exportChildren(self, outfile, level, namespace_='', name_='AnswerType', fromsubclass_=False, pretty_print=True):502 if pretty_print:503 eol_ = '\n'504 else:505 eol_ = ''506 if self.OptionID is not None:507 showIndent(outfile, level, pretty_print)508 outfile.write('<%sOptionID>%s</%sOptionID>%s' % (namespace_, self.gds_format_integer(self.OptionID, input_name='OptionID'), namespace_, eol_))509 if self.ModifyFlag is not None:510 showIndent(outfile, level, pretty_print)511 outfile.write('<%sModifyFlag>%s</%sModifyFlag>%s' % (namespace_, self.gds_format_string(quote_xml(self.ModifyFlag).encode(ExternalEncoding), input_name='ModifyFlag'), namespace_, eol_))512 if self.BrandID is not None:513 showIndent(outfile, level, pretty_print)514 outfile.write('<%sBrandID>%s</%sBrandID>%s' % (namespace_, self.gds_format_integer(self.BrandID, input_name='BrandID'), namespace_, eol_))515 if self.DrinkCategoryID is not None:516 showIndent(outfile, level, pretty_print)517 outfile.write('<%sDrinkCategoryID>%s</%sDrinkCategoryID>%s' % (namespace_, self.gds_format_integer(self.DrinkCategoryID, input_name='DrinkCategoryID'), namespace_, eol_))518 if self.CommunicationChannel is not None:519 showIndent(outfile, level, pretty_print)520 outfile.write('<%sCommunicationChannel>%s</%sCommunicationChannel>%s' % (namespace_, self.gds_format_integer(self.CommunicationChannel, input_name='CommunicationChannel'), namespace_, eol_))521 if self.AnswerText is not None:522 showIndent(outfile, level, pretty_print)523 outfile.write('<%sAnswerText>%s</%sAnswerText>%s' % (namespace_, self.gds_format_string(quote_xml(self.AnswerText).encode(ExternalEncoding), input_name='AnswerText'), namespace_, eol_))524 def hasContent_(self):525 if (526 self.OptionID is not None or527 self.ModifyFlag is not None or528 self.BrandID is not None or529 self.DrinkCategoryID is not None or530 self.CommunicationChannel is not None or531 self.AnswerText is not None532 ):533 return True534 else:535 return False536 def exportLiteral(self, outfile, level, name_='AnswerType'):537 level += 1538 self.exportLiteralAttributes(outfile, level, [], name_)539 if self.hasContent_():540 self.exportLiteralChildren(outfile, level, name_)541 def exportLiteralAttributes(self, outfile, level, already_processed, name_):542 pass543 def exportLiteralChildren(self, outfile, level, name_):544 if self.OptionID is not None:545 showIndent(outfile, level)546 outfile.write('OptionID=%d,\n' % self.OptionID)547 if self.ModifyFlag is not None:548 showIndent(outfile, level)549 outfile.write('ModifyFlag=%s,\n' % quote_python(self.ModifyFlag).encode(ExternalEncoding))550 if self.BrandID is not None:551 showIndent(outfile, level)552 outfile.write('BrandID=%d,\n' % self.BrandID)553 if self.DrinkCategoryID is not None:554 showIndent(outfile, level)555 outfile.write('DrinkCategoryID=%d,\n' % self.DrinkCategoryID)556 if self.CommunicationChannel is not None:557 showIndent(outfile, level)558 outfile.write('CommunicationChannel=%d,\n' % self.CommunicationChannel)559 if self.AnswerText is not None:560 showIndent(outfile, level)561 outfile.write('AnswerText=%s,\n' % quote_python(self.AnswerText).encode(ExternalEncoding))562 def build(self, node):563 self.buildAttributes(node, node.attrib, [])564 for child in node:565 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]566 self.buildChildren(child, node, nodeName_)567 def buildAttributes(self, node, attrs, already_processed):568 pass569 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):570 if nodeName_ == 'OptionID':571 sval_ = child_.text572 try:573 ival_ = int(sval_)574 except (TypeError, ValueError), exp:575 raise_parse_error(child_, 'requires integer: %s' % exp)576 ival_ = self.gds_validate_integer(ival_, node, 'OptionID')577 self.OptionID = ival_578 elif nodeName_ == 'ModifyFlag':579 ModifyFlag_ = child_.text580 ModifyFlag_ = self.gds_validate_string(ModifyFlag_, node, 'ModifyFlag')581 self.ModifyFlag = ModifyFlag_582 self.validate_ModifyFlag(self.ModifyFlag) # validate type ModifyFlag583 elif nodeName_ == 'BrandID':584 sval_ = child_.text585 try:586 ival_ = int(sval_)587 except (TypeError, ValueError), exp:588 raise_parse_error(child_, 'requires integer: %s' % exp)589 ival_ = self.gds_validate_integer(ival_, node, 'BrandID')590 self.BrandID = ival_591 self.validate_BrandID(self.BrandID) # validate type BrandID592 elif nodeName_ == 'DrinkCategoryID':593 sval_ = child_.text594 try:595 ival_ = int(sval_)596 except (TypeError, ValueError), exp:597 raise_parse_error(child_, 'requires integer: %s' % exp)598 ival_ = self.gds_validate_integer(ival_, node, 'DrinkCategoryID')599 self.DrinkCategoryID = ival_600 self.validate_DrinkCategoryID(self.DrinkCategoryID) # validate type DrinkCategoryID601 elif nodeName_ == 'CommunicationChannel':602 sval_ = child_.text603 try:604 ival_ = int(sval_)605 except (TypeError, ValueError), exp:606 raise_parse_error(child_, 'requires integer: %s' % exp)607 ival_ = self.gds_validate_integer(ival_, node, 'CommunicationChannel')608 self.CommunicationChannel = ival_609 self.validate_CommunicationChannel(self.CommunicationChannel) # validate type CommunicationChannel610 elif nodeName_ == 'AnswerText':611 AnswerText_ = child_.text612 AnswerText_ = self.gds_validate_string(AnswerText_, node, 'AnswerText')613 self.AnswerText = AnswerText_614 self.validate_AnswerText(self.AnswerText) # validate type AnswerText615# end class AnswerType616class EmailDetailsType(GeneratedsSuper):617 subclass = None618 superclass = None619 def __init__(self, Id=None, EmailId=None, EmailCategory=None, IsDefaultFlag=None, ModifyFlag=None):620 self.Id = Id621 self.EmailId = EmailId622 self.EmailCategory = EmailCategory623 self.IsDefaultFlag = IsDefaultFlag624 self.ModifyFlag = ModifyFlag625 def factory(*args_, **kwargs_):626 if EmailDetailsType.subclass:627 return EmailDetailsType.subclass(*args_, **kwargs_)628 else:629 return EmailDetailsType(*args_, **kwargs_)630 factory = staticmethod(factory)631 def get_Id(self): return self.Id632 def set_Id(self, Id): self.Id = Id633 def get_EmailId(self): return self.EmailId634 def set_EmailId(self, EmailId): self.EmailId = EmailId635 def validate_EmailId(self, value):636 # Validate type EmailId, a restriction on xs:string.637 pass638 def get_EmailCategory(self): return self.EmailCategory639 def set_EmailCategory(self, EmailCategory): self.EmailCategory = EmailCategory640 def validate_EmailCategory(self, value):641 # Validate type EmailCategory, a restriction on xs:byte.642 pass643 def get_IsDefaultFlag(self): return self.IsDefaultFlag644 def set_IsDefaultFlag(self, IsDefaultFlag): self.IsDefaultFlag = IsDefaultFlag645 def validate_IsDefaultFlagType(self, value):646 # Validate type IsDefaultFlagType, a restriction on xs:byte.647 pass648 def get_ModifyFlag(self): return self.ModifyFlag649 def set_ModifyFlag(self, ModifyFlag): self.ModifyFlag = ModifyFlag650 def export(self, outfile, level, namespace_='', name_='EmailDetailsType', namespacedef_='', pretty_print=True):651 if pretty_print:652 eol_ = '\n'653 else:654 eol_ = ''655 showIndent(outfile, level, pretty_print)656 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))657 already_processed = []658 self.exportAttributes(outfile, level, already_processed, namespace_, name_='EmailDetailsType')659 if self.hasContent_():660 outfile.write('>%s' % (eol_, ))661 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)662 showIndent(outfile, level, pretty_print)663 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))664 else:665 outfile.write('/>%s' % (eol_, ))666 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='EmailDetailsType'):667 pass668 def exportChildren(self, outfile, level, namespace_='', name_='EmailDetailsType', fromsubclass_=False, pretty_print=True):669 if pretty_print:670 eol_ = '\n'671 else:672 eol_ = ''673 if self.Id is not None:674 showIndent(outfile, level, pretty_print)675 outfile.write('<%sId>%s</%sId>%s' % (namespace_, self.gds_format_integer(self.Id, input_name='Id'), namespace_, eol_))676 if self.EmailId is not None:677 showIndent(outfile, level, pretty_print)678 outfile.write('<%sEmailId>%s</%sEmailId>%s' % (namespace_, self.gds_format_string(quote_xml(self.EmailId).encode(ExternalEncoding), input_name='EmailId'), namespace_, eol_))679 if self.EmailCategory is not None:680 showIndent(outfile, level, pretty_print)681 outfile.write('<%sEmailCategory>%s</%sEmailCategory>%s' % (namespace_, self.gds_format_integer(self.EmailCategory, input_name='EmailCategory'), namespace_, eol_))682 if self.IsDefaultFlag is not None:683 showIndent(outfile, level, pretty_print)684 outfile.write('<%sIsDefaultFlag>%s</%sIsDefaultFlag>%s' % (namespace_, self.gds_format_integer(self.IsDefaultFlag, input_name='IsDefaultFlag'), namespace_, eol_))685 if self.ModifyFlag is not None:686 showIndent(outfile, level, pretty_print)687 outfile.write('<%sModifyFlag>%s</%sModifyFlag>%s' % (namespace_, self.gds_format_string(quote_xml(self.ModifyFlag).encode(ExternalEncoding), input_name='ModifyFlag'), namespace_, eol_))688 def hasContent_(self):689 if (690 self.Id is not None or691 self.EmailId is not None or692 self.EmailCategory is not None or693 self.IsDefaultFlag is not None or694 self.ModifyFlag is not None695 ):696 return True697 else:698 return False699 def exportLiteral(self, outfile, level, name_='EmailDetailsType'):700 level += 1701 self.exportLiteralAttributes(outfile, level, [], name_)702 if self.hasContent_():703 self.exportLiteralChildren(outfile, level, name_)704 def exportLiteralAttributes(self, outfile, level, already_processed, name_):705 pass706 def exportLiteralChildren(self, outfile, level, name_):707 if self.Id is not None:708 showIndent(outfile, level)709 outfile.write('Id=%d,\n' % self.Id)710 if self.EmailId is not None:711 showIndent(outfile, level)712 outfile.write('EmailId=%s,\n' % quote_python(self.EmailId).encode(ExternalEncoding))713 if self.EmailCategory is not None:714 showIndent(outfile, level)715 outfile.write('EmailCategory=%d,\n' % self.EmailCategory)716 if self.IsDefaultFlag is not None:717 showIndent(outfile, level)718 outfile.write('IsDefaultFlag=%d,\n' % self.IsDefaultFlag)719 if self.ModifyFlag is not None:720 showIndent(outfile, level)721 outfile.write('ModifyFlag=%s,\n' % quote_python(self.ModifyFlag).encode(ExternalEncoding))722 def build(self, node):723 self.buildAttributes(node, node.attrib, [])724 for child in node:725 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]726 self.buildChildren(child, node, nodeName_)727 def buildAttributes(self, node, attrs, already_processed):728 pass729 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):730 if nodeName_ == 'Id':731 sval_ = child_.text732 try:733 ival_ = int(sval_)734 except (TypeError, ValueError), exp:735 raise_parse_error(child_, 'requires integer: %s' % exp)736 ival_ = self.gds_validate_integer(ival_, node, 'Id')737 self.Id = ival_738 elif nodeName_ == 'EmailId':739 EmailId_ = child_.text740 EmailId_ = self.gds_validate_string(EmailId_, node, 'EmailId')741 self.EmailId = EmailId_742 self.validate_EmailId(self.EmailId) # validate type EmailId743 elif nodeName_ == 'EmailCategory':744 sval_ = child_.text745 try:746 ival_ = int(sval_)747 except (TypeError, ValueError), exp:748 raise_parse_error(child_, 'requires integer: %s' % exp)749 ival_ = self.gds_validate_integer(ival_, node, 'EmailCategory')750 self.EmailCategory = ival_751 self.validate_EmailCategory(self.EmailCategory) # validate type EmailCategory752 elif nodeName_ == 'IsDefaultFlag':753 sval_ = child_.text754 try:755 ival_ = int(sval_)756 except (TypeError, ValueError), exp:757 raise_parse_error(child_, 'requires integer: %s' % exp)758 ival_ = self.gds_validate_integer(ival_, node, 'IsDefaultFlag')759 self.IsDefaultFlag = ival_760 self.validate_IsDefaultFlagType(self.IsDefaultFlag) # validate type IsDefaultFlagType761 elif nodeName_ == 'ModifyFlag':762 ModifyFlag_ = child_.text763 ModifyFlag_ = self.gds_validate_string(ModifyFlag_, node, 'ModifyFlag')764 self.ModifyFlag = ModifyFlag_765# end class EmailDetailsType766class UserAccountType(GeneratedsSuper):767 subclass = None768 superclass = None769 def __init__(self, LoginCredentials=None, SecretQuestions=None):770 self.LoginCredentials = LoginCredentials771 self.SecretQuestions = SecretQuestions772 def factory(*args_, **kwargs_):773 if UserAccountType.subclass:774 return UserAccountType.subclass(*args_, **kwargs_)775 else:776 return UserAccountType(*args_, **kwargs_)777 factory = staticmethod(factory)778 def get_LoginCredentials(self): return self.LoginCredentials779 def set_LoginCredentials(self, LoginCredentials): self.LoginCredentials = LoginCredentials780 def get_SecretQuestions(self): return self.SecretQuestions781 def set_SecretQuestions(self, SecretQuestions): self.SecretQuestions = SecretQuestions782 def export(self, outfile, level, namespace_='', name_='UserAccountType', namespacedef_='', pretty_print=True):783 if pretty_print:784 eol_ = '\n'785 else:786 eol_ = ''787 showIndent(outfile, level, pretty_print)788 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))789 already_processed = []790 self.exportAttributes(outfile, level, already_processed, namespace_, name_='UserAccountType')791 if self.hasContent_():792 outfile.write('>%s' % (eol_, ))793 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)794 showIndent(outfile, level, pretty_print)795 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))796 else:797 outfile.write('/>%s' % (eol_, ))798 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='UserAccountType'):799 pass800 def exportChildren(self, outfile, level, namespace_='', name_='UserAccountType', fromsubclass_=False, pretty_print=True):801 if pretty_print:802 eol_ = '\n'803 else:804 eol_ = ''805 if self.LoginCredentials is not None:806 self.LoginCredentials.export(outfile, level, namespace_, name_='LoginCredentials', pretty_print=pretty_print)807 if self.SecretQuestions is not None:808 self.SecretQuestions.export(outfile, level, namespace_, name_='SecretQuestions', pretty_print=pretty_print)809 def hasContent_(self):810 if (811 self.LoginCredentials is not None or812 self.SecretQuestions is not None813 ):814 return True815 else:816 return False817 def exportLiteral(self, outfile, level, name_='UserAccountType'):818 level += 1819 self.exportLiteralAttributes(outfile, level, [], name_)820 if self.hasContent_():821 self.exportLiteralChildren(outfile, level, name_)822 def exportLiteralAttributes(self, outfile, level, already_processed, name_):823 pass824 def exportLiteralChildren(self, outfile, level, name_):825 if self.LoginCredentials is not None:826 showIndent(outfile, level)827 outfile.write('LoginCredentials=model_.LoginCredentialsType(\n')828 self.LoginCredentials.exportLiteral(outfile, level, name_='LoginCredentials')829 showIndent(outfile, level)830 outfile.write('),\n')831 if self.SecretQuestions is not None:832 showIndent(outfile, level)833 outfile.write('SecretQuestions=model_.QuestionAnswerType(\n')834 self.SecretQuestions.exportLiteral(outfile, level, name_='SecretQuestions')835 showIndent(outfile, level)836 outfile.write('),\n')837 def build(self, node):838 self.buildAttributes(node, node.attrib, [])839 for child in node:840 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]841 self.buildChildren(child, node, nodeName_)842 def buildAttributes(self, node, attrs, already_processed):843 pass844 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):845 if nodeName_ == 'LoginCredentials':846 obj_ = LoginCredentialsType.factory()847 obj_.build(child_)848 self.set_LoginCredentials(obj_)849 elif nodeName_ == 'SecretQuestions':850 obj_ = QuestionAnswerType.factory()851 obj_.build(child_)852 self.set_SecretQuestions(obj_)853# end class UserAccountType854class LoginCredentialsType(GeneratedsSuper):855 subclass = None856 superclass = None857 def __init__(self, LoginName=None, Password=None):858 self.LoginName = LoginName859 self.Password = Password860 def factory(*args_, **kwargs_):861 if LoginCredentialsType.subclass:862 return LoginCredentialsType.subclass(*args_, **kwargs_)863 else:864 return LoginCredentialsType(*args_, **kwargs_)865 factory = staticmethod(factory)866 def get_LoginName(self): return self.LoginName867 def set_LoginName(self, LoginName): self.LoginName = LoginName868 def validate_LoginName(self, value):869 # Validate type LoginName, a restriction on Name.870 pass871 def get_Password(self): return self.Password872 def set_Password(self, Password): self.Password = Password873 def validate_Password(self, value):874 # Validate type Password, a restriction on xs:string.875 pass876 def export(self, outfile, level, namespace_='', name_='LoginCredentialsType', namespacedef_='', pretty_print=True):877 if pretty_print:878 eol_ = '\n'879 else:880 eol_ = ''881 showIndent(outfile, level, pretty_print)882 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))883 already_processed = []884 self.exportAttributes(outfile, level, already_processed, namespace_, name_='LoginCredentialsType')885 if self.hasContent_():886 outfile.write('>%s' % (eol_, ))887 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)888 showIndent(outfile, level, pretty_print)889 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))890 else:891 outfile.write('/>%s' % (eol_, ))892 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='LoginCredentialsType'):893 pass894 def exportChildren(self, outfile, level, namespace_='', name_='LoginCredentialsType', fromsubclass_=False, pretty_print=True):895 if pretty_print:896 eol_ = '\n'897 else:898 eol_ = ''899 if self.LoginName is not None:900 showIndent(outfile, level, pretty_print)901 outfile.write('<%sLoginName>%s</%sLoginName>%s' % (namespace_, self.gds_format_string(quote_xml(self.LoginName).encode(ExternalEncoding), input_name='LoginName'), namespace_, eol_))902 if self.Password is not None:903 showIndent(outfile, level, pretty_print)904 outfile.write('<%sPassword>%s</%sPassword>%s' % (namespace_, self.gds_format_string(quote_xml(self.Password).encode(ExternalEncoding), input_name='Password'), namespace_, eol_))905 def hasContent_(self):906 if (907 self.LoginName is not None or908 self.Password is not None909 ):910 return True911 else:912 return False913 def exportLiteral(self, outfile, level, name_='LoginCredentialsType'):914 level += 1915 self.exportLiteralAttributes(outfile, level, [], name_)916 if self.hasContent_():917 self.exportLiteralChildren(outfile, level, name_)918 def exportLiteralAttributes(self, outfile, level, already_processed, name_):919 pass920 def exportLiteralChildren(self, outfile, level, name_):921 if self.LoginName is not None:922 showIndent(outfile, level)923 outfile.write('LoginName=%s,\n' % quote_python(self.LoginName).encode(ExternalEncoding))924 if self.Password is not None:925 showIndent(outfile, level)926 outfile.write('Password=%s,\n' % quote_python(self.Password).encode(ExternalEncoding))927 def build(self, node):928 self.buildAttributes(node, node.attrib, [])929 for child in node:930 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]931 self.buildChildren(child, node, nodeName_)932 def buildAttributes(self, node, attrs, already_processed):933 pass934 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):935 if nodeName_ == 'LoginName':936 LoginName_ = child_.text937 LoginName_ = self.gds_validate_string(LoginName_, node, 'LoginName')938 self.LoginName = LoginName_939 self.validate_LoginName(self.LoginName) # validate type LoginName940 elif nodeName_ == 'Password':941 Password_ = child_.text942 Password_ = self.gds_validate_string(Password_, node, 'Password')943 self.Password = Password_944 self.validate_Password(self.Password) # validate type Password945# end class LoginCredentialsType946class UserIdentificationDataType(GeneratedsSuper):947 subclass = None948 superclass = None949 def __init__(self, ConsumerID=None, LoginName=None, EmailID=None, TempToken=None):950 self.ConsumerID = ConsumerID951 self.LoginName = LoginName952 self.EmailID = EmailID953 self.TempToken = TempToken954 def factory(*args_, **kwargs_):955 if UserIdentificationDataType.subclass:956 return UserIdentificationDataType.subclass(*args_, **kwargs_)957 else:958 return UserIdentificationDataType(*args_, **kwargs_)959 factory = staticmethod(factory)960 def get_ConsumerID(self): return self.ConsumerID961 def set_ConsumerID(self, ConsumerID): self.ConsumerID = ConsumerID962 def validate_ConsumerIDType(self, value):963 # Validate type ConsumerIDType, a restriction on xs:long.964 pass965 def get_LoginName(self): return self.LoginName966 def set_LoginName(self, LoginName): self.LoginName = LoginName967 def validate_Name(self, value):968 # Validate type Name, a restriction on xs:string.969 pass970 def get_EmailID(self): return self.EmailID971 def set_EmailID(self, EmailID): self.EmailID = EmailID972 def validate_EmailId(self, value):973 # Validate type EmailId, a restriction on xs:string.974 pass975 def get_TempToken(self): return self.TempToken976 def set_TempToken(self, TempToken): self.TempToken = TempToken977 def validate_Token(self, value):978 # Validate type Token, a restriction on xs:string.979 pass980 def export(self, outfile, level, namespace_='', name_='UserIdentificationDataType', namespacedef_='', pretty_print=True):981 if pretty_print:982 eol_ = '\n'983 else:984 eol_ = ''985 showIndent(outfile, level, pretty_print)986 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))987 already_processed = []988 self.exportAttributes(outfile, level, already_processed, namespace_, name_='UserIdentificationDataType')989 if self.hasContent_():990 outfile.write('>%s' % (eol_, ))991 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)992 showIndent(outfile, level, pretty_print)993 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))994 else:995 outfile.write('/>%s' % (eol_, ))996 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='UserIdentificationDataType'):997 pass998 def exportChildren(self, outfile, level, namespace_='', name_='UserIdentificationDataType', fromsubclass_=False, pretty_print=True):999 if pretty_print:1000 eol_ = '\n'1001 else:1002 eol_ = ''1003 if self.ConsumerID is not None:1004 showIndent(outfile, level, pretty_print)1005 outfile.write('<%sConsumerID>%s</%sConsumerID>%s' % (namespace_, self.gds_format_integer(self.ConsumerID, input_name='ConsumerID'), namespace_, eol_))1006 if self.LoginName is not None:1007 showIndent(outfile, level, pretty_print)1008 outfile.write('<%sLoginName>%s</%sLoginName>%s' % (namespace_, self.gds_format_string(quote_xml(self.LoginName).encode(ExternalEncoding), input_name='LoginName'), namespace_, eol_))1009 if self.EmailID is not None:1010 showIndent(outfile, level, pretty_print)1011 outfile.write('<%sEmailID>%s</%sEmailID>%s' % (namespace_, self.gds_format_string(quote_xml(self.EmailID).encode(ExternalEncoding), input_name='EmailID'), namespace_, eol_))1012 if self.TempToken is not None:1013 showIndent(outfile, level, pretty_print)1014 outfile.write('<%sTempToken>%s</%sTempToken>%s' % (namespace_, self.gds_format_string(quote_xml(self.TempToken).encode(ExternalEncoding), input_name='TempToken'), namespace_, eol_))1015 def hasContent_(self):1016 if (1017 self.ConsumerID is not None or1018 self.LoginName is not None or1019 self.EmailID is not None or1020 self.TempToken is not None1021 ):1022 return True1023 else:1024 return False1025 def exportLiteral(self, outfile, level, name_='UserIdentificationDataType'):1026 level += 11027 self.exportLiteralAttributes(outfile, level, [], name_)1028 if self.hasContent_():1029 self.exportLiteralChildren(outfile, level, name_)1030 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1031 pass1032 def exportLiteralChildren(self, outfile, level, name_):1033 if self.ConsumerID is not None:1034 showIndent(outfile, level)1035 outfile.write('ConsumerID=%d,\n' % self.ConsumerID)1036 if self.LoginName is not None:1037 showIndent(outfile, level)1038 outfile.write('LoginName=%s,\n' % quote_python(self.LoginName).encode(ExternalEncoding))1039 if self.EmailID is not None:1040 showIndent(outfile, level)1041 outfile.write('EmailID=%s,\n' % quote_python(self.EmailID).encode(ExternalEncoding))1042 if self.TempToken is not None:1043 showIndent(outfile, level)1044 outfile.write('TempToken=%s,\n' % quote_python(self.TempToken).encode(ExternalEncoding))1045 def build(self, node):1046 self.buildAttributes(node, node.attrib, [])1047 for child in node:1048 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1049 self.buildChildren(child, node, nodeName_)1050 def buildAttributes(self, node, attrs, already_processed):1051 pass1052 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1053 if nodeName_ == 'ConsumerID':1054 sval_ = child_.text1055 try:1056 ival_ = int(sval_)1057 except (TypeError, ValueError), exp:1058 raise_parse_error(child_, 'requires integer: %s' % exp)1059 ival_ = self.gds_validate_integer(ival_, node, 'ConsumerID')1060 self.ConsumerID = ival_1061 self.validate_ConsumerIDType(self.ConsumerID) # validate type ConsumerIDType1062 elif nodeName_ == 'LoginName':1063 LoginName_ = child_.text1064 LoginName_ = self.gds_validate_string(LoginName_, node, 'LoginName')1065 self.LoginName = LoginName_1066 self.validate_Name(self.LoginName) # validate type Name1067 elif nodeName_ == 'EmailID':1068 EmailID_ = child_.text1069 EmailID_ = self.gds_validate_string(EmailID_, node, 'EmailID')1070 self.EmailID = EmailID_1071 self.validate_EmailId(self.EmailID) # validate type EmailId1072 elif nodeName_ == 'TempToken':1073 TempToken_ = child_.text1074 TempToken_ = self.gds_validate_string(TempToken_, node, 'TempToken')1075 self.TempToken = TempToken_1076 self.validate_Token(self.TempToken) # validate type Token1077# end class UserIdentificationDataType1078class ExtendedOptInPreferencesType(GeneratedsSuper):1079 subclass = None1080 superclass = None1081 def __init__(self, PromoCode=None, AcquisitionSource=None, QuestionCategory=None):1082 self.PromoCode = PromoCode1083 self.AcquisitionSource = AcquisitionSource1084 if QuestionCategory is None:1085 self.QuestionCategory = []1086 else:1087 self.QuestionCategory = QuestionCategory1088 def factory(*args_, **kwargs_):1089 if ExtendedOptInPreferencesType.subclass:1090 return ExtendedOptInPreferencesType.subclass(*args_, **kwargs_)1091 else:1092 return ExtendedOptInPreferencesType(*args_, **kwargs_)1093 factory = staticmethod(factory)1094 def get_PromoCode(self): return self.PromoCode1095 def set_PromoCode(self, PromoCode): self.PromoCode = PromoCode1096 def validate_PromoCodeDesc(self, value):1097 # Validate type PromoCodeDesc, a restriction on Name.1098 pass1099 def get_AcquisitionSource(self): return self.AcquisitionSource1100 def set_AcquisitionSource(self, AcquisitionSource): self.AcquisitionSource = AcquisitionSource1101 def validate_AcquisitionSourceType(self, value):1102 # Validate type AcquisitionSourceType, a restriction on Name.1103 pass1104 def get_QuestionCategory(self): return self.QuestionCategory1105 def set_QuestionCategory(self, QuestionCategory): self.QuestionCategory = QuestionCategory1106 def add_QuestionCategory(self, value): self.QuestionCategory.append(value)1107 def insert_QuestionCategory(self, index, value): self.QuestionCategory[index] = value1108 def export(self, outfile, level, namespace_='', name_='ExtendedOptInPreferencesType', namespacedef_='', pretty_print=True):1109 if pretty_print:1110 eol_ = '\n'1111 else:1112 eol_ = ''1113 showIndent(outfile, level, pretty_print)1114 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1115 already_processed = []1116 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ExtendedOptInPreferencesType')1117 if self.hasContent_():1118 outfile.write('>%s' % (eol_, ))1119 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)1120 showIndent(outfile, level, pretty_print)1121 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))1122 else:1123 outfile.write('/>%s' % (eol_, ))1124 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ExtendedOptInPreferencesType'):1125 pass1126 def exportChildren(self, outfile, level, namespace_='', name_='ExtendedOptInPreferencesType', fromsubclass_=False, pretty_print=True):1127 if pretty_print:1128 eol_ = '\n'1129 else:1130 eol_ = ''1131 if self.PromoCode is not None:1132 showIndent(outfile, level, pretty_print)1133 outfile.write('<%sPromoCode>%s</%sPromoCode>%s' % (namespace_, self.gds_format_string(quote_xml(self.PromoCode).encode(ExternalEncoding), input_name='PromoCode'), namespace_, eol_))1134 if self.AcquisitionSource is not None:1135 showIndent(outfile, level, pretty_print)1136 outfile.write('<%sAcquisitionSource>%s</%sAcquisitionSource>%s' % (namespace_, self.gds_format_string(quote_xml(self.AcquisitionSource).encode(ExternalEncoding), input_name='AcquisitionSource'), namespace_, eol_))1137 for QuestionCategory_ in self.QuestionCategory:1138 QuestionCategory_.export(outfile, level, namespace_, name_='QuestionCategory', pretty_print=pretty_print)1139 def hasContent_(self):1140 if (1141 self.PromoCode is not None or1142 self.AcquisitionSource is not None or1143 self.QuestionCategory1144 ):1145 return True1146 else:1147 return False1148 def exportLiteral(self, outfile, level, name_='ExtendedOptInPreferencesType'):1149 level += 11150 self.exportLiteralAttributes(outfile, level, [], name_)1151 if self.hasContent_():1152 self.exportLiteralChildren(outfile, level, name_)1153 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1154 pass1155 def exportLiteralChildren(self, outfile, level, name_):1156 if self.PromoCode is not None:1157 showIndent(outfile, level)1158 outfile.write('PromoCode=%s,\n' % quote_python(self.PromoCode).encode(ExternalEncoding))1159 if self.AcquisitionSource is not None:1160 showIndent(outfile, level)1161 outfile.write('AcquisitionSource=%s,\n' % quote_python(self.AcquisitionSource).encode(ExternalEncoding))1162 showIndent(outfile, level)1163 outfile.write('QuestionCategory=[\n')1164 level += 11165 for QuestionCategory_ in self.QuestionCategory:1166 showIndent(outfile, level)1167 outfile.write('model_.CategoryType(\n')1168 QuestionCategory_.exportLiteral(outfile, level, name_='CategoryType')1169 showIndent(outfile, level)1170 outfile.write('),\n')1171 level -= 11172 showIndent(outfile, level)1173 outfile.write('],\n')1174 def build(self, node):1175 self.buildAttributes(node, node.attrib, [])1176 for child in node:1177 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1178 self.buildChildren(child, node, nodeName_)1179 def buildAttributes(self, node, attrs, already_processed):1180 pass1181 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1182 if nodeName_ == 'PromoCode':1183 PromoCode_ = child_.text1184 PromoCode_ = self.gds_validate_string(PromoCode_, node, 'PromoCode')1185 self.PromoCode = PromoCode_1186 self.validate_PromoCodeDesc(self.PromoCode) # validate type PromoCodeDesc1187 elif nodeName_ == 'AcquisitionSource':1188 AcquisitionSource_ = child_.text1189 AcquisitionSource_ = self.gds_validate_string(AcquisitionSource_, node, 'AcquisitionSource')1190 self.AcquisitionSource = AcquisitionSource_1191 self.validate_AcquisitionSourceType(self.AcquisitionSource) # validate type AcquisitionSourceType1192 elif nodeName_ == 'QuestionCategory':1193 obj_ = CategoryType.factory()1194 obj_.build(child_)1195 self.QuestionCategory.append(obj_)1196# end class ExtendedOptInPreferencesType1197class HubLifeStylesType(GeneratedsSuper):1198 subclass = None1199 superclass = None1200 def __init__(self, PromoCode=None, AcquisitionSource=None, QuestionCategory=None):1201 self.PromoCode = PromoCode1202 self.AcquisitionSource = AcquisitionSource1203 if QuestionCategory is None:1204 self.QuestionCategory = []1205 else:1206 self.QuestionCategory = QuestionCategory1207 def factory(*args_, **kwargs_):1208 if HubLifeStylesType.subclass:1209 return HubLifeStylesType.subclass(*args_, **kwargs_)1210 else:1211 return HubLifeStylesType(*args_, **kwargs_)1212 factory = staticmethod(factory)1213 def get_PromoCode(self): return self.PromoCode1214 def set_PromoCode(self, PromoCode): self.PromoCode = PromoCode1215 def validate_PromoCodeDesc(self, value):1216 # Validate type PromoCodeDesc, a restriction on Name.1217 pass1218 def get_AcquisitionSource(self): return self.AcquisitionSource1219 def set_AcquisitionSource(self, AcquisitionSource): self.AcquisitionSource = AcquisitionSource1220 def validate_AcquisitionSourceType(self, value):1221 # Validate type AcquisitionSourceType, a restriction on Name.1222 pass1223 def get_QuestionCategory(self): return self.QuestionCategory1224 def set_QuestionCategory(self, QuestionCategory): self.QuestionCategory = QuestionCategory1225 def add_QuestionCategory(self, value): self.QuestionCategory.append(value)1226 def insert_QuestionCategory(self, index, value): self.QuestionCategory[index] = value1227 def export(self, outfile, level, namespace_='', name_='HubLifeStylesType', namespacedef_='', pretty_print=True):1228 if pretty_print:1229 eol_ = '\n'1230 else:1231 eol_ = ''1232 showIndent(outfile, level, pretty_print)1233 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1234 already_processed = []1235 self.exportAttributes(outfile, level, already_processed, namespace_, name_='HubLifeStylesType')1236 if self.hasContent_():1237 outfile.write('>%s' % (eol_, ))1238 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)1239 showIndent(outfile, level, pretty_print)1240 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))1241 else:1242 outfile.write('/>%s' % (eol_, ))1243 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='HubLifeStylesType'):1244 pass1245 def exportChildren(self, outfile, level, namespace_='', name_='HubLifeStylesType', fromsubclass_=False, pretty_print=True):1246 if pretty_print:1247 eol_ = '\n'1248 else:1249 eol_ = ''1250 if self.PromoCode is not None:1251 showIndent(outfile, level, pretty_print)1252 outfile.write('<%sPromoCode>%s</%sPromoCode>%s' % (namespace_, self.gds_format_string(quote_xml(self.PromoCode).encode(ExternalEncoding), input_name='PromoCode'), namespace_, eol_))1253 if self.AcquisitionSource is not None:1254 showIndent(outfile, level, pretty_print)1255 outfile.write('<%sAcquisitionSource>%s</%sAcquisitionSource>%s' % (namespace_, self.gds_format_string(quote_xml(self.AcquisitionSource).encode(ExternalEncoding), input_name='AcquisitionSource'), namespace_, eol_))1256 for QuestionCategory_ in self.QuestionCategory:1257 QuestionCategory_.export(outfile, level, namespace_, name_='QuestionCategory', pretty_print=pretty_print)1258 def hasContent_(self):1259 if (1260 self.PromoCode is not None or1261 self.AcquisitionSource is not None or1262 self.QuestionCategory1263 ):1264 return True1265 else:1266 return False1267 def exportLiteral(self, outfile, level, name_='HubLifeStylesType'):1268 level += 11269 self.exportLiteralAttributes(outfile, level, [], name_)1270 if self.hasContent_():1271 self.exportLiteralChildren(outfile, level, name_)1272 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1273 pass1274 def exportLiteralChildren(self, outfile, level, name_):1275 if self.PromoCode is not None:1276 showIndent(outfile, level)1277 outfile.write('PromoCode=%s,\n' % quote_python(self.PromoCode).encode(ExternalEncoding))1278 if self.AcquisitionSource is not None:1279 showIndent(outfile, level)1280 outfile.write('AcquisitionSource=%s,\n' % quote_python(self.AcquisitionSource).encode(ExternalEncoding))1281 showIndent(outfile, level)1282 outfile.write('QuestionCategory=[\n')1283 level += 11284 for QuestionCategory_ in self.QuestionCategory:1285 showIndent(outfile, level)1286 outfile.write('model_.CategoryType(\n')1287 QuestionCategory_.exportLiteral(outfile, level, name_='CategoryType')1288 showIndent(outfile, level)1289 outfile.write('),\n')1290 level -= 11291 showIndent(outfile, level)1292 outfile.write('],\n')1293 def build(self, node):1294 self.buildAttributes(node, node.attrib, [])1295 for child in node:1296 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1297 self.buildChildren(child, node, nodeName_)1298 def buildAttributes(self, node, attrs, already_processed):1299 pass1300 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1301 if nodeName_ == 'PromoCode':1302 PromoCode_ = child_.text1303 PromoCode_ = self.gds_validate_string(PromoCode_, node, 'PromoCode')1304 self.PromoCode = PromoCode_1305 self.validate_PromoCodeDesc(self.PromoCode) # validate type PromoCodeDesc1306 elif nodeName_ == 'AcquisitionSource':1307 AcquisitionSource_ = child_.text1308 AcquisitionSource_ = self.gds_validate_string(AcquisitionSource_, node, 'AcquisitionSource')1309 self.AcquisitionSource = AcquisitionSource_1310 self.validate_AcquisitionSourceType(self.AcquisitionSource) # validate type AcquisitionSourceType1311 elif nodeName_ == 'QuestionCategory':1312 obj_ = CategoryType.factory()1313 obj_.build(child_)1314 self.QuestionCategory.append(obj_)1315# end class HubLifeStylesType1316class CategoryType(GeneratedsSuper):1317 subclass = None1318 superclass = None1319 def __init__(self, CategoryID=None, QuestionAnswers=None):1320 self.CategoryID = CategoryID1321 if QuestionAnswers is None:1322 self.QuestionAnswers = []1323 else:1324 self.QuestionAnswers = QuestionAnswers1325 def factory(*args_, **kwargs_):1326 if CategoryType.subclass:1327 return CategoryType.subclass(*args_, **kwargs_)1328 else:1329 return CategoryType(*args_, **kwargs_)1330 factory = staticmethod(factory)1331 def get_CategoryID(self): return self.CategoryID1332 def set_CategoryID(self, CategoryID): self.CategoryID = CategoryID1333 def validate_QuestionCategory(self, value):1334 # Validate type QuestionCategory, a restriction on xs:long.1335 pass1336 def get_QuestionAnswers(self): return self.QuestionAnswers1337 def set_QuestionAnswers(self, QuestionAnswers): self.QuestionAnswers = QuestionAnswers1338 def add_QuestionAnswers(self, value): self.QuestionAnswers.append(value)1339 def insert_QuestionAnswers(self, index, value): self.QuestionAnswers[index] = value1340 def export(self, outfile, level, namespace_='', name_='CategoryType', namespacedef_='', pretty_print=True):1341 if pretty_print:1342 eol_ = '\n'1343 else:1344 eol_ = ''1345 showIndent(outfile, level, pretty_print)1346 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1347 already_processed = []1348 self.exportAttributes(outfile, level, already_processed, namespace_, name_='CategoryType')1349 if self.hasContent_():1350 outfile.write('>%s' % (eol_, ))1351 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)1352 showIndent(outfile, level, pretty_print)1353 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))1354 else:1355 outfile.write('/>%s' % (eol_, ))1356 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='CategoryType'):1357 pass1358 def exportChildren(self, outfile, level, namespace_='', name_='CategoryType', fromsubclass_=False, pretty_print=True):1359 if pretty_print:1360 eol_ = '\n'1361 else:1362 eol_ = ''1363 if self.CategoryID is not None:1364 showIndent(outfile, level, pretty_print)1365 outfile.write('<%sCategoryID>%s</%sCategoryID>%s' % (namespace_, self.gds_format_integer(self.CategoryID, input_name='CategoryID'), namespace_, eol_))1366 for QuestionAnswers_ in self.QuestionAnswers:1367 QuestionAnswers_.export(outfile, level, namespace_, name_='QuestionAnswers', pretty_print=pretty_print)1368 def hasContent_(self):1369 if (1370 self.CategoryID is not None or1371 self.QuestionAnswers1372 ):1373 return True1374 else:1375 return False1376 def exportLiteral(self, outfile, level, name_='CategoryType'):1377 level += 11378 self.exportLiteralAttributes(outfile, level, [], name_)1379 if self.hasContent_():1380 self.exportLiteralChildren(outfile, level, name_)1381 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1382 pass1383 def exportLiteralChildren(self, outfile, level, name_):1384 if self.CategoryID is not None:1385 showIndent(outfile, level)1386 outfile.write('CategoryID=%d,\n' % self.CategoryID)1387 showIndent(outfile, level)1388 outfile.write('QuestionAnswers=[\n')1389 level += 11390 for QuestionAnswers_ in self.QuestionAnswers:1391 showIndent(outfile, level)1392 outfile.write('model_.QuestionAnswerType(\n')1393 QuestionAnswers_.exportLiteral(outfile, level, name_='QuestionAnswerType')1394 showIndent(outfile, level)1395 outfile.write('),\n')1396 level -= 11397 showIndent(outfile, level)1398 outfile.write('],\n')1399 def build(self, node):1400 self.buildAttributes(node, node.attrib, [])1401 for child in node:1402 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1403 self.buildChildren(child, node, nodeName_)1404 def buildAttributes(self, node, attrs, already_processed):1405 pass1406 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1407 if nodeName_ == 'CategoryID':1408 sval_ = child_.text1409 try:1410 ival_ = int(sval_)1411 except (TypeError, ValueError), exp:1412 raise_parse_error(child_, 'requires integer: %s' % exp)1413 ival_ = self.gds_validate_integer(ival_, node, 'CategoryID')1414 self.CategoryID = ival_1415 self.validate_QuestionCategory(self.CategoryID) # validate type QuestionCategory1416 elif nodeName_ == 'QuestionAnswers':1417 obj_ = QuestionAnswerType.factory()1418 obj_.build(child_)1419 self.QuestionAnswers.append(obj_)1420# end class CategoryType1421class Emails(GeneratedsSuper):1422 subclass = None1423 superclass = None1424 def __init__(self, Email=None, ConsumerID=None, PromoCode=None, AcquisitionSource=None):1425 if Email is None:1426 self.Email = []1427 else:1428 self.Email = Email1429 self.ConsumerID = ConsumerID1430 self.PromoCode = PromoCode1431 self.AcquisitionSource = AcquisitionSource1432 def factory(*args_, **kwargs_):1433 if Emails.subclass:1434 return Emails.subclass(*args_, **kwargs_)1435 else:1436 return Emails(*args_, **kwargs_)1437 factory = staticmethod(factory)1438 def get_Email(self): return self.Email1439 def set_Email(self, Email): self.Email = Email1440 def add_Email(self, value): self.Email.append(value)1441 def insert_Email(self, index, value): self.Email[index] = value1442 def get_ConsumerID(self): return self.ConsumerID1443 def set_ConsumerID(self, ConsumerID): self.ConsumerID = ConsumerID1444 def get_PromoCode(self): return self.PromoCode1445 def set_PromoCode(self, PromoCode): self.PromoCode = PromoCode1446 def validate_PromoCodeDesc(self, value):1447 # Validate type PromoCodeDesc, a restriction on Name.1448 pass1449 def get_AcquisitionSource(self): return self.AcquisitionSource1450 def set_AcquisitionSource(self, AcquisitionSource): self.AcquisitionSource = AcquisitionSource1451 def validate_AcquisitionSourceType(self, value):1452 # Validate type AcquisitionSourceType, a restriction on Name.1453 pass1454 def export(self, outfile, level, namespace_='', name_='Emails', namespacedef_='', pretty_print=True):1455 if pretty_print:1456 eol_ = '\n'1457 else:1458 eol_ = ''1459 showIndent(outfile, level, pretty_print)1460 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1461 already_processed = []1462 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Emails')1463 if self.hasContent_():1464 outfile.write('>%s' % (eol_, ))1465 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)1466 showIndent(outfile, level, pretty_print)1467 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))1468 else:1469 outfile.write('/>%s' % (eol_, ))1470 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='Emails'):1471 pass1472 def exportChildren(self, outfile, level, namespace_='', name_='Emails', fromsubclass_=False, pretty_print=True):1473 if pretty_print:1474 eol_ = '\n'1475 else:1476 eol_ = ''1477 for Email_ in self.Email:1478 Email_.export(outfile, level, namespace_, name_='Email', pretty_print=pretty_print)1479 if self.ConsumerID is not None:1480 showIndent(outfile, level, pretty_print)1481 outfile.write('<%sConsumerID>%s</%sConsumerID>%s' % (namespace_, self.gds_format_integer(self.ConsumerID, input_name='ConsumerID'), namespace_, eol_))1482 if self.PromoCode is not None:1483 showIndent(outfile, level, pretty_print)1484 outfile.write('<%sPromoCode>%s</%sPromoCode>%s' % (namespace_, self.gds_format_string(quote_xml(self.PromoCode).encode(ExternalEncoding), input_name='PromoCode'), namespace_, eol_))1485 if self.AcquisitionSource is not None:1486 showIndent(outfile, level, pretty_print)1487 outfile.write('<%sAcquisitionSource>%s</%sAcquisitionSource>%s' % (namespace_, self.gds_format_string(quote_xml(self.AcquisitionSource).encode(ExternalEncoding), input_name='AcquisitionSource'), namespace_, eol_))1488 def hasContent_(self):1489 if (1490 self.Email or1491 self.ConsumerID is not None or1492 self.PromoCode is not None or1493 self.AcquisitionSource is not None1494 ):1495 return True1496 else:1497 return False1498 def exportLiteral(self, outfile, level, name_='Emails'):1499 level += 11500 self.exportLiteralAttributes(outfile, level, [], name_)1501 if self.hasContent_():1502 self.exportLiteralChildren(outfile, level, name_)1503 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1504 pass1505 def exportLiteralChildren(self, outfile, level, name_):1506 showIndent(outfile, level)1507 outfile.write('Email=[\n')1508 level += 11509 for Email_ in self.Email:1510 showIndent(outfile, level)1511 outfile.write('model_.EmailType(\n')1512 Email_.exportLiteral(outfile, level, name_='EmailType')1513 showIndent(outfile, level)1514 outfile.write('),\n')1515 level -= 11516 showIndent(outfile, level)1517 outfile.write('],\n')1518 if self.ConsumerID is not None:1519 showIndent(outfile, level)1520 outfile.write('ConsumerID=%d,\n' % self.ConsumerID)1521 if self.PromoCode is not None:1522 showIndent(outfile, level)1523 outfile.write('PromoCode=%s,\n' % quote_python(self.PromoCode).encode(ExternalEncoding))1524 if self.AcquisitionSource is not None:1525 showIndent(outfile, level)1526 outfile.write('AcquisitionSource=%s,\n' % quote_python(self.AcquisitionSource).encode(ExternalEncoding))1527 def build(self, node):1528 self.buildAttributes(node, node.attrib, [])1529 for child in node:1530 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1531 self.buildChildren(child, node, nodeName_)1532 def buildAttributes(self, node, attrs, already_processed):1533 pass1534 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1535 if nodeName_ == 'Email':1536 obj_ = EmailType.factory()1537 obj_.build(child_)1538 self.Email.append(obj_)1539 elif nodeName_ == 'ConsumerID':1540 sval_ = child_.text1541 try:1542 ival_ = int(sval_)1543 except (TypeError, ValueError), exp:1544 raise_parse_error(child_, 'requires integer: %s' % exp)1545 ival_ = self.gds_validate_integer(ival_, node, 'ConsumerID')1546 self.ConsumerID = ival_1547 elif nodeName_ == 'PromoCode':1548 PromoCode_ = child_.text1549 PromoCode_ = self.gds_validate_string(PromoCode_, node, 'PromoCode')1550 self.PromoCode = PromoCode_1551 self.validate_PromoCodeDesc(self.PromoCode) # validate type PromoCodeDesc1552 elif nodeName_ == 'AcquisitionSource':1553 AcquisitionSource_ = child_.text1554 AcquisitionSource_ = self.gds_validate_string(AcquisitionSource_, node, 'AcquisitionSource')1555 self.AcquisitionSource = AcquisitionSource_1556 self.validate_AcquisitionSourceType(self.AcquisitionSource) # validate type AcquisitionSourceType1557# end class Emails1558class AttachmentType(GeneratedsSuper):1559 subclass = None1560 superclass = None1561 def __init__(self, FileName=None, FileContent=None):1562 self.FileName = FileName1563 self.FileContent = FileContent1564 def factory(*args_, **kwargs_):1565 if AttachmentType.subclass:1566 return AttachmentType.subclass(*args_, **kwargs_)1567 else:1568 return AttachmentType(*args_, **kwargs_)1569 factory = staticmethod(factory)1570 def get_FileName(self): return self.FileName1571 def set_FileName(self, FileName): self.FileName = FileName1572 def validate_FileNameType(self, value):1573 # Validate type FileNameType, a restriction on xs:string.1574 pass1575 def get_FileContent(self): return self.FileContent1576 def set_FileContent(self, FileContent): self.FileContent = FileContent1577 def validate_FileContentType(self, value):1578 # Validate type FileContentType, a restriction on xs:base64Binary.1579 pass1580 def export(self, outfile, level, namespace_='', name_='AttachmentType', namespacedef_='', pretty_print=True):1581 if pretty_print:1582 eol_ = '\n'1583 else:1584 eol_ = ''1585 showIndent(outfile, level, pretty_print)1586 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1587 already_processed = []1588 self.exportAttributes(outfile, level, already_processed, namespace_, name_='AttachmentType')1589 if self.hasContent_():1590 outfile.write('>%s' % (eol_, ))1591 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)1592 showIndent(outfile, level, pretty_print)1593 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))1594 else:1595 outfile.write('/>%s' % (eol_, ))1596 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='AttachmentType'):1597 pass1598 def exportChildren(self, outfile, level, namespace_='', name_='AttachmentType', fromsubclass_=False, pretty_print=True):1599 if pretty_print:1600 eol_ = '\n'1601 else:1602 eol_ = ''1603 if self.FileName is not None:1604 showIndent(outfile, level, pretty_print)1605 outfile.write('<%sFileName>%s</%sFileName>%s' % (namespace_, self.gds_format_string(quote_xml(self.FileName).encode(ExternalEncoding), input_name='FileName'), namespace_, eol_))1606 if self.FileContent is not None:1607 showIndent(outfile, level, pretty_print)1608 outfile.write('<%sFileContent>%s</%sFileContent>%s' % (namespace_, self.gds_format_string(quote_xml(self.FileContent).encode(ExternalEncoding), input_name='FileContent'), namespace_, eol_))1609 def hasContent_(self):1610 if (1611 self.FileName is not None or1612 self.FileContent is not None1613 ):1614 return True1615 else:1616 return False1617 def exportLiteral(self, outfile, level, name_='AttachmentType'):1618 level += 11619 self.exportLiteralAttributes(outfile, level, [], name_)1620 if self.hasContent_():1621 self.exportLiteralChildren(outfile, level, name_)1622 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1623 pass1624 def exportLiteralChildren(self, outfile, level, name_):1625 if self.FileName is not None:1626 showIndent(outfile, level)1627 outfile.write('FileName=%s,\n' % quote_python(self.FileName).encode(ExternalEncoding))1628 if self.FileContent is not None:1629 showIndent(outfile, level)1630 outfile.write('FileContent=%s,\n' % quote_python(self.FileContent).encode(ExternalEncoding))1631 def build(self, node):1632 self.buildAttributes(node, node.attrib, [])1633 for child in node:1634 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1635 self.buildChildren(child, node, nodeName_)1636 def buildAttributes(self, node, attrs, already_processed):1637 pass1638 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1639 if nodeName_ == 'FileName':1640 FileName_ = child_.text1641 FileName_ = self.gds_validate_string(FileName_, node, 'FileName')1642 self.FileName = FileName_1643 self.validate_FileNameType(self.FileName) # validate type FileNameType1644 elif nodeName_ == 'FileContent':1645 FileContent_ = child_.text1646 FileContent_ = self.gds_validate_string(FileContent_, node, 'FileContent')1647 self.FileContent = FileContent_1648 self.validate_FileContentType(self.FileContent) # validate type FileContentType1649# end class AttachmentType1650class EmailType(GeneratedsSuper):1651 subclass = None1652 superclass = None1653 def __init__(self, ToAddress=None, FromAddress=None, Subject=None, EmailBody=None, Attachment=None, UnsolicitedEmailFlag=None):1654 if ToAddress is None:1655 self.ToAddress = []1656 else:1657 self.ToAddress = ToAddress1658 self.FromAddress = FromAddress1659 self.Subject = Subject1660 self.EmailBody = EmailBody1661 if Attachment is None:1662 self.Attachment = []1663 else:1664 self.Attachment = Attachment1665 self.UnsolicitedEmailFlag = UnsolicitedEmailFlag1666 def factory(*args_, **kwargs_):1667 if EmailType.subclass:1668 return EmailType.subclass(*args_, **kwargs_)1669 else:1670 return EmailType(*args_, **kwargs_)1671 factory = staticmethod(factory)1672 def get_ToAddress(self): return self.ToAddress1673 def set_ToAddress(self, ToAddress): self.ToAddress = ToAddress1674 def add_ToAddress(self, value): self.ToAddress.append(value)1675 def insert_ToAddress(self, index, value): self.ToAddress[index] = value1676 def validate_EmailId(self, value):1677 # Validate type EmailId, a restriction on xs:string.1678 pass1679 def get_FromAddress(self): return self.FromAddress1680 def set_FromAddress(self, FromAddress): self.FromAddress = FromAddress1681 def get_Subject(self): return self.Subject1682 def set_Subject(self, Subject): self.Subject = Subject1683 def validate_Subject(self, value):1684 # Validate type Subject, a restriction on xs:string.1685 pass1686 def get_EmailBody(self): return self.EmailBody1687 def set_EmailBody(self, EmailBody): self.EmailBody = EmailBody1688 def validate_EmailBody(self, value):1689 # Validate type EmailBody, a restriction on xs:string.1690 pass1691 def get_Attachment(self): return self.Attachment1692 def set_Attachment(self, Attachment): self.Attachment = Attachment1693 def add_Attachment(self, value): self.Attachment.append(value)1694 def insert_Attachment(self, index, value): self.Attachment[index] = value1695 def get_UnsolicitedEmailFlag(self): return self.UnsolicitedEmailFlag1696 def set_UnsolicitedEmailFlag(self, UnsolicitedEmailFlag): self.UnsolicitedEmailFlag = UnsolicitedEmailFlag1697 def validate_UnsolicitedEmailFlagType(self, value):1698 # Validate type UnsolicitedEmailFlagType, a restriction on xs:byte.1699 pass1700 def export(self, outfile, level, namespace_='', name_='EmailType', namespacedef_='', pretty_print=True):1701 if pretty_print:1702 eol_ = '\n'1703 else:1704 eol_ = ''1705 showIndent(outfile, level, pretty_print)1706 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1707 already_processed = []1708 self.exportAttributes(outfile, level, already_processed, namespace_, name_='EmailType')1709 if self.hasContent_():1710 outfile.write('>%s' % (eol_, ))1711 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)1712 showIndent(outfile, level, pretty_print)1713 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))1714 else:1715 outfile.write('/>%s' % (eol_, ))1716 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='EmailType'):1717 pass1718 def exportChildren(self, outfile, level, namespace_='', name_='EmailType', fromsubclass_=False, pretty_print=True):1719 if pretty_print:1720 eol_ = '\n'1721 else:1722 eol_ = ''1723 for ToAddress_ in self.ToAddress:1724 showIndent(outfile, level, pretty_print)1725 outfile.write('<%sToAddress>%s</%sToAddress>%s' % (namespace_, self.gds_format_string(quote_xml(ToAddress_).encode(ExternalEncoding), input_name='ToAddress'), namespace_, eol_))1726 if self.FromAddress is not None:1727 showIndent(outfile, level, pretty_print)1728 outfile.write('<%sFromAddress>%s</%sFromAddress>%s' % (namespace_, self.gds_format_string(quote_xml(self.FromAddress).encode(ExternalEncoding), input_name='FromAddress'), namespace_, eol_))1729 if self.Subject is not None:1730 showIndent(outfile, level, pretty_print)1731 outfile.write('<%sSubject>%s</%sSubject>%s' % (namespace_, self.gds_format_string(quote_xml(self.Subject).encode(ExternalEncoding), input_name='Subject'), namespace_, eol_))1732 if self.EmailBody is not None:1733 showIndent(outfile, level, pretty_print)1734 outfile.write('<%sEmailBody>%s</%sEmailBody>%s' % (namespace_, self.gds_format_string(quote_xml(self.EmailBody).encode(ExternalEncoding), input_name='EmailBody'), namespace_, eol_))1735 for Attachment_ in self.Attachment:1736 Attachment_.export(outfile, level, namespace_, name_='Attachment', pretty_print=pretty_print)1737 if self.UnsolicitedEmailFlag is not None:1738 showIndent(outfile, level, pretty_print)1739 outfile.write('<%sUnsolicitedEmailFlag>%s</%sUnsolicitedEmailFlag>%s' % (namespace_, self.gds_format_integer(self.UnsolicitedEmailFlag, input_name='UnsolicitedEmailFlag'), namespace_, eol_))1740 def hasContent_(self):1741 if (1742 self.ToAddress or1743 self.FromAddress is not None or1744 self.Subject is not None or1745 self.EmailBody is not None or1746 self.Attachment or1747 self.UnsolicitedEmailFlag is not None1748 ):1749 return True1750 else:1751 return False1752 def exportLiteral(self, outfile, level, name_='EmailType'):1753 level += 11754 self.exportLiteralAttributes(outfile, level, [], name_)1755 if self.hasContent_():1756 self.exportLiteralChildren(outfile, level, name_)1757 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1758 pass1759 def exportLiteralChildren(self, outfile, level, name_):1760 showIndent(outfile, level)1761 outfile.write('ToAddress=[\n')1762 level += 11763 for ToAddress_ in self.ToAddress:1764 showIndent(outfile, level)1765 outfile.write('%s,\n' % quote_python(ToAddress_).encode(ExternalEncoding))1766 level -= 11767 showIndent(outfile, level)1768 outfile.write('],\n')1769 if self.FromAddress is not None:1770 showIndent(outfile, level)1771 outfile.write('FromAddress=%s,\n' % quote_python(self.FromAddress).encode(ExternalEncoding))1772 if self.Subject is not None:1773 showIndent(outfile, level)1774 outfile.write('Subject=%s,\n' % quote_python(self.Subject).encode(ExternalEncoding))1775 if self.EmailBody is not None:1776 showIndent(outfile, level)1777 outfile.write('EmailBody=%s,\n' % quote_python(self.EmailBody).encode(ExternalEncoding))1778 showIndent(outfile, level)1779 outfile.write('Attachment=[\n')1780 level += 11781 for Attachment_ in self.Attachment:1782 showIndent(outfile, level)1783 outfile.write('model_.AttachmentType(\n')1784 Attachment_.exportLiteral(outfile, level, name_='AttachmentType')1785 showIndent(outfile, level)1786 outfile.write('),\n')1787 level -= 11788 showIndent(outfile, level)1789 outfile.write('],\n')1790 if self.UnsolicitedEmailFlag is not None:1791 showIndent(outfile, level)1792 outfile.write('UnsolicitedEmailFlag=%d,\n' % self.UnsolicitedEmailFlag)1793 def build(self, node):1794 self.buildAttributes(node, node.attrib, [])1795 for child in node:1796 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1797 self.buildChildren(child, node, nodeName_)1798 def buildAttributes(self, node, attrs, already_processed):1799 pass1800 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1801 if nodeName_ == 'ToAddress':1802 ToAddress_ = child_.text1803 ToAddress_ = self.gds_validate_string(ToAddress_, node, 'ToAddress')1804 self.ToAddress.append(ToAddress_)1805 self.validate_EmailId(self.ToAddress) # validate type EmailId1806 elif nodeName_ == 'FromAddress':1807 FromAddress_ = child_.text1808 FromAddress_ = self.gds_validate_string(FromAddress_, node, 'FromAddress')1809 self.FromAddress = FromAddress_1810 self.validate_EmailId(self.FromAddress) # validate type EmailId1811 elif nodeName_ == 'Subject':1812 Subject_ = child_.text1813 Subject_ = self.gds_validate_string(Subject_, node, 'Subject')1814 self.Subject = Subject_1815 self.validate_Subject(self.Subject) # validate type Subject1816 elif nodeName_ == 'EmailBody':1817 EmailBody_ = child_.text1818 EmailBody_ = self.gds_validate_string(EmailBody_, node, 'EmailBody')1819 self.EmailBody = EmailBody_1820 self.validate_EmailBody(self.EmailBody) # validate type EmailBody1821 elif nodeName_ == 'Attachment':1822 obj_ = AttachmentType.factory()1823 obj_.build(child_)1824 self.Attachment.append(obj_)1825 elif nodeName_ == 'UnsolicitedEmailFlag':1826 sval_ = child_.text1827 try:1828 ival_ = int(sval_)1829 except (TypeError, ValueError), exp:1830 raise_parse_error(child_, 'requires integer: %s' % exp)1831 ival_ = self.gds_validate_integer(ival_, node, 'UnsolicitedEmailFlag')1832 self.UnsolicitedEmailFlag = ival_1833 self.validate_UnsolicitedEmailFlagType(self.UnsolicitedEmailFlag) # validate type UnsolicitedEmailFlagType1834# end class EmailType1835class SendToFriendType(GeneratedsSuper):1836 subclass = None1837 superclass = None1838 def __init__(self, EmailDetails=None, ReferralDetails=None):1839 self.EmailDetails = EmailDetails1840 self.ReferralDetails = ReferralDetails1841 def factory(*args_, **kwargs_):1842 if SendToFriendType.subclass:1843 return SendToFriendType.subclass(*args_, **kwargs_)1844 else:1845 return SendToFriendType(*args_, **kwargs_)1846 factory = staticmethod(factory)1847 def get_EmailDetails(self): return self.EmailDetails1848 def set_EmailDetails(self, EmailDetails): self.EmailDetails = EmailDetails1849 def get_ReferralDetails(self): return self.ReferralDetails1850 def set_ReferralDetails(self, ReferralDetails): self.ReferralDetails = ReferralDetails1851 def export(self, outfile, level, namespace_='', name_='SendToFriendType', namespacedef_='', pretty_print=True):1852 if pretty_print:1853 eol_ = '\n'1854 else:1855 eol_ = ''1856 showIndent(outfile, level, pretty_print)1857 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1858 already_processed = []1859 self.exportAttributes(outfile, level, already_processed, namespace_, name_='SendToFriendType')1860 if self.hasContent_():1861 outfile.write('>%s' % (eol_, ))1862 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)1863 showIndent(outfile, level, pretty_print)1864 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))1865 else:1866 outfile.write('/>%s' % (eol_, ))1867 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SendToFriendType'):1868 pass1869 def exportChildren(self, outfile, level, namespace_='', name_='SendToFriendType', fromsubclass_=False, pretty_print=True):1870 if pretty_print:1871 eol_ = '\n'1872 else:1873 eol_ = ''1874 if self.EmailDetails is not None:1875 self.EmailDetails.export(outfile, level, namespace_, name_='EmailDetails', pretty_print=pretty_print)1876 if self.ReferralDetails is not None:1877 self.ReferralDetails.export(outfile, level, namespace_, name_='ReferralDetails', pretty_print=pretty_print)1878 def hasContent_(self):1879 if (1880 self.EmailDetails is not None or1881 self.ReferralDetails is not None1882 ):1883 return True1884 else:1885 return False1886 def exportLiteral(self, outfile, level, name_='SendToFriendType'):1887 level += 11888 self.exportLiteralAttributes(outfile, level, [], name_)1889 if self.hasContent_():1890 self.exportLiteralChildren(outfile, level, name_)1891 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1892 pass1893 def exportLiteralChildren(self, outfile, level, name_):1894 if self.EmailDetails is not None:1895 showIndent(outfile, level)1896 outfile.write('EmailDetails=model_.EmailType(\n')1897 self.EmailDetails.exportLiteral(outfile, level, name_='EmailDetails')1898 showIndent(outfile, level)1899 outfile.write('),\n')1900 if self.ReferralDetails is not None:1901 showIndent(outfile, level)1902 outfile.write('ReferralDetails=model_.ReferralType(\n')1903 self.ReferralDetails.exportLiteral(outfile, level, name_='ReferralDetails')1904 showIndent(outfile, level)1905 outfile.write('),\n')1906 def build(self, node):1907 self.buildAttributes(node, node.attrib, [])1908 for child in node:1909 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1910 self.buildChildren(child, node, nodeName_)1911 def buildAttributes(self, node, attrs, already_processed):1912 pass1913 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1914 if nodeName_ == 'EmailDetails':1915 obj_ = EmailType.factory()1916 obj_.build(child_)1917 self.set_EmailDetails(obj_)1918 elif nodeName_ == 'ReferralDetails':1919 obj_ = ReferralType.factory()1920 obj_.build(child_)1921 self.set_ReferralDetails(obj_)1922# end class SendToFriendType1923class ReferralType(GeneratedsSuper):1924 subclass = None1925 superclass = None1926 def __init__(self, SenderFriendName=None, ReferralURL=None, ConsumerID=None, PromoCode=None, AcquisitionSource=None, CommunicationChannel=None):1927 self.SenderFriendName = SenderFriendName1928 self.ReferralURL = ReferralURL1929 self.ConsumerID = ConsumerID1930 self.PromoCode = PromoCode1931 self.AcquisitionSource = AcquisitionSource1932 self.CommunicationChannel = CommunicationChannel1933 def factory(*args_, **kwargs_):1934 if ReferralType.subclass:1935 return ReferralType.subclass(*args_, **kwargs_)1936 else:1937 return ReferralType(*args_, **kwargs_)1938 factory = staticmethod(factory)1939 def get_SenderFriendName(self): return self.SenderFriendName1940 def set_SenderFriendName(self, SenderFriendName): self.SenderFriendName = SenderFriendName1941 def validate_FullName(self, value):1942 # Validate type FullName, a restriction on Name.1943 pass1944 def get_ReferralURL(self): return self.ReferralURL1945 def set_ReferralURL(self, ReferralURL): self.ReferralURL = ReferralURL1946 def validate_URL(self, value):1947 # Validate type URL, a restriction on xs:string.1948 pass1949 def get_ConsumerID(self): return self.ConsumerID1950 def set_ConsumerID(self, ConsumerID): self.ConsumerID = ConsumerID1951 def get_PromoCode(self): return self.PromoCode1952 def set_PromoCode(self, PromoCode): self.PromoCode = PromoCode1953 def validate_PromoCodeDesc(self, value):1954 # Validate type PromoCodeDesc, a restriction on Name.1955 pass1956 def get_AcquisitionSource(self): return self.AcquisitionSource1957 def set_AcquisitionSource(self, AcquisitionSource): self.AcquisitionSource = AcquisitionSource1958 def validate_AcquisitionSourceType(self, value):1959 # Validate type AcquisitionSourceType, a restriction on Name.1960 pass1961 def get_CommunicationChannel(self): return self.CommunicationChannel1962 def set_CommunicationChannel(self, CommunicationChannel): self.CommunicationChannel = CommunicationChannel1963 def validate_CommunicationChannel(self, value):1964 # Validate type CommunicationChannel, a restriction on xs:byte.1965 pass1966 def export(self, outfile, level, namespace_='', name_='ReferralType', namespacedef_='', pretty_print=True):1967 if pretty_print:1968 eol_ = '\n'1969 else:1970 eol_ = ''1971 showIndent(outfile, level, pretty_print)1972 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1973 already_processed = []1974 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ReferralType')1975 if self.hasContent_():1976 outfile.write('>%s' % (eol_, ))1977 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)1978 showIndent(outfile, level, pretty_print)1979 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))1980 else:1981 outfile.write('/>%s' % (eol_, ))1982 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ReferralType'):1983 pass1984 def exportChildren(self, outfile, level, namespace_='', name_='ReferralType', fromsubclass_=False, pretty_print=True):1985 if pretty_print:1986 eol_ = '\n'1987 else:1988 eol_ = ''1989 if self.SenderFriendName is not None:1990 showIndent(outfile, level, pretty_print)1991 outfile.write('<%sSenderFriendName>%s</%sSenderFriendName>%s' % (namespace_, self.gds_format_string(quote_xml(self.SenderFriendName).encode(ExternalEncoding), input_name='SenderFriendName'), namespace_, eol_))1992 if self.ReferralURL is not None:1993 showIndent(outfile, level, pretty_print)1994 outfile.write('<%sReferralURL>%s</%sReferralURL>%s' % (namespace_, self.gds_format_string(quote_xml(self.ReferralURL).encode(ExternalEncoding), input_name='ReferralURL'), namespace_, eol_))1995 if self.ConsumerID is not None:1996 showIndent(outfile, level, pretty_print)1997 outfile.write('<%sConsumerID>%s</%sConsumerID>%s' % (namespace_, self.gds_format_integer(self.ConsumerID, input_name='ConsumerID'), namespace_, eol_))1998 if self.PromoCode is not None:1999 showIndent(outfile, level, pretty_print)2000 outfile.write('<%sPromoCode>%s</%sPromoCode>%s' % (namespace_, self.gds_format_string(quote_xml(self.PromoCode).encode(ExternalEncoding), input_name='PromoCode'), namespace_, eol_))2001 if self.AcquisitionSource is not None:2002 showIndent(outfile, level, pretty_print)2003 outfile.write('<%sAcquisitionSource>%s</%sAcquisitionSource>%s' % (namespace_, self.gds_format_string(quote_xml(self.AcquisitionSource).encode(ExternalEncoding), input_name='AcquisitionSource'), namespace_, eol_))2004 if self.CommunicationChannel is not None:2005 showIndent(outfile, level, pretty_print)2006 outfile.write('<%sCommunicationChannel>%s</%sCommunicationChannel>%s' % (namespace_, self.gds_format_integer(self.CommunicationChannel, input_name='CommunicationChannel'), namespace_, eol_))2007 def hasContent_(self):2008 if (2009 self.SenderFriendName is not None or2010 self.ReferralURL is not None or2011 self.ConsumerID is not None or2012 self.PromoCode is not None or2013 self.AcquisitionSource is not None or2014 self.CommunicationChannel is not None2015 ):2016 return True2017 else:2018 return False2019 def exportLiteral(self, outfile, level, name_='ReferralType'):2020 level += 12021 self.exportLiteralAttributes(outfile, level, [], name_)2022 if self.hasContent_():2023 self.exportLiteralChildren(outfile, level, name_)2024 def exportLiteralAttributes(self, outfile, level, already_processed, name_):2025 pass2026 def exportLiteralChildren(self, outfile, level, name_):2027 if self.SenderFriendName is not None:2028 showIndent(outfile, level)2029 outfile.write('SenderFriendName=%s,\n' % quote_python(self.SenderFriendName).encode(ExternalEncoding))2030 if self.ReferralURL is not None:2031 showIndent(outfile, level)2032 outfile.write('ReferralURL=%s,\n' % quote_python(self.ReferralURL).encode(ExternalEncoding))2033 if self.ConsumerID is not None:2034 showIndent(outfile, level)2035 outfile.write('ConsumerID=%d,\n' % self.ConsumerID)2036 if self.PromoCode is not None:2037 showIndent(outfile, level)2038 outfile.write('PromoCode=%s,\n' % quote_python(self.PromoCode).encode(ExternalEncoding))2039 if self.AcquisitionSource is not None:2040 showIndent(outfile, level)2041 outfile.write('AcquisitionSource=%s,\n' % quote_python(self.AcquisitionSource).encode(ExternalEncoding))2042 if self.CommunicationChannel is not None:2043 showIndent(outfile, level)2044 outfile.write('CommunicationChannel=%d,\n' % self.CommunicationChannel)2045 def build(self, node):2046 self.buildAttributes(node, node.attrib, [])2047 for child in node:2048 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]2049 self.buildChildren(child, node, nodeName_)2050 def buildAttributes(self, node, attrs, already_processed):2051 pass2052 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):2053 if nodeName_ == 'SenderFriendName':2054 SenderFriendName_ = child_.text2055 SenderFriendName_ = self.gds_validate_string(SenderFriendName_, node, 'SenderFriendName')2056 self.SenderFriendName = SenderFriendName_2057 self.validate_FullName(self.SenderFriendName) # validate type FullName2058 elif nodeName_ == 'ReferralURL':2059 ReferralURL_ = child_.text2060 ReferralURL_ = self.gds_validate_string(ReferralURL_, node, 'ReferralURL')2061 self.ReferralURL = ReferralURL_2062 self.validate_URL(self.ReferralURL) # validate type URL2063 elif nodeName_ == 'ConsumerID':2064 sval_ = child_.text2065 try:2066 ival_ = int(sval_)2067 except (TypeError, ValueError), exp:2068 raise_parse_error(child_, 'requires integer: %s' % exp)2069 ival_ = self.gds_validate_integer(ival_, node, 'ConsumerID')2070 self.ConsumerID = ival_2071 elif nodeName_ == 'PromoCode':2072 PromoCode_ = child_.text2073 PromoCode_ = self.gds_validate_string(PromoCode_, node, 'PromoCode')2074 self.PromoCode = PromoCode_2075 self.validate_PromoCodeDesc(self.PromoCode) # validate type PromoCodeDesc2076 elif nodeName_ == 'AcquisitionSource':2077 AcquisitionSource_ = child_.text2078 AcquisitionSource_ = self.gds_validate_string(AcquisitionSource_, node, 'AcquisitionSource')2079 self.AcquisitionSource = AcquisitionSource_2080 self.validate_AcquisitionSourceType(self.AcquisitionSource) # validate type AcquisitionSourceType2081 elif nodeName_ == 'CommunicationChannel':2082 sval_ = child_.text2083 try:2084 ival_ = int(sval_)2085 except (TypeError, ValueError), exp:2086 raise_parse_error(child_, 'requires integer: %s' % exp)2087 ival_ = self.gds_validate_integer(ival_, node, 'CommunicationChannel')2088 self.CommunicationChannel = ival_2089 self.validate_CommunicationChannel(self.CommunicationChannel) # validate type CommunicationChannel2090# end class ReferralType2091class ContactUsDetailsType(GeneratedsSuper):2092 subclass = None2093 superclass = None2094 def __init__(self, ContactUsDetail=None):2095 if ContactUsDetail is None:2096 self.ContactUsDetail = []2097 else:2098 self.ContactUsDetail = ContactUsDetail2099 def factory(*args_, **kwargs_):2100 if ContactUsDetailsType.subclass:2101 return ContactUsDetailsType.subclass(*args_, **kwargs_)2102 else:2103 return ContactUsDetailsType(*args_, **kwargs_)2104 factory = staticmethod(factory)2105 def get_ContactUsDetail(self): return self.ContactUsDetail2106 def set_ContactUsDetail(self, ContactUsDetail): self.ContactUsDetail = ContactUsDetail2107 def add_ContactUsDetail(self, value): self.ContactUsDetail.append(value)2108 def insert_ContactUsDetail(self, index, value): self.ContactUsDetail[index] = value2109 def export(self, outfile, level, namespace_='', name_='ContactUsDetailsType', namespacedef_='', pretty_print=True):2110 if pretty_print:2111 eol_ = '\n'2112 else:2113 eol_ = ''2114 showIndent(outfile, level, pretty_print)2115 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))2116 already_processed = []2117 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ContactUsDetailsType')2118 if self.hasContent_():2119 outfile.write('>%s' % (eol_, ))2120 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)2121 showIndent(outfile, level, pretty_print)2122 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))2123 else:2124 outfile.write('/>%s' % (eol_, ))2125 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ContactUsDetailsType'):2126 pass2127 def exportChildren(self, outfile, level, namespace_='', name_='ContactUsDetailsType', fromsubclass_=False, pretty_print=True):2128 if pretty_print:2129 eol_ = '\n'2130 else:2131 eol_ = ''2132 for ContactUsDetail_ in self.ContactUsDetail:2133 ContactUsDetail_.export(outfile, level, namespace_, name_='ContactUsDetail', pretty_print=pretty_print)2134 def hasContent_(self):2135 if (2136 self.ContactUsDetail2137 ):2138 return True2139 else:2140 return False2141 def exportLiteral(self, outfile, level, name_='ContactUsDetailsType'):2142 level += 12143 self.exportLiteralAttributes(outfile, level, [], name_)2144 if self.hasContent_():2145 self.exportLiteralChildren(outfile, level, name_)2146 def exportLiteralAttributes(self, outfile, level, already_processed, name_):2147 pass2148 def exportLiteralChildren(self, outfile, level, name_):2149 showIndent(outfile, level)2150 outfile.write('ContactUsDetail=[\n')2151 level += 12152 for ContactUsDetail_ in self.ContactUsDetail:2153 showIndent(outfile, level)2154 outfile.write('model_.ContactUsDetailType(\n')2155 ContactUsDetail_.exportLiteral(outfile, level, name_='ContactUsDetailType')2156 showIndent(outfile, level)2157 outfile.write('),\n')2158 level -= 12159 showIndent(outfile, level)2160 outfile.write('],\n')2161 def build(self, node):2162 self.buildAttributes(node, node.attrib, [])2163 for child in node:2164 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]2165 self.buildChildren(child, node, nodeName_)2166 def buildAttributes(self, node, attrs, already_processed):2167 pass2168 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):2169 if nodeName_ == 'ContactUsDetail':2170 obj_ = ContactUsDetailType.factory()2171 obj_.build(child_)2172 self.ContactUsDetail.append(obj_)2173# end class ContactUsDetailsType2174class ContactUsDetailType(GeneratedsSuper):2175 subclass = None2176 superclass = None2177 def __init__(self, ContactUsID=None, Status=None, ConsumerID=None, PromoCode=None, AcquisitionSource=None, Email=None, Remarks=None):2178 self.ContactUsID = ContactUsID2179 self.Status = Status2180 self.ConsumerID = ConsumerID2181 self.PromoCode = PromoCode2182 self.AcquisitionSource = AcquisitionSource2183 self.Email = Email2184 self.Remarks = Remarks2185 def factory(*args_, **kwargs_):2186 if ContactUsDetailType.subclass:2187 return ContactUsDetailType.subclass(*args_, **kwargs_)2188 else:2189 return ContactUsDetailType(*args_, **kwargs_)2190 factory = staticmethod(factory)2191 def get_ContactUsID(self): return self.ContactUsID2192 def set_ContactUsID(self, ContactUsID): self.ContactUsID = ContactUsID2193 def validate_ConsumerIDType(self, value):2194 # Validate type ConsumerIDType, a restriction on xs:long.2195 pass2196 def get_Status(self): return self.Status2197 def set_Status(self, Status): self.Status = Status2198 def validate_Status(self, value):2199 # Validate type Status, a restriction on xs:byte.2200 pass2201 def get_ConsumerID(self): return self.ConsumerID2202 def set_ConsumerID(self, ConsumerID): self.ConsumerID = ConsumerID2203 def get_PromoCode(self): return self.PromoCode2204 def set_PromoCode(self, PromoCode): self.PromoCode = PromoCode2205 def validate_PromoCodeDesc(self, value):2206 # Validate type PromoCodeDesc, a restriction on Name.2207 pass2208 def get_AcquisitionSource(self): return self.AcquisitionSource2209 def set_AcquisitionSource(self, AcquisitionSource): self.AcquisitionSource = AcquisitionSource2210 def validate_AcquisitionSourceType(self, value):2211 # Validate type AcquisitionSourceType, a restriction on Name.2212 pass2213 def get_Email(self): return self.Email2214 def set_Email(self, Email): self.Email = Email2215 def get_Remarks(self): return self.Remarks2216 def set_Remarks(self, Remarks): self.Remarks = Remarks2217 def validate_RemarkType(self, value):2218 # Validate type RemarkType, a restriction on xs:string.2219 pass2220 def export(self, outfile, level, namespace_='', name_='ContactUsDetailType', namespacedef_='', pretty_print=True):2221 if pretty_print:2222 eol_ = '\n'2223 else:2224 eol_ = ''2225 showIndent(outfile, level, pretty_print)2226 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))2227 already_processed = []2228 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ContactUsDetailType')2229 if self.hasContent_():2230 outfile.write('>%s' % (eol_, ))2231 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)2232 showIndent(outfile, level, pretty_print)2233 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))2234 else:2235 outfile.write('/>%s' % (eol_, ))2236 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ContactUsDetailType'):2237 pass2238 def exportChildren(self, outfile, level, namespace_='', name_='ContactUsDetailType', fromsubclass_=False, pretty_print=True):2239 if pretty_print:2240 eol_ = '\n'2241 else:2242 eol_ = ''2243 if self.ContactUsID is not None:2244 showIndent(outfile, level, pretty_print)2245 outfile.write('<%sContactUsID>%s</%sContactUsID>%s' % (namespace_, self.gds_format_integer(self.ContactUsID, input_name='ContactUsID'), namespace_, eol_))2246 if self.Status is not None:2247 showIndent(outfile, level, pretty_print)2248 outfile.write('<%sStatus>%s</%sStatus>%s' % (namespace_, self.gds_format_integer(self.Status, input_name='Status'), namespace_, eol_))2249 if self.ConsumerID is not None:2250 showIndent(outfile, level, pretty_print)2251 outfile.write('<%sConsumerID>%s</%sConsumerID>%s' % (namespace_, self.gds_format_integer(self.ConsumerID, input_name='ConsumerID'), namespace_, eol_))2252 if self.PromoCode is not None:2253 showIndent(outfile, level, pretty_print)2254 outfile.write('<%sPromoCode>%s</%sPromoCode>%s' % (namespace_, self.gds_format_string(quote_xml(self.PromoCode).encode(ExternalEncoding), input_name='PromoCode'), namespace_, eol_))2255 if self.AcquisitionSource is not None:2256 showIndent(outfile, level, pretty_print)2257 outfile.write('<%sAcquisitionSource>%s</%sAcquisitionSource>%s' % (namespace_, self.gds_format_string(quote_xml(self.AcquisitionSource).encode(ExternalEncoding), input_name='AcquisitionSource'), namespace_, eol_))2258 if self.Email is not None:2259 self.Email.export(outfile, level, namespace_, name_='Email', pretty_print=pretty_print)2260 if self.Remarks is not None:2261 showIndent(outfile, level, pretty_print)2262 outfile.write('<%sRemarks>%s</%sRemarks>%s' % (namespace_, self.gds_format_string(quote_xml(self.Remarks).encode(ExternalEncoding), input_name='Remarks'), namespace_, eol_))2263 def hasContent_(self):2264 if (2265 self.ContactUsID is not None or2266 self.Status is not None or2267 self.ConsumerID is not None or2268 self.PromoCode is not None or2269 self.AcquisitionSource is not None or2270 self.Email is not None or2271 self.Remarks is not None2272 ):2273 return True2274 else:2275 return False2276 def exportLiteral(self, outfile, level, name_='ContactUsDetailType'):2277 level += 12278 self.exportLiteralAttributes(outfile, level, [], name_)2279 if self.hasContent_():2280 self.exportLiteralChildren(outfile, level, name_)2281 def exportLiteralAttributes(self, outfile, level, already_processed, name_):2282 pass2283 def exportLiteralChildren(self, outfile, level, name_):2284 if self.ContactUsID is not None:2285 showIndent(outfile, level)2286 outfile.write('ContactUsID=%d,\n' % self.ContactUsID)2287 if self.Status is not None:2288 showIndent(outfile, level)2289 outfile.write('Status=%d,\n' % self.Status)2290 if self.ConsumerID is not None:2291 showIndent(outfile, level)2292 outfile.write('ConsumerID=%d,\n' % self.ConsumerID)2293 if self.PromoCode is not None:2294 showIndent(outfile, level)2295 outfile.write('PromoCode=%s,\n' % quote_python(self.PromoCode).encode(ExternalEncoding))2296 if self.AcquisitionSource is not None:2297 showIndent(outfile, level)2298 outfile.write('AcquisitionSource=%s,\n' % quote_python(self.AcquisitionSource).encode(ExternalEncoding))2299 if self.Email is not None:2300 showIndent(outfile, level)2301 outfile.write('Email=model_.EmailType(\n')2302 self.Email.exportLiteral(outfile, level, name_='Email')2303 showIndent(outfile, level)2304 outfile.write('),\n')2305 if self.Remarks is not None:2306 showIndent(outfile, level)2307 outfile.write('Remarks=%s,\n' % quote_python(self.Remarks).encode(ExternalEncoding))2308 def build(self, node):2309 self.buildAttributes(node, node.attrib, [])2310 for child in node:2311 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]2312 self.buildChildren(child, node, nodeName_)2313 def buildAttributes(self, node, attrs, already_processed):2314 pass2315 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):2316 if nodeName_ == 'ContactUsID':2317 sval_ = child_.text2318 try:2319 ival_ = int(sval_)2320 except (TypeError, ValueError), exp:2321 raise_parse_error(child_, 'requires integer: %s' % exp)2322 ival_ = self.gds_validate_integer(ival_, node, 'ContactUsID')2323 self.ContactUsID = ival_2324 self.validate_ConsumerIDType(self.ContactUsID) # validate type ConsumerIDType2325 elif nodeName_ == 'Status':2326 sval_ = child_.text2327 try:2328 ival_ = int(sval_)2329 except (TypeError, ValueError), exp:2330 raise_parse_error(child_, 'requires integer: %s' % exp)2331 ival_ = self.gds_validate_integer(ival_, node, 'Status')2332 self.Status = ival_2333 self.validate_Status(self.Status) # validate type Status2334 elif nodeName_ == 'ConsumerID':2335 sval_ = child_.text2336 try:2337 ival_ = int(sval_)2338 except (TypeError, ValueError), exp:2339 raise_parse_error(child_, 'requires integer: %s' % exp)2340 ival_ = self.gds_validate_integer(ival_, node, 'ConsumerID')2341 self.ConsumerID = ival_2342 self.validate_ConsumerIDType(self.ConsumerID) # validate type ConsumerIDType2343 elif nodeName_ == 'PromoCode':2344 PromoCode_ = child_.text2345 PromoCode_ = self.gds_validate_string(PromoCode_, node, 'PromoCode')2346 self.PromoCode = PromoCode_2347 self.validate_PromoCodeDesc(self.PromoCode) # validate type PromoCodeDesc2348 elif nodeName_ == 'AcquisitionSource':2349 AcquisitionSource_ = child_.text2350 AcquisitionSource_ = self.gds_validate_string(AcquisitionSource_, node, 'AcquisitionSource')2351 self.AcquisitionSource = AcquisitionSource_2352 self.validate_AcquisitionSourceType(self.AcquisitionSource) # validate type AcquisitionSourceType2353 elif nodeName_ == 'Email':2354 obj_ = EmailType.factory()2355 obj_.build(child_)2356 self.set_Email(obj_)2357 elif nodeName_ == 'Remarks':2358 Remarks_ = child_.text2359 Remarks_ = self.gds_validate_string(Remarks_, node, 'Remarks')2360 self.Remarks = Remarks_2361 self.validate_RemarkType(self.Remarks) # validate type RemarkType2362# end class ContactUsDetailType2363class PreferencesType(GeneratedsSuper):2364 subclass = None2365 superclass = None2366 def __init__(self, PromoCode=None, AcquisitionSource=None, QuestionCategory=None):2367 self.PromoCode = PromoCode2368 self.AcquisitionSource = AcquisitionSource2369 if QuestionCategory is None:2370 self.QuestionCategory = []2371 else:2372 self.QuestionCategory = QuestionCategory2373 def factory(*args_, **kwargs_):2374 if PreferencesType.subclass:2375 return PreferencesType.subclass(*args_, **kwargs_)2376 else:2377 return PreferencesType(*args_, **kwargs_)2378 factory = staticmethod(factory)2379 def get_PromoCode(self): return self.PromoCode2380 def set_PromoCode(self, PromoCode): self.PromoCode = PromoCode2381 def validate_PromoCodeDesc(self, value):2382 # Validate type PromoCodeDesc, a restriction on Name.2383 pass2384 def get_AcquisitionSource(self): return self.AcquisitionSource2385 def set_AcquisitionSource(self, AcquisitionSource): self.AcquisitionSource = AcquisitionSource2386 def validate_AcquisitionSourceType(self, value):2387 # Validate type AcquisitionSourceType, a restriction on Name.2388 pass2389 def get_QuestionCategory(self): return self.QuestionCategory2390 def set_QuestionCategory(self, QuestionCategory): self.QuestionCategory = QuestionCategory2391 def add_QuestionCategory(self, value): self.QuestionCategory.append(value)2392 def insert_QuestionCategory(self, index, value): self.QuestionCategory[index] = value2393 def export(self, outfile, level, namespace_='', name_='PreferencesType', namespacedef_='', pretty_print=True):2394 if pretty_print:2395 eol_ = '\n'2396 else:2397 eol_ = ''2398 showIndent(outfile, level, pretty_print)2399 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))2400 already_processed = []2401 self.exportAttributes(outfile, level, already_processed, namespace_, name_='PreferencesType')2402 if self.hasContent_():2403 outfile.write('>%s' % (eol_, ))2404 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)2405 showIndent(outfile, level, pretty_print)2406 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))2407 else:2408 outfile.write('/>%s' % (eol_, ))2409 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PreferencesType'):2410 pass2411 def exportChildren(self, outfile, level, namespace_='', name_='PreferencesType', fromsubclass_=False, pretty_print=True):2412 if pretty_print:2413 eol_ = '\n'2414 else:2415 eol_ = ''2416 if self.PromoCode is not None:2417 showIndent(outfile, level, pretty_print)2418 outfile.write('<%sPromoCode>%s</%sPromoCode>%s' % (namespace_, self.gds_format_string(quote_xml(self.PromoCode).encode(ExternalEncoding), input_name='PromoCode'), namespace_, eol_))2419 if self.AcquisitionSource is not None:2420 showIndent(outfile, level, pretty_print)2421 outfile.write('<%sAcquisitionSource>%s</%sAcquisitionSource>%s' % (namespace_, self.gds_format_string(quote_xml(self.AcquisitionSource).encode(ExternalEncoding), input_name='AcquisitionSource'), namespace_, eol_))2422 for QuestionCategory_ in self.QuestionCategory:2423 QuestionCategory_.export(outfile, level, namespace_, name_='QuestionCategory', pretty_print=pretty_print)2424 def hasContent_(self):2425 if (2426 self.PromoCode is not None or2427 self.AcquisitionSource is not None or2428 self.QuestionCategory2429 ):2430 return True2431 else:2432 return False2433 def exportLiteral(self, outfile, level, name_='PreferencesType'):2434 level += 12435 self.exportLiteralAttributes(outfile, level, [], name_)2436 if self.hasContent_():2437 self.exportLiteralChildren(outfile, level, name_)2438 def exportLiteralAttributes(self, outfile, level, already_processed, name_):2439 pass2440 def exportLiteralChildren(self, outfile, level, name_):2441 if self.PromoCode is not None:2442 showIndent(outfile, level)2443 outfile.write('PromoCode=%s,\n' % quote_python(self.PromoCode).encode(ExternalEncoding))2444 if self.AcquisitionSource is not None:2445 showIndent(outfile, level)2446 outfile.write('AcquisitionSource=%s,\n' % quote_python(self.AcquisitionSource).encode(ExternalEncoding))2447 showIndent(outfile, level)2448 outfile.write('QuestionCategory=[\n')2449 level += 12450 for QuestionCategory_ in self.QuestionCategory:2451 showIndent(outfile, level)2452 outfile.write('model_.CategoryType(\n')2453 QuestionCategory_.exportLiteral(outfile, level, name_='CategoryType')2454 showIndent(outfile, level)2455 outfile.write('),\n')2456 level -= 12457 showIndent(outfile, level)2458 outfile.write('],\n')2459 def build(self, node):2460 self.buildAttributes(node, node.attrib, [])2461 for child in node:2462 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]2463 self.buildChildren(child, node, nodeName_)2464 def buildAttributes(self, node, attrs, already_processed):2465 pass2466 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):2467 if nodeName_ == 'PromoCode':2468 PromoCode_ = child_.text2469 PromoCode_ = self.gds_validate_string(PromoCode_, node, 'PromoCode')2470 self.PromoCode = PromoCode_2471 self.validate_PromoCodeDesc(self.PromoCode) # validate type PromoCodeDesc2472 elif nodeName_ == 'AcquisitionSource':2473 AcquisitionSource_ = child_.text2474 AcquisitionSource_ = self.gds_validate_string(AcquisitionSource_, node, 'AcquisitionSource')2475 self.AcquisitionSource = AcquisitionSource_2476 self.validate_AcquisitionSourceType(self.AcquisitionSource) # validate type AcquisitionSourceType2477 elif nodeName_ == 'QuestionCategory':2478 obj_ = CategoryType.factory()2479 obj_.build(child_)2480 self.QuestionCategory.append(obj_)2481# end class PreferencesType2482class AddressDetailsType(GeneratedsSuper):2483 subclass = None2484 superclass = None2485 def __init__(self, AddressID=None, Address1=None, Address2=None, Address3=None, Address4=None, City=None, State=None, Country=None, ZipCode=None, AddressType=None, StateOther=None, ModifyFlag=None):2486 self.AddressID = AddressID2487 self.Address1 = Address12488 self.Address2 = Address22489 self.Address3 = Address32490 self.Address4 = Address42491 self.City = City2492 self.State = State2493 self.Country = Country2494 self.ZipCode = ZipCode2495 self.AddressType = AddressType2496 self.StateOther = StateOther2497 self.ModifyFlag = ModifyFlag2498 def factory(*args_, **kwargs_):2499 if AddressDetailsType.subclass:2500 return AddressDetailsType.subclass(*args_, **kwargs_)2501 else:2502 return AddressDetailsType(*args_, **kwargs_)2503 factory = staticmethod(factory)2504 def get_AddressID(self): return self.AddressID2505 def set_AddressID(self, AddressID): self.AddressID = AddressID2506 def get_Address1(self): return self.Address12507 def set_Address1(self, Address1): self.Address1 = Address12508 def validate_Address1(self, value):2509 # Validate type Address1, a restriction on Address.2510 pass2511 def get_Address2(self): return self.Address22512 def set_Address2(self, Address2): self.Address2 = Address22513 def validate_Address2(self, value):2514 # Validate type Address2, a restriction on Address.2515 pass2516 def get_Address3(self): return self.Address32517 def set_Address3(self, Address3): self.Address3 = Address32518 def validate_Address3(self, value):2519 # Validate type Address3, a restriction on Address.2520 pass2521 def get_Address4(self): return self.Address42522 def set_Address4(self, Address4): self.Address4 = Address42523 def validate_Address4(self, value):2524 # Validate type Address4, a restriction on Address.2525 pass2526 def get_City(self): return self.City2527 def set_City(self, City): self.City = City2528 def validate_CityName(self, value):2529 # Validate type CityName, a restriction on Name.2530 pass2531 def get_State(self): return self.State2532 def set_State(self, State): self.State = State2533 def validate_StateName(self, value):2534 # Validate type StateName, a restriction on Name.2535 pass2536 def get_Country(self): return self.Country2537 def set_Country(self, Country): self.Country = Country2538 def validate_CountryName(self, value):2539 # Validate type CountryName, a restriction on Name.2540 pass2541 def get_ZipCode(self): return self.ZipCode2542 def set_ZipCode(self, ZipCode): self.ZipCode = ZipCode2543 def validate_ZipCode(self, value):2544 # Validate type ZipCode, a restriction on Name.2545 pass2546 def get_AddressType(self): return self.AddressType2547 def set_AddressType(self, AddressType): self.AddressType = AddressType2548 def validate_AddressType(self, value):2549 # Validate type AddressType, a restriction on xs:byte.2550 pass2551 def get_StateOther(self): return self.StateOther2552 def set_StateOther(self, StateOther): self.StateOther = StateOther2553 def get_ModifyFlag(self): return self.ModifyFlag2554 def set_ModifyFlag(self, ModifyFlag): self.ModifyFlag = ModifyFlag2555 def export(self, outfile, level, namespace_='', name_='AddressDetailsType', namespacedef_='', pretty_print=True):2556 if pretty_print:2557 eol_ = '\n'2558 else:2559 eol_ = ''2560 showIndent(outfile, level, pretty_print)2561 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))2562 already_processed = []2563 self.exportAttributes(outfile, level, already_processed, namespace_, name_='AddressDetailsType')2564 if self.hasContent_():2565 outfile.write('>%s' % (eol_, ))2566 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)2567 showIndent(outfile, level, pretty_print)2568 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))2569 else:2570 outfile.write('/>%s' % (eol_, ))2571 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='AddressDetailsType'):2572 pass2573 def exportChildren(self, outfile, level, namespace_='', name_='AddressDetailsType', fromsubclass_=False, pretty_print=True):2574 if pretty_print:2575 eol_ = '\n'2576 else:2577 eol_ = ''2578 if self.AddressID is not None:2579 showIndent(outfile, level, pretty_print)2580 outfile.write('<%sAddressID>%s</%sAddressID>%s' % (namespace_, self.gds_format_integer(self.AddressID, input_name='AddressID'), namespace_, eol_))2581 if self.Address1 is not None:2582 showIndent(outfile, level, pretty_print)2583 outfile.write('<%sAddress1>%s</%sAddress1>%s' % (namespace_, self.gds_format_string(quote_xml(self.Address1).encode(ExternalEncoding), input_name='Address1'), namespace_, eol_))2584 if self.Address2 is not None:2585 showIndent(outfile, level, pretty_print)2586 outfile.write('<%sAddress2>%s</%sAddress2>%s' % (namespace_, self.gds_format_string(quote_xml(self.Address2).encode(ExternalEncoding), input_name='Address2'), namespace_, eol_))2587 if self.Address3 is not None:2588 showIndent(outfile, level, pretty_print)2589 outfile.write('<%sAddress3>%s</%sAddress3>%s' % (namespace_, self.gds_format_string(quote_xml(self.Address3).encode(ExternalEncoding), input_name='Address3'), namespace_, eol_))2590 if self.Address4 is not None:2591 showIndent(outfile, level, pretty_print)2592 outfile.write('<%sAddress4>%s</%sAddress4>%s' % (namespace_, self.gds_format_string(quote_xml(self.Address4).encode(ExternalEncoding), input_name='Address4'), namespace_, eol_))2593 if self.City is not None:2594 showIndent(outfile, level, pretty_print)2595 outfile.write('<%sCity>%s</%sCity>%s' % (namespace_, self.gds_format_string(quote_xml(self.City).encode(ExternalEncoding), input_name='City'), namespace_, eol_))2596 if self.State is not None:2597 showIndent(outfile, level, pretty_print)2598 outfile.write('<%sState>%s</%sState>%s' % (namespace_, self.gds_format_string(quote_xml(self.State).encode(ExternalEncoding), input_name='State'), namespace_, eol_))2599 if self.Country is not None:2600 showIndent(outfile, level, pretty_print)2601 outfile.write('<%sCountry>%s</%sCountry>%s' % (namespace_, self.gds_format_string(quote_xml(self.Country).encode(ExternalEncoding), input_name='Country'), namespace_, eol_))2602 if self.ZipCode is not None:2603 showIndent(outfile, level, pretty_print)2604 outfile.write('<%sZipCode>%s</%sZipCode>%s' % (namespace_, self.gds_format_string(quote_xml(self.ZipCode).encode(ExternalEncoding), input_name='ZipCode'), namespace_, eol_))2605 if self.AddressType is not None:2606 showIndent(outfile, level, pretty_print)2607 outfile.write('<%sAddressType>%s</%sAddressType>%s' % (namespace_, self.gds_format_integer(self.AddressType, input_name='AddressType'), namespace_, eol_))2608 if self.StateOther is not None:2609 showIndent(outfile, level, pretty_print)2610 outfile.write('<%sStateOther>%s</%sStateOther>%s' % (namespace_, self.gds_format_string(quote_xml(self.StateOther).encode(ExternalEncoding), input_name='StateOther'), namespace_, eol_))2611 if self.ModifyFlag is not None:2612 showIndent(outfile, level, pretty_print)2613 outfile.write('<%sModifyFlag>%s</%sModifyFlag>%s' % (namespace_, self.gds_format_string(quote_xml(self.ModifyFlag).encode(ExternalEncoding), input_name='ModifyFlag'), namespace_, eol_))2614 def hasContent_(self):2615 if (2616 self.AddressID is not None or2617 self.Address1 is not None or2618 self.Address2 is not None or2619 self.Address3 is not None or2620 self.Address4 is not None or2621 self.City is not None or2622 self.State is not None or2623 self.Country is not None or2624 self.ZipCode is not None or2625 self.AddressType is not None or2626 self.StateOther is not None or2627 self.ModifyFlag is not None2628 ):2629 return True2630 else:2631 return False2632 def exportLiteral(self, outfile, level, name_='AddressDetailsType'):2633 level += 12634 self.exportLiteralAttributes(outfile, level, [], name_)2635 if self.hasContent_():2636 self.exportLiteralChildren(outfile, level, name_)2637 def exportLiteralAttributes(self, outfile, level, already_processed, name_):2638 pass2639 def exportLiteralChildren(self, outfile, level, name_):2640 if self.AddressID is not None:2641 showIndent(outfile, level)2642 outfile.write('AddressID=%d,\n' % self.AddressID)2643 if self.Address1 is not None:2644 showIndent(outfile, level)2645 outfile.write('Address1=%s,\n' % quote_python(self.Address1).encode(ExternalEncoding))2646 if self.Address2 is not None:2647 showIndent(outfile, level)2648 outfile.write('Address2=%s,\n' % quote_python(self.Address2).encode(ExternalEncoding))2649 if self.Address3 is not None:2650 showIndent(outfile, level)2651 outfile.write('Address3=%s,\n' % quote_python(self.Address3).encode(ExternalEncoding))2652 if self.Address4 is not None:2653 showIndent(outfile, level)2654 outfile.write('Address4=%s,\n' % quote_python(self.Address4).encode(ExternalEncoding))2655 if self.City is not None:2656 showIndent(outfile, level)2657 outfile.write('City=%s,\n' % quote_python(self.City).encode(ExternalEncoding))2658 if self.State is not None:2659 showIndent(outfile, level)2660 outfile.write('State=%s,\n' % quote_python(self.State).encode(ExternalEncoding))2661 if self.Country is not None:2662 showIndent(outfile, level)2663 outfile.write('Country=%s,\n' % quote_python(self.Country).encode(ExternalEncoding))2664 if self.ZipCode is not None:2665 showIndent(outfile, level)2666 outfile.write('ZipCode=%s,\n' % quote_python(self.ZipCode).encode(ExternalEncoding))2667 if self.AddressType is not None:2668 showIndent(outfile, level)2669 outfile.write('AddressType=%d,\n' % self.AddressType)2670 if self.StateOther is not None:2671 showIndent(outfile, level)2672 outfile.write('StateOther=%s,\n' % quote_python(self.StateOther).encode(ExternalEncoding))2673 if self.ModifyFlag is not None:2674 showIndent(outfile, level)2675 outfile.write('ModifyFlag=%s,\n' % quote_python(self.ModifyFlag).encode(ExternalEncoding))2676 def build(self, node):2677 self.buildAttributes(node, node.attrib, [])2678 for child in node:2679 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]2680 self.buildChildren(child, node, nodeName_)2681 def buildAttributes(self, node, attrs, already_processed):2682 pass2683 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):2684 if nodeName_ == 'AddressID':2685 sval_ = child_.text2686 try:2687 ival_ = int(sval_)2688 except (TypeError, ValueError), exp:2689 raise_parse_error(child_, 'requires integer: %s' % exp)2690 ival_ = self.gds_validate_integer(ival_, node, 'AddressID')2691 self.AddressID = ival_2692 elif nodeName_ == 'Address1':2693 Address1_ = child_.text2694 Address1_ = self.gds_validate_string(Address1_, node, 'Address1')2695 self.Address1 = Address1_2696 self.validate_Address1(self.Address1) # validate type Address12697 elif nodeName_ == 'Address2':2698 Address2_ = child_.text2699 Address2_ = self.gds_validate_string(Address2_, node, 'Address2')2700 self.Address2 = Address2_2701 self.validate_Address2(self.Address2) # validate type Address22702 elif nodeName_ == 'Address3':2703 Address3_ = child_.text2704 Address3_ = self.gds_validate_string(Address3_, node, 'Address3')2705 self.Address3 = Address3_2706 self.validate_Address3(self.Address3) # validate type Address32707 elif nodeName_ == 'Address4':2708 Address4_ = child_.text2709 Address4_ = self.gds_validate_string(Address4_, node, 'Address4')2710 self.Address4 = Address4_2711 self.validate_Address4(self.Address4) # validate type Address42712 elif nodeName_ == 'City':2713 City_ = child_.text2714 City_ = self.gds_validate_string(City_, node, 'City')2715 self.City = City_2716 self.validate_CityName(self.City) # validate type CityName2717 elif nodeName_ == 'State':2718 State_ = child_.text2719 State_ = self.gds_validate_string(State_, node, 'State')2720 self.State = State_2721 self.validate_StateName(self.State) # validate type StateName2722 elif nodeName_ == 'Country':2723 Country_ = child_.text2724 Country_ = self.gds_validate_string(Country_, node, 'Country')2725 self.Country = Country_2726 self.validate_CountryName(self.Country) # validate type CountryName2727 elif nodeName_ == 'ZipCode':2728 ZipCode_ = child_.text2729 ZipCode_ = self.gds_validate_string(ZipCode_, node, 'ZipCode')2730 self.ZipCode = ZipCode_2731 self.validate_ZipCode(self.ZipCode) # validate type ZipCode2732 elif nodeName_ == 'AddressType':2733 sval_ = child_.text2734 try:2735 ival_ = int(sval_)2736 except (TypeError, ValueError), exp:2737 raise_parse_error(child_, 'requires integer: %s' % exp)2738 ival_ = self.gds_validate_integer(ival_, node, 'AddressType')2739 self.AddressType = ival_2740 self.validate_AddressType(self.AddressType) # validate type AddressType2741 elif nodeName_ == 'StateOther':2742 StateOther_ = child_.text2743 StateOther_ = self.gds_validate_string(StateOther_, node, 'StateOther')2744 self.StateOther = StateOther_2745 self.validate_StateName(self.StateOther) # validate type StateName2746 elif nodeName_ == 'ModifyFlag':2747 ModifyFlag_ = child_.text2748 ModifyFlag_ = self.gds_validate_string(ModifyFlag_, node, 'ModifyFlag')2749 self.ModifyFlag = ModifyFlag_2750# end class AddressDetailsType2751class ConsumerProfileType(GeneratedsSuper):2752 subclass = None2753 superclass = None2754 def __init__(self, Title=None, FirstName=None, LastName=None, AlternateFirstName=None, AlternateLastName=None, DOB=None, Gender=None, MaritalStatus=None, NationalID=None, PassportNumber=None, Education=None, Profession=None, Suffix=None, Company=None, MiddleName=None, AlternateMiddleName=None, MaternalLastName=None, AlternateMaternalLastName=None, AlternateTitle=None, AlternateSuffix=None, Address=None, Phone=None, PromoCode=None, AcquisitionSource=None, Email=None):2755 self.Title = Title2756 self.FirstName = FirstName2757 self.LastName = LastName2758 self.AlternateFirstName = AlternateFirstName2759 self.AlternateLastName = AlternateLastName2760 self.DOB = DOB2761 self.Gender = Gender2762 self.MaritalStatus = MaritalStatus2763 self.NationalID = NationalID2764 self.PassportNumber = PassportNumber2765 self.Education = Education2766 self.Profession = Profession2767 self.Suffix = Suffix2768 self.Company = Company2769 self.MiddleName = MiddleName2770 self.AlternateMiddleName = AlternateMiddleName2771 self.MaternalLastName = MaternalLastName2772 self.AlternateMaternalLastName = AlternateMaternalLastName2773 self.AlternateTitle = AlternateTitle2774 self.AlternateSuffix = AlternateSuffix2775 if Address is None:2776 self.Address = []2777 else:2778 self.Address = Address2779 if Phone is None:2780 self.Phone = []2781 else:2782 self.Phone = Phone2783 self.PromoCode = PromoCode2784 self.AcquisitionSource = AcquisitionSource2785 if Email is None:2786 self.Email = []2787 else:2788 self.Email = Email2789 def factory(*args_, **kwargs_):2790 if ConsumerProfileType.subclass:2791 return ConsumerProfileType.subclass(*args_, **kwargs_)2792 else:2793 return ConsumerProfileType(*args_, **kwargs_)2794 factory = staticmethod(factory)2795 def get_Title(self): return self.Title2796 def set_Title(self, Title): self.Title = Title2797 def validate_Title(self, value):2798 # Validate type Title, a restriction on Consumer.2799 pass2800 def get_FirstName(self): return self.FirstName2801 def set_FirstName(self, FirstName): self.FirstName = FirstName2802 def validate_FirstName(self, value):2803 # Validate type FirstName, a restriction on Name.2804 pass2805 def get_LastName(self): return self.LastName2806 def set_LastName(self, LastName): self.LastName = LastName2807 def validate_LastName(self, value):2808 # Validate type LastName, a restriction on Name.2809 pass2810 def get_AlternateFirstName(self): return self.AlternateFirstName2811 def set_AlternateFirstName(self, AlternateFirstName): self.AlternateFirstName = AlternateFirstName2812 def get_AlternateLastName(self): return self.AlternateLastName2813 def set_AlternateLastName(self, AlternateLastName): self.AlternateLastName = AlternateLastName2814 def get_DOB(self): return self.DOB2815 def set_DOB(self, DOB): self.DOB = DOB2816 def validate_Date(self, value):2817 # Validate type Date, a restriction on xs:date.2818 pass2819 def get_Gender(self): return self.Gender2820 def set_Gender(self, Gender): self.Gender = Gender2821 def validate_Gender(self, value):2822 # Validate type Gender, a restriction on Flag.2823 pass2824 def get_MaritalStatus(self): return self.MaritalStatus2825 def set_MaritalStatus(self, MaritalStatus): self.MaritalStatus = MaritalStatus2826 def validate_MaritalStatus(self, value):2827 # Validate type MaritalStatus, a restriction on xs:byte.2828 pass2829 def get_NationalID(self): return self.NationalID2830 def set_NationalID(self, NationalID): self.NationalID = NationalID2831 def validate_NationalID(self, value):2832 # Validate type NationalID, a restriction on Consumer.2833 pass2834 def get_PassportNumber(self): return self.PassportNumber2835 def set_PassportNumber(self, PassportNumber): self.PassportNumber = PassportNumber2836 def validate_PassportNumber(self, value):2837 # Validate type PassportNumber, a restriction on Consumer.2838 pass2839 def get_Education(self): return self.Education2840 def set_Education(self, Education): self.Education = Education2841 def validate_Education(self, value):2842 # Validate type Education, a restriction on Consumer.2843 pass2844 def get_Profession(self): return self.Profession2845 def set_Profession(self, Profession): self.Profession = Profession2846 def validate_Profession(self, value):2847 # Validate type Profession, a restriction on Consumer.2848 pass2849 def get_Suffix(self): return self.Suffix2850 def set_Suffix(self, Suffix): self.Suffix = Suffix2851 def validate_Suffix(self, value):2852 # Validate type Suffix, a restriction on xs:string.2853 pass2854 def get_Company(self): return self.Company2855 def set_Company(self, Company): self.Company = Company2856 def validate_Company(self, value):2857 # Validate type Company, a restriction on Consumer.2858 pass2859 def get_MiddleName(self): return self.MiddleName2860 def set_MiddleName(self, MiddleName): self.MiddleName = MiddleName2861 def validate_MiddleName(self, value):2862 # Validate type MiddleName, a restriction on Name.2863 pass2864 def get_AlternateMiddleName(self): return self.AlternateMiddleName2865 def set_AlternateMiddleName(self, AlternateMiddleName): self.AlternateMiddleName = AlternateMiddleName2866 def get_MaternalLastName(self): return self.MaternalLastName2867 def set_MaternalLastName(self, MaternalLastName): self.MaternalLastName = MaternalLastName2868 def get_AlternateMaternalLastName(self): return self.AlternateMaternalLastName2869 def set_AlternateMaternalLastName(self, AlternateMaternalLastName): self.AlternateMaternalLastName = AlternateMaternalLastName2870 def get_AlternateTitle(self): return self.AlternateTitle2871 def set_AlternateTitle(self, AlternateTitle): self.AlternateTitle = AlternateTitle2872 def get_AlternateSuffix(self): return self.AlternateSuffix2873 def set_AlternateSuffix(self, AlternateSuffix): self.AlternateSuffix = AlternateSuffix2874 def get_Address(self): return self.Address2875 def set_Address(self, Address): self.Address = Address2876 def add_Address(self, value): self.Address.append(value)2877 def insert_Address(self, index, value): self.Address[index] = value2878 def get_Phone(self): return self.Phone2879 def set_Phone(self, Phone): self.Phone = Phone2880 def add_Phone(self, value): self.Phone.append(value)2881 def insert_Phone(self, index, value): self.Phone[index] = value2882 def get_PromoCode(self): return self.PromoCode2883 def set_PromoCode(self, PromoCode): self.PromoCode = PromoCode2884 def validate_PromoCodeDesc(self, value):2885 # Validate type PromoCodeDesc, a restriction on Name.2886 pass2887 def get_AcquisitionSource(self): return self.AcquisitionSource2888 def set_AcquisitionSource(self, AcquisitionSource): self.AcquisitionSource = AcquisitionSource2889 def validate_AcquisitionSourceType(self, value):2890 # Validate type AcquisitionSourceType, a restriction on Name.2891 pass2892 def get_Email(self): return self.Email2893 def set_Email(self, Email): self.Email = Email2894 def add_Email(self, value): self.Email.append(value)2895 def insert_Email(self, index, value): self.Email[index] = value2896 def export(self, outfile, level, namespace_='', name_='ConsumerProfileType', namespacedef_='', pretty_print=True):2897 if pretty_print:2898 eol_ = '\n'2899 else:2900 eol_ = ''2901 showIndent(outfile, level, pretty_print)2902 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))2903 already_processed = []2904 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ConsumerProfileType')2905 if self.hasContent_():2906 outfile.write('>%s' % (eol_, ))2907 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)2908 showIndent(outfile, level, pretty_print)2909 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))2910 else:2911 outfile.write('/>%s' % (eol_, ))2912 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ConsumerProfileType'):2913 pass2914 def exportChildren(self, outfile, level, namespace_='', name_='ConsumerProfileType', fromsubclass_=False, pretty_print=True):2915 if pretty_print:2916 eol_ = '\n'2917 else:2918 eol_ = ''2919 if self.Title is not None:2920 showIndent(outfile, level, pretty_print)2921 outfile.write('<%sTitle>%s</%sTitle>%s' % (namespace_, self.gds_format_string(quote_xml(self.Title).encode(ExternalEncoding), input_name='Title'), namespace_, eol_))2922 if self.FirstName is not None:2923 showIndent(outfile, level, pretty_print)2924 outfile.write('<%sFirstName>%s</%sFirstName>%s' % (namespace_, self.gds_format_string(quote_xml(self.FirstName).encode(ExternalEncoding), input_name='FirstName'), namespace_, eol_))2925 if self.LastName is not None:2926 showIndent(outfile, level, pretty_print)2927 outfile.write('<%sLastName>%s</%sLastName>%s' % (namespace_, self.gds_format_string(quote_xml(self.LastName).encode(ExternalEncoding), input_name='LastName'), namespace_, eol_))2928 if self.AlternateFirstName is not None:2929 showIndent(outfile, level, pretty_print)2930 outfile.write('<%sAlternateFirstName>%s</%sAlternateFirstName>%s' % (namespace_, self.gds_format_string(quote_xml(self.AlternateFirstName).encode(ExternalEncoding), input_name='AlternateFirstName'), namespace_, eol_))2931 if self.AlternateLastName is not None:2932 showIndent(outfile, level, pretty_print)2933 outfile.write('<%sAlternateLastName>%s</%sAlternateLastName>%s' % (namespace_, self.gds_format_string(quote_xml(self.AlternateLastName).encode(ExternalEncoding), input_name='AlternateLastName'), namespace_, eol_))2934 if self.DOB is not None:2935 showIndent(outfile, level, pretty_print)2936 outfile.write('<%sDOB>%s</%sDOB>%s' % (namespace_, self.gds_format_string(quote_xml(self.DOB).encode(ExternalEncoding), input_name='DOB'), namespace_, eol_))2937 if self.Gender is not None:2938 showIndent(outfile, level, pretty_print)2939 outfile.write('<%sGender>%s</%sGender>%s' % (namespace_, self.gds_format_integer(self.Gender, input_name='Gender'), namespace_, eol_))2940 if self.MaritalStatus is not None:2941 showIndent(outfile, level, pretty_print)2942 outfile.write('<%sMaritalStatus>%s</%sMaritalStatus>%s' % (namespace_, self.gds_format_integer(self.MaritalStatus, input_name='MaritalStatus'), namespace_, eol_))2943 if self.NationalID is not None:2944 showIndent(outfile, level, pretty_print)2945 outfile.write('<%sNationalID>%s</%sNationalID>%s' % (namespace_, self.gds_format_string(quote_xml(self.NationalID).encode(ExternalEncoding), input_name='NationalID'), namespace_, eol_))2946 if self.PassportNumber is not None:2947 showIndent(outfile, level, pretty_print)2948 outfile.write('<%sPassportNumber>%s</%sPassportNumber>%s' % (namespace_, self.gds_format_string(quote_xml(self.PassportNumber).encode(ExternalEncoding), input_name='PassportNumber'), namespace_, eol_))2949 if self.Education is not None:2950 showIndent(outfile, level, pretty_print)2951 outfile.write('<%sEducation>%s</%sEducation>%s' % (namespace_, self.gds_format_string(quote_xml(self.Education).encode(ExternalEncoding), input_name='Education'), namespace_, eol_))2952 if self.Profession is not None:2953 showIndent(outfile, level, pretty_print)2954 outfile.write('<%sProfession>%s</%sProfession>%s' % (namespace_, self.gds_format_string(quote_xml(self.Profession).encode(ExternalEncoding), input_name='Profession'), namespace_, eol_))2955 if self.Suffix is not None:2956 showIndent(outfile, level, pretty_print)2957 outfile.write('<%sSuffix>%s</%sSuffix>%s' % (namespace_, self.gds_format_string(quote_xml(self.Suffix).encode(ExternalEncoding), input_name='Suffix'), namespace_, eol_))2958 if self.Company is not None:2959 showIndent(outfile, level, pretty_print)2960 outfile.write('<%sCompany>%s</%sCompany>%s' % (namespace_, self.gds_format_string(quote_xml(self.Company).encode(ExternalEncoding), input_name='Company'), namespace_, eol_))2961 if self.MiddleName is not None:2962 showIndent(outfile, level, pretty_print)2963 outfile.write('<%sMiddleName>%s</%sMiddleName>%s' % (namespace_, self.gds_format_string(quote_xml(self.MiddleName).encode(ExternalEncoding), input_name='MiddleName'), namespace_, eol_))2964 if self.AlternateMiddleName is not None:2965 showIndent(outfile, level, pretty_print)2966 outfile.write('<%sAlternateMiddleName>%s</%sAlternateMiddleName>%s' % (namespace_, self.gds_format_string(quote_xml(self.AlternateMiddleName).encode(ExternalEncoding), input_name='AlternateMiddleName'), namespace_, eol_))2967 if self.MaternalLastName is not None:2968 showIndent(outfile, level, pretty_print)2969 outfile.write('<%sMaternalLastName>%s</%sMaternalLastName>%s' % (namespace_, self.gds_format_string(quote_xml(self.MaternalLastName).encode(ExternalEncoding), input_name='MaternalLastName'), namespace_, eol_))2970 if self.AlternateMaternalLastName is not None:2971 showIndent(outfile, level, pretty_print)2972 outfile.write('<%sAlternateMaternalLastName>%s</%sAlternateMaternalLastName>%s' % (namespace_, self.gds_format_string(quote_xml(self.AlternateMaternalLastName).encode(ExternalEncoding), input_name='AlternateMaternalLastName'), namespace_, eol_))2973 if self.AlternateTitle is not None:2974 showIndent(outfile, level, pretty_print)2975 outfile.write('<%sAlternateTitle>%s</%sAlternateTitle>%s' % (namespace_, self.gds_format_string(quote_xml(self.AlternateTitle).encode(ExternalEncoding), input_name='AlternateTitle'), namespace_, eol_))2976 if self.AlternateSuffix is not None:2977 showIndent(outfile, level, pretty_print)2978 outfile.write('<%sAlternateSuffix>%s</%sAlternateSuffix>%s' % (namespace_, self.gds_format_string(quote_xml(self.AlternateSuffix).encode(ExternalEncoding), input_name='AlternateSuffix'), namespace_, eol_))2979 for Address_ in self.Address:2980 Address_.export(outfile, level, namespace_, name_='Address', pretty_print=pretty_print)2981 for Phone_ in self.Phone:2982 Phone_.export(outfile, level, namespace_, name_='Phone', pretty_print=pretty_print)2983 if self.PromoCode is not None:2984 showIndent(outfile, level, pretty_print)2985 outfile.write('<%sPromoCode>%s</%sPromoCode>%s' % (namespace_, self.gds_format_string(quote_xml(self.PromoCode).encode(ExternalEncoding), input_name='PromoCode'), namespace_, eol_))2986 if self.AcquisitionSource is not None:2987 showIndent(outfile, level, pretty_print)2988 outfile.write('<%sAcquisitionSource>%s</%sAcquisitionSource>%s' % (namespace_, self.gds_format_string(quote_xml(self.AcquisitionSource).encode(ExternalEncoding), input_name='AcquisitionSource'), namespace_, eol_))2989 for Email_ in self.Email:2990 Email_.export(outfile, level, namespace_, name_='Email', pretty_print=pretty_print)2991 def hasContent_(self):2992 if (2993 self.Title is not None or2994 self.FirstName is not None or2995 self.LastName is not None or2996 self.AlternateFirstName is not None or2997 self.AlternateLastName is not None or2998 self.DOB is not None or2999 self.Gender is not None or3000 self.MaritalStatus is not None or3001 self.NationalID is not None or3002 self.PassportNumber is not None or3003 self.Education is not None or3004 self.Profession is not None or3005 self.Suffix is not None or3006 self.Company is not None or3007 self.MiddleName is not None or3008 self.AlternateMiddleName is not None or3009 self.MaternalLastName is not None or3010 self.AlternateMaternalLastName is not None or3011 self.AlternateTitle is not None or3012 self.AlternateSuffix is not None or3013 self.Address or3014 self.Phone or3015 self.PromoCode is not None or3016 self.AcquisitionSource is not None or3017 self.Email3018 ):3019 return True3020 else:3021 return False3022 def exportLiteral(self, outfile, level, name_='ConsumerProfileType'):3023 level += 13024 self.exportLiteralAttributes(outfile, level, [], name_)3025 if self.hasContent_():3026 self.exportLiteralChildren(outfile, level, name_)3027 def exportLiteralAttributes(self, outfile, level, already_processed, name_):3028 pass3029 def exportLiteralChildren(self, outfile, level, name_):3030 if self.Title is not None:3031 showIndent(outfile, level)3032 outfile.write('Title=%s,\n' % quote_python(self.Title).encode(ExternalEncoding))3033 if self.FirstName is not None:3034 showIndent(outfile, level)3035 outfile.write('FirstName=%s,\n' % quote_python(self.FirstName).encode(ExternalEncoding))3036 if self.LastName is not None:3037 showIndent(outfile, level)3038 outfile.write('LastName=%s,\n' % quote_python(self.LastName).encode(ExternalEncoding))3039 if self.AlternateFirstName is not None:3040 showIndent(outfile, level)3041 outfile.write('AlternateFirstName=%s,\n' % quote_python(self.AlternateFirstName).encode(ExternalEncoding))3042 if self.AlternateLastName is not None:3043 showIndent(outfile, level)3044 outfile.write('AlternateLastName=%s,\n' % quote_python(self.AlternateLastName).encode(ExternalEncoding))3045 if self.DOB is not None:3046 showIndent(outfile, level)3047 outfile.write('DOB=%s,\n' % quote_python(self.DOB).encode(ExternalEncoding))3048 if self.Gender is not None:3049 showIndent(outfile, level)3050 outfile.write('Gender=%d,\n' % self.Gender)3051 if self.MaritalStatus is not None:3052 showIndent(outfile, level)3053 outfile.write('MaritalStatus=%d,\n' % self.MaritalStatus)3054 if self.NationalID is not None:3055 showIndent(outfile, level)3056 outfile.write('NationalID=%s,\n' % quote_python(self.NationalID).encode(ExternalEncoding))3057 if self.PassportNumber is not None:3058 showIndent(outfile, level)3059 outfile.write('PassportNumber=%s,\n' % quote_python(self.PassportNumber).encode(ExternalEncoding))3060 if self.Education is not None:3061 showIndent(outfile, level)3062 outfile.write('Education=%s,\n' % quote_python(self.Education).encode(ExternalEncoding))3063 if self.Profession is not None:3064 showIndent(outfile, level)3065 outfile.write('Profession=%s,\n' % quote_python(self.Profession).encode(ExternalEncoding))3066 if self.Suffix is not None:3067 showIndent(outfile, level)3068 outfile.write('Suffix=%s,\n' % quote_python(self.Suffix).encode(ExternalEncoding))3069 if self.Company is not None:3070 showIndent(outfile, level)3071 outfile.write('Company=%s,\n' % quote_python(self.Company).encode(ExternalEncoding))3072 if self.MiddleName is not None:3073 showIndent(outfile, level)3074 outfile.write('MiddleName=%s,\n' % quote_python(self.MiddleName).encode(ExternalEncoding))3075 if self.AlternateMiddleName is not None:3076 showIndent(outfile, level)3077 outfile.write('AlternateMiddleName=%s,\n' % quote_python(self.AlternateMiddleName).encode(ExternalEncoding))3078 if self.MaternalLastName is not None:3079 showIndent(outfile, level)3080 outfile.write('MaternalLastName=%s,\n' % quote_python(self.MaternalLastName).encode(ExternalEncoding))3081 if self.AlternateMaternalLastName is not None:3082 showIndent(outfile, level)3083 outfile.write('AlternateMaternalLastName=%s,\n' % quote_python(self.AlternateMaternalLastName).encode(ExternalEncoding))3084 if self.AlternateTitle is not None:3085 showIndent(outfile, level)3086 outfile.write('AlternateTitle=%s,\n' % quote_python(self.AlternateTitle).encode(ExternalEncoding))3087 if self.AlternateSuffix is not None:3088 showIndent(outfile, level)3089 outfile.write('AlternateSuffix=%s,\n' % quote_python(self.AlternateSuffix).encode(ExternalEncoding))3090 showIndent(outfile, level)3091 outfile.write('Address=[\n')3092 level += 13093 for Address_ in self.Address:3094 showIndent(outfile, level)3095 outfile.write('model_.AddressDetailsType(\n')3096 Address_.exportLiteral(outfile, level, name_='AddressDetailsType')3097 showIndent(outfile, level)3098 outfile.write('),\n')3099 level -= 13100 showIndent(outfile, level)3101 outfile.write('],\n')3102 showIndent(outfile, level)3103 outfile.write('Phone=[\n')3104 level += 13105 for Phone_ in self.Phone:3106 showIndent(outfile, level)3107 outfile.write('model_.PhoneDetailsType(\n')3108 Phone_.exportLiteral(outfile, level, name_='PhoneDetailsType')3109 showIndent(outfile, level)3110 outfile.write('),\n')3111 level -= 13112 showIndent(outfile, level)3113 outfile.write('],\n')3114 if self.PromoCode is not None:3115 showIndent(outfile, level)3116 outfile.write('PromoCode=%s,\n' % quote_python(self.PromoCode).encode(ExternalEncoding))3117 if self.AcquisitionSource is not None:3118 showIndent(outfile, level)3119 outfile.write('AcquisitionSource=%s,\n' % quote_python(self.AcquisitionSource).encode(ExternalEncoding))3120 showIndent(outfile, level)3121 outfile.write('Email=[\n')3122 level += 13123 for Email_ in self.Email:3124 showIndent(outfile, level)3125 outfile.write('model_.EmailDetailsType(\n')3126 Email_.exportLiteral(outfile, level, name_='EmailDetailsType')3127 showIndent(outfile, level)3128 outfile.write('),\n')3129 level -= 13130 showIndent(outfile, level)3131 outfile.write('],\n')3132 def build(self, node):3133 self.buildAttributes(node, node.attrib, [])3134 for child in node:3135 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]3136 self.buildChildren(child, node, nodeName_)3137 def buildAttributes(self, node, attrs, already_processed):3138 pass3139 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):3140 if nodeName_ == 'Title':3141 Title_ = child_.text3142 Title_ = self.gds_validate_string(Title_, node, 'Title')3143 self.Title = Title_3144 self.validate_Title(self.Title) # validate type Title3145 elif nodeName_ == 'FirstName':3146 FirstName_ = child_.text3147 FirstName_ = self.gds_validate_string(FirstName_, node, 'FirstName')3148 self.FirstName = FirstName_3149 self.validate_FirstName(self.FirstName) # validate type FirstName3150 elif nodeName_ == 'LastName':3151 LastName_ = child_.text3152 LastName_ = self.gds_validate_string(LastName_, node, 'LastName')3153 self.LastName = LastName_3154 self.validate_LastName(self.LastName) # validate type LastName3155 elif nodeName_ == 'AlternateFirstName':3156 AlternateFirstName_ = child_.text3157 AlternateFirstName_ = self.gds_validate_string(AlternateFirstName_, node, 'AlternateFirstName')3158 self.AlternateFirstName = AlternateFirstName_3159 self.validate_FirstName(self.AlternateFirstName) # validate type FirstName3160 elif nodeName_ == 'AlternateLastName':3161 AlternateLastName_ = child_.text3162 AlternateLastName_ = self.gds_validate_string(AlternateLastName_, node, 'AlternateLastName')3163 self.AlternateLastName = AlternateLastName_3164 self.validate_LastName(self.AlternateLastName) # validate type LastName3165 elif nodeName_ == 'DOB':3166 DOB_ = child_.text3167 DOB_ = self.gds_validate_string(DOB_, node, 'DOB')3168 self.DOB = DOB_3169 self.validate_Date(self.DOB) # validate type Date3170 elif nodeName_ == 'Gender':3171 sval_ = child_.text3172 try:3173 ival_ = int(sval_)3174 except (TypeError, ValueError), exp:3175 raise_parse_error(child_, 'requires integer: %s' % exp)3176 ival_ = self.gds_validate_integer(ival_, node, 'Gender')3177 self.Gender = ival_3178 self.validate_Gender(self.Gender) # validate type Gender3179 elif nodeName_ == 'MaritalStatus':3180 sval_ = child_.text3181 try:3182 ival_ = int(sval_)3183 except (TypeError, ValueError), exp:3184 raise_parse_error(child_, 'requires integer: %s' % exp)3185 ival_ = self.gds_validate_integer(ival_, node, 'MaritalStatus')3186 self.MaritalStatus = ival_3187 self.validate_MaritalStatus(self.MaritalStatus) # validate type MaritalStatus3188 elif nodeName_ == 'NationalID':3189 NationalID_ = child_.text3190 NationalID_ = self.gds_validate_string(NationalID_, node, 'NationalID')3191 self.NationalID = NationalID_3192 self.validate_NationalID(self.NationalID) # validate type NationalID3193 elif nodeName_ == 'PassportNumber':3194 PassportNumber_ = child_.text3195 PassportNumber_ = self.gds_validate_string(PassportNumber_, node, 'PassportNumber')3196 self.PassportNumber = PassportNumber_3197 self.validate_PassportNumber(self.PassportNumber) # validate type PassportNumber3198 elif nodeName_ == 'Education':3199 Education_ = child_.text3200 Education_ = self.gds_validate_string(Education_, node, 'Education')3201 self.Education = Education_3202 self.validate_Education(self.Education) # validate type Education3203 elif nodeName_ == 'Profession':3204 Profession_ = child_.text3205 Profession_ = self.gds_validate_string(Profession_, node, 'Profession')3206 self.Profession = Profession_3207 self.validate_Profession(self.Profession) # validate type Profession3208 elif nodeName_ == 'Suffix':3209 Suffix_ = child_.text3210 Suffix_ = self.gds_validate_string(Suffix_, node, 'Suffix')3211 self.Suffix = Suffix_3212 self.validate_Suffix(self.Suffix) # validate type Suffix3213 elif nodeName_ == 'Company':3214 Company_ = child_.text3215 Company_ = self.gds_validate_string(Company_, node, 'Company')3216 self.Company = Company_3217 self.validate_Company(self.Company) # validate type Company3218 elif nodeName_ == 'MiddleName':3219 MiddleName_ = child_.text3220 MiddleName_ = self.gds_validate_string(MiddleName_, node, 'MiddleName')3221 self.MiddleName = MiddleName_3222 self.validate_MiddleName(self.MiddleName) # validate type MiddleName3223 elif nodeName_ == 'AlternateMiddleName':3224 AlternateMiddleName_ = child_.text3225 AlternateMiddleName_ = self.gds_validate_string(AlternateMiddleName_, node, 'AlternateMiddleName')3226 self.AlternateMiddleName = AlternateMiddleName_3227 self.validate_MiddleName(self.AlternateMiddleName) # validate type MiddleName3228 elif nodeName_ == 'MaternalLastName':3229 MaternalLastName_ = child_.text3230 MaternalLastName_ = self.gds_validate_string(MaternalLastName_, node, 'MaternalLastName')3231 self.MaternalLastName = MaternalLastName_3232 self.validate_LastName(self.MaternalLastName) # validate type LastName3233 elif nodeName_ == 'AlternateMaternalLastName':3234 AlternateMaternalLastName_ = child_.text3235 AlternateMaternalLastName_ = self.gds_validate_string(AlternateMaternalLastName_, node, 'AlternateMaternalLastName')3236 self.AlternateMaternalLastName = AlternateMaternalLastName_3237 self.validate_LastName(self.AlternateMaternalLastName) # validate type LastName3238 elif nodeName_ == 'AlternateTitle':3239 AlternateTitle_ = child_.text3240 AlternateTitle_ = self.gds_validate_string(AlternateTitle_, node, 'AlternateTitle')3241 self.AlternateTitle = AlternateTitle_3242 self.validate_Title(self.AlternateTitle) # validate type Title3243 elif nodeName_ == 'AlternateSuffix':3244 AlternateSuffix_ = child_.text3245 AlternateSuffix_ = self.gds_validate_string(AlternateSuffix_, node, 'AlternateSuffix')3246 self.AlternateSuffix = AlternateSuffix_3247 self.validate_Suffix(self.AlternateSuffix) # validate type Suffix3248 elif nodeName_ == 'Address':3249 obj_ = AddressDetailsType.factory()3250 obj_.build(child_)3251 self.Address.append(obj_)3252 elif nodeName_ == 'Phone':3253 obj_ = PhoneDetailsType.factory()3254 obj_.build(child_)3255 self.Phone.append(obj_)3256 elif nodeName_ == 'PromoCode':3257 PromoCode_ = child_.text3258 PromoCode_ = self.gds_validate_string(PromoCode_, node, 'PromoCode')3259 self.PromoCode = PromoCode_3260 self.validate_PromoCodeDesc(self.PromoCode) # validate type PromoCodeDesc3261 elif nodeName_ == 'AcquisitionSource':3262 AcquisitionSource_ = child_.text3263 AcquisitionSource_ = self.gds_validate_string(AcquisitionSource_, node, 'AcquisitionSource')3264 self.AcquisitionSource = AcquisitionSource_3265 self.validate_AcquisitionSourceType(self.AcquisitionSource) # validate type AcquisitionSourceType3266 elif nodeName_ == 'Email':3267 obj_ = EmailDetailsType.factory()3268 obj_.build(child_)3269 self.Email.append(obj_)3270# end class ConsumerProfileType3271class PhoneDetailsType(GeneratedsSuper):3272 subclass = None3273 superclass = None3274 def __init__(self, PhoneID=None, InternationalCode=None, AreaCode=None, PhoneNumber=None, PhoneType=None, Extension=None, ModifyFlag=None):3275 self.PhoneID = PhoneID3276 self.InternationalCode = InternationalCode3277 self.AreaCode = AreaCode3278 self.PhoneNumber = PhoneNumber3279 self.PhoneType = PhoneType3280 self.Extension = Extension3281 self.ModifyFlag = ModifyFlag3282 def factory(*args_, **kwargs_):3283 if PhoneDetailsType.subclass:3284 return PhoneDetailsType.subclass(*args_, **kwargs_)3285 else:3286 return PhoneDetailsType(*args_, **kwargs_)3287 factory = staticmethod(factory)3288 def get_PhoneID(self): return self.PhoneID3289 def set_PhoneID(self, PhoneID): self.PhoneID = PhoneID3290 def get_InternationalCode(self): return self.InternationalCode3291 def set_InternationalCode(self, InternationalCode): self.InternationalCode = InternationalCode3292 def validate_AreaCode(self, value):3293 # Validate type AreaCode, a restriction on Name.3294 pass3295 def get_AreaCode(self): return self.AreaCode3296 def set_AreaCode(self, AreaCode): self.AreaCode = AreaCode3297 def get_PhoneNumber(self): return self.PhoneNumber3298 def set_PhoneNumber(self, PhoneNumber): self.PhoneNumber = PhoneNumber3299 def validate_PhoneNumber(self, value):3300 # Validate type PhoneNumber, a restriction on Name.3301 pass3302 def get_PhoneType(self): return self.PhoneType3303 def set_PhoneType(self, PhoneType): self.PhoneType = PhoneType3304 def validate_PhoneType(self, value):3305 # Validate type PhoneType, a restriction on xs:byte.3306 pass3307 def get_Extension(self): return self.Extension3308 def set_Extension(self, Extension): self.Extension = Extension3309 def get_ModifyFlag(self): return self.ModifyFlag3310 def set_ModifyFlag(self, ModifyFlag): self.ModifyFlag = ModifyFlag3311 def export(self, outfile, level, namespace_='', name_='PhoneDetailsType', namespacedef_='', pretty_print=True):3312 if pretty_print:3313 eol_ = '\n'3314 else:3315 eol_ = ''3316 showIndent(outfile, level, pretty_print)3317 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))3318 already_processed = []3319 self.exportAttributes(outfile, level, already_processed, namespace_, name_='PhoneDetailsType')3320 if self.hasContent_():3321 outfile.write('>%s' % (eol_, ))3322 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)3323 showIndent(outfile, level, pretty_print)3324 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))3325 else:3326 outfile.write('/>%s' % (eol_, ))3327 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PhoneDetailsType'):3328 pass3329 def exportChildren(self, outfile, level, namespace_='', name_='PhoneDetailsType', fromsubclass_=False, pretty_print=True):3330 if pretty_print:3331 eol_ = '\n'3332 else:3333 eol_ = ''3334 if self.PhoneID is not None:3335 showIndent(outfile, level, pretty_print)3336 outfile.write('<%sPhoneID>%s</%sPhoneID>%s' % (namespace_, self.gds_format_integer(self.PhoneID, input_name='PhoneID'), namespace_, eol_))3337 if self.InternationalCode is not None:3338 showIndent(outfile, level, pretty_print)3339 outfile.write('<%sInternationalCode>%s</%sInternationalCode>%s' % (namespace_, self.gds_format_string(quote_xml(self.InternationalCode).encode(ExternalEncoding), input_name='InternationalCode'), namespace_, eol_))3340 if self.AreaCode is not None:3341 showIndent(outfile, level, pretty_print)3342 outfile.write('<%sAreaCode>%s</%sAreaCode>%s' % (namespace_, self.gds_format_string(quote_xml(self.AreaCode).encode(ExternalEncoding), input_name='AreaCode'), namespace_, eol_))3343 if self.PhoneNumber is not None:3344 showIndent(outfile, level, pretty_print)3345 outfile.write('<%sPhoneNumber>%s</%sPhoneNumber>%s' % (namespace_, self.gds_format_string(quote_xml(self.PhoneNumber).encode(ExternalEncoding), input_name='PhoneNumber'), namespace_, eol_))3346 if self.PhoneType is not None:3347 showIndent(outfile, level, pretty_print)3348 outfile.write('<%sPhoneType>%s</%sPhoneType>%s' % (namespace_, self.gds_format_integer(self.PhoneType, input_name='PhoneType'), namespace_, eol_))3349 if self.Extension is not None:3350 showIndent(outfile, level, pretty_print)3351 outfile.write('<%sExtension>%s</%sExtension>%s' % (namespace_, self.gds_format_string(quote_xml(self.Extension).encode(ExternalEncoding), input_name='Extension'), namespace_, eol_))3352 if self.ModifyFlag is not None:3353 showIndent(outfile, level, pretty_print)3354 outfile.write('<%sModifyFlag>%s</%sModifyFlag>%s' % (namespace_, self.gds_format_string(quote_xml(self.ModifyFlag).encode(ExternalEncoding), input_name='ModifyFlag'), namespace_, eol_))3355 def hasContent_(self):3356 if (3357 self.PhoneID is not None or3358 self.InternationalCode is not None or3359 self.AreaCode is not None or3360 self.PhoneNumber is not None or3361 self.PhoneType is not None or3362 self.Extension is not None or3363 self.ModifyFlag is not None3364 ):3365 return True3366 else:3367 return False3368 def exportLiteral(self, outfile, level, name_='PhoneDetailsType'):3369 level += 13370 self.exportLiteralAttributes(outfile, level, [], name_)3371 if self.hasContent_():3372 self.exportLiteralChildren(outfile, level, name_)3373 def exportLiteralAttributes(self, outfile, level, already_processed, name_):3374 pass3375 def exportLiteralChildren(self, outfile, level, name_):3376 if self.PhoneID is not None:3377 showIndent(outfile, level)3378 outfile.write('PhoneID=%d,\n' % self.PhoneID)3379 if self.InternationalCode is not None:3380 showIndent(outfile, level)3381 outfile.write('InternationalCode=%s,\n' % quote_python(self.InternationalCode).encode(ExternalEncoding))3382 if self.AreaCode is not None:3383 showIndent(outfile, level)3384 outfile.write('AreaCode=%s,\n' % quote_python(self.AreaCode).encode(ExternalEncoding))3385 if self.PhoneNumber is not None:3386 showIndent(outfile, level)3387 outfile.write('PhoneNumber=%s,\n' % quote_python(self.PhoneNumber).encode(ExternalEncoding))3388 if self.PhoneType is not None:3389 showIndent(outfile, level)3390 outfile.write('PhoneType=%d,\n' % self.PhoneType)3391 if self.Extension is not None:3392 showIndent(outfile, level)3393 outfile.write('Extension=%s,\n' % quote_python(self.Extension).encode(ExternalEncoding))3394 if self.ModifyFlag is not None:3395 showIndent(outfile, level)3396 outfile.write('ModifyFlag=%s,\n' % quote_python(self.ModifyFlag).encode(ExternalEncoding))3397 def build(self, node):3398 self.buildAttributes(node, node.attrib, [])3399 for child in node:3400 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]3401 self.buildChildren(child, node, nodeName_)3402 def buildAttributes(self, node, attrs, already_processed):3403 pass3404 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):3405 if nodeName_ == 'PhoneID':3406 sval_ = child_.text3407 try:3408 ival_ = int(sval_)3409 except (TypeError, ValueError), exp:3410 raise_parse_error(child_, 'requires integer: %s' % exp)3411 ival_ = self.gds_validate_integer(ival_, node, 'PhoneID')3412 self.PhoneID = ival_3413 elif nodeName_ == 'InternationalCode':3414 InternationalCode_ = child_.text3415 InternationalCode_ = self.gds_validate_string(InternationalCode_, node, 'InternationalCode')3416 self.InternationalCode = InternationalCode_3417 self.validate_AreaCode(self.InternationalCode) # validate type AreaCode3418 elif nodeName_ == 'AreaCode':3419 AreaCode_ = child_.text3420 AreaCode_ = self.gds_validate_string(AreaCode_, node, 'AreaCode')3421 self.AreaCode = AreaCode_3422 self.validate_AreaCode(self.AreaCode) # validate type AreaCode3423 elif nodeName_ == 'PhoneNumber':3424 PhoneNumber_ = child_.text3425 PhoneNumber_ = self.gds_validate_string(PhoneNumber_, node, 'PhoneNumber')3426 self.PhoneNumber = PhoneNumber_3427 self.validate_PhoneNumber(self.PhoneNumber) # validate type PhoneNumber3428 elif nodeName_ == 'PhoneType':3429 sval_ = child_.text3430 try:3431 ival_ = int(sval_)3432 except (TypeError, ValueError), exp:3433 raise_parse_error(child_, 'requires integer: %s' % exp)3434 ival_ = self.gds_validate_integer(ival_, node, 'PhoneType')3435 self.PhoneType = ival_3436 self.validate_PhoneType(self.PhoneType) # validate type PhoneType3437 elif nodeName_ == 'Extension':3438 Extension_ = child_.text3439 Extension_ = self.gds_validate_string(Extension_, node, 'Extension')3440 self.Extension = Extension_3441 self.validate_AreaCode(self.Extension) # validate type AreaCode3442 elif nodeName_ == 'ModifyFlag':3443 ModifyFlag_ = child_.text3444 ModifyFlag_ = self.gds_validate_string(ModifyFlag_, node, 'ModifyFlag')3445 self.ModifyFlag = ModifyFlag_3446# end class PhoneDetailsType3447class SocialNetworksType(GeneratedsSuper):3448 subclass = None3449 superclass = None3450 def __init__(self, PromoCode=None, AcquisitionSource=None, QuestionCategory=None):3451 self.PromoCode = PromoCode3452 self.AcquisitionSource = AcquisitionSource3453 if QuestionCategory is None:3454 self.QuestionCategory = []3455 else:3456 self.QuestionCategory = QuestionCategory3457 def factory(*args_, **kwargs_):3458 if SocialNetworksType.subclass:3459 return SocialNetworksType.subclass(*args_, **kwargs_)3460 else:3461 return SocialNetworksType(*args_, **kwargs_)3462 factory = staticmethod(factory)3463 def get_PromoCode(self): return self.PromoCode3464 def set_PromoCode(self, PromoCode): self.PromoCode = PromoCode3465 def validate_PromoCodeDesc(self, value):3466 # Validate type PromoCodeDesc, a restriction on Name.3467 pass3468 def get_AcquisitionSource(self): return self.AcquisitionSource3469 def set_AcquisitionSource(self, AcquisitionSource): self.AcquisitionSource = AcquisitionSource3470 def validate_AcquisitionSourceType(self, value):3471 # Validate type AcquisitionSourceType, a restriction on Name.3472 pass3473 def get_QuestionCategory(self): return self.QuestionCategory3474 def set_QuestionCategory(self, QuestionCategory): self.QuestionCategory = QuestionCategory3475 def add_QuestionCategory(self, value): self.QuestionCategory.append(value)3476 def insert_QuestionCategory(self, index, value): self.QuestionCategory[index] = value3477 def export(self, outfile, level, namespace_='', name_='SocialNetworksType', namespacedef_='', pretty_print=True):3478 if pretty_print:3479 eol_ = '\n'3480 else:3481 eol_ = ''3482 showIndent(outfile, level, pretty_print)3483 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))3484 already_processed = []3485 self.exportAttributes(outfile, level, already_processed, namespace_, name_='SocialNetworksType')3486 if self.hasContent_():3487 outfile.write('>%s' % (eol_, ))3488 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)3489 showIndent(outfile, level, pretty_print)3490 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))3491 else:3492 outfile.write('/>%s' % (eol_, ))3493 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SocialNetworksType'):3494 pass3495 def exportChildren(self, outfile, level, namespace_='', name_='SocialNetworksType', fromsubclass_=False, pretty_print=True):3496 if pretty_print:3497 eol_ = '\n'3498 else:3499 eol_ = ''3500 if self.PromoCode is not None:3501 showIndent(outfile, level, pretty_print)3502 outfile.write('<%sPromoCode>%s</%sPromoCode>%s' % (namespace_, self.gds_format_string(quote_xml(self.PromoCode).encode(ExternalEncoding), input_name='PromoCode'), namespace_, eol_))3503 if self.AcquisitionSource is not None:3504 showIndent(outfile, level, pretty_print)3505 outfile.write('<%sAcquisitionSource>%s</%sAcquisitionSource>%s' % (namespace_, self.gds_format_string(quote_xml(self.AcquisitionSource).encode(ExternalEncoding), input_name='AcquisitionSource'), namespace_, eol_))3506 for QuestionCategory_ in self.QuestionCategory:3507 QuestionCategory_.export(outfile, level, namespace_, name_='QuestionCategory', pretty_print=pretty_print)3508 def hasContent_(self):3509 if (3510 self.PromoCode is not None or3511 self.AcquisitionSource is not None or3512 self.QuestionCategory3513 ):3514 return True3515 else:3516 return False3517 def exportLiteral(self, outfile, level, name_='SocialNetworksType'):3518 level += 13519 self.exportLiteralAttributes(outfile, level, [], name_)3520 if self.hasContent_():3521 self.exportLiteralChildren(outfile, level, name_)3522 def exportLiteralAttributes(self, outfile, level, already_processed, name_):3523 pass3524 def exportLiteralChildren(self, outfile, level, name_):3525 if self.PromoCode is not None:3526 showIndent(outfile, level)3527 outfile.write('PromoCode=%s,\n' % quote_python(self.PromoCode).encode(ExternalEncoding))3528 if self.AcquisitionSource is not None:3529 showIndent(outfile, level)3530 outfile.write('AcquisitionSource=%s,\n' % quote_python(self.AcquisitionSource).encode(ExternalEncoding))3531 showIndent(outfile, level)3532 outfile.write('QuestionCategory=[\n')3533 level += 13534 for QuestionCategory_ in self.QuestionCategory:3535 showIndent(outfile, level)3536 outfile.write('model_.CategoryType(\n')3537 QuestionCategory_.exportLiteral(outfile, level, name_='CategoryType')3538 showIndent(outfile, level)3539 outfile.write('),\n')3540 level -= 13541 showIndent(outfile, level)3542 outfile.write('],\n')3543 def build(self, node):3544 self.buildAttributes(node, node.attrib, [])3545 for child in node:3546 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]3547 self.buildChildren(child, node, nodeName_)3548 def buildAttributes(self, node, attrs, already_processed):3549 pass3550 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):3551 if nodeName_ == 'PromoCode':3552 PromoCode_ = child_.text3553 PromoCode_ = self.gds_validate_string(PromoCode_, node, 'PromoCode')3554 self.PromoCode = PromoCode_3555 self.validate_PromoCodeDesc(self.PromoCode) # validate type PromoCodeDesc3556 elif nodeName_ == 'AcquisitionSource':3557 AcquisitionSource_ = child_.text3558 AcquisitionSource_ = self.gds_validate_string(AcquisitionSource_, node, 'AcquisitionSource')3559 self.AcquisitionSource = AcquisitionSource_3560 self.validate_AcquisitionSourceType(self.AcquisitionSource) # validate type AcquisitionSourceType3561 elif nodeName_ == 'QuestionCategory':3562 obj_ = CategoryType.factory()3563 obj_.build(child_)3564 self.QuestionCategory.append(obj_)3565# end class SocialNetworksType3566class ConversionLocationsType(GeneratedsSuper):3567 subclass = None3568 superclass = None3569 def __init__(self, PromoCode=None, AcquisitionSource=None, QuestionCategory=None):3570 self.PromoCode = PromoCode3571 self.AcquisitionSource = AcquisitionSource3572 if QuestionCategory is None:3573 self.QuestionCategory = []3574 else:3575 self.QuestionCategory = QuestionCategory3576 def factory(*args_, **kwargs_):3577 if ConversionLocationsType.subclass:3578 return ConversionLocationsType.subclass(*args_, **kwargs_)3579 else:3580 return ConversionLocationsType(*args_, **kwargs_)3581 factory = staticmethod(factory)3582 def get_PromoCode(self): return self.PromoCode3583 def set_PromoCode(self, PromoCode): self.PromoCode = PromoCode3584 def validate_PromoCodeDesc(self, value):3585 # Validate type PromoCodeDesc, a restriction on Name.3586 pass3587 def get_AcquisitionSource(self): return self.AcquisitionSource3588 def set_AcquisitionSource(self, AcquisitionSource): self.AcquisitionSource = AcquisitionSource3589 def validate_AcquisitionSourceType(self, value):3590 # Validate type AcquisitionSourceType, a restriction on Name.3591 pass3592 def get_QuestionCategory(self): return self.QuestionCategory3593 def set_QuestionCategory(self, QuestionCategory): self.QuestionCategory = QuestionCategory3594 def add_QuestionCategory(self, value): self.QuestionCategory.append(value)3595 def insert_QuestionCategory(self, index, value): self.QuestionCategory[index] = value3596 def export(self, outfile, level, namespace_='', name_='ConversionLocationsType', namespacedef_='', pretty_print=True):3597 if pretty_print:3598 eol_ = '\n'3599 else:3600 eol_ = ''3601 showIndent(outfile, level, pretty_print)3602 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))3603 already_processed = []3604 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ConversionLocationsType')3605 if self.hasContent_():3606 outfile.write('>%s' % (eol_, ))3607 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)3608 showIndent(outfile, level, pretty_print)3609 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))3610 else:3611 outfile.write('/>%s' % (eol_, ))3612 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ConversionLocationsType'):3613 pass3614 def exportChildren(self, outfile, level, namespace_='', name_='ConversionLocationsType', fromsubclass_=False, pretty_print=True):3615 if pretty_print:3616 eol_ = '\n'3617 else:3618 eol_ = ''3619 if self.PromoCode is not None:3620 showIndent(outfile, level, pretty_print)3621 outfile.write('<%sPromoCode>%s</%sPromoCode>%s' % (namespace_, self.gds_format_string(quote_xml(self.PromoCode).encode(ExternalEncoding), input_name='PromoCode'), namespace_, eol_))3622 if self.AcquisitionSource is not None:3623 showIndent(outfile, level, pretty_print)3624 outfile.write('<%sAcquisitionSource>%s</%sAcquisitionSource>%s' % (namespace_, self.gds_format_string(quote_xml(self.AcquisitionSource).encode(ExternalEncoding), input_name='AcquisitionSource'), namespace_, eol_))3625 for QuestionCategory_ in self.QuestionCategory:3626 QuestionCategory_.export(outfile, level, namespace_, name_='QuestionCategory', pretty_print=pretty_print)3627 def hasContent_(self):3628 if (3629 self.PromoCode is not None or3630 self.AcquisitionSource is not None or3631 self.QuestionCategory3632 ):3633 return True3634 else:3635 return False3636 def exportLiteral(self, outfile, level, name_='ConversionLocationsType'):3637 level += 13638 self.exportLiteralAttributes(outfile, level, [], name_)3639 if self.hasContent_():3640 self.exportLiteralChildren(outfile, level, name_)3641 def exportLiteralAttributes(self, outfile, level, already_processed, name_):3642 pass3643 def exportLiteralChildren(self, outfile, level, name_):3644 if self.PromoCode is not None:3645 showIndent(outfile, level)3646 outfile.write('PromoCode=%s,\n' % quote_python(self.PromoCode).encode(ExternalEncoding))3647 if self.AcquisitionSource is not None:3648 showIndent(outfile, level)3649 outfile.write('AcquisitionSource=%s,\n' % quote_python(self.AcquisitionSource).encode(ExternalEncoding))3650 showIndent(outfile, level)3651 outfile.write('QuestionCategory=[\n')3652 level += 13653 for QuestionCategory_ in self.QuestionCategory:3654 showIndent(outfile, level)3655 outfile.write('model_.CategoryType(\n')3656 QuestionCategory_.exportLiteral(outfile, level, name_='CategoryType')3657 showIndent(outfile, level)3658 outfile.write('),\n')3659 level -= 13660 showIndent(outfile, level)3661 outfile.write('],\n')3662 def build(self, node):3663 self.buildAttributes(node, node.attrib, [])3664 for child in node:3665 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]3666 self.buildChildren(child, node, nodeName_)3667 def buildAttributes(self, node, attrs, already_processed):3668 pass3669 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):3670 if nodeName_ == 'PromoCode':3671 PromoCode_ = child_.text3672 PromoCode_ = self.gds_validate_string(PromoCode_, node, 'PromoCode')3673 self.PromoCode = PromoCode_3674 self.validate_PromoCodeDesc(self.PromoCode) # validate type PromoCodeDesc3675 elif nodeName_ == 'AcquisitionSource':3676 AcquisitionSource_ = child_.text3677 AcquisitionSource_ = self.gds_validate_string(AcquisitionSource_, node, 'AcquisitionSource')3678 self.AcquisitionSource = AcquisitionSource_3679 self.validate_AcquisitionSourceType(self.AcquisitionSource) # validate type AcquisitionSourceType3680 elif nodeName_ == 'QuestionCategory':3681 obj_ = CategoryType.factory()3682 obj_.build(child_)3683 self.QuestionCategory.append(obj_)3684# end class ConversionLocationsType3685class FacebookConnectType(GeneratedsSuper):3686 subclass = None3687 superclass = None3688 def __init__(self, PromoCode=None, AcquisitionSource=None, QuestionCategory=None):3689 self.PromoCode = PromoCode3690 self.AcquisitionSource = AcquisitionSource3691 if QuestionCategory is None:3692 self.QuestionCategory = []3693 else:3694 self.QuestionCategory = QuestionCategory3695 def factory(*args_, **kwargs_):3696 if FacebookConnectType.subclass:3697 return FacebookConnectType.subclass(*args_, **kwargs_)3698 else:3699 return FacebookConnectType(*args_, **kwargs_)3700 factory = staticmethod(factory)3701 def get_PromoCode(self): return self.PromoCode3702 def set_PromoCode(self, PromoCode): self.PromoCode = PromoCode3703 def validate_PromoCodeDesc(self, value):3704 # Validate type PromoCodeDesc, a restriction on Name.3705 pass3706 def get_AcquisitionSource(self): return self.AcquisitionSource3707 def set_AcquisitionSource(self, AcquisitionSource): self.AcquisitionSource = AcquisitionSource3708 def validate_AcquisitionSourceType(self, value):3709 # Validate type AcquisitionSourceType, a restriction on Name.3710 pass3711 def get_QuestionCategory(self): return self.QuestionCategory3712 def set_QuestionCategory(self, QuestionCategory): self.QuestionCategory = QuestionCategory3713 def add_QuestionCategory(self, value): self.QuestionCategory.append(value)3714 def insert_QuestionCategory(self, index, value): self.QuestionCategory[index] = value3715 def export(self, outfile, level, namespace_='', name_='FacebookConnectType', namespacedef_='', pretty_print=True):3716 if pretty_print:3717 eol_ = '\n'3718 else:3719 eol_ = ''3720 showIndent(outfile, level, pretty_print)3721 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))3722 already_processed = []3723 self.exportAttributes(outfile, level, already_processed, namespace_, name_='FacebookConnectType')3724 if self.hasContent_():3725 outfile.write('>%s' % (eol_, ))3726 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)3727 showIndent(outfile, level, pretty_print)3728 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))3729 else:3730 outfile.write('/>%s' % (eol_, ))3731 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='FacebookConnectType'):3732 pass3733 def exportChildren(self, outfile, level, namespace_='', name_='FacebookConnectType', fromsubclass_=False, pretty_print=True):3734 if pretty_print:3735 eol_ = '\n'3736 else:3737 eol_ = ''3738 if self.PromoCode is not None:3739 showIndent(outfile, level, pretty_print)3740 outfile.write('<%sPromoCode>%s</%sPromoCode>%s' % (namespace_, self.gds_format_string(quote_xml(self.PromoCode).encode(ExternalEncoding), input_name='PromoCode'), namespace_, eol_))3741 if self.AcquisitionSource is not None:3742 showIndent(outfile, level, pretty_print)3743 outfile.write('<%sAcquisitionSource>%s</%sAcquisitionSource>%s' % (namespace_, self.gds_format_string(quote_xml(self.AcquisitionSource).encode(ExternalEncoding), input_name='AcquisitionSource'), namespace_, eol_))3744 for QuestionCategory_ in self.QuestionCategory:3745 QuestionCategory_.export(outfile, level, namespace_, name_='QuestionCategory', pretty_print=pretty_print)3746 def hasContent_(self):3747 if (3748 self.PromoCode is not None or3749 self.AcquisitionSource is not None or3750 self.QuestionCategory3751 ):3752 return True3753 else:3754 return False3755 def exportLiteral(self, outfile, level, name_='FacebookConnectType'):3756 level += 13757 self.exportLiteralAttributes(outfile, level, [], name_)3758 if self.hasContent_():3759 self.exportLiteralChildren(outfile, level, name_)3760 def exportLiteralAttributes(self, outfile, level, already_processed, name_):3761 pass3762 def exportLiteralChildren(self, outfile, level, name_):3763 if self.PromoCode is not None:3764 showIndent(outfile, level)3765 outfile.write('PromoCode=%s,\n' % quote_python(self.PromoCode).encode(ExternalEncoding))3766 if self.AcquisitionSource is not None:3767 showIndent(outfile, level)3768 outfile.write('AcquisitionSource=%s,\n' % quote_python(self.AcquisitionSource).encode(ExternalEncoding))3769 showIndent(outfile, level)3770 outfile.write('QuestionCategory=[\n')3771 level += 13772 for QuestionCategory_ in self.QuestionCategory:3773 showIndent(outfile, level)3774 outfile.write('model_.CategoryType(\n')3775 QuestionCategory_.exportLiteral(outfile, level, name_='CategoryType')3776 showIndent(outfile, level)3777 outfile.write('),\n')3778 level -= 13779 showIndent(outfile, level)3780 outfile.write('],\n')3781 def build(self, node):3782 self.buildAttributes(node, node.attrib, [])3783 for child in node:3784 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]3785 self.buildChildren(child, node, nodeName_)3786 def buildAttributes(self, node, attrs, already_processed):3787 pass3788 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):3789 if nodeName_ == 'PromoCode':3790 PromoCode_ = child_.text3791 PromoCode_ = self.gds_validate_string(PromoCode_, node, 'PromoCode')3792 self.PromoCode = PromoCode_3793 self.validate_PromoCodeDesc(self.PromoCode) # validate type PromoCodeDesc3794 elif nodeName_ == 'AcquisitionSource':3795 AcquisitionSource_ = child_.text3796 AcquisitionSource_ = self.gds_validate_string(AcquisitionSource_, node, 'AcquisitionSource')3797 self.AcquisitionSource = AcquisitionSource_3798 self.validate_AcquisitionSourceType(self.AcquisitionSource) # validate type AcquisitionSourceType3799 elif nodeName_ == 'QuestionCategory':3800 obj_ = CategoryType.factory()3801 obj_.build(child_)3802 self.QuestionCategory.append(obj_)3803# end class FacebookConnectType3804class DigitalInteractionsType(GeneratedsSuper):3805 subclass = None3806 superclass = None3807 def __init__(self, PromoCode=None, AcquisitionSource=None, QuestionCategory=None):3808 self.PromoCode = PromoCode3809 self.AcquisitionSource = AcquisitionSource3810 if QuestionCategory is None:3811 self.QuestionCategory = []3812 else:3813 self.QuestionCategory = QuestionCategory3814 def factory(*args_, **kwargs_):3815 if DigitalInteractionsType.subclass:3816 return DigitalInteractionsType.subclass(*args_, **kwargs_)3817 else:3818 return DigitalInteractionsType(*args_, **kwargs_)3819 factory = staticmethod(factory)3820 def get_PromoCode(self): return self.PromoCode3821 def set_PromoCode(self, PromoCode): self.PromoCode = PromoCode3822 def validate_PromoCodeDesc(self, value):3823 # Validate type PromoCodeDesc, a restriction on Name.3824 pass3825 def get_AcquisitionSource(self): return self.AcquisitionSource3826 def set_AcquisitionSource(self, AcquisitionSource): self.AcquisitionSource = AcquisitionSource3827 def validate_AcquisitionSourceType(self, value):3828 # Validate type AcquisitionSourceType, a restriction on Name.3829 pass3830 def get_QuestionCategory(self): return self.QuestionCategory3831 def set_QuestionCategory(self, QuestionCategory): self.QuestionCategory = QuestionCategory3832 def add_QuestionCategory(self, value): self.QuestionCategory.append(value)3833 def insert_QuestionCategory(self, index, value): self.QuestionCategory[index] = value3834 def export(self, outfile, level, namespace_='', name_='DigitalInteractionsType', namespacedef_='', pretty_print=True):3835 if pretty_print:3836 eol_ = '\n'3837 else:3838 eol_ = ''3839 showIndent(outfile, level, pretty_print)3840 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))3841 already_processed = []3842 self.exportAttributes(outfile, level, already_processed, namespace_, name_='DigitalInteractionsType')3843 if self.hasContent_():3844 outfile.write('>%s' % (eol_, ))3845 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)3846 showIndent(outfile, level, pretty_print)3847 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))3848 else:3849 outfile.write('/>%s' % (eol_, ))3850 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='DigitalInteractionsType'):3851 pass3852 def exportChildren(self, outfile, level, namespace_='', name_='DigitalInteractionsType', fromsubclass_=False, pretty_print=True):3853 if pretty_print:3854 eol_ = '\n'3855 else:3856 eol_ = ''3857 if self.PromoCode is not None:3858 showIndent(outfile, level, pretty_print)3859 outfile.write('<%sPromoCode>%s</%sPromoCode>%s' % (namespace_, self.gds_format_string(quote_xml(self.PromoCode).encode(ExternalEncoding), input_name='PromoCode'), namespace_, eol_))3860 if self.AcquisitionSource is not None:3861 showIndent(outfile, level, pretty_print)3862 outfile.write('<%sAcquisitionSource>%s</%sAcquisitionSource>%s' % (namespace_, self.gds_format_string(quote_xml(self.AcquisitionSource).encode(ExternalEncoding), input_name='AcquisitionSource'), namespace_, eol_))3863 for QuestionCategory_ in self.QuestionCategory:3864 QuestionCategory_.export(outfile, level, namespace_, name_='QuestionCategory', pretty_print=pretty_print)3865 def hasContent_(self):3866 if (3867 self.PromoCode is not None or3868 self.AcquisitionSource is not None or3869 self.QuestionCategory3870 ):3871 return True3872 else:3873 return False3874 def exportLiteral(self, outfile, level, name_='DigitalInteractionsType'):3875 level += 13876 self.exportLiteralAttributes(outfile, level, [], name_)3877 if self.hasContent_():3878 self.exportLiteralChildren(outfile, level, name_)3879 def exportLiteralAttributes(self, outfile, level, already_processed, name_):3880 pass3881 def exportLiteralChildren(self, outfile, level, name_):3882 if self.PromoCode is not None:3883 showIndent(outfile, level)3884 outfile.write('PromoCode=%s,\n' % quote_python(self.PromoCode).encode(ExternalEncoding))3885 if self.AcquisitionSource is not None:3886 showIndent(outfile, level)3887 outfile.write('AcquisitionSource=%s,\n' % quote_python(self.AcquisitionSource).encode(ExternalEncoding))3888 showIndent(outfile, level)3889 outfile.write('QuestionCategory=[\n')3890 level += 13891 for QuestionCategory_ in self.QuestionCategory:3892 showIndent(outfile, level)3893 outfile.write('model_.CategoryType(\n')3894 QuestionCategory_.exportLiteral(outfile, level, name_='CategoryType')3895 showIndent(outfile, level)3896 outfile.write('),\n')3897 level -= 13898 showIndent(outfile, level)3899 outfile.write('],\n')3900 def build(self, node):3901 self.buildAttributes(node, node.attrib, [])3902 for child in node:3903 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]3904 self.buildChildren(child, node, nodeName_)3905 def buildAttributes(self, node, attrs, already_processed):3906 pass3907 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):3908 if nodeName_ == 'PromoCode':3909 PromoCode_ = child_.text3910 PromoCode_ = self.gds_validate_string(PromoCode_, node, 'PromoCode')3911 self.PromoCode = PromoCode_3912 self.validate_PromoCodeDesc(self.PromoCode) # validate type PromoCodeDesc3913 elif nodeName_ == 'AcquisitionSource':3914 AcquisitionSource_ = child_.text3915 AcquisitionSource_ = self.gds_validate_string(AcquisitionSource_, node, 'AcquisitionSource')3916 self.AcquisitionSource = AcquisitionSource_3917 self.validate_AcquisitionSourceType(self.AcquisitionSource) # validate type AcquisitionSourceType3918 elif nodeName_ == 'QuestionCategory':3919 obj_ = CategoryType.factory()3920 obj_.build(child_)3921 self.QuestionCategory.append(obj_)3922# end class DigitalInteractionsType3923class ExtendedProfileType(GeneratedsSuper):3924 subclass = None3925 superclass = None3926 def __init__(self, PromoCode=None, AcquisitionSource=None, QuestionCategory=None):3927 self.PromoCode = PromoCode3928 self.AcquisitionSource = AcquisitionSource3929 if QuestionCategory is None:3930 self.QuestionCategory = []3931 else:3932 self.QuestionCategory = QuestionCategory3933 def factory(*args_, **kwargs_):3934 if ExtendedProfileType.subclass:3935 return ExtendedProfileType.subclass(*args_, **kwargs_)3936 else:3937 return ExtendedProfileType(*args_, **kwargs_)3938 factory = staticmethod(factory)3939 def get_PromoCode(self): return self.PromoCode3940 def set_PromoCode(self, PromoCode): self.PromoCode = PromoCode3941 def validate_PromoCodeDesc(self, value):3942 # Validate type PromoCodeDesc, a restriction on Name.3943 pass3944 def get_AcquisitionSource(self): return self.AcquisitionSource3945 def set_AcquisitionSource(self, AcquisitionSource): self.AcquisitionSource = AcquisitionSource3946 def validate_AcquisitionSourceType(self, value):3947 # Validate type AcquisitionSourceType, a restriction on Name.3948 pass3949 def get_QuestionCategory(self): return self.QuestionCategory3950 def set_QuestionCategory(self, QuestionCategory): self.QuestionCategory = QuestionCategory3951 def add_QuestionCategory(self, value): self.QuestionCategory.append(value)3952 def insert_QuestionCategory(self, index, value): self.QuestionCategory[index] = value3953 def export(self, outfile, level, namespace_='', name_='ExtendedProfileType', namespacedef_='', pretty_print=True):3954 if pretty_print:3955 eol_ = '\n'3956 else:3957 eol_ = ''3958 showIndent(outfile, level, pretty_print)3959 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))3960 already_processed = []3961 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ExtendedProfileType')3962 if self.hasContent_():3963 outfile.write('>%s' % (eol_, ))3964 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)3965 showIndent(outfile, level, pretty_print)3966 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))3967 else:3968 outfile.write('/>%s' % (eol_, ))3969 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ExtendedProfileType'):3970 pass3971 def exportChildren(self, outfile, level, namespace_='', name_='ExtendedProfileType', fromsubclass_=False, pretty_print=True):3972 if pretty_print:3973 eol_ = '\n'3974 else:3975 eol_ = ''3976 if self.PromoCode is not None:3977 showIndent(outfile, level, pretty_print)3978 outfile.write('<%sPromoCode>%s</%sPromoCode>%s' % (namespace_, self.gds_format_string(quote_xml(self.PromoCode).encode(ExternalEncoding), input_name='PromoCode'), namespace_, eol_))3979 if self.AcquisitionSource is not None:3980 showIndent(outfile, level, pretty_print)3981 outfile.write('<%sAcquisitionSource>%s</%sAcquisitionSource>%s' % (namespace_, self.gds_format_string(quote_xml(self.AcquisitionSource).encode(ExternalEncoding), input_name='AcquisitionSource'), namespace_, eol_))3982 for QuestionCategory_ in self.QuestionCategory:3983 QuestionCategory_.export(outfile, level, namespace_, name_='QuestionCategory', pretty_print=pretty_print)3984 def hasContent_(self):3985 if (3986 self.PromoCode is not None or3987 self.AcquisitionSource is not None or3988 self.QuestionCategory3989 ):3990 return True3991 else:3992 return False3993 def exportLiteral(self, outfile, level, name_='ExtendedProfileType'):3994 level += 13995 self.exportLiteralAttributes(outfile, level, [], name_)3996 if self.hasContent_():3997 self.exportLiteralChildren(outfile, level, name_)3998 def exportLiteralAttributes(self, outfile, level, already_processed, name_):3999 pass4000 def exportLiteralChildren(self, outfile, level, name_):4001 if self.PromoCode is not None:4002 showIndent(outfile, level)4003 outfile.write('PromoCode=%s,\n' % quote_python(self.PromoCode).encode(ExternalEncoding))4004 if self.AcquisitionSource is not None:4005 showIndent(outfile, level)4006 outfile.write('AcquisitionSource=%s,\n' % quote_python(self.AcquisitionSource).encode(ExternalEncoding))4007 showIndent(outfile, level)4008 outfile.write('QuestionCategory=[\n')4009 level += 14010 for QuestionCategory_ in self.QuestionCategory:4011 showIndent(outfile, level)4012 outfile.write('model_.CategoryType(\n')4013 QuestionCategory_.exportLiteral(outfile, level, name_='CategoryType')4014 showIndent(outfile, level)4015 outfile.write('),\n')4016 level -= 14017 showIndent(outfile, level)4018 outfile.write('],\n')4019 def build(self, node):4020 self.buildAttributes(node, node.attrib, [])4021 for child in node:4022 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]4023 self.buildChildren(child, node, nodeName_)4024 def buildAttributes(self, node, attrs, already_processed):4025 pass4026 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):4027 if nodeName_ == 'PromoCode':4028 PromoCode_ = child_.text4029 PromoCode_ = self.gds_validate_string(PromoCode_, node, 'PromoCode')4030 self.PromoCode = PromoCode_4031 self.validate_PromoCodeDesc(self.PromoCode) # validate type PromoCodeDesc4032 elif nodeName_ == 'AcquisitionSource':4033 AcquisitionSource_ = child_.text4034 AcquisitionSource_ = self.gds_validate_string(AcquisitionSource_, node, 'AcquisitionSource')4035 self.AcquisitionSource = AcquisitionSource_4036 self.validate_AcquisitionSourceType(self.AcquisitionSource) # validate type AcquisitionSourceType4037 elif nodeName_ == 'QuestionCategory':4038 obj_ = CategoryType.factory()4039 obj_.build(child_)4040 self.QuestionCategory.append(obj_)4041# end class ExtendedProfileType4042class Consumer(GeneratedsSuper):4043 subclass = None4044 superclass = None4045 def __init__(self, ConsumerProfile=None, Preferences=None, SocialNetworks=None, ConversionLocations=None, FacebookConnect=None, DigitalInteractions=None, ExtendedProfile=None, ExtendedOptInPreferences=None, HubLifeStyles=None, UserAccount=None):4046 self.ConsumerProfile = ConsumerProfile4047 self.Preferences = Preferences4048 self.SocialNetworks = SocialNetworks4049 self.ConversionLocations = ConversionLocations4050 self.FacebookConnect = FacebookConnect4051 self.DigitalInteractions = DigitalInteractions4052 self.ExtendedProfile = ExtendedProfile4053 self.ExtendedOptInPreferences = ExtendedOptInPreferences4054 self.HubLifeStyles = HubLifeStyles4055 self.UserAccount = UserAccount4056 def factory(*args_, **kwargs_):4057 if Consumer.subclass:4058 return Consumer.subclass(*args_, **kwargs_)4059 else:4060 return Consumer(*args_, **kwargs_)4061 factory = staticmethod(factory)4062 def get_ConsumerProfile(self): return self.ConsumerProfile4063 def set_ConsumerProfile(self, ConsumerProfile): self.ConsumerProfile = ConsumerProfile4064 def get_Preferences(self): return self.Preferences4065 def set_Preferences(self, Preferences): self.Preferences = Preferences4066 def get_SocialNetworks(self): return self.SocialNetworks4067 def set_SocialNetworks(self, SocialNetworks): self.SocialNetworks = SocialNetworks4068 def get_ConversionLocations(self): return self.ConversionLocations4069 def set_ConversionLocations(self, ConversionLocations): self.ConversionLocations = ConversionLocations4070 def get_FacebookConnect(self): return self.FacebookConnect4071 def set_FacebookConnect(self, FacebookConnect): self.FacebookConnect = FacebookConnect4072 def get_DigitalInteractions(self): return self.DigitalInteractions4073 def set_DigitalInteractions(self, DigitalInteractions): self.DigitalInteractions = DigitalInteractions4074 def get_ExtendedProfile(self): return self.ExtendedProfile4075 def set_ExtendedProfile(self, ExtendedProfile): self.ExtendedProfile = ExtendedProfile4076 def get_ExtendedOptInPreferences(self): return self.ExtendedOptInPreferences4077 def set_ExtendedOptInPreferences(self, ExtendedOptInPreferences): self.ExtendedOptInPreferences = ExtendedOptInPreferences4078 def get_HubLifeStyles(self): return self.HubLifeStyles4079 def set_HubLifeStyles(self, HubLifeStyles): self.HubLifeStyles = HubLifeStyles4080 def get_UserAccount(self): return self.UserAccount4081 def set_UserAccount(self, UserAccount): self.UserAccount = UserAccount4082 def export(self, outfile, level, namespace_='', name_='Consumer', namespacedef_='', pretty_print=True):4083 if pretty_print:4084 eol_ = '\n'4085 else:4086 eol_ = ''4087 showIndent(outfile, level, pretty_print)4088 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))4089 already_processed = []4090 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Consumer')4091 if self.hasContent_():4092 outfile.write('>%s' % (eol_, ))4093 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)4094 showIndent(outfile, level, pretty_print)4095 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))4096 else:4097 outfile.write('/>%s' % (eol_, ))4098 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='Consumer'):4099 pass4100 def exportChildren(self, outfile, level, namespace_='', name_='Consumer', fromsubclass_=False, pretty_print=True):4101 if pretty_print:4102 eol_ = '\n'4103 else:4104 eol_ = ''4105 if self.ConsumerProfile is not None:4106 self.ConsumerProfile.export(outfile, level, namespace_, name_='ConsumerProfile', pretty_print=pretty_print)4107 if self.Preferences is not None:4108 self.Preferences.export(outfile, level, namespace_, name_='Preferences', pretty_print=pretty_print)4109 if self.SocialNetworks is not None:4110 self.SocialNetworks.export(outfile, level, namespace_, name_='SocialNetworks', pretty_print=pretty_print)4111 if self.ConversionLocations is not None:4112 self.ConversionLocations.export(outfile, level, namespace_, name_='ConversionLocations', pretty_print=pretty_print)4113 if self.FacebookConnect is not None:4114 self.FacebookConnect.export(outfile, level, namespace_, name_='FacebookConnect', pretty_print=pretty_print)4115 if self.DigitalInteractions is not None:4116 self.DigitalInteractions.export(outfile, level, namespace_, name_='DigitalInteractions', pretty_print=pretty_print)4117 if self.ExtendedProfile is not None:4118 self.ExtendedProfile.export(outfile, level, namespace_, name_='ExtendedProfile', pretty_print=pretty_print)4119 if self.ExtendedOptInPreferences is not None:4120 self.ExtendedOptInPreferences.export(outfile, level, namespace_, name_='ExtendedOptInPreferences', pretty_print=pretty_print)4121 if self.HubLifeStyles is not None:4122 self.HubLifeStyles.export(outfile, level, namespace_, name_='HubLifeStyles', pretty_print=pretty_print)4123 if self.UserAccount is not None:4124 self.UserAccount.export(outfile, level, namespace_, name_='UserAccount', pretty_print=pretty_print)4125 def hasContent_(self):4126 if (4127 self.ConsumerProfile is not None or4128 self.Preferences is not None or4129 self.SocialNetworks is not None or4130 self.ConversionLocations is not None or4131 self.FacebookConnect is not None or4132 self.DigitalInteractions is not None or4133 self.ExtendedProfile is not None or4134 self.ExtendedOptInPreferences is not None or4135 self.HubLifeStyles is not None or4136 self.UserAccount is not None4137 ):4138 return True4139 else:4140 return False4141 def exportLiteral(self, outfile, level, name_='Consumer'):4142 level += 14143 self.exportLiteralAttributes(outfile, level, [], name_)4144 if self.hasContent_():4145 self.exportLiteralChildren(outfile, level, name_)4146 def exportLiteralAttributes(self, outfile, level, already_processed, name_):4147 pass4148 def exportLiteralChildren(self, outfile, level, name_):4149 if self.ConsumerProfile is not None:4150 showIndent(outfile, level)4151 outfile.write('ConsumerProfile=model_.ConsumerProfileType(\n')4152 self.ConsumerProfile.exportLiteral(outfile, level, name_='ConsumerProfile')4153 showIndent(outfile, level)4154 outfile.write('),\n')4155 if self.Preferences is not None:4156 showIndent(outfile, level)4157 outfile.write('Preferences=model_.PreferencesType(\n')4158 self.Preferences.exportLiteral(outfile, level, name_='Preferences')4159 showIndent(outfile, level)4160 outfile.write('),\n')4161 if self.SocialNetworks is not None:4162 showIndent(outfile, level)4163 outfile.write('SocialNetworks=model_.SocialNetworksType(\n')4164 self.SocialNetworks.exportLiteral(outfile, level, name_='SocialNetworks')4165 showIndent(outfile, level)4166 outfile.write('),\n')4167 if self.ConversionLocations is not None:4168 showIndent(outfile, level)4169 outfile.write('ConversionLocations=model_.ConversionLocationsType(\n')4170 self.ConversionLocations.exportLiteral(outfile, level, name_='ConversionLocations')4171 showIndent(outfile, level)4172 outfile.write('),\n')4173 if self.FacebookConnect is not None:4174 showIndent(outfile, level)4175 outfile.write('FacebookConnect=model_.FacebookConnectType(\n')4176 self.FacebookConnect.exportLiteral(outfile, level, name_='FacebookConnect')4177 showIndent(outfile, level)4178 outfile.write('),\n')4179 if self.DigitalInteractions is not None:4180 showIndent(outfile, level)4181 outfile.write('DigitalInteractions=model_.DigitalInteractionsType(\n')4182 self.DigitalInteractions.exportLiteral(outfile, level, name_='DigitalInteractions')4183 showIndent(outfile, level)4184 outfile.write('),\n')4185 if self.ExtendedProfile is not None:4186 showIndent(outfile, level)4187 outfile.write('ExtendedProfile=model_.ExtendedProfileType(\n')4188 self.ExtendedProfile.exportLiteral(outfile, level, name_='ExtendedProfile')4189 showIndent(outfile, level)4190 outfile.write('),\n')4191 if self.ExtendedOptInPreferences is not None:4192 showIndent(outfile, level)4193 outfile.write('ExtendedOptInPreferences=model_.ExtendedOptInPreferencesType(\n')4194 self.ExtendedOptInPreferences.exportLiteral(outfile, level, name_='ExtendedOptInPreferences')4195 showIndent(outfile, level)4196 outfile.write('),\n')4197 if self.HubLifeStyles is not None:4198 showIndent(outfile, level)4199 outfile.write('HubLifeStyles=model_.HubLifeStylesType(\n')4200 self.HubLifeStyles.exportLiteral(outfile, level, name_='HubLifeStyles')4201 showIndent(outfile, level)4202 outfile.write('),\n')4203 if self.UserAccount is not None:4204 showIndent(outfile, level)4205 outfile.write('UserAccount=model_.UserAccountType(\n')4206 self.UserAccount.exportLiteral(outfile, level, name_='UserAccount')4207 showIndent(outfile, level)4208 outfile.write('),\n')4209 def build(self, node):4210 self.buildAttributes(node, node.attrib, [])4211 for child in node:4212 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]4213 self.buildChildren(child, node, nodeName_)4214 def buildAttributes(self, node, attrs, already_processed):4215 pass4216 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):4217 if nodeName_ == 'ConsumerProfile':4218 obj_ = ConsumerProfileType.factory()4219 obj_.build(child_)4220 self.set_ConsumerProfile(obj_)4221 elif nodeName_ == 'Preferences':4222 obj_ = PreferencesType.factory()4223 obj_.build(child_)4224 self.set_Preferences(obj_)4225 elif nodeName_ == 'SocialNetworks':4226 obj_ = SocialNetworksType.factory()4227 obj_.build(child_)4228 self.set_SocialNetworks(obj_)4229 elif nodeName_ == 'ConversionLocations':4230 obj_ = ConversionLocationsType.factory()4231 obj_.build(child_)4232 self.set_ConversionLocations(obj_)4233 elif nodeName_ == 'FacebookConnect':4234 obj_ = FacebookConnectType.factory()4235 obj_.build(child_)4236 self.set_FacebookConnect(obj_)4237 elif nodeName_ == 'DigitalInteractions':4238 obj_ = DigitalInteractionsType.factory()4239 obj_.build(child_)4240 self.set_DigitalInteractions(obj_)4241 elif nodeName_ == 'ExtendedProfile':4242 obj_ = ExtendedProfileType.factory()4243 obj_.build(child_)4244 self.set_ExtendedProfile(obj_)4245 elif nodeName_ == 'ExtendedOptInPreferences':4246 obj_ = ExtendedOptInPreferencesType.factory()4247 obj_.build(child_)4248 self.set_ExtendedOptInPreferences(obj_)4249 elif nodeName_ == 'HubLifeStyles':4250 obj_ = HubLifeStylesType.factory()4251 obj_.build(child_)4252 self.set_HubLifeStyles(obj_)4253 elif nodeName_ == 'UserAccount':4254 obj_ = UserAccountType.factory()4255 obj_.build(child_)4256 self.set_UserAccount(obj_)4257# end class Consumer4258class ConsumerSearchProfileType(GeneratedsSuper):4259 subclass = None4260 superclass = None4261 def __init__(self, DOB=None, CountryOfResidence=None, SearchBy_EmailOrMobile=None, EmailOrMobile=None):4262 self.DOB = DOB4263 self.CountryOfResidence = CountryOfResidence4264 self.SearchBy_EmailOrMobile = SearchBy_EmailOrMobile4265 self.EmailOrMobile = EmailOrMobile4266 def factory(*args_, **kwargs_):4267 if ConsumerSearchProfileType.subclass:4268 return ConsumerSearchProfileType.subclass(*args_, **kwargs_)4269 else:4270 return ConsumerSearchProfileType(*args_, **kwargs_)4271 factory = staticmethod(factory)4272 def get_DOB(self): return self.DOB4273 def set_DOB(self, DOB): self.DOB = DOB4274 def validate_Date(self, value):4275 # Validate type Date, a restriction on xs:date.4276 pass4277 def get_CountryOfResidence(self): return self.CountryOfResidence4278 def set_CountryOfResidence(self, CountryOfResidence): self.CountryOfResidence = CountryOfResidence4279 def get_SearchBy_EmailOrMobile(self): return self.SearchBy_EmailOrMobile4280 def set_SearchBy_EmailOrMobile(self, SearchBy_EmailOrMobile): self.SearchBy_EmailOrMobile = SearchBy_EmailOrMobile4281 def get_EmailOrMobile(self): return self.EmailOrMobile4282 def set_EmailOrMobile(self, EmailOrMobile): self.EmailOrMobile = EmailOrMobile4283 def export(self, outfile, level, namespace_='', name_='ConsumerSearchProfileType', namespacedef_='', pretty_print=True):4284 if pretty_print:4285 eol_ = '\n'4286 else:4287 eol_ = ''4288 showIndent(outfile, level, pretty_print)4289 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))4290 already_processed = []4291 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ConsumerSearchProfileType')4292 if self.hasContent_():4293 outfile.write('>%s' % (eol_, ))4294 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)4295 showIndent(outfile, level, pretty_print)4296 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))4297 else:4298 outfile.write('/>%s' % (eol_, ))4299 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ConsumerSearchProfileType'):4300 pass4301 def exportChildren(self, outfile, level, namespace_='', name_='ConsumerSearchProfileType', fromsubclass_=False, pretty_print=True):4302 if pretty_print:4303 eol_ = '\n'4304 else:4305 eol_ = ''4306 if self.DOB is not None:4307 showIndent(outfile, level, pretty_print)4308 outfile.write('<%sDOB>%s</%sDOB>%s' % (namespace_, self.gds_format_string(quote_xml(self.DOB).encode(ExternalEncoding), input_name='DOB'), namespace_, eol_))4309 if self.CountryOfResidence is not None:4310 showIndent(outfile, level, pretty_print)4311 outfile.write('<%sCountryOfResidence>%s</%sCountryOfResidence>%s' % (namespace_, self.gds_format_string(quote_xml(self.CountryOfResidence).encode(ExternalEncoding), input_name='CountryOfResidence'), namespace_, eol_))4312 if self.SearchBy_EmailOrMobile is not None:4313 showIndent(outfile, level, pretty_print)4314 outfile.write('<%sSearchBy_EmailOrMobile>%s</%sSearchBy_EmailOrMobile>%s' % (namespace_, self.gds_format_string(quote_xml(self.SearchBy_EmailOrMobile).encode(ExternalEncoding), input_name='SearchBy_EmailOrMobile'), namespace_, eol_))4315 if self.EmailOrMobile is not None:4316 showIndent(outfile, level, pretty_print)4317 outfile.write('<%sEmailOrMobile>%s</%sEmailOrMobile>%s' % (namespace_, self.gds_format_string(quote_xml(self.EmailOrMobile).encode(ExternalEncoding), input_name='EmailOrMobile'), namespace_, eol_))4318 def hasContent_(self):4319 if (4320 self.DOB is not None or4321 self.CountryOfResidence is not None or4322 self.SearchBy_EmailOrMobile is not None or4323 self.EmailOrMobile is not None4324 ):4325 return True4326 else:4327 return False4328 def exportLiteral(self, outfile, level, name_='ConsumerSearchProfileType'):4329 level += 14330 self.exportLiteralAttributes(outfile, level, [], name_)4331 if self.hasContent_():4332 self.exportLiteralChildren(outfile, level, name_)4333 def exportLiteralAttributes(self, outfile, level, already_processed, name_):4334 pass4335 def exportLiteralChildren(self, outfile, level, name_):4336 if self.DOB is not None:4337 showIndent(outfile, level)4338 outfile.write('DOB=%s,\n' % quote_python(self.DOB).encode(ExternalEncoding))4339 if self.CountryOfResidence is not None:4340 showIndent(outfile, level)4341 outfile.write('CountryOfResidence=%s,\n' % quote_python(self.CountryOfResidence).encode(ExternalEncoding))4342 if self.SearchBy_EmailOrMobile is not None:4343 showIndent(outfile, level)4344 outfile.write('SearchBy_EmailOrMobile=%s,\n' % quote_python(self.SearchBy_EmailOrMobile).encode(ExternalEncoding))4345 if self.EmailOrMobile is not None:4346 showIndent(outfile, level)4347 outfile.write('EmailOrMobile=%s,\n' % quote_python(self.EmailOrMobile).encode(ExternalEncoding))4348 def build(self, node):4349 self.buildAttributes(node, node.attrib, [])4350 for child in node:4351 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]4352 self.buildChildren(child, node, nodeName_)4353 def buildAttributes(self, node, attrs, already_processed):4354 pass4355 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):4356 if nodeName_ == 'DOB':4357 DOB_ = child_.text4358 DOB_ = self.gds_validate_string(DOB_, node, 'DOB')4359 self.DOB = DOB_4360 self.validate_Date(self.DOB) # validate type Date4361 elif nodeName_ == 'CountryOfResidence':4362 CountryOfResidence_ = child_.text4363 CountryOfResidence_ = self.gds_validate_string(CountryOfResidence_, node, 'CountryOfResidence')4364 self.CountryOfResidence = CountryOfResidence_4365 elif nodeName_ == 'SearchBy_EmailOrMobile':4366 SearchBy_EmailOrMobile_ = child_.text4367 SearchBy_EmailOrMobile_ = self.gds_validate_string(SearchBy_EmailOrMobile_, node, 'SearchBy_EmailOrMobile')4368 self.SearchBy_EmailOrMobile = SearchBy_EmailOrMobile_4369 elif nodeName_ == 'EmailOrMobile':4370 EmailOrMobile_ = child_.text4371 EmailOrMobile_ = self.gds_validate_string(EmailOrMobile_, node, 'EmailOrMobile')4372 self.EmailOrMobile = EmailOrMobile_4373# end class ConsumerSearchProfileType4374class LoginDetails(GeneratedsSuper):4375 subclass = None4376 superclass = None4377 def __init__(self, ConsumerID=None, LoginName=None, LastLoginSuccess=None, LastLoginTime=None):4378 self.ConsumerID = ConsumerID4379 self.LoginName = LoginName4380 self.LastLoginSuccess = LastLoginSuccess4381 self.LastLoginTime = LastLoginTime4382 def factory(*args_, **kwargs_):4383 if LoginDetails.subclass:4384 return LoginDetails.subclass(*args_, **kwargs_)4385 else:4386 return LoginDetails(*args_, **kwargs_)4387 factory = staticmethod(factory)4388 def get_ConsumerID(self): return self.ConsumerID4389 def set_ConsumerID(self, ConsumerID): self.ConsumerID = ConsumerID4390 def validate_ConsumerIDType(self, value):4391 # Validate type ConsumerIDType, a restriction on xs:long.4392 pass4393 def get_LoginName(self): return self.LoginName4394 def set_LoginName(self, LoginName): self.LoginName = LoginName4395 def validate_LoginName(self, value):4396 # Validate type LoginName, a restriction on Name.4397 pass4398 def get_LastLoginSuccess(self): return self.LastLoginSuccess4399 def set_LastLoginSuccess(self, LastLoginSuccess): self.LastLoginSuccess = LastLoginSuccess4400 def validate_LoginSuccessFlagType(self, value):4401 # Validate type LoginSuccessFlagType, a restriction on xs:boolean.4402 pass4403 def get_LastLoginTime(self): return self.LastLoginTime4404 def set_LastLoginTime(self, LastLoginTime): self.LastLoginTime = LastLoginTime4405 def validate_LoginTimeType(self, value):4406 # Validate type LoginTimeType, a restriction on xs:dateTime.4407 pass4408 def export(self, outfile, level, namespace_='', name_='LoginDetails', namespacedef_='', pretty_print=True):4409 if pretty_print:4410 eol_ = '\n'4411 else:4412 eol_ = ''4413 showIndent(outfile, level, pretty_print)4414 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))4415 already_processed = []4416 self.exportAttributes(outfile, level, already_processed, namespace_, name_='LoginDetails')4417 if self.hasContent_():4418 outfile.write('>%s' % (eol_, ))4419 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)4420 showIndent(outfile, level, pretty_print)4421 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))4422 else:4423 outfile.write('/>%s' % (eol_, ))4424 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='LoginDetails'):4425 pass4426 def exportChildren(self, outfile, level, namespace_='', name_='LoginDetails', fromsubclass_=False, pretty_print=True):4427 if pretty_print:4428 eol_ = '\n'4429 else:4430 eol_ = ''4431 if self.ConsumerID is not None:4432 showIndent(outfile, level, pretty_print)4433 outfile.write('<%sConsumerID>%s</%sConsumerID>%s' % (namespace_, self.gds_format_integer(self.ConsumerID, input_name='ConsumerID'), namespace_, eol_))4434 if self.LoginName is not None:4435 showIndent(outfile, level, pretty_print)4436 outfile.write('<%sLoginName>%s</%sLoginName>%s' % (namespace_, self.gds_format_string(quote_xml(self.LoginName).encode(ExternalEncoding), input_name='LoginName'), namespace_, eol_))4437 if self.LastLoginSuccess is not None:4438 showIndent(outfile, level, pretty_print)4439 outfile.write('<%sLastLoginSuccess>%s</%sLastLoginSuccess>%s' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.LastLoginSuccess)), input_name='LastLoginSuccess'), namespace_, eol_))4440 if self.LastLoginTime is not None:4441 showIndent(outfile, level, pretty_print)4442 outfile.write('<%sLastLoginTime>%s</%sLastLoginTime>%s' % (namespace_, self.gds_format_string(quote_xml(self.LastLoginTime).encode(ExternalEncoding), input_name='LastLoginTime'), namespace_, eol_))4443 def hasContent_(self):4444 if (4445 self.ConsumerID is not None or4446 self.LoginName is not None or4447 self.LastLoginSuccess is not None or4448 self.LastLoginTime is not None4449 ):4450 return True4451 else:4452 return False4453 def exportLiteral(self, outfile, level, name_='LoginDetails'):4454 level += 14455 self.exportLiteralAttributes(outfile, level, [], name_)4456 if self.hasContent_():4457 self.exportLiteralChildren(outfile, level, name_)4458 def exportLiteralAttributes(self, outfile, level, already_processed, name_):4459 pass4460 def exportLiteralChildren(self, outfile, level, name_):4461 if self.ConsumerID is not None:4462 showIndent(outfile, level)4463 outfile.write('ConsumerID=%d,\n' % self.ConsumerID)4464 if self.LoginName is not None:4465 showIndent(outfile, level)4466 outfile.write('LoginName=%s,\n' % quote_python(self.LoginName).encode(ExternalEncoding))4467 if self.LastLoginSuccess is not None:4468 showIndent(outfile, level)4469 outfile.write('LastLoginSuccess=%s,\n' % self.LastLoginSuccess)4470 if self.LastLoginTime is not None:4471 showIndent(outfile, level)4472 outfile.write('LastLoginTime=%s,\n' % quote_python(self.LastLoginTime).encode(ExternalEncoding))4473 def build(self, node):4474 self.buildAttributes(node, node.attrib, [])4475 for child in node:4476 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]4477 self.buildChildren(child, node, nodeName_)4478 def buildAttributes(self, node, attrs, already_processed):4479 pass4480 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):4481 if nodeName_ == 'ConsumerID':4482 sval_ = child_.text4483 try:4484 ival_ = int(sval_)4485 except (TypeError, ValueError), exp:4486 raise_parse_error(child_, 'requires integer: %s' % exp)4487 ival_ = self.gds_validate_integer(ival_, node, 'ConsumerID')4488 self.ConsumerID = ival_4489 self.validate_ConsumerIDType(self.ConsumerID) # validate type ConsumerIDType4490 elif nodeName_ == 'LoginName':4491 LoginName_ = child_.text4492 LoginName_ = self.gds_validate_string(LoginName_, node, 'LoginName')4493 self.LoginName = LoginName_4494 self.validate_LoginName(self.LoginName) # validate type LoginName4495 elif nodeName_ == 'LastLoginSuccess':4496 sval_ = child_.text4497 if sval_ in ('true', '1'):4498 ival_ = True4499 elif sval_ in ('false', '0'):4500 ival_ = False4501 else:4502 raise_parse_error(child_, 'requires boolean')4503 ival_ = self.gds_validate_boolean(ival_, node, 'LastLoginSuccess')4504 self.LastLoginSuccess = ival_4505 self.validate_LoginSuccessFlagType(self.LastLoginSuccess) # validate type LoginSuccessFlagType4506 elif nodeName_ == 'LastLoginTime':4507 LastLoginTime_ = child_.text4508 LastLoginTime_ = self.gds_validate_string(LastLoginTime_, node, 'LastLoginTime')4509 self.LastLoginTime = LastLoginTime_4510 self.validate_LoginTimeType(self.LastLoginTime) # validate type LoginTimeType4511# end class LoginDetails4512class UnsubscribePreferencesType(GeneratedsSuper):4513 subclass = None4514 superclass = None4515 def __init__(self, ConsumerDetails=None, Preference=None):4516 self.ConsumerDetails = ConsumerDetails4517 if Preference is None:4518 self.Preference = []4519 else:4520 self.Preference = Preference4521 def factory(*args_, **kwargs_):4522 if UnsubscribePreferencesType.subclass:4523 return UnsubscribePreferencesType.subclass(*args_, **kwargs_)4524 else:4525 return UnsubscribePreferencesType(*args_, **kwargs_)4526 factory = staticmethod(factory)4527 def get_ConsumerDetails(self): return self.ConsumerDetails4528 def set_ConsumerDetails(self, ConsumerDetails): self.ConsumerDetails = ConsumerDetails4529 def get_Preference(self): return self.Preference4530 def set_Preference(self, Preference): self.Preference = Preference4531 def add_Preference(self, value): self.Preference.append(value)4532 def insert_Preference(self, index, value): self.Preference[index] = value4533 def export(self, outfile, level, namespace_='', name_='UnsubscribePreferencesType', namespacedef_='', pretty_print=True):4534 if pretty_print:4535 eol_ = '\n'4536 else:4537 eol_ = ''4538 showIndent(outfile, level, pretty_print)4539 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))4540 already_processed = []4541 self.exportAttributes(outfile, level, already_processed, namespace_, name_='UnsubscribePreferencesType')4542 if self.hasContent_():4543 outfile.write('>%s' % (eol_, ))4544 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)4545 showIndent(outfile, level, pretty_print)4546 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))4547 else:4548 outfile.write('/>%s' % (eol_, ))4549 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='UnsubscribePreferencesType'):4550 pass4551 def exportChildren(self, outfile, level, namespace_='', name_='UnsubscribePreferencesType', fromsubclass_=False, pretty_print=True):4552 if pretty_print:4553 eol_ = '\n'4554 else:4555 eol_ = ''4556 if self.ConsumerDetails is not None:4557 self.ConsumerDetails.export(outfile, level, namespace_, name_='ConsumerDetails', pretty_print=pretty_print)4558 for Preference_ in self.Preference:4559 Preference_.export(outfile, level, namespace_, name_='Preference', pretty_print=pretty_print)4560 def hasContent_(self):4561 if (4562 self.ConsumerDetails is not None or4563 self.Preference4564 ):4565 return True4566 else:4567 return False4568 def exportLiteral(self, outfile, level, name_='UnsubscribePreferencesType'):4569 level += 14570 self.exportLiteralAttributes(outfile, level, [], name_)4571 if self.hasContent_():4572 self.exportLiteralChildren(outfile, level, name_)4573 def exportLiteralAttributes(self, outfile, level, already_processed, name_):4574 pass4575 def exportLiteralChildren(self, outfile, level, name_):4576 if self.ConsumerDetails is not None:4577 showIndent(outfile, level)4578 outfile.write('ConsumerDetails=model_.ConsumerDetailsType(\n')4579 self.ConsumerDetails.exportLiteral(outfile, level, name_='ConsumerDetails')4580 showIndent(outfile, level)4581 outfile.write('),\n')4582 showIndent(outfile, level)4583 outfile.write('Preference=[\n')4584 level += 14585 for Preference_ in self.Preference:4586 showIndent(outfile, level)4587 outfile.write('model_.UnsubscribePreferenceType(\n')4588 Preference_.exportLiteral(outfile, level, name_='UnsubscribePreferenceType')4589 showIndent(outfile, level)4590 outfile.write('),\n')4591 level -= 14592 showIndent(outfile, level)4593 outfile.write('],\n')4594 def build(self, node):4595 self.buildAttributes(node, node.attrib, [])4596 for child in node:4597 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]4598 self.buildChildren(child, node, nodeName_)4599 def buildAttributes(self, node, attrs, already_processed):4600 pass4601 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):4602 if nodeName_ == 'ConsumerDetails':4603 obj_ = ConsumerDetailsType.factory()4604 obj_.build(child_)4605 self.set_ConsumerDetails(obj_)4606 elif nodeName_ == 'Preference':4607 obj_ = UnsubscribePreferenceType.factory()4608 obj_.build(child_)4609 self.Preference.append(obj_)4610# end class UnsubscribePreferencesType4611class UnsubscribePreferenceType(GeneratedsSuper):4612 subclass = None4613 superclass = None4614 def __init__(self, QuestionID=None, OptionID=None, OptionDetails=None, BrandID=None, CommunicationChannel=None):4615 self.QuestionID = QuestionID4616 self.OptionID = OptionID4617 self.OptionDetails = OptionDetails4618 self.BrandID = BrandID4619 self.CommunicationChannel = CommunicationChannel4620 def factory(*args_, **kwargs_):4621 if UnsubscribePreferenceType.subclass:4622 return UnsubscribePreferenceType.subclass(*args_, **kwargs_)4623 else:4624 return UnsubscribePreferenceType(*args_, **kwargs_)4625 factory = staticmethod(factory)4626 def get_QuestionID(self): return self.QuestionID4627 def set_QuestionID(self, QuestionID): self.QuestionID = QuestionID4628 def get_OptionID(self): return self.OptionID4629 def set_OptionID(self, OptionID): self.OptionID = OptionID4630 def get_OptionDetails(self): return self.OptionDetails4631 def set_OptionDetails(self, OptionDetails): self.OptionDetails = OptionDetails4632 def get_BrandID(self): return self.BrandID4633 def set_BrandID(self, BrandID): self.BrandID = BrandID4634 def validate_BrandID(self, value):4635 # Validate type BrandID, a restriction on xs:long.4636 pass4637 def get_CommunicationChannel(self): return self.CommunicationChannel4638 def set_CommunicationChannel(self, CommunicationChannel): self.CommunicationChannel = CommunicationChannel4639 def validate_CommunicationChannel(self, value):4640 # Validate type CommunicationChannel, a restriction on xs:byte.4641 pass4642 def export(self, outfile, level, namespace_='', name_='UnsubscribePreferenceType', namespacedef_='', pretty_print=True):4643 if pretty_print:4644 eol_ = '\n'4645 else:4646 eol_ = ''4647 showIndent(outfile, level, pretty_print)4648 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))4649 already_processed = []4650 self.exportAttributes(outfile, level, already_processed, namespace_, name_='UnsubscribePreferenceType')4651 if self.hasContent_():4652 outfile.write('>%s' % (eol_, ))4653 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)4654 showIndent(outfile, level, pretty_print)4655 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))4656 else:4657 outfile.write('/>%s' % (eol_, ))4658 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='UnsubscribePreferenceType'):4659 pass4660 def exportChildren(self, outfile, level, namespace_='', name_='UnsubscribePreferenceType', fromsubclass_=False, pretty_print=True):4661 if pretty_print:4662 eol_ = '\n'4663 else:4664 eol_ = ''4665 if self.QuestionID is not None:4666 showIndent(outfile, level, pretty_print)4667 outfile.write('<%sQuestionID>%s</%sQuestionID>%s' % (namespace_, self.gds_format_integer(self.QuestionID, input_name='QuestionID'), namespace_, eol_))4668 if self.OptionID is not None:4669 showIndent(outfile, level, pretty_print)4670 outfile.write('<%sOptionID>%s</%sOptionID>%s' % (namespace_, self.gds_format_integer(self.OptionID, input_name='OptionID'), namespace_, eol_))4671 if self.OptionDetails is not None:4672 self.OptionDetails.export(outfile, level, namespace_, name_='OptionDetails', pretty_print=pretty_print)4673 if self.BrandID is not None:4674 showIndent(outfile, level, pretty_print)4675 outfile.write('<%sBrandID>%s</%sBrandID>%s' % (namespace_, self.gds_format_integer(self.BrandID, input_name='BrandID'), namespace_, eol_))4676 if self.CommunicationChannel is not None:4677 showIndent(outfile, level, pretty_print)4678 outfile.write('<%sCommunicationChannel>%s</%sCommunicationChannel>%s' % (namespace_, self.gds_format_integer(self.CommunicationChannel, input_name='CommunicationChannel'), namespace_, eol_))4679 def hasContent_(self):4680 if (4681 self.QuestionID is not None or4682 self.OptionID is not None or4683 self.OptionDetails is not None or4684 self.BrandID is not None or4685 self.CommunicationChannel is not None4686 ):4687 return True4688 else:4689 return False4690 def exportLiteral(self, outfile, level, name_='UnsubscribePreferenceType'):4691 level += 14692 self.exportLiteralAttributes(outfile, level, [], name_)4693 if self.hasContent_():4694 self.exportLiteralChildren(outfile, level, name_)4695 def exportLiteralAttributes(self, outfile, level, already_processed, name_):4696 pass4697 def exportLiteralChildren(self, outfile, level, name_):4698 if self.QuestionID is not None:4699 showIndent(outfile, level)4700 outfile.write('QuestionID=%d,\n' % self.QuestionID)4701 if self.OptionID is not None:4702 showIndent(outfile, level)4703 outfile.write('OptionID=%d,\n' % self.OptionID)4704 if self.OptionDetails is not None:4705 showIndent(outfile, level)4706 outfile.write('OptionDetails=model_.CommunicationChannelDetailsType(\n')4707 self.OptionDetails.exportLiteral(outfile, level, name_='OptionDetails')4708 showIndent(outfile, level)4709 outfile.write('),\n')4710 if self.BrandID is not None:4711 showIndent(outfile, level)4712 outfile.write('BrandID=%d,\n' % self.BrandID)4713 if self.CommunicationChannel is not None:4714 showIndent(outfile, level)4715 outfile.write('CommunicationChannel=%d,\n' % self.CommunicationChannel)4716 def build(self, node):4717 self.buildAttributes(node, node.attrib, [])4718 for child in node:4719 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]4720 self.buildChildren(child, node, nodeName_)4721 def buildAttributes(self, node, attrs, already_processed):4722 pass4723 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):4724 if nodeName_ == 'QuestionID':4725 sval_ = child_.text4726 try:4727 ival_ = int(sval_)4728 except (TypeError, ValueError), exp:4729 raise_parse_error(child_, 'requires integer: %s' % exp)4730 ival_ = self.gds_validate_integer(ival_, node, 'QuestionID')4731 self.QuestionID = ival_4732 elif nodeName_ == 'OptionID':4733 sval_ = child_.text4734 try:4735 ival_ = int(sval_)4736 except (TypeError, ValueError), exp:4737 raise_parse_error(child_, 'requires integer: %s' % exp)4738 ival_ = self.gds_validate_integer(ival_, node, 'OptionID')4739 self.OptionID = ival_4740 elif nodeName_ == 'OptionDetails':4741 obj_ = CommunicationChannelDetailsType.factory()4742 obj_.build(child_)4743 self.set_OptionDetails(obj_)4744 elif nodeName_ == 'BrandID':4745 sval_ = child_.text4746 try:4747 ival_ = int(sval_)4748 except (TypeError, ValueError), exp:4749 raise_parse_error(child_, 'requires integer: %s' % exp)4750 ival_ = self.gds_validate_integer(ival_, node, 'BrandID')4751 self.BrandID = ival_4752 self.validate_BrandID(self.BrandID) # validate type BrandID4753 elif nodeName_ == 'CommunicationChannel':4754 sval_ = child_.text4755 try:4756 ival_ = int(sval_)4757 except (TypeError, ValueError), exp:4758 raise_parse_error(child_, 'requires integer: %s' % exp)4759 ival_ = self.gds_validate_integer(ival_, node, 'CommunicationChannel')4760 self.CommunicationChannel = ival_4761 self.validate_CommunicationChannel(self.CommunicationChannel) # validate type CommunicationChannel4762# end class UnsubscribePreferenceType4763class CommunicationChannelDetailsType(GeneratedsSuper):4764 subclass = None4765 superclass = None4766 def __init__(self, Postal=None, Email=None, Phone=None):4767 if Postal is None:4768 self.Postal = []4769 else:4770 self.Postal = Postal4771 if Email is None:4772 self.Email = []4773 else:4774 self.Email = Email4775 if Phone is None:4776 self.Phone = []4777 else:4778 self.Phone = Phone4779 def factory(*args_, **kwargs_):4780 if CommunicationChannelDetailsType.subclass:4781 return CommunicationChannelDetailsType.subclass(*args_, **kwargs_)4782 else:4783 return CommunicationChannelDetailsType(*args_, **kwargs_)4784 factory = staticmethod(factory)4785 def get_Postal(self): return self.Postal4786 def set_Postal(self, Postal): self.Postal = Postal4787 def add_Postal(self, value): self.Postal.append(value)4788 def insert_Postal(self, index, value): self.Postal[index] = value4789 def get_Email(self): return self.Email4790 def set_Email(self, Email): self.Email = Email4791 def add_Email(self, value): self.Email.append(value)4792 def insert_Email(self, index, value): self.Email[index] = value4793 def get_Phone(self): return self.Phone4794 def set_Phone(self, Phone): self.Phone = Phone4795 def add_Phone(self, value): self.Phone.append(value)4796 def insert_Phone(self, index, value): self.Phone[index] = value4797 def export(self, outfile, level, namespace_='', name_='CommunicationChannelDetailsType', namespacedef_='', pretty_print=True):4798 if pretty_print:4799 eol_ = '\n'4800 else:4801 eol_ = ''4802 showIndent(outfile, level, pretty_print)4803 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))4804 already_processed = []4805 self.exportAttributes(outfile, level, already_processed, namespace_, name_='CommunicationChannelDetailsType')4806 if self.hasContent_():4807 outfile.write('>%s' % (eol_, ))4808 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)4809 showIndent(outfile, level, pretty_print)4810 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))4811 else:4812 outfile.write('/>%s' % (eol_, ))4813 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='CommunicationChannelDetailsType'):4814 pass4815 def exportChildren(self, outfile, level, namespace_='', name_='CommunicationChannelDetailsType', fromsubclass_=False, pretty_print=True):4816 if pretty_print:4817 eol_ = '\n'4818 else:4819 eol_ = ''4820 for Postal_ in self.Postal:4821 Postal_.export(outfile, level, namespace_, name_='Postal', pretty_print=pretty_print)4822 for Email_ in self.Email:4823 Email_.export(outfile, level, namespace_, name_='Email', pretty_print=pretty_print)4824 for Phone_ in self.Phone:4825 Phone_.export(outfile, level, namespace_, name_='Phone', pretty_print=pretty_print)4826 def hasContent_(self):4827 if (4828 self.Postal or4829 self.Email or4830 self.Phone4831 ):4832 return True4833 else:4834 return False4835 def exportLiteral(self, outfile, level, name_='CommunicationChannelDetailsType'):4836 level += 14837 self.exportLiteralAttributes(outfile, level, [], name_)4838 if self.hasContent_():4839 self.exportLiteralChildren(outfile, level, name_)4840 def exportLiteralAttributes(self, outfile, level, already_processed, name_):4841 pass4842 def exportLiteralChildren(self, outfile, level, name_):4843 showIndent(outfile, level)4844 outfile.write('Postal=[\n')4845 level += 14846 for Postal_ in self.Postal:4847 showIndent(outfile, level)4848 outfile.write('model_.AddressDetailsType(\n')4849 Postal_.exportLiteral(outfile, level, name_='AddressDetailsType')4850 showIndent(outfile, level)4851 outfile.write('),\n')4852 level -= 14853 showIndent(outfile, level)4854 outfile.write('],\n')4855 showIndent(outfile, level)4856 outfile.write('Email=[\n')4857 level += 14858 for Email_ in self.Email:4859 showIndent(outfile, level)4860 outfile.write('model_.EmailDetailsType(\n')4861 Email_.exportLiteral(outfile, level, name_='EmailDetailsType')4862 showIndent(outfile, level)4863 outfile.write('),\n')4864 level -= 14865 showIndent(outfile, level)4866 outfile.write('],\n')4867 showIndent(outfile, level)4868 outfile.write('Phone=[\n')4869 level += 14870 for Phone_ in self.Phone:4871 showIndent(outfile, level)4872 outfile.write('model_.PhoneDetailsType(\n')4873 Phone_.exportLiteral(outfile, level, name_='PhoneDetailsType')4874 showIndent(outfile, level)4875 outfile.write('),\n')4876 level -= 14877 showIndent(outfile, level)4878 outfile.write('],\n')4879 def build(self, node):4880 self.buildAttributes(node, node.attrib, [])4881 for child in node:4882 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]4883 self.buildChildren(child, node, nodeName_)4884 def buildAttributes(self, node, attrs, already_processed):4885 pass4886 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):4887 if nodeName_ == 'Postal':4888 obj_ = AddressDetailsType.factory()4889 obj_.build(child_)4890 self.Postal.append(obj_)4891 elif nodeName_ == 'Email':4892 obj_ = EmailDetailsType.factory()4893 obj_.build(child_)4894 self.Email.append(obj_)4895 elif nodeName_ == 'Phone':4896 obj_ = PhoneDetailsType.factory()4897 obj_.build(child_)4898 self.Phone.append(obj_)4899# end class CommunicationChannelDetailsType4900class ConsumerDetailsType(GeneratedsSuper):4901 subclass = None4902 superclass = None4903 def __init__(self, Title=None, Suffix=None, FirstName=None, MiddleName=None, LastName=None, MaternalLastName=None, DOB=None, CountryOfResidence=None, PromoCode=None, AcquisitionSource=None):4904 self.Title = Title4905 self.Suffix = Suffix4906 self.FirstName = FirstName4907 self.MiddleName = MiddleName4908 self.LastName = LastName4909 self.MaternalLastName = MaternalLastName4910 self.DOB = DOB4911 self.CountryOfResidence = CountryOfResidence4912 self.PromoCode = PromoCode4913 self.AcquisitionSource = AcquisitionSource4914 def factory(*args_, **kwargs_):4915 if ConsumerDetailsType.subclass:4916 return ConsumerDetailsType.subclass(*args_, **kwargs_)4917 else:4918 return ConsumerDetailsType(*args_, **kwargs_)4919 factory = staticmethod(factory)4920 def get_Title(self): return self.Title4921 def set_Title(self, Title): self.Title = Title4922 def validate_Title(self, value):4923 # Validate type Title, a restriction on Consumer.4924 pass4925 def get_Suffix(self): return self.Suffix4926 def set_Suffix(self, Suffix): self.Suffix = Suffix4927 def validate_Suffix(self, value):4928 # Validate type Suffix, a restriction on xs:string.4929 pass4930 def get_FirstName(self): return self.FirstName4931 def set_FirstName(self, FirstName): self.FirstName = FirstName4932 def validate_FirstName(self, value):4933 # Validate type FirstName, a restriction on Name.4934 pass4935 def get_MiddleName(self): return self.MiddleName4936 def set_MiddleName(self, MiddleName): self.MiddleName = MiddleName4937 def validate_MiddleName(self, value):4938 # Validate type MiddleName, a restriction on Name.4939 pass4940 def get_LastName(self): return self.LastName4941 def set_LastName(self, LastName): self.LastName = LastName4942 def validate_LastName(self, value):4943 # Validate type LastName, a restriction on Name.4944 pass4945 def get_MaternalLastName(self): return self.MaternalLastName4946 def set_MaternalLastName(self, MaternalLastName): self.MaternalLastName = MaternalLastName4947 def get_DOB(self): return self.DOB4948 def set_DOB(self, DOB): self.DOB = DOB4949 def validate_Date(self, value):4950 # Validate type Date, a restriction on xs:date.4951 pass4952 def get_CountryOfResidence(self): return self.CountryOfResidence4953 def set_CountryOfResidence(self, CountryOfResidence): self.CountryOfResidence = CountryOfResidence4954 def validate_CountryName(self, value):4955 # Validate type CountryName, a restriction on Name.4956 pass4957 def get_PromoCode(self): return self.PromoCode4958 def set_PromoCode(self, PromoCode): self.PromoCode = PromoCode4959 def validate_PromoCodeDesc(self, value):4960 # Validate type PromoCodeDesc, a restriction on Name.4961 pass4962 def get_AcquisitionSource(self): return self.AcquisitionSource4963 def set_AcquisitionSource(self, AcquisitionSource): self.AcquisitionSource = AcquisitionSource4964 def validate_AcquisitionSourceType(self, value):4965 # Validate type AcquisitionSourceType, a restriction on Name.4966 pass4967 def export(self, outfile, level, namespace_='', name_='ConsumerDetailsType', namespacedef_='', pretty_print=True):4968 if pretty_print:4969 eol_ = '\n'4970 else:4971 eol_ = ''4972 showIndent(outfile, level, pretty_print)4973 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))4974 already_processed = []4975 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ConsumerDetailsType')4976 if self.hasContent_():4977 outfile.write('>%s' % (eol_, ))4978 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)4979 showIndent(outfile, level, pretty_print)4980 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))4981 else:4982 outfile.write('/>%s' % (eol_, ))4983 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ConsumerDetailsType'):4984 pass4985 def exportChildren(self, outfile, level, namespace_='', name_='ConsumerDetailsType', fromsubclass_=False, pretty_print=True):4986 if pretty_print:4987 eol_ = '\n'4988 else:4989 eol_ = ''4990 if self.Title is not None:4991 showIndent(outfile, level, pretty_print)4992 outfile.write('<%sTitle>%s</%sTitle>%s' % (namespace_, self.gds_format_string(quote_xml(self.Title).encode(ExternalEncoding), input_name='Title'), namespace_, eol_))4993 if self.Suffix is not None:4994 showIndent(outfile, level, pretty_print)4995 outfile.write('<%sSuffix>%s</%sSuffix>%s' % (namespace_, self.gds_format_string(quote_xml(self.Suffix).encode(ExternalEncoding), input_name='Suffix'), namespace_, eol_))4996 if self.FirstName is not None:4997 showIndent(outfile, level, pretty_print)4998 outfile.write('<%sFirstName>%s</%sFirstName>%s' % (namespace_, self.gds_format_string(quote_xml(self.FirstName).encode(ExternalEncoding), input_name='FirstName'), namespace_, eol_))4999 if self.MiddleName is not None:5000 showIndent(outfile, level, pretty_print)5001 outfile.write('<%sMiddleName>%s</%sMiddleName>%s' % (namespace_, self.gds_format_string(quote_xml(self.MiddleName).encode(ExternalEncoding), input_name='MiddleName'), namespace_, eol_))5002 if self.LastName is not None:5003 showIndent(outfile, level, pretty_print)5004 outfile.write('<%sLastName>%s</%sLastName>%s' % (namespace_, self.gds_format_string(quote_xml(self.LastName).encode(ExternalEncoding), input_name='LastName'), namespace_, eol_))5005 if self.MaternalLastName is not None:5006 showIndent(outfile, level, pretty_print)5007 outfile.write('<%sMaternalLastName>%s</%sMaternalLastName>%s' % (namespace_, self.gds_format_string(quote_xml(self.MaternalLastName).encode(ExternalEncoding), input_name='MaternalLastName'), namespace_, eol_))5008 if self.DOB is not None:5009 showIndent(outfile, level, pretty_print)5010 outfile.write('<%sDOB>%s</%sDOB>%s' % (namespace_, self.gds_format_string(quote_xml(self.DOB).encode(ExternalEncoding), input_name='DOB'), namespace_, eol_))5011 if self.CountryOfResidence is not None:5012 showIndent(outfile, level, pretty_print)5013 outfile.write('<%sCountryOfResidence>%s</%sCountryOfResidence>%s' % (namespace_, self.gds_format_string(quote_xml(self.CountryOfResidence).encode(ExternalEncoding), input_name='CountryOfResidence'), namespace_, eol_))5014 if self.PromoCode is not None:5015 showIndent(outfile, level, pretty_print)5016 outfile.write('<%sPromoCode>%s</%sPromoCode>%s' % (namespace_, self.gds_format_string(quote_xml(self.PromoCode).encode(ExternalEncoding), input_name='PromoCode'), namespace_, eol_))5017 if self.AcquisitionSource is not None:5018 showIndent(outfile, level, pretty_print)5019 outfile.write('<%sAcquisitionSource>%s</%sAcquisitionSource>%s' % (namespace_, self.gds_format_string(quote_xml(self.AcquisitionSource).encode(ExternalEncoding), input_name='AcquisitionSource'), namespace_, eol_))5020 def hasContent_(self):5021 if (5022 self.Title is not None or5023 self.Suffix is not None or5024 self.FirstName is not None or5025 self.MiddleName is not None or5026 self.LastName is not None or5027 self.MaternalLastName is not None or5028 self.DOB is not None or5029 self.CountryOfResidence is not None or5030 self.PromoCode is not None or5031 self.AcquisitionSource is not None5032 ):5033 return True5034 else:5035 return False5036 def exportLiteral(self, outfile, level, name_='ConsumerDetailsType'):5037 level += 15038 self.exportLiteralAttributes(outfile, level, [], name_)5039 if self.hasContent_():5040 self.exportLiteralChildren(outfile, level, name_)5041 def exportLiteralAttributes(self, outfile, level, already_processed, name_):5042 pass5043 def exportLiteralChildren(self, outfile, level, name_):5044 if self.Title is not None:5045 showIndent(outfile, level)5046 outfile.write('Title=%s,\n' % quote_python(self.Title).encode(ExternalEncoding))5047 if self.Suffix is not None:5048 showIndent(outfile, level)5049 outfile.write('Suffix=%s,\n' % quote_python(self.Suffix).encode(ExternalEncoding))5050 if self.FirstName is not None:5051 showIndent(outfile, level)5052 outfile.write('FirstName=%s,\n' % quote_python(self.FirstName).encode(ExternalEncoding))5053 if self.MiddleName is not None:5054 showIndent(outfile, level)5055 outfile.write('MiddleName=%s,\n' % quote_python(self.MiddleName).encode(ExternalEncoding))5056 if self.LastName is not None:5057 showIndent(outfile, level)5058 outfile.write('LastName=%s,\n' % quote_python(self.LastName).encode(ExternalEncoding))5059 if self.MaternalLastName is not None:5060 showIndent(outfile, level)5061 outfile.write('MaternalLastName=%s,\n' % quote_python(self.MaternalLastName).encode(ExternalEncoding))5062 if self.DOB is not None:5063 showIndent(outfile, level)5064 outfile.write('DOB=%s,\n' % quote_python(self.DOB).encode(ExternalEncoding))5065 if self.CountryOfResidence is not None:5066 showIndent(outfile, level)5067 outfile.write('CountryOfResidence=%s,\n' % quote_python(self.CountryOfResidence).encode(ExternalEncoding))5068 if self.PromoCode is not None:5069 showIndent(outfile, level)5070 outfile.write('PromoCode=%s,\n' % quote_python(self.PromoCode).encode(ExternalEncoding))5071 if self.AcquisitionSource is not None:5072 showIndent(outfile, level)5073 outfile.write('AcquisitionSource=%s,\n' % quote_python(self.AcquisitionSource).encode(ExternalEncoding))5074 def build(self, node):5075 self.buildAttributes(node, node.attrib, [])5076 for child in node:5077 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]5078 self.buildChildren(child, node, nodeName_)5079 def buildAttributes(self, node, attrs, already_processed):5080 pass5081 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):5082 if nodeName_ == 'Title':5083 Title_ = child_.text5084 Title_ = self.gds_validate_string(Title_, node, 'Title')5085 self.Title = Title_5086 self.validate_Title(self.Title) # validate type Title5087 elif nodeName_ == 'Suffix':5088 Suffix_ = child_.text5089 Suffix_ = self.gds_validate_string(Suffix_, node, 'Suffix')5090 self.Suffix = Suffix_5091 self.validate_Suffix(self.Suffix) # validate type Suffix5092 elif nodeName_ == 'FirstName':5093 FirstName_ = child_.text5094 FirstName_ = self.gds_validate_string(FirstName_, node, 'FirstName')5095 self.FirstName = FirstName_5096 self.validate_FirstName(self.FirstName) # validate type FirstName5097 elif nodeName_ == 'MiddleName':5098 MiddleName_ = child_.text5099 MiddleName_ = self.gds_validate_string(MiddleName_, node, 'MiddleName')5100 self.MiddleName = MiddleName_5101 self.validate_MiddleName(self.MiddleName) # validate type MiddleName5102 elif nodeName_ == 'LastName':5103 LastName_ = child_.text5104 LastName_ = self.gds_validate_string(LastName_, node, 'LastName')5105 self.LastName = LastName_5106 self.validate_LastName(self.LastName) # validate type LastName5107 elif nodeName_ == 'MaternalLastName':5108 MaternalLastName_ = child_.text5109 MaternalLastName_ = self.gds_validate_string(MaternalLastName_, node, 'MaternalLastName')5110 self.MaternalLastName = MaternalLastName_5111 self.validate_LastName(self.MaternalLastName) # validate type LastName5112 elif nodeName_ == 'DOB':5113 DOB_ = child_.text5114 DOB_ = self.gds_validate_string(DOB_, node, 'DOB')5115 self.DOB = DOB_5116 self.validate_Date(self.DOB) # validate type Date5117 elif nodeName_ == 'CountryOfResidence':5118 CountryOfResidence_ = child_.text5119 CountryOfResidence_ = self.gds_validate_string(CountryOfResidence_, node, 'CountryOfResidence')5120 self.CountryOfResidence = CountryOfResidence_5121 self.validate_CountryName(self.CountryOfResidence) # validate type CountryName5122 elif nodeName_ == 'PromoCode':5123 PromoCode_ = child_.text5124 PromoCode_ = self.gds_validate_string(PromoCode_, node, 'PromoCode')5125 self.PromoCode = PromoCode_5126 self.validate_PromoCodeDesc(self.PromoCode) # validate type PromoCodeDesc5127 elif nodeName_ == 'AcquisitionSource':5128 AcquisitionSource_ = child_.text5129 AcquisitionSource_ = self.gds_validate_string(AcquisitionSource_, node, 'AcquisitionSource')5130 self.AcquisitionSource = AcquisitionSource_5131 self.validate_AcquisitionSourceType(self.AcquisitionSource) # validate type AcquisitionSourceType5132# end class ConsumerDetailsType5133class ResponseType(GeneratedsSuper):5134 subclass = None5135 superclass = None5136 def __init__(self, ResponseCode=None, ResponseMessage=None):5137 self.ResponseCode = ResponseCode5138 self.ResponseMessage = ResponseMessage5139 def factory(*args_, **kwargs_):5140 if ResponseType.subclass:5141 return ResponseType.subclass(*args_, **kwargs_)5142 else:5143 return ResponseType(*args_, **kwargs_)5144 factory = staticmethod(factory)5145 def get_ResponseCode(self): return self.ResponseCode5146 def set_ResponseCode(self, ResponseCode): self.ResponseCode = ResponseCode5147 def validate_ResponseCode(self, value):5148 # Validate type ResponseCode, a restriction on xs:string.5149 pass5150 def get_ResponseMessage(self): return self.ResponseMessage5151 def set_ResponseMessage(self, ResponseMessage): self.ResponseMessage = ResponseMessage5152 def validate_ResponseMessage(self, value):5153 # Validate type ResponseMessage, a restriction on xs:string.5154 pass5155 def export(self, outfile, level, namespace_='', name_='ResponseType', namespacedef_='', pretty_print=True):5156 if pretty_print:5157 eol_ = '\n'5158 else:5159 eol_ = ''5160 showIndent(outfile, level, pretty_print)5161 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))5162 already_processed = []5163 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ResponseType')5164 if self.hasContent_():5165 outfile.write('>%s' % (eol_, ))5166 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)5167 showIndent(outfile, level, pretty_print)5168 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))5169 else:5170 outfile.write('/>%s' % (eol_, ))5171 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ResponseType'):5172 pass5173 def exportChildren(self, outfile, level, namespace_='', name_='ResponseType', fromsubclass_=False, pretty_print=True):5174 if pretty_print:5175 eol_ = '\n'5176 else:5177 eol_ = ''5178 if self.ResponseCode is not None:5179 showIndent(outfile, level, pretty_print)5180 outfile.write('<%sResponseCode>%s</%sResponseCode>%s' % (namespace_, self.gds_format_string(quote_xml(self.ResponseCode).encode(ExternalEncoding), input_name='ResponseCode'), namespace_, eol_))5181 if self.ResponseMessage is not None:5182 showIndent(outfile, level, pretty_print)5183 outfile.write('<%sResponseMessage>%s</%sResponseMessage>%s' % (namespace_, self.gds_format_string(quote_xml(self.ResponseMessage).encode(ExternalEncoding), input_name='ResponseMessage'), namespace_, eol_))5184 def hasContent_(self):5185 if (5186 self.ResponseCode is not None or5187 self.ResponseMessage is not None5188 ):5189 return True5190 else:5191 return False5192 def exportLiteral(self, outfile, level, name_='ResponseType'):5193 level += 15194 self.exportLiteralAttributes(outfile, level, [], name_)5195 if self.hasContent_():5196 self.exportLiteralChildren(outfile, level, name_)5197 def exportLiteralAttributes(self, outfile, level, already_processed, name_):5198 pass5199 def exportLiteralChildren(self, outfile, level, name_):5200 if self.ResponseCode is not None:5201 showIndent(outfile, level)5202 outfile.write('ResponseCode=%s,\n' % quote_python(self.ResponseCode).encode(ExternalEncoding))5203 if self.ResponseMessage is not None:5204 showIndent(outfile, level)5205 outfile.write('ResponseMessage=%s,\n' % quote_python(self.ResponseMessage).encode(ExternalEncoding))5206 def build(self, node):5207 self.buildAttributes(node, node.attrib, [])5208 for child in node:5209 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]5210 self.buildChildren(child, node, nodeName_)5211 def buildAttributes(self, node, attrs, already_processed):5212 pass5213 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):5214 if nodeName_ == 'ResponseCode':5215 ResponseCode_ = child_.text5216 ResponseCode_ = self.gds_validate_string(ResponseCode_, node, 'ResponseCode')5217 self.ResponseCode = ResponseCode_5218 self.validate_ResponseCode(self.ResponseCode) # validate type ResponseCode5219 elif nodeName_ == 'ResponseMessage':5220 ResponseMessage_ = child_.text5221 ResponseMessage_ = self.gds_validate_string(ResponseMessage_, node, 'ResponseMessage')5222 self.ResponseMessage = ResponseMessage_5223 self.validate_ResponseMessage(self.ResponseMessage) # validate type ResponseMessage5224# end class ResponseType5225class ResponseListType(GeneratedsSuper):5226 subclass = None5227 superclass = None5228 def __init__(self, Response=None):5229 if Response is None:5230 self.Response = []5231 else:5232 self.Response = Response5233 def factory(*args_, **kwargs_):5234 if ResponseListType.subclass:5235 return ResponseListType.subclass(*args_, **kwargs_)5236 else:5237 return ResponseListType(*args_, **kwargs_)5238 factory = staticmethod(factory)5239 def get_Response(self): return self.Response5240 def set_Response(self, Response): self.Response = Response5241 def add_Response(self, value): self.Response.append(value)5242 def insert_Response(self, index, value): self.Response[index] = value5243 def export(self, outfile, level, namespace_='', name_='ResponseListType', namespacedef_='', pretty_print=True):5244 if pretty_print:5245 eol_ = '\n'5246 else:5247 eol_ = ''5248 showIndent(outfile, level, pretty_print)5249 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))5250 already_processed = []5251 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ResponseListType')5252 if self.hasContent_():5253 outfile.write('>%s' % (eol_, ))5254 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)5255 showIndent(outfile, level, pretty_print)5256 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))5257 else:5258 outfile.write('/>%s' % (eol_, ))5259 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ResponseListType'):5260 pass5261 def exportChildren(self, outfile, level, namespace_='', name_='ResponseListType', fromsubclass_=False, pretty_print=True):5262 if pretty_print:5263 eol_ = '\n'5264 else:5265 eol_ = ''5266 for Response_ in self.Response:5267 Response_.export(outfile, level, namespace_, name_='Response', pretty_print=pretty_print)5268 def hasContent_(self):5269 if (5270 self.Response5271 ):5272 return True5273 else:5274 return False5275 def exportLiteral(self, outfile, level, name_='ResponseListType'):5276 level += 15277 self.exportLiteralAttributes(outfile, level, [], name_)5278 if self.hasContent_():5279 self.exportLiteralChildren(outfile, level, name_)5280 def exportLiteralAttributes(self, outfile, level, already_processed, name_):5281 pass5282 def exportLiteralChildren(self, outfile, level, name_):5283 showIndent(outfile, level)5284 outfile.write('Response=[\n')5285 level += 15286 for Response_ in self.Response:5287 showIndent(outfile, level)5288 outfile.write('model_.ResponseType(\n')5289 Response_.exportLiteral(outfile, level, name_='ResponseType')5290 showIndent(outfile, level)5291 outfile.write('),\n')5292 level -= 15293 showIndent(outfile, level)5294 outfile.write('],\n')5295 def build(self, node):5296 self.buildAttributes(node, node.attrib, [])5297 for child in node:5298 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]5299 self.buildChildren(child, node, nodeName_)5300 def buildAttributes(self, node, attrs, already_processed):5301 pass5302 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):5303 if nodeName_ == 'Response':5304 obj_ = ResponseType.factory()5305 obj_.build(child_)5306 self.Response.append(obj_)5307# end class ResponseListType5308class ConsumerIDAndApplicationsType(GeneratedsSuper):5309 subclass = None5310 superclass = None5311 def __init__(self, Consumer=None):5312 if Consumer is None:5313 self.Consumer = []5314 else:5315 self.Consumer = Consumer5316 def factory(*args_, **kwargs_):5317 if ConsumerIDAndApplicationsType.subclass:5318 return ConsumerIDAndApplicationsType.subclass(*args_, **kwargs_)5319 else:5320 return ConsumerIDAndApplicationsType(*args_, **kwargs_)5321 factory = staticmethod(factory)5322 def get_Consumer(self): return self.Consumer5323 def set_Consumer(self, Consumer): self.Consumer = Consumer5324 def add_Consumer(self, value): self.Consumer.append(value)5325 def insert_Consumer(self, index, value): self.Consumer[index] = value5326 def export(self, outfile, level, namespace_='', name_='ConsumerIDAndApplicationsType', namespacedef_='', pretty_print=True):5327 if pretty_print:5328 eol_ = '\n'5329 else:5330 eol_ = ''5331 showIndent(outfile, level, pretty_print)5332 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))5333 already_processed = []5334 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ConsumerIDAndApplicationsType')5335 if self.hasContent_():5336 outfile.write('>%s' % (eol_, ))5337 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)5338 showIndent(outfile, level, pretty_print)5339 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))5340 else:5341 outfile.write('/>%s' % (eol_, ))5342 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ConsumerIDAndApplicationsType'):5343 pass5344 def exportChildren(self, outfile, level, namespace_='', name_='ConsumerIDAndApplicationsType', fromsubclass_=False, pretty_print=True):5345 if pretty_print:5346 eol_ = '\n'5347 else:5348 eol_ = ''5349 for Consumer_ in self.Consumer:5350 Consumer_.export(outfile, level, namespace_, name_='Consumer', pretty_print=pretty_print)5351 def hasContent_(self):5352 if (5353 self.Consumer5354 ):5355 return True5356 else:5357 return False5358 def exportLiteral(self, outfile, level, name_='ConsumerIDAndApplicationsType'):5359 level += 15360 self.exportLiteralAttributes(outfile, level, [], name_)5361 if self.hasContent_():5362 self.exportLiteralChildren(outfile, level, name_)5363 def exportLiteralAttributes(self, outfile, level, already_processed, name_):5364 pass5365 def exportLiteralChildren(self, outfile, level, name_):5366 showIndent(outfile, level)5367 outfile.write('Consumer=[\n')5368 level += 15369 for Consumer_ in self.Consumer:5370 showIndent(outfile, level)5371 outfile.write('model_.ConsumerIDAndApplicationType(\n')5372 Consumer_.exportLiteral(outfile, level, name_='ConsumerIDAndApplicationType')5373 showIndent(outfile, level)5374 outfile.write('),\n')5375 level -= 15376 showIndent(outfile, level)5377 outfile.write('],\n')5378 def build(self, node):5379 self.buildAttributes(node, node.attrib, [])5380 for child in node:5381 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]5382 self.buildChildren(child, node, nodeName_)5383 def buildAttributes(self, node, attrs, already_processed):5384 pass5385 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):5386 if nodeName_ == 'Consumer':5387 obj_ = ConsumerIDAndApplicationType.factory()5388 obj_.build(child_)5389 self.Consumer.append(obj_)5390# end class ConsumerIDAndApplicationsType5391class ConsumerIDAndApplicationType(GeneratedsSuper):5392 subclass = None5393 superclass = None5394 def __init__(self, ConsumerID=None, LoginName=None, ApplicationName=None):5395 self.ConsumerID = ConsumerID5396 self.LoginName = LoginName5397 self.ApplicationName = ApplicationName5398 def factory(*args_, **kwargs_):5399 if ConsumerIDAndApplicationType.subclass:5400 return ConsumerIDAndApplicationType.subclass(*args_, **kwargs_)5401 else:5402 return ConsumerIDAndApplicationType(*args_, **kwargs_)5403 factory = staticmethod(factory)5404 def get_ConsumerID(self): return self.ConsumerID5405 def set_ConsumerID(self, ConsumerID): self.ConsumerID = ConsumerID5406 def validate_ConsumerIDType(self, value):5407 # Validate type ConsumerIDType, a restriction on xs:long.5408 pass5409 def get_LoginName(self): return self.LoginName5410 def set_LoginName(self, LoginName): self.LoginName = LoginName5411 def validate_LoginName(self, value):5412 # Validate type LoginName, a restriction on Name.5413 pass5414 def get_ApplicationName(self): return self.ApplicationName5415 def set_ApplicationName(self, ApplicationName): self.ApplicationName = ApplicationName5416 def validate_ApplicationNameType(self, value):5417 # Validate type ApplicationNameType, a restriction on xs:string.5418 pass5419 def export(self, outfile, level, namespace_='', name_='ConsumerIDAndApplicationType', namespacedef_='', pretty_print=True):5420 if pretty_print:5421 eol_ = '\n'5422 else:5423 eol_ = ''5424 showIndent(outfile, level, pretty_print)5425 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))5426 already_processed = []5427 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ConsumerIDAndApplicationType')5428 if self.hasContent_():5429 outfile.write('>%s' % (eol_, ))5430 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)5431 showIndent(outfile, level, pretty_print)5432 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))5433 else:5434 outfile.write('/>%s' % (eol_, ))5435 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ConsumerIDAndApplicationType'):5436 pass5437 def exportChildren(self, outfile, level, namespace_='', name_='ConsumerIDAndApplicationType', fromsubclass_=False, pretty_print=True):5438 if pretty_print:5439 eol_ = '\n'5440 else:5441 eol_ = ''5442 if self.ConsumerID is not None:5443 showIndent(outfile, level, pretty_print)5444 outfile.write('<%sConsumerID>%s</%sConsumerID>%s' % (namespace_, self.gds_format_integer(self.ConsumerID, input_name='ConsumerID'), namespace_, eol_))5445 if self.LoginName is not None:5446 showIndent(outfile, level, pretty_print)5447 outfile.write('<%sLoginName>%s</%sLoginName>%s' % (namespace_, self.gds_format_string(quote_xml(self.LoginName).encode(ExternalEncoding), input_name='LoginName'), namespace_, eol_))5448 if self.ApplicationName is not None:5449 showIndent(outfile, level, pretty_print)5450 outfile.write('<%sApplicationName>%s</%sApplicationName>%s' % (namespace_, self.gds_format_string(quote_xml(self.ApplicationName).encode(ExternalEncoding), input_name='ApplicationName'), namespace_, eol_))5451 def hasContent_(self):5452 if (5453 self.ConsumerID is not None or5454 self.LoginName is not None or5455 self.ApplicationName is not None5456 ):5457 return True5458 else:5459 return False5460 def exportLiteral(self, outfile, level, name_='ConsumerIDAndApplicationType'):5461 level += 15462 self.exportLiteralAttributes(outfile, level, [], name_)5463 if self.hasContent_():5464 self.exportLiteralChildren(outfile, level, name_)5465 def exportLiteralAttributes(self, outfile, level, already_processed, name_):5466 pass5467 def exportLiteralChildren(self, outfile, level, name_):5468 if self.ConsumerID is not None:5469 showIndent(outfile, level)5470 outfile.write('ConsumerID=%d,\n' % self.ConsumerID)5471 if self.LoginName is not None:5472 showIndent(outfile, level)5473 outfile.write('LoginName=%s,\n' % quote_python(self.LoginName).encode(ExternalEncoding))5474 if self.ApplicationName is not None:5475 showIndent(outfile, level)5476 outfile.write('ApplicationName=%s,\n' % quote_python(self.ApplicationName).encode(ExternalEncoding))5477 def build(self, node):5478 self.buildAttributes(node, node.attrib, [])5479 for child in node:5480 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]5481 self.buildChildren(child, node, nodeName_)5482 def buildAttributes(self, node, attrs, already_processed):5483 pass5484 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):5485 if nodeName_ == 'ConsumerID':5486 sval_ = child_.text5487 try:5488 ival_ = int(sval_)5489 except (TypeError, ValueError), exp:5490 raise_parse_error(child_, 'requires integer: %s' % exp)5491 ival_ = self.gds_validate_integer(ival_, node, 'ConsumerID')5492 self.ConsumerID = ival_5493 self.validate_ConsumerIDType(self.ConsumerID) # validate type ConsumerIDType5494 elif nodeName_ == 'LoginName':5495 LoginName_ = child_.text5496 LoginName_ = self.gds_validate_string(LoginName_, node, 'LoginName')5497 self.LoginName = LoginName_5498 self.validate_LoginName(self.LoginName) # validate type LoginName5499 elif nodeName_ == 'ApplicationName':5500 ApplicationName_ = child_.text5501 ApplicationName_ = self.gds_validate_string(ApplicationName_, node, 'ApplicationName')5502 self.ApplicationName = ApplicationName_5503 self.validate_ApplicationNameType(self.ApplicationName) # validate type ApplicationNameType5504# end class ConsumerIDAndApplicationType5505class ProfanityCheckType(GeneratedsSuper):5506 subclass = None5507 superclass = None5508 def __init__(self, Locale=None, Language=None, EmailBody=None):5509 self.Locale = Locale5510 self.Language = Language5511 self.EmailBody = EmailBody5512 def factory(*args_, **kwargs_):5513 if ProfanityCheckType.subclass:5514 return ProfanityCheckType.subclass(*args_, **kwargs_)5515 else:5516 return ProfanityCheckType(*args_, **kwargs_)5517 factory = staticmethod(factory)5518 def get_Locale(self): return self.Locale5519 def set_Locale(self, Locale): self.Locale = Locale5520 def validate_LocaleCode(self, value):5521 # Validate type LocaleCode, a restriction on xs:string.5522 pass5523 def get_Language(self): return self.Language5524 def set_Language(self, Language): self.Language = Language5525 def validate_LanguageCode(self, value):5526 # Validate type LanguageCode, a restriction on xs:string.5527 pass5528 def get_EmailBody(self): return self.EmailBody5529 def set_EmailBody(self, EmailBody): self.EmailBody = EmailBody5530 def validate_EmailBody(self, value):5531 # Validate type EmailBody, a restriction on xs:string.5532 pass5533 def export(self, outfile, level, namespace_='', name_='ProfanityCheckType', namespacedef_='', pretty_print=True):5534 if pretty_print:5535 eol_ = '\n'5536 else:5537 eol_ = ''5538 showIndent(outfile, level, pretty_print)5539 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))5540 already_processed = []5541 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ProfanityCheckType')5542 if self.hasContent_():5543 outfile.write('>%s' % (eol_, ))5544 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)5545 showIndent(outfile, level, pretty_print)5546 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))5547 else:5548 outfile.write('/>%s' % (eol_, ))5549 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ProfanityCheckType'):5550 pass5551 def exportChildren(self, outfile, level, namespace_='', name_='ProfanityCheckType', fromsubclass_=False, pretty_print=True):5552 if pretty_print:5553 eol_ = '\n'5554 else:5555 eol_ = ''5556 if self.Locale is not None:5557 showIndent(outfile, level, pretty_print)5558 outfile.write('<%sLocale>%s</%sLocale>%s' % (namespace_, self.gds_format_string(quote_xml(self.Locale).encode(ExternalEncoding), input_name='Locale'), namespace_, eol_))5559 if self.Language is not None:5560 showIndent(outfile, level, pretty_print)5561 outfile.write('<%sLanguage>%s</%sLanguage>%s' % (namespace_, self.gds_format_string(quote_xml(self.Language).encode(ExternalEncoding), input_name='Language'), namespace_, eol_))5562 if self.EmailBody is not None:5563 showIndent(outfile, level, pretty_print)5564 outfile.write('<%sEmailBody>%s</%sEmailBody>%s' % (namespace_, self.gds_format_string(quote_xml(self.EmailBody).encode(ExternalEncoding), input_name='EmailBody'), namespace_, eol_))5565 def hasContent_(self):5566 if (5567 self.Locale is not None or5568 self.Language is not None or5569 self.EmailBody is not None5570 ):5571 return True5572 else:5573 return False5574 def exportLiteral(self, outfile, level, name_='ProfanityCheckType'):5575 level += 15576 self.exportLiteralAttributes(outfile, level, [], name_)5577 if self.hasContent_():5578 self.exportLiteralChildren(outfile, level, name_)5579 def exportLiteralAttributes(self, outfile, level, already_processed, name_):5580 pass5581 def exportLiteralChildren(self, outfile, level, name_):5582 if self.Locale is not None:5583 showIndent(outfile, level)5584 outfile.write('Locale=%s,\n' % quote_python(self.Locale).encode(ExternalEncoding))5585 if self.Language is not None:5586 showIndent(outfile, level)5587 outfile.write('Language=%s,\n' % quote_python(self.Language).encode(ExternalEncoding))5588 if self.EmailBody is not None:5589 showIndent(outfile, level)5590 outfile.write('EmailBody=%s,\n' % quote_python(self.EmailBody).encode(ExternalEncoding))5591 def build(self, node):5592 self.buildAttributes(node, node.attrib, [])5593 for child in node:5594 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]5595 self.buildChildren(child, node, nodeName_)5596 def buildAttributes(self, node, attrs, already_processed):5597 pass5598 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):5599 if nodeName_ == 'Locale':5600 Locale_ = child_.text5601 Locale_ = self.gds_validate_string(Locale_, node, 'Locale')5602 self.Locale = Locale_5603 self.validate_LocaleCode(self.Locale) # validate type LocaleCode5604 elif nodeName_ == 'Language':5605 Language_ = child_.text5606 Language_ = self.gds_validate_string(Language_, node, 'Language')5607 self.Language = Language_5608 self.validate_LanguageCode(self.Language) # validate type LanguageCode5609 elif nodeName_ == 'EmailBody':5610 EmailBody_ = child_.text5611 EmailBody_ = self.gds_validate_string(EmailBody_, node, 'EmailBody')5612 self.EmailBody = EmailBody_5613 self.validate_EmailBody(self.EmailBody) # validate type EmailBody5614# end class ProfanityCheckType5615class SearchDataType(GeneratedsSuper):5616 subclass = None5617 superclass = None5618 def __init__(self, QuestionCategory=None):5619 if QuestionCategory is None:5620 self.QuestionCategory = []5621 else:5622 self.QuestionCategory = QuestionCategory5623 def factory(*args_, **kwargs_):5624 if SearchDataType.subclass:5625 return SearchDataType.subclass(*args_, **kwargs_)5626 else:5627 return SearchDataType(*args_, **kwargs_)5628 factory = staticmethod(factory)5629 def get_QuestionCategory(self): return self.QuestionCategory5630 def set_QuestionCategory(self, QuestionCategory): self.QuestionCategory = QuestionCategory5631 def add_QuestionCategory(self, value): self.QuestionCategory.append(value)5632 def insert_QuestionCategory(self, index, value): self.QuestionCategory[index] = value5633 def export(self, outfile, level, namespace_='', name_='SearchDataType', namespacedef_='', pretty_print=True):5634 if pretty_print:5635 eol_ = '\n'5636 else:5637 eol_ = ''5638 showIndent(outfile, level, pretty_print)5639 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))5640 already_processed = []5641 self.exportAttributes(outfile, level, already_processed, namespace_, name_='SearchDataType')5642 if self.hasContent_():5643 outfile.write('>%s' % (eol_, ))5644 self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)5645 showIndent(outfile, level, pretty_print)5646 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))5647 else:5648 outfile.write('/>%s' % (eol_, ))5649 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SearchDataType'):5650 pass5651 def exportChildren(self, outfile, level, namespace_='', name_='SearchDataType', fromsubclass_=False, pretty_print=True):5652 if pretty_print:5653 eol_ = '\n'5654 else:5655 eol_ = ''5656 for QuestionCategory_ in self.QuestionCategory:5657 QuestionCategory_.export(outfile, level, namespace_, name_='QuestionCategory', pretty_print=pretty_print)5658 def hasContent_(self):5659 if (5660 self.QuestionCategory5661 ):5662 return True5663 else:5664 return False5665 def exportLiteral(self, outfile, level, name_='SearchDataType'):5666 level += 15667 self.exportLiteralAttributes(outfile, level, [], name_)5668 if self.hasContent_():5669 self.exportLiteralChildren(outfile, level, name_)5670 def exportLiteralAttributes(self, outfile, level, already_processed, name_):5671 pass5672 def exportLiteralChildren(self, outfile, level, name_):5673 showIndent(outfile, level)5674 outfile.write('QuestionCategory=[\n')5675 level += 15676 for QuestionCategory_ in self.QuestionCategory:5677 showIndent(outfile, level)5678 outfile.write('model_.CategoryType(\n')5679 QuestionCategory_.exportLiteral(outfile, level, name_='CategoryType')5680 showIndent(outfile, level)5681 outfile.write('),\n')5682 level -= 15683 showIndent(outfile, level)5684 outfile.write('],\n')5685 def build(self, node):5686 self.buildAttributes(node, node.attrib, [])5687 for child in node:5688 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]5689 self.buildChildren(child, node, nodeName_)5690 def buildAttributes(self, node, attrs, already_processed):5691 pass5692 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):5693 if nodeName_ == 'QuestionCategory':5694 obj_ = CategoryType.factory()5695 obj_.build(child_)5696 self.QuestionCategory.append(obj_)5697# end class SearchDataType5698class CountryType(GeneratedsSuper):5699 subclass = None5700 superclass = None5701 def __init__(self, CountryCode=None, DefaultLanguageCode=None, OtherLanguageCode=None, CurrencyCode=None, DefaultTimeZone=None, OtherTimeZones=None, RedirectURL=None):5702 self.CountryCode = CountryCode5703 self.DefaultLanguageCode = DefaultLanguageCode5704 if OtherLanguageCode is None:5705 self.OtherLanguageCode = []5706 else:5707 self.OtherLanguageCode = OtherLanguageCode5708 self.CurrencyCode = CurrencyCode5709 self.DefaultTimeZone = DefaultTimeZone5710 if OtherTimeZones is None:5711 self.OtherTimeZones = []5712 else:5713 self.OtherTimeZones = OtherTimeZones5714 self.RedirectURL = RedirectURL5715 def factory(*args_, **kwargs_):5716 if CountryType.subclass:5717 return CountryType.subclass(*args_, **kwargs_)5718 else:5719 return CountryType(*args_, **kwargs_)5720 factory = staticmethod(factory)5721 def get_Cou