DSCResources/cTeamsGuestMessagingConfiguration/cTeamsGuestMessagingConfiguration.schema.psm1

configuration cTeamsGuestMessagingConfiguration {
    param (
        [Parameter(Mandatory = $true)]
        [ValidateSet('Yes')]
        [string]
        $IsSingleInstance,

        [Parameter()]
        [bool]
        $AllowUserEditMessage,

        [Parameter()]
        [bool]
        $AllowUserDeleteMessage,

        [Parameter()]
        [bool]
        $AllowUserChat,

        [Parameter()]
        [bool]
        $AllowUserDeleteChat,

        [Parameter()]
        [ValidateSet('Moderate', 'Strict', 'NoRestriction')]
        [string]
        $GiphyRatingType,

        [Parameter()]
        [bool]
        $AllowMemes,

        [Parameter()]
        [bool]
        $AllowStickers,

        [Parameter()]
        [bool]
        $AllowGiphy,

        [Parameter()]
        [bool]
        $AllowImmersiveReader,

        [Parameter()]
        [bool]
        $UsersCanDeleteBotMessages,

        [Parameter()]
        [PSCredential]
        $Credential,

        [Parameter()]
        [string]
        $ApplicationId,

        [Parameter()]
        [string]
        $TenantId,

        [Parameter()]
        [string]
        $CertificateThumbprint,

        [Parameter()]
        [PSCredential]
        $CertificatePassword,

        [Parameter()]
        [string]
        $CertificatePath,

        [Parameter()]
        [bool]
        $ManagedIdentity,

        [Parameter()]
        [string[]]
        $AccessTokens
)

<#
TeamsGuestMessagingConfiguration [String] #ResourceName
{
    IsSingleInstance = [string]{ Yes }
    [AccessTokens = [string[]]]
    [AllowGiphy = [bool]]
    [AllowImmersiveReader = [bool]]
    [AllowMemes = [bool]]
    [AllowStickers = [bool]]
    [AllowUserChat = [bool]]
    [AllowUserDeleteChat = [bool]]
    [AllowUserDeleteMessage = [bool]]
    [AllowUserEditMessage = [bool]]
    [ApplicationId = [string]]
    [CertificatePassword = [PSCredential]]
    [CertificatePath = [string]]
    [CertificateThumbprint = [string]]
    [Credential = [PSCredential]]
    [DependsOn = [string[]]]
    [GiphyRatingType = [string]{ Moderate | NoRestriction | Strict }]
    [ManagedIdentity = [bool]]
    [PsDscRunAsCredential = [PSCredential]]
    [TenantId = [string]]
    [UsersCanDeleteBotMessages = [bool]]
}
 
#>



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

    $dscResourceName = 'TeamsGuestMessagingConfiguration'

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

    $dscParameterKeys = 'IsSingleInstance' -split ', '

    $keyValues = foreach ($key in $dscParameterKeys)
    {
        $param.$key
    }
    $executionName = $keyValues -join '_'
    $executionName = $executionName -replace "[\s()\\:*-+/{}```"']", '_'

    (Get-DscSplattedResource -ResourceName $dscResourceName -ExecutionName $executionName -Properties $param -NoInvoke).Invoke($param)

}