class_docstr: Download artifacts from a dbt Cloud job run.
  
  .. seealso::
      For more information on how to use this operator, take a look at the guide:
      :ref:`howto/operator:DbtCloudGetJobRunArtifactOperator`
  
  :param dbt_cloud_conn_id: The connection ID for connecting to dbt Cloud.
  :param run_id: The ID of a dbt Cloud job run.
  :param path: The file path related to the artifact file. Paths are rooted at the target/ directory.
      Use "manifest.json", "catalog.json", or "run_results.json" to download dbt-generated artifacts
      for the run.
  :param account_id: Optional. The ID of a dbt Cloud account.
  :param step: Optional. The index of the Step in the Run to query for artifacts. The first step in the
      run has the index 1. If the step parameter is omitted, artifacts for the last step in the run will
      be returned.
  :param output_file_name: Optional. The desired file name for the download artifact file.
      Defaults to <run_id>_<path> (e.g. "728368_run_results.json").
class_docstr_tok: ["Download","artifacts","from","a","dbt","Cloud","job","run",".","..","seealso",":",":","For","more","information","on","how","to","use","this","operator",",","take","a","look","at","the","guide",":",":","ref",":","`","howto\/operator",":","DbtCloudGetJobRunArtifactOperator","`",":","param","dbt_cloud_conn_id",":","The","connection","ID","for","connecting","to","dbt","Cloud",".",":","param","run_id",":","The","ID","of","a","dbt","Cloud","job","run",".",":","param","path",":","The","file","path","related","to","the","artifact","file",".","Paths","are","rooted","at","the","target\/","directory",".","Use","``","manifest.json","''",",","``","catalog.json","''",",","or","``","run_results.json","''","to","download","dbt-generated","artifacts","for","the","run",".",":","param","account_id",":","Optional",".","The","ID","of","a","dbt","Cloud","account",".",":","param","step",":","Optional",".","The","index","of","the","Step","in","the","Run","to","query","for","artifacts",".","The","first","step","in","the","run","has","the","index","1",".","If","the","step","parameter","is","omitted",",","artifacts","for","the","last","step","in","the","run","will","be","returned",".",":","param","output_file_name",":","Optional",".","The","desired","file","name","for","the","download","artifact","file",".","Defaults","to","<","run_id",">","_","<","path",">","(","e.g",".","``","728368_run_results.json","''",")","."]
code: def execute(self, context: Context) -> str:
      hook = DbtCloudHook(self.dbt_cloud_conn_id)
      response = hook.get_job_run_artifact(
          run_id=self.run_id,
          path=self.path,
          account_id=self.account_id,
          step=self.step,
      )
  
      output_file_path = Path(self.output_file_name)
      output_file_path.parent.mkdir(parents=True, exist_ok=True)
      with output_file_path.open(mode="w") as file:
          self.log.info(
              "Writing %s artifact for job run %s to %s.",
              self.path,
              self.run_id,
              self.output_file_name,
          )
          if self.path.endswith(".json"):
              json.dump(response.json(), file)
          else:
              file.write(response.text)
  
      return self.output_file_name
  
imports: from __future__ import annotations
  import json
  import time
  import warnings
  from functools import cached_property
  from pathlib import Path
  from typing import TYPE_CHECKING, Any
  from airflow.configuration import conf
  from airflow.models import BaseOperator, BaseOperatorLink, XCom
  from airflow.providers.dbt.cloud.hooks.dbt import DbtCloudHook, DbtCloudJobRunException, DbtCloudJobRunStatus, JobRunInfo
  from airflow.providers.dbt.cloud.triggers.dbt import DbtCloudRunJobTrigger
  from airflow.providers.dbt.cloud.utils.openlineage import generate_openlineage_events_from_dbt_cloud_run
label_desc: Use image node_id 2 for calling the DbtCloudGetJobRunArtifactOperator obj's underlying member method code with example usage: obj.execute(context) and returns: self