Pax8API/Public/Partner/Get-Pax8UsageSummary.ps1

<#
.SYNOPSIS
List Usage Summaries
.DESCRIPTION
Fetch a paginated list of usage summaries. Default page is 0 and default size is 10. The maximum page size is 200
OpenAPI: GET /subscriptions/{subscriptionId}/usage-summaries
Scope: Partner. Audience: https://api.pax8.com.
.PARAMETER SubscriptionId
path parameter 'subscriptionId'.
.PARAMETER Page
The page number to request in the usage summaries list
.PARAMETER Size
Returns _this_ number of usage summaries per page
.PARAMETER Sort
Return usage summaries sorted by this field and direction Formatted as fieldName,direction - ex. sort=resourceGroup,desc Suggested values: resourceGroup, currentCharges, partnerTotal.
.PARAMETER ResourceGroup
Return only usage summaries matching this ```resourceGroup``` value
.PARAMETER CompanyId
Return only usage summaries with this ```companyId``` value
.PARAMETER Direction
Optional sort direction. When provided, the module sends sort as field,direction.
.PARAMETER Raw
Returns the unmodified API response instead of unwrapping paginated content.
.EXAMPLE
Get-Pax8UsageSummary -SubscriptionId '00000000-0000-0000-0000-000000000000'
.LINK
https://devx.pax8.com/openapi/partner-endpoints.json
#>

function Get-Pax8UsageSummary {
    [CmdletBinding()]
    param (
        [Parameter(Mandatory = $true)]
        [guid]$SubscriptionId,

        [double]$Page,

        [ValidateRange(1, 200)]
        [double]$Size,

        [ValidateSet('resourceGroup', 'currentCharges', 'partnerTotal')]
        [string]$Sort,

        [string]$ResourceGroup,

        [guid]$CompanyId,

        [ValidateSet('asc', 'desc')]
        [string]$Direction,

        [switch]$All,

        [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 'Get-Pax8UsageSummaries' -Value 'Get-Pax8UsageSummary'