public/helper/Send-TwitterWelcome_Message_Rule.ps1

function Send-TwitterWelcome_Message_Rule {

<#
.SYNOPSIS
    Welcome Messages
 
.DESCRIPTION
    POST direct_messages/welcome_messages/rules/new
     
    Creates a new Welcome Message Rule that determines which Welcome Message will be shown in a given conversation. Returns the created rule if successful.
     
    Requires a JSON POST body and Content-Type header to be set to application/json. Setting Content-Length may also be required if it is not automatically.
     
    Additional rule configurations are forthcoming. For the initial beta release, the most recently created Rule will always take precedence, and the assigned Welcome Message will be displayed in the conversation.
     
    See the Welcome Messages overview to learn how to work with Welcome Messages.
 
 
.NOTES
    This helper function was generated by the information provided here:
    https://developer.twitter.com/en/docs/direct-messages/welcome-messages/api-reference/new-welcome-message-rule
 
#>

    [CmdletBinding()]
    Param(
        
    )
    Begin {

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

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

    }
    Process {

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

    }
    End {

    }
}