class_docstr: Stops the job with the specified name prefix or Job ID.
  
  All jobs with provided name prefix will be stopped.
  Streaming jobs are drained by default.
  
  Parameter ``job_name_prefix`` and ``job_id`` are mutually exclusive.
  
  .. seealso::
      For more details on stopping a pipeline see:
      https://cloud.google.com/dataflow/docs/guides/stopping-a-pipeline
  
  .. seealso::
      For more information on how to use this operator, take a look at the guide:
      :ref:`howto/operator:DataflowStopJobOperator`
  
  :param job_name_prefix: Name prefix specifying which jobs are to be stopped.
  :param job_id: Job ID specifying which jobs are to be stopped.
  :param project_id: Optional, the Google Cloud project ID in which to start a job.
      If set to None or missing, the default project_id from the Google Cloud connection is used.
  :param location: Optional, Job location. If set to None or missing, "us-central1" will be used.
  :param gcp_conn_id: The connection ID to use connecting to Google Cloud.
  :param poll_sleep: The time in seconds to sleep between polling Google
      Cloud Platform for the dataflow job status to confirm it's stopped.
  :param impersonation_chain: Optional service account to impersonate using short-term
      credentials, or chained list of accounts required to get the access_token
      of the last account in the list, which will be impersonated in the request.
      If set as a string, the account must grant the originating account
      the Service Account Token Creator IAM role.
      If set as a sequence, the identities from the list must grant
      Service Account Token Creator IAM role to the directly preceding identity, with first
      account from the list granting this role to the originating account (templated).
  :param drain_pipeline: Optional, set to False if want to stop streaming job by canceling it
      instead of draining. See: https://cloud.google.com/dataflow/docs/guides/stopping-a-pipeline
  :param stop_timeout: wait time in seconds for successful job canceling/draining
class_docstr_tok: ["Stops","the","job","with","the","specified","name","prefix","or","Job","ID",".","All","jobs","with","provided","name","prefix","will","be","stopped",".","Streaming","jobs","are","drained","by","default",".","Parameter","``","job_name_prefix","``","and","``","job_id","``","are","mutually","exclusive",".","..","seealso",":",":","For","more","details","on","stopping","a","pipeline","see",":","https",":","\/\/cloud.google.com\/dataflow\/docs\/guides\/stopping-a-pipeline","..","seealso",":",":","For","more","information","on","how","to","use","this","operator",",","take","a","look","at","the","guide",":",":","ref",":","`","howto\/operator",":","DataflowStopJobOperator","`",":","param","job_name_prefix",":","Name","prefix","specifying","which","jobs","are","to","be","stopped",".",":","param","job_id",":","Job","ID","specifying","which","jobs","are","to","be","stopped",".",":","param","project_id",":","Optional",",","the","Google","Cloud","project","ID","in","which","to","start","a","job",".","If","set","to","None","or","missing",",","the","default","project_id","from","the","Google","Cloud","connection","is","used",".",":","param","location",":","Optional",",","Job","location",".","If","set","to","None","or","missing",",","``","us-central1","''","will","be","used",".",":","param","gcp_conn_id",":","The","connection","ID","to","use","connecting","to","Google","Cloud",".",":","param","poll_sleep",":","The","time","in","seconds","to","sleep","between","polling","Google","Cloud","Platform","for","the","dataflow","job","status","to","confirm","it","'s","stopped",".",":","param","impersonation_chain",":","Optional","service","account","to","impersonate","using","short-term","credentials",",","or","chained","list","of","accounts","required","to","get","the","access_token","of","the","last","account","in","the","list",",","which","will","be","impersonated","in","the","request",".","If","set","as","a","string",",","the","account","must","grant","the","originating","account","the","Service","Account","Token","Creator","IAM","role",".","If","set","as","a","sequence",",","the","identities","from","the","list","must","grant","Service","Account","Token","Creator","IAM","role","to","the","directly","preceding","identity",",","with","first","account","from","the","list","granting","this","role","to","the","originating","account","(","templated",")",".",":","param","drain_pipeline",":","Optional",",","set","to","False","if","want","to","stop","streaming","job","by","canceling","it","instead","of","draining",".","See",":","https",":","\/\/cloud.google.com\/dataflow\/docs\/guides\/stopping-a-pipeline",":","param","stop_timeout",":","wait","time","in","seconds","for","successful","job","canceling\/draining"]
code: def execute(self, context: Context) -> None:
      self.dataflow_hook = DataflowHook(
          gcp_conn_id=self.gcp_conn_id,
          poll_sleep=self.poll_sleep,
          impersonation_chain=self.impersonation_chain,
          cancel_timeout=self.stop_timeout,
          drain_pipeline=self.drain_pipeline,
      )
      if self.job_id or self.dataflow_hook.is_job_dataflow_running(
          name=self.job_name,
          project_id=self.project_id,
          location=self.location,
      ):
          self.dataflow_hook.cancel_job(
              job_name=self.job_name,
              project_id=self.project_id,
              location=self.location,
              job_id=self.job_id,
          )
      else:
          self.log.info("No jobs to stop")
  
      return None
  
imports: from __future__ import annotations
  import copy
  import re
  import uuid
  import warnings
  from contextlib import ExitStack
  from enum import Enum
  from functools import cached_property
  from typing import TYPE_CHECKING, Any, Sequence
  from airflow.configuration import conf
  from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
  from airflow.providers.apache.beam.hooks.beam import BeamHook, BeamRunnerType
  from airflow.providers.google.cloud.hooks.dataflow import DEFAULT_DATAFLOW_LOCATION, DataflowHook, process_line_and_extract_dataflow_job_id_callback
  from airflow.providers.google.cloud.hooks.gcs import GCSHook
  from airflow.providers.google.cloud.links.dataflow import DataflowJobLink
  from airflow.providers.google.cloud.operators.cloud_base import GoogleCloudBaseOperator
  from airflow.providers.google.cloud.triggers.dataflow import TemplateJobStartTrigger
  from airflow.version import version
label_desc: Use image node_id 2 for calling the DataflowStopJobOperator obj's underlying member method code with example usage: obj.execute(context) and returns: None