Model/Entitlementrecommendationassignrequest.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

Request body for assigning a set of entitlement recommendations to a reviewer.

.PARAMETER Items
The list of recommendation record IDs to assign.
.PARAMETER Assignee
No description available.
.OUTPUTS

Entitlementrecommendationassignrequest<PSCustomObject>
#>


function Initialize-Entitlementrecommendationassignrequest {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String[]]
        ${Items},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Assignee}
    )

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

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

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


        $PSO = [PSCustomObject]@{
            "items" = ${Items}
            "assignee" = ${Assignee}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to Entitlementrecommendationassignrequest<PSCustomObject>

.DESCRIPTION

Convert from JSON to Entitlementrecommendationassignrequest<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

Entitlementrecommendationassignrequest<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in Entitlementrecommendationassignrequest
        $AllProperties = ("items", "assignee")
        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 'items' missing."
        }

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

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

        $PSO = [PSCustomObject]@{
            "items" = ${Items}
            "assignee" = ${Assignee}
        }

        return $PSO
    }

}