DSCResources/cTeamsCallQueue/cTeamsCallQueue.schema.psm1

configuration cTeamsCallQueue {
    param (
        [Parameter()]
        [hashtable[]]
        $Items
)

<#
TeamsCallQueue [String] #ResourceName
{
    Name = [string]
    [AccessTokens = [string[]]]
    [AgentAlertTime = [UInt16]]
    [AllowOptOut = [bool]]
    [ApplicationId = [string]]
    [AuthorizedUsers = [string[]]]
    [CertificateThumbprint = [string]]
    [ChannelId = [string]]
    [ChannelUserObjectId = [string]]
    [ConferenceMode = [bool]]
    [Credential = [PSCredential]]
    [DependsOn = [string[]]]
    [DistributionLists = [string[]]]
    [EnableOverflowSharedVoicemailTranscription = [bool]]
    [EnableTimeoutSharedVoicemailTranscription = [bool]]
    [Ensure = [string]{ Absent | Present }]
    [LanguageId = [string]]
    [ManagedIdentity = [bool]]
    [MusicOnHoldAudioFileId = [string]]
    [OboResourceAccountIds = [string[]]]
    [OverflowAction = [string]{ DisconnectWithBusy | Forward | SharedVoicemail | Voicemail }]
    [OverflowActionTarget = [string]]
    [OverflowDisconnectAudioFilePrompt = [string]]
    [OverflowDisconnectTextToSpeechPrompt = [string]]
    [OverflowRedirectPersonAudioFilePrompt = [string]]
    [OverflowRedirectPersonTextToSpeechPrompt = [string]]
    [OverflowRedirectPhoneNumberAudioFilePrompt = [string]]
    [OverflowRedirectPhoneNumberTextToSpeechPrompt = [string]]
    [OverflowRedirectVoiceAppAudioFilePrompt = [string]]
    [OverflowRedirectVoiceAppTextToSpeechPrompt = [string]]
    [OverflowRedirectVoicemailAudioFilePrompt = [string]]
    [OverflowRedirectVoicemailTextToSpeechPrompt = [string]]
    [OverflowSharedVoicemailAudioFilePrompt = [string]]
    [OverflowSharedVoicemailTextToSpeechPrompt = [string]]
    [OverflowThreshold = [UInt16]]
    [PresenceBasedRouting = [bool]]
    [PsDscRunAsCredential = [PSCredential]]
    [RoutingMethod = [string]{ Attendant | LongestIdle | RoundRobin | Serial }]
    [TenantId = [string]]
    [TimeoutAction = [string]{ Disconnect | Forward | SharedVoicemail | Voicemail }]
    [TimeoutActionTarget = [string]]
    [TimeoutDisconnectAudioFilePrompt = [string]]
    [TimeoutDisconnectTextToSpeechPrompt = [string]]
    [TimeoutRedirectPersonAudioFilePrompt = [string]]
    [TimeoutRedirectPersonTextToSpeechPrompt = [string]]
    [TimeoutRedirectPhoneNumberAudioFilePrompt = [string]]
    [TimeoutRedirectPhoneNumberTextToSpeechPrompt = [string]]
    [TimeoutRedirectVoiceAppAudioFilePrompt = [string]]
    [TimeoutRedirectVoiceAppTextToSpeechPrompt = [string]]
    [TimeoutRedirectVoicemailAudioFilePrompt = [string]]
    [TimeoutRedirectVoicemailTextToSpeechPrompt = [string]]
    [TimeoutSharedVoicemailAudioFilePrompt = [string]]
    [TimeoutSharedVoicemailTextToSpeechPrompt = [string]]
    [TimeoutThreshold = [UInt16]]
    [UseDefaultMusicOnHold = [bool]]
    [Users = [string[]]]
    [WelcomeMusicAudioFileId = [string]]
}
 
#>



    Import-DscResource -ModuleName PSDesiredStateConfiguration
    Import-DscResource -ModuleName Microsoft365DSC

    $dscResourceName = 'TeamsCallQueue'

    $param = $PSBoundParameters
    $param.Remove("InstanceName")

    $dscParameterKeys = 'Name' -split ', '

        foreach ($item in $Items)
        {
            if (-not $item.ContainsKey('Ensure'))
            {
                $item.Ensure = 'Present'
            }
            $keyValues = foreach ($key in $dscParameterKeys)
        {
            $item.$key
        }
        $executionName = $keyValues -join '_'
        $executionName = $executionName -replace "[\s()\\:*-+/{}```"']", '_'
        (Get-DscSplattedResource -ResourceName $dscResourceName -ExecutionName $executionName -Properties $item -NoInvoke).Invoke($item)
    }
}