class_docstr: An Amazon SageMaker endpoint context, which is part of a SageMaker lineage.
class_docstr_tok: ["An","Amazon","SageMaker","endpoint","context",",","which","is","part","of","a","SageMaker","lineage","."]
docstr: Get ARNs for all training jobs that appear in the endpoint's lineage.
  
  Args:
      direction (LineageQueryDirectionEnum, optional): The query direction.
  
  Returns:
      list of str: Training job ARNs.
docstr_tok: ["Get","ARNs","for","all","training","jobs","that","appear","in","the","endpoint","'s","lineage",".","Args",":","direction","(","LineageQueryDirectionEnum",",","optional",")",":","The","query","direction",".","Returns",":","list","of","str",":","Training","job","ARNs","."]
code: def training_job_arns(
      self,
      direction: LineageQueryDirectionEnum = LineageQueryDirectionEnum.ASCENDANTS,
  ) -> List[str]:
      """Get ARNs for all training jobs that appear in the endpoint's lineage.
  
      Args:
          direction (LineageQueryDirectionEnum, optional): The query direction.
  
      Returns:
          list of str: Training job ARNs.
      """
      query_filter = LineageFilter(
          entities=[LineageEntityEnum.TRIAL_COMPONENT],
          sources=[LineageSourceEnum.TRAINING_JOB],
      )
      query_result = LineageQuery(self.sagemaker_session).query(
          start_arns=[self.context_arn],
          query_filter=query_filter,
          direction=direction,
          include_edges=False,
      )
  
      training_job_arns = []
      for vertex in query_result.vertices:
          trial_component_name = _utils.get_resource_name_from_arn(
              vertex.arn
          )
          trial_component = self.sagemaker_session.sagemaker_client.describe_trial_component(
              TrialComponentName=trial_component_name
          )
          training_job_arns.append(
              trial_component["Source"]["SourceArn"]
          )
      return training_job_arns
  
imports: from __future__ import absolute_import
  from datetime import datetime
  from typing import Iterator, Optional, List
  from sagemaker.apiutils import _base_types
  from sagemaker.lineage import _api_types, _utils, association
  from sagemaker.lineage._api_types import ContextSummary
  from sagemaker.lineage.query import LineageQuery, LineageFilter, LineageSourceEnum, LineageEntityEnum, LineageQueryDirectionEnum
  from sagemaker.lineage.artifact import Artifact
  from sagemaker.lineage.action import Action
  from sagemaker.lineage.lineage_trial_component import LineageTrialComponent
  from sagemaker.utils import format_tags
label_desc: Use image node_id 4 for calling the EndpointContext obj's underlying member method code with example usage: obj.training_job_arns(direction) and returns: training_job_arns