v2025/src/PSSailpoint.V2025/Model/ApprovalConfig.ps1

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

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

Approval config Object

.PARAMETER TenantId
Tenant ID of the approval configuration.
.PARAMETER Id
ID of the approval configuration.
.PARAMETER Scope
The type/scope of the configuration. Ie DOMAIN_OBJECT, APPROVAL_TYPE, TENANT
.PARAMETER ReminderConfig
No description available.
.PARAMETER EscalationConfig
No description available.
.PARAMETER TimeoutConfig
No description available.
.PARAMETER CronTimezone
No description available.
.PARAMETER SerialChain
If the approval request has an approvalCriteria of SERIAL this chain will be used to determine the assignment order.
.PARAMETER RequiresComment
Determines whether a comment is required when approving or rejecting the approval request.
.PARAMETER FallbackApprover
Configuration for fallback approver. Used if the user cannot be found for whatever reason and escalation config does not exist.
.PARAMETER AutoApprove
OFF will prevent the approval request from being assigned to the requester or requestee by assigning it to their manager instead. DIRECT will cause approval requests to be auto-approved when assigned directly and only to the requester. INDIRECT will auto-approve when the requester appears anywhere in the list of approvers, including in a governance group. This field will only be effective if requestedTarget.reauthRequired is set to false, otherwise the approval will have to be manually approved.
.OUTPUTS

ApprovalConfig<PSCustomObject>
#>


function Initialize-V2025ApprovalConfig {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${TenantId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Scope},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${ReminderConfig},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${EscalationConfig},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${TimeoutConfig},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${CronTimezone},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${SerialChain},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("APPROVAL", "REJECTION", "ALL", "OFF")]
        [String]
        ${RequiresComment},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${FallbackApprover},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("OFF", "DIRECT", "INDIRECT")]
        [String]
        ${AutoApprove}
    )

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


        $PSO = [PSCustomObject]@{
            "tenantId" = ${TenantId}
            "id" = ${Id}
            "scope" = ${Scope}
            "reminderConfig" = ${ReminderConfig}
            "escalationConfig" = ${EscalationConfig}
            "timeoutConfig" = ${TimeoutConfig}
            "cronTimezone" = ${CronTimezone}
            "serialChain" = ${SerialChain}
            "requiresComment" = ${RequiresComment}
            "fallbackApprover" = ${FallbackApprover}
            "autoApprove" = ${AutoApprove}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to ApprovalConfig<PSCustomObject>

.DESCRIPTION

Convert from JSON to ApprovalConfig<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

ApprovalConfig<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in V2025ApprovalConfig
        $AllProperties = ("tenantId", "id", "scope", "reminderConfig", "escalationConfig", "timeoutConfig", "cronTimezone", "serialChain", "requiresComment", "fallbackApprover", "autoApprove")
        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 "tenantId"))) { #optional property not found
            $TenantId = $null
        } else {
            $TenantId = $JsonParameters.PSobject.Properties["tenantId"].value
        }

        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 "scope"))) { #optional property not found
            $Scope = $null
        } else {
            $Scope = $JsonParameters.PSobject.Properties["scope"].value
        }

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

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

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "tenantId" = ${TenantId}
            "id" = ${Id}
            "scope" = ${Scope}
            "reminderConfig" = ${ReminderConfig}
            "escalationConfig" = ${EscalationConfig}
            "timeoutConfig" = ${TimeoutConfig}
            "cronTimezone" = ${CronTimezone}
            "serialChain" = ${SerialChain}
            "requiresComment" = ${RequiresComment}
            "fallbackApprover" = ${FallbackApprover}
            "autoApprove" = ${AutoApprove}
        }

        return $PSO
    }

}