from enum import IntEnum


class DiscoverBeginColumns(IntEnum):
    EVENTCLASS = 0  # Event Class is used to categorize events.
    EVENTSUBCLASS = 1  # Event Subclass provides additional information about each event class.  The following are valid Sub Class Id/Sub Class Name value pairs: 0: DBSCHEMA_CATALOGS 1: DBSCHEMA_TABLES 2: DBSCHEMA_COLUMNS 3: DBSCHEMA_PROVIDER_TYPES 4: MDSCHEMA_CUBES 5: MDSCHEMA_DIMENSIONS 6: MDSCHEMA_HIERARCHIES 7: MDSCHEMA_LEVELS 8: MDSCHEMA_MEASURES 9: MDSCHEMA_PROPERTIES 10: MDSCHEMA_MEMBERS 11: MDSCHEMA_FUNCTIONS 12: MDSCHEMA_ACTIONS 13: MDSCHEMA_SETS 14: DISCOVER_INSTANCES 15: MDSCHEMA_KPIS 16: MDSCHEMA_MEASUREGROUPS 17: MDSCHEMA_COMMANDS 18: DMSCHEMA_MINING_SERVICES 19: DMSCHEMA_MINING_SERVICE_PARAMETERS 20: DMSCHEMA_MINING_FUNCTIONS 21: DMSCHEMA_MINING_MODEL_CONTENT 22: DMSCHEMA_MINING_MODEL_XML 23: DMSCHEMA_MINING_MODELS 24: DMSCHEMA_MINING_COLUMNS 25: DISCOVER_DATASOURCES 26: DISCOVER_PROPERTIES 27: DISCOVER_SCHEMA_ROWSETS 28: DISCOVER_ENUMERATORS 29: DISCOVER_KEYWORDS 30: DISCOVER_LITERALS 31: DISCOVER_XML_METADATA 32: DISCOVER_TRACES 33: DISCOVER_TRACE_DEFINITION_PROVIDERINFO 34: DISCOVER_TRACE_COLUMNS 35: DISCOVER_TRACE_EVENT_CATEGORIES 36: DMSCHEMA_MINING_STRUCTURES 37: DMSCHEMA_MINING_STRUCTURE_COLUMNS 38: DISCOVER_MASTER_KEY 39: MDSCHEMA_INPUT_DATASOURCES 40: DISCOVER_LOCATIONS 41: DISCOVER_PARTITION_DIMENSION_STAT 42: DISCOVER_PARTITION_STAT 43: DISCOVER_DIMENSION_STAT 44: MDSCHEMA_MEASUREGROUP_DIMENSIONS 45: DISCOVER_XEVENT_PACKAGES 46: DISCOVER_XEVENT_OBJECTS 47: DISCOVER_XEVENT_OBJECT_COLUMNS 48: DISCOVER_XEVENT_SESSION_TARGETS 49: DISCOVER_XEVENT_SESSIONS 50: DISCOVER_STORAGE_TABLES 51: DISCOVER_STORAGE_TABLE_COLUMNS 52: DISCOVER_STORAGE_TABLE_COLUMN_SEGMENTS 53: DISCOVER_CALC_DEPENDENCY 54: DISCOVER_CSDL_METADATA 55: DISCOVER_RESOURCE_POOLS 56: TMSCHEMA_MODEL 57: TMSCHEMA_DATA_SOURCES 58: TMSCHEMA_TABLES 59: TMSCHEMA_COLUMNS 60: TMSCHEMA_ATTRIBUTE_HIERARCHIES 61: TMSCHEMA_PARTITIONS 62: TMSCHEMA_RELATIONSHIPS 63: TMSCHEMA_MEASURES 64: TMSCHEMA_HIERARCHIES 65: TMSCHEMA_LEVELS 67: TMSCHEMA_TABLE_STORAGES 68: TMSCHEMA_COLUMN_STORAGES 69: TMSCHEMA_PARTITION_STORAGES 70: TMSCHEMA_SEGMENT_MAP_STORAGES 71: TMSCHEMA_DICTIONARY_STORAGES 72: TMSCHEMA_COLUMN_PARTITION_STORAGES 73: TMSCHEMA_RELATIONSHIP_STORAGES 74: TMSCHEMA_RELATIONSHIP_INDEX_STORAGES 75: TMSCHEMA_ATTRIBUTE_HIERARCHY_STORAGES 76: TMSCHEMA_HIERARCHY_STORAGES 77: DISCOVER_RING_BUFFERS 78: TMSCHEMA_KPIS 79: TMSCHEMA_STORAGE_FOLDERS 80: TMSCHEMA_STORAGE_FILES 81: TMSCHEMA_SEGMENT_STORAGES 82: TMSCHEMA_CULTURES 83: TMSCHEMA_OBJECT_TRANSLATIONS 84: TMSCHEMA_LINGUISTIC_METADATA 85: TMSCHEMA_ANNOTATIONS 86: TMSCHEMA_PERSPECTIVES 87: TMSCHEMA_PERSPECTIVE_TABLES 88: TMSCHEMA_PERSPECTIVE_COLUMNS 89: TMSCHEMA_PERSPECTIVE_HIERARCHIES 90: TMSCHEMA_PERSPECTIVE_MEASURES  95: TMSCHEMA_SETS 96: TMSCHEMA_PERSPECTIVE_SETS 97: TMSCHEMA_EXTENDED_PROPERTIES 98: TMSCHEMA_EXPRESSIONS 99: TMSCHEMA_COLUMN_PERMISSIONS 100: TMSCHEMA_DETAIL_ROWS_DEFINITIONS 101: TMSCHEMA_RELATED_COLUMN_DETAILS 102: TMSCHEMA_GROUP_BY_COLUMNS 103: TMSCHEMA_CALCULATION_GROUPS 104: TMSCHEMA_CALCULATION_ITEMS 105: TMSCHEMA_ALTERNATE_OF_DEFINITIONS 106: TMSCHEMA_REFRESH_POLICIES 107: DISCOVER_POWERBI_DATASOURCES 108: TMSCHEMA_FORMAT_STRING_DEFINITIONS 109: DISCOVER_M_EXPRESSIONS 110: TMSCHEMA_POWERBI_ROLES 111: TMSCHEMA_QUERY_GROUPS 112: DISCOVER_DB_MEM_STATS 113: DISCOVER_MEM_STATS 114: TMSCHEMA_ANALYTICS_AIMETADATA 115: DISCOVER_OBJECT_COUNTERS
    CURRENTTIME = 2  # Time at which the event started, when available. For filtering, expected formats are 'YYYY-MM-DD' and 'YYYY-MM-DD HH:MM:SS'.
    STARTTIME = 3  # Time at which the event started, when available. For filtering, expected formats are 'YYYY-MM-DD' and 'YYYY-MM-DD HH:MM:SS'.
    CONNECTIONID = 25  # Contains the unique connection ID associated with the discover event.
    DATABASENAME = 28  # Name of the database in which the statement of the user is running.
    NTUSERNAME = 32  # Contains the user name associated with the command event. Depending on the environment, the user name is in the following form: - Windows user account (DOMAIN\UserName) - User Principal Name (UPN) (username@domain.com) - Service  Principal Name (SPN) (appid@tenantid) - Power BI Service Account  (Power BI Service) - Power BI Service on behalf of a UPN or SPN (Power BI Service (UPN/SPN))
    NTDOMAINNAME = 33  # Contains the domain name associated with the user account that triggered the command event.  - Windows domain name for Windows user accounts - AzureAD for Microsoft Entra accounts - NT AUTHORITY accounts without a Windows domain name, such as the Power BI service
    CLIENTPROCESSID = 36  # Contains the process ID of the client application.
    APPLICATIONNAME = 37  # Name of the client application that created the connection to the server. This column is populated with the values passed by the application rather than the displayed name of the program.
    SESSIONID = 39  # Contains the session ID associated with the discover event.
    NTCANONICALUSERNAME = 40  # Contains the user name associated with the command event. Depending on the environment, the user name is in the following form: - Windows user account (DOMAIN\UserName) - User Principal Name (UPN) (username@domain.com) - Service Principal Name (SPN) (appid@tenantid) - Power BI Service Account (Power BI Service)
    SPID = 41  # Contains the server process ID (SPID) that uniquely identifies the user session associated with the discover event. The SPID directly corresponds to the session GUID used by XMLA.
    TEXTDATA = 42  # Contains the text data associated with the event.
    SERVERNAME = 43  # Contains the name of the instance on which the discover event occurred.
    REQUESTPROPERTIES = (
        45  # Contains the XML for Analysis (XMLA) request properties associated with the discover event.
    )
    ACTIVITYID = 46
    REQUESTID = 47


