Public/Get-HibpDataClass.ps1

function Get-HibpDataClass {
    <#
        .SYNOPSIS
            Gets all data classes in the system.

        .DESCRIPTION
            Retrieves a list of all the data classes (e.g., "Email addresses", "Passwords") that are used to classify the data in a breach.

        .PARAMETER ApiKey
            Your HIBP API key. Can be used instead of saving the key with Save-HibpCredential.

        .EXAMPLE
            Get-HibpDataClass

            Returns all data classes used in the HIBP system.

        .LINK
            https://haveibeenpwned.com/API/v3#AllDataClasses
    #>


    [CmdletBinding()]
    Param(
        [string]$ApiKey
    )

    $invokeParams = @{
        Endpoint = 'dataclasses'
    }

    if ($PSBoundParameters.ContainsKey('ApiKey')) {
        $invokeParams.ApiKey = $ApiKey
    }

    Invoke-HibpRequest @invokeParams
}