DSCResources/cTeamsCallingPolicy/cTeamsCallingPolicy.schema.psm1

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

<#
TeamsCallingPolicy [String] #ResourceName
{
    Identity = [string]
    [AccessTokens = [string[]]]
    [AllowCallForwardingToPhone = [bool]]
    [AllowCallForwardingToUser = [bool]]
    [AllowCallGroups = [bool]]
    [AllowCallRedirect = [string]{ Disabled | Enabled | UserOverride }]
    [AllowCloudRecordingForCalls = [bool]]
    [AllowDelegation = [bool]]
    [AllowPrivateCalling = [bool]]
    [AllowSIPDevicesCalling = [bool]]
    [AllowTranscriptionforCalling = [bool]]
    [AllowVoicemail = [string]{ AlwaysDisabled | AlwaysEnabled | UserOverride }]
    [AllowWebPSTNCalling = [bool]]
    [ApplicationId = [string]]
    [AutoAnswerEnabledType = [string]{ Disabled | Enabled }]
    [BusyOnBusyEnabledType = [string]{ Disabled | Enabled | Unanswered | UserOverride }]
    [CallRecordingExpirationDays = [UInt32]]
    [CertificateThumbprint = [string]]
    [Credential = [PSCredential]]
    [DependsOn = [string[]]]
    [Description = [string]]
    [Ensure = [string]{ Absent | Present }]
    [LiveCaptionsEnabledTypeForCalling = [string]{ Disabled | DisabledUserOverride }]
    [ManagedIdentity = [bool]]
    [MusicOnHoldEnabledType = [string]{ Disabled | Enabled | UserOverride }]
    [PreventTollBypass = [bool]]
    [PsDscRunAsCredential = [PSCredential]]
    [SafeTransferEnabled = [string]{ Disabled | Enabled | UserOverride }]
    [SpamFilteringEnabledType = [string]{ Disabled | Enabled }]
    [TenantId = [string]]
}
 
#>



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

    $dscResourceName = 'TeamsCallingPolicy'

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

    $dscParameterKeys = 'Identity' -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)
    }
}