v2026/src/PSSailpoint.V2026/Model/EntitlementPrivilegeLevel.ps1

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

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

No description available.

.PARAMETER Direct
Direct privilege level assigned to the entitlement
.PARAMETER SetBy
User or process that set the privilege level
.PARAMETER SetByType
Method by which the privilege level was set
.PARAMETER Inherited
Inherited privilege level on the entitlement, if any
.PARAMETER Effective
Effective privilege level assigned to the entitlement
.OUTPUTS

EntitlementPrivilegeLevel<PSCustomObject>
#>


function Initialize-V2026EntitlementPrivilegeLevel {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("HIGH", "LOW", "MEDIUM", "NONE")]
        [String]
        ${Direct},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SetBy},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("OVERRIDE", "CUSTOM_CRITERIA", "CONNECTOR_CRITERIA", "SINGLE_LEVEL_CRITERIA")]
        [String]
        ${SetByType},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("HIGH", "LOW", "MEDIUM", "NONE")]
        [String]
        ${Inherited},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("HIGH", "LOW", "MEDIUM", "NONE")]
        [String]
        ${Effective}
    )

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


        $PSO = [PSCustomObject]@{
            "direct" = ${Direct}
            "setBy" = ${SetBy}
            "setByType" = ${SetByType}
            "inherited" = ${Inherited}
            "effective" = ${Effective}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to EntitlementPrivilegeLevel<PSCustomObject>

.DESCRIPTION

Convert from JSON to EntitlementPrivilegeLevel<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

EntitlementPrivilegeLevel<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in V2026EntitlementPrivilegeLevel
        $AllProperties = ("direct", "setBy", "setByType", "inherited", "effective")
        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 "direct"))) { #optional property not found
            $Direct = $null
        } else {
            $Direct = $JsonParameters.PSobject.Properties["direct"].value
        }

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

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

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

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

        $PSO = [PSCustomObject]@{
            "direct" = ${Direct}
            "setBy" = ${SetBy}
            "setByType" = ${SetByType}
            "inherited" = ${Inherited}
            "effective" = ${Effective}
        }

        return $PSO
    }

}