# Path: libcloudforensics/providers/azure/internal/account.py
# class AZAccount:
#   def __init__(self,
#                default_resource_group_name: str,
#                default_region: str = 'eastus',
#                profile_name: Optional[str] = None) -> None:
#   def compute(self) -> compute_module.AZCompute:
#   def monitoring(self) -> monitoring_module.AZMonitoring:
#   def network(self) -> network_module.AZNetwork:
#   def resource(self) -> resource_module.AZResource:
#   def storage(self) -> storage_module.AZStorage:
# 
# Path: libcloudforensics/providers/azure/internal/compute.py
# class AZCompute:
# class AZComputeVirtualMachine(compute_base_resource.AZComputeResource):
# class AZComputeDisk(compute_base_resource.AZComputeResource):
# class AZComputeSnapshot(compute_base_resource.AZComputeResource):
#   def __init__(self, az_account: 'account.AZAccount') -> None:
#   def ListInstances(self,
#                     resource_group_name: Optional[str] = None
#                     ) -> Dict[str, 'AZComputeVirtualMachine']:
#   def ListDisks(
#       self,
#       resource_group_name: Optional[str] = None) -> Dict[str, 'AZComputeDisk']:
#   def GetInstance(
#       self,
#       instance_name: str,
#       resource_group_name: Optional[str] = None) -> 'AZComputeVirtualMachine':
#   def GetDisk(
#       self,
#       disk_name: str,
#       resource_group_name: Optional[str] = None) -> 'AZComputeDisk':
#   def CreateDiskFromSnapshot(
#       self,
#       snapshot: 'AZComputeSnapshot',
#       region: Optional[str] = None,
#       disk_name: Optional[str] = None,
#       disk_name_prefix: Optional[str] = None,
#       disk_type: str = 'Standard_LRS') -> 'AZComputeDisk':
#   def CreateDiskFromSnapshotURI(
#       self,
#       snapshot: 'AZComputeSnapshot',
#       snapshot_uri: str,
#       region: Optional[str] = None,
#       disk_name: Optional[str] = None,
#       disk_name_prefix: Optional[str] = None,
#       disk_type: str = 'Standard_LRS') -> 'AZComputeDisk':
#   def GetOrCreateAnalysisVm(
#       self,
#       vm_name: str,
#       boot_disk_size: int,
#       cpu_cores: int,
#       memory_in_mb: int,
#       ssh_public_key: str,
#       region: Optional[str] = None,
#       packages: Optional[List[str]] = None,
#       tags: Optional[Dict[str, str]] = None
#   ) -> Tuple['AZComputeVirtualMachine', bool]:
#   def ListInstanceTypes(self,
#                         region: Optional[str] = None) -> List[Dict[str, Any]]:
#   def _GetInstanceType(self, cpu_cores: int, memory_in_mb: int) -> str:
#   def __init__(self,
#                az_account: 'account.AZAccount',
#                resource_id: str,
#                name: str,
#                region: str,
#                zones: Optional[List[str]] = None) -> None:
#   def GetBootDisk(self) -> 'AZComputeDisk':
#   def GetDisk(self, disk_name: str) -> 'AZComputeDisk':
#   def ListDisks(self) -> Dict[str, 'AZComputeDisk']:
#   def AttachDisk(self, disk: 'AZComputeDisk') -> None:
#   def __init__(self,
#                az_account: 'account.AZAccount',
#                resource_id: str,
#                name: str,
#                region: str,
#                zones: Optional[List[str]] = None) -> None:
#   def Snapshot(self,
#                snapshot_name: Optional[str] = None,
#                tags: Optional[Dict[str, str]] = None) -> 'AZComputeSnapshot':
#   def GetDiskType(self) -> str:
#   def __init__(self,
#                az_account: 'account.AZAccount',
#                resource_id: str,
#                name: str,
#                region: str,
#                source_disk: AZComputeDisk) -> None:
#   def Delete(self) -> None:
#   def GrantAccessAndGetURI(self) -> str:
#   def RevokeAccessURI(self) -> None:
# 
# Path: libcloudforensics/providers/azure/internal/monitoring.py
# class AZMonitoring:
#   def __init__(self,
#                az_account: 'account.AZAccount') -> None:
#   def ListAvailableMetricsForResource(self, resource_id: str) -> List[str]:
#   def GetMetricsForResource(
#       self,
#       resource_id: str,
#       metrics: str,
#       from_date: Optional['datetime'] = None,
#       to_date: Optional['datetime'] = None,
#       interval: Optional[str] = None,
#       aggregation: str = 'Total',
#       qfilter: Optional[str] = None) -> Dict[str, Dict[str, str]]:


