class_docstr: A vertex for a lineage graph.
class_docstr_tok: ["A","vertex","for","a","lineage","graph","."]
docstr: Convert the ``Vertex`` object to its corresponding lineage object.
  
  Returns:
      A ``Vertex`` object to its corresponding ``Artifact``,``Action``, ``Context``
      or ``TrialComponent`` object.
docstr_tok: ["Convert","the","``","Vertex","``","object","to","its","corresponding","lineage","object",".","Returns",":","A","``","Vertex","``","object","to","its","corresponding","``","Artifact","``",",","``","Action","``",",","``","Context","``","or","``","TrialComponent","``","object","."]
code: def to_lineage_object(self):
      """Convert the ``Vertex`` object to its corresponding lineage object.
  
      Returns:
          A ``Vertex`` object to its corresponding ``Artifact``,``Action``, ``Context``
          or ``TrialComponent`` object.
      """
      from sagemaker.lineage.context import Context, EndpointContext
      from sagemaker.lineage.action import Action
      from sagemaker.lineage.lineage_trial_component import (
          LineageTrialComponent,
      )
  
      if self.lineage_entity == LineageEntityEnum.CONTEXT.value:
          resource_name = get_resource_name_from_arn(self.arn)
          if self.lineage_source == LineageSourceEnum.ENDPOINT.value:
              return EndpointContext.load(
                  context_name=resource_name,
                  sagemaker_session=self._session,
              )
          return Context.load(
              context_name=resource_name,
              sagemaker_session=self._session,
          )
  
      if self.lineage_entity == LineageEntityEnum.ARTIFACT.value:
          return self._artifact_to_lineage_object()
  
      if self.lineage_entity == LineageEntityEnum.ACTION.value:
          return Action.load(
              action_name=self.arn.split("/")[1],
              sagemaker_session=self._session,
          )
  
      if self.lineage_entity == LineageEntityEnum.TRIAL_COMPONENT.value:
          trial_component_name = get_resource_name_from_arn(self.arn)
          return LineageTrialComponent.load(
              trial_component_name=trial_component_name,
              sagemaker_session=self._session,
          )
      raise ValueError(
          "Vertex cannot be converted to a lineage object."
      )
  
imports: from __future__ import absolute_import
  from datetime import datetime
  from enum import Enum
  from typing import Any, Optional, Union, List, Dict
  from json import dumps
  from re import sub, search
  from sagemaker.utils import get_module
  from sagemaker.lineage._utils import get_resource_name_from_arn
label_desc: Use image node_id 6 for calling the Vertex obj's underlying member method code with example usage: obj.to_lineage_object() and returns: Context, self, Action, LineageTrialComponent, EndpointContext