# Path: libcloudforensics/providers/gcp/internal/common.py
# RETRY_MAX = 10
# COMPUTE_RFC1035_REGEX = re.compile('^(?=.{1,63}$)[a-z]([-a-z0-9]*[a-z0-9])?$')
# REGEX_DISK_NAME = COMPUTE_RFC1035_REGEX
# COMPUTE_NAME_LIMIT = 63
# STORAGE_LINK_URL = 'https://storage.cloud.google.com'
# DEFAULT_COMPUTE_INSTANCE_SCOPE = [
#     'https://www.googleapis.com/auth/devstorage.read_only',
#     'https://www.googleapis.com/auth/logging.write',
#     'https://www.googleapis.com/auth/monitoring.write',
#     'https://www.googleapis.com/auth/service.management.readonly',
#     'https://www.googleapis.com/auth/servicecontrol',
#     'https://www.googleapis.com/auth/trace.append'
# ]
# DEFAULT_SA_EMAIL = 'default'
#   COMPUTE_ENGINE_API_VERSION = 'v1'
# def GenerateDiskName(
#     snapshot: 'compute.GoogleComputeSnapshot',
#     disk_name_prefix: Optional[str] = None) -> str:
# def GenerateSourceRange(
#     exempted_src_ips: Optional[List[str]] = None) -> List[str]:
# def GenerateUniqueInstanceName(
#     prefix: str, truncate_at: Optional[int] = None) -> str:
# def CreateService(
#     service_name: str,
#     api_version: str) -> 'googleapiclient.discovery.Resource':
#   def __init__(self, project_id: Optional[str] = None) -> None:
#   def GceApi(self) -> 'googleapiclient.discovery.Resource':
#   def BlockOperation(
#       self, response: Dict[str, Any],
#       zone: Optional[str] = None) -> Dict[str, Any]:
# def ExecuteRequest(
#     client: 'googleapiclient.discovery.Resource',
#     func: str,
#     kwargs: Dict[str, Any],
#     throttle: bool = False) -> List[Dict[str, Any]]:
# def FormatRFC3339(datetime_instance: datetime.datetime) -> str:
# class GoogleCloudComputeClient:


from typing import Optional
from typing import TYPE_CHECKING, List, Dict, Any
from libcloudforensics.providers.gcp.internal import common
  import googleapiclient
      self, qfilter: Optional[List[str]] = None) -> List[Dict[str, Any]]:
    """Query logs in GCP project.

    Args:
      qfilter (List[str]): Optional. A list of query filters to use.

    Returns:
      List[Dict]: Log entries returned by the query, e.g. [{'projectIds':
          [...], 'resourceNames': [...]}, {...}]

    Raises:
      RuntimeError: If API call failed.
      ValueError: If the number of project IDs being queried doesn't match
          the number of provided filters.
    """

    entries = []
    gcl_instance_client = self.GclApi().entries() # pylint: disable=no-member

    if qfilter and len(self.project_ids) != len(qfilter):
      raise ValueError(
          'Several project IDs detected ({0:d}) but only {1:d} query filters '
          'provided.'.format(len(self.project_ids), len(qfilter)))

    for idx, project_id in enumerate(self.project_ids):
      body = {
          'resourceNames': 'projects/' + project_id,
          'filter': qfilter[idx] if qfilter else '',
          'orderBy': 'timestamp desc',
      }

# Path: libcloudforensics/providers/gcp/internal/common.py
# RETRY_MAX = 10
# COMPUTE_RFC1035_REGEX = re.compile('^(?=.{1,63}$)[a-z]([-a-z0-9]*[a-z0-9])?$')
# REGEX_DISK_NAME = COMPUTE_RFC1035_REGEX
# COMPUTE_NAME_LIMIT = 63
# STORAGE_LINK_URL = 'https://storage.cloud.google.com'
# DEFAULT_COMPUTE_INSTANCE_SCOPE = [
#     'https://www.googleapis.com/auth/devstorage.read_only',
#     'https://www.googleapis.com/auth/logging.write',
#     'https://www.googleapis.com/auth/monitoring.write',
#     'https://www.googleapis.com/auth/service.management.readonly',
#     'https://www.googleapis.com/auth/servicecontrol',
#     'https://www.googleapis.com/auth/trace.append'
# ]
# DEFAULT_SA_EMAIL = 'default'
#   COMPUTE_ENGINE_API_VERSION = 'v1'
# def GenerateDiskName(
#     snapshot: 'compute.GoogleComputeSnapshot',
#     disk_name_prefix: Optional[str] = None) -> str:
# def GenerateSourceRange(
#     exempted_src_ips: Optional[List[str]] = None) -> List[str]:
# def GenerateUniqueInstanceName(
#     prefix: str, truncate_at: Optional[int] = None) -> str:
# def CreateService(
#     service_name: str,
#     api_version: str) -> 'googleapiclient.discovery.Resource':
#   def __init__(self, project_id: Optional[str] = None) -> None:
#   def GceApi(self) -> 'googleapiclient.discovery.Resource':
#   def BlockOperation(
#       self, response: Dict[str, Any],
#       zone: Optional[str] = None) -> Dict[str, Any]:
# def ExecuteRequest(
#     client: 'googleapiclient.discovery.Resource',
#     func: str,
#     kwargs: Dict[str, Any],
#     throttle: bool = False) -> List[Dict[str, Any]]:
# def FormatRFC3339(datetime_instance: datetime.datetime) -> str:
# class GoogleCloudComputeClient:


# Path: libcloudforensics/providers/gcp/internal/log.py
from typing import Optional
from typing import TYPE_CHECKING, List, Dict, Any
from libcloudforensics.providers.gcp.internal import common
  import googleapiclient

      self, qfilter: Optional[List[str]] = None) -> List[Dict[str, Any]]:
    """Query logs in GCP project.

    Args:
      qfilter (List[str]): Optional. A list of query filters to use.

    Returns:
      List[Dict]: Log entries returned by the query, e.g. [{'projectIds':
          [...], 'resourceNames': [...]}, {...}]

    Raises:
      RuntimeError: If API call failed.
      ValueError: If the number of project IDs being queried doesn't match
          the number of provided filters.
    """

    entries = []
    gcl_instance_client = self.GclApi().entries() # pylint: disable=no-member

    if qfilter and len(self.project_ids) != len(qfilter):
      raise ValueError(
          'Several project IDs detected ({0:d}) but only {1:d} query filters '
          'provided.'.format(len(self.project_ids), len(qfilter)))

    for idx, project_id in enumerate(self.project_ids):
      body = {
          'resourceNames': 'projects/' + project_id,
          'filter': qfilter[idx] if qfilter else '',
          'orderBy': 'timestamp desc',
      }

      responses = common.ExecuteRequest(