def METHOD_NAME(self, action):
    if isinstance(action, RecordStart):
        self.write_object_start()
    elif isinstance(action, RecordEnd) or isinstance(action, UnionEnd):
        self.write_object_end()
    elif isinstance(action, FieldStart):
        self.write_object_key(action.field_name)
    elif isinstance(action, FieldEnd):
        # TODO: Do we need a FieldEnd symbol?
        pass
    elif isinstance(action, Root):
        self.write_buffer()
    else:
        raise Exception(f"Internal Exception: {action}")