import mock
from libcloudforensics.providers.azure.internal import account
from libcloudforensics.providers.azure.internal import compute
from libcloudforensics.providers.azure.internal import monitoring
RESOURCE_ID_PREFIX = ('/subscriptions/sub/resourceGroups/fake-resource-group'
                      '/providers/Microsoft.Compute/type/')

# pylint: disable=line-too-long
with mock.patch('libcloudforensics.providers.azure.internal.common.GetCredentials') as mock_creds:
  mock_creds.return_value = ('fake-subscription-id', mock.Mock())
  with mock.patch('libcloudforensics.providers.azure.internal.resource.AZResource.GetOrCreateResourceGroup') as mock_resource:
    # pylint: enable=line-too-long
    mock_resource.return_value = 'fake-resource-group'
    FAKE_ACCOUNT = account.AZAccount(
        'fake-resource-group',
        default_region='fake-region'
    )

FAKE_INSTANCE = compute.AZComputeVirtualMachine(
    FAKE_ACCOUNT,
    RESOURCE_ID_PREFIX + 'fake-vm-name',
    'fake-vm-name',
    'fake-region',
    ['fake-zone']
)

FAKE_DISK = compute.AZComputeDisk(
    FAKE_ACCOUNT,
    RESOURCE_ID_PREFIX + 'fake-disk-name',
    'fake-disk-name',
    'fake-region',
    ['fake-zone']
)


