Model/EntitlementRequestConfig1.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 AllowEntitlementRequest
If this is true, entitlement requests are allowed.
.PARAMETER RequestCommentsRequired
If this is true, comments are required to submit entitlement requests.
.PARAMETER DeniedCommentsRequired
If this is true, comments are required to reject entitlement requests.
.PARAMETER GrantRequestApprovalSchemes
Approval schemes for granting entitlement request. This can be empty if no approval is needed. Multiple schemes must be comma-separated. The valid schemes are ""entitlementOwner"", ""sourceOwner"", ""manager"" and ""workgroup:{id}"". You can use multiple governance groups (workgroups).
.OUTPUTS

EntitlementRequestConfig1<PSCustomObject>
#>


function Initialize-V2024EntitlementRequestConfig1 {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${AllowEntitlementRequest} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${RequestCommentsRequired} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${DeniedCommentsRequired} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${GrantRequestApprovalSchemes} = "sourceOwner"
    )

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


        $PSO = [PSCustomObject]@{
            "allowEntitlementRequest" = ${AllowEntitlementRequest}
            "requestCommentsRequired" = ${RequestCommentsRequired}
            "deniedCommentsRequired" = ${DeniedCommentsRequired}
            "grantRequestApprovalSchemes" = ${GrantRequestApprovalSchemes}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to EntitlementRequestConfig1<PSCustomObject>

.DESCRIPTION

Convert from JSON to EntitlementRequestConfig1<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

EntitlementRequestConfig1<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in V2024EntitlementRequestConfig1
        $AllProperties = ("allowEntitlementRequest", "requestCommentsRequired", "deniedCommentsRequired", "grantRequestApprovalSchemes")
        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 "allowEntitlementRequest"))) { #optional property not found
            $AllowEntitlementRequest = $null
        } else {
            $AllowEntitlementRequest = $JsonParameters.PSobject.Properties["allowEntitlementRequest"].value
        }

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

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

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

        $PSO = [PSCustomObject]@{
            "allowEntitlementRequest" = ${AllowEntitlementRequest}
            "requestCommentsRequired" = ${RequestCommentsRequired}
            "deniedCommentsRequired" = ${DeniedCommentsRequired}
            "grantRequestApprovalSchemes" = ${GrantRequestApprovalSchemes}
        }

        return $PSO
    }

}