Public/Get-GCGdprSubjects.ps1

<#
.SYNOPSIS
    Retrieves GDPR subjects.

.DESCRIPTION
    Searches for GDPR subjects matching the specified criteria in Genesys Cloud.
    Uses the GET /api/v2/gdpr/subjects endpoint.

.PARAMETER SearchType
    The type of search to perform (e.g., NAME, PHONE_NUMBER, EMAIL).

.PARAMETER SearchValue
    The value to search for.

.EXAMPLE
    Get-GCGdprSubjects -SearchType 'EMAIL' -SearchValue 'user@example.com'

.NOTES
    Genesys Cloud API: GET /api/v2/gdpr/subjects
#>

function Get-GCGdprSubjects {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory = $true)]
        [string]$SearchType,

        [Parameter(Mandatory = $true)]
        [string]$SearchValue
    )

    $endpoint = "gdpr/subjects"
    $queryParams = @{
        searchType  = $SearchType
        searchValue = $SearchValue
    }

    return Invoke-GCApiRequest -Endpoint $endpoint -Method GET -QueryParameters $queryParams
}