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: Acknowledges the messages associated with the ``ack_ids`` from Pub/Sub subscription.
  
  :param subscription: the Pub/Sub subscription name to delete; do not
      include the 'projects/{project}/topics/' prefix.
  :param ack_ids: List of ReceivedMessage ackIds from a previous pull response.
      Mutually exclusive with ``messages`` argument.
  :param messages: List of ReceivedMessage objects to acknowledge.
      Mutually exclusive with ``ack_ids`` argument.
  :param project_id: Optional, the Google Cloud project name or ID in which to create the topic
      If set to None or missing, the default project_id from the Google Cloud connection is used.
  :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: ["Acknowledges","the","messages","associated","with","the","``","ack_ids","``","from","Pub\/Sub","subscription",".",":","param","subscription",":","the","Pub\/Sub","subscription","name","to","delete",";","do","not","include","the","'projects\/","{","project","}","\/topics\/","'","prefix",".",":","param","ack_ids",":","List","of","ReceivedMessage","ackIds","from","a","previous","pull","response",".","Mutually","exclusive","with","``","messages","``","argument",".",":","param","messages",":","List","of","ReceivedMessage","objects","to","acknowledge",".","Mutually","exclusive","with","``","ack_ids","``","argument",".",":","param","project_id",":","Optional",",","the","Google","Cloud","project","name","or","ID","in","which","to","create","the","topic","If","set","to","None","or","missing",",","the","default","project_id","from","the","Google","Cloud","connection","is","used",".",":","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 acknowledge(
      self,
      subscription: str,
      project_id: str,
      ack_ids: list[str] | None = None,
      messages: list[ReceivedMessage] | None = None,
      retry: Retry | _MethodDefault = DEFAULT,
      timeout: float | None = None,
      metadata: Sequence[tuple[str, str]] = (),
  ) -> None:
      """
      Acknowledges the messages associated with the ``ack_ids`` from Pub/Sub subscription.
  
      :param subscription: the Pub/Sub subscription name to delete; do not
          include the 'projects/{project}/topics/' prefix.
      :param ack_ids: List of ReceivedMessage ackIds from a previous pull response.
          Mutually exclusive with ``messages`` argument.
      :param messages: List of ReceivedMessage objects to acknowledge.
          Mutually exclusive with ``ack_ids`` argument.
      :param project_id: Optional, the Google Cloud project name or ID in which to create the topic
          If set to None or missing, the default project_id from the Google Cloud connection is used.
      :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.
      """
      if ack_ids is not None and messages is None:
          pass  # use ack_ids as is
      elif ack_ids is None and messages is not None:
          ack_ids = [
              message.ack_id for message in messages
          ]  # extract ack_ids from messages
      else:
          raise ValueError(
              "One and only one of 'ack_ids' and 'messages' arguments have to be provided"
          )
  
      subscriber = self.subscriber_client
      # E501
      subscription_path = (
          f"projects/{project_id}/subscriptions/{subscription}"
      )
  
      self.log.info(
          "Acknowledging %d ack_ids from subscription (path) %s",
          len(ack_ids),
          subscription_path,
      )
      try:
          subscriber.acknowledge(
              request={
                  "subscription": subscription_path,
                  "ack_ids": ack_ids,
              },
              retry=retry,
              timeout=timeout,
              metadata=metadata,
          )
      except (HttpError, GoogleAPICallError) as e:
          raise PubSubException(
              f"Error acknowledging {len(ack_ids)} messages pulled from subscription {subscription_path}",
              e,
          )
  
      self.log.info(
          "Acknowledged ack_ids from 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 11 for calling the PubSubHook obj's underlying member method code with example usage: obj.acknowledge(subscription, project_id, ack_ids, messages, retry, timeout, metadata) without return types