# 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:


import datetime
  import googleapiclient
from typing import TYPE_CHECKING, Dict, List, Optional, Any
from libcloudforensics.providers.gcp.internal import common
    """Initialize the GoogleCloudMonitoring object.

    Args:
      project_id (str): The name of the project.
    """

    self.project_id = project_id

  def GcmApi(self) -> 'googleapiclient.discovery.Resource':
    """Get a Google Cloud Monitoring service object.

    Returns:
      googleapiclient.discovery.Resource: A Google Cloud Monitoring
          service object.
    """
    return common.CreateService(
        'monitoring', self.CLOUD_MONITORING_API_VERSION)

  def ActiveServices(self, timeframe: int = 30) -> Dict[str, int]:
    """List active services in the project (default: last 30 days).

    Args:
      timeframe (int): Optional. The number (in days) for
          which to measure activity.

    Returns:
      Dict[str, int]: Dictionary mapping service name to number of uses.
    """
    start_time = common.FormatRFC3339(
        datetime.datetime.utcnow() - datetime.timedelta(days=timeframe))

# 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/monitoring.py
import datetime
  import googleapiclient
from typing import TYPE_CHECKING, Dict, List, Optional, Any
from libcloudforensics.providers.gcp.internal import common

    """Initialize the GoogleCloudMonitoring object.

    Args:
      project_id (str): The name of the project.
    """

    self.project_id = project_id

  def GcmApi(self) -> 'googleapiclient.discovery.Resource':
    """Get a Google Cloud Monitoring service object.

    Returns:
      googleapiclient.discovery.Resource: A Google Cloud Monitoring
          service object.
    """
    return common.CreateService(
        'monitoring', self.CLOUD_MONITORING_API_VERSION)

  def ActiveServices(self, timeframe: int = 30) -> Dict[str, int]:
    """List active services in the project (default: last 30 days).

    Args:
      timeframe (int): Optional. The number (in days) for
          which to measure activity.

    Returns:
      Dict[str, int]: Dictionary mapping service name to number of uses.
    """
    start_time = common.FormatRFC3339(
        datetime.datetime.utcnow() - datetime.timedelta(days=timeframe))

    end_time = common.FormatRFC3339(datetime.datetime.utcnow())