def unpack_object(self, zenpy_object):
if hasattr(zenpy_object, self.api.object_type):<EOL><INDENT>obj = getattr(zenpy_object, self.api.object_type)<EOL><DEDENT>else:<EOL><INDENT>obj = zenpy_object<EOL><DEDENT>if obj is not None and obj not in self.created_objects:<EOL><INDENT>self.created_objects.append(obj)<EOL><DEDENT>return obj<EOL>
If we have a nested object, return the nested object we are interested in.
Otherwise just return the passed object.