beta/src/PSSailpointBeta/Model/RecommendationResponse.ps1

#
# IdentityNow Beta API
# Use these APIs to interact with the IdentityNow platform to achieve repeatable, automated processes with greater scalability. These APIs are in beta and are subject to change. 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: 3.1.0-beta
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

No description available.

.PARAMETER Request
No description available.
.PARAMETER Recommendation
The recommendation - YES if the access is recommended, NO if not recommended, MAYBE if there is not enough information to make a recommendation, NOT_FOUND if the identity is not found in the system
.PARAMETER Interpretations
The list of interpretations explaining the recommendation. The array is empty if includeInterpretations is false or not present in the request. e.g. - [ ""Not approved in the last 6 months."" ]. Interpretations will be translated using the client's locale as found in the Accept-Language header. If a translation for the client's locale cannot be found, the US English translation will be returned.
.PARAMETER TranslationMessages
The list of translation messages, if they have been requested.
.PARAMETER RecommenderCalculations
No description available.
.OUTPUTS

RecommendationResponse<PSCustomObject>
#>


function Initialize-BetaRecommendationResponse {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Request},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("true", "false", "MAYBE", "NOT_FOUND")]
        [String]
        ${Recommendation},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String[]]
        ${Interpretations},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${TranslationMessages},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${RecommenderCalculations}
    )

    Process {
        'Creating PSCustomObject: PSSailpointBeta => BetaRecommendationResponse' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug


        $PSO = [PSCustomObject]@{
            "request" = ${Request}
            "recommendation" = ${Recommendation}
            "interpretations" = ${Interpretations}
            "translationMessages" = ${TranslationMessages}
            "recommenderCalculations" = ${RecommenderCalculations}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to RecommendationResponse<PSCustomObject>

.DESCRIPTION

Convert from JSON to RecommendationResponse<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

RecommendationResponse<PSCustomObject>
#>

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

    Process {
        'Converting JSON to PSCustomObject: PSSailpointBeta => BetaRecommendationResponse' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in BetaRecommendationResponse
        $AllProperties = ("request", "recommendation", "interpretations", "translationMessages", "recommenderCalculations")
        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 "request"))) { #optional property not found
            $Request = $null
        } else {
            $Request = $JsonParameters.PSobject.Properties["request"].value
        }

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

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

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

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

        $PSO = [PSCustomObject]@{
            "request" = ${Request}
            "recommendation" = ${Recommendation}
            "interpretations" = ${Interpretations}
            "translationMessages" = ${TranslationMessages}
            "recommenderCalculations" = ${RecommenderCalculations}
        }

        return $PSO
    }

}