@classmethod
def encode_conjure_bean_type(cls, obj):
    """Encodes a conjure bean into json"""
    encoded = {}
    for attribute_name, field_definition in obj._fields().items():
        encoded[field_definition.identifier] = cls.do_encode(getattr(obj,
            attribute_name))
    return encoded
