# Path: libcloudforensics/errors.py
# class LCFError(Exception):
# class CredentialsConfigurationError(LCFError):
# class InvalidFileFormatError(LCFError):
# class InvalidNameError(LCFError):
# class ResourceNotFoundError(LCFError):
# class ResourceCreationError(LCFError):
# class ResourceDeletionError(LCFError):
# class InstanceStateChangeError(LCFError):
# class ServiceAccountRemovalError(LCFError):
# class InstanceProfileCreationError(LCFError):
# class OperationFailedError(LCFError):
# class TransferCreationError(LCFError):
# class TransferExecutionError(LCFError):
# class ResourceAlreadyExistsError(LCFError):
#   def __init__(self,
#                message: str,
#                name: str) -> None:
# 
# Path: libcloudforensics/providers/azure/internal/common.py
# REGEX_DISK_NAME = re.compile('^[\\w]{1,80}$')
# REGEX_SNAPSHOT_NAME = re.compile('^(?=.{1,80}$)[a-zA-Z0-9]([\\w,-]*[\\w])?$')
# REGEX_ACCOUNT_STORAGE_NAME = re.compile('^[a-z0-9]{1,24}$')
# REGEX_COMPUTE_RESOURCE_ID = re.compile(
#     '/subscriptions/.+/resourceGroups/.+/providers/Microsoft.Compute/.+/.+')
# DEFAULT_DISK_COPY_PREFIX = 'evidence'
# UBUNTU_1804_SKU = '18.04-LTS'
# def _ParseCredentialsFile(profile_name: str) -> Dict[str, Any]:
# def _CheckAzureCliCredentials() -> Optional[str]:
# def GetCredentials(profile_name: Optional[str] = None
#                    ) -> Tuple[str, DefaultAzureCredential]:
# def ExecuteRequest(
#     client: Any,
#     func: str,
#     kwargs: Optional[Dict[str, str]] = None) -> List[Any]:
# def GenerateDiskName(snapshot: 'compute.AZComputeSnapshot',
#                      disk_name_prefix: Optional[str] = None) -> str:


from typing import Optional, List, TYPE_CHECKING
from azure.mgmt import compute as compute_sdk  # pylint: disable=import-error
from libcloudforensics import errors
from libcloudforensics.providers.azure.internal import common
  from libcloudforensics.providers.azure.internal import account  # pylint: disable=cyclic-import, ungrouped-imports
    resource_id (str): The Azure resource ID.
    name (str): The resource's name.
    region (str): The region in which the resource is located.
    zones (List[str]): Optional. Availability zones within the region where
        the resource is located.
  """

  def __init__(self,
               az_account: 'account.AZAccount',
               resource_id: str,
               name: str,
               region: str,
               zones: Optional[List[str]] = None) -> None:
    """Initialize the AZComputeResource class.

    Args:
      az_account (AZAccount): An Azure account object.
      resource_id (str): The Azure resource ID.
      name (str): The resource's name.
      region (str): The region in which the resource is located.
      zones (List[str]): Optional. Availability zones within the region where
          the resource is located.

    Raises:
      InvalidNameError: If the resource ID is malformed.
    """

    if not common.REGEX_COMPUTE_RESOURCE_ID.match(resource_id):
      raise errors.InvalidNameError(
          'Malformed resource ID: expected {0:s}, got {1:s}'.format(

# Path: libcloudforensics/errors.py
# class LCFError(Exception):
# class CredentialsConfigurationError(LCFError):
# class InvalidFileFormatError(LCFError):
# class InvalidNameError(LCFError):
# class ResourceNotFoundError(LCFError):
# class ResourceCreationError(LCFError):
# class ResourceDeletionError(LCFError):
# class InstanceStateChangeError(LCFError):
# class ServiceAccountRemovalError(LCFError):
# class InstanceProfileCreationError(LCFError):
# class OperationFailedError(LCFError):
# class TransferCreationError(LCFError):
# class TransferExecutionError(LCFError):
# class ResourceAlreadyExistsError(LCFError):
#   def __init__(self,
#                message: str,
#                name: str) -> None:
# 
# Path: libcloudforensics/providers/azure/internal/common.py
# REGEX_DISK_NAME = re.compile('^[\\w]{1,80}$')
# REGEX_SNAPSHOT_NAME = re.compile('^(?=.{1,80}$)[a-zA-Z0-9]([\\w,-]*[\\w])?$')
# REGEX_ACCOUNT_STORAGE_NAME = re.compile('^[a-z0-9]{1,24}$')
# REGEX_COMPUTE_RESOURCE_ID = re.compile(
#     '/subscriptions/.+/resourceGroups/.+/providers/Microsoft.Compute/.+/.+')
# DEFAULT_DISK_COPY_PREFIX = 'evidence'
# UBUNTU_1804_SKU = '18.04-LTS'
# def _ParseCredentialsFile(profile_name: str) -> Dict[str, Any]:
# def _CheckAzureCliCredentials() -> Optional[str]:
# def GetCredentials(profile_name: Optional[str] = None
#                    ) -> Tuple[str, DefaultAzureCredential]:
# def ExecuteRequest(
#     client: Any,
#     func: str,
#     kwargs: Optional[Dict[str, str]] = None) -> List[Any]:
# def GenerateDiskName(snapshot: 'compute.AZComputeSnapshot',
#                      disk_name_prefix: Optional[str] = None) -> str:


# Path: libcloudforensics/providers/azure/internal/compute_base_resource.py
from typing import Optional, List, TYPE_CHECKING
from azure.mgmt import compute as compute_sdk  # pylint: disable=import-error
from libcloudforensics import errors
from libcloudforensics.providers.azure.internal import common
  from libcloudforensics.providers.azure.internal import account  # pylint: disable=cyclic-import, ungrouped-imports

    resource_id (str): The Azure resource ID.
    name (str): The resource's name.
    region (str): The region in which the resource is located.
    zones (List[str]): Optional. Availability zones within the region where
        the resource is located.
  """

  def __init__(self,
               az_account: 'account.AZAccount',
               resource_id: str,
               name: str,
               region: str,
               zones: Optional[List[str]] = None) -> None:
    """Initialize the AZComputeResource class.

    Args:
      az_account (AZAccount): An Azure account object.
      resource_id (str): The Azure resource ID.
      name (str): The resource's name.
      region (str): The region in which the resource is located.
      zones (List[str]): Optional. Availability zones within the region where
          the resource is located.

    Raises:
      InvalidNameError: If the resource ID is malformed.
    """

    if not common.REGEX_COMPUTE_RESOURCE_ID.match(resource_id):
      raise errors.InvalidNameError(
          'Malformed resource ID: expected {0:s}, got {1:s}'.format(

              common.REGEX_COMPUTE_RESOURCE_ID.pattern, resource_id), __name__)