v2024/src/PSSailpoint.V2024/Model/AccessRequestRecommendationConfigDto.ps1

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

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

No description available.

.PARAMETER ScoreThreshold
The value that internal calculations need to exceed for recommendations to be made.
.PARAMETER StartDateAttribute
Use to map an attribute name for determining identities' start date.
.PARAMETER RestrictionAttribute
Use to only give recommendations based on this attribute.
.PARAMETER MoverAttribute
Use to map an attribute name for determining whether identities are movers.
.PARAMETER JoinerAttribute
Use to map an attribute name for determining whether identities are joiners.
.PARAMETER UseRestrictionAttribute
Use only the attribute named in restrictionAttribute to make recommendations.
.OUTPUTS

AccessRequestRecommendationConfigDto<PSCustomObject>
#>


function Initialize-V2024AccessRequestRecommendationConfigDto {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [Double]
        ${ScoreThreshold},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${StartDateAttribute},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${RestrictionAttribute},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${MoverAttribute},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${JoinerAttribute},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${UseRestrictionAttribute} = $false
    )

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

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


        $PSO = [PSCustomObject]@{
            "scoreThreshold" = ${ScoreThreshold}
            "startDateAttribute" = ${StartDateAttribute}
            "restrictionAttribute" = ${RestrictionAttribute}
            "moverAttribute" = ${MoverAttribute}
            "joinerAttribute" = ${JoinerAttribute}
            "useRestrictionAttribute" = ${UseRestrictionAttribute}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to AccessRequestRecommendationConfigDto<PSCustomObject>

.DESCRIPTION

Convert from JSON to AccessRequestRecommendationConfigDto<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

AccessRequestRecommendationConfigDto<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in V2024AccessRequestRecommendationConfigDto
        $AllProperties = ("scoreThreshold", "startDateAttribute", "restrictionAttribute", "moverAttribute", "joinerAttribute", "useRestrictionAttribute")
        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 'scoreThreshold' missing."
        }

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "scoreThreshold" = ${ScoreThreshold}
            "startDateAttribute" = ${StartDateAttribute}
            "restrictionAttribute" = ${RestrictionAttribute}
            "moverAttribute" = ${MoverAttribute}
            "joinerAttribute" = ${JoinerAttribute}
            "useRestrictionAttribute" = ${UseRestrictionAttribute}
        }

        return $PSO
    }

}