How to use get_extensiontype_ method in autotest

Best Python code snippet using autotest_python

mediaType.py

Source:mediaType.py Github

copy

Full Screen

...775 def insert_VCloudExtension_at(self, index, value): self.VCloudExtension.insert(index, value)776 def replace_VCloudExtension_at(self, index, value): self.VCloudExtension[index] = value777 def get_anyAttributes_(self): return self.anyAttributes_778 def set_anyAttributes_(self, anyAttributes_): self.anyAttributes_ = anyAttributes_779 def get_extensiontype_(self): return self.extensiontype_780 def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_781 def hasContent_(self):782 if (783 self.VCloudExtension784 ):785 return True786 else:787 return False788 def export(self, outfile, level, namespace_='', name_='VCloudExtensibleType', namespacedef_='', pretty_print=True):789 if pretty_print:790 eol_ = '\n'791 else:792 eol_ = ''793 if self.original_tagname_ is not None:794 name_ = self.original_tagname_795 showIndent(outfile, level, pretty_print)796 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))797 already_processed = set()798 self.exportAttributes(outfile, level, already_processed, namespace_, name_='VCloudExtensibleType')799 if self.hasContent_():800 outfile.write('>%s' % (eol_, ))801 self.exportChildren(outfile, level + 1, namespace_='', name_='VCloudExtensibleType', pretty_print=pretty_print)802 showIndent(outfile, level, pretty_print)803 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))804 else:805 outfile.write('/>%s' % (eol_, ))806 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='VCloudExtensibleType'):807 unique_counter = 0808 for name, value in self.anyAttributes_.items():809 xsinamespaceprefix = 'xsi'810 xsinamespace1 = 'http://www.w3.org/2001/XMLSchema-instance'811 xsinamespace2 = '{%s}' % (xsinamespace1, )812 if name.startswith(xsinamespace2):813 name1 = name[len(xsinamespace2):]814 name2 = '%s:%s' % (xsinamespaceprefix, name1, )815 if name2 not in already_processed:816 already_processed.add(name2)817 outfile.write(' %s=%s' % (name2, quote_attrib(value), ))818 else:819 mo = re_.match(Namespace_extract_pat_, name)820 if mo is not None:821 namespace, name = mo.group(1, 2)822 if name not in already_processed:823 already_processed.add(name)824 if namespace == 'http://www.w3.org/XML/1998/namespace':825 outfile.write(' %s=%s' % (826 name, quote_attrib(value), ))827 else:828 unique_counter += 1829 outfile.write(' xmlns:yyy%d="%s"' % (830 unique_counter, namespace, ))831 outfile.write(' yyy%d:%s=%s' % (832 unique_counter, name, quote_attrib(value), ))833 else:834 if name not in already_processed:835 already_processed.add(name)836 outfile.write(' %s=%s' % (837 name, quote_attrib(value), ))838 if self.extensiontype_ is not None and 'xsi:type' not in already_processed:839 already_processed.add('xsi:type')840 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')841 outfile.write(' xsi:type="%s"' % self.extensiontype_)842 pass843 def exportChildren(self, outfile, level, namespace_='', name_='VCloudExtensibleType', fromsubclass_=False, pretty_print=True):844 if pretty_print:845 eol_ = '\n'846 else:847 eol_ = ''848 for VCloudExtension_ in self.VCloudExtension:849 VCloudExtension_.export(outfile, level, namespace_, name_='VCloudExtension', pretty_print=pretty_print)850 def exportLiteral(self, outfile, level, name_='VCloudExtensibleType'):851 level += 1852 already_processed = set()853 self.exportLiteralAttributes(outfile, level, already_processed, name_)854 if self.hasContent_():855 self.exportLiteralChildren(outfile, level, name_)856 def exportLiteralAttributes(self, outfile, level, already_processed, name_):857 for name, value in self.anyAttributes_.items():858 showIndent(outfile, level)859 outfile.write('%s="%s",\n' % (name, value,))860 def exportLiteralChildren(self, outfile, level, name_):861 showIndent(outfile, level)862 outfile.write('VCloudExtension=[\n')863 level += 1864 for VCloudExtension_ in self.VCloudExtension:865 showIndent(outfile, level)866 outfile.write('model_.VCloudExtensionType(\n')867 VCloudExtension_.exportLiteral(outfile, level, name_='VCloudExtensionType')868 showIndent(outfile, level)869 outfile.write('),\n')870 level -= 1871 showIndent(outfile, level)872 outfile.write('],\n')873 def build(self, node):874 already_processed = set()875 self.buildAttributes(node, node.attrib, already_processed)876 for child in node:877 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]878 self.buildChildren(child, node, nodeName_)879 return self880 def buildAttributes(self, node, attrs, already_processed):881 self.anyAttributes_ = {}882 for name, value in attrs.items():883 if name not in already_processed:884 self.anyAttributes_[name] = value885 value = find_attr_value_('xsi:type', node)886 if value is not None and 'xsi:type' not in already_processed:887 already_processed.add('xsi:type')888 self.extensiontype_ = value889 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):890 if nodeName_ == 'VCloudExtension':891 obj_ = VCloudExtensionType.factory()892 obj_.build(child_)893 self.VCloudExtension.append(obj_)894 obj_.original_tagname_ = 'VCloudExtension'895# end class VCloudExtensibleType896class ErrorType(VCloudExtensibleType):897 """0.9 The standard error message type used in the vCloud REST API.898 none An one line, human-readable message describing the error899 that occurred. truenone The class of the error. Matches the HTTP900 status code. truenone Resource-specific error code. truenone A901 vendor- or implementation-specific error code that can reference902 specific modules or source lines for diagnostic purposes.903 false1.0none The stack trace of the exception. false"""904 subclass = None905 superclass = VCloudExtensibleType906 def __init__(self, VCloudExtension=None, vendorSpecificErrorCode=None, stackTrace=None, message=None, minorErrorCode=None, majorErrorCode=None):907 self.original_tagname_ = None908 super(ErrorType, self).__init__(VCloudExtension, )909 self.vendorSpecificErrorCode = _cast(None, vendorSpecificErrorCode)910 self.stackTrace = _cast(None, stackTrace)911 self.message = _cast(None, message)912 self.minorErrorCode = _cast(None, minorErrorCode)913 self.majorErrorCode = _cast(int, majorErrorCode)914 def factory(*args_, **kwargs_):915 if ErrorType.subclass:916 return ErrorType.subclass(*args_, **kwargs_)917 else:918 return ErrorType(*args_, **kwargs_)919 factory = staticmethod(factory)920 def get_vendorSpecificErrorCode(self): return self.vendorSpecificErrorCode921 def set_vendorSpecificErrorCode(self, vendorSpecificErrorCode): self.vendorSpecificErrorCode = vendorSpecificErrorCode922 def get_stackTrace(self): return self.stackTrace923 def set_stackTrace(self, stackTrace): self.stackTrace = stackTrace924 def get_message(self): return self.message925 def set_message(self, message): self.message = message926 def get_minorErrorCode(self): return self.minorErrorCode927 def set_minorErrorCode(self, minorErrorCode): self.minorErrorCode = minorErrorCode928 def get_majorErrorCode(self): return self.majorErrorCode929 def set_majorErrorCode(self, majorErrorCode): self.majorErrorCode = majorErrorCode930 def hasContent_(self):931 if (932 super(ErrorType, self).hasContent_()933 ):934 return True935 else:936 return False937 def export(self, outfile, level, namespace_='', name_='ErrorType', namespacedef_='', pretty_print=True):938 if pretty_print:939 eol_ = '\n'940 else:941 eol_ = ''942 if self.original_tagname_ is not None:943 name_ = self.original_tagname_944 showIndent(outfile, level, pretty_print)945 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))946 already_processed = set()947 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ErrorType')948 if self.hasContent_():949 outfile.write('>%s' % (eol_, ))950 self.exportChildren(outfile, level + 1, namespace_='', name_='ErrorType', pretty_print=pretty_print)951 showIndent(outfile, level, pretty_print)952 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))953 else:954 outfile.write('/>%s' % (eol_, ))955 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ErrorType'):956 super(ErrorType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='ErrorType')957 if self.vendorSpecificErrorCode is not None and 'vendorSpecificErrorCode' not in already_processed:958 already_processed.add('vendorSpecificErrorCode')959 outfile.write(' vendorSpecificErrorCode=%s' % (self.gds_format_string(quote_attrib(self.vendorSpecificErrorCode).encode(ExternalEncoding), input_name='vendorSpecificErrorCode'), ))960 if self.stackTrace is not None and 'stackTrace' not in already_processed:961 already_processed.add('stackTrace')962 outfile.write(' stackTrace=%s' % (self.gds_format_string(quote_attrib(self.stackTrace).encode(ExternalEncoding), input_name='stackTrace'), ))963 if self.message is not None and 'message' not in already_processed:964 already_processed.add('message')965 outfile.write(' message=%s' % (self.gds_format_string(quote_attrib(self.message).encode(ExternalEncoding), input_name='message'), ))966 if self.minorErrorCode is not None and 'minorErrorCode' not in already_processed:967 already_processed.add('minorErrorCode')968 outfile.write(' minorErrorCode=%s' % (self.gds_format_string(quote_attrib(self.minorErrorCode).encode(ExternalEncoding), input_name='minorErrorCode'), ))969 if self.majorErrorCode is not None and 'majorErrorCode' not in already_processed:970 already_processed.add('majorErrorCode')971 outfile.write(' majorErrorCode="%s"' % self.gds_format_integer(self.majorErrorCode, input_name='majorErrorCode'))972 def exportChildren(self, outfile, level, namespace_='', name_='ErrorType', fromsubclass_=False, pretty_print=True):973 super(ErrorType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)974 def exportLiteral(self, outfile, level, name_='ErrorType'):975 level += 1976 already_processed = set()977 self.exportLiteralAttributes(outfile, level, already_processed, name_)978 if self.hasContent_():979 self.exportLiteralChildren(outfile, level, name_)980 def exportLiteralAttributes(self, outfile, level, already_processed, name_):981 if self.vendorSpecificErrorCode is not None and 'vendorSpecificErrorCode' not in already_processed:982 already_processed.add('vendorSpecificErrorCode')983 showIndent(outfile, level)984 outfile.write('vendorSpecificErrorCode="%s",\n' % (self.vendorSpecificErrorCode,))985 if self.stackTrace is not None and 'stackTrace' not in already_processed:986 already_processed.add('stackTrace')987 showIndent(outfile, level)988 outfile.write('stackTrace="%s",\n' % (self.stackTrace,))989 if self.message is not None and 'message' not in already_processed:990 already_processed.add('message')991 showIndent(outfile, level)992 outfile.write('message="%s",\n' % (self.message,))993 if self.minorErrorCode is not None and 'minorErrorCode' not in already_processed:994 already_processed.add('minorErrorCode')995 showIndent(outfile, level)996 outfile.write('minorErrorCode="%s",\n' % (self.minorErrorCode,))997 if self.majorErrorCode is not None and 'majorErrorCode' not in already_processed:998 already_processed.add('majorErrorCode')999 showIndent(outfile, level)1000 outfile.write('majorErrorCode=%d,\n' % (self.majorErrorCode,))1001 super(ErrorType, self).exportLiteralAttributes(outfile, level, already_processed, name_)1002 def exportLiteralChildren(self, outfile, level, name_):1003 super(ErrorType, self).exportLiteralChildren(outfile, level, name_)1004 def build(self, node):1005 already_processed = set()1006 self.buildAttributes(node, node.attrib, already_processed)1007 for child in node:1008 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1009 self.buildChildren(child, node, nodeName_)1010 return self1011 def buildAttributes(self, node, attrs, already_processed):1012 value = find_attr_value_('vendorSpecificErrorCode', node)1013 if value is not None and 'vendorSpecificErrorCode' not in already_processed:1014 already_processed.add('vendorSpecificErrorCode')1015 self.vendorSpecificErrorCode = value1016 value = find_attr_value_('stackTrace', node)1017 if value is not None and 'stackTrace' not in already_processed:1018 already_processed.add('stackTrace')1019 self.stackTrace = value1020 value = find_attr_value_('message', node)1021 if value is not None and 'message' not in already_processed:1022 already_processed.add('message')1023 self.message = value1024 value = find_attr_value_('minorErrorCode', node)1025 if value is not None and 'minorErrorCode' not in already_processed:1026 already_processed.add('minorErrorCode')1027 self.minorErrorCode = value1028 value = find_attr_value_('majorErrorCode', node)1029 if value is not None and 'majorErrorCode' not in already_processed:1030 already_processed.add('majorErrorCode')1031 try:1032 self.majorErrorCode = int(value)1033 except ValueError, exp:1034 raise_parse_error(node, 'Bad integer attribute: %s' % exp)1035 super(ErrorType, self).buildAttributes(node, attrs, already_processed)1036 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1037 super(ErrorType, self).buildChildren(child_, node, nodeName_, True)1038 pass1039# end class ErrorType1040class ResourceType(VCloudExtensibleType):1041 """0.9 The base type for all objects in the vCloud model. Has an1042 optional list of links and href and type attributes. always The1043 URI of the entity. falsealways The MIME type of the entity.1044 false"""1045 subclass = None1046 superclass = VCloudExtensibleType1047 def __init__(self, VCloudExtension=None, href=None, type_=None, Link=None, extensiontype_=None):1048 self.original_tagname_ = None1049 super(ResourceType, self).__init__(VCloudExtension, extensiontype_, )1050 self.href = _cast(None, href)1051 self.type_ = _cast(None, type_)1052 if Link is None:1053 self.Link = []1054 else:1055 self.Link = Link1056 self.extensiontype_ = extensiontype_1057 def factory(*args_, **kwargs_):1058 if ResourceType.subclass:1059 return ResourceType.subclass(*args_, **kwargs_)1060 else:1061 return ResourceType(*args_, **kwargs_)1062 factory = staticmethod(factory)1063 def get_Link(self): return self.Link1064 def set_Link(self, Link): self.Link = Link1065 def add_Link(self, value): self.Link.append(value)1066 def insert_Link_at(self, index, value): self.Link.insert(index, value)1067 def replace_Link_at(self, index, value): self.Link[index] = value1068 def get_href(self): return self.href1069 def set_href(self, href): self.href = href1070 def get_type(self): return self.type_1071 def set_type(self, type_): self.type_ = type_1072 def get_extensiontype_(self): return self.extensiontype_1073 def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_1074 def hasContent_(self):1075 if (1076 self.Link or1077 super(ResourceType, self).hasContent_()1078 ):1079 return True1080 else:1081 return False1082 def export(self, outfile, level, namespace_='', name_='ResourceType', namespacedef_='', pretty_print=True):1083 if pretty_print:1084 eol_ = '\n'1085 else:1086 eol_ = ''1087 if self.original_tagname_ is not None:1088 name_ = self.original_tagname_1089 showIndent(outfile, level, pretty_print)1090 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1091 already_processed = set()1092 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ResourceType')1093 if self.hasContent_():1094 outfile.write('>%s' % (eol_, ))1095 self.exportChildren(outfile, level + 1, namespace_='', name_='ResourceType', pretty_print=pretty_print)1096 showIndent(outfile, level, pretty_print)1097 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))1098 else:1099 outfile.write('/>%s' % (eol_, ))1100 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ResourceType'):1101 super(ResourceType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='ResourceType')1102 if self.href is not None and 'href' not in already_processed:1103 already_processed.add('href')1104 outfile.write(' href=%s' % (self.gds_format_string(quote_attrib(self.href).encode(ExternalEncoding), input_name='href'), ))1105 if self.type_ is not None and 'type_' not in already_processed:1106 already_processed.add('type_')1107 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))1108 if self.extensiontype_ is not None and 'xsi:type' not in already_processed:1109 already_processed.add('xsi:type')1110 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')1111 outfile.write(' xsi:type="%s"' % self.extensiontype_)1112 def exportChildren(self, outfile, level, namespace_='', name_='ResourceType', fromsubclass_=False, pretty_print=True):1113 super(ResourceType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)1114 if pretty_print:1115 eol_ = '\n'1116 else:1117 eol_ = ''1118 for Link_ in self.Link:1119 Link_.export(outfile, level, namespace_, name_='Link', pretty_print=pretty_print)1120 def exportLiteral(self, outfile, level, name_='ResourceType'):1121 level += 11122 already_processed = set()1123 self.exportLiteralAttributes(outfile, level, already_processed, name_)1124 if self.hasContent_():1125 self.exportLiteralChildren(outfile, level, name_)1126 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1127 if self.href is not None and 'href' not in already_processed:1128 already_processed.add('href')1129 showIndent(outfile, level)1130 outfile.write('href="%s",\n' % (self.href,))1131 if self.type_ is not None and 'type_' not in already_processed:1132 already_processed.add('type_')1133 showIndent(outfile, level)1134 outfile.write('type_="%s",\n' % (self.type_,))1135 super(ResourceType, self).exportLiteralAttributes(outfile, level, already_processed, name_)1136 def exportLiteralChildren(self, outfile, level, name_):1137 super(ResourceType, self).exportLiteralChildren(outfile, level, name_)1138 showIndent(outfile, level)1139 outfile.write('Link=[\n')1140 level += 11141 for Link_ in self.Link:1142 showIndent(outfile, level)1143 outfile.write('model_.LinkType(\n')1144 Link_.exportLiteral(outfile, level, name_='LinkType')1145 showIndent(outfile, level)1146 outfile.write('),\n')1147 level -= 11148 showIndent(outfile, level)1149 outfile.write('],\n')1150 def build(self, node):1151 already_processed = set()1152 self.buildAttributes(node, node.attrib, already_processed)1153 for child in node:1154 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1155 self.buildChildren(child, node, nodeName_)1156 return self1157 def buildAttributes(self, node, attrs, already_processed):1158 value = find_attr_value_('href', node)1159 if value is not None and 'href' not in already_processed:1160 already_processed.add('href')1161 self.href = value1162 value = find_attr_value_('type', node)1163 if value is not None and 'type' not in already_processed:1164 already_processed.add('type')1165 self.type_ = value1166 value = find_attr_value_('xsi:type', node)1167 if value is not None and 'xsi:type' not in already_processed:1168 already_processed.add('xsi:type')1169 self.extensiontype_ = value1170 super(ResourceType, self).buildAttributes(node, attrs, already_processed)1171 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1172 if nodeName_ == 'Link':1173 obj_ = LinkType.factory()1174 obj_.build(child_)1175 self.Link.append(obj_)1176 obj_.original_tagname_ = 'Link'1177 super(ResourceType, self).buildChildren(child_, node, nodeName_, True)1178# end class ResourceType1179class IdentifiableResourceType(ResourceType):1180 """0.9 The base type for all resource types which contain an id1181 attribute. none The entity identifier, expressed in URN format.1182 The value of this attribute uniquely identifies the entity,1183 persists for the life of the entity, and is never reused.1184 falsecreate Optional unique identifier to support idempotent1185 semantics for create and delete operations. false"""1186 subclass = None1187 superclass = ResourceType1188 def __init__(self, VCloudExtension=None, href=None, type_=None, Link=None, operationKey=None, id=None, extensiontype_=None):1189 self.original_tagname_ = None1190 super(IdentifiableResourceType, self).__init__(VCloudExtension, href, type_, Link, extensiontype_, )1191 self.operationKey = _cast(None, operationKey)1192 self.id = _cast(None, id)1193 self.extensiontype_ = extensiontype_1194 def factory(*args_, **kwargs_):1195 if IdentifiableResourceType.subclass:1196 return IdentifiableResourceType.subclass(*args_, **kwargs_)1197 else:1198 return IdentifiableResourceType(*args_, **kwargs_)1199 factory = staticmethod(factory)1200 def get_operationKey(self): return self.operationKey1201 def set_operationKey(self, operationKey): self.operationKey = operationKey1202 def get_id(self): return self.id1203 def set_id(self, id): self.id = id1204 def get_extensiontype_(self): return self.extensiontype_1205 def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_1206 def hasContent_(self):1207 if (1208 super(IdentifiableResourceType, self).hasContent_()1209 ):1210 return True1211 else:1212 return False1213 def export(self, outfile, level, namespace_='', name_='IdentifiableResourceType', namespacedef_='', pretty_print=True):1214 if pretty_print:1215 eol_ = '\n'1216 else:1217 eol_ = ''1218 if self.original_tagname_ is not None:1219 name_ = self.original_tagname_1220 showIndent(outfile, level, pretty_print)1221 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1222 already_processed = set()1223 self.exportAttributes(outfile, level, already_processed, namespace_, name_='IdentifiableResourceType')1224 if self.hasContent_():1225 outfile.write('>%s' % (eol_, ))1226 self.exportChildren(outfile, level + 1, namespace_='', name_='IdentifiableResourceType', pretty_print=pretty_print)1227 showIndent(outfile, level, pretty_print)1228 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))1229 else:1230 outfile.write('/>%s' % (eol_, ))1231 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='IdentifiableResourceType'):1232 super(IdentifiableResourceType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='IdentifiableResourceType')1233 if self.operationKey is not None and 'operationKey' not in already_processed:1234 already_processed.add('operationKey')1235 outfile.write(' operationKey=%s' % (self.gds_format_string(quote_attrib(self.operationKey).encode(ExternalEncoding), input_name='operationKey'), ))1236 if self.id is not None and 'id' not in already_processed:1237 already_processed.add('id')1238 outfile.write(' id=%s' % (self.gds_format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))1239 if self.extensiontype_ is not None and 'xsi:type' not in already_processed:1240 already_processed.add('xsi:type')1241 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')1242 outfile.write(' xsi:type="%s"' % self.extensiontype_)1243 def exportChildren(self, outfile, level, namespace_='', name_='IdentifiableResourceType', fromsubclass_=False, pretty_print=True):1244 super(IdentifiableResourceType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)1245 def exportLiteral(self, outfile, level, name_='IdentifiableResourceType'):1246 level += 11247 already_processed = set()1248 self.exportLiteralAttributes(outfile, level, already_processed, name_)1249 if self.hasContent_():1250 self.exportLiteralChildren(outfile, level, name_)1251 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1252 if self.operationKey is not None and 'operationKey' not in already_processed:1253 already_processed.add('operationKey')1254 showIndent(outfile, level)1255 outfile.write('operationKey="%s",\n' % (self.operationKey,))1256 if self.id is not None and 'id' not in already_processed:1257 already_processed.add('id')1258 showIndent(outfile, level)1259 outfile.write('id="%s",\n' % (self.id,))1260 super(IdentifiableResourceType, self).exportLiteralAttributes(outfile, level, already_processed, name_)1261 def exportLiteralChildren(self, outfile, level, name_):1262 super(IdentifiableResourceType, self).exportLiteralChildren(outfile, level, name_)1263 def build(self, node):1264 already_processed = set()1265 self.buildAttributes(node, node.attrib, already_processed)1266 for child in node:1267 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1268 self.buildChildren(child, node, nodeName_)1269 return self1270 def buildAttributes(self, node, attrs, already_processed):1271 value = find_attr_value_('operationKey', node)1272 if value is not None and 'operationKey' not in already_processed:1273 already_processed.add('operationKey')1274 self.operationKey = value1275 value = find_attr_value_('id', node)1276 if value is not None and 'id' not in already_processed:1277 already_processed.add('id')1278 self.id = value1279 value = find_attr_value_('xsi:type', node)1280 if value is not None and 'xsi:type' not in already_processed:1281 already_processed.add('xsi:type')1282 self.extensiontype_ = value1283 super(IdentifiableResourceType, self).buildAttributes(node, attrs, already_processed)1284 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1285 super(IdentifiableResourceType, self).buildChildren(child_, node, nodeName_, True)1286 pass1287# end class IdentifiableResourceType1288class ParamsType(VCloudExtensibleType):1289 """0.9 A basic type used to specify request parameters. always1290 Typically used to name or identify the subject of the request.1291 For example, the name of the object being created or modified.1292 false"""1293 subclass = None1294 superclass = VCloudExtensibleType1295 def __init__(self, VCloudExtension=None, name=None, Description=None, extensiontype_=None):1296 self.original_tagname_ = None1297 super(ParamsType, self).__init__(VCloudExtension, extensiontype_, )1298 self.name = _cast(None, name)1299 self.Description = Description1300 self.extensiontype_ = extensiontype_1301 def factory(*args_, **kwargs_):1302 if ParamsType.subclass:1303 return ParamsType.subclass(*args_, **kwargs_)1304 else:1305 return ParamsType(*args_, **kwargs_)1306 factory = staticmethod(factory)1307 def get_Description(self): return self.Description1308 def set_Description(self, Description): self.Description = Description1309 def get_name(self): return self.name1310 def set_name(self, name): self.name = name1311 def get_extensiontype_(self): return self.extensiontype_1312 def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_1313 def hasContent_(self):1314 if (1315 self.Description is not None or1316 super(ParamsType, self).hasContent_()1317 ):1318 return True1319 else:1320 return False1321 def export(self, outfile, level, namespace_='', name_='ParamsType', namespacedef_='', pretty_print=True):1322 if pretty_print:1323 eol_ = '\n'1324 else:1325 eol_ = ''1326 if self.original_tagname_ is not None:1327 name_ = self.original_tagname_1328 showIndent(outfile, level, pretty_print)1329 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1330 already_processed = set()1331 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ParamsType')1332 if self.hasContent_():1333 outfile.write('>%s' % (eol_, ))1334 self.exportChildren(outfile, level + 1, namespace_='', name_='ParamsType', pretty_print=pretty_print)1335 showIndent(outfile, level, pretty_print)1336 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))1337 else:1338 outfile.write('/>%s' % (eol_, ))1339 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ParamsType'):1340 super(ParamsType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='ParamsType')1341 if self.name is not None and 'name' not in already_processed:1342 already_processed.add('name')1343 outfile.write(' name=%s' % (self.gds_format_string(quote_attrib(self.name).encode(ExternalEncoding), input_name='name'), ))1344 if self.extensiontype_ is not None and 'xsi:type' not in already_processed:1345 already_processed.add('xsi:type')1346 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')1347 outfile.write(' xsi:type="%s"' % self.extensiontype_)1348 def exportChildren(self, outfile, level, namespace_='', name_='ParamsType', fromsubclass_=False, pretty_print=True):1349 super(ParamsType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)1350 if pretty_print:1351 eol_ = '\n'1352 else:1353 eol_ = ''1354 if self.Description is not None:1355 showIndent(outfile, level, pretty_print)1356 outfile.write('<%sDescription>%s</%sDescription>%s' % (namespace_, self.gds_format_string(quote_xml(self.Description).encode(ExternalEncoding), input_name='Description'), namespace_, eol_))1357 def exportLiteral(self, outfile, level, name_='ParamsType'):1358 level += 11359 already_processed = set()1360 self.exportLiteralAttributes(outfile, level, already_processed, name_)1361 if self.hasContent_():1362 self.exportLiteralChildren(outfile, level, name_)1363 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1364 if self.name is not None and 'name' not in already_processed:1365 already_processed.add('name')1366 showIndent(outfile, level)1367 outfile.write('name="%s",\n' % (self.name,))1368 super(ParamsType, self).exportLiteralAttributes(outfile, level, already_processed, name_)1369 def exportLiteralChildren(self, outfile, level, name_):1370 super(ParamsType, self).exportLiteralChildren(outfile, level, name_)1371 if self.Description is not None:1372 showIndent(outfile, level)1373 outfile.write('Description=%s,\n' % quote_python(self.Description).encode(ExternalEncoding))1374 def build(self, node):1375 already_processed = set()1376 self.buildAttributes(node, node.attrib, already_processed)1377 for child in node:1378 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1379 self.buildChildren(child, node, nodeName_)1380 return self1381 def buildAttributes(self, node, attrs, already_processed):1382 value = find_attr_value_('name', node)1383 if value is not None and 'name' not in already_processed:1384 already_processed.add('name')1385 self.name = value1386 value = find_attr_value_('xsi:type', node)1387 if value is not None and 'xsi:type' not in already_processed:1388 already_processed.add('xsi:type')1389 self.extensiontype_ = value1390 super(ParamsType, self).buildAttributes(node, attrs, already_processed)1391 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1392 if nodeName_ == 'Description':1393 Description_ = child_.text1394 Description_ = self.gds_validate_string(Description_, node, 'Description')1395 self.Description = Description_1396 super(ParamsType, self).buildChildren(child_, node, nodeName_, True)1397# end class ParamsType1398class ReferenceType(VCloudExtensibleType):1399 """0.9 A reference to a resource. Contains an href attribute and1400 optional name and type attributes. always Contains the URI to1401 the entity. truealways The resource identifier, expressed in URN1402 format. The value of this attribute uniquely identifies the1403 resource, persists for the life of the resource, and is never1404 reused. falsealways Contains the type of the the entity.1405 falsealways Contains the name of the the entity. false"""1406 subclass = None1407 superclass = VCloudExtensibleType1408 def __init__(self, VCloudExtension=None, href=None, type_=None, id=None, name=None, extensiontype_=None):1409 self.original_tagname_ = None1410 super(ReferenceType, self).__init__(VCloudExtension, extensiontype_, )1411 self.href = _cast(None, href)1412 self.type_ = _cast(None, type_)1413 self.id = _cast(None, id)1414 self.name = _cast(None, name)1415 self.extensiontype_ = extensiontype_1416 def factory(*args_, **kwargs_):1417 if ReferenceType.subclass:1418 return ReferenceType.subclass(*args_, **kwargs_)1419 else:1420 return ReferenceType(*args_, **kwargs_)1421 factory = staticmethod(factory)1422 def get_href(self): return self.href1423 def set_href(self, href): self.href = href1424 def get_type(self): return self.type_1425 def set_type(self, type_): self.type_ = type_1426 def get_id(self): return self.id1427 def set_id(self, id): self.id = id1428 def get_name(self): return self.name1429 def set_name(self, name): self.name = name1430 def get_extensiontype_(self): return self.extensiontype_1431 def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_1432 def hasContent_(self):1433 if (1434 super(ReferenceType, self).hasContent_()1435 ):1436 return True1437 else:1438 return False1439 def export(self, outfile, level, namespace_='', name_='ReferenceType', namespacedef_='', pretty_print=True):1440 if pretty_print:1441 eol_ = '\n'1442 else:1443 eol_ = ''1444 if self.original_tagname_ is not None:1445 name_ = self.original_tagname_1446 showIndent(outfile, level, pretty_print)1447 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1448 already_processed = set()1449 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ReferenceType')1450 if self.hasContent_():1451 outfile.write('>%s' % (eol_, ))1452 self.exportChildren(outfile, level + 1, namespace_='', name_='ReferenceType', pretty_print=pretty_print)1453 showIndent(outfile, level, pretty_print)1454 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))1455 else:1456 outfile.write('/>%s' % (eol_, ))1457 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ReferenceType'):1458 super(ReferenceType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='ReferenceType')1459 if self.href is not None and 'href' not in already_processed:1460 already_processed.add('href')1461 outfile.write(' href=%s' % (self.gds_format_string(quote_attrib(self.href).encode(ExternalEncoding), input_name='href'), ))1462 if self.type_ is not None and 'type_' not in already_processed:1463 already_processed.add('type_')1464 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))1465 if self.id is not None and 'id' not in already_processed:1466 already_processed.add('id')1467 outfile.write(' id=%s' % (self.gds_format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))1468 if self.name is not None and 'name' not in already_processed:1469 already_processed.add('name')1470 outfile.write(' name=%s' % (self.gds_format_string(quote_attrib(self.name).encode(ExternalEncoding), input_name='name'), ))1471 if self.extensiontype_ is not None and 'xsi:type' not in already_processed:1472 already_processed.add('xsi:type')1473 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')1474 outfile.write(' xsi:type="%s"' % self.extensiontype_)1475 def exportChildren(self, outfile, level, namespace_='', name_='ReferenceType', fromsubclass_=False, pretty_print=True):1476 super(ReferenceType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)1477 def exportLiteral(self, outfile, level, name_='ReferenceType'):1478 level += 11479 already_processed = set()1480 self.exportLiteralAttributes(outfile, level, already_processed, name_)1481 if self.hasContent_():1482 self.exportLiteralChildren(outfile, level, name_)1483 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1484 if self.href is not None and 'href' not in already_processed:1485 already_processed.add('href')1486 showIndent(outfile, level)1487 outfile.write('href="%s",\n' % (self.href,))1488 if self.type_ is not None and 'type_' not in already_processed:1489 already_processed.add('type_')1490 showIndent(outfile, level)1491 outfile.write('type_="%s",\n' % (self.type_,))1492 if self.id is not None and 'id' not in already_processed:1493 already_processed.add('id')1494 showIndent(outfile, level)1495 outfile.write('id="%s",\n' % (self.id,))1496 if self.name is not None and 'name' not in already_processed:1497 already_processed.add('name')1498 showIndent(outfile, level)1499 outfile.write('name="%s",\n' % (self.name,))1500 super(ReferenceType, self).exportLiteralAttributes(outfile, level, already_processed, name_)1501 def exportLiteralChildren(self, outfile, level, name_):1502 super(ReferenceType, self).exportLiteralChildren(outfile, level, name_)1503 def build(self, node):1504 already_processed = set()1505 self.buildAttributes(node, node.attrib, already_processed)1506 for child in node:1507 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1508 self.buildChildren(child, node, nodeName_)1509 return self1510 def buildAttributes(self, node, attrs, already_processed):1511 value = find_attr_value_('href', node)1512 if value is not None and 'href' not in already_processed:1513 already_processed.add('href')1514 self.href = value1515 value = find_attr_value_('type', node)1516 if value is not None and 'type' not in already_processed:1517 already_processed.add('type')1518 self.type_ = value1519 value = find_attr_value_('id', node)1520 if value is not None and 'id' not in already_processed:1521 already_processed.add('id')1522 self.id = value1523 value = find_attr_value_('name', node)1524 if value is not None and 'name' not in already_processed:1525 already_processed.add('name')1526 self.name = value1527 value = find_attr_value_('xsi:type', node)1528 if value is not None and 'xsi:type' not in already_processed:1529 already_processed.add('xsi:type')1530 self.extensiontype_ = value1531 super(ReferenceType, self).buildAttributes(node, attrs, already_processed)1532 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1533 super(ReferenceType, self).buildChildren(child_, node, nodeName_, True)1534 pass1535# end class ReferenceType1536class ResourceReferenceType(ReferenceType):1537 """0.9 Represents a reference to a resource. Contains an href1538 attribute, a resource status attribute, and optional name and1539 type attributes. none Status of a resource. false"""1540 subclass = None1541 superclass = ReferenceType1542 def __init__(self, VCloudExtension=None, href=None, type_=None, id=None, name=None, status=None):1543 self.original_tagname_ = None1544 super(ResourceReferenceType, self).__init__(VCloudExtension, href, type_, id, name, )1545 self.status = _cast(int, status)1546 def factory(*args_, **kwargs_):1547 if ResourceReferenceType.subclass:1548 return ResourceReferenceType.subclass(*args_, **kwargs_)1549 else:1550 return ResourceReferenceType(*args_, **kwargs_)1551 factory = staticmethod(factory)1552 def get_status(self): return self.status1553 def set_status(self, status): self.status = status1554 def hasContent_(self):1555 if (1556 super(ResourceReferenceType, self).hasContent_()1557 ):1558 return True1559 else:1560 return False1561 def export(self, outfile, level, namespace_='', name_='ResourceReferenceType', namespacedef_='', pretty_print=True):1562 if pretty_print:1563 eol_ = '\n'1564 else:1565 eol_ = ''1566 if self.original_tagname_ is not None:1567 name_ = self.original_tagname_1568 showIndent(outfile, level, pretty_print)1569 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1570 already_processed = set()1571 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ResourceReferenceType')1572 if self.hasContent_():1573 outfile.write('>%s' % (eol_, ))1574 self.exportChildren(outfile, level + 1, namespace_='', name_='ResourceReferenceType', pretty_print=pretty_print)1575 showIndent(outfile, level, pretty_print)1576 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))1577 else:1578 outfile.write('/>%s' % (eol_, ))1579 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ResourceReferenceType'):1580 super(ResourceReferenceType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='ResourceReferenceType')1581 if self.status is not None and 'status' not in already_processed:1582 already_processed.add('status')1583 outfile.write(' status="%s"' % self.gds_format_integer(self.status, input_name='status'))1584 def exportChildren(self, outfile, level, namespace_='', name_='ResourceReferenceType', fromsubclass_=False, pretty_print=True):1585 super(ResourceReferenceType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)1586 def exportLiteral(self, outfile, level, name_='ResourceReferenceType'):1587 level += 11588 already_processed = set()1589 self.exportLiteralAttributes(outfile, level, already_processed, name_)1590 if self.hasContent_():1591 self.exportLiteralChildren(outfile, level, name_)1592 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1593 if self.status is not None and 'status' not in already_processed:1594 already_processed.add('status')1595 showIndent(outfile, level)1596 outfile.write('status=%d,\n' % (self.status,))1597 super(ResourceReferenceType, self).exportLiteralAttributes(outfile, level, already_processed, name_)1598 def exportLiteralChildren(self, outfile, level, name_):1599 super(ResourceReferenceType, self).exportLiteralChildren(outfile, level, name_)1600 def build(self, node):1601 already_processed = set()1602 self.buildAttributes(node, node.attrib, already_processed)1603 for child in node:1604 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1605 self.buildChildren(child, node, nodeName_)1606 return self1607 def buildAttributes(self, node, attrs, already_processed):1608 value = find_attr_value_('status', node)1609 if value is not None and 'status' not in already_processed:1610 already_processed.add('status')1611 try:1612 self.status = int(value)1613 except ValueError, exp:1614 raise_parse_error(node, 'Bad integer attribute: %s' % exp)1615 super(ResourceReferenceType, self).buildAttributes(node, attrs, already_processed)1616 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1617 super(ResourceReferenceType, self).buildChildren(child_, node, nodeName_, True)1618 pass1619# end class ResourceReferenceType1620class ContainerType(ResourceType):1621 """Container for query result sets. none Query name that generated this1622 result set. falsenone Page of the result set that this container1623 holds. The first page is page number 1. falsenone Page size, as1624 a number of records or references. falsenone Total number of1625 records or references in the container. false"""1626 subclass = None1627 superclass = ResourceType1628 def __init__(self, VCloudExtension=None, href=None, type_=None, Link=None, total=None, name=None, pageSize=None, page=None, extensiontype_=None):1629 self.original_tagname_ = None1630 super(ContainerType, self).__init__(VCloudExtension, href, type_, Link, extensiontype_, )1631 self.total = _cast(int, total)1632 self.name = _cast(None, name)1633 self.pageSize = _cast(int, pageSize)1634 self.page = _cast(int, page)1635 self.extensiontype_ = extensiontype_1636 def factory(*args_, **kwargs_):1637 if ContainerType.subclass:1638 return ContainerType.subclass(*args_, **kwargs_)1639 else:1640 return ContainerType(*args_, **kwargs_)1641 factory = staticmethod(factory)1642 def get_total(self): return self.total1643 def set_total(self, total): self.total = total1644 def get_name(self): return self.name1645 def set_name(self, name): self.name = name1646 def get_pageSize(self): return self.pageSize1647 def set_pageSize(self, pageSize): self.pageSize = pageSize1648 def get_page(self): return self.page1649 def set_page(self, page): self.page = page1650 def get_extensiontype_(self): return self.extensiontype_1651 def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_1652 def hasContent_(self):1653 if (1654 super(ContainerType, self).hasContent_()1655 ):1656 return True1657 else:1658 return False1659 def export(self, outfile, level, namespace_='', name_='ContainerType', namespacedef_='', pretty_print=True):1660 if pretty_print:1661 eol_ = '\n'1662 else:1663 eol_ = ''1664 if self.original_tagname_ is not None:1665 name_ = self.original_tagname_1666 showIndent(outfile, level, pretty_print)1667 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1668 already_processed = set()1669 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ContainerType')1670 if self.hasContent_():1671 outfile.write('>%s' % (eol_, ))1672 self.exportChildren(outfile, level + 1, namespace_='', name_='ContainerType', pretty_print=pretty_print)1673 showIndent(outfile, level, pretty_print)1674 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))1675 else:1676 outfile.write('/>%s' % (eol_, ))1677 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ContainerType'):1678 super(ContainerType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='ContainerType')1679 if self.total is not None and 'total' not in already_processed:1680 already_processed.add('total')1681 outfile.write(' total="%s"' % self.gds_format_integer(self.total, input_name='total'))1682 if self.name is not None and 'name' not in already_processed:1683 already_processed.add('name')1684 outfile.write(' name=%s' % (self.gds_format_string(quote_attrib(self.name).encode(ExternalEncoding), input_name='name'), ))1685 if self.pageSize is not None and 'pageSize' not in already_processed:1686 already_processed.add('pageSize')1687 outfile.write(' pageSize="%s"' % self.gds_format_integer(self.pageSize, input_name='pageSize'))1688 if self.page is not None and 'page' not in already_processed:1689 already_processed.add('page')1690 outfile.write(' page="%s"' % self.gds_format_integer(self.page, input_name='page'))1691 if self.extensiontype_ is not None and 'xsi:type' not in already_processed:1692 already_processed.add('xsi:type')1693 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')1694 outfile.write(' xsi:type="%s"' % self.extensiontype_)1695 def exportChildren(self, outfile, level, namespace_='', name_='ContainerType', fromsubclass_=False, pretty_print=True):1696 super(ContainerType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)1697 def exportLiteral(self, outfile, level, name_='ContainerType'):1698 level += 11699 already_processed = set()1700 self.exportLiteralAttributes(outfile, level, already_processed, name_)1701 if self.hasContent_():1702 self.exportLiteralChildren(outfile, level, name_)1703 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1704 if self.total is not None and 'total' not in already_processed:1705 already_processed.add('total')1706 showIndent(outfile, level)1707 outfile.write('total=%d,\n' % (self.total,))1708 if self.name is not None and 'name' not in already_processed:1709 already_processed.add('name')1710 showIndent(outfile, level)1711 outfile.write('name="%s",\n' % (self.name,))1712 if self.pageSize is not None and 'pageSize' not in already_processed:1713 already_processed.add('pageSize')1714 showIndent(outfile, level)1715 outfile.write('pageSize=%d,\n' % (self.pageSize,))1716 if self.page is not None and 'page' not in already_processed:1717 already_processed.add('page')1718 showIndent(outfile, level)1719 outfile.write('page=%d,\n' % (self.page,))1720 super(ContainerType, self).exportLiteralAttributes(outfile, level, already_processed, name_)1721 def exportLiteralChildren(self, outfile, level, name_):1722 super(ContainerType, self).exportLiteralChildren(outfile, level, name_)1723 def build(self, node):1724 already_processed = set()1725 self.buildAttributes(node, node.attrib, already_processed)1726 for child in node:1727 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1728 self.buildChildren(child, node, nodeName_)1729 return self1730 def buildAttributes(self, node, attrs, already_processed):1731 value = find_attr_value_('total', node)1732 if value is not None and 'total' not in already_processed:1733 already_processed.add('total')1734 try:1735 self.total = int(value)1736 except ValueError, exp:1737 raise_parse_error(node, 'Bad integer attribute: %s' % exp)1738 value = find_attr_value_('name', node)1739 if value is not None and 'name' not in already_processed:1740 already_processed.add('name')1741 self.name = value1742 value = find_attr_value_('pageSize', node)1743 if value is not None and 'pageSize' not in already_processed:1744 already_processed.add('pageSize')1745 try:1746 self.pageSize = int(value)1747 except ValueError, exp:1748 raise_parse_error(node, 'Bad integer attribute: %s' % exp)1749 value = find_attr_value_('page', node)1750 if value is not None and 'page' not in already_processed:1751 already_processed.add('page')1752 try:1753 self.page = int(value)1754 except ValueError, exp:1755 raise_parse_error(node, 'Bad integer attribute: %s' % exp)1756 value = find_attr_value_('xsi:type', node)1757 if value is not None and 'xsi:type' not in already_processed:1758 already_processed.add('xsi:type')1759 self.extensiontype_ = value1760 super(ContainerType, self).buildAttributes(node, attrs, already_processed)1761 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1762 super(ContainerType, self).buildChildren(child_, node, nodeName_, True)1763 pass1764# end class ContainerType1765class CapacityType(VCloudExtensibleType):1766 """0.9 Represents the capacity of a given resource."""1767 subclass = None1768 superclass = VCloudExtensibleType1769 def __init__(self, VCloudExtension=None, Units=None, Allocated=None, Limit=None, extensiontype_=None):1770 self.original_tagname_ = None1771 super(CapacityType, self).__init__(VCloudExtension, extensiontype_, )1772 self.Units = Units1773 self.Allocated = Allocated1774 self.Limit = Limit1775 self.extensiontype_ = extensiontype_1776 def factory(*args_, **kwargs_):1777 if CapacityType.subclass:1778 return CapacityType.subclass(*args_, **kwargs_)1779 else:1780 return CapacityType(*args_, **kwargs_)1781 factory = staticmethod(factory)1782 def get_Units(self): return self.Units1783 def set_Units(self, Units): self.Units = Units1784 def get_Allocated(self): return self.Allocated1785 def set_Allocated(self, Allocated): self.Allocated = Allocated1786 def get_Limit(self): return self.Limit1787 def set_Limit(self, Limit): self.Limit = Limit1788 def get_extensiontype_(self): return self.extensiontype_1789 def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_1790 def hasContent_(self):1791 if (1792 self.Units is not None or1793 self.Allocated is not None or1794 self.Limit is not None or1795 super(CapacityType, self).hasContent_()1796 ):1797 return True1798 else:1799 return False1800 def export(self, outfile, level, namespace_='', name_='CapacityType', namespacedef_='', pretty_print=True):1801 if pretty_print:1802 eol_ = '\n'1803 else:1804 eol_ = ''1805 if self.original_tagname_ is not None:1806 name_ = self.original_tagname_1807 showIndent(outfile, level, pretty_print)1808 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1809 already_processed = set()1810 self.exportAttributes(outfile, level, already_processed, namespace_, name_='CapacityType')1811 if self.hasContent_():1812 outfile.write('>%s' % (eol_, ))1813 self.exportChildren(outfile, level + 1, namespace_='', name_='CapacityType', pretty_print=pretty_print)1814 showIndent(outfile, level, pretty_print)1815 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))1816 else:1817 outfile.write('/>%s' % (eol_, ))1818 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='CapacityType'):1819 super(CapacityType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='CapacityType')1820 if self.extensiontype_ is not None and 'xsi:type' not in already_processed:1821 already_processed.add('xsi:type')1822 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')1823 outfile.write(' xsi:type="%s"' % self.extensiontype_)1824 def exportChildren(self, outfile, level, namespace_='', name_='CapacityType', fromsubclass_=False, pretty_print=True):1825 super(CapacityType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)1826 if pretty_print:1827 eol_ = '\n'1828 else:1829 eol_ = ''1830 if self.Units is not None:1831 showIndent(outfile, level, pretty_print)1832 outfile.write('<%sUnits>%s</%sUnits>%s' % (namespace_, self.gds_format_string(quote_xml(self.Units).encode(ExternalEncoding), input_name='Units'), namespace_, eol_))1833 if self.Allocated is not None:1834 showIndent(outfile, level, pretty_print)1835 outfile.write('<%sAllocated>%s</%sAllocated>%s' % (namespace_, self.gds_format_integer(self.Allocated, input_name='Allocated'), namespace_, eol_))1836 if self.Limit is not None:1837 showIndent(outfile, level, pretty_print)1838 outfile.write('<%sLimit>%s</%sLimit>%s' % (namespace_, self.gds_format_integer(self.Limit, input_name='Limit'), namespace_, eol_))1839 def exportLiteral(self, outfile, level, name_='CapacityType'):1840 level += 11841 already_processed = set()1842 self.exportLiteralAttributes(outfile, level, already_processed, name_)1843 if self.hasContent_():1844 self.exportLiteralChildren(outfile, level, name_)1845 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1846 super(CapacityType, self).exportLiteralAttributes(outfile, level, already_processed, name_)1847 def exportLiteralChildren(self, outfile, level, name_):1848 super(CapacityType, self).exportLiteralChildren(outfile, level, name_)1849 if self.Units is not None:1850 showIndent(outfile, level)1851 outfile.write('Units=%s,\n' % quote_python(self.Units).encode(ExternalEncoding))1852 if self.Allocated is not None:1853 showIndent(outfile, level)1854 outfile.write('Allocated=%d,\n' % self.Allocated)1855 if self.Limit is not None:1856 showIndent(outfile, level)1857 outfile.write('Limit=%d,\n' % self.Limit)1858 def build(self, node):1859 already_processed = set()1860 self.buildAttributes(node, node.attrib, already_processed)1861 for child in node:1862 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1863 self.buildChildren(child, node, nodeName_)1864 return self1865 def buildAttributes(self, node, attrs, already_processed):1866 value = find_attr_value_('xsi:type', node)1867 if value is not None and 'xsi:type' not in already_processed:1868 already_processed.add('xsi:type')1869 self.extensiontype_ = value1870 super(CapacityType, self).buildAttributes(node, attrs, already_processed)1871 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1872 if nodeName_ == 'Units':1873 Units_ = child_.text1874 Units_ = self.gds_validate_string(Units_, node, 'Units')1875 self.Units = Units_1876 elif nodeName_ == 'Allocated':1877 sval_ = child_.text1878 try:1879 ival_ = int(sval_)1880 except (TypeError, ValueError), exp:1881 raise_parse_error(child_, 'requires integer: %s' % exp)1882 ival_ = self.gds_validate_integer(ival_, node, 'Allocated')1883 self.Allocated = ival_1884 elif nodeName_ == 'Limit':1885 sval_ = child_.text1886 try:1887 ival_ = int(sval_)1888 except (TypeError, ValueError), exp:1889 raise_parse_error(child_, 'requires integer: %s' % exp)1890 ival_ = self.gds_validate_integer(ival_, node, 'Limit')1891 self.Limit = ival_1892 super(CapacityType, self).buildChildren(child_, node, nodeName_, True)1893# end class CapacityType1894class CapacityWithUsageType(CapacityType):1895 """0.9 Represents a capacity and usage of a given resource."""1896 subclass = None1897 superclass = CapacityType1898 def __init__(self, VCloudExtension=None, Units=None, Allocated=None, Limit=None, Reserved=None, Used=None, Overhead=None):1899 self.original_tagname_ = None1900 super(CapacityWithUsageType, self).__init__(VCloudExtension, Units, Allocated, Limit, )1901 self.Reserved = Reserved1902 self.Used = Used1903 self.Overhead = Overhead1904 def factory(*args_, **kwargs_):1905 if CapacityWithUsageType.subclass:1906 return CapacityWithUsageType.subclass(*args_, **kwargs_)1907 else:1908 return CapacityWithUsageType(*args_, **kwargs_)1909 factory = staticmethod(factory)1910 def get_Reserved(self): return self.Reserved1911 def set_Reserved(self, Reserved): self.Reserved = Reserved1912 def get_Used(self): return self.Used1913 def set_Used(self, Used): self.Used = Used1914 def get_Overhead(self): return self.Overhead1915 def set_Overhead(self, Overhead): self.Overhead = Overhead1916 def hasContent_(self):1917 if (1918 self.Reserved is not None or1919 self.Used is not None or1920 self.Overhead is not None or1921 super(CapacityWithUsageType, self).hasContent_()1922 ):1923 return True1924 else:1925 return False1926 def export(self, outfile, level, namespace_='', name_='CapacityWithUsageType', namespacedef_='', pretty_print=True):1927 if pretty_print:1928 eol_ = '\n'1929 else:1930 eol_ = ''1931 if self.original_tagname_ is not None:1932 name_ = self.original_tagname_1933 showIndent(outfile, level, pretty_print)1934 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1935 already_processed = set()1936 self.exportAttributes(outfile, level, already_processed, namespace_, name_='CapacityWithUsageType')1937 if self.hasContent_():1938 outfile.write('>%s' % (eol_, ))1939 self.exportChildren(outfile, level + 1, namespace_='', name_='CapacityWithUsageType', pretty_print=pretty_print)1940 showIndent(outfile, level, pretty_print)1941 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))1942 else:1943 outfile.write('/>%s' % (eol_, ))1944 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='CapacityWithUsageType'):1945 super(CapacityWithUsageType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='CapacityWithUsageType')1946 def exportChildren(self, outfile, level, namespace_='', name_='CapacityWithUsageType', fromsubclass_=False, pretty_print=True):1947 super(CapacityWithUsageType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)1948 if pretty_print:1949 eol_ = '\n'1950 else:1951 eol_ = ''1952 if self.Reserved is not None:1953 showIndent(outfile, level, pretty_print)1954 outfile.write('<%sReserved>%s</%sReserved>%s' % (namespace_, self.gds_format_integer(self.Reserved, input_name='Reserved'), namespace_, eol_))1955 if self.Used is not None:1956 showIndent(outfile, level, pretty_print)1957 outfile.write('<%sUsed>%s</%sUsed>%s' % (namespace_, self.gds_format_integer(self.Used, input_name='Used'), namespace_, eol_))1958 if self.Overhead is not None:1959 showIndent(outfile, level, pretty_print)1960 outfile.write('<%sOverhead>%s</%sOverhead>%s' % (namespace_, self.gds_format_integer(self.Overhead, input_name='Overhead'), namespace_, eol_))1961 def exportLiteral(self, outfile, level, name_='CapacityWithUsageType'):1962 level += 11963 already_processed = set()1964 self.exportLiteralAttributes(outfile, level, already_processed, name_)1965 if self.hasContent_():1966 self.exportLiteralChildren(outfile, level, name_)1967 def exportLiteralAttributes(self, outfile, level, already_processed, name_):1968 super(CapacityWithUsageType, self).exportLiteralAttributes(outfile, level, already_processed, name_)1969 def exportLiteralChildren(self, outfile, level, name_):1970 super(CapacityWithUsageType, self).exportLiteralChildren(outfile, level, name_)1971 if self.Reserved is not None:1972 showIndent(outfile, level)1973 outfile.write('Reserved=%d,\n' % self.Reserved)1974 if self.Used is not None:1975 showIndent(outfile, level)1976 outfile.write('Used=%d,\n' % self.Used)1977 if self.Overhead is not None:1978 showIndent(outfile, level)1979 outfile.write('Overhead=%d,\n' % self.Overhead)1980 def build(self, node):1981 already_processed = set()1982 self.buildAttributes(node, node.attrib, already_processed)1983 for child in node:1984 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1985 self.buildChildren(child, node, nodeName_)1986 return self1987 def buildAttributes(self, node, attrs, already_processed):1988 super(CapacityWithUsageType, self).buildAttributes(node, attrs, already_processed)1989 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1990 if nodeName_ == 'Reserved':1991 sval_ = child_.text1992 try:1993 ival_ = int(sval_)1994 except (TypeError, ValueError), exp:1995 raise_parse_error(child_, 'requires integer: %s' % exp)1996 ival_ = self.gds_validate_integer(ival_, node, 'Reserved')1997 self.Reserved = ival_1998 elif nodeName_ == 'Used':1999 sval_ = child_.text2000 try:2001 ival_ = int(sval_)2002 except (TypeError, ValueError), exp:2003 raise_parse_error(child_, 'requires integer: %s' % exp)2004 ival_ = self.gds_validate_integer(ival_, node, 'Used')2005 self.Used = ival_2006 elif nodeName_ == 'Overhead':2007 sval_ = child_.text2008 try:2009 ival_ = int(sval_)2010 except (TypeError, ValueError), exp:2011 raise_parse_error(child_, 'requires integer: %s' % exp)2012 ival_ = self.gds_validate_integer(ival_, node, 'Overhead')2013 self.Overhead = ival_2014 super(CapacityWithUsageType, self).buildChildren(child_, node, nodeName_, True)2015# end class CapacityWithUsageType2016class AccessSettingType(VCloudExtensibleType):2017 """0.9 Controls access to the resource."""2018 subclass = None2019 superclass = VCloudExtensibleType2020 def __init__(self, VCloudExtension=None, Subject=None, AccessLevel=None):2021 self.original_tagname_ = None2022 super(AccessSettingType, self).__init__(VCloudExtension, )2023 self.Subject = Subject2024 self.AccessLevel = AccessLevel2025 def factory(*args_, **kwargs_):2026 if AccessSettingType.subclass:2027 return AccessSettingType.subclass(*args_, **kwargs_)2028 else:2029 return AccessSettingType(*args_, **kwargs_)2030 factory = staticmethod(factory)2031 def get_Subject(self): return self.Subject2032 def set_Subject(self, Subject): self.Subject = Subject2033 def get_AccessLevel(self): return self.AccessLevel2034 def set_AccessLevel(self, AccessLevel): self.AccessLevel = AccessLevel2035 def hasContent_(self):2036 if (2037 self.Subject is not None or2038 self.AccessLevel is not None or2039 super(AccessSettingType, self).hasContent_()2040 ):2041 return True2042 else:2043 return False2044 def export(self, outfile, level, namespace_='', name_='AccessSettingType', namespacedef_='', pretty_print=True):2045 if pretty_print:2046 eol_ = '\n'2047 else:2048 eol_ = ''2049 if self.original_tagname_ is not None:2050 name_ = self.original_tagname_2051 showIndent(outfile, level, pretty_print)2052 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))2053 already_processed = set()2054 self.exportAttributes(outfile, level, already_processed, namespace_, name_='AccessSettingType')2055 if self.hasContent_():2056 outfile.write('>%s' % (eol_, ))2057 self.exportChildren(outfile, level + 1, namespace_='', name_='AccessSettingType', pretty_print=pretty_print)2058 showIndent(outfile, level, pretty_print)2059 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))2060 else:2061 outfile.write('/>%s' % (eol_, ))2062 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='AccessSettingType'):2063 super(AccessSettingType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='AccessSettingType')2064 def exportChildren(self, outfile, level, namespace_='', name_='AccessSettingType', fromsubclass_=False, pretty_print=True):2065 super(AccessSettingType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)2066 if pretty_print:2067 eol_ = '\n'2068 else:2069 eol_ = ''2070 if self.Subject is not None:2071 self.Subject.export(outfile, level, namespace_, name_='Subject', pretty_print=pretty_print)2072 if self.AccessLevel is not None:2073 showIndent(outfile, level, pretty_print)2074 outfile.write('<%sAccessLevel>%s</%sAccessLevel>%s' % (namespace_, self.gds_format_string(quote_xml(self.AccessLevel).encode(ExternalEncoding), input_name='AccessLevel'), namespace_, eol_))2075 def exportLiteral(self, outfile, level, name_='AccessSettingType'):2076 level += 12077 already_processed = set()2078 self.exportLiteralAttributes(outfile, level, already_processed, name_)2079 if self.hasContent_():2080 self.exportLiteralChildren(outfile, level, name_)2081 def exportLiteralAttributes(self, outfile, level, already_processed, name_):2082 super(AccessSettingType, self).exportLiteralAttributes(outfile, level, already_processed, name_)2083 def exportLiteralChildren(self, outfile, level, name_):2084 super(AccessSettingType, self).exportLiteralChildren(outfile, level, name_)2085 if self.Subject is not None:2086 showIndent(outfile, level)2087 outfile.write('Subject=model_.ReferenceType(\n')2088 self.Subject.exportLiteral(outfile, level, name_='Subject')2089 showIndent(outfile, level)2090 outfile.write('),\n')2091 if self.AccessLevel is not None:2092 showIndent(outfile, level)2093 outfile.write('AccessLevel=%s,\n' % quote_python(self.AccessLevel).encode(ExternalEncoding))2094 def build(self, node):2095 already_processed = set()2096 self.buildAttributes(node, node.attrib, already_processed)2097 for child in node:2098 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]2099 self.buildChildren(child, node, nodeName_)2100 return self2101 def buildAttributes(self, node, attrs, already_processed):2102 super(AccessSettingType, self).buildAttributes(node, attrs, already_processed)2103 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):2104 if nodeName_ == 'Subject':2105 class_obj_ = self.get_class_obj_(child_, ReferenceType)2106 obj_ = class_obj_.factory()2107 obj_.build(child_)2108 self.Subject = obj_2109 obj_.original_tagname_ = 'Subject'2110 elif nodeName_ == 'AccessLevel':2111 AccessLevel_ = child_.text2112 AccessLevel_ = self.gds_validate_string(AccessLevel_, node, 'AccessLevel')2113 self.AccessLevel = AccessLevel_2114 super(AccessSettingType, self).buildChildren(child_, node, nodeName_, True)2115# end class AccessSettingType2116class AccessSettingsType(VCloudExtensibleType):2117 """0.9 A list of access settings for a resource."""2118 subclass = None2119 superclass = VCloudExtensibleType2120 def __init__(self, VCloudExtension=None, AccessSetting=None):2121 self.original_tagname_ = None2122 super(AccessSettingsType, self).__init__(VCloudExtension, )2123 if AccessSetting is None:2124 self.AccessSetting = []2125 else:2126 self.AccessSetting = AccessSetting2127 def factory(*args_, **kwargs_):2128 if AccessSettingsType.subclass:2129 return AccessSettingsType.subclass(*args_, **kwargs_)2130 else:2131 return AccessSettingsType(*args_, **kwargs_)2132 factory = staticmethod(factory)2133 def get_AccessSetting(self): return self.AccessSetting2134 def set_AccessSetting(self, AccessSetting): self.AccessSetting = AccessSetting2135 def add_AccessSetting(self, value): self.AccessSetting.append(value)2136 def insert_AccessSetting_at(self, index, value): self.AccessSetting.insert(index, value)2137 def replace_AccessSetting_at(self, index, value): self.AccessSetting[index] = value2138 def hasContent_(self):2139 if (2140 self.AccessSetting or2141 super(AccessSettingsType, self).hasContent_()2142 ):2143 return True2144 else:2145 return False2146 def export(self, outfile, level, namespace_='', name_='AccessSettingsType', namespacedef_='', pretty_print=True):2147 if pretty_print:2148 eol_ = '\n'2149 else:2150 eol_ = ''2151 if self.original_tagname_ is not None:2152 name_ = self.original_tagname_2153 showIndent(outfile, level, pretty_print)2154 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))2155 already_processed = set()2156 self.exportAttributes(outfile, level, already_processed, namespace_, name_='AccessSettingsType')2157 if self.hasContent_():2158 outfile.write('>%s' % (eol_, ))2159 self.exportChildren(outfile, level + 1, namespace_='', name_='AccessSettingsType', pretty_print=pretty_print)2160 showIndent(outfile, level, pretty_print)2161 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))2162 else:2163 outfile.write('/>%s' % (eol_, ))2164 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='AccessSettingsType'):2165 super(AccessSettingsType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='AccessSettingsType')2166 def exportChildren(self, outfile, level, namespace_='', name_='AccessSettingsType', fromsubclass_=False, pretty_print=True):2167 super(AccessSettingsType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)2168 if pretty_print:2169 eol_ = '\n'2170 else:2171 eol_ = ''2172 for AccessSetting_ in self.AccessSetting:2173 AccessSetting_.export(outfile, level, namespace_, name_='AccessSetting', pretty_print=pretty_print)2174 def exportLiteral(self, outfile, level, name_='AccessSettingsType'):2175 level += 12176 already_processed = set()2177 self.exportLiteralAttributes(outfile, level, already_processed, name_)2178 if self.hasContent_():2179 self.exportLiteralChildren(outfile, level, name_)2180 def exportLiteralAttributes(self, outfile, level, already_processed, name_):2181 super(AccessSettingsType, self).exportLiteralAttributes(outfile, level, already_processed, name_)2182 def exportLiteralChildren(self, outfile, level, name_):2183 super(AccessSettingsType, self).exportLiteralChildren(outfile, level, name_)2184 showIndent(outfile, level)2185 outfile.write('AccessSetting=[\n')2186 level += 12187 for AccessSetting_ in self.AccessSetting:2188 showIndent(outfile, level)2189 outfile.write('model_.AccessSettingType(\n')2190 AccessSetting_.exportLiteral(outfile, level, name_='AccessSettingType')2191 showIndent(outfile, level)2192 outfile.write('),\n')2193 level -= 12194 showIndent(outfile, level)2195 outfile.write('],\n')2196 def build(self, node):2197 already_processed = set()2198 self.buildAttributes(node, node.attrib, already_processed)2199 for child in node:2200 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]2201 self.buildChildren(child, node, nodeName_)2202 return self2203 def buildAttributes(self, node, attrs, already_processed):2204 super(AccessSettingsType, self).buildAttributes(node, attrs, already_processed)2205 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):2206 if nodeName_ == 'AccessSetting':2207 obj_ = AccessSettingType.factory()2208 obj_.build(child_)2209 self.AccessSetting.append(obj_)2210 obj_.original_tagname_ = 'AccessSetting'2211 super(AccessSettingsType, self).buildChildren(child_, node, nodeName_, True)2212# end class AccessSettingsType2213class ControlAccessParamsType(VCloudExtensibleType):2214 """0.9 Specifies access controls for a resource."""2215 subclass = None2216 superclass = VCloudExtensibleType2217 def __init__(self, VCloudExtension=None, IsSharedToEveryone=None, EveryoneAccessLevel=None, AccessSettings=None):2218 self.original_tagname_ = None2219 super(ControlAccessParamsType, self).__init__(VCloudExtension, )2220 self.IsSharedToEveryone = IsSharedToEveryone2221 self.EveryoneAccessLevel = EveryoneAccessLevel2222 self.AccessSettings = AccessSettings2223 def factory(*args_, **kwargs_):2224 if ControlAccessParamsType.subclass:2225 return ControlAccessParamsType.subclass(*args_, **kwargs_)2226 else:2227 return ControlAccessParamsType(*args_, **kwargs_)2228 factory = staticmethod(factory)2229 def get_IsSharedToEveryone(self): return self.IsSharedToEveryone2230 def set_IsSharedToEveryone(self, IsSharedToEveryone): self.IsSharedToEveryone = IsSharedToEveryone2231 def get_EveryoneAccessLevel(self): return self.EveryoneAccessLevel2232 def set_EveryoneAccessLevel(self, EveryoneAccessLevel): self.EveryoneAccessLevel = EveryoneAccessLevel2233 def get_AccessSettings(self): return self.AccessSettings2234 def set_AccessSettings(self, AccessSettings): self.AccessSettings = AccessSettings2235 def hasContent_(self):2236 if (2237 self.IsSharedToEveryone is not None or2238 self.EveryoneAccessLevel is not None or2239 self.AccessSettings is not None or2240 super(ControlAccessParamsType, self).hasContent_()2241 ):2242 return True2243 else:2244 return False2245 def export(self, outfile, level, namespace_='', name_='ControlAccessParamsType', namespacedef_='', pretty_print=True):2246 if pretty_print:2247 eol_ = '\n'2248 else:2249 eol_ = ''2250 if self.original_tagname_ is not None:2251 name_ = self.original_tagname_2252 showIndent(outfile, level, pretty_print)2253 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))2254 already_processed = set()2255 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ControlAccessParamsType')2256 if self.hasContent_():2257 outfile.write('>%s' % (eol_, ))2258 self.exportChildren(outfile, level + 1, namespace_='', name_='ControlAccessParamsType', pretty_print=pretty_print)2259 showIndent(outfile, level, pretty_print)2260 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))2261 else:2262 outfile.write('/>%s' % (eol_, ))2263 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ControlAccessParamsType'):2264 super(ControlAccessParamsType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='ControlAccessParamsType')2265 def exportChildren(self, outfile, level, namespace_='', name_='ControlAccessParamsType', fromsubclass_=False, pretty_print=True):2266 super(ControlAccessParamsType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)2267 if pretty_print:2268 eol_ = '\n'2269 else:2270 eol_ = ''2271 if self.IsSharedToEveryone is not None:2272 showIndent(outfile, level, pretty_print)2273 outfile.write('<%sIsSharedToEveryone>%s</%sIsSharedToEveryone>%s' % (namespace_, self.gds_format_boolean(self.IsSharedToEveryone, input_name='IsSharedToEveryone'), namespace_, eol_))2274 if self.EveryoneAccessLevel is not None:2275 showIndent(outfile, level, pretty_print)2276 outfile.write('<%sEveryoneAccessLevel>%s</%sEveryoneAccessLevel>%s' % (namespace_, self.gds_format_string(quote_xml(self.EveryoneAccessLevel).encode(ExternalEncoding), input_name='EveryoneAccessLevel'), namespace_, eol_))2277 if self.AccessSettings is not None:2278 self.AccessSettings.export(outfile, level, namespace_, name_='AccessSettings', pretty_print=pretty_print)2279 def exportLiteral(self, outfile, level, name_='ControlAccessParamsType'):2280 level += 12281 already_processed = set()2282 self.exportLiteralAttributes(outfile, level, already_processed, name_)2283 if self.hasContent_():2284 self.exportLiteralChildren(outfile, level, name_)2285 def exportLiteralAttributes(self, outfile, level, already_processed, name_):2286 super(ControlAccessParamsType, self).exportLiteralAttributes(outfile, level, already_processed, name_)2287 def exportLiteralChildren(self, outfile, level, name_):2288 super(ControlAccessParamsType, self).exportLiteralChildren(outfile, level, name_)2289 if self.IsSharedToEveryone is not None:2290 showIndent(outfile, level)2291 outfile.write('IsSharedToEveryone=%s,\n' % self.IsSharedToEveryone)2292 if self.EveryoneAccessLevel is not None:2293 showIndent(outfile, level)2294 outfile.write('EveryoneAccessLevel=%s,\n' % quote_python(self.EveryoneAccessLevel).encode(ExternalEncoding))2295 if self.AccessSettings is not None:2296 showIndent(outfile, level)2297 outfile.write('AccessSettings=model_.AccessSettingsType(\n')2298 self.AccessSettings.exportLiteral(outfile, level, name_='AccessSettings')2299 showIndent(outfile, level)2300 outfile.write('),\n')2301 def build(self, node):2302 already_processed = set()2303 self.buildAttributes(node, node.attrib, already_processed)2304 for child in node:2305 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]2306 self.buildChildren(child, node, nodeName_)2307 return self2308 def buildAttributes(self, node, attrs, already_processed):2309 super(ControlAccessParamsType, self).buildAttributes(node, attrs, already_processed)2310 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):2311 if nodeName_ == 'IsSharedToEveryone':2312 sval_ = child_.text2313 if sval_ in ('true', '1'):2314 ival_ = True2315 elif sval_ in ('false', '0'):2316 ival_ = False2317 else:2318 raise_parse_error(child_, 'requires boolean')2319 ival_ = self.gds_validate_boolean(ival_, node, 'IsSharedToEveryone')2320 self.IsSharedToEveryone = ival_2321 elif nodeName_ == 'EveryoneAccessLevel':2322 EveryoneAccessLevel_ = child_.text2323 EveryoneAccessLevel_ = self.gds_validate_string(EveryoneAccessLevel_, node, 'EveryoneAccessLevel')2324 self.EveryoneAccessLevel = EveryoneAccessLevel_2325 elif nodeName_ == 'AccessSettings':2326 obj_ = AccessSettingsType.factory()2327 obj_.build(child_)2328 self.AccessSettings = obj_2329 obj_.original_tagname_ = 'AccessSettings'2330 super(ControlAccessParamsType, self).buildChildren(child_, node, nodeName_, True)2331# end class ControlAccessParamsType2332class OwnerType(ResourceType):2333 """1.5 Represents the owner of this entity."""2334 subclass = None2335 superclass = ResourceType2336 def __init__(self, VCloudExtension=None, href=None, type_=None, Link=None, User=None):2337 self.original_tagname_ = None2338 super(OwnerType, self).__init__(VCloudExtension, href, type_, Link, )2339 self.User = User2340 def factory(*args_, **kwargs_):2341 if OwnerType.subclass:2342 return OwnerType.subclass(*args_, **kwargs_)2343 else:2344 return OwnerType(*args_, **kwargs_)2345 factory = staticmethod(factory)2346 def get_User(self): return self.User2347 def set_User(self, User): self.User = User2348 def hasContent_(self):2349 if (2350 self.User is not None or2351 super(OwnerType, self).hasContent_()2352 ):2353 return True2354 else:2355 return False2356 def export(self, outfile, level, namespace_='', name_='OwnerType', namespacedef_='', pretty_print=True):2357 if pretty_print:2358 eol_ = '\n'2359 else:2360 eol_ = ''2361 if self.original_tagname_ is not None:2362 name_ = self.original_tagname_2363 showIndent(outfile, level, pretty_print)2364 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))2365 already_processed = set()2366 self.exportAttributes(outfile, level, already_processed, namespace_, name_='OwnerType')2367 if self.hasContent_():2368 outfile.write('>%s' % (eol_, ))2369 self.exportChildren(outfile, level + 1, namespace_='', name_='OwnerType', pretty_print=pretty_print)2370 showIndent(outfile, level, pretty_print)2371 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))2372 else:2373 outfile.write('/>%s' % (eol_, ))2374 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='OwnerType'):2375 super(OwnerType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='OwnerType')2376 def exportChildren(self, outfile, level, namespace_='', name_='OwnerType', fromsubclass_=False, pretty_print=True):2377 super(OwnerType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)2378 if pretty_print:2379 eol_ = '\n'2380 else:2381 eol_ = ''2382 if self.User is not None:2383 self.User.export(outfile, level, namespace_, name_='User', pretty_print=pretty_print)2384 def exportLiteral(self, outfile, level, name_='OwnerType'):2385 level += 12386 already_processed = set()2387 self.exportLiteralAttributes(outfile, level, already_processed, name_)2388 if self.hasContent_():2389 self.exportLiteralChildren(outfile, level, name_)2390 def exportLiteralAttributes(self, outfile, level, already_processed, name_):2391 super(OwnerType, self).exportLiteralAttributes(outfile, level, already_processed, name_)2392 def exportLiteralChildren(self, outfile, level, name_):2393 super(OwnerType, self).exportLiteralChildren(outfile, level, name_)2394 if self.User is not None:2395 showIndent(outfile, level)2396 outfile.write('User=model_.ReferenceType(\n')2397 self.User.exportLiteral(outfile, level, name_='User')2398 showIndent(outfile, level)2399 outfile.write('),\n')2400 def build(self, node):2401 already_processed = set()2402 self.buildAttributes(node, node.attrib, already_processed)2403 for child in node:2404 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]2405 self.buildChildren(child, node, nodeName_)2406 return self2407 def buildAttributes(self, node, attrs, already_processed):2408 super(OwnerType, self).buildAttributes(node, attrs, already_processed)2409 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):2410 if nodeName_ == 'User':2411 class_obj_ = self.get_class_obj_(child_, ReferenceType)2412 obj_ = class_obj_.factory()2413 obj_.build(child_)2414 self.User = obj_2415 obj_.original_tagname_ = 'User'2416 super(OwnerType, self).buildChildren(child_, node, nodeName_, True)2417# end class OwnerType2418class ReferencesType(ContainerType):2419 """Container for query results returned in references format."""2420 subclass = None2421 superclass = ContainerType2422 def __init__(self, VCloudExtension=None, href=None, type_=None, Link=None, total=None, name=None, pageSize=None, page=None, Reference=None):2423 self.original_tagname_ = None2424 super(ReferencesType, self).__init__(VCloudExtension, href, type_, Link, total, name, pageSize, page, )2425 if Reference is None:2426 self.Reference = []2427 else:2428 self.Reference = Reference2429 def factory(*args_, **kwargs_):2430 if ReferencesType.subclass:2431 return ReferencesType.subclass(*args_, **kwargs_)2432 else:2433 return ReferencesType(*args_, **kwargs_)2434 factory = staticmethod(factory)2435 def get_Reference(self): return self.Reference2436 def set_Reference(self, Reference): self.Reference = Reference2437 def add_Reference(self, value): self.Reference.append(value)2438 def insert_Reference_at(self, index, value): self.Reference.insert(index, value)2439 def replace_Reference_at(self, index, value): self.Reference[index] = value2440 def hasContent_(self):2441 if (2442 self.Reference or2443 super(ReferencesType, self).hasContent_()2444 ):2445 return True2446 else:2447 return False2448 def export(self, outfile, level, namespace_='', name_='ReferencesType', namespacedef_='', pretty_print=True):2449 if pretty_print:2450 eol_ = '\n'2451 else:2452 eol_ = ''2453 if self.original_tagname_ is not None:2454 name_ = self.original_tagname_2455 showIndent(outfile, level, pretty_print)2456 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))2457 already_processed = set()2458 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ReferencesType')2459 if self.hasContent_():2460 outfile.write('>%s' % (eol_, ))2461 self.exportChildren(outfile, level + 1, namespace_='', name_='ReferencesType', pretty_print=pretty_print)2462 showIndent(outfile, level, pretty_print)2463 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))2464 else:2465 outfile.write('/>%s' % (eol_, ))2466 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ReferencesType'):2467 super(ReferencesType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='ReferencesType')2468 def exportChildren(self, outfile, level, namespace_='', name_='ReferencesType', fromsubclass_=False, pretty_print=True):2469 super(ReferencesType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)2470 if pretty_print:2471 eol_ = '\n'2472 else:2473 eol_ = ''2474 for Reference_ in self.Reference:2475 Reference_.export(outfile, level, namespace_, name_='Reference', pretty_print=pretty_print)2476 def exportLiteral(self, outfile, level, name_='ReferencesType'):2477 level += 12478 already_processed = set()2479 self.exportLiteralAttributes(outfile, level, already_processed, name_)2480 if self.hasContent_():2481 self.exportLiteralChildren(outfile, level, name_)2482 def exportLiteralAttributes(self, outfile, level, already_processed, name_):2483 super(ReferencesType, self).exportLiteralAttributes(outfile, level, already_processed, name_)2484 def exportLiteralChildren(self, outfile, level, name_):2485 super(ReferencesType, self).exportLiteralChildren(outfile, level, name_)2486 showIndent(outfile, level)2487 outfile.write('Reference=[\n')2488 level += 12489 for Reference_ in self.Reference:2490 showIndent(outfile, level)2491 outfile.write('model_.Reference(\n')2492 Reference_.exportLiteral(outfile, level)2493 showIndent(outfile, level)2494 outfile.write('),\n')2495 level -= 12496 showIndent(outfile, level)2497 outfile.write('],\n')2498 def build(self, node):2499 already_processed = set()2500 self.buildAttributes(node, node.attrib, already_processed)2501 for child in node:2502 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]2503 self.buildChildren(child, node, nodeName_)2504 return self2505 def buildAttributes(self, node, attrs, already_processed):2506 super(ReferencesType, self).buildAttributes(node, attrs, already_processed)2507 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):2508 if nodeName_ == 'Reference':2509 class_obj_ = self.get_class_obj_(child_, ReferenceType)2510 obj_ = class_obj_.factory()2511 obj_.build(child_)2512 self.Reference.append(obj_)2513 obj_.original_tagname_ = 'Reference'2514 super(ReferencesType, self).buildChildren(child_, node, nodeName_, True)2515# end class ReferencesType2516class QueryListType(ContainerType):2517 """Container for the list of typed queries available to the requesting2518 user."""2519 subclass = None2520 superclass = ContainerType2521 def __init__(self, VCloudExtension=None, href=None, type_=None, Link=None, total=None, name=None, pageSize=None, page=None):2522 self.original_tagname_ = None2523 super(QueryListType, self).__init__(VCloudExtension, href, type_, Link, total, name, pageSize, page, )2524 def factory(*args_, **kwargs_):2525 if QueryListType.subclass:2526 return QueryListType.subclass(*args_, **kwargs_)2527 else:2528 return QueryListType(*args_, **kwargs_)2529 factory = staticmethod(factory)2530 def hasContent_(self):2531 if (2532 super(QueryListType, self).hasContent_()2533 ):2534 return True2535 else:2536 return False2537 def export(self, outfile, level, namespace_='', name_='QueryListType', namespacedef_='', pretty_print=True):2538 if pretty_print:2539 eol_ = '\n'2540 else:2541 eol_ = ''2542 if self.original_tagname_ is not None:2543 name_ = self.original_tagname_2544 showIndent(outfile, level, pretty_print)2545 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))2546 already_processed = set()2547 self.exportAttributes(outfile, level, already_processed, namespace_, name_='QueryListType')2548 if self.hasContent_():2549 outfile.write('>%s' % (eol_, ))2550 self.exportChildren(outfile, level + 1, namespace_='', name_='QueryListType', pretty_print=pretty_print)2551 showIndent(outfile, level, pretty_print)2552 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))2553 else:2554 outfile.write('/>%s' % (eol_, ))2555 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='QueryListType'):2556 super(QueryListType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='QueryListType')2557 def exportChildren(self, outfile, level, namespace_='', name_='QueryListType', fromsubclass_=False, pretty_print=True):2558 super(QueryListType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)2559 def exportLiteral(self, outfile, level, name_='QueryListType'):2560 level += 12561 already_processed = set()2562 self.exportLiteralAttributes(outfile, level, already_processed, name_)2563 if self.hasContent_():2564 self.exportLiteralChildren(outfile, level, name_)2565 def exportLiteralAttributes(self, outfile, level, already_processed, name_):2566 super(QueryListType, self).exportLiteralAttributes(outfile, level, already_processed, name_)2567 def exportLiteralChildren(self, outfile, level, name_):2568 super(QueryListType, self).exportLiteralChildren(outfile, level, name_)2569 def build(self, node):2570 already_processed = set()2571 self.buildAttributes(node, node.attrib, already_processed)2572 for child in node:2573 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]2574 self.buildChildren(child, node, nodeName_)2575 return self2576 def buildAttributes(self, node, attrs, already_processed):2577 super(QueryListType, self).buildAttributes(node, attrs, already_processed)2578 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):2579 super(QueryListType, self).buildChildren(child_, node, nodeName_, True)2580 pass2581# end class QueryListType2582class MetadataDomainTagType(GeneratedsSuper):2583 """A value of SYSTEM places this MetadataEntry in the SYSTEM domain.2584 Omit or leave empty to place this MetadataEntry in the GENERAL2585 domain. true One of:<br> PRIVATE<br> READONLY"""2586 subclass = None2587 superclass = None2588 def __init__(self, visibility=None, valueOf_=None):2589 self.original_tagname_ = None2590 self.visibility = _cast(None, visibility)2591 self.valueOf_ = valueOf_2592 def factory(*args_, **kwargs_):2593 if MetadataDomainTagType.subclass:2594 return MetadataDomainTagType.subclass(*args_, **kwargs_)2595 else:2596 return MetadataDomainTagType(*args_, **kwargs_)2597 factory = staticmethod(factory)2598 def get_visibility(self): return self.visibility2599 def set_visibility(self, visibility): self.visibility = visibility2600 def get_valueOf_(self): return self.valueOf_2601 def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_2602 def hasContent_(self):2603 if (2604 self.valueOf_2605 ):2606 return True2607 else:2608 return False2609 def export(self, outfile, level, namespace_='', name_='MetadataDomainTagType', namespacedef_='', pretty_print=True):2610 if pretty_print:2611 eol_ = '\n'2612 else:2613 eol_ = ''2614 if self.original_tagname_ is not None:2615 name_ = self.original_tagname_2616 showIndent(outfile, level, pretty_print)2617 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))2618 already_processed = set()2619 self.exportAttributes(outfile, level, already_processed, namespace_, name_='MetadataDomainTagType')2620 if self.hasContent_():2621 outfile.write('>')2622 outfile.write(str(self.valueOf_).encode(ExternalEncoding))2623 self.exportChildren(outfile, level + 1, namespace_='', name_='MetadataDomainTagType', pretty_print=pretty_print)2624 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))2625 else:2626 outfile.write('/>%s' % (eol_, ))2627 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='MetadataDomainTagType'):2628 if self.visibility is not None and 'visibility' not in already_processed:2629 already_processed.add('visibility')2630 outfile.write(' visibility=%s' % (self.gds_format_string(quote_attrib(self.visibility).encode(ExternalEncoding), input_name='visibility'), ))2631 def exportChildren(self, outfile, level, namespace_='', name_='MetadataDomainTagType', fromsubclass_=False, pretty_print=True):2632 pass2633 def exportLiteral(self, outfile, level, name_='MetadataDomainTagType'):2634 level += 12635 already_processed = set()2636 self.exportLiteralAttributes(outfile, level, already_processed, name_)2637 if self.hasContent_():2638 self.exportLiteralChildren(outfile, level, name_)2639 showIndent(outfile, level)2640 outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))2641 def exportLiteralAttributes(self, outfile, level, already_processed, name_):2642 if self.visibility is not None and 'visibility' not in already_processed:2643 already_processed.add('visibility')2644 showIndent(outfile, level)2645 outfile.write('visibility="%s",\n' % (self.visibility,))2646 def exportLiteralChildren(self, outfile, level, name_):2647 pass2648 def build(self, node):2649 already_processed = set()2650 self.buildAttributes(node, node.attrib, already_processed)2651 self.valueOf_ = get_all_text_(node)2652 for child in node:2653 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]2654 self.buildChildren(child, node, nodeName_)2655 return self2656 def buildAttributes(self, node, attrs, already_processed):2657 value = find_attr_value_('visibility', node)2658 if value is not None and 'visibility' not in already_processed:2659 already_processed.add('visibility')2660 self.visibility = value2661 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):2662 pass2663# end class MetadataDomainTagType2664class MetadataEntryType(ResourceType):2665 subclass = None2666 superclass = ResourceType2667 def __init__(self, VCloudExtension=None, href=None, type_=None, Link=None, Domain=None, Key=None, Value=None, TypedValue=None):2668 self.original_tagname_ = None2669 super(MetadataEntryType, self).__init__(VCloudExtension, href, type_, Link, )2670 self.Domain = Domain2671 self.Key = Key2672 self.Value = Value2673 self.TypedValue = TypedValue2674 def factory(*args_, **kwargs_):2675 if MetadataEntryType.subclass:2676 return MetadataEntryType.subclass(*args_, **kwargs_)2677 else:2678 return MetadataEntryType(*args_, **kwargs_)2679 factory = staticmethod(factory)2680 def get_Domain(self): return self.Domain2681 def set_Domain(self, Domain): self.Domain = Domain2682 def get_Key(self): return self.Key2683 def set_Key(self, Key): self.Key = Key2684 def get_Value(self): return self.Value2685 def set_Value(self, Value): self.Value = Value2686 def get_TypedValue(self): return self.TypedValue2687 def set_TypedValue(self, TypedValue): self.TypedValue = TypedValue2688 def hasContent_(self):2689 if (2690 self.Domain is not None or2691 self.Key is not None or2692 self.Value is not None or2693 self.TypedValue is not None or2694 super(MetadataEntryType, self).hasContent_()2695 ):2696 return True2697 else:2698 return False2699 def export(self, outfile, level, namespace_='', name_='MetadataEntryType', namespacedef_='', pretty_print=True):2700 if pretty_print:2701 eol_ = '\n'2702 else:2703 eol_ = ''2704 if self.original_tagname_ is not None:2705 name_ = self.original_tagname_2706 showIndent(outfile, level, pretty_print)2707 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))2708 already_processed = set()2709 self.exportAttributes(outfile, level, already_processed, namespace_, name_='MetadataEntryType')2710 if self.hasContent_():2711 outfile.write('>%s' % (eol_, ))2712 self.exportChildren(outfile, level + 1, namespace_='', name_='MetadataEntryType', pretty_print=pretty_print)2713 showIndent(outfile, level, pretty_print)2714 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))2715 else:2716 outfile.write('/>%s' % (eol_, ))2717 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='MetadataEntryType'):2718 super(MetadataEntryType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='MetadataEntryType')2719 def exportChildren(self, outfile, level, namespace_='', name_='MetadataEntryType', fromsubclass_=False, pretty_print=True):2720 super(MetadataEntryType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)2721 if pretty_print:2722 eol_ = '\n'2723 else:2724 eol_ = ''2725 if self.Domain is not None:2726 self.Domain.export(outfile, level, namespace_, name_='Domain', pretty_print=pretty_print)2727 if self.Key is not None:2728 showIndent(outfile, level, pretty_print)2729 outfile.write('<%sKey>%s</%sKey>%s' % (namespace_, self.gds_format_string(quote_xml(self.Key).encode(ExternalEncoding), input_name='Key'), namespace_, eol_))2730 if self.Value is not None:2731 showIndent(outfile, level, pretty_print)2732 outfile.write('<%sValue>%s</%sValue>%s' % (namespace_, self.gds_format_string(quote_xml(self.Value).encode(ExternalEncoding), input_name='Value'), namespace_, eol_))2733 if self.TypedValue is not None:2734 self.TypedValue.export(outfile, level, namespace_, name_='TypedValue', pretty_print=pretty_print)2735 def exportLiteral(self, outfile, level, name_='MetadataEntryType'):2736 level += 12737 already_processed = set()2738 self.exportLiteralAttributes(outfile, level, already_processed, name_)2739 if self.hasContent_():2740 self.exportLiteralChildren(outfile, level, name_)2741 def exportLiteralAttributes(self, outfile, level, already_processed, name_):2742 super(MetadataEntryType, self).exportLiteralAttributes(outfile, level, already_processed, name_)2743 def exportLiteralChildren(self, outfile, level, name_):2744 super(MetadataEntryType, self).exportLiteralChildren(outfile, level, name_)2745 if self.Domain is not None:2746 showIndent(outfile, level)2747 outfile.write('Domain=model_.MetadataDomainTagType(\n')2748 self.Domain.exportLiteral(outfile, level, name_='Domain')2749 showIndent(outfile, level)2750 outfile.write('),\n')2751 if self.Key is not None:2752 showIndent(outfile, level)2753 outfile.write('Key=%s,\n' % quote_python(self.Key).encode(ExternalEncoding))2754 if self.Value is not None:2755 showIndent(outfile, level)2756 outfile.write('Value=%s,\n' % quote_python(self.Value).encode(ExternalEncoding))2757 if self.MetadataTypedValue is not None:2758 showIndent(outfile, level)2759 outfile.write('MetadataTypedValue=model_.MetadataTypedValue(\n')2760 self.MetadataTypedValue.exportLiteral(outfile, level)2761 showIndent(outfile, level)2762 outfile.write('),\n')2763 def build(self, node):2764 already_processed = set()2765 self.buildAttributes(node, node.attrib, already_processed)2766 for child in node:2767 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]2768 self.buildChildren(child, node, nodeName_)2769 return self2770 def buildAttributes(self, node, attrs, already_processed):2771 super(MetadataEntryType, self).buildAttributes(node, attrs, already_processed)2772 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):2773 if nodeName_ == 'Domain':2774 obj_ = MetadataDomainTagType.factory()2775 obj_.build(child_)2776 self.Domain = obj_2777 obj_.original_tagname_ = 'Domain'2778 elif nodeName_ == 'Key':2779 Key_ = child_.text2780 Key_ = self.gds_validate_string(Key_, node, 'Key')2781 self.Key = Key_2782 elif nodeName_ == 'Value':2783 Value_ = child_.text2784 Value_ = self.gds_validate_string(Value_, node, 'Value')2785 self.Value = Value_2786 elif nodeName_ == 'TypedValue':2787 type_name_ = child_.attrib.get(2788 '{http://www.w3.org/2001/XMLSchema-instance}type')2789 if type_name_ is None:2790 type_name_ = child_.attrib.get('type')2791 if type_name_ is not None:2792 type_names_ = type_name_.split(':')2793 if len(type_names_) == 1:2794 type_name_ = type_names_[0]2795 else:2796 type_name_ = type_names_[1]2797 class_ = globals()[type_name_]2798 obj_ = class_.factory()2799 obj_.build(child_)2800 else:2801 raise NotImplementedError(2802 'Class not implemented for <TypedValue> element')2803 self.TypedValue = obj_2804 obj_.original_tagname_ = 'TypedValue'2805 super(MetadataEntryType, self).buildChildren(child_, node, nodeName_, True)2806# end class MetadataEntryType2807class MetadataTypedValue(GeneratedsSuper):2808 """One of:<br> MetadataStringValue<br> MetadataNumberValue<br>2809 MetadataBooleanValue<br> MetadataDateTimeValue"""2810 subclass = None2811 superclass = None2812 def __init__(self, extensiontype_=None):2813 self.original_tagname_ = None2814 self.extensiontype_ = extensiontype_2815 def factory(*args_, **kwargs_):2816 if MetadataTypedValue.subclass:2817 return MetadataTypedValue.subclass(*args_, **kwargs_)2818 else:2819 return MetadataTypedValue(*args_, **kwargs_)2820 factory = staticmethod(factory)2821 def get_extensiontype_(self): return self.extensiontype_2822 def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_2823 def hasContent_(self):2824 if (2825 ):2826 return True2827 else:2828 return False2829 def export(self, outfile, level, namespace_='', name_='MetadataTypedValue', namespacedef_='', pretty_print=True):2830 if pretty_print:2831 eol_ = '\n'2832 else:2833 eol_ = ''2834 if self.original_tagname_ is not None:2835 name_ = self.original_tagname_2836 showIndent(outfile, level, pretty_print)2837 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))2838 already_processed = set()2839 self.exportAttributes(outfile, level, already_processed, namespace_, name_='MetadataTypedValue')2840 if self.hasContent_():2841 outfile.write('>%s' % (eol_, ))2842 self.exportChildren(outfile, level + 1, namespace_='', name_='MetadataTypedValue', pretty_print=pretty_print)2843 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))2844 else:2845 outfile.write('/>%s' % (eol_, ))2846 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='MetadataTypedValue'):2847 if self.extensiontype_ is not None and 'xsi:type' not in already_processed:2848 already_processed.add('xsi:type')2849 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')2850 outfile.write(' xsi:type="%s"' % self.extensiontype_)2851 pass2852 def exportChildren(self, outfile, level, namespace_='', name_='MetadataTypedValue', fromsubclass_=False, pretty_print=True):2853 pass2854 def exportLiteral(self, outfile, level, name_='MetadataTypedValue'):2855 level += 12856 already_processed = set()2857 self.exportLiteralAttributes(outfile, level, already_processed, name_)2858 if self.hasContent_():2859 self.exportLiteralChildren(outfile, level, name_)2860 def exportLiteralAttributes(self, outfile, level, already_processed, name_):2861 pass2862 def exportLiteralChildren(self, outfile, level, name_):2863 pass2864 def build(self, node):2865 already_processed = set()2866 self.buildAttributes(node, node.attrib, already_processed)2867 for child in node:2868 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]2869 self.buildChildren(child, node, nodeName_)2870 return self2871 def buildAttributes(self, node, attrs, already_processed):2872 value = find_attr_value_('xsi:type', node)2873 if value is not None and 'xsi:type' not in already_processed:2874 already_processed.add('xsi:type')2875 self.extensiontype_ = value2876 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):2877 pass2878# end class MetadataTypedValue2879class MetadataStringValue(MetadataTypedValue):2880 """UTF-8 character set. Strings longer than 1000 characters cannot be2881 searched for in a query."""2882 subclass = None2883 superclass = MetadataTypedValue2884 def __init__(self, Value=None):2885 self.original_tagname_ = None2886 super(MetadataStringValue, self).__init__()2887 self.Value = Value2888 def factory(*args_, **kwargs_):2889 if MetadataStringValue.subclass:2890 return MetadataStringValue.subclass(*args_, **kwargs_)2891 else:2892 return MetadataStringValue(*args_, **kwargs_)2893 factory = staticmethod(factory)2894 def get_Value(self): return self.Value2895 def set_Value(self, Value): self.Value = Value2896 def hasContent_(self):2897 if (2898 self.Value is not None or2899 super(MetadataStringValue, self).hasContent_()2900 ):2901 return True2902 else:2903 return False2904 def export(self, outfile, level, namespace_='', name_='MetadataStringValue', namespacedef_='', pretty_print=True):2905 if pretty_print:2906 eol_ = '\n'2907 else:2908 eol_ = ''2909 if self.original_tagname_ is not None:2910 name_ = self.original_tagname_2911 showIndent(outfile, level, pretty_print)2912 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))2913 already_processed = set()2914 self.exportAttributes(outfile, level, already_processed, namespace_, name_='MetadataStringValue')2915 if self.hasContent_():2916 outfile.write('>%s' % (eol_, ))2917 self.exportChildren(outfile, level + 1, namespace_='', name_='MetadataStringValue', pretty_print=pretty_print)2918 showIndent(outfile, level, pretty_print)2919 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))2920 else:2921 outfile.write('/>%s' % (eol_, ))2922 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='MetadataStringValue'):2923 super(MetadataStringValue, self).exportAttributes(outfile, level, already_processed, namespace_, name_='MetadataStringValue')2924 def exportChildren(self, outfile, level, namespace_='', name_='MetadataStringValue', fromsubclass_=False, pretty_print=True):2925 super(MetadataStringValue, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)2926 if pretty_print:2927 eol_ = '\n'2928 else:2929 eol_ = ''2930 if self.Value is not None:2931 showIndent(outfile, level, pretty_print)2932 outfile.write('<%sValue>%s</%sValue>%s' % (namespace_, self.gds_format_string(quote_xml(self.Value).encode(ExternalEncoding), input_name='Value'), namespace_, eol_))2933 def exportLiteral(self, outfile, level, name_='MetadataStringValue'):2934 level += 12935 already_processed = set()2936 self.exportLiteralAttributes(outfile, level, already_processed, name_)2937 if self.hasContent_():2938 self.exportLiteralChildren(outfile, level, name_)2939 def exportLiteralAttributes(self, outfile, level, already_processed, name_):2940 super(MetadataStringValue, self).exportLiteralAttributes(outfile, level, already_processed, name_)2941 def exportLiteralChildren(self, outfile, level, name_):2942 super(MetadataStringValue, self).exportLiteralChildren(outfile, level, name_)2943 if self.Value is not None:2944 showIndent(outfile, level)2945 outfile.write('Value=%s,\n' % quote_python(self.Value).encode(ExternalEncoding))2946 def build(self, node):2947 already_processed = set()2948 self.buildAttributes(node, node.attrib, already_processed)2949 for child in node:2950 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]2951 self.buildChildren(child, node, nodeName_)2952 return self2953 def buildAttributes(self, node, attrs, already_processed):2954 super(MetadataStringValue, self).buildAttributes(node, attrs, already_processed)2955 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):2956 if nodeName_ == 'Value':2957 Value_ = child_.text2958 Value_ = self.gds_validate_string(Value_, node, 'Value')2959 self.Value = Value_2960 super(MetadataStringValue, self).buildChildren(child_, node, nodeName_, True)2961# end class MetadataStringValue2962class MetadataNumberValue(MetadataTypedValue):2963 """A signed 8-byte integer."""2964 subclass = None2965 superclass = MetadataTypedValue2966 def __init__(self, Value=None):2967 self.original_tagname_ = None2968 super(MetadataNumberValue, self).__init__()2969 self.Value = Value2970 def factory(*args_, **kwargs_):2971 if MetadataNumberValue.subclass:2972 return MetadataNumberValue.subclass(*args_, **kwargs_)2973 else:2974 return MetadataNumberValue(*args_, **kwargs_)2975 factory = staticmethod(factory)2976 def get_Value(self): return self.Value2977 def set_Value(self, Value): self.Value = Value2978 def hasContent_(self):2979 if (2980 self.Value is not None or2981 super(MetadataNumberValue, self).hasContent_()2982 ):2983 return True2984 else:2985 return False2986 def export(self, outfile, level, namespace_='', name_='MetadataNumberValue', namespacedef_='', pretty_print=True):2987 if pretty_print:2988 eol_ = '\n'2989 else:2990 eol_ = ''2991 if self.original_tagname_ is not None:2992 name_ = self.original_tagname_2993 showIndent(outfile, level, pretty_print)2994 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))2995 already_processed = set()2996 self.exportAttributes(outfile, level, already_processed, namespace_, name_='MetadataNumberValue')2997 if self.hasContent_():2998 outfile.write('>%s' % (eol_, ))2999 self.exportChildren(outfile, level + 1, namespace_='', name_='MetadataNumberValue', pretty_print=pretty_print)3000 showIndent(outfile, level, pretty_print)3001 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))3002 else:3003 outfile.write('/>%s' % (eol_, ))3004 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='MetadataNumberValue'):3005 super(MetadataNumberValue, self).exportAttributes(outfile, level, already_processed, namespace_, name_='MetadataNumberValue')3006 def exportChildren(self, outfile, level, namespace_='', name_='MetadataNumberValue', fromsubclass_=False, pretty_print=True):3007 super(MetadataNumberValue, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)3008 if pretty_print:3009 eol_ = '\n'3010 else:3011 eol_ = ''3012 if self.Value is not None:3013 showIndent(outfile, level, pretty_print)3014 outfile.write('<%sValue>%s</%sValue>%s' % (namespace_, self.gds_format_integer(self.Value, input_name='Value'), namespace_, eol_))3015 def exportLiteral(self, outfile, level, name_='MetadataNumberValue'):3016 level += 13017 already_processed = set()3018 self.exportLiteralAttributes(outfile, level, already_processed, name_)3019 if self.hasContent_():3020 self.exportLiteralChildren(outfile, level, name_)3021 def exportLiteralAttributes(self, outfile, level, already_processed, name_):3022 super(MetadataNumberValue, self).exportLiteralAttributes(outfile, level, already_processed, name_)3023 def exportLiteralChildren(self, outfile, level, name_):3024 super(MetadataNumberValue, self).exportLiteralChildren(outfile, level, name_)3025 if self.Value is not None:3026 showIndent(outfile, level)3027 outfile.write('Value=%d,\n' % self.Value)3028 def build(self, node):3029 already_processed = set()3030 self.buildAttributes(node, node.attrib, already_processed)3031 for child in node:3032 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]3033 self.buildChildren(child, node, nodeName_)3034 return self3035 def buildAttributes(self, node, attrs, already_processed):3036 super(MetadataNumberValue, self).buildAttributes(node, attrs, already_processed)3037 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):3038 if nodeName_ == 'Value':3039 sval_ = child_.text3040 try:3041 ival_ = int(sval_)3042 except (TypeError, ValueError), exp:3043 raise_parse_error(child_, 'requires integer: %s' % exp)3044 ival_ = self.gds_validate_integer(ival_, node, 'Value')3045 self.Value = ival_3046 super(MetadataNumberValue, self).buildChildren(child_, node, nodeName_, True)3047# end class MetadataNumberValue3048class MetadataBooleanValue(MetadataTypedValue):3049 """One of: 1, 0, true, false"""3050 subclass = None3051 superclass = MetadataTypedValue3052 def __init__(self, Value=None):3053 self.original_tagname_ = None3054 super(MetadataBooleanValue, self).__init__()3055 self.Value = Value3056 def factory(*args_, **kwargs_):3057 if MetadataBooleanValue.subclass:3058 return MetadataBooleanValue.subclass(*args_, **kwargs_)3059 else:3060 return MetadataBooleanValue(*args_, **kwargs_)3061 factory = staticmethod(factory)3062 def get_Value(self): return self.Value3063 def set_Value(self, Value): self.Value = Value3064 def hasContent_(self):3065 if (3066 self.Value is not None or3067 super(MetadataBooleanValue, self).hasContent_()3068 ):3069 return True3070 else:3071 return False3072 def export(self, outfile, level, namespace_='', name_='MetadataBooleanValue', namespacedef_='', pretty_print=True):3073 if pretty_print:3074 eol_ = '\n'3075 else:3076 eol_ = ''3077 if self.original_tagname_ is not None:3078 name_ = self.original_tagname_3079 showIndent(outfile, level, pretty_print)3080 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))3081 already_processed = set()3082 self.exportAttributes(outfile, level, already_processed, namespace_, name_='MetadataBooleanValue')3083 if self.hasContent_():3084 outfile.write('>%s' % (eol_, ))3085 self.exportChildren(outfile, level + 1, namespace_='', name_='MetadataBooleanValue', pretty_print=pretty_print)3086 showIndent(outfile, level, pretty_print)3087 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))3088 else:3089 outfile.write('/>%s' % (eol_, ))3090 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='MetadataBooleanValue'):3091 super(MetadataBooleanValue, self).exportAttributes(outfile, level, already_processed, namespace_, name_='MetadataBooleanValue')3092 def exportChildren(self, outfile, level, namespace_='', name_='MetadataBooleanValue', fromsubclass_=False, pretty_print=True):3093 super(MetadataBooleanValue, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)3094 if pretty_print:3095 eol_ = '\n'3096 else:3097 eol_ = ''3098 if self.Value is not None:3099 showIndent(outfile, level, pretty_print)3100 outfile.write('<%sValue>%s</%sValue>%s' % (namespace_, self.gds_format_boolean(self.Value, input_name='Value'), namespace_, eol_))3101 def exportLiteral(self, outfile, level, name_='MetadataBooleanValue'):3102 level += 13103 already_processed = set()3104 self.exportLiteralAttributes(outfile, level, already_processed, name_)3105 if self.hasContent_():3106 self.exportLiteralChildren(outfile, level, name_)3107 def exportLiteralAttributes(self, outfile, level, already_processed, name_):3108 super(MetadataBooleanValue, self).exportLiteralAttributes(outfile, level, already_processed, name_)3109 def exportLiteralChildren(self, outfile, level, name_):3110 super(MetadataBooleanValue, self).exportLiteralChildren(outfile, level, name_)3111 if self.Value is not None:3112 showIndent(outfile, level)3113 outfile.write('Value=%s,\n' % self.Value)3114 def build(self, node):3115 already_processed = set()3116 self.buildAttributes(node, node.attrib, already_processed)3117 for child in node:3118 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]3119 self.buildChildren(child, node, nodeName_)3120 return self3121 def buildAttributes(self, node, attrs, already_processed):3122 super(MetadataBooleanValue, self).buildAttributes(node, attrs, already_processed)3123 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):3124 if nodeName_ == 'Value':3125 sval_ = child_.text3126 if sval_ in ('true', '1'):3127 ival_ = True3128 elif sval_ in ('false', '0'):3129 ival_ = False3130 else:3131 raise_parse_error(child_, 'requires boolean')3132 ival_ = self.gds_validate_boolean(ival_, node, 'Value')3133 self.Value = ival_3134 super(MetadataBooleanValue, self).buildChildren(child_, node, nodeName_, True)3135# end class MetadataBooleanValue3136class MetadataDateTimeValue(MetadataTypedValue):3137 """UTC format. For example 2012-06-18T12:00:00-05:00"""3138 subclass = None3139 superclass = MetadataTypedValue3140 def __init__(self, Value=None):3141 self.original_tagname_ = None3142 super(MetadataDateTimeValue, self).__init__()3143 if isinstance(Value, basestring):3144 initvalue_ = datetime_.datetime.strptime(Value, '%Y-%m-%dT%H:%M:%S')3145 else:3146 initvalue_ = Value3147 self.Value = initvalue_3148 def factory(*args_, **kwargs_):3149 if MetadataDateTimeValue.subclass:3150 return MetadataDateTimeValue.subclass(*args_, **kwargs_)3151 else:3152 return MetadataDateTimeValue(*args_, **kwargs_)3153 factory = staticmethod(factory)3154 def get_Value(self): return self.Value3155 def set_Value(self, Value): self.Value = Value3156 def hasContent_(self):3157 if (3158 self.Value is not None or3159 super(MetadataDateTimeValue, self).hasContent_()3160 ):3161 return True3162 else:3163 return False3164 def export(self, outfile, level, namespace_='', name_='MetadataDateTimeValue', namespacedef_='', pretty_print=True):3165 if pretty_print:3166 eol_ = '\n'3167 else:3168 eol_ = ''3169 if self.original_tagname_ is not None:3170 name_ = self.original_tagname_3171 showIndent(outfile, level, pretty_print)3172 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))3173 already_processed = set()3174 self.exportAttributes(outfile, level, already_processed, namespace_, name_='MetadataDateTimeValue')3175 if self.hasContent_():3176 outfile.write('>%s' % (eol_, ))3177 self.exportChildren(outfile, level + 1, namespace_='', name_='MetadataDateTimeValue', pretty_print=pretty_print)3178 showIndent(outfile, level, pretty_print)3179 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))3180 else:3181 outfile.write('/>%s' % (eol_, ))3182 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='MetadataDateTimeValue'):3183 super(MetadataDateTimeValue, self).exportAttributes(outfile, level, already_processed, namespace_, name_='MetadataDateTimeValue')3184 def exportChildren(self, outfile, level, namespace_='', name_='MetadataDateTimeValue', fromsubclass_=False, pretty_print=True):3185 super(MetadataDateTimeValue, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)3186 if pretty_print:3187 eol_ = '\n'3188 else:3189 eol_ = ''3190 if self.Value is not None:3191 showIndent(outfile, level, pretty_print)3192 outfile.write('<%sValue>%s</%sValue>%s' % (namespace_, self.gds_format_datetime(self.Value, input_name='Value'), namespace_, eol_))3193 def exportLiteral(self, outfile, level, name_='MetadataDateTimeValue'):3194 level += 13195 already_processed = set()3196 self.exportLiteralAttributes(outfile, level, already_processed, name_)3197 if self.hasContent_():3198 self.exportLiteralChildren(outfile, level, name_)3199 def exportLiteralAttributes(self, outfile, level, already_processed, name_):3200 super(MetadataDateTimeValue, self).exportLiteralAttributes(outfile, level, already_processed, name_)3201 def exportLiteralChildren(self, outfile, level, name_):3202 super(MetadataDateTimeValue, self).exportLiteralChildren(outfile, level, name_)3203 if self.Value is not None:3204 showIndent(outfile, level)3205 outfile.write('Value=model_.GeneratedsSuper.gds_parse_datetime("%s"),\n' % self.gds_format_datetime(self.Value, input_name='Value'))3206 def build(self, node):3207 already_processed = set()3208 self.buildAttributes(node, node.attrib, already_processed)3209 for child in node:3210 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]3211 self.buildChildren(child, node, nodeName_)3212 return self3213 def buildAttributes(self, node, attrs, already_processed):3214 super(MetadataDateTimeValue, self).buildAttributes(node, attrs, already_processed)3215 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):3216 if nodeName_ == 'Value':3217 sval_ = child_.text3218 dval_ = self.gds_parse_datetime(sval_)3219 self.Value = dval_3220 super(MetadataDateTimeValue, self).buildChildren(child_, node, nodeName_, True)3221# end class MetadataDateTimeValue3222class MetadataType(ResourceType):3223 """User-defined metadata associated with with an object."""3224 subclass = None3225 superclass = ResourceType3226 def __init__(self, VCloudExtension=None, href=None, type_=None, Link=None, MetadataEntry=None):3227 self.original_tagname_ = None3228 super(MetadataType, self).__init__(VCloudExtension, href, type_, Link, )3229 if MetadataEntry is None:3230 self.MetadataEntry = []3231 else:3232 self.MetadataEntry = MetadataEntry3233 def factory(*args_, **kwargs_):3234 if MetadataType.subclass:3235 return MetadataType.subclass(*args_, **kwargs_)3236 else:3237 return MetadataType(*args_, **kwargs_)3238 factory = staticmethod(factory)3239 def get_MetadataEntry(self): return self.MetadataEntry3240 def set_MetadataEntry(self, MetadataEntry): self.MetadataEntry = MetadataEntry3241 def add_MetadataEntry(self, value): self.MetadataEntry.append(value)3242 def insert_MetadataEntry_at(self, index, value): self.MetadataEntry.insert(index, value)3243 def replace_MetadataEntry_at(self, index, value): self.MetadataEntry[index] = value3244 def hasContent_(self):3245 if (3246 self.MetadataEntry or3247 super(MetadataType, self).hasContent_()3248 ):3249 return True3250 else:3251 return False3252 def export(self, outfile, level, namespace_='', name_='MetadataType', namespacedef_='', pretty_print=True):3253 if pretty_print:3254 eol_ = '\n'3255 else:3256 eol_ = ''3257 if self.original_tagname_ is not None:3258 name_ = self.original_tagname_3259 showIndent(outfile, level, pretty_print)3260 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))3261 already_processed = set()3262 self.exportAttributes(outfile, level, already_processed, namespace_, name_='MetadataType')3263 if self.hasContent_():3264 outfile.write('>%s' % (eol_, ))3265 self.exportChildren(outfile, level + 1, namespace_='', name_='MetadataType', pretty_print=pretty_print)3266 showIndent(outfile, level, pretty_print)3267 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))3268 else:3269 outfile.write('/>%s' % (eol_, ))3270 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='MetadataType'):3271 super(MetadataType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='MetadataType')3272 def exportChildren(self, outfile, level, namespace_='', name_='MetadataType', fromsubclass_=False, pretty_print=True):3273 super(MetadataType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)3274 if pretty_print:3275 eol_ = '\n'3276 else:3277 eol_ = ''3278 for MetadataEntry_ in self.MetadataEntry:3279 MetadataEntry_.export(outfile, level, namespace_, name_='MetadataEntry', pretty_print=pretty_print)3280 def exportLiteral(self, outfile, level, name_='MetadataType'):3281 level += 13282 already_processed = set()3283 self.exportLiteralAttributes(outfile, level, already_processed, name_)3284 if self.hasContent_():3285 self.exportLiteralChildren(outfile, level, name_)3286 def exportLiteralAttributes(self, outfile, level, already_processed, name_):3287 super(MetadataType, self).exportLiteralAttributes(outfile, level, already_processed, name_)3288 def exportLiteralChildren(self, outfile, level, name_):3289 super(MetadataType, self).exportLiteralChildren(outfile, level, name_)3290 showIndent(outfile, level)3291 outfile.write('MetadataEntry=[\n')3292 level += 13293 for MetadataEntry_ in self.MetadataEntry:3294 showIndent(outfile, level)3295 outfile.write('model_.MetadataEntryType(\n')3296 MetadataEntry_.exportLiteral(outfile, level, name_='MetadataEntryType')3297 showIndent(outfile, level)3298 outfile.write('),\n')3299 level -= 13300 showIndent(outfile, level)3301 outfile.write('],\n')3302 def build(self, node):3303 already_processed = set()3304 self.buildAttributes(node, node.attrib, already_processed)3305 for child in node:3306 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]3307 self.buildChildren(child, node, nodeName_)3308 return self3309 def buildAttributes(self, node, attrs, already_processed):3310 super(MetadataType, self).buildAttributes(node, attrs, already_processed)3311 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):3312 if nodeName_ == 'MetadataEntry':3313 obj_ = MetadataEntryType.factory()3314 obj_.build(child_)3315 self.MetadataEntry.append(obj_)3316 obj_.original_tagname_ = 'MetadataEntry'3317 super(MetadataType, self).buildChildren(child_, node, nodeName_, True)3318# end class MetadataType3319class MetadataValueType(ResourceType):3320 subclass = None3321 superclass = ResourceType3322 def __init__(self, VCloudExtension=None, href=None, type_=None, Link=None, Domain=None, Value=None, TypedValue=None):3323 self.original_tagname_ = None3324 super(MetadataValueType, self).__init__(VCloudExtension, href, type_, Link, )3325 self.Domain = Domain3326 self.Value = Value3327 self.TypedValue = TypedValue3328 def factory(*args_, **kwargs_):3329 if MetadataValueType.subclass:3330 return MetadataValueType.subclass(*args_, **kwargs_)3331 else:3332 return MetadataValueType(*args_, **kwargs_)3333 factory = staticmethod(factory)3334 def get_Domain(self): return self.Domain3335 def set_Domain(self, Domain): self.Domain = Domain3336 def get_Value(self): return self.Value3337 def set_Value(self, Value): self.Value = Value3338 def get_TypedValue(self): return self.TypedValue3339 def set_TypedValue(self, TypedValue): self.TypedValue = TypedValue3340 def hasContent_(self):3341 if (3342 self.Domain is not None or3343 self.Value is not None or3344 self.TypedValue is not None or3345 super(MetadataValueType, self).hasContent_()3346 ):3347 return True3348 else:3349 return False3350 def export(self, outfile, level, namespace_='', name_='MetadataValueType', namespacedef_='', pretty_print=True):3351 if pretty_print:3352 eol_ = '\n'3353 else:3354 eol_ = ''3355 if self.original_tagname_ is not None:3356 name_ = self.original_tagname_3357 showIndent(outfile, level, pretty_print)3358 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))3359 already_processed = set()3360 self.exportAttributes(outfile, level, already_processed, namespace_, name_='MetadataValueType')3361 if self.hasContent_():3362 outfile.write('>%s' % (eol_, ))3363 self.exportChildren(outfile, level + 1, namespace_='', name_='MetadataValueType', pretty_print=pretty_print)3364 showIndent(outfile, level, pretty_print)3365 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))3366 else:3367 outfile.write('/>%s' % (eol_, ))3368 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='MetadataValueType'):3369 super(MetadataValueType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='MetadataValueType')3370 def exportChildren(self, outfile, level, namespace_='', name_='MetadataValueType', fromsubclass_=False, pretty_print=True):3371 super(MetadataValueType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)3372 if pretty_print:3373 eol_ = '\n'3374 else:3375 eol_ = ''3376 if self.Domain is not None:3377 self.Domain.export(outfile, level, namespace_, name_='Domain', pretty_print=pretty_print)3378 if self.Value is not None:3379 showIndent(outfile, level, pretty_print)3380 outfile.write('<%sValue>%s</%sValue>%s' % (namespace_, self.gds_format_string(quote_xml(self.Value).encode(ExternalEncoding), input_name='Value'), namespace_, eol_))3381 if self.TypedValue is not None:3382 self.TypedValue.export(outfile, level, namespace_, name_='TypedValue', pretty_print=pretty_print)3383 def exportLiteral(self, outfile, level, name_='MetadataValueType'):3384 level += 13385 already_processed = set()3386 self.exportLiteralAttributes(outfile, level, already_processed, name_)3387 if self.hasContent_():3388 self.exportLiteralChildren(outfile, level, name_)3389 def exportLiteralAttributes(self, outfile, level, already_processed, name_):3390 super(MetadataValueType, self).exportLiteralAttributes(outfile, level, already_processed, name_)3391 def exportLiteralChildren(self, outfile, level, name_):3392 super(MetadataValueType, self).exportLiteralChildren(outfile, level, name_)3393 if self.Domain is not None:3394 showIndent(outfile, level)3395 outfile.write('Domain=model_.MetadataDomainTagType(\n')3396 self.Domain.exportLiteral(outfile, level, name_='Domain')3397 showIndent(outfile, level)3398 outfile.write('),\n')3399 if self.Value is not None:3400 showIndent(outfile, level)3401 outfile.write('Value=%s,\n' % quote_python(self.Value).encode(ExternalEncoding))3402 if self.MetadataTypedValue is not None:3403 showIndent(outfile, level)3404 outfile.write('MetadataTypedValue=model_.MetadataTypedValue(\n')3405 self.MetadataTypedValue.exportLiteral(outfile, level)3406 showIndent(outfile, level)3407 outfile.write('),\n')3408 def build(self, node):3409 already_processed = set()3410 self.buildAttributes(node, node.attrib, already_processed)3411 for child in node:3412 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]3413 self.buildChildren(child, node, nodeName_)3414 return self3415 def buildAttributes(self, node, attrs, already_processed):3416 super(MetadataValueType, self).buildAttributes(node, attrs, already_processed)3417 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):3418 if nodeName_ == 'Domain':3419 obj_ = MetadataDomainTagType.factory()3420 obj_.build(child_)3421 self.Domain = obj_3422 obj_.original_tagname_ = 'Domain'3423 elif nodeName_ == 'Value':3424 Value_ = child_.text3425 Value_ = self.gds_validate_string(Value_, node, 'Value')3426 self.Value = Value_3427 elif nodeName_ == 'TypedValue':3428 type_name_ = child_.attrib.get(3429 '{http://www.w3.org/2001/XMLSchema-instance}type')3430 if type_name_ is None:3431 type_name_ = child_.attrib.get('type')3432 if type_name_ is not None:3433 type_names_ = type_name_.split(':')3434 if len(type_names_) == 1:3435 type_name_ = type_names_[0]3436 else:3437 type_name_ = type_names_[1]3438 class_ = globals()[type_name_]3439 obj_ = class_.factory()3440 obj_.build(child_)3441 else:3442 raise NotImplementedError(3443 'Class not implemented for <TypedValue> element')3444 self.TypedValue = obj_3445 obj_.original_tagname_ = 'TypedValue'3446 super(MetadataValueType, self).buildChildren(child_, node, nodeName_, True)3447# end class MetadataValueType3448class FileUploadParamsType(VCloudExtensibleType):3449 """5.1 Parameters for initializing file upload session. create Size in3450 bytes of the file which will be uploaded. true"""3451 subclass = None3452 superclass = VCloudExtensibleType3453 def __init__(self, VCloudExtension=None, fileSize=None):3454 self.original_tagname_ = None3455 super(FileUploadParamsType, self).__init__(VCloudExtension, )3456 self.fileSize = _cast(int, fileSize)3457 def factory(*args_, **kwargs_):3458 if FileUploadParamsType.subclass:3459 return FileUploadParamsType.subclass(*args_, **kwargs_)3460 else:3461 return FileUploadParamsType(*args_, **kwargs_)3462 factory = staticmethod(factory)3463 def get_fileSize(self): return self.fileSize3464 def set_fileSize(self, fileSize): self.fileSize = fileSize3465 def hasContent_(self):3466 if (3467 super(FileUploadParamsType, self).hasContent_()3468 ):3469 return True3470 else:3471 return False3472 def export(self, outfile, level, namespace_='', name_='FileUploadParamsType', namespacedef_='', pretty_print=True):3473 if pretty_print:3474 eol_ = '\n'3475 else:3476 eol_ = ''3477 if self.original_tagname_ is not None:3478 name_ = self.original_tagname_3479 showIndent(outfile, level, pretty_print)3480 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))3481 already_processed = set()3482 self.exportAttributes(outfile, level, already_processed, namespace_, name_='FileUploadParamsType')3483 if self.hasContent_():3484 outfile.write('>%s' % (eol_, ))3485 self.exportChildren(outfile, level + 1, namespace_='', name_='FileUploadParamsType', pretty_print=pretty_print)3486 showIndent(outfile, level, pretty_print)3487 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))3488 else:3489 outfile.write('/>%s' % (eol_, ))3490 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='FileUploadParamsType'):3491 super(FileUploadParamsType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='FileUploadParamsType')3492 if self.fileSize is not None and 'fileSize' not in already_processed:3493 already_processed.add('fileSize')3494 outfile.write(' fileSize="%s"' % self.gds_format_integer(self.fileSize, input_name='fileSize'))3495 def exportChildren(self, outfile, level, namespace_='', name_='FileUploadParamsType', fromsubclass_=False, pretty_print=True):3496 super(FileUploadParamsType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)3497 def exportLiteral(self, outfile, level, name_='FileUploadParamsType'):3498 level += 13499 already_processed = set()3500 self.exportLiteralAttributes(outfile, level, already_processed, name_)3501 if self.hasContent_():3502 self.exportLiteralChildren(outfile, level, name_)3503 def exportLiteralAttributes(self, outfile, level, already_processed, name_):3504 if self.fileSize is not None and 'fileSize' not in already_processed:3505 already_processed.add('fileSize')3506 showIndent(outfile, level)3507 outfile.write('fileSize=%d,\n' % (self.fileSize,))3508 super(FileUploadParamsType, self).exportLiteralAttributes(outfile, level, already_processed, name_)3509 def exportLiteralChildren(self, outfile, level, name_):3510 super(FileUploadParamsType, self).exportLiteralChildren(outfile, level, name_)3511 def build(self, node):3512 already_processed = set()3513 self.buildAttributes(node, node.attrib, already_processed)3514 for child in node:3515 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]3516 self.buildChildren(child, node, nodeName_)3517 return self3518 def buildAttributes(self, node, attrs, already_processed):3519 value = find_attr_value_('fileSize', node)3520 if value is not None and 'fileSize' not in already_processed:3521 already_processed.add('fileSize')3522 try:3523 self.fileSize = int(value)3524 except ValueError, exp:3525 raise_parse_error(node, 'Bad integer attribute: %s' % exp)3526 super(FileUploadParamsType, self).buildAttributes(node, attrs, already_processed)3527 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):3528 super(FileUploadParamsType, self).buildChildren(child_, node, nodeName_, True)3529 pass3530# end class FileUploadParamsType3531class FileUploadSocketType(VCloudExtensibleType):3532 """5.1 Parameters for initiating file upload. none URL where the file3533 must be uploaded. false"""3534 subclass = None3535 superclass = VCloudExtensibleType3536 def __init__(self, VCloudExtension=None, uploadLocation=None, Task=None):3537 self.original_tagname_ = None3538 super(FileUploadSocketType, self).__init__(VCloudExtension, )3539 self.uploadLocation = _cast(None, uploadLocation)3540 self.Task = Task3541 def factory(*args_, **kwargs_):3542 if FileUploadSocketType.subclass:3543 return FileUploadSocketType.subclass(*args_, **kwargs_)3544 else:3545 return FileUploadSocketType(*args_, **kwargs_)3546 factory = staticmethod(factory)3547 def get_Task(self): return self.Task3548 def set_Task(self, Task): self.Task = Task3549 def get_uploadLocation(self): return self.uploadLocation3550 def set_uploadLocation(self, uploadLocation): self.uploadLocation = uploadLocation3551 def hasContent_(self):3552 if (3553 self.Task is not None or3554 super(FileUploadSocketType, self).hasContent_()3555 ):3556 return True3557 else:3558 return False3559 def export(self, outfile, level, namespace_='', name_='FileUploadSocketType', namespacedef_='', pretty_print=True):3560 if pretty_print:3561 eol_ = '\n'3562 else:3563 eol_ = ''3564 if self.original_tagname_ is not None:3565 name_ = self.original_tagname_3566 showIndent(outfile, level, pretty_print)3567 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))3568 already_processed = set()3569 self.exportAttributes(outfile, level, already_processed, namespace_, name_='FileUploadSocketType')3570 if self.hasContent_():3571 outfile.write('>%s' % (eol_, ))3572 self.exportChildren(outfile, level + 1, namespace_='', name_='FileUploadSocketType', pretty_print=pretty_print)3573 showIndent(outfile, level, pretty_print)3574 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))3575 else:3576 outfile.write('/>%s' % (eol_, ))3577 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='FileUploadSocketType'):3578 super(FileUploadSocketType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='FileUploadSocketType')3579 if self.uploadLocation is not None and 'uploadLocation' not in already_processed:3580 already_processed.add('uploadLocation')3581 outfile.write(' uploadLocation=%s' % (self.gds_format_string(quote_attrib(self.uploadLocation).encode(ExternalEncoding), input_name='uploadLocation'), ))3582 def exportChildren(self, outfile, level, namespace_='', name_='FileUploadSocketType', fromsubclass_=False, pretty_print=True):3583 super(FileUploadSocketType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)3584 if pretty_print:3585 eol_ = '\n'3586 else:3587 eol_ = ''3588 if self.Task is not None:3589 self.Task.export(outfile, level, namespace_, name_='Task', pretty_print=pretty_print)3590 def exportLiteral(self, outfile, level, name_='FileUploadSocketType'):3591 level += 13592 already_processed = set()3593 self.exportLiteralAttributes(outfile, level, already_processed, name_)3594 if self.hasContent_():3595 self.exportLiteralChildren(outfile, level, name_)3596 def exportLiteralAttributes(self, outfile, level, already_processed, name_):3597 if self.uploadLocation is not None and 'uploadLocation' not in already_processed:3598 already_processed.add('uploadLocation')3599 showIndent(outfile, level)3600 outfile.write('uploadLocation="%s",\n' % (self.uploadLocation,))3601 super(FileUploadSocketType, self).exportLiteralAttributes(outfile, level, already_processed, name_)3602 def exportLiteralChildren(self, outfile, level, name_):3603 super(FileUploadSocketType, self).exportLiteralChildren(outfile, level, name_)3604 if self.Task is not None:3605 showIndent(outfile, level)3606 outfile.write('Task=model_.TaskType(\n')3607 self.Task.exportLiteral(outfile, level, name_='Task')3608 showIndent(outfile, level)3609 outfile.write('),\n')3610 def build(self, node):3611 already_processed = set()3612 self.buildAttributes(node, node.attrib, already_processed)3613 for child in node:3614 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]3615 self.buildChildren(child, node, nodeName_)3616 return self3617 def buildAttributes(self, node, attrs, already_processed):3618 value = find_attr_value_('uploadLocation', node)3619 if value is not None and 'uploadLocation' not in already_processed:3620 already_processed.add('uploadLocation')3621 self.uploadLocation = value3622 super(FileUploadSocketType, self).buildAttributes(node, attrs, already_processed)3623 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):3624 if nodeName_ == 'Task':3625 obj_ = TaskType.factory()3626 obj_.build(child_)3627 self.Task = obj_3628 obj_.original_tagname_ = 'Task'3629 super(FileUploadSocketType, self).buildChildren(child_, node, nodeName_, True)3630# end class FileUploadSocketType3631class TaskOperationListType(ResourceType):3632 """List of operation names. 1.5"""3633 subclass = None3634 superclass = ResourceType3635 def __init__(self, VCloudExtension=None, href=None, type_=None, Link=None, Operation=None):3636 self.original_tagname_ = None3637 super(TaskOperationListType, self).__init__(VCloudExtension, href, type_, Link, )3638 if Operation is None:3639 self.Operation = []3640 else:3641 self.Operation = Operation3642 def factory(*args_, **kwargs_):3643 if TaskOperationListType.subclass:3644 return TaskOperationListType.subclass(*args_, **kwargs_)3645 else:3646 return TaskOperationListType(*args_, **kwargs_)3647 factory = staticmethod(factory)3648 def get_Operation(self): return self.Operation3649 def set_Operation(self, Operation): self.Operation = Operation3650 def add_Operation(self, value): self.Operation.append(value)3651 def insert_Operation_at(self, index, value): self.Operation.insert(index, value)3652 def replace_Operation_at(self, index, value): self.Operation[index] = value3653 def hasContent_(self):3654 if (3655 self.Operation or3656 super(TaskOperationListType, self).hasContent_()3657 ):3658 return True3659 else:3660 return False3661 def export(self, outfile, level, namespace_='', name_='TaskOperationListType', namespacedef_='', pretty_print=True):3662 if pretty_print:3663 eol_ = '\n'3664 else:3665 eol_ = ''3666 if self.original_tagname_ is not None:3667 name_ = self.original_tagname_3668 showIndent(outfile, level, pretty_print)3669 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))3670 already_processed = set()3671 self.exportAttributes(outfile, level, already_processed, namespace_, name_='TaskOperationListType')3672 if self.hasContent_():3673 outfile.write('>%s' % (eol_, ))3674 self.exportChildren(outfile, level + 1, namespace_='', name_='TaskOperationListType', pretty_print=pretty_print)3675 showIndent(outfile, level, pretty_print)3676 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))3677 else:3678 outfile.write('/>%s' % (eol_, ))3679 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='TaskOperationListType'):3680 super(TaskOperationListType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='TaskOperationListType')3681 def exportChildren(self, outfile, level, namespace_='', name_='TaskOperationListType', fromsubclass_=False, pretty_print=True):3682 super(TaskOperationListType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)3683 if pretty_print:3684 eol_ = '\n'3685 else:3686 eol_ = ''3687 for Operation_ in self.Operation:3688 showIndent(outfile, level, pretty_print)3689 outfile.write('<%sOperation>%s</%sOperation>%s' % (namespace_, self.gds_format_string(quote_xml(Operation_).encode(ExternalEncoding), input_name='Operation'), namespace_, eol_))3690 def exportLiteral(self, outfile, level, name_='TaskOperationListType'):3691 level += 13692 already_processed = set()3693 self.exportLiteralAttributes(outfile, level, already_processed, name_)3694 if self.hasContent_():3695 self.exportLiteralChildren(outfile, level, name_)3696 def exportLiteralAttributes(self, outfile, level, already_processed, name_):3697 super(TaskOperationListType, self).exportLiteralAttributes(outfile, level, already_processed, name_)3698 def exportLiteralChildren(self, outfile, level, name_):3699 super(TaskOperationListType, self).exportLiteralChildren(outfile, level, name_)3700 showIndent(outfile, level)3701 outfile.write('Operation=[\n')3702 level += 13703 for Operation_ in self.Operation:3704 showIndent(outfile, level)3705 outfile.write('%s,\n' % quote_python(Operation_).encode(ExternalEncoding))3706 level -= 13707 showIndent(outfile, level)3708 outfile.write('],\n')3709 def build(self, node):3710 already_processed = set()3711 self.buildAttributes(node, node.attrib, already_processed)3712 for child in node:3713 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]3714 self.buildChildren(child, node, nodeName_)3715 return self3716 def buildAttributes(self, node, attrs, already_processed):3717 super(TaskOperationListType, self).buildAttributes(node, attrs, already_processed)3718 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):3719 if nodeName_ == 'Operation':3720 Operation_ = child_.text3721 Operation_ = self.gds_validate_string(Operation_, node, 'Operation')3722 self.Operation.append(Operation_)3723 super(TaskOperationListType, self).buildChildren(child_, node, nodeName_, True)3724# end class TaskOperationListType3725class EntityType(IdentifiableResourceType):3726 """0.9 Basic entity type in the vCloud object model. Includes a name,3727 an optional description, and an optional list of links. always3728 The name of the entity. true"""3729 subclass = None3730 superclass = IdentifiableResourceType3731 def __init__(self, VCloudExtension=None, href=None, type_=None, Link=None, operationKey=None, id=None, name=None, Description=None, Tasks=None, extensiontype_=None):3732 self.original_tagname_ = None3733 super(EntityType, self).__init__(VCloudExtension, href, type_, Link, operationKey, id, extensiontype_, )3734 self.name = _cast(None, name)3735 self.Description = Description3736 self.Tasks = Tasks3737 self.extensiontype_ = extensiontype_3738 def factory(*args_, **kwargs_):3739 if EntityType.subclass:3740 return EntityType.subclass(*args_, **kwargs_)3741 else:3742 return EntityType(*args_, **kwargs_)3743 factory = staticmethod(factory)3744 def get_Description(self): return self.Description3745 def set_Description(self, Description): self.Description = Description3746 def get_Tasks(self): return self.Tasks3747 def set_Tasks(self, Tasks): self.Tasks = Tasks3748 def get_name(self): return self.name3749 def set_name(self, name): self.name = name3750 def get_extensiontype_(self): return self.extensiontype_3751 def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_3752 def hasContent_(self):3753 if (3754 self.Description is not None or3755 self.Tasks is not None or3756 super(EntityType, self).hasContent_()3757 ):3758 return True3759 else:3760 return False3761 def export(self, outfile, level, namespace_='', name_='EntityType', namespacedef_='', pretty_print=True):3762 if pretty_print:3763 eol_ = '\n'3764 else:3765 eol_ = ''3766 if self.original_tagname_ is not None:3767 name_ = self.original_tagname_3768 showIndent(outfile, level, pretty_print)3769 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))3770 already_processed = set()3771 self.exportAttributes(outfile, level, already_processed, namespace_, name_='EntityType')3772 if self.hasContent_():3773 outfile.write('>%s' % (eol_, ))3774 self.exportChildren(outfile, level + 1, namespace_='', name_='EntityType', pretty_print=pretty_print)3775 showIndent(outfile, level, pretty_print)3776 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))3777 else:3778 outfile.write('/>%s' % (eol_, ))3779 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='EntityType'):3780 super(EntityType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='EntityType')3781 if self.name is not None and 'name' not in already_processed:3782 already_processed.add('name')3783 outfile.write(' name=%s' % (self.gds_format_string(quote_attrib(self.name).encode(ExternalEncoding), input_name='name'), ))3784 if self.extensiontype_ is not None and 'xsi:type' not in already_processed:3785 already_processed.add('xsi:type')3786 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')3787 outfile.write(' xsi:type="%s"' % self.extensiontype_)3788 def exportChildren(self, outfile, level, namespace_='', name_='EntityType', fromsubclass_=False, pretty_print=True):3789 super(EntityType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)3790 if pretty_print:3791 eol_ = '\n'3792 else:3793 eol_ = ''3794 if self.Description is not None:3795 showIndent(outfile, level, pretty_print)3796 outfile.write('<%sDescription>%s</%sDescription>%s' % (namespace_, self.gds_format_string(quote_xml(self.Description).encode(ExternalEncoding), input_name='Description'), namespace_, eol_))3797 if self.Tasks is not None:3798 self.Tasks.export(outfile, level, namespace_, name_='Tasks', pretty_print=pretty_print)3799 def exportLiteral(self, outfile, level, name_='EntityType'):3800 level += 13801 already_processed = set()3802 self.exportLiteralAttributes(outfile, level, already_processed, name_)3803 if self.hasContent_():3804 self.exportLiteralChildren(outfile, level, name_)3805 def exportLiteralAttributes(self, outfile, level, already_processed, name_):3806 if self.name is not None and 'name' not in already_processed:3807 already_processed.add('name')3808 showIndent(outfile, level)3809 outfile.write('name="%s",\n' % (self.name,))3810 super(EntityType, self).exportLiteralAttributes(outfile, level, already_processed, name_)3811 def exportLiteralChildren(self, outfile, level, name_):3812 super(EntityType, self).exportLiteralChildren(outfile, level, name_)3813 if self.Description is not None:3814 showIndent(outfile, level)3815 outfile.write('Description=%s,\n' % quote_python(self.Description).encode(ExternalEncoding))3816 if self.Tasks is not None:3817 showIndent(outfile, level)3818 outfile.write('Tasks=model_.TasksInProgressType(\n')3819 self.Tasks.exportLiteral(outfile, level, name_='Tasks')3820 showIndent(outfile, level)3821 outfile.write('),\n')3822 def build(self, node):3823 already_processed = set()3824 self.buildAttributes(node, node.attrib, already_processed)3825 for child in node:3826 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]3827 self.buildChildren(child, node, nodeName_)3828 return self3829 def buildAttributes(self, node, attrs, already_processed):3830 value = find_attr_value_('name', node)3831 if value is not None and 'name' not in already_processed:3832 already_processed.add('name')3833 self.name = value3834 value = find_attr_value_('xsi:type', node)3835 if value is not None and 'xsi:type' not in already_processed:3836 already_processed.add('xsi:type')3837 self.extensiontype_ = value3838 super(EntityType, self).buildAttributes(node, attrs, already_processed)3839 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):3840 if nodeName_ == 'Description':3841 Description_ = child_.text3842 Description_ = self.gds_validate_string(Description_, node, 'Description')3843 self.Description = Description_3844 elif nodeName_ == 'Tasks':3845 obj_ = TasksInProgressType.factory()3846 obj_.build(child_)3847 self.Tasks = obj_3848 obj_.original_tagname_ = 'Tasks'3849 super(EntityType, self).buildChildren(child_, node, nodeName_, True)3850# end class EntityType3851class EntityReferenceType(VCloudExtensibleType):3852 """1.5 A reference to a vCloud entity. none The object identifier,3853 expressed in URN format. The value of this attribute uniquely3854 identifies the object, persists for the life of the object, and3855 is never reused. This context-free identifier can apply to any3856 object in any system. truealways The type of the the referenced3857 object. falsealways The name of the referenced object. false"""3858 subclass = None3859 superclass = VCloudExtensibleType3860 def __init__(self, VCloudExtension=None, type_=None, id=None, name=None, extensiontype_=None):3861 self.original_tagname_ = None3862 super(EntityReferenceType, self).__init__(VCloudExtension, extensiontype_, )3863 self.type_ = _cast(None, type_)3864 self.id = _cast(None, id)3865 self.name = _cast(None, name)3866 self.extensiontype_ = extensiontype_3867 def factory(*args_, **kwargs_):3868 if EntityReferenceType.subclass:3869 return EntityReferenceType.subclass(*args_, **kwargs_)3870 else:3871 return EntityReferenceType(*args_, **kwargs_)3872 factory = staticmethod(factory)3873 def get_type(self): return self.type_3874 def set_type(self, type_): self.type_ = type_3875 def get_id(self): return self.id3876 def set_id(self, id): self.id = id3877 def get_name(self): return self.name3878 def set_name(self, name): self.name = name3879 def get_extensiontype_(self): return self.extensiontype_3880 def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_3881 def hasContent_(self):3882 if (3883 super(EntityReferenceType, self).hasContent_()3884 ):3885 return True3886 else:3887 return False3888 def export(self, outfile, level, namespace_='', name_='EntityReferenceType', namespacedef_='', pretty_print=True):3889 if pretty_print:3890 eol_ = '\n'3891 else:3892 eol_ = ''3893 if self.original_tagname_ is not None:3894 name_ = self.original_tagname_3895 showIndent(outfile, level, pretty_print)3896 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))3897 already_processed = set()3898 self.exportAttributes(outfile, level, already_processed, namespace_, name_='EntityReferenceType')3899 if self.hasContent_():3900 outfile.write('>%s' % (eol_, ))3901 self.exportChildren(outfile, level + 1, namespace_='', name_='EntityReferenceType', pretty_print=pretty_print)3902 showIndent(outfile, level, pretty_print)3903 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))3904 else:3905 outfile.write('/>%s' % (eol_, ))3906 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='EntityReferenceType'):3907 super(EntityReferenceType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='EntityReferenceType')3908 if self.type_ is not None and 'type_' not in already_processed:3909 already_processed.add('type_')3910 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))3911 if self.id is not None and 'id' not in already_processed:3912 already_processed.add('id')3913 outfile.write(' id=%s' % (self.gds_format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))3914 if self.name is not None and 'name' not in already_processed:3915 already_processed.add('name')3916 outfile.write(' name=%s' % (self.gds_format_string(quote_attrib(self.name).encode(ExternalEncoding), input_name='name'), ))3917 if self.extensiontype_ is not None and 'xsi:type' not in already_processed:3918 already_processed.add('xsi:type')3919 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')3920 outfile.write(' xsi:type="%s"' % self.extensiontype_)3921 def exportChildren(self, outfile, level, namespace_='', name_='EntityReferenceType', fromsubclass_=False, pretty_print=True):3922 super(EntityReferenceType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)3923 def exportLiteral(self, outfile, level, name_='EntityReferenceType'):3924 level += 13925 already_processed = set()3926 self.exportLiteralAttributes(outfile, level, already_processed, name_)3927 if self.hasContent_():3928 self.exportLiteralChildren(outfile, level, name_)3929 def exportLiteralAttributes(self, outfile, level, already_processed, name_):3930 if self.type_ is not None and 'type_' not in already_processed:3931 already_processed.add('type_')3932 showIndent(outfile, level)3933 outfile.write('type_="%s",\n' % (self.type_,))3934 if self.id is not None and 'id' not in already_processed:3935 already_processed.add('id')3936 showIndent(outfile, level)3937 outfile.write('id="%s",\n' % (self.id,))3938 if self.name is not None and 'name' not in already_processed:3939 already_processed.add('name')3940 showIndent(outfile, level)3941 outfile.write('name="%s",\n' % (self.name,))3942 super(EntityReferenceType, self).exportLiteralAttributes(outfile, level, already_processed, name_)3943 def exportLiteralChildren(self, outfile, level, name_):3944 super(EntityReferenceType, self).exportLiteralChildren(outfile, level, name_)3945 def build(self, node):3946 already_processed = set()3947 self.buildAttributes(node, node.attrib, already_processed)3948 for child in node:3949 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]3950 self.buildChildren(child, node, nodeName_)3951 return self3952 def buildAttributes(self, node, attrs, already_processed):3953 value = find_attr_value_('type', node)3954 if value is not None and 'type' not in already_processed:3955 already_processed.add('type')3956 self.type_ = value3957 value = find_attr_value_('id', node)3958 if value is not None and 'id' not in already_processed:3959 already_processed.add('id')3960 self.id = value3961 value = find_attr_value_('name', node)3962 if value is not None and 'name' not in already_processed:3963 already_processed.add('name')3964 self.name = value3965 value = find_attr_value_('xsi:type', node)3966 if value is not None and 'xsi:type' not in already_processed:3967 already_processed.add('xsi:type')3968 self.extensiontype_ = value3969 super(EntityReferenceType, self).buildAttributes(node, attrs, already_processed)3970 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):3971 super(EntityReferenceType, self).buildChildren(child_, node, nodeName_, True)3972 pass3973# end class EntityReferenceType3974class EntityLinkType(EntityReferenceType):3975 """1.5 Extends EntityReference type by adding relation attribute.3976 always Defines the relationship of the link to the object that3977 contains it. A relationship can be the name of an operation on3978 the object, a reference to a contained or containing object, or3979 a reference to an alternate representation of the object. The3980 relationship value implies the HTTP verb to use when you use the3981 link's href value as a request URL. true"""3982 subclass = None3983 superclass = EntityReferenceType3984 def __init__(self, VCloudExtension=None, type_=None, id=None, name=None, rel=None):3985 self.original_tagname_ = None3986 super(EntityLinkType, self).__init__(VCloudExtension, type_, id, name, )3987 self.rel = _cast(None, rel)3988 def factory(*args_, **kwargs_):3989 if EntityLinkType.subclass:3990 return EntityLinkType.subclass(*args_, **kwargs_)3991 else:3992 return EntityLinkType(*args_, **kwargs_)3993 factory = staticmethod(factory)3994 def get_rel(self): return self.rel3995 def set_rel(self, rel): self.rel = rel3996 def hasContent_(self):3997 if (3998 super(EntityLinkType, self).hasContent_()3999 ):4000 return True4001 else:4002 return False4003 def export(self, outfile, level, namespace_='', name_='EntityLinkType', namespacedef_='', pretty_print=True):4004 if pretty_print:4005 eol_ = '\n'4006 else:4007 eol_ = ''4008 if self.original_tagname_ is not None:4009 name_ = self.original_tagname_4010 showIndent(outfile, level, pretty_print)4011 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))4012 already_processed = set()4013 self.exportAttributes(outfile, level, already_processed, namespace_, name_='EntityLinkType')4014 if self.hasContent_():4015 outfile.write('>%s' % (eol_, ))4016 self.exportChildren(outfile, level + 1, namespace_='', name_='EntityLinkType', pretty_print=pretty_print)4017 showIndent(outfile, level, pretty_print)4018 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))4019 else:4020 outfile.write('/>%s' % (eol_, ))4021 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='EntityLinkType'):4022 super(EntityLinkType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='EntityLinkType')4023 if self.rel is not None and 'rel' not in already_processed:4024 already_processed.add('rel')4025 outfile.write(' rel=%s' % (self.gds_format_string(quote_attrib(self.rel).encode(ExternalEncoding), input_name='rel'), ))4026 def exportChildren(self, outfile, level, namespace_='', name_='EntityLinkType', fromsubclass_=False, pretty_print=True):4027 super(EntityLinkType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)4028 def exportLiteral(self, outfile, level, name_='EntityLinkType'):4029 level += 14030 already_processed = set()4031 self.exportLiteralAttributes(outfile, level, already_processed, name_)4032 if self.hasContent_():4033 self.exportLiteralChildren(outfile, level, name_)4034 def exportLiteralAttributes(self, outfile, level, already_processed, name_):4035 if self.rel is not None and 'rel' not in already_processed:4036 already_processed.add('rel')4037 showIndent(outfile, level)4038 outfile.write('rel="%s",\n' % (self.rel,))4039 super(EntityLinkType, self).exportLiteralAttributes(outfile, level, already_processed, name_)4040 def exportLiteralChildren(self, outfile, level, name_):4041 super(EntityLinkType, self).exportLiteralChildren(outfile, level, name_)4042 def build(self, node):4043 already_processed = set()4044 self.buildAttributes(node, node.attrib, already_processed)4045 for child in node:4046 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]4047 self.buildChildren(child, node, nodeName_)4048 return self4049 def buildAttributes(self, node, attrs, already_processed):4050 value = find_attr_value_('rel', node)4051 if value is not None and 'rel' not in already_processed:4052 already_processed.add('rel')4053 self.rel = value4054 super(EntityLinkType, self).buildAttributes(node, attrs, already_processed)4055 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):4056 super(EntityLinkType, self).buildChildren(child_, node, nodeName_, True)4057 pass4058# end class EntityLinkType4059class TasksInProgressType(VCloudExtensibleType):4060 """0.9 A list of queued, running, or recently completed tasks."""4061 subclass = None4062 superclass = VCloudExtensibleType4063 def __init__(self, VCloudExtension=None, Task=None):4064 self.original_tagname_ = None4065 super(TasksInProgressType, self).__init__(VCloudExtension, )4066 if Task is None:4067 self.Task = []4068 else:4069 self.Task = Task4070 def factory(*args_, **kwargs_):4071 if TasksInProgressType.subclass:4072 return TasksInProgressType.subclass(*args_, **kwargs_)4073 else:4074 return TasksInProgressType(*args_, **kwargs_)4075 factory = staticmethod(factory)4076 def get_Task(self): return self.Task4077 def set_Task(self, Task): self.Task = Task4078 def add_Task(self, value): self.Task.append(value)4079 def insert_Task_at(self, index, value): self.Task.insert(index, value)4080 def replace_Task_at(self, index, value): self.Task[index] = value4081 def hasContent_(self):4082 if (4083 self.Task or4084 super(TasksInProgressType, self).hasContent_()4085 ):4086 return True4087 else:4088 return False4089 def export(self, outfile, level, namespace_='', name_='TasksInProgressType', namespacedef_='', pretty_print=True):4090 if pretty_print:4091 eol_ = '\n'4092 else:4093 eol_ = ''4094 if self.original_tagname_ is not None:4095 name_ = self.original_tagname_4096 showIndent(outfile, level, pretty_print)4097 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))4098 already_processed = set()4099 self.exportAttributes(outfile, level, already_processed, namespace_, name_='TasksInProgressType')4100 if self.hasContent_():4101 outfile.write('>%s' % (eol_, ))4102 self.exportChildren(outfile, level + 1, namespace_='', name_='TasksInProgressType', pretty_print=pretty_print)4103 showIndent(outfile, level, pretty_print)4104 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))4105 else:4106 outfile.write('/>%s' % (eol_, ))4107 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='TasksInProgressType'):4108 super(TasksInProgressType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='TasksInProgressType')4109 def exportChildren(self, outfile, level, namespace_='', name_='TasksInProgressType', fromsubclass_=False, pretty_print=True):4110 super(TasksInProgressType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)4111 if pretty_print:4112 eol_ = '\n'4113 else:4114 eol_ = ''4115 for Task_ in self.Task:4116 Task_.export(outfile, level, namespace_, name_='Task', pretty_print=pretty_print)4117 def exportLiteral(self, outfile, level, name_='TasksInProgressType'):4118 level += 14119 already_processed = set()4120 self.exportLiteralAttributes(outfile, level, already_processed, name_)4121 if self.hasContent_():4122 self.exportLiteralChildren(outfile, level, name_)4123 def exportLiteralAttributes(self, outfile, level, already_processed, name_):4124 super(TasksInProgressType, self).exportLiteralAttributes(outfile, level, already_processed, name_)4125 def exportLiteralChildren(self, outfile, level, name_):4126 super(TasksInProgressType, self).exportLiteralChildren(outfile, level, name_)4127 showIndent(outfile, level)4128 outfile.write('Task=[\n')4129 level += 14130 for Task_ in self.Task:4131 showIndent(outfile, level)4132 outfile.write('model_.TaskType(\n')4133 Task_.exportLiteral(outfile, level, name_='TaskType')4134 showIndent(outfile, level)4135 outfile.write('),\n')4136 level -= 14137 showIndent(outfile, level)4138 outfile.write('],\n')4139 def build(self, node):4140 already_processed = set()4141 self.buildAttributes(node, node.attrib, already_processed)4142 for child in node:4143 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]4144 self.buildChildren(child, node, nodeName_)4145 return self4146 def buildAttributes(self, node, attrs, already_processed):4147 super(TasksInProgressType, self).buildAttributes(node, attrs, already_processed)4148 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):4149 if nodeName_ == 'Task':4150 obj_ = TaskType.factory()4151 obj_.build(child_)4152 self.Task.append(obj_)4153 obj_.original_tagname_ = 'Task'4154 super(TasksInProgressType, self).buildChildren(child_, node, nodeName_, True)4155# end class TasksInProgressType4156class ResourceEntityType(EntityType):4157 """0.9 Base type that represents a resource entity such as a vApp4158 template or virtual media. none Creation status of the resource4159 entity. false"""4160 subclass = None4161 superclass = EntityType4162 def __init__(self, VCloudExtension=None, href=None, type_=None, Link=None, operationKey=None, id=None, name=None, Description=None, Tasks=None, status=None, Files=None, extensiontype_=None):4163 self.original_tagname_ = None4164 super(ResourceEntityType, self).__init__(VCloudExtension, href, type_, Link, operationKey, id, name, Description, Tasks, extensiontype_, )4165 self.status = _cast(int, status)4166 self.Files = Files4167 self.extensiontype_ = extensiontype_4168 def factory(*args_, **kwargs_):4169 if ResourceEntityType.subclass:4170 return ResourceEntityType.subclass(*args_, **kwargs_)4171 else:4172 return ResourceEntityType(*args_, **kwargs_)4173 factory = staticmethod(factory)4174 def get_Files(self): return self.Files4175 def set_Files(self, Files): self.Files = Files4176 def get_status(self): return self.status4177 def set_status(self, status): self.status = status4178 def get_extensiontype_(self): return self.extensiontype_4179 def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_4180 def hasContent_(self):4181 if (4182 self.Files is not None or4183 super(ResourceEntityType, self).hasContent_()4184 ):4185 return True4186 else:4187 return False4188 def export(self, outfile, level, namespace_='', name_='ResourceEntityType', namespacedef_='', pretty_print=True):4189 if pretty_print:4190 eol_ = '\n'4191 else:4192 eol_ = ''...

