code: def encode_conjure_bean_type(cls, obj):
          # type: (ConjureBeanType) -> Any
          
          encoded = {}  # type: Dict[str, Any]
          for attribute_name, field_definition in obj._fields().items():
              encoded[field_definition.identifier] = cls.do_encode(
                  getattr(obj, attribute_name)
              )
          return encoded
docs: Encodes a conjure bean into json