Framework/Models/AzSKEvent.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Set-StrictMode -Version Latest
class AzSKRootEvent {
    static [string] $CustomMessage = "AzSK.CustomMessage"; #EventArgument: AzSKRootEventArgument

    static [string] $GenerateRunIdentifier = "AzSK.GenerateRunIdentifier"; #Creates a timestamp and publish, Initialize listeners #EventArgument: AzSKRootEventArgument
    static [string] $UnsupportedResources = "AzSK.UnsupportedResources";
    static [string] $WriteCSV = "AzSK.WriteCSV";
    static [string] $PublishCustomData = "AzSK.PublishCustomData"


    #Command level event
    static [string] $CommandStarted = "AzSK.Command.Started"; #Initialize listeners #Command execution started #EventArgument: AzSKRootEventArgument
    static [string] $CommandCompleted = "AzSK.Command.Completed"; #Cleanup listeners #Command execution completed #EventArgument: AzSKRootEventArgument
    static [string] $CommandError = "AzSK.Command.Error"; #EventArgument: AzSKRootEventArgument
    static [string] $CommandProcessing = "AzSK.Command.Processing"; #EventArgument: AzSKRootEventArgument
}

class SubscriptionContext {
    [string] $SubscriptionId = "";
    [string] $SubscriptionName = "";
    [string] $Scope = "";
    hidden [hashtable] $SubscriptionMetadata = @{}
}

class AzSKRootEventArgument {
    [SubscriptionContext] $SubscriptionContext;
    [MessageData[]] $Messages = @();
    hidden [System.Management.Automation.ErrorRecord] $ExceptionMessage
}
class CustomData {
    [string] $Name
    [PSObject] $Value
}