class_docstr: Hook for Google Dataflow.
  
  All the methods in the hook where project_id is used must be called with
  keyword arguments rather than positional.
class_docstr_tok: ["Hook","for","Google","Dataflow",".","All","the","methods","in","the","hook","where","project_id","is","used","must","be","called","with","keyword","arguments","rather","than","positional","."]
docstr: Cancels the job with the specified name prefix or Job ID.
  
  Parameter ``name`` and ``job_id`` are mutually exclusive.
  
  :param job_name: Name prefix specifying which jobs are to be canceled.
  :param job_id: Job ID specifying which jobs are to be canceled.
  :param location: Job location.
  :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.
code: def cancel_job(
      self,
      project_id: str,
      job_name: str | None = None,
      job_id: str | None = None,
      location: str = DEFAULT_DATAFLOW_LOCATION,
  ) -> None:
      """
      Cancels the job with the specified name prefix or Job ID.
  
      Parameter ``name`` and ``job_id`` are mutually exclusive.
  
      :param job_name: Name prefix specifying which jobs are to be canceled.
      :param job_id: Job ID specifying which jobs are to be canceled.
      :param location: Job location.
      :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.
      """
      jobs_controller = _DataflowJobsController(
          dataflow=self.get_conn(),
          project_number=project_id,
          name=job_name,
          job_id=job_id,
          location=location,
          poll_sleep=self.poll_sleep,
          drain_pipeline=self.drain_pipeline,
          num_retries=self.num_retries,
          cancel_timeout=self.cancel_timeout,
      )
      jobs_controller.cancel()
  
imports: from __future__ import annotations
  import functools
  import json
  import re
  import shlex
  import subprocess
  import time
  import uuid
  import warnings
  from copy import deepcopy
  from typing import TYPE_CHECKING, Any, Callable, Generator, Sequence, TypeVar, cast
  from google.cloud.dataflow_v1beta3 import GetJobRequest, Job, JobState, JobsV1Beta3AsyncClient, JobView
  from google.cloud.dataflow_v1beta3.types.jobs import ListJobsRequest
  from googleapiclient.discovery import build
  from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
  from airflow.providers.apache.beam.hooks.beam import BeamHook, BeamRunnerType, beam_options_to_args
  from airflow.providers.google.common.hooks.base_google import PROVIDE_PROJECT_ID, GoogleBaseAsyncHook, GoogleBaseHook
  from airflow.utils.log.logging_mixin import LoggingMixin
  from airflow.utils.timeout import timeout
label_desc: Use image node_id 10 for calling the DataflowHook obj's underlying member method code with example usage: obj.cancel_job(project_id, job_name, job_id, location) without return types