code: def to_json(self):
      
      mapper_spec = self.mapper.to_json()
      return {
          "name": self.name,
          "mapreduce_id": self.mapreduce_id,
          "mapper_spec": mapper_spec,
          "params": self.params,
          "hooks_class_name": self.hooks_class_name,
      }
docs: Serializes all data in this mapreduce spec into json form.
  
      Returns:
        data in json format.