class DiscoverEndColumns(IntEnum):
    EVENTCLASS = 0  # Contains the event class; this is used to categorize events.
    EVENTSUBCLASS = 1  # Event Subclass provides additional information about each event class. The following are valid Sub Class Id/Sub Class Name value pairs: 0: DBSCHEMA_CATALOGS 1: DBSCHEMA_TABLES 2: DBSCHEMA_COLUMNS 3: DBSCHEMA_PROVIDER_TYPES 4: MDSCHEMA_CUBES 5: MDSCHEMA_DIMENSIONS 6: MDSCHEMA_HIERARCHIES 7: MDSCHEMA_LEVELS 8: MDSCHEMA_MEASURES 9: MDSCHEMA_PROPERTIES 10: MDSCHEMA_MEMBERS 11: MDSCHEMA_FUNCTIONS 12: MDSCHEMA_ACTIONS 13: MDSCHEMA_SETS 14: DISCOVER_INSTANCES 15: MDSCHEMA_KPIS 16: MDSCHEMA_MEASUREGROUPS 17: MDSCHEMA_COMMANDS 18: DMSCHEMA_MINING_SERVICES 19: DMSCHEMA_MINING_SERVICE_PARAMETERS 20: DMSCHEMA_MINING_FUNCTIONS 21: DMSCHEMA_MINING_MODEL_CONTENT 22: DMSCHEMA_MINING_MODEL_XML 23: DMSCHEMA_MINING_MODELS 24: DMSCHEMA_MINING_COLUMNS 25: DISCOVER_DATASOURCES 26: DISCOVER_PROPERTIES 27: DISCOVER_SCHEMA_ROWSETS 28: DISCOVER_ENUMERATORS 29: DISCOVER_KEYWORDS 30: DISCOVER_LITERALS 31: DISCOVER_XML_METADATA 32: DISCOVER_TRACES 33: DISCOVER_TRACE_DEFINITION_PROVIDERINFO 34: DISCOVER_TRACE_COLUMNS 35: DISCOVER_TRACE_EVENT_CATEGORIES 36: DMSCHEMA_MINING_STRUCTURES 37: DMSCHEMA_MINING_STRUCTURE_COLUMNS 38: DISCOVER_MASTER_KEY 39: MDSCHEMA_INPUT_DATASOURCES 40: DISCOVER_LOCATIONS 41: DISCOVER_PARTITION_DIMENSION_STAT 42: DISCOVER_PARTITION_STAT 43: DISCOVER_DIMENSION_STAT 44: MDSCHEMA_MEASUREGROUP_DIMENSIONS 45: DISCOVER_XEVENT_PACKAGES 46: DISCOVER_XEVENT_OBJECTS 47: DISCOVER_XEVENT_OBJECT_COLUMNS 48: DISCOVER_XEVENT_SESSION_TARGETS 49: DISCOVER_XEVENT_SESSIONS 50: DISCOVER_STORAGE_TABLES 51: DISCOVER_STORAGE_TABLE_COLUMNS 52: DISCOVER_STORAGE_TABLE_COLUMN_SEGMENTS 53: DISCOVER_CALC_DEPENDENCY 54: DISCOVER_CSDL_METADATA 55: DISCOVER_RESOURCE_POOLS 56: TMSCHEMA_MODEL 57: TMSCHEMA_DATA_SOURCES 58: TMSCHEMA_TABLES 59: TMSCHEMA_COLUMNS 60: TMSCHEMA_ATTRIBUTE_HIERARCHIES 61: TMSCHEMA_PARTITIONS 62: TMSCHEMA_RELATIONSHIPS 63: TMSCHEMA_MEASURES 64: TMSCHEMA_HIERARCHIES 65: TMSCHEMA_LEVELS 67: TMSCHEMA_TABLE_STORAGES 68: TMSCHEMA_COLUMN_STORAGES 69: TMSCHEMA_PARTITION_STORAGES 70: TMSCHEMA_SEGMENT_MAP_STORAGES 71: TMSCHEMA_DICTIONARY_STORAGES 72: TMSCHEMA_COLUMN_PARTITION_STORAGES 73: TMSCHEMA_RELATIONSHIP_STORAGES 74: TMSCHEMA_RELATIONSHIP_INDEX_STORAGES 75: TMSCHEMA_ATTRIBUTE_HIERARCHY_STORAGES 76: TMSCHEMA_HIERARCHY_STORAGES 77: DISCOVER_RING_BUFFERS 78: TMSCHEMA_KPIS 79: TMSCHEMA_STORAGE_FOLDERS 80: TMSCHEMA_STORAGE_FILES 81: TMSCHEMA_SEGMENT_STORAGES 82: TMSCHEMA_CULTURES 83: TMSCHEMA_OBJECT_TRANSLATIONS 84: TMSCHEMA_LINGUISTIC_METADATA 85: TMSCHEMA_ANNOTATIONS 86: TMSCHEMA_PERSPECTIVES 87: TMSCHEMA_PERSPECTIVE_TABLES 88: TMSCHEMA_PERSPECTIVE_COLUMNS 89: TMSCHEMA_PERSPECTIVE_HIERARCHIES 90: TMSCHEMA_PERSPECTIVE_MEASURES  95: TMSCHEMA_SETS 96: TMSCHEMA_PERSPECTIVE_SETS 97: TMSCHEMA_EXTENDED_PROPERTIES 98: TMSCHEMA_EXPRESSIONS 99: TMSCHEMA_COLUMN_PERMISSIONS 100: TMSCHEMA_DETAIL_ROWS_DEFINITIONS 101: TMSCHEMA_RELATED_COLUMN_DETAILS 102: TMSCHEMA_GROUP_BY_COLUMNS 103: TMSCHEMA_CALCULATION_GROUPS 104: TMSCHEMA_CALCULATION_ITEMS 105: TMSCHEMA_ALTERNATE_OF_DEFINITIONS 106: TMSCHEMA_REFRESH_POLICIES 107: DISCOVER_POWERBI_DATASOURCES 108: TMSCHEMA_FORMAT_STRING_DEFINITIONS 109: DISCOVER_M_EXPRESSIONS 110: TMSCHEMA_POWERBI_ROLES 111: TMSCHEMA_QUERY_GROUPS 112: DISCOVER_DB_MEM_STATS 113: DISCOVER_MEM_STATS 114: TMSCHEMA_ANALYTICS_AIMETADATA 115: DISCOVER_OBJECT_COUNTERS
    CURRENTTIME = 2  # Contains the current time of the discover event, when available. For filtering, expected formats are 'YYYY-MM-DD' and 'YYYY-MM-DD HH:MM:SS'.
    STARTTIME = 3  # Contains the time (if available) at which the discover end event started.. For filtering, expected formats are 'YYYY-MM-DD' and 'YYYY-MM-DD HH:MM:SS'.
    ENDTIME = 4  # Contains the time at which the event ended. This column is not populated for starting event classes, such as SQL:BatchStarting or SP:Starting. For filtering, expected formats are 'YYYY-MM-DD' and 'YYYY-MM-DD HH:MM:SS'.
    DURATION = 5  # Contains the approximate amount of time (milliseconds) taken by the discover event.
    CPUTIME = 6  # Contains the amount of CPU time (in milliseconds) used by the event.
    SEVERITY = 22  # Contains the severity level of an exception.
    SUCCESS = 23  # Contains the success or failure of the discover event. Values are: 0 = Failure 1 = Success
    ERROR = 24  # Contains the error number of any error associated the discover event.
    CONNECTIONID = 25  # Contains the unique connection ID associated with the discover event.
    DATABASENAME = 28  # Contains the name of the database in which the discover event occurred.
    NTUSERNAME = 32  # Contains the Windows user name associated with the object permission event.
    NTDOMAINNAME = 33  # Contains the domain name associated with the user account that triggered the command event.  - Windows domain name for Windows user accounts - AzureAD for Microsoft Entra accounts - NT AUTHORITY accounts without a Windows domain name, such as the Power BI service
    CLIENTPROCESSID = 36  # Contains the client process ID of the application that initiated the event.
    APPLICATIONNAME = 37  # Contains the name of the client application that created the connection to the server. This column is populated with the values passed by the application rather than the displayed name of the program.
    SESSIONID = 39  # Contains the session ID associated with the discover event.
    NTCANONICALUSERNAME = 40  # Contains the user name associated with the command event. Depending on the environment, the user name is in the following form: - Windows user account (DOMAIN\UserName) - User Principal Name (UPN) (username@domain.com) - Service Principal Name (SPN) (appid@tenantid) - Power BI Service Account (Power BI Service)
    SPID = 41  # Contains the server process ID (SPID) that uniquely identifies the user session associated with the discover end event. The SPID directly corresponds to the session GUID used by XMLA.
    TEXTDATA = 42  # Contains the text data associated with the event.
    SERVERNAME = 43  # Contains the name of the instance on which the discover event occurred.
    REQUESTPROPERTIES = 45  # Contains the properties in the XMLA request.
    ACTIVITYID = 46
    REQUESTID = 47
