Model/PublicIdentitiesSearchRequestQuerySet.ps1

#
# Identity Security Cloud API - Public Identities
# Use these APIs to interact with the Identity Security Cloud platform to achieve repeatable, automated processes with greater scalability. We encourage you to join the SailPoint Developer Community forum at https://developer.sailpoint.com/discuss to connect with other developers using our APIs.
# Version: v1
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

No description available.

.PARAMETER MatchAny
When true, entries are OR'd; when false, entries are AND'd.
.PARAMETER Entries
One or more TEXT or nested COMPOSITE entries.
.OUTPUTS

PublicIdentitiesSearchRequestQuerySet<PSCustomObject>
#>


function Initialize-PublicIdentitiesSearchRequestQuerySet {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [Boolean]
        ${MatchAny},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Entries}
    )

    Process {
        'Creating PSCustomObject: PSSailpoint.PublicIdentities => PublicIdentitiesSearchRequestQuerySet' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        if (!$MatchAny) {
            throw "invalid value for 'MatchAny', 'MatchAny' cannot be null."
        }

        if (!$Entries) {
            throw "invalid value for 'Entries', 'Entries' cannot be null."
        }

        if ($Entries.length -lt 1) {
            throw "invalid value for 'Entries', number of items must be greater than or equal to 1."
        }


        $PSO = [PSCustomObject]@{
            "matchAny" = ${MatchAny}
            "entries" = ${Entries}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to PublicIdentitiesSearchRequestQuerySet<PSCustomObject>

.DESCRIPTION

Convert from JSON to PublicIdentitiesSearchRequestQuerySet<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

PublicIdentitiesSearchRequestQuerySet<PSCustomObject>
#>

function ConvertFrom-JsonToPublicIdentitiesSearchRequestQuerySet {
    Param(
        [AllowEmptyString()]
        [string]$Json
    )

    Process {
        'Converting JSON to PSCustomObject: PSSailpoint.PublicIdentities => PublicIdentitiesSearchRequestQuerySet' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in PublicIdentitiesSearchRequestQuerySet
        $AllProperties = ("matchAny", "entries")
        foreach ($name in $JsonParameters.PsObject.Properties.Name) {
            if (!($AllProperties.Contains($name))) {
                throw "Error! JSON key '$name' not found in the properties: $($AllProperties)"
            }
        }

        If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json
            throw "Error! Empty JSON cannot be serialized due to the required property 'matchAny' missing."
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "matchAny"))) {
            throw "Error! JSON cannot be serialized due to the required property 'matchAny' missing."
        } else {
            $MatchAny = $JsonParameters.PSobject.Properties["matchAny"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "entries"))) {
            throw "Error! JSON cannot be serialized due to the required property 'entries' missing."
        } else {
            $Entries = $JsonParameters.PSobject.Properties["entries"].value
        }

        $PSO = [PSCustomObject]@{
            "matchAny" = ${MatchAny}
            "entries" = ${Entries}
        }

        return $PSO
    }

}