v2025/src/PSSailpoint.V2025/Model/PrivilegeCriteriaDTOGroupsInnerCriteriaItemsInner.ps1

#
# Identity Security Cloud V2025 API
# 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: v2025
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

No description available.

.PARAMETER TargetType
The target type for the criteria item.
.PARAMETER Operator
The operator to apply to the property and values.
.PARAMETER Property
No description available.
.PARAMETER Values
The values to evaluate the property against.
.PARAMETER IgnoreCase
Whether to ignore case when evaluating the property against the values.
.OUTPUTS

PrivilegeCriteriaDTOGroupsInnerCriteriaItemsInner<PSCustomObject>
#>


function Initialize-V2025PrivilegeCriteriaDTOGroupsInnerCriteriaItemsInner {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("group")]
        [String]
        ${TargetType},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("IN", "EQUALS", "NOT_EQUALS", "CONTAINS", "DOES_NOT_CONTAIN", "STARTS_WITH", "ENDS_WITH")]
        [String]
        ${Operator},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Property},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String[]]
        ${Values},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${IgnoreCase} = $false
    )

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

        if (!$Values -and $Values.length -gt 50) {
            throw "invalid value for 'Values', number of items must be less than or equal to 50."
        }

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


        $PSO = [PSCustomObject]@{
            "targetType" = ${TargetType}
            "operator" = ${Operator}
            "property" = ${Property}
            "values" = ${Values}
            "ignoreCase" = ${IgnoreCase}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to PrivilegeCriteriaDTOGroupsInnerCriteriaItemsInner<PSCustomObject>

.DESCRIPTION

Convert from JSON to PrivilegeCriteriaDTOGroupsInnerCriteriaItemsInner<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

PrivilegeCriteriaDTOGroupsInnerCriteriaItemsInner<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in V2025PrivilegeCriteriaDTOGroupsInnerCriteriaItemsInner
        $AllProperties = ("targetType", "operator", "property", "values", "ignoreCase")
        foreach ($name in $JsonParameters.PsObject.Properties.Name) {
            if (!($AllProperties.Contains($name))) {
                throw "Error! JSON key '$name' not found in the properties: $($AllProperties)"
            }
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "targetType"))) { #optional property not found
            $TargetType = $null
        } else {
            $TargetType = $JsonParameters.PSobject.Properties["targetType"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "operator"))) { #optional property not found
            $Operator = $null
        } else {
            $Operator = $JsonParameters.PSobject.Properties["operator"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "property"))) { #optional property not found
            $Property = $null
        } else {
            $Property = $JsonParameters.PSobject.Properties["property"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "values"))) { #optional property not found
            $Values = $null
        } else {
            $Values = $JsonParameters.PSobject.Properties["values"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "ignoreCase"))) { #optional property not found
            $IgnoreCase = $null
        } else {
            $IgnoreCase = $JsonParameters.PSobject.Properties["ignoreCase"].value
        }

        $PSO = [PSCustomObject]@{
            "targetType" = ${TargetType}
            "operator" = ${Operator}
            "property" = ${Property}
            "values" = ${Values}
            "ignoreCase" = ${IgnoreCase}
        }

        return $PSO
    }

}