Pax8API/Public/Quoting/Remove-Pax8LineItem.ps1

<#
.SYNOPSIS
Delete line item by ID
.DESCRIPTION
Delete a line item by lineItemId from quote.
OpenAPI: DELETE /v2/quotes/{quoteId}/line-items/{lineItemId}
Scope: Quoting. Audience: https://api.pax8.com.
.PARAMETER QuoteId
path parameter 'quoteId'.
.PARAMETER LineItemId
path parameter 'lineItemId'.
.EXAMPLE
Remove-Pax8LineItem -QuoteId '00000000-0000-0000-0000-000000000000' -LineItemId '00000000-0000-0000-0000-000000000000'
.LINK
https://devx.pax8.com/openapi/quoting-endpoints.json
#>

function Remove-Pax8LineItem {
    [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'High')]
    param (
        [Parameter(Mandatory = $true)]
        [guid]$QuoteId,

        [Parameter(Mandatory = $true)]
        [guid]$LineItemId,

        [switch]$Raw
    )

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

        $target = 'DELETE /v2/quotes/{quoteId}/line-items/{lineItemId}'
        if ($PSCmdlet.ShouldProcess($target, 'Remove-Pax8LineItem')) {
            Invoke-Pax8ApiOperation -CommandName $MyInvocation.MyCommand.Name -Parameters $boundParameters
        }
    }
}