# Path: libcloudforensics/logging_utils.py
# def _GenerateColorSequences() -> List[str]:
#   def __init__(self,
#                colorize: bool = True,
#                random_color: bool = False,
#                **kwargs: str) -> None:
#   def format(self, record: logging.LogRecord) -> str:
# def SetUpLogger(name: str, no_newline: bool = False) -> None:
# def GetLogger(name: str) -> logging.Logger:
# COLOR_SEQS = _GenerateColorSequences()
# RESET_SEQ = '\u001b[0m'
# BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = COLOR_SEQS[8:16]
# BG_RED = '\u001b[41m'  # Red background
# BOLD = '\u001b[1m'  # Bold / bright modifier
# LOG_FORMAT = ('[%(asctime)s] [{0:s}{color:s}%(name)-20s{1:s}] %(levelname)-8s'
#               ' %(message)s')
# LEVEL_COLOR_MAP = {
#     'WARNING': YELLOW,
#     'INFO': WHITE,
#     'DEBUG': BLUE,
#     'CRITICAL': BOLD + BG_RED + WHITE,
#     'ERROR': RED
# }
# class Formatter(logging.Formatter):
# 
# 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 TYPE_CHECKING, Dict, List, Any
from googleapiclient import errors as google_api_errors
from libcloudforensics import logging_utils
from libcloudforensics.providers.gcp.internal import common
  import googleapiclient
    service = self.GrmApi()
    resource_client = getattr(service, resource_type)()
    request = {'name': name}
    # Safe to unpack
    response = common.ExecuteRequest(resource_client, 'get', request)[0]
    return response

  def DeleteResource(self, name: str) -> Dict[str, Any]:
    """Delete a Cloud Resource Manager resource.

    Args:
      name (str): a resource identifier in the format
        resource_type/resource_number e.g. projects/123456789012 where
        project_type is one of projects or folders.

    Returns:
      Dict[str, Any]: The operation's result details.

    Raises:
      TypeError: if an invalid resource type is provided.
    """
    resource_type = name.split('/')[0]
    if resource_type not in self.RESOURCE_TYPES[:-1]:
      raise TypeError('Invalid resource type "{0:s}", resource must be one of '
                      '"projects" or "folders" provided in the format '
                      '"resource_type/resource_number".'.format(name))
    service = self.GrmApi()
    resource_client = getattr(service, resource_type)()
    request = {'name': name}
    # Safe to unpack

# Path: libcloudforensics/logging_utils.py
# def _GenerateColorSequences() -> List[str]:
#   def __init__(self,
#                colorize: bool = True,
#                random_color: bool = False,
#                **kwargs: str) -> None:
#   def format(self, record: logging.LogRecord) -> str:
# def SetUpLogger(name: str, no_newline: bool = False) -> None:
# def GetLogger(name: str) -> logging.Logger:
# COLOR_SEQS = _GenerateColorSequences()
# RESET_SEQ = '\u001b[0m'
# BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = COLOR_SEQS[8:16]
# BG_RED = '\u001b[41m'  # Red background
# BOLD = '\u001b[1m'  # Bold / bright modifier
# LOG_FORMAT = ('[%(asctime)s] [{0:s}{color:s}%(name)-20s{1:s}] %(levelname)-8s'
#               ' %(message)s')
# LEVEL_COLOR_MAP = {
#     'WARNING': YELLOW,
#     'INFO': WHITE,
#     'DEBUG': BLUE,
#     'CRITICAL': BOLD + BG_RED + WHITE,
#     'ERROR': RED
# }
# class Formatter(logging.Formatter):
# 
# 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/cloudresourcemanager.py
from typing import TYPE_CHECKING, Dict, List, Any
from googleapiclient import errors as google_api_errors
from libcloudforensics import logging_utils
from libcloudforensics.providers.gcp.internal import common
  import googleapiclient

    service = self.GrmApi()
    resource_client = getattr(service, resource_type)()
    request = {'name': name}
    # Safe to unpack
    response = common.ExecuteRequest(resource_client, 'get', request)[0]
    return response

  def DeleteResource(self, name: str) -> Dict[str, Any]:
    """Delete a Cloud Resource Manager resource.

    Args:
      name (str): a resource identifier in the format
        resource_type/resource_number e.g. projects/123456789012 where
        project_type is one of projects or folders.

    Returns:
      Dict[str, Any]: The operation's result details.

    Raises:
      TypeError: if an invalid resource type is provided.
    """
    resource_type = name.split('/')[0]
    if resource_type not in self.RESOURCE_TYPES[:-1]:
      raise TypeError('Invalid resource type "{0:s}", resource must be one of '
                      '"projects" or "folders" provided in the format '
                      '"resource_type/resource_number".'.format(name))
    service = self.GrmApi()
    resource_client = getattr(service, resource_type)()
    request = {'name': name}
    # Safe to unpack

    response = common.ExecuteRequest(resource_client, 'delete', request)[0]