Full Screen

Full Screen

vchsType.py

Source:vchsType.py Github

copy

Full Screen

...633 def get_type(self): return self.type_634 def set_type(self, type_): self.type_ = type_635 def get_name(self): return self.name636 def set_name(self, name): self.name = name637 def get_extensiontype_(self): return self.extensiontype_638 def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_639 def hasContent_(self):640 if (641 self.Link642 ):643 return True644 else:645 return False646 def export(self, outfile, level, namespace_='', name_='EntityType', namespacedef_='', pretty_print=True):647 if pretty_print:648 eol_ = '\n'649 else:650 eol_ = ''651 if self.original_tagname_ is not None:652 name_ = self.original_tagname_653 showIndent(outfile, level, pretty_print)654 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))655 already_processed = set()656 self.exportAttributes(outfile, level, already_processed, namespace_, name_='EntityType')657 if self.hasContent_():658 outfile.write('>%s' % (eol_, ))659 self.exportChildren(outfile, level + 1, namespace_='', name_='EntityType', pretty_print=pretty_print)660 showIndent(outfile, level, pretty_print)661 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))662 else:663 outfile.write('/>%s' % (eol_, ))664 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='EntityType'):665 if self.href is not None and 'href' not in already_processed:666 already_processed.add('href')667 outfile.write(' href=%s' % (self.gds_format_string(quote_attrib(self.href).encode(ExternalEncoding), input_name='href'), ))668 if self.type_ is not None and 'type_' not in already_processed:669 already_processed.add('type_')670 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))671 if self.name is not None and 'name' not in already_processed:672 already_processed.add('name')673 outfile.write(' name=%s' % (self.gds_format_string(quote_attrib(self.name).encode(ExternalEncoding), input_name='name'), ))674 if self.extensiontype_ is not None and 'xsi:type' not in already_processed:675 already_processed.add('xsi:type')676 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')677 outfile.write(' xsi:type="%s"' % self.extensiontype_)678 def exportChildren(self, outfile, level, namespace_='', name_='EntityType', fromsubclass_=False, pretty_print=True):679 if pretty_print:680 eol_ = '\n'681 else:682 eol_ = ''683 for Link_ in self.Link:684 Link_.export(outfile, level, namespace_, name_='Link', pretty_print=pretty_print)685 def exportLiteral(self, outfile, level, name_='EntityType'):686 level += 1687 already_processed = set()688 self.exportLiteralAttributes(outfile, level, already_processed, name_)689 if self.hasContent_():690 self.exportLiteralChildren(outfile, level, name_)691 def exportLiteralAttributes(self, outfile, level, already_processed, name_):692 if self.href is not None and 'href' not in already_processed:693 already_processed.add('href')694 showIndent(outfile, level)695 outfile.write('href="%s",\n' % (self.href,))696 if self.type_ is not None and 'type_' not in already_processed:697 already_processed.add('type_')698 showIndent(outfile, level)699 outfile.write('type_="%s",\n' % (self.type_,))700 if self.name is not None and 'name' not in already_processed:701 already_processed.add('name')702 showIndent(outfile, level)703 outfile.write('name="%s",\n' % (self.name,))704 def exportLiteralChildren(self, outfile, level, name_):705 showIndent(outfile, level)706 outfile.write('Link=[\n')707 level += 1708 for Link_ in self.Link:709 showIndent(outfile, level)710 outfile.write('model_.LinkType(\n')711 Link_.exportLiteral(outfile, level, name_='LinkType')712 showIndent(outfile, level)713 outfile.write('),\n')714 level -= 1715 showIndent(outfile, level)716 outfile.write('],\n')717 def build(self, node):718 already_processed = set()719 self.buildAttributes(node, node.attrib, already_processed)720 for child in node:721 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]722 self.buildChildren(child, node, nodeName_)723 return self724 def buildAttributes(self, node, attrs, already_processed):725 value = find_attr_value_('href', node)726 if value is not None and 'href' not in already_processed:727 already_processed.add('href')728 self.href = value729 value = find_attr_value_('type', node)730 if value is not None and 'type' not in already_processed:731 already_processed.add('type')732 self.type_ = value733 value = find_attr_value_('name', node)734 if value is not None and 'name' not in already_processed:735 already_processed.add('name')736 self.name = value737 value = find_attr_value_('xsi:type', node)738 if value is not None and 'xsi:type' not in already_processed:739 already_processed.add('xsi:type')740 self.extensiontype_ = value741 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):742 if nodeName_ == 'Link':743 class_obj_ = self.get_class_obj_(child_, LinkType)744 obj_ = class_obj_.factory()745 obj_.build(child_)746 self.Link.append(obj_)747 obj_.original_tagname_ = 'Link'748# end class EntityType749class ReferenceType(GeneratedsSuper):750 """5.6 A reference to a entity. Contains an href attribute and optional751 name and type attributes. always Contains the URI to the entity.752 truealways The resource identifier, expressed in URN format. The753 value of this attribute uniquely identifies the resource,754 persists for the life of the entity, and is never reused.755 falsealways Contains the type of the the entity. falsealways756 Contains the name of the the entity. false"""757 subclass = None758 superclass = None759 def __init__(self, href=None, type_=None, id=None, name=None, extensiontype_=None):760 self.original_tagname_ = None761 self.href = _cast(None, href)762 self.type_ = _cast(None, type_)763 self.id = _cast(None, id)764 self.name = _cast(None, name)765 self.extensiontype_ = extensiontype_766 def factory(*args_, **kwargs_):767 if ReferenceType.subclass:768 return ReferenceType.subclass(*args_, **kwargs_)769 else:770 return ReferenceType(*args_, **kwargs_)771 factory = staticmethod(factory)772 def get_href(self): return self.href773 def set_href(self, href): self.href = href774 def get_type(self): return self.type_775 def set_type(self, type_): self.type_ = type_776 def get_id(self): return self.id777 def set_id(self, id): self.id = id778 def get_name(self): return self.name779 def set_name(self, name): self.name = name780 def get_extensiontype_(self): return self.extensiontype_781 def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_782 def hasContent_(self):783 if (784 ):785 return True786 else:787 return False788 def export(self, outfile, level, namespace_='', name_='ReferenceType', namespacedef_='', pretty_print=True):789 if pretty_print:790 eol_ = '\n'791 else:792 eol_ = ''793 if self.original_tagname_ is not None:794 name_ = self.original_tagname_795 showIndent(outfile, level, pretty_print)796 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))797 already_processed = set()798 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ReferenceType')799 if self.hasContent_():800 outfile.write('>%s' % (eol_, ))801 self.exportChildren(outfile, level + 1, namespace_='', name_='ReferenceType', pretty_print=pretty_print)802 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))803 else:804 outfile.write('/>%s' % (eol_, ))805 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ReferenceType'):806 if self.href is not None and 'href' not in already_processed:807 already_processed.add('href')808 outfile.write(' href=%s' % (self.gds_format_string(quote_attrib(self.href).encode(ExternalEncoding), input_name='href'), ))809 if self.type_ is not None and 'type_' not in already_processed:810 already_processed.add('type_')811 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))812 if self.id is not None and 'id' not in already_processed:813 already_processed.add('id')814 outfile.write(' id=%s' % (self.gds_format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))815 if self.name is not None and 'name' not in already_processed:816 already_processed.add('name')817 outfile.write(' name=%s' % (self.gds_format_string(quote_attrib(self.name).encode(ExternalEncoding), input_name='name'), ))818 if self.extensiontype_ is not None and 'xsi:type' not in already_processed:819 already_processed.add('xsi:type')820 outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')821 outfile.write(' xsi:type="%s"' % self.extensiontype_)822 def exportChildren(self, outfile, level, namespace_='', name_='ReferenceType', fromsubclass_=False, pretty_print=True):823 pass824 def exportLiteral(self, outfile, level, name_='ReferenceType'):825 level += 1826 already_processed = set()827 self.exportLiteralAttributes(outfile, level, already_processed, name_)828 if self.hasContent_():829 self.exportLiteralChildren(outfile, level, name_)830 def exportLiteralAttributes(self, outfile, level, already_processed, name_):831 if self.href is not None and 'href' not in already_processed:832 already_processed.add('href')833 showIndent(outfile, level)834 outfile.write('href="%s",\n' % (self.href,))835 if self.type_ is not None and 'type_' not in already_processed:836 already_processed.add('type_')837 showIndent(outfile, level)838 outfile.write('type_="%s",\n' % (self.type_,))839 if self.id is not None and 'id' not in already_processed:840 already_processed.add('id')841 showIndent(outfile, level)842 outfile.write('id="%s",\n' % (self.id,))843 if self.name is not None and 'name' not in already_processed:844 already_processed.add('name')845 showIndent(outfile, level)846 outfile.write('name="%s",\n' % (self.name,))847 def exportLiteralChildren(self, outfile, level, name_):848 pass849 def build(self, node):850 already_processed = set()851 self.buildAttributes(node, node.attrib, already_processed)852 for child in node:853 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]854 self.buildChildren(child, node, nodeName_)855 return self856 def buildAttributes(self, node, attrs, already_processed):857 value = find_attr_value_('href', node)858 if value is not None and 'href' not in already_processed:859 already_processed.add('href')860 self.href = value861 value = find_attr_value_('type', node)862 if value is not None and 'type' not in already_processed:863 already_processed.add('type')864 self.type_ = value865 value = find_attr_value_('id', node)866 if value is not None and 'id' not in already_processed:867 already_processed.add('id')868 self.id = value869 value = find_attr_value_('name', node)870 if value is not None and 'name' not in already_processed:871 already_processed.add('name')872 self.name = value873 value = find_attr_value_('xsi:type', node)874 if value is not None and 'xsi:type' not in already_processed:875 already_processed.add('xsi:type')876 self.extensiontype_ = value877 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):878 pass879# end class ReferenceType880class LinkType(ReferenceType):881 """5.6 Extends reference type by adding relation attribute. Defines a882 hyper-link with a relationship, hyper-link reference, and an883 optional MIME type. always Defines the relationship of the link884 to the object that contains it. A relationship can be the name885 of an operation on the object, a reference to a contained or886 containing object, or a reference to an alternate representation887 of the object. The relationship value implies the HTTP verb to888 use when you use the link's href as a request URL. See the VCHS889 API Programming Guide for a list of links and link relations.890 true"""891 subclass = None892 superclass = ReferenceType893 def __init__(self, href=None, type_=None, id=None, name=None, rel=None, extensiontype_=None):894 self.original_tagname_ = None895 super(LinkType, self).__init__(href, type_, id, name, extensiontype_, )896 self.rel = _cast(None, rel)897 self.extensiontype_ = extensiontype_898 def factory(*args_, **kwargs_):899 if LinkType.subclass:900 return LinkType.subclass(*args_, **kwargs_)901 else:902 return LinkType(*args_, **kwargs_)903 factory = staticmethod(factory)904 def get_rel(self): return self.rel905 def set_rel(self, rel): self.rel = rel906 def get_extensiontype_(self): return self.extensiontype_907 def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_908 def hasContent_(self):909 if (910 super(LinkType, self).hasContent_()911 ):912 return True913 else:914 return False915 def export(self, outfile, level, namespace_='', name_='LinkType', namespacedef_='', pretty_print=True):916 if pretty_print:917 eol_ = '\n'918 else:919 eol_ = ''920 if self.original_tagname_ is not None:...

Full Screen

Full Screen

c2_data.py

Source:c2_data.py Github

copy

Full Screen

...55def _get_pinors_from_xml(xml):56 pinor = collections.namedtuple("pinor", ["lat", "lon", "timestamp"])57 pinor_list = []58 for gis in xml.get_gisposition():59 if gis.get_value().get_extensiontype_() == "strandedPerson" \60 and gis.get_position().get_extensiontype_() == "point":61 time_stamp = gis.get_timestamp().get_date()62 pinor_list.append(pinor(63 Decimal(gis.get_position().get_position().get_latitude()).quantize(Decimal("1.000000")),64 Decimal(gis.get_position().get_position().get_longitude()).quantize(Decimal("1.000000")), time_stamp))65 return pinor_list66def _create_xml(pinor_list):67 """68 :param pinor_list: list of dictionaries containing pinors69 :return: xml object of pinors70 """71 root = schema.gpigData()72 for pinor in pinor_list:73 coord = schema.coord(pinor.get("lat"), pinor.get("lon"))74 point = schema.point(coord)...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run autotest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful