class_docstr: Hook for accessing Google Pub/Sub.
  
  The Google Cloud project against which actions are applied is determined by
  the project embedded in the Connection referenced by gcp_conn_id.
class_docstr_tok: ["Hook","for","accessing","Google","Pub\/Sub",".","The","Google","Cloud","project","against","which","actions","are","applied","is","determined","by","the","project","embedded","in","the","Connection","referenced","by","gcp_conn_id","."]
docstr: Deletes a Pub/Sub subscription, if it exists.
  
  :param subscription: the Pub/Sub subscription name to delete; do not
      include the ``projects/{project}/subscriptions/`` prefix.
  :param project_id: Optional, the Google Cloud project ID where the subscription exists
      If set to None or missing, the default project_id from the Google Cloud connection is used.
  :param fail_if_not_exists: if set, raise an exception if the topic does not exist
  :param retry: (Optional) A retry object used to retry requests.
      If None is specified, requests will not be retried.
  :param timeout: (Optional) The amount of time, in seconds, to wait for the request
      to complete. Note that if retry is specified, the timeout applies to each
      individual attempt.
  :param metadata: (Optional) Additional metadata that is provided to the method.
docstr_tok: ["Deletes","a","Pub\/Sub","subscription",",","if","it","exists",".",":","param","subscription",":","the","Pub\/Sub","subscription","name","to","delete",";","do","not","include","the","``","projects\/","{","project","}","\/subscriptions\/","``","prefix",".",":","param","project_id",":","Optional",",","the","Google","Cloud","project","ID","where","the","subscription","exists","If","set","to","None","or","missing",",","the","default","project_id","from","the","Google","Cloud","connection","is","used",".",":","param","fail_if_not_exists",":","if","set",",","raise","an","exception","if","the","topic","does","not","exist",":","param","retry",":","(","Optional",")","A","retry","object","used","to","retry","requests",".","If","None","is","specified",",","requests","will","not","be","retried",".",":","param","timeout",":","(","Optional",")","The","amount","of","time",",","in","seconds",",","to","wait","for","the","request","to","complete",".","Note","that","if","retry","is","specified",",","the","timeout","applies","to","each","individual","attempt",".",":","param","metadata",":","(","Optional",")","Additional","metadata","that","is","provided","to","the","method","."]
code: def delete_subscription(
      self,
      subscription: str,
      project_id: str = PROVIDE_PROJECT_ID,
      fail_if_not_exists: bool = False,
      retry: Retry | _MethodDefault = DEFAULT,
      timeout: float | None = None,
      metadata: Sequence[tuple[str, str]] = (),
  ) -> None:
      """
      Deletes a Pub/Sub subscription, if it exists.
  
      :param subscription: the Pub/Sub subscription name to delete; do not
          include the ``projects/{project}/subscriptions/`` prefix.
      :param project_id: Optional, the Google Cloud project ID where the subscription exists
          If set to None or missing, the default project_id from the Google Cloud connection is used.
      :param fail_if_not_exists: if set, raise an exception if the topic does not exist
      :param retry: (Optional) A retry object used to retry requests.
          If None is specified, requests will not be retried.
      :param timeout: (Optional) The amount of time, in seconds, to wait for the request
          to complete. Note that if retry is specified, the timeout applies to each
          individual attempt.
      :param metadata: (Optional) Additional metadata that is provided to the method.
      """
      subscriber = self.subscriber_client
      # E501
      subscription_path = (
          f"projects/{project_id}/subscriptions/{subscription}"
      )
  
      self.log.info(
          "Deleting subscription (path) %s", subscription_path
      )
      try:
          subscriber.delete_subscription(
              request={"subscription": subscription_path},
              retry=retry,
              timeout=timeout,
              metadata=metadata,
          )
  
      except NotFound:
          self.log.warning(
              "Subscription does not exist: %s", subscription_path
          )
          if fail_if_not_exists:
              raise PubSubException(
                  f"Subscription does not exist: {subscription_path}"
              )
      except GoogleAPICallError as e:
          raise PubSubException(
              f"Error deleting subscription {subscription_path}", e
          )
  
      self.log.info("Deleted subscription (path) %s", subscription_path)
  
imports: from __future__ import annotations
  import warnings
  from base64 import b64decode
  from functools import cached_property
  from typing import TYPE_CHECKING, Any, Sequence
  from uuid import uuid4
  from google.api_core.exceptions import AlreadyExists, GoogleAPICallError
  from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
  from google.cloud.exceptions import NotFound
  from google.cloud.pubsub_v1 import PublisherClient, SubscriberClient
  from google.pubsub_v1.services.subscriber.async_client import SubscriberAsyncClient
  from googleapiclient.errors import HttpError
  from airflow.exceptions import AirflowProviderDeprecationWarning
  from airflow.providers.google.common.consts import CLIENT_INFO
  from airflow.providers.google.common.hooks.base_google import PROVIDE_PROJECT_ID, GoogleBaseAsyncHook, GoogleBaseHook
  from airflow.version import version
label_desc: Use image node_id 9 for calling the PubSubHook obj's underlying member method code with example usage: obj.delete_subscription(subscription, project_id, fail_if_not_exists, retry, timeout, metadata) without return types