Public/ServiceTypeIntegrationCodes/Get-AspireServiceTypeIntegrationCodes.ps1

<#
.SYNOPSIS
    Retrieves a list of service type integration codes from the Aspire API.
.DESCRIPTION
    Uses Invoke-AspireRequest to perform a GET request to the /ServiceTypeIntegrationCodes endpoint with support for OData query parameters.
.PARAMETER Filter
    Optional OData filter query (e.g., "ServiceTypeID eq 1").
.PARAMETER Top
    Optional number of records to return (integer).
.PARAMETER Skip
    Optional number of records to skip (integer).
.PARAMETER Select
    Optional comma-separated list of fields to include (e.g., "ServiceTypeIntegrationCodeID,Code").
.PARAMETER Expand
    Optional comma-separated list of related entities to expand (e.g., "ServiceType").
.PARAMETER OrderBy
    Optional comma-separated list of fields to order by (e.g., "Code asc").
.OUTPUTS
    The response from the API containing the list of service type integration codes.
.EXAMPLE
    Get-AspireServiceTypeIntegrationCodes -Filter "Active eq true" -Top 10
#>

function Get-AspireServiceTypeIntegrationCodes {
    [CmdletBinding()]
    param(
        [string]$Filter = $null,
        [int]$Top = $null,
        [int]$Skip = $null,
        [string]$Select = $null,
        [string]$Expand = $null,
        [string]$OrderBy = $null
    )

    $queryParams = @{}
    if ($Filter) {
        $queryParams['$filter'] = $Filter
    }
    if ($Top) {
        $queryParams['$top'] = $Top
    }
    if ($Skip) {
        $queryParams['$skip'] = $Skip
    }
    if ($Select) {
        $queryParams['$select'] = $Select
    }
    if ($Expand) {
        $queryParams['$expand'] = $Expand
    }
    if ($OrderBy) {
        $queryParams['$orderby'] = $OrderBy
    }

    return Invoke-AspireRequest -Method GET -Path "/ServiceTypeIntegrationCodes" -QueryParams $queryParams -ApiVersion $null
}