Model/Privilegedrecommendationinstance.ps1

#
# Identity Security Cloud API - Suggested Entitlement Description
# 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

An individual entitlement instance within a privileged recommendation group.

.PARAMETER Id
The unique identifier for this entitlement instance.
.PARAMETER Attribute
The entitlement attribute name.
.PARAMETER SourceId
The ID of the source that owns this entitlement.
.PARAMETER SourceName
The display name of the source.
.PARAMETER Type
The entitlement type.
.PARAMETER Value
The entitlement value or distinguished name.
.PARAMETER Status
The current review status of this instance.
.PARAMETER PrivilegeLevel
The currently assigned privilege level, if any.
.PARAMETER Description
The current description of the entitlement, if one exists.
.PARAMETER RecommendedAt
The timestamp when this instance was recommended.
.OUTPUTS

Privilegedrecommendationinstance<PSCustomObject>
#>


function Initialize-Privilegedrecommendationinstance {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Attribute},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SourceId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SourceName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Type},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Value},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Status},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${PrivilegeLevel},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Description},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${RecommendedAt}
    )

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


        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "attribute" = ${Attribute}
            "sourceId" = ${SourceId}
            "sourceName" = ${SourceName}
            "type" = ${Type}
            "value" = ${Value}
            "status" = ${Status}
            "privilegeLevel" = ${PrivilegeLevel}
            "description" = ${Description}
            "recommendedAt" = ${RecommendedAt}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to Privilegedrecommendationinstance<PSCustomObject>

.DESCRIPTION

Convert from JSON to Privilegedrecommendationinstance<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

Privilegedrecommendationinstance<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in Privilegedrecommendationinstance
        $AllProperties = ("id", "attribute", "sourceId", "sourceName", "type", "value", "status", "privilegeLevel", "description", "recommendedAt")
        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 "id"))) { #optional property not found
            $Id = $null
        } else {
            $Id = $JsonParameters.PSobject.Properties["id"].value
        }

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

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

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

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "attribute" = ${Attribute}
            "sourceId" = ${SourceId}
            "sourceName" = ${SourceName}
            "type" = ${Type}
            "value" = ${Value}
            "status" = ${Status}
            "privilegeLevel" = ${PrivilegeLevel}
            "description" = ${Description}
            "recommendedAt" = ${RecommendedAt}
        }

        return $PSO
    }

}