Pax8API/Public/Webhooks/Get-Pax8TopicDefinitions.ps1

<#
.SYNOPSIS
Get topic definitions
.DESCRIPTION
Get all available webhook subscription topic definitions and their filterable conditions
OpenAPI: GET /webhooks/topic-definitions
Scope: Webhooks. Audience: https://api.pax8.com.
.PARAMETER Page
query parameter 'page'.
.PARAMETER Size
query parameter 'size'.
.PARAMETER Search
query parameter 'search'.
.PARAMETER Sort
query parameter 'sort'.
.PARAMETER Topic
query parameter 'topic'.
.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-Pax8TopicDefinitions
.LINK
https://devx.pax8.com/openapi/webhooks-api.json
#>

function Get-Pax8TopicDefinitions {
    [CmdletBinding()]
    param (
        [int]$Page,

        [int]$Size,

        [string]$Search,

        [string]$Sort,

        [string]$Topic,

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