# Path: libcloudforensics/providers/azure/internal/account.py
# class AZAccount:
#   def __init__(self,
#                default_resource_group_name: str,
#                default_region: str = 'eastus',
#                profile_name: Optional[str] = None) -> None:
#   def compute(self) -> compute_module.AZCompute:
#   def monitoring(self) -> monitoring_module.AZMonitoring:
#   def network(self) -> network_module.AZNetwork:
#   def resource(self) -> resource_module.AZResource:
#   def storage(self) -> storage_module.AZStorage:
# 
# Path: libcloudforensics/providers/azure/internal/compute.py
# class AZCompute:
# class AZComputeVirtualMachine(compute_base_resource.AZComputeResource):
# class AZComputeDisk(compute_base_resource.AZComputeResource):
# class AZComputeSnapshot(compute_base_resource.AZComputeResource):
#   def __init__(self, az_account: 'account.AZAccount') -> None:
#   def ListInstances(self,
#                     resource_group_name: Optional[str] = None
#                     ) -> Dict[str, 'AZComputeVirtualMachine']:
#   def ListDisks(
#       self,
#       resource_group_name: Optional[str] = None) -> Dict[str, 'AZComputeDisk']:
#   def GetInstance(
#       self,
#       instance_name: str,
#       resource_group_name: Optional[str] = None) -> 'AZComputeVirtualMachine':
#   def GetDisk(
#       self,
#       disk_name: str,
#       resource_group_name: Optional[str] = None) -> 'AZComputeDisk':
#   def CreateDiskFromSnapshot(
#       self,
#       snapshot: 'AZComputeSnapshot',
#       region: Optional[str] = None,
#       disk_name: Optional[str] = None,
#       disk_name_prefix: Optional[str] = None,
#       disk_type: str = 'Standard_LRS') -> 'AZComputeDisk':
#   def CreateDiskFromSnapshotURI(
#       self,
#       snapshot: 'AZComputeSnapshot',
#       snapshot_uri: str,
#       region: Optional[str] = None,
#       disk_name: Optional[str] = None,
#       disk_name_prefix: Optional[str] = None,
#       disk_type: str = 'Standard_LRS') -> 'AZComputeDisk':
#   def GetOrCreateAnalysisVm(
#       self,
#       vm_name: str,
#       boot_disk_size: int,
#       cpu_cores: int,
#       memory_in_mb: int,
#       ssh_public_key: str,
#       region: Optional[str] = None,
#       packages: Optional[List[str]] = None,
#       tags: Optional[Dict[str, str]] = None
#   ) -> Tuple['AZComputeVirtualMachine', bool]:
#   def ListInstanceTypes(self,
#                         region: Optional[str] = None) -> List[Dict[str, Any]]:
#   def _GetInstanceType(self, cpu_cores: int, memory_in_mb: int) -> str:
#   def __init__(self,
#                az_account: 'account.AZAccount',
#                resource_id: str,
#                name: str,
#                region: str,
#                zones: Optional[List[str]] = None) -> None:
#   def GetBootDisk(self) -> 'AZComputeDisk':
#   def GetDisk(self, disk_name: str) -> 'AZComputeDisk':
#   def ListDisks(self) -> Dict[str, 'AZComputeDisk']:
#   def AttachDisk(self, disk: 'AZComputeDisk') -> None:
#   def __init__(self,
#                az_account: 'account.AZAccount',
#                resource_id: str,
#                name: str,
#                region: str,
#                zones: Optional[List[str]] = None) -> None:
#   def Snapshot(self,
#                snapshot_name: Optional[str] = None,
#                tags: Optional[Dict[str, str]] = None) -> 'AZComputeSnapshot':
#   def GetDiskType(self) -> str:
#   def __init__(self,
#                az_account: 'account.AZAccount',
#                resource_id: str,
#                name: str,
#                region: str,
#                source_disk: AZComputeDisk) -> None:
#   def Delete(self) -> None:
#   def GrantAccessAndGetURI(self) -> str:
#   def RevokeAccessURI(self) -> None:
# 
# Path: libcloudforensics/providers/azure/internal/monitoring.py
# class AZMonitoring:
#   def __init__(self,
#                az_account: 'account.AZAccount') -> None:
#   def ListAvailableMetricsForResource(self, resource_id: str) -> List[str]:
#   def GetMetricsForResource(
#       self,
#       resource_id: str,
#       metrics: str,
#       from_date: Optional['datetime'] = None,
#       to_date: Optional['datetime'] = None,
#       interval: Optional[str] = None,
#       aggregation: str = 'Total',
#       qfilter: Optional[str] = None) -> Dict[str, Dict[str, str]]:


# Path: tests/providers/azure/azure_mocks.py
import mock
from libcloudforensics.providers.azure.internal import account
from libcloudforensics.providers.azure.internal import compute
from libcloudforensics.providers.azure.internal import monitoring

RESOURCE_ID_PREFIX = ('/subscriptions/sub/resourceGroups/fake-resource-group'
                      '/providers/Microsoft.Compute/type/')

# pylint: disable=line-too-long
with mock.patch('libcloudforensics.providers.azure.internal.common.GetCredentials') as mock_creds:
  mock_creds.return_value = ('fake-subscription-id', mock.Mock())
  with mock.patch('libcloudforensics.providers.azure.internal.resource.AZResource.GetOrCreateResourceGroup') as mock_resource:
    # pylint: enable=line-too-long
    mock_resource.return_value = 'fake-resource-group'
    FAKE_ACCOUNT = account.AZAccount(
        'fake-resource-group',
        default_region='fake-region'
    )

FAKE_INSTANCE = compute.AZComputeVirtualMachine(
    FAKE_ACCOUNT,
    RESOURCE_ID_PREFIX + 'fake-vm-name',
    'fake-vm-name',
    'fake-region',
    ['fake-zone']
)

FAKE_DISK = compute.AZComputeDisk(
    FAKE_ACCOUNT,
    RESOURCE_ID_PREFIX + 'fake-disk-name',
    'fake-disk-name',
    'fake-region',
    ['fake-zone']
)


FAKE_BOOT_DISK = compute.AZComputeDisk(