Pax8API/Public/Partner/Update-Pax8SubscriptionById.ps1

<#
.SYNOPSIS
Update Subscription
.DESCRIPTION
Updates a subscription. Currently NOT supported for subscriptions with a future date. At least one of the following fields are required: Price, BillingTerm, Quantity, StartDate
OpenAPI: PUT /subscriptions/{subscriptionId}
Scope: Partner. Audience: https://api.pax8.com.
.PARAMETER SubscriptionId
subscription to be updated
.PARAMETER Quantity
body parameter 'quantity'.
.PARAMETER StartDate
body parameter 'startDate'.
.PARAMETER EndDate
body parameter 'endDate'.
.PARAMETER Price
The price for the customer.
.PARAMETER CurrencyCode
The currency ISO 4217 code
.PARAMETER PartnerCost
The price for the Partner.
.PARAMETER BillingTerm
body parameter 'billingTerm'. Suggested values: Monthly, Annual, 2-Year, 3-Year, One-Time, Trial, Activation.
.PARAMETER ProvisioningDetails
body parameter 'provisioningDetails'.
.PARAMETER Body
Raw request body. This can be a hashtable, PSCustomObject, or pre-built JSON string.
.EXAMPLE
Update-Pax8SubscriptionById -SubscriptionId 'value'
.LINK
https://devx.pax8.com/openapi/partner-endpoints.json
#>

function Update-Pax8SubscriptionById {
    [CmdletBinding()]
    param (
        [Parameter(Mandatory = $true)]
        [string]$SubscriptionId,

        [double]$Quantity,

        [datetime]$StartDate,

        [datetime]$EndDate,

        [double]$Price,

        [string]$CurrencyCode,

        [double]$PartnerCost,

        [ValidateSet('Monthly', 'Annual', '2-Year', '3-Year', 'One-Time', 'Trial', 'Activation')]
        [string]$BillingTerm,

        [object[]]$ProvisioningDetails,

        [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
    }
}

Set-Alias -Name 'Set-Pax8Subscription' -Value 'Update-Pax8SubscriptionById'