Pax8API/Public/Partner/Remove-Pax8SubscriptionById.ps1

<#
.SYNOPSIS
Cancel Subscription
.DESCRIPTION
Cancels the Subscription specified by subscriptionId
OpenAPI: DELETE /subscriptions/{subscriptionId}
Scope: Partner. Audience: https://api.pax8.com.
.PARAMETER SubscriptionId
subscription to be updated
.PARAMETER CancelDate
The date to cancel the subscription on
.EXAMPLE
Remove-Pax8SubscriptionById -SubscriptionId 'value'
.LINK
https://devx.pax8.com/openapi/partner-endpoints.json
#>

function Remove-Pax8SubscriptionById {
    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'High')]
    param (
        [Parameter(Mandatory = $true)]
        [string]$SubscriptionId,

        [datetime]$CancelDate,

        [switch]$Raw
    )

    process {
        $boundParameters = @{}
        foreach ($entry in $PSBoundParameters.GetEnumerator()) {
            $boundParameters[$entry.Key] = $entry.Value
        }

        $target = 'DELETE /subscriptions/{subscriptionId}'
        if ($PSCmdlet.ShouldProcess($target, 'Remove-Pax8SubscriptionById')) {
            Invoke-Pax8ApiOperation -CommandName $MyInvocation.MyCommand.Name -Parameters $boundParameters
        }
    }
}