def parse(self, super_type, plugins, resource_base): relationship_type = self.build_dict_result() if not relationship_type.get('derived_from'): relationship_type.pop('derived_from', None) relationship_type_name = self.name if super_type: relationship_type[constants.PROPERTIES] = utils.merge_sub_dicts( overridden_dict=super_type, overriding_dict=relationship_type, sub_dict_key=constants.PROPERTIES) for interfaces in [constants.SOURCE_INTERFACES, constants.TARGET_INTERFACES]: relationship_type[interfaces] = interfaces_parser. \ merge_relationship_type_interfaces( overriding_interfaces=relationship_type[interfaces], overridden_interfaces=super_type[interfaces]) _validate_relationship_fields( rel_obj=relationship_type, plugins=plugins, rel_name=relationship_type_name, resource_base=resource_base) relationship_type['name'] = relationship_type_name relationship_type[ constants.TYPE_HIERARCHY] = self.create_type_hierarchy(super_type) return relationship_type
def parse(self, super_type): node_type = self.build_dict_result() if not node_type.get('derived_from'): node_type.pop('derived_from', None) if super_type: node_type[constants.PROPERTIES] = utils.merge_sub_dicts( overridden_dict=super_type, overriding_dict=node_type, sub_dict_key=constants.PROPERTIES) node_type[constants.INTERFACES] = interfaces_parser. \ merge_node_type_interfaces( overridden_interfaces=super_type[constants.INTERFACES], overriding_interfaces=node_type[constants.INTERFACES]) node_type[constants.TYPE_HIERARCHY] = self.create_type_hierarchy( super_type) return node_type