Pax8API/Public/VendorUsage/Set-Pax8UsageLinesWithAggregate.ps1

<#
.SYNOPSIS
Save Usage Lines with an Aggregate Partner Quantity
.DESCRIPTION
A `subscriptionId` OR an `externalSubscriptionId` is required
OpenAPI: POST /aggregate-lines
Scope: VendorUsage. Audience: api://usage.
.PARAMETER SubscriptionId
query parameter 'subscriptionId'.
.PARAMETER ExternalSubscriptionId
query parameter 'externalSubscriptionId'.
.PARAMETER BillingPeriod
Billing period with format yyyy-MM
.PARAMETER OverwriteSameDayUsage
When set to false, usage lines for the same summary key will be appended instead of replacing existing same-day lines
.PARAMETER Body
Raw request body. This can be a hashtable, PSCustomObject, or pre-built JSON string.
.EXAMPLE
Set-Pax8UsageLinesWithAggregate -BillingPeriod 'value'
.LINK
https://devx.pax8.com/openapi/vendor-usage-endpoints.json
#>

function Set-Pax8UsageLinesWithAggregate {
    [CmdletBinding()]
    param (
        [guid]$SubscriptionId,

        [string]$ExternalSubscriptionId,

        [Parameter(Mandatory = $true)]
        [string]$BillingPeriod,

        [bool]$OverwriteSameDayUsage,

        [Parameter(ValueFromPipeline = $true)]
        [object]$Body,

        [switch]$Raw
    )

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

        Invoke-Pax8ApiOperation -CommandName $MyInvocation.MyCommand.Name -Parameters $boundParameters
    }
}