using Insight.Infrastructure.Entities;
using MongoDB.Driver;

namespace Insight.Infrastructure
{
    public static class MongoDatabaseExtensions
    {
        // internal users (roles), groups...
        public static IMongoCollection<InsightUser> User(this IMongoDatabase database) => database.GetCollection<InsightUser>("user");
        public static IMongoCollection<InsightUserLogEntity> UserLog(this IMongoDatabase database) => database.GetCollection<InsightUserLogEntity>("user_log");
        public static IMongoCollection<InsightUserPreferences> UserPreference(this IMongoDatabase database) => database.GetCollection<InsightUserPreferences>("user_pref");
        public static IMongoCollection<InsightRole> Role(this IMongoDatabase database) => database.GetCollection<InsightRole>("role");

        // customers
        public static IMongoCollection<CustomerEntity> Customer(this IMongoDatabase database) => database.GetCollection<CustomerEntity>("customer");

        // agents
        public static IMongoCollection<AgentEntity> Agent(this IMongoDatabase database) => database.GetCollection<AgentEntity>("agent");
        public static IMongoCollection<AgentLogEntity> AgentLog(this IMongoDatabase database) => database.GetCollection<AgentLogEntity>("agent_log");

        // host groups
        public static IMongoCollection<HostEntity> HostGroup(this IMongoDatabase database) => database.GetCollection<HostEntity>("host");

        // hosts
        public static IMongoCollection<HostEntity> Host(this IMongoDatabase database) => database.GetCollection<HostEntity>("host");
        public static IMongoCollection<HostLogEntity> HostLog(this IMongoDatabase database) => database.GetCollection<HostLogEntity>("host_log");

        // hosts extensions
        public static IMongoCollection<HostLogMonitoringEntity> HostLogMonitoring(this IMongoDatabase database) => database.GetCollection<HostLogMonitoringEntity>("host_log_mon");
        public static IMongoCollection<HostApplicationEntity> HostApplication(this IMongoDatabase database) => database.GetCollection<HostApplicationEntity>("host_app");
        public static IMongoCollection<HostDriveEntity> HostDrive(this IMongoDatabase database) => database.GetCollection<HostDriveEntity>("host_drv");
        public static IMongoCollection<HostVolumeEntity> HostVolume(this IMongoDatabase database) => database.GetCollection<HostVolumeEntity>("host_vol");
        public static IMongoCollection<HostOsEntity> HostOs(this IMongoDatabase database) => database.GetCollection<HostOsEntity>("host_os");
        public static IMongoCollection<HostUpdateEntity> HostUpdate(this IMongoDatabase database) => database.GetCollection<HostUpdateEntity>("host_upd");
        public static IMongoCollection<HostSessionEntity> HostSession(this IMongoDatabase database) => database.GetCollection<HostSessionEntity>("host_session");
        public static IMongoCollection<HostServiceEntity> HostService(this IMongoDatabase database) => database.GetCollection<HostServiceEntity>("host_svc");
        public static IMongoCollection<HostPrinterEntity> HostPrinter(this IMongoDatabase database) => database.GetCollection<HostPrinterEntity>("host_prn");
        public static IMongoCollection<HostMainboardEntity> HostMainboard(this IMongoDatabase database) => database.GetCollection<HostMainboardEntity>("host_board");
        public static IMongoCollection<HostProcessorEntity> HostProcessor(this IMongoDatabase database) => database.GetCollection<HostProcessorEntity>("host_cpu");
        public static IMongoCollection<HostMemoryEntity> HostMemory(this IMongoDatabase database) => database.GetCollection<HostMemoryEntity>("host_mem");
        public static IMongoCollection<HostVideocardEntity> HostVideocard(this IMongoDatabase database) => database.GetCollection<HostVideocardEntity>("host_gpu");
        public static IMongoCollection<HostUserEntity> HostSystemUser(this IMongoDatabase database) => database.GetCollection<HostUserEntity>("host_sysusr");
        public static IMongoCollection<HostGroupEntity> HostSystemGroup(this IMongoDatabase database) => database.GetCollection<HostGroupEntity>("host_sysgrp");
        public static IMongoCollection<HostUserGroupEntity> HostSystemUserSystemGroup(this IMongoDatabase database) => database.GetCollection<HostUserGroupEntity>("host_sysusr_sysgrp");
        public static IMongoCollection<HostSystemEntity> HostSystem(this IMongoDatabase database) => database.GetCollection<HostSystemEntity>("host_sys");
        public static IMongoCollection<HostStoragePoolEntity> HostStoragePool(this IMongoDatabase database) => database.GetCollection<HostStoragePoolEntity>("host_sp");
        public static IMongoCollection<HostStoragePoolPhysicalDiskEntity> HostStoragePoolPhysicalDisk(this IMongoDatabase database) => database.GetCollection<HostStoragePoolPhysicalDiskEntity>("host_sp.pd");
        public static IMongoCollection<HostStoragePoolVirtualDiskEntity> HostStoragePoolVirtualDisk(this IMongoDatabase database) => database.GetCollection<HostStoragePoolVirtualDiskEntity>("host_sp.vd");
        public static IMongoCollection<HostHypervisorVirtualMaschineEntity> HostHypervisorVirtualMaschine(this IMongoDatabase database) => database.GetCollection<HostHypervisorVirtualMaschineEntity>("host_hv_vm");
        public static IMongoCollection<HostHypervisorVirtualMaschineConfigEntity> HostVirtualMaschineConfig(this IMongoDatabase database) => database.GetCollection<HostHypervisorVirtualMaschineConfigEntity>("host_hv_vm_cfg");
        public static IMongoCollection<HostInterfaceEntity> HostInterface(this IMongoDatabase database) => database.GetCollection<HostInterfaceEntity>("host_if");
        public static IMongoCollection<HostInterfaceAddressEntity> HostInterfaceAddress(this IMongoDatabase database) => database.GetCollection<HostInterfaceAddressEntity>("host_if_addr");
        public static IMongoCollection<HostInterfaceGatewayEntity> HostInterfaceGateway(this IMongoDatabase database) => database.GetCollection<HostInterfaceGatewayEntity>("host_if_gw");
        public static IMongoCollection<HostInterfaceNameserverEntity> HostInterfaceNameserver(this IMongoDatabase database) => database.GetCollection<HostInterfaceNameserverEntity>("host_if_ns");
        public static IMongoCollection<HostInterfaceRouteEntity> HostInterfaceRoute(this IMongoDatabase database) => database.GetCollection<HostInterfaceRouteEntity>("host_if_rt");
    }
}