code: def to_proto(self):
      data = {
          "start_time_ms": self.start_time_ms,
          "actor_name": self.actor_name,
          "version": self.version,
          "end_time_ms": self.end_time_ms,
      }
      if self.deployment_config:
          data["deployment_config"] = self.deployment_config.to_proto()
      if self.replica_config:
          data["replica_config"] = self.replica_config.to_proto()
      if self.target_capacity is None:
          data["target_capacity"] = -1
      else:
          data["target_capacity"] = self.target_capacity
      if self.target_capacity_direction is None:
          data[
              "target_capacity_direction"
          ] = TargetCapacityDirectionProto.UNSET
      else:
          data[
              "target_capacity_direction"
          ] = self.target_capacity_direction.name
      return DeploymentInfoProto(**data)
  
file_path: ray/python/ray/serve/_private/deployment_info.py
imports: from typing import Any, Dict, Optional
  import ray
  from ray.serve._private.autoscaling_policy import AutoscalingPolicyManager
  from ray.serve._private.common import TargetCapacityDirection
  from ray.serve._private.config import DeploymentConfig, ReplicaConfig
  from ray.serve._private.constants import REPLICA_CONTROL_PLANE_CONCURRENCY_GROUP
  from ray.serve.generated.serve_pb2 import DeploymentInfo
  from ray.serve.generated.serve_pb2 import TargetCapacityDirection
label_desc: Use image node_id 8 for calling the DeploymentInfo obj's underlying member method code with example usage: obj.to_proto() and returns: DeploymentInfoProto