class_docstr: A class for recording information associated with a job and its execution.
  
  Please keep this in sync with the JobsAPIInfo proto in src/ray/protobuf/gcs.proto.
docstr: Convert this object to a JSON-serializable dictionary.
  
  Note that the runtime_env field is converted to a JSON-serialized string
  and the field is renamed to runtime_env_json.
  
  Returns:
      A JSON-serializable dictionary representing the JobInfo object.
docstr_tok: ["Convert","this","object","to","a","JSON-serializable","dictionary",".","Note","that","the","runtime_env","field","is","converted","to","a","JSON-serialized","string","and","the","field","is","renamed","to","runtime_env_json",".","Returns",":","A","JSON-serializable","dictionary","representing","the","JobInfo","object","."]
code: def to_json(self) -> Dict[str, Any]:
      """Convert this object to a JSON-serializable dictionary.
  
      Note that the runtime_env field is converted to a JSON-serialized string
      and the field is renamed to runtime_env_json.
  
      Returns:
          A JSON-serializable dictionary representing the JobInfo object.
      """
  
      json_dict = asdict(self)
  
      # Convert enum values to strings.
      json_dict["status"] = str(json_dict["status"])
  
      # Convert runtime_env to a JSON-serialized string.
      if "runtime_env" in json_dict:
          if json_dict["runtime_env"] is not None:
              json_dict["runtime_env_json"] = json.dumps(
                  json_dict["runtime_env"]
              )
          del json_dict["runtime_env"]
  
      # Assert that the dictionary is JSON-serializable.
      json.dumps(json_dict)
  
      return json_dict
  
imports: import asyncio
  import json
  import time
  from dataclasses import dataclass, replace, asdict
  from enum import Enum
  from pathlib import Path
  from typing import Any, Dict, Optional, Tuple, Union
  from ray._private import ray_constants
  from ray._private.gcs_utils import GcsAioClient
  from ray._private.runtime_env.packaging import parse_uri
  from ray.util.annotations import PublicAPI
label_desc: Use image node_id 2 for calling the JobInfo obj's underlying member method code with example usage: obj.to_json() and returns: json_dict