Pax8API/Public/Partner/Get-Pax8Contact.ps1

<#
.SYNOPSIS
List Contacts
.DESCRIPTION
Returns a paginated list of contacts ordered by ```createDate``` descending
OpenAPI: GET /companies/{companyId}/contacts
Scope: Partner. Audience: https://api.pax8.com.
.PARAMETER Page
The page number to request for in the contacts list
.PARAMETER Size
Return this number of company records per page
.PARAMETER CompanyId
path parameter 'companyId'.
.PARAMETER Raw
Returns the unmodified API response instead of unwrapping paginated content.
.EXAMPLE
Get-Pax8Contact -CompanyId '00000000-0000-0000-0000-000000000000'
.LINK
https://devx.pax8.com/openapi/partner-endpoints.json
#>

function Get-Pax8Contact {
    [CmdletBinding()]
    param (
        [double]$Page,

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

        [Parameter(Mandatory = $true)]
        [guid]$CompanyId,

        [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-Pax8Contacts' -Value 'Get-Pax8Contact'