class_docstr: A base hook for Google cloud-related hooks.
  
  Google cloud has a shared REST API client that is built in the same way no matter
  which service you use.  This class helps construct and authorize the credentials
  needed to then call googleapiclient.discovery.build() to actually discover and
  build a client for a Google cloud service.
  
  The class also contains some miscellaneous helper functions.
  
  All hook derived from this base hook use the 'Google Cloud' connection
  type. Three ways of authentication are supported:
  
  Default credentials: Only the 'Project Id' is required. You'll need to
  have set up default credentials, such as by the
  ``GOOGLE_APPLICATION_DEFAULT`` environment variable or from the metadata
  server on Google Compute Engine.
  
  JSON key file: Specify 'Project Id', 'Keyfile Path' and 'Scope'.
  
  Legacy P12 key files are not supported.
  
  JSON data provided in the UI: Specify 'Keyfile JSON'.
  
  :param gcp_conn_id: The connection ID to use when fetching connection info.
  :param delegate_to: The account to impersonate using domain-wide delegation of authority,
      if any. For this to work, the service account making the request must have
      domain-wide delegation enabled. The usage of this parameter should be limited only to Google Workspace
      (gsuite) and marketing platform operators and hooks. It is deprecated for usage by Google Cloud
      and Firebase operators and hooks, as well as transfer operators in other providers that involve
      Google cloud.
  :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.
class_docstr_tok: ["A","base","hook","for","Google","cloud-related","hooks",".","Google","cloud","has","a","shared","REST","API","client","that","is","built","in","the","same","way","no","matter","which","service","you","use",".","This","class","helps","construct","and","authorize","the","credentials","needed","to","then","call","googleapiclient.discovery.build","(",")","to","actually","discover","and","build","a","client","for","a","Google","cloud","service",".","The","class","also","contains","some","miscellaneous","helper","functions",".","All","hook","derived","from","this","base","hook","use","the","'Google","Cloud","'","connection","type",".","Three","ways","of","authentication","are","supported",":","Default","credentials",":","Only","the","'Project","Id","'","is","required",".","You","'ll","need","to","have","set","up","default","credentials",",","such","as","by","the","``","GOOGLE_APPLICATION_DEFAULT","``","environment","variable","or","from","the","metadata","server","on","Google","Compute","Engine",".","JSON","key","file",":","Specify","'Project","Id","'",",","'Keyfile","Path","'","and","'Scope","'",".","Legacy","P12","key","files","are","not","supported",".","JSON","data","provided","in","the","UI",":","Specify","'Keyfile","JSON","'",".",":","param","gcp_conn_id",":","The","connection","ID","to","use","when","fetching","connection","info",".",":","param","delegate_to",":","The","account","to","impersonate","using","domain-wide","delegation","of","authority",",","if","any",".","For","this","to","work",",","the","service","account","making","the","request","must","have","domain-wide","delegation","enabled",".","The","usage","of","this","parameter","should","be","limited","only","to","Google","Workspace","(","gsuite",")","and","marketing","platform","operators","and","hooks",".","It","is","deprecated","for","usage","by","Google","Cloud","and","Firebase","operators","and","hooks",",","as","well","as","transfer","operators","in","other","providers","that","involve","Google","cloud",".",":","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","."]
docstr: Returns an authorized HTTP object to be used to build a Google cloud service hook connection.
docstr_tok: ["Returns","an","authorized","HTTP","object","to","be","used","to","build","a","Google","cloud","service","hook","connection","."]
code: def _authorize(self) -> google_auth_httplib2.AuthorizedHttp:
      """Returns an authorized HTTP object to be used to build a Google cloud service hook connection."""
      credentials = self.get_credentials()
      http = build_http()
      http = set_user_agent(http, "airflow/" + version.version)
      authed_http = google_auth_httplib2.AuthorizedHttp(
          credentials, http=http
      )
      return authed_http
  
imports: from __future__ import annotations
  import functools
  import json
  import logging
  import os
  import tempfile
  import warnings
  from contextlib import ExitStack, contextmanager
  from subprocess import check_output
  from typing import TYPE_CHECKING, Any, Callable, Generator, Sequence, TypeVar, cast
  import google.auth
  import google.auth.credentials
  import google.oauth2.service_account
  import google_auth_httplib2
  import requests
  import tenacity
  from asgiref.sync import sync_to_async
  from google.api_core.exceptions import Forbidden, ResourceExhausted, TooManyRequests
  from google.auth import _cloud_sdk, compute_engine
  from google.auth.environment_vars import CLOUD_SDK_CONFIG_DIR, CREDENTIALS
  from google.auth.exceptions import RefreshError
  from google.auth.transport import _http_client
  from googleapiclient import discovery
  from googleapiclient.errors import HttpError
  from googleapiclient.http import MediaIoBaseDownload, build_http, set_user_agent
  from airflow import version
  from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
  from airflow.hooks.base import BaseHook
  from airflow.providers.google.cloud.utils.credentials_provider import _get_scopes, _get_target_principal_and_delegates, get_credentials_and_project_id
  from airflow.providers.google.common.consts import CLIENT_INFO
  from airflow.utils.process_utils import patch_environ
label_desc: Use image node_id 8 for calling the GoogleBaseHook obj's underlying member method code with example usage: obj._authorize() and returns: authed_http