public/helper/Send-TwitterDirectMessages_MarkRead.ps1

function Send-TwitterDirectMessages_MarkRead {
<#
.SYNOPSIS
    Typing indicator and read receipts
 
.DESCRIPTION
    POST direct_messages/mark_read
     
    Marks a message as read in the recipient’s Direct Message conversation view with the sender.
 
.PARAMETER last_read_event_id (required)
     
 
.PARAMETER recipient_id (required)
     
 
.PARAMETER 204
     
 
.PARAMETER 400
     
 
.NOTES
    This helper function was generated by the information provided here:
    https://developer.twitter.com/en/docs/direct-messages/typing-indicator-and-read-receipts/api-reference/new-read-receipt
 
#>

    [CmdletBinding()]
    Param(
        [string]$last_read_event_id,
        [string]$recipient_id,
        [string]$204,
        [string]$400
    )
    Begin {

        [hashtable]$Parameters = $PSBoundParameters
                   $CmdletBindingParameters | ForEach-Object { $Parameters.Remove($_) }

        [string]$Method      = 'POST'
        [string]$Resource    = '/direct_messages/mark_read'
        [string]$ResourceUrl = 'https://api.twitter.com/1.1/direct_messages/mark_read.json'

    }
    Process {

        # Find & Replace any ResourceUrl parameters.
        $UrlParameters = [regex]::Matches($ResourceUrl, '(?<!\w):\w+')
        ForEach ($UrlParameter in $UrlParameters) {
            $UrlParameterValue = $Parameters["$($UrlParameter.Value.TrimStart(":"))"]
            $ResourceUrl = $ResourceUrl -Replace $UrlParameter.Value, $UrlParameterValue
        }

        If (-Not $OAuthSettings) { $OAuthSettings = Get-TwitterOAuthSettings -Resource $Resource }
        Invoke-TwitterAPI -Method $Method -ResourceUrl $ResourceUrl -Parameters $Parameters -OAuthSettings $OAuthSettings

    }
    End {

    }
}