code: def do_encode(cls, obj):
          # type: (Any) -> Any
          
          if isinstance(obj, ConjureBeanType):
              return cls.encode_conjure_bean_type(obj)
  
          elif isinstance(obj, ConjureUnionType):
              return cls.encode_conjure_union_type(obj)
  
          elif isinstance(obj, ConjureEnumType):
              return obj.value
  
          elif isinstance(obj, list):
              return list(map(cls.do_encode, obj))
  
          elif isinstance(obj, dict):
              return {cls.do_encode(key): cls.do_encode(value)
                      for key, value in obj.items()}
  
          else:
              return cls.encode_primitive(obj)
docs: Encodes the passed object into json